From a9fcc4ee9a45fe358af52f64adb7f874490301512a214a2ad89da5064668e71d Mon Sep 17 00:00:00 2001 From: Gary Ching-Pang Lin Date: Thu, 23 Mar 2017 06:44:52 +0000 Subject: [PATCH] Accepting request 482059 from home:michael-chang:branches:devel:openSUSE:Factory - shim-install: add option --suse-enable-tpm (fate#315831) OBS-URL: https://build.opensuse.org/request/show/482059 OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory/shim?expand=0&rev=126 --- shim-install | 18 +++++++++++++++++- shim.changes | 5 +++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/shim-install b/shim-install index c9590b5..8363078 100644 --- a/shim-install +++ b/shim-install @@ -18,6 +18,7 @@ grub_install="/usr/sbin/grub2-install" self="`basename $0`" grub_cfg="/boot/grub2/grub.cfg" update_boot=no +def_grub_efi="${source_dir}/grub.efi" # Get GRUB_DISTRIBUTOR. if test -f "${sysconfdir}/default/grub" ; then @@ -58,6 +59,7 @@ usage () { 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." echo "--clean remove all installed files and configs." + echo "--suse-enable-tpm install grub.efi with TPM support." echo echo "INSTALL_DEVICE must be system device filename." } @@ -121,6 +123,9 @@ do --no-nvram) no_nvram=yes ;; + --suse-enable-tpm) + source_grub_efi="/usr/lib/grub2/x86_64-efi/grub-tpm.efi" ;; + --clean) clean=yes ;; @@ -235,7 +240,18 @@ if test "$clean" = "yes"; then fi cp "${source_dir}/MokManager.efi" "${efidir}" -cp "${source_dir}/grub.efi" "${efidir}" + +if test -n "$source_grub_efi" && ! test -f "$source_grub_efi"; then + echo "File $source_grub_efi doesn't exist, fallback to default one" 1>&2 + source_grub_efi="" +fi + +if test -z "$source_grub_efi"; then + source_grub_efi="$def_grub_efi" +fi + +echo "copying $source_grub_efi to ${efidir}/grub.efi" +cp "$source_grub_efi" "${efidir}/grub.efi" if test "$efidir" != "$efibootdir" ; then cp "${source_dir}/shim.efi" "${efidir}" diff --git a/shim.changes b/shim.changes index f117fb3..74a42ef 100644 --- a/shim.changes +++ b/shim.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Mar 22 10:54:41 UTC 2017 - mchang@suse.com + +- shim-install: add option --suse-enable-tpm (fate#315831) + ------------------------------------------------------------------- Fri Jan 13 09:21:49 UTC 2017 - mchang@suse.com