Accepting request 431418 from devel:openSUSE:Factory
Automatic submission by obs-autosubmit OBS-URL: https://build.opensuse.org/request/show/431418 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/shim?expand=0&rev=52
This commit is contained in:
commit
f90ab72042
34
shim-install
34
shim-install
@ -6,6 +6,7 @@ efidir=
|
||||
install_device=
|
||||
efibootdir=
|
||||
ca_string=
|
||||
no_nvram=no
|
||||
removable=no
|
||||
clean=no
|
||||
sysconfdir="/etc"
|
||||
@ -52,6 +53,7 @@ usage () {
|
||||
echo "--directory=DIR use images from DIR."
|
||||
echo "--grub-probe=FILE use FILE as grub-probe."
|
||||
echo "--removable the installation device is removable."
|
||||
echo "--no-nvram don't update the NVRAM variable."
|
||||
echo "--bootloader-id=ID the ID of bootloader."
|
||||
echo "--efi-directory=DIR use DIR as the EFI System Partition root."
|
||||
echo "--config-file=FILE use FILE as config file, default is $grub_cfg."
|
||||
@ -113,8 +115,12 @@ do
|
||||
grub_cfg="`echo "$option" | sed 's/--config-file=//'`" ;;
|
||||
|
||||
--removable)
|
||||
no_nvram=yes
|
||||
removable=yes ;;
|
||||
|
||||
--no-nvram)
|
||||
no_nvram=yes ;;
|
||||
|
||||
--clean)
|
||||
clean=yes ;;
|
||||
|
||||
@ -189,14 +195,18 @@ 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
|
||||
if test "$removable" = "yes" ; then
|
||||
efidir="$efibootdir"
|
||||
else
|
||||
efidir="$efidir/EFI/$efi_distributor"
|
||||
mkdir -p "$efidir" || exit 1
|
||||
fi
|
||||
else
|
||||
echo "No valid EFI partition" 1>&2
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
if test -f "$efibootdir/bootx64.efi"; then
|
||||
if test "$removable" = "no" -a -f "$efibootdir/bootx64.efi"; then
|
||||
if test -n "$ca_string" && (grep -q "$ca_string" "$efibootdir/bootx64.efi"); then
|
||||
update_boot=yes
|
||||
fi
|
||||
@ -214,7 +224,7 @@ if test "$clean" = "yes"; then
|
||||
rm -f "${efibootdir}/bootx64.efi"
|
||||
rm -f "${efibootdir}/fallback.efi"
|
||||
fi
|
||||
if test "$removable" = no && test -n "$bootloader_id"; then
|
||||
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]' | \
|
||||
fgrep -i " $bootloader_id" | cut -b5-8`; do
|
||||
@ -224,13 +234,21 @@ if test "$clean" = "yes"; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
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 "$efidir" != "$efibootdir" ; then
|
||||
cp "${source_dir}/shim.efi" "${efidir}"
|
||||
if test -n "$bootloader_id"; then
|
||||
echo "shim.efi,${bootloader_id}" | iconv -f ascii -t ucs2 > "${efidir}/boot.csv"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$update_boot" = "yes"; then
|
||||
cp "${source_dir}/shim.efi" "${efibootdir}/bootx64.efi"
|
||||
cp "${source_dir}/fallback.efi" "${efibootdir}"
|
||||
if test "$removable" = "no"; then
|
||||
cp "${source_dir}/fallback.efi" "${efibootdir}"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@ -268,7 +286,7 @@ make_grubcfg > "${efidir}/grub.cfg"
|
||||
# invoke grub_install to initialize /boot/grub2 directory with files needed by grub.cfg
|
||||
${grub_install} --no-nvram
|
||||
|
||||
if test "$removable" = no && test -n "$bootloader_id"; then
|
||||
if test "$no_nvram" = no && test -n "$bootloader_id"; then
|
||||
|
||||
modprobe -q efivars 2>/dev/null || true
|
||||
|
||||
|
@ -1,3 +1,10 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Sep 21 09:55:40 UTC 2016 - mchang@suse.com
|
||||
|
||||
- shim-install :
|
||||
* add option --no-nvram (bsc#999818)
|
||||
* improve removable media and fallback mode handling
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Aug 19 06:46:59 UTC 2016 - mchang@suse.com
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package shim
|
||||
#
|
||||
# Copyright (c) 2016 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
|
Loading…
x
Reference in New Issue
Block a user