Index: branches/blackosx/package/Scripts/Main/ESPpostinstall =================================================================== --- branches/blackosx/package/Scripts/Main/ESPpostinstall (revision 1657) +++ branches/blackosx/package/Scripts/Main/ESPpostinstall (revision 1658) @@ -36,7 +36,15 @@ stage1LoaderFAT="boot1f32" stage2Loader="boot" -targetVolumeChosenByUser=$3 +# If target volume root of current system then replace +# / with volume name. +if [ "$3" == "/" ] +then + targetVolumeChosenByUser="/Volumes/"$( ls -1F /Volumes | sed -n 's:@$::p' ) +else + targetVolumeChosenByUser="$3" +fi + targetDeviceChosenByUser=$( df "${targetVolumeChosenByUser}" | sed -n '2p' | awk '{print $1}' ) targetVolume="/Volumes/EFI" Index: branches/blackosx/package/Scripts/Main/postinstall =================================================================== --- branches/blackosx/package/Scripts/Main/postinstall (revision 1657) +++ branches/blackosx/package/Scripts/Main/postinstall (revision 1658) @@ -18,10 +18,11 @@ exit 1 fi -# clean up what would otherwise turn into "//" paths +# If target volume root of current system then replace +# / with volume name. if [ "$3" == "/" ] then - dest_vol="" + dest_vol="/Volumes/"$( ls -1F /Volumes | sed -n 's:@$::p' ) else dest_vol="$3" fi @@ -31,17 +32,9 @@ export MYLOCATION="${MYLOCATION%/*}" scriptDir=$MYLOCATION -# Has install log already been generated? -if [ ! -f "${dest_vol}"/.ChameleonLogFlag ]; then - # Write some information to the Install Log - versionNumber=`cat "${scriptDir}"/Resources/version` - revisionNumber=`cat "${scriptDir}"/Resources/revision` - "$scriptDir"InstallLog.sh "${dest_vol}" "Installer version: ${versionNumber} ${revisionNumber}" - "$scriptDir"InstallLog.sh "${dest_vol}" "Running Post postinstall script" - "$scriptDir"InstallLog.sh "${dest_vol}" "Target volume = ${dest_vol}" -else - "$scriptDir"InstallLog.sh "${dest_vol}" "Running Post postinstall script" -fi +# Write some information to the Install Log +"$scriptDir"InstallLog.sh "${dest_vol}" "Running Post postinstall script" +"$scriptDir"InstallLog.sh "${dest_vol}" "Target volume = ${dest_vol}" # set temporary directory chamTemp="$dest_vol/usr/local/chamTemp" @@ -86,10 +79,36 @@ mkdir "$chamTemp"/Extra fi - # Create template for org.chameleon.Boot.plist" + tempOCBP="$chamTemp"/Extra/org.chameleon.Boot.plist + + # # Does the user want to upgrade an existing /Extra folder? + # # If so, then make a copy of their Boot.plist. + # if [ -e "$chamTemp/install_type_upgrade" ]; then + # # Check for an existing /Extra folder + # if [ -e "$dest_vol"/.ChameleonEFI ]; then + # if [ -e "/Volumes/EFI/Extra/org.chameleon.Boot.plist" ]; then + # cp /Volumes/EFI/Extra/org.chameleon.Boot.plist "$tempOCBP" + # fi + # if [ -e "/Volumes/EFI/Extra/com.apple.Boot.plist" ]; then + # cp /Volumes/EFI/Extra/com.apple.Boot.plist "$tempOCBP" + # fi + # else + # if [ -e "$dest_vol/Extra/org.chameleon.Boot.plist" ]; then + # cp "${dest_vol}/Extra/org.chameleon.Boot.plist" "$tempOCBP" + # fi + # if [ -e "$dest_vol/Extra/com.apple.Boot.plist" ]; then + # cp "${dest_vol}/Extra/com.apple.Boot.plist" "$tempOCBP" + # fi + # fi + # elif [ -e "$chamTemp/install_type_new" ]; then + # # Create template for org.chameleon.Boot.plist" + # cp "$4"/Library/Preferences/SystemConfiguration/com.apple.Boot.plist "$tempOCBP" + # fi + + # 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 @@ -170,6 +189,7 @@ mv "$dest_vol/Extra" "$dest_vol/Extra_OLD-"$( date "+%H-%M-%S" ) fi "$scriptDir"InstallLog.sh "${dest_vol}" "Writing folder: $dest_vol/Extra" + echo "Copying $chamTemp/Extra TO $dest_vol" cp -R "$chamTemp"/Extra "$dest_vol" else # The EFI system partition install option was chosen Index: branches/blackosx/package/Scripts/Main/Standardpostinstall =================================================================== --- branches/blackosx/package/Scripts/Main/Standardpostinstall (revision 1657) +++ branches/blackosx/package/Scripts/Main/Standardpostinstall (revision 1658) @@ -37,7 +37,16 @@ stage1LoaderFAT="boot1f32" stage2Loader="boot" -targetVolume=$3 +# If target volume root of current system then replace +# / with volume name. +if [ "$3" == "/" ] +then + targetVolume="/Volumes/"$( ls -1F /Volumes | sed -n 's:@$::p' ) +else + targetVolume="$3" +fi + + targetDevice=$( df "${targetVolume}" | sed -n '2p' | awk '{print $1}' ) targetDeviceRaw=${targetDevice/disk/rdisk} targetDisk=${targetDevice%s*} @@ -192,6 +201,7 @@ "$scriptDir"InstallLog.sh "${targetVolume}" "LineBreak" "$scriptDir"InstallLog.sh "${targetVolume}" "Standard script complete" +"$scriptDir"InstallLog.sh "${targetVolume}" "LineBreak" echo "===============================================" echo "END - Standard Post-Install Script" Index: branches/blackosx/package/Scripts/Main/preinstall =================================================================== --- branches/blackosx/package/Scripts/Main/preinstall (revision 1657) +++ branches/blackosx/package/Scripts/Main/preinstall (revision 1658) @@ -20,8 +20,16 @@ export MYLOCATION="${MYLOCATION%/*}" scriptDir=$MYLOCATION -targetVolume=$3 +# If target volume root of current system then replace +# / with volume name. +if [ "$3" == "/" ] +then + targetVolume="/Volumes/"$( ls -1F /Volumes | sed -n 's:@$::p' ) +else + targetVolume="$3" +fi + logName="Chameleon_Installer_Log.txt" logFile="${targetVolume}"/$logName Index: branches/blackosx/package/Resources/en.lproj/Localizable.strings =================================================================== --- branches/blackosx/package/Resources/en.lproj/Localizable.strings (revision 1657) +++ branches/blackosx/package/Resources/en.lproj/Localizable.strings (revision 1658) @@ -9,6 +9,19 @@ // ============================================================================ +// Install Type +// ---------------------------------------------------------------------------- +"InstallType_title" = "Install Type"; +"InstallType_description" = "Choose to perform a new installation or upgrade an existing installation."; + +"New_title" = "New Installation"; +"New_description" = "Backup an existing /Extra folder, if found on the target partition. A new one will be created if any options are chosen from the installer, other than the Bootloader."; + +"Upgrade_title" = "Upgrade"; +"Upgrade_description" = "Merge an existing /Extra folder, if found on the target, with any options chosen from the installer, other than the Bootloader."; + + +// ============================================================================ // Bootloader // ---------------------------------------------------------------------------- "Chameleon_title" = "Chameleon Bootloader"; Index: branches/blackosx/package/buildpkg.sh =================================================================== --- branches/blackosx/package/buildpkg.sh (revision 1657) +++ branches/blackosx/package/buildpkg.sh (revision 1658) @@ -88,6 +88,31 @@ buildpackage "${1}/Core" "/" "0" "start_visible=\"false\" start_selected=\"true\"" >/dev/null 2>&1 # 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 +# +# # 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 + +# ((xmlindent--)) +# outline[$((outlinecount++))]="${indent[$xmlindent]}" +# End build install type + # build Chameleon package echo "================= Chameleon =================" outline[$((outlinecount++))]="${indent[$xmlindent]}"