+# Set up for booting from Mac HFS+ volume that boots rEFInd in MJG's way
+# (http://mjg59.dreamwidth.org/7468.html)
+# Must be passed the original rEFInd binary filename (without a path).
+SetupMacHfs() {
+ if [[ -s "$InstallDir/mach_kernel" ]] ; then
+ echo "Attempt to install rEFInd to a partition with a /mach_kernel file! Aborting!"
+ exit 1
+ fi
+ cp -n "$InstallDir/$TargetDir/boot.efi" "$InstallDir/$TargetDir/boot.efi-backup" &> /dev/null
+ ln -f "$InstallDir/$TargetDir/$1" "$InstallDir/$TargetDir/boot.efi"
+ touch "$InstallDir/mach_kernel"
+ cp -n "$RefindDir/icons/os_refind.icns" "$InstallDir/.VolumeIcon.icns" &> /dev/null
+ rm "$InstallDir/$TargetDir/SystemVersion.plist" &> /dev/null
+ cat - << ENDOFHERE >> "$InstallDir/$TargetDir/SystemVersion.plist"
+<xml version="1.0" encoding="UTF-8"?>
+<plist version="1.0">
+<dict>
+ <key>ProductBuildVersion</key>
+ <string></string>
+ <key>ProductName</key>
+ <string>rEFInd</string>
+ <key>ProductVersion</key>
+ <string>0.7.6</string>
+</dict>
+</plist>
+ENDOFHERE
+} # SetupMacHfs()
+