Shaun Reitan
2017-02-02 00:33:58 UTC
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
done
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.
--
Shaun
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
done
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.
--
Shaun