#!/bin/bash # $1 = Full path to the installation package the installer app is processing # $2 = Full path to the installation destination # $3 = Installation volume (mountpoint) to receive the payload # $4 = Root directory for the system # Check target exists if [ ! -d "$3" ]; then echo "$3 volume does not exist !" >&2 exit 1 fi # If target volume is root of current system then replace # / with volume name. if [ "$3" == "/" ]; then dest_vol="/Volumes/"$( ls -1F /Volumes | sed -n 's:@$::p' ) else dest_vol="$3" fi logName="@LOG_FILENAME@" logFile="${dest_vol}/$logName" exec >>"${logFile}" 2>&1 # Find script location so to find the Install Log script. MYLOCATION="${PWD}/${BASH_ARGV[0]}" export MYLOCATION="${MYLOCATION%/*}" scriptDir=$MYLOCATION # Write some information to the Install Log echo "======================================================" echo "Running Post postinstall script" echo "Target volume = ${dest_vol}" # --------------------------------------------- # Update Rights # --------------------------------------------- chmod 777 ${dest_vol}/Extra 2>/dev/null chmod 666 ${dest_vol}/Extra/*.plist 2>/dev/null # --------------------------------------------- # Cleanup # --------------------------------------------- # Unmount ALL mounted volumes named EFI "$scriptDir"UnMountEFIvolumes.sh "${dest_vol}" "${scriptDir}" # remove any temporary boot sector files if they exist rm -f /tmp/newbs /tmp/origbs /tmp/originalBootSector /tmp/newBootSector # Remove /.ChameleonEFI file rm -f "${dest_vol}/.ChameleonEFI" echo "======================================================" echo "Post postinstall script complete"