Article 5Q1G8 [SOLVED] kernel module error when updating from lubuntu to mint

[SOLVED] kernel module error when updating from lubuntu to mint

by
knobby67
from LinuxQuestions.org on (#5Q1G8)
Hi All,
I've just updated from Lunbuntu to Mint. I'm trying to compile a .ko module that has worked for years on Lubuntu but won't on Mint 20. I have all build essentials and the linux headers install. I have to use sudo as linux headers give permission denied if I don't. I use the command I've used for years.

sudo make -C /usr/src/linux-headers-5.4.0-86-generic SUBDIRS=`pwd` modules

this give the following errors
make: Entering directory '/usr/src/linux-headers-5.4.0-86-generic'
make[1]: *** No rule to make target 'arch/x86/tools/relocs_32.c', needed by 'arch/x86/tools/relocs_32.o'. Stop.
make: *** [arch/x86/Makefile:236: archscripts] Error 2
make: Leaving directory '/usr/src/linux-headers-5.4.0-86-generic'


A google search says it's because sudo doesn't have pwd and the answer is to try

sudo make -C /usr/src/linux-headers-5.4.0-86-generic M=$(shell pwd) modules

this gives
Command 'shell' not found, did you mean:

I've also seen a couple of variations on this with CURDIR, tried these and get

sudo make -C /usr/src/linux-headers-5.4.0-86-generic M=$(CURDIR) modules

CURDIR: command not found
make: Entering directory '/usr/src/linux-headers-5.4.0-86-generic'
make[1]: *** No rule to make target 'arch/x86/tools/relocs_32.c', needed by 'arch/x86/tools/relocs_32.o'. Stop.
make: *** [arch/x86/Makefile:236: archscripts] Error 2
make: Leaving directory '/usr/src/linux-headers-5.4.0-86-generic


Can anyone what command I need to use with Mint or what I need to add to get it to compile? Thankslatest?d=yIl2AUoC8zA latest?i=ur4mq4JHqJ0:CUTT_gb0rVI:F7zBnMy latest?i=ur4mq4JHqJ0:CUTT_gb0rVI:V_sGLiP latest?d=qj6IDK7rITs latest?i=ur4mq4JHqJ0:CUTT_gb0rVI:gIN9vFwur4mq4JHqJ0
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments