summaryrefslogtreecommitdiff
path: root/drivers/dahdi/firmware
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2008-07-02 20:37:15 +0000
committerKevin P. Fleming <kpfleming@digium.com>2008-07-02 20:37:15 +0000
commit7b1cb1997aa40af6aac8f4257e1d9b59fa1a53a6 (patch)
treee4acf85f6bef2fdbd959d6a45e64ae6c3bcdc6ca /drivers/dahdi/firmware
parent8445a9d385bd8c74cceda49adb9841ef5ccd0ec0 (diff)
perform an explicit check for the destination directories for hotplug firmware, and issue an error message if neither of them can be found
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4529 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/firmware')
-rw-r--r--drivers/dahdi/firmware/Makefile30
1 files changed, 25 insertions, 5 deletions
diff --git a/drivers/dahdi/firmware/Makefile b/drivers/dahdi/firmware/Makefile
index c4790d3..54ad0b8 100644
--- a/drivers/dahdi/firmware/Makefile
+++ b/drivers/dahdi/firmware/Makefile
@@ -11,9 +11,7 @@
# the GNU General Public License
#
-.PHONY: dist-clean all uninstall have_download install
-
-PWD:=$(shell pwd)
+.PHONY: dist-clean clean all uninstall have_download install object-build hotplug-install hotplug-dirs hotplug-uninstall make_firmware_object
OCT6114_064_VERSION:=1.05.01
OCT6114_128_VERSION:=1.05.01
@@ -64,7 +62,7 @@ clean:
rm -f dahdi-fw-*.o
# Download and extract firmware tarballs
-dahdi-fw-oct6114-%.tar.gz dahdi-fw-tc400m-%.tar.gz dahdi-fw-vpmadt032-%.tar.gz:
+dahdi-fw-%.tar.gz:
ifeq ($(shell if ( [ "$(HOTPLUG_FIRMWARE)" = "no" ] ) || ( [ -d $(DESTDIR)/usr/lib/hotplug/firmware ] && ! [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.$(subst .tar.gz,,$*) ] ) || ( [ -d $(DESTDIR)/lib/firmware ] && ! [ -f $(DESTDIR)/lib/firmware/.$(subst .tar.gz,,$*) ] ); then echo "yes"; else echo "no"; fi),yes)
@echo "Attempting to download $@"
@if test ! -f $@; then $(DOWNLOAD) $(WGET_ARGS) $(FIRMWARE_URL)/$@; fi;
@@ -75,8 +73,30 @@ endif
# Create object files suitable for linking against
object-build: $(FIRMWARE) $(OBJECT_FILES)
+# Ensure that we can find at least one hotplug firmware directory to install into
+hotplug-dirs:
+ @if [ -d $(DESTDIR)/usr/lib/hotplug/firmware ] || [ -d $(DESTDIR)/lib/firmware ]; then \
+ exit 0; \
+ else \
+ echo "###################################################"; \
+ echo "###"; \
+ echo "### The hotplug firmware cannot be installed, because "; \
+ if [ -n "$(DESTDIR)" ]; then \
+ echo "### the destination directory at: "; \
+ echo "### $(DESTDIR)"; \
+ echo "### does not have either of the following directories: "; \
+ else \
+ echo "### neither of these directories exist on your system: "; \
+ fi; \
+ echo "### /usr/lib/hotplug/firmware "; \
+ echo "### lib/firmware "; \
+ echo "###"; \
+ echo "###################################################"; \
+ exit 1; \
+ fi
+
# Install all downloaded firmware images for hotplug usage
-hotplug-install: $(FIRMWARE)
+hotplug-install: hotplug-dirs $(FIRMWARE)
ifeq ($(HOTPLUG_FIRMWARE),yes)
ifeq ($(shell if ( [ -d $(DESTDIR)/usr/lib/hotplug/firmware ] && ! [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-oct6114-064-$(OCT6114_064_VERSION) ] ) || ( [ -d $(DESTDIR)/lib/firmware ] && ! [ -f $(DESTDIR)/lib/firmware/.dahdi-fw-oct6114-064-$(OCT6114_064_VERSION) ] ); then echo "yes"; else echo "no"; fi),yes)
@echo "Installing dahdi-fw-oct6114-064.bin to hotplug firmware directories"