[zaptel-commits] trunk r1067 - in /trunk: ./ build_tools/ udev/

zaptel-commits at lists.digium.com zaptel-commits at lists.digium.com
Wed May 17 12:06:34 MST 2006


Author: kpfleming
Date: Wed May 17 14:06:34 2006
New Revision: 1067

URL: http://svn.digium.com/view/zaptel?rev=1067&view=rev
Log:
Merged revisions 1064-1065 via svnmerge from 
https://origsvn.digium.com/svn/zaptel/branches/1.2

........
r1064 | kpfleming | 2006-05-17 11:49:46 -0500 (Wed, 17 May 2006) | 2 lines

move udev rules creating into a script, and generate it properly based on the installed udev version

........
r1065 | kpfleming | 2006-05-17 13:50:38 -0500 (Wed, 17 May 2006) | 2 lines

move module-rules building into a script, and remove some old unnecessary steps

........

Added:
    trunk/build_tools/genmodconf
      - copied unchanged from r1065, branches/1.2/build_tools/genmodconf
    trunk/build_tools/genudevrules
      - copied unchanged from r1065, branches/1.2/build_tools/genudevrules
Removed:
    trunk/udev/
Modified:
    trunk/   (props changed)
    trunk/Makefile

Propchange: trunk/
------------------------------------------------------------------------------
--- branch-1.2-merged (original)
+++ branch-1.2-merged Wed May 17 14:06:34 2006
@@ -1,1 +1,1 @@
-/branches/1.2:1-916,918-936,938-949,958,962,970,990,1004,1011,1017,1031,1033,1060,1062
+/branches/1.2:1-916,918-936,938-949,958,962,970,990,1004,1011,1017,1031,1033,1060,1062,1064-1066

Modified: trunk/Makefile
URL: http://svn.digium.com/view/zaptel/trunk/Makefile?rev=1067&r1=1066&r2=1067&view=diff
==============================================================================
--- trunk/Makefile (original)
+++ trunk/Makefile Wed May 17 14:06:34 2006
@@ -4,9 +4,9 @@
 # Copyright (C) 2001-2006 Digium, Inc.
 #
 #
+
 .EXPORT_ALL_VARIABLES:
 
-BASEADDR=0xd0000
 PWD:=$(shell pwd)
 
 HOSTCC=gcc
@@ -77,54 +77,15 @@
   BUILDVER:=linux26
 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
-	MODCONFBACKUP:=1
-      else
-        ifneq (,$(wildcard $(ROOT_PREFIX)/etc/conf.modules))
-          MODCONF:=$(ROOT_PREFIX)/etc/conf.modules
-          MODCONFBACKUP:=1
-        endif
-      endif
-    endif
-  endif
-  # get the minor version of module-init-tools, since only 3.2.x and above support
-  # $CMDLINE_OPTS replacement
-  MODTOOLSVERSION:=$(shell /sbin/modprobe --version | awk '{print $$3;}' | cut -d . -f2)
-  ifneq ($(MODTOOLSVERSION),1)
-    MODCMDLINE:=\$$CMDLINE_OPTS
-  endif
-else # BUILDVER == linux24
-  ifneq (,$(wildcard $(ROOT_PREFIX)/etc/modutils))
-    MODCONF:=$(ROOT_PREFIX)/etc/modutils/zaptel
-    MODCONFBACKUP:=1
-   else
-    ifneq (,$(wildcard $(ROOT_PREFIX)/etc/modules.conf))
-      MODCONF:=$(ROOT_PREFIX)/etc/modules.conf
-      MODCONFBACKUP:=1
-     endif
-  endif
-endif
-
 # This is not related to the version that we build. Rather, to the 
 # version that we runs. If we build for 2.4 using 2.4 headers on a 2.6
 # system with udev mounted on /dev , no point in installing files to /dev
 # because they'll be wiped at next reboot.
-DYNFS:=$(shell ps ax | grep -q -v grep | grep -qw 'devfsd\|udevd' && echo "yes")
-
-# Check for udev permissions directories
+DYNFS:=$(shell ps ax | grep -v grep | grep -qw 'devfsd\|udevd' && echo "yes")
+
+# Check for udev rules directories
 ifneq (,$(wildcard $(ROOT_PREFIX)/etc/udev/rules.d))
   UDEVRULES=yes
-  ifneq (,$(wildcard $(ROOT_PREFIX)/etc/udev/permissions.d))
-    UDEVPERMISSIONS=yes
-  endif
 endif
 
 CHKCONFIG:=$(shell sh -c 'type -p chkconfig' 2> /dev/null)
@@ -157,7 +118,7 @@
          ztd-loc # ztdummy
 #MODULES+=wcfxsusb
 # build ztdummy by default for 2.6 kernels
-ifeq (${BUILDVER},linux26)
+ifeq ($(BUILDVER),linux26)
 MODULES+=ztdummy
 endif
 
@@ -194,10 +155,6 @@
 UTILS:=tor2ee ztspeed zttool ztmonitor sethdlc-new \
   usbfxstest fxstest fxotune fxsdump ztdiag
 UTILSO:=$(UTILS:%=%.o)
-
-#PRIMARY=wcfxsusb
-PRIMARY=torisa
-#PRIMARY=wcfxo
 
 all: modules $(LIBTONEZONE_SO)
 
@@ -353,12 +310,7 @@
 	done
 else # DYNFS
   ifdef UDEVRULES
-    ifdef UDEVPERMISSIONS
-	install -m 644 udev/zaptel.rules $(INSTALL_PREFIX)/etc/udev/rules.d
-	install -m 644 udev/zaptel.permissions $(INSTALL_PREFIX)/etc/udev/permissions.d
-    else # !UDEVPERMISSIONS (newer, combined syntax)
-	install -m 644 udev/zaptel.rules-combined $(INSTALL_PREFIX)/etc/udev/rules.d/zaptel.rules
-    endif
+	build_tools/genudevrules > $(INSTALL_PREFIX)/etc/udev/rules.d/zaptel.rules
   else # !UDEVRULES
 	@echo "**** Dynamic filesystem detected -- not creating device nodes"
   endif
@@ -372,29 +324,25 @@
 		install -D -m 755 sethdlc $(INSTALL_PREFIX)/sbin/sethdlc ; \
 	fi
 	if [ -f zttool ]; then install -D -m 755 zttool $(INSTALL_PREFIX)/sbin/zttool; fi
-	if [ -f zaptel.ko ]; then \
-		for x in $(MODULESKO); do \
-			rm -f $(INSTALL_PREFIX)/lib/modules/$(KVERS)/extra/$$x ; \
-		done; \
-		$(KMAKE_INST); \
-		if [ -f datamods/syncppp.ko ]; then \
-			$(MAKE) -C datamods install; \
-		else \
-			rm -f $(INSTALL_PREFIX)/lib/modules/$(KVERS)/misc/{hdlc_*,syncppp}.ko; \
-		fi; \
-		if ! [ -f wcfxsusb.ko ]; then \
-			rm -f $(INSTALL_PREFIX)/lib/modules/$(KVERS)/misc/wcfxsusb.ko; \
-		fi; \
-		rm -f $(INSTALL_PREFIX)/lib/modules/$(KVERS)/misc/wcfxs.ko; \
+ifeq ($(BUILDVER),linux26)
+	for x in $(MODULESKO); do \
+		rm -f $(INSTALL_PREFIX)/lib/modules/$(KVERS)/extra/$$x ; \
+	done; \
+	$(KMAKE_INST); \
+	if [ -f datamods/syncppp.ko ]; then \
+		$(MAKE) -C datamods install; \
 	else \
-		for x in $(MODULESO); do \
-			install -D -m 644 $$x $(INSTALL_PREFIX)/lib/modules/$(KVERS)/misc/$$x ; \
-		done; \
-		if ! [ -f wcfxsusb.o ]; then \
-			rm -f $(INSTALL_PREFIX)/lib/modules/$(KVERS)/misc/wcfxsusb.o; \
-		fi; \
-		rm -f $(INSTALL_PREFIX)/lib/modules/$(KVERS)/misc/wcfxs.o; \
-	fi
+		rm -f $(INSTALL_PREFIX)/lib/modules/$(KVERS)/misc/{hdlc_*,syncppp}.ko; \
+	fi
+else
+	for x in $(MODULESO); do \
+		install -D -m 644 $$x $(INSTALL_PREFIX)/lib/modules/$(KVERS)/misc/$$x ; \
+	done
+endif
+	if ! [ -f wcfxsusb.o ]; then \
+		rm -f $(INSTALL_PREFIX)/lib/modules/$(KVERS)/misc/wcfxsusb.o; \
+	fi; \
+	rm -f $(INSTALL_PREFIX)/lib/modules/$(KVERS)/misc/wcfxs.o
 	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 || :
 	rm -f $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO)
