Chameleon

Chameleon Commit Details

Date:2011-10-20 21:55:54 (7 years 9 months ago)
Author:blackosx
Commit:1642
Parents: 1641
Message:Move creation of the install log to the preinstall script and adapt other scripts accordingly.
Changes:
M/branches/blackosx/package/Scripts/Main/EFI/postinstall
M/branches/blackosx/package/buildpkg.sh
M/branches/blackosx/package/Scripts/Main/Post/postinstall
M/branches/blackosx/package/Scripts/Sub/InstallLog.sh
M/branches/blackosx/package/Scripts/Main/Standard/postinstall
M/branches/blackosx/package/Scripts/Main/preinstall

File differences

branches/blackosx/package/Scripts/Main/Standard/postinstall
6767
6868
6969
70
71
72
73
7470
7571
7672
# Write some information to the Install Log
versionNumber=`cat "${scriptDir}"/Resources/version`
revisionNumber=`cat "${scriptDir}"/Resources/revision`
"$scriptDir"InstallLog.sh "${targetVolume}" "Installer version: ${versionNumber} ${revisionNumber}"
"$scriptDir"InstallLog.sh "${targetVolume}" "Diskutil"
"$scriptDir"InstallLog.sh "${targetVolume}" "Running Standard postinstall script"
"$scriptDir"InstallLog.sh "${targetVolume}" "Target volume = ${targetVolume} on ${targetDevice}"
branches/blackosx/package/Scripts/Main/EFI/postinstall
7171
7272
7373
74
75
76
77
7874
7975
8076
8177
82
8378
8479
8580
# Write some information to the Install Log
versionNumber=`cat "${scriptDir}"/Resources/version`
revisionNumber=`cat "${scriptDir}"/Resources/revision`
"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Installer version: ${versionNumber} ${revisionNumber}"
"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Diskutil"
"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Running EFI postinstall script"
"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Target selected by user = ${targetVolumeChosenByUser} on ${targetDeviceChosenByUser}"
"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Target volume = ${targetVolume} on ${targetDevice}"
# Check to see if the selected disk uses a GPT
bootuuid=$( diskutil info "$targetDeviceChosenByUser" | grep Volume\ UUID | awk {'print $3'} )
branches/blackosx/package/Scripts/Main/Post/postinstall
224224
225225
226226
227
228
229
227
228
229
230230
231
232
233
234
235
236
237
238
239
240
241231
242232
243233
rm "$dest_vol"/.ChameleonEFI
fi
# Remove /.ChameleonLogFlag file
if [ -f "$dest_vol"/.ChameleonLogFlag ]; then
cleanUp="${cleanUp},4"
"$scriptDir"InstallLog.sh "${dest_vol}" "Cleanup: ${cleanUp}"
"$scriptDir"InstallLog.sh "${dest_vol}" "LineBreak"
"$scriptDir"InstallLog.sh "${dest_vol}" "Post script complete"
"$scriptDir"InstallLog.sh "${dest_vol}" "Cleanup: ${cleanUp}"
# we have to add the final install log messages before
# deleting /.ChameleonLogFlag.
"$scriptDir"InstallLog.sh "${dest_vol}" "LineBreak"
"$scriptDir"InstallLog.sh "${dest_vol}" "Post script complete"
rm "$dest_vol"/.ChameleonLogFlag
fi
echo "==============================================="
echo "END - Post Post-Install Script"
echo "*********************************"
branches/blackosx/package/Scripts/Main/preinstall
66
77
88
9
9
10
11
12
1013
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
1145
1246
1347
echo "-----------------------------------------------"
echo ""
# Place holder for maybe setting up install log here?
# 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
targetVolume=$3
logName="Chameleon_Installer_Log.txt"
logFile="${targetVolume}"/$logName
versionNumber=`cat "${scriptDir}"/Resources/version`
revisionNumber=`cat "${scriptDir}"/Resources/revision`
# 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}"
echo "==============================================="
echo "END - Pre-Install Script"
echo "*********************************"
branches/blackosx/package/Scripts/Sub/InstallLog.sh
44
55
66
7
8
9
10
7
8
119
1210
1311
......
2321
2422
2523
24
25
2626
2727
2828
29
30
31
32
3329
34
35
36
37
30
3831
39
40
41
42
43
44
45
46
47
48
49
5032
5133
5234
echo "InstallLog: Create/Append installation log"
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'.
# 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
exit 9
fi
logName="Chameleon_Installer_Log.txt"
logFile="${logLocation}"/$logName
# On first run, create a file named .ChameleonLogFlag at
# the root of the target volume. Then check for this file
# on subsequent runs to know the initialisation sequence
# has been done.
if [ ! -f "${logLocation}"/.ChameleonLogFlag ]; then
# This is the first run, so setup
# Chameleon_Installer_Log.txt file
# by writing header.
if [ -f "${logFile}" ]; then
# Also include the first message that this script
# would be called with which will be version/revision
# of Chameleon package.
echo "Chameleon installer log - $( date )
${verboseText}
======================================================" >"${logFile}"
# Create /.ChameleonLogFlag file.
echo "Log" >"${logLocation}"/.ChameleonLogFlag
else
# Append messages to the log as passed by other scripts.
if [ "${verboseText}" = "Diskutil" ]; then
diskutil list >>"${logFile}"
branches/blackosx/package/buildpkg.sh
6161
6262
6363
64
65
6466
67
6568
6669
6770
......
99102
100103
101104
102
103
104105
105106
106107
......
111112
112113
113114
114
115
116115
117116
118117
packagesidentity="org.chameleon"
mkdir -p ${1}/Pre/Root
mkdir -p ${1}/Pre/Scripts
ditto --noextattr --noqtn ${1%/*/*}/revision ${1}/Pre/Scripts/Resources/revision
ditto --noextattr --noqtn ${1%/*/*}/version ${1}/Pre/Scripts/Resources/version
cp -f ${pkgroot}/Scripts/Main/preinstall ${1}/Pre/Scripts
cp -f ${pkgroot}/Scripts/Sub/InstallLog.sh ${1}/Pre/Scripts
echo "[BUILD] Pre "
buildpackage "${1}/Pre" "/" "" "start_visible=\"false\" start_selected=\"true\"" >/dev/null 2>&1
# End build pre install package
cp -f ${pkgroot}/Scripts/Main/Standard/* ${1}/Standard/Scripts
cp -f ${pkgroot}/Scripts/Sub/* ${1}/Standard/Scripts
ditto --arch i386 `which SetFile` ${1}/Standard/Scripts/Resources/SetFile
ditto --noextattr --noqtn ${1%/*/*}/revision ${1}/Standard/Scripts/Resources/revision
ditto --noextattr --noqtn ${1%/*/*}/version ${1}/Standard/Scripts/Resources/version
echo "[BUILD] Standard "
buildpackage "${1}/Standard" "/" "${coresize}" "start_enabled=\"true\" selected=\"exclusive(choices['EFI']) && exclusive(choices['noboot'])\"" >/dev/null 2>&1
# End build standard package
cp -f ${pkgroot}/Scripts/Main/EFI/* ${1}/EFI/Scripts
cp -f ${pkgroot}/Scripts/Sub/* ${1}/EFI/Scripts
ditto --arch i386 `which SetFile` ${1}/EFI/Scripts/Resources/SetFile
ditto --noextattr --noqtn ${1%/*/*}/revision ${1}/EFI/Scripts/Resources/revision
ditto --noextattr --noqtn ${1%/*/*}/version ${1}/EFI/Scripts/Resources/version
echo "[BUILD] EFI "
buildpackage "${1}/EFI" "/" "${coresize}" "start_visible=\"systemHasGPT()\" selected=\"exclusive(choices['Standard']) && exclusive(choices['noboot'])\"" >/dev/null 2>&1
# End build efi package

Archive Download the corresponding diff file

Revision: 1642