[zaptel-commits] kpfleming: branch 1.4 r4356 - /branches/1.4/firmware/Makefile

SVN commits to the Zaptel project zaptel-commits at lists.digium.com
Tue Jun 17 16:41:57 CDT 2008


Author: kpfleming
Date: Tue Jun 17 16:41:57 2008
New Revision: 4356

URL: http://svn.digium.com/view/zaptel?view=rev&rev=4356
Log:
fix various problems:

- don't actually install hotplug firmware just because it has been downloaded... wait until hotplug-install is requested
- ensure that tag files aren't removed and recreated unless the firmware file was successfully installed

Modified:
    branches/1.4/firmware/Makefile

Modified: branches/1.4/firmware/Makefile
URL: http://svn.digium.com/view/zaptel/branches/1.4/firmware/Makefile?view=diff&rev=4356&r1=4355&r2=4356
==============================================================================
--- branches/1.4/firmware/Makefile (original)
+++ branches/1.4/firmware/Makefile Tue Jun 17 16:41:57 2008
@@ -68,22 +68,8 @@
 	@if test ! -f $@; then $(DOWNLOAD) $(WGET_ARGS) $(FIRMWARE_URL)/$@; fi;
 	@if test ! -f $@; then exit 1; fi; \
 	(cat $@ | gzip -d | tar -xf -)
-ifeq ($(HOTPLUG_FIRMWARE),yes)
-	@echo "Installing zaptel-fw-oct6114-064.bin to hotplug firmware directories"
-	if [ -d $(DESTDIR)/usr/lib/hotplug/firmware ]; then \
-		$(INSTALL) -m 644 zaptel-fw-oct6114-064.bin $(DESTDIR)/usr/lib/hotplug/firmware; \
-		rm -rf $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-oct6114-064-*; \
-		touch $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-oct6114-064-$(OCT6114_064_VERSION); \
-	fi
-	if [ -d $(DESTDIR)/lib/firmware ]; then \
-		$(INSTALL) -m 644 zaptel-fw-oct6114-064.bin $(DESTDIR)/lib/firmware; \
-		rm -rf $(DESTDIR)/lib/firmware/.zaptel-fw-oct6114-064-*; \
-		touch $(DESTDIR)/lib/firmware/.zaptel-fw-oct6114-064-$(OCT6114_064_VERSION); \
-	fi
-endif
-else
-	@echo "Firmware zaptel-fw-oct6114-064.bin is already installed with required version $(OCT6114_064_VERSION)"
-endif
+endif
+
 
 zaptel-fw-oct6114-128-%.tar.gz: have_download
 ifeq ($(shell if ( [ "$(HOTPLUG_FIRMWARE)" = "no" ] ) || ( [ -d $(DESTDIR)/usr/lib/hotplug/firmware ] && ! [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-oct6114-128-$(OCT6114_128_VERSION) ] ) || ( [ -d $(DESTDIR)/lib/firmware ] && ! [ -f $(DESTDIR)/lib/firmware/.zaptel-fw-oct6114-128-$(OCT6114_128_VERSION) ] ); then echo "yes"; else echo "no"; fi),yes)
@@ -91,21 +77,6 @@
 	@if test ! -f $@; then $(DOWNLOAD) $(WGET_ARGS) $(FIRMWARE_URL)/$@; fi;
 	@if test ! -f $@; then exit 1; fi; \
 	(cat $@ | gzip -d | tar -xf -)
-ifeq ($(HOTPLUG_FIRMWARE),yes)
-	@echo "Installing zaptel-fw-oct6114-128.bin to hotplug firmware directories"
-	if [ -d $(DESTDIR)/usr/lib/hotplug/firmware ]; then \
-		$(INSTALL) -m 644 zaptel-fw-oct6114-128.bin $(DESTDIR)/usr/lib/hotplug/firmware; \
-		rm -rf $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-oct6114-128-*; \
-		touch $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-oct6114-128-$(OCT6114_128_VERSION); \
-	fi
-	if [ -d $(DESTDIR)/lib/firmware ]; then \
-		$(INSTALL) -m 644 zaptel-fw-oct6114-128.bin $(DESTDIR)/lib/firmware; \
-		rm -rf $(DESTDIR)/lib/firmware/.zaptel-fw-oct6114-128-*; \
-		touch $(DESTDIR)/lib/firmware/.zaptel-fw-oct6114-128-$(OCT6114_128_VERSION); \
-	fi
-endif
-else
-	@echo "Firmware zaptel-fw-oct6114-128.bin is already installed with required version $(OCT6114_128_VERSION)"
 endif
 
 zaptel-fw-tc400m-%.tar.gz: have_download
@@ -114,21 +85,6 @@
 	@if test ! -f $@; then $(DOWNLOAD) $(WGET_ARGS) $(FIRMWARE_URL)/$@; fi;
 	@if test ! -f $@; then exit 1; fi; \
 	(cat $@ | gzip -d | tar -xf -)
-ifeq ($(HOTPLUG_FIRMWARE),yes)
-	@echo "Installing zaptel-fw-tc400m.bin to hotplug firmware directories"
-	if [ -d $(DESTDIR)/usr/lib/hotplug/firmware ]; then \
-		$(INSTALL) -m 644 zaptel-fw-tc400m.bin $(DESTDIR)/usr/lib/hotplug/firmware; \
-		rm -rf $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-tc400m-*; \
-		touch $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-tc400m-$(TC400M_VERSION); \
-	fi
-	if [ -d $(DESTDIR)/lib/firmware ]; then \
-		$(INSTALL) -m 644 zaptel-fw-tc400m.bin $(DESTDIR)/lib/firmware; \
-		rm -rf $(DESTDIR)/lib/firmware/.zaptel-fw-tc400m-*; \
-		touch $(DESTDIR)/lib/firmware/.zaptel-fw-tc400m-$(TC400M_VERSION); \
-	fi
-endif
-else
-	@echo "Firmware zaptel-fw-tc400m.bin is already installed with required version $(TC400M_VERSION)"
 endif
 
 zaptel-fw-vpmadt032-%.tar.gz: have_download
@@ -137,21 +93,6 @@
 	@if test ! -f $@; then $(DOWNLOAD) $(WGET_ARGS) $(FIRMWARE_URL)/$@; fi;
 	@if test ! -f $@; then exit 1; fi; \
 	(cat $@ | gzip -d | tar -xf -)
-ifeq ($(HOTPLUG_FIRMWARE),yes)
-	@echo "Installing zaptel-fw-vpmadt032.bin to hotplug firmware directories"
-	if [ -d $(DESTDIR)/usr/lib/hotplug/firmware ]; then \
-		$(INSTALL) -m 644 zaptel-fw-vpmadt032.bin $(DESTDIR)/usr/lib/hotplug/firmware; \
-		rm -rf $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-vpmadt032-*; \
-		touch $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-vpmadt032-$(VPMADT032_VERSION); \
-	fi
-	if [ -d $(DESTDIR)/lib/firmware ]; then \
-		$(INSTALL) -m 644 zaptel-fw-vpmadt032.bin $(DESTDIR)/lib/firmware; \
-		rm -rf $(DESTDIR)/lib/firmware/.zaptel-fw-vpmadt032-*; \
-		touch $(DESTDIR)/lib/firmware/.zaptel-fw-vpmadt032-$(VPMADT032_VERSION); \
-	fi
-endif
-else
-	@echo "Firmware zaptel-fw-vpmadt032.bin is already installed with required version $(VPMADT032_VERSION)"
 endif
 
 # Clean up any downloaded/extracted firmware packages
@@ -168,6 +109,68 @@
 
 # Install all downloaded firmware images for hotplug usage and build headers for inclusion
 hotplug-install: $(FIRMWARE)
+ifeq ($(HOTPLUG_FIRMWARE),yes)
+ifeq ($(shell if ( [ -d $(DESTDIR)/usr/lib/hotplug/firmware ] && ! [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-oct6114-064-$(OCT6114_064_VERSION) ] ) || ( [ -d $(DESTDIR)/lib/firmware ] && ! [ -f $(DESTDIR)/lib/firmware/.zaptel-fw-oct6114-064-$(OCT6114_064_VERSION) ] ); then echo "yes"; else echo "no"; fi),yes)
+	@echo "Installing zaptel-fw-oct6114-064.bin to hotplug firmware directories"
+	if [ -d $(DESTDIR)/usr/lib/hotplug/firmware ]; then \
+		$(INSTALL) -m 644 zaptel-fw-oct6114-064.bin $(DESTDIR)/usr/lib/hotplug/firmware && \
+		(rm -rf $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-oct6114-064-*; \
+		 touch $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-oct6114-064-$(OCT6114_064_VERSION)); \
+	fi
+	if [ -d $(DESTDIR)/lib/firmware ]; then \
+		$(INSTALL) -m 644 zaptel-fw-oct6114-064.bin $(DESTDIR)/lib/firmware && \
+		(rm -rf $(DESTDIR)/lib/firmware/.zaptel-fw-oct6114-064-*; \
+		 touch $(DESTDIR)/lib/firmware/.zaptel-fw-oct6114-064-$(OCT6114_064_VERSION)); \
+	fi
+else
+	@echo "Firmware zaptel-fw-oct6114-064.bin is already installed with required version $(OCT6114_064_VERSION)"
+endif
+ifeq ($(shell if ( [ -d $(DESTDIR)/usr/lib/hotplug/firmware ] && ! [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-oct6114-128-$(OCT6114_128_VERSION) ] ) || ( [ -d $(DESTDIR)/lib/firmware ] && ! [ -f $(DESTDIR)/lib/firmware/.zaptel-fw-oct6114-128-$(OCT6114_128_VERSION) ] ); then echo "yes"; else echo "no"; fi),yes)
+	@echo "Installing zaptel-fw-oct6114-128.bin to hotplug firmware directories"
+	if [ -d $(DESTDIR)/usr/lib/hotplug/firmware ]; then \
+		$(INSTALL) -m 644 zaptel-fw-oct6114-128.bin $(DESTDIR)/usr/lib/hotplug/firmware && \
+		(rm -rf $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-oct6114-128-*; \
+		 touch $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-oct6114-128-$(OCT6114_128_VERSION)); \
+	fi
+	if [ -d $(DESTDIR)/lib/firmware ]; then \
+		$(INSTALL) -m 644 zaptel-fw-oct6114-128.bin $(DESTDIR)/lib/firmware && \
+		(rm -rf $(DESTDIR)/lib/firmware/.zaptel-fw-oct6114-128-*; \
+		 touch $(DESTDIR)/lib/firmware/.zaptel-fw-oct6114-128-$(OCT6114_128_VERSION)); \
+	fi
+else
+	@echo "Firmware zaptel-fw-oct6114-128.bin is already installed with required version $(OCT6114_128_VERSION)"
+endif
+ifeq ($(shell if ( [ -d $(DESTDIR)/usr/lib/hotplug/firmware ] && ! [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-tc400m-$(TC400M_VERSION) ] ) || ( [ -d $(DESTDIR)/lib/firmware ] && ! [ -f $(DESTDIR)/lib/firmware/.zaptel-fw-tc400m-$(TC400M_VERSION) ] ); then echo "yes"; else echo "no"; fi),yes)
+	@echo "Installing zaptel-fw-tc400m.bin to hotplug firmware directories"
+	if [ -d $(DESTDIR)/usr/lib/hotplug/firmware ]; then \
+		$(INSTALL) -m 644 zaptel-fw-tc400m.bin $(DESTDIR)/usr/lib/hotplug/firmware && \
+		(rm -rf $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-tc400m-*; \
+		 touch $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-tc400m-$(TC400M_VERSION)); \
+	fi
+	if [ -d $(DESTDIR)/lib/firmware ]; then \
+		$(INSTALL) -m 644 zaptel-fw-tc400m.bin $(DESTDIR)/lib/firmware && \
+		(rm -rf $(DESTDIR)/lib/firmware/.zaptel-fw-tc400m-*; \
+		 touch $(DESTDIR)/lib/firmware/.zaptel-fw-tc400m-$(TC400M_VERSION)); \
+	fi
+else
+	@echo "Firmware zaptel-fw-tc400m.bin is already installed with required version $(TC400M_VERSION)"
+endif
+ifeq ($(shell if ( [ -d $(DESTDIR)/usr/lib/hotplug/firmware ] && ! [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-vpmadt032-$(VPMADT032_VERSION) ] ) || ( [ -d $(DESTDIR)/lib/firmware ] && ! [ -f $(DESTDIR)/lib/firmware/.zaptel-fw-vpmadt032-$(VPMADT032_VERSION) ] ); then echo "yes"; else echo "no"; fi),yes)
+	@echo "Installing zaptel-fw-vpmadt032.bin to hotplug firmware directories"
+	if [ -d $(DESTDIR)/usr/lib/hotplug/firmware ]; then \
+		$(INSTALL) -m 644 zaptel-fw-vpmadt032.bin $(DESTDIR)/usr/lib/hotplug/firmware && \
+		(rm -rf $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-vpmadt032-*; \
+		 touch $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-vpmadt032-$(VPMADT032_VERSION)); \
+	fi
+	if [ -d $(DESTDIR)/lib/firmware ]; then \
+		$(INSTALL) -m 644 zaptel-fw-vpmadt032.bin $(DESTDIR)/lib/firmware && \
+		(rm -rf $(DESTDIR)/lib/firmware/.zaptel-fw-vpmadt032-*; \
+		 touch $(DESTDIR)/lib/firmware/.zaptel-fw-vpmadt032-$(VPMADT032_VERSION)); \
+	fi
+else
+	@echo "Firmware zaptel-fw-vpmadt032.bin is already installed with required version $(VPMADT032_VERSION)"
+endif
+endif
 
 # Uninstall any installed zaptel firmware images from hotplug firmware directories
 hotplug-uninstall:




More information about the zaptel-commits mailing list