[PC-BSD Commits] r17830 - pcbsd/current/src-sh/pc-updatemanager/scripts

svn at pcbsd.org svn at pcbsd.org
Fri Jul 20 07:07:59 PDT 2012


Author: kris
Date: 2012-07-20 14:07:59 +0000 (Fri, 20 Jul 2012)
New Revision: 17830

Modified:
   pcbsd/current/src-sh/pc-updatemanager/scripts/mu-stage1
Log:

Add some additional checks to ensure that we get a good extraction
during the system upgrade process



Modified: pcbsd/current/src-sh/pc-updatemanager/scripts/mu-stage1
===================================================================
--- pcbsd/current/src-sh/pc-updatemanager/scripts/mu-stage1	2012-07-20 13:42:27 UTC (rev 17829)
+++ pcbsd/current/src-sh/pc-updatemanager/scripts/mu-stage1	2012-07-20 14:07:59 UTC (rev 17830)
@@ -9,6 +9,19 @@
 STAGEDIR="${DOWNLOADDIR}/update-stagedir"
 UPVER=`cat ${STAGEDIR}/sys-ver`
 LOGFILE="/root/pcbsd-system-upgrade.log"
+
+rtn()
+{
+  if [ -z "$1" ] ; then
+    echo "Press Enter to continue"
+  else
+    echo "$1"
+  fi
+  read tmp
+}
+
+
+
 echo "Starting system upgrade to $UPVER - `date`" >${LOGFILE}
 
 clear
@@ -64,13 +77,20 @@
 mv /boot/kernel /boot/kernel.old
 echo -e ".\c"
 
+if [ -e "/.boot-tmp" ] ; then
+  rm -rf /.boot-tmp
+fi
+
 mkdir /.boot-tmp
 tar xvpf ${STAGEDIR}/PCBSD.txz -C /.boot-tmp ./boot >/dev/null 2>>${LOGFILE}
 if [ $? -eq 0 ] ; then
   echo -e ".\c"
 else
-  echo -e "x.\c"
-  sleep 5 
+  echo "ERROR: Failed extracting kernel to /.boot-tmp. Is / out of space?"
+  echo "Logfile: ${LOGFILE}"
+  echo "You may need to manually create some space on the disk before continuing update..."
+  rtn "Press Enter to reboot"
+  reboot
 fi
 
 # Remove loader.conf
@@ -82,7 +102,14 @@
 if [ $? -eq 0 ] ; then
   echo "DONE"
 else
-  echo "DONE!"
+  rm -rf /boot/kernel
+  mv /boot/kernel.old /boot/kernel
+  rm -rf /.boot-tmp
+  echo "ERROR: Failed extracting kernel to /boot. Is /boot out of disk space?"
+  echo "Logfile: ${LOGFILE}"
+  echo "You may need to manually create some space on the disk before continuing update..."
+  rtn "Press Enter to reboot"
+  reboot
   sleep 5
 fi
 
@@ -111,7 +138,9 @@
 if [ $? -eq 0 ] ; then
   echo "DONE"
 else
-  echo "DONE!"
+  echo "ERROR: Failed extracting world environment. Is / out of disk space?"
+  echo "Logfile: ${LOGFILE}"
+  rtn
 fi
 
 # Remove deleted files



More information about the Commits mailing list