--- firmware/Makefile.orig	2008-09-15 08:55:22.000000000 +0200
+++ firmware/Makefile	2008-09-15 08:56:15.000000000 +0200
@@ -72,7 +72,7 @@
 
 # Download and extract firmware tarballs
 zaptel-fw-%.tar.gz:
-	@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 \
+	@if ( [ "$(HOTPLUG_FIRMWARE)" = "no" ] ) || ( [ -d $(DESTDIR)/$(LIBDIR)/hotplug/firmware ] && ! [ -f $(DESTDIR)/$(LIBDIR)/hotplug/firmware/.$(subst .tar.gz,,$*) ] ) || ( [ -d $(DESTDIR)/lib/firmware ] && ! [ -f $(DESTDIR)/lib/firmware/.$(subst .tar.gz,,$*) ] ); then \
 		echo "Attempting to download $@"; \
 		if test ! -f $@; then $(DOWNLOAD) $(WGET_ARGS) $(FIRMWARE_URL)/$@; fi; \
 		if test ! -f $@; then exit 1; fi; \
@@ -82,17 +82,17 @@
 # Create object files suitable for linking against
 object-build: $(FIRMWARE) $(OBJECT_FILES)
 
-$(DESTDIR)/usr/lib/hotplug/firmware $(DESTDIR)/lib/firmware:
+$(DESTDIR)/$(LIBDIR)/hotplug/firmware $(DESTDIR)/lib/firmware:
 	mkdir -p $@
 
 # Install all downloaded firmware images for hotplug usage
-hotplug-install: $(DESTDIR)/usr/lib/hotplug/firmware $(DESTDIR)/lib/firmware $(FIRMWARE)
+hotplug-install: $(DESTDIR)/$(LIBDIR)/hotplug/firmware $(DESTDIR)/lib/firmware $(FIRMWARE)
 ifneq ($(findstring zaptel-fw-oct6114-064,$(FIRMWARE)),)
-ifeq ($(shell if ( [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-oct6114-064-$(OCT6114_064_VERSION) ] ) && ( [ -f $(DESTDIR)/lib/firmware/.zaptel-fw-oct6114-064-$(OCT6114_064_VERSION) ] ); then echo "no"; else echo "yes"; fi),yes)
+ifeq ($(shell if ( [ -f $(DESTDIR)/$(LIBDIR)/hotplug/firmware/.zaptel-fw-oct6114-064-$(OCT6114_064_VERSION) ] ) && ( [ -f $(DESTDIR)/lib/firmware/.zaptel-fw-oct6114-064-$(OCT6114_064_VERSION) ] ); then echo "no"; else echo "yes"; fi),yes)
 	@echo "Installing zaptel-fw-oct6114-064.bin to hotplug firmware directories"
-	@$(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)
+	@$(INSTALL) -m 644 zaptel-fw-oct6114-064.bin $(DESTDIR)/$(LIBDIR)/hotplug/firmware
+	@rm -rf $(DESTDIR)/$(LIBDIR)/hotplug/firmware/.zaptel-fw-oct6114-064-*
+	@touch $(DESTDIR)/$(LIBDIR)/hotplug/firmware/.zaptel-fw-oct6114-064-$(OCT6114_064_VERSION)
 	@$(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)
@@ -101,11 +101,11 @@
 endif
 endif
 ifneq ($(findstring zaptel-fw-oct6114-128,$(FIRMWARE)),)
-ifeq ($(shell if ( [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-oct6114-128-$(OCT6114_128_VERSION) ] ) && ( [ -f $(DESTDIR)/lib/firmware/.zaptel-fw-oct6114-128-$(OCT6114_128_VERSION) ] ); then echo "no"; else echo "yes"; fi),yes)
+ifeq ($(shell if ( [ -f $(DESTDIR)/$(LIBDIR)/hotplug/firmware/.zaptel-fw-oct6114-128-$(OCT6114_128_VERSION) ] ) && ( [ -f $(DESTDIR)/lib/firmware/.zaptel-fw-oct6114-128-$(OCT6114_128_VERSION) ] ); then echo "no"; else echo "yes"; fi),yes)
 	@echo "Installing zaptel-fw-oct6114-128.bin to hotplug firmware directories"
-	@$(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)
+	@$(INSTALL) -m 644 zaptel-fw-oct6114-128.bin $(DESTDIR)/$(LIBDIR)/hotplug/firmware
+	@rm -rf $(DESTDIR)/$(LIBDIR)/hotplug/firmware/.zaptel-fw-oct6114-128-*
+	@touch $(DESTDIR)/$(LIBDIR)/hotplug/firmware/.zaptel-fw-oct6114-128-$(OCT6114_128_VERSION)
 	@$(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)
