mirror of
https://github.com/nxp-imx/meta-imx.git
synced 2025-12-14 14:36:02 +01:00
Revert "layer: Adapt to improved EULA handling model [YOCIMX-4322, YOCIMX-4323]"
The upstream change was reverted, so revert this for now.
This reverts commit 349cc26118.
This commit is contained in:
parent
f964a21920
commit
0f51ac3728
73
meta-bsp/classes/fsl-eula-unpack.bbclass
Normal file
73
meta-bsp/classes/fsl-eula-unpack.bbclass
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
# fsl-eula-unpack.bbclass provides the mechanism used for unpacking
|
||||
# the .bin file downloaded by HTTP and handle the EULA acceptance.
|
||||
#
|
||||
# To use it, the 'fsl-eula' parameter needs to be added to the
|
||||
# SRC_URI entry, e.g:
|
||||
#
|
||||
# SRC_URI = "${FSL_MIRROR}/firmware-imx-${PV};fsl-eula=true"
|
||||
|
||||
LIC_FILES_CHKSUM_append = " file://${FSL_EULA_FILE};md5=228c72f2a91452b8a03c4cab30f30ef9"
|
||||
|
||||
LIC_FILES_CHKSUM[vardepsexclude] += "FSL_EULA_FILE"
|
||||
|
||||
do_fetch_prepend() {
|
||||
if "Proprietary" not in d.getVar("LICENSE"):
|
||||
bb.fatal("The recipe LICENSE should include Proprietary but is " + d.getVar("LICENSE") + ".")
|
||||
}
|
||||
|
||||
python fsl_bin_do_unpack() {
|
||||
src_uri = (d.getVar('SRC_URI') or "").split()
|
||||
if len(src_uri) == 0:
|
||||
return
|
||||
|
||||
localdata = bb.data.createCopy(d)
|
||||
bb.data.update_data(localdata)
|
||||
|
||||
rootdir = localdata.getVar('WORKDIR', True)
|
||||
fetcher = bb.fetch2.Fetch(src_uri, localdata)
|
||||
|
||||
for url in fetcher.ud.values():
|
||||
save_cwd = os.getcwd()
|
||||
# Check for supported fetchers
|
||||
if url.type in ['http', 'https', 'ftp', 'file']:
|
||||
if url.parm.get('fsl-eula', False):
|
||||
# If download has failed, do nothing
|
||||
if not os.path.exists(url.localpath):
|
||||
bb.debug(1, "Exiting as '%s' cannot be found" % url.basename)
|
||||
return
|
||||
|
||||
# Change to the working directory
|
||||
bb.note("Handling file '%s' as a Freescale's EULA binary." % url.basename)
|
||||
save_cwd = os.getcwd()
|
||||
os.chdir(rootdir)
|
||||
|
||||
cmd = "sh %s --auto-accept --force" % (url.localpath)
|
||||
bb.fetch2.runfetchcmd(cmd, d, quiet=True)
|
||||
|
||||
# Return to the previous directory
|
||||
os.chdir(save_cwd)
|
||||
}
|
||||
|
||||
python do_unpack() {
|
||||
eula = d.getVar('ACCEPT_FSL_EULA')
|
||||
eula_file = d.getVar('FSL_EULA_FILE')
|
||||
pkg = d.getVar('PN')
|
||||
if eula == None:
|
||||
bb.fatal("To use '%s' you need to accept the Freescale EULA at '%s'. "
|
||||
"Please read it and in case you accept it, write: "
|
||||
"ACCEPT_FSL_EULA = \"1\" in your local.conf." % (pkg, eula_file))
|
||||
elif eula == '0':
|
||||
bb.fatal("To use '%s' you need to accept the Freescale EULA." % pkg)
|
||||
else:
|
||||
bb.note("Freescale EULA has been accepted for '%s'" % pkg)
|
||||
|
||||
# The binary unpack needs to be done first so 'S' is valid
|
||||
bb.build.exec_func('fsl_bin_do_unpack', d)
|
||||
|
||||
try:
|
||||
bb.build.exec_func('base_do_unpack', d)
|
||||
except:
|
||||
raise
|
||||
}
|
||||
|
||||
do_unpack[vardepsexclude] += "FSL_EULA_FILE"
|
||||
|
|
@ -10,19 +10,6 @@ BBFILE_PATTERN_fsl-bsp-release := "^${LAYERDIR}"
|
|||
BBFILE_PRIORITY_fsl-bsp-release = "8"
|
||||
LAYERSERIES_COMPAT_fsl-bsp-release = "warrior zeus"
|
||||
|
||||
# Define new EULAs and add them to the list defined in meta-freescale.
|
||||
# See fsl-eula-unpack.bbclass.
|
||||
FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V10 = "fd4b227530cd88a82af6a5982cfb724d"
|
||||
FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V11 = "228c72f2a91452b8a03c4cab30f30ef9"
|
||||
FSL_EULA_FILE_MD5SUMS_append = " \
|
||||
${FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V10} \
|
||||
${FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V11} \
|
||||
"
|
||||
|
||||
# Override the EULA defined in meta-freescale.
|
||||
FSL_EULA_FILE = "${LAYERDIR}/EULA.txt"
|
||||
FSL_EULA_FILE_MD5SUM = "${FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V11}"
|
||||
|
||||
HOSTTOOLS_NONFATAL_append = " bc rsync xxd"
|
||||
|
||||
# optee is no longer a valid distro feature. Use machine feature to remove, like this:
|
||||
|
|
|
|||
|
|
@ -115,6 +115,9 @@ imx8*)
|
|||
;;
|
||||
esac
|
||||
|
||||
# copy new EULA into community so setup uses latest i.MX EULA
|
||||
cp sources/meta-imx/EULA.txt sources/meta-freescale/EULA
|
||||
|
||||
# Set up the basic yocto environment
|
||||
if [ -z "$DISTRO" ]; then
|
||||
DISTRO=$FSLDISTRO MACHINE=$MACHINE . ./$PROGNAME $BUILD_DIR
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user