Chameleon

Chameleon Commit Details

Date:2011-10-07 00:56:32 (12 years 5 months ago)
Author:blackosx
Commit:1615
Parents: 1614
Message:Make further tweaks and code clean-ups. Change most echo's to include the word DEBUG and comment them out.
Changes:
M/branches/blackosx/package/Scripts/Sub/SetActivePartition.sh
M/branches/blackosx/package/Scripts/Main/Post/postinstall
M/branches/blackosx/package/Scripts/Sub/CheckGRUBLinuxLoader.sh
M/branches/blackosx/package/Scripts/Sub/UnMountEFIvolumes.sh
M/branches/blackosx/package/Scripts/Sub/CheckWindowsDiskSignature.sh
M/branches/blackosx/package/Scripts/Sub/CheckFormat.sh
M/branches/blackosx/package/Scripts/Sub/CheckFatType.sh
M/branches/blackosx/package/Scripts/Sub/WriteChameleonStage0.sh
M/branches/blackosx/package/Scripts/Sub/WriteChameleonStage1.sh
M/branches/blackosx/package/Scripts/Sub/CheckPartitionScheme.sh
M/branches/blackosx/package/Scripts/Sub/WriteChameleonStage2.sh
M/branches/blackosx/package/Scripts/Sub/CheckDiskMicrocode.sh
M/branches/blackosx/package/Scripts/Sub/CheckProceed.sh

File differences

