Root/
| |
---|---|
Source at commit 2741 created 8 years 11 months ago. By ifabio, Add data for new logo and clut (grey) from macosxbootloader (Credits to Pike R. Alpha) | |
1 | #!/bin/bash␊ |
2 | ␊ |
3 | echo "==============================================="␊ |
4 | echo "Write Chameleon Stage 0 Loader:"␊ |
5 | echo "*******************************"␊ |
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 | ␊ |
18 | if [ "$#" -eq 7 ]; then␊ |
19 | ␉disksignature="$1"␊ |
20 | ␉stage0Loader="$2"␊ |
21 | ␉stage0Loaderdualboot="$3"␊ |
22 | ␉targetDisk="$4"␊ |
23 | ␉targetResources="$5"␊ |
24 | ␉targetVolume="$6"␊ |
25 | ␉scriptDir="$7"␊ |
26 | ␉echo "DEBUG: passed argument for disksignature = $disksignature"␊ |
27 | ␉echo "DEBUG: passed argument for stage0Loader = $stage0Loader"␊ |
28 | ␉echo "DEBUG: passed argument for stage0Loaderdualboot = $stage0Loaderdualboot"␊ |
29 | ␉echo "DEBUG: passed argument for targetDisk = $targetDisk"␊ |
30 | ␉echo "DEBUG: passed argument for targetResources = $targetResources"␊ |
31 | ␉echo "DEBUG: passed argument for targetVolume = $targetVolume"␊ |
32 | ␉echo "DEBUG: passed argument for scriptDir = $scriptDir"␊ |
33 | else␊ |
34 | ␉echo "Error - wrong number of values passed"␊ |
35 | ␉exit 9␊ |
36 | fi␊ |
37 | ␊ |
38 | ␊ |
39 | if [ ${disksignature} = "0" ]; then␊ |
40 | |
41 | ␉␉␊ |
42 | ␉#echo "DEBUG: 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}."␊ |
45 | else␊ |
46 | ␉# Windows is also installed on the HDD so we need to write boot0md␊ |
47 | ␉␉␊ |
48 | ␉#echo "DEBUG: 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}."␊ |
51 | fi␊ |
52 | ␊ |
53 | exit 0 |