Chameleon

Chameleon Commit Details

Date:2012-01-08 23:24:00 (8 years 4 months ago)
Author:JrCs
Commit:1777
Parents: 1776
Message:Improved Installer - Start using template scripts
Changes:
R/trunk/package/Scripts/Main/preinstall → /trunk/package/Scripts.templates/Pre/preinstall
R/trunk/package/Scripts/Sub/InstallLog.sh → /trunk/package/Scripts.templates/InstallerLog/InstallLog.sh
R/trunk/package/Scripts/Main/postinstall → /trunk/package/Scripts.templates/Post/postinstall
A/trunk/package/Scripts.templates/Post
A/trunk/package/Scripts.templates/Pre
A/trunk/package/Scripts.templates/InstallerLog
A/trunk/package/Scripts.templates
M/trunk/package/Resources/ru.lproj/Conclusion.rtfd/TXT.rtf
M/trunk/package/buildpkg.sh
M/trunk/package/Resources/id.lproj/Conclusion.rtfd/TXT.rtf
M/trunk/package/Resources/el.lproj/Conclusion.rtfd/TXT.rtf
M/trunk/package/Resources/ar.lproj/Conclusion.rtfd/TXT.rtf
M/trunk/package/Resources/en.lproj/Conclusion.rtfd/TXT.rtf
M/trunk/package/Resources/mk.lproj/Conclusion.rtfd/TXT.rtf
M/trunk/package/Resources/es.lproj/Conclusion.rtfd/TXT.rtf
M/trunk/package/Resources/ko.lproj/Conclusion.rtfd/TXT.rtf
M/trunk/package/Resources/it.lproj/Conclusion.rtfd/TXT.rtf
M/trunk/package/Resources/sr.lproj/Conclusion.rtfd/TXT.rtf
M/trunk/package/Resources/pt-BR.lproj/Conclusion.rtfd/TXT.rtf
M/trunk/package/Resources/bg.lproj/Conclusion.rtfd/TXT.rtf
M/trunk/package/Resources/de.lproj/Conclusion.rtfd/TXT.rtf
M/trunk/package/Resources/ja.lproj/Conclusion.rtfd/TXT.rtf
M/trunk/package/Resources/zh_TW.lproj/Conclusion.rtfd/TXT.rtf
M/trunk/package/Resources/he.lproj/Conclusion.rtfd/TXT.rtf
M/trunk/package/Resources/zh_CN.lproj/Conclusion.rtfd/TXT.rtf
M/trunk/package/Resources/pt-PT.lproj/Conclusion.rtfd/TXT.rtf
M/trunk/package/Resources/bs.lproj/Conclusion.rtfd/TXT.rtf
M/trunk/package/Resources/fr.lproj/Conclusion.rtfd/TXT.rtf
M/trunk/package/Resources/nl.lproj/Conclusion.rtfd/TXT.rtf
M/trunk/package/Resources/hr.lproj/Conclusion.rtfd/TXT.rtf
M/trunk/package/Resources/pl.lproj/Conclusion.rtfd/TXT.rtf

File differences

