summaryrefslogtreecommitdiff
path: root/meta-xilinx/meta-xilinx-bsp/classes/xilinx-fetch-restricted.bbclass
diff options
context:
space:
mode:
authorBrad Bishop <bradleyb@fuzziesquirrel.com>2018-10-02 22:21:57 +0300
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2018-10-02 22:25:59 +0300
commit286d45cc649a5b852a27b48e61b51bf75e9d1cee (patch)
tree90095cb0d2c571fd8de164caf2ca2f2e4d3f7247 /meta-xilinx/meta-xilinx-bsp/classes/xilinx-fetch-restricted.bbclass
parentd4b38429f6dec208547bf3d250a0c06f5d0fbcb2 (diff)
downloadopenbmc-286d45cc649a5b852a27b48e61b51bf75e9d1cee.tar.xz
Add meta-xilinx subtree
Import git://git.yoctoproject.org/meta-xilinx from 5fccc46503 as meta-xilinx subtree. Change-Id: I3d59bcf3a57cee588aab7f5cdd0287af66450c8a Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'meta-xilinx/meta-xilinx-bsp/classes/xilinx-fetch-restricted.bbclass')
-rw-r--r--meta-xilinx/meta-xilinx-bsp/classes/xilinx-fetch-restricted.bbclass35
1 files changed, 35 insertions, 0 deletions
diff --git a/meta-xilinx/meta-xilinx-bsp/classes/xilinx-fetch-restricted.bbclass b/meta-xilinx/meta-xilinx-bsp/classes/xilinx-fetch-restricted.bbclass
new file mode 100644
index 000000000..a778ec7dc
--- /dev/null
+++ b/meta-xilinx/meta-xilinx-bsp/classes/xilinx-fetch-restricted.bbclass
@@ -0,0 +1,35 @@
+# This class is setup to override the default fetching for the target recipe.
+# When fetching it forces PREMIRROR only fetching so that no attempts are made
+# to fetch the Xilinx downloads that are restricted to authenticated users only.
+#
+# The purpose of this class is to allow for automatation with pre-downloaded
+# content or content that is available with curated/user defined pre-mirrors
+# and or pre-populated downloads/ directories.
+
+python do_fetch() {
+ xilinx_restricted_url = "xilinx.com/member/forms/download"
+
+ src_uri = (d.getVar('SRC_URI') or "").split()
+ if len(src_uri) == 0:
+ return
+
+ for i in src_uri:
+ if xilinx_restricted_url in i:
+ # force the use of premirrors only, do not attempt download from xilinx.com
+ d.setVar("BB_FETCH_PREMIRRORONLY", "1")
+ break
+
+ try:
+ fetcher = bb.fetch2.Fetch(src_uri, d)
+ fetcher.download()
+ except bb.fetch2.NetworkAccess as e:
+ if xilinx_restricted_url in e.url:
+ # fatal on access to xilinx.com restricted downloads, print the url for manual download
+ bb.fatal("The following download cannot be fetched automatically. " \
+ "Please manually download the file and place it in the 'downloads' directory (or on an available PREMIRROR).\n" \
+ " %s" % (e.url.split(";")[0]))
+ else:
+ bb.fatal(str(e))
+ except bb.fetch2.BBFetchException as e:
+ bb.fatal(str(e))
+}