]>
code.delx.au - refind/blob - install.sh
3 # Linux/MacOS X script to install rEFInd
7 # ./install.sh [options]
10 # "--esp" to install to the ESP rather than to the system's root
11 # filesystem. This is the default on Linux
12 # "--usedefault {devicefile}" to install as default
13 # (/EFI/BOOT/BOOTX64.EFI and similar) to the specified device
14 # (/dev/sdd1 or whatever) without registering with the NVRAM.
15 # "--drivers" to install drivers along with regular files
16 # "--shim {shimfile}" to install a shim.efi file for Secure Boot
17 # "--localkeys" to re-sign x86-64 binaries with a locally-generated key
19 # The "esp" option is valid only on Mac OS X; it causes
20 # installation to the EFI System Partition (ESP) rather than
21 # to the current OS X boot partition. Under Linux, this script
22 # installs to the ESP by default.
24 # This program is copyright (c) 2012 by Roderick W. Smith
25 # It is released under the terms of the GNU GPL, version 3,
26 # a copy of which should be included in the file COPYING.txt.
30 # 0.5.1 -- Added --shim & --localkeys options & create sample refind_linux.conf
32 # 0.5.0 -- Added --usedefault & --drivers options & changed "esp" option to "--esp"
33 # 0.4.5 -- Fixed check for rEFItBlesser in OS X
34 # 0.4.2 -- Added notice about BIOS-based OSes & made NVRAM changes in Linux smarter
35 # 0.4.1 -- Added check for rEFItBlesser in OS X
36 # 0.3.3.1 -- Fixed OS X 10.7 bug; also works as make target
37 # 0.3.2.1 -- Check for presence of source files; aborts if not present
38 # 0.3.2 -- Initial version
40 # Note: install.sh version numbers match those of the rEFInd package
41 # with which they first appeared.
44 EtcKeysDir
=/etc
/refind.d
/keys
45 LocalKeysBase
="refind_local"
47 TargetX64
="refind_x64.efi"
48 TargetIA32
="refind_ia32.efi"
53 # Functions used by both OS X and Linux....
59 while [[ $# -gt 0 ]]; do
61 --esp |
--ESP) InstallToEspOnMac
=1
63 --usedefault) TargetDir
=/EFI
/BOOT
65 TargetX64
="bootx64.efi"
66 TargetIA32
="bootia32.efi"
69 --localkeys) LocalKeys
=1
74 --drivers) InstallDrivers
=1
76 * ) echo "Usage: $0 [--esp | --usedefault {device-file}] [--drivers] "
77 echo " [--shim {shim-filename}] [--localkeys]"
82 if [[ $InstallToEspOnMac == 1 && $TargetDir == '/EFI/BOOT' ]] ; then
83 echo "You may use --esp OR --usedefault, but not both! Aborting!"
89 # Abort if the rEFInd files can't be found.
90 # Also sets $ConfFile to point to the configuration file,
91 # $IconsDir to point to the icons directory, and
92 # $ShimSource to the source of the shim.efi file (if necessary).
94 # Note: This check is satisfied if EITHER the 32- or the 64-bit version
95 # is found, even on the wrong platform. This is because the platform
96 # hasn't yet been determined. This could obviously be improved, but it
97 # would mean restructuring lots more code....
98 if [[ ! -f $RefindDir/refind_ia32.efi
&& ! -f $RefindDir/refind_x64.efi
]] ; then
99 echo "The rEFInd binary file is missing! Aborting installation!"
103 if [[ -f $RefindDir/refind.conf-sample
]] ; then
104 ConfFile
=$RefindDir/refind.conf-sample
105 elif [[ -f $ThisDir/refind.conf-sample
]] ; then
106 ConfFile
=$ThisDir/refind.conf-sample
108 echo "The sample configuration file is missing! Aborting installation!"
112 if [[ -d $RefindDir/icons
]] ; then
113 IconsDir
=$RefindDir/icons
114 elif [[ -d $ThisDir/icons
]] ; then
115 IconsDir
=$ThisDir/icons
117 echo "The icons directory is missing! Aborting installation!"
121 if [[ $ShimSource != "none" ]] ; then
122 if [[ -f $ShimSource ]] ; then
123 TargetX64
="grubx64.efi"
124 MokManagerSource
=`dirname $ShimSource`/MokManager.efi
126 echo "The specified shim file, $ShimSource, doesn't exist!"
127 echo "Aborting installation!"
133 # Helper for CopyRefindFiles; copies shim files (including MokManager, if it's
134 # available) to target.
136 cp $ShimSource $InstallDir/$TargetDir/$TargetShim
137 if [[ $?
!= 0 ]] ; then
140 if [[ -f $MokManagerSource ]] ; then
141 cp $MokManagerSource $InstallDir/$TargetDir/
143 if [[ $?
!= 0 ]] ; then
148 # Copy the public keys to the installation medium
150 if [[ $LocalKeys == 1 ]] ; then
151 cp $EtcKeysDir/$LocalKeysBase.cer
$InstallDir/$TargetDir
152 cp $EtcKeysDir/$LocalKeysBase.crt
$InstallDir/$TargetDir
154 cp $ThisDir/refind.cer
$InstallDir/$TargetDir
155 cp $ThisDir/refind.crt
$InstallDir/$TargetDir
159 # Copy the rEFInd files to the ESP or OS X root partition.
160 # Sets Problems=1 if any critical commands fail.
162 mkdir
-p $InstallDir/$TargetDir &> /dev
/null
163 if [[ $TargetDir == '/EFI/BOOT' ]] ; then
164 cp $RefindDir/refind_ia32.efi
$InstallDir/$TargetDir/$TargetIA32 2> /dev
/null
165 if [[ $?
!= 0 ]] ; then
166 echo "Note: IA32 (x86) binary not installed!"
168 cp $RefindDir/refind_x64.efi
$InstallDir/$TargetDir/$TargetX64 2> /dev
/null
169 if [[ $?
!= 0 ]] ; then
172 if [[ $ShimSource != "none" ]] ; then
173 TargetShim
="bootx64.efi"
176 if [[ $InstallDrivers == 1 ]] ; then
177 cp -r $RefindDir/drivers_
* $InstallDir/$TargetDir/ 2> /dev
/null
178 cp -r $ThisDir/drivers_
* $InstallDir/$TargetDir/ 2> /dev
/null
182 elif [[ $Platform == 'EFI32' ]] ; then
183 cp $RefindDir/refind_ia32.efi
$InstallDir/$TargetDir/$TargetIA32
184 if [[ $?
!= 0 ]] ; then
187 if [[ $InstallDrivers == 1 ]] ; then
188 mkdir
-p $InstallDir/$TargetDir/drivers_ia32
189 cp $RefindDir/drivers_ia32
/*_ia32.efi
$InstallDir/$TargetDir/drivers_ia32
/ 2> /dev
/null
190 cp $ThisDir/drivers_ia32
/*_ia32.efi
$InstallDir/$TargetDir/drivers_ia32
/ 2> /dev
/null
192 Refind
="refind_ia32.efi"
193 elif [[ $Platform == 'EFI64' ]] ; then
194 cp $RefindDir/refind_x64.efi
$InstallDir/$TargetDir/$TargetX64
195 if [[ $?
!= 0 ]] ; then
198 if [[ $InstallDrivers == 1 ]] ; then
199 mkdir
-p $InstallDir/$TargetDir/drivers_x64
200 cp $RefindDir/drivers_x64
/*_x64.efi
$InstallDir/$TargetDir/drivers_x64
/ 2> /dev
/null
201 cp $ThisDir/drivers_x64
/*_x64.efi
$InstallDir/$TargetDir/drivers_x64
/ 2> /dev
/null
203 Refind
="refind_x64.efi"
205 if [[ $ShimSource != "none" ]] ; then
206 TargetShim
=`basename $ShimSource`
209 if [[ $LocalKeys == 0 ]] ; then
210 echo "Storing copies of rEFInd Secure Boot public keys in $EtcKeysDir"
212 cp $ThisDir/refind.cer
$EtcKeysDir
213 cp $ThisDir/refind.crt
$EtcKeysDir
217 echo "Unknown platform! Aborting!"
220 echo "Copied rEFInd binary files"
222 if [[ -d $InstallDir/$TargetDir/icons
]] ; then
223 rm -rf $InstallDir/$TargetDir/icons-backup
&> /dev
/null
224 mv -f $InstallDir/$TargetDir/icons
$InstallDir/$TargetDir/icons-backup
225 echo "Notice: Backed up existing icons directory as icons-backup."
227 cp -r $IconsDir $InstallDir/$TargetDir
228 if [[ $?
!= 0 ]] ; then
231 if [[ -f $InstallDir/$TargetDir/refind.conf
]] ; then
232 echo "Existing refind.conf file found; copying sample file as refind.conf-sample"
233 echo "to avoid overwriting your customizations."
235 cp -f $ConfFile $InstallDir/$TargetDir
236 if [[ $?
!= 0 ]] ; then
240 echo "Copying sample configuration file as refind.conf; edit this file to configure"
243 cp -f $ConfFile $InstallDir/$TargetDir/refind.conf
244 if [[ $?
!= 0 ]] ; then
248 if [[ $DeleteRefindDir == 1 ]] ; then
249 echo "Deleting the temporary directory $RefindDir"
252 } # CopyRefindFiles()
254 # Mount the partition the user specified with the --usedefault option
255 MountDefaultTarget
() {
256 InstallDir
=/tmp
/refind_install
258 if [[ $OSName == 'Darwin' ]] ; then
259 mount
-t msdos
$TargetPart $InstallDir
260 elif [[ $OSName == 'Linux' ]] ; then
261 mount
-t vfat
$TargetPart $InstallDir
263 if [[ $?
!= 0 ]] ; then
264 echo "Couldn't mount $TargetPart ! Aborting!"
269 } # MountDefaultTarget()
272 # A series of OS X support functions....
275 # Mount the ESP at /Volumes/ESP or determine its current mount
277 # Sets InstallDir to the ESP mount point
278 # Sets UnmountEsp if we mounted it
280 # Identify the ESP. Note: This returns the FIRST ESP found;
281 # if the system has multiple disks, this could be wrong!
282 Temp
=`diskutil list | grep " EFI "`
283 Esp
=/dev
/`echo $Temp | cut -f 5 -d ' '`
284 # If the ESP is mounted, use its current mount point....
285 Temp
=`df | grep $Esp`
286 InstallDir
=`echo $Temp | cut -f 6 -d ' '`
287 if [[ $InstallDir == '' ]] ; then
288 mkdir
/Volumes
/ESP
&> /dev
/null
289 mount
-t msdos
$Esp /Volumes
/ESP
290 if [[ $?
!= 0 ]] ; then
291 echo "Unable to mount ESP! Aborting!\n"
295 InstallDir
="/Volumes/ESP"
299 # Control the OS X installation.
300 # Sets Problems=1 if problems found during the installation.
302 echo "Installing rEFInd on OS X...."
303 if [[ $TargetDir == "/EFI/BOOT" ]] ; then
305 elif [[ $InstallToEspOnMac == "1" ]] ; then
310 echo "Installing rEFInd to the partition mounted at '$InstallDir'"
311 Platform
=`ioreg -l -p IODeviceTree | grep firmware-abi | cut -d "\"" -f 4`
313 if [[ $InstallToEspOnMac == "1" ]] ; then
314 bless
--mount $InstallDir --setBoot --file $InstallDir/$TargetDir/$Refind
315 elif [[ $TargetDir != "/EFI/BOOT" ]] ; then
316 bless
--setBoot --folder $InstallDir/$TargetDir --file $InstallDir/$TargetDir/$Refind
318 if [[ $?
!= 0 ]] ; then
321 if [[ -f /Library
/StartupItems
/rEFItBlesser ||
-d /Library
/StartupItems
/rEFItBlesser
]] ; then
323 echo "/Library/StartupItems/rEFItBlesser found!"
324 echo "This program is part of rEFIt, and will cause rEFInd to fail to work after"
325 echo -n "its first boot. Do you want to remove rEFItBlesser (Y/N)? "
327 if [[ $YesNo == "Y" ||
$YesNo == "y" ]] ; then
328 echo "Deleting /Library/StartupItems/rEFItBlesser..."
329 rm -r /Library
/StartupItems
/rEFItBlesser
331 echo "Not deleting rEFItBlesser."
335 echo "WARNING: If you have an Advanced Format disk, *DO NOT* attempt to check the"
336 echo "bless status with 'bless --info', since this is known to cause disk corruption"
337 echo "on some systems!!"
343 # Now a series of Linux support functions....
346 # Check for evidence that we're running in Secure Boot mode. If so, and if
347 # appropriate options haven't been set, warn the user and offer to abort.
348 # If we're NOT in Secure Boot mode but the user HAS specified the --shim
349 # or --localkeys option, warn the user and offer to abort.
351 VarFile
=`ls -d /sys/firmware/efi/vars/SecureBoot* 2> /dev/null`
352 if [[ -n $VarFile && $TargetDir != '/EFI/BOOT' && $ShimSource == "none" ]] ; then
354 echo "CAUTION: The computer seems to have been booted with Secure Boot active, but"
355 echo "you haven't specified a valid shim.efi file source. The resulting installation"
356 echo "will not boot unless you disable Secure Boot. You may continue, but you should"
357 echo "consider using --shim to specify a working shim.efi file. You can read more"
358 echo "about this topic at http://www.rodsbooks.com/refind/secureboot.html."
360 echo -n "Do you want to proceed with installation (Y/N)? "
362 if [[ $ContYN == "Y" ||
$ContYN == "y" ]] ; then
363 echo "OK; continuing with the installation..."
369 if [[ $ShimSource != "none" && ! -n $VarFile ]] ; then
371 echo "You've specified installing using a shim.efi file, but your computer does not"
372 echo "appear to be running in Secure Boot mode. Although installing in this way"
373 echo "should work, it's unnecessarily complex. You may continue, but unless you"
374 echo "plan to enable Secure Boot, you should consider stopping and omitting the"
375 echo "--shim option. You can read more about this topic at"
376 echo "http://www.rodsbooks.com/refind/secureboot.html."
378 echo -n "Do you want to proceed with installation (Y/N)? "
380 if [[ $ContYN == "Y" ||
$ContYN == "y" ]] ; then
381 echo "OK; continuing with the installation..."
387 if [[ $LocalKeys != 0 && ! -n $VarFile ]] ; then
389 echo "You've specified re-signing your rEFInd binaries with locally-generated keys,"
390 echo "but your computer does not appear to be running in Secure Boot mode. The"
391 echo "keys you generate will be useless unless you enable Secure Boot. You may"
392 echo "proceed with this installation, but before you do so, you may want to read"
393 echo "more about it at http://www.rodsbooks.com/refind/secureboot.html."
395 echo -n "Do you want to proceed with installation (Y/N)? "
397 if [[ $ContYN == "Y" ||
$ContYN == "y" ]] ; then
398 echo "OK; continuing with the installation..."
404 } # CheckSecureBoot()
406 # Check for the presence of locally-generated keys from a previous installation in
407 # $EtcKeysDir (/etc/refind.d/keys). If they're not present, generate them using
410 PrivateKey
=$EtcKeysDir/$LocalKeysBase.key
411 CertKey
=$EtcKeysDir/$LocalKeysBase.crt
412 DerKey
=$EtcKeysDir/$LocalKeysBase.cer
413 OpenSSL
=`which openssl 2> /dev/null`
415 # Do the work only if one or more of the necessary keys is missing
416 # TODO: Technically, we don't need the DerKey; but if it's missing and openssl
417 # is also missing, this will fail. This could be improved.
418 if [[ ! -f $PrivateKey ||
! -f $CertKey ||
! -f $DerKey ]] ; then
419 echo "Generating a fresh set of local keys...."
421 chmod 0700 $EtcKeysDir
422 if [[ ! -x $OpenSSL ]] ; then
423 echo "Can't find openssl, which is required to create your private signing keys!"
427 if [[ -f $PrivateKey ]] ; then
428 echo "Backing up existing $PrivateKey"
429 cp -f $PrivateKey $PrivateKey.backup
2> /dev
/null
431 if [[ -f $CertKey ]] ; then
432 echo "Backing up existing $CertKey"
433 cp -f $CertKey $CertKey.backup
2> /dev
/null
435 if [[ -f $DerKey ]] ; then
436 echo "Backing up existing $DerKey"
437 cp -f $DerKey $DerKey.backup
2> /dev
/null
439 $OpenSSL req
-new -x509 -newkey rsa
:2048 -keyout $PrivateKey -out $CertKey \
440 -nodes -days 3650 -subj "/CN=Locally-generated rEFInd key/"
441 $OpenSSL x509
-in $CertKey -out $DerKey -outform DER
442 chmod 0600 $PrivateKey
444 echo "Using existing local keys...."
448 # Sign a single binary. Requires parameters:
450 # $2 = destination file
451 # Also assumes that the SBSign, PESign, UseSBSign, UsePESign, and various key variables are set
453 # Aborts script on error
455 $SBSign --key $PrivateKey --cert $CertKey --output $2 $1
456 if [[ $?
!= 0 ]] ; then
457 echo "Problem signing the binary $1! Aborting!"
462 # Re-sign the x86-64 binaries with a locally-generated key, First look for appropriate
463 # key files in $EtcKeysDir. If they're present, use them to re-sign the binaries. If
464 # not, try to generate new keys and store them in $EtcKeysDir.
466 SBSign
=`which sbsign 2> /dev/null`
467 echo "Found sbsign at $SBSign"
468 TempDir
="/tmp/refind_local"
469 if [[ ! -x $SBSign ]] ; then
470 echo "Can't find sbsign, which is required to sign rEFInd with your own keys!"
475 mkdir
-p $TempDir/drivers_x64
476 cp $RefindDir/refind.conf-sample
$TempDir 2> /dev
/null
477 cp $ThisDir/refind.conf-sample
$TempDir 2> /dev
/null
478 cp $RefindDir/refind_ia32.efi
$TempDir
479 cp -a $RefindDir/drivers_ia32
$TempDir 2> /dev
/null
480 cp -a $ThisDir/drivers_ia32
$TempDir 2> /dev
/null
481 SignOneBinary
$RefindDir/refind_x64.efi
$ThisDir/refind_x64.efi
482 for Driver
in `ls $RefindDir/drivers_x64/*.efi $ThisDir/drivers_x64/*.efi 2> /dev/null` ; do
483 TempName
=`basename $Driver`
484 SignOneBinary
$Driver $TempDir/drivers_x64
/$TempName
490 # Identifies the ESP's location (/boot or /boot/efi); aborts if
491 # the ESP isn't mounted at either location.
492 # Sets InstallDir to the ESP mount point.
494 EspLine
=`df /boot/efi | grep boot`
495 InstallDir
=`echo $EspLine | cut -d " " -f 6`
496 EspFilesystem
=`grep $InstallDir /etc/mtab | cut -d " " -f 3`
497 if [[ $EspFilesystem != 'vfat' ]] ; then
498 echo "/boot/efi doesn't seem to be on a VFAT filesystem. The ESP must be mounted at"
499 echo "/boot or /boot/efi and it must be VFAT! Aborting!"
502 echo "ESP was found at $InstallDir using $EspFilesystem"
505 # Uses efibootmgr to add an entry for rEFInd to the EFI's NVRAM.
506 # If this fails, sets Problems=1
509 Efibootmgr
=`which efibootmgr 2> /dev/null`
510 if [[ $Efibootmgr ]] ; then
511 modprobe efivars
&> /dev
/null
512 InstallDisk
=`grep $InstallDir /etc/mtab | cut -d " " -f 1 | cut -c 1-8`
513 PartNum
=`grep $InstallDir /etc/mtab | cut -d " " -f 1 | cut -c 9-10`
514 EntryFilename
=$TargetDir/$Refind
515 EfiEntryFilename
=`echo ${EntryFilename//\//\\\}`
516 EfiEntryFilename2
=`echo ${EfiEntryFilename} | sed s/\\\\\\\\/\\\\\\\\\\\\\\\\/g`
517 ExistingEntry
=`$Efibootmgr -v | grep $EfiEntryFilename2`
518 # NOTE: Below protects against duplicate entries, but only for non-Secure Boot
520 # TODO: Improve to detect & protect against duplicating a Secure Boot entry.
521 if [[ $ExistingEntry && $ShimSource == "none" ]] ; then
522 ExistingEntryBootNum
=`echo $ExistingEntry | cut -c 5-8`
523 FirstBoot
=`$Efibootmgr | grep BootOrder | cut -c 12-15`
524 if [[ $ExistingEntryBootNum != $FirstBoot ]] ; then
525 echo "An existing rEFInd boot entry exists, but isn't set as the default boot"
526 echo "manager. The boot order is being adjusted to make rEFInd the default boot"
527 echo "manager. If this is NOT what you want, you should use efibootmgr to"
528 echo "manually adjust your EFI's boot order."
529 $Efibootmgr -b $ExistingEntryBootNum -B &> /dev
/null
535 if [[ $InstallIt == "1" ]] ; then
536 echo "Installing it!"
537 $Efibootmgr -c -l $EfiEntryFilename -L rEFInd
-d $InstallDisk -p $PartNum &> /dev
/null
538 if [[ $?
!= 0 ]] ; then
547 if [[ $EfibootmgrProblems ]] ; then
549 echo "ALERT: There were problems running the efibootmgr program! You may need to"
550 echo "rename the $Refind binary to the default name (EFI/boot/bootx64.efi"
551 echo "on x86-64 systems or EFI/boot/bootia32.efi on x86 systems) to have it run!"
556 # Create a minimal/sample refind_linux.conf file in /boot.
557 GenerateRefindLinuxConf
() {
558 if [[ ! -f /boot
/refind_linux.conf
]] ; then
559 if [[ -f /etc
/default
/grub
]] ; then
560 # We want the default options used by the distribution, stored here....
561 source /etc
/default
/grub
563 RootFS
=`df / | grep dev | cut -f 1 -d " "`
564 StartOfDevname
=`echo $RootFS | cut -b 1-7`
565 if [[ $StartOfDevname == "/dev/sd" ||
$StartOfDevName == "/dev/hd" ]] ; then
566 # Identify root filesystem by UUID rather than by device node, if possible
567 Uuid
=`blkid -o export $RootFS 2> /dev/null | grep UUID=`
568 if [[ -n $Uuid ]] ; then
572 DefaultOptions
="$GRUB_CMDLINE_LINUX $GRUB_CMDLINE_LINUX_DEFAULT"
573 echo "\"Boot with standard options\" \"ro root=$RootFS $DefaultOptions \"" > $RLConfFile
574 echo "\"Boot to single-user mode\" \"ro root=$RootFS $DefaultOptions single\"" >> $RLConfFile
578 # Controls rEFInd installation under Linux.
579 # Sets Problems=1 if something goes wrong.
581 echo "Installing rEFInd on Linux...."
582 if [[ $TargetDir == "/EFI/BOOT" ]] ; then
588 if [[ $CpuType == 'x86_64' ]] ; then
590 if [[ $LocalKeys == 1 ]] ; then
593 elif [[ $CpuType == 'i386' ||
$CpuType == 'i486' ||
$CpuType == 'i586' ||
$CpuType == 'i686' ]] ; then
594 if [[ $ShimSource != "none" && $TargetDir != "/BOOT/EFI" ]] ; then
596 echo "CAUTION: Neither rEFInd nor shim currently supports 32-bit systems, so you"
597 echo "should not use the --shim option to install on such systems. Aborting!"
603 echo "CAUTION: This Linux installation uses a 32-bit kernel. 32-bit EFI-based"
604 echo "computers are VERY RARE. If you've installed a 32-bit version of Linux"
605 echo "on a 64-bit computer, you should manually install the 64-bit version of"
606 echo "rEFInd. If you're installing on a Mac, you should do so from OS X. If"
607 echo "you're positive you want to continue with this installation, answer 'Y'"
608 echo "to the following question..."
610 echo -n "Are you sure you want to continue (Y/N)? "
612 if [[ $ContYN == "Y" ||
$ContYN == "y" ]] ; then
613 echo "OK; continuing with the installation..."
618 echo "Unknown CPU type '$CpuType'; aborting!"
623 if [[ $TargetDir != "/EFI/BOOT" ]] ; then
625 GenerateRefindLinuxConf
630 # The main part of the script. Sets a few environment variables,
631 # performs a few startup checks, and then calls functions to
632 # install under OS X or Linux, depending on the detected platform.
637 ThisDir
="$( cd -P "$
( dirname "${BASH_SOURCE[0]}" )" && pwd )"
638 RefindDir
="$ThisDir/refind"
639 ThisScript
="$ThisDir/`basename $0`"
640 if [[ `whoami` != "root" ]] ; then
641 echo "Not running as root; attempting to elevate privileges via sudo...."
642 sudo
$ThisScript "$@"
643 if [[ $?
!= 0 ]] ; then
644 echo "This script must be run as root (or using sudo). Exiting!"
651 if [[ $OSName == 'Darwin' ]] ; then
652 if [[ $ShimDir != "none" ]] ; then
653 echo "The --shim option is not supported on OS X! Exiting!"
656 if [[ $LocalKeys != 0 ]] ; then
657 echo "The --localkeys option is not supported on OS X! Exiting!"
661 elif [[ $OSName == 'Linux' ]] ; then
664 echo "Running on unknown OS; aborting!"
667 if [[ $Problems ]] ; then
670 echo "Installation has completed, but problems were detected. Review the output for"
671 echo "error messages and take corrective measures as necessary. You may need to"
672 echo "re-run this script or install manually before rEFInd will work."
676 echo "Installation has completed successfully."
680 if [[ $UnmountEsp ]] ; then
681 echo "Unmounting install dir"
685 if [[ $InstallDir == /tmp
/refind_install
]] ; then