Skip to content

Commit

Permalink
Add change-kernel-version.sh
Browse files Browse the repository at this point in the history
First public release of an utility script to make changing the kernel version of the host machine easier
  • Loading branch information
oliveiraleo committed Jul 29, 2024
1 parent d248d63 commit adcef6b
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions change-kernel-version.sh
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit adcef6b

Please sign in to comment.