Are there any differences in the build process depending on the kernel version?

I’m currently setting up a DRBD environment.
I successfully built DRBD-9.0.32-1 on RHEL 8.9 with kernel version 4.18.0-513.5.1.el8_9.x86_64.

However, after updating to kernel version 4.18.0-513.11.1.el8_9, the same build process fails.

Does anyone know why this might be happening?

  • Update List
  • Result Output
[root@test drbd-9.0.32-1]# pwd

[root@test drbd-9.0.32-1]# ls
ChangeLog   docker                drbd-kernel.spec  Makefile 
coccinelle  drbd                  filelist-redhat   misc               rpm-macro-fixes
COPYING     drbd-9.0.32-1.tar.gz  filelist-suse     README.drbd-utils

[root@test drbd-9.0.32-1]# make kmp-rpm
checking for presence of 9\.0\.32-1 in various changelog files
ChangeLog:9.0.32-1 (api:genl2/proto:86-121/transport:14)
test -s .filelist
rm -f drbd-9.0.32-1
ln -s . drbd-9.0.32-1
for f in $(<.filelist) ; do [ -e $f ] && continue ; echo missing: $f ; exit 1; done
tar --owner=0 --group=0 -czf - -T .filelist > drbd-9.0.32-1.tar.gz
rm drbd-9.0.32-1
cp drbd-9.0.32-1.tar.gz `rpm -E "%_sourcedir"`
KVER=`uname -r`; flavors=; \
case $KVER in *.debug) flavors=debug; KVER=${KVER%.debug};; esac; \
rpmbuild -bb \
     --define "kernel_version $KVER" \
    ${flavors:+ --define "lb_flavors $flavors"} \
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.Txggzt
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd /root/rpmbuild/BUILD
+ rm -rf drbd-9.0.32-1
+ /usr/bin/gzip -dc /root/rpmbuild/SOURCES/drbd-9.0.32-1.tar.gz
+ /usr/bin/tar -xof -
+ '[' 0 -ne 0 ']'
+ cd drbd-9.0.32-1
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.lwBJRw
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd drbd-9.0.32-1
+ rm -rf obj
+ mkdir obj
+ for flavor in default
+ cp -a -r drbd obj/default
+ ln -s default obj/drbd
++ '[' default = default ']'
++ echo /usr/src/kernels//4.18.0-513.11.1.el8_9.x86_64
+ make -C obj/default all KDIR=/usr/src/kernels//4.18.0-513.11.1.el8_9.x86_64
make[1]: Entering directory '/root/rpmbuild/BUILD/drbd-9.0.32-1/obj/default'

    Calling toplevel makefile of kernel source tree, which I believe is in

make -C /usr/src/kernels//4.18.0-513.11.1.el8_9.x86_64   M=/root/rpmbuild/BUILD/drbd-9.0.32-1/obj/default  modules
  COMPAT  __vmalloc_has_2_params
  COMPAT  alloc_workqueue_takes_fmt

< omitted >

  COMPAT  sock_create_kern_has_five_parameters
  COMPAT  sock_ops_returns_addr_len
  UPD     /root/rpmbuild/BUILD/drbd-9.0.32-1/obj/default/compat.4.18.0-513.11.1.el8_9.x86_64.h
  UPD     /root/rpmbuild/BUILD/drbd-9.0.32-1/obj/default/compat.h
./drbd-kernel-compat/ line 12: spatch: command not found
./drbd-kernel-compat/ line 45: hash: spatch: not found
  INFO: no suitable spatch found; trying spatch-as-a-service;
  be patient, may take up to 10 minutes
  if it is in the server side cache it might only take a second
  SPAAS    bef8467d9e8283a624f1a0bb4cd4ea4e
curl: (6) Could not resolve host:
  ERROR: SPAAS is not reachable! Please check if your network
  configuration or some firewall prohibits access to
make[4]: *** [Makefile:178: drbd-kernel-compat/cocci_cache/bef8467d9e8283a624f1a0bb4cd4ea4e/compat.patch] Error 1
make[3]: *** [/root/rpmbuild/BUILD/drbd-9.0.32-1/obj/default/Kbuild:135: /root/rpmbuild/BUILD/drbd-9.0.32-1/obj/default/drbd-kernel-compat/compat.patch] Error 2
make[2]: *** [Makefile:1619: _module_/root/rpmbuild/BUILD/drbd-9.0.32-1/obj/default] Error 2
make[1]: *** [Makefile:132: kbuild] Error 2
make[1]: Leaving directory '/root/rpmbuild/BUILD/drbd-9.0.32-1/obj/default'
error: Bad exit status from /var/tmp/rpm-tmp.lwBJRw (%build)

RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.lwBJRw (%build)
make: *** [Makefile:279: kmp-rpm] Error 1

I know nothing about this, but this looks like a good starting point to investigate I think.

1 Like

Apologies for the delayed response.
I’m not familiar with this, but it seems like a promising starting point for further investigation, I believe.

We use the coccinelle/spatch to manage patches for different kernel versions. However most distributions do not have that available as a package, or they do not have a recent enough version available. So our release tarballs contain a number of pre-computed patches.

These pre-computed patches are available for every supported RHEL kernel at the time of release. In this case the 4.18.0-513.5.1.el8_9.x86_64 kernel seems to have been compatible with one of these, while the 4.18.0-513.11.1.el8_9 was not.

There is a secondary fallback, if there is neither a precomputed patch, nor a recent spatch command available, which is a service we call “spatch-as-a-service”. This uploads the results of our compat tests to, where we run spatch and try to create the right compat patch.

I assume your builds are running with networking disable, so you can not make use of this fallback.

As a general note, DRBD 9.0 is no longer receiving updated, so do not expect compatibility with recent kernels: for that you need to update to DRBD 9.1 or 9.2.