[OE-core] [oe-core][PATCH 1/1] modules: move creation of some module related tools

Bruce Ashfield bruce.ashfield at gmail.com
Fri Jul 21 17:30:12 UTC 2017


On Fri, Jul 21, 2017 at 1:13 PM, Joe Slater <jslater at windriver.com> wrote:

> Move creation of tools needed by module building recipes into
> kernel.bbclass but invoke the task only from the module recipes.
> Without this change, one module recipe can fail trying to use the
> tools while another is (re-)building them.
>

You are changing some core code that has been protecting our builds for
quite some time .. yet, you have no example of the errors that are being
seen, and no proof that this actually fixes the problem (and that it doesn't
introduce other issues).

i.e. how are the lock files no protecting this in whatever is breaking for
you ?

Looking at the change, I'm not convinced it is the right thing to do.

i.e. putting something in kernel.bbclass that is only used by the modules
is less than ideal, without some sort of justification.

Bruce


>
> Signed-off-by: Joe Slater <jslater at windriver.com>
> ---
>  meta/classes/kernel.bbclass      | 15 +++++++++++++++
>  meta/classes/module-base.bbclass | 10 ++--------
>  meta/classes/module.bbclass      |  4 ----
>  3 files changed, 17 insertions(+), 12 deletions(-)
>
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index 7670c71..131387e 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -280,6 +280,11 @@ kernel_do_compile() {
>
>  do_compile_kernelmodules() {
>         unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
> +
> +       # build modpost, etc
> +       make CC="${KERNEL_CC}" LD="${KERNEL_LD}" AR="${KERNEL_AR}" \
> +                  -C ${STAGING_KERNEL_DIR} O=${STAGING_KERNEL_BUILDDIR}
> scripts
> +
>         if (grep -q -i -e '^CONFIG_MODULES=y$' ${B}/.config); then
>                 oe_runmake -C ${B} ${PARALLEL_MAKE} modules
> CC="${KERNEL_CC}" LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS}
>
> @@ -296,6 +301,16 @@ do_compile_kernelmodules() {
>  }
>  addtask compile_kernelmodules after do_compile before do_strip
>
> +# Task to ensure the kernel scripts are created. Expected to be invoked
> +# only by module building recipes. See module.bbclass for an example.
> +do_make_scripts() {
> +       unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
> +       make CC="${KERNEL_CC}" LD="${KERNEL_LD}" AR="${KERNEL_AR}" \
> +                  -C ${STAGING_KERNEL_DIR} O=${STAGING_KERNEL_BUILDDIR}
> scripts
> +}
> +addtask make_scripts after do_compile_kernelmodules
> +do_make_scripts[lockfiles] = "${TMPDIR}/kernel-scripts.lock"
> +
>  kernel_do_install() {
>         #
>         # First install the modules
> diff --git a/meta/classes/module-base.bbclass b/meta/classes/module-base.
> bbclass
> index 6fe77c0..c1fe191 100644
> --- a/meta/classes/module-base.bbclass
> +++ b/meta/classes/module-base.bbclass
> @@ -1,7 +1,8 @@
>  inherit kernel-arch
>
>  # This is instead of DEPENDS = "virtual/kernel"
> -do_configure[depends] += "virtual/kernel:do_compile_kernelmodules"
> +# do_make_scripts() used to be in here, but is now in kernel.bbclass
> +do_configure[depends] += "virtual/kernel:do_make_scripts"
>
>  export OS = "${TARGET_OS}"
>  export CROSS_COMPILE = "${TARGET_PREFIX}"
> @@ -18,10 +19,3 @@ KERNEL_OBJECT_SUFFIX = ".ko"
>  # kernel modules are generally machine specific
>  PACKAGE_ARCH = "${MACHINE_ARCH}"
>
> -# Function to ensure the kernel scripts are created. Expected to
> -# be called before do_compile. See module.bbclass for an example.
> -do_make_scripts() {
> -       unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
> -       make CC="${KERNEL_CC}" LD="${KERNEL_LD}" AR="${KERNEL_AR}" \
> -                  -C ${STAGING_KERNEL_DIR} O=${STAGING_KERNEL_BUILDDIR}
> scripts
> -}
> diff --git a/meta/classes/module.bbclass b/meta/classes/module.bbclass
> index 391776d..e344960 100644
> --- a/meta/classes/module.bbclass
> +++ b/meta/classes/module.bbclass
> @@ -1,9 +1,5 @@
>  inherit module-base kernel-module-split pkgconfig
>
> -addtask make_scripts after do_prepare_recipe_sysroot before do_compile
> -do_make_scripts[lockfiles] = "${TMPDIR}/kernel-scripts.lock"
> -do_make_scripts[depends] += "virtual/kernel:do_shared_workdir"
> -
>  EXTRA_OEMAKE += "KERNEL_SRC=${STAGING_KERNEL_DIR}"
>
>  MODULES_INSTALL_TARGET ?= "modules_install"
> --
> 2.7.4
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>



-- 
"Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20170721/30ade55b/attachment-0002.html>


More information about the Openembedded-core mailing list