aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitch Riedstra <mitch@riedstra.us>2019-03-06 19:03:11 -0500
committerMitch Riedstra <mitch@riedstra.us>2019-03-06 19:03:11 -0500
commit33894038a97eb4c628501cca1cf12469ee2aa251 (patch)
tree61c09e81ca8c93466629a354bc5bc8197475428c
parent38f886de88aa27f437d7e5b9bfdaa1ea2e12b3e5 (diff)
downloaddotfiles-33894038a97eb4c628501cca1cf12469ee2aa251.tar.gz
dotfiles-33894038a97eb4c628501cca1cf12469ee2aa251.tar.xz
Add a script to update the Kernel on a Void Linux workstation
-rwxr-xr-xkernel_upgrade.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/kernel_upgrade.sh b/kernel_upgrade.sh
new file mode 100755
index 0000000..d956a10
--- /dev/null
+++ b/kernel_upgrade.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+# Basic script to update the kernel on a Void Linux system somewhat automatically
+set -e
+set -x
+version="$(sed 11q Makefile \
+ | sed -n \
+ -e's/^VERSION = //p' \
+ -e's/^PATCHLEVEL = //p' \
+ -e's/^SUBLEVEL = //p' \
+ | tr '\n' '.' \
+ | sed -e's/\.$//')"
+localversion="$(sed 25q .config \
+ | sed -rn \
+ -e's/^CONFIG_LOCALVERSION=".*"$//p')"
+if [ -z "$version" ] ; then
+ exit 1;
+fi
+CPUs="$(nproc)"
+# git checkout v$version
+make -j$CPUs "$@" olddefconfig bzImage modules
+sudo make -j$CPUs install modules_install
+sudo dracut -f --kver "${version}${localversion}"
+sudo grub-mkconfig -o /boot/grub/grub.cfg
+# echo "You'll have to update grub by hand there bud"