Index: branches/blackosx/package/Scripts/Main/Standard/postinstall
===================================================================
--- branches/blackosx/package/Scripts/Main/Standard/postinstall (revision 1582)
+++ branches/blackosx/package/Scripts/Main/Standard/postinstall (revision 1583)
@@ -145,7 +145,7 @@
# Continue if the selected device is not a FAT16 format device
# Append a line break to the installer log
- "$scriptDir"InstallLog.sh "${targetVolume}" "Line Break"
+ "$scriptDir"InstallLog.sh "${targetVolume}" "LineBreak"
if [ ${diskupdate} = "0" ]; then
# Write the stage 0 loader to the MBR
@@ -162,7 +162,7 @@
"$scriptDir"WriteChameleonStage2.sh "${espformat}" "${stage2Loader}" "${3}" "${targetDevice}" "${targetVolume}" "${scriptDir}"
# Append a line break to the installer log
- "$scriptDir"InstallLog.sh "${targetVolume}" "Line Break"
+ "$scriptDir"InstallLog.sh "${targetVolume}" "LineBreak"
# Set the active partition ONLY if Windows is not installed
"$scriptDir"SetActivePartition.sh "${espformat}" "${diskSigCheck}" "${targetDiskRaw}" "${targetSlice}" "${targetVolume}" "${scriptDir}"
@@ -170,7 +170,7 @@
fi
fi
-"$scriptDir"InstallLog.sh "${targetVolume}" "Line Break"
+"$scriptDir"InstallLog.sh "${targetVolume}" "LineBreak"
"$scriptDir"InstallLog.sh "${targetVolume}" "Standard script complete"
echo "==============================================="
Index: branches/blackosx/package/Scripts/Main/Post/postinstall
===================================================================
--- branches/blackosx/package/Scripts/Main/Post/postinstall (revision 1582)
+++ branches/blackosx/package/Scripts/Main/Post/postinstall (revision 1583)
@@ -41,9 +41,16 @@
mkdir "$chamTemp"/Extra
fi
+# ---------------------------------------------
+# Get location of this script so we know where
+# to find the Install Log script.
+# ---------------------------------------------
+MYLOCATION="${PWD}/${BASH_ARGV[0]}"
+export MYLOCATION="${MYLOCATION%/*}"
+scriptDir=$MYLOCATION
# ---------------------------------------------
-# Blackosx - Build boot options / Kernel Flags.
+# Build boot options / Kernel Flags.
# NEEDS MORE WORK!!!!!!!!!!!!
# ---------------------------------------------
# All options selected are now dummy files with
@@ -51,6 +58,9 @@
# in /usr/local/chamTemp/options/
# for example. Boot Banner=Yes
+# Write some information to the Install Log
+"$scriptDir"InstallLog.sh "${3}" "Running Post postinstall script"
+
# Create template for org.chameleon.Boot.plist"
tempOCBP="$chamTemp"/Extra/org.chameleon.Boot.plist
cp "$dest_vol"/Library/Preferences/SystemConfiguration/com.apple.Boot.plist "$tempOCBP"
@@ -61,7 +71,6 @@
do
options[arrayCount]="${FILE##*/}"
keyRead="${options[$arrayCount]%=*}"
-
value="${options[$arrayCount]#*=}"
# Check keyRead for 'KF' at beginning to
@@ -73,37 +82,53 @@
# but skip first one as that will be 'options'
if [ $arrayCount -gt 0 ]; then
sudo /usr/libexec/plistbuddy -c "Add :Kernel\ Flags string $kernelflag" "$tempOCBP"
+ "$scriptDir"InstallLog.sh "${3}" "Add kernel flag: ${kernelflag}"
+ returnValue=$?
+ if [ ${returnValue}=1 ]; then
+ # Delete it for now, but need to append as more kernel flags could be added in future!!
+ sudo /usr/libexec/plistbuddy -c "Delete :Kernel\ Flags" "$tempOCBP"
+ sudo /usr/libexec/plistbuddy -c "Add :Kernel\ Flags string $kernelflag" "$tempOCBP"
+ fi
fi
else
# escape any spaces
keyToUse=$( echo $keyRead | sed 's/ /\\ /g' )
-
# write value to org.chameleon.Boot.plist
# but skip first one as that will be 'options'
if [ $arrayCount -gt 0 ]; then
- sudo /usr/libexec/plistbuddy -c "Add :$keyToUse string $value" "$tempOCBP"
+ echo "Add :${keyToUse} string ${value}"
+ sudo /usr/libexec/plistbuddy -c "Add :${keyToUse} string ${value}" "$tempOCBP"
+ "$scriptDir"InstallLog.sh "${3}" "Add boot option: ${keyToUse}=${value}"
fi
fi
-
- arrayCount=$(( ${arrayCount} + 1 ))
+
+ (( arrayCount++ ))
done
# ---------------------------------------------
# Copy temp Extra folder to target destination
# ---------------------------------------------
+# If an existing /Extra folder is found, then back it up.
# Extra folder now resides in /usr/local/chamTemp/
# Copy /usr/local/chamTemp/Extra to correct location.
+
if [ ! -f "$dest_vol"/.ChameleonEFI ]; then
- if [ ! -f "$dest_vol"/Extra ]; then
+ if [ ! -e "$dest_vol"/Extra ]; then
mkdir "$dest_vol"/Extra
+ else
+ "$scriptDir"InstallLog.sh "${3}" "Found existing $dest_vol/Extra folder. Renaming it $dest_vol/Extra-OLD-$( date "+%H-%M-%S" )"
+ mv "$dest_vol/Extra" "$dest_vol/Extra_OLD-"$( date "+%H-%M-%S" )
fi
- cp -R "$chamTemp"/Extra/* "$dest_vol"/Extra
+ cp -R "$chamTemp"/Extra "$dest_vol"
else
- if [ ! -f "/Volumes/EFI/Extra" ]; then
+ if [ ! -e "/Volumes/EFI/Extra" ]; then
mkdir "/Volumes/EFI/Extra"
+ else
+ "$scriptDir"InstallLog.sh "${3}" "Found existing /Volumes/EFI/Extra folder. Renaming it Extra-OLD-$( date "+%H-%M-%S" )"
+ mv "/Volumes/EFI/Extra" "/Volumes/EFI/Extra_OLD-"$( date "+%H-%M-%S" )
fi
- cp -R "$chamTemp"/Extra/* /Volumes/EFI/Extra
+ cp -R "$chamTemp"/Extra "/Volumes/EFI"
# unmount /Volumes/EFI
attempts=1
@@ -132,7 +157,7 @@
# delete the temporary Chameleon folder
echo "Removing $chamTemp file"
-rm -rf "$chamTemp"
+#rm -rf "$chamTemp"
echo "Done..."
\ No newline at end of file
Index: branches/blackosx/package/Scripts/Sub/InstallLog.sh
===================================================================
--- branches/blackosx/package/Scripts/Sub/InstallLog.sh (revision 1582)
+++ branches/blackosx/package/Scripts/Sub/InstallLog.sh (revision 1583)
@@ -53,7 +53,7 @@
echo "Log" >"${logLocation}"/.ChameleonLogFlag
else
# Append messages to the log as passed by other scripts.
- if [ "${verboseText}" = "Line Break" ]; then
+ if [ "${verboseText}" = "LineBreak" ]; then
echo "
======================================================
" >>"${logFile}"
@@ -65,7 +65,7 @@
echo " " >>"${logFile}"
fi
- if [ "${verboseText}" != "Line Break" ] && [[ "${verboseText}" != *fdisk* ]]; then
+ if [ "${verboseText}" != "LineBreak" ] && [[ "${verboseText}" != *fdisk* ]]; then
echo "${verboseText}" >> "${logFile}"
fi
fi
Index: branches/blackosx/package/buildpkg.sh
===================================================================
--- branches/blackosx/package/buildpkg.sh (revision 1582)
+++ branches/blackosx/package/buildpkg.sh (revision 1583)
@@ -288,6 +288,7 @@
mkdir -p ${1}/Post/Root
mkdir -p ${1}/Post/Scripts
cp -f ${pkgroot}/Scripts/Main/Post/* ${1}/Post/Scripts
+ cp -f ${pkgroot}/Scripts/Sub/InstallLog.sh ${1}/Post/Scripts
echo " [BUILD] Post "
buildpackage "${1}/Post" "/" "" "start_visible=\"false\" start_selected=\"true\"" >/dev/null 2>&1
outline[$((outlinecount++))]="${indent[$xmlindent]}"
@@ -298,7 +299,7 @@
# clean up
- rm -R -f "${1}"
+ #rm -R -f "${1}"
}
@@ -418,7 +419,7 @@
header+="auth=\"root\">\n"
header+="\t\n"
- rm -R -f "${1}/Temp"
+ #rm -R -f "${1}/Temp"
[ -d "${1}/Temp" ] || mkdir -m 777 "${1}/Temp"
[ -d "${1}/Root" ] && mkbom "${1}/Root" "${1}/Temp/Bom"
@@ -455,7 +456,7 @@
fi
choices[$((choicescount++))]="\n\t#${packagename// /}.pkg\n\n"
- rm -R -f "${1}"
+ #rm -R -f "${1}"
fi
}