@@ -402,64 +350,20 @@
 		$(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 -q "SELinux status:" | grep -q "enabled") ; then restorecon -v $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO); fi
+	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
-	if [ -n "$(MODCONF)" ]; then \
-		if [ -n "$(MODCONFBACKUP)" ]; then \
-			if [ -f $(MODCONF) ]; then mv -f $(MODCONF) $(MODCONF).bak ; fi; \
-			cat $(MODCONF).bak | grep -q -v "alias char-major-250" | \
-			grep -q -v "post-install torisa /sbin/ztcfg" | \
-			grep -q -v "post-install wcfxsusb /sbin/ztcfg" | \
-			grep -q -v "alias wctdm" | \
-			grep -q -v "post-install wctdm /sbin/ztcfg" > $(MODCONF); \
-			if ! grep -q "options torisa" $(MODCONF); then \
-				echo "options torisa base=$(BASEADDR)" >> $(MODCONF); \
-			fi; \
-			if ! grep -q "alias char-major-196" $(MODCONF); then \
-				echo "alias char-major-196 $(PRIMARY)" >> $(MODCONF); \
-			fi; \
-		else \
-			grep "^options" $(MODCONF) > $(MODCONF).new; \
-			rm -f $(MODCONF) $(MODCONF).bak; \
-			mv $(MODCONF).new $(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 $(MODCMDLINE) && /sbin/ztcfg" >> $(MODCONF); \
-						else echo "post-install $$x /sbin/ztcfg" >> $(MODCONF); \
-						fi; \
-					fi; \
-				fi; \
-			fi; \
-		done; \
-		if ! grep -q "alias wcfxs" $(MODCONF); then \
-			echo "alias wcfxs wctdm" >> $(MODCONF); \
-		fi; \
-		if ! grep -q "alias wct2xxp" $(MODCONF); then \
-			echo "alias wct2xxp wct4xxp" >> $(MODCONF); \
-		fi; \
-	fi
+	build_tools/genmodconf $(BUILDVER) "$(ROOT_PREFIX)" "$(filter-out zaptel,$(MODULES))"
 	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 644 udev/zaptel.rules $(INSTALL_PREFIX)/etc/udev/rules.d
-	install -m 644 udev/zaptel.permissions $(INSTALL_PREFIX)/etc/udev/permissions.d
-    else # !UDEVPERMISSIONS (newer, combined syntax)
-	install -m 644 udev/zaptel.rules-combined $(INSTALL_PREFIX)/etc/udev/rules.d/zaptel.rules
-    endif
-  endif
+install-udev: devices
 
 config:
 	if [ -d $(INSTALL_PREFIX)/etc/rc.d/init.d ]; then \
@@ -486,7 +390,7 @@
 		rm -f .version; \
 		if [ `grep -q -c ^C update.out` -gt 0 ]; then \
 			echo ; echo "The following files have conflicts:" ; \
-			grep -q ^C update.out | cut -b4- ; \
+			grep ^C update.out | cut -b4- ; \
 		fi ; \
 		rm -f update.out; \
 	elif [ -d CVS ]; then \
@@ -495,7 +399,7 @@
 		rm -f .version; \
 		if [ `grep -q -c ^C update.out` -gt 0 ]; then \
 			echo ; echo "The following files have conflicts:" ; \
-			grep -q ^C update.out | cut -d' ' -f2- ; \
+			grep ^C update.out | cut -d' ' -f2- ; \
 		fi ; \
 		rm -f update.out; \
 	else \
@@ -522,10 +426,10 @@
 
 clean:
 	rm -f torisatool makefw tor2fw.h radfw.h
-	rm -f ${BINS}
+	rm -f $(BINS)
 	rm -f *.o ztcfg tzdriver sethdlc sethdlc-new
 	rm -f $(TZOBJS) $(LIBTONEZONE_SO) *.lo
-ifeq (${BUILDVER},linux26)
+ifeq ($(BUILDVER),linux26)
 	$(KMAKE) clean
 	$(MAKE) -C datamods clean
 endif



More information about the zaptel-commits mailing list