1 | #!/bin/bash␊ |
2 | ␊ |
3 | echo "==============================================="␊ |
4 | echo "Write Chameleon Stage 0 Loader:"␊ |
5 | echo "*******************************"␊ |
6 | ␊ |
7 | |
8 | ␊ |
9 | if [ "$#" -eq 7 ]; then␊ |
10 | ␉diskupdate="$1"␊ |
11 | ␉disksignature="$2"␊ |
12 | ␉stage0Loader="$3"␊ |
13 | ␉stage0Loaderdualboot="$4"␊ |
14 | ␉targetDisk="$5"␊ |
15 | ␉targetVolume="$6"␊ |
16 | ␉scriptDir="$7"␊ |
17 | ␉echo "DEBUG: passed argument for diskupdate = $diskupdate"␊ |
18 | ␉echo "DEBUG: passed argument for disksignature = $disksignature"␊ |
19 | ␉echo "DEBUG: passed argument for stage0Loader = $stage0Loader"␊ |
20 | ␉echo "DEBUG: passed argument for stage0Loaderdualboot = $stage0Loaderdualboot"␊ |
21 | ␉echo "DEBUG: passed argument for targetDisk = $targetDisk"␊ |
22 | ␉echo "DEBUG: passed argument for targetVolume = $targetVolume"␊ |
23 | ␉echo "DEBUG: passed argument for scriptDir = $scriptDir"␊ |
24 | else␊ |
25 | ␉echo "Error - wrong number of values passed"␊ |
26 | ␉exit 9␊ |
27 | fi␊ |
28 | ␊ |
29 | if [ ${diskupdate} = "0" ]; then␊ |
30 | ␉echo "Diskupdate = true, so yes"␊ |
31 | ␉␊ |
32 | ␉if [ ${disksignature} = "0" ]; then␊ |
33 | |
34 | ␉␉␊ |
35 | ␉␉echo "Executing command: fdisk440 -u -f /usr/standalone/i386/${stage0Loader} -y ${targetDisk}"␊ |
36 | ␉␉"${scriptDir}"/Tools/fdisk440 -u -f "${targetVolume}"/usr/standalone/i386/${stage0Loader} -y ${targetDisk}␊ |
37 | ␉else␊ |
38 | ␉␉# Windows is also installed on the HDD and we need to write boot0hfs␊ |
39 | ␉␉␊ |
40 | ␉␉echo "Executing command: /fdisk440 -u -f /usr/standalone/i386/${stage0Loaderdualboot} -y ${targetDisk}"␊ |
41 | ␉␉"${scriptDir}"/Tools/fdisk440 -u -f "${targetVolume}"/usr/standalone/i386/${stage0Loaderdualboot} -y ${targetDisk}␊ |
42 | ␉fi␊ |
43 | fi␊ |
44 | ␊ |
45 | echo "-----------------------------------------------"␊ |
46 | echo ""␊ |
47 | echo ""␊ |
48 | ␊ |
49 | exit 0 |