Change how we find the installer when booting via grub-efi

instead of looking for the .disk/info file, use .disk/id/$UUID
instead. Closes: #1024346, #1024720.
This commit is contained in:
Steve McIntyre 2022-11-26 01:45:26 +00:00
parent b97abf735f
commit 6d1fdf2446
7 changed files with 27 additions and 0 deletions

3
debian/changelog vendored
View File

@ -13,6 +13,9 @@ debian-cd (3.1.36) UNRELEASED; urgency=medium
to look for non-free packages. to look for non-free packages.
* Add a Contents-firmware file to help with looking up firmware * Add a Contents-firmware file to help with looking up firmware
packages in d-i. packages in d-i.
* Change how we find the installer when booting via grub-efi:
instead of looking for the .disk/info file, use .disk/id/$UUID
instead. Closes: #1024346, #1024720.
[ Cyril Brulebois ] [ Cyril Brulebois ]
* generate_firmware_patterns: Drop support for the temporary --test * generate_firmware_patterns: Drop support for the temporary --test

View File

@ -91,6 +91,8 @@ if [ -d boot$N/grub ] ; then
mv boot$N/grub/* $CDDIR/boot/grub/ mv boot$N/grub/* $CDDIR/boot/grub/
rmdir boot$N/grub rmdir boot$N/grub
change_grub_cfg_uuid $CDDIR
# Stuff the EFI boot files into a FAT filesystem, making it as # Stuff the EFI boot files into a FAT filesystem, making it as
# small as possible. We end up re-packing like this in case we're # small as possible. We end up re-packing like this in case we're
# making a multi-arch image # making a multi-arch image

View File

@ -90,6 +90,8 @@ if [ -d boot$N/grub ] ; then
mv boot$N/grub/* $CDDIR/boot/grub/ mv boot$N/grub/* $CDDIR/boot/grub/
rmdir boot$N/grub rmdir boot$N/grub
change_grub_cfg_uuid $CDDIR
# Stuff the EFI boot files into a FAT filesystem, making it as # Stuff the EFI boot files into a FAT filesystem, making it as
# small as possible. We end up re-packing like this in case we're # small as possible. We end up re-packing like this in case we're
# making a multi-arch image # making a multi-arch image

View File

@ -134,6 +134,8 @@ if [ $BOOT_EFI -ne 0 ] ; then
mv boot$N/grub/* $CDDIR/boot/grub/ mv boot$N/grub/* $CDDIR/boot/grub/
rmdir boot$N/grub rmdir boot$N/grub
change_grub_cfg_uuid $CDDIR
# Stuff the EFI boot files into a FAT filesystem, making it as # Stuff the EFI boot files into a FAT filesystem, making it as
# small as possible. We end up re-packing like this in case we're # small as possible. We end up re-packing like this in case we're
# making a multi-arch image # making a multi-arch image

View File

@ -87,6 +87,8 @@ if [ -d boot$N/grub ] ; then
mv boot$N/grub/* $CDDIR/boot/grub/ mv boot$N/grub/* $CDDIR/boot/grub/
rmdir boot$N/grub rmdir boot$N/grub
change_grub_cfg_uuid $CDDIR
# Stuff the EFI boot files into a FAT filesystem, making it as # Stuff the EFI boot files into a FAT filesystem, making it as
# small as possible. We end up re-packing like this in case we're # small as possible. We end up re-packing like this in case we're
# making a multi-arch image # making a multi-arch image

View File

@ -456,6 +456,8 @@ if [ -d boot$N/isolinux/grub ] && [ $BOOT_EFI -ne 0 ] ; then
NUM_ENTRIES=$(grep menuentry $CDDIR/boot/grub/grub.cfg | wc -l) NUM_ENTRIES=$(grep menuentry $CDDIR/boot/grub/grub.cfg | wc -l)
echo " CD$N/boot/grub/grub.cfg has $NUM_ENTRIES boot entries defined" echo " CD$N/boot/grub/grub.cfg has $NUM_ENTRIES boot entries defined"
change_grub_cfg_uuid $CDDIR
# Stuff the EFI boot files into a FAT filesystem, making it as # Stuff the EFI boot files into a FAT filesystem, making it as
# small as possible. We end up re-packing like this in case we're # small as possible. We end up re-packing like this in case we're
# making a multi-arch image # making a multi-arch image

View File

@ -248,3 +248,17 @@ install_firmwares_initrd () {
fi fi
fi fi
} }
change_grub_cfg_uuid () {
CDDIR=$1
# We (used to) look for /.disk/info in grub.cfg to find this
# Debian media once we've booted via EFI. This is not 100%
# reliable - see #1024346 and #1024720 for examples where this
# fails. Instead, let's generate a UUID here and use that as a
# flag file.
UUID=$(uuidgen)
mkdir -p $CDDIR/.disk/id
touch $CDDIR/.disk/id/$UUID
sed -i "/search --file --set=root/s,.disk/info,.disk/id/$UUID," $CDDIR/EFI/debian/grub.cfg
}