then go make a coffee, this’ll take an hour or more.
p.s. $ sudo dnf builddep kernel will generally install all of your dependencies, you may have to point it at a spec or srpm too, kernel-devel certainly won’t be enough. from your build log its pretty obvious you need to $ sudo dnf install diffutils
The dnf builddep kernel doesn’t seem to do what it should:
(in a clean almalinux:9.2 docker)
# docker run almalinux:9.2 bash -c 'dnf install -y dnf-plugins-core && dnf builddep kernel'
Package gawk-5.1.0-6.el9.x86_64 is already installed.
Package coreutils-single-8.32-34.el9.x86_64 is already installed.
Package openssl-1:3.0.7-16.el9_2.x86_64 is already installed.
Package xz-5.2.5-8.el9_0.x86_64 is already installed.
Package findutils-1:4.8.0-5.el9.x86_64 is already installed.
Package hostname-3.23-6.el9.x86_64 is already installed.
Package bash-5.1.8-6.el9_1.x86_64 is already installed.
Package binutils-2.35.2-37.el9.x86_64 is already installed.
No matching package to install: 'glibc-static'
Package tar-2:1.34-6.el9_1.x86_64 is already installed.
Package gzip-1.12-1.el9.x86_64 is already installed.
No matching package to install: 'gcc-plugin-devel'
Not all dependencies satisfied
Error: Some packages could not be found.
I should have some time to play with the ‘proper’ way of using srpms later. It sounds promising.
its doing exactly what it should - installing all the BuildRequires, some aren’t found as you haven’t enabled the repo’s and some are already installed in the base image.
you’ll have to enable the CRB repo for certain and i think devel too, that’s why mock (or even an almalinux vm) is better than docker.
if you’re just building a kernel module, that’s different, here’s a couple of tutorials albeit a bit dated/incomplete but if you’re advanced enough to be building custom kernel modules you should be able to fill in the gaps: