diff options
author | Marc Ferland <ferlandm@amotus.ca> | 2018-08-06 15:18:25 -0400 |
---|---|---|
committer | Otavio Salvador <otavio@ossystems.com.br> | 2018-08-30 23:19:03 -0300 |
commit | 9a5a143d97345871d4c258ce6ce13567d87f5ba7 (patch) | |
tree | a9f5163d65608c0bc087bd164ba451275965f008 /recipes-kernel/linux/linux-mfgtool.inc | |
parent | 385e68c9470e52ff8226002aaa89a9f70206cec6 (diff) | |
download | meta-freescale-9a5a143d97345871d4c258ce6ce13567d87f5ba7.tar.gz |
linux-mfgtool: Simplify linux-mfgtool support
As OpenEmbedded-Core now supports (from commit
5b4aab6b40cf21471442e21abc8051b38985de84) building multiple kernels,
this patch completly replaces the old linux-mfgtool with a single
statement:
KERNEL_PACKAGE_NAME = "linux-mfgtool"
and it works surprisingly well! This patch also provides a separate
defconfig for linux-imx-mfgtool (which currently is a copy of
linux-imx defconfig).
Note: The linux-mfgtool kernel will be deployed in ${DEPLOY}/mfgtool.
Signed-off-by: Marc Ferland <ferlandm@amotus.ca>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Diffstat (limited to 'recipes-kernel/linux/linux-mfgtool.inc')
-rw-r--r-- | recipes-kernel/linux/linux-mfgtool.inc | 82 |
1 files changed, 1 insertions, 81 deletions
diff --git a/recipes-kernel/linux/linux-mfgtool.inc b/recipes-kernel/linux/linux-mfgtool.inc index dc06c541..7ff370e4 100644 --- a/recipes-kernel/linux/linux-mfgtool.inc +++ b/recipes-kernel/linux/linux-mfgtool.inc | |||
@@ -1,87 +1,7 @@ | |||
1 | # Produces a Manufacturing Tool compatible Linux Kernel | 1 | # Produces a Manufacturing Tool compatible Linux Kernel |
2 | # | 2 | # |
3 | # This makes a separated binary set for Manufacturing Tool use | ||
4 | # without clobbering the Linux Kernel used for normal use. | ||
5 | # | ||
6 | # This file must be included after the original linux-imx.inc file | ||
7 | # as it overrides the needed values. | ||
8 | # | ||
9 | # Copyright (C) 2014, 2015, 2018 O.S. Systems Software LTDA. | 3 | # Copyright (C) 2014, 2015, 2018 O.S. Systems Software LTDA. |
10 | 4 | ||
11 | # Adjust provides | ||
12 | PROVIDES = "linux-mfgtool" | 5 | PROVIDES = "linux-mfgtool" |
13 | 6 | ||
14 | # Avoid coliding files | 7 | KERNEL_PACKAGE_NAME = "mfgtool" |
15 | LOCALVERSION_append = "-mfgtool" | ||
16 | KERNEL_SRC_PATH = "/usr/src/kernel-mfgtool" | ||
17 | KERNEL_IMAGE_BASE_NAME = "${KERNEL_IMAGETYPE}-mfgtool-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}" | ||
18 | KERNEL_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME" | ||
19 | KERNEL_IMAGE_SYMLINK_NAME = "${KERNEL_IMAGETYPE}-mfgtool-${MACHINE}" | ||
20 | MODULE_IMAGE_BASE_NAME = "modules-mfgtool-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}" | ||
21 | MODULE_TARBALL_SYMLINK_NAME = "modules-mfgtool-${MACHINE}.tgz" | ||
22 | STAGING_KERNEL_DIR = "${TMPDIR}/work-shared/${MACHINE}/kernel-mfgtool-source" | ||
23 | STAGING_KERNEL_BUILDDIR = "${TMPDIR}/work-shared/${MACHINE}/kernel-mfgtool-build-artifacts" | ||
24 | |||
25 | # Ensures we prefer our mfgtool specific files | ||
26 | FILESEXTRAPATHS_prepend := "${THISDIR}/${ORIG_PN}-${PV}:${THISDIR}/${ORIG_PN}:" | ||
27 | |||
28 | python mfgtool_recipe_handler () { | ||
29 | pn = e.data.getVar("PN", True) | ||
30 | if not (pn.endswith("-mfgtool") or pn.startswith("mfgtool-")): | ||
31 | return | ||
32 | |||
33 | e.data.setVar("MLPREFIX", "mfgtool-") | ||
34 | e.data.setVar("ORIG_PN", e.data.getVar("PN", True)) | ||
35 | e.data.setVar("PN", "mfgtool-" + e.data.getVar("PN", True).replace("-mfgtool", "").replace("mfgtool-", "")) | ||
36 | } | ||
37 | |||
38 | python () { | ||
39 | pn = d.getVar("PN", True) | ||
40 | if not pn.startswith("mfgtool-"): | ||
41 | return | ||
42 | |||
43 | from oe.classextend import ClassExtender | ||
44 | |||
45 | # We need to expand KERNEL_VERSION at runtime, not at parse time | ||
46 | # The class extension code can expand variables early so remove | ||
47 | # the variable from the datastore temporarily and then restore | ||
48 | kernver = d.getVar("KERNEL_VERSION", False) | ||
49 | kernverpkgname = d.getVar("KERNEL_VERSION_PKG_NAME", False) | ||
50 | d.delVar("KERNEL_VERSION") | ||
51 | d.delVar("KERNEL_VERSION_PKG_NAME") | ||
52 | |||
53 | class LinuxMfgToolExtender(ClassExtender): | ||
54 | def extend_name(self, name): | ||
55 | if name.startswith("kernel-"): | ||
56 | return self.extname + "-" + name | ||
57 | return super().extend_name(name) | ||
58 | |||
59 | clsextend = LinuxMfgToolExtender("mfgtool", d) | ||
60 | clsextend.rename_packages() | ||
61 | clsextend.rename_package_variables((d.getVar("PACKAGEVARS", True) or "").split()) | ||
62 | |||
63 | clsextend.map_packagevars() | ||
64 | clsextend.map_regexp_variable("PACKAGES_DYNAMIC") | ||
65 | |||
66 | d.setVar("KERNEL_VERSION", kernver) | ||
67 | d.setVar("KERNEL_VERSION_PKG_NAME", kernverpkgname) | ||
68 | } | ||
69 | |||
70 | addhandler mfgtool_recipe_handler | ||
71 | mfgtool_recipe_handler[eventmask] = "bb.event.RecipePreFinalise" | ||
72 | |||
73 | # FIXME: Avoid depmod data emiting as kernel-abiversion path is | ||
74 | # hardcoded. | ||
75 | emit_depmod_pkgdata() { | ||
76 | : | ||
77 | } | ||
78 | |||
79 | # FIXME: We need to remove the STAGING_KERNEL_BUILDDIR contents as | ||
80 | # kernel.bbclass has no way to skip its installation. | ||
81 | # FIXME: It is not possible to have external modules against | ||
82 | # this kernel variant. | ||
83 | do_install_append() { | ||
84 | rm -r ${STAGING_KERNEL_BUILDDIR} | ||
85 | } | ||
86 | |||
87 | POPULATESYSROOTDEPS_class-target = "virtual/${TARGET_PREFIX}binutils:do_populate_sysroot" | ||