No rule to make target 'scripts/module.lds' while building out-of-tree modules

Bug #1906131 reported by TJ on 2020-11-29
48
This bug affects 7 people
Affects Status Importance Assigned to Milestone
linux (Debian)
Fix Released
Unknown
linux (Ubuntu)
Undecided
Unassigned

Bug Description

kernel v5.10-rc1 introduced a change ( 596b0474d3d9 "kbuild: preprocess module linker script" ) that affects where and how scripts/module.lds is used and causes external modules to fail to build since that linker script is not shipped in the linux-{image,header} packages.

I've been testing the mainline PPA kernel v5.10-rc5 and today installed v4l2loopback-dkms and hit this issue.

It will affect all DKMS packages. Ubuntu carries 39 DKMS packages.

See the LKML discussion:

https://lkml.org/lkml/2020/8/31/455

DKMS make.log for v4l2loopback-0.12.3 for kernel 5.10.0-051000rc5-lowlatency (x86_64)
Sun 29 Nov 02:48:58 GMT 2020
Building v4l2-loopback driver...
make -C /lib/modules/5.10.0-051000rc5-lowlatency/build M=/var/lib/dkms/v4l2loopback/0.12.3/build modules
make[1]: Entering directory '/usr/src/linux-headers-5.10.0-051000rc5-lowlatency'
  CC [M] /var/lib/dkms/v4l2loopback/0.12.3/build/v4l2loopback.o
  MODPOST /var/lib/dkms/v4l2loopback/0.12.3/build/Module.symvers
make[3]: *** No rule to make target 'scripts/module.lds', needed by '/var/lib/dkms/v4l2loopback/0.12.3/build/v4l2loopback.ko'. Stop.
make[3]: *** Waiting for unfinished jobs....
  CC [M] /var/lib/dkms/v4l2loopback/0.12.3/build/v4l2loopback.mod.o
make[2]: *** [scripts/Makefile.modpost:117: __modpost] Error 2
make[1]: *** [Makefile:1703: modules] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.10.0-051000rc5-lowlatency'
make: *** [Makefile:43: v4l2loopback.ko] Error 2

TJ (tj) on 2020-11-29
description: updated
description: updated

This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:

apport-collect 1906131

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
TJ (tj) on 2020-11-30
Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Jags Desai (jagsdesai) wrote :
Download full text (13.1 KiB)

I too am getting the same error:

make[3]: *** No rule to make target 'scripts/module.lds', needed by '/var/lib/dkms/rtl88x2bu/git/build/88x2bu.ko'. Stop.,

while trying to install wireless drivers for (1) RTL88x2BU and (2) RTL8192EU for Kernel 5.10 RC6 on Ubuntu MATE 20.10

(1) Error and "make.log" for RTL88x2BU:

Building module fails on Kernel 5.10 RC6 in Ubuntu MATE Groovy 20.10 with the following error message:

````
root@um:/usr/src/rtl88x2bu-git# sed -i 's/PACKAGE_VERSION="@PKGVER@"/PACKAGE_VERSION="git"/g' /usr/src/rtl88x2bu-git/dkms.conf

root@um:/usr/src/rtl88x2bu-git# dkms add -m rtl88x2bu -v git

Creating symlink /var/lib/dkms/rtl88x2bu/git/source ->
                 /usr/src/rtl88x2bu-git

DKMS: add completed.

root@um:/usr/src/rtl88x2bu-git# dkms autoinstall

Kernel preparation unnecessary for this kernel. Skipping...

Building module:

cleaning build area...
'make' -j12 KVER=5.10.0-051000rc6-generic KSRC=/lib/modules/5.10.0-051000rc6-generic/build..............(bad exit status: 2)
Error! Bad return status for module build on kernel: 5.10.0-051000rc6-generic (x86_64)
Consult /var/lib/dkms/rtl88x2bu/git/build/make.log for more information.

root@um:/usr/src/rtl88x2bu-git#
````

