Chameleon Applications

Chameleon Applications Commit Details

Date:2010-11-25 18:21:53 (13 years 4 months ago)
Author:blackosx
Commit:236
Parents: 235
Message:Added simple error log file to be written to the selected partition
Changes:
A/branches/blackosx/trunk/PackageBuilder/Main_Package_Elements/Scripts/WriteInstallerLog.sh
M/branches/blackosx/trunk/PackageBuilder/Main_Package_Elements/Scripts/CheckProceed.sh
M/branches/blackosx/trunk/PackageBuilder/Main_Package_Elements/Scripts/MainStandardPostinstall.sh

File differences

branches/blackosx/trunk/PackageBuilder/Main_Package_Elements/Scripts/WriteInstallerLog.sh
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
#!/bin/bash
#echo "==============================================="
#echo "Write Installer Log"
#echo "*******************"
#echo ""
#echo ""
# Receives two parameters
# $1 = selected volume for location of the install log
# $2 = text to write to the installer log
if [ "$#" -eq 2 ]; then
logLocation="$1"
verboseText="$2"
#echo "DEBUG: passed argument = $logLocation"
#echo "DEBUG: passed argument = $verboseText"
fi
echo "${verboseText}" >> ${logLocation}/Chameleon_Error_Log.txt
#echo "-----------------------------------------------"
#echo ""
exit 0
branches/blackosx/trunk/PackageBuilder/Main_Package_Elements/Scripts/CheckProceed.sh
44
55
66
7
7
88
99
1010
echo "Check Proceed - Can the script continue?"
echo "******************************************"
# Receives Target Disk and Target Device
# Receives targetVolume and targetDevice
# Checks the selected volume is present and the disk
# is partitioned.
branches/blackosx/trunk/PackageBuilder/Main_Package_Elements/Scripts/MainStandardPostinstall.sh
3131
3232
3333
34
35
36
37
38
34
35
36
37
38
3939
4040
41
42
43
44
45
46
41
42
43
44
45
4746
47
4848
4949
50
51
52
5350
54
55
56
57
58
59
60
61
62
63
64
65
66
67
51
52
53
6854
55
56
57
58
59
60
61
62
63
64
65
66
67
68
6969
70
7071
7172
7273
7374
7475
75
76
7677
7778
7879
......
137138
138139
139140
141
142
140143
141144
142145
......
154157
155158
156159
157
160
161
162
158163
164
165
166
159167
160168
161169
# Initialise Script Globals
stage0Loader="boot0" #diskloader
stage0LoaderDualBoot="boot0hfs" #was stage0Loaderdualboot
stage1LoaderHFS="boot1h" #was stage1LoaderHFS
stage1LoaderFAT="boot1f32" #was partitionloaderfat
stage2Loader="boot" #was filesystemloader
stage0Loader="boot0"
stage0LoaderDualBoot="boot0hfs"
stage1LoaderHFS="boot1h"
stage1LoaderFAT="boot1f32"
stage2Loader="boot"
targetVolume=$3 #was bootvolume
targetDevice=$( df "${targetVolume}" | sed -n '2p' | awk '{print $1}' ) #was bootdev
targetDeviceRaw=${targetDevice/disk/rdisk} #was bootrdev
targetDisk=${targetDevice%s*} #was bootdisk
targetDiskRaw=${targetDisk/disk/rdisk} #was bootrdisk
targetSlice=${targetDevice#*disk*s} #was bootslice
targetResources="${targetVolume%/*}" #was bootresources - is this needed?
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%/*}" # is this needed?
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 ""
#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 ""
# Double check we can see the selected partition and it's of the right type
# if not the following script returns to indicate failure.
"$scriptDir"CheckProceed.sh "${targetVolume}" "${targetDevice}"
returnValue=$?
if [ ${returnValue} = 0 ]; then
if [ ${returnValue}=0 ]; then
# OK to proceed
if [ ${fatType} = 1 ] && [ ${partitionTable} = 3 ]; then
echo "ERROR: - Can't install to a device using FAT16"
# Write error to Chameleon_Error_Log file
"$scriptDir"WriteInstallerLog.sh "${3}" "${3} is a FAT16 device - Chameleon boot files not written"
else
# Continue if the selected device is not a FAT16 format device
# Set the active partition ONLY if Windows is not installed
"$scriptDir"SetActivePartition.sh "${espformat}" "${diskSigCheck}" "${targetDiskRaw}" "${targetSlice}" "${targetVolume}"
fi
else
# Write error to Chameleon_Error_Log file
"$scriptDir"WriteInstallerLog.sh "${targetVolume}" "Error: Target drive has existing GRUB / Linux loader in the MBR - Not sure how to continue"
fi
else
# Write error to Chameleon_Error_Log file
"$scriptDir"WriteInstallerLog.sh "${targetVolume}" "Error: ${targetVolume} couldn't be found or the disk doesn't use slices"
fi
exit 0

Archive Download the corresponding diff file

Revision: 236