All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Thomas <74cmonty@gmail.com>
Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org,
	"Andrew Baumann" <Andrew.Baumann@microsoft.com>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Peter Maydell" <peter.maydell@linaro.org>
Subject: Re: Emulate Rpi with QEMU fails
Date: Sun, 04 Oct 2020 18:44:09 +0100	[thread overview]
Message-ID: <87sgatanti.fsf@linaro.org> (raw)
In-Reply-To: <47dbcad4-3121-b1c3-06fa-abec7c353fb6@gmail.com>


Thomas <74cmonty@gmail.com> writes:

> Hi,
>
> I'm trying to emulate Rpi with QEMU.
> I found
> [url=1]this[/url]
> arcticle in Raspberry Pi Geek documenting the steps including persistent
> storage on host.
>
> However when starting the emulation with command
> qemu-system-arm -M versatilepb -cpu arm1176 -m 256 -serial stdio -hda
> 2020-08-20-raspios-buster-armhf-lite.img -net
> "user,hostfwd=tcp::5022-:22" -dtb versatile-pb-buster.dtb -kernel
> kernel-qemu-5.4.51-buster -append "root=/dev/sda2 rootfstype=ext4 rw
> panic=1" -no-reboot

Let's start with the fact you are using a versatilepb machine type with
a versatilepb dtb and not the rasppi model. The manual goes into more
details about why you can't generally share kernels built for one ARM
system on another:

  https://qemu.readthedocs.io/en/latest/system/target-arm.html

Since that article was written we have added models for the -M raspi2
and -M raspi3 which might work better with a kernel written for it
although the emulation isn't complete.

> I get this error:
> VFS: Cannot open root device "sda2" or unknown-block(0,0): error -6
> Please append a correct "root=" boot option; here are the available
> partitions:
> 0100            4096 ram0
>  (driver?)
> 0101            4096 ram1
>  (driver?)
> 0102            4096 ram2
>  (driver?)
> 0103            4096 ram3
>  (driver?)
> 0104            4096 ram4
>  (driver?)
> 0105            4096 ram5
>  (driver?)
> 0106            4096 ram6
>  (driver?)
> 0107            4096 ram7
>  (driver?)
> 0108            4096 ram8
>  (driver?)
> 0109            4096 ram9
>  (driver?)
> 010a            4096 ram10
>  (driver?)
> 010b            4096 ram11
>  (driver?)
> 010c            4096 ram12
>  (driver?)
> 010d            4096 ram13
>  (driver?)
> 010e            4096 ram14
>  (driver?)
> 010f            4096 ram15
>  (driver?)
> 1f00           65536 mtdblock0
>  (driver?)
> Kernel panic - not syncing: VFS: Unable to mount root fs on
> unknown-block(0,0)
>
> I assume this is related to the content in fstab of RaspiOS:
> proc            /proc           proc    defaults          0       0
> PARTUUID=907af7d0-01  /boot           vfat    defaults          0       2
> PARTUUID=907af7d0-02  /               ext4    defaults,noatime  0       1
>
> Can you please advise how to fix this error?
>
> THX


-- 
Alex Bennée

WARNING: multiple messages have this Message-ID (diff)
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Thomas <74cmonty@gmail.com>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	qemu-arm@nongnu.org, qemu-devel@nongnu.org,
	"Andrew Baumann" <Andrew.Baumann@microsoft.com>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>
Subject: Re: Emulate Rpi with QEMU fails
Date: Sun, 04 Oct 2020 18:44:09 +0100	[thread overview]
Message-ID: <87sgatanti.fsf@linaro.org> (raw)
In-Reply-To: <47dbcad4-3121-b1c3-06fa-abec7c353fb6@gmail.com>


Thomas <74cmonty@gmail.com> writes:

> Hi,
>
> I'm trying to emulate Rpi with QEMU.
> I found
> [url=1]this[/url]
> arcticle in Raspberry Pi Geek documenting the steps including persistent
> storage on host.
>
> However when starting the emulation with command
> qemu-system-arm -M versatilepb -cpu arm1176 -m 256 -serial stdio -hda
> 2020-08-20-raspios-buster-armhf-lite.img -net
> "user,hostfwd=tcp::5022-:22" -dtb versatile-pb-buster.dtb -kernel
> kernel-qemu-5.4.51-buster -append "root=/dev/sda2 rootfstype=ext4 rw
> panic=1" -no-reboot

