Hi, I’ve been following this guide to build and install a custom kernel. I’m specifically targeting Fedora with the Asahi kernel.
I’m running into some weird issues and I don’t know what all is going wrong. But here’s what I’ve been doing (let me know if I’m missing anything important):
I copy the config file from /boot/config-6.6.3-411.asahi.fc39.aarch64+16k to ./.config
I modify the Makefile and set EXTRAVERSION = -custom.
I run make oldconfig.
I run make Image (I saw online that bzImage is changed for arm64).
I run make -j4 (I saw online that make modules is redundant now). I should have a linux image built.
I then run sudo make modules_install. It seems to have worked as now there’s a folder /lib/modules/6.6.3-custom
I run sudo make install. It seems to have worked as now there’s a file /boot/vmlinuz-6.6.3-custom.
Now when I reboot my machine and run uname -r it prints out 6.6.3-custom. So I think that means it worked right? Or were there extra steps I needed to do? I thought I would have to modify some bootloader files but does sudo make install take care of that?
Well I try to do it all again with a patched version of the kernel. I clone kernel-asahi, but this time I modify the source files. I again modify the Makefile but this time set EXTRAVERSION = -modified. I run all the same commands as before, but when I reboot, uname -r still prints 6.6.3-custom instead of 6.6.3-modified. Why didn’t my patched kernel get booted up correctly?
I think I’m making some sort of mistake in the process, but I’m not sure what’s missing as I’m following that guide pretty closely…
Did you build create the -modified versions?
Check the files in your build tree to see what you have.
Also did you keep all the output from all the makes?
When I do this sort of thing I keep logs of all output so I can go back and see what was done.
Can you compare your custom build vs. your modified build?
Did you clean out the old compilation files before recompiling the newer kernel. make clean should remove all the previous object files and allow a new full compile with the new settings. Without that it will not recompile and link already existing object files.
How do I update grub to use my custom kernel? Do I just use sudo grubby --set-default? Or are there extra steps? Do I need to call grub2-mkconfig as well?
Research grub bls (boot loader spec) and create a bls file for grub pointing to your kernel. I do not know the details off the top of my head but know it is well documented so you should be able to get this working.
Running sudo grubby --set-default with my -custom kernel as input, and then calling grub2-mkconfig seems to have worked. I don’t know if that’s the “right” way to do it, but at least now uname -r returns the name of my -custom kernel. Is that sufficient proof or could it be a red herring?