summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2010-10-09 08:52:09 +0000
committerimp <imp@FreeBSD.org>2010-10-09 08:52:09 +0000
commit3373ecde5ca05e50431b3c471dc2273cd4aa0684 (patch)
tree7150d81e3a4829aa5c267662132f05aeab3b70d5 /usr.sbin/pc-sysinstall/backend/functions-extractimage.sh
parent69b5e27b6262ebefe667ae8ee68532c760620e48 (diff)
downloadFreeBSD-src-3373ecde5ca05e50431b3c471dc2273cd4aa0684.zip
FreeBSD-src-3373ecde5ca05e50431b3c471dc2273cd4aa0684.tar.gz
Initial patches to install images...
PR: 150921
Diffstat (limited to 'usr.sbin/pc-sysinstall/backend/functions-extractimage.sh')
-rwxr-xr-xusr.sbin/pc-sysinstall/backend/functions-extractimage.sh42
1 files changed, 42 insertions, 0 deletions
diff --git a/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh b/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh
index c7c7ed7..3077f2a 100755
--- a/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh
+++ b/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh
@@ -147,6 +147,7 @@ start_extract_split()
then
exit_err "ERROR: Failed extracting ${KERNELS}"
fi
+ rm -rf "${FSMNT}/boot/kernel"
mv "${FSMNT}/boot/GENERIC" "${FSMNT}/boot/kernel"
else
exit_err "ERROR: ${KERNELS}/install.sh does not exist"
@@ -328,6 +329,46 @@ start_rsync_copy()
};
+start_image_install()
+{
+ if [ -z "${IMAGE_FILE}" ]
+ then
+ exit_err "ERROR: installMedium set to image but no image file specified!"
+ fi
+
+ # We are ready to start mounting, lets read the config and do it
+ while read line
+ do
+ echo $line | grep "^disk0=" >/dev/null 2>/dev/null
+ if [ "$?" = "0" ]
+ then
+ # Found a disk= entry, lets get the disk we are working on
+ get_value_from_string "${line}"
+ strip_white_space "$VAL"
+ DISK="$VAL"
+ fi
+
+ echo $line | grep "^commitDiskPart" >/dev/null 2>/dev/null
+ if [ "$?" = "0" ]
+ then
+ # Found our flag to commit this disk setup / lets do sanity check and do it
+ if [ ! -z "${DISK}" ]
+ then
+
+ # Write the image
+ write_image "${IMAGE_FILE}" "${DISK}"
+
+ # Increment our disk counter to look for next disk and unset
+ unset DISK
+ break
+
+ else
+ exit_err "ERROR: commitDiskPart was called without procceding disk<num>= and partition= entries!!!"
+ fi
+ fi
+
+ done <${CFGF}
+};
# Entrance function, which starts the installation process
init_extraction()
@@ -393,6 +434,7 @@ init_extraction()
sftp) ;;
rsync) start_rsync_copy ;;
+ image) start_image_install ;;
*) exit_err "ERROR: Unknown install medium" ;;
esac
OpenPOWER on IntegriCloud