Chameleon

Chameleon Svn Source Tree

Root/branches/blackosx/package/Scripts/Sub/MountESP.sh

  • Property svn:executable set to *
1#!/bin/bash
2
3echo "==============================================="
4echo "MountESP: Mount the EFI system partition"
5echo "***********************************************"
6
7# Creates a mountpoint and mounts /Volumes/EFI of the
8# supplied disk which would have been pre-checked as using a GPT
9
10# Receives targetDisk: for example /dev/disk2.
11# Receives installerVolume: Volume to write the installer log to.
12# Receives scriptDir: The location of the main script dir.
13
14if [ "$#" -eq 3 ]; then
15targetDisk="$1"
16installerVolume="$2"
17scriptDir="$3"
18echo "DEBUG: passed argument for targetDisk = $targetDisk"
19echo "DEBUG: passed argument for installerVolume = $installerVolume"
20echo "DEBUG: passed argument for scriptDir = $scriptDir"
21else
22echo "Error - wrong number of values passed"
23exit 9
24fi
25
26
27# Does the mountpoint exist?
28if [ ! -e "/Volumes/EFI" ]; then
29mkdir -p "/Volumes/EFI"
30fi
31
32# Mount '/Volumes/EFI' using the correct format type
33if [ "$( fstyp "${targetDisk}"s1 | grep hfs )" ]; then
34"$scriptDir"InstallLog.sh "${installerVolume}" "Mounting ${targetDisk}s1 as /Volumes/EFI"
35mount_hfs "${targetDisk}"s1 "/Volumes/EFI"
36fi
37if [ "$( fstyp "${targetDisk}"s1 | grep msdos )" ]; then
38"$scriptDir"InstallLog.sh "${installerVolume}" "Mounting ${targetDisk}s1 as /Volumes/EFI"
39mount_msdos -u 0 -g 0 "${targetDisk}"s1 "/Volumes/EFI"
40fi
41
42exit 0

Archive Download this file

Revision: 1637