[PC-BSD Commits] r4859 - in pcbsd/trunk/pc-sysinstall: . backend backend-query conf examples
svn at pcbsd.org
svn at pcbsd.org
Tue Nov 3 14:06:21 PST 2009
Author: kris
Date: 2009-11-03 14:06:21 -0800 (Tue, 03 Nov 2009)
New Revision: 4859
Added:
pcbsd/trunk/pc-sysinstall/backend/functions-upgrade.sh
pcbsd/trunk/pc-sysinstall/examples/pcinstall.cfg.restore
Modified:
pcbsd/trunk/pc-sysinstall/backend-query/update-part-list.sh
pcbsd/trunk/pc-sysinstall/backend/functions-extractimage.sh
pcbsd/trunk/pc-sysinstall/backend/functions-unmount.sh
pcbsd/trunk/pc-sysinstall/backend/parseconfig.sh
pcbsd/trunk/pc-sysinstall/conf/exclude-from-upgrade
pcbsd/trunk/pc-sysinstall/pcinstall.cfg
Log:
Added support for doing upgrades in the pc-sysinstall program, simply mounts the target
slice and its individual partitions, and extracts the specified image, using our exclude file
for tar extraction. Still needs work for uzip excludes and net install is still missing
Modified: pcbsd/trunk/pc-sysinstall/backend/functions-extractimage.sh
===================================================================
--- pcbsd/trunk/pc-sysinstall/backend/functions-extractimage.sh 2009-11-03 20:52:18 UTC (rev 4858)
+++ pcbsd/trunk/pc-sysinstall/backend/functions-extractimage.sh 2009-11-03 22:06:21 UTC (rev 4859)
@@ -8,9 +8,9 @@
start_extract_dvd()
{
# Check if we are doing an upgrade, and if so use our exclude list
- if [ "${INSTALLMODE}" != "fresh" ]
+ if [ "${INSTALLMODE}" = "upgrade" ]
then
- TAROPTS="-X ${PROGDIR}/conf/excUpgrade"
+ TAROPTS="-X ${PROGDIR}/conf/exclude-from-upgrade"
else
TAROPTS=""
fi
Modified: pcbsd/trunk/pc-sysinstall/backend/functions-unmount.sh
===================================================================
--- pcbsd/trunk/pc-sysinstall/backend/functions-unmount.sh 2009-11-03 20:52:18 UTC (rev 4858)
+++ pcbsd/trunk/pc-sysinstall/backend/functions-unmount.sh 2009-11-03 22:06:21 UTC (rev 4859)
@@ -68,12 +68,16 @@
# Unmounts any filesystems after a failure
unmount_all_filesystems_failure()
{
- # Lets read our partition list, and unmount each
- ##################################################################
- if [ -d "${PARTDIR}" ]
- then
- for PART in `ls ${PARTDIR}`
- do
+ # if we did a fresh install, start unmounting
+ if [ "${INSTALLMODE}" = "fresh" ]
+ then
+
+ # Lets read our partition list, and unmount each
+ ##################################################################
+ if [ -d "${PARTDIR}" ]
+ then
+ for PART in `ls ${PARTDIR}`
+ do
PARTFS="`cat ${PARTDIR}/${PART} | cut -d ':' -f 1`"
PARTMNT="`cat ${PARTDIR}/${PART} | cut -d ':' -f 2`"
@@ -100,8 +104,12 @@
#########################################################
rc_nohalt "umount ${FSMNT}"
+ fi
+ else
+ # We are doing a upgrade, try unmounting any of these filesystems
+ rc_nohalt "sh ${TMPDIR}/.upgrade-unmount"
fi
-
+
# Unmount our CDMNT
rc_nohalt "umount ${CDMNT}"
};
Modified: pcbsd/trunk/pc-sysinstall/backend/parseconfig.sh
===================================================================
--- pcbsd/trunk/pc-sysinstall/backend/parseconfig.sh 2009-11-03 20:52:18 UTC (rev 4858)
+++ pcbsd/trunk/pc-sysinstall/backend/parseconfig.sh 2009-11-03 22:06:21 UTC (rev 4859)
@@ -4,17 +4,18 @@
# Source our functions scripts
. ${BACKEND}/functions.sh
-. ${BACKEND}/functions-parse.sh
+. ${BACKEND}/functions-bsdlabel.sh
+. ${BACKEND}/functions-cleanup.sh
. ${BACKEND}/functions-disk.sh
-. ${BACKEND}/functions-bsdlabel.sh
-. ${BACKEND}/functions-newfs.sh
-. ${BACKEND}/functions-mountdisk.sh
. ${BACKEND}/functions-extractimage.sh
. ${BACKEND}/functions-installcomponents.sh
+. ${BACKEND}/functions-localize.sh
+. ${BACKEND}/functions-mountdisk.sh
+. ${BACKEND}/functions-newfs.sh
+. ${BACKEND}/functions-parse.sh
. ${BACKEND}/functions-runcommands.sh
-. ${BACKEND}/functions-localize.sh
-. ${BACKEND}/functions-cleanup.sh
. ${BACKEND}/functions-unmount.sh
+. ${BACKEND}/functions-upgrade.sh
. ${BACKEND}/functions-users.sh
# Check that the config file exists
@@ -39,7 +40,7 @@
file_sanity_check "installMode disk0 partition bootManager installType installMedium packageType"
# We passed the Sanity check, lets grab some of the universal config settings and store them
-check_value installMode "fresh upgrade restore"
+check_value installMode "fresh upgrade"
check_value bootManager "bsd none"
check_value installType "PCBSD-Desktop PCBSD-Desktop-OEM PCBSD-Server FreeBSD"
check_value installMedium "dvd usb ftp"
@@ -105,7 +106,16 @@
else
# We're going to do an upgrade, skip all the disk setup
- # and start by mounting the target drive/slice
+ # and start by mounting the target drive/slices
+ mount_upgrade
+ # Start the extraction process
+ init_extraction
+
+ # All finished, unmount the file-systems
+ unmount_upgrade
+
+ echo_log "Upgrade finished!"
+ exit 0
fi
Modified: pcbsd/trunk/pc-sysinstall/backend-query/update-part-list.sh
===================================================================
--- pcbsd/trunk/pc-sysinstall/backend-query/update-part-list.sh 2009-11-03 20:52:18 UTC (rev 4858)
+++ pcbsd/trunk/pc-sysinstall/backend-query/update-part-list.sh 2009-11-03 22:06:21 UTC (rev 4859)
@@ -25,7 +25,7 @@
PART="${i}"
# Check if this is a ZFS boot partition
- cat ${FSMNT}/boot/loader.conf | grep '^vfs.root.mountfrom="zfs:' >/dev/null 2>/dev/null
+ cat ${FSMNT}/boot/loader.conf 2>/dev/null | grep '^vfs.root.mountfrom="zfs:' >/dev/null 2>/dev/null
if [ "$?" = "0" ]
then
ZROOT="`cat ${FSMNT}/boot/loader.conf | grep vfs.root.mountfrom | cut -d '=' -f 2 | cut -d ':' -f 2 | cut -d '/' -f 1`"
Modified: pcbsd/trunk/pc-sysinstall/conf/exclude-from-upgrade
===================================================================
--- pcbsd/trunk/pc-sysinstall/conf/exclude-from-upgrade 2009-11-03 20:52:18 UTC (rev 4858)
+++ pcbsd/trunk/pc-sysinstall/conf/exclude-from-upgrade 2009-11-03 22:06:21 UTC (rev 4859)
@@ -14,3 +14,4 @@
etc/nsmb.conf
usr/Programs/.config/ProgList
Programs/.config/ProgList
+boot/loader.conf
Modified: pcbsd/trunk/pc-sysinstall/pcinstall.cfg
===================================================================
--- pcbsd/trunk/pc-sysinstall/pcinstall.cfg 2009-11-03 20:52:18 UTC (rev 4858)
+++ pcbsd/trunk/pc-sysinstall/pcinstall.cfg 2009-11-03 22:06:21 UTC (rev 4859)
@@ -1,26 +1,15 @@
# Sample configuration file for an installation using pc-sysinstall
-installMode=fresh
+installMode=upgrade
installInteractive=no
hostname=freebsd8
# Set the disk parameters
disk0=ad1
-partition=all
+partition=s1
bootManager=none
commitDiskPart
-# Setup the disk label
-# All sizes are expressed in MB
-# Avail FS Types, UFS, UFS+S, UFS+J, ZFS, SWAP
-# UFS.eli, UFS+S.eli, UFS+J.eli, ZFS.eli, SWAP.eli
-disk0-part=UFS+S 500 /
-disk0-part=SWAP.eli 2000 none
-disk0-part=UFS+S 0 /usr
-# Size 0 means use the rest of the slice size
-# Do it now!
-commitDiskLabel
-
# Set if we are installing via optical, USB, or FTP
installType=FreeBSD
installMedium=dvd
@@ -32,23 +21,6 @@
#installComponents=ports,src
commitInstall
-# Run any commands post-install
-#runCommand=echo 'root' | pw usermod root -h 0
-#runScript=/root/test.sh
-#runExtCommand=echo 'hey there'; touch $FSMNT/touched
-
-# Set the root pass
-rootPass=root
-
-# Setup our users
-userName=kris
-userComment=Kris Moore
-userPass=kris
-userShell=/bin/csh
-userHome=/home/kris
-userGroups=wheel,operator
-commitUser
-
#autoLoginUser=kris
# Options for localizing an install
More information about the Commits
mailing list