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

Archive Download this file

Revision: 1553