Ubuntu 20.04 comes with Linux kernel 5.4.0-37. I had to reboot every time my machine wake up from sleep to fix screen flickering issues. Latest stable kernel (5.7.2) fixed this issue for me.
Notes,
- It's easy to start with a working config and test the kernel first
- If it's working, move on to remove things you don't need. This will result in a smaller kernel
- Kernel modules built against the running kernel have to be recompiled. Notably Nvidia drivers and VirtualBox
Steps to compile the kernel,
Download latest stable from kernel.org
Unzip
➜ tar xf linux-5.7.2.tar.xz && cd linux-5.7.2
Copy existing config (make things easy)
➜ cp /boot/config-$(uname -r) .config
Use terminal based configuration tool
➜ make menuconfig
If you have relatively recent hardware, this step will take most of your time. Add/remove stuff based on your hardwareCompile the kernel with Clang (Remove CC for compiling with gcc - the default C compiler)
make CC=clang -j12
Install the kernel
sudo make install
Update grub
sudo update-grub
Reboot
sudo reboot
Top comments (2)
according to your experience, because it is better to compile,
like this: make CC=clang -j4
and not, like this: make -j4
Or is it that there are factors that determine when to use one or the other ?
These look like notes I make for my own benefit. ;))