Chameleon

Chameleon Commit Details

Date:2011-10-07 09:06:22 (12 years 6 months ago)
Author:blackosx
Commit:1616
Parents: 1615
Message:Make a few changes to the content sent to the install log.
Changes:
M/branches/blackosx/package/Scripts/Main/EFI/postinstall
M/branches/blackosx/package/Scripts/Sub/WriteChameleonStage2.sh
M/branches/blackosx/package/Scripts/Sub/CheckDiskMicrocode.sh
M/branches/blackosx/package/Scripts/Main/Standard/postinstall
M/branches/blackosx/package/Scripts/Sub/CheckProceed.sh

File differences

branches/blackosx/package/Scripts/Main/Standard/postinstall
2929
3030
3131
32
3332
3433
3534
......
7372
7473
7574
76
75
7776
7877
7978
#echo ""
# Initialise Script Globals
stage0Loader="boot0"
"$scriptDir"InstallLog.sh "${targetVolume}" "Installer version: ${versionNumber} ${revisionNumber}"
"$scriptDir"InstallLog.sh "${targetVolume}" "Diskutil"
"$scriptDir"InstallLog.sh "${targetVolume}" "Running Standard postinstall script"
"$scriptDir"InstallLog.sh "${targetVolume}" "Target volume = ${targetVolume}"
"$scriptDir"InstallLog.sh "${targetVolume}" "Target volume = ${targetVolume} on ${targetDevice}"
# Double check we can see the selected partition and it's of the right type.
branches/blackosx/package/Scripts/Main/EFI/postinstall
7676
7777
7878
79
80
79
80
8181
8282
8383
"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Installer version: ${versionNumber} ${revisionNumber}"
"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Diskutil"
"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Running EFI postinstall script"
"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Target selected by user = ${targetDeviceChosenByUser}"
"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Target volume = ${targetVolume}"
"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Target selected by user = ${targetVolumeChosenByUser} on ${targetDeviceChosenByUser}"
"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Target volume = ${targetVolume} on ${targetDevice}"
# Check to see if the selected disk uses a GPT
branches/blackosx/package/Scripts/Sub/WriteChameleonStage2.sh
6565
6666
6767
68
68
6969
7070
7171
else
#echo "DEBUG: Executing command: cp "${targetVolume}"/usr/standalone/i386/${stage2Loader} ${targetVolume}"
cp "${targetVolume}"/usr/standalone/i386/"${stage2Loader}" "${targetVolume}"
"$scriptDir"InstallLog.sh "${targetVolume}" "Written boot to ${targetVolume}."
"$scriptDir"InstallLog.sh "${targetVolume}" "Written boot to ${targetVolume} on ${targetDevice}."
fi
branches/blackosx/package/Scripts/Sub/CheckDiskMicrocode.sh
3737
3838
3939
40
41
42
43
44
45
40
4641
4742
4843
......
5045
5146
5247
53
48
5449
5550
5651
......
6257
6358
6459
65
60
6661
6762
6863
......
7570
7671
7772
78
73
7974
8075
8176
......
8984
9085
9186
92
87
9388
9489
9590
......
10297
10398
10499
100
101
102
105103
106104
107105
mbr437=$( dd 2>/dev/null if="$targetDisk" count=1 | dd 2>/dev/null count=1 bs=437 | perl -ne '@a=split"";for(@a){printf"%02x",ord}' )
#mbr437md5=$( dd 2>/dev/null if="$targetDisk" count=1 | dd 2>/dev/null count=1 bs=437 | md5 )
#echo "DEBUG: ${mbr437}"
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}" "Target has no bootcode in the MBR disk sector."
else
if [ $( echo "${mbr437}" | awk -F0 '{print NF-1}' ) != 874 ]; then
# There is already something on the MBR
# See if a Windows bootloader already exists
windowsloader=$( dd 2>/dev/null if="$targetDisk" count=4 bs=1 | xxd | awk '{print $2$3}' )
if [ "${windowsloader}" == "33c08ed0" ] ; then
#echo "DEBUG: Found existing Windows Boot Loader so will replace with Chameleon boot0md"
"$scriptDir"InstallLog.sh "${targetVolume}" "Target has existing Windows boot loader - Will replace with boot0md"
"$scriptDir"InstallLog.sh "${targetVolume}" "Target disk has existing Windows boot loader - Will replace with boot0md"
fi
# See if a Chameleon stage0 boot file already exists
stage0type=$( dd 2>/dev/null if="$targetDisk" count=3 bs=1 skip=105 | xxd | awk '{print $2$3}' )
if [ "${stage0type}" == "0b807c" ]; then
#echo "DEBUG: Target has existing Chameleon stage 0 loader - Boot0hfs"
"$scriptDir"InstallLog.sh "${targetVolume}" "Target has existing Chameleon stage 0 loader - boot0hfs"
"$scriptDir"InstallLog.sh "${targetVolume}" "Target disk already has existing Chameleon stage 0 loader - boot0hfs"
# Script CheckDiskSignature.sh returned 0 if a Windows installation was NOT found
if [ "$diskSigCheck" == "0" ]; then
if [ "${stage0type}" == "0a803c" ]; then
#echo "DEBUG: Found existing Chameleon stage 0 loader - Boot0"
"$scriptDir"InstallLog.sh "${targetVolume}" "Target has existing Chameleon stage 0 loader - boot0"
"$scriptDir"InstallLog.sh "${targetVolume}" "Target disk already has existing Chameleon stage 0 loader - boot0"
# Script CheckDiskSignature.sh returned 1 if a Windows installation was found
if [ "$diskSigCheck" = "1" ]; then
if [ "${stage0type}" == "ee7505" ]; then
#echo "DEBUG: Found existing Chameleon stage 0 loader - Boot0md"
#echo "DEBUG: And will leave boot0md installed."
"$scriptDir"InstallLog.sh "${targetVolume}" "Target has existing Chameleon stage 0 loader - boot0md. Leaving as is."
"$scriptDir"InstallLog.sh "${targetVolume}" "Target disk already has existing Chameleon stage 0 loader - boot0md."
exit 1
fi
"$scriptDir"InstallLog.sh "${targetVolume}" "NOTE: Target has existing unrecognised bootcode in the MBR. Leaving as is."
exit 1
fi
#else
#echo "DEBUG: The first 437 bytes of the MBR Disk Sector is blank - Updating"
#"$scriptDir"InstallLog.sh "${targetVolume}" "Target has no bootcode in the MBR disk sector."
fi
echo "diskupdate is now set to true."
branches/blackosx/package/Scripts/Sub/CheckProceed.sh
116116
117117
118118
119
120
121
119
120
121
122
123
122124
123125
124126
if [ $stageExistence == 3 ] && [ $i -ne $sliceNumber ]; then
#echo "DEBUG: STOP: There is already an existing Chameleon installation on $targetDiskRaw"
"$scriptDir"InstallLog.sh "${installerVolume}" "STOP: There is already an existing Chameleon installation on $targetDiskRaw."
"$scriptDir"InstallLog.sh "${installerVolume}" "STOP: You could continue to install to $targetDeviceRaw, but you will have to"
"$scriptDir"InstallLog.sh "${installerVolume}" "STOP: control which partition is loaded by flagging the required partition active."
"$scriptDir"InstallLog.sh "${installerVolume}" "STOP: For now, please proceed by installing Chameleon manually."
"$scriptDir"InstallLog.sh "${installerVolume}" "NOTE: This is allowed and does work as long as you aren't dual booting Windows"
"$scriptDir"InstallLog.sh "${installerVolume}" "NOTE: from the same disk and are happy to control which partition is used by"
"$scriptDir"InstallLog.sh "${installerVolume}" "NOTE: flagging the required partition active. General use doesn't require two"
"$scriptDir"InstallLog.sh "${installerVolume}" "NOTE: Chameleon installs on the same disk, though might be done by advanced users."
"$scriptDir"InstallLog.sh "${installerVolume}" "NOTE: If you still want to do this then proceed by installing Chameleon manually."
exit 1
fi
done

Archive Download the corresponding diff file

Revision: 1616