Cannot rebuild 5.11.0-36-generic with BTF support

Asked by Dwight Browne

I have attempted multiple permutations of trying to rebuild the existing kernel with BTF support while retaining the ability to still install packages with the package manager.
I followed the instructions in https://wiki.ubuntu.com/KernelTeam/GitKernelBuild
The additional instructions failed with the following:
git clone git://kernel.ubuntu.com/ubuntu/ubuntu-lucid.git
Cloning into 'ubuntu-lucid'...
fatal: remote error: access denied or repository not exported: /ubuntu/ubuntu-lucid.git

Attempted the instructions here (with the corresponding kernel changes) https://wiki.ubuntu.com/KernelCustomBuild
Which is outdated as I could not successfully get past the can't find command hwmatch when using a bzImage
Attempting to rebuild the kernel at 5.11.0.36 with dpkg -i
Generates the following in the dkpg.log
2021-09-26 20:32:29 upgrade linux-image-5.11.0-36-generic:amd64 5.11.0-36.40~20.04.1 5.11.0-36-generic-2
2021-09-26 20:32:29 status half-configured linux-image-5.11.0-36-generic:amd64 5.11.0-36.40~20.04.1
2021-09-26 20:32:29 status unpacked linux-image-5.11.0-36-generic:amd64 5.11.0-36.40~20.04.1
2021-09-26 20:32:29 status half-installed linux-image-5.11.0-36-generic:amd64 5.11.0-36.40~20.04.1
2021-09-26 20:32:29 status unpacked linux-image-5.11.0-36-generic:amd64 5.11.0-36.40~20.04.1
2021-09-26 20:32:29 status installed linux-image-5.11.0-36-generic:amd64 5.11.0-36.40~20.04.1

What steps am I missing?
Is is possible to rebuild the kernel with BTF support (using pahole v1.20) and still retain package manager compatibility?
Secondly, Building the kernel with uapi headers does not install the headers and I cannot build anything in the kernel tools directory after rebooting.

Thanks

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Dwight Browne
Solved:
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said (last edit ):
#1

It seems to me that the instructions in https://wiki.ubuntu.com/KernelTeam/GitKernelBuild are outdated. Ubuntu lucid was release 10.04 and is not supported any more. Additionally the repository structure has been changes.

I have never tried building a kernel myself, so I cannot give advice.
Based on browsing the directory structure on the kernel server I suggest:
Instead of
git clone git://kernel.ubuntu.com/ubuntu/ubuntu-lucid.git
try
git clone git://kernel.ubuntu.com/git/ubuntu/ubuntu-hirsute.git
(or whatever Ubuntu release you are interested in)

And for the other attempt with the dpkg messages:
I do not see anything wrong.

What is the output of the commands
sudo dpkg --audit
sudo dpkg --configure -a

Revision history for this message
Bernard Stafford (bernard010) said (last edit ):
#2
Revision history for this message
Dwight Browne (oldphd1966) said :
#3

The quick solution (after 19 hours of reading the obvious) was to upgrade to Ubuntu 21.04. where /sys/kernel/btf actually exists.
This page https://wiki.ubuntu.com/KernelTeam/GitKernelBuild as last edited on 2021-04-10 so I assumed it was accurate.

I should be able to rebuild a kernel with minor changes and still retain my package compatibility but I guess that is asking for too much.