mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tadeusz Struk <tadeusz.struk@intel.com>
To: linux-firmware@kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] firmware: Automatically pull missing FW files
Date: Wed, 20 Aug 2014 11:21:45 -0700	[thread overview]
Message-ID: <20140820182145.15596.86122.stgit@tstruk-mobl1> (raw)

Hi,
When a binary FW file is not present in the firmware dir then the build
will fail. This patch enables auto-download any missing FW file for both shipped
and external targets.
Generated against linux-next.

Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
---
 firmware/Makefile |   25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)

diff --git a/firmware/Makefile b/firmware/Makefile
index 5747417..3ad12f6 100644
--- a/firmware/Makefile
+++ b/firmware/Makefile
@@ -178,10 +178,31 @@ wordsize_deps := $(wildcard include/config/64bit.h include/config/32bit.h \
 		include/config/superh32.h include/config/superh64.h \
 		include/config/x86_32.h include/config/x86_64.h)
 
-$(patsubst %,$(obj)/%.gen.S, $(fw-shipped-y)): %: $(wordsize_deps)
+FW_URL := git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/plain
+
+.NOTPARALLEL: get_missing_external $(patsubst %,$(obj)/%.gen.S, $(fw-external-y))
+.NOTPARALLEL: get_missing_shipped $(patsubst %,$(obj)/%.gen.S, $(fw-shipped-y))
+
+get_missing_shipped:
+	@for file in $(fw-shipped-y) $(fw-shipped-m); do \
+		if [ ! -f $(obj)/$$file ]; then \
+			wget $(FW_URL)/$$file -o /dev/null -O $(obj)/$$file; \
+		fi; \
+	done;
+
+get_missing_external:
+	@for file in $(fw-external-y); do \
+		if [ ! -f $(obj)/$$file ]; then \
+			wget $(FW_URL)/$$file -o /dev/null -O $(obj)/$$file; \
+		fi; \
+	done;
+
+$(patsubst %,$(obj)/%.gen.S, $(fw-shipped-y)): %: $(wordsize_deps) \
+		get_missing_shipped
 	$(call cmd,fwbin,$(patsubst %.gen.S,%,$@))
+
 $(patsubst %,$(obj)/%.gen.S, $(fw-external-y)): %: $(wordsize_deps) \
-		include/config/extra/firmware/dir.h
+		include/config/extra/firmware/dir.h get_missing_external
 	$(call cmd,fwbin,$(fwabs)/$(patsubst $(obj)/%.gen.S,%,$@))
 
 # The .o files depend on the binaries directly; the .S files don't.


             reply	other threads:[~2014-08-20 18:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-20 18:21 Tadeusz Struk [this message]
2014-08-20 18:34 ` David Woodhouse
2014-08-20 19:21   ` Tadeusz Struk
2014-08-20 20:17     ` Valdis.Kletnieks
2014-08-20 20:39     ` David Woodhouse
2014-08-20 20:48       ` Tadeusz Struk
2014-08-21 12:31         ` Henrique de Moraes Holschuh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140820182145.15596.86122.stgit@tstruk-mobl1 \
    --to=tadeusz.struk@intel.com \
    --cc=linux-firmware@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome