Chameleon

Chameleon Commit Details

Date:2011-10-25 09:02:58 (12 years 5 months ago)
Author:blackosx
Commit:1658
Parents: 1657
Message:Apply fix for issue writing /Extra folder when installing to /. Commented out newer additions not implemented yet.
Changes:
M/branches/blackosx/package/Resources/en.lproj/Localizable.strings
M/branches/blackosx/package/buildpkg.sh
M/branches/blackosx/package/Scripts/Main/ESPpostinstall
M/branches/blackosx/package/Scripts/Main/postinstall
M/branches/blackosx/package/Scripts/Main/Standardpostinstall
M/branches/blackosx/package/Scripts/Main/preinstall

File differences

branches/blackosx/package/Scripts/Main/ESPpostinstall
3636
3737
3838
39
39
40
41
42
43
44
45
46
47
4048
4149
4250
stage1LoaderFAT="boot1f32"
stage2Loader="boot"
targetVolumeChosenByUser=$3
# If target volume root of current system then replace
# / with volume name.
if [ "$3" == "/" ]
then
targetVolumeChosenByUser="/Volumes/"$( ls -1F /Volumes | sed -n 's:@$::p' )
else
targetVolumeChosenByUser="$3"
fi
targetDeviceChosenByUser=$( df "${targetVolumeChosenByUser}" | sed -n '2p' | awk '{print $1}' )
targetVolume="/Volumes/EFI"
branches/blackosx/package/Scripts/Main/postinstall
1818
1919
2020
21
21
22
2223
2324
24
25
2526
2627
2728
......
3132
3233
3334
34
35
36
37
38
39
40
41
42
43
44
35
36
37
4538
4639
4740
......
8679
8780
8881
89
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
90109
91110
92
111
93112
94113
95114
......
170189
171190
172191
192
173193
174194
175195
exit 1
fi
# clean up what would otherwise turn into "//" paths
# If target volume root of current system then replace
# / with volume name.
if [ "$3" == "/" ]
then
dest_vol=""
dest_vol="/Volumes/"$( ls -1F /Volumes | sed -n 's:@$::p' )
else
dest_vol="$3"
fi
export MYLOCATION="${MYLOCATION%/*}"
scriptDir=$MYLOCATION
# Has install log already been generated?
if [ ! -f "${dest_vol}"/.ChameleonLogFlag ]; then
# Write some information to the Install Log
versionNumber=`cat "${scriptDir}"/Resources/version`
revisionNumber=`cat "${scriptDir}"/Resources/revision`
"$scriptDir"InstallLog.sh "${dest_vol}" "Installer version: ${versionNumber} ${revisionNumber}"
"$scriptDir"InstallLog.sh "${dest_vol}" "Running Post postinstall script"
"$scriptDir"InstallLog.sh "${dest_vol}" "Target volume = ${dest_vol}"
else
"$scriptDir"InstallLog.sh "${dest_vol}" "Running Post postinstall script"
fi
# Write some information to the Install Log
"$scriptDir"InstallLog.sh "${dest_vol}" "Running Post postinstall script"
"$scriptDir"InstallLog.sh "${dest_vol}" "Target volume = ${dest_vol}"
# set temporary directory
chamTemp="$dest_vol/usr/local/chamTemp"
mkdir "$chamTemp"/Extra
fi
# Create template for org.chameleon.Boot.plist"
tempOCBP="$chamTemp"/Extra/org.chameleon.Boot.plist
## Does the user want to upgrade an existing /Extra folder?
## If so, then make a copy of their Boot.plist.
#if [ -e "$chamTemp/install_type_upgrade" ]; then
## Check for an existing /Extra folder
#if [ -e "$dest_vol"/.ChameleonEFI ]; then
#if [ -e "/Volumes/EFI/Extra/org.chameleon.Boot.plist" ]; then
#cp /Volumes/EFI/Extra/org.chameleon.Boot.plist "$tempOCBP"
#fi
#if [ -e "/Volumes/EFI/Extra/com.apple.Boot.plist" ]; then
#cp /Volumes/EFI/Extra/com.apple.Boot.plist "$tempOCBP"
#fi
#else
#if [ -e "$dest_vol/Extra/org.chameleon.Boot.plist" ]; then
#cp "${dest_vol}/Extra/org.chameleon.Boot.plist" "$tempOCBP"
#fi
#if [ -e "$dest_vol/Extra/com.apple.Boot.plist" ]; then
#cp "${dest_vol}/Extra/com.apple.Boot.plist" "$tempOCBP"
#fi
#fi
#elif [ -e "$chamTemp/install_type_new" ]; then
## Create template for org.chameleon.Boot.plist"
#cp "$4"/Library/Preferences/SystemConfiguration/com.apple.Boot.plist "$tempOCBP"
#fi
# Create template for org.chameleon.Boot.plist"
tempOCBP="$chamTemp"/Extra/org.chameleon.Boot.plist
cp "$4"/Library/Preferences/SystemConfiguration/com.apple.Boot.plist "$tempOCBP"
# Read list of all boot options the user added.
arrayCount=0
kernelFlagCount=0
mv "$dest_vol/Extra" "$dest_vol/Extra_OLD-"$( date "+%H-%M-%S" )
fi
"$scriptDir"InstallLog.sh "${dest_vol}" "Writing folder: $dest_vol/Extra"
echo "Copying $chamTemp/Extra TO $dest_vol"
cp -R "$chamTemp"/Extra "$dest_vol"
else
# The EFI system partition install option was chosen
branches/blackosx/package/Scripts/Main/Standardpostinstall
3737
3838
3939
40
40
41
42
43
44
45
46
47
48
49
4150
4251
4352
......
192201
193202
194203
204
195205
196206
197207
stage1LoaderFAT="boot1f32"
stage2Loader="boot"
targetVolume=$3
# If target volume root of current system then replace
# / with volume name.
if [ "$3" == "/" ]
then
targetVolume="/Volumes/"$( ls -1F /Volumes | sed -n 's:@$::p' )
else
targetVolume="$3"
fi
targetDevice=$( df "${targetVolume}" | sed -n '2p' | awk '{print $1}' )
targetDeviceRaw=${targetDevice/disk/rdisk}
targetDisk=${targetDevice%s*}
"$scriptDir"InstallLog.sh "${targetVolume}" "LineBreak"
"$scriptDir"InstallLog.sh "${targetVolume}" "Standard script complete"
"$scriptDir"InstallLog.sh "${targetVolume}" "LineBreak"
echo "==============================================="
echo "END - Standard Post-Install Script"
branches/blackosx/package/Scripts/Main/preinstall
2020
2121
2222
23
2423
24
25
26
27
28
29
30
31
32
2533
2634
2735
export MYLOCATION="${MYLOCATION%/*}"
scriptDir=$MYLOCATION
targetVolume=$3
# If target volume root of current system then replace
# / with volume name.
if [ "$3" == "/" ]
then
targetVolume="/Volumes/"$( ls -1F /Volumes | sed -n 's:@$::p' )
else
targetVolume="$3"
fi
logName="Chameleon_Installer_Log.txt"
logFile="${targetVolume}"/$logName
branches/blackosx/package/Resources/en.lproj/Localizable.strings
99
1010
1111
12
13
14
15
16
17
18
19
20
21
22
23
24
1225
1326
1427
// ============================================================================
// Install Type
// ----------------------------------------------------------------------------
"InstallType_title" = "Install Type";
"InstallType_description" = "Choose to perform a new installation or upgrade an existing installation.";
"New_title" = "New Installation";
"New_description" = "Backup an existing /Extra folder, if found on the target partition. A new one will be created if any options are chosen from the installer, other than the Bootloader.";
"Upgrade_title" = "Upgrade";
"Upgrade_description" = "Merge an existing /Extra folder, if found on the target, with any options chosen from the installer, other than the Bootloader.";
// ============================================================================
// Bootloader
// ----------------------------------------------------------------------------
"Chameleon_title" = "Chameleon Bootloader";
branches/blackosx/package/buildpkg.sh
8888
8989
9090
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
91116
92117
93118
buildpackage "${1}/Core" "/" "0" "start_visible=\"false\" start_selected=\"true\"" >/dev/null 2>&1
# End build core package
# build install type
#echo "================= Chameleon ================="
#outline[$((outlinecount++))]="${indent[$xmlindent]}<line choice=\"InstallType\">"
#choices[$((choicescount++))]="\t<choice\n\t\tid=\"InstallType\"\n\t\ttitle=\"InstallType_title\"\n\t\tdescription=\"InstallType_description\">\n\t</choice>\n"
#((xmlindent++))
#packagesidentity="org.chameleon.type"
#
## build new install package
#mkdir -p ${1}/New/Root
#echo "" > "${1}/New/Root/install_type_new"
#echo "[BUILD] New "
# buildpackage "${1}/New" "/$chamTemp" "" "start_enabled=\"true\" selected=\"exclusive(choices['Upgrade'])\"" >/dev/null 2>&1
## End build new install package
#
## build upgrade package
#mkdir -p ${1}/Upgrade/Root
#echo "" > "${1}/Upgrade/Root/install_type_upgrade"
#echo "[BUILD] Upgrade "
#buildpackage "${1}/Upgrade" "/$chamTemp" "" "start_selected=\"false\" selected=\"exclusive(choices['New'])\"" >/dev/null 2>&1
## End build upgrade package
# ((xmlindent--))
# outline[$((outlinecount++))]="${indent[$xmlindent]}</line>"
# End build install type
# build Chameleon package
echo "================= Chameleon ================="
outline[$((outlinecount++))]="${indent[$xmlindent]}<line choice=\"Chameleon\">"

Archive Download the corresponding diff file

Revision: 1658