[PC-BSD Commits] r5722 - pcbsd/trunk/pc-sysinstall/backend

svn at pcbsd.org svn at pcbsd.org
Wed Dec 30 14:48:01 PST 2009


Author: kris
Date: 2009-12-30 14:48:01 -0800 (Wed, 30 Dec 2009)
New Revision: 5722

Modified:
   pcbsd/trunk/pc-sysinstall/backend/functions-extractimage.sh
   pcbsd/trunk/pc-sysinstall/backend/functions-unmount.sh
   pcbsd/trunk/pc-sysinstall/backend/functions-upgrade.sh
Log:

Fixed some bugs unmounting the CD after a extraction failure, also
fixed some upgrade issues, don't need proc/ and linux proc mounted



Modified: pcbsd/trunk/pc-sysinstall/backend/functions-extractimage.sh
===================================================================
--- pcbsd/trunk/pc-sysinstall/backend/functions-extractimage.sh	2009-12-30 21:06:04 UTC (rev 5721)
+++ pcbsd/trunk/pc-sysinstall/backend/functions-extractimage.sh	2009-12-30 22:48:01 UTC (rev 5722)
@@ -37,9 +37,14 @@
          cd ${FSMNT}.uzip
 
          # Copy over all the files now!
-         tar cvf - . 2>/dev/null | tar -xpv -C ${FSMNT} ${TAROPTS} -f - 2>&1
+         tar cvf - . 2>/dev/null | tar -xpv -C ${FSMNT} ${TAROPTS} -f - 2>&1 | tee -a ${FSMNT}/.tar-extract.log
          if [ "$?" != "0" ]
          then
+           cd /
+           echo "TAR failure occured:" >>${LOGOUT}
+           cat ${FSMNT}/.tar-extract.log | grep "tar:" >>${LOGOUT}
+           umount ${FSMNT}.uzip
+           mdconfig -d -u ${MDDEVICE}
            exit_err "ERROR: Failed extracting the tar image"
          fi
 

Modified: pcbsd/trunk/pc-sysinstall/backend/functions-unmount.sh
===================================================================
--- pcbsd/trunk/pc-sysinstall/backend/functions-unmount.sh	2009-12-30 21:06:04 UTC (rev 5721)
+++ pcbsd/trunk/pc-sysinstall/backend/functions-unmount.sh	2009-12-30 22:48:01 UTC (rev 5722)
@@ -145,6 +145,10 @@
     fi
    else
      # We are doing a upgrade, try unmounting any of these filesystems
+     chroot ${FSMNT} /sbin/umount -a >>${LOGOUT} >>${LOGOUT}
+     umount ${FSMNT}/usr >>${LOGOUT} 2>>${LOGOUT}
+     umount ${FSMNT}/dev >>${LOGOUT} 2>>${LOGOUT}
+     umount ${FSMNT} >>${LOGOUT} 2>>${LOGOUT}
      rc_nohalt "sh ${TMPDIR}/.upgrade-unmount"
    fi
    

Modified: pcbsd/trunk/pc-sysinstall/backend/functions-upgrade.sh
===================================================================
--- pcbsd/trunk/pc-sysinstall/backend/functions-upgrade.sh	2009-12-30 21:06:04 UTC (rev 5721)
+++ pcbsd/trunk/pc-sysinstall/backend/functions-upgrade.sh	2009-12-30 22:48:01 UTC (rev 5722)
@@ -15,7 +15,9 @@
   fi
 
   mount -t devfs devfs ${FSMNT}/dev
-  chroot ${FSMNT} /sbin/mount -a >>${LOGOUT} >>${LOGOUT}
+  chroot ${FSMNT} /sbin/mount -a >>${LOGOUT} 2>>${LOGOUT}
+  chroot ${FSMNT} umount /proc >/dev/null 2>/dev/null 
+  chroot ${FSMNT} umount /compat/linux/proc  >/dev/null 2>/dev/null
 
   # Save which partition was mounted, so we may unmount it later
   echo "umount -f /dev/${MPART}a" >>${TMPDIR}/.upgrade-unmount
@@ -27,10 +29,30 @@
   # If we are doing PC-BSD install, lets cleanup old pkgs on disk
   if [ "$INSTALLTYPE" != "FreeBSD" ]
   then
-    run_chroot_cmd "pkg_delete -f \*"
-    run_chroot_cmd "rm -rf /usr/PCBSD"
-    run_chroot_cmd "rm -rf /PCBSD"
-    run_chroot_cmd "rm -rf /var/db/pkgs"
+    echo_log "Removing old packages, this may take a while... Please wait..."
+    echo '#/bin/sh
+for i in `pkg_info -E \*`
+do
+  echo "Uninstalling package: ${i}"
+  pkg_delete -f ${i} >/dev/null 2>/dev/null
+done
+' >${FSMNT}/.cleanPkgs.sh
+    chmod 755 ${FSMNT}/.cleanPkgs.sh
+    chroot ${FSMNT} /.cleanPkgs.sh
+    rm ${FSMNT}/.cleanPkgs.sh
+    run_chroot_cmd "pkg_delete -f \*" >/dev/null 2>/dev/null
+    run_chroot_cmd "rm -rf /usr/PCBSD" >/dev/null 2>/dev/null
+    run_chroot_cmd "rm -rf /PCBSD" >/dev/null 2>/dev/null
+    run_chroot_cmd "rm -rf /var/db/pkgs" >/dev/null 2>/dev/null
+    run_chroot_cmd "rm -rf /usr/local32" >/dev/null 2>/dev/null
+    run_chroot_cmd "rm -rf /usr/sbin" >/dev/null 2>/dev/null
+    run_chroot_cmd "rm -rf /usr/lib" >/dev/null 2>/dev/null
+    run_chroot_cmd "rm -rf /usr/bin" >/dev/null 2>/dev/null
+    run_chroot_cmd "rm -rf /boot/kernel" >/dev/null 2>/dev/null
+    run_chroot_cmd "rm -rf /sbin" >/dev/null 2>/dev/null
+    run_chroot_cmd "rm -rf /bin" >/dev/null 2>/dev/null
+    run_chroot_cmd "rm -rf /lib" >/dev/null 2>/dev/null
+    run_chroot_cmd "rm -rf /libexec" >/dev/null 2>/dev/null
   fi
 
 }
@@ -90,9 +112,6 @@
                      *) exit_err "ERROR: Unknown PTYPE: $PTYPE" ;;
          esac
 
-         # Now save which disk<num> this is, so we can parse it later during slice partition setup
-         echo "disk${disknum}" >${SLICECFGDIR}/$tmpSLICE
-
          if [ ! -e "/dev/${tmpSLICE}" ]
          then
            exit_err "ERROR: /dev/${tmpSLICE} does not exist! Mount failed!"



More information about the Commits mailing list