aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitch Riedstra <mitch@riedstra.us>2019-04-08 18:03:30 -0400
committerMitch Riedstra <mitch@riedstra.us>2019-04-08 18:05:14 -0400
commit547425185390511d189331775ca8301c86c31993 (patch)
tree13948210eb442a0b8c54294121367c083536b592
parentb1dc220a512368901617a115cf8533805711291a (diff)
downloaddotfiles-547425185390511d189331775ca8301c86c31993.tar.gz
dotfiles-547425185390511d189331775ca8301c86c31993.tar.xz
Update kernel_upgrade to support dkms. Also add kernel package
-rwxr-xr-xkernel_package.sh23
-rwxr-xr-xkernel_upgrade.sh8
2 files changed, 28 insertions, 3 deletions
diff --git a/kernel_package.sh b/kernel_package.sh
new file mode 100755
index 0000000..14a23b2
--- /dev/null
+++ b/kernel_package.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+set -e
+set -x
+
+if [ $(id -u) -ne 0 ] ; then
+ echo "You must be root"
+ exit 1;
+fi
+
+if [ -z "$1" ] ; then
+ echo "Usage: $0 \$version"
+ echo "Will place currently installed kernel \$version in the current directory"
+ exit 1;
+fi
+version="$1"; shift
+
+tar -C / -cvf - \
+ "/usr/lib/modules/$version" \
+ "/boot/config-$version" \
+ "/boot/vmlinuz-$version" \
+ "/boot/System.map-${version}" \
+ "/boot/initramfs-${version}.img" \
+ | gzip -3c > $version.tar.gz
diff --git a/kernel_upgrade.sh b/kernel_upgrade.sh
index d956a10..dab1518 100755
--- a/kernel_upgrade.sh
+++ b/kernel_upgrade.sh
@@ -1,5 +1,4 @@
#!/bin/sh
-# Basic script to update the kernel on a Void Linux system somewhat automatically
set -e
set -x
version="$(sed 11q Makefile \
@@ -11,7 +10,7 @@ version="$(sed 11q Makefile \
| sed -e's/\.$//')"
localversion="$(sed 25q .config \
| sed -rn \
- -e's/^CONFIG_LOCALVERSION=".*"$//p')"
+ -e's/^CONFIG_LOCALVERSION="(.*)"$/\1/p')"
if [ -z "$version" ] ; then
exit 1;
fi
@@ -19,6 +18,9 @@ CPUs="$(nproc)"
# git checkout v$version
make -j$CPUs "$@" olddefconfig bzImage modules
sudo make -j$CPUs install modules_install
+cd /
+sudo sh -c 'umask 002; sh /etc/kernel.d/post-install/10-dkms linux '"${version}${localversion}"
+cd -
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"
+echo "You'll have to update grub by hand there bud"