CentOS 8.3: Trying to build custom kernel

Issues related to applications and software problems and general support
Post Reply
LA_FORGE
Posts: 4
Joined: 2021/01/11 20:49:41

CentOS 8.3: Trying to build custom kernel

Post by LA_FORGE » 2021/01/12 10:42:02

Hi,

I'm trying to build a custom/homebrew kernel for CentOS 8.3. I just followed the instructions in the Wiki. The preparations were successful but when I'm trying to run rpmbuild, the following dependencies are missing:

Code: Select all

[steve@trinity SPECS]$ rpmbuild -bp --target=x86_64 kernel.spec
Building target platforms: x86_64
Building for target x86_64
error: Failed build dependencies:
        dwarves is needed by kernel-4.18.0-240.1.1.el8.x86_64
        libbabeltrace-devel is needed by kernel-4.18.0-240.1.1.el8.x86_64
        libbpf-devel is needed by kernel-4.18.0-240.1.1.el8.x86_64
I tried to install them but the packages can't be found:

Code: Select all

[steve@trinity SPECS]# dnf install dwarves libbabeltrace-devel libbpf-devel
Last metadata expiration check: 1:43:47 ago on Mon Jan 11 20:12:10 2021.
No match for argument: dwarves
No match for argument: libbabeltrace-devel
No match for argument: libbpf-devel
Error: Unable to find a match: dwarves libbabeltrace-devel libbpf-devel
Where can I get these packages?


Best

LA_FORGE

scottro
Forum Moderator
Posts: 2556
Joined: 2007/09/03 21:18:09
Location: NYC
Contact:

Re: CentOS 8.3: Trying to build custom kernel

Post by scottro » 2021/01/12 14:06:55

While it doesn't always work, (say, if the packages simply aren't available), you can use, one you have the spec file

Code: Select all

 dnf builddep kernel.spec
(or whatever the spec file is called. You will need to use sudo.

A very quick look indicates that dwarves is provided by the epel repo with a newer version from the powertools repo.
New users should check the FAQ and Read Me First pages

LA_FORGE
Posts: 4
Joined: 2021/01/11 20:49:41

Re: CentOS 8.3: Trying to build custom kernel

Post by LA_FORGE » 2021/01/12 16:27:17

This worked very well. Thank you very much. Can you locate the Repo for libbabeltrace-devel
and libbpf-devel as well because it wasn't found in the epel repo. Or should I build these libs from the sources?

sml
Posts: 305
Joined: 2020/01/17 09:01:44

Re: CentOS 8.3: Trying to build custom kernel

Post by sml » 2021/01/12 16:42:06

They are in powertools:

Code: Select all

$ dnf -q provides lib{babeltrace,bpf}-devel
libbabeltrace-devel-1.5.4-3.el8.i686 : Common Trace Format Babel Tower
Repo        : powertools
Matched from:
Provide    : libbabeltrace-devel = 1.5.4-3.el8

libbabeltrace-devel-1.5.4-3.el8.x86_64 : Common Trace Format Babel Tower
Repo        : powertools
Matched from:
Provide    : libbabeltrace-devel = 1.5.4-3.el8

libbpf-devel-0.0.8-4.el8.i686 : Development files for libbpf
Repo        : powertools
Matched from:
Provide    : libbpf-devel = 0.0.8-4.el8

libbpf-devel-0.0.8-4.el8.x86_64 : Development files for libbpf
Repo        : powertools
Matched from:
Provide    : libbpf-devel = 0.0.8-4.el8
FWIW, I usually build in a Mock chroot. Among other things, it spares me the chasing after build dependencies.

LA_FORGE
Posts: 4
Joined: 2021/01/11 20:49:41

Re: CentOS 8.3: Trying to build custom kernel

Post by LA_FORGE » 2021/01/12 17:29:36

Thank you very much

Code: Select all

[steve@trinity linux]$ time make -j16
real    0m36.927s
user    6m19.360s
sys     2m41.734s
These are fantastic build times since I didn't remove any module or other code in the kernel, I just took the config from /boot/config-4.18.0-240.1.1.el8_3.x86_64

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: CentOS 8.3: Trying to build custom kernel

Post by TrevorH » 2021/01/12 19:17:58

You should really use mock not rpmbuild.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

LA_FORGE
Posts: 4
Joined: 2021/01/11 20:49:41

Re: CentOS 8.3: Trying to build custom kernel

Post by LA_FORGE » 2021/01/13 15:14:05

Ok, thanks. I'll do it next build.

zvivered
Posts: 17
Joined: 2019/09/23 17:23:00

Re: CentOS 8.3: Trying to build custom kernel

Post by zvivered » 2021/07/14 14:39:50

Hello,

I tried to use this wiki on centos 8.2 several times.
The final rpmbuild was successfull.
But after booting the new kernel I did not have the new kernel configuration.

According to /proc/version, the version of the kernel was new.

For example, the line: cp configs/kernel-3.10.0-`uname -m`.config .config
is for Centos 7.x only.
I changed it to :
cp .config configs/kernel-`uname -m`.config

Can you please tell if you found any other mistakes in the wiki ?

Thank you,
Zvika

wangyuan
Posts: 1
Joined: 2019/11/19 03:04:31

Re: CentOS 8.3: Trying to build custom kernel

Post by wangyuan » 2021/08/18 02:38:27

Even this question has answers, I add an answer here to make it clear.

The packages missed are in "PowerTools" repo.

To enable the repo, you can modify "/etc/yum.repos.d/CentOS-Linux-PowerTools.repo".

Change the "enabled=0" to "enabled=1". Then try to install again.

Post Reply