In a previous article, I went about Building a tickless Ubuntu Kernel. While that approach is fairly straightforward, I’ve been building a variety of kernel configs recently and was starting to find it a bit hard to manage.
Here is a simpler and slightly more automated version of building kernel configs.
Some steps remain the same as before, but I’ve included them here for completeness.
Uncomment source repositories
This step might be optional depending on your setup:
Let’s quickly backup our sources.list
|
|
Open /etc/apt/sources.list
and uncomment the deb-src
lines.
Install required dependencies
|
|
If you have problems with the above you might also need to:
|
|
Clone kernel repo
The official site is very slow, but let’s use that anyway. If you’d like to clone from a faster location, please check the article mentioned above.
The last line picks one version ahead, for ease of recognition and for the newly compiled kernel to be the default at boot.
|
|
Copy the config of the current setup as a base for further changes:
|
|
Create and Manage config changes
We will use the kernel-workspace/config
directory to manage configs and changes. This is also initialized as a git repo.
Create a file overriding config changes for the tickless kernel: Create a file representing config changes for the tickless kernel:
|
|
In a similar fashion, any number of config files can be created and/or versioned as necessary.
Apply config to kernel build
Start with the base config stored earlier and apply config changes:
|
|
It’s alternatively possible to use skip verification and use defaults by using make olddefconfig
instead of make oldconfig
.
Build the kernel
The following will build the kernel using the number of cores:
|
|
Sign the kernel
Follow the instructions in UEFI section of the previous article to sign the kernel.
Reboot
Reboot into the new kernel. It should be selected by default during boot process. Verify after boot using uname -r
.