Page 1 of 1
how to compile kernel modules for 4.0 Dingo?
Posted: Thu 30 Apr 2009, 17:45
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.
Posted: Thu 30 Apr 2009, 18:45
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
Posted: Thu 30 Apr 2009, 19:01
by jamesjeffries2
@MU - what would happen if you were to use a different kernel source?
Posted: Thu 30 Apr 2009, 19:04
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
Thanks
Posted: Thu 30 Apr 2009, 21:45
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?
Posted: Thu 30 Apr 2009, 21:54
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
getting closer...
Posted: Fri 01 May 2009, 02:56
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.