SHA256
1
0
forked from pool/shim

Accepting request 224563 from home:gary_lin:branches:devel:openSUSE:Factory

FATE#315002: Update shim-install to install shim.efi as the EFI default bootloader when none exists in \EFI\boot.

OBS-URL: https://build.opensuse.org/request/show/224563
OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory/shim?expand=0&rev=62
This commit is contained in:
Gary Ching-Pang Lin 2014-03-04 04:32:46 +00:00 committed by Git OBS Bridge
parent 48acea1e89
commit ac40989026
2 changed files with 35 additions and 0 deletions

View File

@ -4,6 +4,8 @@ rootdir=
bootdir=
efidir=
install_device=
efibootdir=
ca_string=
removable=no
clean=no
sysconfdir="/etc"
@ -12,6 +14,7 @@ source_dir="$libdir/efi"
grub_probe="`which grub2-probe`"
self="`basename $0`"
grub_cfg="/boot/grub2/grub.cfg"
update_boot=no
# Get GRUB_DISTRIBUTOR.
if test -f "${sysconfdir}/default/grub" ; then
@ -26,6 +29,14 @@ fi
efi_distributor="$bootloader_id"
bootloader_id="${bootloader_id}-secureboot"
case "$bootloader_id" in
"sle"*)
ca_string='SUSE Linux Enterprise Secure Boot CA1';;
"opensuse"*)
ca_string='openSUSE Secure Boot CA1';;
*) ca_string="";;
esac
usage () {
echo "Usage: $self [OPTION] [INSTALL_DEVICE]"
echo
@ -169,18 +180,32 @@ fi
if test -n "$efidir"; then
efi_file=shim.efi
efibootdir="$efidir/EFI/boot"
mkdir -p "$efibootdir" || exit 1
efidir="$efidir/EFI/$efi_distributor"
mkdir -p "$efidir" || exit 1
else
exit 1;
fi
if test -f "$efibootdir/bootx64.efi"; then
if test -n "$ca_string" && (grep -q "$ca_string" "$efibootdir/bootx64.efi"); then
update_boot=yes
fi
else
update_boot=yes
fi
if test "$clean" = "yes"; then
rm -f "${efidir}/shim.efi"
rm -f "${efidir}/MokManager.efi"
rm -f "${efidir}/grub.efi"
rm -f "${efidir}/grub.cfg"
rm -f "${efidir}/boot.csv"
if test "$update_boot" = "yes"; then
rm -f "${efibootdir}/bootx64.efi"
rm -f "${efibootdir}/fallback.efi"
fi
efibootmgr="`which efibootmgr`"
if test "$removable" = no && test -n "$bootloader_id" && test -n "$efibootmgr"; then
# Delete old entries from the same distributor.
@ -196,6 +221,10 @@ cp "${source_dir}/shim.efi" "${efidir}"
cp "${source_dir}/MokManager.efi" "${efidir}"
cp "${source_dir}/grub.efi" "${efidir}"
echo "shim.efi,${bootloader_id}" | iconv -f ascii -t ucs2 > "${efidir}/boot.csv"
if test "$update_boot" = "yes"; then
cp "${source_dir}/shim.efi" "${efibootdir}/bootx64.efi"
cp "${source_dir}/fallback.efi" "${efibootdir}"
fi
grub_cfg_dirname=`dirname $grub_cfg`
grub_cfg_basename=`basename $grub_cfg`

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Mar 4 04:19:05 UTC 2014 - glin@suse.com
- FATE#315002: Update shim-install to install shim.efi as the EFI
default bootloader when none exists in \EFI\boot.
-------------------------------------------------------------------
Fri Feb 21 08:45:46 UTC 2014 - glin@suse.com