Issue
I have compiled the linux kernel (stable) from the tree and got the initrd and bzImage. I try running it on the qemu emulator but I am having trouble specifying the root file system partition. (I know that this is the partition thats loaded to run initrd from).
My system is Ubuntu 12.04 installed via Wubi on Windows.
The command i have been using is
qemu-system-x86_64 -kernel bzImage -initrd initrd.img-3.11 -append "root=/no-clue-what-to-put"
I know root is argument that specifies where the root partition is. Any help to get this image running on qemu would be appreciated.
Solution
Do you actually have a disk image and root filesystem to give to qemu and your kernel?
You need more than a linux kernel to boot a linux system. For qemu, you need a root filesystem contained within a virtual disk image as well. This will contain programs to which the kernel "hands control" when it's done booting, usually 'init' or 'systemd'.
So you have to generate a qemu-disk image that contains a root filesystem. If you created it such that the root filesystem is on the first partition of your virtual disk, you can then specify the virtual disk as a parameter to qemu with -hda /path/to/qemu/disk/image
, and you can tell the kernel to use the first partition of that virtual disk with -append "root=/dev/sda1"
(it could also be /dev/vda1
or /dev/hda1
depending on what kind of disk image you created).
So your final command will look something like:
qemu-system-x86_64 -kernel bzImage -initrd initrd.img-3.11 -hda /path/to/your/qemu/disk/image -append "root=/dev/sda1"
Answered By - Kal
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.