/var/lib/dkms/rtl88x2bu/git/build/make.log

````
DKMS make.log for rtl88x2bu-git for kernel 5.10.0-051000rc6-generic (x86_64)

make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/5.10.0-051000rc6-generic/build M=/var/lib/dkms/rtl88x2bu/git/build modules

make[1]: Entering directory '/usr/src/linux-headers-5.10.0-051000rc6-generic'
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_cmd.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_security.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_debug.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_io.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_ioctl_query.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_ioctl_set.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_ieee80211.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_mlme.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_mlme_ext.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_mi.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_wlan_util.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_vht.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_pwrctrl.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_rf.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_chplan.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_recv.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_sta_mgt.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_ap.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/mesh/rtw_mesh.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/mesh/rtw_mesh_pathtbl.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/mesh/rtw_mesh_hwmp.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_xmit.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_p2p.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_rson.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_tdls.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_br_ext.o
  CC [M] /var/lib/dkms/rtl88x...

Jags Desai (jagsdesai) wrote :
Download full text (10.6 KiB)

(2) Error and "make.log" for RTL8192EU:

Building module fails on Kernel 5.10 RC6 in Ubuntu MATE Groovy 20.10 with the following error message:
````
admn@um:~/Downloads$ git clone https://github.com/Mange/rtl8192eu-linux-driver;

admn@um:~/Downloads$ cd rtl8192eu-linux-driver;

admn@um:~/Downloads/rtl8192eu-linux-driver$ sudo dkms add .;

Creating symlink /var/lib/dkms/rtl8192eu/1.0/source ->
                 /usr/src/rtl8192eu-1.0

DKMS: add completed.

admn@um:~/Downloads/rtl8192eu-linux-driver$ sudo dkms install rtl8192eu/1.0;

Kernel preparation unnecessary for this kernel. Skipping...

Building module:
cleaning build area...

'make' all KVER=5.10.0-051000rc6-generic................................................(bad exit status: 2)
Error! Bad return status for module build on kernel: 5.10.0-051000rc6-generic (x86_64)
Consult /var/lib/dkms/rtl8192eu/1.0/build/make.log for more information.

admn@um:~/Downloads/rtl8192eu-linux-driver$
````

/var/lib/dkms/rtl8192eu/1.0/build/make.log

````
DKMS make.log for rtl8192eu-1.0 for kernel 5.10.0-051000rc6-generic (x86_64)

make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/5.10.0-051000rc6-generic/build M=/var/lib/dkms/rtl8192eu/1.0/build modules

make[1]: Entering directory '/usr/src/linux-headers-5.10.0-051000rc6-generic'
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_cmd.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_security.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_debug.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_io.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_ioctl_query.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_ioctl_set.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_ieee80211.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_mlme.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_mlme_ext.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_mi.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_wlan_util.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_vht.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_pwrctrl.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_rf.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_chplan.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_recv.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_sta_mgt.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_ap.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/mesh/rtw_mesh.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/mesh/rtw_mesh_pathtbl.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/mesh/rtw_mesh_hwmp.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_xmit.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_p2p.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_rson.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_tdls.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_br_ext.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_iol.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_sreset.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_btcoex_wifionly.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_btcoex.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/...

Timo Aaltonen (tjaalton) wrote :

fixed since Ubuntu-5.10-5.10.0-2.3

d599f8f68c47774 UBUNTU: [Debian] Include scripts/module.lds from builddir in headers package

Changed in linux (Ubuntu):
status: Confirmed → Fix Released
kamiccolo (kamicc) wrote :

Still got similar issue even trying to install linux-modules-5.10.1-051001-generic:

Building module:
cleaning build area...
KVER=5.10.1-051001-generic make...(bad exit status: 2)
ERROR (dkms apport): kernel package linux-headers-5.10.1-051001-generic is not supported
Error! Bad return status for module build on kernel: 5.10.1-051001-generic (x86_64)
Consult /var/lib/dkms/fwts-efi-runtime-dkms/18.03.00/build/make.log for more information.
   ...done.

