# Kernel questions - finding source, and trouble building

**URL:** <https://forums.rockylinux.org/t/kernel-questions-finding-source-and-trouble-building/10296>\
**Category:** Rocky Linux Help & Support\
**Created:** [June 15, 2023, 11:39am UTC](https://forums.rockylinux.org/t/kernel-questions-finding-source-and-trouble-building/10296 "2023-06-15T11:39:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rfs](https://avatars.discourse-cdn.com/v4/letter/r/a87d85/32.png) [@rfs](https://forums.rockylinux.org/u/rfs)\
**Post date:** [June 15, 2023, 11:39am UTC](https://forums.rockylinux.org/t/kernel-questions-finding-source-and-trouble-building/10296/1 "2023-06-15T11:39:45Z")

</div>

I have been trying to find the source RPM (i.e. SRPM) package for the kernel I am currently running, whose prebuilt package is kernel-5.14.0-162.6.1.el9\_1.0.1.x86\_64.rpm . In other words, I’m trying to find the package kernel-5.14.0-162.6.1.el9\_1.0.1.src.rpm .

Now, the nearest I can find on [rockylinux.org](http://rockylinux.org) under archived versions is kernel-5.14.0-162.23.1.el9\_1.src.rpm, but this doesn’t build correctly, giving me the following output (after I have removed the -s (silent) flag from the make instruction):

/usr/bin/make ‘HOSTCFLAGS=-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D\_FORTIFY\_SOURCE=2 -Wp,-D\_GLIBCXX\_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection’ 'HOSTLDFLAGS=-Wl,-z,relro -Wl,–as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 ’ ARCH=x86\_64 KCFLAGS= WITH\_GCOV=0 -j24 bzImage

- /usr/bin/make ‘HOSTCFLAGS=-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D\_FORTIFY\_SOURCE=2 -Wp,-D\_GLIBCXX\_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection’ 'HOSTLDFLAGS=-Wl,-z,relro -Wl,–as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 ’ ARCH=x86\_64 KCFLAGS= WITH\_GCOV=0 -j24 bzImage  
DESCEND objtool  
DESCEND bpf/resolve\_btfids  
CALL scripts/atomic/check-atomics.sh  
CALL scripts/checksyscalls.sh  
CHK include/generated/compile.h  
GEN .version  
CHK include/generated/compile.h  
UPD include/generated/compile.h  
CC init/version.o  
AR init/built-in.a  
LD vmlinux.o  
MODPOST vmlinux.symvers  
MODINFO modules.builtin.modinfo  
GEN modules.builtin  
LD .tmp\_vmlinux.btf  
BTF .btf.vmlinux.bin.o  
LD .tmp\_vmlinux.kallsyms1  
KSYMS .tmp\_vmlinux.kallsyms1.S  
AS .tmp\_vmlinux.kallsyms1.S  
LD .tmp\_vmlinux.kallsyms2  
KSYMS .tmp\_vmlinux.kallsyms2.S  
AS .tmp\_vmlinux.kallsyms2.S  
LD vmlinux  
BTFIDS vmlinux  
FAILED: load BTF from vmlinux: Invalid argument  
make: \*\*\* [Makefile:1218: vmlinux] Error 255  
make: \*\*\* Deleting file ‘vmlinux’

Can anybody tell me any of:

where to find the source package I really want; or  
what is wrong in the above build; or  
where I can find the meaning of the capital letter keywords output from make (e.g. BTFIDS) ?

Roger.

---

<div class="post-metadata">

**Author:** ![toracat](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/toracat/32/68_2.png) [@toracat](https://forums.rockylinux.org/u/toracat)\
**Post date:** [June 15, 2023, 5:18pm UTC](https://forums.rockylinux.org/t/kernel-questions-finding-source-and-trouble-building/10296/2 "2023-06-15T17:18:27Z")

</div>

I’m not sure why you need such an old kernel, not the latest kernel from 9.2. But anyway, can you check to see if CONFIG\_DEBUG\_INFO\_COMPRESSED is enabled in the config file? If so, would disabling it make it work?

---

<div class="post-metadata">

**Author:** ![Cphusion](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/cphusion/32/3235_2.png) [@Cphusion](https://forums.rockylinux.org/u/Cphusion)\
**Post date:** [June 15, 2023, 5:21pm UTC](https://forums.rockylinux.org/t/kernel-questions-finding-source-and-trouble-building/10296/3 "2023-06-15T17:21:10Z")

</div>

You have to enable the source repo in /etc/yum.repos.d rocky.repo

[baseos-source]  
name=Rocky Linux $releasever - BaseOS - Source  
mirrorlist=[https://mirrors.rockylinux.org/mirrorlist?arch=source&repo=BaseOS-$releasever-source$rltype](https://mirrors.rockylinux.org/mirrorlist?arch=source&repo=BaseOS-$releasever-source$rltype)  
#baseurl=[http://dl.rockylinux.org/$contentdir/$releasever/BaseOS/source/tree/](http://dl.rockylinux.org/$contentdir/$releasever/BaseOS/source/tree/)  
gpgcheck=1  
enabled=0  
metadata\_expire=6h  
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9

```auto
Change "enabled=0" to "enabled=1"
```

---

<div class="post-metadata">

**Author:** ![rfs](https://avatars.discourse-cdn.com/v4/letter/r/a87d85/32.png) [@rfs](https://forums.rockylinux.org/u/rfs)\
**Post date:** [June 15, 2023, 9:09pm UTC](https://forums.rockylinux.org/t/kernel-questions-finding-source-and-trouble-building/10296/4 "2023-06-15T21:09:19Z")

</div>

Thank you Toracat for this suggestion; it was already disabled. However, your suggestion somehow led me to this article [Compiling older Linux Kernels can fail with load BTF from vmlinux: invalid argument - devkernel.io](https://devkernel.io/posts/pahole-error/) which contains three possible solutions; the third (patch pahole-flags.sh) seems to have worked for me so far.

In answer to your “I’m not sure why you need…”, I have not updated to rocky 9.2 because of hearing about random crashes with 9.2 which I definitely don’t want, particularly given that RedHat have a fix for them which is so far not available to non-fee-payers, so I am waiting till a kernel with that fix is available on the rocky repos. In the meantime I am investigating on another (non-production) system some things about the behaviour of my current system that I don’t understand, hence wanting the ability to put additional code in the kernel to investigate.

---

<div class="post-metadata">

**Author:** ![rfs](https://avatars.discourse-cdn.com/v4/letter/r/a87d85/32.png) [@rfs](https://forums.rockylinux.org/u/rfs)\
**Post date:** [June 15, 2023, 9:10pm UTC](https://forums.rockylinux.org/t/kernel-questions-finding-source-and-trouble-building/10296/5 "2023-06-15T21:10:55Z")

</div>

Thank you Cphusion for that - I had already enabled it, but as far as I can tell only the current (rocky 9.2) kernel and source are kept there.

---

<div class="post-metadata">

**Author:** ![Cphusion](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/cphusion/32/3235_2.png) [@Cphusion](https://forums.rockylinux.org/u/Cphusion)\
**Post date:** [June 15, 2023, 9:22pm UTC](https://forums.rockylinux.org/t/kernel-questions-finding-source-and-trouble-building/10296/6 "2023-06-15T21:22:07Z")

</div>

[This](http://dl.rockylinux.org/vault/rocky/9.1/BaseOS/source/tree/Packages/k/kernel-5.14.0-162.23.1.el9_1.src.rpm) one is probably the closest one you are going to get to kernel-5.14.0-162.6.1.el9\_1.0.1.src.rpm unless you download that kernel directly from RHEL.  
[https://dl.rockylinux.org/vault/rocky/9.1/BaseOS/source/tree/Packages/k](https://dl.rockylinux.org/vault/rocky/9.1/BaseOS/source/tree/Packages/k)

---

<div class="post-metadata">

**Author:** ![brian](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/brian/32/5777_2.png) [@brian](https://forums.rockylinux.org/u/brian)\
**Post date:** [August 25, 2023, 3:00am UTC](https://forums.rockylinux.org/t/kernel-questions-finding-source-and-trouble-building/10296/7 "2023-08-25T03:00:07Z")

</div>


