how to compile kernel modules for 4.0 Dingo?

Stuff that has yet to be sorted into a category.
Post Reply
Message
Author
maddmike
Posts: 14
Joined: Tue 17 Jun 2008, 20:03

how to compile kernel modules for 4.0 Dingo?

#1 Post by maddmike »

I'm trying to compile additional kernel modules (Panasonic ACPI hotkey driver). The output should be pcc-acpi.ko. make is looking for how to build "modules" in the /lib/modules/2.6.../build directory. The build directory doesn't exist in my puppy (which has devx_400.sfs)

Here is the Makefile:

Code: Select all

ifneq ($(KERNELRELEASE),)

obj-m := pcc_acpi.o

else

obj-m := pcc_acpi.o

KVER  := $(shell uname -r)

KDIR := /lib/modules/$(KVER)/build
MDIR := /lib/modules/$(KVER)/kernel/drivers/acpi/
PWD := $(shell pwd)

default:
	$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules

install:
	install -d $(MDIR)
	install -m 644 -c $(obj-m:.o=.ko) $(MDIR)
	depmod -a

clean:
	rm -rf *.mod.c *.o *.ko .tmp_versions .$(obj-m:.o=)*

endif
What do I need to do to enable compiling the new kernel module?
Thanks.

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#2 Post by MU »

download the matching kernel source sfs, and add it in the bootmanager.
http://ftp.nluug.nl/ftp/pub/os/Linux/di ... modules-4/

After reboot, create a symlink like:

ln -s /usr/src/linux-2.6.25.16 /lib/modules/2.6.25.16/build

Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

jamesjeffries2
Posts: 196
Joined: Mon 28 Apr 2008, 00:50

#3 Post by jamesjeffries2 »

@MU - what would happen if you were to use a different kernel source?

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#4 Post by MU »

It might compile, but when you try to
modprobe themodule
you usually get an error about unresolved symbols, so it would not work.

Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

maddmike
Posts: 14
Joined: Tue 17 Jun 2008, 20:03

Thanks

#5 Post by maddmike »

Thanks for the quick reply.

Can I use

kernel-src-2.6.21.7-patched-puppy4.1retro.sfs

with the 2.6.21.7 kernel in puppy 4.0? Or do I need to upgrade to 4.1?

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#6 Post by MU »

I don't exactly remember, if there were changes in the config from 4.0 to 4.1, but I think you can use it.
I think there would be another one, if there were changes. But I can't guarantee it.
Give it a try!
Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

maddmike
Posts: 14
Joined: Tue 17 Jun 2008, 20:03

getting closer...

#7 Post by maddmike »

Installing the kernel source as you suggested seems to work. It compiles OK. But installing doesn't completely work:

Code: Select all

make -C /lib/modules/2.6.21.7/build M=/root/pcc-acpi-0.9-hy20081212 INSTALL_MOD_DIR=kernel/drivers/acpi modules_install
make[1]: Entering directory `/usr/src/linux-2.6.21.7'
  INSTALL /root/pcc-acpi-0.9-hy20081212/pcc_acpi.ko
  INSTALL /root/pcc-acpi-0.9-hy20081212/pcc_acpi_cd.ko
  DEPMOD  2.6.21.7
WARNING: /lib/modules/2.6.21.7/initrd/kernel/fs/unionfs/unionfs.ko needs unknown symbol drop_pagecache_sb
WARNING: /lib/modules/2.6.21.7/kernel/drivers/acpi/pcc_acpi.ko needs unknown symbol input_set_drvdata
WARNING: /lib/modules/2.6.21.7/kernel/drivers/acpi/pcc_acpi.ko needs unknown symbol input_get_drvdata
WARNING: /lib/modules/2.6.21.7/kernel/drivers/acpi/pcc_acpi.ko needs unknown symbol acpi_bus_generate_proc_event
WARNING: /lib/modules/2.6.21.7/kernel/net/netfilter/xt_hashlimit.ko needs unknown symbol ipv6_find_hdr
when I modprobe pcc-acpi, I get a fatal error: invalid module format.

I'm also wondering if I should be concerned about the warning for unionfs.ko needing an unknown symbol.

Post Reply