From: Michael Tremer Date: Wed, 6 Jun 2018 13:01:18 +0000 (+0100) Subject: core121: Create updater X-Git-Tag: v2.21-core122~24 X-Git-Url: http://git.ipfire.org/?p=ipfire-2.x.git;a=commitdiff_plain;h=05b2d72588aa0ae8d1a1b521788912f0b1702b47 core121: Create updater Signed-off-by: Michael Tremer --- diff --git a/config/rootfiles/core/121/filelists/acpid b/config/rootfiles/core/121/filelists/acpid new file mode 120000 index 0000000000..73f1b7b0d9 --- /dev/null +++ b/config/rootfiles/core/121/filelists/acpid @@ -0,0 +1 @@ +../../../common/acpid \ No newline at end of file diff --git a/config/rootfiles/core/121/filelists/apache2 b/config/rootfiles/core/121/filelists/apache2 new file mode 120000 index 0000000000..eef95efa72 --- /dev/null +++ b/config/rootfiles/core/121/filelists/apache2 @@ -0,0 +1 @@ +../../../common/apache2 \ No newline at end of file diff --git a/config/rootfiles/core/121/filelists/apr b/config/rootfiles/core/121/filelists/apr new file mode 120000 index 0000000000..87dd1974f2 --- /dev/null +++ b/config/rootfiles/core/121/filelists/apr @@ -0,0 +1 @@ +../../../common/apr \ No newline at end of file diff --git a/config/rootfiles/core/121/filelists/aprutil b/config/rootfiles/core/121/filelists/aprutil new file mode 120000 index 0000000000..999f9f84bc --- /dev/null +++ b/config/rootfiles/core/121/filelists/aprutil @@ -0,0 +1 @@ +../../../common/aprutil \ No newline at end of file diff --git a/config/rootfiles/core/121/filelists/armv5tel/files b/config/rootfiles/core/121/filelists/armv5tel/files new file mode 100644 index 0000000000..d2712ba533 --- /dev/null +++ b/config/rootfiles/core/121/filelists/armv5tel/files @@ -0,0 +1 @@ +etc/rc.d/init.d/swconfig diff --git a/config/rootfiles/core/121/filelists/armv5tel/linux-initrd-kirkwood b/config/rootfiles/core/121/filelists/armv5tel/linux-initrd-kirkwood new file mode 120000 index 0000000000..39c5591b71 --- /dev/null +++ b/config/rootfiles/core/121/filelists/armv5tel/linux-initrd-kirkwood @@ -0,0 +1 @@ +../../../../common/armv5tel/linux-initrd-kirkwood \ No newline at end of file diff --git a/config/rootfiles/core/121/filelists/armv5tel/linux-initrd-multi b/config/rootfiles/core/121/filelists/armv5tel/linux-initrd-multi new file mode 120000 index 0000000000..0b1b4530a8 --- /dev/null +++ b/config/rootfiles/core/121/filelists/armv5tel/linux-initrd-multi @@ -0,0 +1 @@ +../../../../common/armv5tel/linux-initrd-multi \ No newline at end of file diff --git a/config/rootfiles/core/121/filelists/armv5tel/linux-initrd-rpi b/config/rootfiles/core/121/filelists/armv5tel/linux-initrd-rpi new file mode 120000 index 0000000000..8281067574 --- /dev/null +++ b/config/rootfiles/core/121/filelists/armv5tel/linux-initrd-rpi @@ -0,0 +1 @@ +../../../../common/armv5tel/linux-initrd-rpi \ No newline at end of file diff --git a/config/rootfiles/core/121/filelists/armv5tel/linux-kirkwood b/config/rootfiles/core/121/filelists/armv5tel/linux-kirkwood new file mode 120000 index 0000000000..72171071e6 --- /dev/null +++ b/config/rootfiles/core/121/filelists/armv5tel/linux-kirkwood @@ -0,0 +1 @@ +../../../../common/armv5tel/linux-kirkwood \ No newline at end of file diff --git a/config/rootfiles/core/121/filelists/armv5tel/linux-multi b/config/rootfiles/core/121/filelists/armv5tel/linux-multi new file mode 120000 index 0000000000..204eb4c437 --- /dev/null +++ b/config/rootfiles/core/121/filelists/armv5tel/linux-multi @@ -0,0 +1 @@ +../../../../common/armv5tel/linux-multi \ No newline at end of file diff --git a/config/rootfiles/core/121/filelists/armv5tel/linux-rpi b/config/rootfiles/core/121/filelists/armv5tel/linux-rpi new file mode 120000 index 0000000000..a651a498fe --- /dev/null +++ b/config/rootfiles/core/121/filelists/armv5tel/linux-rpi @@ -0,0 +1 @@ +../../../../common/armv5tel/linux-rpi \ No newline at end of file diff --git a/config/rootfiles/core/121/filelists/armv5tel/rpi-firmware b/config/rootfiles/core/121/filelists/armv5tel/rpi-firmware new file mode 120000 index 0000000000..428fdf88fe --- /dev/null +++ b/config/rootfiles/core/121/filelists/armv5tel/rpi-firmware @@ -0,0 +1 @@ +../../../../common/armv5tel/rpi-firmware \ No newline at end of file diff --git a/config/rootfiles/core/121/filelists/armv5tel/u-boot b/config/rootfiles/core/121/filelists/armv5tel/u-boot new file mode 120000 index 0000000000..3df31a883d --- /dev/null +++ b/config/rootfiles/core/121/filelists/armv5tel/u-boot @@ -0,0 +1 @@ +../../../../common/armv5tel/u-boot \ No newline at end of file diff --git a/config/rootfiles/core/121/filelists/armv5tel/u-boot-kirkwood b/config/rootfiles/core/121/filelists/armv5tel/u-boot-kirkwood new file mode 120000 index 0000000000..eebbdb14a8 --- /dev/null +++ b/config/rootfiles/core/121/filelists/armv5tel/u-boot-kirkwood @@ -0,0 +1 @@ +../../../../common/armv5tel/u-boot-kirkwood \ No newline at end of file diff --git a/config/rootfiles/core/121/filelists/armv5tel/u-boot-mkimage b/config/rootfiles/core/121/filelists/armv5tel/u-boot-mkimage new file mode 120000 index 0000000000..65fe960aea --- /dev/null +++ b/config/rootfiles/core/121/filelists/armv5tel/u-boot-mkimage @@ -0,0 +1 @@ +../../../../common/armv5tel/u-boot-mkimage \ No newline at end of file diff --git a/config/rootfiles/core/121/filelists/beep b/config/rootfiles/core/121/filelists/beep new file mode 120000 index 0000000000..6db094efa7 --- /dev/null +++ b/config/rootfiles/core/121/filelists/beep @@ -0,0 +1 @@ +../../../common/beep \ No newline at end of file diff --git a/config/rootfiles/core/121/filelists/ca-certificates b/config/rootfiles/core/121/filelists/ca-certificates new file mode 120000 index 0000000000..320fea8f40 --- /dev/null +++ b/config/rootfiles/core/121/filelists/ca-certificates @@ -0,0 +1 @@ +../../../common/ca-certificates \ No newline at end of file diff --git a/config/rootfiles/core/121/filelists/cmake b/config/rootfiles/core/121/filelists/cmake new file mode 120000 index 0000000000..491d25f727 --- /dev/null +++ b/config/rootfiles/core/121/filelists/cmake @@ -0,0 +1 @@ +../../../common/cmake \ No newline at end of file diff --git a/config/rootfiles/core/121/filelists/crda b/config/rootfiles/core/121/filelists/crda new file mode 120000 index 0000000000..d68c46e55b --- /dev/null +++ b/config/rootfiles/core/121/filelists/crda @@ -0,0 +1 @@ +../../../common/crda \ No newline at end of file diff --git a/config/rootfiles/core/121/filelists/dhcp b/config/rootfiles/core/121/filelists/dhcp new file mode 120000 index 0000000000..32d8da443d --- /dev/null +++ b/config/rootfiles/core/121/filelists/dhcp @@ -0,0 +1 @@ +../../../common/dhcp \ No newline at end of file diff --git a/config/rootfiles/core/121/filelists/files b/config/rootfiles/core/121/filelists/files index fc07ad7e9f..a0bb9423cf 100644 --- a/config/rootfiles/core/121/filelists/files +++ b/config/rootfiles/core/121/filelists/files @@ -1,6 +1,20 @@ etc/system-release etc/issue +etc/rc.d/init.d/acpid +etc/rc.d/init.d/collectd +etc/rc.d/init.d/firstsetup +etc/rc.d/init.d/leds +etc/rc.d/init.d/partresize +etc/rc.d/init.d/rngd +etc/rc.d/rc0.d/K87acpid +etc/rc.d/rc3.d/S12acpid +etc/rc.d/rc6.d/K87acpid etc/ssl/certs/ca-bundle.crt +srv/web/ipfire/cgi-bin/entropy.cgi +srv/web/ipfire/cgi-bin/firewall.cgi +srv/web/ipfire/cgi-bin/fwhosts.cgi srv/web/ipfire/cgi-bin/ovpnmain.cgi srv/web/ipfire/cgi-bin/remote.cgi +usr/lib/firewall/firewall-lib.pl var/ipfire/langs +var/ipfire/qos/bin/makeqosscripts.pl diff --git a/config/rootfiles/core/121/filelists/flex b/config/rootfiles/core/121/filelists/flex new file mode 120000 index 0000000000..feb0390ffe --- /dev/null +++ b/config/rootfiles/core/121/filelists/flex @@ -0,0 +1 @@ +../../../common/flex \ No newline at end of file diff --git a/config/rootfiles/core/121/filelists/i586/grub b/config/rootfiles/core/121/filelists/i586/grub new file mode 120000 index 0000000000..feb236a224 --- /dev/null +++ b/config/rootfiles/core/121/filelists/i586/grub @@ -0,0 +1 @@ +../../../../common/i586/grub \ No newline at end of file diff --git a/config/rootfiles/core/121/filelists/i586/intel-microcode b/config/rootfiles/core/121/filelists/i586/intel-microcode new file mode 120000 index 0000000000..f03e84778a --- /dev/null +++ b/config/rootfiles/core/121/filelists/i586/intel-microcode @@ -0,0 +1 @@ +../../../../common/i586/intel-microcode \ No newline at end of file diff --git a/config/rootfiles/core/121/filelists/i586/linux b/config/rootfiles/core/121/filelists/i586/linux new file mode 120000 index 0000000000..693ec4bbf9 --- /dev/null +++ b/config/rootfiles/core/121/filelists/i586/linux @@ -0,0 +1 @@ +../../../../common/i586/linux \ No newline at end of file diff --git a/config/rootfiles/core/121/filelists/i586/linux-initrd b/config/rootfiles/core/121/filelists/i586/linux-initrd new file mode 120000 index 0000000000..32a03e6a90 --- /dev/null +++ b/config/rootfiles/core/121/filelists/i586/linux-initrd @@ -0,0 +1 @@ +../../../../common/i586/linux-initrd \ No newline at end of file diff --git a/config/rootfiles/core/121/filelists/iw b/config/rootfiles/core/121/filelists/iw new file mode 120000 index 0000000000..7c58a2089a --- /dev/null +++ b/config/rootfiles/core/121/filelists/iw @@ -0,0 +1 @@ +../../../common/iw \ No newline at end of file diff --git a/config/rootfiles/core/121/filelists/jwhois b/config/rootfiles/core/121/filelists/jwhois new file mode 120000 index 0000000000..b984a7f3f6 --- /dev/null +++ b/config/rootfiles/core/121/filelists/jwhois @@ -0,0 +1 @@ +../../../common/jwhois \ No newline at end of file diff --git a/config/rootfiles/core/121/filelists/linux-firmware b/config/rootfiles/core/121/filelists/linux-firmware new file mode 120000 index 0000000000..4bf91bca9f --- /dev/null +++ b/config/rootfiles/core/121/filelists/linux-firmware @@ -0,0 +1 @@ +../../../common/linux-firmware \ No newline at end of file diff --git a/config/rootfiles/core/121/filelists/multipath-tools b/config/rootfiles/core/121/filelists/multipath-tools new file mode 120000 index 0000000000..9ff63237c5 --- /dev/null +++ b/config/rootfiles/core/121/filelists/multipath-tools @@ -0,0 +1 @@ +../../../common/multipath-tools \ No newline at end of file diff --git a/config/rootfiles/core/121/filelists/openssl b/config/rootfiles/core/121/filelists/openssl new file mode 120000 index 0000000000..e011a9266c --- /dev/null +++ b/config/rootfiles/core/121/filelists/openssl @@ -0,0 +1 @@ +../../../common/openssl \ No newline at end of file diff --git a/config/rootfiles/core/121/filelists/rng-tools b/config/rootfiles/core/121/filelists/rng-tools new file mode 120000 index 0000000000..a7853e41b3 --- /dev/null +++ b/config/rootfiles/core/121/filelists/rng-tools @@ -0,0 +1 @@ +../../../common/rng-tools \ No newline at end of file diff --git a/config/rootfiles/core/121/filelists/tar b/config/rootfiles/core/121/filelists/tar new file mode 120000 index 0000000000..3e585d2ebe --- /dev/null +++ b/config/rootfiles/core/121/filelists/tar @@ -0,0 +1 @@ +../../../common/tar \ No newline at end of file diff --git a/config/rootfiles/core/121/filelists/unbound b/config/rootfiles/core/121/filelists/unbound new file mode 120000 index 0000000000..66adf09242 --- /dev/null +++ b/config/rootfiles/core/121/filelists/unbound @@ -0,0 +1 @@ +../../../common/unbound \ No newline at end of file diff --git a/config/rootfiles/core/121/filelists/wget b/config/rootfiles/core/121/filelists/wget new file mode 120000 index 0000000000..fcb57dfec8 --- /dev/null +++ b/config/rootfiles/core/121/filelists/wget @@ -0,0 +1 @@ +../../../common/wget \ No newline at end of file diff --git a/config/rootfiles/core/121/filelists/x86_64/grub b/config/rootfiles/core/121/filelists/x86_64/grub new file mode 120000 index 0000000000..78d3bd7840 --- /dev/null +++ b/config/rootfiles/core/121/filelists/x86_64/grub @@ -0,0 +1 @@ +../../../../common/x86_64/grub \ No newline at end of file diff --git a/config/rootfiles/core/121/filelists/x86_64/intel-microcode b/config/rootfiles/core/121/filelists/x86_64/intel-microcode new file mode 120000 index 0000000000..d5ac074e2e --- /dev/null +++ b/config/rootfiles/core/121/filelists/x86_64/intel-microcode @@ -0,0 +1 @@ +../../../../common/x86_64/intel-microcode \ No newline at end of file diff --git a/config/rootfiles/core/121/filelists/x86_64/linux b/config/rootfiles/core/121/filelists/x86_64/linux new file mode 120000 index 0000000000..0615b5b9ad --- /dev/null +++ b/config/rootfiles/core/121/filelists/x86_64/linux @@ -0,0 +1 @@ +../../../../common/x86_64/linux \ No newline at end of file diff --git a/config/rootfiles/core/121/filelists/x86_64/linux-initrd b/config/rootfiles/core/121/filelists/x86_64/linux-initrd new file mode 120000 index 0000000000..1b9fff70ff --- /dev/null +++ b/config/rootfiles/core/121/filelists/x86_64/linux-initrd @@ -0,0 +1 @@ +../../../../common/x86_64/linux-initrd \ No newline at end of file diff --git a/config/rootfiles/core/121/filelists/xr819-firmware b/config/rootfiles/core/121/filelists/xr819-firmware new file mode 120000 index 0000000000..8b746aea41 --- /dev/null +++ b/config/rootfiles/core/121/filelists/xr819-firmware @@ -0,0 +1 @@ +../../../common/xr819-firmware \ No newline at end of file diff --git a/config/rootfiles/core/121/filelists/xtables-addons b/config/rootfiles/core/121/filelists/xtables-addons new file mode 120000 index 0000000000..2e24c4298b --- /dev/null +++ b/config/rootfiles/core/121/filelists/xtables-addons @@ -0,0 +1 @@ +../../../common/xtables-addons \ No newline at end of file diff --git a/config/rootfiles/core/121/filelists/xz b/config/rootfiles/core/121/filelists/xz new file mode 120000 index 0000000000..734e926c7e --- /dev/null +++ b/config/rootfiles/core/121/filelists/xz @@ -0,0 +1 @@ +../../../common/xz \ No newline at end of file diff --git a/config/rootfiles/core/121/update.sh b/config/rootfiles/core/121/update.sh index 87d5f6ebd4..76994d9226 100644 --- a/config/rootfiles/core/121/update.sh +++ b/config/rootfiles/core/121/update.sh @@ -26,11 +26,56 @@ core=121 +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 +# This update cannot be applied on ARM +case "$(uname -a)" in + arm*) + exit_with_error "ERROR: Cannot update on ARM. Please re-install." 1 + ;; +esac + +# Do some sanity checks. +case $(uname -r) in + *-ipfire*) + # Ok. + ;; + *) + exit_with_error "ERROR cannot update. No IPFire Kernel." 1 + ;; +esac + +# 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 + +# Remove the old kernel +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 + # Stop services # Extract files