Recompiling The Ubuntu 20.04 Kernel To Speed Up Gameplay - You Couldn't Do This On Windows

x

sudo -s
nano /etc/apt/sources.list
# uncomment deb-src lines
apt-get update
apt-get build-dep linux linux-image-$(uname -r)
apt-get install libncurses-dev fakeroot zstd libzstd-dev mc mesa-utils linux-cloud-tools-common linux-tools-common
# exit from root user
apt-get source linux-image-unsigned-$(uname -r)
curl -JLO https://raw.githubusercontent.com/graysky2/kernel_compiler_patch/master/more-uarches-for-kernel-5.15-5.16.patch
cd linux-?.??.???

chmod a+x debian/rules
chmod a+x debian/scripts/*
chmod a+x debian/scripts/misc/*
LANG=C fakeroot debian/rules clean

#now is the time to add the patches
patch -p1 < ../more-uarches-for-kernel-5.15-5.16.patch

#Also edit arch/x86/Kconfig.debug so debugging can be cleaned out
nano arch/x86/Kconfig.debug
#Blank out the annotations, so that the config does not error out
echo '' > debian.master/config/annotations
echo '' > debian.hwe-5.15/config/annotations
LANG=C fakeroot debian/rules editconfigs # you need to go through each (Y, Exit, Y, Exit..) or get a complaint about config later (also delete drivers to speed up compiling)
#Update the top version number by removing the all of the Ubuntu version and adding eg. "+custom1" to end of it
nano debian.master/changelog
nano debian.hwe-5.15/changelog
#also check debian/changelog

LANG=C fakeroot debian/rules clean
# quicker build:
LANG=C fakeroot debian/rules binary-headers binary-generic binary-perarch skipmodule=true skipabi=true skipretpoline=true
cd ..
#go back to root
sudo -s
dpkg -i linux-hwe-*.deb linux-image-unsigned-*.deb linux-modules-*.deb linux-headers-*.deb linux-tools-*.deb
nano /etc/default/grub
#set GRUB_TIMEOUT=10
#set GRUB_TIMEOUT_STYLE=menu
update-grub

#time for some benchmarks
apt-get install p7zip-full nexuiz sysbench
wget https://dl.xonotic.org/xonotic-0.8.5.zip

7z b

cd Xonotic
./xonotic-linux64-glx -benchmark demos/the-big-keybench 2>&1 | egrep -e '[0-9]+ frames'
cd ..
nexuiz -benchmark demos/demo1 -nosound 2>&1 | egrep -e '[0-9]+ frames'

sysbench cpu --threads=4 --time=30 run
sysbench memory --threads=4 --time=30 run