diff options
Diffstat (limited to 'classes')
-rw-r--r-- | classes/fsl-dynamic-packagearch.bbclass | 11 | ||||
-rw-r--r-- | classes/fsl-eula-unpack.bbclass | 101 | ||||
-rw-r--r-- | classes/fsl-kernel-localversion.bbclass | 17 | ||||
-rw-r--r-- | classes/fsl-u-boot-localversion.bbclass | 19 | ||||
-rw-r--r-- | classes/image_populate_mfgtool.bbclass | 139 | ||||
-rw-r--r-- | classes/image_types_fsl.bbclass | 14 | ||||
-rw-r--r-- | classes/imx-boot-container.bbclass | 35 | ||||
-rw-r--r-- | classes/mfgtool-initramfs-image.bbclass | 3 | ||||
-rw-r--r-- | classes/use-imx-security-controller-firmware.bbclass | 14 | ||||
-rw-r--r-- | classes/uuu_bootloader_tag.bbclass | 5 |
10 files changed, 285 insertions, 73 deletions
diff --git a/classes/fsl-dynamic-packagearch.bbclass b/classes/fsl-dynamic-packagearch.bbclass index 9fcf37be..6cb0c0a9 100644 --- a/classes/fsl-dynamic-packagearch.bbclass +++ b/classes/fsl-dynamic-packagearch.bbclass @@ -54,6 +54,17 @@ python __anonymous () { if not machine_socarch in cur_package_archs: d.appendVar("PACKAGE_EXTRA_ARCHS", " %s" % machine_socarch) + multilib_variants = (d.getVar("MULTILIB_VARIANTS") or "").split() + for variant in multilib_variants: + defaulttune = d.getVar("DEFAULTTUNE:virtclass-multilib-" + variant) + if defaulttune: + package_extra_archs_tune_archs = (d.getVar("PACKAGE_EXTRA_ARCHS:tune-" + defaulttune) or "").split() + arch_suffix = d.getVar("MACHINE_SOCARCH_SUFFIX") + for arch in package_extra_archs_tune_archs: + socarch = arch + arch_suffix + if not socarch in cur_package_archs: + d.appendVar("PACKAGE_EXTRA_ARCHS", " %s" % socarch ) + if d.getVar("TUNE_ARCH") == "arm": # For ARM we have two possible machine_socarch values, one for the arm and one for the thumb instruction set # add the other value to extra archs also, so that a image recipe searches both for packages. diff --git a/classes/fsl-eula-unpack.bbclass b/classes/fsl-eula-unpack.bbclass index 5fd18c2f..56d2844c 100644 --- a/classes/fsl-eula-unpack.bbclass +++ b/classes/fsl-eula-unpack.bbclass @@ -46,6 +46,19 @@ FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V32 = "17d2319de7baa686e8a755ba FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V33 = "e4098ac4459cb81b07d3f0c22b3e8370" FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V34 = "be5ff43682ed6c57dfcbeb97651c2829" FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V35 = "d3c315c6eaa43e07d8c130dc3a04a011" +FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V36 = "b54da624b8d2ffe8a3b47757da48e60f" +FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V37 = "37cb2d8c2bcf8bf2fbe0366d5d928c29" +FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V38 = "65c483bb431ccd9a1820e6872c604771" +FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V39 = "5a0bf11f745e68024f37b4724a5364fe" +FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V40 = "add2d392714d3096ed7e0f7e2190724b" +FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V42 = "ea25d099982d035af85d193c88a1b479" +FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V44 = "d7853b7bf2936b2c25c893eac7033374" +FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V45 = "63a38e9f392d8813d6f1f4d0d6fbe657" +FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V46 = "673fa34349fa40f59e0713cb0ac22b1f" +FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V47 = "9135422c7a38dac21bf1f858b6ef3bac" +FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V48 = "db4762b09b6bda63da103963e6e081de" +FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V49 = "2827219e81f28aba7c6a569f7c437fa7" + FSL_EULA_FILE_MD5SUMS = " \ ${FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V8} \ ${FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V10} \ @@ -87,11 +100,23 @@ FSL_EULA_FILE_MD5SUMS = " \ ${FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V33} \ ${FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V34} \ ${FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V35} \ + ${FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V36} \ + ${FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V37} \ + ${FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V38} \ + ${FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V39} \ + ${FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V40} \ + ${FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V42} \ + ${FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V44} \ + ${FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V45} \ + ${FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V46} \ + ${FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V47} \ + ${FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V48} \ + ${FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V49} \ " # The checksum for the EULA in the layer FSL_EULA_FILE_MD5SUM ?= \ - "${FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V35}" + "${FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V49}" LIC_FILES_CHKSUM_LAYER ?= "file://${FSL_EULA_FILE};md5=${FSL_EULA_FILE_MD5SUM}" LIC_FILES_CHKSUM_LAYER[vardepsexclude] += "FSL_EULA_FILE" @@ -104,13 +129,34 @@ do_fetch:prepend() { bb.fatal("The recipe LICENSE should include Proprietary but is " + d.getVar("LICENSE") + ".") } +do_unpack[vardepsexclude] += "FSL_EULA_FILE" +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) + + try: + bb.build.exec_func('base_do_unpack', d) + except: + raise + + bb.build.exec_func('fsl_bin_do_unpack', d) +} + 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) @@ -128,16 +174,28 @@ python fsl_bin_do_unpack() { bb.note("Handling file '%s' as a Freescale EULA-licensed archive." % url.basename) cmd = "sh %s --auto-accept --force" % (url.localpath) bb.fetch2.runfetchcmd(cmd, d, quiet=True, workdir=rootdir) + if not found: + bb.fatal("The recipe inherits 'fsl-eula-unpack.bbclass' but does not mark any URL in SRC_URI with the option 'fsl-eula=true'") # Check for two EULAs, one from the layer and one from the package bb.note("Checking LIC_FILES_CHKSUM for Freescale EULA consistency...") if found > 1: bb.warn("The package contains multiple Freescale EULA-licensed archives. The consistency logic may not be able to detect a EULA problem.") + (layer_license, licenses, md5sums, found_layer_licenses, found_package_licenses) = find_nxp_eula_licenses(d) + if not found_layer_licenses: + bb.fatal("The Freescale layer EULA '%s' is not listed in LIC_FILES_CHKSUM '%s'." + % (layer_license, licenses)) + if not found_package_licenses: + bb.fatal("A valid package EULA with md5sum in %s was not found in LIC_FILES_CHKSUM '%s'." + % (md5sums.split(), licenses)) +} + +def find_nxp_eula_licenses(d): layer_license = d.getVar('LIC_FILES_CHKSUM_LAYER') licenses = d.getVar('LIC_FILES_CHKSUM') or "" md5sums = d.getVar('FSL_EULA_FILE_MD5SUMS') or "" - found_layer_license = False - found_package_license = False + found_layer_licenses = "" + found_package_licenses = "" for license in licenses.split(): try: (method, host, path, user, pswd, parm) = bb.fetch.decodeurl(license) @@ -147,37 +205,8 @@ python fsl_bin_do_unpack() { bb.fatal("%s: LIC_FILES_CHKSUM contains an invalid URL: %s" % (d.getVar('PF'), license)) if license == layer_license: bb.note("Found Freescale EULA for the layer %s." % license) - found_layer_license = True + found_layer_licenses += license elif parm.get('md5') in md5sums: bb.note("Found Freescale EULA for the package %s." % license) - found_package_license = True - if not found_layer_license: - bb.fatal("The Freescale layer EULA '%s' is not listed in LIC_FILES_CHKSUM '%s'." - % (layer_license, licenses)) - if not found_package_license: - bb.fatal("A valid package EULA with md5sum in %s was not found in LIC_FILES_CHKSUM '%s'." - % (md5sums.split(), licenses)) -} - -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) - - try: - bb.build.exec_func('base_do_unpack', d) - except: - raise - - bb.build.exec_func('fsl_bin_do_unpack', d) -} - -do_unpack[vardepsexclude] += "FSL_EULA_FILE" + found_package_licenses += license + return (layer_license, licenses, md5sums, found_layer_licenses, found_package_licenses) diff --git a/classes/fsl-kernel-localversion.bbclass b/classes/fsl-kernel-localversion.bbclass index d4322e25..9ef0a62f 100644 --- a/classes/fsl-kernel-localversion.bbclass +++ b/classes/fsl-kernel-localversion.bbclass @@ -20,13 +20,24 @@ do_kernel_localversion() { # Fallback for recipes not able to use LINUX_VERSION_EXTENSION if [ "${@bb.data.inherits_class('kernel-yocto', d)}" = "False" ]; then - echo "CONFIG_LOCALVERSION=${LOCALVERSION}" >> ${B}/.config + echo 'CONFIG_LOCALVERSION="${LOCALVERSION}"' >> ${B}/.config fi if [ "${SCMVERSION}" = "y" ]; then # Add GIT revision to the local version - head=`git --git-dir=${S}/.git rev-parse --verify --short HEAD 2> /dev/null` - printf "%s%s" +g $head > ${S}/.scmversion + if [ "${SRCREV}" = "INVALID" ]; then + hash=${SRCREV_machine} + else + hash=${SRCREV} + fi + if [ "$hash" = "AUTOINC" ]; then + branch=`git --git-dir=${S}/.git symbolic-ref --short -q HEAD` + head=`git --git-dir=${S}/.git rev-parse --verify --short origin/${branch} 2> /dev/null` + else + head=`git --git-dir=${S}/.git rev-parse --verify --short $hash 2> /dev/null` + fi + patches=`git --git-dir=${S}/.git rev-list --count $head..HEAD 2> /dev/null` + printf "%s%s%s%s" +g $head +p $patches > ${S}/.scmversion sed -i -e "/CONFIG_LOCALVERSION_AUTO[ =]/d" ${B}/.config echo "CONFIG_LOCALVERSION_AUTO=y" >> ${B}/.config diff --git a/classes/fsl-u-boot-localversion.bbclass b/classes/fsl-u-boot-localversion.bbclass index ebde8ea7..94b30c04 100644 --- a/classes/fsl-u-boot-localversion.bbclass +++ b/classes/fsl-u-boot-localversion.bbclass @@ -17,10 +17,21 @@ UBOOT_LOCALVERSION = "${LOCALVERSION}" do_compile:prepend() { if [ "${SCMVERSION}" = "y" ]; then # Add GIT revision to the local version - head=`cd ${S} ; git rev-parse --verify --short HEAD 2> /dev/null` - printf "%s%s%s" "${UBOOT_LOCALVERSION}" +g $head > ${S}/.scmversion - printf "%s%s%s" "${UBOOT_LOCALVERSION}" +g $head > ${B}/.scmversion - else + if [ "${SRCREV}" = "INVALID" ]; then + hash=${SRCREV_machine} + else + hash=${SRCREV} + fi + if [ "$hash" = "AUTOINC" ]; then + branch=`git --git-dir=${S}/.git symbolic-ref --short -q HEAD` + head=`git --git-dir=${S}/.git rev-parse --verify --short origin/${branch} 2> /dev/null` + else + head=`git --git-dir=${S}/.git rev-parse --verify --short $hash 2> /dev/null` + fi + patches=`git --git-dir=${S}/.git rev-list --count $head..HEAD 2> /dev/null` + printf "%s%s%s%s" +g $head +p $patches > ${S}/.scmversion + printf "%s%s%s%s" +g $head +p $patches > ${B}/.scmversion + else printf "%s" "${UBOOT_LOCALVERSION}" > ${S}/.scmversion printf "%s" "${UBOOT_LOCALVERSION}" > ${B}/.scmversion fi diff --git a/classes/image_populate_mfgtool.bbclass b/classes/image_populate_mfgtool.bbclass new file mode 100644 index 00000000..d30b47a3 --- /dev/null +++ b/classes/image_populate_mfgtool.bbclass @@ -0,0 +1,139 @@ +# Allow generation of mfgtool bundle +# +# The class provides the infrastructure for MFGTOOL generation and is tied to images. To generate +# the bundle, the task populate_mfgtool must be called. For example: +# +# ,----[ Running populate_mfgtool for core-image-minimal image ] +# | $: bitbake core-image-minimal -c populate_mfgtool +# `---- +# +# The class behavior is controlled through the MFGTOOLCONFIG (analogous to PACKAGECONFIG) +# variable. The MFGTOOLCONFIG variable itself specifies a space-separated list of the script to +# enable. Following the script, you can determine the behavior of each script by providing up to two +# order-dependent arguments, which are separated by commas. You can omit any argument you like but +# must retain the separating commas. The order is important and specifies the following: +# +# 1. Extra dependencies that should be added to the do_populate_mfgtool task, if the script is +# enabled. +# 2. Extra binaries that should be added to the bundle, if the script is enabled. +# +# For example: +# +# ,----[ Defining foo.uuu.in and bar.uuu script ] +# | MFGTOOLCONFIG = "foo.uuu.in bar.uuu" +# | MFGTOOLCONFIG[foo.uuu.in] = "dep-foo1:do_deploy dep-foo2:do_deploy,file-foo1" +# | MFGTOOLCONFIG[bar.uuu] = "dep-bar1:do_deploy,file-bar1 file-bar2" +# `---- +# +# The dep-foo1:do_deploy, dep-foo2:do_deploy, and dep-bar1:do_deploy are added to +# do_populate_mfgtool dependencies. In addition, file-foo1, file-bar1, and file-bar2 are copied to +# the bundle, only if the script is enabled. +# +# During the mfgtool bundle generation, the uuu.in files are processed and some variables +# replaced. The variables are: +# +# - MACHINE +# - UBOOT_BINARY +# - SPL_BINARY +# - IMAGE_BASENAME +# +# Copyright 2022-2023 (C) O.S. Systems Software LTDA. +# +# SPDX-License-Identifier: MIT + +MFGTOOL_FILESPATH ??= " \ + ${@base_set_filespath(["%s/mfgtool" % p for p in "${BBPATH}".split(":")] \ + + ["${FILE_DIRNAME}/${BP}/mfgtool", \ + "${FILE_DIRNAME}/${BPN}/mfgtool", \ + "${FILE_DIRNAME}/files/mfgtool"] \ + , d)} \ +" + +MFGTOOLDIR = "${WORKDIR}/mfgtool-${PN}" +do_populate_mfgtool[dirs] += "${MFGTOOLDIR}" +do_populate_mfgtool[cleandirs] = "${MFGTOOLDIR}" + +addtask populate_mfgtool after do_image_complete do_unpack before do_deploy +do_populate_mfgtool[nostamp] = "1" +do_populate_mfgtool[dirs] += "${DEPLOY_DIR_IMAGE} ${WORKDIR}" +do_populate_mfgtool[recrdeptask] += "do_deploy" +do_populate_mfgtool[depends] += "uuu-bin:do_populate_sysroot" + +python () { + depends = [] + deploy_files = "" + scripts = (d.getVar('MFGTOOLCONFIG') or "").split() + scripts_and_flags = d.getVarFlags('MFGTOOLCONFIG') or {} + for flag, flagval in sorted(scripts_and_flags.items()): + items = flagval.split(",") + num = len(items) + if num > 2: + bb.error("%s: MFGTOOLCONFIG[%s] Only \"depends,deploy files\" can be specified!" % (d.getVar("PN"), flag)) + + if flag in scripts: + if num >= 2 and items[1]: + deploy_files += ' ' + items[1] + if num >= 1 and items[0]: + depends.append(items[0]) + + d.appendVarFlag('do_populate_mfgtool', 'depends', ' ' + ' '.join(depends)) + d.setVar('_SCRIPT_DEPLOY_FILES', ' '.join(sorted(list(set(deploy_files.split()))))) +} + +python do_populate_mfgtool() { + # For MFGTOOLCONFIG items we use BitBake's fetcher module allowing a consistent behavior. + scripts = (d.getVar('MFGTOOLCONFIG') or "").split() + src_uri = ["file://%s" % f for f in scripts] + if not src_uri: + bb.fatal("MFGTOOLCONFIG is empty so populate_mfgtool cannot be run.") + return + bb.debug(1, "following scripts are used: %s" % ', '.join(scripts)) + + localdata = bb.data.createCopy(d) + filespath = (d.getVar('MFGTOOL_FILESPATH') or "") + localdata.setVar('FILESPATH', filespath) + + try: + fetcher = bb.fetch2.Fetch(src_uri, localdata) + fetcher.unpack(localdata.getVar('WORKDIR')) + except bb.fetch2.BBFetchException as e: + bb.fatal("BitBake Fetcher Error: " + repr(e)) + + # Generate MFGTOOL bundle. + bb.build.exec_func('generate_mfgtool_bundle', d) +} + +generate_mfgtool_bundle() { + bbnote "Processing uuu files ..." + for src in $(ls -1 ${WORKDIR}/*.uuu.in); do + dest=$(echo $src | sed 's,.in$,,g') + bbnote " - $src -> $dest" + sed -e 's/@@MACHINE@@/${MACHINE}/g' \ + -e "s,@@UBOOT_BINARY@@,${UBOOT_BINARY},g" \ + -e "s,@@SPL_BINARY@@,${SPL_BINARY},g" \ + -e "s,@@IMAGE_BASENAME@@,${IMAGE_BASENAME},g" \ + $src > $dest + done + + bbnote "Deploying uuu files ..." + for src in $(ls -1 ${WORKDIR}/*.uuu); do + dest=$(basename $src) + bbnote " - $src -> ${MFGTOOLDIR}/${PN}-${MACHINE}/$dest" + install -D -m 0644 $src ${MFGTOOLDIR}/${PN}-${MACHINE}/$dest + done + + bbnote "Copying uuu binaries..." + cp -v -s ${STAGING_LIBDIR}/uuu/* ${MFGTOOLDIR}/${PN}-${MACHINE}/ + + bbnote "Copying MFGTOOL extra deploy files..." + for f in ${_SCRIPT_DEPLOY_FILES}; do + mkdir -p ${MFGTOOLDIR}/${PN}-${MACHINE}/binaries + cp -v -s ${DEPLOY_DIR_IMAGE}/$f ${MFGTOOLDIR}/${PN}-${MACHINE}/binaries/ + done + + tar -czf ${DEPLOY_DIR_IMAGE}/mfgtool-bundle-${PN}-${MACHINE}.tar.gz \ + --dereference -C ${MFGTOOLDIR} ${PN}-${MACHINE} + + ln -fs mfgtool-bundle-${PN}-${MACHINE}.tar.gz \ + ${DEPLOY_DIR_IMAGE}/mfgtool-bundle-${PN}.tar.gz +} diff --git a/classes/image_types_fsl.bbclass b/classes/image_types_fsl.bbclass index cdfbb97e..63a10f30 100644 --- a/classes/image_types_fsl.bbclass +++ b/classes/image_types_fsl.bbclass @@ -13,9 +13,9 @@ do_image_uboot_mxsboot_sdcard[depends] += "u-boot-mxsboot-native:do_populate_sys u-boot:do_deploy" IMAGE_CMD:uboot-mxsboot-sdcard() { mxsboot sd ${DEPLOY_DIR_IMAGE}/u-boot-${MACHINE}.${UBOOT_SUFFIX} \ - ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.uboot-mxsboot-sdcard - ln -sf ${IMAGE_NAME}.rootfs.uboot-mxsboot-sdcard \ - ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.rootfs.uboot-mxsboot-sdcard + ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.uboot-mxsboot-sdcard + ln -sf ${IMAGE_NAME}.uboot-mxsboot-sdcard \ + ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.uboot-mxsboot-sdcard } # U-Boot mxsboot generation for NAND @@ -24,9 +24,9 @@ do_image_uboot_mxsboot_nand[depends] += "u-boot-mxsboot-native:do_populate_sysro IMAGE_CMD:uboot-mxsboot-nand() { mxsboot ${MXSBOOT_NAND_ARGS} nand \ ${DEPLOY_DIR_IMAGE}/u-boot-${MACHINE}.${UBOOT_SUFFIX} \ - ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.uboot-mxsboot-nand - ln -sf ${IMAGE_NAME}.rootfs.uboot-mxsboot-nand \ - ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.rootfs.uboot-mxsboot-nand + ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.uboot-mxsboot-nand + ln -sf ${IMAGE_NAME}.uboot-mxsboot-nand \ + ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.uboot-mxsboot-nand } # In case we are building for i.MX23 or i.MX28 we need to have the @@ -40,5 +40,5 @@ do_image_wic[depends] += " \ IMAGE_CMD:wic:append:mxs-generic-bsp() { # Change partition type for mxs processor family bbnote "Setting partition type to 0x53 as required for mxs' SoC family." - echo -n S | dd of=$out${IMAGE_NAME_SUFFIX}.wic bs=1 count=1 seek=450 conv=notrunc + echo -n S | dd of=$out.wic bs=1 count=1 seek=450 conv=notrunc } diff --git a/classes/imx-boot-container.bbclass b/classes/imx-boot-container.bbclass index a420b4c4..53c70a0b 100644 --- a/classes/imx-boot-container.bbclass +++ b/classes/imx-boot-container.bbclass @@ -18,8 +18,7 @@ # # Class inheritance is performed in u-boot-fslc recipe, and is controlled # by variable UBOOT_PROVIDES_BOOT_CONTAINER, which is defined in the -# base machine include file (imx-base.inc), and is set to "1" when the -# 'imx-boot-container' is present in MACHINEOVERRIDES. +# base machine include file (imx-base.inc). # # NOTE: A backwards-compatible symlink is added for 'flash.bin', named # 'imx-boot', during the deployment task. @@ -28,6 +27,16 @@ ATF_MACHINE_NAME = "bl31-${ATF_PLATFORM}.bin" ATF_MACHINE_NAME:append = "${@bb.utils.contains('MACHINE_FEATURES', 'optee', '-optee', '', d)}" +IMX_BOOT_CONTAINER_FIRMWARE_SOC = "" +IMX_BOOT_CONTAINER_FIRMWARE_SOC:mx8mq-generic-bsp = " \ + signed_dp_imx8m.bin \ + signed_hdmi_imx8m.bin \ +" +IMX_BOOT_CONTAINER_FIRMWARE ?= " \ + ${IMX_BOOT_CONTAINER_FIRMWARE_SOC} \ + ${DDR_FIRMWARE_NAME} \ +" + # This package aggregates output deployed by other packages, so set the # appropriate dependencies for populate binaries task do_resolve_and_populate_binaries[depends] += " \ @@ -45,9 +54,9 @@ do_resolve_and_populate_binaries() { for type in ${UBOOT_CONFIG}; do j=$(expr $j + 1); if [ $j -eq $i ]; then - for ddr_firmware in ${DDR_FIRMWARE_NAME}; do - bbnote "Copy ddr_firmware: ${ddr_firmware} from ${DEPLOY_DIR_IMAGE} -> ${B}/${config}/${ddr_firmware_name}" - cp ${DEPLOY_DIR_IMAGE}/${ddr_firmware} ${B}/${config}/ + for firmware in ${IMX_BOOT_CONTAINER_FIRMWARE}; do + bbnote "Copy firmware: ${firmware} from ${DEPLOY_DIR_IMAGE} -> ${B}/${config}/" + cp ${DEPLOY_DIR_IMAGE}/${firmware} ${B}/${config}/ done if [ -n "${ATF_MACHINE_NAME}" ]; then cp ${DEPLOY_DIR_IMAGE}/${ATF_MACHINE_NAME} ${B}/${config}/bl31.bin @@ -83,14 +92,14 @@ do_deploy:append() { then install -m 0644 ${B}/${config}/flash.bin ${DEPLOYDIR}/flash.bin-${MACHINE}-${type} # When there's more than one word in UBOOT_CONFIG, - # this will overwrite the links created in - # previous loop iterations, effectively making - # u-boot.itb and flash.bin correspond to the _last_ - # word in UBOOT_CONFIG. This is also how all other - # artifacts handled by oe-core's u-boot.inc are - # treated. - ln -sf flash.bin-${MACHINE}-${type} flash.bin - ln -sf flash.bin-${MACHINE}-${type} imx-boot + # the first UBOOT_CONFIG listed will be the imx-boot binary + if [ ! -f "${DEPLOYDIR}/imx-boot" ]; then + ln -sf flash.bin-${MACHINE}-${type} flash.bin + ln -sf flash.bin-${MACHINE}-${type} imx-boot + + else + bbwarn "Use custom wks.in for $UBOOT_CONFIG = $type" + fi fi done unset j diff --git a/classes/mfgtool-initramfs-image.bbclass b/classes/mfgtool-initramfs-image.bbclass index c8c9e22b..f338bf82 100644 --- a/classes/mfgtool-initramfs-image.bbclass +++ b/classes/mfgtool-initramfs-image.bbclass @@ -6,7 +6,7 @@ # # Copyright 2014-2017 (C) O.S. Systems Software LTDA. -DEPENDS += "u-boot-mfgtool linux-mfgtool" +DEPENDS += "linux-mfgtool" FEATURE_PACKAGES_mtd = "packagegroup-fsl-mfgtool-mtd" FEATURE_PACKAGES_extfs = "packagegroup-fsl-mfgtool-extfs" @@ -16,6 +16,7 @@ ZSTD_COMPRESSION_LEVEL ?= "-10" SOC_DEFAULT_IMAGE_FSTYPES = "cpio.zst.u-boot" SOC_DEFAULT_IMAGE_FSTYPES:mxs-generic-bsp = "cpio.gz.u-boot" IMAGE_ROOTFS_SIZE ?= "8192" +IMAGE_NAME_SUFFIX = "" # Filesystems enabled by default DEFAULT_FS_SUPPORT = " \ diff --git a/classes/use-imx-security-controller-firmware.bbclass b/classes/use-imx-security-controller-firmware.bbclass index eb88fb99..f07580dd 100644 --- a/classes/use-imx-security-controller-firmware.bbclass +++ b/classes/use-imx-security-controller-firmware.bbclass @@ -16,13 +16,13 @@ # This behavior ensures that derivatives which requires SECO Firmware to be # present in the image file have it properly defined. -SECO_FIRMWARE_NAME ?= "" -SECO_FIRMWARE_NAME:mx8qm-nxp-bsp = "mx8qmb0-ahab-container.img" -SECO_FIRMWARE_NAME:mx8qxp-nxp-bsp = \ - "${@bb.utils.contains('MACHINE_FEATURES', 'soc-revb0', 'mx8qxb0-ahab-container.img', \ - 'mx8qxc0-ahab-container.img', d)}" -SECO_FIRMWARE_NAME:mx8dx-nxp-bsp = "mx8qxc0-ahab-container.img" -SECO_FIRMWARE_NAME:mx8dxl-nxp-bsp = "mx8dxla1-ahab-container.img" +SECO_FIRMWARE_NAME ?= "" +SECO_FIRMWARE_NAME:mx8qm-generic-bsp ?= "mx8qm${IMX_SOC_REV_LOWER}-ahab-container.img" +SECO_FIRMWARE_NAME:mx8qxp-generic-bsp ?= "mx8qx${IMX_SOC_REV_LOWER}-ahab-container.img" +SECO_FIRMWARE_NAME:mx8dx-generic-bsp ?= "mx8qx${IMX_SOC_REV_LOWER}-ahab-container.img" +SECO_FIRMWARE_NAME:mx8dxl-generic-bsp ?= "mx8dxl${IMX_SOC_REV_LOWER}-ahab-container.img" +SECO_FIRMWARE_NAME:mx8ulp-generic-bsp ?= "mx8ulp${IMX_SOC_REV_LOWER}-ahab-container.img" +SECO_FIRMWARE_NAME:mx93-generic-bsp ?= "mx93${IMX_SOC_REV_LOWER}-ahab-container.img" python () { if "mx8m-generic-bsp" in d.getVar('MACHINEOVERRIDES').split(":"): diff --git a/classes/uuu_bootloader_tag.bbclass b/classes/uuu_bootloader_tag.bbclass index fb6acd72..87745660 100644 --- a/classes/uuu_bootloader_tag.bbclass +++ b/classes/uuu_bootloader_tag.bbclass @@ -4,8 +4,9 @@ do_deploy:append() { if [ "${UUU_BOOTLOADER}" != "" ]; then cp ${DEPLOYDIR}/${UUU_BOOTLOADER} ${DEPLOYDIR}/${UUU_BOOTLOADER_TAGGED} + cp ${DEPLOYDIR}/${UUU_BOOTLOADER} ${DEPLOYDIR}/${UUU_BOOTLOADER_UNTAGGED} ln -sf ${UUU_BOOTLOADER_TAGGED} ${DEPLOYDIR}/${UUU_BOOTLOADER} - stat -L -cUUUBURNXXOEUZX7+A-XY5601QQWWZ%sEND ${DEPLOYDIR}/${UUU_BOOTLOADER} \ - >> ${DEPLOYDIR}/${UUU_BOOTLOADER} + stat -L -cUUUBURNXXOEUZX7+A-XY5601QQWWZ%sEND ${DEPLOYDIR}/${UUU_BOOTLOADER_TAGGED} \ + >> ${DEPLOYDIR}/${UUU_BOOTLOADER_TAGGED} fi } |