]> git.ipfire.org Git - people/mfischer/ipfire-2.x.git/commitdiff
core164: add kernel to update
authorArne Fitzenreiter <arne_f@ipfire.org>
Fri, 21 Jan 2022 10:09:22 +0000 (10:09 +0000)
committerArne Fitzenreiter <arne_f@ipfire.org>
Fri, 21 Jan 2022 10:09:22 +0000 (10:09 +0000)
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
config/rootfiles/core/164/filelists/aarch64/linux [new symlink]
config/rootfiles/core/164/filelists/aarch64/linux-initrd [new symlink]
config/rootfiles/core/164/filelists/armv6l/linux [new symlink]
config/rootfiles/core/164/filelists/armv6l/linux-initrd [new symlink]
config/rootfiles/core/164/filelists/x86_64/linux [new symlink]
config/rootfiles/core/164/filelists/x86_64/linux-initrd [new symlink]
config/rootfiles/core/164/update.sh

diff --git a/config/rootfiles/core/164/filelists/aarch64/linux b/config/rootfiles/core/164/filelists/aarch64/linux
new file mode 120000 (symlink)
index 0000000..3a2532b
--- /dev/null
@@ -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 (symlink)
index 0000000..8acdb0f
--- /dev/null
@@ -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 (symlink)
index 0000000..aee1f4d
--- /dev/null
@@ -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 (symlink)
index 0000000..4af11bf
--- /dev/null
@@ -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 (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/164/filelists/x86_64/linux-initrd b/config/rootfiles/core/164/filelists/x86_64/linux-initrd
new file mode 120000 (symlink)
index 0000000..1b9fff7
--- /dev/null
@@ -0,0 +1 @@
+../../../../common/x86_64/linux-initrd
\ No newline at end of file
index bca58fcbd7587dd6e81ef444343f418e36b76a3e..a0650dbda0cdb63caa195c22da039ed5a7f2dd1a 100644 (file)
@@ -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