]> git.ipfire.org Git - people/dweismueller/ipfire-2.x.git/commitdiff
start core107 updater
authorArne Fitzenreiter <arne_f@ipfire.org>
Thu, 27 Oct 2016 19:06:16 +0000 (21:06 +0200)
committerArne Fitzenreiter <arne_f@ipfire.org>
Thu, 27 Oct 2016 19:07:55 +0000 (21:07 +0200)
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
48 files changed:
config/rootfiles/core/107/exclude [new file with mode: 0644]
config/rootfiles/core/107/filelists/armv5tel/linux-kirkwood [new symlink]
config/rootfiles/core/107/filelists/armv5tel/linux-multi [new symlink]
config/rootfiles/core/107/filelists/armv5tel/linux-rpi [new symlink]
config/rootfiles/core/107/filelists/files [new file with mode: 0644]
config/rootfiles/core/107/filelists/hdparm [new symlink]
config/rootfiles/core/107/filelists/i586/linux [new symlink]
config/rootfiles/core/107/filelists/libjpeg [new symlink]
config/rootfiles/core/107/filelists/libjpeg-compat [new symlink]
config/rootfiles/core/107/filelists/squid [moved from config/rootfiles/core/106/filelists/squid with 100% similarity]
config/rootfiles/core/107/filelists/x86_64/linux [new symlink]
config/rootfiles/core/107/meta [moved from config/rootfiles/core/106/meta with 100% similarity]
config/rootfiles/core/107/update.sh [new file with mode: 0644]
config/rootfiles/oldcore/106/exclude [moved from config/rootfiles/core/106/exclude with 100% similarity]
config/rootfiles/oldcore/106/filelists/attr [moved from config/rootfiles/core/106/filelists/attr with 100% similarity]
config/rootfiles/oldcore/106/filelists/diffutils [moved from config/rootfiles/core/106/filelists/diffutils with 100% similarity]
config/rootfiles/oldcore/106/filelists/ed [moved from config/rootfiles/core/106/filelists/ed with 100% similarity]
config/rootfiles/oldcore/106/filelists/expat [moved from config/rootfiles/core/106/filelists/expat with 100% similarity]
config/rootfiles/oldcore/106/filelists/file [moved from config/rootfiles/core/106/filelists/file with 100% similarity]
config/rootfiles/oldcore/106/filelists/files [moved from config/rootfiles/core/106/filelists/files with 100% similarity]
config/rootfiles/oldcore/106/filelists/flex [moved from config/rootfiles/core/106/filelists/flex with 100% similarity]
config/rootfiles/oldcore/106/filelists/gawk [moved from config/rootfiles/core/106/filelists/gawk with 100% similarity]
config/rootfiles/oldcore/106/filelists/gettext [moved from config/rootfiles/core/106/filelists/gettext with 100% similarity]
config/rootfiles/oldcore/106/filelists/gnupg [moved from config/rootfiles/core/106/filelists/gnupg with 100% similarity]
config/rootfiles/oldcore/106/filelists/i586/openssl-sse2 [moved from config/rootfiles/core/106/filelists/i586/openssl-sse2 with 100% similarity]
config/rootfiles/oldcore/106/filelists/i586/strongswan-padlock [moved from config/rootfiles/core/106/filelists/i586/strongswan-padlock with 100% similarity]
config/rootfiles/oldcore/106/filelists/iproute2 [moved from config/rootfiles/core/106/filelists/iproute2 with 100% similarity]
config/rootfiles/oldcore/106/filelists/ipset [moved from config/rootfiles/core/106/filelists/ipset with 100% similarity]
config/rootfiles/oldcore/106/filelists/libgpg-error [moved from config/rootfiles/core/106/filelists/libgpg-error with 100% similarity]
config/rootfiles/oldcore/106/filelists/libidn [moved from config/rootfiles/core/106/filelists/libidn with 100% similarity]
config/rootfiles/oldcore/106/filelists/libmnl [moved from config/rootfiles/core/106/filelists/libmnl with 100% similarity]
config/rootfiles/oldcore/106/filelists/libnetfilter_conntrack [moved from config/rootfiles/core/106/filelists/libnetfilter_conntrack with 100% similarity]
config/rootfiles/oldcore/106/filelists/misc-progs [moved from config/rootfiles/core/106/filelists/misc-progs with 100% similarity]
config/rootfiles/oldcore/106/filelists/mt7601u-firmware [moved from config/rootfiles/core/106/filelists/mt7601u-firmware with 100% similarity]
config/rootfiles/oldcore/106/filelists/openssl [moved from config/rootfiles/core/106/filelists/openssl with 100% similarity]
config/rootfiles/oldcore/106/filelists/python-daemon [moved from config/rootfiles/core/106/filelists/python-daemon with 100% similarity]
config/rootfiles/oldcore/106/filelists/python-docutils [moved from config/rootfiles/core/106/filelists/python-docutils with 100% similarity]
config/rootfiles/oldcore/106/filelists/python-inotify [moved from config/rootfiles/core/106/filelists/python-inotify with 100% similarity]
config/rootfiles/oldcore/106/filelists/python-ipaddress [moved from config/rootfiles/core/106/filelists/python-ipaddress with 100% similarity]
config/rootfiles/oldcore/106/filelists/smartmontools [moved from config/rootfiles/core/106/filelists/smartmontools with 100% similarity]
config/rootfiles/oldcore/106/filelists/squid [new symlink]
config/rootfiles/oldcore/106/filelists/strongswan [moved from config/rootfiles/core/106/filelists/strongswan with 100% similarity]
config/rootfiles/oldcore/106/filelists/unbound [moved from config/rootfiles/core/106/filelists/unbound with 100% similarity]
config/rootfiles/oldcore/106/filelists/usb_modeswitch [moved from config/rootfiles/core/106/filelists/usb_modeswitch with 100% similarity]
config/rootfiles/oldcore/106/filelists/usb_modeswitch_data [moved from config/rootfiles/core/106/filelists/usb_modeswitch_data with 100% similarity]
config/rootfiles/oldcore/106/meta [new file with mode: 0644]
config/rootfiles/oldcore/106/update.sh [moved from config/rootfiles/core/106/update.sh with 100% similarity]
make.sh

diff --git a/config/rootfiles/core/107/exclude b/config/rootfiles/core/107/exclude
new file mode 100644 (file)
index 0000000..1d8d74e
--- /dev/null
@@ -0,0 +1,29 @@
+boot/config.txt
+boot/grub/grub.cfg
+boot/grub/grubenv
+etc/alternatives
+etc/collectd.custom
+etc/default/grub
+etc/ipsec.conf
+etc/ipsec.secrets
+etc/ipsec.user.conf
+etc/ipsec.user.secrets
+etc/localtime
+etc/shadow
+etc/snort/snort.conf
+etc/ssh/ssh_config
+etc/ssh/sshd_config
+etc/ssl/openssl.cnf
+etc/sudoers
+etc/sysconfig/firewall.local
+etc/sysconfig/rc.local
+etc/udev/rules.d/30-persistent-network.rules
+srv/web/ipfire/html/proxy.pac
+var/ipfire/dma
+var/ipfire/time
+var/ipfire/ovpn
+var/lib/alternatives
+var/lib/unbound/root.key
+var/log/cache
+var/state/dhcp/dhcpd.leases
+var/updatecache
diff --git a/config/rootfiles/core/107/filelists/armv5tel/linux-kirkwood b/config/rootfiles/core/107/filelists/armv5tel/linux-kirkwood
new file mode 120000 (symlink)
index 0000000..7217107
--- /dev/null
@@ -0,0 +1 @@
+../../../../common/armv5tel/linux-kirkwood
\ No newline at end of file
diff --git a/config/rootfiles/core/107/filelists/armv5tel/linux-multi b/config/rootfiles/core/107/filelists/armv5tel/linux-multi
new file mode 120000 (symlink)
index 0000000..204eb4c
--- /dev/null
@@ -0,0 +1 @@
+../../../../common/armv5tel/linux-multi
\ No newline at end of file
diff --git a/config/rootfiles/core/107/filelists/armv5tel/linux-rpi b/config/rootfiles/core/107/filelists/armv5tel/linux-rpi
new file mode 120000 (symlink)
index 0000000..a651a49
--- /dev/null
@@ -0,0 +1 @@
+../../../../common/armv5tel/linux-rpi
\ No newline at end of file
diff --git a/config/rootfiles/core/107/filelists/files b/config/rootfiles/core/107/filelists/files
new file mode 100644 (file)
index 0000000..b03a86e
--- /dev/null
@@ -0,0 +1,5 @@
+etc/system-release
+etc/issue
+srv/web/ipfire/cgi-bin/logs.cgi/log.dat
+srv/web/ipfire/cgi-bin/traffic.cgi
+var/ipfire/langs
diff --git a/config/rootfiles/core/107/filelists/hdparm b/config/rootfiles/core/107/filelists/hdparm
new file mode 120000 (symlink)
index 0000000..b644751
--- /dev/null
@@ -0,0 +1 @@
+../../../common/hdparm
\ No newline at end of file
diff --git a/config/rootfiles/core/107/filelists/i586/linux b/config/rootfiles/core/107/filelists/i586/linux
new file mode 120000 (symlink)
index 0000000..693ec4b
--- /dev/null
@@ -0,0 +1 @@
+../../../../common/i586/linux
\ No newline at end of file
diff --git a/config/rootfiles/core/107/filelists/libjpeg b/config/rootfiles/core/107/filelists/libjpeg
new file mode 120000 (symlink)
index 0000000..3b1a782
--- /dev/null
@@ -0,0 +1 @@
+../../../common/libjpeg
\ No newline at end of file
diff --git a/config/rootfiles/core/107/filelists/libjpeg-compat b/config/rootfiles/core/107/filelists/libjpeg-compat
new file mode 120000 (symlink)
index 0000000..e6ff86d
--- /dev/null
@@ -0,0 +1 @@
+../../../common/libjpeg-compat
\ No newline at end of file
diff --git a/config/rootfiles/core/107/filelists/x86_64/linux b/config/rootfiles/core/107/filelists/x86_64/linux
new file mode 120000 (symlink)
index 0000000..0615b5b
--- /dev/null
@@ -0,0 +1 @@
+../../../../common/x86_64/linux
\ No newline at end of file
diff --git a/config/rootfiles/core/107/update.sh b/config/rootfiles/core/107/update.sh
new file mode 100644 (file)
index 0000000..b8987b0
--- /dev/null
@@ -0,0 +1,249 @@
+#!/bin/bash
+############################################################################
+#                                                                          #
+# This file is part of the IPFire Firewall.                                #
+#                                                                          #
+# IPFire is free software; you can redistribute it and/or modify           #
+# it under the terms of the GNU General Public License as published by     #
+# the Free Software Foundation; either version 3 of the License, or        #
+# (at your option) any later version.                                      #
+#                                                                          #
+# IPFire is distributed in the hope that it will be useful,                #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of           #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            #
+# GNU General Public License for more details.                             #
+#                                                                          #
+# You should have received a copy of the GNU General Public License        #
+# along with IPFire; if not, write to the Free Software                    #
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA #
+#                                                                          #
+# Copyright (C) 2016 IPFire-Team <info@ipfire.org>.                        #
+#                                                                          #
+############################################################################
+#
+. /opt/pakfire/lib/functions.sh
+/usr/local/bin/backupctrl exclude >/dev/null 2>&1
+
+function find_device() {
+       local mountpoint="${1}"
+
+       local root
+       local dev mp fs flags rest
+       while read -r dev mp fs flags rest; do
+               # Skip unwanted entries
+               [ "${dev}" = "rootfs" ] && continue
+
+               if [ "${mp}" = "${mountpoint}" ] && [ -b "${dev}" ]; then
+                       root="$(basename "${dev}")"
+                       break
+               fi
+       done < /proc/mounts
+
+       # Get the actual device from the partition that holds /
+       while [ -n "${root}" ]; do
+               if [ -e "/sys/block/${root}" ]; then
+                       echo "${root}"
+                       return 0
+               fi
+
+               # Remove last character
+               root="${root::-1}"
+       done
+
+       return 1
+}
+
+
+core=107
+
+function exit_with_error() {
+       # Set last succesfull installed core.
+       echo $(($core-1)) > /opt/pakfire/db/core/mine
+       /usr/bin/logger -p syslog.emerg -t ipfire \
+               "core-update-${core}: $1"
+       exit $2
+}
+
+# Remove old core updates from pakfire cache to save space...
+for (( i=1; i<=$core; i++ ))
+do
+       rm -f /var/cache/pakfire/core-upgrade-*-$i.ipfire
+done
+
+#
+# Do some sanity checks.
+case $(uname -r) in
+       *-ipfire* )
+               # Ok.
+               ;;
+       * )
+               exit_with_error "ERROR cannot update. No IPFire Kernel." 1
+       ;;
+esac
+
+
+#
+#
+KVER="xxxKVERxxx"
+
+# Check diskspace on root
+ROOTSPACE=`df / -Pk | sed "s| * | |g" | cut -d" " -f4 | tail -n 1`
+
+if [ $ROOTSPACE -lt 100000 ]; then
+       exit_with_error "ERROR cannot update because not enough free space on root." 2
+       exit 2
+fi
+
+echo
+echo Update Kernel to $KVER ...
+#
+# Remove old kernel, configs, initrd, modules, dtb's ...
+#
+rm -rf /boot/System.map-*
+rm -rf /boot/config-*
+rm -rf /boot/ipfirerd-*
+rm -rf /boot/initramfs-*
+rm -rf /boot/vmlinuz-*
+rm -rf /boot/uImage-ipfire-*
+rm -rf /boot/zImage-ipfire-*
+rm -rf /boot/uInit-ipfire-*
+rm -rf /boot/dtb-*-ipfire-*
+rm -rf /lib/modules
+
+case "$(uname -m)" in
+       armv*)
+               # Backup uEnv.txt if exist
+               if [ -e /boot/uEnv.txt ]; then
+                       cp -vf /boot/uEnv.txt /boot/uEnv.txt.org
+               fi
+
+               # work around the u-boot folder detection bug
+               mkdir -pv /boot/dtb-$KVER-ipfire-kirkwood
+               mkdir -pv /boot/dtb-$KVER-ipfire-multi
+               touch /boot/uImage-ipfire-kirkwood
+               touch /boot/zImage-ipfire-multi
+               touch /boot/uIinit-ipfire-kirkwood
+               touch /boot/uIinit-ipfire-multi
+               ;;
+esac
+
+# Stop services
+/etc/init.d/collectd stop
+/etc/init.d/snort stop
+/etc/init.d/squid stop
+/etc/init.d/ipsec stop
+/etc/init.d/apache stop
+
+# Extract files
+tar xavf /opt/pakfire/tmp/files* --no-overwrite-dir -p --numeric-owner -C /
+
+# Remove some old files
+
+# update linker config
+ldconfig
+
+# Check diskspace on boot
+BOOTSPACE=`df /boot -Pk | sed "s| * | |g" | cut -d" " -f4 | tail -n 1`
+
+if [ $BOOTSPACE -lt 1000 ]; then
+       case $(uname -r) in
+               *-ipfire-kirkwood )
+                       # Special handling for old kirkwood images.
+                       # (install only kirkwood kernel)
+                       rm -rf /boot/*
+                       # work around the u-boot folder detection bug
+                       mkdir -pv /boot/dtb-$KVER-ipfire-kirkwood
+                       tar xavf /opt/pakfire/tmp/files* --no-overwrite-dir -p \
+                               --numeric-owner -C / --wildcards 'boot/*-kirkwood*'
+                       ;;
+               * )
+                       /etc/init.d/apache start
+                       exit_with_error "FATAL-ERROR space run out on boot. System is not bootable..." 4
+                       ;;
+       esac
+fi
+
+# Update Language cache
+/usr/local/bin/update-lang-cache
+
+#
+# Start services
+#
+/etc/init.d/collectd start
+/etc/init.d/apache start
+/etc/init.d/squid start
+/etc/init.d/snort start
+if [ `grep "ENABLED=on" /var/ipfire/vpn/settings` ]; then
+       /etc/init.d/ipsec start
+fi
+
+# Delete old QoS enabled indicator
+rm -f /var/ipfire/qos/enable
+
+# Upadate Kernel version uEnv.txt
+if [ -e /boot/uEnv.txt ]; then
+       sed -i -e "s/KVER=.*/KVER=${KVER}/g" /boot/uEnv.txt
+fi
+
+# call user update script (needed for some arm boards)
+if [ -e /boot/pakfire-kernel-update ]; then
+       /boot/pakfire-kernel-update ${KVER}
+fi
+
+case "$(uname -m)" in
+       i?86)
+               # Force (re)install pae kernel if pae is supported
+               rm -rf /opt/pakfire/db/installed/meta-linux-pae
+               if [ ! "$(grep "^flags.* pae " /proc/cpuinfo)" == "" ]; then
+                       ROOTSPACE=`df / -Pk | sed "s| * | |g" | cut -d" " -f4 | tail -n 1`
+                       BOOTSPACE=`df /boot -Pk | sed "s| * | |g" | cut -d" " -f4 | tail -n 1`
+                       if [ $BOOTSPACE -lt 12000 -o $ROOTSPACE -lt 90000 ]; then
+                               /usr/bin/logger -p syslog.emerg -t ipfire \
+                               "core-update-${core}: WARNING not enough space for pae kernel."
+                       else
+                               echo "Name: linux-pae" > /opt/pakfire/db/installed/meta-linux-pae
+                               echo "ProgVersion: 0" >> /opt/pakfire/db/installed/meta-linux-pae
+                               echo "Release: 0"     >> /opt/pakfire/db/installed/meta-linux-pae
+                       fi
+               fi
+               ;;
+esac
+#
+# 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 ipfire "Core-upgrade finished. If you use a customized grub/uboot config"' >> /tmp/pak_update
+echo '/usr/bin/logger -p syslog.emerg -t ipfire "Check it before reboot !!!"' >> /tmp/pak_update
+echo '/usr/bin/logger -p syslog.emerg -t ipfire " *** Please reboot... *** "' >> /tmp/pak_update
+echo 'touch /var/run/need_reboot ' >> /tmp/pak_update
+#
+killall -KILL pak_update
+chmod +x /tmp/pak_update
+/tmp/pak_update &
+
+sync
+
+# This update need a reboot...
+touch /var/run/need_reboot
+
+# Finish
+/etc/init.d/fireinfo start
+sendprofile
+# Update grub config to display new core version
+if [ -e /boot/grub/grub.cfg ]; then
+       grub-mkconfig -o /boot/grub/grub.cfg
+fi
+sync
+
+# Don't report the exitcode last command
+exit 0
diff --git a/config/rootfiles/oldcore/106/filelists/squid b/config/rootfiles/oldcore/106/filelists/squid
new file mode 120000 (symlink)
index 0000000..2dc8372
--- /dev/null
@@ -0,0 +1 @@
+../../../common/squid
\ No newline at end of file
diff --git a/config/rootfiles/oldcore/106/meta b/config/rootfiles/oldcore/106/meta
new file mode 100644 (file)
index 0000000..d547fa8
--- /dev/null
@@ -0,0 +1 @@
+DEPS=""
diff --git a/make.sh b/make.sh
index e30c075bda2bee11b0e1a838887b15f73e490c49..d2e32ab0b5731ac62d124a53e164754059f47d8f 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -25,7 +25,7 @@
 NAME="IPFire"                                                  # Software name
 SNAME="ipfire"                                                 # Short name
 VERSION="2.19"                                                 # Version number
-CORE="106"                                                     # Core Level (Filename)
+CORE="107"                                                     # Core Level (Filename)
 PAKFIRE_CORE="106"                                             # Core Level (PAKFIRE)
 GIT_BRANCH=`git rev-parse --abbrev-ref HEAD`                   # Git Branch
 SLOGAN="www.ipfire.org"                                                # Software slogan