[zaptel-commits] trunk r1032 - in /trunk: ./ Makefile

zaptel-commits at lists.digium.com zaptel-commits at lists.digium.com
Tue May 9 04:10:03 MST 2006


Author: kpfleming
Date: Tue May  9 06:10:02 2006
New Revision: 1032

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

........
r1031 | kpfleming | 2006-05-09 06:07:24 -0500 (Tue, 09 May 2006) | 3 lines

use commmand-line parameter substitution for modprobe commands if the system's module-init-tools is new enough to support it
don't backup and use the old configuration file for modules if we are using a zaptel-specific file in /etc/modprobe.d or similar

........

Modified:
    trunk/   (props changed)
    trunk/Makefile

Propchange: trunk/
------------------------------------------------------------------------------
--- branch-1.2-merged (original)
+++ branch-1.2-merged Tue May  9 06:10:02 2006
@@ -1,1 +1,1 @@
-/branches/1.2:1-916,918-936,938-949,958,962,970,990,1004,1011,1017
+/branches/1.2:1-916,918-936,938-949,958,962,970,990,1004,1011,1017,1031

Modified: trunk/Makefile
URL: http://svn.digium.com/view/zaptel/trunk/Makefile?rev=1032&r1=1031&r2=1032&view=diff
==============================================================================
--- trunk/Makefile (original)
+++ trunk/Makefile Tue May  9 06:10:02 2006
@@ -85,19 +85,29 @@
     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 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
@@ -106,7 +116,7 @@
 # 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 -v grep | grep -qw 'devfsd\|udevd' && echo "yes")
+DYNFS:=$(shell ps ax | grep -q -v grep | grep -qw 'devfsd\|udevd' && echo "yes")
 
 # Check for udev permissions directories
 ifneq (,$(wildcard $(ROOT_PREFIX)/etc/udev/rules.d))
@@ -220,11 +230,11 @@
 tests: patgen pattest patlooptest hdlcstress hdlctest hdlcgen hdlcverify timertest
 
 tor2.o: tor2-hw.h tor2fw.h
-  
+
 zaptel.o: digits.h arith.h sec.h mec.h sec-2.h mec2.h mec3.h zconfig.h
-  
+
 torisa.o: torisa.h
-  
+
 wcusb.o: wcusb.h
 
 wcfxsusb.o: wcfxsusb.h
@@ -392,40 +402,45 @@
 		$(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
+	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
 	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 [ -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); \
+		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 \
+			rm -f $(MODCONF) $(MODCONF).bak; \
+			touch $(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); \
+						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 "ias wcfxs" $(MODCONF); then \
+		if ! grep -q "alias wcfxs" $(MODCONF); then \
 			echo "alias wcfxs wctdm" >> $(MODCONF); \
 		fi; \
-		if ! grep "alias wct2xxp" $(MODCONF); then \
+		if ! grep -q "alias wct2xxp" $(MODCONF); then \
 			echo "alias wct2xxp wct4xxp" >> $(MODCONF); \
 		fi; \
 	fi
@@ -468,18 +483,18 @@
 		echo "Updating from Subversion..." ; \
 		svn update | tee update.out; \
 		rm -f .version; \
-		if [ `grep -c ^C update.out` -gt 0 ]; then \
+		if [ `grep -q -c ^C update.out` -gt 0 ]; then \
 			echo ; echo "The following files have conflicts:" ; \
-			grep ^C update.out | cut -b4- ; \
+			grep -q ^C update.out | cut -b4- ; \
 		fi ; \
 		rm -f update.out; \
 	elif [ -d CVS ]; then \
 		echo "Updating from CVS..." ; \
 		cvs -q -z3 update -Pd | tee update.out; \
 		rm -f .version; \
-		if [ `grep -c ^C update.out` -gt 0 ]; then \
+		if [ `grep -q -c ^C update.out` -gt 0 ]; then \
 			echo ; echo "The following files have conflicts:" ; \
-			grep ^C update.out | cut -d' ' -f2- ; \
+			grep -q ^C update.out | cut -d' ' -f2- ; \
 		fi ; \
 		rm -f update.out; \
 	else \



More information about the zaptel-commits mailing list