Chameleon

Chameleon Svn Source Tree

Root/branches/blackosx/package/Scripts/Install/CheckProceed.sh

  • Property svn:executable set to *
1#!/bin/bash
2
3echo "==============================================="
4echo "Check Proceed: Can the script continue?"
5echo "***************************************"
6
7# Checks the selected volume is present and the disk
8# is partitioned.
9
10# Receives targetVolumeTemp: Stores original target if EFI install selected.
11# Receives targetVolume: Stores '/Volumes/EFI' if EFI install, or blank if not.
12# Receives targetDevice: Stores device number: for example /dev/disk2s1.
13# Receives scriptDir: The location of the main script dir.
14
15if [ "$#" -eq 4 ]; then
16targetVolumeTemp="$1"
17targetVolume="$2"
18targetDevice="$3"
19scriptDir="$4"
20echo "DEBUG: passed argument for targetVolumeTemp = $targetVolumeTemp"
21echo "DEBUG: passed argument for targetVolume = $targetVolume"
22echo "DEBUG: passed argument for targetDevice = $targetDevice"
23echo "DEBUG: passed argument for scriptDir = $scriptDir"
24else
25echo "Error - wrong number of values passed"
26exit 9
27fi
28
29if [ -z "$targetVolume" ]; then
30echo "*** Cannot find the volume. Exiting."
31"$scriptDir"InstallLog.sh "${targetVolumeTemp}" "Cannot file the volume."
32exit 1
33else
34echo "Confirming target volume exists"
35fi
36
37if [ "$targetDevice" = "$targetDevice#*disk*s" ]; then
38echo "*** ERROR Volume does not use slices. Exiting."
39"$scriptDir"InstallLog.sh "${targetVolumeTemp}" "The selected volume doesn't use slices."
40exit 1
41else
42echo "Confirming target device uses slices"
43fi
44
45# Add check for installing to a 'small' HFS device like a
46# 1GB USB flash drive which won't have an EFI System Partition.
47
48if [ "$targetVolume" = "/Volumes/EFI" ]; then
49existESP=$( df | grep /dev/disk2s1 | awk {'print $6'} )
50if [ ! "$existESP" = "/Volumes/EFI" ]; then
51echo "*** The selected volume doesn't have an EFI System Partition. Exiting."
52"$scriptDir"InstallLog.sh "${targetVolumeTemp}" "The selected volume doesn't have an EFI System Partition."
53exit 1
54fi
55fi
56
57echo "-----------------------------------------------"
58echo ""
59
60exit 0

Archive Download this file

Revision: 1542