Sync from SUSE:SLFO:Main shim revision 4b996f0bb96a07b8a2ba31bce9177c64
This commit is contained in:
parent
546989ac38
commit
58ba8cc5cf
57
shim-install
57
shim-install
@ -84,6 +84,11 @@ case "$OS_ID" in
|
|||||||
ca_string='SUSE Linux Enterprise Secure Boot CA1';;
|
ca_string='SUSE Linux Enterprise Secure Boot CA1';;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
# bsc#1230316 For SL-Micro, always install shim/grub2 with the "removable" way
|
||||||
|
if test "$GRUB_DISTRIBUTOR" = "SL Micro"; then
|
||||||
|
removable=yes
|
||||||
|
fi
|
||||||
|
|
||||||
is_azure () {
|
is_azure () {
|
||||||
local bios_vendor;
|
local bios_vendor;
|
||||||
local product_name;
|
local product_name;
|
||||||
@ -471,32 +476,36 @@ if test "$no_nvram" = no && test -n "$bootloader_id"; then
|
|||||||
$efibootmgr -b "$bootnum" -B
|
$efibootmgr -b "$bootnum" -B
|
||||||
done
|
done
|
||||||
|
|
||||||
efidir_drive="$("$grub_probe" --target=drive --device-map= "$efidir")"
|
# bsc#1230316 Skip the creation of the boot option for SL-Micro to make
|
||||||
efidir_disk="$("$grub_probe" --target=disk --device-map= "$efidir")"
|
# the system always boot from HDD
|
||||||
if test -z "$efidir_drive" || test -z "$efidir_disk"; then
|
if test "$GRUB_DISTRIBUTOR" != "SL Micro"; then
|
||||||
echo "Can't find GRUB drive for $efidir; unable to create EFI Boot Manager entry." >&2
|
efidir_drive="$("$grub_probe" --target=drive --device-map= "$efidir")"
|
||||||
# bsc#1119762 If the MD device is partitioned, we just need to create one
|
efidir_disk="$("$grub_probe" --target=disk --device-map= "$efidir")"
|
||||||
# boot entry since the partitions are nested partitions and the mirrored
|
if test -z "$efidir_drive" || test -z "$efidir_disk"; then
|
||||||
# partitions share the same UUID.
|
echo "Can't find GRUB drive for $efidir; unable to create EFI Boot Manager entry." >&2
|
||||||
elif [[ "$efidir_drive" == \(mduuid/* && "$efidir_drive" != \(mduuid/*,* ]]; then
|
# bsc#1119762 If the MD device is partitioned, we just need to create one
|
||||||
eval $(mdadm --detail --export "$efidir_disk" |
|
# boot entry since the partitions are nested partitions and the mirrored
|
||||||
perl -ne 'print if m{^MD_LEVEL=}; push( @D, $1) if (m{^MD_DEVICE_\S+_DEV=(\S+)$});
|
# partitions share the same UUID.
|
||||||
sub END() {print "MD_DEVS=\"", join( " ", @D), "\"\n";};')
|
elif [[ "$efidir_drive" == \(mduuid/* && "$efidir_drive" != \(mduuid/*,* ]]; then
|
||||||
if [ "$MD_LEVEL" != "raid1" ]; then
|
eval $(mdadm --detail --export "$efidir_disk" |
|
||||||
echo "GRUB drive for $efidir not on RAID1; unable to create EFI Boot Manager entry." >&2
|
perl -ne 'print if m{^MD_LEVEL=}; push( @D, $1) if (m{^MD_DEVICE_\S+_DEV=(\S+)$});
|
||||||
fi
|
sub END() {print "MD_DEVS=\"", join( " ", @D), "\"\n";};')
|
||||||
for mddev in $MD_DEVS; do
|
if [ "$MD_LEVEL" != "raid1" ]; then
|
||||||
efidir_drive="$("$grub_probe" --target=drive --device-map= -d "$mddev")"
|
echo "GRUB drive for $efidir not on RAID1; unable to create EFI Boot Manager entry." >&2
|
||||||
efidir_disk="$("$grub_probe" --target=disk --device-map= -d "$mddev")"
|
fi
|
||||||
|
for mddev in $MD_DEVS; do
|
||||||
|
efidir_drive="$("$grub_probe" --target=drive --device-map= -d "$mddev")"
|
||||||
|
efidir_disk="$("$grub_probe" --target=disk --device-map= -d "$mddev")"
|
||||||
|
efidir_part="$(echo "$efidir_drive" | sed 's/^([^,]*,[^0-9]*//; s/[^0-9].*//')"
|
||||||
|
efidir_d=${mddev#/dev/}
|
||||||
|
$efibootmgr -c -d "$efidir_disk" -p "$efidir_part" -w \
|
||||||
|
-L "$bootloader_id ($efidir_d)" -l "\\EFI\\$efi_distributor\\$efi_file"
|
||||||
|
done
|
||||||
|
else
|
||||||
efidir_part="$(echo "$efidir_drive" | sed 's/^([^,]*,[^0-9]*//; s/[^0-9].*//')"
|
efidir_part="$(echo "$efidir_drive" | sed 's/^([^,]*,[^0-9]*//; s/[^0-9].*//')"
|
||||||
efidir_d=${mddev#/dev/}
|
|
||||||
$efibootmgr -c -d "$efidir_disk" -p "$efidir_part" -w \
|
$efibootmgr -c -d "$efidir_disk" -p "$efidir_part" -w \
|
||||||
-L "$bootloader_id ($efidir_d)" -l "\\EFI\\$efi_distributor\\$efi_file"
|
-L "$bootloader_id" -l "\\EFI\\$efi_distributor\\$efi_file"
|
||||||
done
|
fi
|
||||||
else
|
|
||||||
efidir_part="$(echo "$efidir_drive" | sed 's/^([^,]*,[^0-9]*//; s/[^0-9].*//')"
|
|
||||||
$efibootmgr -c -d "$efidir_disk" -p "$efidir_part" -w \
|
|
||||||
-L "$bootloader_id" -l "\\EFI\\$efi_distributor\\$efi_file"
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Sep 16 07:28:57 UTC 2024 - Gary Ching-Pang Lin <glin@suse.com>
|
||||||
|
|
||||||
|
- Update shim-install to use the 'removable' way for SL-Micro
|
||||||
|
(bsc#1230316)
|
||||||
|
* 433cc4e Always use the removable way for SL-Micro
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Sun May 19 15:08:27 UTC 2024 - Dennis Tseng <dennis.tseng@suse.com>
|
Sun May 19 15:08:27 UTC 2024 - Dennis Tseng <dennis.tseng@suse.com>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user