From: "Gabriel L. Somlo" <gsomlo@gmail.com>
To: "Richard W.M. Jones" <rjones@redhat.com>
Cc: lersek@redhat.com, qemu-devel@nongnu.org
Subject: [Qemu-devel] qemu-system-arm command line question
Date: Fri, 2 Oct 2015 14:15:20 -0400 [thread overview]
Message-ID: <20151002181519.GA1977@HEDWIG.INI.CMU.EDU> (raw)
Hi Rich,
On Tue, Jul 14, 2015 at 07:48:30PM +0100, Richard W.M. Jones wrote:
> On Tue, Jul 14, 2015 at 02:23:14PM -0400, Gabriel L. Somlo wrote:
> > On Tue, Jul 14, 2015 at 10:43:46AM +0100, Richard W.M. Jones wrote:
> > > On Mon, Jul 13, 2015 at 04:09:37PM -0400, Gabriel L. Somlo wrote:
> > > > 3. I'm currently only handling x86 and I/O ports. I could drop the
> > > > fw_cfg_dmi_whitelist and just check the signature, using mmio where
> > > > appropriate, but I don't have a handy-dandy set of VMs for those
> > > > architectures on which I could test. Wondering if that's something
> > > > we should have before I officially try to submit this to the kernel,
> > > > or whether it could wait for a second iteration.
> > >
> > > $ virt-builder --arch armv7l fedora-22
> > > or:
> > > $ virt-builder --arch aarch64 fedora-22
> > > then:
> > > $ virt-builder --get-kernel fedora-22.img
> > >
> > > and then boot is using the right qemu command, probably something
> > > like:
> > >
> > > $ qemu-system-arm \
> > > -M virt,accel=tcg \
> > > -cpu cortex-a15 \
> > > -kernel vmlinuz-4.0.4-301.fc22.armv7hl+lpae \
> > > -initrd initramfs-4.0.4-301.fc22.armv7hl+lpae.img \
> > > -append "console=ttyAMA0 root=/dev/vda3 ro" \
> > > -drive file=fedora-22.img,if=none,id=hd \
> > > -device virtio-blk-device,drive=hd \
> > > -serial stdio
> > >
> > > The root password is printed in virt-builder output.
> >
> > Thanks, that should help (once I figure out how to *really* start it,
> > right now it hangs at "reached target basic system", and spews garbage
> > if I hit 'escape', probably in an attempt to paint the text-mode
> > progress bar... Then it throws me into a dracut prompt, complaining
> > that it can't find /dev/vda3...
> >
> > But I'm sure I'll sort it out eventually :)
>
> That error, as I guess you know, indicates that the disk image is not
> being presented as virtio-blk to the guest. I know for sure (because
> I tested the command line above earlier) that the armv7l guest can see
> virtio-blk. I didn't test the aarch64 guest.
Eventually, I got 32-bit arm working like this:
bin/qemu-system-arm -M virt,accel=tcg -m 1024 -cpu cortex-a15 \
-kernel ./vmlinuz-4.0.4-301.fc22.armv7hl+lpae \
-initrd ./initramfs-4.0.4-301.fc22.armv7hl+lpae.img \
-append "console=ttyAMA0 root=/dev/vda3 ro" \
-device virtio-blk-device,drive=hd0 \
-drive id=hd0,if=none,snapshot=on,file=./fedora-22.armv7hl+lpae.img \
-device virtio-net-device,netdev=usernet \
-netdev user,id=usernet \
-monitor stdio
But now I need to tinker with aarch64, so I went back to your original
instructions and did the following:
LIBGUESTFS_BACKEND=direct virt-builder --arch aarch64 fedora-22
LIBGUESTFS_BACKEND=direct virt-builder --get-kernel fedora-22.img
mv fedora-22.img fedora-22.aarch64.img
Trying to adapt the command line used with 32-bit arm, I ran:
bin/qemu-system-aarch64 -M virt,accel=tcg -m 2048 -cpu cortex-a57 \
-kernel ./vmlinuz-4.0.4-301.fc22.aarch64 \
-initrd ./initramfs-4.0.4-301.fc22.aarch64.img \
-append "console=ttyAMA0 root=/dev/vda3 ro" \
-device virtio-blk-device,drive=hd0 \
-drive id=hd0,if=none,snapshot=on,file=./fedora-22.aarch64.img \
-device virtio-net-device,netdev=usernet \
-netdev user,id=usernet \
-monitor stdio
and now I'm back to the guest dumping me into a dracut prompt after
complaining about "/dev/vda3 does not exist".
I tried guestfish at Laszlo's suggestion, and
guestfish --ro -i -a ./fedora-22.aarch64.img
gives me the following:
/dev/sda4 mounted on /
/dev/sda2 mounted on /boot
/dev/sda1 mounted on /boot/efi
I then tried to modify the command line above to use:
--append "console=ttyAMA0 root=/dev/vda4 ro"
--append "console=ttyAMA0 root=/dev/sda4 ro"
with no luck whatsoever.
Your original advice seemed to hint at the possibility of an issue
with using "virtio-blk-device" on aarch64, so I'm wondering what
else I could try, and, more interestingly, what the process of
determining that might be, starting with just being handed a
"fedora-22.img" file by virt-builder...
Digging through /etc/grub2-efi.cfg with guestfish, I found the menu
entry for Fedora, and it looks like this:
...
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 578e2ae7-957d-449a-930f-94478154137f
else
search --no-floppy --fs-uuid --set=root 578e2ae7-957d-449a-930f-94478154137f
fi
linux /vmlinuz-4.0.4-301.fc22.aarch64 root=UUID=629b6e0b-aaea-475a-b383-4beca36425c4 ro no_timer_check earlyprintk=pl011,0x9000000 ignore_loglevel rd_NO_PLYMOUTH console=ttyAMA0 printk.time=1 LANG=en_US.UTF-8
...
So I tried
-append "console=ttyAMA0 root=/dev/sda4 ro"
-device ahci,id=ide \
-device ide-drive,bus=ide.0,drive=hd0 \
-drive id=hd0,if=none,snapshot=on,file=./fedora-22.aarch64.img \
and still nothing, same "/dev/sda4 does not exist"...
There are no /dev/vda* or /dev/sda* devices (ls /dev/ from the dracut
prompt), and cat /proc/partitions comes up empty as well...
At this point I'm totally out of clue, please help :)
Thanks a ton,
--Gabriel
next reply other threads:[~2015-10-02 18:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-02 18:15 Gabriel L. Somlo [this message]
2015-10-02 18:37 ` [Qemu-devel] qemu-system-arm command line question Richard W.M. Jones
2015-10-02 18:57 ` Gabriel L. Somlo
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=20151002181519.GA1977@HEDWIG.INI.CMU.EDU \
--to=gsomlo@gmail.com \
--cc=lersek@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rjones@redhat.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).