- Use the full path for efibootmgr to avoid errors when invoking

shim-install from packagekitd (bsc#1168104)

OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory/shim-leap?expand=0&rev=20
This commit is contained in:
Gary Ching-Pang Lin 2020-03-31 08:44:59 +00:00 committed by Git OBS Bridge
parent 049deae41c
commit 2f84c32b4e
2 changed files with 13 additions and 6 deletions

View File

@ -12,6 +12,7 @@ clean=no
sysconfdir="/etc"
libdir="/usr/lib64"
source_dir="$libdir/efi"
efibootmgr="/usr/sbin/efibootmgr"
grub_probe="/usr/sbin/grub2-probe"
grub_mkrelpath="/usr/bin/grub2-mkrelpath"
grub_install="/usr/sbin/grub2-install"
@ -245,9 +246,9 @@ if test "$clean" = "yes"; then
fi
if test "$no_nvram" = no && test -n "$bootloader_id"; then
# Delete old entries from the same distributor.
for bootnum in `efibootmgr | grep '^Boot[0-9]' | \
for bootnum in `$efibootmgr | grep '^Boot[0-9]' | \
fgrep -i " $bootloader_id" | cut -b5-8`; do
efibootmgr -b "$bootnum" -B
$efibootmgr -b "$bootnum" -B
done
fi
exit 0
@ -323,9 +324,9 @@ if test "$no_nvram" = no && test -n "$bootloader_id"; then
modprobe -q efivars 2>/dev/null || true
# Delete old entries from the same distributor.
for bootnum in `efibootmgr | grep '^Boot[0-9]' | \
for bootnum in `$efibootmgr | grep '^Boot[0-9]' | \
fgrep -i " $bootloader_id" | cut -b5-8`; do
efibootmgr -b "$bootnum" -B
$efibootmgr -b "$bootnum" -B
done
efidir_drive="$("$grub_probe" --target=drive --device-map= "$efidir")"
@ -344,12 +345,12 @@ if test "$no_nvram" = no && test -n "$bootloader_id"; then
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 \
$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].*//')"
efibootmgr -c -d "$efidir_disk" -p "$efidir_part" -w \
$efibootmgr -c -d "$efidir_disk" -p "$efidir_part" -w \
-L "$bootloader_id" -l "\\EFI\\$efi_distributor\\$efi_file"
fi
fi

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Mar 31 08:38:56 UTC 2020 - Gary Ching-Pang Lin <glin@suse.com>
- Use the full path for efibootmgr to avoid errors when invoking
shim-install from packagekitd (bsc#1168104)
-------------------------------------------------------------------
Mon Mar 30 06:05:58 UTC 2020 - Gary Ching-Pang Lin <glin@suse.com>