Chameleon Applications

Chameleon Applications Commit Details

Date:2010-10-15 02:22:05 (10 years 6 months ago)
Author:ErmaC
Commit:187
Parents: 186
Message:edit the 4th script again add both fdisk & fdisk440. set fdisk440 only for boot0hfs
Changes:
M/branches/iFabio/trunk/package/Scripts/Standardhfs/postinstall
M/branches/iFabio/trunk/package/Scripts/FAT/postinstall
M/branches/iFabio/trunk/package/buildpkg
M/branches/iFabio/trunk/package/Scripts/HFS/postinstall
M/branches/iFabio/trunk/package/Scripts/Standard/postinstall
M/branches/iFabio/trunk/revision

File differences

branches/iFabio/trunk/package/buildpkg
4343
4444
4545
46
4647
4748
4849
......
5455
5556
5657
58
5759
58
5960
6061
6162
......
6364
6465
6566
66
67
67
68
6869
6970
7071
......
7374
7475
7576
76
77
7778
7879
7980
......
112113
113114
114115
115
116
117
118
116
117
118
119119
120120
121121
......
399399
400400
401401
402
# build core package
mkdir -p ${1}/Core/Root/usr/sbin
mkdir -p ${1}/Core/Root/usr/local/bin
mkdir -p ${1}/Core/Root/usr/standalone/i386
cp -f ${1%/*}/i386/boot ${1}/Core/Root/usr/standalone/i386
cp -f ${1%/*}/i386/boot0 ${1}/Core/Root/usr/standalone/i386
cp -f ${1%/*}/i386/cdboot ${1}/Core/Root/usr/standalone/i386
cp -f ${1%/*}/i386/chain0 ${1}/Core/Root/usr/standalone/i386
fixperms "${1}/Core/Root/"
cp -f ${pkgroot}/fdisk ${1}/Core/Root/usr/sbin
cp -f ${pkgroot}/fdisk440 ${1}/Core/Root/usr/sbin
cp -f ${1%/*}/i386/bdmesg ${1}/Core/Root/usr/sbin
local coresize=$( du -hkc "${1}/Core/Root" | tail -n1 | awk {'print $1'} )
echo "Building core package"
buildpackage "${1}/Core" "/" "0" "start_visible=\"false\" start_selected=\"true\""
# build standard package
mkdir -p ${1}/Standard/Root
mkdir -p ${1}/Standard/Scripts
cp -f ${pkgroot}/Scripts/Standard/postinstall ${1}/Standard/Scripts
mkdir -p ${1}/Standard/Scripts/Tools
cp -f ${pkgroot}/Scripts/Standard/* ${1}/Standard/Scripts
ditto --arch i386 `which SetFile` ${1}/Standard/Scripts/Tools/SetFile
echo "Building boot0 package"
buildpackage "${1}/Standard" "/" "${coresize}" "start_enabled=\"true\" start_selected=\"upgrade_allowed()\" selected=\"exclusive(choices['EnhancedHFS']) && exclusive(choices['Standardhfs']) && exclusive(choices['EnhancedFAT']) && exclusive(choices['noboot'])\""
# build standard package with boot0hfs
mkdir -p ${1}/Standardhfs/Root
mkdir -p ${1}/Standardhfs/Scripts
cp -f ${pkgroot}/Scripts/Standardhfs/postinstall ${1}/Standardhfs/Scripts
cp -f ${pkgroot}/Scripts/Standardhfs/* ${1}/Standardhfs/Scripts
ditto --arch i386 `which SetFile` ${1}/Standardhfs/Scripts/Tools/SetFile
echo "Building boot0hfs package"
buildpackage "${1}/Standardhfs" "/" "${coresize}" "start_enabled=\"true\" start_selected=\"false\" selected=\"exclusive(choices['EnhancedHFS']) && exclusive(choices['Standard']) && exclusive(choices['EnhancedFAT']) && exclusive(choices['noboot'])\""
((xmlindent++))
packagesidentity="org.chameleon.theme"
artwork="${1%/*}"
artwork="${1%/*}"
themes=($( find "${artwork%/*}/artwork/themes" -type d -depth 1 -not -name '.svn' ))
for (( i = 0 ; i < ${#themes[@]} ; i++ ))
do
themes=($( find "${artwork%/*}/artwork/themes" -type d -depth 1 -not -name '.svn' ))
for (( i = 0 ; i < ${#themes[@]} ; i++ ))
do
theme=$( echo ${themes[$i]##*/} | awk 'BEGIN{OFS=FS=""}{$1=toupper($1);print}' )
mkdir -p "${1}/${theme}/Root/"
ditto --noextattr --noqtn "${themes[$i]}" "${1}/${themes[$i]##*/}/Root/${theme}"
}
main "${1}" "${2}" "${3}" "${4}" "${5}"
branches/iFabio/trunk/package/Scripts/HFS/postinstall
154154
155155
156156
157
157
158158
159159
160160
......
186186
187187
188188
189
190
189
190
191191
192192
193193
......
196196
197197
198198
199
199
200200
201201
202202
......
217217
218218
219219
220
221
222
223
220
221
222
223
224224
225
226
227
228
229
230
225
226
227
228
229
230
231231
232232
233
234
235
236
237
238
239
240
241
242
243
244
245
233
234
235
236
237
238
239
240
241
242
243
244
245
246246
247247
248
249
250
248
249
250
251251
252252
checkpartitionactive ()
{
partitionactive=$( fdisk440 -d ${bootrdisk} | grep -n "*" | awk -F: '{print $1}')
partitionactive=$( fdisk -d ${bootrdisk} | grep -n "*" | awk -F: '{print $1}')
if [ -n "${partitionactive}" ]; then
echo "Partition flagged active is ${partitionactive}"
checkpartitionactive
if ${diskupdate}; then
echo "Executing command: fdisk440 -u -f ${diskloader} -y ${bootdisk}"
fdisk440 -u -f "${osxvolume}/${diskloader}" -y ${bootdisk}
echo "Executing command: fdisk -u -f ${diskloader} -y ${bootdisk}"
fdisk -u -f "${osxvolume}/${diskloader}" -y ${bootdisk}
fi
echo "Executing command: dd if=${partitionloader} of=${bootrdev}"
# If table is GPT make the first partition active (BadAxe compatibility).
[ "${partitiontable}" = "GPT" ] && bootslice=1
if [[ "${partitiontable}" = "GPT" ]]; then
fdisk440 -e ${bootdisk} <<-MAKEACTIVE
fdisk -e ${bootdisk} <<-MAKEACTIVE
print
flag ${bootslice}
write
echo "Executing command: cp ${osxvolume}${filesystemloader} ${bootvolume}/boot"
cp "${osxvolume}${filesystemloader}" "${bootvolume}/boot"
#if ! [ -d "${bootvolume}/Extra/Extensions" ]; then
#echo "Executing command: mkdir -p ${bootvolume}/Extra/Extensions"
#mkdir -p "${bootvolume}/Extra/Extensions"
#fi
if ! [ -d "${bootvolume}/Extra/Extensions" ]; then
echo "Executing command: mkdir -p ${bootvolume}/Extra/Extensions"
mkdir -p "${bootvolume}/Extra/Extensions"
fi
# unpack any existing Extensions.mkext already on the booter volume
#if [ -e "${bootvolume}/Extra/Extensions.mkext" ]; then
#echo "Executing command: mkextunpack -d ${bootvolume}/Extra/Extensions ${bootvolume}/Extra/Extensions.mkext"
#mkextunpack -d "${bootvolume}/Extra/Extensions" "${bootvolume}/Extra/Extensions.mkext"
#echo "Executing command: rm -R -f ${bootvolume}/Extra/Extensions.mkext"
#rm -R -f "${bootvolume}/Extra/Extensions.mkext"
#fi
if [ -e "${bootvolume}/Extra/Extensions.mkext" ]; then
echo "Executing command: mkextunpack -d ${bootvolume}/Extra/Extensions ${bootvolume}/Extra/Extensions.mkext"
mkextunpack -d "${bootvolume}/Extra/Extensions" "${bootvolume}/Extra/Extensions.mkext"
echo "Executing command: rm -R -f ${bootvolume}/Extra/Extensions.mkext"
rm -R -f "${bootvolume}/Extra/Extensions.mkext"
fi
# copy existing /Extra
#if [ -d "${2}/Extra" ]; then
#[ -d "${bootvolume}/Extra/Extensions" ] || mkdir -p "${bootvolume}/Extra/Extensions"
#echo "Executing command: find ${2}/Extra -name '*.plist' -depth 1 -exec cp -f {} ${bootvolume}/Extra \;"
#find "${2}/Extra" -name '*.plist' -depth 1 -exec cp -f {} "${bootvolume}/Extra/" \;
#if [ -f "${2}/Extra/Extensions.mkext" ]; then
#echo "Executing command: mkextunpack -d ${2}/Extra/Extensions ${2}/Extra/Extensions.mkext"
#mkextunpack -d "${bootvolume}/Extra/Extensions" "${2}/Extra/Extensions.mkext"
#fi
#if [ -d "${2}/Extra/Extensions" ]; then
#echo "Executing command: find ${2}/Extra/Extensions -name '*.kext' -depth 1 -exec cp -R {} ${bootvolume}/Extra/Extensions \;"
#find "${2}/Extra/Extensions" -name '*.kext' -depth 1 -exec cp -R {} "${bootvolume}/Extra/Extensions" \;
#fi
#fi
if [ -d "${2}/Extra" ]; then
[ -d "${bootvolume}/Extra/Extensions" ] || mkdir -p "${bootvolume}/Extra/Extensions"
echo "Executing command: find ${2}/Extra -name '*.plist' -depth 1 -exec cp -f {} ${bootvolume}/Extra \;"
find "${2}/Extra" -name '*.plist' -depth 1 -exec cp -f {} "${bootvolume}/Extra/" \;
if [ -f "${2}/Extra/Extensions.mkext" ]; then
echo "Executing command: mkextunpack -d ${2}/Extra/Extensions ${2}/Extra/Extensions.mkext"
mkextunpack -d "${bootvolume}/Extra/Extensions" "${2}/Extra/Extensions.mkext"
fi
if [ -d "${2}/Extra/Extensions" ]; then
echo "Executing command: find ${2}/Extra/Extensions -name '*.kext' -depth 1 -exec cp -R {} ${bootvolume}/Extra/Extensions \;"
find "${2}/Extra/Extensions" -name '*.kext' -depth 1 -exec cp -R {} "${bootvolume}/Extra/Extensions" \;
fi
fi
# setup link for extras
#[ -h "${2}/.Chameleon" ] && unlink "${2}/.Chameleon"
#echo "Executing command: ln -s /Volumes/${bootervolumename} ${2}/.Chameleon"
#ln -s "/Volumes/${bootervolumename}" "${2}/.Chameleon"
[ -h "${2}/.Chameleon" ] && unlink "${2}/.Chameleon"
echo "Executing command: ln -s /Volumes/${bootervolumename} ${2}/.Chameleon"
ln -s "/Volumes/${bootervolumename}" "${2}/.Chameleon"
exit
branches/iFabio/trunk/package/Scripts/Standard/postinstall
1313
1414
1515
16
1716
18
1917
2018
2119
......
132130
133131
134132
135
133
136134
137135
138136
......
188186
189187
190188
191
192
189
190
193191
194192
195193
......
202200
203201
204202
205
206
207
208
203
204
205
209206
210
211
212
213
214
215
216
217207
218
219
220
221
222
208
209
210
211
212
223213
224214
225215
226
227
228
216
217
218
229219
230220
# 1 volume
bootvolume="${@}"
echo "Volume is $bootvolume"
bootresources="${0%/*}"
echo "$bootresources"
if [ -z "${bootvolume}" ]; then
echo
checkpartitionactive ()
{
partitionactive=$( fdisk440 -d ${bootrdisk} | grep -n "*" | awk -F: '{print $1}')
partitionactive=$( fdisk -d ${bootrdisk} | grep -n "*" | awk -F: '{print $1}')
if [ -n "${partitionactive}" ]; then
echo "Partition flagged active is ${partitionactive}"
"${bootresources}/Tools/SetFile" -a V "${bootvolume}/${filesystemloader}"
# If table is GPT make the first partition active (BadAxe compatibility).
#[ "${partitiontable}" = "GPT" ] && bootslice=1
fdisk440 -e ${bootdisk} <<-MAKEACTIVE
[ "${partitiontable}" = "GPT" ] && bootslice=1
fdisk -e ${bootdisk} <<-MAKEACTIVE
print
flag ${bootslice}
write
checkpartitionbootcode check
checkpartitionactive
# Check efi partition
if [ -d /Volumes/EFI ]; then
umount -f /Volumes/EFI
rm -R -f /Volumes/EFI
if ! [ -d "${bootvolume}/Extra/Extensions" ]; then
echo "Executing command: mkdir -p ${bootvolume}/Extra/Extensions"
mkdir -p "${bootvolume}/Extra/Extensions"
fi
if [ -d "${bootvolume}/Extra/Extensions" ]; then
#echo "Executing command: mkdir -p ${bootvolume}/Extra/Extensions"
mkdir -p "${bootvolume}/ExtraBackup"
cp -f -R "${bootvolume}/Extra" "${bootvolume}/ExtraBackup"
rm -f -R "${bootvolume}/Extra"
fi
# unpack any existing Extensions.mkext already on the booter volume
if [ -f "${2}/ExtraBackup/Extensions.mkext" ]; then
echo "Executing command: mkextunpack -d ${2}/Extra/Extensions ${2}/ExtraBackup/Extensions.mkext"
mkextunpack -d "${2}/.Chameleon/Extra/Extensions" "${2}/.Chameleon/ExtraBackup/Extensions.mkext"
echo "Executing command: rm -R -f ${2}/ExtraBackup/Extensions.mkext"
rm -R -f "${2}/ExtraBackup/Extensions.mkext"
if [ -f "${2}/Extra/Extensions.mkext" ]; then
echo "Executing command: mkextunpack -d ${2}/Extra/Extensions ${2}/Extra/Extensions.mkext"
mkextunpack -d "${2}/Extra/Extensions" "${2}/Extra/Extensions.mkext"
echo "Executing command: rm -R -f ${2}/Extra/Extensions.mkext"
rm -R -f "${2}/Extra/Extensions.mkext"
fi
# setup link for extras
#[ -h "${2}/.Chameleon" ] && unlink "${2}/.Chameleon"
#echo "Executing command: ln -s . ${2}/.Chameleon"
#ln -s "${2}" "${2}/.Chameleon"
[ -h "${2}/.Chameleon" ] && unlink "${2}/.Chameleon"
echo "Executing command: ln -s . ${2}/.Chameleon"
ln -s "." "${2}/.Chameleon"
exit
branches/iFabio/trunk/package/Scripts/Standardhfs/postinstall
1313
1414
1515
16
1716
18
1917
2018
2119
......
174172
175173
176174
177
178
175
176
179177
180178
181179
......
202200
203201
204202
205
206
207
208
209
210
211203
212
213
214
215
204
205
216206
217207
218
219
220
221
222
208
209
210
211
212
223213
224214
225215
226
227
228
216
217
218
229219
230220
# 1 volume
bootvolume="${@}"
echo "Volume is $bootvolume"
bootresources="${0%/*}"
echo "$bootresources"
if [ -z "${bootvolume}" ]; then
echo
checkpartitionactive
if ${diskupdate}; then
echo "Executing command: fdisk -u -f /usr/standalone/i386/${diskloader} -y ${bootdisk}"
fdisk -u -f "${bootvolume}/usr/standalone/i386/${diskloader}" -y ${bootdisk}
echo "Executing command: fdisk440 -u -f /usr/standalone/i386/${diskloader} -y ${bootdisk}"
fdisk440 -u -f "${bootvolume}/usr/standalone/i386/${diskloader}" -y ${bootdisk}
fi
echo "Executing command: dd if=/usr/standalone/i386/${partitionloader} of=${bootrdev}"
checkpartitionbootcode check
checkpartitionactive
# Check efi partition
if [ -d /Volumes/EFI ]; then
umount -f /Volumes/EFI
rm -R -f /Volumes/EFI
fi
if ! [ -d "${bootvolume}/Extra/Extensions" ]; then
#echo "Executing command: mkdir -p ${bootvolume}/Extra/Extensions"
mkdir -p "${bootvolume}/ExtraBackup"
cp -f -R "${bootvolume}/Extra" "${bootvolume}/ExtraBackup"
rm -f -R "${bootvolume}/Extra"
echo "Executing command: mkdir -p ${bootvolume}/Extra/Extensions"
mkdir -p "${bootvolume}/Extra/Extensions"
fi
# unpack any existing Extensions.mkext already on the booter volume
if [ -f "${2}/ExtraBackup/Extensions.mkext" ]; then
echo "Executing command: mkextunpack -d ${2}/Extra/Extensions ${2}/ExtraBackup/Extensions.mkext"
mkextunpack -d "${2}/.Chameleon/Extra/Extensions" "${2}/.Chameleon/ExtraBackup/Extensions.mkext"
echo "Executing command: rm -R -f ${2}/ExtraBackup/Extensions.mkext"
rm -R -f "${2}/ExtraBackup/Extensions.mkext"
if [ -f "${2}/Extra/Extensions.mkext" ]; then
echo "Executing command: mkextunpack -d ${2}/Extra/Extensions ${2}/Extra/Extensions.mkext"
mkextunpack -d "${2}/Extra/Extensions" "${2}/Extra/Extensions.mkext"
echo "Executing command: rm -R -f ${2}/Extra/Extensions.mkext"
rm -R -f "${2}/Extra/Extensions.mkext"
fi
# setup link for extras
#[ -h "${2}/.Chameleon" ] && unlink "${2}/.Chameleon"
#echo "Executing command: ln -s . ${2}/.Chameleon"
#ln -s "${2}" "${2}/.Chameleon"
[ -h "${2}/.Chameleon" ] && unlink "${2}/.Chameleon"
echo "Executing command: ln -s . ${2}/.Chameleon"
ln -s "." "${2}/.Chameleon"
exit
branches/iFabio/trunk/package/Scripts/FAT/postinstall
149149
150150
151151
152
152
153153
154154
155155
......
186186
187187
188188
189
190
189
190
191191
192192
193193
......
210210
211211
212212
213
213
214214
215215
216216
......
225225
226226
227227
228
228
229229
230230
231231
232232
233
234233
235
236
237
238
234
235
236
237
239238
240
241
242
243
244
245
239
240
241
242
243
244
246245
247246
248
249
250
251
252
253
254
255
256
257
258
259
260
247
248
249
250
251
252
253
254
255
256
257
258
259
261260
262261
263
264
265
262
263
266264
267265
checkpartitionactive ()
{
partitionactive=$( fdisk440 -d ${bootrdisk} | grep -n "*" | awk -F: '{print $1}')
partitionactive=$( fdisk -d ${bootrdisk} | grep -n "*" | awk -F: '{print $1}')
if [ -n "${partitionactive}" ]; then
echo "Partition flagged active is ${partitionactive}"
checkpartitionactive
if ${diskupdate}; then
echo "Executing command: fdisk440 -u -f ${diskloader} -y ${bootdisk}"
fdisk440 -u -f "${osxvolume}/${diskloader}" -y ${bootdisk}
echo "Executing command: fdisk -u -f ${diskloader} -y ${bootdisk}"
fdisk -u -f "${osxvolume}/${diskloader}" -y ${bootdisk}
fi
#echo "Executing command: dd if=${partitionloader} of=${bootrdev}"
# If table is MBR make the correct slice active. If table is GPT make the first partition active (BadAxe compatibility).
[ "${partitiontable}" = "GUID_partition_scheme" ] && bootslice=1
if [[ "${partitiontable}" = "FDisk_partition_scheme" || "${partitiontable}" = "GUID_partition_scheme" ]]; then
fdisk440 -e ${bootdisk} <<-MAKEACTIVE
fdisk -e ${bootdisk} <<-MAKEACTIVE
print
flag ${bootslice}
write
checkpartitionactive
[ -d "${bootvolume}" ] || mkdir -p "${bootvolume}"
echo "Executing command: mount_msdos -u 0 -g 0 ${bootdev} ${bootvolume}"
echo "Executing command: mount_hfs ${bootdev} ${bootvolume}"
mount_msdos -u 0 -g 0 "${bootdev}" "${bootvolume}"
echo "Executing command: cp ${osxvolume}${filesystemloader} ${bootvolume}/boot"
cp "${osxvolume}${filesystemloader}" "${bootvolume}/boot"
#cp -R "${osxvolume}/Extra" "${bootvolume}/Extra"
#if ! [ -d "${bootvolume}/Extra/Extensions" ]; then
#echo "Executing command: mkdir -p ${bootvolume}/Extra/Extensions"
#mkdir -p "${bootvolume}/Extra/Extensions"
#fi
if ! [ -d "${bootvolume}/Extra/Extensions" ]; then
echo "Executing command: mkdir -p ${bootvolume}/Extra/Extensions"
mkdir -p "${bootvolume}/Extra/Extensions"
fi
# unpack any existing Extensions.mkext already on the booter volume
#if [ -e "${bootvolume}/Extra/Extensions.mkext" ]; then
#echo "Executing command: mkextunpack -d ${bootvolume}/Extra/Extensions ${bootvolume}/Extra/Extensions.mkext"
#mkextunpack -d "${bootvolume}/Extra/Extensions" "${bootvolume}/Extra/Extensions.mkext"
#echo "Executing command: rm -R -f ${bootvolume}/Extra/Extensions.mkext"
#rm -R -f "${bootvolume}/Extra/Extensions.mkext"
#fi
if [ -e "${bootvolume}/Extra/Extensions.mkext" ]; then
echo "Executing command: mkextunpack -d ${bootvolume}/Extra/Extensions ${bootvolume}/Extra/Extensions.mkext"
mkextunpack -d "${bootvolume}/Extra/Extensions" "${bootvolume}/Extra/Extensions.mkext"
echo "Executing command: rm -R -f ${bootvolume}/Extra/Extensions.mkext"
rm -R -f "${bootvolume}/Extra/Extensions.mkext"
fi
# copy existing /Extra
#if [ -d "${2}/Extra" ]; then
#[ -d "${bootvolume}/Extra/Extensions" ] || mkdir -p "${bootvolume}/Extra/Extensions"
#echo "Executing command: find ${2}/Extra -name '*.plist' -depth 1 -exec cp -f {} ${bootvolume}/Extra \;"
#find "${2}/Extra" -name '*.plist' -depth 1 -exec cp -f {} "${bootvolume}/Extra/" \;
#if [ -f "${2}/Extra/Extensions.mkext" ]; then
#echo "Executing command: mkextunpack -d ${2}/Extra/Extensions ${2}/Extra/Extensions.mkext"
#mkextunpack -d "${bootvolume}/Extra/Extensions" "${2}/Extra/Extensions.mkext"
#fi
#if [ -d "${2}/Extra/Extensions" ]; then
#echo "Executing command: find ${2}/Extra/Extensions -name '*.kext' -depth 1 -exec cp -R {} ${bootvolume}/Extra/Extensions \;"
#find "${2}/Extra/Extensions" -name '*.kext' -depth 1 -exec cp -R {} "${bootvolume}/Extra/Extensions" \;
#fi
#fi
if [ -d "${2}/Extra" ]; then
[ -d "${bootvolume}/Extra/Extensions" ] || mkdir -p "${bootvolume}/Extra/Extensions"
echo "Executing command: find ${2}/Extra -name '*.plist' -depth 1 -exec cp -f {} ${bootvolume}/Extra \;"
find "${2}/Extra" -name '*.plist' -depth 1 -exec cp -f {} "${bootvolume}/Extra/" \;
if [ -f "${2}/Extra/Extensions.mkext" ]; then
echo "Executing command: mkextunpack -d ${2}/Extra/Extensions ${2}/Extra/Extensions.mkext"
mkextunpack -d "${bootvolume}/Extra/Extensions" "${2}/Extra/Extensions.mkext"
fi
if [ -d "${2}/Extra/Extensions" ]; then
echo "Executing command: find ${2}/Extra/Extensions -name '*.kext' -depth 1 -exec cp -R {} ${bootvolume}/Extra/Extensions \;"
find "${2}/Extra/Extensions" -name '*.kext' -depth 1 -exec cp -R {} "${bootvolume}/Extra/Extensions" \;
fi
fi
# setup link for extras
#echo "Executing command: ln -s /Volumes/${bootervolumename} ${2}/.Chameleon"
#ln -s "/Volumes/${bootervolumename}" "${2}/.Chameleon"
# setup link for extras
echo "Executing command: ln -s /Volumes/${bootervolumename} ${2}/.Chameleon"
ln -s "/Volumes/${bootervolumename}" "${2}/.Chameleon"
exit
branches/iFabio/trunk/revision
1
1
184:185
184:186

Archive Download the corresponding diff file

Revision: 187