branches/blackosx/package/Scripts/Main/Post/postinstall
113113
114114
115115
116
116
117
118
119
120
121
117122
118123
119124
keyToUse=$( echo $keyRead | sed 's/ /\\ /g' )
if [ "${keyToUse}" != "DONT" ] && [ "${value}" != "USE" ]; then
sudo /usr/libexec/plistbuddy -c "Add :${keyToUse} string ${value}" "$tempOCBP"
"$scriptDir"InstallLog.sh "${dest_vol}" "Added boot option: ${keyRead}=${value}"
returnValue=$?
if [ ${returnValue} -ne 1 ]; then
"$scriptDir"InstallLog.sh "${dest_vol}" "Added boot option: ${keyRead}=${value}"
else
"$scriptDir"InstallLog.sh "${dest_vol}" "Can't add ${keyRead}=${value} as an option already exists for: ${keyRead}"
fi
fi
fi
(( arrayCount++ ))
branches/blackosx/package/Scripts/Sub/CheckFormat.sh
2626
2727
2828
29
30
31
29
3230
3331
3432
3533
3634
37
38
39
35
4036
4137
4238
4339
44
45
46
47
40
4841
4942
5043
fi
if [ "$( fstyp "$targetDevice" | grep hfs )" ]; then
echo "${targetDevice} is currently formatted as HFS"
echo "-----------------------------------------------"
echo ""
#echo "DEBUG: ${targetDevice} is currently formatted as HFS"
#"$scriptDir"InstallLog.sh "${targetVolume}" "${targetDevice} is currently formatted as HFS"
exit 1
fi
if [ "$( fstyp "$targetDevice" | grep msdos )" ]; then
echo "${targetDevice} is currently formatted as msdos"
echo "-----------------------------------------------"
echo ""
#echo "DEBUG: ${targetDevice} is currently formatted as msdos"
#"$scriptDir"InstallLog.sh "${targetVolume}" "${targetDevice} is currently formatted as msdos"
exit 2
fi
echo "WARNING: ${targetDevice} is currently not formatted as either HFS or msdos"
echo "-----------------------------------------------"
echo ""
#echo "DEBUG: WARNING: ${targetDevice} is currently not formatted as either HFS or msdos"
"$scriptDir"InstallLog.sh "${targetVolume}" "WARNING: ${targetDevice} is currently not formatted as either HFS or msdos"
exit 0
branches/blackosx/package/Scripts/Sub/CheckFatType.sh
3232
3333
3434
35
36
37
35
3836
3937
4038
4139
42
43
44
40
4541
4642
4743
4844
49
50
51
45
5246
5347
5448
5549
56
57
58
50
5951
6052
6153
6254
63
64
65
55
6656
6757
6858
6959
70
71
72
60
7361
7462
7563
76
77
64
7865
partitionBootSector=$( dd 2>/dev/null if="$targetDeviceRaw" count=1 | perl -ne '@a=split"";for(@a){printf"%02x",ord}' )
if [ "${partitionBootSector:36:2}" == "00" ] && [ "${partitionBootSector:42:2}" == "f8" ] && [ "${partitionBootSector:48:2}" == "3f" ]; then
echo "Found a FAT32 device formatted by Windows Explorer"
echo "--------------------------------------------------"
echo ""
#echo "DEBUG: Found a FAT32 device formatted by Windows Explorer"
"$scriptDir"InstallLog.sh "${targetVolume}" "${targetDeviceRaw} is on a FAT32 volume formatted by Windows Explorer"
exit 2
fi
if [ "${partitionBootSector:36:2}" == "02" ] && [ "${partitionBootSector:42:2}" == "f8" ] && [ "${partitionBootSector:48:2}" == "3f" ]; then
echo "Found a FAT16 device formatted by Windows Explorer"
echo "--------------------------------------------------"
echo ""
#echo "DEBUG: Found a FAT16 device formatted by Windows Explorer"
"$scriptDir"InstallLog.sh "${targetVolume}" "${targetDeviceRaw} is on a FAT16 volume formatted by Windows Explorer"
exit 1
fi
if [ "${partitionBootSector:36:2}" == "00" ] && [ "${partitionBootSector:42:2}" == "f0" ] && [ "${partitionBootSector:48:2}" == "20" ]; then
echo "Found a FAT32 device formatted by OS X Snow Leopard Disk Utility"
echo "----------------------------------------------------------------"
echo ""
#echo "DEBUG: Found a FAT32 device formatted by OS X Snow Leopard Disk Utility"
"$scriptDir"InstallLog.sh "${targetVolume}" "${targetDeviceRaw} is on a FAT32 volume formatted by OS X Snow Leopard Disk Utility"
exit 2
fi
if [ "${partitionBootSector:36:2}" == "02" ] && [ "${partitionBootSector:42:2}" == "f0" ] && [ "${partitionBootSector:48:2}" == "20" ]; then
echo "Found a FAT16 device formatted by OS X Snow Leopard Disk Utility"
echo "----------------------------------------------------------------"
echo ""
#echo "DEBUG: Found a FAT16 device formatted by OS X Snow Leopard Disk Utility"
"$scriptDir"InstallLog.sh "${targetVolume}" "${targetDeviceRaw} is on a FAT16 volume formatted by OS X Snow Leopard Disk Utility"
exit 1
fi
if [ "${partitionBootSector:36:2}" == "00" ] && [ "${partitionBootSector:42:2}" == "f8" ] && [ "${partitionBootSector:48:2}" == "20" ]; then
echo "Found a FAT32 device formatted by OS X Lion Disk Utility"
echo "--------------------------------------------------------"
echo ""
#echo "DEBUG: Found a FAT32 device formatted by OS X Lion Disk Utility"
"$scriptDir"InstallLog.sh "${targetVolume}" "${targetDeviceRaw} is on a FAT32 volume formatted by OS X Lion Disk Utility"
exit 2
fi
if [ "${partitionBootSector:36:2}" == "02" ] && [ "${partitionBootSector:42:2}" == "f8" ] && [ "${partitionBootSector:48:2}" == "20" ]; then
echo "Found a FAT16 device formatted by OS X Lion Disk Utility"
echo "--------------------------------------------------------"
echo ""
#echo "DEBUG: Found a FAT16 device formatted by OS X Lion Disk Utility"
"$scriptDir"InstallLog.sh "${targetVolume}" "${targetDeviceRaw} is on a FAT16 volume formatted by OS X Lion Disk Utility"
exit 1
fi
echo "-----------------------------------------------"
echo ""
exit 0
branches/blackosx/package/Scripts/Sub/WriteChameleonStage0.sh
3939
4040
4141
42
42
4343
4444
4545
4646
4747
48
48
4949
5050
5151
5252
53
54
55
56
57
5853
if [ ${disksignature} = "0" ]; then
echo "Executing command: ${targetResources}fdisk440 -u -f /usr/standalone/i386/${stage0Loader} -y ${targetDisk}"
#echo "DEBUG: Executing command: ${targetResources}fdisk440 -u -f /usr/standalone/i386/${stage0Loader} -y ${targetDisk}"
"${targetResources}"fdisk440 -u -f "${targetVolume}"/usr/standalone/i386/${stage0Loader} -y ${targetDisk}
"$scriptDir"InstallLog.sh "${targetVolume}" "Written ${stage0Loader} to ${targetDisk}."
else
# Windows is also installed on the HDD so we need to write boot0md
echo "Executing command: ${targetResources}fdisk440 -u -f /usr/standalone/i386/${stage0Loaderdualboot} -y ${targetDisk}"
#echo "DEBUG: Executing command: ${targetResources}fdisk440 -u -f /usr/standalone/i386/${stage0Loaderdualboot} -y ${targetDisk}"
"${targetResources}"fdisk440 -u -f "${targetVolume}"/usr/standalone/i386/${stage0Loaderdualboot} -y ${targetDisk}
"$scriptDir"InstallLog.sh "${targetVolume}" "Written ${stage0Loaderdualboot} to ${targetDisk}."
fi
echo "-----------------------------------------------"
echo ""
echo ""
exit 0
branches/blackosx/package/Scripts/Sub/WriteChameleonStage1.sh
3737
3838
3939
40
40
4141
4242
4343
......
4646
4747
4848
49
49
5050
5151
52
52
5353
5454
55
55
5656
5757
58
58
5959
6060
6161
6262
6363
64
65
66
6764
if [ ${espformat} = "1" ]; then
# the selected partition is HFS formatted
echo "Executing command: dd if=${selectedDestination}/usr/standalone/i386/${stage1LoaderHFS} of=${targetDeviceRaw}"
#echo "DEBUG: Executing command: dd if=${selectedDestination}/usr/standalone/i386/${stage1LoaderHFS} of=${targetDeviceRaw}"
dd if="${selectedDestination}"/usr/standalone/i386/${stage1LoaderHFS} of=${targetDeviceRaw}
"$scriptDir"InstallLog.sh "${targetVolume}" "Written ${stage1LoaderHFS} to ${targetDeviceRaw}."
if [ ${espformat} = "2" ]; then
# the selected partition FAT formatted
echo "Executing command: dd if=${targetDeviceRaw} count=1 bs=512 of=/tmp/origbs"
#echo "DEBUG: Executing command: dd if=${targetDeviceRaw} count=1 bs=512 of=/tmp/origbs"
dd if=${targetDeviceRaw} count=1 bs=512 of=/tmp/origbs
echo "Executing command: cp "${selectedDestination}"/usr/standalone/i386/${stage1LoaderFAT} /tmp/newbs"
#echo "DEBUG: Executing command: cp "${selectedDestination}"/usr/standalone/i386/${stage1LoaderFAT} /tmp/newbs"
cp "${selectedDestination}"/usr/standalone/i386/${stage1LoaderFAT} /tmp/newbs
echo "Executing command: dd if=/tmp/origbs of=/tmp/newbs skip=3 seek=3 bs=1 count=87 conv=notrunc"
#echo "DEBUG: Executing command: dd if=/tmp/origbs of=/tmp/newbs skip=3 seek=3 bs=1 count=87 conv=notrunc"
dd if=/tmp/origbs of=/tmp/newbs skip=3 seek=3 bs=1 count=87 conv=notrunc
echo "Executing command: dd of=${targetDeviceRaw} count=1 bs=512 if=/tmp/newbs"
#echo "DEBUG: Executing command: dd of=${targetDeviceRaw} count=1 bs=512 if=/tmp/newbs"
dd if=/tmp/newbs of="${targetDeviceRaw}" count=1 bs=512
"$scriptDir"InstallLog.sh "${targetVolume}" "Written ${stage1LoaderFAT} to ${targetDeviceRaw}."
fi
echo "-----------------------------------------------"
echo ""
exit 0
branches/blackosx/package/Scripts/Sub/CheckPartitionScheme.sh
3434
3535
3636
37
37
3838
3939
40
40
4141
42
43
44
42
4543
4644
4745
4846
49
50
51
47
5248
5349
5450
5551
5652
5753
58
59
60
54
6155
6256
6357
6458
65
66
67
68
59
6960
7061
7162
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"
#echo "DEBUG: 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"
#echo "DEBUG: Found System ID '00' for each remaining possible partition"
partitiontable="GPT"
echo "${partitiontable} found."
echo "-----------------------------------------------"
echo ""
#echo "DEBUG: ${partitiontable} found."
#"$scriptDir"InstallLog.sh "${targetVolume}" "${targetDisk} is using a GPT."
exit 1
else
partitiontable="GPT/MBR"
echo "${partitiontable} found."
echo "-----------------------------------------------"
echo ""
#echo "DEBUG: ${partitiontable} found."
#"$scriptDir"InstallLog.sh "${targetVolume}" "${targetDisk} is using a GPT/MBR."
exit 2
fi
fi
else
partitiontable="MBR"
echo "${partitiontable} found."
echo "-----------------------------------------------"
echo ""
#echo "DEBUG: ${partitiontable} found."
#"$scriptDir"InstallLog.sh "${targetVolume}" "${targetDisk} is using MBR."
exit 3
fi
echo "No partition table found."
echo "-----------------------------------------------"
echo ""
#echo "DEBUG: No partition table found."
"$scriptDir"InstallLog.sh "${targetVolume}" "NOTE: No partition table found."
exit 0
branches/blackosx/package/Scripts/Sub/WriteChameleonStage2.sh
3737
3838
3939
40
40
4141
4242
4343
......
5959
6060
6161
62
62
6363
6464
6565
66
66
6767
6868
6969
......
7474
7575
7676
77
78
79
80
8177
#echo "DEBUG: EFI install chosen"
if [ ! -d "${selectedDestination}" ]; then
echo "Executing Command: mkdir -p ${selectedDestination}"
#echo "DEBUG: Executing Command: mkdir -p ${selectedDestination}"
mkdir -p "${targetVolume}"
#else
#echo "DEBUG: folder /Volumes/EFI already exists"
mount_msdos -u 0 -g 0 "${targetDevice}" "${selectedDestination}"
fi
echo "Executing command: cp "${targetVolume}"/usr/standalone/i386/${stage2Loader} ${selectedDestination}"
#echo "DEBUG: Executing command: cp "${targetVolume}"/usr/standalone/i386/${stage2Loader} ${selectedDestination}"
cp "${targetVolume}"/usr/standalone/i386/"${stage2Loader}" "${selectedDestination}"
"$scriptDir"InstallLog.sh "${targetVolume}" "Written boot to ${selectedDestination}."
else
echo "Executing command: cp "${targetVolume}"/usr/standalone/i386/${stage2Loader} ${targetVolume}"
#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}."
fi
#"${selectedDestination}"/.Chameleon/Resources/SetFile -a V "${targetVolume}"/"${stage2Loader}"
#fi
echo "-----------------------------------------------"
echo ""
echo ""
exit 0
branches/blackosx/package/Scripts/Sub/CheckDiskMicrocode.sh
4949
5050
5151
52
52
5353
5454
5555
......
6161
6262
6363
64
64
6565
6666
6767
6868
69
69
7070
7171
7272
......
7474
7575
7676
77
77
7878
7979
8080
8181
82
82
8383
8484
8585
......
8787
8888
8989
90
91
90
91
9292
9393
9494
9595
9696
97
97
9898
99
100
101
99
100
101
102102
103
104103
105104
106105
# Check bytes 440-443 of the GPTdiskProtectiveMBR for a Windows Disk Signature
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"
#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"
fi
stage0type=$( dd 2>/dev/null if="$targetDisk" count=3 bs=1 skip=105 | xxd | awk '{print $2$3}' )
if [ "${stage0type}" == "0b807c" ]; then
echo "Target has existing Chameleon stage 0 loader - Boot0hfs"
#echo "DEBUG: 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"
#echo "DEBUG: Found no existing Windows installation so will replace stage 0 loader 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"
#echo "DEBUG: 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"
#echo "DEBUG: Found existing Windows installation so will replace stage 0 loader 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."
#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."
exit 1
fi
if [ "${stage0type}" != "0b807c" ] && [ "${stage0type}" != "0a803c" ] && [ "${stage0type}" != "ee7505" ] && [ "${windowsloader}" != "33c08ed0" ] ; then
echo "Something other than Chameleon or a Windows bootloader was found"
#echo "DEBUG: Something other than Chameleon or a Windows bootloader was found"
test=$(echo "${mbr437}" | awk -F0 '{print NF-1}' )
echo "Disk microcode found: ${test} - Preserving."
echo "diskupdate is set to false"
echo "-----------------------------------------------"
#echo "DEBUG: Disk microcode found: ${test} - Preserving."
#echo "DEBUG: diskupdate is set to false"
#echo "DEBUG: -----------------------------------------------"
"$scriptDir"InstallLog.sh "${targetVolume}" "NOTE: Target has existing unrecognised bootcode in the MBR. Leaving as is."
echo ""
exit 1
fi
fi
branches/blackosx/package/Scripts/Sub/CheckProceed.sh
3838
3939
4040
41
42
41
42
4343
4444
4545
......
4848
4949
5050
51
52
51
52
5353
5454
5555
......
6262
6363
6464
65
65
6666
6767
6868
......
7171
7272
7373
74
74
7575
7676
7777
......
9393
9494
9595
96
96
9797
9898
9999
100100
101101
102102
103
103
104104
105105
106
106
107107
108108
109109
110110
111111
112
112
113113
114114
115115
116116
117
118
119
120
121
117
118
119
120
121
122122
123123
124124
125125
126
127
126
127
128128
129129
130
131
132
133
134130
135131
136132
echo "*** Cannot find the volume. Exiting."
"$scriptDir"InstallLog.sh "${installerVolume}" "FAIL: Cannot file the volume: $targetVolume."
exit 1
else
echo "Confirming target volume exists"
#else
#echo "DEBUG: Confirming target volume exists"
fi
echo "*** ERROR Volume does not use slices. Exiting."
"$scriptDir"InstallLog.sh "${installerVolume}" "FAIL: $targetVolume doesn't use slices."
exit 1
else
echo "Confirming target device uses slices"
#else
#echo "DEBUG: Confirming target device uses slices"
fi
stripped=$( echo ${stripped%s*})"s1"
fi
if [ ! $( diskutil list | grep ${stripped} | awk {'print $2'} ) = "EFI" ]; then
echo "*** The selected volume doesn't have an EFI System Partition. Exiting."
#echo "DEBUG: *** The selected volume doesn't have an EFI System Partition. Exiting."
"$scriptDir"InstallLog.sh "${installerVolume}" "FAIL: Selected disk does not have an EFI System Partition."
exit 1
fi
# Check for existing Chameleon installations on a different
# partition of the same target disk.
echo "Checking for existing Chameleon installations on ${targetDisk#/dev/}..."
#echo "DEBUG: Checking for existing Chameleon installations on ${targetDisk#/dev/}..."
sliceNumber=$( echo ${targetDeviceRaw#*disk*s} )
# strip slice from end
# Check for existing stage 0 boot file from CheckDiskMicrocode.sh script
stage0type=$( dd 2>/dev/null if="$targetDisk" count=3 bs=1 skip=105 | xxd | awk '{print $2$3}' )
if [ "${stage0type}" == "0b807c" ] || [ "${stage0type}" == "0a803c" ] || [ "${stage0type}" == "ee7505" ]; then
echo "boot0 found on $targetDisk"
#echo "DEBUG: boot0 found on $targetDisk"
(( stageExistence++ ))
fi
# Check for boot1h and boot1f32
boot1hSearch=$( dd 2>/dev/null if="$targetDiskRaw" count=1 | perl -ne '@a=split"";for(@a){printf"%02x",ord}' )
if [ "${boot1hSearch:0:16}" == "fa31c08ed0bcf0ff" ]; then
echo "boot1h found on "$targetDiskRaw
#echo "DEBUG: boot1h found on "$targetDiskRaw
(( stageExistence++ ))
elif [ "${boot1hSearch:0:4}" == "e962" ] && [ "${boot1hSearch:180:12}" == "424f4f542020" ]; then
echo "boot1f32 found on "$targetDiskRaw
#echo "DEBUG: boot1f32 found on "$targetDiskRaw
(( stageExistence++ ))
fi
# Check for existing stage 2 boot file also
if [ -e "$( df | grep $targetDisk"s"$i | awk '{ print $6 }' )"/boot ]; then
echo "boot found on $targetDiskRaw"
#echo "DEBUG: boot found on $targetDiskRaw"
(( stageExistence++ ))
fi
if [ $stageExistence == 3 ] && [ $i -ne $sliceNumber ]; then
echo "STOP: Not recommended you install to $targetDeviceRaw as there is already an existing Chameleon installation on $targetDiskRaw"
"$scriptDir"InstallLog.sh "${installerVolume}" "STOP: Not recommended you install to $targetDeviceRaw as there is already an existing Chameleon installation on $targetDiskRaw."
echo "================================"
echo "End"
echo "--------------------------------"
#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."
exit 1
fi
done
else
echo "Just one slice"
#else
#echo "DEBUG: Just one slice"
fi
echo "-----------------------------------------------"
echo ""
#"$scriptDir"InstallLog.sh "${installerVolume}" "CheckProceed: PASS"
exit 0
branches/blackosx/package/Scripts/Sub/SetActivePartition.sh
5858
5959
6060
61
61
6262
6363
6464
65
66
67
68
6965
# 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"
#echo "DEBUG: 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
echo "-----------------------------------------------"
echo ""
echo ""
exit 0
branches/blackosx/package/Scripts/Sub/CheckGRUBLinuxLoader.sh
2828
2929
3030
31
31
3232
3333
3434
......
3838
3939
4040
41
42
41
42
4343
4444
45
46
4745
48
49
5046
diskmicrocodetype[2]="LILO,4c494c4f"
diskmicrocode=$( 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}' )
#echo "${diskmicrocode}"
#echo "DEBUG: ${diskmicrocode}"
diskmicrocodetypecounter=0
while [ ${diskmicrocodetypecounter} -lt ${#diskmicrocodetype[@]} ]; do
echo "${diskmicrocodetype[${diskmicrocodetypecounter}]%,*} found."
"$scriptDir"InstallLog.sh "${targetVolume}" "FAIL: Found an exisitng GRUB/LILO bootloader in the MBR."
exit 1
else
echo "Didn't find a match for ${diskmicrocodetype[${diskmicrocodetypecounter}]%,*}"
#else
#echo "DEBUG: Didn't find a match for ${diskmicrocodetype[${diskmicrocodetypecounter}]%,*}"
fi
done
echo "-----------------------------------------------"
echo ""
#"$scriptDir"InstallLog.sh "${targetVolume}" "GRUB/LILO: PASS"
exit 0
branches/blackosx/package/Scripts/Sub/UnMountEFIvolumes.sh
2323
2424
2525
26
26
2727
2828
2929
3030
3131
3232
33
34
33
3534
36
37
38
3935
4036
4137
42
43
44
45
46
4738
4839
4940
# be unmounted in which case the loop would run forever.
attempts=1
while [ "$( df | grep EFI )" ] && [ $attempts -lt 5 ]; do
echo "Unmounting $( df | grep EFI | awk '{print $1}' )"
#echo "DEBUG: Unmounting $( df | grep EFI | awk '{print $1}' )"
"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Find and unmount any volume named 'EFI':"
"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "$( df | grep EFI | awk '{print $1}' )"
umount -f $( df | grep EFI | awk '{print $1}' )
(( attempts++ ))
done
if [ $attempts = 5 ]; then
echo "failed to unmount 'EFI' System Partition."
echo "-----------------------------------------------"
#echo "DEBUG: failed to unmount 'EFI' System Partition."
"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Failed to unmount 'EFI' System Partition."
echo ""
echo ""
echo ""
exit 1
fi
echo "-----------------------------------------------"
echo ""
echo ""
echo ""
exit 0
branches/blackosx/package/Scripts/Sub/CheckWindowsDiskSignature.sh
2525
2626
2727
28
28
2929
3030
31
32
33
31
3432
3533
36
37
38
34
3935
4036
4137
4238
43
44
45
4639
disksignature=$( dd 2>/dev/null if="$targetDisk" count=1 | dd 2>/dev/null count=4 bs=1 skip=440 | perl -ne '@a=split"";for(@a){printf"%02x",ord}' )
#echo "${disksignature}"
#echo "DEBUG: ${disksignature}"
if [ "${disksignature}" = "00000000" ]; then
echo "No Windows installation detected."
echo "-----------------------------------------------"
echo ""
#echo "DEBUG: No Windows installation detected."
exit 0
else
echo "Detected an existing Windows installation"
echo "-----------------------------------------------"
echo ""
#echo "DEBUG: Detected an existing Windows installation"
"$scriptDir"InstallLog.sh "${targetVolume}" "Detected a Windows installation on this volume."
exit 1
fi
echo "-----------------------------------------------"
echo ""
exit 0

Archive Download the corresponding diff file

Revision: 1615