Chameleon

Chameleon Commit Details

Date:2015-03-05 17:39:45 (4 years 4 months ago)
Author:ErmaC
Commit:2588
Parents: 2587
Message:Update pkg scripts (Credits to Micky1979)
Changes:
M/trunk/package/Scripts.templates/Post/postinstall
M/trunk/package/Scripts.templates/Pre/preinstall
M/trunk/package/Scripts/Main/Standardpostinstall
M/trunk/package/Scripts/Main/ESPpostinstall

File differences

trunk/package/Scripts.templates/Post/postinstall
5656
5757
5858
59
60
61
62
63
6459
6560
6661
......
8176
8277
8378
79
80
81
82
83
8484
8585
8686
echo "Moving Extra folder to ${choicedVolume}"
cp -R "${v_mntpt}/Extra" "${choicedVolume}"/
echo "NOTE: any Themes or modules you have must be there since this now"
echo " is the boot partition. ACPI tables, SMBios.plist and the"
echo " org.chameleon.Boot.plist (with custom settings for the target"
echo " OSX must be in each partition that contain it.)"
echo "$subLine"
echo "Post postinstall script complete"
echo "$mainLine"
# copying the installer log inside the Extra folder
if [[ $( /usr/libexec/PlistBuddy -c "Print bootloader" ${configFile} ) == "true" ]];then
# if we have installed the bootloader, this is a new log
echo "NOTE: any Themes or modules you have must be there since this now"
echo " is the boot partition. ACPI tables, SMBios.plist and the"
echo " org.chameleon.Boot.plist (with custom settings for the target"
echo " OSX must be in each partition that contain it.)"
echo "$mainLine"
cat "${v_mntpt}/${logName}" > "${choicedVolume}/Extra/${logName}"
else
# ..otherwise adding the new log to the existing one (if exist)
trunk/package/Scripts.templates/Pre/preinstall
6565
6666
6767
68
69
70
6871
6972
7073
exec > >(tee -a "${v_mntpt}/${logName}") 2>&1
echo "$mainLine"
echo "SYSTEM INFO:"
sw_vers
echo "$mainLine"
echo "Pre-Install Script"
echo "$subLine"
trunk/package/Scripts/Main/ESPpostinstall
3535
3636
3737
38
39
4038
4139
4240
......
179177
180178
181179
182
183
184
185
186
187
188
189
190
191
192
180
181
182
183
184
185
186
187
188
189
190
191
193192
194193
195194
......
199198
200199
201200
201
202
203
202204
203
204
205
206
205207
206
207
208208
209209
210210
logName="Chameleon_Installer_Log.txt"
logFile="${v_mntpt}/${logName}"
# --------------------------------------------------------------------------------------------------------
stage0Loader="boot0"
stage0LoaderDualBoot="boot0md"
stage1LoaderHFS="boot1h"
stage1LoaderFAT="boot1f32"
stage1LoaderExFAT="boot1x"
}
# --------------------------------------------------------------------------------------------------------
PARTITION_ACTIVE_IF() {
echo -e "${mainLine}\nSET PARTITION ACTIVE:"
# if Windows was detected, don't activate the partition..
# if the stage 0 loader is boo0hfs, don't activate the partition
if [ WINDOWS_EXIST = "0" ] || [ "${stage0Loader}" != "boot0hfs" ];then
partitionactive=$( fdisk -d ${targetDiskRaw} | grep -n "*" | awk -F: '{print $1}')
if [ "${partitionactive}" ] && [ "${partitionactive}" = "${targetSlice}" ]; then
echo "${targetDiskRaw#/dev/r}, slice "${targetSlice}" is already set active. No need to change it."
else
echo "Setting ${choicedVolume} partition active."
# BadAxe requires EFI partition to be flagged active.
# but it doesn't' hurt to do it for any non-windows partition.
if [ $InstallBootloader = "1" ];then
echo -e "${mainLine}\nSET PARTITION ACTIVE:"
# if Windows was detected, don't activate the partition..
# if the stage 0 loader is boo0hfs, don't activate the partition
if [ WINDOWS_EXIST = "0" ] || [ "${stage0Loader}" != "boot0hfs" ];then
partitionactive=$( fdisk -d ${targetDiskRaw} | grep -n "*" | awk -F: '{print $1}')
if [ "${partitionactive}" ] && [ "${partitionactive}" = "${targetSlice}" ]; then
echo "${targetDiskRaw#/dev/r}, slice "${targetSlice}" is already set active. No need to change it."
else
echo "Setting ${choicedVolume} partition active."
# BadAxe requires EFI partition to be flagged active.
# but it doesn't' hurt to do it for any non-windows partition.
# leave left aligned the follow code:
fdisk -e ${targetDiskRaw} <<-MAKEACTIVE
y
quit
MAKEACTIVE
fi
else
echo "Partition will not activate when Windows is detected or stage 0 is boot0hfs"
fi
else
echo "Partition will not activate when Windows is detected or stage 0 is boot0hfs"
echo ""
echo "$mainLine"
fi
echo ""
echo "$mainLine"
}
# --------------------------------------------------------------------------------------------------------
# Writing stage 0
trunk/package/Scripts/Main/Standardpostinstall
3535
3636
3737
38
39
4038
4139
4240
......
179177
180178
181179
182
183
184
185
186
187
188
189
190
191
192
180
181
182
183
184
185
186
187
188
189
190
191
193192
194193
195194
......
199198
200199
201200
201
202
203
202204
203
204
205
206
205207
206
207
208208
209209
210210
logName="Chameleon_Installer_Log.txt"
logFile="${v_mntpt}/${logName}"
# --------------------------------------------------------------------------------------------------------
stage0Loader="boot0"
stage0LoaderDualBoot="boot0md"
stage1LoaderHFS="boot1h"
stage1LoaderFAT="boot1f32"
stage1LoaderExFAT="boot1x"
}
# --------------------------------------------------------------------------------------------------------
PARTITION_ACTIVE_IF() {
echo -e "${mainLine}\nSET PARTITION ACTIVE:"
# if Windows was detected, don't activate the partition..
# if the stage 0 loader is boo0hfs, don't activate the partition
if [ WINDOWS_EXIST = "0" ] || [ "${stage0Loader}" != "boot0hfs" ];then
partitionactive=$( fdisk -d ${targetDiskRaw} | grep -n "*" | awk -F: '{print $1}')
if [ "${partitionactive}" ] && [ "${partitionactive}" = "${targetSlice}" ]; then
echo "${targetDiskRaw#/dev/r}, slice "${targetSlice}" is already set active. No need to change it."
else
echo "Setting ${choicedVolume} partition active."
# BadAxe requires EFI partition to be flagged active.
# but it doesn't' hurt to do it for any non-windows partition.
if [ $InstallBootloader = "1" ];then
echo -e "${mainLine}\nSET PARTITION ACTIVE:"
# if Windows was detected, don't activate the partition..
# if the stage 0 loader is boo0hfs, don't activate the partition
if [ WINDOWS_EXIST = "0" ] || [ "${stage0Loader}" != "boot0hfs" ];then
partitionactive=$( fdisk -d ${targetDiskRaw} | grep -n "*" | awk -F: '{print $1}')
if [ "${partitionactive}" ] && [ "${partitionactive}" = "${targetSlice}" ]; then
echo "${targetDiskRaw#/dev/r}, slice "${targetSlice}" is already set active. No need to change it."
else
echo "Setting ${choicedVolume} partition active."
# BadAxe requires EFI partition to be flagged active.
# but it doesn't' hurt to do it for any non-windows partition.
# leave left aligned the follow code:
fdisk -e ${targetDiskRaw} <<-MAKEACTIVE
y
quit
MAKEACTIVE
fi
else
echo "Partition will not activate when Windows is detected or stage 0 is boot0hfs"
fi
else
echo "Partition will not activate when Windows is detected or stage 0 is boot0hfs"
echo ""
echo "$mainLine"
fi
echo ""
echo "$mainLine"
}
# --------------------------------------------------------------------------------------------------------
# Writing stage 0

Archive Download the corresponding diff file

Revision: 2588