summaryrefslogtreecommitdiffstats
path: root/classes
diff options
context:
space:
mode:
authorOtavio Salvador <otavio@ossystems.com.br>2020-03-27 20:23:44 -0300
committerOtavio Salvador <otavio@ossystems.com.br>2020-03-27 20:23:44 -0300
commit74eb1e5b9ca95c5c60136553fbc33c497490807a (patch)
treebca0bc67f56ccf460c5be7ac8b6b88b87af0e0f3 /classes
parent9418435542ce76a2346f1a4aa2cbbb429a5d3543 (diff)
downloadmeta-freescale-74eb1e5b9ca95c5c60136553fbc33c497490807a.tar.gz
Revert "fsl-eula-unpack.bbclass: Enhance EULA model"
This reverts commit 9418435542ce76a2346f1a4aa2cbbb429a5d3543.
Diffstat (limited to 'classes')
-rw-r--r--classes/fsl-eula-unpack.bbclass45
1 files changed, 1 insertions, 44 deletions
diff --git a/classes/fsl-eula-unpack.bbclass b/classes/fsl-eula-unpack.bbclass
index 51ef1085..ee571f52 100644
--- a/classes/fsl-eula-unpack.bbclass
+++ b/classes/fsl-eula-unpack.bbclass
@@ -6,18 +6,7 @@
6# 6#
7# SRC_URI = "${FSL_MIRROR}/firmware-imx-${PV};fsl-eula=true" 7# SRC_URI = "${FSL_MIRROR}/firmware-imx-${PV};fsl-eula=true"
8 8
9FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V24 = "ab61cab9599935bfe9f700405ef00f28" 9LIC_FILES_CHKSUM_append = " file://${FSL_EULA_FILE};md5=6c12031a11b81db21cdfe0be88cac4b3"
10FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V9 = "6c12031a11b81db21cdfe0be88cac4b3"
11FSL_EULA_FILE_MD5SUMS = \
12 "${FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V24} \
13 ${FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V9}"
14
15# The checksum for the EULA in the layer
16FSL_EULA_FILE_MD5SUM ?= \
17 "${FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V9}"
18
19LIC_FILES_CHKSUM_LAYER ?= "file://${FSL_EULA_FILE};md5=${FSL_EULA_FILE_MD5SUM}"
20LIC_FILES_CHKSUM_append = " ${LIC_FILES_CHKSUM_LAYER}"
21 10
22LIC_FILES_CHKSUM[vardepsexclude] += "FSL_EULA_FILE" 11LIC_FILES_CHKSUM[vardepsexclude] += "FSL_EULA_FILE"
23 12
@@ -37,7 +26,6 @@ python fsl_bin_do_unpack() {
37 rootdir = localdata.getVar('WORKDIR', True) 26 rootdir = localdata.getVar('WORKDIR', True)
38 fetcher = bb.fetch2.Fetch(src_uri, localdata) 27 fetcher = bb.fetch2.Fetch(src_uri, localdata)
39 28
40 found = 0
41 for url in fetcher.ud.values(): 29 for url in fetcher.ud.values():
42 # Skip this fetcher if it's not under EULA or if the fetcher type is not supported 30 # Skip this fetcher if it's not under EULA or if the fetcher type is not supported
43 if not url.parm.get('fsl-eula', False) or url.type not in ['http', 'https', 'ftp', 'file']: 31 if not url.parm.get('fsl-eula', False) or url.type not in ['http', 'https', 'ftp', 'file']:
@@ -46,40 +34,9 @@ python fsl_bin_do_unpack() {
46 if not os.path.exists(url.localpath): 34 if not os.path.exists(url.localpath):
47 bb.debug(1, "Exiting as '%s' cannot be found" % url.basename) 35 bb.debug(1, "Exiting as '%s' cannot be found" % url.basename)
48 return 36 return
49 found += 1
50 bb.note("Handling file '%s' as a Freescale EULA-licensed archive." % url.basename) 37 bb.note("Handling file '%s' as a Freescale EULA-licensed archive." % url.basename)
51 cmd = "sh %s --auto-accept --force" % (url.localpath) 38 cmd = "sh %s --auto-accept --force" % (url.localpath)
52 bb.fetch2.runfetchcmd(cmd, d, quiet=True, workdir=rootdir) 39 bb.fetch2.runfetchcmd(cmd, d, quiet=True, workdir=rootdir)
53
54 # Check for two EULAs, one from the layer and one from the package
55 bb.note("Checking LIC_FILES_CHKSUM for Freescale EULA consistency...")
56 if found > 1:
57 bb.warn("The package contains multiple Freescale EULA-licensed archives. The consistency logic may not be able to detect a EULA problem.")
58 layer_license = d.getVar('LIC_FILES_CHKSUM_LAYER')
59 licenses = d.getVar('LIC_FILES_CHKSUM') or ""
60 md5sums = d.getVar('FSL_EULA_FILE_MD5SUMS') or ""
61 found_layer_license = False
62 found_package_license = False
63 for license in licenses.split():
64 if license == layer_license:
65 bb.note("Found Freescale EULA for the layer %s." % license)
66 found_layer_license = True
67 continue
68 try:
69 (method, host, path, user, pswd, parm) = bb.fetch.decodeurl(license)
70 if method != "file" or not path:
71 raise bb.fetch.MalformedUrl()
72 except bb.fetch.MalformedUrl:
73 bb.fatal("%s: LIC_FILES_CHKSUM contains an invalid URL: %s" % (d.getVar('PF'), license))
74 if parm.get('md5') in md5sums:
75 bb.note("Found Freescale EULA for the package %s." % license)
76 found_package_license = True
77 if not found_layer_license:
78 bb.fatal("The Freescale layer EULA '%s' is not listed in LIC_FILES_CHKSUM '%s'."
79 % (layer_license, licenses))
80 if not found_package_license:
81 bb.fatal("A valid package EULA with md5sum in %s was not found in LIC_FILES_CHKSUM '%s'."
82 % (md5sums.split(), licenses))
83} 40}
84 41
85python do_unpack() { 42python do_unpack() {