diff -ruN zaptel-1.4.11-original/Makefile zaptel-1.4.11/Makefile --- zaptel-1.4.11-original/Makefile 2008-05-13 20:01:28.000000000 +0200 +++ zaptel-1.4.11/Makefile 2008-06-04 17:21:46.000000000 +0200 @@ -66,20 +66,32 @@ # Set HOTPLUG_FIRMWARE=no to override automatic building with hotplug support # if it is enabled in the kernel. ifeq ($(BUILDVER),linux26) - ifneq (,$(wildcard $(DESTDIR)/etc/udev/rules.d)) - DYNFS=yes - UDEVRULES=yes - endif +# ifneq (,$(wildcard $(DESTDIR)/etc/udev/rules.d)) +# DYNFS=yes +# UDEVRULES=yes +# endif ifeq (yes,$(HAS_KSRC)) HOTPLUG_FIRMWARE:=$(shell if grep -q '^CONFIG_FW_LOADER=[ym]' $(KCONFIG); then echo "yes"; else echo "no"; fi) endif endif -ifneq (,$(findstring $(CONFIG_DEVFS_FS),y m)) - DYNFS=yes - HAS_DEVFS=yes +#ifneq (,$(findstring $(CONFIG_DEVFS_FS),y m)) +# DYNFS=yes +# HAS_DEVFS=yes +#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. XXX: should this be a use-flag? Perhaps: noudev? +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 endif + # If the file .zaptel.makeopts is present in your home directory, you can # include all of your favorite menuselect options so that every time you download # a new version of Asterisk, you don't have to run menuselect to set them. @@ -153,7 +165,7 @@ ALL_MODULES+=$(patsubst %,xpp/%.ko,xpp_usb xpd_fxo xpd_fxs xpp) endif -OPTFLAG=-O2 +OPTFLAGS?=-O2 CFLAGS+=-I. $(OPTFLAGS) -g -fPIC -Wall -DBUILDING_TONEZONE #-DTONEZONE_DRIVER ifneq (,$(findstring ppc,$(UNAME_M))) CFLAGS_PPC:=-fsigned-char @@ -162,7 +174,7 @@ CFLAGS_x86_64:=-m64 endif CFLAGS+=$(CFLAGS_PPC) $(CFLAGS_x86_64) -KFLAGS=-I$(KINCLUDES) -O6 +KFLAGS=-I$(KINCLUDES) -O2 KFLAGS+=-DMODULE -D__KERNEL__ -DEXPORT_SYMTAB -I$(KSRC)/drivers/net \ -Wall -I. -Wstrict-prototypes -fomit-frame-pointer -I$(KSRC)/drivers/net/wan -I$(KINCLUDES)/net ifneq (,$(wildcard $(KINCLUDES)/linux/modversions.h)) @@ -425,7 +437,7 @@ $(UTILSO): %.o: %.c $(CC) $(CFLAGS) -o $@ -c $< -install: all devices install-modules install-programs install-firmware +install: devices install-modules install-programs install-firmware @echo "###################################################" @echo "###" @echo "### Zaptel installed successfully." @@ -450,10 +462,8 @@ # Pushing those two to a separate target that is not used by default: install-modconf: - build_tools/genmodconf $(BUILDVER) "$(ROOT_PREFIX)" "$(filter-out zaptel ztdummy xpp zttranscode ztdynamic,$(BUILD_MODULES)) $(MODULE_ALIASES)" - @if [ -d /etc/modutils ]; then \ - /sbin/update-modules ; \ - fi + install -d -m 755 $(DESTDIR)/etc/modules.d + build_tools/genmodconf $(BUILDVER) "$(DESTDIR)" "$(filter-out zaptel ztdummy xpp zttranscode ztdynamic,$(BUILD_MODULES)) $(MODULE_ALIASES)" install-firmware: ifeq ($(HOTPLUG_FIRMWARE),yes) @@ -463,11 +473,9 @@ install-libs: libs $(INSTALL) -D -m 755 $(LTZ_A) $(DESTDIR)$(LIB_DIR)/$(LTZ_A) $(INSTALL) -D -m 755 $(LTZ_SO) $(DESTDIR)$(LIB_DIR)/$(LTZ_SO).$(LTZ_SO_MAJOR_VER).$(LTZ_SO_MINOR_VER) -ifeq (,$(DESTDIR)) if [ `id -u` = 0 ]; then \ - /sbin/ldconfig || : ;\ + /sbin/ldconfig -n $(DESTDIR)$(LIB_DIR) || : ;\ fi -endif rm -f $(DESTDIR)$(LIB_DIR)$(LTZ_SO) $(LN) -sf $(LTZ_SO).$(LTZ_SO_MAJOR_VER).$(LTZ_SO_MINOR_VER) \ $(DESTDIR)$(LIB_DIR)/$(LTZ_SO).$(LTZ_SO_MAJOR_VER) @@ -516,7 +524,8 @@ @echo "**** Dynamic filesystem detected -- not creating device nodes" else # UDEVRULES install -d $(DESTDIR)/etc/udev/rules.d - build_tools/genudevrules > $(DESTDIR)/etc/udev/rules.d/zaptel.rules + build_tools/genudevrules > zaptel.rules + install -D -m 644 zaptel.rules $(DESTDIR)/etc/udev/rules.d/10-zaptel.rules endif endif @@ -531,14 +540,14 @@ endif ifeq ($(BUILDVER),linux24) -install-modules: $(INSTALL_MODULES) uninstall-modules +install-modules: $(INSTALL_MODULES) $(INSTALL) -d $(DESTDIR)$(MOD_DIR) $(INSTALL) -m 644 $(INSTALL_MODULES) $(DESTDIR)$(MOD_DIR) else -install-modules: uninstall-modules +install-modules: $(KMAKE_INST) endif - [ `id -u` = 0 ] && /sbin/depmod -a $(KVERS) || : + [ -z "$(DESTDIR)" -a `id -u` = 0 ] && /sbin/depmod -a $(KVERS) || : config: ifneq (,$(COPY_INITD)) diff -ruN zaptel-1.4.11-original/build_tools/genmodconf zaptel-1.4.11/build_tools/genmodconf --- zaptel-1.4.11-original/build_tools/genmodconf 2007-07-11 21:04:58.000000000 +0200 +++ zaptel-1.4.11/build_tools/genmodconf 2008-06-04 17:20:38.000000000 +0200 @@ -79,20 +79,6 @@ echo Building ${target}... -if [ "${1}" = "linux24" ]; then - for mod in ${3}; do - if ! grep -q "post-install ${mod} " ${target}; then - echo "post-install ${mod} /sbin/ztcfg" >> ${target} - fi - done -elif [ "${1}" = "linux26" ]; then - for mod in ${3}; do - if ! grep -q "install ${mod} " ${target}; then - echo "install ${mod} /sbin/modprobe --ignore-install ${mod} ${cmdopts} && /sbin/ztcfg" >> ${target} - fi - done -fi - if [ -z "${combined}" ]; then echo "***" echo "*** WARNING:" diff -ruN zaptel-1.4.11-original/build_tools/genudevrules zaptel-1.4.11/build_tools/genudevrules --- zaptel-1.4.11-original/build_tools/genudevrules 2008-03-26 09:45:25.000000000 +0100 +++ zaptel-1.4.11/build_tools/genudevrules 2008-06-04 17:20:38.000000000 +0200 @@ -31,5 +31,5 @@ KERNEL${match}"zap[0-9]*", NAME="zap/%n" # zaptel devices with ownership/permissions for running as non-root -SUBSYSTEM${match}"zaptel", OWNER="asterisk", GROUP="asterisk", MODE="0660" +SUBSYSTEM${match}"zaptel", OWNER="asterisk", GROUP="dialout", MODE="0660" EOF