]> code.delx.au - refind/commitdiff
Improved refind-install: Fixed bug that caused --usedefault to not
authorsrs5694 <srs5694@users.sourceforge.net>
Thu, 21 Jan 2016 20:24:37 +0000 (15:24 -0500)
committersrs5694 <srs5694@users.sourceforge.net>
Thu, 21 Jan 2016 20:24:37 +0000 (15:24 -0500)
work on OS X; and improved Secure Boot detection under Linux.

docs/refind/todo.html
refind-install

index 614723fa66b11ad572c8d7dabef88d042616e42e..8496cecb1e0afbca884b45d59300fc2d701785d6 100644 (file)
@@ -330,6 +330,12 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
     <ul>
 
+    <li>Currently, debugging rEFInd requires adding <tt>Print()</tt>
+       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.</li>
+
     <li>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.</li>
index a9753cf5a251fb6a812773f386e260a86e71e88e..37fa8110f176526da9d04fca3a951c5f9fd9eeef 100755 (executable)
@@ -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 ""