diff options
author | Tom Hochstein <tom.hochstein@nxp.com> | 2020-03-18 15:01:07 -0500 |
---|---|---|
committer | Otavio Salvador <otavio@ossystems.com.br> | 2020-04-10 14:54:00 -0300 |
commit | a9015f8b1116f253af58b185a89440486ceee131 (patch) | |
tree | e2078ab6e0f611f895e4ab4dd3c8d1d70b55ea1d /classes/fsl-eula-unpack.bbclass | |
parent | bd173142cc22d356d76bb74fbee15065faf299b8 (diff) | |
download | meta-freescale-a9015f8b1116f253af58b185a89440486ceee131.tar.gz |
fsl-eula-unpack.bbclass: Enhance EULA model
Each new version of the EULA is meant to be a click
through that includes any existing packages with an
older EULA. The latest EULA is also copied in the
layer.
Capture this model in the class by listing the
known EULAs and checking that any package
has a known EULA. The new model also allows
extensibility, so new EULAs can be introduced
separately.
Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
Diffstat (limited to 'classes/fsl-eula-unpack.bbclass')
-rw-r--r-- | classes/fsl-eula-unpack.bbclass | 79 |
1 files changed, 78 insertions, 1 deletions
diff --git a/classes/fsl-eula-unpack.bbclass b/classes/fsl-eula-unpack.bbclass index ee571f52..4ac65327 100644 --- a/classes/fsl-eula-unpack.bbclass +++ b/classes/fsl-eula-unpack.bbclass | |||
@@ -6,7 +6,53 @@ | |||
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 | ||
9 | LIC_FILES_CHKSUM_append = " file://${FSL_EULA_FILE};md5=6c12031a11b81db21cdfe0be88cac4b3" | 9 | FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V8 = "01ba08a2b77c3a0a9d0ab5d4d83fed64" |
10 | FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V10 = "3880bb9c943b135a30fad5e8aabd3ee9" | ||
11 | FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V11 = "a31dce3023402a821cfcdc1bb8dbdbc0" | ||
12 | FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V12 = "8cf95184c220e247b9917e7244124c5a" | ||
13 | FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V13 = "102094e9e695888c6a9f9fda9004165d" | ||
14 | FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V14 = "d4f548f93b5fe0ee2bc86758c344412d" | ||
15 | FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V16 = "be67a88e9e6c841043b005ad7bcf8309" | ||
16 | FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V17 = "88595f92466edd79be7f4f9547ffa0ef" | ||
17 | FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V18 = "6b552f505eedab4a11ab538cf3db743a" | ||
18 | FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V20 = "08fd295cce89b0a9c74b9b83ed74f671" | ||
19 | FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V21 = "6bd2df2910a2234bf6f419b7d2f531a3" | ||
20 | FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V22 = "75abe2fa1d16ca79f87cde926f05f72d" | ||
21 | FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V24 = "ab61cab9599935bfe9f700405ef00f28" | ||
22 | FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V26 = "5ab1a30d0cd181e3408077727ea5a2db" | ||
23 | FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V3 = "6dfb32a488e5fd6bae52fbf6c7ebb086" | ||
24 | FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V5 = "80c0478f4339af024519b3723023fe28" | ||
25 | FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V7 = "fb0303e4ee8b0e71c094171e2272bd44" | ||
26 | FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V8 = "72c0f70181bb6e83eee6aab8de12a9f3" | ||
27 | FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V9 = "6c12031a11b81db21cdfe0be88cac4b3" | ||
28 | FSL_EULA_FILE_MD5SUMS = " \ | ||
29 | ${FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V8} \ | ||
30 | ${FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V10} \ | ||
31 | ${FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V11} \ | ||
32 | ${FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V12} \ | ||
33 | ${FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V13} \ | ||
34 | ${FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V14} \ | ||
35 | ${FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V16} \ | ||
36 | ${FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V17} \ | ||
37 | ${FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V18} \ | ||
38 | ${FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V20} \ | ||
39 | ${FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V21} \ | ||
40 | ${FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V22} \ | ||
41 | ${FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V24} \ | ||
42 | ${FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V26} \ | ||
43 | ${FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V3} \ | ||
44 | ${FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V5} \ | ||
45 | ${FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V7} \ | ||
46 | ${FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V8} \ | ||
47 | ${FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V9} \ | ||
48 | " | ||
49 | |||
50 | # The checksum for the EULA in the layer | ||
51 | FSL_EULA_FILE_MD5SUM ?= \ | ||
52 | "${FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V9}" | ||
53 | |||
54 | LIC_FILES_CHKSUM_LAYER ?= "file://${FSL_EULA_FILE};md5=${FSL_EULA_FILE_MD5SUM}" | ||
55 | LIC_FILES_CHKSUM_append = " ${LIC_FILES_CHKSUM_LAYER}" | ||
10 | 56 | ||
11 | LIC_FILES_CHKSUM[vardepsexclude] += "FSL_EULA_FILE" | 57 | LIC_FILES_CHKSUM[vardepsexclude] += "FSL_EULA_FILE" |
12 | 58 | ||
@@ -26,6 +72,7 @@ python fsl_bin_do_unpack() { | |||
26 | rootdir = localdata.getVar('WORKDIR', True) | 72 | rootdir = localdata.getVar('WORKDIR', True) |
27 | fetcher = bb.fetch2.Fetch(src_uri, localdata) | 73 | fetcher = bb.fetch2.Fetch(src_uri, localdata) |
28 | 74 | ||
75 | found = 0 | ||
29 | for url in fetcher.ud.values(): | 76 | for url in fetcher.ud.values(): |
30 | # Skip this fetcher if it's not under EULA or if the fetcher type is not supported | 77 | # Skip this fetcher if it's not under EULA or if the fetcher type is not supported |
31 | if not url.parm.get('fsl-eula', False) or url.type not in ['http', 'https', 'ftp', 'file']: | 78 | if not url.parm.get('fsl-eula', False) or url.type not in ['http', 'https', 'ftp', 'file']: |
@@ -34,9 +81,39 @@ python fsl_bin_do_unpack() { | |||
34 | if not os.path.exists(url.localpath): | 81 | if not os.path.exists(url.localpath): |
35 | bb.debug(1, "Exiting as '%s' cannot be found" % url.basename) | 82 | bb.debug(1, "Exiting as '%s' cannot be found" % url.basename) |
36 | return | 83 | return |
84 | found += 1 | ||
37 | bb.note("Handling file '%s' as a Freescale EULA-licensed archive." % url.basename) | 85 | bb.note("Handling file '%s' as a Freescale EULA-licensed archive." % url.basename) |
38 | cmd = "sh %s --auto-accept --force" % (url.localpath) | 86 | cmd = "sh %s --auto-accept --force" % (url.localpath) |
39 | bb.fetch2.runfetchcmd(cmd, d, quiet=True, workdir=rootdir) | 87 | bb.fetch2.runfetchcmd(cmd, d, quiet=True, workdir=rootdir) |
88 | |||
89 | # Check for two EULAs, one from the layer and one from the package | ||
90 | bb.note("Checking LIC_FILES_CHKSUM for Freescale EULA consistency...") | ||
91 | if found > 1: | ||
92 | bb.warn("The package contains multiple Freescale EULA-licensed archives. The consistency logic may not be able to detect a EULA problem.") | ||
93 | layer_license = d.getVar('LIC_FILES_CHKSUM_LAYER') | ||
94 | licenses = d.getVar('LIC_FILES_CHKSUM') or "" | ||
95 | md5sums = d.getVar('FSL_EULA_FILE_MD5SUMS') or "" | ||
96 | found_layer_license = False | ||
97 | found_package_license = False | ||
98 | for license in licenses.split(): | ||
99 | try: | ||
100 | (method, host, path, user, pswd, parm) = bb.fetch.decodeurl(license) | ||
101 | if method != "file" or not path: | ||
102 | raise bb.fetch.MalformedUrl() | ||
103 | except bb.fetch.MalformedUrl: | ||
104 | bb.fatal("%s: LIC_FILES_CHKSUM contains an invalid URL: %s" % (d.getVar('PF'), license)) | ||
105 | if license == layer_license: | ||
106 | bb.note("Found Freescale EULA for the layer %s." % license) | ||
107 | found_layer_license = True | ||
108 | elif parm.get('md5') in md5sums: | ||
109 | bb.note("Found Freescale EULA for the package %s." % license) | ||
110 | found_package_license = True | ||
111 | if not found_layer_license: | ||
112 | bb.fatal("The Freescale layer EULA '%s' is not listed in LIC_FILES_CHKSUM '%s'." | ||
113 | % (layer_license, licenses)) | ||
114 | if not found_package_license: | ||
115 | bb.fatal("A valid package EULA with md5sum in %s was not found in LIC_FILES_CHKSUM '%s'." | ||
116 | % (md5sums.split(), licenses)) | ||
40 | } | 117 | } |
41 | 118 | ||
42 | python do_unpack() { | 119 | python do_unpack() { |