Skip to content

DKMS: '.gnu.linkonce.this_module section size must match the kernel's built struct module size at run time' error #8153

Closed
@epsilonrt

Description

@epsilonrt

I'm having a problem installing a driver. Once compiled correctly, the system gives me an error. Note that I performed the same procedure with RaspiOS on an arm64 board with the same kernel version, and it worked. I also tried with Debian 12 on a PC, and it worked. The problem therefore lies with Armbian. Also I have been using tty0tty on Armbian for a very long time and this problem just appeared.

The driver I want to install is https://github.com/lcgamboa/tty0tty.

After two days of searching, I decided to ask for help. I'm having trouble loading the module on a 6.12.20 kernel running aarch64 (Armbian on a NanoPi Neo Core2 board). As we can see the kernel version of the driver is the same as that of the kernel.

epsilonrt@nanopineocore2:~/src/tty0tty/module$ modinfo tty0tty
filename:       /lib/modules/6.12.20-current-sunxi64/updates/dkms/tty0tty.ko
license:        GPL
description:    tty0tty null modem driver
author:         Luis Claudio Gamboa Lopes <lcgamboa@yahoo.com>
depends:
name:           tty0tty
vermagic:       6.12.20-current-sunxi64 SMP mod_unload aarch64
epsilonrt@nanopineocore2:~/src/tty0tty/module$ uname -a
Linux nanopineocore2 6.12.20-current-sunxi64 #1 SMP Sat Mar 22 19:54:28 UTC 2025 aarch64 GNU/Linux

The scripted installation seems to be working correctly (there is no MOK generated by the dkms package under Armbian...):

epsilonrt@nanopineocore2:~/src/tty0tty/module$ sudo ./dkms-install.sh
About to run dkms install steps...
Deprecated feature: REMAKE_INITRD (/usr/src/tty0tty-1.4/dkms.conf)
Creating symlink /var/lib/dkms/tty0tty/1.4/source -> /usr/src/tty0tty-1.4
Sign command: /lib/modules/6.12.20-current-sunxi64/build/scripts/sign-file
Binary /lib/modules/6.12.20-current-sunxi64/build/scripts/sign-file not found, modules won't be signed
Deprecated feature: REMAKE_INITRD (/var/lib/dkms/tty0tty/1.4/source/dkms.conf)

Building module:
Cleaning build area...
'make' -j4 KVERSION=6.12.20-current-sunxi64 KERNELDIR=/lib/modules/6.12.20-current-sunxi64/build......
Cleaning build area...
Deprecated feature: REMAKE_INITRD (/var/lib/dkms/tty0tty/1.4/source/dkms.conf)

tty0tty.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/6.12.20-current-sunxi64/updates/dkms/
depmod...
Finished running dkms install steps.
echo "tty0tty" > /etc/modules-load.d/tty0tty.conf
cp 99-tty0tty.rules  /etc/udev/rules.d/
udevadm control --reload-rules && udevadm trigger
chown root:root /etc/udev/rules.d/99-tty0tty.rules

However the module does not load and dmesg tells me:

epsilonrt@nanopineocore2:~/src/tty0tty/module$ dmesg -T | tail
[...]
[dim. mai  4 17:37:11 2025] module tty0tty: .gnu.linkonce.this_module section size must match the kernel's built struct module size at run time

It seems that the size of the descriptor structure doesn't match the kernel version.
A loading attempt with modprobe indeed indicates a problem, even when trying to force it:

epsilonrt@nanopineocore2:~/src/tty0tty/module$ sudo modprobe tty0tty
modprobe: ERROR: could not insert 'tty0tty': Exec format error
epsilonrt@nanopineocore2:~/src/tty0tty/module$ sudo modprobe tty0tty --force-vermagic
modprobe: ERROR: could not insert 'tty0tty': Exec format error
epsilonrt@nanopineocore2:~/src/tty0tty/module$ sudo modprobe tty0tty -f
modprobe: ERROR: could not insert 'tty0tty': Exec format error

However, the vermagic of my module corresponds to the version of my kernel...

epsilonrt@nanopineocore2:~/src/tty0tty/module$ modinfo tty0tty
filename:       /lib/modules/6.12.20-current-sunxi64/updates/dkms/tty0tty.ko
license:        GPL
description:    tty0tty null modem driver
author:         Luis Claudio Gamboa Lopes <lcgamboa@yahoo.com>
depends:
name:           tty0tty
vermagic:       6.12.20-current-sunxi64 SMP mod_unload aarch64
epsilonrt@nanopineocore2:~/src/tty0tty/module$ uname -a
Linux nanopineocore2 6.12.20-current-sunxi64 #1 SMP Sat Mar 22 19:54:28 UTC 2025 aarch64 GNU/Linux

I did some research, reinstalled the linux-headers package, and did the same thing on a Raspberry Pi 4B with the same kernel version and architecture:

