All of lore.kernel.org
 help / color / mirror / Atom feed
From: Otavio Salvador <otavio@ossystems.com.br>
To: meta-freescale Mailing List <meta-freescale@yoctoproject.org>
Cc: Otavio Salvador <otavio@ossystems.com.br>
Subject: [meta-fsl-arm PATCH 13/16] linux-mfgtool.inc: Build a Manufactoring Tool variant
Date: Mon, 24 Feb 2014 15:52:49 -0300	[thread overview]
Message-ID: <1393267973-4034-14-git-send-email-otavio@ossystems.com.br> (raw)
In-Reply-To: <1393267973-4034-1-git-send-email-otavio@ossystems.com.br>

This makes a separated binary set for Manufacturing Tool use without
clobbering the Linux Kernel used for normal use.

Signed-off-by: Otavio Salvador <otavio@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



  parent reply	other threads:[~2014-02-24 18:53 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-24 18:52 [meta-fsl-arm PATCH 0/16] Freescale MfgTool artifacts support Otavio Salvador
2014-02-24 18:52 ` [meta-fsl-arm PATCH 01/16] imx-uuc: Add 0.4 recipe Otavio Salvador
2014-02-24 19:01   ` Mario Domenech Goulart
2014-02-24 19:09     ` Otavio Salvador
2014-02-25 17:37   ` Daiane Angolini
2014-02-24 18:52 ` [meta-fsl-arm PATCH 02/16] imx-kobs: Upgrade to 3.10.17-1.0.0 version Otavio Salvador
2014-02-25 17:41   ` Daiane Angolini
2014-02-24 18:52 ` [meta-fsl-arm PATCH 03/16] packagegroup-fsl-mfgtool: Provide the required packages Otavio Salvador
2014-02-25 17:44   ` Daiane Angolini
2014-02-24 18:52 ` [meta-fsl-arm PATCH 04/16] u-boot-mfgtool.inc: Build a Manufactoring Tool variant Otavio Salvador
2014-02-25 17:51   ` Daiane Angolini
2014-02-25 18:23     ` Eric Nelson
2014-02-25 18:30       ` Gary Thomas
2014-02-25 18:54       ` Daiane Angolini
2014-02-25 19:12         ` Mario Domenech Goulart
2014-02-25 19:29           ` Daiane Angolini
2014-02-24 18:52 ` [meta-fsl-arm PATCH 05/16] u-boot-imx-mfgtool: Add 2013.04 version Otavio Salvador
2014-02-25 17:53   ` Daiane Angolini
2014-02-24 18:52 ` [meta-fsl-arm PATCH 06/16] imx6slevk: Add U-Boot Manufacturing Tool config Otavio Salvador
2014-02-25 17:59   ` Daiane Angolini
2014-02-24 18:52 ` [meta-fsl-arm PATCH 07/16] imx6dlsabreauto: " Otavio Salvador
2014-02-25 18:00   ` Daiane Angolini
2014-02-26  3:16     ` Otavio Salvador
2014-02-24 18:52 ` [meta-fsl-arm PATCH 08/16] imx6dlsabresd: " Otavio Salvador
2014-02-24 18:52 ` [meta-fsl-arm PATCH 09/16] imx6qsabreauto: " Otavio Salvador
2014-02-24 18:52 ` [meta-fsl-arm PATCH 10/16] imx6qsabresd: " Otavio Salvador
2014-02-24 18:52 ` [meta-fsl-arm PATCH 11/16] imx6solosabreauto: " Otavio Salvador
2014-02-24 18:52 ` [meta-fsl-arm PATCH 12/16] imx6solosabresd: " Otavio Salvador
2014-02-24 18:52 ` Otavio Salvador [this message]
2014-02-25 18:06   ` [meta-fsl-arm PATCH 13/16] linux-mfgtool.inc: Build a Manufactoring Tool variant Daiane Angolini
2014-02-26  3:46     ` Otavio Salvador
2014-02-26 12:53       ` Daiane.Angolini
2014-02-24 18:52 ` [meta-fsl-arm PATCH 14/16] linux-imx-mfgtool: Add 3.10.17 version Otavio Salvador
2014-02-25 18:07   ` Daiane Angolini
2014-02-24 18:52 ` [meta-fsl-arm PATCH 15/16] mfgtool-initramfs-image.bbclass: Abstracts the MfgTool's initramfs needs Otavio Salvador
2014-02-25 18:13   ` Daiane Angolini
2014-02-26 12:58     ` Otavio Salvador
2014-02-26 13:06       ` Otavio Salvador
2014-02-24 18:52 ` [meta-fsl-arm PATCH 16/16] fsl-image-mfgtool-initramfs: Add image Otavio Salvador
2014-02-25 18:15 ` [meta-fsl-arm PATCH 0/16] Freescale MfgTool artifacts support Daiane Angolini
2014-02-25 19:28   ` Daiane Angolini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1393267973-4034-14-git-send-email-otavio@ossystems.com.br \
    --to=otavio@ossystems.com.br \
    --cc=meta-freescale@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.