]> code.delx.au - refind/commitdiff
Fixed refind-install bug that could cause mountesp script to be
authorsrs5694 <srs5694@users.sourceforge.net>
Tue, 26 Jan 2016 19:29:34 +0000 (14:29 -0500)
committersrs5694 <srs5694@users.sourceforge.net>
Tue, 26 Jan 2016 19:29:34 +0000 (14:29 -0500)
installed as a FILE called /usr/local/bin, if that directory did not
exist.

Makefile
docs/refind/sip.html
refind-install
refind/legacy.h
refind/lib.c

index 588fe2df072ffc9af2ba0cec4d29299e6d401c97..17a181e451657a51e1040441e6a17d68d8791a2b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -12,7 +12,7 @@ MOK_DIR=mok
 GPTSYNC_DIR=gptsync
 EFILIB_DIR=EfiLib
 export EDK2BASE=/usr/local/UDK2014/MyWorkSpace
-export REFIND_VERSION='L"0.10.1.3"'
+export REFIND_VERSION='L"0.10.2"'
 
 # The "all" target builds with the TianoCore library if possible, but falls
 # back on the more easily-installed GNU-EFI library if TianoCore isn't
index dbedfa831feaf8a231823143df2fdc4085b825e0..e3ae392cc1ee1f442315eb905c5eb61065ff96ca 100644 (file)
@@ -201,7 +201,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <li>Type <tt class="userinput">df -h</tt> in the Terminal. This produces a list of partitions that are mounted. Locate the one on which you unpacked the rEFInd files. It will normally be <tt>/Volumes/<tt class="variable">Somename</tt></tt>, where <tt class="variable">Somename</tt> is the volume's name.</li>
 
-<li>In the Terminal, use <tt>cd</tt> to change to the directory where the rEFInd files you unpacked earlier are stored. For instance, on my MacBook, I would type <tt class="userinput">cd /Volumes/Macintosh\ HD/Users/rodsmith/Destkop/refind-0.10.0</tt>. Note that if any element of this path includes a space, you must either enclose the <i>entire path</i> in quotes or precede the space with a backslash (<tt>\</tt>), as in this example's <tt>Macintosh\ HD</tt> volume name.</li>
+<li>In the Terminal, use <tt>cd</tt> to change to the directory where the rEFInd files you unpacked earlier are stored. For instance, on my MacBook, I would type <tt class="userinput">cd /Volumes/Macintosh\ HD/Users/rodsmith/Destkop/refind-0.10.2</tt>. Note that if any element of this path includes a space, you must either enclose the <i>entire path</i> in quotes or precede the space with a backslash (<tt>\</tt>), as in this example's <tt>Macintosh\ HD</tt> volume name.</li>
 
 <li>Type <tt class="userinput">ls</tt> to verify that <tt>refind-install</tt> is present in this directory.</li>
 
@@ -237,13 +237,13 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 <h4>Disabling SIP with rEFInd</h4>
 </a>
 
-<p>As described later on this page, rEFInd 0.10.0 provides SIP control features, but they're disabled by default&mdash;except on the USB flash drive and CD-R images available from the <a href="http://www.rodsbooks.com/refind/getting.html">rEFInd downloads page.</a> On these images, the SIP control features are enabled, and can toggle between the two main modes you can set via <tt class="userinput">csrutil enable</tt> and <tt class="userinput">csrutil disable</tt> in the Recovery HD system. Thus, to disable SIP to install rEFInd, you can:</p>
+<p>As described later on this page, rEFInd 0.10.0 and later provide SIP control features, but they're disabled by default&mdash;except on the USB flash drive and CD-R images available from the <a href="http://www.rodsbooks.com/refind/getting.html">rEFInd downloads page.</a> On these images, the SIP control features are enabled, and can toggle between the two main modes you can set via <tt class="userinput">csrutil enable</tt> and <tt class="userinput">csrutil disable</tt> in the Recovery HD system. Thus, to disable SIP to install rEFInd, you can:</p>
 
 <ol>
 
 <li>Download the USB flash drive or CD-R version of rEFInd, as suitable for your computer.</li>
 
-<li>Prepare a boot medium. With the CD-R image, you can use your favorite disc-burning software. With the USB flash drive image, you can use <tt>dd</tt> to copy the image to a blank disk, as in <tt class="userinput">dd if=refind-flashdrive-0.10.0.img of=/dev/disk3</tt> to write the image to <tt>/dev/disk3</tt>. <b>Any existing data on the target disk will be destroyed!</b> For this reason, it's <b><i>imperative</i></b> that you specify the correct target (<tt>of=</tt>) disk; if you accidentally point this command to your regular hard disk, recovery will be difficult!</li>
+<li>Prepare a boot medium. With the CD-R image, you can use your favorite disc-burning software. With the USB flash drive image, you can use <tt>dd</tt> to copy the image to a blank disk, as in <tt class="userinput">dd if=refind-flashdrive-0.10.2.img of=/dev/disk3</tt> to write the image to <tt>/dev/disk3</tt>. <b>Any existing data on the target disk will be destroyed!</b> For this reason, it's <b><i>imperative</i></b> that you specify the correct target (<tt>of=</tt>) disk; if you accidentally point this command to your regular hard disk, recovery will be difficult!</li>
 
 <li>Reboot and hold down the Option (or Alt) key to see the Mac's built-in boot manager.</li>
 
@@ -283,7 +283,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <p>Once rEFInd is installed, you can use it to manage SIP features; however, the rEFInd features needed to do this are disabled by default. You must uncomment or add two lines to your <tt>refind.conf</tt> file:</p>
 
-<p class="sidebar"><b>Note:</b> Apple code samples and technical discussions are filled with the acronym "CSR." I don't know for what this acronym stands, but as it appears to be used in preference to "SIP" or "rootless" when referring to specific values, I used it in the <tt>refind.conf</tt> files token names.</p>
+<p class="sidebar"><b>Note:</b> Apple code samples and technical discussions are filled with the acronym "CSR." I don't know what this acronym means, but as it appears to be used in preference to "SIP" or "rootless" when referring to specific values, I used it in the <tt>refind.conf</tt> files token names.</p>
 
 <ul>
 
@@ -293,7 +293,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 </ul>
 
-<p>Note that <i><b>both</b></i> of these options must be set appropriately. If either of them is missing or misconfigured, rEFInd will not display the new SIP tool. A typical configuration using these features might look like this:</p>
+<p>Note that <i><b>both</b></i> of these options must be set appropriately. If either of them is missing or misconfigured, rEFInd will not display the SIP tool. A typical configuration using these features might look like this:</p>
 
 <pre class="listing">showtools shell,memtest,gdisk,csr_rotate,apple_recovery,windows_recovery,about,shutdown,reboot
 csr_values 10,77</pre>
@@ -324,7 +324,7 @@ csr_values 10,77</pre>
 
 <hr />
 
-<p>copyright &copy; 2015 by Roderick W. Smith</p>
+<p>copyright &copy; 2015-2016 by Roderick W. Smith</p>
 
 <p>This document is licensed under the terms of the <a href="FDL-1.3.txt">GNU Free Documentation License (FDL), version 1.3.</a></p>
 
index 84d661509479bfa0ec29764d4b43268384e06c71..5005bfe13cb3bff9911df5ebe9cebb44e8b33a61 100755 (executable)
@@ -39,7 +39,9 @@
 
 # Revision history:
 #
-# 0.10.2  -- Improved Secure Boot detection in Linux & fixed --usedefault in OS X.
+# 0.10.2  -- Improved Secure Boot detection in Linux, fixed --usedefault in OS X,
+#            and fixed bug that could cause mountesp to be installed as a FILE
+#            called /usr/local/bin in OS X.
 # 0.10.1  -- Improve extraction of default kernel options from /proc/cmdline.
 #            Add support for AMD64 (aka AARCH64, aa64) platform. Added
 #            warning when --alldrivers used without --usedefault.
@@ -863,7 +865,8 @@ InstallOnOSX() {
    DetermineTargetDir
    CheckForSIP
    CopyRefindFiles
-   cp "$ThisDir/mountesp" /usr/local/bin &> /dev/null
+   mkdir -p /usr/local/bin &> /dev/null
+   cp "$ThisDir/mountesp" /usr/local/bin/ &> /dev/null
    if [[ $InstallToEspOnMac == "1" && -z "$TargetPart" ]] ; then
       bless --mount "$InstallDir" --setBoot --file "$InstallDir/$TargetDir/$Refind" --shortform
    elif [[ "$TargetDir" != "/EFI/BOOT" ]] ; then
index 3da42f2150f25c57fb7023ad961f31b7a8084e38..db29673928a137b4b5acda54a6740a36758ebfaa 100644 (file)
@@ -44,6 +44,7 @@
 
 #include "global.h"
 
+VOID ScanShell(VOID);
 VOID StartLegacy(IN LEGACY_ENTRY *Entry, IN CHAR16 *SelectionName);
 VOID StartLegacyUEFI(LEGACY_ENTRY *Entry, CHAR16 *SelectionName);
 VOID ScanLegacyDisc(VOID);
index 9c7d1f6e3f08682538cff3664c5ecd2c3ba62368..f38ac64d2706618077c519efe218757a999ea2da 100644 (file)
@@ -1094,12 +1094,12 @@ VOID ScanVolumes(VOID)
 
     // get all filesystem handles
     Status = LibLocateHandle(ByProtocol, &BlockIoProtocol, NULL, &HandleCount, &Handles);
-    UuidList = AllocateZeroPool(sizeof(EFI_GUID) * HandleCount);
     if (Status == EFI_NOT_FOUND) {
         return;  // no filesystems. strange, but true...
     }
     if (CheckError(Status, L"while listing all file systems"))
         return;
+    UuidList = AllocateZeroPool(sizeof(EFI_GUID) * HandleCount);
 
     // first pass: collect information about all handles
     for (HandleIndex = 0; HandleIndex < HandleCount; HandleIndex++) {