Chameleon Applications

Chameleon Applications Svn Source Tree

Root/branches/blackosx/trunk/PackageBuilder/Main_Package_Elements/Scripts/postflight.sh

  • Property svn:executable set to *
1#!/bin/bash
2
3echo "==============================================="
4echo "Entered Postflight Script"
5echo "*************************"
6
7# Find location of this script in the package installer
8# so we know where all the other scripts are located.
9
10MYLOCATION="${PWD}/${BASH_ARGV[0]}"
11export MYLOCATION="${MYLOCATION%/*}"
12scriptDir=$MYLOCATION
13
14
15# Run script to create com.apple.Boot.plist
16# and pass it the installer destination.
17
18"$scriptDir"BuildBootOptions.sh "${3}"
19
20
21# Has the temporary directory /.Chameleon/Extra been created?
22# If yes then transfer temporary Extra folder to destination,
23# or merge temporary Extra folder in to an already existing Extra
24# folder on the destination target.
25
26if [ -d ${3}/.Chameleon/Extra ]; then
27
28# Check to see if install to EFI system partition was selected
29# if chosen, the package installer would have added a file named
30# 'nullESP' in to the temporary directory /.Chameleon
31
32# We also need to check to see if the user selected both the
33# standard install and EFI system partition options.
34# If they did then the EFI system partition script would
35# have been cancelled, meaning the Extra folder needs to
36# be copied the selected destination.
37
38if [ -f ${3}/.Chameleon/nullESP ] && ! [ -f ${3}/.Chameleon/nullstandard ]; then
39
40echo "Executing command: ditto ${3}/.Chameleon/Extra /Volumes/EFI/Extra"
41ditto ${3}/.Chameleon/Extra /Volumes/EFI/Extra
42
43echo "Executing command: umount -f Volumes/EFI"
44"$scriptDir"UnMountEFIvolumes.sh
45returnValue=$?
46if [ ${returnValue} = 0 ]; then
47rm -R -f /Volumes/EFI
48fi
49else
50echo "Executing command: ditto ${3}/.Chameleon/Extra ${3}/Extra"
51ditto ${3}/.Chameleon/Extra ${3}/Extra
52fi
53
54fi
55
56
57echo "==============================================="
58echo "Clean Up"
59echo "********"
60
61# remove the temporary /.Chameleon directory
62echo "Executing command: rm -r ${3}/.Chameleon/"
63rm -r ${3}/.Chameleon/
64
65# remove the temporary boot sector files if they exist
66if [ -d /tmp/newbs ]; then
67echo "Executing command: rm /tmp/newbs"
68rm /tmp/newbs
69fi
70if [ -d /tmp/origbs ]; then
71echo "Executing command: rm /tmp/origbs"
72rm /tmp/origbs
73fi
74
75
76exit 0
77

Archive Download this file

Revision: 244