2

I'm trying to cross compile a Debian system for ARM. I have a working cross compiler setup, and I can run programs under a Debian system I installed in QEMU. I'm using a virtual disk (qcow2 format) and separate kernel and initramfs images (on the host) which I provide as command line options to QEMU.

When I boot using a precompiled Debian kernel, everything works and the system boots off of the /dev/vda1 partition of /dev/vda* which I surmise is the virtual disk device created by QEMU from the qcow2 disk image.

However when I take the Debian kernel sources (downloaded within the guest system to ensure I get the right sources for that system and Debian version, then copied to host), and cross-compile them on my host system, the kernel this produced boots only as far as busybox in the initramfs. At that point it fails to find a root device because no /dev/vda* devices exist. (There are not any /dev/sd*, /dev/hd*, etc. devices either.)

What is my kernel missing that the QEMU virtual disk device is not seen at all? (QEMU was given the exact same commandline; only difference is which kernel image file name.) Have I misconfigured something when building the kernel? (For default settings I actually started with a Debian kernel config file grabbed from within the /boot folder of the guest system.)

Debian version (guest) is 8.11 (jessie). Linux kernel version is 3.16.0.6-armmp-lpae.

My QEMU commandline looks like:

qemu-system-arm -M virt -m 1024 -kernel <the kernel image file> -initrd initrd.img-3.16.0-6-armmp-lpae -append 'root=/dev/vda2' -drive if=none,file=hda.qcow2,format=qcow2,id=hd -device virtio-blk-device,drive=hd -netdev user,id=mynet -device virtio-net-device,netdev=mynet -nographic

1 Answer 1

1

You probably need — at the very least — the following kernel configuration:

CONFIG_BLOCK=y
CONFIG_BLK_DEV=y
CONFIG_DEVTMPFS=y
CONFIG_VIRTIO_MENU=y
CONFIG_VIRTIO_BLK=y

Then mount devtmpfs to /dev in your initrd and you should get a /dev/vda.

CONFIG_VIRTIO_MENU is apparently required if you use tinyconfig, even though it's on by default.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .