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

svn at pcbsd.org svn at pcbsd.org
Fri Sep 16 07:38:29 PDT 2011


Author: kris
Date: 2011-09-16 07:38:28 -0700 (Fri, 16 Sep 2011)
New Revision: 12811

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

Fix bug upgrading on systems which use ZFS on root and special boot
mount-point



Modified: pcbsd/current/src-sh/pc-updatemanager/scripts/mu-stage1
===================================================================
--- pcbsd/current/src-sh/pc-updatemanager/scripts/mu-stage1	2011-09-16 13:53:57 UTC (rev 12810)
+++ pcbsd/current/src-sh/pc-updatemanager/scripts/mu-stage1	2011-09-16 14:38:28 UTC (rev 12811)
@@ -34,9 +34,49 @@
 # Start extracting the updated world now
 echo -e "Extracting updated world environment...\c"
 cd /
+
+# Exclude ./boot in extract will do after world is done
+echo "./boot" >> ${STAGEDIR}/xtra-data/upgrade-excludes
+
 tar xvpf ${STAGEDIR}/PCBSD.tbz -X ${STAGEDIR}/xtra-data/upgrade-excludes >/dev/null 2>/dev/null
-echo "DONE"
+if [ $? -eq 0 ] ; then
+  echo "DONE"
+else
+  echo "DONE!"
+fi
 
+# Start extracting the boot
+echo -e "Extracting kernel and boot environment...\c"
+cd /
+
+# Backup the old kernel
+rm -rf /boot/kernel.old >/dev/null 2>/dev/null 
+mv /boot/kernel /boot/kernel.old
+echo -e ".\c"
+
+mkdir /.boot-tmp
+tar xvpf ${STAGEDIR}/PCBSD.tbz -C /.boot-tmp ./boot >/dev/null 2>/dev/null
+if [ $? -eq 0 ] ; then
+  echo -e ".\c"
+else
+  echo -e "x.\c"
+  sleep 5 
+fi
+
+# Remove loader.conf
+rm /.boot-tmp/boot/loader.conf
+
+tar cvf - -C /.boot-tmp/boot . | tar xvf - -C /boot >/dev/null 2>/dev/null
+if [ $? -eq 0 ] ; then
+  echo "DONE"
+else
+  echo "DONE!"
+  sleep 5
+fi
+
+# Cleanup the boot tmp files
+rm -rf /.boot-tmp
+
 # Remove deleted files
 cd /
 oList="${STAGEDIR}/xtra-data/system-file.list.old"
@@ -110,5 +150,7 @@
 cp ${STAGEDIR}/mu-stage2 ${STAGEDIR}/doupdate.sh
 
 echo -e "Rebooting for stage 2 of upgrade...\c"
+sync
+sleep 5
 (shutdown -r now) &
 sleep 500



More information about the Commits mailing list