Index: branches/blackosx/package/BootOptions/Resolution.txt
===================================================================
--- branches/blackosx/package/BootOptions/Resolution.txt (revision 1581)
+++ branches/blackosx/package/BootOptions/Resolution.txt (revision 1582)
@@ -1,4 +1,10 @@
-none:DONT=ADD
+# ---------------------------------------------
+# Chameleon boot options list.
+#ÊStructure is name:key=value
+# Note: There must be a carriage return at end of last line
+# ---------------------------------------------
+Exclusive=True
+# ---------------------------------------------
1024x600x32:Graphics Mode=1024x600x32
1024x768x32:Graphics Mode=1024x768x32
1280x768x32:Graphics Mode=1280x768x32
Index: branches/blackosx/package/BootOptions/Video.txt
===================================================================
--- branches/blackosx/package/BootOptions/Video.txt (revision 1581)
+++ branches/blackosx/package/BootOptions/Video.txt (revision 1582)
@@ -1,3 +1,10 @@
+# ---------------------------------------------
+# Chameleon boot options list.
+#Â Structure is name:key=value
+# Note: There must be a carriage return at end of last line
+# ---------------------------------------------
+Exclusive=False
+# ---------------------------------------------
GraphicsEnabler:GraphicsEnabler=Yes
UseAtiROM:UseAtiROM=Yes
UseNvidiaROM:UseNvidiaROM=Yes
Index: branches/blackosx/package/BootOptions/PowerManagement.txt
===================================================================
--- branches/blackosx/package/BootOptions/PowerManagement.txt (revision 1581)
+++ branches/blackosx/package/BootOptions/PowerManagement.txt (revision 1582)
@@ -1,4 +1,10 @@
-CSTUsingSystemIO:CSTUsingSystemIO=Yes
+# ---------------------------------------------
+# Chameleon boot options list.
+#Â Structure is name:key=value
+# Note: There must be a carriage return at end of last line
+# ---------------------------------------------
+Exclusive=False
+# ---------------------------------------------CSTUsingSystemIO:CSTUsingSystemIO=Yes
DropSSDT:DropSSDT=Yes
EnableC2State:EnableC2State=Yes
EnableC3State:EnableC3State=Yes
Index: branches/blackosx/package/BootOptions/General.txt
===================================================================
--- branches/blackosx/package/BootOptions/General.txt (revision 1581)
+++ branches/blackosx/package/BootOptions/General.txt (revision 1582)
@@ -1,3 +1,10 @@
+# ---------------------------------------------
+# Chameleon boot options list.
+#Â Structure is name:key=value
+# Note: There must be a carriage return at end of last line
+# ---------------------------------------------
+Exclusive=False
+# ---------------------------------------------
arch:arch=i386
EHCIacquire:EHCIacquire=Yes
EthernetBuiltIn:EthernetBuiltIn=Yes
Index: branches/blackosx/package/BootOptions/KernelFlags.txt
===================================================================
--- branches/blackosx/package/BootOptions/KernelFlags.txt (revision 1581)
+++ branches/blackosx/package/BootOptions/KernelFlags.txt (revision 1582)
@@ -1 +1,8 @@
+# ---------------------------------------------
+# Chameleon boot options list.
+#Â Structure is name:key=value
+# Note: There must be a carriage return at end of last line
+# ---------------------------------------------
+Exclusive=False
+# ---------------------------------------------
Npci:KF npci=0x2000
Index: branches/blackosx/package/BootOptions/Control.txt
===================================================================
--- branches/blackosx/package/BootOptions/Control.txt (revision 1581)
+++ branches/blackosx/package/BootOptions/Control.txt (revision 1582)
@@ -1,3 +1,10 @@
+# ---------------------------------------------
+# Chameleon boot options list.
+#Â Structure is name:key=value
+# Note: There must be a carriage return at end of last line
+# ---------------------------------------------
+Exclusive=False
+# ---------------------------------------------
BootBanner:Boot Banner=No
GUI:GUI=No
LegacyLogo:Legacy Logo=Yes
Index: branches/blackosx/package/Resources/en.lproj/Localizable.strings
===================================================================
--- branches/blackosx/package/Resources/en.lproj/Localizable.strings (revision 1581)
+++ branches/blackosx/package/Resources/en.lproj/Localizable.strings (revision 1582)
@@ -173,11 +173,8 @@
/ / R e s o l u t i o n
" R e s o l u t i o n _ t i t l e " = " R e s o l u t i o n " ;
- " R e s o l u t i o n _ d e s c r i p t i o n " = " S e t t h e s c r e e n r e s o l u t i o n o f y o u r d i s p l a y " ;
+ " R e s o l u t i o n _ d e s c r i p t i o n " = " S e t o n e r e s o l u t i o n t o u s e , o r s e l e c t ' N o n e ' i f y o u d o n ' t w a n t t o s e l e c t a r e s o l u t i o n . " ;
- " n o n e _ t i t l e " = " D o n ' t a d d a r e s o l u t i o n " ;
- " n o n e _ d e s c r i p t i o n " = " D o n ' t a d d a r e s o l u t i o n " ;
-
" 1 0 2 4 x 6 0 0 x 3 2 _ t i t l e " = " 1 0 2 4 x 6 0 0 x 3 2 " ;
" 1 0 2 4 x 6 0 0 x 3 2 _ d e s c r i p t i o n " = " S e t G r a p h i c s M o d e t o 1 0 2 4 x 6 0 0 x 3 2 " ;
@@ -231,7 +228,7 @@
/ / K e y L a y o u t
" K e y L a y o u t _ t i t l e " = " K e y L a y o u t " ;
- " K e y L a y o u t _ d e s c r i p t i o n " = " S e t k e y l a y o u t t o u s e " ;
+ " K e y L a y o u t _ d e s c r i p t i o n " = " S e t o n e k e y l a y o u t t o u s e , o r s e l e c t ' N o n e ' i f y o u d o n ' t w a n t t o s e l e c t a k e y l a y o u t . " ;
" m a c - d e _ t i t l e " = " G e r m a n M a c K e y b o a r d " ;
" m a c - d e _ d e s c r i p t i o n " = " U s e t h e k e y b o a r d l a y o u t f o r a G e r m a n M a c k e y b o a r d " ;
@@ -282,4 +279,15 @@
" N e w e r _ P a c k a g e _ I n s t a l l e d _ m e s s a g e " = " A n e w e r v e r s i o n o f C h a m e l e o n i s a l r e a d y i n s t a l l e d " ;
" I n t e l _ M a c _ m e s s a g e " = " T h i s s o f t w a r e c a n n o t b e i n s t a l l e d o n t h i s c o m p u t e r . " ;
+
+ / / E x c l u s i v e b o o t p t i o n s s t r i n g
+ / / N a m e t o b e u s e d s h o u l d b e C h o o s e N o n e - x x x x x x
+ / / W h e r e x x x x x = t h e n a m e o f t h e B o o t O p t i o n s f i l e ( m i n u s t h e . t x t )
+ " C h o o s e N o n e - R e s o l u t i o n _ t i t l e " = " N o n e " ;
+ " C h o o s e N o n e - R e s o l u t i o n _ d e s c r i p t i o n " = " D o n ' t c h o o s e a r e s o l u t i o n . " ;
+
+ " C h o o s e N o n e - k e y l a y o u t _ t i t l e " = " N o n e " ;
+ " C h o o s e N o n e - k e y l a y o u t _ d e s c r i p t i o n " = " D o n ' t c h o o s e a k e y l a y o u t . " ;
+
+
\ No newline at end of file
Index: branches/blackosx/package/buildpkg.sh
===================================================================
--- branches/blackosx/package/buildpkg.sh (revision 1581)
+++ branches/blackosx/package/buildpkg.sh (revision 1582)
@@ -88,7 +88,7 @@
mkdir -p ${1}/Standard/Root
mkdir -p ${1}/Standard/Scripts/Resources
cp -f ${pkgroot}/Scripts/Main/Standard/* ${1}/Standard/Scripts
- cp -f ${pkgroot}/Scripts/Sub/* ${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
@@ -100,7 +100,7 @@
mkdir -p ${1}/EFI/Root
mkdir -p ${1}/EFI/Scripts/Resources
cp -f ${pkgroot}/Scripts/Main/EFI/* ${1}/EFI/Scripts
- cp -f ${pkgroot}/Scripts/Sub/* ${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
@@ -198,89 +198,37 @@
do
# Take filename and Strip .txt from end and path from front
- builtOptionsFolderName=$( echo ${bootOptionFiles[$i]%.txt} )
- builtOptionsFolderName=$( echo ${builtOptionsFolderName##*/} )
- echo "================= $builtOptionsFolderName ================="
-
- outline[$((outlinecount++))]="${indent[$xmlindent]}\t"
- choices[$((choicescount++))]="\n\n"
+ builtOptionsList=$( echo ${bootOptionFiles[$i]%.txt} )
+ builtOptionsList=$( echo ${builtOptionsList##*/} )
+ echo "================= $builtOptionsList ================="
+ outline[$((outlinecount++))]="${indent[$xmlindent]}\t"
+ choices[$((choicescount++))]="\n\n"
((xmlindent++))
- packagesidentity="org.chameleon.options.$builtOptionsFolderName"
+ packagesidentity="org.chameleon.options.$builtOptionsList"
# ------------------------------------------------------
- # Read boot option file in to an array.
- # Structure of boot option in file is name:key=value
- # Note: This requires the boot option file to have
- # a carriage return at the end of the last line.
- # ------------------------------------------------------
- count=0
- availableOptions=()
- while read textLine
- do
- availableOptions[count]=$textLine
- ((count++))
- done < ${bootOptionFiles[$i]}
-
- # ------------------------------------------------------
- # Loop through options in array and process each in turn
- # ------------------------------------------------------
- for (( c = 0 ; c < ${#availableOptions[@]} ; c++ ))
+ # Read boot option file in to an array.
+ # ------------------------------------------------------
+ availableOptions=() # array to hold the list of boot options, per 'section'.
+ exclusiveFlag=0 # used to indicate list has exclusive options.
+ exclusiveName="" # will be appended to exclusive 'none' option name.
+ count=0 # used as index for stepping through array.
+ while read textLine
do
- textLine=${availableOptions[c]}
- # split line - taking all before ':' as option name
- # and all after ':' as key/value
- optionName=${textLine%:*}
- keyValue=${textLine##*:}
-
- # create folders required for each boot option
- mkdir -p "${1}/$optionName/Root/"
-
- # create dummy file with name of key/value
- echo "" > "${1}/$optionName/Root/${keyValue}"
-
- echo " [BUILD] ${optionName} "
-
- # ------------------------------------------------------
- # Before calling buildpackage, see if any bootOptionFiles
- # have requested being set to exclusive.
- # Manually set for now to 'Resolutions'.
- # It can eventually be non-specifc by adding a dedicated
- # field at the top of each bootOptionFiles to indicate
- # if the set should be exclusive or not.
- # ------------------------------------------------------
- if [ $builtOptionsFolderName = "Resolution" ]; then
-
- # Prepare individual string parts
- stringStart="selected=\""
- stringBefore="exclusive(choices['"
- stringAfter="']) && "
- stringEnd="'])\""
- x=${stringStart}${stringBefore}
-
- # build string for sending to buildpackage
- totalItems="${#availableOptions[@]}"
- lastItem=$((totalItems-1))
-
- for (( r = 0 ; r < ${totalItems} ; r++ ))
- do
- textLineTemp=${availableOptions[r]}
- optionNameTemp=${textLineTemp%:*}
- if [ "${optionNameTemp}" != "${optionName}" ]; then
- x="${x}${optionNameTemp}"
- # Only add these to end of string up to the one before the last item
- if [ $r -lt $lastItem ]; then
- x="${x}${stringAfter}${stringBefore}"
- fi
- fi
- done
- x="${x}${stringEnd}"
- buildpackage "${1}/${optionName}" "/$chamTemp/options" "" "start_selected=\"false\" ${x}" >/dev/null 2>&1
- else
- buildpackage "${1}/${optionName}" "/$chamTemp/options" "" "start_selected=\"false\"" >/dev/null 2>&1
+ # ignore lines in the file beginning with a # and Exclusive=False
+ if [[ ${textLine} != \#* ]] && [[ ${textLine} != "Exclusive=False" ]];then
+ # check for 'Exclusive=True' option in file
+ if [[ ${textLine} == "Exclusive=True" ]];then
+ exclusiveFlag=1
+ exclusiveName=$builtOptionsList
+ else
+ availableOptions[count]=$textLine
+ ((count++))
+ fi
fi
-
- done
-
+ done < ${bootOptionFiles[$i]}
+ buildbootoptions "$1" "${exclusiveFlag}" "${exclusiveName}"
+
((xmlindent--))
outline[$((outlinecount++))]="${indent[$xmlindent]}\t"
done
@@ -291,14 +239,16 @@
choices[$((choicescount++))]="\n\n"
((xmlindent++))
packagesidentity="org.chameleon.options.keylayout"
- keymaps=($( find "${1%/sym/*}/Keymaps" -type f -depth 1 -name '*.lyt' | sed 's|.*/||;s|\.lyt||' ))
- for (( i = 0 ; i < ${#keymaps[@]} ; i++ ))
- do
- mkdir -p "${1}/${keymaps[$i]##*/}/Root/"
- echo "dummy file" >"${1}/${keymaps[$i]##*/}/Root/KeyLayout=${keymaps[$i]##*/}"
- echo " [BUILD] ${keymaps[$i]##*/} "
- buildpackage "${1}/${keymaps[$i]##*/}" "/$chamTemp/options" "" "start_selected=\"false\"" >/dev/null 2>&1
- done
+
+ # ------------------------------------------------------
+ # Available Keylayout boot options are discovered by
+ # reading contents of /Keymaps folder after compilation
+ # ------------------------------------------------------
+ availableOptions=()
+ availableOptions=($( find "${1%/sym/*}/Keymaps" -type f -depth 1 -name '*.lyt' | sed 's|.*/||;s|\.lyt||' ))
+ # call buildbootoptions with 1 to indicate exclusive option wanted.
+ buildbootoptions "$1" "1" "keylayout"
+
((xmlindent--))
outline[$((outlinecount++))]="${indent[$xmlindent]}\t"
@@ -348,7 +298,7 @@
# clean up
- #rm -R -f "${1}"
+ rm -R -f "${1}"
}
@@ -360,6 +310,85 @@
chown -R 0:0 "${1}"
}
+buildbootoptions()
+{
+ # $1 Path to package to build containing Root and or Scripts
+ # $2 = exclusiveFlag
+ # S3 = exclusiveName
+
+ # ------------------------------------------------------
+ # if exclusiveFlag=1 then re-build array
+ # adding extra boot option at beginning to give
+ #Êuser a chance to choose none of them.
+ # ------------------------------------------------------
+ if [ ${2} = "1" ]; then
+ tempArray=("${availableOptions[@]}")
+ availableOptions=()
+ availableOptions[0]="ChooseNone-"$3":DONT=ADD"
+ position=0
+ totalItems="${#tempArray[@]}"
+ for (( position = 0 ; position < $totalItems ; position++ ))
+ do
+ availableOptions[$position+1]=${tempArray[${position}]}
+ done
+ fi
+
+ # ------------------------------------------------------
+ # Loop through options in array and process each in turn
+ # ------------------------------------------------------
+ for (( c = 0 ; c < ${#availableOptions[@]} ; c++ ))
+ do
+ textLine=${availableOptions[c]}
+ # split line - taking all before ':' as option name
+ # and all after ':' as key/value
+ optionName=${textLine%:*}
+ keyValue=${textLine##*:}
+
+ # create folders required for each boot option
+ mkdir -p "${1}/$optionName/Root/"
+
+ # create dummy file with name of key/value
+ echo "" > "${1}/$optionName/Root/${keyValue}"
+
+ echo " [BUILD] ${optionName} "
+
+ # ------------------------------------------------------
+ # Before calling buildpackage, add exclusive options
+ # to buildpackage call if requested.
+ # ------------------------------------------------------
+ if [ $2 = "1" ]; then
+
+ # Prepare individual string parts
+ stringStart="selected=\""
+ stringBefore="exclusive(choices['"
+ stringAfter="']) && "
+ stringEnd="'])\""
+ x=${stringStart}${stringBefore}
+
+ # build string for sending to buildpackage
+ totalItems="${#availableOptions[@]}"
+ lastItem=$((totalItems-1))
+
+ for (( r = 0 ; r < ${totalItems} ; r++ ))
+ do
+ textLineTemp=${availableOptions[r]}
+ optionNameTemp=${textLineTemp%:*}
+ if [ "${optionNameTemp}" != "${optionName}" ]; then
+ x="${x}${optionNameTemp}"
+ # Only add these to end of string up to the one before the last item
+ if [ $r -lt $lastItem ]; then
+ x="${x}${stringAfter}${stringBefore}"
+ fi
+ fi
+ done
+ x="${x}${stringEnd}"
+ buildpackage "${1}/${optionName}" "/$chamTemp/options" "" "start_selected=\"false\" ${x}" >/dev/null 2>&1
+ else
+ buildpackage "${1}/${optionName}" "/$chamTemp/options" "" "start_selected=\"false\"" >/dev/null 2>&1
+ fi
+ done
+}
+
buildpackage ()
{
# $1 Path to package to build containing Root and or Scripts
@@ -389,7 +418,7 @@
header+="auth=\"root\">\n"
header+="\t\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"
@@ -426,7 +455,7 @@
fi
choices[$((choicescount++))]="\n\t#${packagename// /}.pkg\n\n"
- #rm -R -f "${1}"
+ rm -R -f "${1}"
fi
}