X-Git-Url: https://code.delx.au/refind/blobdiff_plain/fe0f3d769a97966be67a9a8c5404f574123f7b3a..278bed1cfa0a2bc31db18617cad24170014c05b3:/mountesp diff --git a/mountesp b/mountesp index e1c35a7..77bdc0a 100755 --- a/mountesp +++ b/mountesp @@ -1,4 +1,21 @@ #!/bin/bash +# +# Mac OS X script to locate and mount an EFI System Partition (ESP) +# +# Usage: +# +# ./mountesp +# +# This program is copyright (c) 2015 by Roderick W. Smith +# +# This program is licensed under the terms of the GNU GPL, version 3, +# or (at your option) any later version. +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# Revision history: +# +# 0.9.3 -- Initial release (with rEFInd 0.9.3) # Mount the ESP at /Volumes/ESP or determine its current mount # point. @@ -25,17 +42,22 @@ MountOSXESP() { fi fi Esp=/dev/`echo $Temp` + echo "The ESP has been identified as $Esp; attempting to mount it...." # If the ESP is mounted, use its current mount point.... Temp=`df -P | grep "$Esp "` MountPoint=`echo $Temp | cut -f 6- -d ' '` if [[ "$MountPoint" == '' ]] ; then + if [[ $UID != 0 ]] ; then + echo "You must run this program as root or using sudo! Exiting!" + exit 1 + fi MountPoint="/Volumes/ESP" mkdir /Volumes/ESP &> /dev/null - mount -t msdos "$Esp" /Volumes/ESP + mount -t msdos "$Esp" $MountPoint # Some systems have HFS+ "ESPs." They shouldn't, but they do. If this is # detected, mount it as such and set appropriate options. if [[ $? != 0 ]] ; then - mount -t hfs "$Esp" /Volumes/Esp + mount -t hfs "$Esp" $MountPoint if [[ $? != 0 ]] ; then echo "Unable to mount ESP!\n" exit 1 @@ -57,4 +79,4 @@ case "$OSTYPE" in echo "This script is meant to be run under OS X *ONLY*! Exiting!" exit ;; -esac \ No newline at end of file +esac