Index: trunk/version =================================================================== --- trunk/version (revision 1752) +++ trunk/version (revision 1753) @@ -1 +1 @@ -2.1svn +2.1svn \ No newline at end of file Index: trunk/package/Changes.txt =================================================================== --- trunk/package/Changes.txt (revision 1752) +++ trunk/package/Changes.txt (revision 1753) @@ -1,3 +1,19 @@ +- Change Localizable.strings to match the recent changes to the install process. + +- Improve messages written to the installation log. + +- Change upgrade install to only backup /Extra folder if necessary. + +- JrCs - Enhanced installer - We can add an option without an associated package - We can have an option that install +multiple packages - No more "fake" option (none) - The package that is build is already compressed (no need to +compress it again) + +- JrCs - Update postinstall script - Fix a bug where kernel flags are not set properly - Fix indent - Add some comments. + +- JrCs - Automaticaly select upgrade option if /Extra/org.chameleon.Boot.plist file exists on the target volume. + +- JrCs - Keylayout / Keymaps fixed and made a mandatory install when a keymap is chosen. + - 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. Index: trunk/package/Scripts/Main/ESPpostinstall =================================================================== --- trunk/package/Scripts/Main/ESPpostinstall (revision 1752) +++ trunk/package/Scripts/Main/ESPpostinstall (revision 1753) @@ -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: trunk/package/Scripts/Main/postinstall =================================================================== --- trunk/package/Scripts/Main/postinstall (revision 1752) +++ trunk/package/Scripts/Main/postinstall (revision 1753) @@ -37,114 +37,103 @@ # 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 - fi +# Are there any options to build? +if [ "$(ls -A ${chamTemp}/options )" ]; then - # --------------------------------------------- - # 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 + # Check for temporary directory/Extra folder. + if [ ! -d "$chamTemp"/Extra ]; then + mkdir "$chamTemp"/Extra 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 - fi + # Read list of all boot options the user added. + arrayCount=0 + kernelFlagCount=0 + while read FILE + do + options[arrayCount]="${FILE##*/}" - 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 - 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 + # 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 - (( 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 + (( arrayCount++ )) + done < <(ls "${chamTemp}"/options ) - 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 + 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 +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 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." @@ -180,11 +169,13 @@ # 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. + "$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." +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 @@ -210,59 +201,53 @@ # --------------------------------------------- # 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" Index: trunk/package/Scripts/Main/Standardpostinstall =================================================================== --- trunk/package/Scripts/Main/Standardpostinstall (revision 1752) +++ trunk/package/Scripts/Main/Standardpostinstall (revision 1753) @@ -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: trunk/package/Scripts/Sub/CheckPreviousChameleon.sh =================================================================== --- trunk/package/Scripts/Sub/CheckPreviousChameleon.sh (revision 1752) +++ trunk/package/Scripts/Sub/CheckPreviousChameleon.sh (revision 1753) @@ -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." @@ -173,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 \ No newline at end of file Index: trunk/package/Scripts/Sub/MountESP.sh =================================================================== --- trunk/package/Scripts/Sub/MountESP.sh (revision 1752) +++ trunk/package/Scripts/Sub/MountESP.sh (revision 1753) @@ -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 Index: trunk/package/Scripts/Sub/CheckProceed.sh =================================================================== --- trunk/package/Scripts/Sub/CheckProceed.sh (revision 1752) +++ trunk/package/Scripts/Sub/CheckProceed.sh (revision 1753) @@ -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 \ No newline at end of file Index: trunk/package/Resources/ja.lproj/Description.html =================================================================== --- trunk/package/Resources/ja.lproj/Description.html (revision 1752) +++ trunk/package/Resources/ja.lproj/Description.html (revision 1753) @@ -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
- 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
- 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