Bug#762618: debian-installer: amd64/i386 netboot/mini.iso has empty grub.cfg for EFI boot
Control: tag -1 +patch
On Tue, 2014-09-23 at 20:29 +0100, Ian Campbell wrote:
> While looking for an example to crib for arm64 I noticed that the amd64
> mini.iso has a grub cfg (used when booting on EFI) which doesn't contain any
> menu entries. Booting on non-EFI would use the isolinux menus in the usual way.
> Looking at the code I expect this will apply to i386 too, although I've not
> checked.
I wrote a script to generate a grub.cfg for arm64. Since it was based on
the grub.cfg which debian-cd produces for x86 it is pretty trivial to
reuse it here.
diff --git a/build/config/x86.cfg b/build/config/x86.cfg
index d54ebcb..de903bd 100644
--- a/build/config/x86.cfg
+++ b/build/config/x86.cfg
@@ -265,6 +265,10 @@ arch_miniiso: x86_syslinux x86_grub_efi
ln -f $(TEMP_KERNEL) $(TEMP_CD_TREE)/linux
ln -f $(TEMP_INITRD) $(TEMP_CD_TREE)/initrd.gz
+ mkdir -p $(TEMP_CD_TREE)/.disk
+ echo "Debian GNU/Linux $(DEBIAN_VERSION) $(ARCH) - netboot mini.iso $(BUILD_DATE)"\
+ > $(TEMP_CD_TREE)/.disk/info
+
# Use a non-empty character for beep by default to make sure the menu
# is wide enough when beep is enabled.
beep="_"; \
@@ -296,9 +300,12 @@ arch_miniiso: x86_syslinux x86_grub_efi
set -e; \
mkdir -p $(TEMP_CD_TREE)/boot/grub/x86_64-efi; \
cp -a $(TEMP_GRUB_EFI)/efi.img $(TEMP_CD_TREE)/boot/grub/; \
- cat boot/x86/grub/grub-efi.cfg \
- | bootvars-subst KERNEL /linux \
+ grub-gencfg \
+ KERNEL /linux \
INITRD /initrd.gz \
+ HEADER boot/x86/grub/grub-efi.cfg \
+ -- \
+ $(VIDEO_MODE) \
> $(TEMP_CD_TREE)/boot/grub/grub.cfg; \
cp -a $(GRUB_FONT) $(TEMP_CD_TREE)/boot/grub/font.pf2; \
cp -a $(TEMP_GRUB_EFI)/boot/grub/x86_64-efi/* \
diff --git a/debian/changelog b/debian/changelog
index 9c10cc4..e435657 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,6 +10,7 @@ debian-installer (2014XXXX) UNRELEASED; urgency=low
* Switch to installing Jessie by default on ARM64.
* Build netboot mini.iso on ARM64.
* Build cdrom flavour for ARM64.
+ * Add grub.cfg to netboot mini.iso for use on EFI systems (Closes: #762618).
[ Cyril Brulebois ]
* Deal with even more incompatible changes on the syslinux side by
Reply to: