Chameleon

Chameleon Svn Source Tree

Root/trunk/package/Scripts/Sub/WriteChameleonStage2.sh

  • Property svn:executable set to *
1#!/bin/bash
2
3echo "==============================================="
4echo "Write Chameleon Stage 2 Loader:"
5echo "*******************************"
6
7# Receives stage2Loader: Name of file - boot
8# Receives selectedDestination: for example, /Volumes/ChameleonBootUSB (or /Volumes/EFI if ESP install).
9# Receives targetDevice: for example, /dev/disk3s1
10# Receives targetVolume: for example, /Volumes/ChameleonBootUSB
11# Receives scriptDir: The location of the main script dir.
12
13
14if [ "$#" -eq 5 ]; then
15stage2Loader="$1"
16selectedDestination="$2"
17targetDevice="$3"
18targetVolume="$4"
19scriptDir="$5"
20echo "DEBUG: passed argument for stage2Loader = $stage2Loader"
21echo "DEBUG: passed argument for selectedDestination = $selectedDestination"
22echo "DEBUG: passed argument for targetDevice = $targetDevice"
23echo "DEBUG: passed argument for targetVolume = $targetVolume"
24echo "DEBUG: passed argument for scriptDir = $scriptDir"
25else
26echo "Error - wrong number of values passed"
27exit 9
28fi
29
30# check to see if install to EFI system partition was selected
31if [ "${selectedDestination}" = "/Volumes/EFI" ]; then
32#echo "DEBUG: Executing command: cp "${targetVolume}"/usr/standalone/i386/${stage2Loader} ${selectedDestination}"
33cp "${targetVolume}"/usr/standalone/i386/"${stage2Loader}" "${selectedDestination}"
34"$scriptDir"InstallLog.sh "${targetVolume}" "Written boot to ${selectedDestination}."
35else
36#echo "DEBUG: Executing command: cp "${targetVolume}"/usr/standalone/i386/${stage2Loader} ${targetVolume}"
37cp "${targetVolume}"/usr/standalone/i386/"${stage2Loader}" "${targetVolume}"
38"$scriptDir"InstallLog.sh "${targetVolume}" "Written boot to ${targetVolume} on ${targetDevice}."
39fi
40
41
42#if [ -f "${selectedDestination}"/.Chameleon/nullhideboot ]; then
43#echo "Executing command: SetFile -a V ${targetVolume}/${stage2Loader}"
44#"${selectedDestination}"/.Chameleon/Resources/SetFile -a V "${targetVolume}"/"${stage2Loader}"
45#fi
46
47exit 0

Archive Download this file

Revision: 1677