On Mon, May 17, 2004 at 01:23:48AM +0200, Ralf Kleemann wrote:
Hallo,
wenn ich isdn_lzscomp kompilieren will bekomme ich die folgende
Fehlermeldung:
linux:/usr/src/kernel-modules/ipppcomp # ls -l
-rw-r--r-- 1 root root 54685 2002-02-25 02:04 isdn_lzscomp.c
-rw-r--r-- 1 root root 925 1998-10-16 14:37 isdn_lzscomp.h
-rw-r--r-- 1 root root 1256 2004-04-05 19:14 Makefile
-rw-r--r-- 1 root root 577 2004-04-05 19:14 Makefile.module
-rw-r--r-- 1 root root 8947 1999-06-21 15:28 README.LZS
linux:/usr/src/kernel-modules/ipppcomp # make
/usr/src/linux/Makefile:399: .config: Datei oder Verzeichnis nicht gefunden
/usr/src/linux/Makefile:415:
/usr/src/kernel-modules/ipppcomp/arch/i386/Makefile: Datei oder
Verzeichnis nicht gefunden
make: *** Keine Regel, um
»/usr/src/kernel-modules/ipppcomp/arch/i386/Makefile« zu erstellen.
Schluss.
Weiß jemand was ich dabei falsch mache?
Nichts dieser Source ist noch nicht für 2.6 kernel angepasst.
Folgender patch macht das, ist aber ansonsten ungetestet.
--- ipppcomp.old/isdn_lzscomp.c 2002-02-25 02:04:55.000000000 +0100
+++ ipppcomp/isdn_lzscomp.c 2004-05-17 11:06:52.372479370 +0200
@@ -34,7 +34,7 @@
*/
#include
-
+#include
#include
#include
#include
@@ -665,7 +665,9 @@
s->cmode = cmode;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
MOD_INC_USE_COUNT;
+#endif
return s;
}
@@ -684,7 +686,9 @@
printk(KERN_DEBUG "lzsFree: freeing state\n");
kfree(s);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
MOD_DEC_USE_COUNT;
+#endif
}
}
@@ -1912,16 +1916,16 @@
*/
static struct isdn_ppp_compressor ippp_lzs_compress = {
- NULL,NULL, /* prev,next: overwritten by isdn_ppp */
- CI_LZS_COMPRESS, /* CCP proto for PPP */
- lzsAlloc, /* Alloc new state */
- lzsFree, /* Drop state */
- lzsInit, /* Initialize state */
- lzsReset, /* Reset state */
- lzsCompress, /* Do the shrink */
- lzsDecompress, /* Do the other thing */
- lzsIncomp, /* Handle incompressible frame */
- lzsStats /* Get stats */
+ .owner = THIS_MODULE,
+ .num = CI_LZS_COMPRESS, /* CCP proto for PPP */
+ .alloc = lzsAlloc, /* Alloc new state */
+ .free = lzsFree, /* Drop state */
+ .init = lzsInit, /* Initialize state */
+ .reset = lzsReset, /* Reset state */
+ .compress = lzsCompress, /* Do the shrink */
+ .decompress = lzsDecompress, /* Do the other thing */
+ .incomp = lzsIncomp, /* Handle incompressible frame */
+ .stat = lzsStats, /* Get stats */
};
/*
--- ipppcomp.old/Makefile 2002-11-02 01:21:03.000000000 +0100
+++ ipppcomp/Makefile 2004-05-17 10:42:58.741760313 +0200
@@ -1,47 +1,19 @@
-# ipppcomp slave Makefile
-# (c) 03/2001 Karsten Keil
-# adapted from Kurt Garloffs SecuMod package
-KDIR = /usr/src/linux
-
-DESTDIR =
-TARGET = isdn_lzscomp.o
-TARGETS := Rules.make arch $(TARGET)
-TARGET_BASE = isdn_lzscomp
-TARGETMODDIR = misc
-
-default: $(TARGETS)
-
-all: $(TARGETS)
-
-isdn_lzscomp: isdn_lzscomp.o
-
-Rules.make: $(KDIR)/Rules.make
- cp -pf $(KDIR)/Rules.make .
-
-arch: $(KDIR)/arch
- rm -f arch
- ln -s $(KDIR)/arch .
-
-TOPDIR := $(KDIR)
-include $(KDIR)/.config
-include $(KDIR)/Makefile
-TOPDIR := $(KDIR)
+ifneq ($(KERNELRELEASE),)
-CFLAGS := -I. -I $(KDIR)/include $(CFLAGS) -DMODULE -DLINUX
+obj-m := isdn_lzscomp.o
-ifdef CONFIG_MODVERSIONS
-CFLAGS += -DMODVERSIONS -include $(KDIR)/include/linux/modversions.h
-endif
+else
+
+KERNELRELEASE = $(shell uname -r)
+KERNEL_SOURCE := /lib/modules/$(KERNELRELEASE)/build
+PWD := $(shell pwd)
+
+all: modules
-isdn_lzscomp.o: isdn_lzscomp.c *.h $(KDIR)/include/linux/version.h arch Rules.make
+modules:
+ $(MAKE) -C $(KERNEL_SOURCE) SUBDIRS=$(PWD) modules
-MODLIB := $(DESTDIR)$(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE)
-
-install: install_mod
-
-install_mod: $(MODLIB)/$(TARGETMODDIR)/$(TARGET)
-
-$(MODLIB)/$(TARGETMODDIR)/$(TARGET): $(TARGET)
- echo "Install $(TARGET)"; install -o root -g root -d $(MODLIB)/$(TARGETMODDIR); \
- install -o root -g root -m 0644 $(TARGET) $(MODLIB)/$(TARGETMODDIR)/; \
- #echo "depmod -a $(KERNELRELEASE)"; depmod -a $(KERNELRELEASE); \
+install:
+ $(MAKE) -C $(KERNEL_SOURCE) SUBDIRS=$(PWD) modules_add
+
+endif
--
Karsten Keil
SuSE Labs
ISDN development