And relevant build log:

DKMS make.log for fwts-efi-runtime-dkms-18.03.00 for kernel 5.10.1-051001-generic (x86_64)
Sat Dec 19 06:24:24 EET 2020
make -C /lib/modules/5.10.1-051001-generic/build M=`pwd` modules
make[1]: Entering directory '/usr/src/linux-headers-5.10.1-051001-generic'
  CC [M] /var/lib/dkms/fwts-efi-runtime-dkms/18.03.00/build/efi_runtime.o
  MODPOST /var/lib/dkms/fwts-efi-runtime-dkms/18.03.00/build/Module.symvers
  CC [M] /var/lib/dkms/fwts-efi-runtime-dkms/18.03.00/build/efi_runtime.mod.o
make[3]: *** No rule to make target 'scripts/module.lds', needed by '/var/lib/dkms/fwts-efi-runtime-dkms/18.03.00/build/efi_runtime.ko'. Stop.
scripts/Makefile.modpost:117: recipe for target '__modpost' failed
make[2]: *** [__modpost] Error 2
Makefile:1709: recipe for target 'modules' failed
make[1]: *** [modules] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.10.1-051001-generic'
Makefile:23: recipe for target 'all' failed
make: *** [all] Error 2

Jags Desai (jagsdesai) wrote :
Download full text (10.1 KiB)

I too am getting errors with kernel 5.10.2 while building wireless driver modules:

/etc/kernel/header_postinst.d/dkms:
 * dkms: running auto installation service for kernel 5.10.2-051002-generic

Error-1 for RTL8192EU:

Kernel preparation unnecessary for this kernel. Skipping...

Building module:
cleaning build area...
'make' all KVER=5.10.2-051002-generic.................................................(bad exit status: 2)
Error! Bad return status for module build on kernel: 5.10.2-051002-generic (x86_64)
Consult /var/lib/dkms/rtl8192eu/1.0/build/make.log for more information.

Make.log:

DKMS make.log for rtl8192eu-1.0 for kernel 5.10.2-051002-generic (x86_64)

make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/5.10.2-051002-generic/build M=/var/lib/dkms/rtl8192eu/1.0/build modules

make[1]: Entering directory '/usr/src/linux-headers-5.10.2-051002-generic'
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_cmd.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_security.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_debug.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_io.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_ioctl_query.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_ioctl_set.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_ieee80211.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_mlme.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_mlme_ext.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_mi.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_wlan_util.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_vht.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_pwrctrl.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_rf.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_chplan.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_recv.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_sta_mgt.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_ap.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/mesh/rtw_mesh.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/mesh/rtw_mesh_pathtbl.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/mesh/rtw_mesh_hwmp.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_xmit.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_p2p.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_rson.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_tdls.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_br_ext.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_iol.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_sreset.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_btcoex_wifionly.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_btcoex.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_beamforming.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_odm.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_rm.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_rm_fsm.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/core/efuse/rtw_efuse.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/os_dep/osdep_service.o
  CC [M] /var/lib/dkms/rtl8192eu/1.0/build/os_dep/linux/os_intfs.o
  CC [M]...

Jags Desai (jagsdesai) wrote :
Download full text (12.2 KiB)

Error-2 for RTL88x2BU:

Kernel preparation unnecessary for this kernel. Skipping...

Building module:
cleaning build area...
'make' -j12 KVER=5.10.2-051002-generic KSRC=/lib/modules/5.10.2-051002-generic/build...............(bad exit status: 2)
Error! Bad return status for module build on kernel: 5.10.2-051002-generic (x86_64)
Consult /var/lib/dkms/rtl88x2bu/git/build/make.log for more information.

Make.log:

DKMS make.log for rtl88x2bu-git for kernel 5.10.2-051002-generic (x86_64)

