Update of /cvsroot/devil-linux/build/scripts/scripts
In directory sc8-pr-cvs1:/tmp/cvs-serv5686
Modified Files:
Tag: rel-1-0-patches
pre_init
Log Message:
Code to update configuration on new releases.
Index: pre_init
===================================================================
RCS file: /cvsroot/devil-linux/build/scripts/scripts/pre_init,v
retrieving revision 1.6.2.1
retrieving revision 1.6.2.2
diff -u -d -r1.6.2.1 -r1.6.2.2
--- pre_init 9 Oct 2003 00:15:47 -0000 1.6.2.1
+++ pre_init 5 Nov 2003 16:07:12 -0000 1.6.2.2
@@ -46,9 +46,14 @@
mount -o remount,size=$CHANGE_SHMFS_SIZE /shm
fi
+# unpack /var to the shmfs
+echo "Unpacking /var"
+tar -C /shm/ -xjf /config/var.tar.bz2
+
if [ -d /config/etc_files ]; then
if ! cmp -s /shm/etc/Devil-release /config/etc_files/Devil-release
then
+ cp -f /config/etc_files/issue* /etc
RV1="$(cat /shm/etc/Devil-release | sed 's/Devil-Linux //')"
RV2="$(cat /config/etc_files/Devil-release | sed 's/Devil-Linux //')"
echo
@@ -63,21 +68,50 @@
echo "Your cdrom is version: $RV2"
$NORMAL
echo
- echo 'Running "save-config" will eliminate this error message in future reboots,'
- echo "but will NOT fix any problems caused by old configuration files."
- echo
- read -n 1 -t 60 -p "Press any key to continue ... (or timeout in 60 seconds)"
+ read -n 1 -t 300 -p 'Press any key to upgrade, or "n" to skip. (timeout in 5 minutes)' bs
echo
+ if [ "$bs" != "n" ]; then
+ echo
+ echo -n "Comparing configurations, please wait "
+ /sbin/upgrade-config
+ echo
+ read -n 1 -t 300 -p 'Press any key to switch to your new config, or "n" to skip. (timeout in 5 min)' bs
+ echo
+ if [ "$bs" != "n" ]; then
+ cp -f /config/etc_files/* /shm/newconfig/etc/
+ cp -f /shm/etc/mtab /shm/newconfig/etc/
+ mv /shm/etc /shm/etc-old
+ mv /shm/newconfig/etc/ /shm/etc
+ $YELLOW
+ echo
+ echo 'You MUST run "save-config" after bootup to save your new config'
+ echo
+ $NORMAL
+ echo 'Your old etc directory will be saved until reboot at: /shm/etc-old'
+ echo "Your old config file has been saved as: /etc/sysconfig/config.old"
+ echo "A log of all changes is available at: /etc/sysconfig/upgrade.log"
+
+ echo
+ read -n 1 -t 300 -p 'Press any key to continue ... (timeout in 5 minutes)'
+ echo
+ else
+ rm -fr /shm/newconfig
+ $YELLOW
+ echo
+ echo
+ echo 'No changes made.'
+ echo
+ $NORMAL
+ read -n 1 -t 300 -p 'Press any key to continue ... (timeout in 5 minutes)'
+ echo
+ fi
+ fi
+ unset bs
fi
- cp -fdR /config/etc_files/* /etc
fi
# make sure, all the files in /etc are owned by root
chown -R 0.0 /shm/etc/*
-
-# unpack /var to the shmfs
-echo "Unpacking /var"
-tar -C /shm/ -xjf /config/var.tar.bz2
echo "Initializing devfs"
mount -t devfs none /dev
|