Let's start with the fact you are using a versatilepb machine type with
a versatilepb dtb and not the rasppi model. The manual goes into more
details about why you can't generally share kernels built for one ARM
system on another:

  https://qemu.readthedocs.io/en/latest/system/target-arm.html

Since that article was written we have added models for the -M raspi2
and -M raspi3 which might work better with a kernel written for it
although the emulation isn't complete.

> I get this error:
> VFS: Cannot open root device "sda2" or unknown-block(0,0): error -6
> Please append a correct "root=" boot option; here are the available
> partitions:
> 0100            4096 ram0
>  (driver?)
> 0101            4096 ram1
>  (driver?)
> 0102            4096 ram2
>  (driver?)
> 0103            4096 ram3
>  (driver?)
> 0104            4096 ram4
>  (driver?)
> 0105            4096 ram5
>  (driver?)
> 0106            4096 ram6
>  (driver?)
> 0107            4096 ram7
>  (driver?)
> 0108            4096 ram8
>  (driver?)
> 0109            4096 ram9
>  (driver?)
> 010a            4096 ram10
>  (driver?)
> 010b            4096 ram11
>  (driver?)
> 010c            4096 ram12
>  (driver?)
> 010d            4096 ram13
>  (driver?)
> 010e            4096 ram14
>  (driver?)
> 010f            4096 ram15
>  (driver?)
> 1f00           65536 mtdblock0
>  (driver?)
> Kernel panic - not syncing: VFS: Unable to mount root fs on
> unknown-block(0,0)
>
> I assume this is related to the content in fstab of RaspiOS:
> proc            /proc           proc    defaults          0       0
> PARTUUID=907af7d0-01  /boot           vfat    defaults          0       2
> PARTUUID=907af7d0-02  /               ext4    defaults,noatime  0       1
>
> Can you please advise how to fix this error?
>
> THX


-- 
Alex Bennée


  reply	other threads:[~2020-10-04 17:44 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-03 11:45 Emulate Rpi with QEMU fails Thomas
2020-10-04 17:44 ` Alex Bennée [this message]
2020-10-04 17:44   ` Alex Bennée
2020-10-04 18:40   ` Peter Maydell
2020-10-04 18:40     ` Peter Maydell
2020-10-05  9:40     ` Alex Bennée
2020-10-05  9:40       ` Alex Bennée
2020-10-05 10:51       ` Thomas Schneider
2020-10-05 22:08         ` Paul Zimmerman
2020-10-05 22:08           ` Paul Zimmerman
2020-10-06  6:58           ` Thomas Schneider
2020-10-06  6:58             ` Thomas Schneider
2020-10-06  7:42             ` Paul Zimmerman
2020-10-06  7:42               ` Paul Zimmerman
2020-10-06  9:58             ` Alex Bennée
2020-10-06  9:58               ` Alex Bennée
2020-10-07  6:28               ` Thomas
2020-10-07  6:28                 ` Thomas
2020-10-07  6:50                 ` Paul Zimmerman
2020-10-07  6:50                   ` Paul Zimmerman
2020-10-07  7:27                   ` Thomas Schneider
2020-10-07  7:27                     ` Thomas Schneider
2020-10-07 11:00                     ` Alex Bennée
2020-10-07 11:00                       ` Alex Bennée
2020-10-07 11:36                       ` Thomas Schneider
2020-10-07 11:36                         ` Thomas Schneider
2020-10-07 12:02                         ` Alex Bennée
2020-10-07 12:02                           ` Alex Bennée
2020-10-08  7:00                           ` Thomas
2020-10-08  7:00                             ` Thomas
2020-10-08 21:07                             ` Paul Zimmerman
2020-10-08 21:07                               ` Paul Zimmerman
2020-10-09  2:21                               ` Paul Zimmerman
2020-10-09  2:21                                 ` Paul Zimmerman
2020-10-09  6:20                             ` Alex Bennée
2020-10-09  6:20                               ` Alex Bennée

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sgatanti.fsf@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=74cmonty@gmail.com \
    --cc=Andrew.Baumann@microsoft.com \
    --cc=f4bug@amsat.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.