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

svn at pcbsd.org svn at pcbsd.org
Tue Sep 11 14:11:15 PDT 2007


Author: kris
Date: 2007-09-11 14:11:15 -0700 (Tue, 11 Sep 2007)
New Revision: 699

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

Fix to upgrade process so that it doesn't move /usr/home and /usr/Programs
to another partition. Should keep the data on /usr now for folks who custom
partitioned the system. 



Modified: pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.MountUpgrade.sh
===================================================================
--- pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.MountUpgrade.sh	2007-09-11 20:55:30 UTC (rev 698)
+++ pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.MountUpgrade.sh	2007-09-11 21:11:15 UTC (rev 699)
@@ -35,8 +35,6 @@
 mv /mnt/usr/local/MyPrograms /mnt/tmp/upgradebackup/
 mv /mnt/usr/local/etc /mnt/tmp/upgradebackup/localetc
 mv /mnt/Programs /mnt/tmp/upgradebackup/
-mv /mnt/usr/Programs /mnt/tmp/upgradebackup/usrPrograms
-mv /mnt/usr/home /mnt/tmp/upgradebackup/usrhome
 mv /mnt/home /mnt/tmp/upgradebackup/home
 mv /mnt/root /mnt/tmp/upgradebackup/root
 
@@ -50,22 +48,28 @@
 
 echo "Cleaning up old installation..."
 chflags -R noschg /mnt
-mv /mnt/usr/ports /mnt/ports 2>/dev/null
-mv /mnt/usr/src /mnt/src 2>/dev/null
-rm -rf usr 2>/dev/null
 rm -rf boot 2>/dev/null
 rm -rf lib 2>/dev/null
 rm -rf libexec 2>/dev/null 
 rm -rf var 2>/dev/null
-mkdir -p /mnt/usr
 
+# Setup our loop to remove stuff in /usr, saving certian dirs
+for i in `ls /mnt/usr`
+do
+ case ${i} in
+    home) z="1" ;;
+   ports) z="1" ;;
+     src) z="1" ;;
+Programs) z="1" ;;
+       *) rm -rf /mnt/usr/${i} 2>/dev/null ;;
+ esac
+done
+
+
 # Move back the local/etc directory so it gets saved / upgraded
 mkdir -p /mnt/usr/local
 mv /mnt/tmp/upgradebackup/localetc /mnt/usr/local/etc
 
-mv /mnt/ports /mnt/usr/ports 2>/dev/null
-mv /mnt/src /mnt/usr/src 2>/dev/null
-
 mv /mnt/etc/X11/XF86Config /mnt/etc/X11/XF86Config.preUpgrade 2>/dev/null
 mv /mnt/etc/X11/xorg.conf /mnt/etc/X11/xorg.conf.preUpgrade 2>/dev/null
 rm /mnt/var/run/denyhosts.pid
@@ -93,16 +97,12 @@
 # Restore old data
 echo "Restoring saved data..."
 rm -rf /mnt/Programs
-rm -rf /mnt/usr/Programs
 rm -rf /mnt/home
-rm -rf /mnt/usr/home
 rm -rf /mnt/root
 
 mv -f /mnt/tmp/upgradebackup/kdmrc /mnt/usr/local/share/config/kdm/kdmrc
 mv -f /mnt/tmp/upgradebackup/MyPrograms /mnt/usr/local/MyPrograms
 mv -f /mnt/tmp/upgradebackup/Programs /mnt/Programs
-mv -f /mnt/tmp/upgradebackup/usrPrograms /mnt/usr/Programs
-mv -f /mnt/tmp/upgradebackup/usrhome /mnt/usr/home
 mv -f /mnt/tmp/upgradebackup/home /mnt/home
 mv -f /mnt/tmp/upgradebackup/root /mnt/root
 



More information about the Commits mailing list