]> code.delx.au - refind/commitdiff
Added detection of SIP on Macs to installation script. Also began
authorsrs5694 <srs5694@users.sourceforge.net>
Sat, 31 Oct 2015 14:40:49 +0000 (10:40 -0400)
committersrs5694 <srs5694@users.sourceforge.net>
Sat, 31 Oct 2015 14:40:49 +0000 (10:40 -0400)
swapping out tool icons.

NEWS.txt
icons/tool_apple_rescue.png
icons/tool_memtest.png
icons/tool_mok_tool.png
icons/tool_netboot.png
icons/tool_part.png
icons/tool_shell.png
icons/tool_windows_rescue.png
install.sh

index 186ec3a701f60234959cc0818007588f0de8326b..870a88615c20a87b82382ea7d245a0d023a5d0af 100644 (file)
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -1,6 +1,16 @@
 0.9.3 (??/??/2015):
 -------------------
 
+- Added detection of System Integrity Protection (SIP; aka "rootless") mode
+  to OS X portion of install.sh script. When detected, and if no existing
+  rEFInd installation is found, the script now prints a warning and brief
+  instructions of how to enter the Recovery mode to install rEFInd and
+  suggests aborting the installation. (The user can override and attempt
+  installation anyhow.) If SIP is detected along with an existing rEFInd
+  installation, the script moderates the warning and explains that an
+  update of a working rEFInd will probably succeed, but that re-installing
+  to fix a broken rEFInd will probably fail.
+
 - Added new "spoof_osx_version" token, which takes an OS X version number
   (such as "10.9") as an option. This feature, when enabled, causes rEFInd
   to tell a Mac's firmware that the specified version of OS X is being
index 301b7d610ba6b7775e5e5665c63874655cc4a63a..931c2b404a0633c7d5a57181b1a0de40283b451b 100644 (file)
Binary files a/icons/tool_apple_rescue.png and b/icons/tool_apple_rescue.png differ
index d1f80ea1a01c37e41737b600bfb2a06a242c3fc4..7892c550a0cbf61bebd9373eaa27db7d7ccb34c8 100644 (file)
Binary files a/icons/tool_memtest.png and b/icons/tool_memtest.png differ
index fbb1dfc2e13496eebb0c95595b54e775878f1d5e..42bc4887b98e174100ae2941a3cf6b48959a0cb8 100644 (file)
Binary files a/icons/tool_mok_tool.png and b/icons/tool_mok_tool.png differ
index 3df117a3c764cd8f96a87db14341dcd0bc91e4d3..09d22943e9654f1635b54e6c6f456cc53642e7f4 100644 (file)
Binary files a/icons/tool_netboot.png and b/icons/tool_netboot.png differ
index 71ec7916b4f1ad07286584bca53454d560004075..4b7a07b80019203091eafa574cbfe1f21d0f0b88 100644 (file)
Binary files a/icons/tool_part.png and b/icons/tool_part.png differ
index 06110d2acddf11a201c1e7b6c4cd58d6bdfc5263..b7fa2a7ad1a8b9a1ce40d4bb3d06a4cd68cce711 100644 (file)
Binary files a/icons/tool_shell.png and b/icons/tool_shell.png differ
index 08156cf8b521ff7606709f250c925fa66873426b..41e0f355d3461ea576fcbcdaa58319069f886e77 100644 (file)
Binary files a/icons/tool_windows_rescue.png and b/icons/tool_windows_rescue.png differ
index 99896f29769c821a5694305a9b74cf3f5c1eadc6..a503820647542a748abf745547e9c7c18c2f5545 100755 (executable)
@@ -36,7 +36,9 @@
 #
 # Revision history:
 #
-# 0.9.3   -- Enable running under OS X's recovery system.
+# 0.9.3   -- Enable running under OS X's recovery system & add warning about
+#            SIP & brief instructions on how to deal with it if SIP is
+#            detected to be enabled.
 # 0.9.2   -- Added --keepname option.
 # 0.8.7   -- Better detection of Secure Boot mode & fixed errors when copying
 #            Shim & MokManager files over themselves; fixed bug that caused
@@ -695,6 +697,55 @@ SetupMacHfs() {
 ENDOFHERE
 } # SetupMacHfs()
 
+CheckForSIP() {
+   if [[ -x "/usr/bin/csrutil" ]] ; then
+      local OKToInstall=`/usr/bin/csrutil status | grep "Protection status: enabled (Custom Configuration\|Apple Internal)"`
+      if [[ -z "$OKToInstall" ]] ; then
+         echo
+         echo "**** ALERT: SIP ENABLED! ****"
+         echo
+         if [[ "$Upgrade" == "1" ]] ; then
+            echo "You are attempting to upgrade an existing installation, but it appears that"
+            echo "System Integrity Protection (SIP) is enabled. If rEFInd is working now, then"
+            echo "this is fine; you can upgrade your existing rEFInd. If rEFInd is not working,"
+            echo "though, re-installing from this boot will not help. To re-enable rEFInd, you"
+            echo "must re-install it from a Recovery system or from another OS. To enter the"
+            echo "Recovery system and re-install rEFInd:"
+         else
+            echo "rEFInd cannot be installed because System Integrity Protection (SIP) seems"
+            echo "to be enabled! You must install rEFInd from your Recovery installation or"
+            echo "from another OS. To install from the Recovery system:"
+         fi
+         echo
+         echo "  1. Reboot"
+         echo "  2. Hold down Command+R as the chime sounds"
+         echo "  3. When the OS has booted, select Utilities->Terminal"
+         echo "  4. Change to this directory with the 'cd' command; it will probably be under"
+         if [[ "`pwd | cut -b 1-8`" == "/Volumes" ]] ; then
+            echo "     `pwd`"
+         else
+            local RootName=`diskutil info -plist / | grep -A 1 VolumeName | grep string | cut -d \> -f 2 | cut -d \< -f 1`
+            echo "     /Volumes/$RootName`pwd`"
+         fi
+         echo "  5. Re-run this script."
+         echo
+         if [[ "$Upgrade" != "1" ]] ; then
+            echo "If you believe SIP is NOT enabled, you may attempt an installation anyhow,"
+            echo "but it may fail."
+            echo
+         fi
+         echo "For more on this subject, see http://www.rodsbooks.com/refind/sip.html"
+         echo
+         echo -n "Do you want to attempt installation (Y/N)? "
+         ReadYesNo
+         if [[ $YesNo == "N" || $YesNo == "n" ]] ; then
+            echo "Exiting!"
+            exit
+         fi
+      fi # csrutil status suggests OK to install
+   fi # csrutil exists
+} # CheckForSIP()
+
 # Control the OS X installation.
 # Sets Problems=1 if problems found during the installation.
 InstallOnOSX() {
@@ -708,6 +759,7 @@ InstallOnOSX() {
    fi
    echo "Installing rEFInd to the partition mounted at $InstallDir"
    DetermineTargetDir
+   CheckForSIP
    Platform=`ioreg -l -p IODeviceTree | grep firmware-abi | cut -d "\"" -f 4`
    CopyRefindFiles
    if [[ $InstallToEspOnMac == "1" ]] ; then