You are not logged in.

#1 2011-05-27 02:01:58

piezoelectric
Member
Registered: 2009-09-08
Posts: 48

howto? build a module from clean source against kernel26-headers

I'm trying to create a package for a patched psmouse kernel module. (https://aur.archlinux.org/packages.php?ID=49284). However, I can't quite get the module built correctly.

I'm trying various make options like -C $KDIR, M=,.... and various make targets like prepare, modules_pepare, and explicitly giving a module.

Forgetting about the patch for a moment? How am I supposed to do this? I thought something like:

make -C /usr/src/linux-$(uname -r) M=drivers/input/mouse psmouse.ko

would work, but I think it's trying to write to the headers directory.


Thanks for any help.

Offline

#2 2011-05-28 13:50:34

vadmium
Member
Registered: 2010-11-02
Posts: 63

Re: howto? build a module from clean source against kernel26-headers

What’s the error in particular? Are you trying to build the module source code from inside the kernel tree or separately? Look for similar module packages for examples?

If you’re trying to do an external build, perhaps try giving the absolute path in your M=drivers/input/mouse parameter; otherwise the -C option tells Make to change directory and it forgets what the original directory was.

I have an external module with me that has its own Make file and calls the kernel’s Make files with this if it’s any help:

make -C $(KDIR) SUBDIRS=$(PWD) modules

Offline

#3 2011-05-28 16:28:50

piezoelectric
Member
Registered: 2009-09-08
Posts: 48

Re: howto? build a module from clean source against kernel26-headers

I'll give that a try. I actually just got it working by rsync'ing the kernel26-headers files over the clean source I downloaded from kernel.org, but I get the feeling there is a better way than this.

Offline

#4 2011-05-28 16:52:19

piezoelectric
Member
Registered: 2009-09-08
Posts: 48

Re: howto? build a module from clean source against kernel26-headers

So, that appears to be part of the secret

KDIR=/usr/src/linux-$_kver-$_kname
SDIR=$srcdir/linux-$_kver/drivers/input/mouse
make -C $KDIR M=$SDIR psmouse.ko

solves the readonly problem. But it uses the Kconfig from KDIR and I need to use the Kconfig from SDIR because that is modified also.

Last edited by piezoelectric (2011-05-28 17:03:38)

Offline

#5 2011-05-29 01:45:39

vadmium
Member
Registered: 2010-11-02
Posts: 63

Re: howto? build a module from clean source against kernel26-headers

Maybe try make O=/absolute/directory or make KCONFIG_CONFIG=/absolute/path. I’m just guessing though by running “make help” and looking through the Make file on my kernel.

Offline

Board footer

Powered by FluxBB