From: srs5694
Date: Thu, 21 Jan 2016 20:24:37 +0000 (-0500)
Subject: Improved refind-install: Fixed bug that caused --usedefault to not
X-Git-Url: https://code.delx.au/refind/commitdiff_plain/32ddcb84670b3b15693749b9197c93390ea667b9
Improved refind-install: Fixed bug that caused --usedefault to not
work on OS X; and improved Secure Boot detection under Linux.
---
diff --git a/docs/refind/todo.html b/docs/refind/todo.html
index 614723f..8496cec 100644
--- a/docs/refind/todo.html
+++ b/docs/refind/todo.html
@@ -330,6 +330,12 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com
+ - Currently, debugging rEFInd requires adding Print()
+ statements to the code. Adding a logging facility that supports
+ multiple log levels and writes the output to a file would help with
+ debugging, especially when dealing with problem reports from
+ users.
+
- There's currently no way to create a manual boot stanza for a
BIOS-booted OS. This isn't a big priority for me personally, but I
can see how it could be for some people.
diff --git a/refind-install b/refind-install
index a9753cf..37fa811 100755
--- a/refind-install
+++ b/refind-install
@@ -798,7 +798,7 @@ ENDOFHERE
} # SetupMacHfs()
CheckForSIP() {
- if [[ -x "/usr/bin/csrutil" ]] ; then
+ if [[ -x "/usr/bin/csrutil" && -z "$TargetPart" ]] ; then
local OKToInstall=`/usr/bin/csrutil status | \
grep "Protection status: disabled\|enabled (Apple Internal)\|NVRAM Protections: disabled"`
if [[ -z "$OKToInstall" ]] ; then
@@ -851,7 +851,7 @@ CheckForSIP() {
# Sets Problems=1 if problems found during the installation.
InstallOnOSX() {
echo "Installing rEFInd on OS X...."
- if [[ "$InstallToEspOnMac" == "1" ]] ; then
+ if [[ "$InstallToEspOnMac" == "1" && -z "$TargetPart" ]] ; then
MountOSXESP
elif [[ "$TargetDir" == "/EFI/BOOT" || "$OwnHfs" == '1' ]] ; then
MountDefaultTarget
@@ -863,7 +863,7 @@ InstallOnOSX() {
CheckForSIP
CopyRefindFiles
cp "$ThisDir/mountesp" /usr/local/bin &> /dev/null
- if [[ $InstallToEspOnMac == "1" ]] ; then
+ if [[ $InstallToEspOnMac == "1" && -z "$TargetPart" ]] ; then
bless --mount "$InstallDir" --setBoot --file "$InstallDir/$TargetDir/$Refind" --shortform
elif [[ "$TargetDir" != "/EFI/BOOT" ]] ; then
bless --setBoot --folder "$InstallDir/$TargetDir" --file "$InstallDir/$TargetDir/$Refind"
@@ -896,11 +896,11 @@ InstallOnOSX() {
# If we're NOT in Secure Boot mode but the user HAS specified the --shim
# or --localkeys option, warn the user and offer to abort.
CheckSecureBoot() {
- local IsSecureBoot
- if [[ -f /sys/firmware/efi/vars/SecureBoot-8be4df61-93ca-11d2-aa0d-00e098032b8c/data ]] ; then
+ IsSecureBoot="0"
+ if [[ -f /sys/firmware/efi/efivars/SecureBoot-8be4df61-93ca-11d2-aa0d-00e098032b8c ]] ; then
+ IsSecureBoot=`od -An -t u1 /sys/firmware/efi/efivars/SecureBoot-8be4df61-93ca-11d2-aa0d-00e098032b8c | awk '{print substr($0,length,1)}'`
+ elif [[ -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
if [[ $IsSecureBoot == "1" && "$TargetDir" != '/EFI/BOOT' && "$ShimSource" == "none" ]] ; then
echo ""