[meta-xilinx] [PATCH 4/7] xilinx-bootbin: convert to a normal recipe

Manjukumar Harthikote Matha manjukumar.harthikote-matha at xilinx.com
Tue Jul 18 14:59:22 PDT 2017


Hi Jeff,

> -----Original Message-----
> From: Jean-Francois Dagenais [mailto:jeff.dagenais at gmail.com]
> Sent: Thursday, July 06, 2017 10:17 AM
> To: Manjukumar Harthikote Matha <MANJUKUM at xilinx.com>; Sai Pavan Boddu
> <saipava at xilinx.com>; Cyril Chemparathy <cyrilc at xilinx.com>
> Cc: git <git at xilinx.com>; michal.simek at xilinx.com; meta-xilinx at yoctoproject.org;
> Jean-Francois Dagenais <jeff.dagenais at gmail.com>
> Subject: [PATCH 4/7] xilinx-bootbin: convert to a normal recipe
>
> The BOOT.bin product cannot be made by a task attached to every image
> recipe like it is now because it means that each image recipe built,
> wheather sequencially or in parallel, will compete to overwrite the
> same BOOT.bin file in the DEPLOY_DIR_IMAGE directory.
>
> Plus, doing the boot.bin while making an initramfs makes no sense.
>
> Instead, the BOOT.bin product as a recipe on it's own, will behave
> better in the yocto build system.
>
> The recipe can be triggered through normal depencency at machine level,
> or as part of image_types dependencies, etc.
>
> For a wic made sdcard image, something like this works well at the:
> machine scope:
>
> do_image_wic[depends] += "\
> xilinx-bootbin:do_deploy \
> "
> IMAGE_BOOT_FILES = "\
>       BOOT.bin \
> ...
> "
>
> Signed-off-by: Jean-Francois Dagenais <jeff.dagenais at gmail.com>
> ---
>  classes/xilinx-bootbin.bbclass                 |  83 -------------------
>  conf/machine/include/machine-xilinx-zynqmp.inc |   2 -
>  recipes-bsp/bootbin/xilinx-bootbin_1.0.bb      | 105 +++++++++++++++++++++++++
>  3 files changed, 105 insertions(+), 85 deletions(-)
>  delete mode 100644 classes/xilinx-bootbin.bbclass
>  create mode 100644 recipes-bsp/bootbin/xilinx-bootbin_1.0.bb
>


<....>

> -    install -m 0644 BOOT.bin  ${DEPLOY_DIR_IMAGE}/BOOT.bin
> -}
> -addtask do_xilinx_bootbin after do_image_complete before do_build
> diff --git a/conf/machine/include/machine-xilinx-zynqmp.inc
> b/conf/machine/include/machine-xilinx-zynqmp.inc
> index c620813..5357741 100644
> --- a/conf/machine/include/machine-xilinx-zynqmp.inc
> +++ b/conf/machine/include/machine-xilinx-zynqmp.inc
> @@ -1,5 +1,3 @@
> -# add Boot.bin dependency
> -IMAGE_CLASSES_append ?= " xilinx-bootbin"

Added EXTRA_IMAGEDEPENDS += "xilinx-bootbin" so that it always builds boot.bin

>
>  # specify BIF common attribute for FSBL
>  BIF_COMMON_ATTR ?= "fsbl_config"
> diff --git a/recipes-bsp/bootbin/xilinx-bootbin_1.0.bb b/recipes-bsp/bootbin/xilinx-
> bootbin_1.0.bb
> new file mode 100644
> index 0000000..2aca94e
> --- /dev/null
> +++ b/recipes-bsp/bootbin/xilinx-bootbin_1.0.bb
> @@ -0,0 +1,105 @@
> +SUMMARY = "Generates boot.bin using bootgen tool"
> +DESCRIPTION = "Manages task dependencies and creation of boot.bin. Use the \
> +BIF_PARTITION_xyz global variables and flags to determine what makes it into \
> +the image."
> +
> +LICENSE = "BSD"
> +
> +inherit xsct-tc
> +inherit nopackages base deploy
> +
> +PACKAGE_ARCH = "${MACHINE_ARCH}"
> +
> +BIF_COMMON_ATTR ?= ''
> +BIF_PARTITION_ATTR ?= ''
> +BIF_PARTITION_IMAGE ?= ''
> +BIF_PARTITION_DEPENDS ?= ''
> +BIF_FILE_PATH = "${B}/bootgen.bif"
> +
> +# this recipe is almost like an image recipe, taken from image.bbclass:
> +deltask do_fetch
> +deltask do_unpack
> +deltask do_patch
> +#do_configure[noexec] = "1"
> +#do_compile[noexec] = "1"
> +do_install[noexec] = "1"
> +#deltask do_populate_sysroot
> +
> +def create_bif(config, attrflags, attrimage, common_attr, biffd, d):
> +    import re, os
> +    for cfg in config:
> +        if cfg not in attrflags and common_attr:
> +            error_msg = "%s: invalid ATTRIBUTE" % (cfg)
> +            bb.error("BIF attribute Error: %s " % (error_msg))
> +        else:
> +            if common_attr:
> +                cfgval = attrflags[cfg].split(',')
> +                cfgstr = "\t [%s] %s\n" % (cfg,', '.join(cfgval))
> +            else:
> +                if cfg not in attrimage:
> +                    error_msg = "%s: invalid or missing elf or image" % (cfg)
> +                    bb.error("BIF atrribute Error: %s " % (error_msg))
> +                imagestr = d.expand(attrimage[cfg])
> +                if os.stat(imagestr).st_size == 0:
> +                    bb.warn("Empty file %s, excluding from bif file" %(imagestr))
> +                    continue
> +                if cfg in attrflags:
> +                    cfgval = attrflags[cfg].split(',')
> +                    cfgstr = "\t [%s] %s\n" % (', '.join(cfgval), imagestr)
> +                else:
> +                    cfgstr = "\t %s\n" % (imagestr)
> +            biffd.write(cfgstr)
> +
> +    return
> +
> +python do_configure() {
> +

Trying to see if we can get rid of "python" keyword here.
This will be consistent like other recipes in Yocto.

<...>

Thanks,
Manju



This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.




More information about the meta-xilinx mailing list