You are not logged in.

#1 2022-05-30 01:03:33

andsouz
Member
Registered: 2022-05-30
Posts: 4

[SOLVED] DKMS fails to re-install module on kernel updates

Hi! I'm new to Arch, and I've run into a newbie's issue.

I have some dkms modules installed, and whenever I update, and there is a new kernel, I have these dkms install warnings and errors messages:

Running 'pacman -Syu'
synchronizing package lists
starting full system upgrade
running '60-mkinitcpio-remove.hook'...
running '71-dkms-remove.hook'...
==> dkms remove --no-depmod hid-ite8291r3/0.0 -k 5.17.9-arch1-1
==> dkms remove --no-depmod qc71_laptop/0.0 -k 5.17.9-arch1-1
==> dkms remove --no-depmod vboxhost/6.1.34_OSE -k 5.17.9-arch1-1
==> depmod 5.17.9-arch1-1
transaction started
upgraded alacritty (0.10.1-1 -> 0.10.1-2)
upgraded linux (5.17.9.arch1-1 -> 5.18.arch1-1)
upgraded linux-headers (5.17.9.arch1-1 -> 5.18.arch1-1)
upgraded nvidia-utils (515.43.04-1 -> 515.43.04-2)
If you run into trouble with CUDA not being available, run nvidia-modprobe first.
upgraded nvidia (515.43.04-5 -> 515.43.04-6)
upgraded python-cryptography (37.0.0-1 -> 37.0.1-1)
upgraded webkit2gtk (2.36.2-1 -> 2.36.3-1)
transaction completed
running '20-systemd-sysusers.hook'...
running '30-systemd-daemon-reload.hook'...
running '30-systemd-udev-reload.hook'...
running '30-systemd-update.hook'...
running '60-depmod.hook'...
running '70-dkms-install.hook'...
==> dkms install --no-depmod vboxhost/6.1.34_OSE -k 5.18.0-arch1-1
==> dkms install --no-depmod hid-ite8291r3/0.0 -k 5.18.0-arch1-1
Error! Bad return status for module build on kernel: 5.18.0-arch1-1 (x86_64)
Consult /var/lib/dkms/hid-ite8291r3/0.0/build/make.l
og for more information.
==> WARNING: `dkms install --no-depmod hid-ite8291r3
/0.0 -k 5.18.0-arch1-1' exited 10
==> dkms install --no-depmod qc71_laptop/0.0 -k 5.18
.0-arch1-1
Error! Bad return status for module build on kernel:
 5.18.0-arch1-1 (x86_64)
Consult /var/lib/dkms/qc71_laptop/0.0/build/make.log
 for more information.
==> WARNING: `dkms install --no-depmod qc71_laptop/0
.0 -k 5.18.0-arch1-1' exited 10
==> depmod 5.18.0-arch1-1
running '90-mkinitcpio-install.hook'...
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'default'
  -> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img
==> Starting build: 5.18.0-arch1-1
  -> Running build hook: [base]
  -> Running build hook: [systemd]
  -> Running build hook: [autodetect]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
==> WARNING: Possibly missing firmware for module: xhci_pci
  -> Running build hook: [filesystems]
  -> Running build hook: [keyboard]
  -> Running build hook: [fsck]
==> Generating module dependencies
==> Creating zstd-compressed initcpio image: /boot/initramfs-linux.img
==> Image generation successful
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'fallback'
  -> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-fallback.img -S autodetect
==> Starting build: 5.18.0-arch1-1
  -> Running build hook: [base]
  -> Running build hook: [systemd]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
==> WARNING: Possibly missing firmware for module: wd719x
==> WARNING: Possibly missing firmware for module: bfa
==> WARNING: Possibly missing firmware for module: qla1280
==> WARNING: Possibly missing firmware for module: aic94xx
==> WARNING: Possibly missing firmware for module: q
la2xxx
==> WARNING: Possibly missing firmware for module: q
ed
==> WARNING: Possibly missing firmware for module: x
hci_pci
  -> Running build hook: [filesystems]
  -> Running build hook: [keyboard]
  -> Running build hook: [fsck]
==> Generating module dependencies
==> Creating zstd-compressed initcpio image: /boot/i
nitramfs-linux-fallback.img
==> Image generation successful
running 'dbus-reload.hook'...
running 'update-desktop-database.hook'...
Running 'pacman -Syu --debug'
synchronizing package lists
starting full system upgrade
transaction started
upgraded iproute2 (5.17.0-3 -> 5.18.0-1)
transaction completed
running '30-systemd-update.hook'...

Here is the log for the module hid-ite8291r3:

DKMS make.log for hid-ite8291r3-0.0 for kernel 5.18.0-arch1-1 (x86_64)
Sun May 29 04:24:00 PM -03 2022
make: Entering directory '/var/lib/dkms/hid-ite8291r3/0.0/build'
make -C /lib/modules/5.17.9-arch1-1/build M=/var/lib/dkms/hid-ite8291r3/0.0/build modules
make[1]: Entering directory '/var/lib/dkms/hid-ite8291r3/0.0/build'
make[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
make[1]: *** /lib/modules/5.17.9-arch1-1/build: No such file or directory.  Stop.
make[1]: Leaving directory '/var/lib/dkms/hid-ite8291r3/0.0/build'
make: *** [Makefile:11: all] Error 2
make: Leaving directory '/var/lib/dkms/hid-ite8291r3/0.0/build'

And the module qc71_laptop:

DKMS make.log for qc71_laptop-0.0 for kernel 5.18.0-arch1-1 (x86_64)
Sun May 29 04:24:00 PM -03 2022
make: Entering directory '/var/lib/dkms/qc71_laptop/0.0/build'
make -C /lib/modules/5.17.9-arch1-1/build M=/var/lib/dkms/qc71_laptop/0.0/build modules
make[1]: Entering directory '/var/lib/dkms/qc71_laptop/0.0/build'
make[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
make[1]: *** /lib/modules/5.17.9-arch1-1/build: No such file or directory.  Stop.
make[1]: Leaving directory '/var/lib/dkms/qc71_laptop/0.0/build'
make: *** [Makefile:25: all] Error 2
make: Leaving directory '/var/lib/dkms/qc71_laptop/0.0/build'

If I run dkms status imediatelly after the update, I have this output:

hid-ite8291r3/0.0: added
qc71_laptop/0.0: added
vboxhost/6.1.34_OSE, 5.18.0-arch1-1, x86_64: installed

The problem is I have to reboot every time the kernel updates, then run sudo dkms autoinstall, and reboot again to activate the modules.

In this case, I was updating from kernel 5.17.9-arch1-1 to 5.18.0-arch1-1 And from the logs, I understand that make is looking for the older kernel version:

make[1]: *** /lib/modules/5.17.9-arch1-1/build: No such file or directory.  Stop.

My goal is to make it update automatically when the kernel updates, like the module vboxhost does (without errors, and without the need to reboot, autoinstall and reboot again).

Should I make it somehow look for the new kernel version instead of the old one, and update the modules automatically? Or it should be installed and activated only while booting?

Either way, where can I learn how to configure this properly?

I don't know if it helps, but these are the modules:
https://github.com/pobrn/hid-ite8291r3
https://github.com/pobrn/qc71_laptop

Ps.: Sorry for my bad English.
Ps2.: Sorry if it's too much logs.

Last edited by andsouz (2022-06-02 04:28:12)

Offline

#2 2022-05-30 01:27:53

loqs
Member
Registered: 2014-03-06
Posts: 18,968

Re: [SOLVED] DKMS fails to re-install module on kernel updates

https://github.com/pobrn/hid-ite8291r3/ … akefile#L7

KDIR = /lib/modules/$(shell uname -r)/build

Gets the running kernels release from uname and uses that to build the directory path instead of the path to the target kernel.

https://github.com/pobrn/qc71_laptop/bl … le#L20-L21

KVER = $(shell uname -r)
KDIR = /lib/modules/$(KVER)/build

Same problem

From https://docs.kernel.org/kbuild/modules.html

KDIR ?= /lib/modules/`uname -r`/build

Only set the variable KDIR if it is not set already.

Offline

#3 2022-05-30 03:12:51

andsouz
Member
Registered: 2022-05-30
Posts: 4

Re: [SOLVED] DKMS fails to re-install module on kernel updates

Thanks for your reply!

So those lines you pointed should be respectively changed to:

KDIR ?= /lib/modules/$(shell uname -r)/build

and:

KVER = $(shell uname -r)
KDIR ?= /lib/modules/$(KVER)/build

Also, in the dkms.conf file it's being defined as KERNELDIR:
https://github.com/pobrn/hid-ite8291r3/ … ms.conf#L1

MAKE="make -C ./ KERNELDIR=/lib/modules/${kernelver}/build"

So it should be changed to:

MAKE="make -C ./ KDIR=/lib/modules/${kernelver}/build"

Did I get that right?

If this is correct, I can only see if this really worked after the next kernel update?

Offline

#4 2022-05-30 03:31:23

loqs
Member
Registered: 2014-03-06
Posts: 18,968

Re: [SOLVED] DKMS fails to re-install module on kernel updates

Yes the Makefile changes are correct.
I would suggest dropping the Make and Clean lines from dkms.conf so DKMS will use its default rules.

You can have multiple kernels installed at the same time.  If you install linux-lts and linux-lts-headers you can see if the modules build correctly for the newly installed kernel.   You can remove the packages after testing.

Offline

#5 2022-05-30 06:27:57

andsouz
Member
Registered: 2022-05-30
Posts: 4

Re: [SOLVED] DKMS fails to re-install module on kernel updates

Ok, here is what I did:

  1. Uninstalled one of the modules (qc71_laptop).

  2. Rebooted, and reinstalled it with the changes in the Makefile and dkms.conf (removed Make and Clean lines).

  3. Installed the packages linux-lts and linux-lts-headers.

And unexpectedly, both modules built correctly. When I run dkms status, I get this:

hid-ite8291r3/0.0, 5.15.43-1-lts, x86_64: installed
hid-ite8291r3/0.0, 5.18.0-arch1-1, x86_64: installed
qc71_laptop/0.0, 5.15.43-1-lts, x86_64: installed
qc71_laptop/0.0, 5.18.0-arch1-1, x86_64: installed
vboxhost/6.1.34_OSE, 5.15.43-1-lts, x86_64: installed
vboxhost/6.1.34_OSE, 5.18.0-arch1-1, x86_64: installed

I was expecting only the updated module (qc71_laptop) and vboxhost to build successfully. Why the module hid-ite8291r3 builds with linux-lts but doesn't build with the regular linux kernel upgrades?

If I run uname -r:

5.18.0-arch1-1

Offline

#6 2022-06-02 04:24:17

andsouz
Member
Registered: 2022-05-30
Posts: 4

Re: [SOLVED] DKMS fails to re-install module on kernel updates

I opened an issue on the GitHub repository and the developer fixed it. He chose a different approach, but the problem was (as expected) what loqs said.

Thanks for your help loqs!

Offline

Board footer

Powered by FluxBB