epsilonrt@rpi-bookworm-arm64:~/src/tty0tty/module $ sudo ./dkms-install.sh
About to run dkms install steps...
Deprecated feature: REMAKE_INITRD (/usr/src/tty0tty-1.4/dkms.conf)
Creating symlink /var/lib/dkms/tty0tty/1.4/source -> /usr/src/tty0tty-1.4
Sign command: /lib/modules/6.12.20+rpt-rpi-v8/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub
Deprecated feature: REMAKE_INITRD (/var/lib/dkms/tty0tty/1.4/source/dkms.conf)

Building module:
Cleaning build area...
'make' -j4 KVERSION=6.12.20+rpt-rpi-v8 KERNELDIR=/lib/modules/6.12.20+rpt-rpi-v8/build....
Signing module /var/lib/dkms/tty0tty/1.4/build/tty0tty.ko
Cleaning build area...
Deprecated feature: REMAKE_INITRD (/var/lib/dkms/tty0tty/1.4/source/dkms.conf)

tty0tty.ko.xz:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/6.12.20+rpt-rpi-v8/updates/dkms/
depmod....
Finished running dkms install steps.
echo "tty0tty" > /etc/modules-load.d/tty0tty.conf
cp 99-tty0tty.rules  /etc/udev/rules.d/
udevadm control --reload-rules && udevadm trigger
chown root:root /etc/udev/rules.d/99-tty0tty.rules
epsilonrt@rpi-bookworm-arm64:~/src/tty0tty/module $ sudo modprobe tty0tty
epsilonrt@rpi-bookworm-arm64:~/src/tty0tty/module $ sudo dmesg | tail
[...]
[30201.664164] tty0tty: loading out-of-tree module taints kernel.
[30201.668963] tty0tty null modem driver v1.4
epsilonrt@rpi-bookworm-arm64:~/src/tty0tty/module $ ls /dev/tnt*
/dev/tnt0  /dev/tnt1  /dev/tnt2  /dev/tnt3  /dev/tnt4  /dev/tnt5  /dev/tnt6  /dev/tnt7

It works!!

epsilonrt@rpi-bookworm-arm64:~/src/tty0tty/module $ uname -a
Linux rpi-bookworm-arm64 6.12.20+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.12.20-1+rpt1~bpo12+1 (2025-03-19) aarch64 GNU/Linux
epsilonrt@rpi-bookworm-arm64:~/src/tty0tty/module $ modinfo tty0tty
filename:       /lib/modules/6.12.20+rpt-rpi-v8/updates/dkms/tty0tty.ko.xz
license:        GPL
description:    tty0tty null modem driver
author:         Luis Claudio Gamboa Lopes <lcgamboa@yahoo.com>
srcversion:     C65C31D2ED5FD58973628A0
depends:
name:           tty0tty
vermagic:       6.12.20+rpt-rpi-v8 SMP preempt mod_unload modversions aarch64
sig_id:         PKCS#7
signer:         DKMS module signing key
sig_key:        6F:11:CE:4E:78:9F:15:76:4C:EF:26:2D:03:B4:11:D8:8C:A9:BE:1B
sig_hashalgo:   sha512
signature:      63:C1:54:78:B4:01:C5:5F:A3:84:B8:9B:36:C7:19:93:A5:98:FC:37:
                B6:23:BE:33:01:04:E5:C0:E4:0A:BB:70:C9:86:94:00:5F:69:D2:DA:
                9A:4D:40:9F:DF:54:3F:FF:B6:AA:D8:04:6D:D7:E0:40:66:CC:37:31:
                40:43:25:E3:A0:75:1E:3A:2D:22:B8:F2:42:A6:75:D7:37:42:27:44:
                DE:77:4F:76:6B:24:6A:00:01:43:AF:00:02:9B:F1:CA:E4:9B:01:53:
                0A:11:CF:8A:E0:63:EC:DD:BC:5A:A3:C8:E8:4F:4C:DC:B4:C4:E4:5A:
                90:F2:10:4B:EC:91:BF:C5:F1:04:91:24:88:E5:ED:EE:65:65:98:0D:
                50:8A:4A:7A:79:E5:C5:E5:36:37:3F:C1:F9:ED:67:42:BE:DB:5C:45:
                84:34:19:06:AD:C0:65:2D:71:18:0A:C0:F7:CE:AD:57:1B:42:B1:CA:
                7B:CD:57:CF:E1:00:EC:F4:A2:61:E3:8F:11:72:C6:87:5B:4B:26:8F:
                9D:E2:10:70:C4:9A:E5:AE:04:8C:BE:9C:6E:29:41:CC:66:72:A7:12:
                9F:26:DF:30:DF:97:9D:1D:F0:E6:F8:A2:47:59:80:0A:C1:47:6D:7D:
                5C:6A:C8:3F:C1:C2:6C:9F:1D:78:D6:CD:42:A6:10:07

However, the driver is signed, even though it's not on Armbian. Could that be the reason?
I'm a bit lost here, any help would be appreciated, thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions