Chameleon

Chameleon Commit Details

Date:2011-09-20 23:11:43 (8 years 24 days ago)
Author:blackosx
Commit:1548
Parents: 1547
Message:Added detection for FAT format created by Lion's Disk Utility. Enhanced install log.
Changes:
M/branches/blackosx/package/Scripts/Install/InstallLog.sh
M/branches/blackosx/package/Scripts/Install/CheckFatType.sh
M/branches/blackosx/package/Scripts/Standard/postinstall
M/branches/blackosx/package/Scripts/Install/CheckProceed.sh
M/branches/blackosx/package/Scripts/EFI/postinstall
M/branches/blackosx/package/Scripts/Post/postinstall

File differences

branches/blackosx/package/Scripts/Standard/postinstall
4646
4747
4848
49
5049
5150
5251
......
6766
6867
6968
69
70
71
7072
73
7174
7275
7376
targetSlice=${targetDevice#*disk*s}
echo "==============================================="
echo "DEBUG: display script variables"
echo "*******************************"
echo ""
# Write some information to the Install Log
"$scriptDir"InstallLog.sh "${targetVolume}" "Running Standard postinstall script
Target volume = ${targetVolume}"
# Double check we can see the selected partition and it's of the right type
# if not the following script returns to indicate failure.
branches/blackosx/package/Scripts/EFI/postinstall
6969
7070
7171
72
73
74
75
76
77
7278
7379
7480
echo ""
# Write some information to the Install Log
"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Running EFI postinstall script
Target volume Selected by user = ${targetVolumeChosenByUser}
Target volume = ${targetVolume}"
# Check to see if the selected disk uses a GPT
bootuuid=$( diskutil info "$targetDeviceChosenByUser" | grep Volume\ UUID | awk {'print $3'} )
branches/blackosx/package/Scripts/Post/postinstall
4444
4545
4646
47
48
47
48
49
4950
51
52
53
5054
5155
52
5356
5457
5558
attempts=$(( ${attempts} + 1 ))
done
# Remove /.ChameleonEFI file
rm "$dest_vol"/.ChameleonEFI
# Remove /.ChameleonEFI file
rm "$dest_vol"/.ChameleonEFI
fi
# Remove /.ChameleonLogFlag file
if [ -f "$dest_vol"/.ChameleonLogFlag ]; then
rm "$dest_vol"/.ChameleonLogFlag
fi
# delete the temporary Chameleon folder
rm -rf "$dest_vol/tmpcham"
branches/blackosx/package/Scripts/Install/InstallLog.sh
2626
2727
2828
29
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
3045
46
47
48
3149
32
50
51
3352
3453
3554
logName="Chameleon_Installer_Log.txt"
logFile="${logLocation}"/$logName
if [ -f "${logFile}" ]; then
# On first run, create a file named .ChameleonLogFlag at
# the root of the target volume. Then check for this file
# on subsequent runs to know the initialisation sequence
# has been done.
if [ ! -f "${logLocation}"/.ChameleonLogFlag ]; then
# This is the first run, so setup
# Chameleon_Installer_Log.txt file
# by writing header.
echo "Chameleon installer log - "$( date ) >"${logFile}"
echo "------------------------------------------------------" >>"${logFile}"
diskutil list >>"${logFile}"
echo "------------------------------------------------------" >>"${logFile}"
# Write first message that this script was called with.
echo "${verboseText}" >> "${logFile}"
# Create /.ChameleonLogFlag file.
echo "Log" >"${logLocation}"/.ChameleonLogFlag
else
echo "${verboseText}" > "${logFile}"
# Append messages to the log as passed by other scripts.
echo "${verboseText}" >> "${logFile}"
fi
exit 0
branches/blackosx/package/Scripts/Install/CheckFatType.sh
2626
2727
2828
29
29
3030
3131
3232
3333
3434
35
35
3636
3737
3838
3939
40
41
40
41
4242
4343
4444
4545
46
47
46
47
4848
4949
5050
51
51
52
53
54
55
56
57
58
59
60
61
62
5263
5364
5465
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 ""
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 ""
exit 1
fi
if [ "${partitionBootSector:36:2}" == "00" ] && [ "${partitionBootSector:42:2}" == "f0" ] && [ "${partitionBootSector:48:2}" == "20" ]; then
echo "Found a FAT32 device formatted by OSX Disk Utility"
echo "-----------------------------------------------"
echo "Found a FAT32 device formatted by OS X Snow Leopard Disk Utility"
echo "----------------------------------------------------------------"
echo ""
exit 2
fi
if [ "${partitionBootSector:36:2}" == "02" ] && [ "${partitionBootSector:42:2}" == "f0" ] && [ "${partitionBootSector:48:2}" == "20" ]; then
echo "Found a FAT16 device formatted by OSX Disk Utility"
echo "-----------------------------------------------"
echo "Found a FAT16 device formatted by OS X Snow Leopard Disk Utility"
echo "----------------------------------------------------------------"
echo ""
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 ""
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 ""
exit 1
fi
echo "-----------------------------------------------"
echo ""
exit 0
branches/blackosx/package/Scripts/Install/CheckProceed.sh
5656
5757
5858
59
60
5961
echo "-----------------------------------------------"
echo ""
"$scriptDir"InstallLog.sh "${installerVolume}" "CheckProceed: PASS"
exit 0

Archive Download the corresponding diff file

Revision: 1548