[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Building grub2 for use as a kernel on qemu

From: Shaun Reitan
Subject: Building grub2 for use as a kernel on qemu
Date: Thu, 02 Feb 2017 00:33:58 +0000
User-agent: eM_Client/7.0.26356.0

I'm attempting to build a grub2 image that will be used with QEMU to load the grub configuration from a flat disk image (no partitioning, just a filesystem). I've created a grub.cfg with the following inside of it.

echo "Hold onto your grub!"
for grubcfg in /boot/grub2/grub.cfg /etc/grub.cfg; do
       echo $grubcfg

I've then built the image by doing the following...

grub-mkimage -O i386-pc -c grub.cfg -o grub2.img at_keyboard configfile biosdisk ext2 linux serial halt minicmd terminal all_video cat echo gzio search linux16 normal disk test true fat memdisk tar ls sleep -p /usr/src/grub/grub-core/

When starting qemu using that image as the kernel I do see grub loaded, however i'm dumped at a shell. What i've realized is that the for loop in my grub.cfg is not working, but whats weird is that a for loop in the shell works fine. I am able to load the grub.cfg from the disk if i do the following...

set root=(hd0)
configfile /boot/grub2/grub.cfg

Any help on what i'm doing wrong here. This grub2 image will boot many different linux distros so i need grub to search for the grub.cfg in a few places.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]