[PC-BSD Commits] r5721 - in pcbsd/trunk/pc-sysinstall: backend backend-query

svn at pcbsd.org svn at pcbsd.org
Wed Dec 30 13:06:04 PST 2009


Author: kris
Date: 2009-12-30 13:06:04 -0800 (Wed, 30 Dec 2009)
New Revision: 5721

Modified:
   pcbsd/trunk/pc-sysinstall/backend-query/update-part-list.sh
   pcbsd/trunk/pc-sysinstall/backend/functions-upgrade.sh
Log:

Fixed some bugs in the detection of the available upgradeable systems,
and improved upgrade functionality



Modified: pcbsd/trunk/pc-sysinstall/backend/functions-upgrade.sh
===================================================================
--- pcbsd/trunk/pc-sysinstall/backend/functions-upgrade.sh	2009-12-30 20:18:39 UTC (rev 5720)
+++ pcbsd/trunk/pc-sysinstall/backend/functions-upgrade.sh	2009-12-30 21:06:04 UTC (rev 5721)
@@ -14,28 +14,9 @@
     rc_halt "mount /dev/${MPART}a ${FSMNT}"
   fi
 
-  # Check for the partitions in fstab, and mount them now
-  LIST="d e f g h"
-  for j in $LIST
-  do
-    cat ${FSMNT}/etc/fstab | grep "/dev/${MPART}${j}" >/dev/null 2>/dev/null
-    if [ "$?" = "0" ]
-    then
-      MNT="`cat ${FSMNT}/etc/fstab | grep "/dev/${MPART}${j}" | cut -f 2 | cut -d " " -f 1`" >/dev/null 2>/dev/null
+  mount -t devfs devfs ${FSMNT}/dev
+  chroot ${FSMNT} /sbin/mount -a >>${LOGOUT} >>${LOGOUT}
 
-      # Check for .journal extensions
-      ls /dev/${MPART}${j}.journal >/dev/null 2>/dev/null
-      if [ "$?" = "0" ]
-      then
-        rc_halt "mount /dev/${MPART}${j}.journal ${FSMNT}${MNT}"
-        echo "umount -f /dev/${MPART}${j}.journal" >>${TMPDIR}/.upgrade-unmount
-      else
-        rc_halt "mount /dev/${MPART}${j} ${FSMNT}${MNT}"
-        echo "umount -f /dev/${MPART}${j}" >>${TMPDIR}/.upgrade-unmount
-      fi
-    fi
-  done
- 
   # Save which partition was mounted, so we may unmount it later
   echo "umount -f /dev/${MPART}a" >>${TMPDIR}/.upgrade-unmount
 
@@ -137,6 +118,13 @@
 {
    cd /
 
+   # Unmount FS
+   chroot ${FSMNT} /sbin/umount -a >>${LOGOUT} >>${LOGOUT}
+   umount ${FSMNT}/usr >>${LOGOUT} 2>>${LOGOUT}
+   umount ${FSMNT}/dev >>${LOGOUT} 2>>${LOGOUT}
+   umount ${FSMNT} >>${LOGOUT} 2>>${LOGOUT}
+
    # Run our saved unmount script for these file-systems
    rc_nohalt "sh ${TMPDIR}/.upgrade-unmount"
+  
 };

Modified: pcbsd/trunk/pc-sysinstall/backend-query/update-part-list.sh
===================================================================
--- pcbsd/trunk/pc-sysinstall/backend-query/update-part-list.sh	2009-12-30 20:18:39 UTC (rev 5720)
+++ pcbsd/trunk/pc-sysinstall/backend-query/update-part-list.sh	2009-12-30 21:06:04 UTC (rev 5721)
@@ -12,11 +12,11 @@
 
   if [ -e "${i}a.journal" ]
   then
-    mount ${i}a.journal ${FSMNT} >${LOGOUT} 2>${LOGOUT}
+    mount ${i}a.journal ${FSMNT} >>${LOGOUT} 2>>${LOGOUT}
     FOUNDMNT="1"
   elif [ -e "${i}a" ]
   then
-    mount ${i}a ${FSMNT} >${LOGOUT} 2>${LOGOUT}
+    mount ${i}a ${FSMNT} >>${LOGOUT} 2>>${LOGOUT}
     FOUNDMNT="1"
   fi
 
@@ -31,45 +31,22 @@
       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 -R ${FSMNT} -f ${ZROOT} >${LOGOUT} 2>${LOGOUT}
+      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 -t zfs ${ZROOT}/root ${FSMNT} >>${LOGOUT} 2>>${LOGOUT}
       
       # Mount the bootdir now
-      mount ${PART}a ${FSMNT}/bootdir >${LOGOUT} 2>${LOGOUT}
+      mount ${PART}a ${FSMNT}/bootdir >>${LOGOUT} 2>>${LOGOUT}
 
-      zfs mount -a >${LOGOUT} 2>${LOGOUT}
+      zfs mount -a >>${LOGOUT} 2>>${LOGOUT}
    fi
 
    touch ${TMPDIR}/TempUMount
 
-   # Check for the partitions in fstab, and mount them now
-   LIST="d e f g h"
-   for j in $LIST
-   do
-     cat ${FSMNT}/etc/fstab 2>/dev/null | grep "${PART}${j}" >/dev/null 2>/dev/null
-     if [ "$?" = "0" ]
-     then
-       MNT="`cat ${FSMNT}/etc/fstab | grep ${PART}${j} | cut -f 2 | cut -d " " -f 1`" >/dev/null 2>/dev/null
+   mount -t devfs devfs ${FSMNT}/dev
+   chroot ${FSMNT} /sbin/mount -a >>${LOGOUT} >>${LOGOUT}
 
-       # Check for .journal extensions
-       ls ${PART}${j}.journal >/dev/null 2>/dev/null
-       if [ "$?" = "0" ]
-       then
-         mount ${PART}${j}.journal ${FSMNT}${MNT} >${LOGOUT} 2>${LOGOUT}
-         echo "umount ${PART}${j}.journal" >> /tmp/TempUMount
-       else
-         mount ${PART}${j} ${FSMNT}${MNT} >${LOGOUT} 2>${LOGOUT}
-         # Save which partition was mounted, so we may unmount it in a bit
-         echo "umount ${PART}${j}" >> /tmp/TempUMount
-       fi
-       
-
-     fi
-   done
-
-
   
 # Now lets see what type of system we've found here
 
@@ -87,8 +64,8 @@
 
 uname -r >/.fbver 2>/.fbver' >${FSMNT}/getver.sh 
 
-    chmod 755 ${FSMNT}/getver.sh >/dev/null 2>/dev/null
-    chroot ${FSMNT} /getver.sh >${LOGOUT} 2>${LOGOUT}
+    chmod 755 ${FSMNT}/getver.sh >>/dev/null 2>>/dev/null
+    chroot ${FSMNT} /getver.sh >>${LOGOUT} 2>>${LOGOUT}
     PCVER="`cat ${FSMNT}/.pcver 2>/dev/null`"
     FBVER="`cat ${FSMNT}/.fbver 2>/dev/null`"
        
@@ -109,30 +86,30 @@
     # If we are on ZFS, cleanup after the mount
     if [ ! -z "${ZROOT}" ]
     then
-      umount ${FSMNT}/bootdir >${LOGOUT} 2>${LOGOUT}
-      /bin/sh /tmp/TempUMount >${LOGOUT} 2>${LOGOUT}
+      umount ${FSMNT}/bootdir >>${LOGOUT} 2>>${LOGOUT}
+      /bin/sh /tmp/TempUMount >>${LOGOUT} 2>>${LOGOUT}
 
       # Unmount any extra fs from the zfs pool
-      zfs unmount -a >${LOGOUT} 2>${LOGOUT}
+      zfs unmount -a >>${LOGOUT} 2>>${LOGOUT}
 
-      umount ${FSMNT} >${LOGOUT} 2>${LOGOUT}
+      umount ${FSMNT} >>${LOGOUT} 2>>${LOGOUT}
       rm /tmp/TempUMount >/dev/null 2>/dev/null
 
       # Remount the bootdir to /mnt
-      mount ${PART}a ${FSMNT} >${LOGOUT} 2>${LOGOUT}
+      mount ${PART}a ${FSMNT} >>${LOGOUT} 2>>${LOGOUT}
 
       # Copy over our ZFS cache data
-      cp /boot/zfs/* ${FSMNT}/boot/zfs/ >${LOGOUT} 2>${LOGOUT}
+      cp /boot/zfs/* ${FSMNT}/boot/zfs/ >>${LOGOUT} 2>>${LOGOUT}
 
       # Unmount the /bootdir partition again
-      umount ${FSMNT} >${LOGOUT} 2>${LOGOUT}
+      umount ${FSMNT} >>${LOGOUT} 2>>${LOGOUT}
     else
       # Unmount FS
-      /bin/sh /tmp/TempUMount >${LOGOUT} 2>${LOGOUT}
-      umount ${FSMNT} >${LOGOUT} 2>${LOGOUT}
-      rm /tmp/TempUMount >${LOGOUT} 2>${LOGOUT}
+      chroot ${FSMNT} /sbin/umount -a >>${LOGOUT} >>${LOGOUT}
+      umount ${FSMNT}/usr >>${LOGOUT} 2>>${LOGOUT}
+      umount ${FSMNT}/dev >>${LOGOUT} 2>>${LOGOUT}
+      umount ${FSMNT} >>${LOGOUT} 2>>${LOGOUT}
     fi
-
     
   fi # End of if ${i}a
      



More information about the Commits mailing list