From adcef6b6d369a8cf0cec27f0683f448286abc34b Mon Sep 17 00:00:00 2001 From: oliveiraleo Date: Mon, 29 Jul 2024 13:44:13 -0300 Subject: [PATCH] Add change-kernel-version.sh First public release of an utility script to make changing the kernel version of the host machine easier --- change-kernel-version.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 change-kernel-version.sh diff --git a/change-kernel-version.sh b/change-kernel-version.sh new file mode 100644 index 0000000..71bb3db --- /dev/null +++ b/change-kernel-version.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +OLD_KERNEL_VERSION=$(uname -r) +NEW_KERNEL_VERSION="5.15.0-116-generic" + +# TODO add a way to change new kernel version via param/args +# TODO compare kernel versions before running +echo "[INFO] Currently installed kernel version: $OLD_KERNEL_VERSION" +echo "[INFO] Kernel version to be installed: $NEW_KERNEL_VERSION" + +echo "[INFO] Updating system package lists" +sudo apt update +echo "[INFO] Installing kernel $NEW_KERNEL_VERSION" +sudo apt install linux-image-$NEW_KERNEL_VERSION linux-headers-$NEW_KERNEL_VERSION -y +echo "[INFO] Updating GRUB and initramfs" +sudo update-initramfs -u -k all && sudo update-grub + +echo "[INFO] Reinstalling the GTP-U kernel module" +cd gtp5g/ +#TODO if command above fails, clone gtp again, install then remove the new clone +make +sudo make install +echo "[INFO] Installation finished, reboot to be able to use the new kernel version"