diff options
author | jpaetzel <jpaetzel@FreeBSD.org> | 2011-02-17 16:33:41 +0000 |
---|---|---|
committer | jpaetzel <jpaetzel@FreeBSD.org> | 2011-02-17 16:33:41 +0000 |
commit | 38ea23ab3eb9b2ae741939f14f4dd1d81e531110 (patch) | |
tree | 23ed9f9dddae42073f9fcb6b4bd2f5486d657b6f | |
parent | 2f4da8e71efe2c607bdfa327d079c9088d2946be (diff) | |
download | FreeBSD-src-38ea23ab3eb9b2ae741939f14f4dd1d81e531110.zip FreeBSD-src-38ea23ab3eb9b2ae741939f14f4dd1d81e531110.tar.gz |
Add "Extract Only" functionality to pc-sysinstall. This allows disk setup to
be done manually, pc-sysinstall is pointed to a mount-point for installation.
PR: bin/154685
Submitted by: kmoore
Approved by: kib (mentor)
-rwxr-xr-x | usr.sbin/pc-sysinstall/backend/functions.sh | 36 | ||||
-rwxr-xr-x | usr.sbin/pc-sysinstall/backend/parseconfig.sh | 15 | ||||
-rw-r--r-- | usr.sbin/pc-sysinstall/conf/pc-sysinstall.conf | 4 | ||||
-rw-r--r-- | usr.sbin/pc-sysinstall/examples/README | 21 |
4 files changed, 66 insertions, 10 deletions
diff --git a/usr.sbin/pc-sysinstall/backend/functions.sh b/usr.sbin/pc-sysinstall/backend/functions.sh index 2b78bbc..c413968 100755 --- a/usr.sbin/pc-sysinstall/backend/functions.sh +++ b/usr.sbin/pc-sysinstall/backend/functions.sh @@ -409,6 +409,7 @@ write_image() fi }; +# Setup and install on a new disk / partition install_fresh() { # Lets start setting up the disk slices now @@ -458,6 +459,39 @@ install_fresh() echo_log "Installation finished!" }; +# Extract the system to a pre-mounted directory +install_extractonly() +{ + # We are ready to begin extraction, lets start now + init_extraction + + # Check if we have any optional modules to load + install_components + + # Check if we have any packages to install + install_packages + + # Do any localization in configuration + run_localize + + # Save any networking config on the installed system + save_networking_install + + # Now add any users + setup_users + + # Now run any commands specified + run_commands + + # Set a hostname on the install system + setup_hostname + + # Set the root_pw if it is specified + set_root_pw + + echo_log "Installation finished!" +}; + install_image() { # We are ready to begin extraction, lets start now @@ -478,7 +512,7 @@ install_upgrade() # Do any localization in configuration run_localize - # ow run any commands specified + # Now run any commands specified run_commands # Merge any old configuration files diff --git a/usr.sbin/pc-sysinstall/backend/parseconfig.sh b/usr.sbin/pc-sysinstall/backend/parseconfig.sh index 15611fd..ad9c2d7 100755 --- a/usr.sbin/pc-sysinstall/backend/parseconfig.sh +++ b/usr.sbin/pc-sysinstall/backend/parseconfig.sh @@ -67,11 +67,10 @@ fi export CFGF # Start by doing a sanity check, which will catch any obvious mistakes in the config -file_sanity_check "installMode disk0 installType installMedium packageType" +file_sanity_check "installMode installType installMedium packageType" # We passed the Sanity check, lets grab some of the universal config settings and store them -check_value installMode "fresh upgrade" -check_value bootManager "bsd none" +check_value installMode "fresh upgrade extract" check_value installType "PCBSD FreeBSD" check_value installMedium "dvd usb ftp rsync image" check_value packageType "uzip tar rsync split" @@ -108,6 +107,16 @@ case "${INSTALLMODE}" in fi ;; + extract) + # Extracting only, make sure we have a valid target directory + get_value_from_cfg installLocation + FSMNT="${VAL}" ; export FSMNT + if [ -z "$FSMNT" ] ; then exit_err "Missing installLocation=" ; fi + if [ ! -d "$FSMNT" ] ; then exit_err "No such directory: $FSMNT" ; fi + + install_extractonly + ;; + upgrade) install_upgrade ;; diff --git a/usr.sbin/pc-sysinstall/conf/pc-sysinstall.conf b/usr.sbin/pc-sysinstall/conf/pc-sysinstall.conf index 6a9f0cb..5d682dc 100644 --- a/usr.sbin/pc-sysinstall/conf/pc-sysinstall.conf +++ b/usr.sbin/pc-sysinstall/conf/pc-sysinstall.conf @@ -36,8 +36,8 @@ RSYNCTRIES="3" export RSYNCTRIES # Set our mount-points -CDMNT="/cdmnt-install" -FSMNT="/mnt" +CDMNT=${CDMNT-/cdmnt-install} +FSMNT=${FSMNT-/mnt} UZIP_DIR="/usr" BOOT_PART_MOUNT="/boot-mount" export FSMNT CDMNT UZIP_DIR BOOT_PART_MOUNT diff --git a/usr.sbin/pc-sysinstall/examples/README b/usr.sbin/pc-sysinstall/examples/README index 05e0386..2eb1e6f 100644 --- a/usr.sbin/pc-sysinstall/examples/README +++ b/usr.sbin/pc-sysinstall/examples/README @@ -12,9 +12,9 @@ installed system When hostname= is not present, pc-sysinstall will auto-generate a hostname such as freebsd-XXXX or pcbsd-XXXX -# installMode=(fresh or upgrade) +# installMode=(fresh/upgrade/extract) -Set the type of install we are doing, fresh or upgrade. +Set the type of install we are doing. Fresh installs will format and mount the target disks before extracting the install images to the system. Using this mode @@ -27,6 +27,19 @@ The conf/exclude-from-upgrade file can be used to specify additional files to exclude from overwriting during the install process. +Extract will skip any disk setup, and perform an installation +to the directory specified by "installLocation=". This location +should be a directory with your pre-mounted file-systems ready +for file extraction. When using the "extract" option, /etc/fstab +on the installed system will *not* be automatically configured. + +# installLocation= + +Used only when installMode is set to extract. + +This is set to the location you want to extract your system to, +and should already be mounted properly. + # installInteractive=(yes or no) Set if the installer is running in interactive mode, and @@ -320,7 +333,7 @@ Run the specified command within chroot of the installed system # runScript= runScript will copy the specified script into FSMNT, and run it in chroot of the system -Usefull when you have a 3rd party script on the DVD / USB, and you want to copy it into +Useful when you have a 3rd party script on the DVD / USB, and you want to copy it into the installed system and run # runExtCommand= @@ -330,7 +343,7 @@ The variable $FSMNT is set to the mount-point of your installed system ######################################################################## -# PC-BSD SPECIFC OPTIONS +# PC-BSD SPECIFIC OPTIONS ######################################################################## Options for time-zones and NTP on the installed system |