[meta-freescale] [meta-fsl-arm PATCH 13/16] linux-mfgtool.inc: Build a Manufactoring Tool variant

Daiane Angolini daiane.list at gmail.com
Tue Feb 25 10:06:14 PST 2014


On Mon, Feb 24, 2014 at 3:52 PM, Otavio Salvador
<otavio at ossystems.com.br> wrote:
> This makes a separated binary set for Manufacturing Tool use without
> clobbering the Linux Kernel used for normal use.

I don´t understand the script enough to comment.

We must elaborate a way to document a how-to for mfgtools. Maybe, we
should only add a comment on commit log (for example, for kernel
recipe and u-boot recipe) showing where the deliverable from this
recipe is placed, and what should I copy to mfg-tools dir tree in
order to get it working.

Not a mfg-tools related how-to, only a guide for the generated files.

Please, let me know what you think,


Daiane


>
> Signed-off-by: Otavio Salvador <otavio at ossystems.com.br>
> ---
>
>  recipes-kernel/linux/linux-mfgtool.inc | 74 ++++++++++++++++++++++++++++++++++
>  1 file changed, 74 insertions(+)
>  create mode 100644 recipes-kernel/linux/linux-mfgtool.inc
>
> diff --git a/recipes-kernel/linux/linux-mfgtool.inc b/recipes-kernel/linux/linux-mfgtool.inc
> new file mode 100644
> index 0000000..dd09552
> --- /dev/null
> +++ b/recipes-kernel/linux/linux-mfgtool.inc
> @@ -0,0 +1,74 @@
> +# Produces a Manufacturing Tool compatible Linux Kernel
> +#
> +# This makes a separated binary set for Manufacturing Tool use
> +# without clobbering the Linux Kernel used for normal use.
> +#
> +# This file must to be included after the original linux-imx.inc file
> +# as it overrides the needed values.
> +#
> +# Copyright (C) 2014 O.S. Systems Software LTDA.
> +
> +# Adjust provides
> +PROVIDES = "linux-mfgtool"
> +
> +# Avoid coliding files
> +LOCALVERSION_append = "-mfgtool"
> +KERNEL_SRC_PATH = "/usr/src/kernel-mfgtool"
> +KERNEL_IMAGE_BASE_NAME = "${KERNEL_IMAGETYPE}-mfgtool-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
> +KERNEL_IMAGE_SYMLINK_NAME = "${KERNEL_IMAGETYPE}-mfgtool-${MACHINE}"
> +MODULE_IMAGE_BASE_NAME = "modules-mfgtool-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
> +MODULE_TARBALL_SYMLINK_NAME = "modules-mfgtool-${MACHINE}.tgz"
> +
> +# Ensures we prefer our mfgtool specific files
> +FILESEXTRAPATHS_prepend = "${THISDIR}/${ORIG_PN}-${PV}:${THISDIR}/${ORIG_PN}:"
> +
> +python mfgtool_recipe_handler () {
> +    pn = e.data.getVar("PN", True)
> +    if not (pn.endswith("-mfgtool") or pn.startswith("mfgtool-")):
> +        return
> +
> +    e.data.setVar("MLPREFIX", "mfgtool-")
> +    e.data.setVar("ORIG_PN", e.data.getVar("PN", True))
> +    e.data.setVar("PN", "mfgtool-" + e.data.getVar("PN", True).replace("-mfgtool", "").replace("mfgtool-", ""))
> +}
> +
> +python () {
> +    pn = d.getVar("PN", True)
> +    if not pn.startswith("mfgtool-"):
> +        return
> +
> +    from oe.classextend import ClassExtender
> +
> +    class LinuxMfgToolExtender(ClassExtender):
> +        def extend_name(self, name):
> +            if name.startswith("rtld"):
> +                return name
> +            if name.endswith("-" + self.extname):
> +                name = name.replace("-" + self.extname, "")
> +            if name.startswith("virtual/"):
> +                subs = name.split("/", 1)[1]
> +                if not subs.startswith(self.extname):
> +                    return "virtual/" + self.extname + "-" + subs
> +                return name
> +            if not name.startswith(self.extname):
> +                return self.extname + "-" + name
> +            return name
> +
> +    clsextend = LinuxMfgToolExtender("mfgtool", d)
> +    clsextend.rename_packages()
> +    clsextend.rename_package_variables((d.getVar("PACKAGEVARS", True) or "").split())
> +
> +    clsextend.map_packagevars()
> +}
> +
> +addhandler mfgtool_recipe_handler
> +mfgtool_recipe_handler[eventmask] = "bb.event.RecipePreFinalise"
> +
> +# FIXME: We need to remove the KERNEL_SRC_PATH contents as
> +#        kernel.bbclass has no way to skip its installation.
> +# FIXME: It is not possible to have external modules against
> +#        this kernel variant.
> +do_install_append() {
> +       rm -r ${D}${KERNEL_SRC_PATH}
> +       rmdir ${D}/usr/src ${D}/usr
> +}
> --
> 1.9.0
>
> _______________________________________________
> meta-freescale mailing list
> meta-freescale at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/meta-freescale


More information about the meta-freescale mailing list