The officially official Devuan Forum!

You are not logged in.

#1 2021-09-29 17:47:28

nonsd
Member
Registered: 2021-09-28
Posts: 2  

[SOLVED] Compile own kernel

Hello!

Last time I compiled my own kernel was a long (very long) time ago, kernel 2.6.x (only MBR + lilo)

Since then, in every distro I always kept the default kernel that was shipped. Now, with Chimaera (UEFI + GPT + GRUB), the default one is kernel 5.10.

I know that out there are a lot of tutorials with basic steps. But they seem to be a bit incomplete (sorry, I don't know how to be more clear on this.... )

What I would like to do is:

1) Keep kernel 5.10 as a safeguard (in case of any kernel panic when compiling any new/custom kernel)

2) Compile a new kernel using the config-5.10.0-8-amd64 (file located at /boot) as starting point

3) New kernel does not need to be packaged as .deb

- Do I need to compile a new kernel? No, 5.10 is working fine
- Why do I want to compile a new kernel? Well, why not?!?!

I will appreciate any help

Offline

#2 2021-09-30 12:16:41

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 3,125  
Website

Re: [SOLVED] Compile own kernel

nonsd wrote:

1) Keep kernel 5.10 as a safeguard (in case of any kernel panic when compiling any new/custom kernel)

The installed kernels should always be available as boot options if GRUB was installed from the Devuan system.

You may might have to make a new boot entry for your custom kernel though. Not sure if grub-mkconfig will pick it up automatically.

nonsd wrote:

2) Compile a new kernel using the config-5.10.0-8-amd64 (file located at /boot) as starting point

From the custom kernel source tree:

cp /boot/config-$(uname -r) .config
make oldconfig

See also https://wiki.gentoo.org/wiki/Kernel/Con … figuration

nonsd wrote:

3) New kernel does not need to be packaged as .deb

Well yeah, nobody needs chocolate but it's really nice...

https://kernel-team.pages.debian.net/kernel-handbook/

EDIT: corrected command block.

Last edited by Head_on_a_Stick (2021-09-30 13:46:20)


Brianna Ghey — Rest In Power

Offline

#3 2021-10-02 12:16:33

nonsd
Member
Registered: 2021-09-28
Posts: 2  

Re: [SOLVED] Compile own kernel

Hi Head_on_a_Stick

I took a look at your suggestions and I installed kernel 5.14.9, with the creation of .deb packages

First, upgraded the system

apt-get update && apt-get upgrade

Then installed some things

apt-get install -y build-essential libncurses5-dev libelf-dev libssl-dev dwarves

gcc I installed way before this

Now, copy of .config from /boot/config-5.10.0-8-amd64 and

make oldconfig
make menuconfig

I got some erros while compiling, and after searching a bit, I had to edit .config to change one line

CONFIG_SYSTEM_TRUSTED_KEYS=""

Finally,

make deb-pkg -j4

and, to install those .deb

dpkg -i linux-*.deb

This:

grub-mkconfig

was not needed.

Reboot and everything seems to be working fine.

Btw, compilation took 2h30m to finish on this core i3 3rd-gen, with 8gb ram and regular hdd.

Thanks!!

Offline

Board footer