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

Wed Apr 20 14:17:30 UTC 2022
Phil Perry <pperry at elrepo.org>

You could do a lot worse than following this documentation:

https://wiki.centos.org/HowTos/Custom_Kernel


On 20/04/2022 14:28, Passerini Marco wrote:
> Hi,
> 
> 
> I think you're right, I got it after I enabled:
> 
> # cat /etc/yum.repos.d/CentOS-Sources.repo
> [...]
> [base-source]
> name=CentOS-$releasever - Base Sources
> baseurl=http://vault.centos.org/centos/$releasever/os/Source/
> gpgcheck=1
> enabled=1
> gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
> [...]
> 
> 
> Then I ran:
> 
> 
> # yumdownloader --source kernel.src
> 
> Loaded plugins: fastestmirror
> Enabling centos-sclo-rh-source repository
> Enabling epel-source repository
> Enabling updates-source repository
> Enabling centos-sclo-sclo-source repository
> Enabling extras-source repository
> Loading mirror speeds from cached hostfile
> epel/x86_64/metalink                                                                                                                                                               |  31 kB  00:00:00
> epel-source/x86_64/metalink                                                                                                                                                        |  29 kB  00:00:00
>   * base: mirror.imt-systems.com
>   * centos-sclo-rh: ftp.agdsn.de
>   * centos-sclo-sclo: de.mirrors.clouvider.net
>   * epel: fedora.tu-chemnitz.de
>   * epel-source: fedora.tu-chemnitz.de
>   * extras: mirror.imt-systems.com
>   * updates: mirror.scaleuptech.com
> base                                                                                                                                                                               | 3.6 kB  00:00:00
> base-source                                                                                                                                                                        | 2.9 kB  00:00:00
> centos-sclo-rh                                                                                                                                                                     | 3.0 kB  00:00:00
> centos-sclo-rh-source                                                                                                                                                              | 3.0 kB  00:00:00
> centos-sclo-sclo                                                                                                                                                                   | 3.0 kB  00:00:00
> centos-sclo-sclo-source                                                                                                                                                            | 3.0 kB  00:00:00
> extras                                                                                                                                                                             | 2.9 kB  00:00:00
> extras-source                                                                                                                                                                      | 2.9 kB  00:00:00
> updates                                                                                                                                                                            | 2.9 kB  00:00:00
> updates-source                                                                                                                                                                     | 2.9 kB  00:00:00
> Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
> kernel-4.18.0-348.20.1.el7.src.rpm                                                                                                                                                 | 121 MB  00:00:01
> 
> This version is too recent I think. I'm not sure why it's there?
> 
> I then manually downloaded this version, it looks like it's working better:
> 
> wget https://vault.centos.org/7.9.2009/os/Source/SPackages/kernel-3.10.0-1160.el7.src.rpm
> 
> 
> 
> Regards,
> Marco Passerini
> 
> 
> 
> ________________________________
> From: CentOS <centos-bounces at centos.org> on behalf of Phil Perry <pperry at elrepo.org>
> Sent: Tuesday, April 19, 2022 5:46:15 PM
> To: centos at centos.org
> Subject: Re: [CentOS] Kernel rebuild failling on Centos 7: missing libbpf-devel and dwarves rpm too old
> 
> On 19/04/2022 15:56, Passerini Marco wrote:
>> 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
>>
> 
> You seem to be trying to build an el8 kernel source on el7?
> 
>> # 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
>> _______________________________________________
>> CentOS mailing list
>> CentOS at centos.org
>> https://lists.centos.org/mailman/listinfo/centos
> 
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> https://lists.centos.org/mailman/listinfo/centos
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> https://lists.centos.org/mailman/listinfo/centos