]>
code.delx.au - refind/blob - debian/postinst
2 # Post-installation script (run on USER'S system after installing the
7 # Remove any existing NVRAM entry for rEFInd, to avoid creating a duplicate.
8 ExistingEntry
=`efibootmgr | grep "rEFInd Boot Manager" | cut -c 5-8`
9 if [[ -n $ExistingEntry ]] ; then
10 efibootmgr
--bootnum $ExistingEntry --delete-bootnum
15 declare VarFile
=`ls -d /sys/firmware/efi/vars/SecureBoot* 2> /dev/null`
16 # Note: Two find operations for ShimFile favors shim over PreLoader -- if both are
17 # present, the script uses shim rather than PreLoader.
18 declare ShimFile
=`find /boot -name shim\.efi -o -name shimx64\.efi -o -name PreLoader\.efi 2> /dev/null | head -n 1`
19 if [[ ! -n $ShimFile ]] ; then
20 declare ShimFile
=`find /boot -name PreLoader\.efi 2> /dev/null | head -n 1`
22 declare SBSign
=`which sbsign 2> /dev/null`
23 declare OpenSSL
=`which openssl 2> /dev/null`
25 # Run the rEFInd installation script. Do so with the --shim option
26 # if Secure Boot mode is suspected and if a shim program can be
27 # found, or without it if not. If a shim installation is attempted
28 # and the sbsign and openssl programs can be found, do the install
29 # using a local signing key. Note that this option is undesirable
30 # for a distribution, since it would then require the user to
31 # enroll an extra MOK. I'm including it here because I'm NOT a
32 # distribution maintainer, and I want to encourage users to use
33 # their own local keys.
34 if [[ -n $VarFile && -n $ShimFile ]] ; then
35 if [[ -n $SBSign && -n $OpenSSL ]] ; then
36 .
/install.sh
--shim $ShimFile --localkeys --yes
38 .
/install.sh
--shim $ShimFile --yes