[CentOS] Kernel rebuild failling on Centos 7: missing libbpf-devel and dwarves rpm too old

Tue Apr 19 14:56:13 UTC 2022
Passerini Marco <marco.passerini at cscs.ch>

Hi,


I'm trying to rebuild the kernel specifically on Centos7 from src.rpm but some packages are missing or too old. I managed to get them and compile on Centos8 though. Any advice?


# yumdownloader --source kernel.src

# rpm -ivh ./kernel-4.18.0-348.20.1.el7.src.rpm

#  rpmbuild -bb --target=`uname -m`  ~/rpmbuild/SPECS/kernel.spec
Building target platforms: x86_64
Building for target x86_64
error: Failed build dependencies:
    libbpf-devel is needed by kernel-4.18.0-348.20.1.el7.x86_64
    rpm < 4.13.0.1-19 conflicts with kernel-4.18.0-348.20.1.el7.x86_64
    dwarves < 1.13 conflicts with kernel-4.18.0-348.20.1.el7.x86_64

# rpm -q dwarves
dwarves-1.10-1.el7.x86_64

# rpm -q rpm
rpm-4.11.3-48.el7_9.x86_64

# yum search libbpf-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: de.mirrors.clouvider.net
 * centos-sclo-rh: ftp.tu-chemnitz.de
 * centos-sclo-sclo: centos.mirrors.psw.services
 * epel: ftp.uni-kl.de
 * extras: mirror.imt-systems.com
 * updates: centos.mirror.iphh.net
Warning: No matches found for: libbpf-devel
No matches found

# yum info rpm
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: de.mirrors.clouvider.net
 * centos-sclo-rh: ftp.tu-chemnitz.de
 * centos-sclo-sclo: mirror.softaculous.com
 * epel: mirror.nextlayer.at
 * extras: mirror.imt-systems.com
 * updates: centos.mirror.iphh.net
Installed Packages
Name        : rpm
Arch        : x86_64
Version     : 4.11.3
Release     : 48.el7_9
Size        : 2.5 M
Repo        : installed
>From repo   : updates
Summary     : The RPM package management system
URL         : http://www.rpm.org/
License     : GPLv2+
Description : The RPM Package Manager (RPM) is a powerful command line driven
            : package management system capable of installing, uninstalling,
            : verifying, querying, and updating software packages. Each software
            : package consists of an archive of files along with information about
            : the package like its version, a description, etc.

# yum info dwarves
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: de.mirrors.clouvider.net
 * centos-sclo-rh: ftp.tu-chemnitz.de
 * centos-sclo-sclo: ftp.antilo.de
 * epel: mirror.de.leaseweb.net
 * extras: mirror.imt-systems.com
 * updates: centos.mirror.iphh.net
Installed Packages
Name        : dwarves
Arch        : x86_64
Version     : 1.10
Release     : 1.el7
Size        : 199 k
Repo        : installed
>From repo   : epel
Summary     : Debugging Information Manipulation Tools
URL         : http://oops.ghostprotocols.net:81/blog
License     : GPLv2
Description : dwarves is a set of tools that use the debugging information inserted in
            : ELF binaries by compilers such as GCC, used by well known debuggers such as
            : GDB, and more recent ones such as systemtap.
            :
            : Utilities in the dwarves suite include pahole, that can be used to find
            : alignment holes in structs and classes in languages such as C, C++, but not
            : limited to these.
            :
            : It also extracts other information such as CPU cacheline alignment, helping
            : pack those structures to achieve more cache hits.
            :
            : A diff like tool, codiff can be used to compare the effects changes in source
            : code generate on the resulting binaries.
            :
            : Another tool is pfunct, that can be used to find all sorts of information about
            : functions, inlines, decisions made by the compiler about inlining, etc.



Regards,
Marco Passerini