Chameleon

Chameleon Commit Details

Date:2011-09-29 09:18:10 (6 years 11 months ago)
Author:blackosx
Commit:1587
Parents: 1586
Message:Insall log now generates properly when bootloader is not installed. Done a little work on adding kernel flags - not sure which direction to go right now - might re-think it. More tweaks.
Changes:
M/branches/blackosx/package/BootOptions/KernelFlags.txt
M/branches/blackosx/package/Resources/en.lproj/Localizable.strings
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/BootOptions/Resolution.txt
M/branches/blackosx/package/Scripts/Sub/InstallLog.sh
M/branches/blackosx/package/TO DO.txt
M/branches/blackosx/package/Scripts/Main/Standard/postinstall

File differences

branches/blackosx/package/BootOptions/Resolution.txt
11
22
3
3
44
55
66
# ---------------------------------------------
# Chameleon boot options list.
# Structure is name:key=value
# Note: There must be a carriage return at end of last line
# ---------------------------------------------
Exclusive=True
branches/blackosx/package/BootOptions/KernelFlags.txt
11
22
33
4
45
56
67
78
8
9
10
11
12
# ---------------------------------------------
# Chameleon boot options list.
# Structure is name:key=value
# To Add kernel flag: format is name:KFflag=kernelflag
# Note: There must be a carriage return at end of last line
# ---------------------------------------------
Exclusive=False
# ---------------------------------------------
Npci:KF npci=0x2000
Verbose:KFflag=-v
Singleusermode:KFflag=-s
Ignorecaches:KFflag=-f
Npci:KFflag=npci=0x2000
branches/blackosx/package/TO DO.txt
11
22
3
4
5
63
7
8
4
TO DO
* Fix - Keylayouts to match new style for building org.chameleon.boot.plist. = DONE
* Check if boot options already exist before adding with plistbuddy.
* Check also kernel flags before adding with plistbuddy
* Add theme to org.chameleon.boot.plist? (Do what when more than one installed?)
* Install log is so far ONLY generated when selecting to install Chameleon.
* Include Boot options/kernel flags/keylayouts/themes to install log.
* Implement adding more than one kernel flag.
branches/blackosx/package/Scripts/Main/Standard/postinstall
7171
7272
7373
74
75
74
75
76
7677
7778
7879
versionNumber=`cat "${scriptDir}"/Resources/version`
revisionNumber=`cat "${scriptDir}"/Resources/revision`
"$scriptDir"InstallLog.sh "${targetVolume}" "Installer version: ${versionNumber} ${revisionNumber}"
"$scriptDir"InstallLog.sh "${targetVolume}" "Running Standard postinstall script
Target volume = ${targetVolume}"
"$scriptDir"InstallLog.sh "${targetVolume}" "Diskutil"
"$scriptDir"InstallLog.sh "${targetVolume}" "Running Standard postinstall script"
"$scriptDir"InstallLog.sh "${targetVolume}" "Target volume = ${targetVolume}"
# Double check we can see the selected partition and it's of the right type
branches/blackosx/package/Scripts/Main/EFI/postinstall
7474
7575
7676
77
78
79
77
78
79
8080
8181
8282
versionNumber=`cat "${scriptDir}"/Resources/version`
revisionNumber=`cat "${scriptDir}"/Resources/revision`
"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Installer version: ${versionNumber} ${revisionNumber}"
"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Running EFI postinstall script
Target volume selected by user = ${targetVolumeChosenByUser}
Target volume = ${targetVolume}"
"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Diskutil"
"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Running EFI postinstall script"
"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Target volume = ${targetVolume}"
# Check to see if the selected disk uses a GPT
branches/blackosx/package/Scripts/Main/Post/postinstall
3333
3434
3535
36
37
38
39
36
4037
4138
4239
4340
41
42
43
44
45
46
47
48
49
50
51
52
4453
4554
4655
47
48
49
50
5156
5257
5358
......
9196
9297
9398
94
95
96
99
97100
98101
99
100
102
103
101104
102
105
103106
104107
105108
......
107110
108111
109112
113
114
110115
111116
112117
113118
114
119
115120
116121
117122
dest_vol="$3"
fi
# ---------------------------------------------
# Get location of this script so we know where
# to find the Install Log script.
# ---------------------------------------------
# Where are we, so to find the Install Log script.
MYLOCATION="${PWD}/${BASH_ARGV[0]}"
export MYLOCATION="${MYLOCATION%/*}"
scriptDir=$MYLOCATION
# Has install log already been generated?
if [ ! -f "${dest_vol}"/.ChameleonLogFlag ]; then
# Write some information to the Install Log
versionNumber=`cat "${scriptDir}"/Resources/version`
revisionNumber=`cat "${scriptDir}"/Resources/revision`
"$scriptDir"InstallLog.sh "${dest_vol}" "Installer version: ${versionNumber} ${revisionNumber}"
"$scriptDir"InstallLog.sh "${dest_vol}" "Running Post postinstall script"
"$scriptDir"InstallLog.sh "${dest_vol}" "Target volume = ${dest_vol}"
else
"$scriptDir"InstallLog.sh "${dest_vol}" "Running Post postinstall script"
fi
# set temporary directory
chamTemp="$dest_vol/usr/local/chamTemp"
# Write script information to the Install Log
"$scriptDir"InstallLog.sh "${dest_vol}" "Running Post postinstall script"
# Check for temporary directory/Extra folder.
if [ ! -d "$chamTemp"/Extra ]; then
mkdir "$chamTemp"/Extra
ls "${chamTemp}"/options | while read FILE
do
options[arrayCount]="${FILE##*/}"
keyRead="${options[$arrayCount]%=*}"
value="${options[$arrayCount]#*=}"
# Check keyRead for 'KF' at beginning to
# indicate that should be a kernel flag
if [ ${keyRead:0:2} = "KF" ];then
kernelflag=${keyRead#*F }=$value
if [ ${options[arrayCount]:0:2} = "KF" ];then
kernelflag=${options[arrayCount]##*flag=}
sudo /usr/libexec/plistbuddy -c "Add :Kernel\ Flags string $kernelflag" "$tempOCBP"
"$scriptDir"InstallLog.sh "${dest_vol}" "Add kernel flag: ${kernelflag}"
"$scriptDir"InstallLog.sh "${dest_vol}" "Added kernel flag: ${kernelflag}"
returnValue=$?
if [ ${returnValue}=1 ]; then
# Delete it for now, but need to append as more kernel flags could be added in future!!
sudo /usr/libexec/plistbuddy -c "Add :Kernel\ Flags string $kernelflag" "$tempOCBP"
fi
else
keyRead="${options[$arrayCount]%=*}"
value="${options[$arrayCount]#*=}"
# escape any spaces
keyToUse=$( echo $keyRead | sed 's/ /\\ /g' )
if [ "${keyToUse}" != "DONT" ] && [ "${value}" != "USE" ]; then
sudo /usr/libexec/plistbuddy -c "Add :${keyToUse} string ${value}" "$tempOCBP"
"$scriptDir"InstallLog.sh "${dest_vol}" "Add boot option: ${keyRead}=${value}"
"$scriptDir"InstallLog.sh "${dest_vol}" "Added boot option: ${keyRead}=${value}"
fi
fi
(( arrayCount++ ))
branches/blackosx/package/Scripts/Sub/InstallLog.sh
4242
4343
4444
45
46
47
48
49
50
51
45
46
5247
5348
5449
5550
51
52
53
54
55
5656
5757
5858
......
6363
6464
6565
66
66
6767
6868
6969
echo "Chameleon installer log - $( date )
${verboseText}
======================================================
" >"${logFile}"
diskutil list >>"${logFile}"
echo "
======================================================
" >>"${logFile}"
======================================================" >"${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}"
echo "======================================================" >>"${logFile}"
fi
if [ "${verboseText}" = "LineBreak" ]; then
echo "======================================================" >>"${logFile}"
fi
echo " " >>"${logFile}"
fi
if [ "${verboseText}" != "LineBreak" ] && [[ "${verboseText}" != *fdisk* ]]; then
if [ "${verboseText}" != "LineBreak" ] && [[ "${verboseText}" != *fdisk* ]] && [[ "${verboseText}" != "Diskutil" ]]; then
echo "${verboseText}" >> "${logFile}"
fi
fi
branches/blackosx/package/Resources/en.lproj/Localizable.strings
99
1010
1111
12
12
1313
1414
1515
......
7171
7272
7373
74
75
74
75
7676
7777
7878
"Standard_description" = "Install Chameleon's files to the root of the selected partition using either boot0 or boot0md depending on your system without destroying any existing Windows installation if you have one.";
"EFI_title" = "EFI";
"EFI_description" = "Install Chameleon's files to the normally hidden EFI partition using either boot0 or boot0md depending on your system and without destroying any existing Windows installation if you have one.";
"EFI_description" = "Install Chameleon's files to the normally hidden EFI system partition using either boot0 or boot0md depending on your system and without destroying any existing Windows installation if you have one.";
"noboot_title" = "Don't install the Bootloader";
"noboot_description" = "Useful if you only want to install the extra's.";
"Documentation_description" = "Documentation for Chameleon manual install and use";
// Boot Options
"Options_title" = "Boot Options";
"Options_description" = "Create an /Extra/org.chameleon.Boot.plist and select your desired options to control Chameleon's settings.";
"Options_title" = "Available Settings";
"Options_description" = "Create an /Extra/org.chameleon.Boot.plist by selecting any of these boot options and kernel flags.";
// Control
branches/blackosx/package/buildpkg.sh
296296
297297
298298
299
300
299301
300302
301303
......
306308
307309
308310
309
311
310312
311313
312314
......
426428
427429
428430
429
431
430432
431433
432434
......
463465
464466
465467
466
468
467469
468470
469471
mkdir -p ${1}/Post/Scripts
cp -f ${pkgroot}/Scripts/Main/Post/* ${1}/Post/Scripts
cp -f ${pkgroot}/Scripts/Sub/InstallLog.sh ${1}/Post/Scripts
ditto --noextattr --noqtn ${1%/*/*}/revision ${1}/Post/Scripts/Resources/revision
ditto --noextattr --noqtn ${1%/*/*}/version ${1}/Post/Scripts/Resources/version
echo "[BUILD] Post "
buildpackage "${1}/Post" "/" "" "start_visible=\"false\" start_selected=\"true\"" >/dev/null 2>&1
outline[$((outlinecount++))]="${indent[$xmlindent]}</choices-outline>"
# clean up
rm -R -f "${1}"
#rm -R -f "${1}"
}
header+="auth=\"root\">\n"
header+="\t<payload installKBytes=\"${installedsize##* }\" numberOfFiles=\"${filecount##* }\"/>\n"
rm -R -f "${1}/Temp"
#rm -R -f "${1}/Temp"
[ -d "${1}/Temp" ] || mkdir -m 777 "${1}/Temp"
[ -d "${1}/Root" ] && mkbom "${1}/Root" "${1}/Temp/Bom"
fi
choices[$((choicescount++))]="<choice\n\tid=\"${packagename// /}\"\n\ttitle=\"${packagename}_title\"\n\tdescription=\"${packagename}_description\"\n${choiceoptions}>\n\t<pkg-ref id=\"${identifier}\" installKBytes='${installedsize}' version='${version}.0.0.${timestamp}' auth='root'>#${packagename// /}.pkg</pkg-ref>\n</choice>\n"
rm -R -f "${1}"
#rm -R -f "${1}"
fi
}

Archive Download the corresponding diff file

Revision: 1587