X-Git-Url: https://code.delx.au/refind/blobdiff_plain/c017089096e94ed85bef1aa900767646e64f0230..e86087ab76430dd4acf8c992aa0d9bad1c1c494b:/debian/postinst diff --git a/debian/postinst b/debian/postinst index 831c8db..e78bd9d 100755 --- a/debian/postinst +++ b/debian/postinst @@ -10,9 +10,13 @@ if [[ -n $ExistingEntry ]] ; then efibootmgr --bootnum $ExistingEntry --delete-bootnum fi -cd /usr/share/refind-0.8.1 +cd /usr/share/refind -declare VarFile=`ls -d /sys/firmware/efi/vars/SecureBoot* 2> /dev/null` +if [[ -f /sys/firmware/efi/vars/SecureBoot-8be4df61-93ca-11d2-aa0d-00e098032b8c/data ]] ; then + IsSecureBoot=`od -An -t u1 /sys/firmware/efi/vars/SecureBoot-8be4df61-93ca-11d2-aa0d-00e098032b8c/data | tr -d '[[:space:]]'` +else + IsSecureBoot="0" +fi # Note: Two find operations for ShimFile favors shim over PreLoader -- if both are # present, the script uses shim rather than PreLoader. declare ShimFile=`find /boot -name shim\.efi -o -name shimx64\.efi -o -name PreLoader\.efi 2> /dev/null | head -n 1` @@ -31,7 +35,7 @@ declare OpenSSL=`which openssl 2> /dev/null` # enroll an extra MOK. I'm including it here because I'm NOT a # distribution maintainer, and I want to encourage users to use # their own local keys. -if [[ -n $VarFile && -n $ShimFile ]] ; then +if [[ $IsSecureBoot == "1" && -n $ShimFile ]] ; then if [[ -n $SBSign && -n $OpenSSL ]] ; then ./install.sh --shim $ShimFile --localkeys --yes else