summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2008-05-29 11:01:51 +0300
committerDavid Woodhouse <dwmw2@infradead.org>2008-06-30 10:46:20 +0100
commit6ca90f08bd549ca977c136bfd803ef68a0650640 (patch)
treee7696446b0bdf366f9e9c28ee41c91744caacf6e /scripts
parent2e7b45b0aef2ae83840a7acdb3f12b167b649d7e (diff)
firmware: Add 'firmware_install' make target
This installs all the in-kernel-tree firmware into $(INSTALL_FW_PATH), which defaults to $(objtree)/usr/lib/firmware and is intended end up in /lib/firmware for udev to find the files. This, in conjunction with the builtin-firmware support, makes it simple for drivers with associated firmware to move over to request_firmware() and give the user a choice of whether to have it built in to the kernel image or loaded separately from userspace. As with kernel header installation for userspace, it intentionally pays no attention to configuration variables -- it installs _all_ available firmware blobs, unconditionally. Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.fwinst26
1 files changed, 26 insertions, 0 deletions
diff --git a/scripts/Makefile.fwinst b/scripts/Makefile.fwinst
new file mode 100644
index 000000000000..d96941444934
--- /dev/null
+++ b/scripts/Makefile.fwinst
@@ -0,0 +1,26 @@
+# ==========================================================================
+# Installing firmware
+#
+# We don't include the .config, so all firmware files are in $(fw-shipped-)
+# rather than in $(fw-shipped-y) or $(fw-shipped-n).
+# ==========================================================================
+
+INSTALL := install
+
+include scripts/Kbuild.include
+include $(srctree)/$(obj)/Makefile
+
+installed-fw := $(addprefix $(INSTALL_FW_PATH)/,$(fw-shipped-))
+installed-fw-dirs := $(sort $(dir $(installed-fw)))
+
+quiet_cmd_install = INSTALL $(subst $(srctree)/,,$@)
+ cmd_install = $(INSTALL) -m0644 $< $@
+
+$(installed-fw-dirs):
+ $(call cmd,mkdir)
+
+$(installed-fw): $(INSTALL_FW_PATH)/%: $(obj)/% | $(INSTALL_FW_PATH)/$$(dir %)/
+ $(call cmd,install)
+
+.PHONY: __fw_install
+__fw_install: $(installed-fw)