--- zaptel-1.0.10/Makefile.orig 2005-11-04 06:03:38.000000000 +0100 +++ zaptel-1.0.10/Makefile 2005-11-22 19:14:05.000000000 +0100 @@ -15,13 +15,13 @@ HOSTCC=gcc # If you want to build for a kernel other than the current kernel,set KVERS KVERS?=`uname -r` -KINCLUDES=$(shell if [ -d /usr/src/linux-2.4/include ]; then echo /usr/src/linux-2.4/include ; else echo /usr/src/linux/include ; fi) +KINCLUDES=/usr/src/linux/include -CFLAGS+=-I. -O4 -g -Wall -DBUILDING_TONEZONE #-DTONEZONE_DRIVER +CFLAGS+=-I. -g -Wall -DBUILDING_TONEZONE #-DTONEZONE_DRIVER CFLAGS+=$(shell if uname -m | grep -q ppc; then echo "-fsigned-char"; fi) CFLAGS+=$(shell if uname -m | grep -q x86_64; then echo "-m64"; fi) LCFLAGS=-fPIC $(CFLAGS) -DBUILDING_TONEZONE -KFLAGS+=-I/usr/src/linux-2.4/include -O6 +KFLAGS+=-I/usr/src/linux/include -O6 KFLAGS+=-DMODULE -D__KERNEL__ -DEXPORT_SYMTAB -I/usr/src/linux/drivers/net \ -Wall -I. -Wstrict-prototypes -fomit-frame-pointer -I/usr/src/linux/drivers/net/wan -I /usr/src/linux/include -I/usr/src/linux/include/net KFLAGS+=$(shell if [ -f $(KINCLUDES)/linux/modversions.h ] ; then echo "-DMODVERSIONS -include $(KINCLUDES)/linux/modversions.h" ; fi) @@ -41,7 +41,7 @@ CFLAGS+=-DZAPTEL_CONFIG=\"$(CONFIG_FILE)\" BUILDVER=$(shell if echo -n $(KVERS) | grep -q ^2.6; then echo "linux26"; else echo "linux24"; fi) -MODCONF=$(shell if [ -d $(ROOT_PREFIX)/etc/modprobe.d ]; then echo "$(ROOT_PREFIX)/etc/modprobe.d/zaptel"; elif [ -d $(ROOT_PREFIX)/etc/modutils ]; then echo "$(ROOT_PREFIX)/etc/modutils/zaptel"; elif [ -f $(ROOT_PREFIX)/etc/modprobe.conf ]; then echo "$(ROOT_PREFIX)/etc/modprobe.conf"; elif [ -f $(ROOT_PREFIX)/etc/modules.conf ]; then echo "$(ROOT_PREFIX)/etc/modules.conf"; else echo $(ROOT_PREFIX)/etc/conf.modules ; fi) +MODCONF=$(INSTALL_PREFIX)/etc/modules.d/zaptel ifeq (${BUILDVER},linux24) #We only support DEVFS in linux 2.4 kernels, since its considered obsolete post 2.4 @@ -60,7 +60,7 @@ TZOBJS=zonedata.lo tonezone.lo LIBTONEZONE=libtonezone.so.1.0 MODULES=zaptel tor2 torisa wcusb wcfxo wcfxs \ - ztdynamic ztd-eth wct1xxp wct4xxp wcte11xp # ztdummy + ztdynamic ztd-eth wct1xxp wct4xxp wcte11xp ztdummy #MODULES+=wcfxsusb MODULESO=$(shell for x in $(MODULES); do echo "$$x.o "; done ) @@ -264,7 +264,7 @@ @echo "**** If you are running udev, read README.udev" endif -install: all devices +install: devices install -D -m 755 ztcfg $(INSTALL_PREFIX)/sbin/ztcfg if [ -f sethdlc-new ]; then \ install -D -m 755 sethdlc-new $(INSTALL_PREFIX)/sbin/sethdlc; \ @@ -288,45 +288,24 @@ fi; \ fi install -D -m 755 $(LIBTONEZONE) $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE) - if [ -x /usr/sbin/sestatus ] && (/usr/sbin/sestatus | grep "SELinux status:" | grep -q "enabled") ; then restorecon -v $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE); fi install -D -m 644 zaptel.h $(INSTALL_PREFIX)/usr/include/linux/zaptel.h install -D -m 644 torisa.h $(INSTALL_PREFIX)/usr/include/linux/torisa.h install -D -m 644 tonezone.h $(INSTALL_PREFIX)/usr/include/tonezone.h ( cd $(INSTALL_PREFIX)/usr/lib ; rm -f libtonezone.so ; ln -sf $(LIBTONEZONE) libtonezone.so ) - [ `id -u` = 0 ] && /sbin/ldconfig || : - if [ -f $(MODCONF) ]; then mv -f $(MODCONF) $(MODCONF).bak ; fi - cat $(MODCONF).bak | grep -v "alias char-major-250" | \ - grep -v "post-install torisa /sbin/ztcfg" | \ - grep -v "post-install wcfxsusb /sbin/ztcfg" | \ - grep -v "alias wcfxs" | \ - grep -v "post-install wcfxs /sbin/ztcfg" > $(MODCONF) || true + if [ ! -d `dirname $(MODCONF)` ]; then install -d -m 755 `dirname $(MODCONF)` ; fi + /sbin/ldconfig -n $(INSTALL_PREFIX)/usr/lib if ! grep "options torisa" $(MODCONF); then \ echo "options torisa base=$(BASEADDR)" >> $(MODCONF); \ fi if ! grep "alias char-major-196" $(MODCONF); then \ echo "alias char-major-196 $(PRIMARY)" >> $(MODCONF); \ fi - for x in $(MODULES); do \ - if ! grep "post-install $$x" $(MODCONF); then \ - if ! grep "install $$x " $(MODCONF); then \ - if [ "$$x" != "zaptel" ] ; then \ - if [ -f zaptel.ko ]; then echo "install $$x /sbin/modprobe --ignore-install $$x && /sbin/ztcfg" >> $(MODCONF); \ - else echo "post-install $$x /sbin/ztcfg" >> $(MODCONF); \ - fi; \ - fi; \ - fi; \ - fi; \ - done if ! grep "alias wctdm" $(MODCONF); then \ echo "alias wctdm wcfxs" >> $(MODCONF); \ fi if ! grep "alias wct2xxp" $(MODCONF); then \ echo "alias wct2xxp wct4xxp" >> $(MODCONF); \ fi - if [ -d /etc/modutils ]; then \ - /sbin/update-modules ; \ - fi - [ `id -u` = 0 ] && /sbin/depmod -a $(KVERS) || : [ -f $(CONFIG_FILE) ] || install -D -m 644 zaptel.conf.sample $(CONFIG_FILE) config: --- zaptel-1.0.10/Makefile.orig 2005-11-22 19:22:28.000000000 +0100 +++ zaptel-1.0.10/Makefile 2005-11-22 19:23:34.000000000 +0100 @@ -49,7 +49,7 @@ endif ifeq (${BUILDVER},linux26) #Tests for newer linux-2.6 udev support -DYNFS=$(shell ps ax | grep -v grep | grep udevd && echo "yes") +DYNFS=$(shell ps ax | grep -v grep | grep -q "udevd\|devfsd" && echo "yes") endif CHKCONFIG=$(shell sh -c 'type -p chkconfig' 2> /dev/null) --- zaptel-1.0.10/Makefile.orig 2005-11-22 19:40:18.000000000 +0100 +++ zaptel-1.0.10/Makefile 2005-11-22 19:41:01.000000000 +0100 @@ -200,7 +200,7 @@ $(LIBTONEZONE): $(TZOBJS) $(CC) -shared -Wl,-soname,libtonezone.so.1 -lm -o $@ $(TZOBJS) - [ `id -u` = 0 ] && /sbin/ldconfig || : + /sbin/ldconfig -n . ln -sf libtonezone.so.1 libtonezone.so ztcfg.c: ztcfg.h