]>
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.1 -- Fixed bug that caused script failure under OS X
31 # 0.5.1 -- Added --shim & --localkeys options & create sample refind_linux.conf
33 # 0.5.0 -- Added --usedefault & --drivers options & changed "esp" option to "--esp"
34 # 0.4.5 -- Fixed check for rEFItBlesser in OS X
35 # 0.4.2 -- Added notice about BIOS-based OSes & made NVRAM changes in Linux smarter
36 # 0.4.1 -- Added check for rEFItBlesser in OS X
37 # 0.3.3.1 -- Fixed OS X 10.7 bug; also works as make target
38 # 0.3.2.1 -- Check for presence of source files; aborts if not present
39 # 0.3.2 -- Initial version
41 # Note: install.sh version numbers match those of the rEFInd package
42 # with which they first appeared.
45 EtcKeysDir
=/etc
/refind.d
/keys
46 LocalKeysBase
="refind_local"
48 TargetX64
="refind_x64.efi"
49 TargetIA32
="refind_ia32.efi"
54 # Functions used by both OS X and Linux....
60 while [[ $# -gt 0 ]]; do
62 --esp |
--ESP) InstallToEspOnMac
=1
64 --usedefault) TargetDir
=/EFI
/BOOT
66 TargetX64
="bootx64.efi"
67 TargetIA32
="bootia32.efi"
70 --localkeys) LocalKeys
=1
75 --drivers) InstallDrivers
=1
77 * ) echo "Usage: $0 [--esp | --usedefault {device-file}] [--drivers] "
78 echo " [--shim {shim-filename}] [--localkeys]"
83 if [[ $InstallToEspOnMac == 1 && $TargetDir == '/EFI/BOOT' ]] ; then
84 echo "You may use --esp OR --usedefault, but not both! Aborting!"
90 # Abort if the rEFInd files can't be found.
91 # Also sets $ConfFile to point to the configuration file,
92 # $IconsDir to point to the icons directory, and
93 # $ShimSource to the source of the shim.efi file (if necessary).
95 # Note: This check is satisfied if EITHER the 32- or the 64-bit version
96 # is found, even on the wrong platform. This is because the platform
97 # hasn't yet been determined. This could obviously be improved, but it
98 # would mean restructuring lots more code....
99 if [[ ! -f $RefindDir/refind_ia32.efi
&& ! -f $RefindDir/refind_x64.efi
]] ; then
100 echo "The rEFInd binary file is missing! Aborting installation!"
104 if [[ -f $RefindDir/refind.conf-sample
]] ; then
105 ConfFile
=$RefindDir/refind.conf-sample
106 elif [[ -f $ThisDir/refind.conf-sample
]] ; then
107 ConfFile
=$ThisDir/refind.conf-sample
109 echo "The sample configuration file is missing! Aborting installation!"
113 if [[ -d $RefindDir/icons
]] ; then
114 IconsDir
=$RefindDir/icons
115 elif [[ -d $ThisDir/icons
]] ; then
116 IconsDir
=$ThisDir/icons
118 echo "The icons directory is missing! Aborting installation!"
122 if [[ $ShimSource != "none" ]] ; then
123 if [[ -f $ShimSource ]] ; then
124 TargetX64
="grubx64.efi"
125 MokManagerSource
=`dirname $ShimSource`/MokManager.efi
127 echo "The specified shim file, $ShimSource, doesn't exist!"
128 echo "Aborting installation!"
134 # Helper for CopyRefindFiles; copies shim files (including MokManager, if it's
135 # available) to target.
137 cp $ShimSource $InstallDir/$TargetDir/$TargetShim
138 if [[ $?
!= 0 ]] ; then
141 if [[ -f $MokManagerSource ]] ; then
142 cp $MokManagerSource $InstallDir/$TargetDir/
144 if [[ $?
!= 0 ]] ; then
149 # Copy the public keys to the installation medium
151 if [[ $LocalKeys == 1 ]] ; then
152 cp $EtcKeysDir/$LocalKeysBase.cer
$InstallDir/$TargetDir
153 cp $EtcKeysDir/$LocalKeysBase.crt
$InstallDir/$TargetDir
155 cp $ThisDir/refind.cer
$InstallDir/$TargetDir
156 cp $ThisDir/refind.crt
$InstallDir/$TargetDir
160 # Copy the rEFInd files to the ESP or OS X root partition.
161 # Sets Problems=1 if any critical commands fail.
163 mkdir
-p $InstallDir/$TargetDir &> /dev
/null
164 if [[ $TargetDir == '/EFI/BOOT' ]] ; then
165 cp $RefindDir/refind_ia32.efi
$InstallDir/$TargetDir/$TargetIA32 2> /dev
/null
166 if [[ $?
!= 0 ]] ; then
167 echo "Note: IA32 (x86) binary not installed!"
169 cp $RefindDir/refind_x64.efi
$InstallDir/$TargetDir/$TargetX64 2> /dev
/null
170 if [[ $?
!= 0 ]] ; then
173 if [[ $ShimSource != "none" ]] ; then
174 TargetShim
="bootx64.efi"
177 if [[ $InstallDrivers == 1 ]] ; then
178 cp -r $RefindDir/drivers_
* $InstallDir/$TargetDir/ 2> /dev
/null
179 cp -r $ThisDir/drivers_
* $InstallDir/$TargetDir/ 2> /dev
/null
183 elif [[ $Platform == 'EFI32' ]] ; then
184 cp $RefindDir/refind_ia32.efi
$InstallDir/$TargetDir/$TargetIA32
185 if [[ $?
!= 0 ]] ; then
188 if [[ $InstallDrivers == 1 ]] ; then
189 mkdir
-p $InstallDir/$TargetDir/drivers_ia32
190 cp $RefindDir/drivers_ia32
/*_ia32.efi
$InstallDir/$TargetDir/drivers_ia32
/ 2> /dev
/null
191 cp $ThisDir/drivers_ia32
/*_ia32.efi
$InstallDir/$TargetDir/drivers_ia32
/ 2> /dev
/null
193 Refind
="refind_ia32.efi"
194 elif [[ $Platform == 'EFI64' ]] ; then
195 cp $RefindDir/refind_x64.efi
$InstallDir/$TargetDir/$TargetX64
196 if [[ $?
!= 0 ]] ; then
199 if [[ $InstallDrivers == 1 ]] ; then
200 mkdir
-p $InstallDir/$TargetDir/drivers_x64
201 cp $RefindDir/drivers_x64
/*_x64.efi
$InstallDir/$TargetDir/drivers_x64
/ 2> /dev
/null
202 cp $ThisDir/drivers_x64
/*_x64.efi
$InstallDir/$TargetDir/drivers_x64
/ 2> /dev
/null
204 Refind
="refind_x64.efi"
206 if [[ $ShimSource != "none" ]] ; then
207 TargetShim
=`basename $ShimSource`
210 if [[ $LocalKeys == 0 ]] ; then
211 echo "Storing copies of rEFInd Secure Boot public keys in $EtcKeysDir"
213 cp $ThisDir/refind.cer
$EtcKeysDir
214 cp $ThisDir/refind.crt
$EtcKeysDir
218 echo "Unknown platform! Aborting!"
221 echo "Copied rEFInd binary files"
223 if [[ -d $InstallDir/$TargetDir/icons
]] ; then
224 rm -rf $InstallDir/$TargetDir/icons-backup
&> /dev
/null
225 mv -f $InstallDir/$TargetDir/icons
$InstallDir/$TargetDir/icons-backup
226 echo "Notice: Backed up existing icons directory as icons-backup."
228 cp -r $IconsDir $InstallDir/$TargetDir
229 if [[ $?
!= 0 ]] ; then
232 if [[ -f $InstallDir/$TargetDir/refind.conf
]] ; then
233 echo "Existing refind.conf file found; copying sample file as refind.conf-sample"
234 echo "to avoid overwriting your customizations."
236 cp -f $ConfFile $InstallDir/$TargetDir
237 if [[ $?
!= 0 ]] ; then
241 echo "Copying sample configuration file as refind.conf; edit this file to configure"
244 cp -f $ConfFile $InstallDir/$TargetDir/refind.conf
245 if [[ $?
!= 0 ]] ; then
249 if [[ $DeleteRefindDir == 1 ]] ; then
250 echo "Deleting the temporary directory $RefindDir"
253 } # CopyRefindFiles()
255 # Mount the partition the user specified with the --usedefault option
256 MountDefaultTarget
() {
257 InstallDir
=/tmp
/refind_install
259 if [[ $OSName == 'Darwin' ]] ; then
260 mount
-t msdos
$TargetPart $InstallDir
261 elif [[ $OSName == 'Linux' ]] ; then
262 mount
-t vfat
$TargetPart $InstallDir
264 if [[ $?
!= 0 ]] ; then
265 echo "Couldn't mount $TargetPart ! Aborting!"
270 } # MountDefaultTarget()
273 # A series of OS X support functions....
276 # Mount the ESP at /Volumes/ESP or determine its current mount
278 # Sets InstallDir to the ESP mount point
279 # Sets UnmountEsp if we mounted it
281 # Identify the ESP. Note: This returns the FIRST ESP found;
282 # if the system has multiple disks, this could be wrong!
283 Temp
=`diskutil list | grep " EFI "`
284 Esp
=/dev
/`echo $Temp | cut -f 5 -d ' '`
285 # If the ESP is mounted, use its current mount point....
286 Temp
=`df | grep $Esp`
287 InstallDir
=`echo $Temp | cut -f 6 -d ' '`
288 if [[ $InstallDir == '' ]] ; then
289 mkdir
/Volumes
/ESP
&> /dev
/null
290 mount
-t msdos
$Esp /Volumes
/ESP
291 if [[ $?
!= 0 ]] ; then
292 echo "Unable to mount ESP! Aborting!\n"
296 InstallDir
="/Volumes/ESP"
300 # Control the OS X installation.
301 # Sets Problems=1 if problems found during the installation.
303 echo "Installing rEFInd on OS X...."
304 if [[ $TargetDir == "/EFI/BOOT" ]] ; then
306 elif [[ $InstallToEspOnMac == "1" ]] ; then
311 echo "Installing rEFInd to the partition mounted at '$InstallDir'"
312 Platform
=`ioreg -l -p IODeviceTree | grep firmware-abi | cut -d "\"" -f 4`
314 if [[ $InstallToEspOnMac == "1" ]] ; then
315 bless
--mount $InstallDir --setBoot --file $InstallDir/$TargetDir/$Refind
316 elif [[ $TargetDir != "/EFI/BOOT" ]] ; then
317 bless
--setBoot --folder $InstallDir/$TargetDir --file $InstallDir/$TargetDir/$Refind
319 if [[ $?
!= 0 ]] ; then
322 if [[ -f /Library
/StartupItems
/rEFItBlesser ||
-d /Library
/StartupItems
/rEFItBlesser
]] ; then
324 echo "/Library/StartupItems/rEFItBlesser found!"
325 echo "This program is part of rEFIt, and will cause rEFInd to fail to work after"
326 echo -n "its first boot. Do you want to remove rEFItBlesser (Y/N)? "
328 if [[ $YesNo == "Y" ||
$YesNo == "y" ]] ; then
329 echo "Deleting /Library/StartupItems/rEFItBlesser..."
330 rm -r /Library
/StartupItems
/rEFItBlesser
332 echo "Not deleting rEFItBlesser."
336 echo "WARNING: If you have an Advanced Format disk, *DO NOT* attempt to check the"
337 echo "bless status with 'bless --info', since this is known to cause disk corruption"
338 echo "on some systems!!"
344 # Now a series of Linux support functions....
347 # Check for evidence that we're running in Secure Boot mode. If so, and if
348 # appropriate options haven't been set, warn the user and offer to abort.
349 # If we're NOT in Secure Boot mode but the user HAS specified the --shim
350 # or --localkeys option, warn the user and offer to abort.
352 VarFile
=`ls -d /sys/firmware/efi/vars/SecureBoot* 2> /dev/null`
353 if [[ -n $VarFile && $TargetDir != '/EFI/BOOT' && $ShimSource == "none" ]] ; then
355 echo "CAUTION: The computer seems to have been booted with Secure Boot active, but"
356 echo "you haven't specified a valid shim.efi file source. The resulting installation"
357 echo "will not boot unless you disable Secure Boot. You may continue, but you should"
358 echo "consider using --shim to specify a working shim.efi file. You can read more"
359 echo "about this topic at http://www.rodsbooks.com/refind/secureboot.html."
361 echo -n "Do you want to proceed with installation (Y/N)? "
363 if [[ $ContYN == "Y" ||
$ContYN == "y" ]] ; then
364 echo "OK; continuing with the installation..."
370 if [[ $ShimSource != "none" && ! -n $VarFile ]] ; then
372 echo "You've specified installing using a shim.efi file, but your computer does not"
373 echo "appear to be running in Secure Boot mode. Although installing in this way"
374 echo "should work, it's unnecessarily complex. You may continue, but unless you"
375 echo "plan to enable Secure Boot, you should consider stopping and omitting the"
376 echo "--shim option. You can read more about this topic at"
377 echo "http://www.rodsbooks.com/refind/secureboot.html."
379 echo -n "Do you want to proceed with installation (Y/N)? "
381 if [[ $ContYN == "Y" ||
$ContYN == "y" ]] ; then
382 echo "OK; continuing with the installation..."
388 if [[ $LocalKeys != 0 && ! -n $VarFile ]] ; then
390 echo "You've specified re-signing your rEFInd binaries with locally-generated keys,"
391 echo "but your computer does not appear to be running in Secure Boot mode. The"
392 echo "keys you generate will be useless unless you enable Secure Boot. You may"
393 echo "proceed with this installation, but before you do so, you may want to read"
394 echo "more about it at http://www.rodsbooks.com/refind/secureboot.html."
396 echo -n "Do you want to proceed with installation (Y/N)? "
398 if [[ $ContYN == "Y" ||
$ContYN == "y" ]] ; then
399 echo "OK; continuing with the installation..."
405 } # CheckSecureBoot()
407 # Check for the presence of locally-generated keys from a previous installation in
408 # $EtcKeysDir (/etc/refind.d/keys). If they're not present, generate them using
411 PrivateKey
=$EtcKeysDir/$LocalKeysBase.key
412 CertKey
=$EtcKeysDir/$LocalKeysBase.crt
413 DerKey
=$EtcKeysDir/$LocalKeysBase.cer
414 OpenSSL
=`which openssl 2> /dev/null`
416 # Do the work only if one or more of the necessary keys is missing
417 # TODO: Technically, we don't need the DerKey; but if it's missing and openssl
418 # is also missing, this will fail. This could be improved.
419 if [[ ! -f $PrivateKey ||
! -f $CertKey ||
! -f $DerKey ]] ; then
420 echo "Generating a fresh set of local keys...."
422 chmod 0700 $EtcKeysDir
423 if [[ ! -x $OpenSSL ]] ; then
424 echo "Can't find openssl, which is required to create your private signing keys!"
428 if [[ -f $PrivateKey ]] ; then
429 echo "Backing up existing $PrivateKey"
430 cp -f $PrivateKey $PrivateKey.backup
2> /dev
/null
432 if [[ -f $CertKey ]] ; then
433 echo "Backing up existing $CertKey"
434 cp -f $CertKey $CertKey.backup
2> /dev
/null
436 if [[ -f $DerKey ]] ; then
437 echo "Backing up existing $DerKey"
438 cp -f $DerKey $DerKey.backup
2> /dev
/null
440 $OpenSSL req
-new -x509 -newkey rsa
:2048 -keyout $PrivateKey -out $CertKey \
441 -nodes -days 3650 -subj "/CN=Locally-generated rEFInd key/"
442 $OpenSSL x509
-in $CertKey -out $DerKey -outform DER
443 chmod 0600 $PrivateKey
445 echo "Using existing local keys...."
449 # Sign a single binary. Requires parameters:
451 # $2 = destination file
452 # Also assumes that the SBSign, PESign, UseSBSign, UsePESign, and various key variables are set
454 # Aborts script on error
456 $SBSign --key $PrivateKey --cert $CertKey --output $2 $1
457 if [[ $?
!= 0 ]] ; then
458 echo "Problem signing the binary $1! Aborting!"
463 # Re-sign the x86-64 binaries with a locally-generated key, First look for appropriate
464 # key files in $EtcKeysDir. If they're present, use them to re-sign the binaries. If
465 # not, try to generate new keys and store them in $EtcKeysDir.
467 SBSign
=`which sbsign 2> /dev/null`
468 echo "Found sbsign at $SBSign"
469 TempDir
="/tmp/refind_local"
470 if [[ ! -x $SBSign ]] ; then
471 echo "Can't find sbsign, which is required to sign rEFInd with your own keys!"
476 mkdir
-p $TempDir/drivers_x64
477 cp $RefindDir/refind.conf-sample
$TempDir 2> /dev
/null
478 cp $ThisDir/refind.conf-sample
$TempDir 2> /dev
/null
479 cp $RefindDir/refind_ia32.efi
$TempDir
480 cp -a $RefindDir/drivers_ia32
$TempDir 2> /dev
/null
481 cp -a $ThisDir/drivers_ia32
$TempDir 2> /dev
/null
482 SignOneBinary
$RefindDir/refind_x64.efi
$ThisDir/refind_x64.efi
483 for Driver
in `ls $RefindDir/drivers_x64/*.efi $ThisDir/drivers_x64/*.efi 2> /dev/null` ; do
484 TempName
=`basename $Driver`
485 SignOneBinary
$Driver $TempDir/drivers_x64
/$TempName
491 # Identifies the ESP's location (/boot or /boot/efi); aborts if
492 # the ESP isn't mounted at either location.
493 # Sets InstallDir to the ESP mount point.
495 EspLine
=`df /boot/efi | grep boot`
496 InstallDir
=`echo $EspLine | cut -d " " -f 6`
497 EspFilesystem
=`grep $InstallDir /etc/mtab | cut -d " " -f 3`
498 if [[ $EspFilesystem != 'vfat' ]] ; then
499 echo "/boot/efi doesn't seem to be on a VFAT filesystem. The ESP must be mounted at"
500 echo "/boot or /boot/efi and it must be VFAT! Aborting!"
503 echo "ESP was found at $InstallDir using $EspFilesystem"
506 # Uses efibootmgr to add an entry for rEFInd to the EFI's NVRAM.
507 # If this fails, sets Problems=1
510 Efibootmgr
=`which efibootmgr 2> /dev/null`
511 if [[ $Efibootmgr ]] ; then
512 modprobe efivars
&> /dev
/null
513 InstallDisk
=`grep $InstallDir /etc/mtab | cut -d " " -f 1 | cut -c 1-8`
514 PartNum
=`grep $InstallDir /etc/mtab | cut -d " " -f 1 | cut -c 9-10`
515 EntryFilename
=$TargetDir/$Refind
516 EfiEntryFilename
=`echo ${EntryFilename//\//\\\}`
517 EfiEntryFilename2
=`echo ${EfiEntryFilename} | sed s/\\\\\\\\/\\\\\\\\\\\\\\\\/g`
518 ExistingEntry
=`$Efibootmgr -v | grep $EfiEntryFilename2`
519 # NOTE: Below protects against duplicate entries, but only for non-Secure Boot
521 # TODO: Improve to detect & protect against duplicating a Secure Boot entry.
522 if [[ $ExistingEntry && $ShimSource == "none" ]] ; then
523 ExistingEntryBootNum
=`echo $ExistingEntry | cut -c 5-8`
524 FirstBoot
=`$Efibootmgr | grep BootOrder | cut -c 12-15`
525 if [[ $ExistingEntryBootNum != $FirstBoot ]] ; then
526 echo "An existing rEFInd boot entry exists, but isn't set as the default boot"
527 echo "manager. The boot order is being adjusted to make rEFInd the default boot"
528 echo "manager. If this is NOT what you want, you should use efibootmgr to"
529 echo "manually adjust your EFI's boot order."
530 $Efibootmgr -b $ExistingEntryBootNum -B &> /dev
/null
536 if [[ $InstallIt == "1" ]] ; then
537 echo "Installing it!"
538 $Efibootmgr -c -l $EfiEntryFilename -L rEFInd
-d $InstallDisk -p $PartNum &> /dev
/null
539 if [[ $?
!= 0 ]] ; then
548 if [[ $EfibootmgrProblems ]] ; then
550 echo "ALERT: There were problems running the efibootmgr program! You may need to"
551 echo "rename the $Refind binary to the default name (EFI/boot/bootx64.efi"
552 echo "on x86-64 systems or EFI/boot/bootia32.efi on x86 systems) to have it run!"
557 # Create a minimal/sample refind_linux.conf file in /boot.
558 GenerateRefindLinuxConf
() {
559 if [[ ! -f /boot
/refind_linux.conf
]] ; then
560 if [[ -f /etc
/default
/grub
]] ; then
561 # We want the default options used by the distribution, stored here....
562 source /etc
/default
/grub
564 RootFS
=`df / | grep dev | cut -f 1 -d " "`
565 StartOfDevname
=`echo $RootFS | cut -b 1-7`
566 if [[ $StartOfDevname == "/dev/sd" ||
$StartOfDevName == "/dev/hd" ]] ; then
567 # Identify root filesystem by UUID rather than by device node, if possible
568 Uuid
=`blkid -o export $RootFS 2> /dev/null | grep UUID=`
569 if [[ -n $Uuid ]] ; then
573 DefaultOptions
="$GRUB_CMDLINE_LINUX $GRUB_CMDLINE_LINUX_DEFAULT"
574 echo "\"Boot with standard options\" \"ro root=$RootFS $DefaultOptions \"" > $RLConfFile
575 echo "\"Boot to single-user mode\" \"ro root=$RootFS $DefaultOptions single\"" >> $RLConfFile
579 # Controls rEFInd installation under Linux.
580 # Sets Problems=1 if something goes wrong.
582 echo "Installing rEFInd on Linux...."
583 if [[ $TargetDir == "/EFI/BOOT" ]] ; then
589 if [[ $CpuType == 'x86_64' ]] ; then
591 if [[ $LocalKeys == 1 ]] ; then
594 elif [[ $CpuType == 'i386' ||
$CpuType == 'i486' ||
$CpuType == 'i586' ||
$CpuType == 'i686' ]] ; then
595 if [[ $ShimSource != "none" && $TargetDir != "/BOOT/EFI" ]] ; then
597 echo "CAUTION: Neither rEFInd nor shim currently supports 32-bit systems, so you"
598 echo "should not use the --shim option to install on such systems. Aborting!"
604 echo "CAUTION: This Linux installation uses a 32-bit kernel. 32-bit EFI-based"
605 echo "computers are VERY RARE. If you've installed a 32-bit version of Linux"
606 echo "on a 64-bit computer, you should manually install the 64-bit version of"
607 echo "rEFInd. If you're installing on a Mac, you should do so from OS X. If"
608 echo "you're positive you want to continue with this installation, answer 'Y'"
609 echo "to the following question..."
611 echo -n "Are you sure you want to continue (Y/N)? "
613 if [[ $ContYN == "Y" ||
$ContYN == "y" ]] ; then
614 echo "OK; continuing with the installation..."
619 echo "Unknown CPU type '$CpuType'; aborting!"
624 if [[ $TargetDir != "/EFI/BOOT" ]] ; then
626 GenerateRefindLinuxConf
631 # The main part of the script. Sets a few environment variables,
632 # performs a few startup checks, and then calls functions to
633 # install under OS X or Linux, depending on the detected platform.
638 ThisDir
="$( cd -P "$
( dirname "${BASH_SOURCE[0]}" )" && pwd )"
639 RefindDir
="$ThisDir/refind"
640 ThisScript
="$ThisDir/`basename $0`"
641 if [[ `whoami` != "root" ]] ; then
642 echo "Not running as root; attempting to elevate privileges via sudo...."
643 sudo
$ThisScript "$@"
644 if [[ $?
!= 0 ]] ; then
645 echo "This script must be run as root (or using sudo). Exiting!"
652 if [[ $OSName == 'Darwin' ]] ; then
653 if [[ $ShimSource != "none" ]] ; then
654 echo "The --shim option is not supported on OS X! Exiting!"
657 if [[ $LocalKeys != 0 ]] ; then
658 echo "The --localkeys option is not supported on OS X! Exiting!"
662 elif [[ $OSName == 'Linux' ]] ; then
665 echo "Running on unknown OS; aborting!"
668 if [[ $Problems ]] ; then
671 echo "Installation has completed, but problems were detected. Review the output for"
672 echo "error messages and take corrective measures as necessary. You may need to"
673 echo "re-run this script or install manually before rEFInd will work."
677 echo "Installation has completed successfully."
681 if [[ $UnmountEsp ]] ; then
682 echo "Unmounting install dir"
686 if [[ $InstallDir == /tmp
/refind_install
]] ; then