Index: branches/blackosx/trunk/package/buildpkg =================================================================== --- branches/blackosx/trunk/package/buildpkg (revision 206) +++ branches/blackosx/trunk/package/buildpkg (revision 207) @@ -258,6 +258,7 @@ cp -f ${pkgroot}/Scripts/Post/* ${1}/Post/Scripts buildpackage "${1}/Post" "/" "" "start_visible=\"false\" start_selected=\"true\"" outline[$((outlinecount++))]="${indent[$xmlindent]}" + # build meta package makedistribution "${1}" "${2}" "${3}" "${4}" "${5}" Index: branches/blackosx/trunk/package/Scripts/Standard/postinstall =================================================================== --- branches/blackosx/trunk/package/Scripts/Standard/postinstall (revision 206) +++ branches/blackosx/trunk/package/Scripts/Standard/postinstall (revision 207) @@ -3,7 +3,8 @@ diskloader="boot0" diskloaderdualboot="boot0hfs" -partitionloader="boot1h" +partitionloaderhfs="boot1h" +partitionloaderfat="boot1f32" filesystemloader="boot" diskmicrocodetype[1]="GRUB,47525542" @@ -49,7 +50,8 @@ echo "bootdisk: Disk device is ${bootdisk}" echo "bootrdisk: Disk raw device is ${bootrdisk}" echo "diskloader: Disk loader is ${diskloader}" -echo "partitionloader: Partition loader is ${partitionloader}" +echo "partitionloaderhfs: Partition loader is ${partitionloaderhfs}" +echo "partitionloaderfat: Partition loader is ${partitionloaderfat}" echo "filesystemloader: Filesystem loader is ${filesystemloader}" echo "bootresources: Boot Resources is ${bootresources}" echo "-----------------------------------------------" @@ -225,6 +227,23 @@ echo "===============================================" +echo "Check the format of the selected partition" +echo "*************************************" + +if [ "$( fstyp ${bootdev} | grep hfs )" ]; then + echo "${bootdev} is a currently formatted as HFS" + efiformat="hfs" +fi +if [ "$( fstyp ${bootdev} | grep msdos )" ]; then + echo "${bootdev} is currently formatted as msdos" + efiformat="msdos" +fi +echo "-----------------------------------------------" +echo "" +echo "" + + +echo "===============================================" echo "Determine Partition Scheme:" echo "***************************" @@ -285,9 +304,16 @@ echo "Diskupdate is false, so no stage 0 file was written" fi -echo "Executing command: dd if=/usr/standalone/i386/${partitionloader} of=${bootrdev}" -dd if="${bootvolume}/usr/standalone/i386/${partitionloader}" of=${bootrdev} +if [ ${efiformat} = "hfs" ]; then + echo "Executing command: dd if=/usr/standalone/i386/${partitionloaderhfs} of=${bootrdev}" + dd if="${bootvolume}/usr/standalone/i386/${partitionloaderhfs}" of=${bootrdev} +fi +if [ ${efiformat} = "msdos" ]; then + echo "Executing command: dd if=/usr/standalone/i386/${partitionloaderfat} of=${bootrdev}" + dd if="${bootvolume}/usr/standalone/i386/${partitionloaderfat}" of=${bootrdev} +fi + echo "Executing command: cp /usr/standalone/i386/${filesystemloader} ${bootvolume}" cp "${bootvolume}/usr/standalone/i386/${filesystemloader}" "${bootvolume}" Index: branches/blackosx/trunk/package/Scripts/EFI/postinstall =================================================================== --- branches/blackosx/trunk/package/Scripts/EFI/postinstall (revision 206) +++ branches/blackosx/trunk/package/Scripts/EFI/postinstall (revision 207) @@ -246,17 +246,6 @@ } -#checkpartitionactive () -#{ -#partitionactive=$( fdisk440 -d ${bootrdisk} | grep -n "*" | awk -F: '{print $1}') - -#if [ -n "${partitionactive}" ]; then -# echo "Partition flagged active is ${partitionactive}" -#else -# echo "No partition flagged active." -#fi - -#} } @@ -264,21 +253,21 @@ echo "===============================================" -echo "Check the format of the EFI partition" +echo "Unmount all EFI partitions and Check their format" echo "*************************************" -if [ "$( df | grep ${bootdev} )" ]; then - echo "${bootdev} is currently mounted, so un-mounting it" - umount -f ${bootdev} -else - echo "EFI partition is currently not mounted" -fi +# loop through and un-mount all mounted EFI partitions - Thanks kizwan +attempts=1 +while [ "$( df | grep EFI )" ] && [ "${attempts}" -lt 5 ]; do + echo "Unmounting $( df | grep EFI | awk '{print $1}' )" + umount -f $( df | grep EFI | awk '{print $1}' ) + attempts=$(( ${attempts} + 1 )) +done +if [ ${attempts} = 5 ]; then + echo "failed to unmount EFI partitions." + exit +fi -#if [[ `dd if=/dev/disk${1}s1 count=8 bs=1 skip=82 | uuencode -m -|head -n 2|tail -n 1` != "RkFUMzIgICA=" ]]; then -# echo "${bootdev} isn't a FAT32 partition" -# newfs_msdos -v "${bootervolumename}" "${bootdev}" -#fi - if [ "$( fstyp ${bootdev} | grep hfs )" ]; then echo "${bootdev} is a currently formatted as HFS" efiformat="hfs" @@ -286,8 +275,6 @@ if [ "$( fstyp ${bootdev} | grep msdos )" ]; then echo "${bootdev} is currently formatted as msdos" efiformat="msdos" - #echo "Executing command: newfs_msdos -F 32 ${bootdev}" - #newfs_msdos -F 32 "${bootdev}" fi echo "-----------------------------------------------" echo "" Index: branches/blackosx/trunk/package/Scripts/Advanced/ForceHPET/postinstall =================================================================== --- branches/blackosx/trunk/package/Scripts/Advanced/ForceHPET/postinstall (revision 206) +++ branches/blackosx/trunk/package/Scripts/Advanced/ForceHPET/postinstall (revision 207) @@ -1,169 +1,9 @@ #!/bin/bash -# set com.apple.Boot.plist options +temp="/private/tmp/Chameleon" -overide="ForceHPET" -string="Yes" - -main () -{ - - bootplist="${2}/.Chameleon/Extra/com.apple.Boot.plist" - systemplist="/Library/Preferences/SystemConfiguration/com.apple.Boot.plist" - - bootoptionshdextra[1]="${overide}" - bootoptionshdextra[2]="${string}" - - [ ! -d "${bootplist%/*}" ] && mkdir -p "${bootplist%/*}" - - if [ ! -f "${bootplist}" ]; then - if [ -f "${systemplist}" ]; then - cp -f "${systemplist}" "${bootplist}" - fi - fi - - xmlvalue=$( getxmlvalue ${overide} "${bootplist}" | tr "[:upper:]" "[:lower:]" ) - - case "${xmlvalue:0:1}" in - - y) echo "${overide}=y already set in ${bootplist} skipping." - ;; - - n) echo "${overide}=n is set in ${bootplist} leaving." - ;; - - *) echo "Adding ${overide}=y to ${bootplist}" - array=("${bootoptionshdextra[@]}") - searchfilereplaceline "${bootplist}" "Kernel Flags" "" "" "2" - ;; - esac - - chown "${USER}:20" "${bootplist}" -} - -getxmlvalue () -{ -# 1 xml key -# 2 xml file -if [ -f "${2}" ]; then - local value - while read value; do - if [ ! "${value}" = "${value/${1}/}" ]; then - read value - value="${value#*<}" ; value="<${value}" ; value="${value#*>}" ; value="${value# *}" ; value="${value%%<*}" - echo "$value" - break - fi - done < "${2}" +if [ -d ${temp} ]; then + mkdir ${temp}; fi -} -searchfilereplaceline () -{ - -mv "${1}" "${1}.orig" - -prefunctionifs="${IFS}" - -unset fileinput -unset fileoutput -unset find -unset replace -unset deletelines -unset deletelinesskip -unset insertlinesskip - -fileinput="${1}.orig" -fileoutput="${1}" -find="${2}" -replace="${3}" -deletelines="${4%,*}" -insertlinesskip="${5}" - -matchlinefound="0" - -if [ "${#4}" = "${4#*,}" ]; then - deletelinesskip="0" - else - deletelinesskip="${4#*,}" -fi - -IFS="\n" -while read line -do - { - if [ ! "${line}" = "${line/${find}/}" ]; then - { - # Trim the longest match from the end for <* - xmlelementindent="${line%%<*}" - - # Trim the longest match from the start for *< - xmlelementtemp="${line#*<}" - # Add back in stripped < - xmlelement="<${xmlelementtemp}" - - # Trim the shortest match from the start for < - xmltagtemp="${xmlelement#<}" - # Trim the longest match from the end for >* - xmltag="${xmltagtemp%%>*}" - - # Trim the shortest match from the start for *> - xmltexttemp="${xmlelement#*>}" - # Trim the longest match from the end for <* - xmltext="${xmltexttemp%%<*}" - - if [ "${replace}" ]; then - { - echo "${xmlelementindent}<${xmltag}>${replace}" >>"${fileoutput}" - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - matchlinefound="1" - - } - else - { - - if [ "${insertlinesskip}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -le "${insertlinesskip}" ]; then - { - if [ "${matchlinefound}" = "${insertlinesskip}" ]; then - { - arraysize=0 - while [ ${arraysize} -lt ${#array[@]} ]; - do - echo "${xmlelementindent}${array[${arraysize}]}" >>"${fileoutput}" - let arraysize="${arraysize}+1" - done - } - fi - } - fi - - if [ "${deletelines}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -lt $((${deletelines}+${deletelinesskip})) ] && [ "${matchlinefound}" -ge ${deletelinesskip} ]; then - { - : - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - - if [ "${matchlinefound}" -gt 0 ]; then - let matchlinefound="${matchlinefound}+1" - fi - - } - fi - } -done < "${fileinput}" - -IFS=${prefunctionifs} - -rm -f "${fileinput}" -} - -main "${1}" "${2}" "${3}" "${4}" +mkdir -p "${temp}/@ForceHPET+Yes" \ No newline at end of file Index: branches/blackosx/trunk/package/Scripts/Advanced/EHCIacquire/postinstall =================================================================== --- branches/blackosx/trunk/package/Scripts/Advanced/EHCIacquire/postinstall (revision 206) +++ branches/blackosx/trunk/package/Scripts/Advanced/EHCIacquire/postinstall (revision 207) @@ -1,169 +1,9 @@ #!/bin/bash -# set com.apple.Boot.plist options +temp="/private/tmp/Chameleon" -overide="EHCIacquire" -string="Yes" - -main () -{ - - bootplist="${2}/.Chameleon/Extra/com.apple.Boot.plist" - systemplist="/Library/Preferences/SystemConfiguration/com.apple.Boot.plist" - - bootoptionshdextra[1]="${overide}" - bootoptionshdextra[2]="${string}" - - [ ! -d "${bootplist%/*}" ] && mkdir -p "${bootplist%/*}" - - if [ ! -f "${bootplist}" ]; then - if [ -f "${systemplist}" ]; then - cp "${systemplist}" "${bootplist}" - fi - fi - - xmlvalue=$( getxmlvalue ${overide} "${bootplist}" | tr "[:upper:]" "[:lower:]" ) - - case "${xmlvalue:0:1}" in - - y) echo "${overide}=y already set in ${bootplist} skipping." - ;; - - n) echo "${overide}=n is set in ${bootplist} leaving." - ;; - - *) echo "Adding ${overide}=${string} to ${bootplist}" - array=("${bootoptionshdextra[@]}") - searchfilereplaceline "${bootplist}" "Kernel Flags" "" "" "2" - ;; - esac - - chown "${USER}:20" "${bootplist}" -} - -getxmlvalue () -{ -# 1 xml key -# 2 xml file -if [ -f "${2}" ]; then - local value - while read value; do - if [ ! "${value}" = "${value/${1}/}" ]; then - read value - value="${value#*<}" ; value="<${value}" ; value="${value#*>}" ; value="${value# *}" ; value="${value%%<*}" - echo "$value" - break - fi - done < "${2}" +if [ -d ${temp} ]; then + mkdir ${temp}; fi -} -searchfilereplaceline () -{ - -mv "${1}" "${1}.orig" - -prefunctionifs="${IFS}" - -unset fileinput -unset fileoutput -unset find -unset replace -unset deletelines -unset deletelinesskip -unset insertlinesskip - -fileinput="${1}.orig" -fileoutput="${1}" -find="${2}" -replace="${3}" -deletelines="${4%,*}" -insertlinesskip="${5}" - -matchlinefound="0" - -if [ "${#4}" = "${4#*,}" ]; then - deletelinesskip="0" - else - deletelinesskip="${4#*,}" -fi - -IFS="\n" -while read line -do - { - if [ ! "${line}" = "${line/${find}/}" ]; then - { - # Trim the longest match from the end for <* - xmlelementindent="${line%%<*}" - - # Trim the longest match from the start for *< - xmlelementtemp="${line#*<}" - # Add back in stripped < - xmlelement="<${xmlelementtemp}" - - # Trim the shortest match from the start for < - xmltagtemp="${xmlelement#<}" - # Trim the longest match from the end for >* - xmltag="${xmltagtemp%%>*}" - - # Trim the shortest match from the start for *> - xmltexttemp="${xmlelement#*>}" - # Trim the longest match from the end for <* - xmltext="${xmltexttemp%%<*}" - - if [ "${replace}" ]; then - { - echo "${xmlelementindent}<${xmltag}>${replace}" >>"${fileoutput}" - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - matchlinefound="1" - - } - else - { - - if [ "${insertlinesskip}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -le "${insertlinesskip}" ]; then - { - if [ "${matchlinefound}" = "${insertlinesskip}" ]; then - { - arraysize=0 - while [ ${arraysize} -lt ${#array[@]} ]; - do - echo "${xmlelementindent}${array[${arraysize}]}" >>"${fileoutput}" - let arraysize="${arraysize}+1" - done - } - fi - } - fi - - if [ "${deletelines}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -lt $((${deletelines}+${deletelinesskip})) ] && [ "${matchlinefound}" -ge ${deletelinesskip} ]; then - { - : - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - - if [ "${matchlinefound}" -gt 0 ]; then - let matchlinefound="${matchlinefound}+1" - fi - - } - fi - } -done < "${fileinput}" - -IFS=${prefunctionifs} - -rm -f "${fileinput}" -} - -main "${1}" "${2}" "${3}" "${4}" +mkdir -p "${temp}/@EHCIacquire+Yes" \ No newline at end of file Index: branches/blackosx/trunk/package/Scripts/Advanced/VBIOS/postinstall =================================================================== --- branches/blackosx/trunk/package/Scripts/Advanced/VBIOS/postinstall (revision 206) +++ branches/blackosx/trunk/package/Scripts/Advanced/VBIOS/postinstall (revision 207) @@ -1,169 +1,9 @@ #!/bin/bash -# set com.apple.Boot.plist options +temp="/private/tmp/Chameleon" -overide="VBIOS" -string="Yes" - -main () -{ - - bootplist="${2}/.Chameleon/Extra/com.apple.Boot.plist" - systemplist="/Library/Preferences/SystemConfiguration/com.apple.Boot.plist" - - bootoptionshdextra[1]="${overide}" - bootoptionshdextra[2]="${string}" - - [ ! -d "${bootplist%/*}" ] && mkdir -p "${bootplist%/*}" - - if [ ! -f "${bootplist}" ]; then - if [ -f "${systemplist}" ]; then - cp "${systemplist}" "${bootplist}" - fi - fi - - xmlvalue=$( getxmlvalue ${overide} "${bootplist}" | tr "[:upper:]" "[:lower:]" ) - - case "${xmlvalue:0:1}" in - - y) echo "${overide}=y already set in ${bootplist} skipping." - ;; - - n) echo "${overide}=n is set in ${bootplist} leaving." - ;; - - *) echo "Adding ${overide}=${string} to ${bootplist}" - array=("${bootoptionshdextra[@]}") - searchfilereplaceline "${bootplist}" "Kernel Flags" "" "" "2" - ;; - esac - - chown "${USER}:20" "${bootplist}" -} - -getxmlvalue () -{ -# 1 xml key -# 2 xml file -if [ -f "${2}" ]; then - local value - while read value; do - if [ ! "${value}" = "${value/${1}/}" ]; then - read value - value="${value#*<}" ; value="<${value}" ; value="${value#*>}" ; value="${value# *}" ; value="${value%%<*}" - echo "$value" - break - fi - done < "${2}" +if [ -d ${temp} ]; then + mkdir ${temp}; fi -} -searchfilereplaceline () -{ - -mv "${1}" "${1}.orig" - -prefunctionifs="${IFS}" - -unset fileinput -unset fileoutput -unset find -unset replace -unset deletelines -unset deletelinesskip -unset insertlinesskip - -fileinput="${1}.orig" -fileoutput="${1}" -find="${2}" -replace="${3}" -deletelines="${4%,*}" -insertlinesskip="${5}" - -matchlinefound="0" - -if [ "${#4}" = "${4#*,}" ]; then - deletelinesskip="0" - else - deletelinesskip="${4#*,}" -fi - -IFS="\n" -while read line -do - { - if [ ! "${line}" = "${line/${find}/}" ]; then - { - # Trim the longest match from the end for <* - xmlelementindent="${line%%<*}" - - # Trim the longest match from the start for *< - xmlelementtemp="${line#*<}" - # Add back in stripped < - xmlelement="<${xmlelementtemp}" - - # Trim the shortest match from the start for < - xmltagtemp="${xmlelement#<}" - # Trim the longest match from the end for >* - xmltag="${xmltagtemp%%>*}" - - # Trim the shortest match from the start for *> - xmltexttemp="${xmlelement#*>}" - # Trim the longest match from the end for <* - xmltext="${xmltexttemp%%<*}" - - if [ "${replace}" ]; then - { - echo "${xmlelementindent}<${xmltag}>${replace}" >>"${fileoutput}" - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - matchlinefound="1" - - } - else - { - - if [ "${insertlinesskip}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -le "${insertlinesskip}" ]; then - { - if [ "${matchlinefound}" = "${insertlinesskip}" ]; then - { - arraysize=0 - while [ ${arraysize} -lt ${#array[@]} ]; - do - echo "${xmlelementindent}${array[${arraysize}]}" >>"${fileoutput}" - let arraysize="${arraysize}+1" - done - } - fi - } - fi - - if [ "${deletelines}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -lt $((${deletelines}+${deletelinesskip})) ] && [ "${matchlinefound}" -ge ${deletelinesskip} ]; then - { - : - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - - if [ "${matchlinefound}" -gt 0 ]; then - let matchlinefound="${matchlinefound}+1" - fi - - } - fi - } -done < "${fileinput}" - -IFS=${prefunctionifs} - -rm -f "${fileinput}" -} - -main "${1}" "${2}" "${3}" "${4}" +mkdir -p "${temp}/@VBIOS+Yes" \ No newline at end of file Index: branches/blackosx/trunk/package/Scripts/Advanced/GUI/postinstall =================================================================== --- branches/blackosx/trunk/package/Scripts/Advanced/GUI/postinstall (revision 206) +++ branches/blackosx/trunk/package/Scripts/Advanced/GUI/postinstall (revision 207) @@ -1,169 +1,9 @@ #!/bin/bash -# set com.apple.Boot.plist options +temp="/private/tmp/Chameleon" -overide="GUI" -string="No" - -main () -{ - - bootplist="${2}/.Chameleon/Extra/com.apple.Boot.plist" - systemplist="/Library/Preferences/SystemConfiguration/com.apple.Boot.plist" - - bootoptionshdextra[1]="${overide}" - bootoptionshdextra[2]="${string}" - - [ ! -d "${bootplist%/*}" ] && mkdir -p "${bootplist%/*}" - - if [ ! -f "${bootplist}" ]; then - if [ -f "${systemplist}" ]; then - cp "${systemplist}" "${bootplist}" - fi - fi - - xmlvalue=$( getxmlvalue ${overide} "${bootplist}" | tr "[:upper:]" "[:lower:]" ) - - case "${xmlvalue:0:1}" in - - y) echo "${overide}=y already set in ${bootplist} skipping." - ;; - - n) echo "${overide}=n is set in ${bootplist} leaving." - ;; - - *) echo "Adding ${overide}=${string} to ${bootplist}" - array=("${bootoptionshdextra[@]}") - searchfilereplaceline "${bootplist}" "Kernel Flags" "" "" "2" - ;; - esac - - chown "${USER}:20" "${bootplist}" -} - -getxmlvalue () -{ -# 1 xml key -# 2 xml file -if [ -f "${2}" ]; then - local value - while read value; do - if [ ! "${value}" = "${value/${1}/}" ]; then - read value - value="${value#*<}" ; value="<${value}" ; value="${value#*>}" ; value="${value# *}" ; value="${value%%<*}" - echo "$value" - break - fi - done < "${2}" +if [ -d ${temp} ]; then + mkdir ${temp}; fi -} -searchfilereplaceline () -{ - -mv "${1}" "${1}.orig" - -prefunctionifs="${IFS}" - -unset fileinput -unset fileoutput -unset find -unset replace -unset deletelines -unset deletelinesskip -unset insertlinesskip - -fileinput="${1}.orig" -fileoutput="${1}" -find="${2}" -replace="${3}" -deletelines="${4%,*}" -insertlinesskip="${5}" - -matchlinefound="0" - -if [ "${#4}" = "${4#*,}" ]; then - deletelinesskip="0" - else - deletelinesskip="${4#*,}" -fi - -IFS="\n" -while read line -do - { - if [ ! "${line}" = "${line/${find}/}" ]; then - { - # Trim the longest match from the end for <* - xmlelementindent="${line%%<*}" - - # Trim the longest match from the start for *< - xmlelementtemp="${line#*<}" - # Add back in stripped < - xmlelement="<${xmlelementtemp}" - - # Trim the shortest match from the start for < - xmltagtemp="${xmlelement#<}" - # Trim the longest match from the end for >* - xmltag="${xmltagtemp%%>*}" - - # Trim the shortest match from the start for *> - xmltexttemp="${xmlelement#*>}" - # Trim the longest match from the end for <* - xmltext="${xmltexttemp%%<*}" - - if [ "${replace}" ]; then - { - echo "${xmlelementindent}<${xmltag}>${replace}" >>"${fileoutput}" - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - matchlinefound="1" - - } - else - { - - if [ "${insertlinesskip}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -le "${insertlinesskip}" ]; then - { - if [ "${matchlinefound}" = "${insertlinesskip}" ]; then - { - arraysize=0 - while [ ${arraysize} -lt ${#array[@]} ]; - do - echo "${xmlelementindent}${array[${arraysize}]}" >>"${fileoutput}" - let arraysize="${arraysize}+1" - done - } - fi - } - fi - - if [ "${deletelines}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -lt $((${deletelines}+${deletelinesskip})) ] && [ "${matchlinefound}" -ge ${deletelinesskip} ]; then - { - : - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - - if [ "${matchlinefound}" -gt 0 ]; then - let matchlinefound="${matchlinefound}+1" - fi - - } - fi - } -done < "${fileinput}" - -IFS=${prefunctionifs} - -rm -f "${fileinput}" -} - -main "${1}" "${2}" "${3}" "${4}" +mkdir -p "${temp}/@GUI+No" \ No newline at end of file Index: branches/blackosx/trunk/package/Scripts/Advanced/SMBIOSdefaults/postinstall =================================================================== --- branches/blackosx/trunk/package/Scripts/Advanced/SMBIOSdefaults/postinstall (revision 206) +++ branches/blackosx/trunk/package/Scripts/Advanced/SMBIOSdefaults/postinstall (revision 207) @@ -1,169 +1,9 @@ #!/bin/bash -# set com.apple.Boot.plist options +temp="/private/tmp/Chameleon" -overide="SMBIOSdefault" -string="Yes" - -main () -{ - - bootplist="${2}/.Chameleon/Extra/com.apple.Boot.plist" - systemplist="/Library/Preferences/SystemConfiguration/com.apple.Boot.plist" - - bootoptionshdextra[1]="${overide}" - bootoptionshdextra[2]="${string}" - - [ ! -d "${bootplist%/*}" ] && mkdir -p "${bootplist%/*}" - - if [ ! -f "${bootplist}" ]; then - if [ -f "${systemplist}" ]; then - cp "${systemplist}" "${bootplist}" - fi - fi - - xmlvalue=$( getxmlvalue ${overide} "${bootplist}" | tr "[:upper:]" "[:lower:]" ) - - case "${xmlvalue:0:1}" in - - y) echo "${overide}=y already set in ${bootplist} skipping." - ;; - - n) echo "${overide}=n is set in ${bootplist} leaving." - ;; - - *) echo "Adding ${overide}=${string} to ${bootplist}" - array=("${bootoptionshdextra[@]}") - searchfilereplaceline "${bootplist}" "Kernel Flags" "" "" "2" - ;; - esac - - chown "${USER}:20" "${bootplist}" -} - -getxmlvalue () -{ -# 1 xml key -# 2 xml file -if [ -f "${2}" ]; then - local value - while read value; do - if [ ! "${value}" = "${value/${1}/}" ]; then - read value - value="${value#*<}" ; value="<${value}" ; value="${value#*>}" ; value="${value# *}" ; value="${value%%<*}" - echo "$value" - break - fi - done < "${2}" +if [ -d ${temp} ]; then + mkdir ${temp}; fi -} -searchfilereplaceline () -{ - -mv "${1}" "${1}.orig" - -prefunctionifs="${IFS}" - -unset fileinput -unset fileoutput -unset find -unset replace -unset deletelines -unset deletelinesskip -unset insertlinesskip - -fileinput="${1}.orig" -fileoutput="${1}" -find="${2}" -replace="${3}" -deletelines="${4%,*}" -insertlinesskip="${5}" - -matchlinefound="0" - -if [ "${#4}" = "${4#*,}" ]; then - deletelinesskip="0" - else - deletelinesskip="${4#*,}" -fi - -IFS="\n" -while read line -do - { - if [ ! "${line}" = "${line/${find}/}" ]; then - { - # Trim the longest match from the end for <* - xmlelementindent="${line%%<*}" - - # Trim the longest match from the start for *< - xmlelementtemp="${line#*<}" - # Add back in stripped < - xmlelement="<${xmlelementtemp}" - - # Trim the shortest match from the start for < - xmltagtemp="${xmlelement#<}" - # Trim the longest match from the end for >* - xmltag="${xmltagtemp%%>*}" - - # Trim the shortest match from the start for *> - xmltexttemp="${xmlelement#*>}" - # Trim the longest match from the end for <* - xmltext="${xmltexttemp%%<*}" - - if [ "${replace}" ]; then - { - echo "${xmlelementindent}<${xmltag}>${replace}" >>"${fileoutput}" - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - matchlinefound="1" - - } - else - { - - if [ "${insertlinesskip}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -le "${insertlinesskip}" ]; then - { - if [ "${matchlinefound}" = "${insertlinesskip}" ]; then - { - arraysize=0 - while [ ${arraysize} -lt ${#array[@]} ]; - do - echo "${xmlelementindent}${array[${arraysize}]}" >>"${fileoutput}" - let arraysize="${arraysize}+1" - done - } - fi - } - fi - - if [ "${deletelines}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -lt $((${deletelines}+${deletelinesskip})) ] && [ "${matchlinefound}" -ge ${deletelinesskip} ]; then - { - : - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - - if [ "${matchlinefound}" -gt 0 ]; then - let matchlinefound="${matchlinefound}+1" - fi - - } - fi - } -done < "${fileinput}" - -IFS=${prefunctionifs} - -rm -f "${fileinput}" -} - -main "${1}" "${2}" "${3}" "${4}" +mkdir -p "${temp}/@SMBIOSdefault+Yes" \ No newline at end of file Index: branches/blackosx/trunk/package/Scripts/Advanced/UseMemDetect/postinstall =================================================================== --- branches/blackosx/trunk/package/Scripts/Advanced/UseMemDetect/postinstall (revision 206) +++ branches/blackosx/trunk/package/Scripts/Advanced/UseMemDetect/postinstall (revision 207) @@ -1,169 +1,9 @@ #!/bin/bash -# set com.apple.Boot.plist options +temp="/private/tmp/Chameleon" -overide="UseMemDetect" -string="No" - -main () -{ - - bootplist="${2}/.Chameleon/Extra/com.apple.Boot.plist" - systemplist="/Library/Preferences/SystemConfiguration/com.apple.Boot.plist" - - bootoptionshdextra[1]="${overide}" - bootoptionshdextra[2]="${string}" - - [ ! -d "${bootplist%/*}" ] && mkdir -p "${bootplist%/*}" - - if [ ! -f "${bootplist}" ]; then - if [ -f "${systemplist}" ]; then - cp "${systemplist}" "${bootplist}" - fi - fi - - xmlvalue=$( getxmlvalue ${overide} "${bootplist}" | tr "[:upper:]" "[:lower:]" ) - - case "${xmlvalue:0:1}" in - - y) echo "${overide}=y already set in ${bootplist} skipping." - ;; - - n) echo "${overide}=n is set in ${bootplist} leaving." - ;; - - *) echo "Adding ${overide}=${string} to ${bootplist}" - array=("${bootoptionshdextra[@]}") - searchfilereplaceline "${bootplist}" "Kernel Flags" "" "" "2" - ;; - esac - - chown "${USER}:20" "${bootplist}" -} - -getxmlvalue () -{ -# 1 xml key -# 2 xml file -if [ -f "${2}" ]; then - local value - while read value; do - if [ ! "${value}" = "${value/${1}/}" ]; then - read value - value="${value#*<}" ; value="<${value}" ; value="${value#*>}" ; value="${value# *}" ; value="${value%%<*}" - echo "$value" - break - fi - done < "${2}" +if [ -d ${temp} ]; then + mkdir ${temp}; fi -} -searchfilereplaceline () -{ - -mv "${1}" "${1}.orig" - -prefunctionifs="${IFS}" - -unset fileinput -unset fileoutput -unset find -unset replace -unset deletelines -unset deletelinesskip -unset insertlinesskip - -fileinput="${1}.orig" -fileoutput="${1}" -find="${2}" -replace="${3}" -deletelines="${4%,*}" -insertlinesskip="${5}" - -matchlinefound="0" - -if [ "${#4}" = "${4#*,}" ]; then - deletelinesskip="0" - else - deletelinesskip="${4#*,}" -fi - -IFS="\n" -while read line -do - { - if [ ! "${line}" = "${line/${find}/}" ]; then - { - # Trim the longest match from the end for <* - xmlelementindent="${line%%<*}" - - # Trim the longest match from the start for *< - xmlelementtemp="${line#*<}" - # Add back in stripped < - xmlelement="<${xmlelementtemp}" - - # Trim the shortest match from the start for < - xmltagtemp="${xmlelement#<}" - # Trim the longest match from the end for >* - xmltag="${xmltagtemp%%>*}" - - # Trim the shortest match from the start for *> - xmltexttemp="${xmlelement#*>}" - # Trim the longest match from the end for <* - xmltext="${xmltexttemp%%<*}" - - if [ "${replace}" ]; then - { - echo "${xmlelementindent}<${xmltag}>${replace}" >>"${fileoutput}" - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - matchlinefound="1" - - } - else - { - - if [ "${insertlinesskip}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -le "${insertlinesskip}" ]; then - { - if [ "${matchlinefound}" = "${insertlinesskip}" ]; then - { - arraysize=0 - while [ ${arraysize} -lt ${#array[@]} ]; - do - echo "${xmlelementindent}${array[${arraysize}]}" >>"${fileoutput}" - let arraysize="${arraysize}+1" - done - } - fi - } - fi - - if [ "${deletelines}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -lt $((${deletelines}+${deletelinesskip})) ] && [ "${matchlinefound}" -ge ${deletelinesskip} ]; then - { - : - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - - if [ "${matchlinefound}" -gt 0 ]; then - let matchlinefound="${matchlinefound}+1" - fi - - } - fi - } -done < "${fileinput}" - -IFS=${prefunctionifs} - -rm -f "${fileinput}" -} - -main "${1}" "${2}" "${3}" "${4}" +mkdir -p "${temp}/@UseMemDetect+No" \ No newline at end of file Index: branches/blackosx/trunk/package/Scripts/Advanced/Wait/postinstall =================================================================== --- branches/blackosx/trunk/package/Scripts/Advanced/Wait/postinstall (revision 206) +++ branches/blackosx/trunk/package/Scripts/Advanced/Wait/postinstall (revision 207) @@ -1,169 +1,9 @@ #!/bin/bash -# set com.apple.Boot.plist options +temp="/private/tmp/Chameleon" -overide="Wait" -string="Yes" - -main () -{ - - bootplist="${2}/.Chameleon/Extra/com.apple.Boot.plist" - systemplist="/Library/Preferences/SystemConfiguration/com.apple.Boot.plist" - - bootoptionshdextra[1]="${overide}" - bootoptionshdextra[2]="${string}" - - [ ! -d "${bootplist%/*}" ] && mkdir -p "${bootplist%/*}" - - if [ ! -f "${bootplist}" ]; then - if [ -f "${systemplist}" ]; then - cp "${systemplist}" "${bootplist}" - fi - fi - - xmlvalue=$( getxmlvalue ${overide} "${bootplist}" | tr "[:upper:]" "[:lower:]" ) - - case "${xmlvalue:0:1}" in - - y) echo "${overide}=y already set in ${bootplist} skipping." - ;; - - n) echo "${overide}=n is set in ${bootplist} leaving." - ;; - - *) echo "Adding ${overide}=${string} to ${bootplist}" - array=("${bootoptionshdextra[@]}") - searchfilereplaceline "${bootplist}" "Kernel Flags" "" "" "2" - ;; - esac - - chown "${USER}:20" "${bootplist}" -} - -getxmlvalue () -{ -# 1 xml key -# 2 xml file -if [ -f "${2}" ]; then - local value - while read value; do - if [ ! "${value}" = "${value/${1}/}" ]; then - read value - value="${value#*<}" ; value="<${value}" ; value="${value#*>}" ; value="${value# *}" ; value="${value%%<*}" - echo "$value" - break - fi - done < "${2}" +if [ -d ${temp} ]; then + mkdir ${temp}; fi -} -searchfilereplaceline () -{ - -mv "${1}" "${1}.orig" - -prefunctionifs="${IFS}" - -unset fileinput -unset fileoutput -unset find -unset replace -unset deletelines -unset deletelinesskip -unset insertlinesskip - -fileinput="${1}.orig" -fileoutput="${1}" -find="${2}" -replace="${3}" -deletelines="${4%,*}" -insertlinesskip="${5}" - -matchlinefound="0" - -if [ "${#4}" = "${4#*,}" ]; then - deletelinesskip="0" - else - deletelinesskip="${4#*,}" -fi - -IFS="\n" -while read line -do - { - if [ ! "${line}" = "${line/${find}/}" ]; then - { - # Trim the longest match from the end for <* - xmlelementindent="${line%%<*}" - - # Trim the longest match from the start for *< - xmlelementtemp="${line#*<}" - # Add back in stripped < - xmlelement="<${xmlelementtemp}" - - # Trim the shortest match from the start for < - xmltagtemp="${xmlelement#<}" - # Trim the longest match from the end for >* - xmltag="${xmltagtemp%%>*}" - - # Trim the shortest match from the start for *> - xmltexttemp="${xmlelement#*>}" - # Trim the longest match from the end for <* - xmltext="${xmltexttemp%%<*}" - - if [ "${replace}" ]; then - { - echo "${xmlelementindent}<${xmltag}>${replace}" >>"${fileoutput}" - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - matchlinefound="1" - - } - else - { - - if [ "${insertlinesskip}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -le "${insertlinesskip}" ]; then - { - if [ "${matchlinefound}" = "${insertlinesskip}" ]; then - { - arraysize=0 - while [ ${arraysize} -lt ${#array[@]} ]; - do - echo "${xmlelementindent}${array[${arraysize}]}" >>"${fileoutput}" - let arraysize="${arraysize}+1" - done - } - fi - } - fi - - if [ "${deletelines}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -lt $((${deletelines}+${deletelinesskip})) ] && [ "${matchlinefound}" -ge ${deletelinesskip} ]; then - { - : - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - - if [ "${matchlinefound}" -gt 0 ]; then - let matchlinefound="${matchlinefound}+1" - fi - - } - fi - } -done < "${fileinput}" - -IFS=${prefunctionifs} - -rm -f "${fileinput}" -} - -main "${1}" "${2}" "${3}" "${4}" +mkdir -p "${temp}/@Wait+Yes" \ No newline at end of file Index: branches/blackosx/trunk/package/Scripts/Advanced/LegacyLogo/postinstall =================================================================== --- branches/blackosx/trunk/package/Scripts/Advanced/LegacyLogo/postinstall (revision 206) +++ branches/blackosx/trunk/package/Scripts/Advanced/LegacyLogo/postinstall (revision 207) @@ -1,169 +1,9 @@ #!/bin/bash -# set com.apple.Boot.plist options +temp="/private/tmp/Chameleon" -overide="LegacyLogo" -string="Yes" - -main () -{ - - bootplist="${2}/.Chameleon/Extra/com.apple.Boot.plist" - systemplist="/Library/Preferences/SystemConfiguration/com.apple.Boot.plist" - - bootoptionshdextra[1]="${overide}" - bootoptionshdextra[2]="${string}" - - [ ! -d "${bootplist%/*}" ] && mkdir -p "${bootplist%/*}" - - if [ ! -f "${bootplist}" ]; then - if [ -f "${systemplist}" ]; then - cp "${systemplist}" "${bootplist}" - fi - fi - - xmlvalue=$( getxmlvalue ${overide} "${bootplist}" | tr "[:upper:]" "[:lower:]" ) - - case "${xmlvalue:0:1}" in - - y) echo "${overide}=y already set in ${bootplist} skipping." - ;; - - n) echo "${overide}=n is set in ${bootplist} leaving." - ;; - - *) echo "Adding ${overide}=${string} to ${bootplist}" - array=("${bootoptionshdextra[@]}") - searchfilereplaceline "${bootplist}" "Kernel Flags" "" "" "2" - ;; - esac - - chown "${USER}:20" "${bootplist}" -} - -getxmlvalue () -{ -# 1 xml key -# 2 xml file -if [ -f "${2}" ]; then - local value - while read value; do - if [ ! "${value}" = "${value/${1}/}" ]; then - read value - value="${value#*<}" ; value="<${value}" ; value="${value#*>}" ; value="${value# *}" ; value="${value%%<*}" - echo "$value" - break - fi - done < "${2}" +if [ -d ${temp} ]; then + mkdir ${temp}; fi -} -searchfilereplaceline () -{ - -mv "${1}" "${1}.orig" - -prefunctionifs="${IFS}" - -unset fileinput -unset fileoutput -unset find -unset replace -unset deletelines -unset deletelinesskip -unset insertlinesskip - -fileinput="${1}.orig" -fileoutput="${1}" -find="${2}" -replace="${3}" -deletelines="${4%,*}" -insertlinesskip="${5}" - -matchlinefound="0" - -if [ "${#4}" = "${4#*,}" ]; then - deletelinesskip="0" - else - deletelinesskip="${4#*,}" -fi - -IFS="\n" -while read line -do - { - if [ ! "${line}" = "${line/${find}/}" ]; then - { - # Trim the longest match from the end for <* - xmlelementindent="${line%%<*}" - - # Trim the longest match from the start for *< - xmlelementtemp="${line#*<}" - # Add back in stripped < - xmlelement="<${xmlelementtemp}" - - # Trim the shortest match from the start for < - xmltagtemp="${xmlelement#<}" - # Trim the longest match from the end for >* - xmltag="${xmltagtemp%%>*}" - - # Trim the shortest match from the start for *> - xmltexttemp="${xmlelement#*>}" - # Trim the longest match from the end for <* - xmltext="${xmltexttemp%%<*}" - - if [ "${replace}" ]; then - { - echo "${xmlelementindent}<${xmltag}>${replace}" >>"${fileoutput}" - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - matchlinefound="1" - - } - else - { - - if [ "${insertlinesskip}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -le "${insertlinesskip}" ]; then - { - if [ "${matchlinefound}" = "${insertlinesskip}" ]; then - { - arraysize=0 - while [ ${arraysize} -lt ${#array[@]} ]; - do - echo "${xmlelementindent}${array[${arraysize}]}" >>"${fileoutput}" - let arraysize="${arraysize}+1" - done - } - fi - } - fi - - if [ "${deletelines}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -lt $((${deletelines}+${deletelinesskip})) ] && [ "${matchlinefound}" -ge ${deletelinesskip} ]; then - { - : - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - - if [ "${matchlinefound}" -gt 0 ]; then - let matchlinefound="${matchlinefound}+1" - fi - - } - fi - } -done < "${fileinput}" - -IFS=${prefunctionifs} - -rm -f "${fileinput}" -} - -main "${1}" "${2}" "${3}" "${4}" +mkdir -p "${temp}/@LegacyLogo+Yes" \ No newline at end of file Index: branches/blackosx/trunk/package/Scripts/Advanced/UseNvidiaROM/postinstall =================================================================== --- branches/blackosx/trunk/package/Scripts/Advanced/UseNvidiaROM/postinstall (revision 206) +++ branches/blackosx/trunk/package/Scripts/Advanced/UseNvidiaROM/postinstall (revision 207) @@ -1,169 +1,9 @@ #!/bin/bash -# set com.apple.Boot.plist options +temp="/private/tmp/Chameleon" -overide="UseNvidaROM" -string="Yes" - -main () -{ - - bootplist="${2}/.Chameleon/Extra/com.apple.Boot.plist" - systemplist="/Library/Preferences/SystemConfiguration/com.apple.Boot.plist" - - bootoptionshdextra[1]="${overide}" - bootoptionshdextra[2]="${string}" - - [ ! -d "${bootplist%/*}" ] && mkdir -p "${bootplist%/*}" - - if [ ! -f "${bootplist}" ]; then - if [ -f "${systemplist}" ]; then - cp "${systemplist}" "${bootplist}" - fi - fi - - xmlvalue=$( getxmlvalue ${overide} "${bootplist}" | tr "[:upper:]" "[:lower:]" ) - - case "${xmlvalue:0:1}" in - - y) echo "${overide}=y already set in ${bootplist} skipping." - ;; - - n) echo "${overide}=n is set in ${bootplist} leaving." - ;; - - *) echo "Adding ${overide}=${string} to ${bootplist}" - array=("${bootoptionshdextra[@]}") - searchfilereplaceline "${bootplist}" "Kernel Flags" "" "" "2" - ;; - esac - - chown "${USER}:20" "${bootplist}" -} - -getxmlvalue () -{ -# 1 xml key -# 2 xml file -if [ -f "${2}" ]; then - local value - while read value; do - if [ ! "${value}" = "${value/${1}/}" ]; then - read value - value="${value#*<}" ; value="<${value}" ; value="${value#*>}" ; value="${value# *}" ; value="${value%%<*}" - echo "$value" - break - fi - done < "${2}" +if [ -d ${temp} ]; then + mkdir ${temp}; fi -} -searchfilereplaceline () -{ - -mv "${1}" "${1}.orig" - -prefunctionifs="${IFS}" - -unset fileinput -unset fileoutput -unset find -unset replace -unset deletelines -unset deletelinesskip -unset insertlinesskip - -fileinput="${1}.orig" -fileoutput="${1}" -find="${2}" -replace="${3}" -deletelines="${4%,*}" -insertlinesskip="${5}" - -matchlinefound="0" - -if [ "${#4}" = "${4#*,}" ]; then - deletelinesskip="0" - else - deletelinesskip="${4#*,}" -fi - -IFS="\n" -while read line -do - { - if [ ! "${line}" = "${line/${find}/}" ]; then - { - # Trim the longest match from the end for <* - xmlelementindent="${line%%<*}" - - # Trim the longest match from the start for *< - xmlelementtemp="${line#*<}" - # Add back in stripped < - xmlelement="<${xmlelementtemp}" - - # Trim the shortest match from the start for < - xmltagtemp="${xmlelement#<}" - # Trim the longest match from the end for >* - xmltag="${xmltagtemp%%>*}" - - # Trim the shortest match from the start for *> - xmltexttemp="${xmlelement#*>}" - # Trim the longest match from the end for <* - xmltext="${xmltexttemp%%<*}" - - if [ "${replace}" ]; then - { - echo "${xmlelementindent}<${xmltag}>${replace}" >>"${fileoutput}" - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - matchlinefound="1" - - } - else - { - - if [ "${insertlinesskip}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -le "${insertlinesskip}" ]; then - { - if [ "${matchlinefound}" = "${insertlinesskip}" ]; then - { - arraysize=0 - while [ ${arraysize} -lt ${#array[@]} ]; - do - echo "${xmlelementindent}${array[${arraysize}]}" >>"${fileoutput}" - let arraysize="${arraysize}+1" - done - } - fi - } - fi - - if [ "${deletelines}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -lt $((${deletelines}+${deletelinesskip})) ] && [ "${matchlinefound}" -ge ${deletelinesskip} ]; then - { - : - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - - if [ "${matchlinefound}" -gt 0 ]; then - let matchlinefound="${matchlinefound}+1" - fi - - } - fi - } -done < "${fileinput}" - -IFS=${prefunctionifs} - -rm -f "${fileinput}" -} - -main "${1}" "${2}" "${3}" "${4}" +mkdir -p "${temp}/@UseNvidiaROM+Yes" \ No newline at end of file Index: branches/blackosx/trunk/package/Scripts/Advanced/ForceWake/postinstall =================================================================== --- branches/blackosx/trunk/package/Scripts/Advanced/ForceWake/postinstall (revision 206) +++ branches/blackosx/trunk/package/Scripts/Advanced/ForceWake/postinstall (revision 207) @@ -1,169 +1,9 @@ #!/bin/bash -# set com.apple.Boot.plist options +temp="/private/tmp/Chameleon" -overide="ForceWake" -string="Yes" - -main () -{ - - bootplist="${2}/.Chameleon/Extra/com.apple.Boot.plist" - systemplist="/Library/Preferences/SystemConfiguration/com.apple.Boot.plist" - - bootoptionshdextra[1]="${overide}" - bootoptionshdextra[2]="${string}" - - [ ! -d "${bootplist%/*}" ] && mkdir -p "${bootplist%/*}" - - if [ ! -f "${bootplist}" ]; then - if [ -f "${systemplist}" ]; then - cp -f "${systemplist}" "${bootplist}" - fi - fi - - xmlvalue=$( getxmlvalue ${overide} "${bootplist}" | tr "[:upper:]" "[:lower:]" ) - - case "${xmlvalue:0:1}" in - - y) echo "${overide}=y already set in ${bootplist} skipping." - ;; - - n) echo "${overide}=n is set in ${bootplist} leaving." - ;; - - *) echo "Adding ${overide}=y to ${bootplist}" - array=("${bootoptionshdextra[@]}") - searchfilereplaceline "${bootplist}" "Kernel Flags" "" "" "2" - ;; - esac - - chown "${USER}:20" "${bootplist}" -} - -getxmlvalue () -{ -# 1 xml key -# 2 xml file -if [ -f "${2}" ]; then - local value - while read value; do - if [ ! "${value}" = "${value/${1}/}" ]; then - read value - value="${value#*<}" ; value="<${value}" ; value="${value#*>}" ; value="${value# *}" ; value="${value%%<*}" - echo "$value" - break - fi - done < "${2}" +if [ -d ${temp} ]; then + mkdir ${temp}; fi -} -searchfilereplaceline () -{ - -mv "${1}" "${1}.orig" - -prefunctionifs="${IFS}" - -unset fileinput -unset fileoutput -unset find -unset replace -unset deletelines -unset deletelinesskip -unset insertlinesskip - -fileinput="${1}.orig" -fileoutput="${1}" -find="${2}" -replace="${3}" -deletelines="${4%,*}" -insertlinesskip="${5}" - -matchlinefound="0" - -if [ "${#4}" = "${4#*,}" ]; then - deletelinesskip="0" - else - deletelinesskip="${4#*,}" -fi - -IFS="\n" -while read line -do - { - if [ ! "${line}" = "${line/${find}/}" ]; then - { - # Trim the longest match from the end for <* - xmlelementindent="${line%%<*}" - - # Trim the longest match from the start for *< - xmlelementtemp="${line#*<}" - # Add back in stripped < - xmlelement="<${xmlelementtemp}" - - # Trim the shortest match from the start for < - xmltagtemp="${xmlelement#<}" - # Trim the longest match from the end for >* - xmltag="${xmltagtemp%%>*}" - - # Trim the shortest match from the start for *> - xmltexttemp="${xmlelement#*>}" - # Trim the longest match from the end for <* - xmltext="${xmltexttemp%%<*}" - - if [ "${replace}" ]; then - { - echo "${xmlelementindent}<${xmltag}>${replace}" >>"${fileoutput}" - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - matchlinefound="1" - - } - else - { - - if [ "${insertlinesskip}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -le "${insertlinesskip}" ]; then - { - if [ "${matchlinefound}" = "${insertlinesskip}" ]; then - { - arraysize=0 - while [ ${arraysize} -lt ${#array[@]} ]; - do - echo "${xmlelementindent}${array[${arraysize}]}" >>"${fileoutput}" - let arraysize="${arraysize}+1" - done - } - fi - } - fi - - if [ "${deletelines}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -lt $((${deletelines}+${deletelinesskip})) ] && [ "${matchlinefound}" -ge ${deletelinesskip} ]; then - { - : - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - - if [ "${matchlinefound}" -gt 0 ]; then - let matchlinefound="${matchlinefound}+1" - fi - - } - fi - } -done < "${fileinput}" - -IFS=${prefunctionifs} - -rm -f "${fileinput}" -} - -main "${1}" "${2}" "${3}" "${4}" +mkdir -p "${temp}/@ForceWake+Yes" \ No newline at end of file Index: branches/blackosx/trunk/package/Scripts/Advanced/Wake/postinstall =================================================================== --- branches/blackosx/trunk/package/Scripts/Advanced/Wake/postinstall (revision 206) +++ branches/blackosx/trunk/package/Scripts/Advanced/Wake/postinstall (revision 207) @@ -1,169 +1,9 @@ #!/bin/bash -# set com.apple.Boot.plist options +temp="/private/tmp/Chameleon" -overide="Wake" -string="Yes" - -main () -{ - - bootplist="${2}/.Chameleon/Extra/com.apple.Boot.plist" - systemplist="/Library/Preferences/SystemConfiguration/com.apple.Boot.plist" - - bootoptionshdextra[1]="${overide}" - bootoptionshdextra[2]="${string}" - - [ ! -d "${bootplist%/*}" ] && mkdir -p "${bootplist%/*}" - - if [ ! -f "${bootplist}" ]; then - if [ -f "${systemplist}" ]; then - cp "${systemplist}" "${bootplist}" - fi - fi - - xmlvalue=$( getxmlvalue ${overide} "${bootplist}" | tr "[:upper:]" "[:lower:]" ) - - case "${xmlvalue:0:1}" in - - y) echo "${overide}=y already set in ${bootplist} skipping." - ;; - - n) echo "${overide}=n is set in ${bootplist} leaving." - ;; - - *) echo "Adding ${overide}=${string} to ${bootplist}" - array=("${bootoptionshdextra[@]}") - searchfilereplaceline "${bootplist}" "Kernel Flags" "" "" "2" - ;; - esac - - chown "${USER}:20" "${bootplist}" -} - -getxmlvalue () -{ -# 1 xml key -# 2 xml file -if [ -f "${2}" ]; then - local value - while read value; do - if [ ! "${value}" = "${value/${1}/}" ]; then - read value - value="${value#*<}" ; value="<${value}" ; value="${value#*>}" ; value="${value# *}" ; value="${value%%<*}" - echo "$value" - break - fi - done < "${2}" +if [ -d ${temp} ]; then + mkdir ${temp}; fi -} -searchfilereplaceline () -{ - -mv "${1}" "${1}.orig" - -prefunctionifs="${IFS}" - -unset fileinput -unset fileoutput -unset find -unset replace -unset deletelines -unset deletelinesskip -unset insertlinesskip - -fileinput="${1}.orig" -fileoutput="${1}" -find="${2}" -replace="${3}" -deletelines="${4%,*}" -insertlinesskip="${5}" - -matchlinefound="0" - -if [ "${#4}" = "${4#*,}" ]; then - deletelinesskip="0" - else - deletelinesskip="${4#*,}" -fi - -IFS="\n" -while read line -do - { - if [ ! "${line}" = "${line/${find}/}" ]; then - { - # Trim the longest match from the end for <* - xmlelementindent="${line%%<*}" - - # Trim the longest match from the start for *< - xmlelementtemp="${line#*<}" - # Add back in stripped < - xmlelement="<${xmlelementtemp}" - - # Trim the shortest match from the start for < - xmltagtemp="${xmlelement#<}" - # Trim the longest match from the end for >* - xmltag="${xmltagtemp%%>*}" - - # Trim the shortest match from the start for *> - xmltexttemp="${xmlelement#*>}" - # Trim the longest match from the end for <* - xmltext="${xmltexttemp%%<*}" - - if [ "${replace}" ]; then - { - echo "${xmlelementindent}<${xmltag}>${replace}" >>"${fileoutput}" - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - matchlinefound="1" - - } - else - { - - if [ "${insertlinesskip}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -le "${insertlinesskip}" ]; then - { - if [ "${matchlinefound}" = "${insertlinesskip}" ]; then - { - arraysize=0 - while [ ${arraysize} -lt ${#array[@]} ]; - do - echo "${xmlelementindent}${array[${arraysize}]}" >>"${fileoutput}" - let arraysize="${arraysize}+1" - done - } - fi - } - fi - - if [ "${deletelines}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -lt $((${deletelines}+${deletelinesskip})) ] && [ "${matchlinefound}" -ge ${deletelinesskip} ]; then - { - : - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - - if [ "${matchlinefound}" -gt 0 ]; then - let matchlinefound="${matchlinefound}+1" - fi - - } - fi - } -done < "${fileinput}" - -IFS=${prefunctionifs} - -rm -f "${fileinput}" -} - -main "${1}" "${2}" "${3}" "${4}" +mkdir -p "${temp}/@Wake+Yes" \ No newline at end of file Index: branches/blackosx/trunk/package/Scripts/Advanced/UseAtiROM/postinstall =================================================================== --- branches/blackosx/trunk/package/Scripts/Advanced/UseAtiROM/postinstall (revision 206) +++ branches/blackosx/trunk/package/Scripts/Advanced/UseAtiROM/postinstall (revision 207) @@ -1,169 +1,9 @@ #!/bin/bash -# set com.apple.Boot.plist options +temp="/private/tmp/Chameleon" -overide="UseAtiROM" -string="Yes" - -main () -{ - - bootplist="${2}/.Chameleon/Extra/com.apple.Boot.plist" - systemplist="/Library/Preferences/SystemConfiguration/com.apple.Boot.plist" - - bootoptionshdextra[1]="${overide}" - bootoptionshdextra[2]="${string}" - - [ ! -d "${bootplist%/*}" ] && mkdir -p "${bootplist%/*}" - - if [ ! -f "${bootplist}" ]; then - if [ -f "${systemplist}" ]; then - cp "${systemplist}" "${bootplist}" - fi - fi - - xmlvalue=$( getxmlvalue ${overide} "${bootplist}" | tr "[:upper:]" "[:lower:]" ) - - case "${xmlvalue:0:1}" in - - y) echo "${overide}=y already set in ${bootplist} skipping." - ;; - - n) echo "${overide}=n is set in ${bootplist} leaving." - ;; - - *) echo "Adding ${overide}=${string} to ${bootplist}" - array=("${bootoptionshdextra[@]}") - searchfilereplaceline "${bootplist}" "Kernel Flags" "" "" "2" - ;; - esac - - chown "${USER}:20" "${bootplist}" -} - -getxmlvalue () -{ -# 1 xml key -# 2 xml file -if [ -f "${2}" ]; then - local value - while read value; do - if [ ! "${value}" = "${value/${1}/}" ]; then - read value - value="${value#*<}" ; value="<${value}" ; value="${value#*>}" ; value="${value# *}" ; value="${value%%<*}" - echo "$value" - break - fi - done < "${2}" +if [ -d ${temp} ]; then + mkdir ${temp}; fi -} -searchfilereplaceline () -{ - -mv "${1}" "${1}.orig" - -prefunctionifs="${IFS}" - -unset fileinput -unset fileoutput -unset find -unset replace -unset deletelines -unset deletelinesskip -unset insertlinesskip - -fileinput="${1}.orig" -fileoutput="${1}" -find="${2}" -replace="${3}" -deletelines="${4%,*}" -insertlinesskip="${5}" - -matchlinefound="0" - -if [ "${#4}" = "${4#*,}" ]; then - deletelinesskip="0" - else - deletelinesskip="${4#*,}" -fi - -IFS="\n" -while read line -do - { - if [ ! "${line}" = "${line/${find}/}" ]; then - { - # Trim the longest match from the end for <* - xmlelementindent="${line%%<*}" - - # Trim the longest match from the start for *< - xmlelementtemp="${line#*<}" - # Add back in stripped < - xmlelement="<${xmlelementtemp}" - - # Trim the shortest match from the start for < - xmltagtemp="${xmlelement#<}" - # Trim the longest match from the end for >* - xmltag="${xmltagtemp%%>*}" - - # Trim the shortest match from the start for *> - xmltexttemp="${xmlelement#*>}" - # Trim the longest match from the end for <* - xmltext="${xmltexttemp%%<*}" - - if [ "${replace}" ]; then - { - echo "${xmlelementindent}<${xmltag}>${replace}" >>"${fileoutput}" - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - matchlinefound="1" - - } - else - { - - if [ "${insertlinesskip}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -le "${insertlinesskip}" ]; then - { - if [ "${matchlinefound}" = "${insertlinesskip}" ]; then - { - arraysize=0 - while [ ${arraysize} -lt ${#array[@]} ]; - do - echo "${xmlelementindent}${array[${arraysize}]}" >>"${fileoutput}" - let arraysize="${arraysize}+1" - done - } - fi - } - fi - - if [ "${deletelines}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -lt $((${deletelines}+${deletelinesskip})) ] && [ "${matchlinefound}" -ge ${deletelinesskip} ]; then - { - : - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - - if [ "${matchlinefound}" -gt 0 ]; then - let matchlinefound="${matchlinefound}+1" - fi - - } - fi - } -done < "${fileinput}" - -IFS=${prefunctionifs} - -rm -f "${fileinput}" -} - -main "${1}" "${2}" "${3}" "${4}" +mkdir -p "${temp}/@UseAtiROM+Yes" \ No newline at end of file Index: branches/blackosx/trunk/package/Scripts/Advanced/BootBanner/postinstall =================================================================== --- branches/blackosx/trunk/package/Scripts/Advanced/BootBanner/postinstall (revision 206) +++ branches/blackosx/trunk/package/Scripts/Advanced/BootBanner/postinstall (revision 207) @@ -1,169 +1,9 @@ #!/bin/bash -# set com.apple.Boot.plist options +temp="/private/tmp/Chameleon" -overide="BootBanner" -string="No" - -main () -{ - - bootplist="${2}/.Chameleon/Extra/com.apple.Boot.plist" - systemplist="/Library/Preferences/SystemConfiguration/com.apple.Boot.plist" - - bootoptionshdextra[1]="${overide}" - bootoptionshdextra[2]="${string}" - - [ ! -d "${bootplist%/*}" ] && mkdir -p "${bootplist%/*}" - - if [ ! -f "${bootplist}" ]; then - if [ -f "${systemplist}" ]; then - cp "${systemplist}" "${bootplist}" - fi - fi - - xmlvalue=$( getxmlvalue ${overide} "${bootplist}" | tr "[:upper:]" "[:lower:]" ) - - case "${xmlvalue:0:1}" in - - y) echo "${overide}=y already set in ${bootplist} skipping." - ;; - - n) echo "${overide}=n is set in ${bootplist} leaving." - ;; - - *) echo "Adding ${overide}=${string} to ${bootplist}" - array=("${bootoptionshdextra[@]}") - searchfilereplaceline "${bootplist}" "Kernel Flags" "" "" "2" - ;; - esac - - chown "${USER}:20" "${bootplist}" -} - -getxmlvalue () -{ -# 1 xml key -# 2 xml file -if [ -f "${2}" ]; then - local value - while read value; do - if [ ! "${value}" = "${value/${1}/}" ]; then - read value - value="${value#*<}" ; value="<${value}" ; value="${value#*>}" ; value="${value# *}" ; value="${value%%<*}" - echo "$value" - break - fi - done < "${2}" +if [ -d ${temp} ]; then + mkdir ${temp}; fi -} -searchfilereplaceline () -{ - -mv "${1}" "${1}.orig" - -prefunctionifs="${IFS}" - -unset fileinput -unset fileoutput -unset find -unset replace -unset deletelines -unset deletelinesskip -unset insertlinesskip - -fileinput="${1}.orig" -fileoutput="${1}" -find="${2}" -replace="${3}" -deletelines="${4%,*}" -insertlinesskip="${5}" - -matchlinefound="0" - -if [ "${#4}" = "${4#*,}" ]; then - deletelinesskip="0" - else - deletelinesskip="${4#*,}" -fi - -IFS="\n" -while read line -do - { - if [ ! "${line}" = "${line/${find}/}" ]; then - { - # Trim the longest match from the end for <* - xmlelementindent="${line%%<*}" - - # Trim the longest match from the start for *< - xmlelementtemp="${line#*<}" - # Add back in stripped < - xmlelement="<${xmlelementtemp}" - - # Trim the shortest match from the start for < - xmltagtemp="${xmlelement#<}" - # Trim the longest match from the end for >* - xmltag="${xmltagtemp%%>*}" - - # Trim the shortest match from the start for *> - xmltexttemp="${xmlelement#*>}" - # Trim the longest match from the end for <* - xmltext="${xmltexttemp%%<*}" - - if [ "${replace}" ]; then - { - echo "${xmlelementindent}<${xmltag}>${replace}" >>"${fileoutput}" - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - matchlinefound="1" - - } - else - { - - if [ "${insertlinesskip}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -le "${insertlinesskip}" ]; then - { - if [ "${matchlinefound}" = "${insertlinesskip}" ]; then - { - arraysize=0 - while [ ${arraysize} -lt ${#array[@]} ]; - do - echo "${xmlelementindent}${array[${arraysize}]}" >>"${fileoutput}" - let arraysize="${arraysize}+1" - done - } - fi - } - fi - - if [ "${deletelines}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -lt $((${deletelines}+${deletelinesskip})) ] && [ "${matchlinefound}" -ge ${deletelinesskip} ]; then - { - : - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - - if [ "${matchlinefound}" -gt 0 ]; then - let matchlinefound="${matchlinefound}+1" - fi - - } - fi - } -done < "${fileinput}" - -IFS=${prefunctionifs} - -rm -f "${fileinput}" -} - -main "${1}" "${2}" "${3}" "${4}" +mkdir -p "${temp}/@BootBanner+No" \ No newline at end of file Index: branches/blackosx/trunk/package/Scripts/Advanced/QuietBoot/postinstall =================================================================== --- branches/blackosx/trunk/package/Scripts/Advanced/QuietBoot/postinstall (revision 206) +++ branches/blackosx/trunk/package/Scripts/Advanced/QuietBoot/postinstall (revision 207) @@ -1,169 +1,9 @@ #!/bin/bash -# set com.apple.Boot.plist options +temp="/private/tmp/Chameleon" -overide="QuietBoot" -string="Yes" - -main () -{ - - bootplist="${2}/.Chameleon/Extra/com.apple.Boot.plist" - systemplist="/Library/Preferences/SystemConfiguration/com.apple.Boot.plist" - - bootoptionshdextra[1]="${overide}" - bootoptionshdextra[2]="${string}" - - [ ! -d "${bootplist%/*}" ] && mkdir -p "${bootplist%/*}" - - if [ ! -f "${bootplist}" ]; then - if [ -f "${systemplist}" ]; then - cp "${systemplist}" "${bootplist}" - fi - fi - - xmlvalue=$( getxmlvalue ${overide} "${bootplist}" | tr "[:upper:]" "[:lower:]" ) - - case "${xmlvalue:0:1}" in - - y) echo "${overide}=y already set in ${bootplist} skipping." - ;; - - n) echo "${overide}=n is set in ${bootplist} leaving." - ;; - - *) echo "Adding ${overide}=${string} to ${bootplist}" - array=("${bootoptionshdextra[@]}") - searchfilereplaceline "${bootplist}" "Kernel Flags" "" "" "2" - ;; - esac - - chown "${USER}:20" "${bootplist}" -} - -getxmlvalue () -{ -# 1 xml key -# 2 xml file -if [ -f "${2}" ]; then - local value - while read value; do - if [ ! "${value}" = "${value/${1}/}" ]; then - read value - value="${value#*<}" ; value="<${value}" ; value="${value#*>}" ; value="${value# *}" ; value="${value%%<*}" - echo "$value" - break - fi - done < "${2}" +if [ -d ${temp} ]; then + mkdir ${temp}; fi -} -searchfilereplaceline () -{ - -mv "${1}" "${1}.orig" - -prefunctionifs="${IFS}" - -unset fileinput -unset fileoutput -unset find -unset replace -unset deletelines -unset deletelinesskip -unset insertlinesskip - -fileinput="${1}.orig" -fileoutput="${1}" -find="${2}" -replace="${3}" -deletelines="${4%,*}" -insertlinesskip="${5}" - -matchlinefound="0" - -if [ "${#4}" = "${4#*,}" ]; then - deletelinesskip="0" - else - deletelinesskip="${4#*,}" -fi - -IFS="\n" -while read line -do - { - if [ ! "${line}" = "${line/${find}/}" ]; then - { - # Trim the longest match from the end for <* - xmlelementindent="${line%%<*}" - - # Trim the longest match from the start for *< - xmlelementtemp="${line#*<}" - # Add back in stripped < - xmlelement="<${xmlelementtemp}" - - # Trim the shortest match from the start for < - xmltagtemp="${xmlelement#<}" - # Trim the longest match from the end for >* - xmltag="${xmltagtemp%%>*}" - - # Trim the shortest match from the start for *> - xmltexttemp="${xmlelement#*>}" - # Trim the longest match from the end for <* - xmltext="${xmltexttemp%%<*}" - - if [ "${replace}" ]; then - { - echo "${xmlelementindent}<${xmltag}>${replace}" >>"${fileoutput}" - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - matchlinefound="1" - - } - else - { - - if [ "${insertlinesskip}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -le "${insertlinesskip}" ]; then - { - if [ "${matchlinefound}" = "${insertlinesskip}" ]; then - { - arraysize=0 - while [ ${arraysize} -lt ${#array[@]} ]; - do - echo "${xmlelementindent}${array[${arraysize}]}" >>"${fileoutput}" - let arraysize="${arraysize}+1" - done - } - fi - } - fi - - if [ "${deletelines}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -lt $((${deletelines}+${deletelinesskip})) ] && [ "${matchlinefound}" -ge ${deletelinesskip} ]; then - { - : - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - - if [ "${matchlinefound}" -gt 0 ]; then - let matchlinefound="${matchlinefound}+1" - fi - - } - fi - } -done < "${fileinput}" - -IFS=${prefunctionifs} - -rm -f "${fileinput}" -} - -main "${1}" "${2}" "${3}" "${4}" +mkdir -p "${temp}/@QuietBoot+Yes" \ No newline at end of file Index: branches/blackosx/trunk/package/Scripts/Advanced/UHCIreset/postinstall =================================================================== --- branches/blackosx/trunk/package/Scripts/Advanced/UHCIreset/postinstall (revision 206) +++ branches/blackosx/trunk/package/Scripts/Advanced/UHCIreset/postinstall (revision 207) @@ -1,169 +1,9 @@ #!/bin/bash -# set com.apple.Boot.plist options +temp="/private/tmp/Chameleon" -overide="UHCIreset" -string="Yes" - -main () -{ - - bootplist="${2}/.Chameleon/Extra/com.apple.Boot.plist" - systemplist="/Library/Preferences/SystemConfiguration/com.apple.Boot.plist" - - bootoptionshdextra[1]="${overide}" - bootoptionshdextra[2]="${string}" - - [ ! -d "${bootplist%/*}" ] && mkdir -p "${bootplist%/*}" - - if [ ! -f "${bootplist}" ]; then - if [ -f "${systemplist}" ]; then - cp "${systemplist}" "${bootplist}" - fi - fi - - xmlvalue=$( getxmlvalue ${overide} "${bootplist}" | tr "[:upper:]" "[:lower:]" ) - - case "${xmlvalue:0:1}" in - - y) echo "${overide}=y already set in ${bootplist} skipping." - ;; - - n) echo "${overide}=n is set in ${bootplist} leaving." - ;; - - *) echo "Adding ${overide}=y to ${bootplist}" - array=("${bootoptionshdextra[@]}") - searchfilereplaceline "${bootplist}" "Kernel Flags" "" "" "2" - ;; - esac - - chown "${USER}:20" "${bootplist}" -} - -getxmlvalue () -{ -# 1 xml key -# 2 xml file -if [ -f "${2}" ]; then - local value - while read value; do - if [ ! "${value}" = "${value/${1}/}" ]; then - read value - value="${value#*<}" ; value="<${value}" ; value="${value#*>}" ; value="${value# *}" ; value="${value%%<*}" - echo "$value" - break - fi - done < "${2}" +if [ -d ${temp} ]; then + mkdir ${temp}; fi -} -searchfilereplaceline () -{ - -mv "${1}" "${1}.orig" - -prefunctionifs="${IFS}" - -unset fileinput -unset fileoutput -unset find -unset replace -unset deletelines -unset deletelinesskip -unset insertlinesskip - -fileinput="${1}.orig" -fileoutput="${1}" -find="${2}" -replace="${3}" -deletelines="${4%,*}" -insertlinesskip="${5}" - -matchlinefound="0" - -if [ "${#4}" = "${4#*,}" ]; then - deletelinesskip="0" - else - deletelinesskip="${4#*,}" -fi - -IFS="\n" -while read line -do - { - if [ ! "${line}" = "${line/${find}/}" ]; then - { - # Trim the longest match from the end for <* - xmlelementindent="${line%%<*}" - - # Trim the longest match from the start for *< - xmlelementtemp="${line#*<}" - # Add back in stripped < - xmlelement="<${xmlelementtemp}" - - # Trim the shortest match from the start for < - xmltagtemp="${xmlelement#<}" - # Trim the longest match from the end for >* - xmltag="${xmltagtemp%%>*}" - - # Trim the shortest match from the start for *> - xmltexttemp="${xmlelement#*>}" - # Trim the longest match from the end for <* - xmltext="${xmltexttemp%%<*}" - - if [ "${replace}" ]; then - { - echo "${xmlelementindent}<${xmltag}>${replace}" >>"${fileoutput}" - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - matchlinefound="1" - - } - else - { - - if [ "${insertlinesskip}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -le "${insertlinesskip}" ]; then - { - if [ "${matchlinefound}" = "${insertlinesskip}" ]; then - { - arraysize=0 - while [ ${arraysize} -lt ${#array[@]} ]; - do - echo "${xmlelementindent}${array[${arraysize}]}" >>"${fileoutput}" - let arraysize="${arraysize}+1" - done - } - fi - } - fi - - if [ "${deletelines}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -lt $((${deletelines}+${deletelinesskip})) ] && [ "${matchlinefound}" -ge ${deletelinesskip} ]; then - { - : - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - - if [ "${matchlinefound}" -gt 0 ]; then - let matchlinefound="${matchlinefound}+1" - fi - - } - fi - } -done < "${fileinput}" - -IFS=${prefunctionifs} - -rm -f "${fileinput}" -} - -main "${1}" "${2}" "${3}" "${4}" +mkdir -p "${temp}/@UHCIreset+Yes" \ No newline at end of file Index: branches/blackosx/trunk/package/Scripts/Post/postinstall =================================================================== --- branches/blackosx/trunk/package/Scripts/Post/postinstall (revision 206) +++ branches/blackosx/trunk/package/Scripts/Post/postinstall (revision 207) @@ -1,5 +1,209 @@ #!/bin/bash +main () +{ + echo "===============================================" + echo "set com.apple.Boot.plist options" + echo "****************************************" + + temp="/private/tmp/Chameleon" + echo "Temp is ${temp}" + + cd ${temp} + Dirlist=$(find . -type d | grep "/") + for directory in $Dirlist ; do + overide=$(echo $directory | sed 's/_/ /g' | tr -d "./@" |cut -d '+' -f1) + string=$(echo $directory | tr -d "./@" |cut -d'+' -f2) + + bootplist="${3}/.Chameleon/Extra/com.apple.Boot.plist" + echo "bootplist = ${bootplist}" + + systemplist="/Library/Preferences/SystemConfiguration/com.apple.Boot.plist" + echo "systemplist= ${systemplist}" + echo "" + + bootoptionshdextra[1]="${overide}" + bootoptionshdextra[2]="${string}" + echo "bootoptionshdextra 1 = ${bootoptionshdextra[1]}" + echo "bootoptionshdextra 2= ${bootoptionshdextra[2]}" + echo "" + + echo "if no directory exists named ${bootplist%/*} then mkdir ${bootplist%/*}" + echo "" + [ ! -d "${bootplist%/*}" ] && mkdir -p "${bootplist%/*}" + + echo "if ${bootplist} doesn't exist" + echo "" + if [ ! -f "${bootplist}" ]; then + echo "if ${systemplist} doesn't exist" + echo "" + if [ -f "${systemplist}" ]; then + echo "copy ${systemplist} to ${systemplist}" + echo "" + cp "${systemplist}" "${bootplist}" + fi + fi + + xmlvalue=$( getxmlvalue ${overide} "${bootplist}" | tr "[:upper:]" "[:lower:]" ) + echo "xmlvalue = ${xmlvalue}" + echo "" + + case "${xmlvalue:0:1}" in + + y) echo "${overide}=y already set in ${bootplist} skipping." + echo "" + ;; + + n) echo "${overide}=n is set in ${bootplist} leaving." + echo "" + ;; + + *) echo "Adding ${overide}=${string} to ${bootplist}" + array=("${bootoptionshdextra[@]}") + searchfilereplaceline "${bootplist}" "Kernel Flags" "" "" "2" + echo "" + ;; + esac + + echo "set owner privileges for ${bootplist}" + chown "${USER}:20" "${bootplist}" + done +} + +getxmlvalue () +{ +# 1 xml key +# 2 xml file +if [ -f "${2}" ]; then + local value + while read value; do + if [ ! "${value}" = "${value/${1}/}" ]; then + read value + value="${value#*<}" ; value="<${value}" ; value="${value#*>}" ; value="${value# *}" ; value="${value%%<*}" + echo "$value" + break + fi + done < "${2}" +fi +} + +searchfilereplaceline () +{ + +mv "${1}" "${1}.orig" + +prefunctionifs="${IFS}" + +unset fileinput +unset fileoutput +unset find +unset replace +unset deletelines +unset deletelinesskip +unset insertlinesskip + +fileinput="${1}.orig" +fileoutput="${1}" +find="${2}" +replace="${3}" +deletelines="${4%,*}" +insertlinesskip="${5}" + +matchlinefound="0" + +if [ "${#4}" = "${4#*,}" ]; then + deletelinesskip="0" + else + deletelinesskip="${4#*,}" +fi + +IFS="\n" +while read line +do + { + if [ ! "${line}" = "${line/${find}/}" ]; then + { + # Trim the longest match from the end for <* + xmlelementindent="${line%%<*}" + + # Trim the longest match from the start for *< + xmlelementtemp="${line#*<}" + # Add back in stripped < + xmlelement="<${xmlelementtemp}" + + # Trim the shortest match from the start for < + xmltagtemp="${xmlelement#<}" + # Trim the longest match from the end for >* + xmltag="${xmltagtemp%%>*}" + + # Trim the shortest match from the start for *> + xmltexttemp="${xmlelement#*>}" + # Trim the longest match from the end for <* + xmltext="${xmltexttemp%%<*}" + + if [ "${replace}" ]; then + { + echo "${xmlelementindent}<${xmltag}>${replace}" >>"${fileoutput}" + } + else + { + echo "${line}" >>"${fileoutput}" + } + fi + matchlinefound="1" + + } + else + { + + if [ "${insertlinesskip}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -le "${insertlinesskip}" ]; then + { + if [ "${matchlinefound}" = "${insertlinesskip}" ]; then + { + arraysize=0 + while [ ${arraysize} -lt ${#array[@]} ]; + do + echo "${xmlelementindent}${array[${arraysize}]}" >>"${fileoutput}" + let arraysize="${arraysize}+1" + done + } + fi + } + fi + + if [ "${deletelines}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -lt $((${deletelines}+${deletelinesskip})) ] && [ "${matchlinefound}" -ge ${deletelinesskip} ]; then + { + : + } + else + { + echo "${line}" >>"${fileoutput}" + } + fi + + if [ "${matchlinefound}" -gt 0 ]; then + let matchlinefound="${matchlinefound}+1" + fi + + } + fi + } +done < "${fileinput}" + +IFS=${prefunctionifs} + +rm -f "${fileinput}" +} + + +echo "===============================================" +echo "Post Script" +echo "***********" +echo "" +echo "" + +main "${1}" "${2}" "${3}" "${4}" + temp="/private/tmp/Chameleon" #source com.apple.boot.plist @@ -9,12 +213,26 @@ fi fi -# fix kext permissions + + +echo "===============================================" +echo "Fix Kext Permissions" +echo "********************" + find "${2}/.Chameleon/Extra/Extensions" -type f -exec chmod 644 {} \; find "${2}/.Chameleon/Extra/Extensions" -type d -exec chmod 755 {} \; chown -R 0:0 "${2}/.Chameleon/Extra/Extensions" -# build mkext for extras +echo "-----------------------------------------------" +echo "" +echo "" + + + +echo "===============================================" +echo "Build mkext for Extras" +echo "**********************" + [ -d "${temp}" ] && rm -R -f "${temp}" mkdir -p "${temp}/Extensions" ditto --noextattr --noqtn --arch i386 "${2}/.Chameleon/Extra/Extensions" "${temp}/Extensions" @@ -24,17 +242,58 @@ kextcache -m "${temp}/Extensions.mkext" "${temp}/Extensions" cp -f "${temp}/Extensions.mkext" "${2}/.Chameleon/Extra" #cp -f "${temp}/Extensions.mkext" "${2}/Extra" -rm -f -R "${temp}" -# Check efi partition +echo "-----------------------------------------------" +echo "" +echo "" + + + +echo "===============================================" +echo "Removing Temporary Chameleon Directory" +echo "**************************************" + +#rm -f -R "${temp}" + +echo "-----------------------------------------------" +echo "" +echo "" + + + +echo "===============================================" +echo "Are there any EFI partitions mounted?" +echo "*************************************" + if [ -d /Volumes/EFI ]; then -# remove link for extras install -#unlink -r "${2}/.Chameleon" + echo "Yes.." + echo "" - cp -R -f "${2}/.Chameleon/Extra" /Volumes/EFI/ - umount -f /Volumes/EFI - rm -R -f /Volumes/EFI + # remove link for extras install + #unlink -r "${2}/.Chameleon" + #cp -R -f "${2}/.Chameleon/Extra" /Volumes/EFI/ + + echo "===============================================" + echo "Unmount all EFI partitions" + echo "**************************" + + # loop through and un-mount all mounted EFI partitions - Thanks kizwan + attempts=1 + while [ "$( df | grep EFI )" ] && [ "${attempts}" -lt 5 ]; do + echo "Unmounting $( df | grep EFI | awk '{print $1}' )" + umount -f $( df | grep EFI | awk '{print $1}' ) + attempts=$(( ${attempts} + 1 )) + done + if [ ${attempts} != 5 ]; then + rm -R -f /Volumes/EFI + else + echo "failed to unmount EFI partitions." + fi + echo "-----------------------------------------------" + echo "" + echo "" + rm -R -f "${2}/.Chameleon" fi Index: branches/blackosx/trunk/package/Scripts/BaseOptions/GenerateCStates/postinstall =================================================================== --- branches/blackosx/trunk/package/Scripts/BaseOptions/GenerateCStates/postinstall (revision 206) +++ branches/blackosx/trunk/package/Scripts/BaseOptions/GenerateCStates/postinstall (revision 207) @@ -1,169 +1,9 @@ #!/bin/bash -# set com.apple.Boot.plist options +temp="/private/tmp/Chameleon" -overide="GenerateCStates" -string="Yes" - -main () -{ - - bootplist="${2}/.Chameleon/Extra/com.apple.Boot.plist" - systemplist="/Library/Preferences/SystemConfiguration/com.apple.Boot.plist" - - bootoptionshdextra[1]="${overide}" - bootoptionshdextra[2]="${string}" - - [ ! -d "${bootplist%/*}" ] && mkdir -p "${bootplist%/*}" - - if [ ! -f "${bootplist}" ]; then - if [ -f "${systemplist}" ]; then - cp "${systemplist}" "${bootplist}" - fi - fi - - xmlvalue=$( getxmlvalue ${overide} "${bootplist}" | tr "[:upper:]" "[:lower:]" ) - - case "${xmlvalue:0:1}" in - - y) echo "${overide}=y already set in ${bootplist} skipping." - ;; - - n) echo "${overide}=n is set in ${bootplist} leaving." - ;; - - *) echo "Adding ${overide}=${string} to ${bootplist}" - array=("${bootoptionshdextra[@]}") - searchfilereplaceline "${bootplist}" "Kernel Flags" "" "" "2" - ;; - esac - - chown "${USER}:20" "${bootplist}" -} - -getxmlvalue () -{ -# 1 xml key -# 2 xml file -if [ -f "${2}" ]; then - local value - while read value; do - if [ ! "${value}" = "${value/${1}/}" ]; then - read value - value="${value#*<}" ; value="<${value}" ; value="${value#*>}" ; value="${value# *}" ; value="${value%%<*}" - echo "$value" - break - fi - done < "${2}" +if [ -d ${temp} ]; then + mkdir ${temp}; fi -} -searchfilereplaceline () -{ - -mv "${1}" "${1}.orig" - -prefunctionifs="${IFS}" - -unset fileinput -unset fileoutput -unset find -unset replace -unset deletelines -unset deletelinesskip -unset insertlinesskip - -fileinput="${1}.orig" -fileoutput="${1}" -find="${2}" -replace="${3}" -deletelines="${4%,*}" -insertlinesskip="${5}" - -matchlinefound="0" - -if [ "${#4}" = "${4#*,}" ]; then - deletelinesskip="0" - else - deletelinesskip="${4#*,}" -fi - -IFS="\n" -while read line -do - { - if [ ! "${line}" = "${line/${find}/}" ]; then - { - # Trim the longest match from the end for <* - xmlelementindent="${line%%<*}" - - # Trim the longest match from the start for *< - xmlelementtemp="${line#*<}" - # Add back in stripped < - xmlelement="<${xmlelementtemp}" - - # Trim the shortest match from the start for < - xmltagtemp="${xmlelement#<}" - # Trim the longest match from the end for >* - xmltag="${xmltagtemp%%>*}" - - # Trim the shortest match from the start for *> - xmltexttemp="${xmlelement#*>}" - # Trim the longest match from the end for <* - xmltext="${xmltexttemp%%<*}" - - if [ "${replace}" ]; then - { - echo "${xmlelementindent}<${xmltag}>${replace}" >>"${fileoutput}" - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - matchlinefound="1" - - } - else - { - - if [ "${insertlinesskip}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -le "${insertlinesskip}" ]; then - { - if [ "${matchlinefound}" = "${insertlinesskip}" ]; then - { - arraysize=0 - while [ ${arraysize} -lt ${#array[@]} ]; - do - echo "${xmlelementindent}${array[${arraysize}]}" >>"${fileoutput}" - let arraysize="${arraysize}+1" - done - } - fi - } - fi - - if [ "${deletelines}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -lt $((${deletelines}+${deletelinesskip})) ] && [ "${matchlinefound}" -ge ${deletelinesskip} ]; then - { - : - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - - if [ "${matchlinefound}" -gt 0 ]; then - let matchlinefound="${matchlinefound}+1" - fi - - } - fi - } -done < "${fileinput}" - -IFS=${prefunctionifs} - -rm -f "${fileinput}" -} - -main "${1}" "${2}" "${3}" "${4}" +mkdir -p "${temp}/@GenerateCStates+Yes" \ No newline at end of file Index: branches/blackosx/trunk/package/Scripts/BaseOptions/DropSSDT/postinstall =================================================================== --- branches/blackosx/trunk/package/Scripts/BaseOptions/DropSSDT/postinstall (revision 206) +++ branches/blackosx/trunk/package/Scripts/BaseOptions/DropSSDT/postinstall (revision 207) @@ -1,169 +1,9 @@ #!/bin/bash -# set com.apple.Boot.plist options +temp="/private/tmp/Chameleon" -overide="DropSSDT" -string="Yes" - -main () -{ - - bootplist="${2}/.Chameleon/Extra/com.apple.Boot.plist" - systemplist="/Library/Preferences/SystemConfiguration/com.apple.Boot.plist" - - bootoptionshdextra[1]="${overide}" - bootoptionshdextra[2]="${string}" - - [ ! -d "${bootplist%/*}" ] && mkdir -p "${bootplist%/*}" - - if [ ! -f "${bootplist}" ]; then - if [ -f "${systemplist}" ]; then - cp "${systemplist}" "${bootplist}" - fi - fi - - xmlvalue=$( getxmlvalue ${overide} "${bootplist}" | tr "[:upper:]" "[:lower:]" ) - - case "${xmlvalue:0:1}" in - - y) echo "${overide}=y already set in ${bootplist} skipping." - ;; - - n) echo "${overide}=n is set in ${bootplist} leaving." - ;; - - *) echo "Adding ${overide}=${string} to ${bootplist}" - array=("${bootoptionshdextra[@]}") - searchfilereplaceline "${bootplist}" "Kernel Flags" "" "" "2" - ;; - esac - - chown "${USER}:20" "${bootplist}" -} - -getxmlvalue () -{ -# 1 xml key -# 2 xml file -if [ -f "${2}" ]; then - local value - while read value; do - if [ ! "${value}" = "${value/${1}/}" ]; then - read value - value="${value#*<}" ; value="<${value}" ; value="${value#*>}" ; value="${value# *}" ; value="${value%%<*}" - echo "$value" - break - fi - done < "${2}" +if [ -d ${temp} ]; then + mkdir ${temp}; fi -} -searchfilereplaceline () -{ - -mv "${1}" "${1}.orig" - -prefunctionifs="${IFS}" - -unset fileinput -unset fileoutput -unset find -unset replace -unset deletelines -unset deletelinesskip -unset insertlinesskip - -fileinput="${1}.orig" -fileoutput="${1}" -find="${2}" -replace="${3}" -deletelines="${4%,*}" -insertlinesskip="${5}" - -matchlinefound="0" - -if [ "${#4}" = "${4#*,}" ]; then - deletelinesskip="0" - else - deletelinesskip="${4#*,}" -fi - -IFS="\n" -while read line -do - { - if [ ! "${line}" = "${line/${find}/}" ]; then - { - # Trim the longest match from the end for <* - xmlelementindent="${line%%<*}" - - # Trim the longest match from the start for *< - xmlelementtemp="${line#*<}" - # Add back in stripped < - xmlelement="<${xmlelementtemp}" - - # Trim the shortest match from the start for < - xmltagtemp="${xmlelement#<}" - # Trim the longest match from the end for >* - xmltag="${xmltagtemp%%>*}" - - # Trim the shortest match from the start for *> - xmltexttemp="${xmlelement#*>}" - # Trim the longest match from the end for <* - xmltext="${xmltexttemp%%<*}" - - if [ "${replace}" ]; then - { - echo "${xmlelementindent}<${xmltag}>${replace}" >>"${fileoutput}" - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - matchlinefound="1" - - } - else - { - - if [ "${insertlinesskip}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -le "${insertlinesskip}" ]; then - { - if [ "${matchlinefound}" = "${insertlinesskip}" ]; then - { - arraysize=0 - while [ ${arraysize} -lt ${#array[@]} ]; - do - echo "${xmlelementindent}${array[${arraysize}]}" >>"${fileoutput}" - let arraysize="${arraysize}+1" - done - } - fi - } - fi - - if [ "${deletelines}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -lt $((${deletelines}+${deletelinesskip})) ] && [ "${matchlinefound}" -ge ${deletelinesskip} ]; then - { - : - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - - if [ "${matchlinefound}" -gt 0 ]; then - let matchlinefound="${matchlinefound}+1" - fi - - } - fi - } -done < "${fileinput}" - -IFS=${prefunctionifs} - -rm -f "${fileinput}" -} - -main "${1}" "${2}" "${3}" "${4}" +mkdir -p "${temp}/@DropSSDT+Yes" \ No newline at end of file Index: branches/blackosx/trunk/package/Scripts/BaseOptions/EthernetBuiltIn/postinstall =================================================================== --- branches/blackosx/trunk/package/Scripts/BaseOptions/EthernetBuiltIn/postinstall (revision 206) +++ branches/blackosx/trunk/package/Scripts/BaseOptions/EthernetBuiltIn/postinstall (revision 207) @@ -1,169 +1,9 @@ #!/bin/bash -# set com.apple.Boot.plist options +temp="/private/tmp/Chameleon" -overide="EthernetBuiltIn" -string="Yes" - -main () -{ - - bootplist="${2}/.Chameleon/Extra/com.apple.Boot.plist" - systemplist="/Library/Preferences/SystemConfiguration/com.apple.Boot.plist" - - bootoptionshdextra[1]="${overide}" - bootoptionshdextra[2]="${string}" - - [ ! -d "${bootplist%/*}" ] && mkdir -p "${bootplist%/*}" - - if [ ! -f "${bootplist}" ]; then - if [ -f "${systemplist}" ]; then - cp -f "${systemplist}" "${bootplist}" - fi - fi - - xmlvalue=$( getxmlvalue ${overide} "${bootplist}" | tr "[:upper:]" "[:lower:]" ) - - case "${xmlvalue:0:1}" in - - y) echo "${overide}=y already set in ${bootplist} skipping." - ;; - - n) echo "${overide}=n is set in ${bootplist} leaving." - ;; - - *) echo "Adding ${overide}=y to ${bootplist}" - array=("${bootoptionshdextra[@]}") - searchfilereplaceline "${bootplist}" "Kernel Flags" "" "" "2" - ;; - esac - - chown "${USER}:20" "${bootplist}" -} - -getxmlvalue () -{ -# 1 xml key -# 2 xml file -if [ -f "${2}" ]; then - local value - while read value; do - if [ ! "${value}" = "${value/${1}/}" ]; then - read value - value="${value#*<}" ; value="<${value}" ; value="${value#*>}" ; value="${value# *}" ; value="${value%%<*}" - echo "$value" - break - fi - done < "${2}" +if [ -d ${temp} ]; then + mkdir ${temp}; fi -} -searchfilereplaceline () -{ - -mv "${1}" "${1}.orig" - -prefunctionifs="${IFS}" - -unset fileinput -unset fileoutput -unset find -unset replace -unset deletelines -unset deletelinesskip -unset insertlinesskip - -fileinput="${1}.orig" -fileoutput="${1}" -find="${2}" -replace="${3}" -deletelines="${4%,*}" -insertlinesskip="${5}" - -matchlinefound="0" - -if [ "${#4}" = "${4#*,}" ]; then - deletelinesskip="0" - else - deletelinesskip="${4#*,}" -fi - -IFS="\n" -while read line -do - { - if [ ! "${line}" = "${line/${find}/}" ]; then - { - # Trim the longest match from the end for <* - xmlelementindent="${line%%<*}" - - # Trim the longest match from the start for *< - xmlelementtemp="${line#*<}" - # Add back in stripped < - xmlelement="<${xmlelementtemp}" - - # Trim the shortest match from the start for < - xmltagtemp="${xmlelement#<}" - # Trim the longest match from the end for >* - xmltag="${xmltagtemp%%>*}" - - # Trim the shortest match from the start for *> - xmltexttemp="${xmlelement#*>}" - # Trim the longest match from the end for <* - xmltext="${xmltexttemp%%<*}" - - if [ "${replace}" ]; then - { - echo "${xmlelementindent}<${xmltag}>${replace}" >>"${fileoutput}" - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - matchlinefound="1" - - } - else - { - - if [ "${insertlinesskip}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -le "${insertlinesskip}" ]; then - { - if [ "${matchlinefound}" = "${insertlinesskip}" ]; then - { - arraysize=0 - while [ ${arraysize} -lt ${#array[@]} ]; - do - echo "${xmlelementindent}${array[${arraysize}]}" >>"${fileoutput}" - let arraysize="${arraysize}+1" - done - } - fi - } - fi - - if [ "${deletelines}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -lt $((${deletelines}+${deletelinesskip})) ] && [ "${matchlinefound}" -ge ${deletelinesskip} ]; then - { - : - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - - if [ "${matchlinefound}" -gt 0 ]; then - let matchlinefound="${matchlinefound}+1" - fi - - } - fi - } -done < "${fileinput}" - -IFS=${prefunctionifs} - -rm -f "${fileinput}" -} - -main "${1}" "${2}" "${3}" "${4}" +mkdir -p "${temp}/@EthernetBuiltIn+Yes" \ No newline at end of file Index: branches/blackosx/trunk/package/Scripts/BaseOptions/InstantMenu/postinstall =================================================================== --- branches/blackosx/trunk/package/Scripts/BaseOptions/InstantMenu/postinstall (revision 206) +++ branches/blackosx/trunk/package/Scripts/BaseOptions/InstantMenu/postinstall (revision 207) @@ -1,169 +1,9 @@ #!/bin/bash -# set com.apple.Boot.plist options +temp="/private/tmp/Chameleon" -overide="InstantMenu" -string="Yes" - -main () -{ - - bootplist="${2}/.Chameleon/Extra/com.apple.Boot.plist" - systemplist="/Library/Preferences/SystemConfiguration/com.apple.Boot.plist" - - bootoptionshdextra[1]="${overide}" - bootoptionshdextra[2]="${string}" - - [ ! -d "${bootplist%/*}" ] && mkdir -p "${bootplist%/*}" - - if [ ! -f "${bootplist}" ]; then - if [ -f "${systemplist}" ]; then - cp "${systemplist}" "${bootplist}" - fi - fi - - xmlvalue=$( getxmlvalue ${overide} "${bootplist}" | tr "[:upper:]" "[:lower:]" ) - - case "${xmlvalue:0:1}" in - - y) echo "${overide}=y already set in ${bootplist} skipping." - ;; - - n) echo "${overide}=n is set in ${bootplist} leaving." - ;; - - *) echo "Adding ${overide}=${string} to ${bootplist}" - array=("${bootoptionshdextra[@]}") - searchfilereplaceline "${bootplist}" "Kernel Flags" "" "" "2" - ;; - esac - - chown "${USER}:20" "${bootplist}" -} - -getxmlvalue () -{ -# 1 xml key -# 2 xml file -if [ -f "${2}" ]; then - local value - while read value; do - if [ ! "${value}" = "${value/${1}/}" ]; then - read value - value="${value#*<}" ; value="<${value}" ; value="${value#*>}" ; value="${value# *}" ; value="${value%%<*}" - echo "$value" - break - fi - done < "${2}" +if [ -d ${temp} ]; then + mkdir ${temp}; fi -} -searchfilereplaceline () -{ - -mv "${1}" "${1}.orig" - -prefunctionifs="${IFS}" - -unset fileinput -unset fileoutput -unset find -unset replace -unset deletelines -unset deletelinesskip -unset insertlinesskip - -fileinput="${1}.orig" -fileoutput="${1}" -find="${2}" -replace="${3}" -deletelines="${4%,*}" -insertlinesskip="${5}" - -matchlinefound="0" - -if [ "${#4}" = "${4#*,}" ]; then - deletelinesskip="0" - else - deletelinesskip="${4#*,}" -fi - -IFS="\n" -while read line -do - { - if [ ! "${line}" = "${line/${find}/}" ]; then - { - # Trim the longest match from the end for <* - xmlelementindent="${line%%<*}" - - # Trim the longest match from the start for *< - xmlelementtemp="${line#*<}" - # Add back in stripped < - xmlelement="<${xmlelementtemp}" - - # Trim the shortest match from the start for < - xmltagtemp="${xmlelement#<}" - # Trim the longest match from the end for >* - xmltag="${xmltagtemp%%>*}" - - # Trim the shortest match from the start for *> - xmltexttemp="${xmlelement#*>}" - # Trim the longest match from the end for <* - xmltext="${xmltexttemp%%<*}" - - if [ "${replace}" ]; then - { - echo "${xmlelementindent}<${xmltag}>${replace}" >>"${fileoutput}" - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - matchlinefound="1" - - } - else - { - - if [ "${insertlinesskip}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -le "${insertlinesskip}" ]; then - { - if [ "${matchlinefound}" = "${insertlinesskip}" ]; then - { - arraysize=0 - while [ ${arraysize} -lt ${#array[@]} ]; - do - echo "${xmlelementindent}${array[${arraysize}]}" >>"${fileoutput}" - let arraysize="${arraysize}+1" - done - } - fi - } - fi - - if [ "${deletelines}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -lt $((${deletelines}+${deletelinesskip})) ] && [ "${matchlinefound}" -ge ${deletelinesskip} ]; then - { - : - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - - if [ "${matchlinefound}" -gt 0 ]; then - let matchlinefound="${matchlinefound}+1" - fi - - } - fi - } -done < "${fileinput}" - -IFS=${prefunctionifs} - -rm -f "${fileinput}" -} - -main "${1}" "${2}" "${3}" "${4}" +mkdir -p "${temp}/@InstantMenu+Yes" \ No newline at end of file Index: branches/blackosx/trunk/package/Scripts/BaseOptions/GraphicsEnabler/postinstall =================================================================== --- branches/blackosx/trunk/package/Scripts/BaseOptions/GraphicsEnabler/postinstall (revision 206) +++ branches/blackosx/trunk/package/Scripts/BaseOptions/GraphicsEnabler/postinstall (revision 207) @@ -1,169 +1,9 @@ #!/bin/bash -# set com.apple.Boot.plist options +temp="/private/tmp/Chameleon" -overide="GraphicsEnabler" -string="Yes" - -main () -{ - - bootplist="${2}/.Chameleon/Extra/com.apple.Boot.plist" - systemplist="/Library/Preferences/SystemConfiguration/com.apple.Boot.plist" - - bootoptionshdextra[1]="${overide}" - bootoptionshdextra[2]="${string}" - - [ ! -d "${bootplist%/*}" ] && mkdir -p "${bootplist%/*}" - - if [ ! -f "${bootplist}" ]; then - if [ -f "${systemplist}" ]; then - cp -f "${systemplist}" "${bootplist}" - fi - fi - - xmlvalue=$( getxmlvalue ${overide} "${bootplist}" | tr "[:upper:]" "[:lower:]" ) - - case "${xmlvalue:0:1}" in - - y) echo "${overide}=y already set in ${bootplist} skipping." - ;; - - n) echo "${overide}=n is set in ${bootplist} leaving." - ;; - - *) echo "Adding ${overide}=y to ${bootplist}" - array=("${bootoptionshdextra[@]}") - searchfilereplaceline "${bootplist}" "Kernel Flags" "" "" "2" - ;; - esac - - chown "${USER}:20" "${bootplist}" -} - -getxmlvalue () -{ -# 1 xml key -# 2 xml file -if [ -f "${2}" ]; then - local value - while read value; do - if [ ! "${value}" = "${value/${1}/}" ]; then - read value - value="${value#*<}" ; value="<${value}" ; value="${value#*>}" ; value="${value# *}" ; value="${value%%<*}" - echo "$value" - break - fi - done < "${2}" +if [ -d ${temp} ]; then + mkdir ${temp}; fi -} -searchfilereplaceline () -{ - -mv "${1}" "${1}.orig" - -prefunctionifs="${IFS}" - -unset fileinput -unset fileoutput -unset find -unset replace -unset deletelines -unset deletelinesskip -unset insertlinesskip - -fileinput="${1}.orig" -fileoutput="${1}" -find="${2}" -replace="${3}" -deletelines="${4%,*}" -insertlinesskip="${5}" - -matchlinefound="0" - -if [ "${#4}" = "${4#*,}" ]; then - deletelinesskip="0" - else - deletelinesskip="${4#*,}" -fi - -IFS="\n" -while read line -do - { - if [ ! "${line}" = "${line/${find}/}" ]; then - { - # Trim the longest match from the end for <* - xmlelementindent="${line%%<*}" - - # Trim the longest match from the start for *< - xmlelementtemp="${line#*<}" - # Add back in stripped < - xmlelement="<${xmlelementtemp}" - - # Trim the shortest match from the start for < - xmltagtemp="${xmlelement#<}" - # Trim the longest match from the end for >* - xmltag="${xmltagtemp%%>*}" - - # Trim the shortest match from the start for *> - xmltexttemp="${xmlelement#*>}" - # Trim the longest match from the end for <* - xmltext="${xmltexttemp%%<*}" - - if [ "${replace}" ]; then - { - echo "${xmlelementindent}<${xmltag}>${replace}" >>"${fileoutput}" - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - matchlinefound="1" - - } - else - { - - if [ "${insertlinesskip}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -le "${insertlinesskip}" ]; then - { - if [ "${matchlinefound}" = "${insertlinesskip}" ]; then - { - arraysize=0 - while [ ${arraysize} -lt ${#array[@]} ]; - do - echo "${xmlelementindent}${array[${arraysize}]}" >>"${fileoutput}" - let arraysize="${arraysize}+1" - done - } - fi - } - fi - - if [ "${deletelines}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -lt $((${deletelines}+${deletelinesskip})) ] && [ "${matchlinefound}" -ge ${deletelinesskip} ]; then - { - : - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - - if [ "${matchlinefound}" -gt 0 ]; then - let matchlinefound="${matchlinefound}+1" - fi - - } - fi - } -done < "${fileinput}" - -IFS=${prefunctionifs} - -rm -f "${fileinput}" -} - -main "${1}" "${2}" "${3}" "${4}" +mkdir -p "${temp}/@GraphicsEnabler+Yes" \ No newline at end of file Index: branches/blackosx/trunk/package/Scripts/BaseOptions/RestartFix/postinstall =================================================================== --- branches/blackosx/trunk/package/Scripts/BaseOptions/RestartFix/postinstall (revision 206) +++ branches/blackosx/trunk/package/Scripts/BaseOptions/RestartFix/postinstall (revision 207) @@ -1,169 +1,9 @@ #!/bin/bash -# set com.apple.Boot.plist options +temp="/private/tmp/Chameleon" -overide="RestartFix" -string="No" - -main () -{ - - bootplist="${2}/.Chameleon/Extra/com.apple.Boot.plist" - systemplist="/Library/Preferences/SystemConfiguration/com.apple.Boot.plist" - - bootoptionshdextra[1]="${overide}" - bootoptionshdextra[2]="${string}" - - [ ! -d "${bootplist%/*}" ] && mkdir -p "${bootplist%/*}" - - if [ ! -f "${bootplist}" ]; then - if [ -f "${systemplist}" ]; then - cp "${systemplist}" "${bootplist}" - fi - fi - - xmlvalue=$( getxmlvalue ${overide} "${bootplist}" | tr "[:upper:]" "[:lower:]" ) - - case "${xmlvalue:0:1}" in - - y) echo "${overide}=y already set in ${bootplist} skipping." - ;; - - n) echo "${overide}=n is set in ${bootplist} leaving." - ;; - - *) echo "Adding ${overide}=${string} to ${bootplist}" - array=("${bootoptionshdextra[@]}") - searchfilereplaceline "${bootplist}" "Kernel Flags" "" "" "2" - ;; - esac - - chown "${USER}:20" "${bootplist}" -} - -getxmlvalue () -{ -# 1 xml key -# 2 xml file -if [ -f "${2}" ]; then - local value - while read value; do - if [ ! "${value}" = "${value/${1}/}" ]; then - read value - value="${value#*<}" ; value="<${value}" ; value="${value#*>}" ; value="${value# *}" ; value="${value%%<*}" - echo "$value" - break - fi - done < "${2}" +if [ -d ${temp} ]; then + mkdir ${temp}; fi -} -searchfilereplaceline () -{ - -mv "${1}" "${1}.orig" - -prefunctionifs="${IFS}" - -unset fileinput -unset fileoutput -unset find -unset replace -unset deletelines -unset deletelinesskip -unset insertlinesskip - -fileinput="${1}.orig" -fileoutput="${1}" -find="${2}" -replace="${3}" -deletelines="${4%,*}" -insertlinesskip="${5}" - -matchlinefound="0" - -if [ "${#4}" = "${4#*,}" ]; then - deletelinesskip="0" - else - deletelinesskip="${4#*,}" -fi - -IFS="\n" -while read line -do - { - if [ ! "${line}" = "${line/${find}/}" ]; then - { - # Trim the longest match from the end for <* - xmlelementindent="${line%%<*}" - - # Trim the longest match from the start for *< - xmlelementtemp="${line#*<}" - # Add back in stripped < - xmlelement="<${xmlelementtemp}" - - # Trim the shortest match from the start for < - xmltagtemp="${xmlelement#<}" - # Trim the longest match from the end for >* - xmltag="${xmltagtemp%%>*}" - - # Trim the shortest match from the start for *> - xmltexttemp="${xmlelement#*>}" - # Trim the longest match from the end for <* - xmltext="${xmltexttemp%%<*}" - - if [ "${replace}" ]; then - { - echo "${xmlelementindent}<${xmltag}>${replace}" >>"${fileoutput}" - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - matchlinefound="1" - - } - else - { - - if [ "${insertlinesskip}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -le "${insertlinesskip}" ]; then - { - if [ "${matchlinefound}" = "${insertlinesskip}" ]; then - { - arraysize=0 - while [ ${arraysize} -lt ${#array[@]} ]; - do - echo "${xmlelementindent}${array[${arraysize}]}" >>"${fileoutput}" - let arraysize="${arraysize}+1" - done - } - fi - } - fi - - if [ "${deletelines}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -lt $((${deletelines}+${deletelinesskip})) ] && [ "${matchlinefound}" -ge ${deletelinesskip} ]; then - { - : - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - - if [ "${matchlinefound}" -gt 0 ]; then - let matchlinefound="${matchlinefound}+1" - fi - - } - fi - } -done < "${fileinput}" - -IFS=${prefunctionifs} - -rm -f "${fileinput}" -} - -main "${1}" "${2}" "${3}" "${4}" +mkdir -p "${temp}/@RestartFix+No" \ No newline at end of file Index: branches/blackosx/trunk/package/Scripts/BaseOptions/arch/postinstall =================================================================== --- branches/blackosx/trunk/package/Scripts/BaseOptions/arch/postinstall (revision 206) +++ branches/blackosx/trunk/package/Scripts/BaseOptions/arch/postinstall (revision 207) @@ -1,169 +1,9 @@ #!/bin/bash -# set com.apple.Boot.plist options +temp="/private/tmp/Chameleon" -overide="arch" -string="i386" - -main () -{ - - bootplist="${3}/.Chameleon/Extra/com.apple.Boot.plist" - systemplist="/Library/Preferences/SystemConfiguration/com.apple.Boot.plist" - - bootoptionshdextra[1]="${overide}" - bootoptionshdextra[2]="${string}" - - [ ! -d "${bootplist%/*}" ] && mkdir -p "${bootplist%/*}" - - if [ ! -f "${bootplist}" ]; then - if [ -f "${systemplist}" ]; then - cp "${systemplist}" "${bootplist}" - fi - fi - - xmlvalue=$( getxmlvalue ${overide} "${bootplist}" | tr "[:upper:]" "[:lower:]" ) - - case "${xmlvalue:0:1}" in - - y) echo "${overide}=y already set in ${bootplist} skipping." - ;; - - n) echo "${overide}=n is set in ${bootplist} leaving." - ;; - - *) echo "Adding ${overide}=${string} to ${bootplist}" - array=("${bootoptionshdextra[@]}") - searchfilereplaceline "${bootplist}" "Kernel Flags" "" "" "2" - ;; - esac - - chown "${USER}:20" "${bootplist}" -} - -getxmlvalue () -{ -# 1 xml key -# 2 xml file -if [ -f "${2}" ]; then - local value - while read value; do - if [ ! "${value}" = "${value/${1}/}" ]; then - read value - value="${value#*<}" ; value="<${value}" ; value="${value#*>}" ; value="${value# *}" ; value="${value%%<*}" - echo "$value" - break - fi - done < "${2}" +if [ -d ${temp} ]; then + mkdir ${temp}; fi -} -searchfilereplaceline () -{ - -mv "${1}" "${1}.orig" - -prefunctionifs="${IFS}" - -unset fileinput -unset fileoutput -unset find -unset replace -unset deletelines -unset deletelinesskip -unset insertlinesskip - -fileinput="${1}.orig" -fileoutput="${1}" -find="${2}" -replace="${3}" -deletelines="${4%,*}" -insertlinesskip="${5}" - -matchlinefound="0" - -if [ "${#4}" = "${4#*,}" ]; then - deletelinesskip="0" - else - deletelinesskip="${4#*,}" -fi - -IFS="\n" -while read line -do - { - if [ ! "${line}" = "${line/${find}/}" ]; then - { - # Trim the longest match from the end for <* - xmlelementindent="${line%%<*}" - - # Trim the longest match from the start for *< - xmlelementtemp="${line#*<}" - # Add back in stripped < - xmlelement="<${xmlelementtemp}" - - # Trim the shortest match from the start for < - xmltagtemp="${xmlelement#<}" - # Trim the longest match from the end for >* - xmltag="${xmltagtemp%%>*}" - - # Trim the shortest match from the start for *> - xmltexttemp="${xmlelement#*>}" - # Trim the longest match from the end for <* - xmltext="${xmltexttemp%%<*}" - - if [ "${replace}" ]; then - { - echo "${xmlelementindent}<${xmltag}>${replace}" >>"${fileoutput}" - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - matchlinefound="1" - - } - else - { - - if [ "${insertlinesskip}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -le "${insertlinesskip}" ]; then - { - if [ "${matchlinefound}" = "${insertlinesskip}" ]; then - { - arraysize=0 - while [ ${arraysize} -lt ${#array[@]} ]; - do - echo "${xmlelementindent}${array[${arraysize}]}" >>"${fileoutput}" - let arraysize="${arraysize}+1" - done - } - fi - } - fi - - if [ "${deletelines}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -lt $((${deletelines}+${deletelinesskip})) ] && [ "${matchlinefound}" -ge ${deletelinesskip} ]; then - { - : - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - - if [ "${matchlinefound}" -gt 0 ]; then - let matchlinefound="${matchlinefound}+1" - fi - - } - fi - } -done < "${fileinput}" - -IFS=${prefunctionifs} - -rm -f "${fileinput}" -} - -main "${1}" "${2}" "${3}" "${4}" +mkdir -p "${temp}/@arch+i386" \ No newline at end of file Index: branches/blackosx/trunk/package/Scripts/BaseOptions/GeneratePStates/postinstall =================================================================== --- branches/blackosx/trunk/package/Scripts/BaseOptions/GeneratePStates/postinstall (revision 206) +++ branches/blackosx/trunk/package/Scripts/BaseOptions/GeneratePStates/postinstall (revision 207) @@ -1,169 +1,9 @@ #!/bin/bash -# set com.apple.Boot.plist options +temp="/private/tmp/Chameleon" -overide="GeneratePStates" -string="Yes" - -main () -{ - - bootplist="${2}/.Chameleon/Extra/com.apple.Boot.plist" - systemplist="/Library/Preferences/SystemConfiguration/com.apple.Boot.plist" - - bootoptionshdextra[1]="${overide}" - bootoptionshdextra[2]="${string}" - - [ ! -d "${bootplist%/*}" ] && mkdir -p "${bootplist%/*}" - - if [ ! -f "${bootplist}" ]; then - if [ -f "${systemplist}" ]; then - cp "${systemplist}" "${bootplist}" - fi - fi - - xmlvalue=$( getxmlvalue ${overide} "${bootplist}" | tr "[:upper:]" "[:lower:]" ) - - case "${xmlvalue:0:1}" in - - y) echo "${overide}=y already set in ${bootplist} skipping." - ;; - - n) echo "${overide}=n is set in ${bootplist} leaving." - ;; - - *) echo "Adding ${overide}=${string} to ${bootplist}" - array=("${bootoptionshdextra[@]}") - searchfilereplaceline "${bootplist}" "Kernel Flags" "" "" "2" - ;; - esac - - chown "${USER}:20" "${bootplist}" -} - -getxmlvalue () -{ -# 1 xml key -# 2 xml file -if [ -f "${2}" ]; then - local value - while read value; do - if [ ! "${value}" = "${value/${1}/}" ]; then - read value - value="${value#*<}" ; value="<${value}" ; value="${value#*>}" ; value="${value# *}" ; value="${value%%<*}" - echo "$value" - break - fi - done < "${2}" +if [ -d ${temp} ]; then + mkdir ${temp}; fi -} -searchfilereplaceline () -{ - -mv "${1}" "${1}.orig" - -prefunctionifs="${IFS}" - -unset fileinput -unset fileoutput -unset find -unset replace -unset deletelines -unset deletelinesskip -unset insertlinesskip - -fileinput="${1}.orig" -fileoutput="${1}" -find="${2}" -replace="${3}" -deletelines="${4%,*}" -insertlinesskip="${5}" - -matchlinefound="0" - -if [ "${#4}" = "${4#*,}" ]; then - deletelinesskip="0" - else - deletelinesskip="${4#*,}" -fi - -IFS="\n" -while read line -do - { - if [ ! "${line}" = "${line/${find}/}" ]; then - { - # Trim the longest match from the end for <* - xmlelementindent="${line%%<*}" - - # Trim the longest match from the start for *< - xmlelementtemp="${line#*<}" - # Add back in stripped < - xmlelement="<${xmlelementtemp}" - - # Trim the shortest match from the start for < - xmltagtemp="${xmlelement#<}" - # Trim the longest match from the end for >* - xmltag="${xmltagtemp%%>*}" - - # Trim the shortest match from the start for *> - xmltexttemp="${xmlelement#*>}" - # Trim the longest match from the end for <* - xmltext="${xmltexttemp%%<*}" - - if [ "${replace}" ]; then - { - echo "${xmlelementindent}<${xmltag}>${replace}" >>"${fileoutput}" - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - matchlinefound="1" - - } - else - { - - if [ "${insertlinesskip}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -le "${insertlinesskip}" ]; then - { - if [ "${matchlinefound}" = "${insertlinesskip}" ]; then - { - arraysize=0 - while [ ${arraysize} -lt ${#array[@]} ]; - do - echo "${xmlelementindent}${array[${arraysize}]}" >>"${fileoutput}" - let arraysize="${arraysize}+1" - done - } - fi - } - fi - - if [ "${deletelines}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -lt $((${deletelines}+${deletelinesskip})) ] && [ "${matchlinefound}" -ge ${deletelinesskip} ]; then - { - : - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - - if [ "${matchlinefound}" -gt 0 ]; then - let matchlinefound="${matchlinefound}+1" - fi - - } - fi - } -done < "${fileinput}" - -IFS=${prefunctionifs} - -rm -f "${fileinput}" -} - -main "${1}" "${2}" "${3}" "${4}" +mkdir -p "${temp}/@GeneratePStates+Yes" \ No newline at end of file Index: branches/blackosx/trunk/package/Scripts/Resolutions/1024x768x32/postinstall =================================================================== --- branches/blackosx/trunk/package/Scripts/Resolutions/1024x768x32/postinstall (revision 206) +++ branches/blackosx/trunk/package/Scripts/Resolutions/1024x768x32/postinstall (revision 207) @@ -1,169 +1,9 @@ #!/bin/bash -# set com.apple.Boot.plist options +temp="/private/tmp/Chameleon" -overide="Graphics Mode" -string="1024x768x32" - -main () -{ - - bootplist="${2}/.Chameleon/Extra/com.apple.Boot.plist" - systemplist="/Library/Preferences/SystemConfiguration/com.apple.Boot.plist" - - bootoptionshdextra[1]="${overide}" - bootoptionshdextra[2]="${string}" - - [ ! -d "${bootplist%/*}" ] && mkdir -p "${bootplist%/*}" - - if [ ! -f "${bootplist}" ]; then - if [ -f "${systemplist}" ]; then - cp "${systemplist}" "${bootplist}" - fi - fi - - xmlvalue=$( getxmlvalue ${overide} "${bootplist}" | tr "[:upper:]" "[:lower:]" ) - - case "${xmlvalue:0:1}" in - - y) echo "${overide}=y already set in ${bootplist} skipping." - ;; - - n) echo "${overide}=n is set in ${bootplist} leaving." - ;; - - *) echo "Adding ${overide}=${string} to ${bootplist}" - array=("${bootoptionshdextra[@]}") - searchfilereplaceline "${bootplist}" "Kernel Flags" "" "" "2" - ;; - esac - - chown "${USER}:20" "${bootplist}" -} - -getxmlvalue () -{ -# 1 xml key -# 2 xml file -if [ -f "${2}" ]; then - local value - while read value; do - if [ ! "${value}" = "${value/${1}/}" ]; then - read value - value="${value#*<}" ; value="<${value}" ; value="${value#*>}" ; value="${value# *}" ; value="${value%%<*}" - echo "$value" - break - fi - done < "${2}" +if [ -d ${temp} ]; then + mkdir ${temp}; fi -} -searchfilereplaceline () -{ - -mv "${1}" "${1}.orig" - -prefunctionifs="${IFS}" - -unset fileinput -unset fileoutput -unset find -unset replace -unset deletelines -unset deletelinesskip -unset insertlinesskip - -fileinput="${1}.orig" -fileoutput="${1}" -find="${2}" -replace="${3}" -deletelines="${4%,*}" -insertlinesskip="${5}" - -matchlinefound="0" - -if [ "${#4}" = "${4#*,}" ]; then - deletelinesskip="0" - else - deletelinesskip="${4#*,}" -fi - -IFS="\n" -while read line -do - { - if [ ! "${line}" = "${line/${find}/}" ]; then - { - # Trim the longest match from the end for <* - xmlelementindent="${line%%<*}" - - # Trim the longest match from the start for *< - xmlelementtemp="${line#*<}" - # Add back in stripped < - xmlelement="<${xmlelementtemp}" - - # Trim the shortest match from the start for < - xmltagtemp="${xmlelement#<}" - # Trim the longest match from the end for >* - xmltag="${xmltagtemp%%>*}" - - # Trim the shortest match from the start for *> - xmltexttemp="${xmlelement#*>}" - # Trim the longest match from the end for <* - xmltext="${xmltexttemp%%<*}" - - if [ "${replace}" ]; then - { - echo "${xmlelementindent}<${xmltag}>${replace}" >>"${fileoutput}" - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - matchlinefound="1" - - } - else - { - - if [ "${insertlinesskip}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -le "${insertlinesskip}" ]; then - { - if [ "${matchlinefound}" = "${insertlinesskip}" ]; then - { - arraysize=0 - while [ ${arraysize} -lt ${#array[@]} ]; - do - echo "${xmlelementindent}${array[${arraysize}]}" >>"${fileoutput}" - let arraysize="${arraysize}+1" - done - } - fi - } - fi - - if [ "${deletelines}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -lt $((${deletelines}+${deletelinesskip})) ] && [ "${matchlinefound}" -ge ${deletelinesskip} ]; then - { - : - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - - if [ "${matchlinefound}" -gt 0 ]; then - let matchlinefound="${matchlinefound}+1" - fi - - } - fi - } -done < "${fileinput}" - -IFS=${prefunctionifs} - -rm -f "${fileinput}" -} - -main "${1}" "${2}" "${3}" "${4}" +mkdir -p "${temp}/@Graphics_Mode+1024x768x32" \ No newline at end of file Index: branches/blackosx/trunk/package/Scripts/Resolutions/1920x1200x32/postinstall =================================================================== --- branches/blackosx/trunk/package/Scripts/Resolutions/1920x1200x32/postinstall (revision 206) +++ branches/blackosx/trunk/package/Scripts/Resolutions/1920x1200x32/postinstall (revision 207) @@ -1,169 +1,9 @@ #!/bin/bash -# set com.apple.Boot.plist options +temp="/private/tmp/Chameleon" -overide="Graphics Mode" -string="1920x1200x32" - -main () -{ - - bootplist="${2}/.Chameleon/Extra/com.apple.Boot.plist" - systemplist="/Library/Preferences/SystemConfiguration/com.apple.Boot.plist" - - bootoptionshdextra[1]="${overide}" - bootoptionshdextra[2]="${string}" - - [ ! -d "${bootplist%/*}" ] && mkdir -p "${bootplist%/*}" - - if [ ! -f "${bootplist}" ]; then - if [ -f "${systemplist}" ]; then - cp "${systemplist}" "${bootplist}" - fi - fi - - xmlvalue=$( getxmlvalue ${overide} "${bootplist}" | tr "[:upper:]" "[:lower:]" ) - - case "${xmlvalue:0:1}" in - - y) echo "${overide}=y already set in ${bootplist} skipping." - ;; - - n) echo "${overide}=n is set in ${bootplist} leaving." - ;; - - *) echo "Adding ${overide}=${string} to ${bootplist}" - array=("${bootoptionshdextra[@]}") - searchfilereplaceline "${bootplist}" "Kernel Flags" "" "" "2" - ;; - esac - - chown "${USER}:20" "${bootplist}" -} - -getxmlvalue () -{ -# 1 xml key -# 2 xml file -if [ -f "${2}" ]; then - local value - while read value; do - if [ ! "${value}" = "${value/${1}/}" ]; then - read value - value="${value#*<}" ; value="<${value}" ; value="${value#*>}" ; value="${value# *}" ; value="${value%%<*}" - echo "$value" - break - fi - done < "${2}" +if [ -d ${temp} ]; then + mkdir ${temp}; fi -} -searchfilereplaceline () -{ - -mv "${1}" "${1}.orig" - -prefunctionifs="${IFS}" - -unset fileinput -unset fileoutput -unset find -unset replace -unset deletelines -unset deletelinesskip -unset insertlinesskip - -fileinput="${1}.orig" -fileoutput="${1}" -find="${2}" -replace="${3}" -deletelines="${4%,*}" -insertlinesskip="${5}" - -matchlinefound="0" - -if [ "${#4}" = "${4#*,}" ]; then - deletelinesskip="0" - else - deletelinesskip="${4#*,}" -fi - -IFS="\n" -while read line -do - { - if [ ! "${line}" = "${line/${find}/}" ]; then - { - # Trim the longest match from the end for <* - xmlelementindent="${line%%<*}" - - # Trim the longest match from the start for *< - xmlelementtemp="${line#*<}" - # Add back in stripped < - xmlelement="<${xmlelementtemp}" - - # Trim the shortest match from the start for < - xmltagtemp="${xmlelement#<}" - # Trim the longest match from the end for >* - xmltag="${xmltagtemp%%>*}" - - # Trim the shortest match from the start for *> - xmltexttemp="${xmlelement#*>}" - # Trim the longest match from the end for <* - xmltext="${xmltexttemp%%<*}" - - if [ "${replace}" ]; then - { - echo "${xmlelementindent}<${xmltag}>${replace}" >>"${fileoutput}" - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - matchlinefound="1" - - } - else - { - - if [ "${insertlinesskip}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -le "${insertlinesskip}" ]; then - { - if [ "${matchlinefound}" = "${insertlinesskip}" ]; then - { - arraysize=0 - while [ ${arraysize} -lt ${#array[@]} ]; - do - echo "${xmlelementindent}${array[${arraysize}]}" >>"${fileoutput}" - let arraysize="${arraysize}+1" - done - } - fi - } - fi - - if [ "${deletelines}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -lt $((${deletelines}+${deletelinesskip})) ] && [ "${matchlinefound}" -ge ${deletelinesskip} ]; then - { - : - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - - if [ "${matchlinefound}" -gt 0 ]; then - let matchlinefound="${matchlinefound}+1" - fi - - } - fi - } -done < "${fileinput}" - -IFS=${prefunctionifs} - -rm -f "${fileinput}" -} - -main "${1}" "${2}" "${3}" "${4}" +mkdir -p "${temp}/@Graphics_Mode+1920x1200x32" \ No newline at end of file Index: branches/blackosx/trunk/package/Scripts/Resolutions/1600x900x32/postinstall =================================================================== --- branches/blackosx/trunk/package/Scripts/Resolutions/1600x900x32/postinstall (revision 206) +++ branches/blackosx/trunk/package/Scripts/Resolutions/1600x900x32/postinstall (revision 207) @@ -1,169 +1,9 @@ #!/bin/bash -# set com.apple.Boot.plist options +temp="/private/tmp/Chameleon" -overide="Graphics Mode" -string="1600x900x32" - -main () -{ - - bootplist="${2}/.Chameleon/Extra/com.apple.Boot.plist" - systemplist="/Library/Preferences/SystemConfiguration/com.apple.Boot.plist" - - bootoptionshdextra[1]="${overide}" - bootoptionshdextra[2]="${string}" - - [ ! -d "${bootplist%/*}" ] && mkdir -p "${bootplist%/*}" - - if [ ! -f "${bootplist}" ]; then - if [ -f "${systemplist}" ]; then - cp "${systemplist}" "${bootplist}" - fi - fi - - xmlvalue=$( getxmlvalue ${overide} "${bootplist}" | tr "[:upper:]" "[:lower:]" ) - - case "${xmlvalue:0:1}" in - - y) echo "${overide}=y already set in ${bootplist} skipping." - ;; - - n) echo "${overide}=n is set in ${bootplist} leaving." - ;; - - *) echo "Adding ${overide}=${string} to ${bootplist}" - array=("${bootoptionshdextra[@]}") - searchfilereplaceline "${bootplist}" "Kernel Flags" "" "" "2" - ;; - esac - - chown "${USER}:20" "${bootplist}" -} - -getxmlvalue () -{ -# 1 xml key -# 2 xml file -if [ -f "${2}" ]; then - local value - while read value; do - if [ ! "${value}" = "${value/${1}/}" ]; then - read value - value="${value#*<}" ; value="<${value}" ; value="${value#*>}" ; value="${value# *}" ; value="${value%%<*}" - echo "$value" - break - fi - done < "${2}" +if [ -d ${temp} ]; then + mkdir ${temp}; fi -} -searchfilereplaceline () -{ - -mv "${1}" "${1}.orig" - -prefunctionifs="${IFS}" - -unset fileinput -unset fileoutput -unset find -unset replace -unset deletelines -unset deletelinesskip -unset insertlinesskip - -fileinput="${1}.orig" -fileoutput="${1}" -find="${2}" -replace="${3}" -deletelines="${4%,*}" -insertlinesskip="${5}" - -matchlinefound="0" - -if [ "${#4}" = "${4#*,}" ]; then - deletelinesskip="0" - else - deletelinesskip="${4#*,}" -fi - -IFS="\n" -while read line -do - { - if [ ! "${line}" = "${line/${find}/}" ]; then - { - # Trim the longest match from the end for <* - xmlelementindent="${line%%<*}" - - # Trim the longest match from the start for *< - xmlelementtemp="${line#*<}" - # Add back in stripped < - xmlelement="<${xmlelementtemp}" - - # Trim the shortest match from the start for < - xmltagtemp="${xmlelement#<}" - # Trim the longest match from the end for >* - xmltag="${xmltagtemp%%>*}" - - # Trim the shortest match from the start for *> - xmltexttemp="${xmlelement#*>}" - # Trim the longest match from the end for <* - xmltext="${xmltexttemp%%<*}" - - if [ "${replace}" ]; then - { - echo "${xmlelementindent}<${xmltag}>${replace}" >>"${fileoutput}" - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - matchlinefound="1" - - } - else - { - - if [ "${insertlinesskip}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -le "${insertlinesskip}" ]; then - { - if [ "${matchlinefound}" = "${insertlinesskip}" ]; then - { - arraysize=0 - while [ ${arraysize} -lt ${#array[@]} ]; - do - echo "${xmlelementindent}${array[${arraysize}]}" >>"${fileoutput}" - let arraysize="${arraysize}+1" - done - } - fi - } - fi - - if [ "${deletelines}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -lt $((${deletelines}+${deletelinesskip})) ] && [ "${matchlinefound}" -ge ${deletelinesskip} ]; then - { - : - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - - if [ "${matchlinefound}" -gt 0 ]; then - let matchlinefound="${matchlinefound}+1" - fi - - } - fi - } -done < "${fileinput}" - -IFS=${prefunctionifs} - -rm -f "${fileinput}" -} - -main "${1}" "${2}" "${3}" "${4}" +mkdir -p "${temp}/@Graphics_Mode+1600x900x32" \ No newline at end of file Index: branches/blackosx/trunk/package/Scripts/Resolutions/1280x1024x32/postinstall =================================================================== --- branches/blackosx/trunk/package/Scripts/Resolutions/1280x1024x32/postinstall (revision 206) +++ branches/blackosx/trunk/package/Scripts/Resolutions/1280x1024x32/postinstall (revision 207) @@ -1,169 +1,9 @@ #!/bin/bash -# set com.apple.Boot.plist options +temp="/private/tmp/Chameleon" -overide="Graphics Mode" -string="1280x1024x32" - -main () -{ - - bootplist="${2}/.Chameleon/Extra/com.apple.Boot.plist" - systemplist="/Library/Preferences/SystemConfiguration/com.apple.Boot.plist" - - bootoptionshdextra[1]="${overide}" - bootoptionshdextra[2]="${string}" - - [ ! -d "${bootplist%/*}" ] && mkdir -p "${bootplist%/*}" - - if [ ! -f "${bootplist}" ]; then - if [ -f "${systemplist}" ]; then - cp "${systemplist}" "${bootplist}" - fi - fi - - xmlvalue=$( getxmlvalue ${overide} "${bootplist}" | tr "[:upper:]" "[:lower:]" ) - - case "${xmlvalue:0:1}" in - - y) echo "${overide}=y already set in ${bootplist} skipping." - ;; - - n) echo "${overide}=n is set in ${bootplist} leaving." - ;; - - *) echo "Adding ${overide}=${string} to ${bootplist}" - array=("${bootoptionshdextra[@]}") - searchfilereplaceline "${bootplist}" "Kernel Flags" "" "" "2" - ;; - esac - - chown "${USER}:20" "${bootplist}" -} - -getxmlvalue () -{ -# 1 xml key -# 2 xml file -if [ -f "${2}" ]; then - local value - while read value; do - if [ ! "${value}" = "${value/${1}/}" ]; then - read value - value="${value#*<}" ; value="<${value}" ; value="${value#*>}" ; value="${value# *}" ; value="${value%%<*}" - echo "$value" - break - fi - done < "${2}" +if [ -d ${temp} ]; then + mkdir ${temp}; fi -} -searchfilereplaceline () -{ - -mv "${1}" "${1}.orig" - -prefunctionifs="${IFS}" - -unset fileinput -unset fileoutput -unset find -unset replace -unset deletelines -unset deletelinesskip -unset insertlinesskip - -fileinput="${1}.orig" -fileoutput="${1}" -find="${2}" -replace="${3}" -deletelines="${4%,*}" -insertlinesskip="${5}" - -matchlinefound="0" - -if [ "${#4}" = "${4#*,}" ]; then - deletelinesskip="0" - else - deletelinesskip="${4#*,}" -fi - -IFS="\n" -while read line -do - { - if [ ! "${line}" = "${line/${find}/}" ]; then - { - # Trim the longest match from the end for <* - xmlelementindent="${line%%<*}" - - # Trim the longest match from the start for *< - xmlelementtemp="${line#*<}" - # Add back in stripped < - xmlelement="<${xmlelementtemp}" - - # Trim the shortest match from the start for < - xmltagtemp="${xmlelement#<}" - # Trim the longest match from the end for >* - xmltag="${xmltagtemp%%>*}" - - # Trim the shortest match from the start for *> - xmltexttemp="${xmlelement#*>}" - # Trim the longest match from the end for <* - xmltext="${xmltexttemp%%<*}" - - if [ "${replace}" ]; then - { - echo "${xmlelementindent}<${xmltag}>${replace}" >>"${fileoutput}" - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - matchlinefound="1" - - } - else - { - - if [ "${insertlinesskip}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -le "${insertlinesskip}" ]; then - { - if [ "${matchlinefound}" = "${insertlinesskip}" ]; then - { - arraysize=0 - while [ ${arraysize} -lt ${#array[@]} ]; - do - echo "${xmlelementindent}${array[${arraysize}]}" >>"${fileoutput}" - let arraysize="${arraysize}+1" - done - } - fi - } - fi - - if [ "${deletelines}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -lt $((${deletelines}+${deletelinesskip})) ] && [ "${matchlinefound}" -ge ${deletelinesskip} ]; then - { - : - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - - if [ "${matchlinefound}" -gt 0 ]; then - let matchlinefound="${matchlinefound}+1" - fi - - } - fi - } -done < "${fileinput}" - -IFS=${prefunctionifs} - -rm -f "${fileinput}" -} - -main "${1}" "${2}" "${3}" "${4}" +mkdir -p "${temp}/@Graphics_Mode+1280x1024x32" \ No newline at end of file Index: branches/blackosx/trunk/package/Scripts/Resolutions/1680x1050x32/postinstall =================================================================== --- branches/blackosx/trunk/package/Scripts/Resolutions/1680x1050x32/postinstall (revision 206) +++ branches/blackosx/trunk/package/Scripts/Resolutions/1680x1050x32/postinstall (revision 207) @@ -1,169 +1,9 @@ #!/bin/bash -# set com.apple.Boot.plist options +temp="/private/tmp/Chameleon" -overide="Graphics Mode" -string="1680x1050x32" - -main () -{ - - bootplist="${2}/.Chameleon/Extra/com.apple.Boot.plist" - systemplist="/Library/Preferences/SystemConfiguration/com.apple.Boot.plist" - - bootoptionshdextra[1]="${overide}" - bootoptionshdextra[2]="${string}" - - [ ! -d "${bootplist%/*}" ] && mkdir -p "${bootplist%/*}" - - if [ ! -f "${bootplist}" ]; then - if [ -f "${systemplist}" ]; then - cp "${systemplist}" "${bootplist}" - fi - fi - - xmlvalue=$( getxmlvalue ${overide} "${bootplist}" | tr "[:upper:]" "[:lower:]" ) - - case "${xmlvalue:0:1}" in - - y) echo "${overide}=y already set in ${bootplist} skipping." - ;; - - n) echo "${overide}=n is set in ${bootplist} leaving." - ;; - - *) echo "Adding ${overide}=${string} to ${bootplist}" - array=("${bootoptionshdextra[@]}") - searchfilereplaceline "${bootplist}" "Kernel Flags" "" "" "2" - ;; - esac - - chown "${USER}:20" "${bootplist}" -} - -getxmlvalue () -{ -# 1 xml key -# 2 xml file -if [ -f "${2}" ]; then - local value - while read value; do - if [ ! "${value}" = "${value/${1}/}" ]; then - read value - value="${value#*<}" ; value="<${value}" ; value="${value#*>}" ; value="${value# *}" ; value="${value%%<*}" - echo "$value" - break - fi - done < "${2}" +if [ -d ${temp} ]; then + mkdir ${temp}; fi -} -searchfilereplaceline () -{ - -mv "${1}" "${1}.orig" - -prefunctionifs="${IFS}" - -unset fileinput -unset fileoutput -unset find -unset replace -unset deletelines -unset deletelinesskip -unset insertlinesskip - -fileinput="${1}.orig" -fileoutput="${1}" -find="${2}" -replace="${3}" -deletelines="${4%,*}" -insertlinesskip="${5}" - -matchlinefound="0" - -if [ "${#4}" = "${4#*,}" ]; then - deletelinesskip="0" - else - deletelinesskip="${4#*,}" -fi - -IFS="\n" -while read line -do - { - if [ ! "${line}" = "${line/${find}/}" ]; then - { - # Trim the longest match from the end for <* - xmlelementindent="${line%%<*}" - - # Trim the longest match from the start for *< - xmlelementtemp="${line#*<}" - # Add back in stripped < - xmlelement="<${xmlelementtemp}" - - # Trim the shortest match from the start for < - xmltagtemp="${xmlelement#<}" - # Trim the longest match from the end for >* - xmltag="${xmltagtemp%%>*}" - - # Trim the shortest match from the start for *> - xmltexttemp="${xmlelement#*>}" - # Trim the longest match from the end for <* - xmltext="${xmltexttemp%%<*}" - - if [ "${replace}" ]; then - { - echo "${xmlelementindent}<${xmltag}>${replace}" >>"${fileoutput}" - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - matchlinefound="1" - - } - else - { - - if [ "${insertlinesskip}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -le "${insertlinesskip}" ]; then - { - if [ "${matchlinefound}" = "${insertlinesskip}" ]; then - { - arraysize=0 - while [ ${arraysize} -lt ${#array[@]} ]; - do - echo "${xmlelementindent}${array[${arraysize}]}" >>"${fileoutput}" - let arraysize="${arraysize}+1" - done - } - fi - } - fi - - if [ "${deletelines}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -lt $((${deletelines}+${deletelinesskip})) ] && [ "${matchlinefound}" -ge ${deletelinesskip} ]; then - { - : - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - - if [ "${matchlinefound}" -gt 0 ]; then - let matchlinefound="${matchlinefound}+1" - fi - - } - fi - } -done < "${fileinput}" - -IFS=${prefunctionifs} - -rm -f "${fileinput}" -} - -main "${1}" "${2}" "${3}" "${4}" +mkdir -p "${temp}/@Graphics_Mode+1680x1050x32" \ No newline at end of file Index: branches/blackosx/trunk/package/Scripts/Resolutions/1920x1080x32/postinstall =================================================================== --- branches/blackosx/trunk/package/Scripts/Resolutions/1920x1080x32/postinstall (revision 206) +++ branches/blackosx/trunk/package/Scripts/Resolutions/1920x1080x32/postinstall (revision 207) @@ -1,169 +1,9 @@ #!/bin/bash -# set com.apple.Boot.plist options +temp="/private/tmp/Chameleon" -overide="Graphics Mode" -string="1920x1080x32" - -main () -{ - - bootplist="${2}/.Chameleon/Extra/com.apple.Boot.plist" - systemplist="/Library/Preferences/SystemConfiguration/com.apple.Boot.plist" - - bootoptionshdextra[1]="${overide}" - bootoptionshdextra[2]="${string}" - - [ ! -d "${bootplist%/*}" ] && mkdir -p "${bootplist%/*}" - - if [ ! -f "${bootplist}" ]; then - if [ -f "${systemplist}" ]; then - cp "${systemplist}" "${bootplist}" - fi - fi - - xmlvalue=$( getxmlvalue ${overide} "${bootplist}" | tr "[:upper:]" "[:lower:]" ) - - case "${xmlvalue:0:1}" in - - y) echo "${overide}=y already set in ${bootplist} skipping." - ;; - - n) echo "${overide}=n is set in ${bootplist} leaving." - ;; - - *) echo "Adding ${overide}=${string} to ${bootplist}" - array=("${bootoptionshdextra[@]}") - searchfilereplaceline "${bootplist}" "Kernel Flags" "" "" "2" - ;; - esac - - chown "${USER}:20" "${bootplist}" -} - -getxmlvalue () -{ -# 1 xml key -# 2 xml file -if [ -f "${2}" ]; then - local value - while read value; do - if [ ! "${value}" = "${value/${1}/}" ]; then - read value - value="${value#*<}" ; value="<${value}" ; value="${value#*>}" ; value="${value# *}" ; value="${value%%<*}" - echo "$value" - break - fi - done < "${2}" +if [ -d ${temp} ]; then + mkdir ${temp}; fi -} -searchfilereplaceline () -{ - -mv "${1}" "${1}.orig" - -prefunctionifs="${IFS}" - -unset fileinput -unset fileoutput -unset find -unset replace -unset deletelines -unset deletelinesskip -unset insertlinesskip - -fileinput="${1}.orig" -fileoutput="${1}" -find="${2}" -replace="${3}" -deletelines="${4%,*}" -insertlinesskip="${5}" - -matchlinefound="0" - -if [ "${#4}" = "${4#*,}" ]; then - deletelinesskip="0" - else - deletelinesskip="${4#*,}" -fi - -IFS="\n" -while read line -do - { - if [ ! "${line}" = "${line/${find}/}" ]; then - { - # Trim the longest match from the end for <* - xmlelementindent="${line%%<*}" - - # Trim the longest match from the start for *< - xmlelementtemp="${line#*<}" - # Add back in stripped < - xmlelement="<${xmlelementtemp}" - - # Trim the shortest match from the start for < - xmltagtemp="${xmlelement#<}" - # Trim the longest match from the end for >* - xmltag="${xmltagtemp%%>*}" - - # Trim the shortest match from the start for *> - xmltexttemp="${xmlelement#*>}" - # Trim the longest match from the end for <* - xmltext="${xmltexttemp%%<*}" - - if [ "${replace}" ]; then - { - echo "${xmlelementindent}<${xmltag}>${replace}" >>"${fileoutput}" - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - matchlinefound="1" - - } - else - { - - if [ "${insertlinesskip}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -le "${insertlinesskip}" ]; then - { - if [ "${matchlinefound}" = "${insertlinesskip}" ]; then - { - arraysize=0 - while [ ${arraysize} -lt ${#array[@]} ]; - do - echo "${xmlelementindent}${array[${arraysize}]}" >>"${fileoutput}" - let arraysize="${arraysize}+1" - done - } - fi - } - fi - - if [ "${deletelines}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -lt $((${deletelines}+${deletelinesskip})) ] && [ "${matchlinefound}" -ge ${deletelinesskip} ]; then - { - : - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - - if [ "${matchlinefound}" -gt 0 ]; then - let matchlinefound="${matchlinefound}+1" - fi - - } - fi - } -done < "${fileinput}" - -IFS=${prefunctionifs} - -rm -f "${fileinput}" -} - -main "${1}" "${2}" "${3}" "${4}" +mkdir -p "${temp}/@Graphics_Mode+1920x1080x32" \ No newline at end of file Index: branches/blackosx/trunk/package/Scripts/Resolutions/1280x960x32/postinstall =================================================================== --- branches/blackosx/trunk/package/Scripts/Resolutions/1280x960x32/postinstall (revision 206) +++ branches/blackosx/trunk/package/Scripts/Resolutions/1280x960x32/postinstall (revision 207) @@ -1,169 +1,9 @@ #!/bin/bash -# set com.apple.Boot.plist options +temp="/private/tmp/Chameleon" -overide="Graphics Mode" -string="1280x960x32" - -main () -{ - - bootplist="${2}/.Chameleon/Extra/com.apple.Boot.plist" - systemplist="/Library/Preferences/SystemConfiguration/com.apple.Boot.plist" - - bootoptionshdextra[1]="${overide}" - bootoptionshdextra[2]="${string}" - - [ ! -d "${bootplist%/*}" ] && mkdir -p "${bootplist%/*}" - - if [ ! -f "${bootplist}" ]; then - if [ -f "${systemplist}" ]; then - cp "${systemplist}" "${bootplist}" - fi - fi - - xmlvalue=$( getxmlvalue ${overide} "${bootplist}" | tr "[:upper:]" "[:lower:]" ) - - case "${xmlvalue:0:1}" in - - y) echo "${overide}=y already set in ${bootplist} skipping." - ;; - - n) echo "${overide}=n is set in ${bootplist} leaving." - ;; - - *) echo "Adding ${overide}=${string} to ${bootplist}" - array=("${bootoptionshdextra[@]}") - searchfilereplaceline "${bootplist}" "Kernel Flags" "" "" "2" - ;; - esac - - chown "${USER}:20" "${bootplist}" -} - -getxmlvalue () -{ -# 1 xml key -# 2 xml file -if [ -f "${2}" ]; then - local value - while read value; do - if [ ! "${value}" = "${value/${1}/}" ]; then - read value - value="${value#*<}" ; value="<${value}" ; value="${value#*>}" ; value="${value# *}" ; value="${value%%<*}" - echo "$value" - break - fi - done < "${2}" +if [ -d ${temp} ]; then + mkdir ${temp}; fi -} -searchfilereplaceline () -{ - -mv "${1}" "${1}.orig" - -prefunctionifs="${IFS}" - -unset fileinput -unset fileoutput -unset find -unset replace -unset deletelines -unset deletelinesskip -unset insertlinesskip - -fileinput="${1}.orig" -fileoutput="${1}" -find="${2}" -replace="${3}" -deletelines="${4%,*}" -insertlinesskip="${5}" - -matchlinefound="0" - -if [ "${#4}" = "${4#*,}" ]; then - deletelinesskip="0" - else - deletelinesskip="${4#*,}" -fi - -IFS="\n" -while read line -do - { - if [ ! "${line}" = "${line/${find}/}" ]; then - { - # Trim the longest match from the end for <* - xmlelementindent="${line%%<*}" - - # Trim the longest match from the start for *< - xmlelementtemp="${line#*<}" - # Add back in stripped < - xmlelement="<${xmlelementtemp}" - - # Trim the shortest match from the start for < - xmltagtemp="${xmlelement#<}" - # Trim the longest match from the end for >* - xmltag="${xmltagtemp%%>*}" - - # Trim the shortest match from the start for *> - xmltexttemp="${xmlelement#*>}" - # Trim the longest match from the end for <* - xmltext="${xmltexttemp%%<*}" - - if [ "${replace}" ]; then - { - echo "${xmlelementindent}<${xmltag}>${replace}" >>"${fileoutput}" - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - matchlinefound="1" - - } - else - { - - if [ "${insertlinesskip}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -le "${insertlinesskip}" ]; then - { - if [ "${matchlinefound}" = "${insertlinesskip}" ]; then - { - arraysize=0 - while [ ${arraysize} -lt ${#array[@]} ]; - do - echo "${xmlelementindent}${array[${arraysize}]}" >>"${fileoutput}" - let arraysize="${arraysize}+1" - done - } - fi - } - fi - - if [ "${deletelines}" ] && [ "${matchlinefound}" -gt 0 ] && [ "${matchlinefound}" -lt $((${deletelines}+${deletelinesskip})) ] && [ "${matchlinefound}" -ge ${deletelinesskip} ]; then - { - : - } - else - { - echo "${line}" >>"${fileoutput}" - } - fi - - if [ "${matchlinefound}" -gt 0 ]; then - let matchlinefound="${matchlinefound}+1" - fi - - } - fi - } -done < "${fileinput}" - -IFS=${prefunctionifs} - -rm -f "${fileinput}" -} - -main "${1}" "${2}" "${3}" "${4}" +mkdir -p "${temp}/@ Graphics_Mode+1280x960x32" \ No newline at end of file Index: branches/blackosx/trunk/revision =================================================================== --- branches/blackosx/trunk/revision (revision 206) +++ branches/blackosx/trunk/revision (revision 207) @@ -1 +1 @@ -198:201 \ No newline at end of file +206 \ No newline at end of file