Chameleon

Chameleon Commit Details

Date:2011-10-25 19:07:20 (12 years 6 months ago)
Author:blackosx
Commit:1660
Parents: 1659
Message:Add choice for user to upgrade and existing /Extra folder. This needs more testing tonight.. and need to look at merging kernel flags.
Changes:
M/branches/blackosx/package/buildpkg.sh
M/branches/blackosx/package/Scripts/Sub/InstallLog.sh
M/branches/blackosx/package/Scripts/Main/postinstall

File differences

branches/blackosx/package/Scripts/Main/postinstall
33
44
55
6
7
86
97
108
......
4139
4240
4341
42
4443
4544
4645
......
8079
8180
8281
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
82
10883
10984
11085
......
169144
170145
171146
172
147
173148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
174182
175183
176184
echo "==============================================="
echo "Post Post-Install Script"
echo "*********************************"
echo "-----------------------------------------------"
echo ""
#echo "DEBUG: $ 1 = Full path to the installation package the installer app is processing: " $1
#echo "DEBUG: $ 2 = Full path to the installation destination: " $2
# Check for stopped installation due to Chameleon
# already existing on the same disk.
# TO DO - This check can be removed as it's no longer used!!
if [ ! -f "$dest_vol"/.ChameleonExists ]; then
# ---------------------------------------------
fi
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"
fi
fi
fi
# ---------------------------------------------
# Merge /Extra folders?
# ---------------------------------------------
# Does the user want to upgrade an existing /Extra folder?
# If so, then merge their existing one in to the temp one
if [ -e "$chamTemp/install_type_upgrade" ]; then
# first move the new org.chameleon.Boot.plist out of tmp
# Extra folder so we can merge that separately.
mv "$tempOCBP" "$chamTemp/holding.plist"
# Check for an existing /Extra folder
# and merge existing /Extra with temp one.
if [ -e "$dest_vol"/.ChameleonEFI ]; then
if [ -e "/Volumes/EFI/Extra" ]; then
ditto --noextattr --noqtn /Volumes/EFI/Extra "$chamTemp"/Extra
fi
else
if [ -e "$dest_vol/Extra" ]; then
ditto --noextattr --noqtn "${dest_vol}"/Extra "$chamTemp"/Extra
fi
fi
# Check existing plist name for old naming convention
# and change to new convention.
if [ -e "$chamTemp"/Extra/com.apple.Boot.plist ]; then
mv "$chamTemp"/Extra/com.apple.Boot.plist "$tempOCBP"
fi
# Merge new org.chameleon.Boot.plist (holding.plist)
# with their currently existing one.
sudo /usr/libexec/plistbuddy -c "Merge $chamTemp/holding.plist" "$tempOCBP"
fi
# ---------------------------------------------
# Copy temp Extra folder to target destination
# ---------------------------------------------
# If we've made a temporary Extra folder to use then
branches/blackosx/package/Scripts/Sub/InstallLog.sh
11
22
3
4
5
3
4
5
66
77
88
......
1414
1515
1616
17
18
17
18
1919
20
20
2121
2222
2323
#!/bin/bash
echo "==============================================="
echo "InstallLog: Create/Append installation log"
echo "**********************************************"
#echo "==============================================="
#echo "InstallLog: Create/Append installation log"
#echo "**********************************************"
# Writes to the Chameleon_Installer_Log.txt file created
# by the preinstall script at the start of installation.
if [ "$#" -eq 2 ]; then
logLocation="$1"
verboseText="$2"
echo "DEBUG: passed argument = ${logLocation}"
echo "DEBUG: passed argument = ${verboseText}"
#echo "DEBUG: passed argument = ${logLocation}"
#echo "DEBUG: passed argument = ${verboseText}"
else
echo "Error - wrong number of values passed"
echo "InstallLog: Error - wrong number of values passed"
exit 9
fi
branches/blackosx/package/buildpkg.sh
8989
9090
9191
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
92
93
94
95
96
97
98
99
100
101
102
103
111104
112
113
105
106
107
108
109
110
111
112
113
114114
115115
116116
# 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
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
# ((xmlindent--))
# outline[$((outlinecount++))]="${indent[$xmlindent]}</line>"
# 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

Archive Download the corresponding diff file

Revision: 1660