On 8/15/24 23:13, Philippe Mathieu-Daudé wrote:
Hi Paul,
On 15/8/24 23:23, Paul Menzel wrote:
Dear QEMU folks,
I would like to boot a Linux kernel image several times, and log the output –
case in point [1] it would be booting with `initcall_debug`, and look at how
long `acpi_init()` took to execute.
I came up with
qemu-system-x86_64 -enable-kvm -smp cpus=2 -m 1G -nographic -kernel
/boot/vmlinuz-6.11.0-rc3-00007-gd74da846046a -append "initcall_debug
console=ttyS0"
but it hangs, as no bootable image is found. There are probably a lot of ways
to reboot it (initrd, wrapper script, …). What is the “easiest” way?
Guenter uses QEMU with "-no-reboot -append 'panic=-1 noreboot'"
for the linux-build-test suite:
https://github.com/groeck/linux-build-test
You should see on the console:
reboot: Restarting system
Also, I don't use kvm, even on x86/x86_64 because I want to simulate as many
CPUs as possible. I don't understand "no bootable image is found". Presumable,
/boot/vmlinuz-xxx is a bootable image; it boots for me on my system. I would not
expect the command line to work, though, since neither a root file system nor an
initrd is provided, so, yes, it crashes with
VFS: Cannot open root device "" or unknown-block(0,0): error -6
but of course that is as expected.
Regarding root file system - really anything does. I build my own minimal root
file systems using buildroot. Those can be downloaded from github if needed.
They can not be used to boot images from /boot since those depend on the
matching initrd in the same directory and the matching root file system.
However, booting kernels from /boot using my initrd images does work, at least
on my system. The initrd images on the github side are the .cpio images in case
you want to give it a try. Just download rootfs.cpio.gz, decompress it, and
add "-initrd rootfs.cpio" to your qemu command line.
Guenter