diff --git a/debian/control b/debian/control index 52800623c..a2e836dca 100644 --- a/debian/control +++ b/debian/control @@ -184,7 +184,7 @@ Description: GRUB firmware image for QEMU In order to make QEMU use this firmware, simply add `-bios grub.bin' when invoking it. . - Note: this firmware is only suitable for QEMU. If you want to install GRUB - as firmware on real hardware, you can do so in combination with coreboot - (http://www.coreboot.org/). To support that, a grub-coreboot package is - also provided. + This package behaves in the same way as GRUB for coreboot, but doesn't + contain any code from coreboot itself, and is only suitable for QEMU. If + you want to install GRUB as firmware on real hardware, you need to use the + grub-coreboot package, and manually combine that with coreboot. diff --git a/debian/grub-firmware-qemu_grub.cfg b/debian/grub-firmware-qemu_grub.cfg new file mode 100644 index 000000000..d23f22aa3 --- /dev/null +++ b/debian/grub-firmware-qemu_grub.cfg @@ -0,0 +1,37 @@ +set default=0 +set fallback=1 +set timeout=10 + +menuentry "Search & load /boot/multiboot.img" { + search -s -f /boot/multiboot.img + if multiboot /boot/multiboot.img ; then + boot + fi + unset timeout +} + +# For separate /boot partition. +menuentry "Search & load /multiboot.img" { + search -s -f /multiboot.img + if multiboot /multiboot.img ; then + boot + fi + unset timeout +} + +menuentry "Search & source /boot/grub/grub.cfg" { + search -s -f /boot/grub/grub.cfg + source /boot/grub/grub.cfg + unset timeout +} + +# For separate /boot partition. +menuentry "Search & source /grub/grub.cfg" { + search -s -f /grub/grub.cfg + source /grub/grub.cfg + unset timeout +} + +menuentry "Reboot" { + reboot +} diff --git a/debian/rules b/debian/rules index dc93c2111..457cba124 100644 --- a/debian/rules +++ b/debian/rules @@ -72,13 +72,21 @@ build/grub-rescue-pc:: build/grub-pc build/grub-firmware-qemu:: $(MAKE) -C $@ + grub_dir=`mktemp -d` ; \ + grub_memdisk=`mktemp` ; \ + mkdir -p $${grub_dir}/boot/grub ; \ + cp debian/grub-firmware-qemu_grub.cfg $${grub_dir}/boot/grub/grub.cfg ; \ + tar -cf - -C $${grub_dir} boot > $${grub_memdisk} ; \ $(CURDIR)/$@/grub-mkimage -d $(CURDIR)/$@ \ at_keyboard \ ata serial \ pc gpt \ ext2 iso9660 reiserfs xfs fat tar \ - normal ls cat help minicmd halt reboot configfile search \ + normal sh ls cat help minicmd halt reboot configfile sleep search echo \ multiboot linux \ + halt reboot \ + memdisk \ + -m $${grub_memdisk} \ -o $(CURDIR)/$@/grub.bin install/grub-pc install/grub-efi-ia32 install/grub-efi-amd64 install/grub-ieee1275 install/grub-coreboot::