Index: branches/blackosx/package/slimpkg.sh
===================================================================
--- branches/blackosx/package/slimpkg.sh (revision 1642)
+++ branches/blackosx/package/slimpkg.sh (revision 1643)
@@ -83,7 +83,7 @@
# build standard package
mkdir -p ${1}/Standard/Root
mkdir -p ${1}/Standard/Scripts/Resources
- cp -f ${pkgroot}/Scripts/Main/Standard/* ${1}/Standard/Scripts
+ 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
ditto --noextattr --noqtn ${1%/*/*}/revision ${1}/Standard/Scripts/Resources/revision
@@ -95,7 +95,7 @@
# build efi package
mkdir -p ${1}/EFI/Root
mkdir -p ${1}/EFI/Scripts/Resources
- cp -f ${pkgroot}/Scripts/Main/EFI/* ${1}/EFI/Scripts
+ 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
ditto --noextattr --noqtn ${1%/*/*}/revision ${1}/EFI/Scripts/Resources/revision
@@ -183,7 +183,7 @@
packagesidentity="org.chameleon"
mkdir -p ${1}/Post/Root
mkdir -p ${1}/Post/Scripts
- cp -f ${pkgroot}/Scripts/Main/Post/* ${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
Index: branches/blackosx/package/OptionalSettings/Control.txt
===================================================================
--- branches/blackosx/package/OptionalSettings/Control.txt (revision 1642)
+++ branches/blackosx/package/OptionalSettings/Control.txt (revision 1643)
@@ -30,5 +30,5 @@
LegacyLogo:Legacy Logo=Yes
InstantMenu:Instant Menu=Yes
QuietBoot:QuietBoot=Yes
-ShowInfo:ShowInfo=No
+ShowInfo:ShowInfo=Yes
Wait:Wait=Yes
Index: branches/blackosx/package/Scripts/Main/ESPpostinstall
===================================================================
--- branches/blackosx/package/Scripts/Main/ESPpostinstall (revision 0)
+++ branches/blackosx/package/Scripts/Main/ESPpostinstall (revision 1643)
@@ -0,0 +1,187 @@
+#!/bin/bash
+
+echo "==============================================="
+echo "Main EFI System Partition Post-Install Script"
+echo "*********************************************"
+echo "-----------------------------------------------"
+echo ""
+
+# Find location of this script in the package installer
+# so we know where all the other scripts are located.
+
+MYLOCATION="${PWD}/${BASH_ARGV[0]}"
+export MYLOCATION="${MYLOCATION%/*}"
+scriptDir=$MYLOCATION
+
+
+#echo "==============================================="
+#echo "Apple Installer Package Variables"
+#echo "*********************************"
+#echo "DEBUG: $ 1 = Full path to the installation package the installer app is processing: " $1
+#echo "DEBUG: $ 2 = Full path to the installation destination: " $2
+#echo "DEBUG: $ 3 = Installation volume (mountpoint) to receive the payload: " $3
+#echo "DEBUG: $ 4 = Root directory for the system: " $4
+#echo "DEBUG: Script Name: " $SCRIPT_NAME
+#echo "DEBUG: Package Path: " $PACKAGE_PATH
+#echo "DEBUG: Installer Temp: " $INSTALLER_TEMP
+#echo "DEBUG: Full path to the temp directory containing the operation executable: " $RECEIPT_PATH
+#echo "-----------------------------------------------"
+#echo ""
+
+# Initialise Script Globals
+
+stage0Loader="boot0"
+stage0LoaderDualBoot="boot0md"
+stage1LoaderHFS="boot1h"
+stage1LoaderFAT="boot1f32"
+stage2Loader="boot"
+
+targetVolumeChosenByUser=$3
+targetDeviceChosenByUser=$( df "${targetVolumeChosenByUser}" | sed -n '2p' | awk '{print $1}' )
+
+targetVolume="/Volumes/EFI"
+targetDevice=${targetDeviceChosenByUser%s*}s1
+targetDeviceRaw=${targetDevice/disk/rdisk}
+targetDisk=${targetDevice%s*}
+targetDiskRaw=${targetDisk/disk/rdisk}
+targetSlice=${targetDevice#*disk*s}
+
+targetResources="${targetVolumeChosenByUser}/usr/local/bin/"
+
+echo "==============================================="
+echo "DEBUG: display script variables"
+echo "***************************"
+
+echo "DEBUG: stage0Loader: Disk loader is ${stage0Loader}"
+echo "DEBUG: stage0LoaderDualBoot: Disk loader is ${stage0LoaderDualBoot}"
+echo "DEBUG: stage1LoaderHFS: Partition loader is ${stage1LoaderHFS}"
+echo "DEBUG: stage1LoaderFat: Partition loader is ${stage1LoaderFAT}"
+echo "DEBUG: stage2Loader: Filesystem loader is ${stage2Loader}"
+echo "DEBUG: targetVolumeChosenByUser: Volume is ${targetVolumeChosenByUser}"
+echo "DEBUG: targetDeviceChosenByUser: Volume device is ${targetDeviceChosenByUser}"
+echo "DEBUG: targetVolume: Volume is ${targetVolume}"
+echo "DEBUG: targetDevice: Volume device is ${targetDevice}"
+echo "DEBUG: targetDeviceRaw: Volume raw device is ${targetDeviceRaw}"
+echo "DEBUG: targetDisk: Disk device is ${targetDisk}"
+echo "DEBUG: targetDiskRaw: Disk raw device is ${targetDiskRaw}"
+echo "DEBUG: targetSlice: Volume slice is ${targetSlice}"
+echo "DEBUG: targetResources: Boot Resources is ${targetResources}"
+echo "-----------------------------------------------"
+echo ""
+
+
+# Write some information to the Install Log
+"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Running EFI postinstall script"
+"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Target selected by user = ${targetVolumeChosenByUser} on ${targetDeviceChosenByUser}"
+"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Target volume = ${targetVolume} on ${targetDevice}"
+
+# Check to see if the selected disk uses a GPT
+
+bootuuid=$( diskutil info "$targetDeviceChosenByUser" | grep Volume\ UUID | awk {'print $3'} )
+partitiontable=$( diskutil list ${targetDeviceChosenByUser%s*} | sed -n '3p' | awk '{print $2}' )
+
+if [ ${partitiontable} = "GUID_partition_scheme" ]; then
+ 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.
+
+
+ "$scriptDir"CheckProceed.sh "${targetVolume}" "${targetDeviceChosenByUser}" "${targetVolumeChosenByUser}" "${scriptDir}"
+ returnValue=$?
+ if [ ${returnValue} = 0 ]; then
+ # OK to proceed
+
+
+ # Does a GRUB or Linux loader already exist in the disk's MBR?
+ # The script returns 1 if yes, 0 if no.
+
+ "$scriptDir"CheckGRUBLinuxLoader.sh "${targetDisk}" "${targetVolumeChosenByUser}" "${scriptDir}"
+ returnValue=$?
+ if [ ${returnValue} = 0 ]; then
+ # OK to proceed
+
+
+ # check for a 4-byte Windows disk signature in the disk's MBR.
+ # the following script returns 1 if a Windows disk signature exists, and 0 if not.
+
+ "$scriptDir"CheckWindowsDiskSignature.sh "${targetDisk}" "${targetVolumeChosenByUser}" "${scriptDir}"
+ diskSigCheck=$?
+
+
+ # check for existing bootloaders in the disk's MBR
+ # and find out if we can write the Chameleon boot files.
+ # the following script returns 0 if we can proceed
+ # with writing the boot files, and 1 for not.
+
+ "$scriptDir"CheckDiskMicrocode.sh "${targetDisk}" "${diskSigCheck}" "${targetVolumeChosenByUser}" "${scriptDir}"
+ diskupdate=$?
+
+
+ # check the format of the selected partition.
+ # result should be either hfs or msdos
+ # Should really check to make sure!
+
+ targetFormat=$( fstyp "$targetDevice" )
+
+
+ # Append a LineBreak to the installer log
+ "$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "LineBreak"
+
+ if [ ${diskupdate} = "0" ]; then
+
+ # Write the stage 0 loader to the MBR
+ "$scriptDir"WriteChameleonStage0.sh "${diskSigCheck}" "${stage0Loader}" "${stage0LoaderDualBoot}" "${targetDisk}" "${targetResources}" "${targetVolumeChosenByUser}" "${scriptDir}"
+ else
+ "$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Stage 0 loader not written to ${targetDisk}."
+ fi
+
+ # Write the stage 1 loader to the partition boot sector
+ "$scriptDir"WriteChameleonStage1.sh "${targetFormat}" "${stage1LoaderHFS}" "${stage1LoaderFAT}" "${targetVolumeChosenByUser}" "${targetDeviceRaw}" "${targetVolumeChosenByUser}" "${scriptDir}"
+
+
+ # Unmount ALL mounted volumes named EFI.
+ # Returns 0=success, 1=fail
+
+ "$scriptDir"UnMountEFIvolumes.sh "${targetVolumeChosenByUser}" "${scriptDir}"
+ returnValue=$?
+ if [ ${returnValue} = 0 ]; then
+ # OK to proceed
+
+ # Mount the EFI system partition
+ "$scriptDir"MountESP.sh "${targetDisk}" "${targetVolumeChosenByUser}" "${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"CheckPreviousChameleon.sh "${targetDisk}" "${targetDeviceRaw}" "${targetDevice}" "${targetVolumeChosenByUser}" "${scriptDir}"
+ fi
+
+ # Append a LineBreak to the installer log
+ "$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "LineBreak"
+
+ # Set the active partition ONLY if Windows is not installed
+ "$scriptDir"SetActivePartition.sh "${diskSigCheck}" "${targetDiskRaw}" "${targetSlice}" "${targetVolumeChosenByUser}" "${scriptDir}"
+
+ fi
+ fi
+else
+ #echo "ERROR Volume is not on a GPT partitioned disc."
+ "$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "ERROR Volume is not on a GPT partitioned disc."
+fi
+
+# Create temporary file on target volume to notify Postinstall
+# script, boot option code, that EFI (ESP) option was chosen
+echo "EFI" >"${targetVolumeChosenByUser}"/.ChameleonEFI
+
+"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "LineBreak"
+"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "EFI script complete"
+
+echo "==============================================="
+echo "END - Main EFI System Partition Post-Install Script"
+echo "*********************************************"
+echo "-----------------------------------------------"
+echo ""
+
+exit 0
Property changes on: branches/blackosx/package/Scripts/Main/ESPpostinstall
___________________________________________________________________
Added: svn:executable
+ *
Index: branches/blackosx/package/Scripts/Main/postinstall
===================================================================
--- branches/blackosx/package/Scripts/Main/postinstall (revision 0)
+++ branches/blackosx/package/Scripts/Main/postinstall (revision 1643)
@@ -0,0 +1,235 @@
+#!/bin/bash
+
+echo "==============================================="
+echo "Post Post-Install Script"
+echo "*********************************"
+echo "-----------------------------------------------"
+echo ""
+
+#echo "DEBUG: $ 1 = Full path to the installation package the installer app is processing: " $1
+#echo "DEBUG: $ 2 = Full path to the installation destination: " $2
+#echo "DEBUG: $ 3 = Installation volume (mountpoint) to receive the payload: " $3
+#echo "DEBUG: $ 4 = Root directory for the system: " $4
+
+# Check target exists
+if [ ! -e "$3" ]
+then
+ echo "$3 volume does not exist!"
+ exit 1
+fi
+
+# clean up what would otherwise turn into "//" paths
+if [ "$3" == "/" ]
+then
+ dest_vol=""
+else
+ dest_vol="$3"
+fi
+
+# Find script location so to find the Install Log script.
+MYLOCATION="${PWD}/${BASH_ARGV[0]}"
+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
+
+# set temporary directory
+chamTemp="$dest_vol/usr/local/chamTemp"
+
+# Check for stopped installation due to Chameleon
+# already existing on the same disk.
+if [ ! -f "$dest_vol"/.ChameleonExists ]; then
+
+ # ---------------------------------------------
+ # 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}" "Installed module:$FILE"
+ 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}" "Installed 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
+
+ # 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
+
+ # 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
+ 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 kernel flags
+ for (( i=0 ; i < $kernelFlagCount ; i++ ))
+ do
+ # Add any kernel flags together in to one string.
+ kernelFlagString="${kernelFlagString} ${kernelflag[i]}"
+ done
+ 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
+
+ # ---------------------------------------------
+ # 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
+ # 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
+
+ # Does an /Extra folder already exist?
+ if [ -e "$dest_vol"/Extra ]; then
+ "$scriptDir"InstallLog.sh "${dest_vol}" "Found existing $dest_vol/Extra folder. Renaming it $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 folder: $dest_vol/Extra"
+ 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}" "Found existing /Volumes/EFI/Extra folder. Renaming it 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 folder: /Volumes/EFI/Extra"
+ cp -R "$chamTemp"/Extra "/Volumes/EFI"
+ fi
+ fi
+
+ # Unmount ALL mounted volumes named EFI
+ "$scriptDir"UnMountEFIvolumes.sh "${dest_vol}" "${scriptDir}"
+else
+ cleanUp="${cleanUp},0"
+ rm "$dest_vol"/.ChameleonExists
+fi
+
+# ---------------------------------------------
+# Cleanup
+# ---------------------------------------------
+
+# remove any temporary boot sector files if they exist
+if [ -d /tmp/newbs ]; then
+ cleanUp="${cleanUp},1a"
+ rm /tmp/newbs
+fi
+if [ -d /tmp/origbs ]; then
+ cleanUp="${cleanUp},1b"
+ rm /tmp/origbs
+fi
+if [ -d /tmp/newBootSector ]; then
+ cleanUp="${cleanUp},1c"
+ rm /tmp/newbs
+fi
+if [ -d /tmp/originalBootSector ]; then
+ cleanUp="${cleanUp},1d"
+ rm /tmp/origbs
+fi
+
+# delete the temporary Chameleon folder
+if [ -e "$chamTemp" ]; then
+ cleanUp="${cleanUp},2"
+ rm -rf "$chamTemp"
+fi
+
+# Remove /.ChameleonEFI file
+if [ -f "$dest_vol"/.ChameleonEFI ]; then
+ cleanUp="${cleanUp},3"
+ rm "$dest_vol"/.ChameleonEFI
+fi
+
+"$scriptDir"InstallLog.sh "${dest_vol}" "Cleanup: ${cleanUp}"
+"$scriptDir"InstallLog.sh "${dest_vol}" "LineBreak"
+"$scriptDir"InstallLog.sh "${dest_vol}" "Post script complete"
+
+echo "==============================================="
+echo "END - Post Post-Install Script"
+echo "*********************************"
+echo "-----------------------------------------------"
+echo ""
\ No newline at end of file
Property changes on: branches/blackosx/package/Scripts/Main/postinstall
___________________________________________________________________
Added: svn:executable
+ *
Index: branches/blackosx/package/Scripts/Main/Standardpostinstall
===================================================================
--- branches/blackosx/package/Scripts/Main/Standardpostinstall (revision 0)
+++ branches/blackosx/package/Scripts/Main/Standardpostinstall (revision 1643)
@@ -0,0 +1,202 @@
+#!/bin/bash
+
+echo "==============================================="
+echo "Main Standard Post-Install Script"
+echo "*********************************"
+echo "-----------------------------------------------"
+echo ""
+
+# Find location of this script in the package installer
+# so we know where all the other scripts are located.
+
+MYLOCATION="${PWD}/${BASH_ARGV[0]}"
+export MYLOCATION="${MYLOCATION%/*}"
+scriptDir=$MYLOCATION
+
+
+#echo "==============================================="
+#echo "Apple Installer Package Variables"
+#echo "*********************************"
+#echo "DEBUG: $ 1 = Full path to the installation package the installer app is processing: " $1
+#echo "DEBUG: $ 2 = Full path to the installation destination: " $2
+#echo "DEBUG: $ 3 = Installation volume (mountpoint) to receive the payload: " $3
+#echo "DEBUG: $ 4 = Root directory for the system: " $4
+#echo "DEBUG: Script Name: " $SCRIPT_NAME
+#echo "DEBUG: Package Path: " $PACKAGE_PATH
+#echo "DEBUG: Installer Temp: " $INSTALLER_TEMP
+#echo "DEBUG: Full path to the temp directory containing the operation executable: " $RECEIPT_PATH
+#echo "-----------------------------------------------"
+#echo ""
+
+
+# Initialise Script Globals
+
+stage0Loader="boot0"
+stage0LoaderDualBoot="boot0md"
+stage1LoaderHFS="boot1h"
+stage1LoaderFAT="boot1f32"
+stage2Loader="boot"
+
+targetVolume=$3
+targetDevice=$( df "${targetVolume}" | sed -n '2p' | awk '{print $1}' )
+targetDeviceRaw=${targetDevice/disk/rdisk}
+targetDisk=${targetDevice%s*}
+targetDiskRaw=${targetDisk/disk/rdisk}
+targetSlice=${targetDevice#*disk*s}
+
+targetResources="${targetVolume}/usr/local/bin/"
+
+echo "==============================================="
+echo "DEBUG: display script variables"
+echo "*******************************"
+
+echo "DEBUG: stage0Loader: Disk loader is ${stage0Loader}"
+echo "DEBUG: stage0LoaderDualBoot: Disk loader is ${stage0LoaderDualBoot}"
+echo "DEBUG: stage1LoaderHFS: Partition loader is ${stage1LoaderHFS}"
+echo "DEBUG: stage1LoaderFat: Partition loader is ${stage1LoaderFAT}"
+echo "DEBUG: stage2Loader: Filesystem loader is ${stage2Loader}"
+echo "DEBUG: targetVolume: Volume is ${targetVolume}"
+echo "DEBUG: targetDevice: Volume device is ${targetDevice}"
+echo "DEBUG: targetDeviceRaw: Volume raw device is ${targetDeviceRaw}"
+echo "DEBUG: targetDisk: Disk device is ${targetDisk}"
+echo "DEBUG: targetDiskRaw: Disk raw device is ${targetDiskRaw}"
+echo "DEBUG: targetSlice: Volume slice is ${targetSlice}"
+echo "DEBUG: targetResources: Boot Resources is ${targetResources}"
+echo "-----------------------------------------------"
+echo ""
+
+
+# Write some information to the Install Log
+"$scriptDir"InstallLog.sh "${targetVolume}" "Running Standard postinstall script"
+"$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.
+
+"$scriptDir"CheckProceed.sh "${targetVolume}" "${targetDevice}" "${targetVolume}" "${scriptDir}"
+returnValue=$?
+if [ ${returnValue} = 0 ]; then
+ # OK to proceed
+
+
+ # Does a GRUB or Linux loader already exist in the disk's MBR?
+ # The script returns 1 if yes, 0 if no.
+
+ "$scriptDir"CheckGRUBLinuxLoader.sh "${targetDisk}" "${targetVolume}" "${scriptDir}"
+ returnValue=$?
+ if [ ${returnValue} = 0 ]; then
+ # OK to proceed
+
+
+ # check for a 4-byte Windows disk signature in the disk's MBR.
+ # the following script returns 1 if a Windows disk signature exists, and 0 if not.
+
+ "$scriptDir"CheckWindowsDiskSignature.sh "${targetDisk}" "${targetVolume}" "${scriptDir}"
+ diskSigCheck=$?
+
+
+ # check for existing bootloaders in the disk's MBR
+ # and find out if we can write the Chameleon boot files.
+ # the following script returns 0 if we can proceed
+ # with writing the boot files, and 1 for not.
+
+ "$scriptDir"CheckDiskMicrocode.sh "${targetDisk}" "${diskSigCheck}" "${targetVolume}" "${scriptDir}"
+ diskupdate=$?
+
+
+ # check the format of the selected partition.
+ # result should be either hfs or msdos
+ # Should really check to make sure!
+
+ targetFormat=$( fstyp "$targetDevice" )
+
+
+ # check the partition scheme used for the selected disk.
+ # the following script returns 1 if GPT
+ # the following script returns 2 if GPT/MBR
+ # the following script returns 3 if MBR
+ # the following script returns 0 if nothing
+
+ "$scriptDir"CheckPartitionScheme.sh "${targetDisk}" "${targetVolume}" "${scriptDir}"
+ partitionScheme=$?
+ if [ ${partitionScheme} = 3 ]; then
+ # If MBR partition scheme then check for FAT16 or FAT32
+
+ # the following script returns 1 if FAT16
+ # the following script returns 2 if FAT32
+ # the following script returns 0 if nothing
+
+ "$scriptDir"CheckFatType.sh "${targetDeviceRaw}" "${targetVolume}" "${scriptDir}"
+ fatType=$?
+ fi
+
+ if [ "${fatType}" = 1 ] && [ "${partitionScheme}" = 3 ]; then
+ # Write error to Chameleon_Error_Log file
+ "$scriptDir"InstallLog.sh "${targetVolume}" "FAIL: Cannot install to a device using FAT16"
+ else
+ # Continue if the selected device is not a FAT16 format device
+
+ # Append a line break to the installer log
+ "$scriptDir"InstallLog.sh "${targetVolume}" "LineBreak"
+
+ if [ ${diskupdate} = "0" ]; then
+
+ # Write the stage 0 loader to the MBR
+ "$scriptDir"WriteChameleonStage0.sh "${diskSigCheck}" "${stage0Loader}" "${stage0LoaderDualBoot}" "${targetDisk}" "${targetResources}" "${targetVolume}" "${scriptDir}"
+ else
+ "$scriptDir"InstallLog.sh "${targetVolume}" "Stage 0 loader not written to ${targetDisk}."
+ fi
+
+ # Write the stage 1 loader to the partition boot sector
+ "$scriptDir"WriteChameleonStage1.sh "${targetFormat}" "${stage1LoaderHFS}" "${stage1LoaderFAT}" "${3}" "${targetDeviceRaw}" "${targetVolume}" "${scriptDir}"
+
+ # 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
+ # Mount the EFI system partition
+ "$scriptDir"MountESP.sh "${targetDisk}" "${targetVolume}" "${scriptDir}"
+ fi
+
+ # Check for another existing Chameleon installation on the same disk
+ "$scriptDir"CheckPreviousChameleon.sh "${targetDisk}" "${targetDeviceRaw}" "${targetDevice}" "${targetVolume}" "${scriptDir}"
+ fi
+
+ # Append a line break to the installer log
+ "$scriptDir"InstallLog.sh "${targetVolume}" "LineBreak"
+
+ # Set the active partition ONLY if Windows is not installed
+ "$scriptDir"SetActivePartition.sh "${diskSigCheck}" "${targetDiskRaw}" "${targetSlice}" "${targetVolume}" "${scriptDir}"
+ fi
+ fi
+fi
+
+"$scriptDir"InstallLog.sh "${targetVolume}" "LineBreak"
+"$scriptDir"InstallLog.sh "${targetVolume}" "Standard script complete"
+
+echo "==============================================="
+echo "END - Standard Post-Install Script"
+echo "*********************************"
+echo "-----------------------------------------------"
+echo ""
+
+exit 0
Property changes on: branches/blackosx/package/Scripts/Main/Standardpostinstall
___________________________________________________________________
Added: svn:executable
+ *
Index: branches/blackosx/package/Resources/en.lproj/Localizable.strings
===================================================================
--- branches/blackosx/package/Resources/en.lproj/Localizable.strings (revision 1642)
+++ branches/blackosx/package/Resources/en.lproj/Localizable.strings (revision 1643)
@@ -111,8 +111,8 @@
" Q u i e t B o o t _ t i t l e " = " Q u i e t B o o t = Y e s " ;
" Q u i e t B o o t _ d e s c r i p t i o n " = " E n a b l e q u i e t b o o t m o d e ( n o m e s s a g e s o r p r o m p t ) . " ;
- " S h o w I n f o _ t i t l e " = " S h o w I n f o = N o " ;
- " S h o w I n f o _ d e s c r i p t i o n " = " D i s a b l e s d i s p l a y o f p a r t i t i o n a n d r e s o l u t i o n d e t a i l s s h o w n o n t h e l e f t s i d e o f t h e G U I u n d e r t h e b o o t b a n n e r . T h i s i s u s e f u l i n f o r m a t i o n f o r t r o u b l e s h o o t i n g , t h o u g h c a n c l a s h w i t h c e r t a i n t h e m e s . " ;
+ " S h o w I n f o _ t i t l e " = " S h o w I n f o = Y e s " ;
+ " S h o w I n f o _ d e s c r i p t i o n " = " E n a b l e s d i s p l a y o f p a r t i t i o n a n d r e s o l u t i o n d e t a i l s s h o w n o n t h e l e f t s i d e o f t h e G U I u n d e r t h e b o o t b a n n e r . T h i s i s u s e f u l i n f o r m a t i o n f o r t r o u b l e s h o o t i n g , t h o u g h c a n c l a s h w i t h c e r t a i n t h e m e s . " ;
" W a i t _ t i t l e " = " W a i t = Y e s " ;
" W a i t _ d e s c r i p t i o n " = " P a u s e s t h e b o o t p r o c e s s a f t e r C h a m e l e o n h a s f i n i s h e d i t ' s s e t u p t h e n w a i t s f o r a k e y p r e s s b e f o r e i t s t a r t s t h e m a c h k e r n e l . U s e f u l w h e n c o m b i n e d w i t h v e r b o s e b o o t f o r t r o u b l e s h o o t i n g . " ;
Index: branches/blackosx/package/buildpkg.sh
===================================================================
--- branches/blackosx/package/buildpkg.sh (revision 1642)
+++ branches/blackosx/package/buildpkg.sh (revision 1643)
@@ -99,7 +99,7 @@
# build standard package
mkdir -p ${1}/Standard/Root
mkdir -p ${1}/Standard/Scripts/Resources
- cp -f ${pkgroot}/Scripts/Main/Standard/* ${1}/Standard/Scripts
+ 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 "
@@ -109,7 +109,7 @@
# build efi package
mkdir -p ${1}/EFI/Root
mkdir -p ${1}/EFI/Scripts/Resources
- cp -f ${pkgroot}/Scripts/Main/EFI/* ${1}/EFI/Scripts
+ 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 "
@@ -296,15 +296,14 @@
((xmlindent--))
outline[$((outlinecount++))]="${indent[$xmlindent]}"
- # End build theme packages
-# End build Extras package
+ # End build theme packages# End build Extras package
# build post install package
echo "================= Post ================="
packagesidentity="org.chameleon"
mkdir -p ${1}/Post/Root
mkdir -p ${1}/Post/Scripts
- cp -f ${pkgroot}/Scripts/Main/Post/* ${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
@@ -322,7 +321,7 @@
# clean up
- rm -R -f "${1}"
+ #rm -R -f "${1}"
}
@@ -450,7 +449,7 @@
header+="auth=\"root\">\n"
header+="\t\n"
- rm -R -f "${1}/Temp"
+ #rm -R -f "${1}/Temp"
[ -d "${1}/Temp" ] || mkdir -m 777 "${1}/Temp"
[ -d "${1}/Root" ] && mkbom "${1}/Root" "${1}/Temp/Bom"
@@ -485,7 +484,7 @@
local choiceoptions="\t\t${4}"
fi
choices[$((choicescount++))]="\t\n\t\t#${packagename// /}.pkg\n\t\n"
- rm -R -f "${1}"
+ #rm -R -f "${1}"
fi
}