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
32if [ -f ${3}/.Chameleon/nullESP ]; then
33echo "Executing command: ditto ${3}/.Chameleon/Extra /Volumes/EFI/Extra"
34ditto ${3}/.Chameleon/Extra /Volumes/EFI/Extra
35
36echo "Executing command: umount -f Volumes/EFI"
37"$scriptDir"UnMountEFIvolumes.sh
38returnValue=$?
39if [ ${returnValue} = 0 ]; then
40rm -R -f /Volumes/EFI
41fi
42else
43echo "Executing command: ditto ${3}/.Chameleon/Extra ${3}/Extra"
44ditto ${3}/.Chameleon/Extra ${3}/Extra
45fi
46
47fi
48
49echo "==============================================="
50echo "Clean Up"
51echo "*************************"
52
53# remove the temporary /.Chameleon directory
54echo "Executing command: rm -r ${3}/.Chameleon/"
55rm -r ${3}/.Chameleon/
56
57# remove the temporary boot sector files if they exist
58if [ -d /tmp/newbs ]; then
59echo "Executing command: rm /tmp/newbs"
60rm /tmp/newbs
61fi
62if [ -d /tmp/origbs ]; then
63echo "Executing command: rm /tmp/origbs"
64rm /tmp/origbs
65fi
66
67
68exit 0
69

Archive Download this file

Revision: 225