Onload-dkms 8.1.3.40 is fail to install on Rocky Linux 9.4 kernel-5.14.0-427.22.1.el9_4.x86_64

Hi Team, Guys,
Feeling good to create my 1st post here. Really looking fordward to have your reply.
On RL 9.x , I could not install onload-dkms which should be easy to search and download. On RL 8.x everything’s OK.
It is because RL 9.x not able to compile the c code below. Looks there is a problem on <linux/uaccess.h>. Is there anything missing? Meanwhile <linux/module.h> is working fine.

#include <linux/uaccess.h>
MODULE_LICENSE(\"GPL\");

int func(unsigned long size)
{
    return access_ok(NULL, size);
}

Here is the detail steps to trigger the problem. You could sikp:

Step 1 Install

yum install onload-dkms

 

...

Building module:

Cleaning build area...(bad exit status: 2)

Failed command:

make -C /lib/modules/5.14.0-427.22.1.el9_4.x86_64/build M=/var/lib/dkms/onload/8.1.3.40/build clean

Building module(s)...(bad exit status: 1)

Failed command:

/var/lib/dkms/onload/8.1.3.40/build/scripts/onload_install

Error! Bad return status for module build on kernel: 5.14.0-427.22.1.el9_4.x86_64 (x86_64)

Consult /var/lib/dkms/onload/8.1.3.40/build/make.log for more information.

Step 2 Check log

cat /var/lib/dkms/onload/8.1.3.40/build/make.log

...

/var/lib/dkms/onload/8.1.3.40/build/src/driver/linux_resource/kernel_compat.sh -k /lib/modules/5.14.0-427.22.1.el9_4.x86_64/build -q > driver/linux_resource/autocompat.h

kernel_compat.sh: Kernel build tree is unable to build modules

make: *** [/var/lib/dkms/onload/8.1.3.40/build/src/mmake.mk:34: driver/linux_resource/autocompat.h] Error 1

make: Leaving directory '/var/lib/dkms/onload/8.1.3.40/build/build/x86_64_linux-5.14.0-427.22.1.el9_4.x86_64'

onload_build: ERROR: Failed to build driver components.

onload_install: ERROR: Build failed. Not installing.

Step 3 Update test_compile

For function test_compile() function, I add a line to the test.c and remove some code to get the error print on shell.

cd /var/lib/dkms/onload/8.1.3.40/build/src/driver/linux_resource/

vi kernel_compat_funcs.sh

From

  echo "$source" > $dir/test.c

  cat > $dir/Makefile <<EOF

$makefile_prefix

obj-m := test.o

EOF

  make -rR -C $KPATH ${ARCH:+ARCH=$ARCH} M=$dir O=$KOUT ${CC:+CC="$CC"} >$dir/log 2>&1

To

  echo "$source" > $dir/test.c

  cat $dir/test.c > /tmp/test.c

  cat > $dir/Makefile <<EOF

$makefile_prefix

obj-m := test.o

EOF

  make -rR -C $KPATH ${ARCH:+ARCH=$ARCH} M=$dir O=$KOUT ${CC:+CC="$CC"}

Step 4 Retry

Retry and located the failure on which test.c


/var/lib/dkms/onload/8.1.3.40/build/src/driver/linux_resource/kernel_compat.sh -k /lib/modules/5.14.0-427.22.1.el9_4.x86_64/build -q > driver/linux_resource/autocompat.h

 

Skipping BTF generation for /tmp/tmp.T9O48II4mF/test.ko due to unavailability of vmlinux

/tmp/tmp.Iy6DjKhReu/test.c:3:16: error: expected declaration specifiers or ‘...’ before string constant

  3 | MODULE_LICENSE("GPL");

   |        ^~~~~

make[1]: *** [scripts/Makefile.build:299: /tmp/tmp.Iy6DjKhReu/test.o] Error 1

make: *** [Makefile:1934: /tmp/tmp.Iy6DjKhReu] Error 2

cat /tmp/test.c

#include <linux/uaccess.h>

MODULE_LICENSE("GPL");

 

int func(unsigned long size)

{

  return access_ok(NULL, size);

}

Step 5 Confirm <linux/module.h> is working

I’m not providing details here. If you have different result, please advise.

Change the line we added

from

cat $dir/test.c > /tmp/test.c

to

cat $dir/test.c >> /tmp/test.c

What is onload-dkms, and is it something you expect to find in Rocky, or is it something you have to “search and download”, and if so, where did you download it from?

Hello Gerry,
onload-dkms is a driver to Solarflare NIC. I felt it is not a good idea to provide the external link in my post…

So here is the link to download

Or you could directlly download it via
https://www.xilinx.com/content/dam/xilinx/publications/solarflare/onload/openonload/8-1-3-40/SF-120887-LS-15-OpenOnload-DKMS-Release-Package.zip

Thank you so much for your reply.

OK, so it comes from xilinx (3rd party thing), I wasn’t really asking for the exact url, but I had a quick look at the release notes, and it says the previous version only supports RHEL 9.3, but your version appears (?) to support RHEL 9.4, but the wording is a bit unclear.

The other thing I noticed is that there’s a “dkms” version and an “srpm” version, are you sure you need “dkms”, or should you be using “srpm”?

As this is a third party, you really need to ask them why it’s refusing to build out-of-the-box.

I know there were many changes to headers between, 9.3 and 9.4.

I’ve also just checked some source code of a module I build on Rocky 9.4, and it has the macro

MODULE_LICENSE("GPL");

so maybe your build environment is not quite right.

Hello Gerry,
Appreciate for your checking. Let me explain more on it.

  1. About theirt release node of 8-1-3-40, it officially support Red Hat Enterprise Linux 9.0 - 9.4 already.
    https://www.xilinx.com/content/dam/xilinx/publications/solarflare/onload/openonload/8-1-3-40/SF-109585-LS-44-OpenOnload-Release-Package.zip.rl.txt

  2. Actually we are using dkms in Rocky 8 for serval versions of OS and Onload.
    We try to avoid buiding Onload whenever we upgrade RL. That is why we prefer to make dkms working on RL 9 as RL8.

  3. About suggesting to build out-of-the-box, let me think how I communicate.
    They should have tested it on RHEL 9.4 and RL is not the OS they support…
    It is not easy to ask them to pay the effort on RL.

  4. Understood that the macro is present in RL9. Let me try to prepare some easy build test case to show the difference. I’m not sure why it is fail with <linux/uaccess.h> only…

#include <linux/module.h>
...
#include <linux/uaccess.h>
...

Yes, but the release notes are not clear enough, did they really test it?

Maybe you could just junk their wrapper and extract the raw files and do your own build?

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.