trunk/package/Scripts.templates/InstallerLog/InstallLog.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
#echo "==============================================="
#echo "InstallLog: Create/Append installation log"
#echo "**********************************************"
# Writes to the @LOG_FILENAME@ file created
# by the preinstall script at the start of installation.
# Receives two parameters
# $1 = selected volume for location of the install log
# $2 = text to write to the installer log
if [ "$#" -eq 2 ]; then
logLocation="$1"
verboseText="$2"
#echo "DEBUG: passed argument = ${logLocation}"
#echo "DEBUG: passed argument = ${verboseText}"
else
echo "InstallLog: Error - wrong number of values passed"
exit 9
fi
logName="@LOG_FILENAME@"
logFile="${logLocation}"/$logName
if [ -f "${logFile}" ]; then
# Append messages to the log as passed by other scripts.
if [ "${verboseText}" = "Diskutil" ]; then
diskutil list >>"${logFile}"
echo "======================================================" >>"${logFile}"
fi
if [ "${verboseText}" = "LineBreak" ]; then
echo "======================================================" >>"${logFile}"
fi
if [[ "${verboseText}" == *fdisk* ]]; then
targetDiskRaw="${verboseText#fdisk *}"
fdisk $targetDiskRaw >>"${logFile}"
echo " " >>"${logFile}"
fi
if [ "${verboseText}" != "LineBreak" ] && [[ "${verboseText}" != *fdisk* ]] && [[ "${verboseText}" != "Diskutil" ]]; then
echo "${verboseText}" >> "${logFile}"
fi
fi
exit 0
trunk/package/Scripts.templates/Post/postinstall
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
#!/bin/bash
mergeString () {
local src="${1}"
local new="${2}"
local result="$src"
for newItem in $new ;do
local found=0
for srcItem in $src ;do
if [[ $newItem == $srcItem ]];then
found=1
break
fi
done
[[ $found -eq 0 ]] && result="$result $newItem"
done
echo "$result"
}
echo "==============================================="
echo "Post Post-Install Script"
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
#echo "DEBUG: $ 3 = Installation volume (mountpoint) to receive the payload: " $3
#echo "DEBUG: $ 4 = Root directory for the system: " $4
# Check target exists
if [ ! -e "$3" ]
then
echo "$3 volume does not exist!"
exit 1
fi
# If target volume root of current system then replace
# / with volume name.
if [ "$3" == "/" ]
then
dest_vol="/Volumes/"$( ls -1F /Volumes | sed -n 's:@$::p' )
else
dest_vol="$3"
fi
# Find script location so to find the Install Log script.
MYLOCATION="${PWD}/${BASH_ARGV[0]}"
export MYLOCATION="${MYLOCATION%/*}"
scriptDir=$MYLOCATION
# 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"
# ---------------------------------------------
# Build org.chameleon.Boot.plist
# ---------------------------------------------
# All options selected are now dummy files with
# the filename of the option and value residing
# in /usr/local/chamTemp/options/
# for example. Boot Banner=Yes
# Are there any options to build?
if [ "$(ls -A ${chamTemp}/options )" ]; then
# Check for temporary directory/Extra folder.
if [ ! -d "$chamTemp"/Extra ]; then
mkdir "$chamTemp"/Extra
fi
tempOCBP="$chamTemp"/Extra/org.chameleon.Boot.plist
# 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.
while IFS= read -r -d '' FILE; do
option="${FILE##*/}"
key="${option%%=*}"
value="${option#*=}"
# Check for 'Kernel Flags' key indicate that should be a kernel flag
if [[ "$key" = "Kernel Flags" ]];then
# plistbuddy only add's if the key doesn't already exist.
# So let's store any kernelflags and add them all at the
# same time once when we reach the end of the options list.
kernelflag[${#kernelflag[*]}]="$value"
"$scriptDir"InstallLog.sh "${dest_vol}" "Added kernel flag: $value"
else
# escape any spaces
keyToUse=$( echo "$key" | sed 's/ /\\ /g' )
sudo /usr/libexec/plistbuddy -c "Add :${keyToUse} string ${value}" "$tempOCBP"
returnValue=$?
if [ ${returnValue} -ne 1 ]; then
"$scriptDir"InstallLog.sh "${dest_vol}" "Added boot option: ${key}=${value}"
else
"$scriptDir"InstallLog.sh "${dest_vol}" "Can't add ${key}=${value} as an option already exists for: ${key}"
fi
fi
done < <( find "${chamTemp}/options" -type f -print0 )
# Add any kernel flags together in to one string.
kernelFlagString="${kernelflag[@]}"
# We add the final string in the next section.
fi
# ---------------------------------------------
# Add any installed modules to the Install Log
# ---------------------------------------------
if [ -e "${chamTemp}"/Extra/modules ]; then
ls "${chamTemp}"/Extra/modules | while read FILE
do
"$scriptDir"InstallLog.sh "${dest_vol}" "Added module: $FILE"
if [ "$FILE" == "Keylayout.dylib" ]; then
"$scriptDir"InstallLog.sh "${dest_vol}" "Also adding required Keymaps."
fi
done
fi
# ---------------------------------------------
# Add any installed themes to the Install Log
# ---------------------------------------------
if [ -e "${chamTemp}"/Extra/Themes ]; then
ls "${chamTemp}"/Extra/Themes | while read FILE
do
"$scriptDir"InstallLog.sh "${dest_vol}" "Added Theme: $FILE"
done
fi
# Does a temporary /Extra folder exist?
if [ -d "$chamTemp"/Extra ]; then
# ---------------------------------------------
# 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
"$scriptDir"InstallLog.sh "${dest_vol}" "User selected to do an upgrade install."
# 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
"$scriptDir"InstallLog.sh "${dest_vol}" "Merging existing /Volumes/EFI/Extra folder."
ditto --noextattr --noqtn /Volumes/EFI/Extra "$chamTemp"/Extra
fi
else
if [ -e "$dest_vol/Extra" ]; then
"$scriptDir"InstallLog.sh "${dest_vol}" "Merging existing ${dest_vol}/Extra folder."
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
"$scriptDir"InstallLog.sh "${dest_vol}" "Renaming existing com.apple.Boot.plist to org.chameleon.Boot.plist."
mv "$chamTemp"/Extra/com.apple.Boot.plist "$tempOCBP"
fi
# Before merging org.chameleon.Boot.plist, copy any
# existing kernel flags, then delete the entry.
currentFlags=$( sudo /usr/libexec/plistbuddy -c "Print :Kernel\ Flags" "$tempOCBP" )
sudo /usr/libexec/plistbuddy -c "Delete :Kernel\ Flags" "$tempOCBP"
# Merge new org.chameleon.Boot.plist (holding.plist)
# with their currently existing one.
"$scriptDir"InstallLog.sh "${dest_vol}" "------
Merging new options into org.chameleon.Boot.plist.
NOTE: Please check the new merged org.chameleon.Boot.plist as
NOTE: any existing keys will NOT have been updated.
NOTE: For example: If you already had Wait=No as a boot option
NOTE: and chose Wait=Yes from the list, this will NOT be changed.
------"
sudo /usr/libexec/plistbuddy -c "Merge $chamTemp/holding.plist" "$tempOCBP"
if [[ -n "$currentFlags" ]];then
# Combine new kernel flags with old ones.
kernelFlagString=$( mergeString "$currentFlags" "${kernelFlagString}" )
fi
elif [ -e "$chamTemp/install_type_new" ]; then
"$scriptDir"InstallLog.sh "${dest_vol}" "User selected to make a new install."
fi
# Write kernel flags option
kernelFlagString=$(echo ${kernelFlagString}) # Remove leading and trailing spaces
if [[ -n "$kernelFlagString" ]];then
sudo /usr/libexec/plistbuddy -c "Add :Kernel\ Flags string $kernelFlagString" "$tempOCBP"
returnValue=$?
if [ ${returnValue} -ne 0 ]; then # key already exists.
sudo /usr/libexec/plistbuddy -c "Delete :Kernel\ Flags" "$tempOCBP"
sudo /usr/libexec/plistbuddy -c "Add :Kernel\ Flags string $kernelFlagString" "$tempOCBP"
fi
fi
# ---------------------------------------------
# Copy temp Extra folder to target destination
# ---------------------------------------------
# Check for an existing /Extra folder. If found, back it up
# before copying the temporary Extra folder to destination.
# Extra folder now resides in /usr/local/chamTemp/
# Copy /usr/local/chamTemp/Extra to correct location.
if [ ! -f "$dest_vol"/.ChameleonEFI ]; then
# The Standard install option chosen
rm -rf "$dest_vol/Extra" # Remove old Extra directory
"$scriptDir"InstallLog.sh "${dest_vol}" "Writing new Extra folder to: $dest_vol/"
echo "Copying $chamTemp/Extra TO $dest_vol"
cp -R "$chamTemp"/Extra "$dest_vol"
else
# The EFI system partition install option was chosen
rm -rf "/Volumes/EFI/Extra" # Remove old Extra directory
"$scriptDir"InstallLog.sh "${dest_vol}" "Writing new Extra folder to: /Volumes/EFI/"
cp -R "$chamTemp"/Extra "/Volumes/EFI"
fi
else
if [ ! -f "$dest_vol"/.ChameleonEFI ]; then
if [ -e "$dest_vol"/Extra ]; then
"$scriptDir"InstallLog.sh "${dest_vol}" "No elements selected for adding to an Extra folder,
so leaving existing $dest_vol/Extra folder untouched."
fi
else
if [ -e "/Volumes/EFI/Extra" ]; then
"$scriptDir"InstallLog.sh "${dest_vol}" "No elements selected for adding to an Extra folder,
so leaving existing /Volumes/EFI/Extra folder untouched."
fi
fi
fi
# ---------------------------------------------
# Update Rights
# ---------------------------------------------
chmod 777 ${dest_vol}/Extra 2>/dev/null
chmod 666 ${dest_vol}/Extra/*.plist 2>/dev/null
# ---------------------------------------------
# Cleanup
# ---------------------------------------------
# Unmount ALL mounted volumes named EFI
"$scriptDir"UnMountEFIvolumes.sh "${dest_vol}" "${scriptDir}"
# remove any temporary boot sector files if they exist
if [ -d /tmp/newbs ]; then
cleanUp="${cleanUp},1a"
rm /tmp/newbs
fi
if [ -d /tmp/origbs ]; then
cleanUp="${cleanUp},1b"
rm /tmp/origbs
fi
if [ -d /tmp/newBootSector ]; then
cleanUp="${cleanUp},1c"
rm /tmp/newbs
fi
if [ -d /tmp/originalBootSector ]; then
cleanUp="${cleanUp},1d"
rm /tmp/origbs
fi
# delete the temporary Chameleon folder
if [ -e "$chamTemp" ]; then
cleanUp="${cleanUp},2"
rm -rf "$chamTemp"
fi
# Remove /.ChameleonEFI file
if [ -f "$dest_vol"/.ChameleonEFI ]; then
cleanUp="${cleanUp},3"
rm "$dest_vol"/.ChameleonEFI
fi
"$scriptDir"InstallLog.sh "${dest_vol}" "Cleanup: ${cleanUp}"
"$scriptDir"InstallLog.sh "${dest_vol}" "LineBreak"
"$scriptDir"InstallLog.sh "${dest_vol}" "Post script complete"
echo "==============================================="
echo "END - Post Post-Install Script"
echo "*********************************"
echo "-----------------------------------------------"
echo ""
trunk/package/Scripts.templates/Pre/preinstall
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/bin/bash
echo "==============================================="
echo "Pre-Install Script"
echo "*********************************"
echo "-----------------------------------------------"
echo ""
# Creates text file named '@LOG_FILENAME@'
# at the root of the target volume. This is to help show the
# user why the installation process failed (even though the
# package installer ends reading 'Installation Successful'.
# Find location of this script in the package installer
# so we know where all the other scripts are located.
MYLOCATION="${PWD}/${BASH_ARGV[0]}"
export MYLOCATION="${MYLOCATION%/*}"
scriptDir=$MYLOCATION
# 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="@LOG_FILENAME@"
logFile="${targetVolume}/$logName"
# ---------------------------------------------
# Preparing Backing up Chameleon files
# ---------------------------------------------
backupDir="${targetVolume}/Chameleon.Backups/"$( date -j "+%F-%Hh%M" )
mkdir -p "$backupDir"
if [[ -f "$logFile" ]];then
# Backup old log file
mv "$logFile" "${backupDir}/${logName}"
fi
# Setup @LOG_FILENAME@ file
# by writing header and diskutil list
echo "Chameleon installer log - $( date )
Installer version: %CHAMELEONVERSION% %CHAMELEONREVISION%
======================================================" >"${logFile}"
diskutil list >>"${logFile}"
echo "======================================================" >>"${logFile}"
# ---------------------------------------------
# Backing up Chameleon files
# ---------------------------------------------
# Backup stage2
if [[ -f "${targetVolume}/boot" ]];then
echo "Backing up stage2 file ${targetVolume}/boot to ${backupDir}/boot" >>"${logFile}"
cp -p "${targetVolume}/boot" "${backupDir}/boot"
fi
# Backup /Extra directory
if [[ -d "${targetVolume}/Extra" ]];then
echo "Moving ${targetVolume}/Extra folder to ${backupDir}/Extra" >>"${logFile}"
cp -pR "${targetVolume}/Extra" "${backupDir}/Extra"
fi
chflags -R nohidden "$backupDir" # Remove the invisible flag of files in the backups
echo "======================================================" >>"${logFile}"
echo "==============================================="
echo "END - Pre-Install Script"
echo "*********************************"
echo "-----------------------------------------------"
echo ""
exit 0
trunk/package/Scripts/Main/postinstall
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
#!/bin/bash
mergeString () {
local src="${1}"
local new="${2}"
local result="$src"
for newItem in $new ;do
local found=0
for srcItem in $src ;do
if [[ $newItem == $srcItem ]];then
found=1
break
fi
done
[[ $found -eq 0 ]] && result="$result $newItem"
done
echo "$result"
}
echo "==============================================="
echo "Post Post-Install Script"
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
#echo "DEBUG: $ 3 = Installation volume (mountpoint) to receive the payload: " $3
#echo "DEBUG: $ 4 = Root directory for the system: " $4
# Check target exists
if [ ! -e "$3" ]
then
echo "$3 volume does not exist!"
exit 1
fi
# If target volume root of current system then replace
# / with volume name.
if [ "$3" == "/" ]
then
dest_vol="/Volumes/"$( ls -1F /Volumes | sed -n 's:@$::p' )
else
dest_vol="$3"
fi
# Find script location so to find the Install Log script.
MYLOCATION="${PWD}/${BASH_ARGV[0]}"
export MYLOCATION="${MYLOCATION%/*}"
scriptDir=$MYLOCATION
# 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"
# ---------------------------------------------
# Build org.chameleon.Boot.plist
# ---------------------------------------------
# All options selected are now dummy files with
# the filename of the option and value residing
# in /usr/local/chamTemp/options/
# for example. Boot Banner=Yes
# Are there any options to build?
if [ "$(ls -A ${chamTemp}/options )" ]; then
# Check for temporary directory/Extra folder.
if [ ! -d "$chamTemp"/Extra ]; then
mkdir "$chamTemp"/Extra
fi
tempOCBP="$chamTemp"/Extra/org.chameleon.Boot.plist
# 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.
while IFS= read -r -d '' FILE; do
option="${FILE##*/}"
key="${option%%=*}"
value="${option#*=}"
# Check for 'Kernel Flags' key indicate that should be a kernel flag
if [[ "$key" = "Kernel Flags" ]];then
# plistbuddy only add's if the key doesn't already exist.
# So let's store any kernelflags and add them all at the
# same time once when we reach the end of the options list.
kernelflag[${#kernelflag[*]}]="$value"
"$scriptDir"InstallLog.sh "${dest_vol}" "Added kernel flag: $value"
else
# escape any spaces
keyToUse=$( echo "$key" | sed 's/ /\\ /g' )
sudo /usr/libexec/plistbuddy -c "Add :${keyToUse} string ${value}" "$tempOCBP"
returnValue=$?
if [ ${returnValue} -ne 1 ]; then
"$scriptDir"InstallLog.sh "${dest_vol}" "Added boot option: ${key}=${value}"
else
"$scriptDir"InstallLog.sh "${dest_vol}" "Can't add ${key}=${value} as an option already exists for: ${key}"
fi
fi
done < <( find "${chamTemp}/options" -type f -print0 )
# Add any kernel flags together in to one string.
kernelFlagString="${kernelflag[@]}"
# We add the final string in the next section.
fi
# ---------------------------------------------
# Add any installed modules to the Install Log
# ---------------------------------------------
if [ -e "${chamTemp}"/Extra/modules ]; then
ls "${chamTemp}"/Extra/modules | while read FILE
do
"$scriptDir"InstallLog.sh "${dest_vol}" "Added module: $FILE"
if [ "$FILE" == "Keylayout.dylib" ]; then
"$scriptDir"InstallLog.sh "${dest_vol}" "Also adding required Keymaps."
fi
done
fi
# ---------------------------------------------
# Add any installed themes to the Install Log
# ---------------------------------------------
if [ -e "${chamTemp}"/Extra/Themes ]; then
ls "${chamTemp}"/Extra/Themes | while read FILE
do
"$scriptDir"InstallLog.sh "${dest_vol}" "Added Theme: $FILE"
done
fi
# Does a temporary /Extra folder exist?
if [ -d "$chamTemp"/Extra ]; then
# ---------------------------------------------
# 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
"$scriptDir"InstallLog.sh "${dest_vol}" "User selected to do an upgrade install."
# 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
"$scriptDir"InstallLog.sh "${dest_vol}" "Merging existing /Volumes/EFI/Extra folder."
ditto --noextattr --noqtn /Volumes/EFI/Extra "$chamTemp"/Extra
fi
else
if [ -e "$dest_vol/Extra" ]; then
"$scriptDir"InstallLog.sh "${dest_vol}" "Merging existing ${dest_vol}/Extra folder."
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
"$scriptDir"InstallLog.sh "${dest_vol}" "Renaming existing com.apple.Boot.plist to org.chameleon.Boot.plist."
mv "$chamTemp"/Extra/com.apple.Boot.plist "$tempOCBP"
fi
# Before merging org.chameleon.Boot.plist, copy any
# existing kernel flags, then delete the entry.
currentFlags=$( sudo /usr/libexec/plistbuddy -c "Print :Kernel\ Flags" "$tempOCBP" )
sudo /usr/libexec/plistbuddy -c "Delete :Kernel\ Flags" "$tempOCBP"
# Merge new org.chameleon.Boot.plist (holding.plist)
# with their currently existing one.
"$scriptDir"InstallLog.sh "${dest_vol}" "------
Merging new options into org.chameleon.Boot.plist.
NOTE: Please check the new merged org.chameleon.Boot.plist as
NOTE: any existing keys will NOT have been updated.
NOTE: For example: If you already had Wait=No as a boot option
NOTE: and chose Wait=Yes from the list, this will NOT be changed.
------"
sudo /usr/libexec/plistbuddy -c "Merge $chamTemp/holding.plist" "$tempOCBP"
if [[ -n "$currentFlags" ]];then
# Combine new kernel flags with old ones.
kernelFlagString=$( mergeString "$currentFlags" "${kernelFlagString}" )
fi
elif [ -e "$chamTemp/install_type_new" ]; then
"$scriptDir"InstallLog.sh "${dest_vol}" "User selected to make a new install."
fi
# Write kernel flags option
kernelFlagString=$(echo ${kernelFlagString}) # Remove leading and trailing spaces
if [[ -n "$kernelFlagString" ]];then
sudo /usr/libexec/plistbuddy -c "Add :Kernel\ Flags string $kernelFlagString" "$tempOCBP"
returnValue=$?
if [ ${returnValue} -ne 0 ]; then # key already exists.
sudo /usr/libexec/plistbuddy -c "Delete :Kernel\ Flags" "$tempOCBP"
sudo /usr/libexec/plistbuddy -c "Add :Kernel\ Flags string $kernelFlagString" "$tempOCBP"
fi
fi
# ---------------------------------------------
# Copy temp Extra folder to target destination
# ---------------------------------------------
# Check for an existing /Extra folder. If found, back it up
# before copying the temporary Extra folder to destination.
# Extra folder now resides in /usr/local/chamTemp/
# Copy /usr/local/chamTemp/Extra to correct location.
if [ ! -f "$dest_vol"/.ChameleonEFI ]; then
# The Standard install option chosen
rm -rf "$dest_vol/Extra" # Remove old Extra directory
"$scriptDir"InstallLog.sh "${dest_vol}" "Writing new Extra folder to: $dest_vol/"
echo "Copying $chamTemp/Extra TO $dest_vol"
cp -R "$chamTemp"/Extra "$dest_vol"
else
# The EFI system partition install option was chosen
rm -rf "/Volumes/EFI/Extra" # Remove old Extra directory
"$scriptDir"InstallLog.sh "${dest_vol}" "Writing new Extra folder to: /Volumes/EFI/"
cp -R "$chamTemp"/Extra "/Volumes/EFI"
fi
else
if [ ! -f "$dest_vol"/.ChameleonEFI ]; then
if [ -e "$dest_vol"/Extra ]; then
"$scriptDir"InstallLog.sh "${dest_vol}" "No elements selected for adding to an Extra folder,
so leaving existing $dest_vol/Extra folder untouched."
fi
else
if [ -e "/Volumes/EFI/Extra" ]; then
"$scriptDir"InstallLog.sh "${dest_vol}" "No elements selected for adding to an Extra folder,
so leaving existing /Volumes/EFI/Extra folder untouched."
fi
fi
fi
# ---------------------------------------------
# Update Rights
# ---------------------------------------------
chmod 777 ${dest_vol}/Extra 2>/dev/null
chmod 666 ${dest_vol}/Extra/*.plist 2>/dev/null
# ---------------------------------------------
# Cleanup
# ---------------------------------------------
# Unmount ALL mounted volumes named EFI
"$scriptDir"UnMountEFIvolumes.sh "${dest_vol}" "${scriptDir}"
# remove any temporary boot sector files if they exist
if [ -d /tmp/newbs ]; then
cleanUp="${cleanUp},1a"
rm /tmp/newbs
fi
if [ -d /tmp/origbs ]; then
cleanUp="${cleanUp},1b"
rm /tmp/origbs
fi
if [ -d /tmp/newBootSector ]; then
cleanUp="${cleanUp},1c"
rm /tmp/newbs
fi
if [ -d /tmp/originalBootSector ]; then
cleanUp="${cleanUp},1d"
rm /tmp/origbs
fi
# delete the temporary Chameleon folder
if [ -e "$chamTemp" ]; then
cleanUp="${cleanUp},2"
rm -rf "$chamTemp"
fi
# Remove /.ChameleonEFI file
if [ -f "$dest_vol"/.ChameleonEFI ]; then
cleanUp="${cleanUp},3"
rm "$dest_vol"/.ChameleonEFI
fi
"$scriptDir"InstallLog.sh "${dest_vol}" "Cleanup: ${cleanUp}"
"$scriptDir"InstallLog.sh "${dest_vol}" "LineBreak"
"$scriptDir"InstallLog.sh "${dest_vol}" "Post script complete"
echo "==============================================="
echo "END - Post Post-Install Script"
echo "*********************************"
echo "-----------------------------------------------"
echo ""
trunk/package/Scripts/Main/preinstall
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/bin/bash
echo "==============================================="
echo "Pre-Install Script"
echo "*********************************"
echo "-----------------------------------------------"
echo ""
# Creates text file named 'Chameleon_Installer_Log.txt'
# at the root of the target volume. This is to help show the
# user why the installation process failed (even though the
# package installer ends reading 'Installation Successful'.
# Find location of this script in the package installer
# so we know where all the other scripts are located.
MYLOCATION="${PWD}/${BASH_ARGV[0]}"
export MYLOCATION="${MYLOCATION%/*}"
scriptDir=$MYLOCATION
# 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"
versionNumber=`cat "${scriptDir}"/Resources/version`
revisionNumber=`cat "${scriptDir}"/Resources/revision`
# ---------------------------------------------
# Preparing Backing up Chameleon files
# ---------------------------------------------
backupDir="${targetVolume}/Chameleon.Backups/"$( date -j "+%F-%Hh%M" )
mkdir -p "$backupDir"
if [[ -f "$logFile" ]];then
# Backup old log file
mv "$logFile" "${backupDir}/${logName}"
fi
# Setup Chameleon_Installer_Log.txt file
# by writing header and diskutil list
echo "Chameleon installer log - $( date )
Installer version: ${versionNumber} ${revisionNumber}
======================================================" >"${logFile}"
diskutil list >>"${logFile}"
echo "======================================================" >>"${logFile}"
# ---------------------------------------------
# Backing up Chameleon files
# ---------------------------------------------
# Backup stage2
if [[ -f "${targetVolume}/boot" ]];then
echo "Backing up stage2 file ${targetVolume}/boot to ${backupDir}/boot" >>"${logFile}"
cp -p "${targetVolume}/boot" "${backupDir}/boot"
fi
# Backup /Extra directory
if [[ -d "${targetVolume}/Extra" ]];then
echo "Moving ${targetVolume}/Extra folder to ${backupDir}/Extra" >>"${logFile}"
cp -pR "${targetVolume}/Extra" "${backupDir}/Extra"
fi
chflags -R nohidden "$backupDir" # Remove the invisible flag of files in the backups
echo "======================================================" >>"${logFile}"
echo "==============================================="
echo "END - Pre-Install Script"
echo "*********************************"
echo "-----------------------------------------------"
echo ""
exit 0
trunk/package/Scripts/Sub/InstallLog.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
#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.
# Receives two parameters
# $1 = selected volume for location of the install log
# $2 = text to write to the installer log
if [ "$#" -eq 2 ]; then
logLocation="$1"
verboseText="$2"
#echo "DEBUG: passed argument = ${logLocation}"
#echo "DEBUG: passed argument = ${verboseText}"
else
echo "InstallLog: Error - wrong number of values passed"
exit 9
fi
logName="Chameleon_Installer_Log.txt"
logFile="${logLocation}"/$logName
if [ -f "${logFile}" ]; then
# Append messages to the log as passed by other scripts.
if [ "${verboseText}" = "Diskutil" ]; then
diskutil list >>"${logFile}"
echo "======================================================" >>"${logFile}"
fi
if [ "${verboseText}" = "LineBreak" ]; then
echo "======================================================" >>"${logFile}"
fi
if [[ "${verboseText}" == *fdisk* ]]; then
targetDiskRaw="${verboseText#fdisk *}"
fdisk $targetDiskRaw >>"${logFile}"
echo " " >>"${logFile}"
fi
if [ "${verboseText}" != "LineBreak" ] && [[ "${verboseText}" != *fdisk* ]] && [[ "${verboseText}" != "Diskutil" ]]; then
echo "${verboseText}" >> "${logFile}"
fi
fi
exit 0
trunk/package/Resources/ja.lproj/Conclusion.rtfd/TXT.rtf
22
33
44
5
6
5
76
87
98
109
11
10
1211
1312
1413
{\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0;
\red255\green0\blue9;}
\margl1440\margr1440\vieww11660\viewh12980\viewkind0
\pard\ri-20\qc
\pard\ri-740\qc
\f0\b\fs28 \cf0 \
\
The scripts have completed and a file\
named \cf2 Chameleon_Installer_Log.txt\cf3 has been\
named \cf2 @LOG_FILENAME@\cf3 has been\
written to the root of your chosen partition.\
\
\cf0 Please \cf4 read it\cf0 to find out if the installation was\
trunk/package/Resources/zh_TW.lproj/Conclusion.rtfd/TXT.rtf
1
1
22
33
44
5
6
5
76
87
98
9
1010
11
11
1212
1313
1414
1515
16
16
17
1718
1819
1920
21
2022
2123
2224
......
2527
2628
2729
30
2831
2932
3033
......
3639
3740
3841
39
42
{\rtf1\ansi\ansicpg936\cocoartf1038\cocoasubrtf360
{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230
{\fonttbl\f0\fnil\fcharset0 LucidaGrande;\f1\fnil\fcharset134 STHeitiSC-Light;}
{\colortbl;\red255\green255\blue255;\red14\green0\blue45;\red0\green0\blue255;\red255\green0\blue0;
\red255\green0\blue9;}
\margl1440\margr1440\vieww11660\viewh12980\viewkind0
\pard\ri-20\qc
\pard\ri-740\qc
\f0\b\fs28 \cf0 \
\
\pard\ri-740\qc
\f1 \'b0\'b2\'d1\'62\'b3\'cc\'d0\'f2\'d2\'d1\'bd\'9b\'cd\'ea\'b3\'c9
\f1 \cf0 \'b0\'b2\'d1\'62\'b3\'cc\'d0\'f2\'d2\'d1\'bd\'9b\'cd\'ea\'b3\'c9
\f0 \
\f1 \'81\'4b\'d4\'da\'df\'78\'93\'f1\'b0\'b2\'d1\'62\'b5\'c4\'b7\'d6\'b8\'ee\'85\'5e\'bd\'a8\'c1\'a2
\f0 \cf2 \
\cf3 Chameleon_Installer_Log.txt
\pard\ri-740\qc
\cf3 @LOG_FILENAME@
\f1 \cf0 \'bc\'6f\'e4\'9b\'ce\'c4\'bc\'fe\'a1\'a3
\f0 \cf2 \
\
\pard\ri-740\qc
\f1 \cf0 \'d5\'88
\f0
\f1 \'b4\'5f\'d5\'4a\'b0\'b2\'d1\'62\'ca\'c7\'b7\'f1\'b3\'c9\'b9\'a6\'a3\'ac\'81\'4b\'b1\'a3\'c1\'f4\'b0\'b2\'d1\'62\'bc\'6f\'e4\'9b\'ce\'c4\'bc\'fe\'82\'e4\'b2\'e9\'a1\'a3
\f0 \
\pard\ri-740\qc
\cf4 \
\
\
\b0\fs30 \cf0 \
\fs20 Copyright \'a9 2011}
\fs20 Copyright \'a9 2011}
trunk/package/Resources/he.lproj/Conclusion.rtfd/TXT.rtf
22
33
44
5
6
5
76
87
98
109
11
10
1211
1312
1413
{\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0;
\red255\green0\blue9;}
\margl1440\margr1440\vieww11660\viewh12980\viewkind0
\pard\ri-20\qc
\pard\ri-740\qc
\f0\b\fs28 \cf0 \
\
The scripts have completed and a file\
named \cf2 Chameleon_Installer_Log.txt\cf3 has been\
named \cf2 @LOG_FILENAME@\cf3 has been\
written to the root of your chosen partition.\
\
\cf0 Please \cf4 read it\cf0 to find out if the installation was\
trunk/package/Resources/id.lproj/Conclusion.rtfd/TXT.rtf
22
33
44
5
6
5
76
87
98
109
11
10
1211
1312
1413
......
2423
2524
2625
27
26
{\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0;
\red255\green0\blue9;}
\margl1440\margr1440\vieww11660\viewh12980\viewkind0
\pard\ri-20\qc
\pard\ri-740\qc
\f0\b\fs28 \cf0 \
\
Skrip ini telah selesai dan telah disematkan pada\
berkas \cf2 Chameleon_Installer_Log.txt\cf3 yang ditaruh di\
berkas \cf2 @LOG_FILENAME@\cf3 yang ditaruh di\
direktori utama dari partisi yang terinstall.\
\
\cf0 Silahkan \cf4 baca\cf0 berkas itu dan perhatikan apakah instalasi telah\
\b0\fs30 \cf0 \
\fs20 Hak kopi \'a9 2011}
\fs20 Hak kopi \'a9 2011}
trunk/package/Resources/el.lproj/Conclusion.rtfd/TXT.rtf
22
33
44
5
6
5
76
87
98
109
11
10
1211
1312
1413
{\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0;
\red255\green0\blue9;}
\margl1440\margr1440\vieww11660\viewh12980\viewkind0
\pard\ri-20\qc
\pard\ri-740\qc
\f0\b\fs28 \cf0 \
\
The scripts have completed and a file\
named \cf2 Chameleon_Installer_Log.txt\cf3 has been\
named \cf2 @LOG_FILENAME@\cf3 has been\
written to the root of your chosen partition.\
\
\cf0 Please \cf4 read it\cf0 to find out if the installation was\
trunk/package/Resources/zh_CN.lproj/Conclusion.rtfd/TXT.rtf
1
1
22
33
44
5
6
5
76
87
98
9
1010
11
11
1212
1313
1414
1515
16
16
17
1718
1819
1920
21
2022
2123
2224
......
2527
2628
2729
30
2831
2932
3033
......
3639
3740
3841
39
42
{\rtf1\ansi\ansicpg936\cocoartf1038\cocoasubrtf360
{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230
{\fonttbl\f0\fnil\fcharset0 LucidaGrande;\f1\fnil\fcharset134 STHeitiSC-Light;}
{\colortbl;\red255\green255\blue255;\red14\green0\blue45;\red0\green0\blue255;\red255\green0\blue0;
\red255\green0\blue9;}
\margl1440\margr1440\vieww11660\viewh12980\viewkind0
\pard\ri-20\qc
\pard\ri-740\qc
\f0\b\fs28 \cf0 \
\
\pard\ri-740\qc
\f1 \'b0\'b2\'d7\'b0\'b3\'cc\'d0\'f2\'d2\'d1\'be\'ad\'cd\'ea\'b3\'c9
\f1 \cf0 \'b0\'b2\'d7\'b0\'b3\'cc\'d0\'f2\'d2\'d1\'be\'ad\'cd\'ea\'b3\'c9
\f0 \
\f1 \'b2\'a2\'d4\'da\'d1\'a1\'d4\'f1\'b0\'b2\'d7\'b0\'b5\'c4\'b7\'d6\'c7\'f8\'bd\'a8\'c1\'a2
\f0 \cf2 \
\cf3 Chameleon_Installer_Log.txt
\pard\ri-740\qc
\cf3 @LOG_FILENAME@
\f1 \cf0 \'bc\'cd\'c2\'bc\'ce\'c4\'bc\'fe\'a1\'a3
\f0 \cf2 \
\
\pard\ri-740\qc
\f1 \cf0 \'c7\'eb
\f0
\f1 \'c8\'b7\'c8\'cf\'b0\'b2\'d7\'b0\'ca\'c7\'b7\'f1\'b3\'c9\'b9\'a6\'a3\'ac\'b2\'a2\'b1\'a3\'c1\'f4\'b0\'b2\'d7\'b0\'bc\'cd\'c2\'bc\'ce\'c4\'bc\'fe\'b1\'b8\'b2\'e9\'a1\'a3
\f0 \
\pard\ri-740\qc
\cf4 \
\
\
\b0\fs30 \cf0 \
\fs20 Copyright \'a9 2011}
\fs20 Copyright \'a9 2011}
trunk/package/Resources/ar.lproj/Conclusion.rtfd/TXT.rtf
22
33
44
5
6
5
76
87
98
9
1010
11
11
1212
1313
1414
1515
1616
17
18
19
17
18
19
2020
21
22
21
22
2323
2424
2525
......
4949
5050
5151
52
5253
5354
5455
......
6061
6162
6263
63
64
{\fonttbl\f0\fnil\fcharset0 LucidaGrande;\f1\fnil\fcharset178 GeezaPro;}
{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red164\green8\blue0;
\red255\green0\blue0;\red255\green0\blue9;}
\margl1440\margr1440\vieww11660\viewh12500\viewkind0
\pard\ri-20\qc
\pard\ri-740\qc
\f0\b\fs28 \cf0 \
\
\pard\ri-740\qc
\f1 \'c7\'e1\'e3\'ce\'d8\'e6\'d8\'c7\'ca \'ca\'e3\'ca
\f1 \cf0 \'c7\'e1\'e3\'ce\'d8\'e6\'d8\'c7\'ca \'ca\'e3\'ca
\f0 \uc0\u8235 ,
\f1 \uc0\u8236 \'e6 \'e3\'e1\'dd
\f0 \
\f1 \'de\'cf
\f0 \cf2 Chameleon_Installer_Log.txt\cf3
\f1 \'ed\'d3\'e3\'ec
\f0 \
\f0 \cf2 @LOG_FILENAME@\cf3
\f1 \cf3 \'ed\'d3\'e3\'ec
\f0 \cf3 \
\f1 \'df\'f1\'ca\'c8 \'e1\'cc\'d0\'d1 \'c7\'e1\'c8\'c7\'d1\'ca\'d4\'e4 \'c7\'e1\'e3\'ce\'ca\'c7\'d1\uc0\u8235 .
\f0 \uc0\u8236 \
\f1 \cf3 \'df\'f1\'ca\'c8 \'e1\'cc\'d0\'d1 \'c7\'e1\'c8\'c7\'d1\'ca\'d4\'e4 \'c7\'e1\'e3\'ce\'ca\'c7\'d1\uc0\u8235 .
\f0 \cf3 \uc0\u8236 \
\
\f1 \cf0 \'e3\'e4
\f0
\f1 \'df\'ca\'d3\'cc\'ed\'e1 \'e1\'e3\'c7 \'ca\'e3 \uc0\u8235 .
\f0 \uc0\u8236 \
\pard\ri-740\qc
\cf5 \
\
\
\b0\fs30 \cf0 \
\fs20 Copyright \'a9 2011}
\fs20 Copyright \'a9 2011}
trunk/package/Resources/en.lproj/Conclusion.rtfd/TXT.rtf
22
33
44
5
6
5
76
87
98
109
11
10
1211
1312
1413
{\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0;
\red255\green0\blue9;}
\margl1440\margr1440\vieww11660\viewh12980\viewkind0
\pard\ri-20\qc
\pard\ri-740\qc
\f0\b\fs28 \cf0 \
\
The scripts have completed and a file\
named \cf2 Chameleon_Installer_Log.txt\cf3 has been\
named \cf2 @LOG_FILENAME@\cf3 has been\
written to the root of your chosen partition.\
\
\cf0 Please \cf4 read it\cf0 to find out if the installation was\
trunk/package/Resources/pt-PT.lproj/Conclusion.rtfd/TXT.rtf
22
33
44
5
6
5
76
87
98
109
11
10
1211
1312
1413
......
2423
2524
2625
27
26
{\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0;
\red255\green0\blue9;}
\margl1440\margr1440\vieww11660\viewh12980\viewkind0
\pard\ri-20\qc
\pard\ri-740\qc
\f0\b\fs28 \cf0 \
\
Os scripts est\'e3o finalizados e foi gerado um\
ficheiro \cf2 Chameleon_Installer_Log.txt\cf3 que se\
ficheiro \cf2 @LOG_FILENAME@\cf3 que se\
encontra na raiz da parti\'e7\'e3o selecionada.\
\
\cf0 Por Favor \cf4 leia-o\cf0 para verificar se a instala\'e7\'e3o foi realizada\
\b0\fs30 \cf0 \
\fs20 Copyright \'a9 2011}
\fs20 Copyright \'a9 2011}
trunk/package/Resources/bs.lproj/Conclusion.rtfd/TXT.rtf
22
33
44
5
6
5
76
87
98
109
11
10
1211
1312
1413
......
2423
2524
2625
27
26
{\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0;
\red255\green0\blue9;}
\margl1440\margr1440\vieww11660\viewh12980\viewkind0
\pard\ri-20\qc
\pard\ri-740\qc
\f0\b\fs28 \cf0 \
\
Skripte su zavr\'9aile i datoteka pod\
nazivom \cf2 Chameleon_Installer_Log.txt\cf3 je snimljena\
nazivom \cf2 @LOG_FILENAME@\cf3 je snimljena\
na root particije diska koje ste odabrali.\
\
\cf0 Molimo \cf4 pro\uc0\u269 itajte ga\cf0 kako biste saznali da li je instalacija bila\
\b0\fs30 \cf0 \
\fs20 Copyright \'a9 2011}
\fs20 Copyright \'a9 2011}
trunk/package/Resources/es.lproj/Conclusion.rtfd/TXT.rtf
22
33
44
5
6
5
76
87
98
109
11
10
1211
1312
1413
......
2423
2524
2625
27
26
{\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0;
\red255\green0\blue9;}
\margl1440\margr1440\vieww11660\viewh12980\viewkind0
\pard\ri-20\qc
\pard\ri-740\qc
\f0\b\fs28 \cf0 \
\
Los scripts se han completado y un archivo\
de nombre \cf2 Chameleon_Installer_Log.txt\cf3 ha sido\
de nombre \cf2 @LOG_FILENAME@\cf3 ha sido\
escrito en la ra\'edz de la partici\'f3n seleccionada.\
\
\cf0 Por favor \cf4 l\'e9alo\cf0 para saber si la instalaci\'f3n fue\
\b0\fs30 \cf0 \
\fs20 Copyright \'a9 2011}
\fs20 Copyright \'a9 2011}
trunk/package/Resources/fr.lproj/Conclusion.rtfd/TXT.rtf
22
33
44
5
6
5
76
87
98
109
11
12
10
11
1312
1413
1514
......
2423
2524
2625
27
26
{\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0;
\red255\green0\blue9;}
\margl1440\margr1440\vieww11660\viewh12980\viewkind0
\pard\ri-20\qc
\pard\ri-740\qc
\f0\b\fs28 \cf0 \
\
Les scripts sont termin\'e9s et un fichier\
nomm\'e9 \cf2 Chameleon_Installer_Log.txt\cf3 a \cf0 \'e9\cf3 t\cf0 \'e9\cf3 \
\'e9\cf3 crit \'e0\'a0la racine de la partition choisie.\
nomm\'e9 \cf2 @LOG_FILENAME@\cf3 a \cf0 \'e9\cf3 t\cf0 \'e9\cf3 \
\'e9crit \'e0\'a0la racine de la partition choisie.\
\
\cf0 SVP \cf4 lisez le\cf0 pour savoir si l'installation est un\
succes et garder un rapport de ce qui a \'e9t\'e9 fait..\
\b0\fs30 \cf0 \
\fs20 Copyright \'a9 2011}
\fs20 Copyright \'a9 2011}
trunk/package/Resources/mk.lproj/Conclusion.rtfd/TXT.rtf
22
33
44
5
6
5
76
87
98
109
11
10
1211
1312
1413
......
2423
2524
2625
27
26
{\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0;
\red255\green0\blue9;}
\margl1440\margr1440\vieww11660\viewh12980\viewkind0
\pard\ri-20\qc
\pard\ri-740\qc
\f0\b\fs28 \cf0 \
\
\uc0\u1057 \u1082 \u1088 \u1080 \u1087 \u1090 \u1072 \u1090 \u1072 \u1077 \u1079 \u1072 \u1074 \u1088 \u1096 \u1077 \u1085 \u1072 \u1080 \u1076 \u1072 \u1090 \u1086 \u1090 \u1077 \u1082 \u1072 \
\uc0\u1089 \u1086 \u1080 \u1084 \u1077 \cf2 Chameleon_Installer_Log.txt\cf3 \uc0\u1077 \
\uc0\u1089 \u1086 \u1080 \u1084 \u1077 \cf2 @LOG_FILENAME@\cf3 \uc0\u1077 \
\uc0\u1079 \u1072 \u1087 \u1080 \u1096 \u1072 \u1085 \u1072 \u1074 \u1086 root \u1085 \u1072 \u1080 \u1079 \u1073 \u1088 \u1072 \u1085 \u1072 \u1090 \u1072 \u1087 \u1072 \u1088 \u1090 \u1080 \u1094 \u1080 \u1112 \u1072 .\
\
\cf0 \uc0\u1042 \u1077 \u1084 \u1086 \u1083 \u1080 \u1084 \u1077 \cf4 \uc0\u1087 \u1088 \u1086 \u1095 \u1080 \u1090 \u1072 \u1112 \u1090 \u1077 \u1112 \u1072 \cf0 \uc0\u1076 \u1072 \u1076 \u1086 \u1079 \u1085 \u1072 \u1077 \u1090 \u1077 \u1076 \u1072 \u1083 \u1080 \u1080 \u1085 \u1089 \u1090 \u1072 \u1083 \u1072 \u1094 \u1080 \u1112 \u1072 \u1090 \u1072 \
\b0\fs30 \cf0 \
\fs20 Copyright \'a9 2011}
\fs20 Copyright \'a9 2011}
trunk/package/Resources/nl.lproj/Conclusion.rtfd/TXT.rtf
22
33
44
5
6
5
76
87
98
109
11
10
1211
1312
1413
......
2423
2524
2625
27
26
{\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0;
\red255\green0\blue9;}
\margl1440\margr1440\vieww11660\viewh12980\viewkind0
\pard\ri-20\qc
\pard\ri-740\qc
\f0\b\fs28 \cf0 \
\
De installatie is klaar en het bestand\
\cf2 Chameleon_Installer_Log.txt\cf3 is geschreven\
\cf2 @LOG_FILENAME@\cf3 is geschreven\
naar de root van de door u gekozen partitie.\
\
\cf0 Alstublieft \cf4 lees het\cf0 document om te zien of de installatie\
\b0\fs30 \cf0 \
\fs20 Copyright \'a9 2011}
\fs20 Copyright \'a9 2011}
trunk/package/Resources/hr.lproj/Conclusion.rtfd/TXT.rtf
22
33
44
5
6
5
76
87
98
109
11
10
1211
1312
1413
......
2423
2524
2625
27
26
{\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0;
\red255\green0\blue9;}
\margl1440\margr1440\vieww11660\viewh12980\viewkind0
\pard\ri-20\qc
\pard\ri-740\qc
\f0\b\fs28 \cf0 \
\
Skripte su zavr\'9aene i mapa pod\
nazivom \cf2 Chameleon_Installer_Log.txt\cf3 je snimljena\
nazivom \cf2 @LOG_FILENAME@\cf3 je snimljena\
u korijen particije diska koje ste odabrali.\
\
\cf0 Molimo \cf4 pro\uc0\u269 itajte\cf0 kako biste saznali da li je instalacija\
\b0\fs30 \cf0 \
\fs20 Copyright \'a9 2011}
\fs20 Copyright \'a9 2011}
trunk/package/Resources/ko.lproj/Conclusion.rtfd/TXT.rtf
33
44
55
6
7
6
87
98
109
10
1111
12
12
1313
1414
15
1516
16
17
1718
18
19
1920
21
2022
2123
2224
25
2326
2427
2528
2629
2730
2831
32
2933
3034
3135
3236
37
3338
3439
3540
36
41
}
{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0;
\red255\green0\blue9;}
\margl1440\margr1440\vieww11660\viewh12980\viewkind0
\pard\ri-20\qc
\pard\ri-740\qc
\f0\b\fs28 \cf0 \
\
\pard\ri-740\qc
\f1\b0 \'bd\'ba\'c5\'a9\'b8\'b3\'c6\'ae(\'bc\'b3\'c4\'a1)\'b0\'a1 \'bf\'cf\'b7\'e1\'b5\'c7\'be\'fa\'bd\'c0\'b4\'cf\'b4\'d9. \
\f1\b0 \cf0 \'bd\'ba\'c5\'a9\'b8\'b3\'c6\'ae(\'bc\'b3\'c4\'a1)\'b0\'a1 \'bf\'cf\'b7\'e1\'b5\'c7\'be\'fa\'bd\'c0\'b4\'cf\'b4\'d9. \
\'bc\'b1\'c5\'c3\'b5\'c8 \'c6\'c4\'c6\'bc\'bc\'c7\'c0\'c7 \'b7\'e7\'c6\'ae \'b5\'f0\'b7\'ba\'c5\'e4\'b8\'ae\'bf\'a1
\f2\b \
\pard\ri-740\qc
\f0 \cf2 Chameleon_Installer_Log.txt
\f0 \cf2 @LOG_FILENAME@
\f1\b0 \cf3 \'b8\'a6 \'bb\'fd\'bc\'ba\'c7\'cf\'bf\'b4\'bd\'c0\'b4\'cf\'b4\'d9.
\f0\b \
\f0\b \cf3 \
\
\pard\ri-740\qc
\f1\b0 \cf0 \'c0\'a7 \cf4 \'b7\'ce\'b1\'d7\cf0 \'b8\'a6 \'b2\'c0 \cf4 \'c0\'d0\'be\'ee\'ba\'b8\'bd\'c3\'b0\'ed\cf0 \'bc\'b3\'c4\'a1\'b0\'a1 \'c1\'a4\'bb\'f3\'c0\'fb\'c0\'b8\'b7\'ce \'b5\'c7\'be\'fa\'b4\'c2\'c1\'f6\
\'be\'cb\'be\'c6\'ba\'b8\'bd\'c5 \'c8\'c4\'bf\'a1 \'b1\'e2\'b7\'cf\'c0\'b8\'b7\'ce \'c0\'df \'ba\'b8\'b0\'fc\'c7\'cf\'bd\'c3\'b1\'e2 \'b9\'d9\'b6\'f8\'b4\'cf\'b4\'d9. \
\pard\ri-740\qc
\f0\b \cf4 \
\
\
\
\
\pard\ri-740\qc
\f1\b0\fs26 \cf0 \'c4\'ab\'b8\'e1\'b7\'b9\'bf\'c2
\f0\b v%CHAMELEONVERSION% r%CHAMELEONREVISION%
\fs24 \cf5 \
\pard\ri-740\qc
\b0\fs30 \cf0 \
\fs20 Copyright \'a9 2011}
\fs20 Copyright \'a9 2011}
trunk/package/Resources/pl.lproj/Conclusion.rtfd/TXT.rtf
22
33
44
5
6
5
76
87
98
10
9
1110
1211
1312
......
2423
2524
2625
27
26
{\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0;
\red255\green0\blue9;}
\margl1440\margr1440\vieww11660\viewh12980\viewkind0
\pard\ri-20\qc
\pard\ri-740\qc
\f0\b\fs28 \cf0 \
\
Zako\uc0\u324 czono wykonywanie skrypt\'f3w i plik logu \cf2 Chameleon_Installer_Log.txt\cf3 zosta\uc0\u322 zapisany \
Zako\uc0\u324 czono wykonywanie skrypt\'f3w i plik logu \cf2 @LOG_FILENAME@\cf3 zosta\uc0\u322 zapisany \
na g\uc0\u322 \'f3wnym katalogu wybranej partycji.\
\
\cf0 Prosz\uc0\u281 \cf4 przeczytaj go\cf0 by dowiedzie\uc0\u263 si\u281 ,\
\b0\fs30 \cf0 \
\fs20 Copyright \'a9 2011}
\fs20 Copyright \'a9 2011}
trunk/package/Resources/it.lproj/Conclusion.rtfd/TXT.rtf
22
33
44
5
6
5
76
87
98
109
11
10
1211
1312
1413
......
2423
2524
2625
27
26
{\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0;
\red255\green0\blue9;}
\margl1440\margr1440\vieww11660\viewh12980\viewkind0
\pard\ri-20\qc
\pard\ri-740\qc
\f0\b\fs28 \cf0 \
\
Le operazioni sono state completate ed un file\
chiamato \cf2 Chameleon_Installer_Log.txt\cf3 \'e9 stato\
chiamato \cf2 @LOG_FILENAME@\cf3 \'e9 stato\
scritto nella root della partizione scelta.\
\
\cf0 Per favore \cf4 leggilo\cf0 per vedere se l'installazione \'e9\
\b0\fs30 \cf0 \
\fs20 Copyright \'a9 2011}
\fs20 Copyright \'a9 2011}
trunk/package/Resources/pt-BR.lproj/Conclusion.rtfd/TXT.rtf
22
33
44
5
6
5
76
87
98
109
11
10
1211
1312
1413
......
2423
2524
2625
27
26
{\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0;
\red255\green0\blue9;}
\margl1440\margr1440\vieww11660\viewh12980\viewkind0
\pard\ri-20\qc
\pard\ri-740\qc
\f0\b\fs28 \cf0 \
\
Os scripts est\'e3o finalizados e foi gerado um\
ficheiro \cf2 Chameleon_Installer_Log.txt\cf3 que se\
ficheiro \cf2 @LOG_FILENAME@\cf3 que se\
encontra na raiz da parti\'e7\'e3o selecionada.\
\
\cf0 Por Favor \cf4 leia-o\cf0 para verificar se a instala\'e7\'e3o foi realizada\
\b0\fs30 \cf0 \
\fs20 Copyright \'a9 2011}
\fs20 Copyright \'a9 2011}
trunk/package/Resources/sr.lproj/Conclusion.rtfd/TXT.rtf
22
33
44
5
6
5
76
87
98
109
11
10
1211
1312
1413
......
2423
2524
2625
27
26
{\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0;
\red255\green0\blue9;}
\margl1440\margr1440\vieww11660\viewh12980\viewkind0
\pard\ri-20\qc
\pard\ri-740\qc
\f0\b\fs28 \cf0 \
\
Skripte su zavr\'9aene i mapa pod\
nazivom \cf2 Chameleon_Installer_Log.txt\cf3 je snimljena\
nazivom \cf2 @LOG_FILENAME@\cf3 je snimljena\
u koren particije diska koje ste odabrali.\
\
\cf0 Molimo \cf4 pro\uc0\u269 itajte\cf0 kako biste saznali da li je instalacija bila\
\b0\fs30 \cf0 \
\fs20 Copyright \'a9 2011}
\fs20 Copyright \'a9 2011}
trunk/package/Resources/ru.lproj/Conclusion.rtfd/TXT.rtf
22
33
44
5
6
5
76
87
98
109
11
10
1211
1312
1413
{\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0;
\red255\green0\blue9;}
\margl1440\margr1440\vieww11660\viewh12980\viewkind0
\pard\ri-20\qc
\pard\ri-740\qc
\f0\b\fs28 \cf0 \
\
The scripts have completed and a file\
named \cf2 Chameleon_Installer_Log.txt\cf3 has been\
named \cf2 @LOG_FILENAME@\cf3 has been\
written to the root of your chosen partition.\
\
\cf0 Please \cf4 read it\cf0 to find out if the installation was\
trunk/package/Resources/de.lproj/Conclusion.rtfd/TXT.rtf
22
33
44
5
6
5
76
87
98
109
11
10
1211
1312
1413
......
2423
2524
2625
27
26
{\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0;
\red255\green0\blue9;}
\margl1440\margr1440\vieww11660\viewh12980\viewkind0
\pard\ri-20\qc
\pard\ri-740\qc
\f0\b\fs28 \cf0 \
\
Die Scripts wurden ausgef\'fchrt und eine Datei\
genannt \cf2 Chameleon_Installer_Log.txt\cf3 wurde ins\
genannt \cf2 @LOG_FILENAME@\cf3 wurde ins\
Rootverzeichnis deiner ausgesuchten Partition geschrieben. \
\
\cf0 Bitte \cf4 lese\cf5 die Datei\cf0 \cf3 um herauszufinden ob \
\b0\fs30 \cf0 \
\fs20 Copyright \'a9 2011}
\fs20 Copyright \'a9 2011}
trunk/package/Resources/bg.lproj/Conclusion.rtfd/TXT.rtf
22
33
44
5
6
5
76
87
98
109
11
10
1211
1312
1413
{\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0;
\red255\green0\blue9;}
\margl1440\margr1440\vieww11660\viewh12980\viewkind0
\pard\ri-20\qc
\pard\ri-740\qc
\f0\b\fs28 \cf0 \
\
The scripts have completed and a file\
named \cf2 Chameleon_Installer_Log.txt\cf3 has been\
named \cf2 @LOG_FILENAME@\cf3 has been\
written to the root of your chosen partition.\
\
\cf0 Please \cf4 read it\cf0 to find out if the installation was\
trunk/package/buildpkg.sh
99
1010
1111
12
1213
1314
1415
......
4445
4546
4647
47
48
4849
4950
50
51
52
53
51
52
53
54
5455
55
56
57
56
57
58
5859
5960
6061
61
62
63
62
63
64
6465
6566
67
68
6669
6770
6871
......
9396
9497
9598
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
96226
97227
98228
......
266396
267397
268398
269
270
271
272
273
399
274400
275401
276402
......
335461
336462
337463
464
338465
339466
340467
......
348475
349476
350477
478
351479
352480
353481
......
589717
590718
591719
592
720
593721
594722
595723
......
602730
603731
604732
605
606
607
733
608734
609
610
611735
612736
613737
......
646770
647771
648772
649
773
650774
651775
652776
......
679803
680804
681805
682
806
683807
684808
685809
......
752876
753877
754878
755
879
756880
757881
758882
......
792916
793917
794918
795
796
797
919
920
798921
799
800
801
802
803
804
805
806
807922
808923
809924
......
828943
829944
830945
831
832
833
946
947
948
834949
835950
836951
declare -r SRCROOT="$1"
declare -r SYMROOT="$2"
declare -r PKG_BUILD_DIR="$3"
declare -r SCPT_TPL_DIR="${PKGROOT}/Scripts.templates"
if [[ $# -lt 3 ]];then
echo "Too few arguments. Aborting..." >&2 && exit 1
# ====== REVISION/VERSION ======
declare -r version=$( cat version )
declare -r CHAMELEON_VERSION=$( cat version )
# stage
stage=${version##*-}
stage=${stage/RC/Release Candidate }
stage=${stage/FINAL/2.1 Final}
declare -r stage
CHAMELEON_STAGE=${CHAMELEON_VERSION##*-}
CHAMELEON_STAGE=${CHAMELEON_STAGE/RC/Release Candidate }
CHAMELEON_STAGE=${CHAMELEON_STAGE/FINAL/2.1 Final}
declare -r CHAMELEON_STAGE
declare -r revision=$( grep I386BOOT_CHAMELEONREVISION vers.h | awk '{ print $3 }' | tr -d '\"' )
declare -r builddate=$( grep I386BOOT_BUILDDATE vers.h | awk '{ print $3,$4 }' | tr -d '\"' )
declare -r timestamp=$( date -j -f "%Y-%m-%d %H:%M:%S" "${builddate}" "+%s" )
declare -r CHAMELEON_REVISION=$( grep I386BOOT_CHAMELEONREVISION vers.h | awk '{ print $3 }' | tr -d '\"' )
declare -r CHAMELEON_BUILDDATE=$( grep I386BOOT_BUILDDATE vers.h | awk '{ print $3,$4 }' | tr -d '\"' )
declare -r CHAMELEON_TIMESTAMP=$( date -j -f "%Y-%m-%d %H:%M:%S" "${CHAMELEON_BUILDDATE}" "+%s" )
# ====== CREDITS ======
declare -r develop=$(awk "NR==6{print;exit}" ${PKGROOT}/../CREDITS)
declare -r credits=$(awk "NR==10{print;exit}" ${PKGROOT}/../CREDITS)
declare -r pkgdev=$(awk "NR==14{print;exit}" ${PKGROOT}/../CREDITS)
declare -r CHAMELEON_DEVELOP=$(awk "NR==6{print;exit}" ${PKGROOT}/../CREDITS)
declare -r CHAMELEON_CREDITS=$(awk "NR==10{print;exit}" ${PKGROOT}/../CREDITS)
declare -r CHAMELEON_PKGDEV=$(awk "NR==14{print;exit}" ${PKGROOT}/../CREDITS)
# ====== GLOBAL VARIABLES ======
declare -r LOG_FILENAME="Chameleon_Installer_Log.txt"
declare -a pkgrefs
declare -a choice_key
declare -a choice_options
echo "${result%"${result##*[![:space:]]}"}" # remove trailing whitespace characters
}
argument () {
local opt="$1"
if [[ $# -eq 0 ]];then
echo "$0: option requires an argument -- '$opt'" >&2; exit 1
fi
echo "$opt"
}
function makeSubstitutions () {
# Substition is like: Key=Value
#
# Optionnal arguments:
# --subst=<substition> : add a new substitution
# --subst <substition> : add a new substitution
#
# Last argument(s) is/are file(s) where substitutions must be made
local ownSubst=""
function addSubst () {
local mySubst="$1"
case "$mySubst" in
*=*) keySubst=${mySubst%%=*}
valSubst=${mySubst#*=}
ownSubst=$(printf "%s\n%s" "$ownSubst" "s&@$keySubst@&$valSubst&g;t t")
;;
*) echo "Invalid substitution $mySubst" >&2
exit 1
;;
esac
}
# Check the arguments.
while [[ $# -gt 0 ]];do
local option="$1"
case "$option" in
--subst) shift; addSubst "$(argument $@)"; shift ;;
--subst=*) shift; addSubst "${option#*=}" ;;
-*)
echo "Unrecognized makeSubstitutions option '$option'" >&2
exit 1
;;
*) break ;;
esac
done
if [[ $# -lt 1 ]];then
echo "makeSubstitutions invalid number of arguments: at least one file needed" >&2
exit 1
fi
local chameleonSubsts="
s&%CHAMELEONVERSION%&${CHAMELEON_VERSION%%-*}&g
s&%CHAMELEONREVISION%&${CHAMELEON_REVISION}&g
s&%CHAMELEONSTAGE%&${CHAMELEON_STAGE}&g
s&%DEVELOP%&${CHAMELEON_DEVELOP}&g
s&%CREDITS%&${CHAMELEON_CREDITS}&g
s&%PKGDEV%&${CHAMELEON_PKGDEV}&g
:t
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
s&@LOG_FILENAME@&${LOG_FILENAME}&g;t t"
local allSubst="
$chameleonSubsts
$ownSubst"
for file in "$@";do
cp -pf "$file" "${file}.in"
sed "$allSubst" "${file}.in" > "${file}"
rm -f "${file}.in"
done
}
addTemplateScripts () {
# Arguments:
# --pkg-rootdir=<pkg_rootdir> : path of the pkg root dir
#
# Optionnal arguments:
# --subst=<substition> : add a new substitution
# --subst <substition> : add a new substitution
#
# Substition is like: Key=Value
#
# $n : Name of template(s) (templates are in package/Scripts.templates
local pkgRootDir=""
declare -a allSubst
# Check the arguments.
while [[ $# -gt 0 ]];do
local option="$1"
case "$option" in
--pkg-rootdir=*) shift; pkgRootDir="${option#*=}" ;;
--subst) shift; allSubst[${#allSubst[*]}]="$option"; allSubst[${#allSubst[*]}]="$1" ; shift ;;
--subst=*) shift; allSubst[${#allSubst[*]}]="${option}" ;;
-*)
echo "Unrecognized addTemplateScripts option '$option'" >&2
exit 1
;;
*) break ;;
esac
done
if [[ $# -lt 1 ]];then
echo "addTemplateScripts invalid number of arguments: you must specify a template name" >&2
exit 1
fi
[[ -z "$pkgRootDir" ]] && { echo "Error addTemplateScripts: --pkg-rootdir option is needed" >&2 ; exit 1; }
[[ ! -d "$pkgRootDir" ]] && { echo "Error addTemplateScripts: directory '$pkgRootDir' doesn't exists" >&2 ; exit 1; }
for templateName in "$@";do
local templateRootDir="${SCPT_TPL_DIR}/${templateName}"
[[ ! -d "$templateRootDir" ]] && {
echo "Error addTemplateScripts: template '$templateName' doesn't exists" >&2; exit 1; }
# Copy files to destination
rsync -pr --exclude=.svn --exclude="*~" "$templateRootDir/" "$pkgRootDir/Scripts/"
done
files=$( find "$pkgRootDir/Scripts/" -type f )
if [[ ${#allSubst[*]} -gt 0 ]];then
makeSubstitutions "${allSubst[@]}" $files
else
makeSubstitutions $files
fi
}
getPackageRefId () {
echo ${1//_/.}.${2//_/.} | tr [:upper:] [:lower:]
}
packagesidentity="${chameleon_package_identity}"
choiceId="Pre"
mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root
mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Scripts
ditto --noextattr --noqtn ${SRCROOT}/revision ${PKG_BUILD_DIR}/${choiceId}/Scripts/Resources/revision
ditto --noextattr --noqtn ${SRCROOT}/version ${PKG_BUILD_DIR}/${choiceId}/Scripts/Resources/version
cp -f ${PKGROOT}/Scripts/Main/preinstall ${PKG_BUILD_DIR}/${choiceId}/Scripts
cp -f ${PKGROOT}/Scripts/Sub/InstallLog.sh ${PKG_BUILD_DIR}/${choiceId}/Scripts
addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${choiceId}" ${choiceId}
packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}")
buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/"
choiceId="Standard"
mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root
mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Scripts/Resources
addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${choiceId}" InstallerLog
cp -f ${PKGROOT}/Scripts/Main/${choiceId}postinstall ${PKG_BUILD_DIR}/${choiceId}/Scripts/postinstall
cp -f ${PKGROOT}/Scripts/Sub/* ${PKG_BUILD_DIR}/${choiceId}/Scripts
ditto --arch i386 `which SetFile` ${PKG_BUILD_DIR}/${choiceId}/Scripts/Resources/SetFile
choiceId="EFI"
mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root
mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Scripts/Resources
addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${choiceId}" InstallerLog
cp -f ${PKGROOT}/Scripts/Main/ESPpostinstall ${PKG_BUILD_DIR}/${choiceId}/Scripts/postinstall
cp -f ${PKGROOT}/Scripts/Sub/* ${PKG_BUILD_DIR}/${choiceId}/Scripts
ditto --arch i386 `which SetFile` ${PKG_BUILD_DIR}/${choiceId}/Scripts/Resources/SetFile
for (( i = 0 ; i < ${#themes[@]} ; i++ )); do
theme=$( echo ${themes[$i]##*/} | awk 'BEGIN{OFS=FS=""}{$1=toupper($1);print}' )
mkdir -p "${PKG_BUILD_DIR}/${theme}/Root/"
rsync -r --exclude=.svn "${themes[$i]}/" "${PKG_BUILD_DIR}/${theme}/Root/${theme}"
rsync -r --exclude=.svn --exclude="*~" "${themes[$i]}/" "${PKG_BUILD_DIR}/${theme}/Root/${theme}"
packageRefId=$(getPackageRefId "${packagesidentity}" "${theme}")
buildpackage "$packageRefId" "${theme}" "${PKG_BUILD_DIR}/${theme}" "/$chamTemp/Extra/Themes"
packagesidentity="${chameleon_package_identity}"
choiceId="Post"
mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root
mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Scripts
cp -f ${PKGROOT}/Scripts/Main/postinstall ${PKG_BUILD_DIR}/${choiceId}/Scripts
cp -f ${PKGROOT}/Scripts/Sub/InstallLog.sh ${PKG_BUILD_DIR}/${choiceId}/Scripts
addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${choiceId}" ${choiceId} InstallerLog
cp -f ${PKGROOT}/Scripts/Sub/UnMountEFIvolumes.sh ${PKG_BUILD_DIR}/${choiceId}/Scripts
ditto --noextattr --noqtn ${SRCROOT}/revision ${PKG_BUILD_DIR}/${choiceId}/Scripts/Resources/revision
ditto --noextattr --noqtn ${SRCROOT}/version ${PKG_BUILD_DIR}/${choiceId}/Scripts/Resources/version
packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}")
buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/"
#[ "${3}" == "relocatable" ] && header+="relocatable=\"true\" "
header+="identifier=\"${packageRefId}\" "
header+="version=\"${version}\" "
header+="version=\"${CHAMELEON_VERSION}\" "
[ "${targetPath}" != "relocatable" ] && header+="install-location=\"${targetPath}\" "
(cd "${packagePath}/Temp" && xar -c -f "${packagePath}/../${packageName}.pkg" --compression none .)
# Add the package to the list of build packages
pkgrefs[${#pkgrefs[*]}]="\t<pkg-ref id=\"${packageRefId}\" installKBytes='${installedsize}' version='${version}.0.0.${timestamp}'>#${packageName}.pkg</pkg-ref>"
pkgrefs[${#pkgrefs[*]}]="\t<pkg-ref id=\"${packageRefId}\" installKBytes='${installedsize}' version='${CHAMELEON_VERSION}.0.0.${CHAMELEON_TIMESTAMP}'>#${packageName}.pkg</pkg-ref>"
rm -rf "${packagePath}"
fi
makedistribution ()
{
declare -r distributionDestDir="${SYMROOT}"
declare -r distributionFilename="${packagename// /}-${version}-r${revision}.pkg"
declare -r distributionFilename="${packagename// /}-${CHAMELEON_VERSION}-r${CHAMELEON_REVISION}.pkg"
declare -r distributionFilePath="${distributionDestDir}/${distributionFilename}"
rm -f "${distributionDestDir}/${packagename// /}"*.pkg
# CleanUp the directory
find "${PKG_BUILD_DIR}/${packagename}" \( -type d -name '.svn' \) -o -name '.DS_Store' -exec rm -rf {} \;
# Add Chameleon Version and Revision
perl -i -p -e "s/%CHAMELEONVERSION%/${version%%-*}/g" $( find "${PKG_BUILD_DIR}/${packagename}/Resources" -type f )
perl -i -p -e "s/%CHAMELEONREVISION%/${revision}/g" $( find "${PKG_BUILD_DIR}/${packagename}/Resources" -type f )
# Make substitutions like version, revision, stage, developers, credits, etc..
makeSubstitutions $( find "${PKG_BUILD_DIR}/${packagename}/Resources" -type f )
# Add Chameleon Stage
perl -i -p -e "s/%CHAMELEONSTAGE%/${stage}/g" $( find "${PKG_BUILD_DIR}/${packagename}/Resources" -type f )
# Adding Developer and credits
perl -i -p -e "s/%DEVELOP%/${develop}/g" $( find "${PKG_BUILD_DIR}/${packagename}/Resources" -type f )
perl -i -p -e "s/%CREDITS%/${credits}/g" $( find "${PKG_BUILD_DIR}/${packagename}/Resources" -type f )
perl -i -p -e "s/%PKGDEV%/${pkgdev}/g" $( find "${PKG_BUILD_DIR}/${packagename}/Resources" -type f )
# Create the final package
pkgutil --flatten "${PKG_BUILD_DIR}/${packagename}" "${distributionFilePath}"
echo -e $COL_GREEN" ==========="
echo -e $COL_BLUE" Package name: "$COL_RESET"${distributionFilename}"
echo -e $COL_BLUE" MD5: "$COL_RESET"$md5"
echo -e $COL_BLUE" Version: "$COL_RESET"$version"
echo -e $COL_BLUE" Stage: "$COL_RESET"$stage"
echo -e $COL_BLUE" Date/Time: "$COL_RESET"$builddate"
echo -e $COL_BLUE" Version: "$COL_RESET"$CHAMELEON_VERSION"
echo -e $COL_BLUE" Stage: "$COL_RESET"$CHAMELEON_STAGE"
echo -e $COL_BLUE" Date/Time: "$COL_RESET"$CHAMELEON_BUILDDATE"
echo ""
}

Archive Download the corresponding diff file

Revision: 1777