Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QEMU localboot cannot see block devices #38

Open
aroobam opened this issue Dec 2, 2019 · 3 comments
Open

QEMU localboot cannot see block devices #38

aroobam opened this issue Dec 2, 2019 · 3 comments

Comments

@aroobam
Copy link

aroobam commented Dec 2, 2019

Hi team,
I got the complete build instructions working and able to run in qemu. I get as far as the "Systemboot" text art and then a boot loop starts. First fbnetboot is tried ( I don't have network configured ) and then sit0 and then localboot, which I am trying to get to work, by attaching an .iso as a cdrom device to the qemu command line.

madhan@madhan-HP-Notebook:~/coreboot$ sudo qemu-system-x86_64 -M q35 -enable-kvm -bios build/coreboot.rom -m 1024 -object rng-random,filename=/dev/urandom,id=rng0 -vga cirrus --serial /dev/tty -cdrom ./ubuntu-18.04.3-live-server-amd64.iso

However it seems like no block devices are seen. I tried attaching a scsi device, a block device and an usb device (all qcow2 image files that I could get to work in "HEADS" earlier) but same result. Also the uroot shell does not have lspci, lsmod, insmod etc. and so I am not able to look at the devices enumerated. But firstly, how do I know the tinylinux payload that we built got control or not? Should we dig into this on the uroot side or the tinylinux side? Any pointers please?

2019/12/02 16:02:19 Running boot command: [localboot -grub -d]
2019/12/02 16:02:19 Getting list of supported filesystems
2019/12/02 16:02:19 Supported file systems: [ext3 ext2 ext4 iso9660 udf]
2019/12/02 16:02:19 trying to mount all the available block devices with all the supported file system types
2019/12/02 16:02:19 mounted: []
2019/12/02 16:02:19 No boot configuration found
2019/12/02 16:02:19 Error executing &{/bbin/localboot [localboot -grub -d] []  <nil> 0xc00000e020 0xc00000e028 [] <nil> 0xc0000db2f0 exit status 1 <nil> <nil> true [0xc00000e148 0xc00000e020 0xc00000e028] [0xc00000e148] [] [] 0xc0000708a0 <nil>}: exit status 1

Thanks,
Madhan

@JulienVdG
Copy link
Contributor

Hello, I've not tried to run your case however when I did first try an iso with the -cdrom option of qemu I found that my kernel configuration missed CONFIG_BLK_DEV_SR=y.

JulienVdG/test-linuxboot-buildroot@30a207f

Another point is that localboot does only parse grub config not syslinux (isolinux) so if your CD does not have a grub config, localboot will not find it (but I guess it should at list display the block devices it found)

Hope this helps,
Julien VdG

@rjoleary
Copy link
Member

rjoleary commented Dec 6, 2019

This is a bit of a shot in the dark, but for a raw block device, I've had success with this in the past:

Arguments to qemu (where FILENAME is a file on the host):

-drive file=rw:FILENAME,if=none,id=disk -device ich9-ahci,id=ahci -device ide-drive,drive=disk,bus=ahci.0

Config options for the kernel:

CONFIG_BLOCK=y
CONFIG_ATA=y
CONFIG_SATA_AHCI=y
CONFIG_BLK_DEV_SD=y

In the kernel, the block device should be /dev/sda

@aroobam
Copy link
Author

aroobam commented Dec 11, 2019

Got the CD-ROM boot to work. Tried some qcow2 images with SCSI boot. Did not work, though the device is identified. Will did in a little more and update. Guess it is an image format / grub compatibility thing.
Thanks guys!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants