From e8bc4a231a2e16c25e86b7288f6de0b5a0c9bb2f Mon Sep 17 00:00:00 2001 From: Steve McIntyre <93sam@debian.org> Date: Mon, 10 Jun 2019 21:52:53 +0000 Subject: [PATCH] Add an extra di-specific version of the UEFI netboot image Identical to the normal netboot image, but With a different baked-in prefix value ("$vendor-installer/$ARCH/grub" instead of "/grub"). Helps to fix #928750, making d-i consistent in terms of PXE setup. --- debian/build-efi-images | 27 +++++++++++++++++++++------ debian/changelog | 2 ++ debian/rules | 2 +- debian/signing-template.json.in | 1 + 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/debian/build-efi-images b/debian/build-efi-images index 3c1873bae..dbff3e720 100755 --- a/debian/build-efi-images +++ b/debian/build-efi-images @@ -20,16 +20,17 @@ set -e # Make EFI boot images for signing. -if [ $# -lt 5 ]; then - echo "usage: $0 GRUB-MKIMAGE GRUB-CORE OUTPUT-DIRECTORY PLATFORM EFI-NAME [EFI-VENDOR]" +if [ $# -lt 6 ]; then + echo "usage: $0 GRUB-MKIMAGE GRUB-CORE OUTPUT-DIRECTORY DEB-ARCH PLATFORM EFI-NAME [EFI-VENDOR]" fi grub_mkimage="$1" grub_core="$2" outdir="$3" -platform="$4" -efi_name="$5" -efi_vendor="${6:-$(dpkg-vendor --query vendor | tr '[:upper:]' '[:lower:]')}" +deb_arch="$4" +platform="$5" +efi_name="$6" +efi_vendor="${7:-$(dpkg-vendor --query vendor | tr '[:upper:]' '[:lower:]')}" # mkfs.msdos may not be on the default PATH. export PATH="$PATH:/sbin:/usr/sbin" @@ -191,15 +192,29 @@ NET_MODULES="$CD_MODULES tftp " +# CD boot image "$grub_mkimage" -O "$platform" -o "$outdir/gcd$efi_name.efi" \ -d "$grub_core" \ -c "$workdir/grub-bootstrap.cfg" -m "$workdir/memdisk.fat" \ -p /boot/grub \ $CD_MODULES + +# Normal disk boot image "$grub_mkimage" -O "$platform" -o "$outdir/grub$efi_name.efi" \ -d "$grub_core" -p "/EFI/$efi_vendor" $GRUB_MODULES + +# Normal network boot image "$grub_mkimage" -O "$platform" -o "$outdir/grubnet$efi_name.efi" \ -d "$grub_core" -c "$workdir/grub-bootstrap.cfg" \ - -m "$workdir/memdisk-netboot.fat" -p /grub $NET_MODULES + -m "$workdir/memdisk-netboot.fat" \ + -p /grub $NET_MODULES + +# Special network boot image for d-i to use. Just the same as the +# normal network boot image, but with a different value baked in for +# the prefix setting +"$grub_mkimage" -O "$platform" -o "$outdir/grubnet$efi_name-installer.efi" \ + -d "$grub_core" -c "$workdir/grub-bootstrap.cfg" \ + -m "$workdir/memdisk-netboot.fat" \ + -p "${efi_vendor}-installer/$deb_arch/grub" $NET_MODULES exit 0 diff --git a/debian/changelog b/debian/changelog index 4e7084061..c1ae47e95 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,8 @@ grub2 (2.04~rc1-2) UNRELEASED; urgency=medium * Add the ntfs module to signed UEFI images. Closes: #923855 * Add the cpuid module to signed UEFI images. Closes: #928628 * Add the play module to signed UEFI images. Closes: #930290 + * Add an extra di-specific version of the UEFI netboot image with a + different baked-in prefix value. Helps to fix #928750. -- Colin Watson Tue, 04 Jun 2019 19:41:22 +0100 diff --git a/debian/rules b/debian/rules index 06308cbe0..907f062fe 100755 --- a/debian/rules +++ b/debian/rules @@ -219,7 +219,7 @@ debian/stamps/build-grub-efi-ia32 debian/stamps/build-grub-efi-amd64 debian/stam obj/grub-$(COMMON_PLATFORM)/grub-mkimage \ obj/$(package)/grub-core \ obj/monolithic/$(package) \ - $(SB_PLATFORM) $(SB_EFI_NAME) $(SB_EFI_VENDOR) + $(DEB_HOST_ARCH) $(SB_PLATFORM) $(SB_EFI_NAME) $(SB_EFI_VENDOR) touch $@ debian/stamps/build-grub-xen-host-i386: PVBOOT_ARCH := i386 diff --git a/debian/signing-template.json.in b/debian/signing-template.json.in index 08587f718..bd7239608 100644 --- a/debian/signing-template.json.in +++ b/debian/signing-template.json.in @@ -6,6 +6,7 @@ "files": [ {"sig_type": "efi", "file": "usr/lib/grub/@efi_platform@/monolithic/gcd@efi@.efi"}, {"sig_type": "efi", "file": "usr/lib/grub/@efi_platform@/monolithic/grubnet@efi@.efi"}, + {"sig_type": "efi", "file": "usr/lib/grub/@efi_platform@/monolithic/grubnet@efi@-installer.efi"}, {"sig_type": "efi", "file": "usr/lib/grub/@efi_platform@/monolithic/grub@efi@.efi"} ] }