diff options
author | kpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2006-05-09 11:10:02 +0000 |
---|---|---|
committer | kpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2006-05-09 11:10:02 +0000 |
commit | f4f91c0ed866dd969ce68262323b4fefbbbb376c (patch) | |
tree | caec84ff6d581258d1a62f750684dd9e2b695d57 /Makefile | |
parent | 0174c3bcca1cd5c465ff5d25e2d74dfc1a9c5011 (diff) |
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
........
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@1032 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 61 |
1 files changed, 38 insertions, 23 deletions
@@ -85,19 +85,29 @@ ifeq ($(BUILDVER),linux26) 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 @@ endif # 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 @@ devel: tor2ee 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: all devices $(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 @@ update: 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 \ |