-
+
+
-
+
+
+
+
+
-
-
-
-
-
+ Chameleon_title
- Chameleon_title
+
+ function chameleon_boot_plist_exists() {
+ return system.files.fileExistsAtPath(my.target.mountpoint + '/Extra/org.chameleon.Boot.plist');
+ }
+
+
Index: branches/ErmaC/Modules/package/Changes.txt
===================================================================
--- branches/ErmaC/Modules/package/Changes.txt (revision 0)
+++ branches/ErmaC/Modules/package/Changes.txt (revision 1751)
@@ -0,0 +1,47 @@
+- Keylayout / Keymaps fixed and made a mandatory install.
+
+- Add option to upgrade an existing install - or more exactly, merge newly selected options with an existing /Extra folder. Also, rename an existing /Extra/com.apple.Boot.plist to /Extra/org.chameleon.Boot.plist.
+
+- Change the layout/wording displayed in the installer (English only) and give it a facelift. Adjust background image to scale to fit in the window.
+
+- Set exclusive 'None' option to default choice.
+
+- Add code to detect and make necessary changes to avoid possibility of a b1f:error or boot1:error should the user decide to install a secondary boot partition.
+
+- Fix bug installing to /Volumes/EFI
+
+- Add crazybirdy's Chinese translation to zh-CN and zh-TW resources.
+
+- Add dmaazar's boot0workV2 changes to ../i386/boot0/boot0md.s.
+
+- Added check for an existing Chameleon installation on a different partition of same target disk to help stop new
+users from confusing themselves. If found, the install process will exit and write the reason to the install log.
+
+- Re-organised Scripts folder in to Main and Sub scripts. The main scripts for the standard and EFI system partition
+installation options have been changed to used the code that I'd previously re-structured. The Sub scripts are the
+original chameleon installer scripts with maybe some tweaks/additions, split in to separate scripts. These scripts
+include the previous additions I'd made including checking for FAT16 partitions, installing boot0md or boot0 depending
+on whether or not a Windows installation is found and writing boot1h or boot1f32 depending on installing to HFS or
+FAT32 format partitions.
+
+- All references of Boot0hfs removed and now replaced with Boot0md.
+
+- Installer log added to now dump a log of useful info about the install process to the root of the selected target.
+
+- Boot options re-thought and are now automatically created at compile time from simple lists, rather than manage a
+separate file of code of each option.
+
+- Added missing useKernelCache boot option.
+
+- Easily enable a list to be exclusive or not.
+
+- The main Post script now creates the org.chameleon.Boot.plist based on the modules / options / key layouts / themes
+selected by the user.
+
+- Only create and /Extra folder if there's something to go in it.
+
+- Backup an existing /Extra folder to /Extra-OLD(date & time).
+
+- slimpkg.sh changed to match the revised code in buildpkg.sh where applicable.
+
+- English Localizable.strings revised to match latest additions and some texts updated.
\ No newline at end of file
Index: branches/ErmaC/Modules/package/Scripts/Main/ESPpostinstall
===================================================================
--- branches/ErmaC/Modules/package/Scripts/Main/ESPpostinstall (revision 1750)
+++ branches/ErmaC/Modules/package/Scripts/Main/ESPpostinstall (revision 1751)
@@ -56,6 +56,8 @@
targetResources="${targetVolumeChosenByUser}/usr/local/bin/"
+efiPartitionExist=0 # target volume does not have EFI system partition.
+
echo "==============================================="
echo "DEBUG: display script variables"
echo "***************************"
@@ -92,14 +94,18 @@
echo "Confirm this is a GPT partitioned disk."
# Double check we can see the selected partition and it's of the right type.
- # If the following script finds anything, it returns 1 to indicate failure.
+ # The following script returns either 0 or 1 to proceed, or 2 to indicate failure.
"$scriptDir"CheckProceed.sh "${targetVolume}" "${targetDeviceChosenByUser}" "${targetVolumeChosenByUser}" "${scriptDir}"
returnValue=$?
- if [ ${returnValue} = 0 ]; then
+ if [ ${returnValue} -ne 2 ]; then
# OK to proceed
+ # Remember if the target volume has an EFI system partition.
+ if [ ${returnValue} -ne 1 ]; then
+ efiPartitionExist=1
+ fi
# Does a GRUB or Linux loader already exist in the disk's MBR?
# The script returns 1 if yes, 0 if no.
@@ -157,12 +163,14 @@
# OK to proceed
# Mount the EFI system partition
- "$scriptDir"MountESP.sh "${targetDisk}" "${targetVolumeChosenByUser}" "${scriptDir}"
+ "$scriptDir"MountESP.sh "${targetDisk}" "${targetVolumeChosenByUser}" "${efiPartitionExist}" "${scriptDir}"
# Write the stage 2 loader to the root of the selected partition
"$scriptDir"WriteChameleonStage2.sh "${stage2Loader}" "${targetVolume}" "${targetDevice}" "${targetVolumeChosenByUser}" "${scriptDir}"
# Check for another existing Chameleon installation on the same disk
+ "$scriptDir"InstallLog.sh "${targetVolume}" "LineBreak"
+ "$scriptDir"InstallLog.sh "${targetVolume}" "Preparing to check target disk for previous installations."
"$scriptDir"CheckPreviousChameleon.sh "${targetDisk}" "${targetDeviceRaw}" "${targetDevice}" "${targetVolumeChosenByUser}" "${scriptDir}"
fi
Index: branches/ErmaC/Modules/package/Scripts/Main/postinstall
===================================================================
--- branches/ErmaC/Modules/package/Scripts/Main/postinstall (revision 1750)
+++ branches/ErmaC/Modules/package/Scripts/Main/postinstall (revision 1751)
@@ -20,10 +20,10 @@
# / with volume name.
if [ "$3" == "/" ]
then
- dest_vol="/Volumes/"$( ls -1F /Volumes | sed -n 's:@$::p' )
+ dest_vol="/Volumes/"$( ls -1F /Volumes | sed -n 's:@$::p' )
else
dest_vol="$3"
-fi
+fi
# Find script location so to find the Install Log script.
MYLOCATION="${PWD}/${BASH_ARGV[0]}"
@@ -37,261 +37,245 @@
# set temporary directory
chamTemp="$dest_vol/usr/local/chamTemp"
-# Check for stopped installation due to Chameleon
-# already existing on the same disk.
-# TO DO - This check can be removed as it's no longer used!!
-if [ ! -f "$dest_vol"/.ChameleonExists ]; then
+# ---------------------------------------------
+# Build org.chameleon.Boot.plist
+# ---------------------------------------------
+# All options selected are now dummy files with
+# the filename of the option and value residing
+# in /usr/local/chamTemp/options/
+# for example. Boot Banner=Yes
- # ---------------------------------------------
- # Add any installed modules to the Install Log
- # ---------------------------------------------
- if [ -e "${chamTemp}"/Extra/modules ]; then
- ls "${chamTemp}"/Extra/modules | while read FILE
- do
- "$scriptDir"InstallLog.sh "${dest_vol}" "Added module: $FILE"
- done
+# Are there any options to build?
+if [ "$(ls -A ${chamTemp}/options )" ]; then
+
+ # Check for temporary directory/Extra folder.
+ if [ ! -d "$chamTemp"/Extra ]; then
+ mkdir "$chamTemp"/Extra
fi
-
- # ---------------------------------------------
- # Add any installed themes to the Install Log
- # ---------------------------------------------
- if [ -e "${chamTemp}"/Extra/Themes ]; then
- ls "${chamTemp}"/Extra/Themes | while read FILE
- do
- "$scriptDir"InstallLog.sh "${dest_vol}" "Added Theme: $FILE"
- done
- fi
- # ---------------------------------------------
- # Build org.chameleon.Boot.plist
- # ---------------------------------------------
- # All options selected are now dummy files with
- # the filename of the option and value residing
- # in /usr/local/chamTemp/options/
- # for example. Boot Banner=Yes
+ tempOCBP="$chamTemp"/Extra/org.chameleon.Boot.plist
- # Are there any options to build?
- if [ "$(ls -A ${chamTemp}/options )" ]; then
+ # Create template for org.chameleon.Boot.plist"
+ tempOCBP="$chamTemp"/Extra/org.chameleon.Boot.plist
+ cp "$4"/Library/Preferences/SystemConfiguration/com.apple.Boot.plist "$tempOCBP"
- # Check for temporary directory/Extra folder.
- if [ ! -d "$chamTemp"/Extra ]; then
- mkdir "$chamTemp"/Extra
+ # Read list of all boot options the user added.
+ arrayCount=0
+ kernelFlagCount=0
+ while read FILE
+ do
+ options[arrayCount]="${FILE##*/}"
+
+ # Check keyRead for 'KF' at beginning to
+ # indicate that should be a kernel flag
+ if [ ${options[arrayCount]:0:2} = "KF" ];then
+ # plistbuddy only add's if the key doesn't already exist.
+ # So let's store any kernelflags and add them all at the
+ # same time once when we reach the end of the options list.
+ kernelflag[kernelFlagCount]="${options[arrayCount]##*flag=}"
+ "$scriptDir"InstallLog.sh "${dest_vol}" "Added kernel flag: ${kernelflag[kernelFlagCount]}"
+ (( kernelFlagCount++ ))
+ else
+ keyRead="${options[$arrayCount]%=*}"
+ value="${options[$arrayCount]#*=}"
+ # escape any spaces
+ keyToUse=$( echo $keyRead | sed 's/ /\\ /g' )
+ if [ "${keyToUse}" != "DONT" ] && [ "${value}" != "ADD" ]; then
+ sudo /usr/libexec/plistbuddy -c "Add :${keyToUse} string ${value}" "$tempOCBP"
+ returnValue=$?
+ if [ ${returnValue} -ne 1 ]; then
+ "$scriptDir"InstallLog.sh "${dest_vol}" "Added boot option: ${keyRead}=${value}"
+ else
+ "$scriptDir"InstallLog.sh "${dest_vol}" "Can't add ${keyRead}=${value} as an option already exists for: ${keyRead}"
+ fi
+ fi
fi
+ (( arrayCount++ ))
+ done < <(ls "${chamTemp}"/options )
- tempOCBP="$chamTemp"/Extra/org.chameleon.Boot.plist
-
- # Create template for org.chameleon.Boot.plist"
- tempOCBP="$chamTemp"/Extra/org.chameleon.Boot.plist
- cp "$4"/Library/Preferences/SystemConfiguration/com.apple.Boot.plist "$tempOCBP"
-
- # Read list of all boot options the user added.
- arrayCount=0
- kernelFlagCount=0
- while read FILE
+ if [ $kernelFlagCount -gt 0 ]; then
+ # Add any kernel flags together in to one string.
+ for (( i=0 ; i < $kernelFlagCount ; i++ ))
do
- options[arrayCount]="${FILE##*/}"
-
- # Check keyRead for 'KF' at beginning to
- # indicate that should be a kernel flag
- if [ ${options[arrayCount]:0:2} = "KF" ];then
- # plistbuddy only add's if the key doesn't already exist.
- # So let's store any kernelflags and add them all at the
- # same time once when we reach the end of the options list.
- kernelflag[kernelFlagCount]="${options[arrayCount]##*flag=}"
- "$scriptDir"InstallLog.sh "${dest_vol}" "Added kernel flag: ${kernelflag[kernelFlagCount]}"
- (( kernelFlagCount++ ))
- else
- keyRead="${options[$arrayCount]%=*}"
- value="${options[$arrayCount]#*=}"
- # escape any spaces
- keyToUse=$( echo $keyRead | sed 's/ /\\ /g' )
- if [ "${keyToUse}" != "DONT" ] && [ "${value}" != "ADD" ]; then
- sudo /usr/libexec/plistbuddy -c "Add :${keyToUse} string ${value}" "$tempOCBP"
- returnValue=$?
- if [ ${returnValue} -ne 1 ]; then
- "$scriptDir"InstallLog.sh "${dest_vol}" "Added boot option: ${keyRead}=${value}"
- else
- "$scriptDir"InstallLog.sh "${dest_vol}" "Can't add ${keyRead}=${value} as an option already exists for: ${keyRead}"
- fi
- fi
- fi
- (( arrayCount++ ))
- done < <(ls "${chamTemp}"/options )
-
- # If exclusive options were used and the 'None' option was chosen,
- # then a dummy file named DONT=ADD would be in /$chamTemp/Extra/options.
- # If that was the only option then the above code would have made a
- # temporary Extra folder with a default org.chameleon.Boot.plist
- # In this case we don't need it and should discard it otherwise the folder
- # will be copied to the users / directory when it's not wanted.
- if [ ${arrayCount} == 1 ] && [ "${keyToUse}" == "DONT" ] && [ "${value}" == "ADD" ]; then
- if [ -e "${chamTemp}"/Extra ] && [ ! -e "${chamTemp}"/Extra/Themes ] && [ ! -e "${chamTemp}"/Extra/Modules ]; then
- rm -r -f "$chamTemp"/Extra
- fi
- fi
-
- if [ $kernelFlagCount -gt 0 ]; then
- # Add any kernel flags together in to one string.
- for (( i=0 ; i < $kernelFlagCount ; i++ ))
- do
- kernelFlagString="${kernelFlagString} ${kernelflag[i]}"
- done
- # We add the final string in the next section.
- fi
+ kernelFlagString="${kernelFlagString} ${kernelflag[i]}"
+ done
+ # We add the final string in the next section.
fi
-
+fi
+
+# ---------------------------------------------
+# Add any installed modules to the Install Log
+# ---------------------------------------------
+if [ -e "${chamTemp}"/Extra/modules ]; then
+ ls "${chamTemp}"/Extra/modules | while read FILE
+ do
+ "$scriptDir"InstallLog.sh "${dest_vol}" "Added module: $FILE"
+ if [ "$FILE" == "Keylayout.dylib" ]; then
+ "$scriptDir"InstallLog.sh "${dest_vol}" "Also adding required Keymaps."
+ fi
+ done
+fi
+
+# ---------------------------------------------
+# Add any installed themes to the Install Log
+# ---------------------------------------------
+if [ -e "${chamTemp}"/Extra/Themes ]; then
+ ls "${chamTemp}"/Extra/Themes | while read FILE
+ do
+ "$scriptDir"InstallLog.sh "${dest_vol}" "Added Theme: $FILE"
+ done
+fi
+
+# Does a temporary /Extra folder exist?
+if [ -d "$chamTemp"/Extra ]; then
+
# ---------------------------------------------
# Merge /Extra folders?
# ---------------------------------------------
# Does the user want to upgrade an existing /Extra folder?
- # If so, then merge their existing one in to the temp one
- if [ -e "$chamTemp/install_type_upgrade" ]; then
- "$scriptDir"InstallLog.sh "${dest_vol}" "User selected to do an upgrade install."
-
- # first move the new org.chameleon.Boot.plist out of tmp
- # Extra folder so we can merge that separately.
- mv "$tempOCBP" "$chamTemp/holding.plist"
-
- # Check for an existing /Extra folder
- # and merge existing /Extra with temp one.
- if [ -e "$dest_vol"/.ChameleonEFI ]; then
- if [ -e "/Volumes/EFI/Extra" ]; then
- "$scriptDir"InstallLog.sh "${dest_vol}" "Merging existing /Volumes/EFI/Extra folder."
- ditto --noextattr --noqtn /Volumes/EFI/Extra "$chamTemp"/Extra
- fi
- else
- if [ -e "$dest_vol/Extra" ]; then
- "$scriptDir"InstallLog.sh "${dest_vol}" "Merging existing ${dest_vol}/Extra folder."
- ditto --noextattr --noqtn "${dest_vol}"/Extra "$chamTemp"/Extra
- fi
- fi
-
- # Check existing plist name for old naming convention
- # and change to new convention.
- if [ -e "$chamTemp"/Extra/com.apple.Boot.plist ]; then
- "$scriptDir"InstallLog.sh "${dest_vol}" "Renaming existing com.apple.Boot.plist to org.chameleon.Boot.plist."
- mv "$chamTemp"/Extra/com.apple.Boot.plist "$tempOCBP"
- fi
-
- # Before merging org.chameleon.Boot.plist, copy any
- # existing kernel flags, then delete the entry.
- currentFlags=$( sudo /usr/libexec/plistbuddy -c "Print :Kernel\ Flags" "$tempOCBP" )
- sudo /usr/libexec/plistbuddy -c "Delete :Kernel\ Flags" "$tempOCBP"
-
- # Merge new org.chameleon.Boot.plist (holding.plist)
- # with their currently existing one.
- "$scriptDir"InstallLog.sh "${dest_vol}" "Merging new options into org.chameleon.Boot.plist.
+ # If so, then merge their existing one in to the temp one.
+ if [ -e "$chamTemp/install_type_upgrade" ]; then
+ "$scriptDir"InstallLog.sh "${dest_vol}" "User selected to do an upgrade install."
+
+ # first move the new org.chameleon.Boot.plist out of tmp
+ # Extra folder so we can merge that separately.
+ mv "$tempOCBP" "$chamTemp/holding.plist"
+
+ # Check for an existing /Extra folder
+ # and merge existing /Extra with temp one.
+ if [ -e "$dest_vol"/.ChameleonEFI ]; then
+ if [ -e "/Volumes/EFI/Extra" ]; then
+ "$scriptDir"InstallLog.sh "${dest_vol}" "Merging existing /Volumes/EFI/Extra folder."
+ ditto --noextattr --noqtn /Volumes/EFI/Extra "$chamTemp"/Extra
+ fi
+ else
+ if [ -e "$dest_vol/Extra" ]; then
+ "$scriptDir"InstallLog.sh "${dest_vol}" "Merging existing ${dest_vol}/Extra folder."
+ ditto --noextattr --noqtn "${dest_vol}"/Extra "$chamTemp"/Extra
+ fi
+ fi
+
+ # Check existing plist name for old naming convention
+ # and change to new convention.
+ if [ -e "$chamTemp"/Extra/com.apple.Boot.plist ]; then
+ "$scriptDir"InstallLog.sh "${dest_vol}" "Renaming existing com.apple.Boot.plist to org.chameleon.Boot.plist."
+ mv "$chamTemp"/Extra/com.apple.Boot.plist "$tempOCBP"
+ fi
+
+ # Before merging org.chameleon.Boot.plist, copy any
+ # existing kernel flags, then delete the entry.
+ currentFlags=$( sudo /usr/libexec/plistbuddy -c "Print :Kernel\ Flags" "$tempOCBP" )
+ sudo /usr/libexec/plistbuddy -c "Delete :Kernel\ Flags" "$tempOCBP"
+
+ # Merge new org.chameleon.Boot.plist (holding.plist)
+ # with their currently existing one.
+ "$scriptDir"InstallLog.sh "${dest_vol}" "------
+Merging new options into org.chameleon.Boot.plist.
NOTE: Please check the new merged org.chameleon.Boot.plist as
NOTE: any existing keys will NOT have been updated.
NOTE: For example: If you already had Wait=No as a boot option
-NOTE: and chose Wait=Yes from the list, this will NOT be changed."
- sudo /usr/libexec/plistbuddy -c "Merge $chamTemp/holding.plist" "$tempOCBP"
-
- # Combine new kernel flags with old ones.
- kernelFlagString="${kernelFlagString} $currentFlags"
- # Write complete kernel flag entry back.
- sudo /usr/libexec/plistbuddy -c "Add :Kernel\ Flags string $kernelFlagString" "$tempOCBP"
- if [ ${returnValue}=1 ]; then # key already exists.
- sudo /usr/libexec/plistbuddy -c "Delete :Kernel\ Flags" "$tempOCBP"
- sudo /usr/libexec/plistbuddy -c "Add :Kernel\ Flags string $kernelFlagString" "$tempOCBP"
- fi
-
- elif [ -e "$chamTemp/install_type_new" ]; then
- "$scriptDir"InstallLog.sh "${dest_vol}" "User selected to make a new install."
- # Add kernel flags (if any)
- if [ $kernelFlagCount -gt 0 ]; then
- sudo /usr/libexec/plistbuddy -c "Add :Kernel\ Flags string $kernelFlagString" "$tempOCBP"
- if [ ${returnValue}=1 ]; then # key already exists.
- sudo /usr/libexec/plistbuddy -c "Delete :Kernel\ Flags" "$tempOCBP"
- sudo /usr/libexec/plistbuddy -c "Add :Kernel\ Flags string $kernelFlagString" "$tempOCBP"
- fi
- fi
- fi
-
+NOTE: and chose Wait=Yes from the list, this will NOT be changed.
+------"
+ sudo /usr/libexec/plistbuddy -c "Merge $chamTemp/holding.plist" "$tempOCBP"
+
+ if [[ -n "$currentFlags" ]];then
+ # Combine new kernel flags with old ones.
+ kernelFlagString="${kernelFlagString} $currentFlags"
+ fi
+
+ elif [ -e "$chamTemp/install_type_new" ]; then
+ "$scriptDir"InstallLog.sh "${dest_vol}" "User selected to make a new install."
+ fi
+
+ # Write kernel flags option
+ kernelFlagString=$(echo ${kernelFlagString}) # Remove leading and trailing spaces
+ if [[ -n "$kernelFlagString" ]];then
+ sudo /usr/libexec/plistbuddy -c "Add :Kernel\ Flags string $kernelFlagString" "$tempOCBP"
+ returnValue=$?
+ if [ ${returnValue} -ne 0 ]; then # key already exists.
+ sudo /usr/libexec/plistbuddy -c "Delete :Kernel\ Flags" "$tempOCBP"
+ sudo /usr/libexec/plistbuddy -c "Add :Kernel\ Flags string $kernelFlagString" "$tempOCBP"
+ fi
+ fi
+
# ---------------------------------------------
# Copy temp Extra folder to target destination
# ---------------------------------------------
- # If we've made a temporary Extra folder to use then
- # check for an existing /Extra folder. If found, back it up
+ # Check for an existing /Extra folder. If found, back it up
# before copying the temporary Extra folder to destination.
# Extra folder now resides in /usr/local/chamTemp/
# Copy /usr/local/chamTemp/Extra to correct location.
- if [ -d "$chamTemp"/Extra ]; then
- if [ ! -f "$dest_vol"/.ChameleonEFI ]; then
- # The Standard install option chosen
+ if [ ! -f "$dest_vol"/.ChameleonEFI ]; then
+ # The Standard install option chosen
- # Does an /Extra folder already exist?
- if [ -e "$dest_vol"/Extra ]; then
- "$scriptDir"InstallLog.sh "${dest_vol}" "Moving $dest_vol/Extra folder to $dest_vol/Extra-OLD-$( date "+%H-%M-%S" )"
- mv "$dest_vol/Extra" "$dest_vol/Extra_OLD-"$( date "+%H-%M-%S" )
- fi
- "$scriptDir"InstallLog.sh "${dest_vol}" "Writing new Extra folder to: $dest_vol/"
- echo "Copying $chamTemp/Extra TO $dest_vol"
- cp -R "$chamTemp"/Extra "$dest_vol"
- else
- # The EFI system partition install option was chosen
- # Does a /Volumes/Extra folder already exist?
- if [ -e "/Volumes/EFI/Extra" ]; then
- "$scriptDir"InstallLog.sh "${dest_vol}" "Moving /Volumes/EFI/Extra folder to /Volumes/EFI/Extra-OLD-$( date "+%H-%M-%S" )"
- mv "/Volumes/EFI/Extra" "/Volumes/EFI/Extra_OLD-"$( date "+%H-%M-%S" )
- fi
- "$scriptDir"InstallLog.sh "${dest_vol}" "Writing new Extra folder to: /Volumes/EFI/"
- cp -R "$chamTemp"/Extra "/Volumes/EFI"
+ # Does an /Extra folder already exist?
+ if [ -e "$dest_vol"/Extra ]; then
+ "$scriptDir"InstallLog.sh "${dest_vol}" "Moving $dest_vol/Extra folder to $dest_vol/Extra-OLD-$( date "+%H-%M-%S" )"
+ mv "$dest_vol/Extra" "$dest_vol/Extra_OLD-"$( date "+%H-%M-%S" )
fi
+ "$scriptDir"InstallLog.sh "${dest_vol}" "Writing new Extra folder to: $dest_vol/"
+ echo "Copying $chamTemp/Extra TO $dest_vol"
+ cp -R "$chamTemp"/Extra "$dest_vol"
else
- if [ ! -f "$dest_vol"/.ChameleonEFI ]; then
- if [ -e "$dest_vol"/Extra ]; then
- "$scriptDir"InstallLog.sh "${dest_vol}" "No elements selected for adding to an Extra folder,
+ # The EFI system partition install option was chosen
+ # Does a /Volumes/Extra folder already exist?
+ if [ -e "/Volumes/EFI/Extra" ]; then
+ "$scriptDir"InstallLog.sh "${dest_vol}" "Moving /Volumes/EFI/Extra folder to /Volumes/EFI/Extra-OLD-$( date "+%H-%M-%S" )"
+ mv "/Volumes/EFI/Extra" "/Volumes/EFI/Extra_OLD-"$( date "+%H-%M-%S" )
+ fi
+ "$scriptDir"InstallLog.sh "${dest_vol}" "Writing new Extra folder to: /Volumes/EFI/"
+ cp -R "$chamTemp"/Extra "/Volumes/EFI"
+ fi
+else
+ if [ ! -f "$dest_vol"/.ChameleonEFI ]; then
+ if [ -e "$dest_vol"/Extra ]; then
+ "$scriptDir"InstallLog.sh "${dest_vol}" "No elements selected for adding to an Extra folder,
so leaving existing $dest_vol/Extra folder untouched."
- fi
- else
- if [ -e "/Volumes/EFI/Extra" ]; then
- "$scriptDir"InstallLog.sh "${dest_vol}" "No elements selected for adding to an Extra folder,
+ fi
+ else
+ if [ -e "/Volumes/EFI/Extra" ]; then
+ "$scriptDir"InstallLog.sh "${dest_vol}" "No elements selected for adding to an Extra folder,
so leaving existing /Volumes/EFI/Extra folder untouched."
- fi
fi
fi
-
- # Unmount ALL mounted volumes named EFI
- "$scriptDir"UnMountEFIvolumes.sh "${dest_vol}" "${scriptDir}"
-else
- cleanUp="${cleanUp},0"
- rm "$dest_vol"/.ChameleonExists
fi
# ---------------------------------------------
# Cleanup
# ---------------------------------------------
+# Unmount ALL mounted volumes named EFI
+"$scriptDir"UnMountEFIvolumes.sh "${dest_vol}" "${scriptDir}"
+
# remove any temporary boot sector files if they exist
if [ -d /tmp/newbs ]; then
- cleanUp="${cleanUp},1a"
- rm /tmp/newbs
+ cleanUp="${cleanUp},1a"
+ rm /tmp/newbs
fi
if [ -d /tmp/origbs ]; then
- cleanUp="${cleanUp},1b"
- rm /tmp/origbs
+ cleanUp="${cleanUp},1b"
+ rm /tmp/origbs
fi
if [ -d /tmp/newBootSector ]; then
- cleanUp="${cleanUp},1c"
- rm /tmp/newbs
+ cleanUp="${cleanUp},1c"
+ rm /tmp/newbs
fi
if [ -d /tmp/originalBootSector ]; then
- cleanUp="${cleanUp},1d"
- rm /tmp/origbs
+ cleanUp="${cleanUp},1d"
+ rm /tmp/origbs
fi
# delete the temporary Chameleon folder
if [ -e "$chamTemp" ]; then
- cleanUp="${cleanUp},2"
- rm -rf "$chamTemp"
+ cleanUp="${cleanUp},2"
+ rm -rf "$chamTemp"
fi
# Remove /.ChameleonEFI file
if [ -f "$dest_vol"/.ChameleonEFI ]; then
- cleanUp="${cleanUp},3"
- rm "$dest_vol"/.ChameleonEFI
+ cleanUp="${cleanUp},3"
+ rm "$dest_vol"/.ChameleonEFI
fi
"$scriptDir"InstallLog.sh "${dest_vol}" "Cleanup: ${cleanUp}"
Index: branches/ErmaC/Modules/package/Scripts/Main/Standardpostinstall
===================================================================
--- branches/ErmaC/Modules/package/Scripts/Main/Standardpostinstall (revision 1750)
+++ branches/ErmaC/Modules/package/Scripts/Main/Standardpostinstall (revision 1751)
@@ -56,6 +56,7 @@
targetResources="${targetVolume}/usr/local/bin/"
updateStage1=1 # by default update partition boot sector
+efiPartitionExist=0 # target volume does not have EFI system partition.
echo "==============================================="
echo "DEBUG: display script variables"
@@ -82,12 +83,17 @@
"$scriptDir"InstallLog.sh "${targetVolume}" "Target volume = ${targetVolume} on ${targetDevice}"
# Double check we can see the selected partition and it's of the right type.
-# If the following script finds anything, it returns 1 to indicate failure.
+# The following script returns either 0 or 1 to proceed, or 2 to indicate failure.
"$scriptDir"CheckProceed.sh "${targetVolume}" "${targetDevice}" "${targetVolume}" "${scriptDir}"
returnValue=$?
-if [ ${returnValue} = 0 ]; then
+if [ ${returnValue} -ne 2 ]; then
# OK to proceed
+
+ # Remember if the target volume has an EFI system partition.
+ if [ ${returnValue} -ne 1 ]; then
+ efiPartitionExist=1
+ fi
# Does a GRUB or Linux loader already exist in the disk's MBR?
# The script returns 1 if yes, 0 if no.
@@ -162,32 +168,21 @@
# Write the stage 2 loader to the root of the selected partition
"$scriptDir"WriteChameleonStage2.sh "${stage2Loader}" "${3}" "${targetDevice}" "${targetVolume}" "${scriptDir}"
-
# Next we look to check for existing Chameleon installations.
- # But as it will check /Volumes/EFI for the stage 2 loader,
- # we need to make sure it's mounted.
-
- # Tell the user what's going on.
"$scriptDir"InstallLog.sh "${targetVolume}" "LineBreak"
- "$scriptDir"InstallLog.sh "${targetVolume}" "About to check your disk for previous installations"
- "$scriptDir"InstallLog.sh "${targetVolume}" "which involves checking the EFI system partition if"
- "$scriptDir"InstallLog.sh "${targetVolume}" "appropriate for this disk."
-
- # Unmount ALL mounted volumes named EFI.
- # Returns 0=success, 1=fail
- "$scriptDir"UnMountEFIvolumes.sh "${targetVolume}" "${scriptDir}"
- returnValue=$?
- if [ ${returnValue} = 0 ]; then
- # OK to proceed
-
- if [ ${partitionScheme} = 1 ] || [ ${partitionScheme} = 2 ]; then
+ "$scriptDir"InstallLog.sh "${targetVolume}" "Preparing to check target disk for previous installations."
+ if [ ${efiPartitionExist} -ne 0 ]; then # volume has an EFI system partition
+ "$scriptDir"InstallLog.sh "${targetVolume}" "Going to check the EFI system partition also."
+ # Unmount ALL mounted volumes named EFI. Returns 0=success, 1=fail
+ "$scriptDir"UnMountEFIvolumes.sh "${targetVolume}" "${scriptDir}"
+ returnValue=$?
+ if [ ${returnValue} = 0 ]; then
# Mount the EFI system partition
- "$scriptDir"MountESP.sh "${targetDisk}" "${targetVolume}" "${scriptDir}"
+ "$scriptDir"MountESP.sh "${targetDisk}" "${targetVolume}" "${efiPartitionExist}" "${scriptDir}"
fi
-
- # Check for another existing Chameleon installation on the same disk
- "$scriptDir"CheckPreviousChameleon.sh "${targetDisk}" "${targetDeviceRaw}" "${targetDevice}" "${targetVolume}" "${scriptDir}"
fi
+ # Check for another existing Chameleon installation on the same disk
+ "$scriptDir"CheckPreviousChameleon.sh "${targetDisk}" "${targetDeviceRaw}" "${targetDevice}" "${targetVolume}" "${scriptDir}"
# Append a line break to the installer log
"$scriptDir"InstallLog.sh "${targetVolume}" "LineBreak"
Index: branches/ErmaC/Modules/package/Scripts/Sub/CheckPreviousChameleon.sh
===================================================================
--- branches/ErmaC/Modules/package/Scripts/Sub/CheckPreviousChameleon.sh (revision 1750)
+++ branches/ErmaC/Modules/package/Scripts/Sub/CheckPreviousChameleon.sh (revision 1751)
@@ -52,8 +52,7 @@
# if there is more than one partition on the disk.
# ===============================================
if [ $numSlices -gt 1 ]; then
- "$scriptDir"InstallLog.sh "${installerVolume}" "LineBreak"
- "$scriptDir"InstallLog.sh "${installerVolume}" "Checking for previous chameleon installations on ${targetDisk#/dev/}"
+ "$scriptDir"InstallLog.sh "${installerVolume}" "Checking ${targetDisk#/dev/}."
# Check the disk's MBR for existing stage 0 boot code (code from CheckDiskMicrocode.sh script)
stage0type=$( dd 2>/dev/null if="$targetDisk" count=3 bs=1 skip=105 | xxd | awk '{print $2$3}' )
@@ -64,6 +63,7 @@
fi
#Scan all partitions for Chameleon code
+ cleanRun=1
for (( i=1; i <= $numSlices; i++ ));
do
if [ $stage0type == 1 ] || [ $stage0type == 2 ]; then
@@ -108,7 +108,7 @@
"$scriptDir"InstallLog.sh "${installerVolume}" "${message}"
fi
if [ $stagesFound == 3 ] && [ $i -gt $sliceNumber ]; then
- # Exisitng installation found which will no longer be default.
+ # Existing installation found which will no longer be default.
message="NOTE: There is an existing Chameleon installation on $targetDiskRaw
NOTE: but this installation on $targetDevice will be the default loader
NOTE: because you're installing to an earlier partition on the disk."
@@ -131,8 +131,7 @@
if [ $i -lt $sliceNumber ]; then
"$scriptDir"InstallLog.sh "${installerVolume}" "WARN: Conditions point to the possibility of a boot failure"
- # Fix by making previous paritionboot sector un-bootable
- # Change Byte 01FExh to 00 (510 decimal)
+ # Fix by making previous parition bootsector un-bootable
message="---
FIX: Make ${targetDisk}s${i} boot sector un-bootable by changing byte 1FEh to 00.
NOTE: Any Extra folder you had there will still be there. If you want to use
@@ -149,20 +148,12 @@
diskutil unmount "${targetDisk}"s${i}
fi
- if [ "$( fstyp "${targetDisk}"s${i} | grep hfs )" ]; then
- #echo "DEBUG: HFS - changing byte 1FEh to 00"
- dd if=${targetDisk}s${i} count=2 bs=512 of=originalBootSector
- cp originalBootSector newBootSector
- dd if="patch" of=newBootSector bs=1 count=1 seek=510 conv=notrunc
- dd if=newBootSector of=${targetDisk}s${i} count=2 bs=510
- fi
- if [ "$( fstyp "${targetDisk}"s${i} | grep msdos )" ]; then
- #echo "DEBUG: MSDOS - changing byte 1FEh to 00"
- dd if=${targetDisk}s${i} count=1 bs=512 of=/tmp/originalBootSector
- cp /tmp/originalBootSector /tmp/newBootSector
- dd if="$scriptDir/patch" of=/tmp/newBootSector bs=1 count=1 seek=510 conv=notrunc
- dd if=/tmp/newBootSector of=${targetDisk}s${i} count=1 bs=512
- fi
+ # Change Byte 01FExh to 00 (510 decimal)
+ # Same code can be used for HFS or FAT32
+ dd if=${targetDisk}s${i} count=1 bs=512 of=/tmp/originalBootSector
+ cp /tmp/originalBootSector /tmp/newBootSector
+ dd if="$scriptDir/patch" of=/tmp/newBootSector bs=1 count=1 seek=510 conv=notrunc
+ dd if=/tmp/newBootSector of=${targetDisk}s${i} count=1 bs=512
# /Volumes/EFI needs re-mounting so EFI/postinstall script can use it.
# Don't check for a GPT as wouldn't have got here if it wasn't
@@ -182,11 +173,15 @@
#echo "DEBUG: Boot0 not found"
fi
fi
+ else
+ (( cleanRun++ ))
fi
-
done
-#else
- #echo "DEBUG: Just one slice"
+ if [[ $cleanRun == $i ]]; then
+ "$scriptDir"InstallLog.sh "${installerVolume}" "Nothing found that could cause any problems."
+ fi
+else
+ "$scriptDir"InstallLog.sh "${installerVolume}" "Nothing to check as there's only one partition."
fi
exit 0
Index: branches/ErmaC/Modules/package/Scripts/Sub/MountESP.sh
===================================================================
--- branches/ErmaC/Modules/package/Scripts/Sub/MountESP.sh (revision 1750)
+++ branches/ErmaC/Modules/package/Scripts/Sub/MountESP.sh (revision 1751)
@@ -9,34 +9,43 @@
# Receives targetDisk: for example /dev/disk2.
# Receives installerVolume: Volume to write the installer log to.
+# Receives efiPartitionExist: either 0 or 1
# Receives scriptDir: The location of the main script dir.
-if [ "$#" -eq 3 ]; then
+if [ "$#" -eq 4 ]; then
targetDisk="$1"
installerVolume="$2"
- scriptDir="$3"
+ efiPartitionExist="$3"
+ scriptDir="$4"
echo "DEBUG: passed argument for targetDisk = $targetDisk"
echo "DEBUG: passed argument for installerVolume = $installerVolume"
+ echo "DEBUG: passed argument for efiPartitionExist = $efiPartitionExist"
echo "DEBUG: passed argument for scriptDir = $scriptDir"
else
echo "Error - wrong number of values passed"
exit 9
fi
+# Check the first partition is actually type 'EFI'
+# as we could be checking a USB flash drive <4GB
+if [ ${efiPartitionExist} = 1 ]; then
-# Does the mountpoint exist?
-if [ ! -e "/Volumes/EFI" ]; then
- mkdir -p "/Volumes/EFI"
-fi
+ # Does the mountpoint exist?
+ if [ ! -e "/Volumes/EFI" ]; then
+ mkdir -p "/Volumes/EFI"
+ fi
-# Mount '/Volumes/EFI' using the correct format type
-if [ "$( fstyp "${targetDisk}"s1 | grep hfs )" ]; then
- "$scriptDir"InstallLog.sh "${installerVolume}" "Mounting ${targetDisk}s1 as /Volumes/EFI"
- mount_hfs "${targetDisk}"s1 "/Volumes/EFI"
+ # Mount '/Volumes/EFI' using the correct format type
+ if [ "$( fstyp "${targetDisk}"s1 | grep hfs )" ]; then
+ "$scriptDir"InstallLog.sh "${installerVolume}" "Mounting ${targetDisk}s1 as /Volumes/EFI."
+ mount_hfs "${targetDisk}"s1 "/Volumes/EFI"
+ fi
+ if [ "$( fstyp "${targetDisk}"s1 | grep msdos )" ]; then
+ "$scriptDir"InstallLog.sh "${installerVolume}" "Mounting ${targetDisk}s1 as /Volumes/EFI."
+ mount_msdos -u 0 -g 0 "${targetDisk}"s1 "/Volumes/EFI"
+ fi
+else
+ "$scriptDir"InstallLog.sh "${installerVolume}" "Target volume doesn't have an EFI system partition."
fi
-if [ "$( fstyp "${targetDisk}"s1 | grep msdos )" ]; then
- "$scriptDir"InstallLog.sh "${installerVolume}" "Mounting ${targetDisk}s1 as /Volumes/EFI"
- mount_msdos -u 0 -g 0 "${targetDisk}"s1 "/Volumes/EFI"
-fi
-exit 0
\ No newline at end of file
+exit 0
Index: branches/ErmaC/Modules/package/Scripts/Sub/CheckProceed.sh
===================================================================
--- branches/ErmaC/Modules/package/Scripts/Sub/CheckProceed.sh (revision 1750)
+++ branches/ErmaC/Modules/package/Scripts/Sub/CheckProceed.sh (revision 1751)
@@ -6,6 +6,9 @@
# Checks the selected volume is present and the disk is partitioned
# Now also check for another existing Chameleon installation on the same disk.
+# Exit with 0 to indicate okay to proceed, no problems.
+# Exit with 1 to indicate okay to proceed, but target disk doesn't have EFI system partition.
+# Exit with 2 to indicate not to proceed.
# Receives targetVolume: Volume to install to (will be '/Volumes/EFI' if EFI install)
# Receives targetDevice: Stores device number, for example /dev/disk2s1.
@@ -26,40 +29,37 @@
exit 9
fi
-
# Does target volume exist?
if [ -z "$targetVolume" ]; then
echo "*** Cannot find the volume. Exiting."
"$scriptDir"InstallLog.sh "${installerVolume}" "FAIL: Cannot file the volume: $targetVolume."
- exit 1
-#else
- #echo "DEBUG: Confirming target volume exists"
+ exit 2
fi
-
# Does target volume use slices?
if [ "$targetDevice" = "$targetDevice#*disk*s" ]; then
echo "*** ERROR Volume does not use slices. Exiting."
"$scriptDir"InstallLog.sh "${installerVolume}" "FAIL: $targetVolume doesn't use slices."
- exit 1
-#else
- #echo "DEBUG: Confirming target device uses slices"
+ exit 2
fi
+# Check to find if an EFI system partition exists on the disk.
+# This is used in two cases:
+# A) When checking for existing Chameleon installations.
+# B) When the user chooses the EFI system partition install option,
+# and installing to a 'small' HFS device like a 1GB USB flash
+# drive which won't have an EFI System Partition.
-# Add check for installing to a 'small' HFS device like a
-# 1GB USB flash drive which won't have an EFI System Partition.
-if [ "$targetVolume" = "/Volumes/EFI" ]; then
- # Take target device and check slice 1 matches partition named "EFI"
- stripped=$( echo ${targetDevice#/dev/} )
- if [ ! $(echo ${stripped#*disk*s}) = 1 ]; then
- stripped=$( echo ${stripped%s*})"s1"
- fi
- if [ ! $( diskutil list | grep ${stripped} | awk {'print $2'} ) = "EFI" ]; then
- #echo "DEBUG: *** The selected volume doesn't have an EFI System Partition. Exiting."
+# Take target device and check if slice 1 is not named "EFI"
+stripped=$( echo ${targetDevice#/dev/} )
+if [ ! $(echo ${stripped#*disk*s}) = 1 ]; then
+ stripped=$( echo ${stripped%s*})"s1"
+fi
+if [ ! $( diskutil list | grep ${stripped} | awk {'print $2'} ) = "EFI" ]; then
+ if [ "$targetVolume" = "/Volumes/EFI" ]; then
"$scriptDir"InstallLog.sh "${installerVolume}" "FAIL: Selected disk does not have an EFI System Partition."
- exit 1
fi
+ exit 1
fi
exit 0
Index: branches/ErmaC/Modules/package/Resources/ja.lproj/Description.html
===================================================================
--- branches/ErmaC/Modules/package/Resources/ja.lproj/Description.html (revision 1750)
+++ branches/ErmaC/Modules/package/Resources/ja.lproj/Description.html (revision 1751)
@@ -34,7 +34,6 @@
- Automatic P-State & C-State generation for native power management.
- Message logging.
-
The code is released under version 2 of the Gnu Public License.
http://forge.voodooprojects.org/p/chameleon
Index: branches/ErmaC/Modules/package/Resources/he.lproj/Description.html
===================================================================
--- branches/ErmaC/Modules/package/Resources/he.lproj/Description.html (revision 1750)
+++ branches/ErmaC/Modules/package/Resources/he.lproj/Description.html (revision 1751)
@@ -34,7 +34,6 @@
- Automatic P-State & C-State generation for native power management.
- Message logging.
-
The code is released under version 2 of the Gnu Public License.
http://forge.voodooprojects.org/p/chameleon
Index: branches/ErmaC/Modules/package/Resources/bs.lproj/Description.html
===================================================================
--- branches/ErmaC/Modules/package/Resources/bs.lproj/Description.html (revision 1750)
+++ branches/ErmaC/Modules/package/Resources/bs.lproj/Description.html (revision 1751)
@@ -34,7 +34,6 @@
- Automatsko generisanje P-State i C-State za izvorno upravljanje energijom.
- Prijava porukama.
-
Kod je objavljen pod verzijom 2 GNU javna licenca.
http://forge.voodooprojects.org/p/chameleon
Index: branches/ErmaC/Modules/package/Resources/fr.lproj/Description.html
===================================================================
--- branches/ErmaC/Modules/package/Resources/fr.lproj/Description.html (revision 1750)
+++ branches/ErmaC/Modules/package/Resources/fr.lproj/Description.html (revision 1751)
@@ -34,7 +34,6 @@
- Génération automatique des P-State & C-State pour une gestion de l'alimentation native.
- Journalisation des messages console.
-
Le code est publié sous la version 2 de la licence GPL (Gnu Public License).
http://forge.voodooprojects.org/p/chameleon
Index: branches/ErmaC/Modules/package/Resources/fr.lproj/Localizable.strings
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/ErmaC/Modules/package/Resources/nl.lproj/Description.html
===================================================================
--- branches/ErmaC/Modules/package/Resources/nl.lproj/Description.html (revision 1750)
+++ branches/ErmaC/Modules/package/Resources/nl.lproj/Description.html (revision 1751)
@@ -34,7 +34,6 @@
- Automatisch P-State's & C-State's aangemaakt voor automatisch stroombeheer.
- Bericht logboek.
-
De code is vrijgegeven onder versie 2 van de Gnu Public License.
http://forge.voodooprojects.org/p/chameleon
Index: branches/ErmaC/Modules/package/Resources/hr.lproj/Description.html
===================================================================
--- branches/ErmaC/Modules/package/Resources/hr.lproj/Description.html (revision 1750)
+++ branches/ErmaC/Modules/package/Resources/hr.lproj/Description.html (revision 1751)
@@ -34,7 +34,6 @@
- Automatsko generiranje P-State i C-State za izvorno upravljanje energijom.
- Prijava porukama.
-
Kod je objavljen pod verzijom 2 GNU javna licenca.
http://forge.voodooprojects.org/p/chameleon
Index: branches/ErmaC/Modules/package/Resources/pl.lproj/Description.html
===================================================================
--- branches/ErmaC/Modules/package/Resources/pl.lproj/Description.html (revision 1750)
+++ branches/ErmaC/Modules/package/Resources/pl.lproj/Description.html (revision 1751)
@@ -34,7 +34,6 @@
- Automatyczne generowanie stanów P-State & C-State w celu uzyskania natywnego zarządzania energią.
- Logownie komunikatów.
-
Kod jest publikowany z licencją Gnu Public License w wersji 2.
http://forge.voodooprojects.org/p/chameleon
Index: branches/ErmaC/Modules/package/Resources/pt-BR.lproj/Description.html
===================================================================
--- branches/ErmaC/Modules/package/Resources/pt-BR.lproj/Description.html (revision 1750)
+++ branches/ErmaC/Modules/package/Resources/pt-BR.lproj/Description.html (revision 1751)
@@ -34,7 +34,6 @@
- P-State automático & Geração C-State para gestão de energia nativa.
- Protocolo Mensagens.
-
Este código é distribuido sobre os termos da versão 2 da Gnu Public License.
http://forge.voodooprojects.org/p/chameleon
Index: branches/ErmaC/Modules/package/Resources/ru.lproj/Description.html
===================================================================
--- branches/ErmaC/Modules/package/Resources/ru.lproj/Description.html (revision 1750)
+++ branches/ErmaC/Modules/package/Resources/ru.lproj/Description.html (revision 1751)
@@ -34,7 +34,6 @@
- Automatic P-State & C-State generation for native power management.
- Message logging.
-
The code is released under version 2 of the Gnu Public License.
http://forge.voodooprojects.org/p/chameleon
Index: branches/ErmaC/Modules/package/Resources/id.lproj/Description.html
===================================================================
--- branches/ErmaC/Modules/package/Resources/id.lproj/Description.html (revision 1750)
+++ branches/ErmaC/Modules/package/Resources/id.lproj/Description.html (revision 1751)
@@ -34,7 +34,6 @@
- Automatic P-State & C-State generation for native power management.
- Message logging.
-
The code is released under version 2 of the Gnu Public License.
http://forge.voodooprojects.org/p/chameleon
Index: branches/ErmaC/Modules/package/Resources/el.lproj/Description.html
===================================================================
--- branches/ErmaC/Modules/package/Resources/el.lproj/Description.html (revision 1750)
+++ branches/ErmaC/Modules/package/Resources/el.lproj/Description.html (revision 1751)
@@ -34,7 +34,6 @@
- Automatic P-State & C-State generation for native power management.
- Message logging.
-
The code is released under version 2 of the Gnu Public License.
http://forge.voodooprojects.org/p/chameleon
Index: branches/ErmaC/Modules/package/Resources/en.lproj/Description.html
===================================================================
--- branches/ErmaC/Modules/package/Resources/en.lproj/Description.html (revision 1750)
+++ branches/ErmaC/Modules/package/Resources/en.lproj/Description.html (revision 1751)
@@ -34,7 +34,6 @@
- Automatic P-State & C-State generation for native power management.
- Message logging.
-
The code is released under version 2 of the Gnu Public License.
http://forge.voodooprojects.org/p/chameleon
Index: branches/ErmaC/Modules/package/Resources/en.lproj/Localizable.strings
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/ErmaC/Modules/package/Resources/en.lproj/Welcome.rtfd/TXT.rtf
===================================================================
--- branches/ErmaC/Modules/package/Resources/en.lproj/Welcome.rtfd/TXT.rtf (revision 1750)
+++ branches/ErmaC/Modules/package/Resources/en.lproj/Welcome.rtfd/TXT.rtf (revision 1751)
@@ -1,4 +1,4 @@
-{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230
+{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
{\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
{\colortbl;\red255\green255\blue255;\red255\green0\blue9;\red0\green0\blue255;}
\margl1440\margr1440\vieww11660\viewh12980\viewkind0
@@ -12,11 +12,7 @@
\fs26 \cf0 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\
-\fs50 \
-\pard\ri0
-
-\fs22 \cf0 \
-\
+\fs50 \cf0 \
\pard\ri0\qc
\fs28 \cf2 Do not install to an Apple Macintosh computer\
Index: branches/ErmaC/Modules/package/Resources/ar.lproj/Description.html
===================================================================
--- branches/ErmaC/Modules/package/Resources/ar.lproj/Description.html (revision 1750)
+++ branches/ErmaC/Modules/package/Resources/ar.lproj/Description.html (revision 1751)
@@ -34,7 +34,6 @@
- Automatic P-State & C-State generation لادارة الطاقة كما يجب ان يكون .
- Message logging.
-
هذا البرنامج صدر تحت رخضة الاصدار الثانى الهام ل Gnu .
http://forge.voodooprojects.org/p/chameleon
Index: branches/ErmaC/Modules/package/Resources/ar.lproj/Localizable.strings
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/ErmaC/Modules/package/Resources/ar.lproj/Welcome.rtfd/TXT.rtf
===================================================================
--- branches/ErmaC/Modules/package/Resources/ar.lproj/Welcome.rtfd/TXT.rtf (revision 1750)
+++ branches/ErmaC/Modules/package/Resources/ar.lproj/Welcome.rtfd/TXT.rtf (revision 1751)
@@ -11,13 +11,8 @@
\pard\ri0\qc
\fs26 \cf0 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\
-\pard\ri0\qc
\fs50 \cf0 \
-\pard\ri0
-
-\fs22 \cf0 \
-\
\pard\ri0\qc
\f1\fs28 \cf2 \'e1\'c7
Index: branches/ErmaC/Modules/package/Resources/pt-PT.lproj/Description.html
===================================================================
--- branches/ErmaC/Modules/package/Resources/pt-PT.lproj/Description.html (revision 1750)
+++ branches/ErmaC/Modules/package/Resources/pt-PT.lproj/Description.html (revision 1751)
@@ -34,7 +34,6 @@
- P-State automático & Geração C-State para gestão de energia nativa.
- Protocolo Mensagens.
-
Este código é distribuido sobre os termos da versão 2 da Gnu Public License.
http://forge.voodooprojects.org/p/chameleon
Index: branches/ErmaC/Modules/package/Resources/es.lproj/Description.html
===================================================================
--- branches/ErmaC/Modules/package/Resources/es.lproj/Description.html (revision 1750)
+++ branches/ErmaC/Modules/package/Resources/es.lproj/Description.html (revision 1751)
@@ -34,7 +34,6 @@
- Generación automática de P-States & C-States para gestión de energía nativa.
- Registro de Mensajes.
-
El código está liberado bajo la versión 2 de la Licencia Pública GNU.
http://forge.voodooprojects.org/p/chameleon
Index: branches/ErmaC/Modules/package/Resources/es.lproj/Localizable.strings
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/ErmaC/Modules/package/Resources/mk.lproj/Description.html
===================================================================
--- branches/ErmaC/Modules/package/Resources/mk.lproj/Description.html (revision 1750)
+++ branches/ErmaC/Modules/package/Resources/mk.lproj/Description.html (revision 1751)
@@ -34,7 +34,6 @@
- Автоматско генерирање на P-State & C-State за природна контрола на процесорот.
- Логирање на пораки.
-
Овој код е објавен под верзијата 2 од Gnu Public License.
http://forge.voodooprojects.org/p/chameleon
Index: branches/ErmaC/Modules/package/Resources/ko.lproj/Description.html
===================================================================
--- branches/ErmaC/Modules/package/Resources/ko.lproj/Description.html (revision 1750)
+++ branches/ErmaC/Modules/package/Resources/ko.lproj/Description.html (revision 1751)
@@ -39,7 +39,6 @@
- 자동 P-State & C-State 생성기능으로 자연적인 전원 관리.
- 메세지 로깅.
-
이 코드는 GNU 일반 공중 사용 허가서(GPL) 버전 2 아래 공개 되었습니다.
(영문) http://forge.voodooprojects.org/p/chameleon
Index: branches/ErmaC/Modules/package/Resources/it.lproj/Description.html
===================================================================
--- branches/ErmaC/Modules/package/Resources/it.lproj/Description.html (revision 1750)
+++ branches/ErmaC/Modules/package/Resources/it.lproj/Description.html (revision 1751)
@@ -34,7 +34,6 @@
- Generazione automatica dei P-State e C-State.
- Log dei messaggi.
-
Il codice è rilasciato sotto la versione 2 della licenza GPL (Gnu Public License).
http://forge.voodooprojects.org/p/chameleon
Index: branches/ErmaC/Modules/package/Resources/it.lproj/Localizable.strings
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/ErmaC/Modules/package/Resources/it.lproj/Welcome.rtfd/TXT.rtf
===================================================================
--- branches/ErmaC/Modules/package/Resources/it.lproj/Welcome.rtfd/TXT.rtf (revision 1750)
+++ branches/ErmaC/Modules/package/Resources/it.lproj/Welcome.rtfd/TXT.rtf (revision 1751)
@@ -1,4 +1,4 @@
-{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230
+{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
{\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
{\colortbl;\red255\green255\blue255;\red255\green0\blue9;\red0\green0\blue255;}
\margl1440\margr1440\vieww11660\viewh12980\viewkind0
@@ -12,11 +12,7 @@
\fs26 \cf0 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\
-\fs50 \
-\pard\ri0
-
-\fs22 \cf0 \
-\
+\fs50 \cf0 \
\pard\ri0\qc
\fs28 \cf2 Non installare su computer Apple Macintosh\
Index: branches/ErmaC/Modules/package/Resources/sr.lproj/Description.html
===================================================================
--- branches/ErmaC/Modules/package/Resources/sr.lproj/Description.html (revision 1750)
+++ branches/ErmaC/Modules/package/Resources/sr.lproj/Description.html (revision 1751)
@@ -34,7 +34,6 @@
- Automatsko generisanje P-State i C-State za izvorno upravljanje energijom.
- Prijava porukama.
-
Kod je objavljen pod verzijom 2 GNU javna licenca.
http://forge.voodooprojects.org/p/chameleon
Index: branches/ErmaC/Modules/package/Resources/bg.lproj/Description.html
===================================================================
--- branches/ErmaC/Modules/package/Resources/bg.lproj/Description.html (revision 1750)
+++ branches/ErmaC/Modules/package/Resources/bg.lproj/Description.html (revision 1751)
@@ -34,7 +34,6 @@
- Automatic P-State & C-State generation for native power management.
- Message logging.
-
The code is released under version 2 of the Gnu Public License.
http://forge.voodooprojects.org/p/chameleon
Index: branches/ErmaC/Modules/package/Resources/bg.lproj/Localizable.strings
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/ErmaC/Modules/package/Resources/de.lproj/Description.html
===================================================================
--- branches/ErmaC/Modules/package/Resources/de.lproj/Description.html (revision 1750)
+++ branches/ErmaC/Modules/package/Resources/de.lproj/Description.html (revision 1751)
@@ -34,7 +34,6 @@
- Automatische P-State & C-State generation für native power management.
- Message logging.
-
The code is released under version 2 of the Gnu Public License.
http://forge.voodooprojects.org/p/chameleon
Index: branches/ErmaC/Modules/package/Resources/de.lproj/Localizable.strings
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/ErmaC/Modules/package/buildpkg.sh
===================================================================
--- branches/ErmaC/Modules/package/buildpkg.sh (revision 1750)
+++ branches/ErmaC/Modules/package/buildpkg.sh (revision 1751)
@@ -39,607 +39,691 @@
indent[2]="\t\t\t"
indent[3]="\t\t\t\t"
+declare -a pkgrefs
+
+# Package identifiers
+modules_packages_identity="org.chameleon.modules"
+
+getPackageRefId () {
+ echo ${1//_/.}.${2//_/.} | tr [:upper:] [:lower:]
+}
+
+addChoice () {
+ # $1 Choice Id
+ # $2 Choice Options
+ # $3..$n Package reference id (optional)
+ local choiceId="${1}"
+ local choiceOptions="${2}"
+ local choiceNode="\t"
+ done
+ fi
+ choiceNode="${choiceNode}\n\t\n"
+
+ outline[$((outlinecount++))]="${indent[$xmlindent]}"
+ choices[$((choicescount++))]="$choiceNode"
+}
+
+exclusive_one_choice () {
+ # $1 Current choice (ie: test1)
+ # $2..$n Others choice(s) (ie: "test2" "test3"). Current can or can't be in the others choices
+ local myChoice="${1}"
+ local result;
+ local separator=' || ';
+ for choice in ${@:2};do
+ if [[ "$choice" != "$myChoice" ]];then
+ result="${result}choices['$choice'].selected${separator}";
+ fi
+ done
+ echo "!(${result%$separator})"
+}
+
+exclusive_zero_or_one_choice () {
+ # $1 Current choice (ie: test1)
+ # $2..$n Others choice(s) (ie: "test2" "test3"). Current can or can't be in the others choices
+ local myChoice="${1}"
+ local result;
+ echo "(my.choice.selected && $(exclusive_one_choice ${@}))"
+}
+
main ()
{
# clean up the destination path
-rm -R -f "${1}"
-echo ""
-echo -e $COL_CYAN" ----------------------------------"$COL_RESET
-echo -e $COL_CYAN" Building $packagename Install Package"$COL_RESET
-echo -e $COL_CYAN" ----------------------------------"$COL_RESET
-echo ""
+ rm -R -f "${1}"
+ echo ""
+ echo -e $COL_CYAN" ----------------------------------"$COL_RESET
+ echo -e $COL_CYAN" Building $packagename Install Package"$COL_RESET
+ echo -e $COL_CYAN" ----------------------------------"$COL_RESET
+ echo ""
-outline[$((outlinecount++))]="${indent[$xmlindent]}"
+ outline[$((outlinecount++))]="${indent[$xmlindent]}"
# build pre install package
- echo "================= Preinstall ================="
- ((xmlindent++))
- packagesidentity="org.chameleon"
- mkdir -p ${1}/Pre/Root
- mkdir -p ${1}/Pre/Scripts
- ditto --noextattr --noqtn ${1%/*/*}/revision ${1}/Pre/Scripts/Resources/revision
- ditto --noextattr --noqtn ${1%/*/*}/version ${1}/Pre/Scripts/Resources/version
- cp -f ${pkgroot}/Scripts/Main/preinstall ${1}/Pre/Scripts
- cp -f ${pkgroot}/Scripts/Sub/InstallLog.sh ${1}/Pre/Scripts
- echo " [BUILD] Pre "
- buildpackage "${1}/Pre" "/" "" "start_visible=\"false\" start_selected=\"true\"" >/dev/null 2>&1
+ echo "================= Preinstall ================="
+ ((xmlindent++))
+ packagesidentity="org.chameleon"
+ choiceId="Pre"
+ mkdir -p ${1}/${choiceId}/Root
+ mkdir -p ${1}/${choiceId}/Scripts
+ ditto --noextattr --noqtn ${1%/*/*}/revision ${1}/${choiceId}/Scripts/Resources/revision
+ ditto --noextattr --noqtn ${1%/*/*}/version ${1}/${choiceId}/Scripts/Resources/version
+ cp -f ${pkgroot}/Scripts/Main/preinstall ${1}/${choiceId}/Scripts
+ cp -f ${pkgroot}/Scripts/Sub/InstallLog.sh ${1}/${choiceId}/Scripts
+ echo -e "\t[BUILD] ${choiceId} "
+ packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}")
+ buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/" >/dev/null 2>&1
+ addChoice "${choiceId}" "start_visible=\"false\" start_selected=\"true\"" "$packageRefId"
# End build pre install package
# build core package
- echo "================= Core ================="
- packagesidentity="org.chameleon"
- mkdir -p ${1}/Core/Root/usr/local/bin
- mkdir -p ${1}/Core/Root/usr/standalone/i386
- ditto --noextattr --noqtn ${1%/*}/i386/boot ${1}/Core/Root/usr/standalone/i386
- ditto --noextattr --noqtn ${1%/*}/i386/boot0 ${1}/Core/Root/usr/standalone/i386
- ditto --noextattr --noqtn ${1%/*}/i386/boot0md ${1}/Core/Root/usr/standalone/i386
- ditto --noextattr --noqtn ${1%/*}/i386/boot1f32 ${1}/Core/Root/usr/standalone/i386
- ditto --noextattr --noqtn ${1%/*}/i386/boot1h ${1}/Core/Root/usr/standalone/i386
- ditto --noextattr --noqtn ${1%/*}/i386/boot1he ${1}/Core/Root/usr/standalone/i386
- ditto --noextattr --noqtn ${1%/*}/i386/boot1hp ${1}/Core/Root/usr/standalone/i386
- ditto --noextattr --noqtn ${1%/*}/i386/cdboot ${1}/Core/Root/usr/standalone/i386
- ditto --noextattr --noqtn ${1%/*}/i386/chain0 ${1}/Core/Root/usr/standalone/i386
- ditto --noextattr --noqtn ${1%/*}/i386/fdisk440 ${1}/Core/Root/usr/local/bin
- ditto --noextattr --noqtn ${1%/*}/i386/bdmesg ${1}/Core/Root/usr/local/bin
- local coresize=$( du -hkc "${1}/Core/Root" | tail -n1 | awk {'print $1'} )
- echo " [BUILD] i386 "
- buildpackage "${1}/Core" "/" "0" "start_visible=\"false\" start_selected=\"true\"" >/dev/null 2>&1
+ echo "================= Core ================="
+ packagesidentity="org.chameleon"
+ choiceId="Core"
+ mkdir -p ${1}/${choiceId}/Root/usr/local/bin
+ mkdir -p ${1}/${choiceId}/Root/usr/standalone/i386
+ ditto --noextattr --noqtn ${1%/*}/i386/boot ${1}/${choiceId}/Root/usr/standalone/i386
+ ditto --noextattr --noqtn ${1%/*}/i386/boot0 ${1}/${choiceId}/Root/usr/standalone/i386
+ ditto --noextattr --noqtn ${1%/*}/i386/boot0md ${1}/${choiceId}/Root/usr/standalone/i386
+ ditto --noextattr --noqtn ${1%/*}/i386/boot1f32 ${1}/${choiceId}/Root/usr/standalone/i386
+ ditto --noextattr --noqtn ${1%/*}/i386/boot1h ${1}/${choiceId}/Root/usr/standalone/i386
+ ditto --noextattr --noqtn ${1%/*}/i386/boot1he ${1}/${choiceId}/Root/usr/standalone/i386
+ ditto --noextattr --noqtn ${1%/*}/i386/boot1hp ${1}/${choiceId}/Root/usr/standalone/i386
+ ditto --noextattr --noqtn ${1%/*}/i386/cdboot ${1}/${choiceId}/Root/usr/standalone/i386
+ ditto --noextattr --noqtn ${1%/*}/i386/chain0 ${1}/${choiceId}/Root/usr/standalone/i386
+ ditto --noextattr --noqtn ${1%/*}/i386/fdisk440 ${1}/${choiceId}/Root/usr/local/bin
+ ditto --noextattr --noqtn ${1%/*}/i386/bdmesg ${1}/${choiceId}/Root/usr/local/bin
+ echo -e "\t[BUILD] ${choiceId} "
+ packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}")
+ buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/" >/dev/null 2>&1
+ addChoice "${choiceId}" "start_visible=\"false\" start_selected=\"true\"" "$packageRefId"
# End build core package
-
+
# build install type
- echo "================= Chameleon ================="
- outline[$((outlinecount++))]="${indent[$xmlindent]}"
- choices[$((choicescount++))]="\t\n\t\n"
- ((xmlindent++))
- packagesidentity="org.chameleon.type"
-
- # build new install package
- mkdir -p ${1}/New/Root
- echo "" > "${1}/New/Root/install_type_new"
- echo " [BUILD] New "
- buildpackage "${1}/New" "/$chamTemp" "" "start_enabled=\"true\" selected=\"exclusive(choices['Upgrade'])\"" >/dev/null 2>&1
- # End build new install package
+ echo "================= Chameleon ================="
+ outline[$((outlinecount++))]="${indent[$xmlindent]}"
+ choices[$((choicescount++))]="\t\n\t\n"
+ ((xmlindent++))
+ packagesidentity="org.chameleon.type"
+ allChoices="New Upgrade"
- # build upgrade package
- mkdir -p ${1}/Upgrade/Root
- echo "" > "${1}/Upgrade/Root/install_type_upgrade"
- echo " [BUILD] Upgrade "
- buildpackage "${1}/Upgrade" "/$chamTemp" "" "start_selected=\"false\" selected=\"exclusive(choices['New'])\"" >/dev/null 2>&1
- # End build upgrade package
+ # build new install package
+ choiceId="New"
+ mkdir -p ${1}/${choiceId}/Root
+ echo "" > "${1}/${choiceId}/Root/install_type_new"
+ echo -e "\t[BUILD] ${choiceId} "
+ packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}")
+ buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/$chamTemp" >/dev/null 2>&1
+ exclusiveChoice=$(exclusive_one_choice "$choiceId" "$allChoices")
+ addChoice "${choiceId}" "start_selected=\"!choices['Upgrade'].selected\" selected=\"${exclusiveChoice}\"" "$packageRefId"
+ # End build new install package
+ # build upgrade package
+ choiceId="Upgrade"
+ mkdir -p ${1}/${choiceId}/Root
+ echo "" > "${1}/${choiceId}/Root/install_type_upgrade"
+ echo -e "\t[BUILD] ${choiceId} "
+ packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}")
+ buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/$chamTemp" >/dev/null 2>&1
+ exclusiveChoice=$(exclusive_one_choice "$choiceId" "$allChoices")
+ addChoice "${choiceId}" "start_selected=\"chameleon_boot_plist_exists()\" selected=\"${exclusiveChoice}\"" "$packageRefId"
+ # End build upgrade package
+
((xmlindent--))
outline[$((outlinecount++))]="${indent[$xmlindent]}"
-# End build install type
+# End build install type
# build Chameleon package
- echo "================= Chameleon ================="
- outline[$((outlinecount++))]="${indent[$xmlindent]}"
- choices[$((choicescount++))]="\t\n\t\n"
- ((xmlindent++))
-
- # build standard package
- mkdir -p ${1}/Standard/Root
- mkdir -p ${1}/Standard/Scripts/Resources
- cp -f ${pkgroot}/Scripts/Main/Standardpostinstall ${1}/Standard/Scripts/postinstall
- cp -f ${pkgroot}/Scripts/Sub/* ${1}/Standard/Scripts
- ditto --arch i386 `which SetFile` ${1}/Standard/Scripts/Resources/SetFile
- echo " [BUILD] Standard "
- buildpackage "${1}/Standard" "/" "${coresize}" "start_enabled=\"true\" selected=\"exclusive(choices['EFI']) && exclusive(choices['noboot'])\"" >/dev/null 2>&1
- # End build standard package
+ echo "================= Chameleon ================="
+ outline[$((outlinecount++))]="${indent[$xmlindent]}"
+ choices[$((choicescount++))]="\t\n\t\n"
+ ((xmlindent++))
- # build efi package
- mkdir -p ${1}/EFI/Root
- mkdir -p ${1}/EFI/Scripts/Resources
- cp -f ${pkgroot}/Scripts/Main/ESPpostinstall ${1}/EFI/Scripts/postinstall
- cp -f ${pkgroot}/Scripts/Sub/* ${1}/EFI/Scripts
- ditto --arch i386 `which SetFile` ${1}/EFI/Scripts/Resources/SetFile
- echo " [BUILD] EFI "
- buildpackage "${1}/EFI" "/" "${coresize}" "start_visible=\"systemHasGPT()\" selected=\"exclusive(choices['Standard']) && exclusive(choices['noboot'])\"" >/dev/null 2>&1
- # End build efi package
+ allChoices="Standard EFI noboot"
- # build reset choice package
- mkdir -p ${1}/noboot/Root
- echo " [BUILD] Reset choice "
- buildpackage "${1}/noboot" "/$chamTemp" "" "selected=\"exclusive(choices['Standard']) && exclusive(choices['EFI'])\"" >/dev/null 2>&1
- # End build reset choice package
+ # build standard package
+ choiceId="Standard"
+ mkdir -p ${1}/${choiceId}/Root
+ mkdir -p ${1}/${choiceId}/Scripts/Resources
+ cp -f ${pkgroot}/Scripts/Main/${choiceId}postinstall ${1}/${choiceId}/Scripts/postinstall
+ cp -f ${pkgroot}/Scripts/Sub/* ${1}/${choiceId}/Scripts
+ ditto --arch i386 `which SetFile` ${1}/${choiceId}/Scripts/Resources/SetFile
+ echo -e "\t[BUILD] ${choiceId} "
+ packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}")
+ buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/" >/dev/null 2>&1
+ exclusiveChoice=$(exclusive_one_choice "$choiceId" "$allChoices")
+ addChoice "${choiceId}" "start_selected=\"true\" selected=\"${exclusiveChoice}\"" "$packageRefId"
+ # End build standard package
+ # build efi package
+ choiceId="EFI"
+ mkdir -p ${1}/${choiceId}/Root
+ mkdir -p ${1}/${choiceId}/Scripts/Resources
+ cp -f ${pkgroot}/Scripts/Main/ESPpostinstall ${1}/${choiceId}/Scripts/postinstall
+ cp -f ${pkgroot}/Scripts/Sub/* ${1}/${choiceId}/Scripts
+ ditto --arch i386 `which SetFile` ${1}/${choiceId}/Scripts/Resources/SetFile
+ echo -e "\t[BUILD] ${choiceId} "
+ packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}")
+ buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/" >/dev/null 2>&1
+ exclusiveChoice=$(exclusive_one_choice "$choiceId" "$allChoices")
+ addChoice "${choiceId}" "start_visible=\"systemHasGPT()\" start_selected=\"false\" selected=\"${exclusiveChoice}\"" "$packageRefId"
+ # End build efi package
+
+ # build no bootloader choice package
+ choiceId="noboot"
+ mkdir -p ${1}/${choiceId}/Root
+ echo -e "\t[BUILD] ${choiceId} "
+ packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}")
+ buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/" >/dev/null 2>&1
+ exclusiveChoice=$(exclusive_one_choice "$choiceId" "$allChoices")
+ addChoice "${choiceId}" "start_selected=\"false\" selected=\"${exclusiveChoice}\"" "$packageRefId"
+ # End build no bootloader choice package
+
((xmlindent--))
outline[$((outlinecount++))]="${indent[$xmlindent]}"
# End build Chameleon package
# build Modules package
- echo "================= Modules ================="
- ###############################
- # Supported Modules #
- ###############################
- # AMDGraphicsEnabler.dylib #
- # ATiGraphicsEnabler.dylib #
- # IntelGraphicsEnabler.dylib #
- # klibc.dylib #
- # NVIDIAGraphicsEnabler.dylib #
- # Resolution.dylib #
- # uClibcxx.dylib #
- # Keylayout.dylib #
- ###############################
- if [ "$(ls -A "${1%/*}/i386/modules")" ]; then
- {
- outline[$((outlinecount++))]="${indent[$xmlindent]}"
- choices[$((choicescount++))]="\t\n\t\n"
- ((xmlindent++))
- packagesidentity="org.chameleon.modules"
+ echo "================= Modules ================="
+ ###############################
+ # Supported Modules #
+ ###############################
+ # AMDGraphicsEnabler.dylib #
+ # ATiGraphicsEnabler.dylib #
+ # IntelGraphicsEnabler.dylib #
+ # klibc.dylib #
+ # NVIDIAGraphicsEnabler.dylib #
+ # Resolution.dylib #
+ # uClibcxx.dylib #
+ # Keylayout.dylib #
+ ###############################
+ if [ "$(ls -A "${1%/*}/i386/modules")" ]; then
+ {
+ outline[$((outlinecount++))]="${indent[$xmlindent]}"
+ choices[$((choicescount++))]="\t\n\t\n"
+ ((xmlindent++))
+
# -
- if [ -e ${1%/*}/i386/modules/klibc.dylib ]; then
- {
- mkdir -p ${1}/klibc/Root
- ditto --noextattr --noqtn ${1%/*}/i386/modules/klibc.dylib ${1}/klibc/Root
- echo " [BUILD] klibc "
- buildpackage "${1}/klibc" "/$chamTemp/Extra/modules" "" "start_selected=\"false\"" >/dev/null 2>&1
- }
- fi
+ if [ -e ${1%/*}/i386/modules/klibc.dylib ]; then
+ {
+ # Start build klibc package module
+ choiceId="klibc"
+ mkdir -p ${1}/${choiceId}/Root
+ ditto --noextattr --noqtn ${1%/*}/i386/modules/${choiceId}.dylib ${1}/${choiceId}/Root
+ echo -e "\t[BUILD] ${choiceId} "
+ packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}")
+ buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/$chamTemp/Extra/modules" >/dev/null 2>&1
+ addChoice "${choiceId}" "start_selected=\"false\"" "$packageRefId"
+ # End build klibc package module
+ }
+ fi
+
# -
- if [ -e ${1%/*}/i386/modules/uClibcxx.dylib ]; then
- {
- mkdir -p ${1}/uClibc/Root
- ditto --noextattr --noqtn ${1%/*}/i386/modules/uClibcxx.dylib ${1}/uClibc/Root
- ditto --noextattr --noqtn ${1%/*}/i386/modules/klibc.dylib ${1}/uClibc/Root
- echo " [BUILD] uClibc++ "
- buildpackage "${1}/uClibc" "/$chamTemp/Extra/modules" "" "start_selected=\"false\"" >/dev/null 2>&1
- }
- fi
+ if [ -e ${1%/*}/i386/modules/uClibcxx.dylib ]; then
+ {
+ # Start build uClibc package module
+ choiceId="uClibc"
+ mkdir -p ${1}/${choiceId}/Root
+ ditto --noextattr --noqtn ${1%/*}/i386/modules/uClibcxx.dylib ${1}/${choiceId}/Root
+ echo -e "\t[BUILD] ${choiceId} "
+ packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}")
+ buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/$chamTemp/Extra/modules" >/dev/null 2>&1
+ # Add the klibc package because the uClibc module is dependent of klibc module
+ addChoice "${choiceId}" "start_selected=\"false\"" \
+ "$packageRefId" $(getPackageRefId "${modules_packages_identity}" "klibc")
+ # End build uClibc package module
+ }
+ fi
+
# -
- if [ -e ${1%/*}/i386/modules/Resolution.dylib ]; then
- {
- mkdir -p ${1}/AutoReso/Root
- ditto --noextattr --noqtn ${1%/*}/i386/modules/Resolution.dylib ${1}/AutoReso/Root
- echo " [BUILD] Resolution "
- buildpackage "${1}/AutoReso" "/$chamTemp/Extra/modules" "" "start_selected=\"false\"" >/dev/null 2>&1
- }
- fi
+ if [ -e ${1%/*}/i386/modules/Resolution.dylib ]; then
+ {
+ # Start build Resolution package module
+ choiceId="AutoReso"
+ mkdir -p ${1}/${choiceId}/Root
+ ditto --noextattr --noqtn ${1%/*}/i386/modules/Resolution.dylib ${1}/${choiceId}/Root
+ echo -e "\t[BUILD] ${choiceId} "
+ packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}")
+ buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/$chamTemp/Extra/modules" >/dev/null 2>&1
+ addChoice "${choiceId}" "start_selected=\"false\"" "$packageRefId"
+ # End build Resolution package module
+ }
+ fi
+
# -
- # Warning Keylayout module need additional files
- if [ -e ${1%/*}/i386/modules/Keylayout.dylib ]; then
- {
- mkdir -p ${1}/Keylayout/Root/Extra/{modules,Keymaps}
- mkdir -p ${1}/Keylayout/Root/usr/local/bin
- layout_src_dir="${1%/sym/*}/i386/modules/Keylayout/layouts/layouts-src"
- if [ -d "$layout_src_dir" ];then
- # Create a tar.gz from layout sources
- (cd "$layout_src_dir"; \
- tar czf "${1}/Keylayout/Root/Extra/Keymaps/layouts-src.tar.gz" README *.slt)
- fi
- # Adding module
- ditto --noextattr --noqtn ${1%/*}/i386/modules/Keylayout.dylib ${1}/Keylayout/Root/Extra/modules
- # Adding Keymaps
- ditto --noextattr --noqtn ${1%/sym/*}/Keymaps ${1}/Keylayout/Root/Extra/Keymaps
- # Adding tools
- ditto --noextattr --noqtn ${1%/*}/i386/cham-mklayout ${1}/Keylayout/Root/usr/local/bin
- echo " [BUILD] Keylayout "
- buildpackage "${1}/Keylayout" "/" "" "start_selected=\"true\"" >/dev/null 2>&1
- }
- fi
+ # Warning Keylayout module need additional files
+ if [ -e ${1%/*}/i386/modules/Keylayout.dylib ]; then
+ {
+ # Start build Keylayout package module
+ choiceId="Keylayout"
+ mkdir -p ${1}/${choiceId}/Root/Extra/{modules,Keymaps}
+ mkdir -p ${1}/${choiceId}/Root/usr/local/bin
+ layout_src_dir="${1%/sym/*}/i386/modules/Keylayout/layouts/layouts-src"
+ if [ -d "$layout_src_dir" ];then
+ # Create a tar.gz from layout sources
+ (cd "$layout_src_dir"; \
+ tar czf "${1}/Keylayout/Root/Extra/Keymaps/layouts-src.tar.gz" README *.slt)
+ fi
+ # Adding module
+ ditto --noextattr --noqtn ${1%/*}/i386/modules/${choiceId}.dylib ${1}/${choiceId}/Root/Extra/modules
+ # Adding Keymaps
+ ditto --noextattr --noqtn ${1%/sym/*}/Keymaps ${1}/${choiceId}/Root/Extra/Keymaps
+ # Adding tools
+ ditto --noextattr --noqtn ${1%/*}/i386/cham-mklayout ${1}/${choiceId}/Root/usr/local/bin
+ echo -e "\t[BUILD] ${choiceId} "
+ packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}")
+ buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/$chamTemp" >/dev/null 2>&1
+
+ # Don't add a choice for Keylayout module
+ # addChoice "${choiceId}" "start_selected=\"false\"" "$packageRefId"
+ # End build Keylayout package module
+ }
+ fi
+
# -
- if [ -e ${1%/*}/i386/modules/AMDGraphicsEnabler.dylib ]; then
- {
- mkdir -p ${1}/AMDGraphicsEnabler/Root
- ditto --noextattr --noqtn ${1%/*}/i386/modules/AMDGraphicsEnabler.dylib ${1}/AMDGraphicsEnabler/Root
- echo " [BUILD] AMDGraphicsEnabler "
- buildpackage "${1}/AMDGraphicsEnabler" "/$chamTemp/Extra/modules" "" "start_selected=\"false\"" >/dev/null 2>&1
- }
- fi
+
+ if [ -e ${1%/*}/i386/modules/AMDGraphicsEnabler.dylib ]; then
+ {
+ # Start build AMDGraphicsEnabler package module
+ choiceId="AMDGraphicsEnabler"
+ mkdir -p ${1}/${choiceId}/Root
+ ditto --noextattr --noqtn ${1%/*}/i386/modules/AMDGraphicsEnabler.dylib ${1}/${choiceId}/Root
+ echo -e "\t[BUILD] ${choiceId} "
+ packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}")
+ buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/$chamTemp/Extra/modules" >/dev/null 2>&1
+ addChoice "${choiceId}" "start_selected=\"false\"" "$packageRefId"
+ # End build AMDGraphicsEnabler package module
+ }
+ fi
+
# -
- if [ -e ${1%/*}/i386/modules/ATiGraphicsEnabler.dylib ]; then
- {
- mkdir -p ${1}/ATiGraphicsEnabler/Root
- ditto --noextattr --noqtn ${1%/*}/i386/modules/ATiGraphicsEnabler.dylib ${1}/ATiGraphicsEnabler/Root
- echo " [BUILD] ATiGraphicsEnabler "
- buildpackage "${1}/ATiGraphicsEnabler" "/$chamTemp/Extra/modules" "" "start_selected=\"false\"" >/dev/null 2>&1
- }
- fi
+
+ if [ -e ${1%/*}/i386/modules/ATiGraphicsEnabler.dylib ]; then
+ {
+ # Start build ATiGraphicsEnabler package module
+ choiceId="AMDGraphicsEnabler"
+ mkdir -p ${1}/${choiceId}/Root
+ ditto --noextattr --noqtn ${1%/*}/i386/modules/ATiGraphicsEnabler.dylib ${1}/${choiceId}/Root
+ echo -e "\t[BUILD] ${choiceId} "
+ packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}")
+ buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/$chamTemp/Extra/modules" >/dev/null 2>&1
+ addChoice "${choiceId}" "start_selected=\"false\"" "$packageRefId"
+ # End build ATiGraphicsEnabler package module
+ }
+ fi
+
# -
- if [ -e ${1%/*}/i386/modules/IntelGraphicsEnabler.dylib ]; then
- {
- mkdir -p ${1}/IntelGraphicsEnabler/Root
- ditto --noextattr --noqtn ${1%/*}/i386/modules/IntelGraphicsEnabler.dylib ${1}/IntelGraphicsEnabler/Root
- echo " [BUILD] IntelGraphicsEnabler "
- buildpackage "${1}/IntelGraphicsEnabler" "/$chamTemp/Extra/modules" "" "start_selected=\"false\"" >/dev/null 2>&1
- }
- fi
+
+ if [ -e ${1%/*}/i386/modules/IntelGraphicsEnabler.dylib ]; then
+ {
+ # Start build ATiGraphicsEnabler package module
+ choiceId="IntelGraphicsEnabler"
+ mkdir -p ${1}/${choiceId}/Root
+ ditto --noextattr --noqtn ${1%/*}/i386/modules/IntelGraphicsEnabler.dylib ${1}/${choiceId}/Root
+ echo -e "\t[BUILD] ${choiceId} "
+ packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}")
+ buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/$chamTemp/Extra/modules" >/dev/null 2>&1
+ addChoice "${choiceId}" "start_selected=\"false\"" "$packageRefId"
+ # End build IntelGraphicsEnabler package module
+ }
+ fi
+
# -
- if [ -e ${1%/*}/i386/modules/NVIDIAGraphicsEnabler.dylib ]; then
- {
- mkdir -p ${1}/NVIDIAGraphicsEnabler/Root
- ditto --noextattr --noqtn ${1%/*}/i386/modules/NVIDIAGraphicsEnabler.dylib ${1}/NVIDIAGraphicsEnabler/Root
- echo " [BUILD] NVIDIAGraphicsEnabler "
- buildpackage "${1}/NVIDIAGraphicsEnabler" "/$chamTemp/Extra/modules" "" "start_selected=\"false\"" >/dev/null 2>&1
- }
- fi
- ((xmlindent--))
- outline[$((outlinecount++))]="${indent[$xmlindent]}"
- }
- else
- {
- echo " -= no modules to include =-"
- }
- fi
+ if [ -e ${1%/*}/i386/modules/NVIDIAGraphicsEnabler.dylib ]; then
+ {
+ # Start build NVIDIAGraphicsEnabler package module
+ choiceId="NVIDIAGraphicsEnabler"
+ mkdir -p ${1}/${choiceId}/Root
+ ditto --noextattr --noqtn ${1%/*}/i386/modules/NVIDIAGraphicsEnabler.dylib ${1}/${choiceId}/Root
+ echo -e "\t[BUILD] ${choiceId} "
+ packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}")
+ buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/$chamTemp/Extra/modules" >/dev/null 2>&1
+ addChoice "${choiceId}" "start_selected=\"false\"" "$packageRefId"
+ # End build NVIDIAGraphicsEnabler package module
+ }
+ fi
+
+ ((xmlindent--))
+ outline[$((outlinecount++))]="${indent[$xmlindent]}"
+ }
+ else
+ {
+ echo " -= no modules to include =-"
+ }
+ fi
# End build Modules packages
-# build Extras package
- # build options packages
+# build Options packages
- outline[$((outlinecount++))]="${indent[$xmlindent]}"
- choices[$((choicescount++))]="\t\n\t\n"
+ outline[$((outlinecount++))]="${indent[$xmlindent]}"
+ choices[$((choicescount++))]="\t\n\t\n"
+ ((xmlindent++))
+
+
+ # ------------------------------------------------------
+ # parse OptionalSettings folder to find files of boot options.
+ # ------------------------------------------------------
+ OptionalSettingsFolder="${pkgroot}/OptionalSettings"
+ OptionalSettingsFiles=($( find "${OptionalSettingsFolder}" -depth 1 ! -name '.svn' ! -name '.DS_Store' ))
+
+ for (( i = 0 ; i < ${#OptionalSettingsFiles[@]} ; i++ ))
+ do
+
+ # Take filename and Strip .txt from end and path from front
+ builtOptionsList=$( echo ${OptionalSettingsFiles[$i]%.txt} )
+ builtOptionsList=$( echo ${builtOptionsList##*/} )
+ echo "================= $builtOptionsList ================="
+ outline[$((outlinecount++))]="${indent[$xmlindent]}"
+ choices[$((choicescount++))]="\t\n\t\n"
((xmlindent++))
+ packagesidentity="org.chameleon.options.$builtOptionsList"
# ------------------------------------------------------
- # parse OptionalSettings folder to find files of boot options.
+ # Read boot option file into an array.
# ------------------------------------------------------
- OptionalSettingsFolder="${pkgroot}/OptionalSettings"
- OptionalSettingsFiles=($( find "${OptionalSettingsFolder}" -depth 1 ! -name '.svn' ! -name '.DS_Store' ))
-
- for (( i = 0 ; i < ${#OptionalSettingsFiles[@]} ; i++ ))
- do
-
- # Take filename and Strip .txt from end and path from front
- builtOptionsList=$( echo ${OptionalSettingsFiles[$i]%.txt} )
- builtOptionsList=$( echo ${builtOptionsList##*/} )
- echo "================= $builtOptionsList ================="
- outline[$((outlinecount++))]="${indent[$xmlindent]}"
- choices[$((choicescount++))]="\t\n\t\n"
- ((xmlindent++))
- packagesidentity="org.chameleon.options.$builtOptionsList"
-
- # ------------------------------------------------------
- # Read boot option file in to an array.
- # ------------------------------------------------------
- availableOptions=() # array to hold the list of boot options, per 'section'.
- exclusiveFlag=0 # used to indicate list has exclusive options.
- exclusiveName="" # will be appended to exclusive 'none' option name.
- count=0 # used as index for stepping through array.
- while read textLine
- do
- # ignore lines in the file beginning with a # and Exclusive=False
- if [[ ${textLine} != \#* ]] && [[ ${textLine} != "Exclusive=False" ]];then
- # check for 'Exclusive=True' option in file
- if [[ ${textLine} == "Exclusive=True" ]];then
- exclusiveFlag=1
- exclusiveName=$builtOptionsList
- else
- availableOptions[count]=$textLine
- ((count++))
- fi
+ availableOptions=() # array to hold the list of boot options, per 'section'.
+ exclusiveFlag=0 # used to indicate list has exclusive options
+ count=0 # used as index for stepping through array.
+ while read textLine; do
+ # ignore lines in the file beginning with a # and Exclusive=False
+ if [[ ${textLine} != \#* ]] && [[ ${textLine} != "Exclusive=False" ]];then
+ # check for 'Exclusive=True' option in file
+ if [[ ${textLine} == "Exclusive=True" ]];then
+ exclusiveFlag=1
+ else
+ availableOptions[${#availableOptions[@]}]=$textLine
fi
- done < ${OptionalSettingsFiles[$i]}
- buildoptionalsettings "$1" "${exclusiveFlag}" "${exclusiveName}"
-
- ((xmlindent--))
- outline[$((outlinecount++))]="${indent[$xmlindent]}"
- done
+ fi
+ done < ${OptionalSettingsFiles[$i]}
- # build KeyLayout options packages
- echo "================= Keymaps Options ================="
- outline[$((outlinecount++))]="${indent[$xmlindent]}"
- choices[$((choicescount++))]="\t\n\t\n"
- ((xmlindent++))
- packagesidentity="org.chameleon.options.keylayout"
-
- # ------------------------------------------------------
- # Available Keylayout boot options are discovered by
- # reading contents of /Keymaps folder after compilation
- # ------------------------------------------------------
- availableOptions=()
- availableOptions=($( find "${1%/sym/*}/Keymaps" -type f -depth 1 -name '*.lyt' | sed 's|.*/||;s|\.lyt||' ))
- # Adjust array contents to match expected format
- # for boot options which is: name:key=value
- for (( i = 0 ; i < ${#availableOptions[@]} ; i++ ))
- do
- availableOptions[i]=${availableOptions[i]}":KeyLayout="${availableOptions[i]}
- done
-
- # to indicate exclusive option, call buildoptionalsettings with the 2nd parameter set to 1 .
- buildoptionalsettings "$1" "1" "keylayout"
-
- ((xmlindent--))
- outline[$((outlinecount++))]="${indent[$xmlindent]}"
+ # ------------------------------------------------------
+ # Loop through options in array and process each in turn
+ # ------------------------------------------------------
+ allChoices="${availableOptions[@]//:*/}"
+ for (( c = 0 ; c < ${#availableOptions[@]} ; c++ )); do
+ textLine=${availableOptions[c]}
+ # split line - taking all before ':' as option name
+ # and all after ':' as key/value
+ optionName=${textLine%:*}
+ keyValue=${textLine##*:}
- # End build KeyLayout options packages
+ # create folders required for each boot option
+ mkdir -p "${1}/$optionName/Root/"
- ((xmlindent--))
- outline[$((outlinecount++))]="${indent[$xmlindent]}"
+ # create dummy file with name of key/value
+ echo "" > "${1}/$optionName/Root/${keyValue}"
- # End build options packages
-
- # build theme packages
- echo "================= Themes ================="
- outline[$((outlinecount++))]="${indent[$xmlindent]}"
- choices[$((choicescount++))]="\t\n\t\n"
- ((xmlindent++))
-
- # Using themes section from Azi's/package branch.
- packagesidentity="org.chameleon.themes"
- artwork="${1%/sym/package}/artwork/themes"
- themes=($( find "${artwork}" -type d -depth 1 -not -name '.svn' ))
- for (( i = 0 ; i < ${#themes[@]} ; i++ ))
- do
- theme=$( echo ${themes[$i]##*/} | awk 'BEGIN{OFS=FS=""}{$1=toupper($1);print}' )
- mkdir -p "${1}/${theme}/Root/"
- rsync -r --exclude=.svn "${themes[$i]}/" "${1}/${theme}/Root/${theme}"
- echo " [BUILD] ${theme}"
- buildpackage "${1}/${theme}" "/$chamTemp/Extra/Themes" "" "start_selected=\"false\"" >/dev/null 2>&1
+ echo -e "\t[BUILD] ${optionName} "
+ packageRefId=$(getPackageRefId "${packagesidentity}" "${optionName}")
+ buildpackage "$packageRefId" "${optionName}" "${1}/${optionName}" "/$chamTemp/options" >/dev/null 2>&1
+ exclusiveSelect=""
+ if [[ ${exclusiveFlag} -eq 1 ]];then
+ exclusiveSelect="selected=\"$(exclusive_zero_or_one_choice "$optionName" "$allChoices")\""
+ fi
+ addChoice "${optionName}" "start_selected=\"false\" ${exclusiveSelect}" "$packageRefId"
done
((xmlindent--))
outline[$((outlinecount++))]="${indent[$xmlindent]}"
- # End build theme packages# End build Extras package
+ done
-# build post install package
- echo "================= Post ================="
- packagesidentity="org.chameleon"
- mkdir -p ${1}/Post/Root
- mkdir -p ${1}/Post/Scripts
- cp -f ${pkgroot}/Scripts/Main/postinstall ${1}/Post/Scripts
- cp -f ${pkgroot}/Scripts/Sub/InstallLog.sh ${1}/Post/Scripts
- cp -f ${pkgroot}/Scripts/Sub/UnMountEFIvolumes.sh ${1}/Post/Scripts
- ditto --noextattr --noqtn ${1%/*/*}/revision ${1}/Post/Scripts/Resources/revision
- ditto --noextattr --noqtn ${1%/*/*}/version ${1}/Post/Scripts/Resources/version
- echo " [BUILD] Post "
- buildpackage "${1}/Post" "/" "" "start_visible=\"false\" start_selected=\"true\"" >/dev/null 2>&1
-# End build post install package
+ # build KeyLayout options packages
+ echo "================= Keymaps Options ================="
+ outline[$((outlinecount++))]="${indent[$xmlindent]}"
+ choices[$((choicescount++))]="\t\n\t\n"
+ ((xmlindent++))
+ packagesidentity="org.chameleon.options.keylayout"
+ keylayoutPackageRefId=$(getPackageRefId "${modules_packages_identity}" "Keylayout")
-((xmlindent--))
-outline[$((outlinecount++))]="${indent[$xmlindent]}"
+ # ------------------------------------------------------
+ # Available Keylayout boot options are discovered by
+ # reading contents of /Keymaps folder after compilation
+ # ------------------------------------------------------
+ availableOptions=($( find "${1%/sym/*}/Keymaps" -type f -depth 1 -name '*.lyt' | sed 's|.*/||;s|\.lyt||' ))
+ allChoices="${availableOptions[@]}"
+ # Adjust array contents to match expected format
+ # for boot options which is: name:key=value
+ for (( i = 0 ; i < ${#availableOptions[@]} ; i++ )); do
+ # availableOptions[i]=${availableOptions[i]}":KeyLayout="${availableOptions[i]}
+ # Start build of a keymap package module
+ choiceId="${availableOptions[i]}"
+ mkdir -p ${1}/${choiceId}/Root
-# build meta package
+ # create dummy file with name of key/value
+ echo "" > "${1}/${choiceId}/Root/KeyLayout=${availableOptions[i]}"
- makedistribution "${1}" "${2}" "${3}" "${4}" #"${5}"
+ echo -e "\t[BUILD] ${choiceId} "
+ packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}")
+ buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/$chamTemp/options" >/dev/null 2>&1
+ exclusiveChoice=$(exclusive_zero_or_one_choice "$choiceId" "$allChoices")
+ # Add the Keylayout package because the Keylayout module is needed
+ addChoice "${choiceId}" "start_selected=\"false\" selected=\"${exclusiveChoice}\"" \
+ "$packageRefId" "$keylayoutPackageRefId"
+ # End build uClibc package module
+ done
-# clean up
+ ((xmlindent--))
+ outline[$((outlinecount++))]="${indent[$xmlindent]}"
- rm -R -f "${1}"
+ # End build KeyLayout options packages
-}
+ ((xmlindent--))
+ outline[$((outlinecount++))]="${indent[$xmlindent]}"
+# End build options packages
-fixperms ()
-{
- # $1 path
- find "${1}" -type f -exec chmod 644 {} \;
- find "${1}" -type d -exec chmod 755 {} \;
- chown -R 0:0 "${1}"
-}
+# build theme packages
+ echo "================= Themes ================="
+ outline[$((outlinecount++))]="${indent[$xmlindent]}"
+ choices[$((choicescount++))]="\t\n\t\n"
+ ((xmlindent++))
-buildoptionalsettings()
-{
- # $1 Path to package to build containing Root and or Scripts
- # $2 = exclusiveFlag
- # S3 = exclusiveName
-
- # ------------------------------------------------------
- # if exclusiveFlag=1 then re-build array
- # adding extra boot option at beginning to give
- #user a chance to choose none of them.
- # ------------------------------------------------------
- if [ ${2} = "1" ]; then
- tempArray=("${availableOptions[@]}")
- availableOptions=()
- availableOptions[0]="ChooseNone-"$3":DONT=ADD"
- position=0
- totalItems="${#tempArray[@]}"
- for (( position = 0 ; position < $totalItems ; position++ ))
- do
- availableOptions[$position+1]=${tempArray[${position}]}
- done
- fi
-
- # ------------------------------------------------------
- # Loop through options in array and process each in turn
- # ------------------------------------------------------
- for (( c = 0 ; c < ${#availableOptions[@]} ; c++ ))
- do
- textLine=${availableOptions[c]}
- # split line - taking all before ':' as option name
- # and all after ':' as key/value
- optionName=${textLine%:*}
- keyValue=${textLine##*:}
+ # Using themes section from Azi's/package branch.
+ packagesidentity="org.chameleon.themes"
+ artwork="${1%/sym/package}/artwork/themes"
+ themes=($( find "${artwork}" -type d -depth 1 -not -name '.svn' ))
+ for (( i = 0 ; i < ${#themes[@]} ; i++ )); do
+ theme=$( echo ${themes[$i]##*/} | awk 'BEGIN{OFS=FS=""}{$1=toupper($1);print}' )
+ mkdir -p "${1}/${theme}/Root/"
+ rsync -r --exclude=.svn "${themes[$i]}/" "${1}/${theme}/Root/${theme}"
+ echo -e "\t[BUILD] ${theme}"
+ packageRefId=$(getPackageRefId "${packagesidentity}" "${theme}")
+ buildpackage "$packageRefId" "${theme}" "${1}/${theme}" "/$chamTemp/Extra/Themes" >/dev/null 2>&1
+ addChoice "${theme}" "start_selected=\"false\"" "$packageRefId"
+ done
- # create folders required for each boot option
- mkdir -p "${1}/$optionName/Root/"
+ ((xmlindent--))
+ outline[$((outlinecount++))]="${indent[$xmlindent]}"
+# End build theme packages# End build Extras package
- # create dummy file with name of key/value
- echo "" > "${1}/$optionName/Root/${keyValue}"
+# build post install package
+ echo "================= Post ================="
+ packagesidentity="org.chameleon"
+ choiceId="Post"
+ mkdir -p ${1}/${choiceId}/Root
+ mkdir -p ${1}/${choiceId}/Scripts
+ cp -f ${pkgroot}/Scripts/Main/postinstall ${1}/${choiceId}/Scripts
+ cp -f ${pkgroot}/Scripts/Sub/InstallLog.sh ${1}/${choiceId}/Scripts
+ cp -f ${pkgroot}/Scripts/Sub/UnMountEFIvolumes.sh ${1}/${choiceId}/Scripts
+ ditto --noextattr --noqtn ${1%/*/*}/revision ${1}/${choiceId}/Scripts/Resources/revision
+ ditto --noextattr --noqtn ${1%/*/*}/version ${1}/${choiceId}/Scripts/Resources/version
+ echo -e "\t[BUILD] ${choiceId} "
+ packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}")
+ buildpackage "$packageRefId" "${choiceId}" "${1}/${choiceId}" "/" >/dev/null 2>&1
+ addChoice "${choiceId}" "start_visible=\"false\" start_selected=\"true\"" "$packageRefId"
+# End build post install package
- echo " [BUILD] ${optionName} "
+ ((xmlindent--))
+ outline[$((outlinecount++))]="${indent[$xmlindent]}"
- # ------------------------------------------------------
- # Before calling buildpackage, add exclusive options
- # to buildpackage call if requested.
- # ------------------------------------------------------
- if [ $2 = "1" ]; then
+# build meta package
- # Prepare individual string parts
- stringStart="selected=\""
- stringBefore="exclusive(choices['"
- stringAfter="']) && "
- stringEnd="'])\""
- x=${stringStart}${stringBefore}
+ makedistribution "${1}" "${2}" "${3}" "${4}" #"${5}"
- # build string for sending to buildpackage
- totalItems="${#availableOptions[@]}"
- lastItem=$((totalItems-1))
+# clean up
+ # rm -R -f "${1}"
- for (( r = 0 ; r < ${totalItems} ; r++ ))
- do
- textLineTemp=${availableOptions[r]}
- optionNameTemp=${textLineTemp%:*}
- if [ "${optionNameTemp}" != "${optionName}" ]; then
- x="${x}${optionNameTemp}"
- # Only add these to end of string up to the one before the last item
- if [ $r -lt $lastItem ]; then
- x="${x}${stringAfter}${stringBefore}"
- fi
- fi
- done
- x="${x}${stringEnd}"
-
- # First exclusive option is the 'no choice' option, so let's make that selected by default.
- if [ $c = 0 ]; then
- initialChoice="true"
- else
- initialChoice="false"
- fi
-
- buildpackage "${1}/${optionName}" "/$chamTemp/options" "" "start_selected=\"${initialChoice}\" ${x}" >/dev/null 2>&1
- else
- buildpackage "${1}/${optionName}" "/$chamTemp/options" "" "start_selected=\"false\"" >/dev/null 2>&1
- fi
- done
}
buildpackage ()
{
-# $1 Path to package to build containing Root and or Scripts
-# $2 Install Location
-# $3 Size
-# $4 Options
+ # $1 Package Reference Id (ie: org.chameleon.themes.default)
+ # $2 Package Name (ie: Default)
+ # $3 Path to package to build containing Root and/or Scripts
+ # $4 Target install location
+ # $5 Size (optional)
+ if [[ -d "${3}/Root" ]]; then
+ local packageRefId="$1"
+ local packageName="$2"
+ local packagePath="$3"
+ local targetPath="$4"
+ local packageSize="$5"
-if [ -d "${1}/Root" ] && [ "${1}/Scripts" ]; then
+ find "${packagePath}" -name '.DS_Store' -delete
+ local filecount=$( find "${packagePath}/Root" | wc -l )
+ if [ "${packageSize}" ]; then
+ local installedsize="${packageSize}"
+ else
+ local installedsize=$( du -hkc "${packagePath}/Root" | tail -n1 | awk {'print $1'} )
+ fi
+ local header="\n\n\n"
+ header+="\t\n"
+ rm -R -f "${packagePath}/Temp"
- header+="auth=\"root\">\n"
- header+="\t\n"
- rm -R -f "${1}/Temp"
+ [ -d "${packagePath}/Temp" ] || mkdir -m 777 "${packagePath}/Temp"
+ [ -d "${packagePath}/Root" ] && mkbom "${packagePath}/Root" "${packagePath}/Temp/Bom"
- [ -d "${1}/Temp" ] || mkdir -m 777 "${1}/Temp"
- [ -d "${1}/Root" ] && mkbom "${1}/Root" "${1}/Temp/Bom"
+ if [ -d "${packagePath}/Scripts" ]; then
+ header+="\t\n"
+ for script in $( find "${packagePath}/Scripts" -type f \( -name 'pre*' -or -name 'post*' \) ); do
+ header+="\t\t<${script##*/} file=\"./${script##*/}\"/>\n"
+ done
+ header+="\t\n"
+ # Create the Script archive file (cpio format)
+ (cd "${packagePath}/Scripts" && find . -print | cpio -o -z -R root:wheel --format cpio > "${packagePath}/Temp/Scripts") 2>&1 | \
+ grep -vE '^[0-9]+\s+blocks?$' # to remove cpio stderr messages
+ fi
- if [ -d "${1}/Scripts" ]; then
- header+="\t\n"
- for script in $( find "${1}/Scripts" -type f \( -name 'pre*' -or -name 'post*' \) )
- do
- header+="\t\t<${script##*/} file=\"./${script##*/}\"/>\n"
- done
- header+="\t\n"
- chown -R 0:0 "${1}/Scripts"
- pushd "${1}/Scripts" >/dev/null
- find . -print | cpio -o -z -H cpio > "../Temp/Scripts"
- popd >/dev/null
- fi
+ header+=""
+ echo -e "${header}" > "${packagePath}/Temp/PackageInfo"
- header+=""
- echo -e "${header}" > "${1}/Temp/PackageInfo"
- pushd "${1}/Root" >/dev/null
- find . -print | cpio -o -z -H cpio > "../Temp/Payload"
- popd >/dev/null
- pushd "${1}/Temp" >/dev/null
+ # Create the Payload file (cpio format)
+ (cd "${packagePath}/Root" && find . -print | cpio -o -z -R root:wheel --format cpio > "${packagePath}/Temp/Payload") 2>&1 | \
+ grep -vE '^[0-9]+\s+blocks?$' # to remove cpio stderr messages
- xar -c -f "${1%/*}/${packagename// /}.pkg" --compression none .
+ # Create the package
+ (cd "${packagePath}/Temp" && xar -c -f "${packagePath}/../${packageName}.pkg" --compression none .)
- popd >/dev/null
+ # Add the package to the list of build packages
+ pkgrefs[${#pkgrefs[*]}]="\t#${packageName}.pkg"
- outline[$((outlinecount++))]="${indent[$xmlindent]}"
-
- if [ "${4}" ]; then
- local choiceoptions="\t\t${4}"
+ rm -rf "${packagePath}"
fi
- choices[$((choicescount++))]="\t\n\t\t#${packagename// /}.pkg\n\t\n"
- rm -R -f "${1}"
-fi
}
makedistribution ()
{
- rm -f "${1%/*}/${packagename// /}"*.pkg
+ distributionDestDir="${1%/*}"
+ distributionFilename="${packagename// /}-${version}-r${revision}.pkg"
+ distributionFilePath="${distributionDestDir}/${distributionFilename}"
- find "${1}" -type f -name '*.pkg' -depth 1 | while read component
+ rm -f "${distributionDestDir}/${packagename// /}"*.pkg
+
+ mkdir -p "${1}/${packagename}"
+
+ find "${1}" -type f -name '*.pkg' -depth 1 | while read component
do
- mkdir -p "${1}/${packagename}/${component##*/}"
- pushd "${1}/${packagename}/${component##*/}" >/dev/null
- xar -x -f "${1%}/${component##*/}"
- popd >/dev/null
+ pkg="${component##*/}" # ie: EFI.pkg
+ pkgdir="${1}/${packagename}/${pkg}"
+ # expand individual packages
+ pkgutil --expand "${1%}/${pkg}" "$pkgdir"
+ rm -f "${1%}/${pkg}"
+ done
+
+# Create the Distribution file
+ ditto --noextattr --noqtn "${pkgroot}/Distribution" "${1}/${packagename}/Distribution"
+
+ for (( i=0; i < ${#outline[*]} ; i++)); do
+ echo -e "${outline[$i]}" >> "${1}/${packagename}/Distribution"
done
- ditto --noextattr --noqtn "${pkgroot}/Distribution" "${1}/${packagename}/Distribution"
- ditto --noextattr --noqtn "${pkgroot}/Resources" "${1}/${packagename}/Resources"
+ for (( i=0; i < ${#choices[*]} ; i++)); do
+ echo -e "${choices[$i]}" >> "${1}/${packagename}/Distribution"
+ done
- find "${1}/${packagename}/Resources" -type d -name '.svn' -exec rm -R -f {} \; 2>/dev/null
+ for (( i=0; i < ${#pkgrefs[*]} ; i++)); do
+ echo -e "${pkgrefs[$i]}" >> "${1}/${packagename}/Distribution"
+ done
- for (( i=0; i < ${#outline[*]} ; i++));
- do
- echo -e "${outline[$i]}" >> "${1}/${packagename}/Distribution"
- done
+ echo -e "\n" >> "${1}/${packagename}/Distribution"
- for (( i=0; i < ${#choices[*]} ; i++));
- do
- echo -e "${choices[$i]}" >> "${1}/${packagename}/Distribution"
- done
+# Create the Resources directory
+ ditto --noextattr --noqtn "${pkgroot}/Resources" "${1}/${packagename}/Resources"
- echo "" >> "${1}/${packagename}/Distribution"
+# CleanUp the directory
+ find "${1}/${packagename}" -type d -name '.svn' -exec rm -rf {} \; 2>/dev/null
+ find "${1}/${packagename}" -name '.DS_Store' -delete
- perl -i -p -e "s/%CHAMELEONVERSION%/${version%%-*}/g" `find "${1}/${packagename}/Resources" -type f`
- perl -i -p -e "s/%CHAMELEONREVISION%/${revision}/g" `find "${1}/${packagename}/Resources" -type f`
+# Add Chameleon Version and Revision
+ perl -i -p -e "s/%CHAMELEONVERSION%/${version%%-*}/g" $( find "${1}/${packagename}/Resources" -type f )
+ perl -i -p -e "s/%CHAMELEONREVISION%/${revision}/g" $( find "${1}/${packagename}/Resources" -type f )
-# Adding Developer and credits
- perl -i -p -e "s/%DEVELOP%/${develop}/g" `find "${1}/${packagename}/Resources" -type f`
- perl -i -p -e "s/%CREDITS%/${credits}/g" `find "${1}/${packagename}/Resources" -type f`
- perl -i -p -e "s/%PKGDEV%/${pkgdev}/g" `find "${1}/${packagename}/Resources" -type f`
+# Add Chameleon Stage
+ stage=${stage/RC/Release Candidate }
+ stage=${stage/FINAL/2.0 Final}
+ perl -i -p -e "s/%CHAMELEONSTAGE%/${stage}/g" $( find "${1}/${packagename}/Resources" -type f )
- stage=${stage/RC/Release Candidate }
- stage=${stage/FINAL/2.0 Final}
- perl -i -p -e "s/%CHAMELEONSTAGE%/${stage}/g" `find "${1}/${packagename}/Resources" -type f`
+# Adding Developer and credits
+ perl -i -p -e "s/%DEVELOP%/${develop}/g" $( find "${1}/${packagename}/Resources" -type f )
+ perl -i -p -e "s/%CREDITS%/${credits}/g" $( find "${1}/${packagename}/Resources" -type f )
+ perl -i -p -e "s/%PKGDEV%/${pkgdev}/g" $( find "${1}/${packagename}/Resources" -type f )
- find "${1}/${packagename}" -name '.DS_Store' -delete
- pushd "${1}/${packagename}" >/dev/null
- xar -c -f "${1%/*}/${packagename// /}-${version}-r${revision}.pkg" --compression none .
- popd >/dev/null
+# Create the final package
+ pkgutil --flatten "${1}/${packagename}" "${distributionFilePath}"
# Here is the place for assign a Icon to the pkg
# command use to generate the file:
# ditto -c -k --sequesterRsrc --keepParent Icon.icns Icon.zip
# ----
- ditto -xk "${pkgroot}/Icons/pkg.zip" "${pkgroot}/Icons/"
- DeRez -only icns "${pkgroot}/Icons/Icons/pkg.icns" > tempicns.rsrc
- Rez -append tempicns.rsrc -o "${1%/*}/$packagename-${version}-r$revision.pkg"
- SetFile -a C "${1%/*}/$packagename-${version}-r$revision.pkg"
- rm -f tempicns.rsrc
- rm -rf "${pkgroot}/Icons/Icons"
+ ditto -xk "${pkgroot}/Icons/pkg.zip" "${1}/Icons/"
+ DeRez -only icns "${1}/Icons/Icons/pkg.icns" > "${1}/Icons/tempicns.rsrc"
+ Rez -append "${1}/Icons/tempicns.rsrc" -o "${distributionFilePath}"
+ SetFile -a C "${distributionFilePath}"
+ rm -rf "${1}/Icons"
+
# End
- md5=$( md5 "${1%/*}/${packagename// /}-${version}-r${revision}.pkg" | awk {'print $4'} )
- echo "MD5 (${packagename// /}-${version}-r${revision}.pkg) = ${md5}" > "${1%/*}/${packagename// /}-${version}-r${revision}.pkg.md5"
- echo ""
+ md5=$( md5 "${distributionFilePath}" | awk {'print $4'} )
+ echo "MD5 (${distributionFilePath}) = ${md5}" > "${distributionFilePath}.md5"
+ echo ""
- echo -e $COL_GREEN" --------------------------"$COL_RESET
- echo -e $COL_GREEN" Building process complete!"$COL_RESET
- echo -e $COL_GREEN" --------------------------"$COL_RESET
- echo ""
- echo -e $COL_GREEN" Build info."
- echo -e $COL_GREEN" ==========="
- echo -e $COL_BLUE" Package name: "$COL_RESET"$packagename-${version}-r$revision.pkg"
- echo -e $COL_BLUE" MD5: "$COL_RESET"$md5"
- echo -e $COL_BLUE" Version: "$COL_RESET"$version"
- echo -e $COL_BLUE" Stage: "$COL_RESET"$stage"
- echo -e $COL_BLUE" Date/Time: "$COL_RESET"$builddate"
- echo ""
+ echo -e $COL_GREEN" --------------------------"$COL_RESET
+ echo -e $COL_GREEN" Building process complete!"$COL_RESET
+ echo -e $COL_GREEN" --------------------------"$COL_RESET
+ echo ""
+ echo -e $COL_GREEN" Build info."
+ echo -e $COL_GREEN" ==========="
+ echo -e $COL_BLUE" Package name: "$COL_RESET"${distributionFilename}"
+ echo -e $COL_BLUE" MD5: "$COL_RESET"$md5"
+ echo -e $COL_BLUE" Version: "$COL_RESET"$version"
+ echo -e $COL_BLUE" Stage: "$COL_RESET"$stage"
+ echo -e $COL_BLUE" Date/Time: "$COL_RESET"$builddate"
+ echo ""
}
main "${1}" "${2}" "${3}" "${4}" #"${5}"
-
Index: branches/ErmaC/Modules/CREDITS
===================================================================
--- branches/ErmaC/Modules/CREDITS (revision 1750)
+++ branches/ErmaC/Modules/CREDITS (revision 1751)
@@ -11,4 +11,4 @@
Package:
---------
-kalyway, AzimutZ, blackosx, ErmaC, scrax
+kalyway, AzimutZ, blackosx, ErmaC, scrax, JrCs
Index: branches/ErmaC/Modules/Make.rules
===================================================================
--- branches/ErmaC/Modules/Make.rules (revision 1750)
+++ branches/ErmaC/Modules/Make.rules (revision 1751)
@@ -141,13 +141,24 @@
|| eval $$failcom; \
done
+
clean-dep:
@if [ -f "$(OBJROOT)/Makedep" ];then echo "\t[RM] $(OBJROOT)/Makedep"; fi
@rm -f $(OBJROOT)/Makedep
+
+FIND_IGNORE := \( -name .git -o -name .svn \) -prune -o -name Cconfig -o
+
+# clean: remove most generated files
clean: clean-recursive clean-dep
distclean: distclean-recursive clean-local clean-dep
+ @find . $(FIND_IGNORE) \
+ \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
+ -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
+ -o -name '.*.rej' -o -size 0 \
+ -o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \
+ -type f -print | xargs rm -f
clean-local:
Index: branches/ErmaC/Modules/CHANGES
===================================================================
--- branches/ErmaC/Modules/CHANGES (revision 1750)
+++ branches/ErmaC/Modules/CHANGES (revision 1751)
@@ -1,3 +1,10 @@
+- Added support for using UUIDs with ext2 filesystems (credits to bitz): http://forge.voodooprojects.org/p/chameleon/issues/208/
+- Added Guerrero's patch on gui.c: http://forge.voodooprojects.org/p/chameleon/issues/178/
+- cparm : Ported the OS detection to the trunk, updated the default theme to v 1.1 (credit to blackosx)
+- Added scorpius's patch (to get an unstretched boot screen for nVidia cards on DVI) in boot0.s,
+ disabled by default: http://forum.voodooprojects.org/index.php/topic,2158.0.html
+- Added exFAT volume label support (FAT64) support (credit to dmazar):
+ http://forum.voodooprojects.org/index.php/topic,2095.0.html
- Added AtiPorts option to GraphicsEnabler, so users can override the default number of ports. It proved
to be useful when used to limit the number of ports that a framebuffer registers, which seems to be a
requirement on laptops that can only use 2 ports at the same time.
Index: branches/ErmaC/Modules/Makefile
===================================================================
--- branches/ErmaC/Modules/Makefile (revision 1750)
+++ branches/ErmaC/Modules/Makefile (revision 1751)
@@ -100,10 +100,14 @@
@mv ${DISTFILE}.tar.gz ${DISTFILE}.tgz
clean-local:
+ @if [ -d "$(SYMROOT)/package" ];then echo "\t[RMDIR] $(SYMROOT)/package"; fi
@if [ -f "$(HEADER_VERSION)" ];then echo "\t[RM] $(HEADER_VERSION)"; fi
@if [ -f "$(SRCROOT)/revision" ];then echo "\t[RM] $(SRCROOT)/revision"; fi
- @rm -f $(HEADER_VERSION) $(SRCROOT)/revision
+ @rm -rf "$(SYMROOT)/package" $(HEADER_VERSION) $(SRCROOT)/revision
+AUTOCONF_FILES = $(SRCROOT)/auto.conf $(SRCROOT)/autoconf.h \
+ $(SRCROOT)/autoconf.inc $(SRCROOT)/.config $(SRCROOT)/.config.old
+
distclean-local:
@if [ -d "$(OBJROOT)" ];then echo "\t[RMDIR] $(OBJROOT)"; fi
@if [ -d "$(SYMROOT)" ];then echo "\t[RMDIR] $(SYMROOT)"; fi
@@ -111,29 +115,38 @@
@if [ -d "$(SRCROOT)/i386/modules/module_includes" ];then \
echo "\t[RMDIR] $(SRCROOT)/i386/modules/module_includes"; \
fi
- @if [ -f "$(SRCROOT)/auto.conf" ];then echo "\t[RM] $(SRCROOT)/auto.conf"; fi
- @if [ -f "$(SRCROOT)/autoconf.h" ];then echo "\t[RM] $(SRCROOT)/autoconf.h"; fi
- @if [ -f "$(SRCROOT)/autoconf.inc" ];then echo "\t[RM] $(SRCROOT)/autoconf.inc"; fi
-
+ @for cfg in $(AUTOCONF_FILES); do if [ -f "$${cfg}" ];then echo "\t[RM] $${cfg}"; fi; done
@rm -rf $(OBJROOT) $(SYMROOT) $(DSTROOT) \
$(SRCROOT)/i386/modules/module_includes \
- $(SRCROOT)/auto.conf \
- $(SRCROOT)/autoconf.h \
- $(SRCROOT)/autoconf.inc
+ $(AUTOCONF_FILES)
pkg installer: all
- ${SRCROOT}/package/buildpkg.sh ${SYMROOT}/package;
- @echo "\t[ZIP] ${DISTFILE}.pkg"
- @ditto -c -k --sequesterRsrc ${DISTFILE}.pkg ${DISTFILE}.pkg.zip
- @rm -r ${DISTFILE}.pkg
+ ${SRCROOT}/package/buildpkg.sh ${SYMROOT}/package
dmg: all
${SRCROOT}/package/slimpkg.sh ${SYMROOT}/package;
${SRCROOT}/package/builddmg.sh ${SYMROOT}/package;
+help:
+ @echo 'Configuration target:'
+ @echo ' config - Show configuration menu'
+ @echo
+ @echo 'Build targets:'
+ @echo ' all - Build all targets [DEFAULT]'
+ @echo ' dist - Build distribution tarball'
+ @echo ' pkg - Build installer package'
+ @echo
+ @echo 'Cleaning targets:'
+ @echo ' clean - Remove most generated files'
+ @echo ' distclean - Remove all generated files + config'
+#@echo
+# @echo 'Build options:'
+# @echo 'make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build'
+
.PHONY: config
.PHONY: clean
.PHONY: image
.PHONY: pkg
.PHONY: installer
.PHONY: dmg
+.PHONY: help