Chameleon

Chameleon Svn Source Tree

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

  • Property svn:executable set to *
1#!/bin/bash
2
3echo "==============================================="
4echo "Write Chameleon Stage 0 Loader:"
5echo "*******************************"
6
7# Writes Chameleon stage 0 loader.
8
9# Receives disksignature: 0 = Windows not found, 1 = Windows Found
10# Receives stage0Loader: Name of file - boot0
11# Receives stage0Loaderdualboot: Name of file - boot0hfs
12# Receives targetDisk: for example, /dev/disk3
13# Receives targetVolume: for example, /Volumes/USB
14# Receives scriptDir: The location of the main script dir.
15
16
17if [ "$#" -eq 6 ]; then
18disksignature="$1"
19stage0Loader="$2"
20stage0Loaderdualboot="$3"
21targetDisk="$4"
22targetVolume="$5"
23scriptDir="$6"
24echo "DEBUG: passed argument for disksignature = $disksignature"
25echo "DEBUG: passed argument for stage0Loader = $stage0Loader"
26echo "DEBUG: passed argument for stage0Loaderdualboot = $stage0Loaderdualboot"
27echo "DEBUG: passed argument for targetDisk = $targetDisk"
28echo "DEBUG: passed argument for targetVolume = $targetVolume"
29echo "DEBUG: passed argument for scriptDir = $scriptDir"
30else
31echo "Error - wrong number of values passed"
32exit 9
33fi
34
35
36if [ ${disksignature} = "0" ]; then
37
38
39echo "Executing command: fdisk440 -u -f /usr/standalone/i386/${stage0Loader} -y ${targetDisk}"
40"${scriptDir}"/Tools/fdisk440 -u -f "${targetVolume}"/usr/standalone/i386/${stage0Loader} -y ${targetDisk}
41"$scriptDir"InstallLog.sh "${targetVolume}" "Written boot0 to ${targetDisk}."
42else
43# Windows is also installed on the HDD so we need to write boot0hfs
44
45echo "Executing command: /fdisk440 -u -f /usr/standalone/i386/${stage0Loaderdualboot} -y ${targetDisk}"
46"${scriptDir}"/Tools/fdisk440 -u -f "${targetVolume}"/usr/standalone/i386/${stage0Loaderdualboot} -y ${targetDisk}
47"$scriptDir"InstallLog.sh "${targetVolume}" "Written boot0hfs to ${targetDisk}."
48fi
49
50
51echo "-----------------------------------------------"
52echo ""
53echo ""
54
55exit 0

Archive Download this file

Revision: 1545