From 0aec7cbf4161c410bbb0a168fae942b52523b7b0 Mon Sep 17 00:00:00 2001 From: Arne Fitzenreiter Date: Fri, 21 Jan 2022 10:09:22 +0000 Subject: [PATCH] core164: add kernel to update Signed-off-by: Arne Fitzenreiter --- .../core/164/filelists/aarch64/linux | 1 + .../core/164/filelists/aarch64/linux-initrd | 1 + .../rootfiles/core/164/filelists/armv6l/linux | 1 + .../core/164/filelists/armv6l/linux-initrd | 1 + .../rootfiles/core/164/filelists/x86_64/linux | 1 + .../core/164/filelists/x86_64/linux-initrd | 1 + config/rootfiles/core/164/update.sh | 42 +++++++++++++++++++ 7 files changed, 48 insertions(+) create mode 120000 config/rootfiles/core/164/filelists/aarch64/linux create mode 120000 config/rootfiles/core/164/filelists/aarch64/linux-initrd create mode 120000 config/rootfiles/core/164/filelists/armv6l/linux create mode 120000 config/rootfiles/core/164/filelists/armv6l/linux-initrd create mode 120000 config/rootfiles/core/164/filelists/x86_64/linux create mode 120000 config/rootfiles/core/164/filelists/x86_64/linux-initrd diff --git a/config/rootfiles/core/164/filelists/aarch64/linux b/config/rootfiles/core/164/filelists/aarch64/linux new file mode 120000 index 0000000000..3a2532bc7d --- /dev/null +++ b/config/rootfiles/core/164/filelists/aarch64/linux @@ -0,0 +1 @@ +../../../../common/aarch64/linux \ No newline at end of file diff --git a/config/rootfiles/core/164/filelists/aarch64/linux-initrd b/config/rootfiles/core/164/filelists/aarch64/linux-initrd new file mode 120000 index 0000000000..8acdb0f318 --- /dev/null +++ b/config/rootfiles/core/164/filelists/aarch64/linux-initrd @@ -0,0 +1 @@ +../../../../common/aarch64/linux-initrd \ No newline at end of file diff --git a/config/rootfiles/core/164/filelists/armv6l/linux b/config/rootfiles/core/164/filelists/armv6l/linux new file mode 120000 index 0000000000..aee1f4d734 --- /dev/null +++ b/config/rootfiles/core/164/filelists/armv6l/linux @@ -0,0 +1 @@ +../../../../common/armv6l/linux \ No newline at end of file diff --git a/config/rootfiles/core/164/filelists/armv6l/linux-initrd b/config/rootfiles/core/164/filelists/armv6l/linux-initrd new file mode 120000 index 0000000000..4af11bfa1e --- /dev/null +++ b/config/rootfiles/core/164/filelists/armv6l/linux-initrd @@ -0,0 +1 @@ +../../../../common/armv6l/linux-initrd \ No newline at end of file diff --git a/config/rootfiles/core/164/filelists/x86_64/linux b/config/rootfiles/core/164/filelists/x86_64/linux new file mode 120000 index 0000000000..0615b5b9ad --- /dev/null +++ b/config/rootfiles/core/164/filelists/x86_64/linux @@ -0,0 +1 @@ +../../../../common/x86_64/linux \ No newline at end of file diff --git a/config/rootfiles/core/164/filelists/x86_64/linux-initrd b/config/rootfiles/core/164/filelists/x86_64/linux-initrd new file mode 120000 index 0000000000..1b9fff70ff --- /dev/null +++ b/config/rootfiles/core/164/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/164/update.sh b/config/rootfiles/core/164/update.sh index bca58fcbd7..a0650dbda0 100644 --- a/config/rootfiles/core/164/update.sh +++ b/config/rootfiles/core/164/update.sh @@ -43,6 +43,23 @@ for (( i=1; i<=$core; i++ )); do rm -f /var/cache/pakfire/core-upgrade-*-$i.ipfire done +KVER="xxxKVERxxx" + +# Backup uEnv.txt if exist +if [ -e /boot/uEnv.txt ]; then + cp -vf /boot/uEnv.txt /boot/uEnv.txt.org +fi + +# 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` @@ -52,6 +69,17 @@ if [ $ROOTSPACE -lt 100000 ]; then fi # Remove files +# 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-* +rm -rf /boot/zImage-* +rm -rf /boot/uInit-* +rm -rf /boot/dtb-* +rm -rf /lib/modules # Stop services /etc/init.d/collectd stop @@ -85,6 +113,20 @@ echo "DROPSPOOFEDMARTIAN=on" > /var/ipfire/optionsfw/settings /etc/init.d/squid restart /etc/init.d/suricata start +# remove lm_sensor config after collectd was started +# to reserch sensors at next boot with updated kernel +rm -f /etc/sysconfig/lm_sensors + +# 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 + # This update needs a reboot... touch /var/run/need_reboot -- 2.39.5