Chameleon Applications

Chameleon Applications Commit Details

Date:2010-10-20 04:47:44 (13 years 5 months ago)
Author:ErmaC
Commit:191
Parents: 190
Message:clean "bad" script
Changes:
D/branches/iFabio/trunk/package/Scripts/Post/postinstall
D/branches/iFabio/trunk/package/Scripts/Standard/postflight
D/branches/iFabio/trunk/package/Scripts/Standard/preflight
D/branches/iFabio/trunk/package/Scripts/Standardhfs/postflight
D/branches/iFabio/trunk/package/Scripts/Standardhfs/preflight

File differences

branches/iFabio/trunk/package/Scripts/Standard/postflight
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/perl
$destino = $ARGV[1];
$destino =~ s/ /\\ /g;
$volume = $ARGV[2];
my %mapa;
open (MOUNT, "mount|");
while (<MOUNT>) {
chomp;
$line = $_;
if ($line =~ /^([^ ]+) on ([^(]+) \([^)]*\)$/) {
$mapa{$2}=$1;
}
}
close (MOUNT);
if ($mapa{$volume}) {
if ($mapa{$volume} =~ /^\/dev\/(disk\d)s(\d)$/) {
$disk = $1;
$partition = $2;
$volume =~ s/ /\\ /g;
system ($destino."/fdisk440 -f ".$destino."/boot0 -u -y /dev/r".$disk);
system ("dd if=".$destino."/boot1h of=/dev/r".$disk."s".$partition);
system ("cp ".$destino."/boot ".$volume);
open (PIPE, "|fdisk -e /dev/".$disk."|");
print PIPE "f ".$partition."\n";
print PIPE "write\n";
print PIPE "y\n";
print PIPE "exit\n";
}
}
branches/iFabio/trunk/package/Scripts/Standard/preflight
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
# $3 is the installation volume passed from the installer.
# It DOES NOT contain the trailing slash
# /Volume/xxxx
if [ "$3" == "/" ]; then
# If installing to root (/) don't add extra slash (//)
# Always refer to files as ${targetVol}usr/sbin/... no slash after end curly brace
targetVol="$3"
else
# If installing to (/Volumes/xxxx) add extra slash (/Volumes/xxxx/)
# Always refer to files as ${targetVol}usr/sbin/... no slash after end curly brace
targetVol="$3/"
fi
backupDirExtension=`date '+%Y%m%d-%H%M%S'`
backupDir="${targetVol}ChameleonInstallerBackup.${backupDirExtension}/"
echo "${backupDirExtension}" > "${targetVol}ChameleonInstallerBackup.txt"
mkdir "${backupDir}"
# backup directory has extension .YYYYMMDD-HHMMSS year month day-hour minute second
if [ -e "${targetVol}usr/sbin/fdisk" ] ; then
mkdir -p "${backupDir}usr/sbin"
cp -fp "${targetVol}usr/sbin/fdisk" "${backupDir}usr/sbin/fdisk"
fi
if [ -d "${targetVol}usr/standalone/i386" ] ; then
mkdir -p "${backupDir}usr/standalone/i386"
cp -Rfp "${targetVol}usr/standalone/i386" "${backupDir}usr/standalone"
fi
if [ -d "${targetVol}Extra" ] ; then
mkdir -p "${backupDir}Extra"
#cp -Rfp "${targetVol}Extra" "${backupDir}"
# Use a move to avoid possibility of mixing incompatible files.
mv -f "${targetVol}Extra" "${backupDir}"
fi
if [ -e "${targetVol}boot" ] ; then
cp -fp "${targetVol}boot" "${backupDir}boot"
fi
chown -R 0:0 "${backupDir}"
exit 0
branches/iFabio/trunk/package/Scripts/Standardhfs/postflight
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/perl
$destino = $ARGV[1];
$destino =~ s/ /\\ /g;
$volume = $ARGV[2];
my %mapa;
open (MOUNT, "mount|");
while (<MOUNT>) {
chomp;
$line = $_;
if ($line =~ /^([^ ]+) on ([^(]+) \([^)]*\)$/) {
$mapa{$2}=$1;
}
}
close (MOUNT);
if ($mapa{$volume}) {
if ($mapa{$volume} =~ /^\/dev\/(disk\d)s(\d)$/) {
$disk = $1;
$partition = $2;
$volume =~ s/ /\\ /g;
system ($destino."/fdisk440 -f ".$destino."/boot0hfs -u -y /dev/r".$disk);
system ("dd if=".$destino."/boot1h of=/dev/r".$disk."s".$partition);
system ("cp ".$destino."/boot ".$volume);
}
}
branches/iFabio/trunk/package/Scripts/Standardhfs/preflight
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
# $3 is the installation volume passed from the installer.
# It DOES NOT contain the trailing slash
# /Volume/xxxx
if [ "$3" == "/" ]; then
# If installing to root (/) don't add extra slash (//)
# Always refer to files as ${targetVol}usr/sbin/... no slash after end curly brace
targetVol="$3"
else
# If installing to (/Volumes/xxxx) add extra slash (/Volumes/xxxx/)
# Always refer to files as ${targetVol}usr/sbin/... no slash after end curly brace
targetVol="$3/"
fi
backupDirExtension=`date '+%Y%m%d-%H%M%S'`
backupDir="${targetVol}ChameleonInstallerBackup.${backupDirExtension}/"
echo "${backupDirExtension}" > "${targetVol}ChameleonInstallerBackup.txt"
mkdir "${backupDir}"
# backup directory has extension .YYYYMMDD-HHMMSS year month day-hour minute second
if [ -e "${targetVol}usr/sbin/fdisk" ] ; then
mkdir -p "${backupDir}usr/sbin"
cp -fp "${targetVol}usr/sbin/fdisk" "${backupDir}usr/sbin/fdisk"
fi
if [ -d "${targetVol}usr/standalone/i386" ] ; then
mkdir -p "${backupDir}usr/standalone/i386"
cp -Rfp "${targetVol}usr/standalone/i386" "${backupDir}usr/standalone"
fi
if [ -d "${targetVol}Extra" ] ; then
mkdir -p "${backupDir}Extra"
#cp -Rfp "${targetVol}Extra" "${backupDir}"
# Use a move to avoid possibility of mixing incompatible files.
mv -f "${targetVol}Extra" "${backupDir}"
fi
if [ -e "${targetVol}boot" ] ; then
cp -fp "${targetVol}boot" "${backupDir}boot"
fi
chown -R 0:0 "${backupDir}"
exit 0
branches/iFabio/trunk/package/Scripts/Post/postinstall
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
# $3 is the installation volume passed from the installer.
# It DOES NOT contain the trailing slash
# /Volume/xxxx
if [ "$3" == "/" ]; then
# If installing to root (/) don't add extra slash (//)
# Always refer to files as ${targetVol}usr/sbin/... no slash after end curly brace
targetVol="$3"
else
# If installing to (/Volumes/xxxx) add extra slash (/Volumes/xxxx/)
# Always refer to files as ${targetVol}usr/sbin/... no slash after end curly brace
targetVol="$3/"
#source com.apple.boot.plist
if ! [ -f "${2}/Extra/com.apple.Boot.plist" ]; then
if [ -f "${2}/Library/Preferences/SystemConfiguration/com.apple.Boot.plist" ]; then
cp -f "${2}/Library/Preferences/SystemConfiguration/com.apple.Boot.plist" "${2}/Extra"
fi
fi
sleep 2
ls -ld "${targetVol}." | grep "unknown"
if [ $? -eq 0 ] ; then
chown 0:0 "${targetVol}."
fi
ls -ld "${targetVol}.Spotlight-V100" | grep "unknown"
if [ $? -eq 0 ] ; then
chown -R 0:0 "${targetVol}.Spotlight-V100"
fi
ls -ld "${targetVol}.Trashes" | grep "unknown"
if [ $? -eq 0 ] ; then
chown -R 0:0 "${targetVol}.Trashes"
fi
ls -ld "${targetVol}.fseventsd" | grep "unknown"
if [ $? -eq 0 ] ; then
chown -R 0:0 "${targetVol}.fseventsd"
fi
# Rebuild mkext
echo "Rebuilding /Extra/Extensions.mkext"
echo "Executing \"${targetVol}usr/sbin/kextcache\" -m \"${targetVol}Extra/Extensions.mkext\" \"${targetVol}Extra/Extensions\""
"${targetVol}usr/sbin/kextcache" -m "${targetVol}Extra/Extensions.mkext" "${targetVol}Extra/Extensions"
#kextcache -m "${targetVol}Extra/Extensions.mkext" "${targetVol}Extra/Extensions"
#mv -f "${targetVol}Extra/Extensions.mkext" "${targetVol}Extra"
echo "Fixing permissions on /Extra/Extensions.mkext"
echo "Executing chown 0:0 \"${targetVol}Extra/Extensions.mkext\""
chown 0:0 "${targetVol}Extra/Extensions.mkext"
echo "Executing chmod 0644 \"${targetVol}Extra/Extensions.mkext\""
chmod 0644 "${targetVol}Extra/Extensions.mkext"
exit 0

Archive Download the corresponding diff file

Revision: 191