I'm in OS X. In the refind-install
script, there's a bless command that is running, but doesn't seem to work:
elif [[ "$TargetDir" != "/EFI/BOOT" ]] ; then
bless --setBoot --folder "$InstallDir/$TargetDir" --file "$InstallDir/$TargetDir/$Refind"
echo BLESS COMMAND: bless --setBoot --folder "$InstallDir/$TargetDir" --file "$InstallDir/$TargetDir/$Refind"
fi
I added the extra echo
line to see what the command looks like, and this is the output:
BLESS COMMAND: bless --setBoot --folder /Volumes/efi///EFI/refind --file /Volumes/efi///EFI/refind/refind_x64.efi
I'm running the install script like this:
sudo ./refind-install --root /Volumes/efi
where /Volume/efi contains the root of a custom EFI System Partition on disk0s6, not my MacBook's default disk0s1 ESP.
Any idea why it doesn't work and how to get rEFInd to boot by default?
EDIT:
Alright, I think I might know what's wrong. So, I was able to make it work by replacing the --root
option to refind-install
with the --usedefault
option, like this:
sudo ./refind-install --usedefault /dev/disk0s6
Now, what happens next is that the script ignores /dev/disk0s6
and goes ahead and install rEFInd to /dev/disk0s1
, the main OS X ESP (which isn't what I desired, but it works).
The script then goes ahead and runs the other bless command:
if [[ $InstallToEspOnMac == "1" ]] ; then
bless --mount "$InstallDir" --setBoot --file "$InstallDir/$TargetDir/$Refind" --shortform
elif [[ "$TargetDir" != "/EFI/BOOT" ]] ; then
After rebooting, this works, and rEFInd boots by default. I have a hunch that this is working due to rEFInd being installed to the default /EFI/BOOT/bootx64.efi
inside the OS X ESP partition.
But this isn't what I want. I'd like to have refind installed on /dev/disk0s6
, in /EFI/refind/
instead of /EFI/BOOT
.
EDIT:
Also note that when using the --usedefault
option, the install script installs refind_aa64.efi
into /EFI/BOOT
of the OS X ESP (disk0s1) but when using the --root
option to install to disk0s6 the script instead installs refind_x86.efi
Also, I'm not sure if perhaps having the --mount
option in one bless command but not the other is what made the difference.
EDIT:
I was able to copy over /EFI/BOOT from disk0s1 to disk0s6, then run the same --mount
bless command as in the script, and that worked.
EDIT:
Alright, we're getting closer. I modified the script, and changed
elif [[ "$TargetDir" != "/EFI/BOOT" ]] ; then
bless --setBoot --folder "$InstallDir/$TargetDir" --file "$InstallDir/$TargetDir/$Refind"
fi
to
elif [[ "$TargetDir" != "/EFI/BOOT" ]] ; then
bless --mount "$InstallDir" --setBoot --file "$InstallDir/$TargetDir/$Refind"
fi
and now that works as I want: refind installed to /EFI/refind
on the partition whose mount point I specify with the --root
option. Although this gives me the result I was looking for, there is now one small problem: it takes around 30 seconds or more to finally arrive at rEFInd when booting, which is really slow for some reason. I'm going to reset NVRAM and try again...
EDIT
Aha! Before resetting NVRAM, I tried adding the --shortform
option to the bless command, and that fixed the lag issue in the previous edit!
Why is the second bless command in --folder mode? It seems to work better in --mount mode.
So, for now, the solution was to modify the second bless command in the script to be exactly like the first, so that part of the script looks like this:
if [[ $InstallToEspOnMac == "1" ]] ; then
bless --mount "$InstallDir" --setBoot --file "$InstallDir/$TargetDir/$Refind" --shortform
elif [[ "$TargetDir" != "/EFI/BOOT" ]] ; then
bless --mount "$InstallDir" --setBoot --file "$InstallDir/$TargetDir/$Refind" --shortform
fi
and I used the --root
option for refind-install
to specify the mount point of the target partition.
mkdir /Volumes/efi
sudo mount -t msdos /dev/disk0s6 /Volumes/efi
sudo ./refind-install --root /Volumes/efi