--- zaptel-1.2.2/Makefile.orig 2006-01-19 00:04:48.000000000 +0100 +++ zaptel-1.2.2/Makefile 2006-01-19 00:09:24.000000000 +0100 @@ -21,7 +21,7 @@ endif KINCLUDES:=$(KSRC)/include -CFLAGS+=-I. -O4 -g -Wall -DBUILDING_TONEZONE #-DTONEZONE_DRIVER +CFLAGS+=-I. -g -Wall -DBUILDING_TONEZONE #-DTONEZONE_DRIVER CFLAGS_PPC:=$(shell if uname -m | grep -q ppc; then echo "-fsigned-char"; fi) CFLAGS_X86-64:=$(shell if uname -m | grep -q x86_64; then echo "-m64"; fi) CFLAGS+=$(CFLAGS_PPC) $(CFLAGS_X86-64) @@ -55,31 +55,7 @@ BUILDVER:=linux24 endif -ifeq ($(BUILDVER),linux26) - ifneq (,$(wildcard $(ROOT_PREFIX)/etc/modprobe.d)) - MODCONF:=$(ROOT_PREFIX)/etc/modprobe.d/zaptel - else - ifneq (,$(wildcard $(ROOT_PREFIX)/etc/modules.d)) - MODCONF:=$(ROOT_PREFIX)/etc/modules.d/zaptel - else - ifneq (,$(wildcard $(ROOT_PREFIX)/etc/modprobe.conf)) - MODCONF:=$(ROOT_PREFIX)/etc/modprobe.conf - else - ifneq (,$(wildcard $(ROOT_PREFIX)/etc/conf.modules)) - MODCONF:=$(ROOT_PREFIX)/etc/conf.modules - endif - endif - endif - endif -else # BUILDVER == linux24 - ifneq (,$(wildcard $(ROOT_PREFIX)/etc/modutils)) - MODCONF:=$(ROOT_PREFIX)/etc/modutils/zaptel - else - ifneq (,$(wildcard $(ROOT_PREFIX)/etc/modules.conf)) - MODCONF:=$(ROOT_PREFIX)/etc/modules.conf - endif - endif -endif +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 @@ -87,8 +63,8 @@ endif ifeq (${BUILDVER},linux26) + DYNFS:=$(shell ps ax | grep -v grep | grep -q "devfsd\|udevd" && echo "yes") ifneq (,$(wildcard $(ROOT_PREFIX)/etc/udev/rules.d)) - DYNFS=yes UDEVRULES=yes ifneq (,$(wildcard $(ROOT_PREFIX)/etc/udev/permissions.d)) UDEVPERMISSIONS=yes @@ -328,17 +304,17 @@ else # DYNFS ifdef UDEVRULES ifdef UDEVPERMISSIONS - install -m 444 udev/zaptel.rules $(INSTALL_PREFIX)/etc/udev/rules.d - install -m 444 udev/zaptel.permissions $(INSTALL_PREFIX)/etc/udev/permissions.d + install -D -m 444 udev/zaptel.rules $(INSTALL_PREFIX)/etc/udev/rules.d/10-zaptel.rules + install -D -m 444 udev/zaptel.permissions $(INSTALL_PREFIX)/etc/udev/permissions.d/10-zaptel.permissions else # !UDEVPERMISSIONS (newer, combined syntax) - install -m 444 udev/zaptel.rules-combined $(INSTALL_PREFIX)/etc/udev/rules.d/zaptel.rules + install -D -m 444 udev/zaptel.rules-combined $(INSTALL_PREFIX)/etc/udev/rules.d/10-zaptel.rules endif else # !UDEVRULES @echo "**** Dynamic filesystem detected -- not creating device nodes" endif 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; \ @@ -365,42 +341,25 @@ rm -f $(INSTALL_PREFIX)/lib/modules/$(KVERS)/misc/wcfxs.o; \ fi install -D -m 755 $(LIBTONEZONE_SO) $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER).$(LIBTONEZONE_SO_MINOR_VER) - [ `id -u` = 0 ] && /sbin/ldconfig || : + [ `id -u` = 0 ] && /sbin/ldconfig -n $(INSTALL_PREFIX)/usr/lib || : rm -f $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO) ln -sf $(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER).$(LIBTONEZONE_SO_MINOR_VER) \ $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER) ln -sf $(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER).$(LIBTONEZONE_SO_MINOR_VER) \ $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO) - if [ -x /usr/sbin/sestatus ] && (/usr/sbin/sestatus | grep "SELinux status:" | grep -q "enabled") ; then restorecon -v $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO); 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 - install -m 644 doc/ztcfg.8 $(INSTALL_PREFIX)/usr/share/man/man8 - install -m 644 doc/zttool.8 $(INSTALL_PREFIX)/usr/share/man/man8 + install -D -m 644 doc/ztcfg.8 $(INSTALL_PREFIX)/usr/share/man/man8/ztcfg.8 + install -D -m 644 doc/zttool.8 $(INSTALL_PREFIX)/usr/share/man/man8/zttool.8 + if [ ! -d `dirname $(MODCONF)` ]; then install -d -m 755 `dirname $(MODCONF)` ; fi if [ -n "$(MODCONF)" ]; then \ - 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 wctdm" | \ - grep -v "post-install wctdm /sbin/ztcfg" > $(MODCONF); \ 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 -q "post-install $$x" $(MODCONF); then \ - if ! grep -q "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 "ias wcfxs" $(MODCONF); then \ echo "alias wcfxs wctdm" >> $(MODCONF); \ fi; \ @@ -408,19 +367,15 @@ echo "alias wct2xxp wct4xxp" >> $(MODCONF); \ fi; \ 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) install-udev: ifdef UDEVRULES ifdef UDEVPERMISSIONS - install -m 444 udev/zaptel.rules $(INSTALL_PREFIX)/etc/udev/rules.d - install -m 444 udev/zaptel.permissions $(INSTALL_PREFIX)/etc/udev/permissions.d + install -D -m 444 udev/zaptel.rules $(INSTALL_PREFIX)/etc/udev/rules.d/10-zaptel.rules + install -D -m 444 udev/zaptel.permissions $(INSTALL_PREFIX)/etc/udev/permissions.d/10-zaptel.permissions else # !UDEVPERMISSIONS (newer, combined syntax) - install -m 444 udev/zaptel.rules-combined $(INSTALL_PREFIX)/etc/udev/rules.d/zaptel.rules + install -D -m 444 udev/zaptel.rules-combined $(INSTALL_PREFIX)/etc/udev/rules.d/10-zaptel.rules endif endif --- zaptel-1.2.2/udev/zaptel.permissions.orig 2006-01-19 00:11:04.000000000 +0100 +++ zaptel-1.2.2/udev/zaptel.permissions 2006-01-19 00:11:17.000000000 +0100 @@ -1,2 +1,2 @@ # zaptel devices -- for running asterisk as non-root -zap/*:asterisk:asterisk:660 +zap/*:root:dialout:660 --- zaptel-1.2.2/udev/zaptel.rules-combined.orig 2006-01-19 00:11:25.000000000 +0100 +++ zaptel-1.2.2/udev/zaptel.rules-combined 2006-01-19 00:12:12.000000000 +0100 @@ -1,6 +1,6 @@ # zaptel devices with ownership/permissions for running as non-root -KERNEL="zapctl", NAME="zap/ctl", OWNER="asterisk", GROUP="asterisk", MODE="0660" -KERNEL="zaptimer", NAME="zap/timer", OWNER="asterisk", GROUP="asterisk", MODE="0660" -KERNEL="zapchannel", NAME="zap/channel", OWNER="asterisk", GROUP="asterisk", MODE="0660" -KERNEL="zappseudo", NAME="zap/pseudo", OWNER="asterisk", GROUP="asterisk", MODE="0660" -KERNEL="zap[0-9]*", NAME="zap/%n", OWNER="asterisk", GROUP="asterisk", MODE="0660" +KERNEL="zapctl", NAME="zap/ctl", OWNER="root", GROUP="dialout", MODE="0660" +KERNEL="zaptimer", NAME="zap/timer", OWNER="root", GROUP="dialout", MODE="0660" +KERNEL="zapchannel", NAME="zap/channel", OWNER="root", GROUP="dialout", MODE="0660" +KERNEL="zappseudo", NAME="zap/pseudo", OWNER="root", GROUP="dialout", MODE="0660" +KERNEL="zap[0-9]*", NAME="zap/%n", OWNER="root", GROUP="dialout", MODE="0660"