Chameleon

Chameleon Commit Details

Date:2012-01-07 10:02:04 (8 years 4 months ago)
Author:blackosx
Commit:1774
Parents: 1773
Message:Update branch with JrCs latest trunk package installer changes.
Changes:
M/branches/blackosx/package/OptionalSettings/Video.txt
M/branches/blackosx/package/buildpkg.sh
M/branches/blackosx/package/OptionalSettings/PowerManagement.txt
M/branches/blackosx/package/Distribution
M/branches/blackosx/package/OptionalSettings/General.txt
M/branches/blackosx/package/OptionalSettings/KernelFlags.txt
M/branches/blackosx/package/OptionalSettings/Control.txt
M/branches/blackosx
M/branches/blackosx/package/OptionalSettings/Resolution.txt
M/branches/blackosx/package/Scripts/Main/postinstall

File differences

branches/blackosx/package/Distribution
1515
1616
1717
18
19
20
21
22
23
24
25
26
27
1828
1929
2030
......
3949
4050
4151
42
43
44
45
46
47
48
49
50
51
52
53
5452
55
56
57
53
5854
5955
6056
......
6763
6864
6965
70
71
72
73
66
67
68
7469
75
76
77
78
79
80
81
82
83
84
85
86
70
71
72
73
74
8775
88
76
8977
9078
9179
<script>
var bootPlist = null;
if (my.target) {
var boot_plist_filenames = new Array( 'org.chameleon.Boot.plist', 'com.apple.Boot.plist' );
for ( var i = 0; i &lt; boot_plist_filenames.length; i++ ) {
bootPlist = system.files.plistAtPath( my.target.mountpoint + '/Extra/' + boot_plist_filenames[i] );
if (bootPlist)
break;
}
}
function installCheckScript() {
var obj = system.ioregistry.matchingClass("AppleSMC");
if (obj) {
return false;
}
function get_chameleon_boot_plist() {
if (my.target) {
var boot_plist_filenames = new Array( 'org.chameleon.Boot.plist', 'com.apple.Boot.plist' );
for ( var i = 0; i &lt; boot_plist_filenames.length; i++ ) {
var plist = system.files.plistAtPath( my.target.mountpoint + '/Extra/' + boot_plist_filenames[i] );
if (plist)
return plist;
}
}
return null;
}
function chameleon_boot_plist_exists() {
if (get_chameleon_boot_plist() != null)
return true;
return false;
return bootPlist ? true : false;
}
function check_chameleon_kernel_option(kernelFlags, value) {
}
function check_chameleon_option(key, value) {
var bootPlist = get_chameleon_boot_plist();
if (bootPlist) {
if (key == "KFflag")
key = "Kernel Flags";
if ( bootPlist &amp;&amp; bootPlist[ key ] ) {
if ( key == "Kernel Flags" )
return check_chameleon_kernel_option( bootPlist[ key ], value );
if (bootPlist[ key ]) {
if ( key == "Kernel Flags" )
return check_chameleon_kernel_option( bootPlist[ key ], value );
// Check if value is a boolean
var pattern=/^(Y(es)?|No?)$/i;
var result = value.match(pattern); // Check if the value is a boolean
if ( result &amp;&amp; bootPlist[ key ].charAt(0).toLowerCase() == value.charAt(0).toLowerCase() )
return true;
else
return bootPlist[ key ] == value; // check if the strings are equal
}
// Check if value is a boolean
var pattern=/^(Y(es)?|No?)$/i;
var result = value.match(pattern); // Check if the value is a boolean
if ( result &amp;&amp; bootPlist[ key ].charAt(0).toLowerCase() == value.charAt(0).toLowerCase() )
return true;
else
return false;
return bootPlist[ key ] == value; // check if the strings are equal
}
return false;
}
branches/blackosx/package/OptionalSettings/Resolution.txt
1111
1212
1313
14
15
16
14
15
16
1717
1818
1919
# example1: InstantMenu:Instant Menu=Yes
# example2: DropSSDT:DropSSDT=Yes
# ---------------------------------------------
# To add kernel flag: Structure is name:KFflag=kernelflag
# example1: Npci:KFflag=npci=0x2000
# example2: Verbose:KFflag=-v
# To add kernel flag: Structure is name:Kernel Flags=kernelflag
# example1: Npci:Kernel Flags=npci=0x2000
# example2: Verbose:Kernel Flags=-v
# ---------------------------------------------
# The package installer has a setting which controls what
# the user is allowed to choose.
branches/blackosx/package/OptionalSettings/Video.txt
1111
1212
1313
14
15
16
14
15
16
1717
1818
1919
# example1: InstantMenu:Instant Menu=Yes
# example2: DropSSDT:DropSSDT=Yes
# ---------------------------------------------
# To add kernel flag: Structure is name:KFflag=kernelflag
# example1: Npci:KFflag=npci=0x2000
# example2: Verbose:KFflag=-v
# To add kernel flag: Structure is name:Kernel Flags=kernelflag
# example1: Npci:Kernel Flags=npci=0x2000
# example2: Verbose:Kernel Flags=-v
# ---------------------------------------------
# The package installer has a setting which controls what
# the user is allowed to choose.
branches/blackosx/package/OptionalSettings/PowerManagement.txt
1111
1212
1313
14
15
16
14
15
16
1717
1818
1919
# example1: InstantMenu:Instant Menu=Yes
# example2: DropSSDT:DropSSDT=Yes
# ---------------------------------------------
# To add kernel flag: Structure is name:KFflag=kernelflag
# example1: Npci:KFflag=npci=0x2000
# example2: Verbose:KFflag=-v
# To add kernel flag: Structure is name:Kernel Flags=kernelflag
# example1: Npci:Kernel Flags=npci=0x2000
# example2: Verbose:Kernel Flags=-v
# ---------------------------------------------
# The package installer has a setting which controls what
# the user is allowed to choose.
branches/blackosx/package/OptionalSettings/General.txt
1111
1212
1313
14
15
16
14
15
16
1717
1818
1919
# example1: InstantMenu:Instant Menu=Yes
# example2: DropSSDT:DropSSDT=Yes
# ---------------------------------------------
# To add kernel flag: Structure is name:KFflag=kernelflag
# example1: Npci:KFflag=npci=0x2000
# example2: Verbose:KFflag=-v
# To add kernel flag: Structure is name:Kernel Flags=kernelflag
# example1: Npci:Kernel Flags=npci=0x2000
# example2: Verbose:Kernel Flags=-v
# ---------------------------------------------
# The package installer has a setting which controls what
# the user is allowed to choose.
branches/blackosx/package/OptionalSettings/KernelFlags.txt
1111
1212
1313
14
15
16
14
15
16
1717
1818
1919
......
2525
2626
2727
28
29
30
31
32
28
29
30
31
32
# example1: InstantMenu:Instant Menu=Yes
# example2: DropSSDT:DropSSDT=Yes
# ---------------------------------------------
# To add kernel flag: Structure is name:KFflag=kernelflag
# example1: Npci:KFflag=npci=0x2000
# example2: Verbose:KFflag=-v
# To add kernel flag: Structure is name:Kernel Flags=kernelflag
# example1: Npci:Kernel Flags=npci=0x2000
# example2: Verbose:Kernel Flags=-v
# ---------------------------------------------
# The package installer has a setting which controls what
# the user is allowed to choose.
# ---------------------------------------------
# Note: There must be a carriage return at end of last line
# ---------------------------------------------
Verbose:KFflag=-v
Singleusermode:KFflag=-s
Ignorecaches:KFflag=-f
Npci:KFflag=npci=0x2000
Darkwake:KFflag=darkwake=0
Verbose:Kernel Flags=-v
Singleusermode:Kernel Flags=-s
Ignorecaches:Kernel Flags=-f
Npci:Kernel Flags=npci=0x2000
Darkwake:Kernel Flags=darkwake=0
branches/blackosx/package/OptionalSettings/Control.txt
1111
1212
1313
14
15
16
14
15
16
1717
1818
1919
# example1: InstantMenu:Instant Menu=Yes
# example2: DropSSDT:DropSSDT=Yes
# ---------------------------------------------
# To add kernel flag: Structure is name:KFflag=kernelflag
# example1: Npci:KFflag=npci=0x2000
# example2: Verbose:KFflag=-v
# To add kernel flag: Structure is name:Kernel Flags=kernelflag
# example1: Npci:Kernel Flags=npci=0x2000
# example2: Verbose:Kernel Flags=-v
# ---------------------------------------------
# The package installer has a setting which controls what
# the user is allowed to choose.
branches/blackosx/package/Scripts/Main/postinstall
7878
7979
8080
81
82
83
84
85
81
82
83
84
8685
87
88
89
86
87
9088
9189
9290
93
94
95
91
92
9693
97
98
9994
100
101
102
103
104
105
106
107
108
95
96
97
98
99
100
101
109102
110103
111
112
104
113105
114
115
116
117
118
119
120
121
106
107
108
122109
123110
124111
cp "$4"/Library/Preferences/SystemConfiguration/com.apple.Boot.plist "$tempOCBP"
# Read list of all boot options the user added.
arrayCount=0
kernelFlagCount=0
while read FILE
do
options[arrayCount]="${FILE##*/}"
while IFS= read -r -d '' FILE; do
option="${FILE##*/}"
key="${option%%=*}"
value="${option#*=}"
# Check keyRead for 'KF' at beginning to
# indicate that should be a kernel flag
if [ ${options[arrayCount]:0:2} = "KF" ];then
# 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[kernelFlagCount]="${options[arrayCount]##*flag=}"
"$scriptDir"InstallLog.sh "${dest_vol}" "Added kernel flag: ${kernelflag[kernelFlagCount]}"
(( kernelFlagCount++ ))
kernelflag[${#kernelflag[*]}]="$value"
"$scriptDir"InstallLog.sh "${dest_vol}" "Added kernel flag: $value"
else
keyRead="${options[$arrayCount]%=*}"
value="${options[$arrayCount]#*=}"
# escape any spaces
keyToUse=$( echo $keyRead | sed 's/ /\\ /g' )
if [ "${keyToUse}" != "DONT" ] && [ "${value}" != "ADD" ]; then
sudo /usr/libexec/plistbuddy -c "Add :${keyToUse} string ${value}" "$tempOCBP"
returnValue=$?
if [ ${returnValue} -ne 1 ]; then
"$scriptDir"InstallLog.sh "${dest_vol}" "Added boot option: ${keyRead}=${value}"
else
"$scriptDir"InstallLog.sh "${dest_vol}" "Can't add ${keyRead}=${value} as an option already exists for: ${keyRead}"
fi
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
(( arrayCount++ ))
done < <(ls "${chamTemp}"/options )
done < <( find "${chamTemp}/options" -type f -print0 )
if [ $kernelFlagCount -gt 0 ]; then
# Add any kernel flags together in to one string.
for (( i=0 ; i < $kernelFlagCount ; i++ ))
do
kernelFlagString="${kernelFlagString} ${kernelflag[i]}"
done
# We add the final string in the next section.
fi
# Add any kernel flags together in to one string.
kernelFlagString="${kernelflag[@]}"
# We add the final string in the next section.
fi
# ---------------------------------------------
branches/blackosx/package/buildpkg.sh
519519
520520
521521
522
522
523523
524524
525525
textLine=${availableOptions[c]}
# split line - taking all before ':' as option name
# and all after ':' as key/value
optionName=${textLine%:*}
optionName=${textLine%%:*}
keyValue=${textLine##*:}
key=${keyValue%%=*}
value=${keyValue#*=}

Archive Download the corresponding diff file

Revision: 1774