Chameleon

Chameleon Commit Details

Date:2011-09-23 17:56:50 (8 years 27 days ago)
Author:blackosx
Commit:1563
Parents: 1562
Message:Code tweaks.
Changes:
M/branches/blackosx/package/Resources/en.lproj/Localizable.strings
M/branches/blackosx/package/Scripts/Install/CheckWindowsDiskSignature.sh
M/branches/blackosx/package/Scripts/Install/CheckFormat.sh
M/branches/blackosx/package/Scripts/Install/InstallLog.sh
M/branches/blackosx/package/Scripts/Install/CheckPartitionScheme.sh
M/branches/blackosx/package/Scripts/Install/CheckDiskMicrocode.sh
M/branches/blackosx/package/Scripts/Standard/postinstall
M/branches/blackosx/package/Scripts/EFI/postinstall
M/branches/blackosx/package/Scripts/Install/SetActivePartition.sh

File differences

branches/blackosx/package/Scripts/Standard/postinstall
7070
7171
7272
73
73
7474
7575
7676
......
144144
145145
146146
147
148
149
147150
148
149
150151
151152
152153
153
154
154155
155156
156157
......
160161
161162
162163
164
165
166
163167
164168
165169
166170
167171
168172
173
174
175
169176
170177
171178
# Write some information to the Install Log
versionNumber=`cat "${scriptDir}"/Resources/version`
revisionNumber=`cat "${scriptDir}"/Resources/revision`
"$scriptDir"InstallLog.sh "${targetVolume}" "Chameleon installer version: ${versionNumber} ${revisionNumber}"
"$scriptDir"InstallLog.sh "${targetVolume}" "Installer version: ${versionNumber} ${revisionNumber}"
"$scriptDir"InstallLog.sh "${targetVolume}" "Running Standard postinstall script
Target volume = ${targetVolume}"
else
# Continue if the selected device is not a FAT16 format device
# Append a link break to the installer log
"$scriptDir"InstallLog.sh "${targetVolume}" "Line Break"
if [ ${diskupdate} = "0" ]; then
echo "Diskupdate = true, so the stage 0 loader can be written to the MBR"
# Write the stage 0 loader to the MBR
"$scriptDir"WriteChameleonStage0.sh "${diskSigCheck}" "${stage0Loader}" "${stage0LoaderDualBoot}" "${targetDisk}" "${targetResources}" "${targetVolume}" "${scriptDir}"
else
echo "Diskupdate = false, so didn't write the stage 0 loader to the MBR."
#echo "Diskupdate = false, so didn't write the stage 0 loader to the MBR."
"$scriptDir"InstallLog.sh "${targetVolume}" "Stage 0 loader not written to ${targetDisk}."
fi
# Write the stage 2 loader to the root of the selected partition
"$scriptDir"WriteChameleonStage2.sh "${espformat}" "${stage2Loader}" "${3}" "${targetDevice}" "${targetVolume}" "${scriptDir}"
# Append a link break to the installer log
"$scriptDir"InstallLog.sh "${targetVolume}" "Line Break"
# Set the active partition ONLY if Windows is not installed
"$scriptDir"SetActivePartition.sh "${espformat}" "${diskSigCheck}" "${targetDiskRaw}" "${targetSlice}" "${targetVolume}" "${scriptDir}"
fi
fi
fi
"$scriptDir"InstallLog.sh "${targetVolume}" "Line Break"
"$scriptDir"InstallLog.sh "${targetVolume}" "Standard script complete"
echo "==============================================="
echo "END - Standard Post-Install Script"
echo "*********************************"
branches/blackosx/package/Scripts/EFI/postinstall
188188
189189
190190
191
192
193
191194
192195
193196
# boot option scripts than EFI (ESP) option was chosen
echo "EFI" >"${targetVolumeChosenByUser}"/.ChameleonEFI
"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Line Break"
"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "EFI script complete"
echo "==============================================="
echo "END - Main EFI System Partition Post-Install Script"
echo "*********************************************"
branches/blackosx/package/Scripts/Install/CheckFormat.sh
2929
3030
3131
32
32
3333
3434
3535
......
3737
3838
3939
40
40
4141
4242
4343
echo "${targetDevice} is currently formatted as HFS"
echo "-----------------------------------------------"
echo ""
"$scriptDir"InstallLog.sh "${targetVolume}" "${targetDevice} is currently formatted as HFS"
#"$scriptDir"InstallLog.sh "${targetVolume}" "${targetDevice} is currently formatted as HFS"
exit 1
fi
echo "${targetDevice} is currently formatted as msdos"
echo "-----------------------------------------------"
echo ""
"$scriptDir"InstallLog.sh "${targetVolume}" "${targetDevice} is currently formatted as msdos"
#"$scriptDir"InstallLog.sh "${targetVolume}" "${targetDevice} is currently formatted as msdos"
exit 2
fi
branches/blackosx/package/Scripts/Install/InstallLog.sh
4141
4242
4343
44
4544
46
45
46
4747
48
48
49
50
4951
5052
5153
5254
5355
54
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
5571
5672
5773
# of Chameleon package.
echo "Chameleon installer log - $( date )
------------------------------------------------------
${verboseText}
------------------------------------------------------" >"${logFile}"
======================================================
" >"${logFile}"
diskutil list >>"${logFile}"
echo "------------------------------------------------------" >>"${logFile}"
echo "
======================================================
" >>"${logFile}"
# Create /.ChameleonLogFlag file.
echo "Log" >"${logLocation}"/.ChameleonLogFlag
else
# Append messages to the log as passed by other scripts.
echo "${verboseText}" >> "${logFile}"
if [ "${verboseText}" = "Line Break" ]; then
echo "
======================================================
" >>"${logFile}"
fi
if [[ "${verboseText}" == *fdisk* ]]; then
targetDiskRaw="${verboseText#fdisk *}"
fdisk $targetDiskRaw >>"${logFile}"
echo " " >>"${logFile}"
fi
if [ "${verboseText}" != "Line Break" ] && [[ "${verboseText}" != *fdisk* ]]; then
echo "${verboseText}" >> "${logFile}"
fi
fi
exit 0
branches/blackosx/package/Scripts/Install/CheckPartitionScheme.sh
3232
3333
3434
35
3536
3637
38
3739
3840
3941
4042
4143
4244
43
45
4446
4547
4648
4749
4850
4951
50
52
5153
5254
5355
......
5658
5759
5860
59
61
6062
6163
6264
partitiontable=$( dd 2>/dev/null if="$targetDisk" count=1 skip=1 | dd 2>/dev/null count=8 bs=1 | perl -ne '@a=split"";for(@a){printf"%02x",ord}' )
if [ "${partitiontable:0:16}" == "4546492050415254" ]; then
partitiontable=$( dd 2>/dev/null if="$targetDisk" count=1 | dd 2>/dev/null count=64 bs=1 skip=446 | perl -ne '@a=split"";for(@a){printf"%02x",ord}' )
if [ "${partitiontable:8:2}" == "ee" ]; then
echo "Found System ID 'EE' to identify GPT Partition"
if [ "${partitiontable:40:2}" == "00" ] && [ "${partitiontable:72:2}" == "00" ] && [ "${partitiontable:104:2}" == "00" ]; then
echo "Found System ID '00' for each remaining possible partition"
partitiontable="GPT"
echo "${partitiontable} found."
echo "-----------------------------------------------"
echo ""
"$scriptDir"InstallLog.sh "${targetVolume}" "${targetDisk} is using a GPT."
#"$scriptDir"InstallLog.sh "${targetVolume}" "${targetDisk} is using a GPT."
exit 1
else
partitiontable="GPT/MBR"
echo "${partitiontable} found."
echo "-----------------------------------------------"
echo ""
"$scriptDir"InstallLog.sh "${targetVolume}" "${targetDisk} is using a GPT/MBR."
#"$scriptDir"InstallLog.sh "${targetVolume}" "${targetDisk} is using a GPT/MBR."
exit 2
fi
fi
echo "${partitiontable} found."
echo "-----------------------------------------------"
echo ""
"$scriptDir"InstallLog.sh "${targetVolume}" "${targetDisk} is using MBR."
#"$scriptDir"InstallLog.sh "${targetVolume}" "${targetDisk} is using MBR."
exit 3
fi
branches/blackosx/package/Scripts/Install/CheckDiskMicrocode.sh
4141
4242
4343
44
44
4545
4646
4747
......
5050
5151
5252
53
53
5454
5555
5656
......
6060
6161
6262
63
6463
65
66
64
65
6766
6867
6968
7069
71
70
7271
7372
7473
7574
7675
7776
78
77
7978
8079
8180
8281
83
82
8483
8584
8685
......
8887
8988
9089
91
90
9291
9392
9493
......
9897
9998
10099
101
100
102101
103102
104103
if [ $( echo "${mbr437}" | awk -F0 '{print NF-1}' ) = 874 ]; then
echo "The first 437 bytes of the MBR Disk Sector is blank - Updating"
"$scriptDir"InstallLog.sh "${targetVolume}" "First 437 bytes of the MBR are currently blank. Will update."
#"$scriptDir"InstallLog.sh "${targetVolume}" "Target has no bootcode in the MBR disk sector."
else
# There is already something on the MBR
windowsloader=$( dd 2>/dev/null if="$targetDisk" count=4 bs=1 | xxd | awk '{print $2$3}' )
if [ "${windowsloader}" == "33c08ed0" ] ; then
echo "Found existing Windows Boot Loader so will replace with Chameleon boot0md"
"$scriptDir"InstallLog.sh "${targetVolume}" "Found existing Windows boot loader - Will replace with boot0md"
"$scriptDir"InstallLog.sh "${targetVolume}" "Target has existing Windows boot loader - Will replace with boot0md"
fi
# See if a Chameleon stage0 boot file already exists
# need to be checked to see if they are the same or not.
stage0type=$( dd 2>/dev/null if="$targetDisk" count=3 bs=1 skip=105 | xxd | awk '{print $2$3}' )
#echo ${stage0type}
if [ "${stage0type}" == "0b807c" ]; then
echo "Found existing Chameleon stage 0 loader - Boot0hfs"
"$scriptDir"InstallLog.sh "${targetVolume}" "Found existing Chameleon stage 0 loader - boot0hfs"
echo "Target has existing Chameleon stage 0 loader - Boot0hfs"
"$scriptDir"InstallLog.sh "${targetVolume}" "Target has existing Chameleon stage 0 loader - boot0hfs"
# Script CheckDiskSignature.sh returned 0 if a Windows installation was NOT found
if [ "$diskSigCheck" == "0" ]; then
echo "Found no existing Windows installation so will replace stage 0 loader with Boot0"
"$scriptDir"InstallLog.sh "${targetVolume}" "Windows is not installed - Replace boot0hfs with boot0"
"$scriptDir"InstallLog.sh "${targetVolume}" "Will replace boot0hfs with boot0 as Windows is not on target disk."
exit 0
fi
fi
if [ "${stage0type}" == "0a803c" ]; then
echo "Found existing Chameleon stage 0 loader - Boot0"
"$scriptDir"InstallLog.sh "${targetVolume}" "Found existing Chameleon stage 0 loader - boot0"
"$scriptDir"InstallLog.sh "${targetVolume}" "Target has existing Chameleon stage 0 loader - boot0"
# Script CheckDiskSignature.sh returned 1 if a Windows installation was found
if [ "$diskSigCheck" = "1" ]; then
echo "Found existing Windows installation so will replace stage 0 loader with boot0md"
"$scriptDir"InstallLog.sh "${targetVolume}" "As Windows is installed - Replace boot0 with boot0md"
"$scriptDir"InstallLog.sh "${targetVolume}" "Will replace boot0 with boot0md as Windows is on target disk."
exit 0
fi
fi
if [ "${stage0type}" == "ee7505" ]; then
echo "Found existing Chameleon stage 0 loader - Boot0md"
echo "And will leave boot0md installed."
"$scriptDir"InstallLog.sh "${targetVolume}" "Found existing Chameleon stage 0 loader - boot0md. Leaving as is."
"$scriptDir"InstallLog.sh "${targetVolume}" "Target has existing Chameleon stage 0 loader - boot0md. Leaving as is."
exit 1
fi
echo "Disk microcode found: ${test} - Preserving."
echo "diskupdate is set to false"
echo "-----------------------------------------------"
"$scriptDir"InstallLog.sh "${targetVolume}" "NOTE: Found existing unknown bootcode in the MBR. Leaving as is."
"$scriptDir"InstallLog.sh "${targetVolume}" "NOTE: Target has existing unrecognised bootcode in the MBR. Leaving as is."
echo ""
exit 1
fi
branches/blackosx/package/Scripts/Install/SetActivePartition.sh
3232
3333
3434
35
36
35
36
3737
3838
39
40
39
4140
42
43
44
41
42
43
4544
46
47
45
4846
4947
50
48
5149
5250
5351
......
5755
5856
5957
58
59
60
6061
6162
6263
exit 9
fi
partitionactive=$( fdisk -d ${targetDiskRaw} | grep -n "*" | awk -F: '{print $1}')
"$scriptDir"InstallLog.sh "${targetVolume}" "Current active partition on ${targetDiskRaw#/dev/r}: ${partitionactive}"
# Append fdisk output to the installer log
"$scriptDir"InstallLog.sh "${targetVolume}" "fdisk ${targetDiskRaw}"
if [ ${diskSigCheck} == "0" ]; then
#echo "DEBUG: Windows is not installed so let's change the active partition"
"$scriptDir"InstallLog.sh "${targetVolume}" "Windows is not installed so let's change the active partition"
#Windows is not installed so let's change the active partition"
if [ "${partitionactive}" = "${targetSlice}" ]; then
#echo "${targetVolume} is already flagged as active"
"$scriptDir"InstallLog.sh "${targetVolume}" "${targetVolume} is already flagged as active"
partitionactive=$( fdisk -d ${targetDiskRaw} | grep -n "*" | awk -F: '{print $1}')
if [ "${partitionactive}" ] && [ "${partitionactive}" = "${targetSlice}" ]; then
"$scriptDir"InstallLog.sh "${targetVolume}" "${targetDiskRaw#/dev/r}, slice "${targetSlice}" is already set active. No need to change it."
else
#echo "${targetVolume} is not flagged as active, so let's do it."
"$scriptDir"InstallLog.sh "${targetVolume}" "${targetVolume} is not flagged as active, so let's do it."
"$scriptDir"InstallLog.sh "${targetVolume}" "Setting ${targetVolume} partition active."
# BadAxe requires EFI partition to be flagged active.
# but it doesn't' hurt to do it for any non-windows partition.
fdisk -e ${targetDiskRaw} <<-MAKEACTIVE
print
flag ${targetSlice}
MAKEACTIVE
fi
else
# TO DO
# Add check to make sure that the active partition is actually the Windows partition
# before printing next statement.
#echo "Windows is installed so we let that remain the active partition"
"$scriptDir"InstallLog.sh "${targetVolume}" "Windows is installed so that can remain the active partition"
fi
branches/blackosx/package/Scripts/Install/CheckWindowsDiskSignature.sh
3131
3232
3333
34
3534
3635
3736
echo "No Windows installation detected."
echo "-----------------------------------------------"
echo ""
"$scriptDir"InstallLog.sh "${targetVolume}" "Windows is not installed on this volume."
exit 0
else
echo "Detected an existing Windows installation"
branches/blackosx/package/Resources/en.lproj/Localizable.strings
215215
216216
217217
218
218
219219
220220
221
221
222222
223223
224
224
225225
226
227
228
226229
227230
228231
More themes can be found at http://forum.voodooprojects.org/index.php/board,7.0.html";
"Embed_title" = "Embed";
"Embed_description" = "A smaller simple version of the new default theme used when building a version of Chameleon which requires an embedded theme. ";
"Embed_description" = "A smaller simple version of the new default theme used when building a version of Chameleon which requires an embedded theme.";
"Legacy_title" = "Legacy";
"Legacy_description" = "Chameleon's previous default theme";
"Legacy_description" = "Chameleon's original default theme introduced for v2.0 RC1";
"Default_title" = "Standard";
"Default_description" = "Chameleon's new default theme.";
"Default_description" = "Chameleon default theme introduced for v2.0 RC5";
"Bullet_title" = "Bullet";
"Bullet_description" = "A lovely simple theme by NoSmokingBandit from April 2009.";
// Extras
"Extras_title" = "Extras";
"Extras_description" = "A collection of useful addons";

Archive Download the corresponding diff file

Revision: 1563