Skip to content

Instantly share code, notes, and snippets.

@annmuor
Created August 26, 2023 18:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save annmuor/76ab931632dcb068835a31e06007e23a to your computer and use it in GitHub Desktop.
Save annmuor/76ab931632dcb068835a31e06007e23a to your computer and use it in GitHub Desktop.
#!/bin/sh
VER="$1"
if [ -z "$VER" ]; then
echo "Usage: $0 xx.xx.xx -> version"
exit 1
fi
cd /usr/src/linux/
curl -OL https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-${VER}.tar.xz || ( echo "Bad version, exiting"; exit 1 )
tar xfJ linux-${VER}.tar.xz || ( echo "Unable to unpack, exiting"; exit 1 )
( cd linux-${VER} && zcat /proc/config.gz > .config && make olddefconfig && make bzImage -j24 && make modules && make modules_install ) || ( echo "Linux kernel build failed, exiting..."; exit 1 )
( cd /boot && mv vmlinuz-new vmlinuz-xaero && mv initramfs-new.img initramfs-xaero.img && cd - ) || ( echo "Moving images failed, exiting..."; exit 1 )
cp arch/x86/boot/bzImage /boot/vmlinuz-new || ( echo "Image not found, exiting..."; exit 1 )
ls /usr/src/|grep -E "(nvidia|vboxhost)"|awk -F- '{print $1"/"$2}'|xargs -n1 dkms install -k ${VER}xaero -m || ( echo "DKMS failed, exiting..."; exit 1)
mkinitcpio -k ${VER}xaero -g /boor/initramfs-new.img || (echo "mkinitcpio failed, exiting..."; exit 1)
echo "All done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment