Chameleon

Chameleon Commit Details

Date:2011-09-22 09:40:28 (12 years 6 months ago)
Author:blackosx
Commit:1558
Parents: 1557
Message:Code cleanups and tweaks.
Changes:
M/branches/blackosx/package/Scripts/Install/CheckGRUBLinuxLoader.sh
M/branches/blackosx/package/Scripts/Install/CheckPartitionScheme.sh
M/branches/blackosx/package/Scripts/Install/WriteChameleonStage2.sh
M/branches/blackosx/package/Scripts/Install/CheckProceed.sh
M/branches/blackosx/package/Scripts/EFI/postinstall
M/branches/blackosx/package/Scripts/Install/SetActivePartition.sh

File differences

branches/blackosx/package/Scripts/EFI/postinstall
7171
7272
7373
74
74
7575
7676
7777
......
141141
142142
143143
144
144
145145
146146
147147
148148
149
149
150150
151151
152152
......
162162
163163
164164
165
165
166
166167
167168
168169
# Write some information to the Install Log
"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Running EFI postinstall script
Target volume Selected by user = ${targetVolumeChosenByUser}
Target volume selected by user = ${targetVolumeChosenByUser}
Target volume = ${targetVolume}"
# OK to proceed
if [ ${diskupdate} = "0" ]; then
echo "Diskupdate = true, so the stage 0 loader can be written to the MBR"
#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}" "${targetVolumeChosenByUser}" "${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 "${targetVolumeChosenByUser}" "Stage 0 loader not written to ${targetDisk}."
fi
fi
fi
else
echo "ERROR Volume is not on a GPT partitioned disc."
#echo "ERROR Volume is not on a GPT partitioned disc."
"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "ERROR Volume is not on a GPT partitioned disc."
fi
branches/blackosx/package/Scripts/Install/CheckPartitionScheme.sh
4040
4141
4242
43
43
4444
4545
4646
4747
4848
4949
50
50
5151
5252
5353
......
5656
5757
5858
59
59
6060
6161
6262
echo "${partitiontable} found."
echo "-----------------------------------------------"
echo ""
"$scriptDir"InstallLog.sh "${targetVolume}" "Identified ${targetDisk} is on a volume 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}" "Identified ${targetDisk} is on a volume 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}" "Identified ${targetDisk} is on a volume using MBR."
"$scriptDir"InstallLog.sh "${targetVolume}" "${targetDisk} is using MBR."
exit 3
fi
branches/blackosx/package/Scripts/Install/WriteChameleonStage2.sh
3333
3434
3535
36
37
38
3936
4037
4138
......
6966
7067
7168
72
73
7469
75
7670
77
7871
7972
8073
fi
# check to see if install to EFI system partition was selected
# if chosen, the package installer will add a file named 'nullESP'
# in to the temporary directory /.Chameleon
if [ "${selectedDestination}" = "/Volumes/EFI" ]; then
echo "DEBUG: EFI install chosen"
"$scriptDir"InstallLog.sh "${targetVolume}" "Written boot to ${targetVolume}."
fi
#if [ -f "${selectedDestination}"/.Chameleon/nullhideboot ]; then
#
#echo "Executing command: SetFile -a V ${targetVolume}/${stage2Loader}"
#"${selectedDestination}"/.Chameleon//Tools/SetFile -a V "${targetVolume}"/"${stage2Loader}"
#fi
branches/blackosx/package/Scripts/Install/CheckProceed.sh
6060
6161
6262
63
63
6464
6565
echo "-----------------------------------------------"
echo ""
"$scriptDir"InstallLog.sh "${installerVolume}" "CheckProceed: PASS"
#"$scriptDir"InstallLog.sh "${installerVolume}" "CheckProceed: PASS"
exit 0
branches/blackosx/package/Scripts/Install/SetActivePartition.sh
44
55
66
7
8
9
10
7
118
9
10
11
12
13
14
15
1216
1317
1418
......
2832
2933
3034
35
36
37
3138
32
39
40
3341
34
35
36
3742
38
43
44
3945
40
46
47
4148
4249
4350
44
51
4552
4653
4754
......
5057
5158
5259
53
60
61
5462
5563
5664
5765
5866
5967
60
61
62
63
68
echo "Set Active Partition ONLY if Windows is not installed"
echo "*****************************************************"
# for example:
# efiformat code is 1 for HFS, 2 for MSDOS, 0 for unknown
# diskSigCheck code is 1 for a Windows install, 0 for no Windows install
# Sets partition active if Windows is not installed.
# Receives efiformat: code is 1 for HFS, 2 for MSDOS, 0 for unknown
# Receives diskSigCheck: code is 1 for a Windows install, 0 for no Windows install
# Receives targetDiskRaw: for example, /dev/rdisk1
# Receives targetSlice: for example, 1
# Receives targetVolume: Volume to install to.
# Receives scriptDir: The location of the main script dir.
if [ "$#" -eq 6 ]; then
efiformat="$1"
diskSigCheck="$2"
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}"
if [ ${diskSigCheck} == "0" ]; then
echo "DEBUG: Windows is not installed so let's change the active partition"
#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"
partitionactive=$( "${scriptDir}"/Tools/fdisk440 -d ${targetDiskRaw} | grep -n "*" | awk -F: '{print $1}')
echo "Current Active Partition: ${partitionactive}"
if [ "${partitionactive}" = "${targetSlice}" ]; then
echo "${targetVolume} is already flagged as active"
#echo "${targetVolume} is already flagged as active"
"$scriptDir"InstallLog.sh "${targetVolume}" "${targetVolume} is already flagged as active"
else
echo "${targetVolume} is not flagged as active, so let's do it."
#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."
# BadAxe requires EFI partition to be flagged active.
# but it doesn't' hurt to do it for any non-windows partition.
"${scriptDir}"/Tools/fdisk440 -e ${targetDiskRaw} <<-MAKEACTIVE
fdisk -e ${targetDiskRaw} <<-MAKEACTIVE
print
flag ${targetSlice}
write
MAKEACTIVE
fi
else
echo "Windows is installed so we let that remain the active partition"
#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
echo "-----------------------------------------------"
echo ""
echo ""
exit 0
exit 0
branches/blackosx/package/Scripts/Install/CheckGRUBLinuxLoader.sh
4545
4646
4747
48
48
4949
5050
echo "-----------------------------------------------"
echo ""
"$scriptDir"InstallLog.sh "${targetVolume}" "GRUB/LILO: PASS"
#"$scriptDir"InstallLog.sh "${targetVolume}" "GRUB/LILO: PASS"
exit 0

Archive Download the corresponding diff file

Revision: 1558