make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/5.10.2-051002-generic/build M=/var/lib/dkms/rtl88x2bu/git/build modules

make[1]: Entering directory '/usr/src/linux-headers-5.10.2-051002-generic'
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_cmd.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_security.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_debug.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_io.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_ioctl_query.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_ioctl_set.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_ieee80211.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_mlme.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_mlme_ext.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_mi.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_wlan_util.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_vht.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_pwrctrl.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_rf.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_chplan.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_recv.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_sta_mgt.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_ap.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/mesh/rtw_mesh.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/mesh/rtw_mesh_pathtbl.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/mesh/rtw_mesh_hwmp.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_xmit.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_p2p.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_rson.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_tdls.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_br_ext.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_iol.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_sreset.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_btcoex_wifionly.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_btcoex.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_beamforming.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_odm.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_rm.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_rm_fsm.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_rm_util.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/efuse/rtw_efuse.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/os_dep/osdep_service.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/os_dep/linux/os_intfs.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/os_dep/linux/usb_intf.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/os_dep/linux/usb_...

Jags Desai (jagsdesai) wrote :

If anyone come across this looking for a workaround, here's a quick fix I've found on a GitHub repo for RTL8192EU

https://github.com/Mange/rtl8192eu-linux-driver/issues/205#issuecomment-736366347

sudo wget https://raw.githubusercontent.com/torvalds/linux/master/scripts/module.lds.S -O /usr/src/linux-headers-5.10.2-051002-generic/scripts/module.lds

sudo sed -i '$ d' /usr/src/linux-headers-5.10.2-051002-generic/scripts/module.lds

I had already reported this as bug 1906072 two days before this bug was opened.

But I guess since this is where the activity happens, someone should mark my bug as duplicate of this.

I'm still getting this error on https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.10.3/ - using the workaround mentioned in comment #8 seems to work.

kamiccolo (kamicc) wrote :

Interestingly, it wasn't the issue with 5.10.0-rc5.

Jags Desai (jagsdesai) wrote :
Download full text (12.3 KiB)

Still getting errors with kernel 5.11 RC2 while building wireless driver modules.

Though the quick fix still works as detailed in comment #8:

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1906131/comments/8

Error:

'make' -j12 KVER=5.11.0-051100rc2-generic KSRC=/lib/modules/5.11.0-051100rc2-generic/build...............(bad exit status: 2)
Error! Bad return status for module build on kernel: 5.11.0-051100rc2-generic (x86_64)
Consult /var/lib/dkms/rtl88x2bu/git/build/make.log for more information.
   ...done.

Make.log:

DKMS make.log for rtl88x2bu-git for kernel 5.11.0-051100rc2-generic (x86_64)

make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/5.11.0-051100rc2-generic/build M=/var/lib/dkms/rtl88x2bu/git/build modules

make[1]: Entering directory '/usr/src/linux-headers-5.11.0-051100rc2-generic'
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_cmd.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_security.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_debug.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_io.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_ioctl_query.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_ioctl_set.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_ieee80211.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_mlme.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_mlme_ext.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_mi.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_wlan_util.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_vht.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_pwrctrl.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_rf.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_chplan.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_recv.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_sta_mgt.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_ap.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/mesh/rtw_mesh.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/mesh/rtw_mesh_pathtbl.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/mesh/rtw_mesh_hwmp.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_xmit.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_p2p.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_rson.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_tdls.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_br_ext.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_iol.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_sreset.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_btcoex_wifionly.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_btcoex.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_beamforming.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_odm.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_rm.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_rm_fsm.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/rtw_rm_util.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/core/efuse/rtw_efuse.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/os_dep/osdep_service.o
  CC [M] /var/lib/dkms/rtl88x2bu/git/build/os_dep/linux/os_intfs.o
...

Nguyen Khanh Long (longengie) wrote :

Got this issue when update Ubuntu kernel to 5.10.7-051007 and got this problem when install rtl8821ce driver.
Seem like new Debian kernel including 5.10 > 5.11 trying to change module.lsb to module.lsb.S but the dkms cannot read the S file extension and trying to grab the lsb file and that where the problem occur.

So here the solution that I use to fix this issue. Go to usr/src/linux-headers-[KERNEL-VERSION]-generic/scripts and copy module.lsb.S, remove the include line, and save it as module.lsb then run dkms again. These file will change for kernel version so you have to do it yourself.

The file that I attached here is for 5.10 kernel, if you're in 5.10, you can use this module. Maybe I will create the issue in DKMS.

Download full text (4.3 KiB)

This is happening to my NVIDIA module build with kernel 5.10.12 as well.

root@jaxel:~# dpkg-reconfigure nvidia-dkms-460
Removing all DKMS Modules
Done.
update-initramfs: deferring update (trigger activated)
update-initramfs: Generating /boot/initrd.img-5.9.16-050916-generic
INFO:Enable nvidia
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/dell_latitude
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/lenovo_thinkpad
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/put_your_quirks_here
Loading new nvidia-460.39 DKMS files...
Building for 5.9.16-050916-generic 5.10.12-051012-generic
Building for architecture x86_64
Building initial module for 5.9.16-050916-generic
Secure Boot not enabled on this system.
Done.

nvidia.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.9.16-050916-generic/updates/dkms/

nvidia-modeset.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.9.16-050916-generic/updates/dkms/

nvidia-drm.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.9.16-050916-generic/updates/dkms/

nvidia-uvm.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.9.16-050916-generic/updates/dkms/

depmod...

DKMS: install completed.
Building initial module for 5.10.12-051012-generic
ERROR (dkms apport): kernel package linux-headers-5.10.12-051012-generic is not supported
Error! Bad return status for module build on kernel: 5.10.12-051012-generic (x86_64)
Consult /var/lib/dkms/nvidia/460.39/build/make.log for more information.

--- /var/lib/dkms/nvidia/460.39/build/make.log

make -f ./scripts/Makefile.modpost
  sed 's/ko$/o/' /var/lib/dkms/nvidia/460.39/build/modules.order | scripts/mod/modpost -a -o /var/lib/dkms/nvidia/460.39/build/Module.symvers -e -i Module.symvers -T -
make -f ./scripts/Makefile.modfinal
make[3]: *** No rule to make target 'scripts/module.lds', needed by '/var/lib/dkms/nvidia/460.39/build/nvidia-drm.ko'. Stop.
make[3]: *** Waiting for unfinished jobs....
  cc -Wp,-MMD,/var/lib/dkms/nvidia/460.39/build/.nvidia-drm.mod.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-linux-gnu/9/include -I./arch/x86/include -I./arch/x86/include/generated -I./include -I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ -fmacro-prefix-map=./= -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Wno-format-security -std=gnu89 -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -mtune=generic -mno-red-zone -mcmodel=kernel ...

Read more...

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1906131

This is NOT_A_BUG , just a new feature starting from the kernels 5.10.0 onwards.

The patch which made this mess is the following:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/Makefile?id=746b25b1aa0f5736d585728ded70a8141da91edb

Please, read the following net pointer how to handle the patch:
https://www.kernel.org/doc/Documentation/kbuild/modules.txt

For the practical implementation, please, read the following net pointer (answer 2):
https://stackoverflow.com/questions/65972180/im-unable-to-build-the-simple-hello-world-kernel-module-from-kernel-5-10-11/65979628#65979628

Zee

Here is practical explanation how to add this feature to the kernel modules (modules_prepare) compilation/configuration:

https://github.com/ZoranStojsavljevic/BeagleBoard-Workshop-Examples/commit/6b91400a2fdc9c12c835ef0ecbc9f978e978f9c9#diff-786dbb456[…]80c6cb99c03R142

Zee

Changed in linux (Debian):
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.