@@ -114,11 +114,11 @@
 endif
 endif
 ifneq ($(findstring zaptel-fw-tc400m,$(FIRMWARE)),)
-ifeq ($(shell if ( [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-tc400m-$(TC400M_VERSION) ] ) && ( [ -f $(DESTDIR)/lib/firmware/.zaptel-fw-tc400m-$(TC400M_VERSION) ] ); then echo "no"; else echo "yes"; fi),yes)
+ifeq ($(shell if ( [ -f $(DESTDIR)/$(LIBDIR)/hotplug/firmware/.zaptel-fw-tc400m-$(TC400M_VERSION) ] ) && ( [ -f $(DESTDIR)/lib/firmware/.zaptel-fw-tc400m-$(TC400M_VERSION) ] ); then echo "no"; else echo "yes"; fi),yes)
 	@echo "Installing zaptel-fw-tc400m.bin to hotplug firmware directories"
-	@$(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)
+	@$(INSTALL) -m 644 zaptel-fw-tc400m.bin $(DESTDIR)/$(LIBDIR)/hotplug/firmware
+	@rm -rf $(DESTDIR)/$(LIBDIR)/hotplug/firmware/.zaptel-fw-tc400m-*
+	@touch $(DESTDIR)/$(LIBDIR)/hotplug/firmware/.zaptel-fw-tc400m-$(TC400M_VERSION)
 	@$(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)
@@ -127,11 +127,11 @@
 endif
 endif
 ifneq ($(findstring zaptel-fw-vpmadt032,$(FIRMWARE)),)
-ifeq ($(shell if ( [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-vpmadt032-$(VPMADT032_VERSION) ] ) && ( [ -f $(DESTDIR)/lib/firmware/.zaptel-fw-vpmadt032-$(VPMADT032_VERSION) ] ); then echo "no"; else echo "yes"; fi),yes)
+ifeq ($(shell if ( [ -f $(DESTDIR)/$(LIBDIR)/hotplug/firmware/.zaptel-fw-vpmadt032-$(VPMADT032_VERSION) ] ) && ( [ -f $(DESTDIR)/lib/firmware/.zaptel-fw-vpmadt032-$(VPMADT032_VERSION) ] ); then echo "no"; else echo "yes"; fi),yes)
 	@echo "Installing zaptel-fw-vpmadt032.bin to hotplug firmware directories"
-	@$(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)
+	@$(INSTALL) -m 644 zaptel-fw-vpmadt032.bin $(DESTDIR)/$(LIBDIR)/hotplug/firmware
+	@rm -rf $(DESTDIR)/$(LIBDIR)/hotplug/firmware/.zaptel-fw-vpmadt032-*
+	@touch $(DESTDIR)/$(LIBDIR)/hotplug/firmware/.zaptel-fw-vpmadt032-$(VPMADT032_VERSION)
 	@$(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)
@@ -142,9 +142,9 @@
 
 # Uninstall any installed zaptel firmware images from hotplug firmware directories
 hotplug-uninstall:
-	if [ -d $(DESTDIR)/usr/lib/hotplug/firmware ]; then \
-		rm -f $(DESTDIR)/usr/lib/hotplug/firmware/zaptel-fw-*.bin; \
-		rm -f $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw*; \
+	if [ -d $(DESTDIR)/$(LIBDIR)/hotplug/firmware ]; then \
+		rm -f $(DESTDIR)/$(LIBDIR)/hotplug/firmware/zaptel-fw-*.bin; \
+		rm -f $(DESTDIR)/$(LIBDIR)/hotplug/firmware/.zaptel-fw*; \
 	fi
 	if [ -d $(DESTDIR)/lib/firmware ]; then \
 		rm -f $(DESTDIR)/lib/firmware/zaptel-fw-*.bin; \
--- Makefile.orig	2008-09-15 09:10:59.000000000 +0200
+++ Makefile	2008-09-15 09:11:21.000000000 +0200
@@ -479,7 +479,7 @@
 
 install-firmware: menuselect.makeopts
 ifeq ($(HOTPLUG_FIRMWARE),yes)
-	$(MAKE) -C firmware hotplug-install DESTDIR=$(DESTDIR) HOTPLUG_FIRMWARE=$(HOTPLUG_FIRMWARE)
+	$(MAKE) -C firmware hotplug-install DESTDIR=$(DESTDIR) LIBDIR=$(LIB_DIR) HOTPLUG_FIRMWARE=$(HOTPLUG_FIRMWARE)
 endif
 
 install-libs: libs
