]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - config/rootfiles/core/38/update.sh
Merge branch 'master' of git://git.ipfire.org/ipfire-2.x
[people/pmueller/ipfire-2.x.git] / config / rootfiles / core / 38 / update.sh
index 244b188bd9a3aaee9145ccbb10a09095fb317f10..1c65373fc684b31c7bcf4411d82e1c6e4ad59ecf 100644 (file)
 . /opt/pakfire/lib/functions.sh
 /usr/local/bin/backupctrl exclude >/dev/null 2>&1
 #
-KVER="2.6.32.12"
+OLDVERSION=`grep "version = " /opt/pakfire/etc/pakfire.conf | cut -d'"' -f2`
+#
+# Test if we running on xen
+#
+uname -r | grep "ipfire-xen";
+if [ ${?} = 0 ]; then
+       #Xen Kernel is active
+       NEWVERSION="2.7-xen"
+else
+       #Normal Kernel
+       NEWVERSION="2.7"
+fi
+#
+KVER="2.6.32.15"
 ROOT=`grep "root=" /boot/grub/grub.conf | cut -d"=" -f2 | cut -d" " -f1 | tail -n 1`
 MOUNT=`grep "kernel" /boot/grub/grub.conf | tail -n 1`
 # Nur den letzten Parameter verwenden
@@ -57,6 +70,7 @@ tar cjvf /var/ipfire/backup/core-upgrade_$KVER.tar.bz2 \
 /etc/init.d/collectd stop
 /etc/init.d/squid stop
 /etc/init.d/ipsec stop
+/etc/init.d/snort stop
 
 echo
 echo Update Kernel to $KVER ...
@@ -66,15 +80,26 @@ rm -rf /boot/System.map-*
 rm -rf /boot/config-*
 rm -rf /boot/ipfirerd-*
 rm -rf /boot/vmlinuz-*
-# Don't remove old xen modules. Kernel may stored outside.
 rm -rf /lib/modules/*-ipfire
-
+# Don't remove all old xen modules. Kernel may stored outside.
+# only from 2.6.27.25 and 31
+rm -rf /lib/modules/2.6.27.25-ipfire-xen
+rm -rf /lib/modules/2.6.27.31-ipfire-xen
 #
 # remove openswan libs ...
 #
 rm -rf /usr/lib/ipsec
 rm -rf /usr/libexec/ipsec
-
+#
+# old snort libs and rules ...
+#
+rm -rf /usr/lib/snort_*
+rm -rf /etc/snort
+#
+# mISDN Files that was moved to sbin
+#
+rm -rf /usr/bin/misdn_rename
+rm -rf /usr/bin/misdn_cleanl2
 #
 # Backup grub.conf
 #
@@ -91,9 +116,8 @@ echo Unpack the updated files ...
 tar xvf /opt/pakfire/tmp/files --preserve --numeric-owner -C / \
        --no-overwrite-dir
 #
-# Start Sevices
+# Start sysklogd
 /etc/init.d/sysklogd start
-/etc/init.d/squid start
 #
 # Modify grub.conf
 #
@@ -218,8 +242,33 @@ echo "cryptodev" >> /etc/sysconfig/modules
 echo "" >> /etc/sysconfig/modules
 echo "# End /etc/sysconfig/modules" >> /etc/sysconfig/modules
 chmod 644 /etc/sysconfig/modules
+# Change version of Pakfire.conf
+#
+sed -i "s|$OLDVERSION|$NEWVERSION|g" /opt/pakfire/etc/pakfire.conf
+#
+# After pakfire has ended run it again and update the lists and do upgrade
+#
+echo '#!/bin/bash'                                        >  /tmp/pak_update
+echo 'while [ "$(ps -A | grep " update.sh")" != "" ]; do' >> /tmp/pak_update
+echo '    sleep 1'                                        >> /tmp/pak_update
+echo 'done'                                               >> /tmp/pak_update
+echo 'while [ "$(ps -A | grep " pakfire")" != "" ]; do'   >> /tmp/pak_update
+echo '    sleep 1'                                        >> /tmp/pak_update
+echo 'done'                                               >> /tmp/pak_update
+echo '/opt/pakfire/pakfire update -y --force'             >> /tmp/pak_update
+echo '/opt/pakfire/pakfire upgrade -y'                    >> /tmp/pak_update
+echo '/opt/pakfire/pakfire upgrade -y'                    >> /tmp/pak_update
+echo '/opt/pakfire/pakfire upgrade -y'                    >> /tmp/pak_update
+echo '/usr/bin/logger -p syslog.emerg -t core-upgrade-38 "Upgrade finished. If you use a customized grub.cfg"' >> /tmp/pak_update
+echo '/usr/bin/logger -p syslog.emerg -t core-upgrade-38 "Check it before reboot !!!"' >> /tmp/pak_update
+echo '/usr/bin/logger -p syslog.emerg -t core-upgrade-38 " *** Please reboot... *** "' >> /tmp/pak_update
+#
+chmod +x /tmp/pak_update
+/tmp/pak_update &
+#
+# Start squid
+/etc/init.d/squid start
 #
-# This core-update need a reboot
-/usr/bin/logger -p syslog.emerg -t core-upgrade-38 "Upgrade finished. If you use a customized grub.cfg"
-/usr/bin/logger -p syslog.emerg -t core-upgrade-38 "Check it before reboot !!!"
-/usr/bin/logger -p syslog.emerg -t core-upgrade-38 " *** Please reboot... *** "
+echo
+echo Please wait until pakfire has ended...
+echo