[PC-BSD Commits] r7148 - pcbsd/stable/pc-sysinstall/backend

svn at pcbsd.org svn at pcbsd.org
Fri Jul 9 07:49:26 PDT 2010


Author: kris
Date: 2010-07-09 07:49:26 -0700 (Fri, 09 Jul 2010)
New Revision: 7148

Modified:
   pcbsd/stable/pc-sysinstall/backend/functions-upgrade.sh
Log:

Preserve /boot/device.hints & /usr/local/kde4/share/config/kdm/kdmrc on upgrades



Modified: pcbsd/stable/pc-sysinstall/backend/functions-upgrade.sh
===================================================================
--- pcbsd/stable/pc-sysinstall/backend/functions-upgrade.sh	2010-07-09 14:18:46 UTC (rev 7147)
+++ pcbsd/stable/pc-sysinstall/backend/functions-upgrade.sh	2010-07-09 14:49:26 UTC (rev 7148)
@@ -12,7 +12,7 @@
   umount_all_dir "${FSMNT}"
   
   # Set a variable of files we want to make backups of before doing upgrade
-  BKFILES="/etc/rc.conf /boot/loader.conf"
+  BKFILES="/etc/rc.conf /boot/loader.conf /boot/device.hints /usr/local/kde4/share/config/kdm/kdmrc"
 
   if [ -e "/dev/${MPART}" ] ; then
     rc_nohalt "mount /dev/${MPART} ${FSMNT}"
@@ -43,6 +43,7 @@
   # Make backup copies of some files
   for i in ${BKFILES}
   do
+    if [ ! -e "${FSMNT}${i}" ] ; then continue ; fi
     cp ${FSMNT}${i} ${FSMNT}${i}.preUpgrade >/dev/null 2>/dev/null
   done
 
@@ -198,6 +199,18 @@
   merge_config "${FSMNT}/etc/rc.conf.preUpgrade" "${FSMNT}/etc/rc.conf.new" "${FSMNT}/etc/rc.conf"
   rm ${FSMNT}/etc/rc.conf.new
 
+  # Merge the device.hints with old
+  cp ${FSMNT}/boot/device.hints ${FSMNT}/boot/device.hints.new
+  merge_config "${FSMNT}/boot/device.hints.preUpgrade" "${FSMNT}/boot/device.hints.new" "${FSMNT}/boot/device.hints"
+  rm ${FSMNT}/boot/device.hints.new
+
+  if [ -e "${FSMNT}/usr/local/kde4/share/config/kdm/kdmrc" ] ; then
+    # Merge the kdmrc file with old to preserve auto-login and other settings
+    _kdmrc="/usr/local/kde4/share/config/kdm/kdmrc"
+    cp ${FSMNT}${_kdmrc} ${FSMNT}${_kdmrc}.new
+    merge_config "${FSMNT}${_kdmrc}.preUpgrade" "${FSMNT}${_kdmrc}.new" "${FSMNT}${_kdmrc}"
+    rm ${FSMNT}${_kdmrc}.new
+  fi
 };
 
 # Function which unmounts all the mounted file-systems



More information about the Commits mailing list