[PC-BSD Commits] r4035 - pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts

svn at pcbsd.org svn at pcbsd.org
Wed Jun 3 08:22:40 PDT 2009


Author: kris
Date: 2009-06-03 08:22:39 -0700 (Wed, 03 Jun 2009)
New Revision: 4035

Modified:
   pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.FindUpdateParts.sh
   pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.MountUpgrade.sh
   pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.SysConfig.sh
Log:

Did some more fixing up for ZFS upgrades, should be able to fully upgrade from ZFS root partition, and systems with
other ZFS file-systems



Modified: pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.FindUpdateParts.sh
===================================================================
--- pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.FindUpdateParts.sh	2009-06-03 14:43:00 UTC (rev 4034)
+++ pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.FindUpdateParts.sh	2009-06-03 15:22:39 UTC (rev 4035)
@@ -33,13 +33,16 @@
       ZROOT="`cat ${FSMNT}/boot/loader.conf | grep vfs.root.mountfrom | cut -d '=' -f 2 | cut -d ':' -f 2 | cut -d '/' -f 1`"
       umount ${FSMNT}
       # Import the zfs pool now
-      zpool import -f ${ZROOT}
+      zpool import -R ${FSMNT} -f ${ZROOT}
 
       # Now mount the root partition for ZFS
       mount -t zfs ${ZROOT}/root ${FSMNT}
       
       # Mount the bootdir now
       mount ${PART}a ${FSMNT}/bootdir
+
+      # Mount any additional partitions we may have
+      zfs mount -a
    fi
 
    touch /tmp/TempUMount
@@ -106,8 +109,14 @@
     # If we are on ZFS, cleanup after the mount
     if [ ! -z "${ZROOT}" ]
     then
+      # Unmount any auto-mounted ZFS partitions
+      zfs unmount -a
+
+      # Unmount the bootdir
       umount ${FSMNT}/bootdir
       /bin/sh /tmp/TempUMount
+
+      # Umount the root partition
       umount ${FSMNT}
       rm /tmp/TempUMount
 

Modified: pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.MountUpgrade.sh
===================================================================
--- pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.MountUpgrade.sh	2009-06-03 14:43:00 UTC (rev 4034)
+++ pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.MountUpgrade.sh	2009-06-03 15:22:39 UTC (rev 4035)
@@ -24,7 +24,7 @@
   ZROOT="`cat ${FSMNT}/boot/loader.conf | grep vfs.root.mountfrom | cut -d '=' -f 2 | cut -d ':' -f 2 | cut -d '/' -f 1`"
   umount ${FSMNT}
   # Import the zfs pool now
-  zpool import -f ${ZROOT}
+  zpool import -R ${FSMNT} -f ${ZROOT}
 
   # Now mount the root partition for ZFS
   mount -t zfs ${ZROOT}/root ${FSMNT}
@@ -34,6 +34,10 @@
   echo "${ZROOT}" >/tmp/upgradeZFS
   echo "${PART}a" >/uzip/ZFS-bootpart
   echo "/dev/${ZROOT}" >/uzip/ZFS-root
+
+  # Now mount any other zfs file systems in this pool
+  zfs mount -a
+
 fi
 
 

Modified: pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.SysConfig.sh
===================================================================
--- pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.SysConfig.sh	2009-06-03 14:43:00 UTC (rev 4034)
+++ pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.SysConfig.sh	2009-06-03 15:22:39 UTC (rev 4035)
@@ -1,4 +1,4 @@
-#!/bin/sh
+!/bin/sh
 
 # Configuration file
 . /usr/local/pcbsd/scripts/PCBSD.Config
@@ -184,30 +184,39 @@
     # Copy over the /etc/hostid from our install CD to the HD
     cp /etc/hostid ${FSMNT}/etc/hostid
 
-    # Move the kernel to /bootdir so we can bootup properly
-    mv -f ${FSMNT}/boot ${FSMNT}/bootdir/
+    # Reset our mount points for any extra ZFS partitions
+    cd /uzip/zfsmnts/
+    for i in `ls`
+    do
+      # Only set the mounts on partitions besides root
+      if [ "${i}" != "${BASENAME}" ]
+      then
+        zfs set mountpoint=`cat ${i}` ${i}`cat ${i}`
+        umount `cat ${i}`
+        zfs export -f ${i}
+      fi
+    done
 
-    # Create our link to /boot on the ZFS partition
-    ln -s /bootdir/boot ${FSMNT}/boot
   fi
 
-  # Reset our mount points for any extra ZFS partitions
-  cd /uzip/zfsmnts/
-  for i in `ls`
-  do
-    # Only set the mounts on partitions besides root
-    if [ "${i}" != "${BASENAME}" ]
-    then
-      zfs set mountpoint=`cat ${i}` ${i}`cat ${i}`
-      umount `cat ${i}`
-      zfs export -f ${i}
-    fi
-  done
+  # Move the kernel to /bootdir so we can bootup properly
+  rm -rf ${FSMNT}/bootdir/boot >/dev/null 2>/dev/null
+  mv -f ${FSMNT}/boot ${FSMNT}/bootdir/
 
+  # Create our link to /boot on the ZFS partition
+  ln -s /bootdir/boot ${FSMNT}/boot
+
+
   cd /
   
+  # Make sure all auto-mounted ZFS partitions are unmounted now
+  zfs unmount -a 
+  
   # Unmount the /bootdir directory
   umount ${FSMNT}/bootdir
+  
+  # Unmount the root partition
+  umount ${FSMNT}
 
   #  Set our root partition that it needs not be automounted
   zfs set mountpoint=legacy ${BASENAME}/root



More information about the Commits mailing list