[PC-BSD Commits] r6228 - in pcbsd/trunk/pc-sysinstall: backend backend-query
svn at pcbsd.org
svn at pcbsd.org
Fri Feb 12 12:33:30 PST 2010
Author: kris
Date: 2010-02-12 12:33:29 -0800 (Fri, 12 Feb 2010)
New Revision: 6228
Modified:
pcbsd/trunk/pc-sysinstall/backend-query/update-part-list.sh
pcbsd/trunk/pc-sysinstall/backend/functions-upgrade.sh
Log:
Updated pc-sysinstall, fixes bugs doing upgrade when using a ZFS filesystem
Modified: pcbsd/trunk/pc-sysinstall/backend/functions-upgrade.sh
===================================================================
--- pcbsd/trunk/pc-sysinstall/backend/functions-upgrade.sh 2010-02-12 10:02:31 UTC (rev 6227)
+++ pcbsd/trunk/pc-sysinstall/backend/functions-upgrade.sh 2010-02-12 20:33:29 UTC (rev 6228)
@@ -5,6 +5,9 @@
mount_target_slice()
{
MPART="${1}"
+
+ # Import any zpools
+ zpool import -a
# Set a variable of files we want to make backups of before doing upgrade
BKFILES="/etc/rc.conf /boot/loader.conf"
@@ -14,7 +17,16 @@
rc_halt "mount /dev/${MPART}.journal ${FSMNT}"
elif [ -e "/dev/${MPART}a" ]
then
- rc_halt "mount /dev/${MPART}a ${FSMNT}"
+ mount /dev/${MPART}a ${FSMNT}
+ if [ "$?" != "0" ]
+ then
+ # Try ZFS on this slice
+ mount -t zfs ${MPART}a ${FSMNT}
+ if [ "${?}" != "0" ]
+ then
+ exit_err "Failed to mount ${MPART}"
+ fi
+ fi
fi
mount -t devfs devfs ${FSMNT}/dev
Modified: pcbsd/trunk/pc-sysinstall/backend-query/update-part-list.sh
===================================================================
--- pcbsd/trunk/pc-sysinstall/backend-query/update-part-list.sh 2010-02-12 10:02:31 UTC (rev 6227)
+++ pcbsd/trunk/pc-sysinstall/backend-query/update-part-list.sh 2010-02-12 20:33:29 UTC (rev 6228)
@@ -4,6 +4,8 @@
rm ${TMPDIR}/AvailUpgrades >/dev/null 2>/dev/null
+FSMNT="/mnt"
+
# Create our device listing
SYSDISK="`sysctl kern.disks | cut -d ':' -f 2 | sed 's/^[ \t]*//'`"
DEVS=""
@@ -23,6 +25,9 @@
done
+# Import any zpools
+zpool import -a
+
for i in $DEVS
do
# Set our flag that we have not found any mounts
@@ -32,35 +37,31 @@
if [ -e "${i}a.journal" ]
then
mount ${i}a.journal ${FSMNT} >>${LOGOUT} 2>>${LOGOUT}
- FOUNDMNT="1"
+ if [ "${?}" = "0" ]
+ then
+ FOUNDMNT="1"
+ fi
elif [ -e "${i}a" ]
then
mount ${i}a ${FSMNT} >>${LOGOUT} 2>>${LOGOUT}
- FOUNDMNT="1"
+ if [ "${?}" = "0" ]
+ then
+ FOUNDMNT="1"
+ else
+ # Lets try ZFS of this device
+ ZNAME=`echo ${i} | cut -d '/' -f 3`
+ mount -t zfs ${ZNAME}a ${FSMNT}
+ if [ "${?}" = "0" ]
+ then
+ FOUNDMNT="1"
+ fi
fi
+ fi
if [ "${FOUNDMNT}" = "1" ]
then
PART="${i}"
- # Check if this is a ZFS boot partition
- 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`"
- umount ${FSMNT} >/dev/null 2>/dev/null
- # Import the zfs pool now
- zpool import -R ${FSMNT} -f ${ZROOT} >>${LOGOUT} 2>>${LOGOUT}
-
- # Now mount the root partition for ZFS
- mount -t zfs ${ZROOT}/root ${FSMNT} >>${LOGOUT} 2>>${LOGOUT}
-
- # Mount the bootdir now
- mount ${PART}a ${FSMNT}/bootdir >>${LOGOUT} 2>>${LOGOUT}
-
- zfs mount -a >>${LOGOUT} 2>>${LOGOUT}
- fi
-
touch ${TMPDIR}/TempUMount
mount -t devfs devfs ${FSMNT}/dev
@@ -68,7 +69,6 @@
# Now lets see what type of system we've found here
-
# Create Script
echo '#!/bin/sh
/etc/rc.d/ldconfig start
More information about the Commits
mailing list