Chameleon

Chameleon Svn Source Tree

Root/branches/ErmaC/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: for example, boot0
11# Receives stage0Loaderdualboot: for example, boot0md
12# Receives targetDisk: for example, /dev/disk3
13# Receives targetResources: location of fdisk440
14# Receives targetVolume: for example, /Volumes/USB
15# Receives scriptDir: The location of the main script dir.
16
17
18if [ "$#" -eq 7 ]; then
19disksignature="$1"
20stage0Loader="$2"
21stage0Loaderdualboot="$3"
22targetDisk="$4"
23targetResources="$5"
24targetVolume="$6"
25scriptDir="$7"
26echo "DEBUG: passed argument for disksignature = $disksignature"
27echo "DEBUG: passed argument for stage0Loader = $stage0Loader"
28echo "DEBUG: passed argument for stage0Loaderdualboot = $stage0Loaderdualboot"
29echo "DEBUG: passed argument for targetDisk = $targetDisk"
30echo "DEBUG: passed argument for targetResources = $targetResources"
31echo "DEBUG: passed argument for targetVolume = $targetVolume"
32echo "DEBUG: passed argument for scriptDir = $scriptDir"
33else
34echo "Error - wrong number of values passed"
35exit 9
36fi
37
38
39if [ ${disksignature} = "0" ]; then
40
41
42echo "Executing command: ${targetResources}fdisk440 -u -f /usr/standalone/i386/${stage0Loader} -y ${targetDisk}"
43"${targetResources}"fdisk440 -u -f "${targetVolume}"/usr/standalone/i386/${stage0Loader} -y ${targetDisk}
44 "$scriptDir"InstallLog.sh "${targetVolume}" "Written ${stage0Loader} to ${targetDisk}."
45else
46# Windows is also installed on the HDD so we need to write boot0md
47
48echo "Executing command: ${targetResources}fdisk440 -u -f /usr/standalone/i386/${stage0Loaderdualboot} -y ${targetDisk}"
49"${targetResources}"fdisk440 -u -f "${targetVolume}"/usr/standalone/i386/${stage0Loaderdualboot} -y ${targetDisk}
50 "$scriptDir"InstallLog.sh "${targetVolume}" "Written ${stage0Loaderdualboot} to ${targetDisk}."
51fi
52
53
54echo "-----------------------------------------------"
55echo ""
56echo ""
57
58exit 0

Archive Download this file

Revision: 1612