All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] kernel-devsrc: restructure for out of tree (and on target) module builds
@ 2018-02-28 19:20 Bruce Ashfield
  2018-02-28 21:10 ` Mark Hatle
  2018-03-01  8:28 ` Maxin B. John
  0 siblings, 2 replies; 36+ messages in thread
From: Bruce Ashfield @ 2018-02-28 19:20 UTC (permalink / raw)
  To: richard.purdie; +Cc: openembedded-core

The existing kernel-devsrc package starts with a full copy of the kernel
source and then starts to strip out elements that are not required.

This results in extra time (I/O) and extra space being taken up in the
final package. The main purpose of the kernel-devsrc package has been to
build modules against the running kernel, not to include a full copy of
the source code for re-building the kernel. The end result was a
600M kernel-devsrc package.

This restructuring of the package uses an approach similar to other
distros, where the kernel-devsrc package is for building against the
running kernel and uses a curated set of copied infrastructure, versus
a mass copy of the entire kernel.

The differences in this approach versus other is largely due to the
architecture support and the split build/source directory of the
kernel.

The result is a kernel-devsrc package of about 10M, which is capable
of running "make scripts" and compiling kernel modules against the
running kernel.

Along with the changes to the copying of the infrascture, we also
have the following changes:

 - a better/more explicit listing of dependencies for on-target
   builds of "make scripts" or "make modules_prepare"

 - The kernel source is installed into /lib/modules/<version>/build
   and a symlink created from /usr/src/kernel to the new location.
   This aligns with the standard location for module support
   code

 - There is also a symlink from /lib/modules/<version>/source -> build
   to reserve a spot for a new package that is simply the kernel
   source. That package is not part of this update.

[YOCTO #12535]

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
---

 v2: fix arch/arm devsrc builds

 The arch conditional code for ARM was using invalid variables for the
 current version of the recipe. Those are now fixed, and we can package
 for ARM.

 meta/recipes-kernel/linux/kernel-devsrc.bb | 178 ++++++++++++++++++++++-------
 1 file changed, 138 insertions(+), 40 deletions(-)

diff --git a/meta/recipes-kernel/linux/kernel-devsrc.bb b/meta/recipes-kernel/linux/kernel-devsrc.bb
index c1b5b7786d7c..738290ac2dc3 100644
--- a/meta/recipes-kernel/linux/kernel-devsrc.bb
+++ b/meta/recipes-kernel/linux/kernel-devsrc.bb
@@ -30,50 +30,148 @@ do_populate_sysroot[noexec] = "1"
 S = "${STAGING_KERNEL_DIR}"
 B = "${STAGING_KERNEL_BUILDDIR}"
 
-KERNEL_VERSION = "${@get_kernelversion_headers('${S}')}"
-
 PACKAGE_ARCH = "${MACHINE_ARCH}"
 
+KERNEL_BUILD_ROOT="/lib/modules/"
+
 do_install() {
-        kerneldir=${D}${KERNEL_SRC_PATH}
-        install -d $kerneldir
-
-        #
-        # Copy the staging dir source (and module build support) into the devsrc structure.
-        # We can keep this copy simple and take everything, since a we'll clean up any build
-        # artifacts afterwards, and the extra i/o is not significant
-        #
-        cd ${B}
-        find . -type d -name '.git*' -prune -o -path '.debug' -prune -o -type f -print0 | cpio --null -pdlu $kerneldir
-        cd ${S}
-	find . -type d -name '.git*' -prune -o -type d -name '.kernel-meta' -prune -o -type f -print0 | cpio --null -pdlu $kerneldir
-
-        # Explicitly set KBUILD_OUTPUT to ensure that the image directory is cleaned and not
-        # The main build artifacts. We clean the directory to avoid QA errors on mismatched
-        # architecture (since scripts and helpers are native format).
-        KBUILD_OUTPUT="$kerneldir"
-        oe_runmake -C $kerneldir CC="${KERNEL_CC}" LD="${KERNEL_LD}" clean _mrproper_scripts
-        # make clean generates an absolute path symlink called "source"
-        # in $kerneldir points to $kerneldir, which doesn't make any
-        # sense, so remove it.
-        if [ -L $kerneldir/source ]; then
-            bbnote "Removing $kerneldir/source symlink"
-            rm -f $kerneldir/source
-        fi
-
-        # As of Linux kernel version 3.0.1, the clean target removes
-        # arch/powerpc/lib/crtsavres.o which is present in
-        # KBUILD_LDFLAGS_MODULE, making it required to build external modules.
-        if [ ${ARCH} = "powerpc" ]; then
-                mkdir -p $kerneldir/arch/powerpc/lib/
-                cp ${B}/arch/powerpc/lib/crtsavres.o $kerneldir/arch/powerpc/lib/crtsavres.o
-        fi
-
-        chown -R root:root ${D}
+    kerneldir=${D}${KERNEL_BUILD_ROOT}${KERNEL_VERSION}
+    install -d $kerneldir
+
+    # create the directory structure
+    rm -f $kerneldir/build
+    rm -f $kerneldir/source
+    mkdir -p $kerneldir/build
+
+    # for compatibility with some older variants of this package, we
+    # create  a /usr/src/kernel symlink to /lib/modules/<version>/source
+    mkdir -p ${D}/usr/src
+    (
+	cd ${D}/usr/src
+	ln -s ${KERNEL_BUILD_ROOT}${KERNEL_VERSION}/source kernel
+    )
+
+    # for on target purposes, we unify build and source
+    (
+	cd $kerneldir
+	ln -s build source
+    )
+
+    # first copy everything
+    (
+	cd ${S}
+	cp --parents $(find  -type f -name "Makefile*" -o -name "Kconfig*") $kerneldir/build
+    )
+
+    # then drop all but the needed Makefiles/Kconfig files
+    rm -rf $kerneldir/build/Documentation
+    rm -rf $kerneldir/build/scripts
+    rm -rf $kerneldir/build/include
+
+    # now copy in parts from the build that we'll need later
+    (
+	cd ${B}
+
+	cp Module.symvers $kerneldir/build
+	cp System.map* $kerneldir/build
+	if [ -s Module.markers ]; then
+	    cp Module.markers $kerneldir/build
+	fi
+
+	cp .config $kerneldir/build
+
+	# TODO: this scripts copy will likely blow up QA, so for now, we
+	#       require a more complex 'make scripts' to restore these, versus
+	#       copying them here. Left as a reference to indicate that we
+	#       know the scripts must be dealt with.
+	# cp -a scripts $kerneldir/build
+
+	if [ -f tools/objtool/objtool ]; then
+	    cp -a tools/objtool/objtool $kerneldir/build/tools/objtool/
+	fi
+	if [ -d arch/${ARCH}/scripts ]; then
+	    cp -a arch/${ARCH}/scripts $kerneldir/build/arch/${ARCH}
+	fi
+	if [ -f arch/${ARCH}/*lds ]; then
+	    cp -a arch/${ARCH}/*lds $kerneldir/build/arch/${ARCH}
+	fi
+
+	rm -f $kerneldir/build/scripts/*.o
+	rm -f $kerneldir/build/scripts/*/*.o
+
+	if [ "${ARCH}" = "powerpc" ]; then
+	    cp -a --parents arch/powerpc/lib/crtsavres.[So] $kerneldir/build/
+	fi
+
+	cp -a include $kerneldir/build/include
+    )
+
+    # now grab the chunks from the source tree that we need
+    (
+	cd ${S}
+
+	cp -a scripts $kerneldir/build
+	if [ "${ARCH}" = "arm64" ]; then
+	    # arch/arm64/include/asm/xen references arch/arm
+	    cp -a --parents arch/arm/include/asm/xen $kerneldir/build/
+	    # arch/arm64/include/asm/opcodes.h references arch/arm
+	    cp -a --parents arch/arm/include/asm/opcodes.h $kerneldir/build/
+	fi
+
+	# include the machine specific headers for ARM variants, if available.
+	if [ "${ARCH}" = "arm" ]; then
+	    cp -a --parents arch/${ARCH}/mach-*/include $kerneldir/build/
+
+	    # include a few files for 'make prepare'
+	    cp -a --parents arch/arm/tools/gen-mach-types $kerneldir/build/
+	    cp -a --parents arch/arm/tools/mach-types $kerneldir/build/
+	fi
+
+	if [ -d arch/${ARCH}/include ]; then
+	    cp -a --parents arch/${ARCH}/include $kerneldir/build/
+	fi
+
+	cp -a include $kerneldir/build
+
+	if [ "${ARCH}" = "x86" ]; then
+	    # files for 'make prepare' to succeed with kernel-devel
+	    cp -a --parents arch/x86/entry/syscalls/syscall_32.tbl $kerneldir/build/
+	    cp -a --parents arch/x86/entry/syscalls/syscalltbl.sh $kerneldir/build/
+	    cp -a --parents arch/x86/entry/syscalls/syscallhdr.sh $kerneldir/build/
+	    cp -a --parents arch/x86/entry/syscalls/syscall_64.tbl $kerneldir/build/
+	    cp -a --parents arch/x86/tools/relocs_32.c $kerneldir/build/
+	    cp -a --parents arch/x86/tools/relocs_64.c $kerneldir/build/
+	    cp -a --parents arch/x86/tools/relocs.c $kerneldir/build/
+	    cp -a --parents arch/x86/tools/relocs_common.c $kerneldir/build/
+	    cp -a --parents arch/x86/tools/relocs.h $kerneldir/build/
+	    cp -a --parents tools/include/tools/le_byteshift.h $kerneldir/build/
+	    cp -a --parents tools/include/tools/be_byteshift.h $kerneldir/build/
+	    cp -a --parents arch/x86/purgatory/purgatory.c $kerneldir/build/
+	    cp -a --parents arch/x86/purgatory/sha256.h $kerneldir/build/
+	    cp -a --parents arch/x86/purgatory/sha256.c $kerneldir/build/
+	    cp -a --parents arch/x86/purgatory/stack.S $kerneldir/build/
+	    cp -a --parents arch/x86/purgatory/string.c $kerneldir/build/
+	    cp -a --parents arch/x86/purgatory/setup-x86_64.S $kerneldir/build/
+	    cp -a --parents arch/x86/purgatory/entry64.S $kerneldir/build/
+	    cp -a --parents arch/x86/boot/string.h $kerneldir/build/
+	    cp -a --parents arch/x86/boot/string.c $kerneldir/build/
+	    cp -a --parents arch/x86/boot/ctype.h $kerneldir/build/
+	fi
+    )
+
+    # Make sure the Makefile and version.h have a matching timestamp so that
+    # external modules can be built
+    touch -r $kerneldir/build/Makefile $kerneldir/build/include/generated/uapi/linux/version.h
+
+    # Copy .config to include/config/auto.conf so "make prepare" is unnecessary.
+    cp $kerneldir/build/.config $kerneldir/build/include/config/auto.conf
+
+    chown -R root:root ${D}
 }
+
 # Ensure we don't race against "make scripts" during cpio
 do_install[lockfiles] = "${TMPDIR}/kernel-scripts.lock"
 
-PACKAGES = "kernel-devsrc"
-FILES_${PN} = "${KERNEL_SRC_PATH}"
-RDEPENDS_${PN} = "bc"
+FILES_${PN} = "${KERNEL_BUILD_ROOT} ${KERNEL_SRC_PATH}"
+FILES_${PN}-dbg += "${KERNEL_BUILD_ROOT}*/build/scripts/*/.debug/*"
+RDEPENDS_${PN} = "bc glibc-utils"
-- 
2.5.0



^ permalink raw reply related	[flat|nested] 36+ messages in thread

* Re: [PATCH v2] kernel-devsrc: restructure for out of tree (and on target) module builds
  2018-02-28 19:20 [PATCH v2] kernel-devsrc: restructure for out of tree (and on target) module builds Bruce Ashfield
@ 2018-02-28 21:10 ` Mark Hatle
  2018-02-28 21:12   ` Bruce Ashfield
  2018-03-01  8:28 ` Maxin B. John
  1 sibling, 1 reply; 36+ messages in thread
From: Mark Hatle @ 2018-02-28 21:10 UTC (permalink / raw)
  To: Bruce Ashfield, richard.purdie; +Cc: openembedded-core

One question, below inline:

On 2/28/18 1:20 PM, Bruce Ashfield wrote:
> The existing kernel-devsrc package starts with a full copy of the kernel
> source and then starts to strip out elements that are not required.
> 
> This results in extra time (I/O) and extra space being taken up in the
> final package. The main purpose of the kernel-devsrc package has been to
> build modules against the running kernel, not to include a full copy of
> the source code for re-building the kernel. The end result was a
> 600M kernel-devsrc package.
> 
> This restructuring of the package uses an approach similar to other
> distros, where the kernel-devsrc package is for building against the
> running kernel and uses a curated set of copied infrastructure, versus
> a mass copy of the entire kernel.
> 
> The differences in this approach versus other is largely due to the
> architecture support and the split build/source directory of the
> kernel.
> 
> The result is a kernel-devsrc package of about 10M, which is capable
> of running "make scripts" and compiling kernel modules against the
> running kernel.
> 
> Along with the changes to the copying of the infrascture, we also
> have the following changes:
> 
>  - a better/more explicit listing of dependencies for on-target
>    builds of "make scripts" or "make modules_prepare"
> 
>  - The kernel source is installed into /lib/modules/<version>/build
>    and a symlink created from /usr/src/kernel to the new location.
>    This aligns with the standard location for module support
>    code
> 
>  - There is also a symlink from /lib/modules/<version>/source -> build
>    to reserve a spot for a new package that is simply the kernel
>    source. That package is not part of this update.
> 
> [YOCTO #12535]
> 
> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
> ---
> 
>  v2: fix arch/arm devsrc builds
> 
>  The arch conditional code for ARM was using invalid variables for the
>  current version of the recipe. Those are now fixed, and we can package
>  for ARM.
> 
>  meta/recipes-kernel/linux/kernel-devsrc.bb | 178 ++++++++++++++++++++++-------
>  1 file changed, 138 insertions(+), 40 deletions(-)
> 
> diff --git a/meta/recipes-kernel/linux/kernel-devsrc.bb b/meta/recipes-kernel/linux/kernel-devsrc.bb
> index c1b5b7786d7c..738290ac2dc3 100644
> --- a/meta/recipes-kernel/linux/kernel-devsrc.bb
> +++ b/meta/recipes-kernel/linux/kernel-devsrc.bb
> @@ -30,50 +30,148 @@ do_populate_sysroot[noexec] = "1"
>  S = "${STAGING_KERNEL_DIR}"
>  B = "${STAGING_KERNEL_BUILDDIR}"
>  
> -KERNEL_VERSION = "${@get_kernelversion_headers('${S}')}"
> -

I see this is removed, but later items reference KERNEL_VERSION.  Is that
defined elsewhere?

--Mark

>  PACKAGE_ARCH = "${MACHINE_ARCH}"
>  
> +KERNEL_BUILD_ROOT="/lib/modules/"
> +
>  do_install() {
> -        kerneldir=${D}${KERNEL_SRC_PATH}
> -        install -d $kerneldir
> -
> -        #
> -        # Copy the staging dir source (and module build support) into the devsrc structure.
> -        # We can keep this copy simple and take everything, since a we'll clean up any build
> -        # artifacts afterwards, and the extra i/o is not significant
> -        #
> -        cd ${B}
> -        find . -type d -name '.git*' -prune -o -path '.debug' -prune -o -type f -print0 | cpio --null -pdlu $kerneldir
> -        cd ${S}
> -	find . -type d -name '.git*' -prune -o -type d -name '.kernel-meta' -prune -o -type f -print0 | cpio --null -pdlu $kerneldir
> -
> -        # Explicitly set KBUILD_OUTPUT to ensure that the image directory is cleaned and not
> -        # The main build artifacts. We clean the directory to avoid QA errors on mismatched
> -        # architecture (since scripts and helpers are native format).
> -        KBUILD_OUTPUT="$kerneldir"
> -        oe_runmake -C $kerneldir CC="${KERNEL_CC}" LD="${KERNEL_LD}" clean _mrproper_scripts
> -        # make clean generates an absolute path symlink called "source"
> -        # in $kerneldir points to $kerneldir, which doesn't make any
> -        # sense, so remove it.
> -        if [ -L $kerneldir/source ]; then
> -            bbnote "Removing $kerneldir/source symlink"
> -            rm -f $kerneldir/source
> -        fi
> -
> -        # As of Linux kernel version 3.0.1, the clean target removes
> -        # arch/powerpc/lib/crtsavres.o which is present in
> -        # KBUILD_LDFLAGS_MODULE, making it required to build external modules.
> -        if [ ${ARCH} = "powerpc" ]; then
> -                mkdir -p $kerneldir/arch/powerpc/lib/
> -                cp ${B}/arch/powerpc/lib/crtsavres.o $kerneldir/arch/powerpc/lib/crtsavres.o
> -        fi
> -
> -        chown -R root:root ${D}
> +    kerneldir=${D}${KERNEL_BUILD_ROOT}${KERNEL_VERSION}
> +    install -d $kerneldir
> +
> +    # create the directory structure
> +    rm -f $kerneldir/build
> +    rm -f $kerneldir/source
> +    mkdir -p $kerneldir/build
> +
> +    # for compatibility with some older variants of this package, we
> +    # create  a /usr/src/kernel symlink to /lib/modules/<version>/source
> +    mkdir -p ${D}/usr/src
> +    (
> +	cd ${D}/usr/src
> +	ln -s ${KERNEL_BUILD_ROOT}${KERNEL_VERSION}/source kernel
> +    )
> +
> +    # for on target purposes, we unify build and source
> +    (
> +	cd $kerneldir
> +	ln -s build source
> +    )
> +
> +    # first copy everything
> +    (
> +	cd ${S}
> +	cp --parents $(find  -type f -name "Makefile*" -o -name "Kconfig*") $kerneldir/build
> +    )
> +
> +    # then drop all but the needed Makefiles/Kconfig files
> +    rm -rf $kerneldir/build/Documentation
> +    rm -rf $kerneldir/build/scripts
> +    rm -rf $kerneldir/build/include
> +
> +    # now copy in parts from the build that we'll need later
> +    (
> +	cd ${B}
> +
> +	cp Module.symvers $kerneldir/build
> +	cp System.map* $kerneldir/build
> +	if [ -s Module.markers ]; then
> +	    cp Module.markers $kerneldir/build
> +	fi
> +
> +	cp .config $kerneldir/build
> +
> +	# TODO: this scripts copy will likely blow up QA, so for now, we
> +	#       require a more complex 'make scripts' to restore these, versus
> +	#       copying them here. Left as a reference to indicate that we
> +	#       know the scripts must be dealt with.
> +	# cp -a scripts $kerneldir/build
> +
> +	if [ -f tools/objtool/objtool ]; then
> +	    cp -a tools/objtool/objtool $kerneldir/build/tools/objtool/
> +	fi
> +	if [ -d arch/${ARCH}/scripts ]; then
> +	    cp -a arch/${ARCH}/scripts $kerneldir/build/arch/${ARCH}
> +	fi
> +	if [ -f arch/${ARCH}/*lds ]; then
> +	    cp -a arch/${ARCH}/*lds $kerneldir/build/arch/${ARCH}
> +	fi
> +
> +	rm -f $kerneldir/build/scripts/*.o
> +	rm -f $kerneldir/build/scripts/*/*.o
> +
> +	if [ "${ARCH}" = "powerpc" ]; then
> +	    cp -a --parents arch/powerpc/lib/crtsavres.[So] $kerneldir/build/
> +	fi
> +
> +	cp -a include $kerneldir/build/include
> +    )
> +
> +    # now grab the chunks from the source tree that we need
> +    (
> +	cd ${S}
> +
> +	cp -a scripts $kerneldir/build
> +	if [ "${ARCH}" = "arm64" ]; then
> +	    # arch/arm64/include/asm/xen references arch/arm
> +	    cp -a --parents arch/arm/include/asm/xen $kerneldir/build/
> +	    # arch/arm64/include/asm/opcodes.h references arch/arm
> +	    cp -a --parents arch/arm/include/asm/opcodes.h $kerneldir/build/
> +	fi
> +
> +	# include the machine specific headers for ARM variants, if available.
> +	if [ "${ARCH}" = "arm" ]; then
> +	    cp -a --parents arch/${ARCH}/mach-*/include $kerneldir/build/
> +
> +	    # include a few files for 'make prepare'
> +	    cp -a --parents arch/arm/tools/gen-mach-types $kerneldir/build/
> +	    cp -a --parents arch/arm/tools/mach-types $kerneldir/build/
> +	fi
> +
> +	if [ -d arch/${ARCH}/include ]; then
> +	    cp -a --parents arch/${ARCH}/include $kerneldir/build/
> +	fi
> +
> +	cp -a include $kerneldir/build
> +
> +	if [ "${ARCH}" = "x86" ]; then
> +	    # files for 'make prepare' to succeed with kernel-devel
> +	    cp -a --parents arch/x86/entry/syscalls/syscall_32.tbl $kerneldir/build/
> +	    cp -a --parents arch/x86/entry/syscalls/syscalltbl.sh $kerneldir/build/
> +	    cp -a --parents arch/x86/entry/syscalls/syscallhdr.sh $kerneldir/build/
> +	    cp -a --parents arch/x86/entry/syscalls/syscall_64.tbl $kerneldir/build/
> +	    cp -a --parents arch/x86/tools/relocs_32.c $kerneldir/build/
> +	    cp -a --parents arch/x86/tools/relocs_64.c $kerneldir/build/
> +	    cp -a --parents arch/x86/tools/relocs.c $kerneldir/build/
> +	    cp -a --parents arch/x86/tools/relocs_common.c $kerneldir/build/
> +	    cp -a --parents arch/x86/tools/relocs.h $kerneldir/build/
> +	    cp -a --parents tools/include/tools/le_byteshift.h $kerneldir/build/
> +	    cp -a --parents tools/include/tools/be_byteshift.h $kerneldir/build/
> +	    cp -a --parents arch/x86/purgatory/purgatory.c $kerneldir/build/
> +	    cp -a --parents arch/x86/purgatory/sha256.h $kerneldir/build/
> +	    cp -a --parents arch/x86/purgatory/sha256.c $kerneldir/build/
> +	    cp -a --parents arch/x86/purgatory/stack.S $kerneldir/build/
> +	    cp -a --parents arch/x86/purgatory/string.c $kerneldir/build/
> +	    cp -a --parents arch/x86/purgatory/setup-x86_64.S $kerneldir/build/
> +	    cp -a --parents arch/x86/purgatory/entry64.S $kerneldir/build/
> +	    cp -a --parents arch/x86/boot/string.h $kerneldir/build/
> +	    cp -a --parents arch/x86/boot/string.c $kerneldir/build/
> +	    cp -a --parents arch/x86/boot/ctype.h $kerneldir/build/
> +	fi
> +    )
> +
> +    # Make sure the Makefile and version.h have a matching timestamp so that
> +    # external modules can be built
> +    touch -r $kerneldir/build/Makefile $kerneldir/build/include/generated/uapi/linux/version.h
> +
> +    # Copy .config to include/config/auto.conf so "make prepare" is unnecessary.
> +    cp $kerneldir/build/.config $kerneldir/build/include/config/auto.conf
> +
> +    chown -R root:root ${D}
>  }
> +
>  # Ensure we don't race against "make scripts" during cpio
>  do_install[lockfiles] = "${TMPDIR}/kernel-scripts.lock"
>  
> -PACKAGES = "kernel-devsrc"
> -FILES_${PN} = "${KERNEL_SRC_PATH}"
> -RDEPENDS_${PN} = "bc"
> +FILES_${PN} = "${KERNEL_BUILD_ROOT} ${KERNEL_SRC_PATH}"
> +FILES_${PN}-dbg += "${KERNEL_BUILD_ROOT}*/build/scripts/*/.debug/*"
> +RDEPENDS_${PN} = "bc glibc-utils"
> 



^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2] kernel-devsrc: restructure for out of tree (and on target) module builds
  2018-02-28 21:10 ` Mark Hatle
@ 2018-02-28 21:12   ` Bruce Ashfield
  0 siblings, 0 replies; 36+ messages in thread
From: Bruce Ashfield @ 2018-02-28 21:12 UTC (permalink / raw)
  To: Mark Hatle, richard.purdie; +Cc: openembedded-core

On 2018-02-28 4:10 PM, Mark Hatle wrote:
> One question, below inline:
> 
> On 2/28/18 1:20 PM, Bruce Ashfield wrote:
>> The existing kernel-devsrc package starts with a full copy of the kernel
>> source and then starts to strip out elements that are not required.
>>
>> This results in extra time (I/O) and extra space being taken up in the
>> final package. The main purpose of the kernel-devsrc package has been to
>> build modules against the running kernel, not to include a full copy of
>> the source code for re-building the kernel. The end result was a
>> 600M kernel-devsrc package.
>>
>> This restructuring of the package uses an approach similar to other
>> distros, where the kernel-devsrc package is for building against the
>> running kernel and uses a curated set of copied infrastructure, versus
>> a mass copy of the entire kernel.
>>
>> The differences in this approach versus other is largely due to the
>> architecture support and the split build/source directory of the
>> kernel.
>>
>> The result is a kernel-devsrc package of about 10M, which is capable
>> of running "make scripts" and compiling kernel modules against the
>> running kernel.
>>
>> Along with the changes to the copying of the infrascture, we also
>> have the following changes:
>>
>>   - a better/more explicit listing of dependencies for on-target
>>     builds of "make scripts" or "make modules_prepare"
>>
>>   - The kernel source is installed into /lib/modules/<version>/build
>>     and a symlink created from /usr/src/kernel to the new location.
>>     This aligns with the standard location for module support
>>     code
>>
>>   - There is also a symlink from /lib/modules/<version>/source -> build
>>     to reserve a spot for a new package that is simply the kernel
>>     source. That package is not part of this update.
>>
>> [YOCTO #12535]
>>
>> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
>> ---
>>
>>   v2: fix arch/arm devsrc builds
>>
>>   The arch conditional code for ARM was using invalid variables for the
>>   current version of the recipe. Those are now fixed, and we can package
>>   for ARM.
>>
>>   meta/recipes-kernel/linux/kernel-devsrc.bb | 178 ++++++++++++++++++++++-------
>>   1 file changed, 138 insertions(+), 40 deletions(-)
>>
>> diff --git a/meta/recipes-kernel/linux/kernel-devsrc.bb b/meta/recipes-kernel/linux/kernel-devsrc.bb
>> index c1b5b7786d7c..738290ac2dc3 100644
>> --- a/meta/recipes-kernel/linux/kernel-devsrc.bb
>> +++ b/meta/recipes-kernel/linux/kernel-devsrc.bb
>> @@ -30,50 +30,148 @@ do_populate_sysroot[noexec] = "1"
>>   S = "${STAGING_KERNEL_DIR}"
>>   B = "${STAGING_KERNEL_BUILDDIR}"
>>   
>> -KERNEL_VERSION = "${@get_kernelversion_headers('${S}')}"
>> -
> 
> I see this is removed, but later items reference KERNEL_VERSION.  Is that
> defined elsewhere?

Yup. It comes from the base classes. That variable in the current
form, is actually empty.

Bruce

> 
> --Mark
> 
>>   PACKAGE_ARCH = "${MACHINE_ARCH}"
>>   
>> +KERNEL_BUILD_ROOT="/lib/modules/"
>> +
>>   do_install() {
>> -        kerneldir=${D}${KERNEL_SRC_PATH}
>> -        install -d $kerneldir
>> -
>> -        #
>> -        # Copy the staging dir source (and module build support) into the devsrc structure.
>> -        # We can keep this copy simple and take everything, since a we'll clean up any build
>> -        # artifacts afterwards, and the extra i/o is not significant
>> -        #
>> -        cd ${B}
>> -        find . -type d -name '.git*' -prune -o -path '.debug' -prune -o -type f -print0 | cpio --null -pdlu $kerneldir
>> -        cd ${S}
>> -	find . -type d -name '.git*' -prune -o -type d -name '.kernel-meta' -prune -o -type f -print0 | cpio --null -pdlu $kerneldir
>> -
>> -        # Explicitly set KBUILD_OUTPUT to ensure that the image directory is cleaned and not
>> -        # The main build artifacts. We clean the directory to avoid QA errors on mismatched
>> -        # architecture (since scripts and helpers are native format).
>> -        KBUILD_OUTPUT="$kerneldir"
>> -        oe_runmake -C $kerneldir CC="${KERNEL_CC}" LD="${KERNEL_LD}" clean _mrproper_scripts
>> -        # make clean generates an absolute path symlink called "source"
>> -        # in $kerneldir points to $kerneldir, which doesn't make any
>> -        # sense, so remove it.
>> -        if [ -L $kerneldir/source ]; then
>> -            bbnote "Removing $kerneldir/source symlink"
>> -            rm -f $kerneldir/source
>> -        fi
>> -
>> -        # As of Linux kernel version 3.0.1, the clean target removes
>> -        # arch/powerpc/lib/crtsavres.o which is present in
>> -        # KBUILD_LDFLAGS_MODULE, making it required to build external modules.
>> -        if [ ${ARCH} = "powerpc" ]; then
>> -                mkdir -p $kerneldir/arch/powerpc/lib/
>> -                cp ${B}/arch/powerpc/lib/crtsavres.o $kerneldir/arch/powerpc/lib/crtsavres.o
>> -        fi
>> -
>> -        chown -R root:root ${D}
>> +    kerneldir=${D}${KERNEL_BUILD_ROOT}${KERNEL_VERSION}
>> +    install -d $kerneldir
>> +
>> +    # create the directory structure
>> +    rm -f $kerneldir/build
>> +    rm -f $kerneldir/source
>> +    mkdir -p $kerneldir/build
>> +
>> +    # for compatibility with some older variants of this package, we
>> +    # create  a /usr/src/kernel symlink to /lib/modules/<version>/source
>> +    mkdir -p ${D}/usr/src
>> +    (
>> +	cd ${D}/usr/src
>> +	ln -s ${KERNEL_BUILD_ROOT}${KERNEL_VERSION}/source kernel
>> +    )
>> +
>> +    # for on target purposes, we unify build and source
>> +    (
>> +	cd $kerneldir
>> +	ln -s build source
>> +    )
>> +
>> +    # first copy everything
>> +    (
>> +	cd ${S}
>> +	cp --parents $(find  -type f -name "Makefile*" -o -name "Kconfig*") $kerneldir/build
>> +    )
>> +
>> +    # then drop all but the needed Makefiles/Kconfig files
>> +    rm -rf $kerneldir/build/Documentation
>> +    rm -rf $kerneldir/build/scripts
>> +    rm -rf $kerneldir/build/include
>> +
>> +    # now copy in parts from the build that we'll need later
>> +    (
>> +	cd ${B}
>> +
>> +	cp Module.symvers $kerneldir/build
>> +	cp System.map* $kerneldir/build
>> +	if [ -s Module.markers ]; then
>> +	    cp Module.markers $kerneldir/build
>> +	fi
>> +
>> +	cp .config $kerneldir/build
>> +
>> +	# TODO: this scripts copy will likely blow up QA, so for now, we
>> +	#       require a more complex 'make scripts' to restore these, versus
>> +	#       copying them here. Left as a reference to indicate that we
>> +	#       know the scripts must be dealt with.
>> +	# cp -a scripts $kerneldir/build
>> +
>> +	if [ -f tools/objtool/objtool ]; then
>> +	    cp -a tools/objtool/objtool $kerneldir/build/tools/objtool/
>> +	fi
>> +	if [ -d arch/${ARCH}/scripts ]; then
>> +	    cp -a arch/${ARCH}/scripts $kerneldir/build/arch/${ARCH}
>> +	fi
>> +	if [ -f arch/${ARCH}/*lds ]; then
>> +	    cp -a arch/${ARCH}/*lds $kerneldir/build/arch/${ARCH}
>> +	fi
>> +
>> +	rm -f $kerneldir/build/scripts/*.o
>> +	rm -f $kerneldir/build/scripts/*/*.o
>> +
>> +	if [ "${ARCH}" = "powerpc" ]; then
>> +	    cp -a --parents arch/powerpc/lib/crtsavres.[So] $kerneldir/build/
>> +	fi
>> +
>> +	cp -a include $kerneldir/build/include
>> +    )
>> +
>> +    # now grab the chunks from the source tree that we need
>> +    (
>> +	cd ${S}
>> +
>> +	cp -a scripts $kerneldir/build
>> +	if [ "${ARCH}" = "arm64" ]; then
>> +	    # arch/arm64/include/asm/xen references arch/arm
>> +	    cp -a --parents arch/arm/include/asm/xen $kerneldir/build/
>> +	    # arch/arm64/include/asm/opcodes.h references arch/arm
>> +	    cp -a --parents arch/arm/include/asm/opcodes.h $kerneldir/build/
>> +	fi
>> +
>> +	# include the machine specific headers for ARM variants, if available.
>> +	if [ "${ARCH}" = "arm" ]; then
>> +	    cp -a --parents arch/${ARCH}/mach-*/include $kerneldir/build/
>> +
>> +	    # include a few files for 'make prepare'
>> +	    cp -a --parents arch/arm/tools/gen-mach-types $kerneldir/build/
>> +	    cp -a --parents arch/arm/tools/mach-types $kerneldir/build/
>> +	fi
>> +
>> +	if [ -d arch/${ARCH}/include ]; then
>> +	    cp -a --parents arch/${ARCH}/include $kerneldir/build/
>> +	fi
>> +
>> +	cp -a include $kerneldir/build
>> +
>> +	if [ "${ARCH}" = "x86" ]; then
>> +	    # files for 'make prepare' to succeed with kernel-devel
>> +	    cp -a --parents arch/x86/entry/syscalls/syscall_32.tbl $kerneldir/build/
>> +	    cp -a --parents arch/x86/entry/syscalls/syscalltbl.sh $kerneldir/build/
>> +	    cp -a --parents arch/x86/entry/syscalls/syscallhdr.sh $kerneldir/build/
>> +	    cp -a --parents arch/x86/entry/syscalls/syscall_64.tbl $kerneldir/build/
>> +	    cp -a --parents arch/x86/tools/relocs_32.c $kerneldir/build/
>> +	    cp -a --parents arch/x86/tools/relocs_64.c $kerneldir/build/
>> +	    cp -a --parents arch/x86/tools/relocs.c $kerneldir/build/
>> +	    cp -a --parents arch/x86/tools/relocs_common.c $kerneldir/build/
>> +	    cp -a --parents arch/x86/tools/relocs.h $kerneldir/build/
>> +	    cp -a --parents tools/include/tools/le_byteshift.h $kerneldir/build/
>> +	    cp -a --parents tools/include/tools/be_byteshift.h $kerneldir/build/
>> +	    cp -a --parents arch/x86/purgatory/purgatory.c $kerneldir/build/
>> +	    cp -a --parents arch/x86/purgatory/sha256.h $kerneldir/build/
>> +	    cp -a --parents arch/x86/purgatory/sha256.c $kerneldir/build/
>> +	    cp -a --parents arch/x86/purgatory/stack.S $kerneldir/build/
>> +	    cp -a --parents arch/x86/purgatory/string.c $kerneldir/build/
>> +	    cp -a --parents arch/x86/purgatory/setup-x86_64.S $kerneldir/build/
>> +	    cp -a --parents arch/x86/purgatory/entry64.S $kerneldir/build/
>> +	    cp -a --parents arch/x86/boot/string.h $kerneldir/build/
>> +	    cp -a --parents arch/x86/boot/string.c $kerneldir/build/
>> +	    cp -a --parents arch/x86/boot/ctype.h $kerneldir/build/
>> +	fi
>> +    )
>> +
>> +    # Make sure the Makefile and version.h have a matching timestamp so that
>> +    # external modules can be built
>> +    touch -r $kerneldir/build/Makefile $kerneldir/build/include/generated/uapi/linux/version.h
>> +
>> +    # Copy .config to include/config/auto.conf so "make prepare" is unnecessary.
>> +    cp $kerneldir/build/.config $kerneldir/build/include/config/auto.conf
>> +
>> +    chown -R root:root ${D}
>>   }
>> +
>>   # Ensure we don't race against "make scripts" during cpio
>>   do_install[lockfiles] = "${TMPDIR}/kernel-scripts.lock"
>>   
>> -PACKAGES = "kernel-devsrc"
>> -FILES_${PN} = "${KERNEL_SRC_PATH}"
>> -RDEPENDS_${PN} = "bc"
>> +FILES_${PN} = "${KERNEL_BUILD_ROOT} ${KERNEL_SRC_PATH}"
>> +FILES_${PN}-dbg += "${KERNEL_BUILD_ROOT}*/build/scripts/*/.debug/*"
>> +RDEPENDS_${PN} = "bc glibc-utils"
>>
> 



^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2] kernel-devsrc: restructure for out of tree (and on target) module builds
  2018-02-28 19:20 [PATCH v2] kernel-devsrc: restructure for out of tree (and on target) module builds Bruce Ashfield
  2018-02-28 21:10 ` Mark Hatle
@ 2018-03-01  8:28 ` Maxin B. John
  2018-03-01  9:37   ` Burton, Ross
  2018-03-01 12:57   ` Bruce Ashfield
  1 sibling, 2 replies; 36+ messages in thread
From: Maxin B. John @ 2018-03-01  8:28 UTC (permalink / raw)
  To: Bruce Ashfield; +Cc: openembedded-core

Hi,

On Wed, Feb 28, 2018 at 02:20:45PM -0500, Bruce Ashfield wrote:
> The existing kernel-devsrc package starts with a full copy of the kernel
> source and then starts to strip out elements that are not required.
> 
> This results in extra time (I/O) and extra space being taken up in the
> final package. The main purpose of the kernel-devsrc package has been to
> build modules against the running kernel, not to include a full copy of
> the source code for re-building the kernel. The end result was a
> 600M kernel-devsrc package.
> 
> This restructuring of the package uses an approach similar to other
> distros, where the kernel-devsrc package is for building against the
> running kernel and uses a curated set of copied infrastructure, versus
> a mass copy of the entire kernel.
> 
> The differences in this approach versus other is largely due to the
> architecture support and the split build/source directory of the
> kernel.
> 
> The result is a kernel-devsrc package of about 10M, which is capable
> of running "make scripts" and compiling kernel modules against the
> running kernel.
> 
> Along with the changes to the copying of the infrascture, we also
> have the following changes:
> 
>  - a better/more explicit listing of dependencies for on-target
>    builds of "make scripts" or "make modules_prepare"
> 
>  - The kernel source is installed into /lib/modules/<version>/build
>    and a symlink created from /usr/src/kernel to the new location.
>    This aligns with the standard location for module support
>    code
> 
>  - There is also a symlink from /lib/modules/<version>/source -> build
>    to reserve a spot for a new package that is simply the kernel
>    source. That package is not part of this update.
> 
> [YOCTO #12535]
> 
> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
> ---
> 
>  v2: fix arch/arm devsrc builds

Noticed one kernel-devsrc build failure in autobuilder (qemuarm) :

https://autobuilder.yocto.io/builders/nightly-arm/builds/876/steps/BuildImages/logs/stdio

ERROR: kernel-devsrc-1.0-r0 do_install: Function failed: do_install (log file is located at /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/temp/log.do_install.25822)
ERROR: Logfile of failure stored in: /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/temp/log.do_install.25822
Log data follows:
| DEBUG: Executing python function extend_recipe_sysroot
| NOTE: Direct dependencies are ['/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-devtools/binutils/binutils-cross_2.30.bb:do_populate_sysroot', 'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-extended/xz/xz_5.2.3.bb:do_populate_sysroot', 'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-devtools/pkgconfig/pkgconfig_git.bb:do_populate_sysroot', 'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-support/lzop/lzop_1.03.bb:do_populate_sysroot', '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb:do_populate_sysroot', '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-devtools/gcc/gcc-runtime_7.3.bb:do_populate_sysroot', '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-devtools/gcc/gcc-cross_7.3.bb:do_populate_sysroot', 'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-devtools/bison/bison_3.0.4.bb:do_populate_sysroot', 'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-devtools/pseudo/pseudo_1.8.2.bb:do_populate_sysroot', '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-core/glibc/glibc_2.26.bb:do_populate_sysroot', '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-kernel/kmod/kmod-native_git.bb:do_populate_sysroot', 'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-extended/bc/bc_1.06.bb:do_populate_sysroot', '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-devtools/quilt/quilt-native_0.65.bb:do_populate_sysroot', 'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-connectivity/openssl/openssl_1.0.2n.bb:do_populate_sysroot']
| NOTE: Installed into sysroot: ['pkgconfig-native', 'lzop-native', 'kern-tools-native', 'pseudo-native', 'kmod-native', 'bc-native', 'openssl-native', 'gtk-doc-native', 'lzo-native', 'makedepend-native', 'cryptodev-linux-native', 'util-macros-native', 'xproto-native']
| NOTE: Skipping as already exists in sysroot: ['binutils-cross-arm', 'xz-native', 'gcc-runtime', 'gcc-cross-arm', 'bison-native', 'glibc', 'quilt-native', 'gettext-minimal-native', 'gnu-config-native', 'automake-native', 'autoconf-native', 'libtool-native', 'linux-libc-headers', 'libgcc', 'zlib-native', 'texinfo-dummy-native', 'flex-native', 'libmpc-native', 'gmp-native', 'mpfr-native', 'm4-native']
| DEBUG: sed -e 's:^[^/]*/:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/recipe-sysroot-native/:g' /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/sysroots-components/x86_64/pkgconfig-native/fixmepath /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/sysroots-components/x86_64/openssl-native/fixmepath /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/sysroots-components/x86_64/gtk-doc-native/fixmepath | xargs sed -i -e 's:FIXMESTAGINGDIRTARGET:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/recipe-sysroot:g; s:FIXMESTAGINGDIRHOST:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/recipe-sysroot-native:g' -e 's:FIXME_COMPONENTS_DIR:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/sysroots-components:g' -e 's:FIXME_HOSTTOOLS_DIR:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/hosttools:g' -e 's:FIXME_PKGDATA_DIR:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/pkgdata/qemuarm:g' -e 's:FIXME_PSEUDO_LOCALSTATEDIR:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/pseudo/:g' -e 's:FIXME_LOGFIFO:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/temp/fifo.25822:g'
| DEBUG: Python function extend_recipe_sysroot finished
| DEBUG: Executing shell function do_install
| cp: with --parents, the destination must be a directory
| Try 'cp --help' for more information.
| WARNING: /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/temp/run.do_install.25822:1 exit 1 from 'rm -rf $kerneldir/build/include'
| ERROR: Function failed: do_install (log file is located at /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/temp/log.do_install.25822)
NOTE: recipe kernel-devsrc-1.0-r0: task do_install: Failed
ERROR: Task (/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-kernel/linux/kernel-devsrc.bb:do_install) failed with exit code '1'

Best Regards,
Maxin


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2] kernel-devsrc: restructure for out of tree (and on target) module builds
  2018-03-01  8:28 ` Maxin B. John
@ 2018-03-01  9:37   ` Burton, Ross
  2018-03-01 10:58     ` Maxin B. John
                       ` (2 more replies)
  2018-03-01 12:57   ` Bruce Ashfield
  1 sibling, 3 replies; 36+ messages in thread
From: Burton, Ross @ 2018-03-01  9:37 UTC (permalink / raw)
  To: Bruce Ashfield; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 8708 bytes --]

Also fails on musl:

ERROR: Nothing RPROVIDES 'glibc-utils' (but
/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-musl/build/meta/recipes-kernel/linux/
kernel-devsrc.bb RDEPENDS on or otherwise requires it)

Ross

On 1 March 2018 at 08:28, Maxin B. John <maxin.john@intel.com> wrote:

> Hi,
>
> On Wed, Feb 28, 2018 at 02:20:45PM -0500, Bruce Ashfield wrote:
> > The existing kernel-devsrc package starts with a full copy of the kernel
> > source and then starts to strip out elements that are not required.
> >
> > This results in extra time (I/O) and extra space being taken up in the
> > final package. The main purpose of the kernel-devsrc package has been to
> > build modules against the running kernel, not to include a full copy of
> > the source code for re-building the kernel. The end result was a
> > 600M kernel-devsrc package.
> >
> > This restructuring of the package uses an approach similar to other
> > distros, where the kernel-devsrc package is for building against the
> > running kernel and uses a curated set of copied infrastructure, versus
> > a mass copy of the entire kernel.
> >
> > The differences in this approach versus other is largely due to the
> > architecture support and the split build/source directory of the
> > kernel.
> >
> > The result is a kernel-devsrc package of about 10M, which is capable
> > of running "make scripts" and compiling kernel modules against the
> > running kernel.
> >
> > Along with the changes to the copying of the infrascture, we also
> > have the following changes:
> >
> >  - a better/more explicit listing of dependencies for on-target
> >    builds of "make scripts" or "make modules_prepare"
> >
> >  - The kernel source is installed into /lib/modules/<version>/build
> >    and a symlink created from /usr/src/kernel to the new location.
> >    This aligns with the standard location for module support
> >    code
> >
> >  - There is also a symlink from /lib/modules/<version>/source -> build
> >    to reserve a spot for a new package that is simply the kernel
> >    source. That package is not part of this update.
> >
> > [YOCTO #12535]
> >
> > Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
> > ---
> >
> >  v2: fix arch/arm devsrc builds
>
> Noticed one kernel-devsrc build failure in autobuilder (qemuarm) :
>
> https://autobuilder.yocto.io/builders/nightly-arm/builds/
> 876/steps/BuildImages/logs/stdio
>
> ERROR: kernel-devsrc-1.0-r0 do_install: Function failed: do_install (log
> file is located at /home/pokybuild/yocto-autobuilder/yocto-worker/
> nightly-arm/build/build/tmp/work/qemuarm-poky-linux-
> gnueabi/kernel-devsrc/1.0-r0/temp/log.do_install.25822)
> ERROR: Logfile of failure stored in: /home/pokybuild/yocto-
> autobuilder/yocto-worker/nightly-arm/build/build/tmp/
> work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/
> temp/log.do_install.25822
> Log data follows:
> | DEBUG: Executing python function extend_recipe_sysroot
> | NOTE: Direct dependencies are ['/home/pokybuild/yocto-
> autobuilder/yocto-worker/nightly-arm/build/meta/recipes-devtools/binutils/
> binutils-cross_2.30.bb:do_populate_sysroot', 'virtual:native:/home/
> pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/
> build/meta/recipes-extended/xz/xz_5.2.3.bb:do_populate_sysroot',
> 'virtual:native:/home/pokybuild/yocto-autobuilder/
> yocto-worker/nightly-arm/build/meta/recipes-devtools/
> pkgconfig/pkgconfig_git.bb:do_populate_sysroot', 'virtual:native:/home/
> pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/
> build/meta/recipes-support/lzop/lzop_1.03.bb:do_populate_sysroot',
> '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/
> recipes-kernel/kern-tools/kern-tools-native_git.bb:do_populate_sysroot',
> '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/
> recipes-devtools/gcc/gcc-runtime_7.3.bb:do_populate_sysroot',
> '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/
> recipes-devtools/gcc/gcc-cross_7.
>  3.bb:do_populate_sysroot', 'virtual:native:/home/
> pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/
> build/meta/recipes-devtools/bison/bison_3.0.4.bb:do_populate_sysroot',
> 'virtual:native:/home/pokybuild/yocto-autobuilder/
> yocto-worker/nightly-arm/build/meta/recipes-devtools/
> pseudo/pseudo_1.8.2.bb:do_populate_sysroot', '/home/pokybuild/yocto-
> autobuilder/yocto-worker/nightly-arm/build/meta/
> recipes-core/glibc/glibc_2.26.bb:do_populate_sysroot',
> '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/
> recipes-kernel/kmod/kmod-native_git.bb:do_populate_sysroot',
> 'virtual:native:/home/pokybuild/yocto-autobuilder/
> yocto-worker/nightly-arm/build/meta/recipes-extended/bc/bc_1.06.bb:
> do_populate_sysroot', '/home/pokybuild/yocto-autobuilder/yocto-worker/
> nightly-arm/build/meta/recipes-devtools/quilt/quilt-native_0.65.bb:
> do_populate_sysroot', 'virtual:native:/home/pokybuild/yocto-autobuilder/
> yocto-worker/nightly-arm/build/meta/recipes-connectivity/openssl/openssl_
> 1.0.2n.bb:d
>  o_populate_sysroot']
> | NOTE: Installed into sysroot: ['pkgconfig-native', 'lzop-native',
> 'kern-tools-native', 'pseudo-native', 'kmod-native', 'bc-native',
> 'openssl-native', 'gtk-doc-native', 'lzo-native', 'makedepend-native',
> 'cryptodev-linux-native', 'util-macros-native', 'xproto-native']
> | NOTE: Skipping as already exists in sysroot: ['binutils-cross-arm',
> 'xz-native', 'gcc-runtime', 'gcc-cross-arm', 'bison-native', 'glibc',
> 'quilt-native', 'gettext-minimal-native', 'gnu-config-native',
> 'automake-native', 'autoconf-native', 'libtool-native',
> 'linux-libc-headers', 'libgcc', 'zlib-native', 'texinfo-dummy-native',
> 'flex-native', 'libmpc-native', 'gmp-native', 'mpfr-native', 'm4-native']
> | DEBUG: sed -e 's:^[^/]*/:/home/pokybuild/yocto-autobuilder/yocto-
> worker/nightly-arm/build/build/tmp/work/qemuarm-poky-
> linux-gnueabi/kernel-devsrc/1.0-r0/recipe-sysroot-native/:g'
> /home/pokybuild/yocto-autobuilder/yocto-worker/
> nightly-arm/build/build/tmp/sysroots-components/x86_64/pkgconfig-native/fixmepath
> /home/pokybuild/yocto-autobuilder/yocto-worker/
> nightly-arm/build/build/tmp/sysroots-components/x86_64/openssl-native/fixmepath
> /home/pokybuild/yocto-autobuilder/yocto-worker/
> nightly-arm/build/build/tmp/sysroots-components/x86_64/gtk-doc-native/fixmepath
> | xargs sed -i -e 's:FIXMESTAGINGDIRTARGET:/home/pokybuild/yocto-
> autobuilder/yocto-worker/nightly-arm/build/build/tmp/
> work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/recipe-sysroot:g;
> s:FIXMESTAGINGDIRHOST:/home/pokybuild/yocto-autobuilder/
> yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-
> poky-linux-gnueabi/kernel-devsrc/1.0-r0/recipe-sysroot-native:g' -e
> 's:FIXME_COMPONENTS_DIR:/home/pokybuild/yocto-autobuilder/y
>  octo-worker/nightly-arm/build/build/tmp/sysroots-components:g' -e
> 's:FIXME_HOSTTOOLS_DIR:/home/pokybuild/yocto-autobuilder/
> yocto-worker/nightly-arm/build/build/tmp/hosttools:g' -e
> 's:FIXME_PKGDATA_DIR:/home/pokybuild/yocto-autobuilder/
> yocto-worker/nightly-arm/build/build/tmp/pkgdata/qemuarm:g' -e
> 's:FIXME_PSEUDO_LOCALSTATEDIR:/home/pokybuild/yocto-
> autobuilder/yocto-worker/nightly-arm/build/build/tmp/
> work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/pseudo/:g' -e
> 's:FIXME_LOGFIFO:/home/pokybuild/yocto-autobuilder/
> yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-
> poky-linux-gnueabi/kernel-devsrc/1.0-r0/temp/fifo.25822:g'
> | DEBUG: Python function extend_recipe_sysroot finished
> | DEBUG: Executing shell function do_install
> | cp: with --parents, the destination must be a directory
> | Try 'cp --help' for more information.
> | WARNING: /home/pokybuild/yocto-autobuilder/yocto-worker/
> nightly-arm/build/build/tmp/work/qemuarm-poky-linux-
> gnueabi/kernel-devsrc/1.0-r0/temp/run.do_install.25822:1 exit 1 from 'rm
> -rf $kerneldir/build/include'
> | ERROR: Function failed: do_install (log file is located at
> /home/pokybuild/yocto-autobuilder/yocto-worker/
> nightly-arm/build/build/tmp/work/qemuarm-poky-linux-
> gnueabi/kernel-devsrc/1.0-r0/temp/log.do_install.25822)
> NOTE: recipe kernel-devsrc-1.0-r0: task do_install: Failed
> ERROR: Task (/home/pokybuild/yocto-autobuilder/yocto-worker/
> nightly-arm/build/meta/recipes-kernel/linux/kernel-devsrc.bb:do_install)
> failed with exit code '1'
>
> Best Regards,
> Maxin
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>

[-- Attachment #2: Type: text/html, Size: 10845 bytes --]

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2] kernel-devsrc: restructure for out of tree (and on target) module builds
  2018-03-01  9:37   ` Burton, Ross
@ 2018-03-01 10:58     ` Maxin B. John
  2018-03-01 12:58       ` Bruce Ashfield
  2018-03-01 13:59       ` Bruce Ashfield
  2018-03-02 14:23     ` Bruce Ashfield
  2018-03-02 18:16     ` Khem Raj
  2 siblings, 2 replies; 36+ messages in thread
From: Maxin B. John @ 2018-03-01 10:58 UTC (permalink / raw)
  To: Burton, Ross; +Cc: Bruce Ashfield, OE-core


>Also fails on musl:
>
>ERROR: Nothing RPROVIDES 'glibc-utils' (but /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-musl/build/meta/recipes-kernel/linux/kernel-devsrc.bb RDEPENDS on or otherwise requires it)
>
>Ross
>
>On 1 March 2018 at 08:28, Maxin B. John <maxin.john@intel.com> wrote:

 >On Wed, Feb 28, 2018 at 02:20:45PM -0500, Bruce Ashfield wrote:
 >> The existing kernel-devsrc package starts with a full copy of the kernel
 >> source and then starts to strip out elements that are not required.
 >>
 >> This results in extra time (I/O) and extra space being taken up in the
 >> final package. The main purpose of the kernel-devsrc package has been to
 >> build modules against the running kernel, not to include a full copy of
 >> the source code for re-building the kernel. The end result was a
 >> 600M kernel-devsrc package.

 Other failures are listed below:
 
 arm64:
 https://autobuilder.yocto.io/builders/nightly-arm64/builds/790/steps/Running%20Sanity%20Tests/logs/stdio

 RESULTS - kernelmodule.KernelModuleTest.test_kernel_module - Testcase 1541: FAILED

HOSTCC  scripts/sortextable
 scripts/sortextable.c:31:10: fatal error: tools/be_byteshift.h: No such file or directory
#include <tools/be_byteshift.h>
  ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [scripts/Makefile.host:102: scripts/sortextable] Error 1
make: *** [Makefile:557: scripts] Error 2
----------------------------------------------------------------------

Similar on qemuarm - poky-lsb :

https://autobuilder.yocto.io/builders/nightly-arm-lsb/builds/812/steps/Running%20Sanity%20Tests/logs/stdio

HOSTCC  scripts/recordmcount
HOSTCC  scripts/sortextable
scripts/sortextable.c:31:10: fatal error: tools/be_byteshift.h: No such file or directory
    #include <tools/be_byteshift.h>
              ^~~~~~~~~~~~~~~~~~~~~~
              compilation terminated.
              make[1]: *** [scripts/Makefile.host:102: scripts/sortextable] Error 1
              make: *** [Makefile:557: scripts] Error 2
-------------------------------------------------------------------------

Also on PowerPC:

https://autobuilder.yocto.io/builders/nightly-ppc-lsb/builds/814/steps/Running%20Sanity%20Tests/logs/stdio

scripts/sortextable.c:31:10: fatal error: tools/be_byteshift.h: No such file or directory
 #include <tools/be_byteshift.h>
           ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [scripts/Makefile.host:102: scripts/sortextable] Error 1
make: *** [Makefile:557: scripts] Error 2

Best Regards,
Maxin


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2] kernel-devsrc: restructure for out of tree (and on target) module builds
  2018-03-01  8:28 ` Maxin B. John
  2018-03-01  9:37   ` Burton, Ross
@ 2018-03-01 12:57   ` Bruce Ashfield
  1 sibling, 0 replies; 36+ messages in thread
From: Bruce Ashfield @ 2018-03-01 12:57 UTC (permalink / raw)
  To: Maxin B. John; +Cc: Patches and discussions about the oe-core layer

On Thu, Mar 1, 2018 at 3:28 AM, Maxin B. John <maxin.john@intel.com> wrote:
> Hi,
>
> On Wed, Feb 28, 2018 at 02:20:45PM -0500, Bruce Ashfield wrote:
>> The existing kernel-devsrc package starts with a full copy of the kernel
>> source and then starts to strip out elements that are not required.
>>
>> This results in extra time (I/O) and extra space being taken up in the
>> final package. The main purpose of the kernel-devsrc package has been to
>> build modules against the running kernel, not to include a full copy of
>> the source code for re-building the kernel. The end result was a
>> 600M kernel-devsrc package.
>>
>> This restructuring of the package uses an approach similar to other
>> distros, where the kernel-devsrc package is for building against the
>> running kernel and uses a curated set of copied infrastructure, versus
>> a mass copy of the entire kernel.
>>
>> The differences in this approach versus other is largely due to the
>> architecture support and the split build/source directory of the
>> kernel.
>>
>> The result is a kernel-devsrc package of about 10M, which is capable
>> of running "make scripts" and compiling kernel modules against the
>> running kernel.
>>
>> Along with the changes to the copying of the infrascture, we also
>> have the following changes:
>>
>>  - a better/more explicit listing of dependencies for on-target
>>    builds of "make scripts" or "make modules_prepare"
>>
>>  - The kernel source is installed into /lib/modules/<version>/build
>>    and a symlink created from /usr/src/kernel to the new location.
>>    This aligns with the standard location for module support
>>    code
>>
>>  - There is also a symlink from /lib/modules/<version>/source -> build
>>    to reserve a spot for a new package that is simply the kernel
>>    source. That package is not part of this update.
>>
>> [YOCTO #12535]
>>
>> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
>> ---
>>
>>  v2: fix arch/arm devsrc builds
>
> Noticed one kernel-devsrc build failure in autobuilder (qemuarm) :
>
> https://autobuilder.yocto.io/builders/nightly-arm/builds/876/steps/BuildImages/logs/stdio

This failure actually can't be from v2, it is the v1 issue I fixed.
The offending lines of
code are completely gone.

Bruce

>
> ERROR: kernel-devsrc-1.0-r0 do_install: Function failed: do_install (log file is located at /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/temp/log.do_install.25822)
> ERROR: Logfile of failure stored in: /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/temp/log.do_install.25822
> Log data follows:
> | DEBUG: Executing python function extend_recipe_sysroot
> | NOTE: Direct dependencies are ['/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-devtools/binutils/binutils-cross_2.30.bb:do_populate_sysroot', 'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-extended/xz/xz_5.2.3.bb:do_populate_sysroot', 'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-devtools/pkgconfig/pkgconfig_git.bb:do_populate_sysroot', 'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-support/lzop/lzop_1.03.bb:do_populate_sysroot', '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb:do_populate_sysroot', '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-devtools/gcc/gcc-runtime_7.3.bb:do_populate_sysroot', '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-devtools/gcc/gcc-cross_7.
>  3.bb:do_populate_sysroot', 'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-devtools/bison/bison_3.0.4.bb:do_populate_sysroot', 'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-devtools/pseudo/pseudo_1.8.2.bb:do_populate_sysroot', '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-core/glibc/glibc_2.26.bb:do_populate_sysroot', '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-kernel/kmod/kmod-native_git.bb:do_populate_sysroot', 'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-extended/bc/bc_1.06.bb:do_populate_sysroot', '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-devtools/quilt/quilt-native_0.65.bb:do_populate_sysroot', 'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-connectivity/openssl/openssl_1.0.2n.bb:d
>  o_populate_sysroot']
> | NOTE: Installed into sysroot: ['pkgconfig-native', 'lzop-native', 'kern-tools-native', 'pseudo-native', 'kmod-native', 'bc-native', 'openssl-native', 'gtk-doc-native', 'lzo-native', 'makedepend-native', 'cryptodev-linux-native', 'util-macros-native', 'xproto-native']
> | NOTE: Skipping as already exists in sysroot: ['binutils-cross-arm', 'xz-native', 'gcc-runtime', 'gcc-cross-arm', 'bison-native', 'glibc', 'quilt-native', 'gettext-minimal-native', 'gnu-config-native', 'automake-native', 'autoconf-native', 'libtool-native', 'linux-libc-headers', 'libgcc', 'zlib-native', 'texinfo-dummy-native', 'flex-native', 'libmpc-native', 'gmp-native', 'mpfr-native', 'm4-native']
> | DEBUG: sed -e 's:^[^/]*/:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/recipe-sysroot-native/:g' /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/sysroots-components/x86_64/pkgconfig-native/fixmepath /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/sysroots-components/x86_64/openssl-native/fixmepath /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/sysroots-components/x86_64/gtk-doc-native/fixmepath | xargs sed -i -e 's:FIXMESTAGINGDIRTARGET:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/recipe-sysroot:g; s:FIXMESTAGINGDIRHOST:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/recipe-sysroot-native:g' -e 's:FIXME_COMPONENTS_DIR:/home/pokybuild/yocto-autobuilder/y
>  octo-worker/nightly-arm/build/build/tmp/sysroots-components:g' -e 's:FIXME_HOSTTOOLS_DIR:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/hosttools:g' -e 's:FIXME_PKGDATA_DIR:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/pkgdata/qemuarm:g' -e 's:FIXME_PSEUDO_LOCALSTATEDIR:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/pseudo/:g' -e 's:FIXME_LOGFIFO:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/temp/fifo.25822:g'
> | DEBUG: Python function extend_recipe_sysroot finished
> | DEBUG: Executing shell function do_install
> | cp: with --parents, the destination must be a directory
> | Try 'cp --help' for more information.
> | WARNING: /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/temp/run.do_install.25822:1 exit 1 from 'rm -rf $kerneldir/build/include'
> | ERROR: Function failed: do_install (log file is located at /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/temp/log.do_install.25822)
> NOTE: recipe kernel-devsrc-1.0-r0: task do_install: Failed
> ERROR: Task (/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-kernel/linux/kernel-devsrc.bb:do_install) failed with exit code '1'
>
> Best Regards,
> Maxin
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@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"


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2] kernel-devsrc: restructure for out of tree (and on target) module builds
  2018-03-01 10:58     ` Maxin B. John
@ 2018-03-01 12:58       ` Bruce Ashfield
  2018-03-01 13:59       ` Bruce Ashfield
  1 sibling, 0 replies; 36+ messages in thread
From: Bruce Ashfield @ 2018-03-01 12:58 UTC (permalink / raw)
  To: Maxin B. John; +Cc: OE-core

Interesting. I'll look at the errors and send a v3 next week.

I unfortunately have no capability to run the oe-selftests on my
builder, so I can only fix these
by inspection.

Cheers,

Bruce

On Thu, Mar 1, 2018 at 5:58 AM, Maxin B. John <maxin.john@intel.com> wrote:
>
>>Also fails on musl:
>>
>>ERROR: Nothing RPROVIDES 'glibc-utils' (but /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-musl/build/meta/recipes-kernel/linux/kernel-devsrc.bb RDEPENDS on or otherwise requires it)
>>
>>Ross
>>
>>On 1 March 2018 at 08:28, Maxin B. John <maxin.john@intel.com> wrote:
>
>  >On Wed, Feb 28, 2018 at 02:20:45PM -0500, Bruce Ashfield wrote:
>  >> The existing kernel-devsrc package starts with a full copy of the kernel
>  >> source and then starts to strip out elements that are not required.
>  >>
>  >> This results in extra time (I/O) and extra space being taken up in the
>  >> final package. The main purpose of the kernel-devsrc package has been to
>  >> build modules against the running kernel, not to include a full copy of
>  >> the source code for re-building the kernel. The end result was a
>  >> 600M kernel-devsrc package.
>
>  Other failures are listed below:
>
>  arm64:
>  https://autobuilder.yocto.io/builders/nightly-arm64/builds/790/steps/Running%20Sanity%20Tests/logs/stdio
>
>  RESULTS - kernelmodule.KernelModuleTest.test_kernel_module - Testcase 1541: FAILED
>
> HOSTCC  scripts/sortextable
>  scripts/sortextable.c:31:10: fatal error: tools/be_byteshift.h: No such file or directory
> #include <tools/be_byteshift.h>
>   ^~~~~~~~~~~~~~~~~~~~~~
> compilation terminated.
> make[1]: *** [scripts/Makefile.host:102: scripts/sortextable] Error 1
> make: *** [Makefile:557: scripts] Error 2
> ----------------------------------------------------------------------
>
> Similar on qemuarm - poky-lsb :
>
> https://autobuilder.yocto.io/builders/nightly-arm-lsb/builds/812/steps/Running%20Sanity%20Tests/logs/stdio
>
> HOSTCC  scripts/recordmcount
> HOSTCC  scripts/sortextable
> scripts/sortextable.c:31:10: fatal error: tools/be_byteshift.h: No such file or directory
>     #include <tools/be_byteshift.h>
>               ^~~~~~~~~~~~~~~~~~~~~~
>               compilation terminated.
>               make[1]: *** [scripts/Makefile.host:102: scripts/sortextable] Error 1
>               make: *** [Makefile:557: scripts] Error 2
> -------------------------------------------------------------------------
>
> Also on PowerPC:
>
> https://autobuilder.yocto.io/builders/nightly-ppc-lsb/builds/814/steps/Running%20Sanity%20Tests/logs/stdio
>
> scripts/sortextable.c:31:10: fatal error: tools/be_byteshift.h: No such file or directory
>  #include <tools/be_byteshift.h>
>            ^~~~~~~~~~~~~~~~~~~~~~
> compilation terminated.
> make[1]: *** [scripts/Makefile.host:102: scripts/sortextable] Error 1
> make: *** [Makefile:557: scripts] Error 2
>
> Best Regards,
> Maxin
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@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"


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2] kernel-devsrc: restructure for out of tree (and on target) module builds
  2018-03-01 10:58     ` Maxin B. John
  2018-03-01 12:58       ` Bruce Ashfield
@ 2018-03-01 13:59       ` Bruce Ashfield
  2018-03-01 14:22         ` Burton, Ross
  1 sibling, 1 reply; 36+ messages in thread
From: Bruce Ashfield @ 2018-03-01 13:59 UTC (permalink / raw)
  To: Maxin B. John, Burton, Ross; +Cc: OE-core

On 2018-03-01 5:58 AM, Maxin B. John wrote:
> 
>> Also fails on musl:
>>
>> ERROR: Nothing RPROVIDES 'glibc-utils' (but /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-musl/build/meta/recipes-kernel/linux/kernel-devsrc.bb RDEPENDS on or otherwise requires it)
>>
>> Ross
>>
>> On 1 March 2018 at 08:28, Maxin B. John <maxin.john@intel.com> wrote:
> 
>   >On Wed, Feb 28, 2018 at 02:20:45PM -0500, Bruce Ashfield wrote:
>   >> The existing kernel-devsrc package starts with a full copy of the kernel
>   >> source and then starts to strip out elements that are not required.
>   >>
>   >> This results in extra time (I/O) and extra space being taken up in the
>   >> final package. The main purpose of the kernel-devsrc package has been to
>   >> build modules against the running kernel, not to include a full copy of
>   >> the source code for re-building the kernel. The end result was a
>   >> 600M kernel-devsrc package.
> 
>   Other failures are listed below:
>   
>   arm64:
>   https://autobuilder.yocto.io/builders/nightly-arm64/builds/790/steps/Running%20Sanity%20Tests/logs/stdio
> 
>   RESULTS - kernelmodule.KernelModuleTest.test_kernel_module - Testcase 1541: FAILED
> 
> HOSTCC  scripts/sortextable
>   scripts/sortextable.c:31:10: fatal error: tools/be_byteshift.h: No such file or directory
> #include <tools/be_byteshift.h>
>    ^~~~~~~~~~~~~~~~~~~~~~
> compilation terminated.
> make[1]: *** [scripts/Makefile.host:102: scripts/sortextable] Error 1
> make: *** [Makefile:557: scripts] Error 2
> ----------------------------------------------------------------------
> 
> Similar on qemuarm - poky-lsb :
> 
> https://autobuilder.yocto.io/builders/nightly-arm-lsb/builds/812/steps/Running%20Sanity%20Tests/logs/stdio
> 
> HOSTCC  scripts/recordmcount
> HOSTCC  scripts/sortextable
> scripts/sortextable.c:31:10: fatal error: tools/be_byteshift.h: No such file or directory
>      #include <tools/be_byteshift.h>
>                ^~~~~~~~~~~~~~~~~~~~~~
>                compilation terminated.
>                make[1]: *** [scripts/Makefile.host:102: scripts/sortextable] Error 1
>                make: *** [Makefile:557: scripts] Error 2
> -------------------------------------------------------------------------
> 
> Also on PowerPC:
> 
> https://autobuilder.yocto.io/builders/nightly-ppc-lsb/builds/814/steps/Running%20Sanity%20Tests/logs/stdio
> 
> scripts/sortextable.c:31:10: fatal error: tools/be_byteshift.h: No such file or directory
>   #include <tools/be_byteshift.h>
>             ^~~~~~~~~~~~~~~~~~~~~~
> compilation terminated.
> make[1]: *** [scripts/Makefile.host:102: scripts/sortextable] Error 1
> make: *** [Makefile:557: scripts] Error 2

I have all these fixed now.

Will have a look at musl next.

Cheers,

Bruce

> 
> Best Regards,
> Maxin
> 



^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2] kernel-devsrc: restructure for out of tree (and on target) module builds
  2018-03-01 13:59       ` Bruce Ashfield
@ 2018-03-01 14:22         ` Burton, Ross
  2018-03-01 14:45           ` Bruce Ashfield
  0 siblings, 1 reply; 36+ messages in thread
From: Burton, Ross @ 2018-03-01 14:22 UTC (permalink / raw)
  To: Bruce Ashfield; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 3187 bytes --]

Swore I picked the v2 patch for the second run, I've fired a mini test
build to see.

Ross

On 1 March 2018 at 13:59, Bruce Ashfield <bruce.ashfield@windriver.com>
wrote:

> On 2018-03-01 5:58 AM, Maxin B. John wrote:
>
>>
>> Also fails on musl:
>>>
>>> ERROR: Nothing RPROVIDES 'glibc-utils' (but
>>> /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-musl/
>>> build/meta/recipes-kernel/linux/kernel-devsrc.bb RDEPENDS on or
>>> otherwise requires it)
>>>
>>> Ross
>>>
>>> On 1 March 2018 at 08:28, Maxin B. John <maxin.john@intel.com> wrote:
>>>
>>
>>   >On Wed, Feb 28, 2018 at 02:20:45PM -0500, Bruce Ashfield wrote:
>>   >> The existing kernel-devsrc package starts with a full copy of the
>> kernel
>>   >> source and then starts to strip out elements that are not required.
>>   >>
>>   >> This results in extra time (I/O) and extra space being taken up in
>> the
>>   >> final package. The main purpose of the kernel-devsrc package has
>> been to
>>   >> build modules against the running kernel, not to include a full copy
>> of
>>   >> the source code for re-building the kernel. The end result was a
>>   >> 600M kernel-devsrc package.
>>
>>   Other failures are listed below:
>>     arm64:
>>   https://autobuilder.yocto.io/builders/nightly-arm64/builds/7
>> 90/steps/Running%20Sanity%20Tests/logs/stdio
>>
>>   RESULTS - kernelmodule.KernelModuleTest.test_kernel_module - Testcase
>> 1541: FAILED
>>
>> HOSTCC  scripts/sortextable
>>   scripts/sortextable.c:31:10: fatal error: tools/be_byteshift.h: No such
>> file or directory
>> #include <tools/be_byteshift.h>
>>    ^~~~~~~~~~~~~~~~~~~~~~
>> compilation terminated.
>> make[1]: *** [scripts/Makefile.host:102: scripts/sortextable] Error 1
>> make: *** [Makefile:557: scripts] Error 2
>> ----------------------------------------------------------------------
>>
>> Similar on qemuarm - poky-lsb :
>>
>> https://autobuilder.yocto.io/builders/nightly-arm-lsb/builds
>> /812/steps/Running%20Sanity%20Tests/logs/stdio
>>
>> HOSTCC  scripts/recordmcount
>> HOSTCC  scripts/sortextable
>> scripts/sortextable.c:31:10: fatal error: tools/be_byteshift.h: No such
>> file or directory
>>      #include <tools/be_byteshift.h>
>>                ^~~~~~~~~~~~~~~~~~~~~~
>>                compilation terminated.
>>                make[1]: *** [scripts/Makefile.host:102:
>> scripts/sortextable] Error 1
>>                make: *** [Makefile:557: scripts] Error 2
>> -------------------------------------------------------------------------
>>
>> Also on PowerPC:
>>
>> https://autobuilder.yocto.io/builders/nightly-ppc-lsb/builds
>> /814/steps/Running%20Sanity%20Tests/logs/stdio
>>
>> scripts/sortextable.c:31:10: fatal error: tools/be_byteshift.h: No such
>> file or directory
>>   #include <tools/be_byteshift.h>
>>             ^~~~~~~~~~~~~~~~~~~~~~
>> compilation terminated.
>> make[1]: *** [scripts/Makefile.host:102: scripts/sortextable] Error 1
>> make: *** [Makefile:557: scripts] Error 2
>>
>
> I have all these fixed now.
>
> Will have a look at musl next.
>
> Cheers,
>
> Bruce
>
>
>> Best Regards,
>> Maxin
>>
>>
>

[-- Attachment #2: Type: text/html, Size: 4752 bytes --]

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2] kernel-devsrc: restructure for out of tree (and on target) module builds
  2018-03-01 14:22         ` Burton, Ross
@ 2018-03-01 14:45           ` Bruce Ashfield
  2018-03-01 14:57             ` Burton, Ross
  0 siblings, 1 reply; 36+ messages in thread
From: Bruce Ashfield @ 2018-03-01 14:45 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

On 2018-03-01 9:22 AM, Burton, Ross wrote:
> Swore I picked the v2 patch for the second run, I've fired a mini test 
> build to see.

The other failures reported were valid and not addressed by v2. So only
32 bit ARM would have been fixed (packaging wise), the rest were ok.

I build and deployed kernel-devsrc for ARM multiple times, so if it does
actually fail again .. I'm *very* interested to hear.

Bruce

> 
> Ross
> 
> On 1 March 2018 at 13:59, Bruce Ashfield <bruce.ashfield@windriver.com 
> <mailto:bruce.ashfield@windriver.com>> wrote:
> 
>     On 2018-03-01 5:58 AM, Maxin B. John wrote:
> 
> 
>             Also fails on musl:
> 
>             ERROR: Nothing RPROVIDES 'glibc-utils' (but
>             /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-musl/build/meta/recipes-kernel/linux/kernel-devsrc.bb
>             <http://kernel-devsrc.bb> RDEPENDS on or otherwise requires it)
> 
>             Ross
> 
>             On 1 March 2018 at 08:28, Maxin B. John
>             <maxin.john@intel.com <mailto:maxin.john@intel.com>> wrote:
> 
> 
>            >On Wed, Feb 28, 2018 at 02:20:45PM -0500, Bruce Ashfield wrote:
>            >> The existing kernel-devsrc package starts with a full copy
>         of the kernel
>            >> source and then starts to strip out elements that are not
>         required.
>            >>
>            >> This results in extra time (I/O) and extra space being
>         taken up in the
>            >> final package. The main purpose of the kernel-devsrc
>         package has been to
>            >> build modules against the running kernel, not to include a
>         full copy of
>            >> the source code for re-building the kernel. The end result
>         was a
>            >> 600M kernel-devsrc package.
> 
>            Other failures are listed below:
>              arm64:
>         https://autobuilder.yocto.io/builders/nightly-arm64/builds/790/steps/Running%20Sanity%20Tests/logs/stdio
>         <https://autobuilder.yocto.io/builders/nightly-arm64/builds/790/steps/Running%20Sanity%20Tests/logs/stdio>
> 
>            RESULTS - kernelmodule.KernelModuleTest.test_kernel_module -
>         Testcase 1541: FAILED
> 
>         HOSTCC  scripts/sortextable
>            scripts/sortextable.c:31:10: fatal error:
>         tools/be_byteshift.h: No such file or directory
>         #include <tools/be_byteshift.h>
>             ^~~~~~~~~~~~~~~~~~~~~~
>         compilation terminated.
>         make[1]: *** [scripts/Makefile.host:102: scripts/sortextable]
>         Error 1
>         make: *** [Makefile:557: scripts] Error 2
>         ----------------------------------------------------------------------
> 
>         Similar on qemuarm - poky-lsb :
> 
>         https://autobuilder.yocto.io/builders/nightly-arm-lsb/builds/812/steps/Running%20Sanity%20Tests/logs/stdio
>         <https://autobuilder.yocto.io/builders/nightly-arm-lsb/builds/812/steps/Running%20Sanity%20Tests/logs/stdio>
> 
>         HOSTCC  scripts/recordmcount
>         HOSTCC  scripts/sortextable
>         scripts/sortextable.c:31:10: fatal error: tools/be_byteshift.h:
>         No such file or directory
>               #include <tools/be_byteshift.h>
>                         ^~~~~~~~~~~~~~~~~~~~~~
>                         compilation terminated.
>                         make[1]: *** [scripts/Makefile.host:102:
>         scripts/sortextable] Error 1
>                         make: *** [Makefile:557: scripts] Error 2
>         -------------------------------------------------------------------------
> 
>         Also on PowerPC:
> 
>         https://autobuilder.yocto.io/builders/nightly-ppc-lsb/builds/814/steps/Running%20Sanity%20Tests/logs/stdio
>         <https://autobuilder.yocto.io/builders/nightly-ppc-lsb/builds/814/steps/Running%20Sanity%20Tests/logs/stdio>
> 
>         scripts/sortextable.c:31:10: fatal error: tools/be_byteshift.h:
>         No such file or directory
>            #include <tools/be_byteshift.h>
>                      ^~~~~~~~~~~~~~~~~~~~~~
>         compilation terminated.
>         make[1]: *** [scripts/Makefile.host:102: scripts/sortextable]
>         Error 1
>         make: *** [Makefile:557: scripts] Error 2
> 
> 
>     I have all these fixed now.
> 
>     Will have a look at musl next.
> 
>     Cheers,
> 
>     Bruce
> 
> 
>         Best Regards,
>         Maxin
> 
> 
> 



^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2] kernel-devsrc: restructure for out of tree (and on target) module builds
  2018-03-01 14:45           ` Bruce Ashfield
@ 2018-03-01 14:57             ` Burton, Ross
  0 siblings, 0 replies; 36+ messages in thread
From: Burton, Ross @ 2018-03-01 14:57 UTC (permalink / raw)
  To: Bruce Ashfield; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 4760 bytes --]

Ah ok, I misunderstood.

Ross

On 1 March 2018 at 14:45, Bruce Ashfield <bruce.ashfield@windriver.com>
wrote:

> On 2018-03-01 9:22 AM, Burton, Ross wrote:
>
>> Swore I picked the v2 patch for the second run, I've fired a mini test
>> build to see.
>>
>
> The other failures reported were valid and not addressed by v2. So only
> 32 bit ARM would have been fixed (packaging wise), the rest were ok.
>
> I build and deployed kernel-devsrc for ARM multiple times, so if it does
> actually fail again .. I'm *very* interested to hear.
>
> Bruce
>
>
>> Ross
>>
>> On 1 March 2018 at 13:59, Bruce Ashfield <bruce.ashfield@windriver.com
>> <mailto:bruce.ashfield@windriver.com>> wrote:
>>
>>     On 2018-03-01 5:58 AM, Maxin B. John wrote:
>>
>>
>>             Also fails on musl:
>>
>>             ERROR: Nothing RPROVIDES 'glibc-utils' (but
>>             /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-musl/
>> build/meta/recipes-kernel/linux/kernel-devsrc.bb
>>             <http://kernel-devsrc.bb> RDEPENDS on or otherwise requires
>> it)
>>
>>             Ross
>>
>>             On 1 March 2018 at 08:28, Maxin B. John
>>             <maxin.john@intel.com <mailto:maxin.john@intel.com>> wrote:
>>
>>
>>            >On Wed, Feb 28, 2018 at 02:20:45PM -0500, Bruce Ashfield
>> wrote:
>>            >> The existing kernel-devsrc package starts with a full copy
>>         of the kernel
>>            >> source and then starts to strip out elements that are not
>>         required.
>>            >>
>>            >> This results in extra time (I/O) and extra space being
>>         taken up in the
>>            >> final package. The main purpose of the kernel-devsrc
>>         package has been to
>>            >> build modules against the running kernel, not to include a
>>         full copy of
>>            >> the source code for re-building the kernel. The end result
>>         was a
>>            >> 600M kernel-devsrc package.
>>
>>            Other failures are listed below:
>>              arm64:
>>         https://autobuilder.yocto.io/builders/nightly-arm64/builds/7
>> 90/steps/Running%20Sanity%20Tests/logs/stdio
>>         <https://autobuilder.yocto.io/builders/nightly-arm64/builds/
>> 790/steps/Running%20Sanity%20Tests/logs/stdio>
>>
>>            RESULTS - kernelmodule.KernelModuleTest.test_kernel_module -
>>         Testcase 1541: FAILED
>>
>>         HOSTCC  scripts/sortextable
>>            scripts/sortextable.c:31:10: fatal error:
>>         tools/be_byteshift.h: No such file or directory
>>         #include <tools/be_byteshift.h>
>>             ^~~~~~~~~~~~~~~~~~~~~~
>>         compilation terminated.
>>         make[1]: *** [scripts/Makefile.host:102: scripts/sortextable]
>>         Error 1
>>         make: *** [Makefile:557: scripts] Error 2
>>         ------------------------------------------------------------
>> ----------
>>
>>         Similar on qemuarm - poky-lsb :
>>
>>         https://autobuilder.yocto.io/builders/nightly-arm-lsb/builds
>> /812/steps/Running%20Sanity%20Tests/logs/stdio
>>         <https://autobuilder.yocto.io/builders/nightly-arm-lsb/build
>> s/812/steps/Running%20Sanity%20Tests/logs/stdio>
>>
>>         HOSTCC  scripts/recordmcount
>>         HOSTCC  scripts/sortextable
>>         scripts/sortextable.c:31:10: fatal error: tools/be_byteshift.h:
>>         No such file or directory
>>               #include <tools/be_byteshift.h>
>>                         ^~~~~~~~~~~~~~~~~~~~~~
>>                         compilation terminated.
>>                         make[1]: *** [scripts/Makefile.host:102:
>>         scripts/sortextable] Error 1
>>                         make: *** [Makefile:557: scripts] Error 2
>>         ------------------------------------------------------------
>> -------------
>>
>>         Also on PowerPC:
>>
>>         https://autobuilder.yocto.io/builders/nightly-ppc-lsb/builds
>> /814/steps/Running%20Sanity%20Tests/logs/stdio
>>         <https://autobuilder.yocto.io/builders/nightly-ppc-lsb/build
>> s/814/steps/Running%20Sanity%20Tests/logs/stdio>
>>
>>         scripts/sortextable.c:31:10: fatal error: tools/be_byteshift.h:
>>         No such file or directory
>>            #include <tools/be_byteshift.h>
>>                      ^~~~~~~~~~~~~~~~~~~~~~
>>         compilation terminated.
>>         make[1]: *** [scripts/Makefile.host:102: scripts/sortextable]
>>         Error 1
>>         make: *** [Makefile:557: scripts] Error 2
>>
>>
>>     I have all these fixed now.
>>
>>     Will have a look at musl next.
>>
>>     Cheers,
>>
>>     Bruce
>>
>>
>>         Best Regards,
>>         Maxin
>>
>>
>>
>>
>

[-- Attachment #2: Type: text/html, Size: 7448 bytes --]

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2] kernel-devsrc: restructure for out of tree (and on target) module builds
  2018-03-01  9:37   ` Burton, Ross
  2018-03-01 10:58     ` Maxin B. John
@ 2018-03-02 14:23     ` Bruce Ashfield
  2018-03-02 14:26       ` Burton, Ross
  2018-03-02 18:16     ` Khem Raj
  2 siblings, 1 reply; 36+ messages in thread
From: Bruce Ashfield @ 2018-03-02 14:23 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

I worked through some problems to test with musl:

   - uprev'd linux-libc-headers --> refresh / change of the musl ethhdr
     patch

   - worked around the binutils link issue and libsystemd

So I was able to assemble kernel-devsrc on an image with musl, and now
I'm back to the problem that lead me to add glibc-utils to the RDEPENDS
of kernel-devsrc:

---------

root@qemux86-64:/lib/modules/4.14.19-yocto-standard/build# make ARCH=x86 
scripts
make: getconf: Command not found
make: getconf: Command not found
make: getconf: Command not found
   HOSTCC  scripts/basic/fixdep
   HOSTCC  scripts/basic/bin2c
make[1]: getconf: Command not found
make[1]: getconf: Command not found
make[1]: getconf: Command not found
   HOSTCC  scripts/kconfig/conf.o
   SHIPPED scripts/kconfig/zconf.tab.c
   SHIPPED scripts/kconfig/zconf.lex.c
   HOSTCC  scripts/kconfig/zconf.tab.o
   HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf  --silentoldconfig Kconfig
   WRAP    arch/x86/include/generated/asm/clkdev.h
   WRAP    arch/x86/include/generated/asm/dma-contiguous.h
   WRAP    arch/x86/include/generated/asm/early_ioremap.h
   WRAP    arch/x86/include/generated/asm/mcs_spinlock.h
   WRAP    arch/x86/include/generated/asm/mm-arch-hooks.h
   CC      scripts/mod/empty.o
   HOSTCC  scripts/mod/mk_elfconfig
   MKELF   scripts/mod/elfconfig.h
   HOSTCC  scripts/mod/modpost.o
   CC      scripts/mod/devicetable-offsets.s
   CHK     scripts/mod/devicetable-offsets.h
   UPD     scripts/mod/devicetable-offsets.h
   HOSTCC  scripts/mod/file2alias.o
   HOSTCC  scripts/mod/sumversion.o
   HOSTLD  scripts/mod/modpost
   HOSTCC  scripts/kallsyms
   HOSTCC  scripts/conmakehash
   HOSTCC  scripts/recordmcount
   HOSTCC  scripts/sortextable
root@qemux86-64:/lib/modules/4.14.19-yocto-standard/build#

----------------

I've added Khem to the cc .. Khem: what in the muslc world would
provide 'getconf' ? I didn't see it when glancing through the packaging.

Bruce

On 2018-03-01 4:37 AM, Burton, Ross wrote:
> Also fails on musl:
> 
> ERROR: Nothing RPROVIDES 'glibc-utils' (but 
> /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-musl/build/meta/recipes-kernel/linux/kernel-devsrc.bb 
> <http://kernel-devsrc.bb> RDEPENDS on or otherwise requires it)
> 
> Ross
> 
> On 1 March 2018 at 08:28, Maxin B. John <maxin.john@intel.com 
> <mailto:maxin.john@intel.com>> wrote:
> 
>     Hi,
> 
>     On Wed, Feb 28, 2018 at 02:20:45PM -0500, Bruce Ashfield wrote:
>      > The existing kernel-devsrc package starts with a full copy of the
>     kernel
>      > source and then starts to strip out elements that are not required.
>      >
>      > This results in extra time (I/O) and extra space being taken up
>     in the
>      > final package. The main purpose of the kernel-devsrc package has
>     been to
>      > build modules against the running kernel, not to include a full
>     copy of
>      > the source code for re-building the kernel. The end result was a
>      > 600M kernel-devsrc package.
>      >
>      > This restructuring of the package uses an approach similar to other
>      > distros, where the kernel-devsrc package is for building against the
>      > running kernel and uses a curated set of copied infrastructure,
>     versus
>      > a mass copy of the entire kernel.
>      >
>      > The differences in this approach versus other is largely due to the
>      > architecture support and the split build/source directory of the
>      > kernel.
>      >
>      > The result is a kernel-devsrc package of about 10M, which is capable
>      > of running "make scripts" and compiling kernel modules against the
>      > running kernel.
>      >
>      > Along with the changes to the copying of the infrascture, we also
>      > have the following changes:
>      >
>      >  - a better/more explicit listing of dependencies for on-target
>      >    builds of "make scripts" or "make modules_prepare"
>      >
>      >  - The kernel source is installed into /lib/modules/<version>/build
>      >    and a symlink created from /usr/src/kernel to the new location.
>      >    This aligns with the standard location for module support
>      >    code
>      >
>      >  - There is also a symlink from /lib/modules/<version>/source ->
>     build
>      >    to reserve a spot for a new package that is simply the kernel
>      >    source. That package is not part of this update.
>      >
>      > [YOCTO #12535]
>      >
>      > Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com
>     <mailto:bruce.ashfield@windriver.com>>
>      > ---
>      >
>      >  v2: fix arch/arm devsrc builds
> 
>     Noticed one kernel-devsrc build failure in autobuilder (qemuarm) :
> 
>     https://autobuilder.yocto.io/builders/nightly-arm/builds/876/steps/BuildImages/logs/stdio
>     <https://autobuilder.yocto.io/builders/nightly-arm/builds/876/steps/BuildImages/logs/stdio>
> 
>     ERROR: kernel-devsrc-1.0-r0 do_install: Function failed: do_install
>     (log file is located at
>     /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/temp/log.do_install.25822)
>     ERROR: Logfile of failure stored in:
>     /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/temp/log.do_install.25822
>     Log data follows:
>     | DEBUG: Executing python function extend_recipe_sysroot
>     | NOTE: Direct dependencies are
>     ['/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-devtools/binutils/binutils-cross_2.30.bb:do_populate_sysroot',
>     'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-extended/xz/xz_5.2.3.bb:do_populate_sysroot',
>     'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-devtools/pkgconfig/pkgconfig_git.bb:do_populate_sysroot',
>     'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-support/lzop/lzop_1.03.bb:do_populate_sysroot',
>     '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb:do_populate_sysroot',
>     '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-devtools/gcc/gcc-runtime_7.3.bb:do_populate_sysroot',
>     '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-devtools/gcc/gcc-cross_7.
>       3.bb:do_populate_sysroot',
>     'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-devtools/bison/bison_3.0.4.bb:do_populate_sysroot',
>     'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-devtools/pseudo/pseudo_1.8.2.bb:do_populate_sysroot',
>     '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-core/glibc/glibc_2.26.bb:do_populate_sysroot',
>     '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-kernel/kmod/kmod-native_git.bb:do_populate_sysroot',
>     'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-extended/bc/bc_1.06.bb:do_populate_sysroot',
>     '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-devtools/quilt/quilt-native_0.65.bb:do_populate_sysroot',
>     'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-connectivity/openssl/openssl_1.0.2n.bb:d
>       o_populate_sysroot']
>     | NOTE: Installed into sysroot: ['pkgconfig-native', 'lzop-native',
>     'kern-tools-native', 'pseudo-native', 'kmod-native', 'bc-native',
>     'openssl-native', 'gtk-doc-native', 'lzo-native',
>     'makedepend-native', 'cryptodev-linux-native', 'util-macros-native',
>     'xproto-native']
>     | NOTE: Skipping as already exists in sysroot:
>     ['binutils-cross-arm', 'xz-native', 'gcc-runtime', 'gcc-cross-arm',
>     'bison-native', 'glibc', 'quilt-native', 'gettext-minimal-native',
>     'gnu-config-native', 'automake-native', 'autoconf-native',
>     'libtool-native', 'linux-libc-headers', 'libgcc', 'zlib-native',
>     'texinfo-dummy-native', 'flex-native', 'libmpc-native',
>     'gmp-native', 'mpfr-native', 'm4-native']
>     | DEBUG: sed -e
>     's:^[^/]*/:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/recipe-sysroot-native/:g'
>     /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/sysroots-components/x86_64/pkgconfig-native/fixmepath
>     /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/sysroots-components/x86_64/openssl-native/fixmepath
>     /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/sysroots-components/x86_64/gtk-doc-native/fixmepath
>     | xargs sed -i -e
>     's:FIXMESTAGINGDIRTARGET:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/recipe-sysroot:g;
>     s:FIXMESTAGINGDIRHOST:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/recipe-sysroot-native:g'
>     -e 's:FIXME_COMPONENTS_DIR:/home/pokybuild/yocto-autobuilder/y
>       octo-worker/nightly-arm/build/build/tmp/sysroots-components:g' -e
>     's:FIXME_HOSTTOOLS_DIR:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/hosttools:g'
>     -e
>     's:FIXME_PKGDATA_DIR:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/pkgdata/qemuarm:g'
>     -e
>     's:FIXME_PSEUDO_LOCALSTATEDIR:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/pseudo/:g'
>     -e
>     's:FIXME_LOGFIFO:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/temp/fifo.25822:g'
>     | DEBUG: Python function extend_recipe_sysroot finished
>     | DEBUG: Executing shell function do_install
>     | cp: with --parents, the destination must be a directory
>     | Try 'cp --help' for more information.
>     | WARNING:
>     /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/temp/run.do_install.25822:1
>     exit 1 from 'rm -rf $kerneldir/build/include'
>     | ERROR: Function failed: do_install (log file is located at
>     /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/temp/log.do_install.25822)
>     NOTE: recipe kernel-devsrc-1.0-r0: task do_install: Failed
>     ERROR: Task
>     (/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-kernel/linux/kernel-devsrc.bb:do_install)
>     failed with exit code '1'
> 
>     Best Regards,
>     Maxin
>     --
>     _______________________________________________
>     Openembedded-core mailing list
>     Openembedded-core@lists.openembedded.org
>     <mailto:Openembedded-core@lists.openembedded.org>
>     http://lists.openembedded.org/mailman/listinfo/openembedded-core
>     <http://lists.openembedded.org/mailman/listinfo/openembedded-core>
> 
> 



^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2] kernel-devsrc: restructure for out of tree (and on target) module builds
  2018-03-02 14:23     ` Bruce Ashfield
@ 2018-03-02 14:26       ` Burton, Ross
  2018-03-02 15:20         ` Khem Raj
  0 siblings, 1 reply; 36+ messages in thread
From: Burton, Ross @ 2018-03-02 14:26 UTC (permalink / raw)
  To: Bruce Ashfield; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 12312 bytes --]

Alpine Linux has hit this and they just build a custom getconf binary as
part of their musl build;

https://git.alpinelinux.org/cgit/aports/tree/main/musl

(also getent)

Ross

On 2 March 2018 at 14:23, Bruce Ashfield <bruce.ashfield@windriver.com>
wrote:

> I worked through some problems to test with musl:
>
>   - uprev'd linux-libc-headers --> refresh / change of the musl ethhdr
>     patch
>
>   - worked around the binutils link issue and libsystemd
>
> So I was able to assemble kernel-devsrc on an image with musl, and now
> I'm back to the problem that lead me to add glibc-utils to the RDEPENDS
> of kernel-devsrc:
>
> ---------
>
> root@qemux86-64:/lib/modules/4.14.19-yocto-standard/build# make ARCH=x86
> scripts
> make: getconf: Command not found
> make: getconf: Command not found
> make: getconf: Command not found
>   HOSTCC  scripts/basic/fixdep
>   HOSTCC  scripts/basic/bin2c
> make[1]: getconf: Command not found
> make[1]: getconf: Command not found
> make[1]: getconf: Command not found
>   HOSTCC  scripts/kconfig/conf.o
>   SHIPPED scripts/kconfig/zconf.tab.c
>   SHIPPED scripts/kconfig/zconf.lex.c
>   HOSTCC  scripts/kconfig/zconf.tab.o
>   HOSTLD  scripts/kconfig/conf
> scripts/kconfig/conf  --silentoldconfig Kconfig
>   WRAP    arch/x86/include/generated/asm/clkdev.h
>   WRAP    arch/x86/include/generated/asm/dma-contiguous.h
>   WRAP    arch/x86/include/generated/asm/early_ioremap.h
>   WRAP    arch/x86/include/generated/asm/mcs_spinlock.h
>   WRAP    arch/x86/include/generated/asm/mm-arch-hooks.h
>   CC      scripts/mod/empty.o
>   HOSTCC  scripts/mod/mk_elfconfig
>   MKELF   scripts/mod/elfconfig.h
>   HOSTCC  scripts/mod/modpost.o
>   CC      scripts/mod/devicetable-offsets.s
>   CHK     scripts/mod/devicetable-offsets.h
>   UPD     scripts/mod/devicetable-offsets.h
>   HOSTCC  scripts/mod/file2alias.o
>   HOSTCC  scripts/mod/sumversion.o
>   HOSTLD  scripts/mod/modpost
>   HOSTCC  scripts/kallsyms
>   HOSTCC  scripts/conmakehash
>   HOSTCC  scripts/recordmcount
>   HOSTCC  scripts/sortextable
> root@qemux86-64:/lib/modules/4.14.19-yocto-standard/build#
>
> ----------------
>
> I've added Khem to the cc .. Khem: what in the muslc world would
> provide 'getconf' ? I didn't see it when glancing through the packaging.
>
> Bruce
>
> On 2018-03-01 4:37 AM, Burton, Ross wrote:
>
>> Also fails on musl:
>>
>> ERROR: Nothing RPROVIDES 'glibc-utils' (but /home/pokybuild/yocto-autobuil
>> der/yocto-worker/nightly-musl/build/meta/recipes-kernel/linux/
>> kernel-devsrc.bb <http://kernel-devsrc.bb> RDEPENDS on or otherwise
>> requires it)
>>
>> Ross
>>
>>
>> On 1 March 2018 at 08:28, Maxin B. John <maxin.john@intel.com <mailto:
>> maxin.john@intel.com>> wrote:
>>
>>     Hi,
>>
>>     On Wed, Feb 28, 2018 at 02:20:45PM -0500, Bruce Ashfield wrote:
>>      > The existing kernel-devsrc package starts with a full copy of the
>>     kernel
>>      > source and then starts to strip out elements that are not required.
>>      >
>>      > This results in extra time (I/O) and extra space being taken up
>>     in the
>>      > final package. The main purpose of the kernel-devsrc package has
>>     been to
>>      > build modules against the running kernel, not to include a full
>>     copy of
>>      > the source code for re-building the kernel. The end result was a
>>      > 600M kernel-devsrc package.
>>      >
>>      > This restructuring of the package uses an approach similar to other
>>      > distros, where the kernel-devsrc package is for building against
>> the
>>      > running kernel and uses a curated set of copied infrastructure,
>>     versus
>>      > a mass copy of the entire kernel.
>>      >
>>      > The differences in this approach versus other is largely due to the
>>      > architecture support and the split build/source directory of the
>>      > kernel.
>>      >
>>      > The result is a kernel-devsrc package of about 10M, which is
>> capable
>>      > of running "make scripts" and compiling kernel modules against the
>>      > running kernel.
>>      >
>>      > Along with the changes to the copying of the infrascture, we also
>>      > have the following changes:
>>      >
>>      >  - a better/more explicit listing of dependencies for on-target
>>      >    builds of "make scripts" or "make modules_prepare"
>>      >
>>      >  - The kernel source is installed into /lib/modules/<version>/build
>>      >    and a symlink created from /usr/src/kernel to the new location.
>>      >    This aligns with the standard location for module support
>>      >    code
>>      >
>>      >  - There is also a symlink from /lib/modules/<version>/source ->
>>     build
>>      >    to reserve a spot for a new package that is simply the kernel
>>      >    source. That package is not part of this update.
>>      >
>>      > [YOCTO #12535]
>>      >
>>      > Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com
>>     <mailto:bruce.ashfield@windriver.com>>
>>
>>      > ---
>>      >
>>      >  v2: fix arch/arm devsrc builds
>>
>>     Noticed one kernel-devsrc build failure in autobuilder (qemuarm) :
>>
>>     https://autobuilder.yocto.io/builders/nightly-arm/builds/876
>> /steps/BuildImages/logs/stdio
>>     <https://autobuilder.yocto.io/builders/nightly-arm/builds/87
>> 6/steps/BuildImages/logs/stdio>
>>
>>     ERROR: kernel-devsrc-1.0-r0 do_install: Function failed: do_install
>>     (log file is located at
>>     /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/
>> build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-
>> devsrc/1.0-r0/temp/log.do_install.25822)
>>     ERROR: Logfile of failure stored in:
>>     /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/
>> build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-
>> devsrc/1.0-r0/temp/log.do_install.25822
>>     Log data follows:
>>     | DEBUG: Executing python function extend_recipe_sysroot
>>     | NOTE: Direct dependencies are
>>     ['/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-
>> arm/build/meta/recipes-devtools/binutils/binutils-cross_2.30.bb:
>> do_populate_sysroot',
>>     'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-
>> worker/nightly-arm/build/meta/recipes-extended/xz/xz_5.2.3.
>> bb:do_populate_sysroot',
>>     'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-
>> worker/nightly-arm/build/meta/recipes-devtools/pkgconfig/
>> pkgconfig_git.bb:do_populate_sysroot',
>>     'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-
>> worker/nightly-arm/build/meta/recipes-support/lzop/lzop_1.03.bb:
>> do_populate_sysroot',
>>     '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/
>> build/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb:
>> do_populate_sysroot',
>>     '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/
>> build/meta/recipes-devtools/gcc/gcc-runtime_7.3.bb:do_populate_sysroot',
>>     '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/
>> build/meta/recipes-devtools/gcc/gcc-cross_7.
>>       3.bb:do_populate_sysroot',
>>     'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-
>> worker/nightly-arm/build/meta/recipes-devtools/bison/bison_3.0.4.bb:
>> do_populate_sysroot',
>>     'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-
>> worker/nightly-arm/build/meta/recipes-devtools/pseudo/pseudo_1.8.2.bb:
>> do_populate_sysroot',
>>     '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/
>> build/meta/recipes-core/glibc/glibc_2.26.bb:do_populate_sysroot',
>>     '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/
>> build/meta/recipes-kernel/kmod/kmod-native_git.bb:do_populate_sysroot',
>>     'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-
>> worker/nightly-arm/build/meta/recipes-extended/bc/bc_1.06.
>> bb:do_populate_sysroot',
>>     '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/
>> build/meta/recipes-devtools/quilt/quilt-native_0.65.bb:do_
>> populate_sysroot',
>>     'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-
>> worker/nightly-arm/build/meta/recipes-connectivity/openssl/
>> openssl_1.0.2n.bb:d
>>       o_populate_sysroot']
>>     | NOTE: Installed into sysroot: ['pkgconfig-native', 'lzop-native',
>>     'kern-tools-native', 'pseudo-native', 'kmod-native', 'bc-native',
>>     'openssl-native', 'gtk-doc-native', 'lzo-native',
>>     'makedepend-native', 'cryptodev-linux-native', 'util-macros-native',
>>     'xproto-native']
>>     | NOTE: Skipping as already exists in sysroot:
>>     ['binutils-cross-arm', 'xz-native', 'gcc-runtime', 'gcc-cross-arm',
>>     'bison-native', 'glibc', 'quilt-native', 'gettext-minimal-native',
>>     'gnu-config-native', 'automake-native', 'autoconf-native',
>>     'libtool-native', 'linux-libc-headers', 'libgcc', 'zlib-native',
>>     'texinfo-dummy-native', 'flex-native', 'libmpc-native',
>>     'gmp-native', 'mpfr-native', 'm4-native']
>>     | DEBUG: sed -e
>>     's:^[^/]*/:/home/pokybuild/yocto-autobuilder/yocto-worker/
>> nightly-arm/build/build/tmp/work/qemuarm-poky-linux-
>> gnueabi/kernel-devsrc/1.0-r0/recipe-sysroot-native/:g'
>>     /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/
>> build/build/tmp/sysroots-components/x86_64/pkgconfig-native/fixmepath
>>     /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/
>> build/build/tmp/sysroots-components/x86_64/openssl-native/fixmepath
>>     /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/
>> build/build/tmp/sysroots-components/x86_64/gtk-doc-native/fixmepath
>>     | xargs sed -i -e
>>     's:FIXMESTAGINGDIRTARGET:/home/pokybuild/yocto-autobuilder/
>> yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-
>> poky-linux-gnueabi/kernel-devsrc/1.0-r0/recipe-sysroot:g;
>>     s:FIXMESTAGINGDIRHOST:/home/pokybuild/yocto-autobuilder/yoct
>> o-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-
>> linux-gnueabi/kernel-devsrc/1.0-r0/recipe-sysroot-native:g'
>>     -e 's:FIXME_COMPONENTS_DIR:/home/pokybuild/yocto-autobuilder/y
>>       octo-worker/nightly-arm/build/build/tmp/sysroots-components:g' -e
>>     's:FIXME_HOSTTOOLS_DIR:/home/pokybuild/yocto-autobuilder/yoc
>> to-worker/nightly-arm/build/build/tmp/hosttools:g'
>>     -e
>>     's:FIXME_PKGDATA_DIR:/home/pokybuild/yocto-autobuilder/yocto
>> -worker/nightly-arm/build/build/tmp/pkgdata/qemuarm:g'
>>     -e
>>     's:FIXME_PSEUDO_LOCALSTATEDIR:/home/pokybuild/yocto-autobuil
>> der/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-
>> poky-linux-gnueabi/kernel-devsrc/1.0-r0/pseudo/:g'
>>     -e
>>     's:FIXME_LOGFIFO:/home/pokybuild/yocto-autobuilder/yocto-
>> worker/nightly-arm/build/build/tmp/work/qemuarm-poky-
>> linux-gnueabi/kernel-devsrc/1.0-r0/temp/fifo.25822:g'
>>     | DEBUG: Python function extend_recipe_sysroot finished
>>     | DEBUG: Executing shell function do_install
>>     | cp: with --parents, the destination must be a directory
>>     | Try 'cp --help' for more information.
>>     | WARNING:
>>     /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/
>> build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-
>> devsrc/1.0-r0/temp/run.do_install.25822:1
>>     exit 1 from 'rm -rf $kerneldir/build/include'
>>     | ERROR: Function failed: do_install (log file is located at
>>     /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/
>> build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-
>> devsrc/1.0-r0/temp/log.do_install.25822)
>>     NOTE: recipe kernel-devsrc-1.0-r0: task do_install: Failed
>>     ERROR: Task
>>     (/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/
>> build/meta/recipes-kernel/linux/kernel-devsrc.bb:do_install)
>>     failed with exit code '1'
>>
>>     Best Regards,
>>     Maxin
>>     --
>>     _______________________________________________
>>     Openembedded-core mailing list
>>     Openembedded-core@lists.openembedded.org
>>     <mailto:Openembedded-core@lists.openembedded.org>
>>     http://lists.openembedded.org/mailman/listinfo/openembedded-core
>>     <http://lists.openembedded.org/mailman/listinfo/openembedded-core>
>>
>>
>>
>

[-- Attachment #2: Type: text/html, Size: 15876 bytes --]

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2] kernel-devsrc: restructure for out of tree (and on target) module builds
  2018-03-02 14:26       ` Burton, Ross
@ 2018-03-02 15:20         ` Khem Raj
  0 siblings, 0 replies; 36+ messages in thread
From: Khem Raj @ 2018-03-02 15:20 UTC (permalink / raw)
  To: Burton, Ross; +Cc: Bruce Ashfield, OE-core

On Fri, Mar 2, 2018 at 6:26 AM, Burton, Ross <ross.burton@intel.com> wrote:
> Alpine Linux has hit this and they just build a custom getconf binary as
> part of their musl build;
>
> https://git.alpinelinux.org/cgit/aports/tree/main/musl
>
> (also getent)
>

I have long thought for adding musl-utils recipes for compat issues

we should probably enhance bsd-headers to include
https://github.com/boltlinux/musl-utils
and also rename the recipe to be called glibc-compat or musl-utils

> Ross
>
> On 2 March 2018 at 14:23, Bruce Ashfield <bruce.ashfield@windriver.com>
> wrote:
>>
>> I worked through some problems to test with musl:
>>
>>   - uprev'd linux-libc-headers --> refresh / change of the musl ethhdr
>>     patch
>>
>>   - worked around the binutils link issue and libsystemd
>>
>> So I was able to assemble kernel-devsrc on an image with musl, and now
>> I'm back to the problem that lead me to add glibc-utils to the RDEPENDS
>> of kernel-devsrc:
>>
>> ---------
>>
>> root@qemux86-64:/lib/modules/4.14.19-yocto-standard/build# make ARCH=x86
>> scripts
>> make: getconf: Command not found
>> make: getconf: Command not found
>> make: getconf: Command not found
>>   HOSTCC  scripts/basic/fixdep
>>   HOSTCC  scripts/basic/bin2c
>> make[1]: getconf: Command not found
>> make[1]: getconf: Command not found
>> make[1]: getconf: Command not found
>>   HOSTCC  scripts/kconfig/conf.o
>>   SHIPPED scripts/kconfig/zconf.tab.c
>>   SHIPPED scripts/kconfig/zconf.lex.c
>>   HOSTCC  scripts/kconfig/zconf.tab.o
>>   HOSTLD  scripts/kconfig/conf
>> scripts/kconfig/conf  --silentoldconfig Kconfig
>>   WRAP    arch/x86/include/generated/asm/clkdev.h
>>   WRAP    arch/x86/include/generated/asm/dma-contiguous.h
>>   WRAP    arch/x86/include/generated/asm/early_ioremap.h
>>   WRAP    arch/x86/include/generated/asm/mcs_spinlock.h
>>   WRAP    arch/x86/include/generated/asm/mm-arch-hooks.h
>>   CC      scripts/mod/empty.o
>>   HOSTCC  scripts/mod/mk_elfconfig
>>   MKELF   scripts/mod/elfconfig.h
>>   HOSTCC  scripts/mod/modpost.o
>>   CC      scripts/mod/devicetable-offsets.s
>>   CHK     scripts/mod/devicetable-offsets.h
>>   UPD     scripts/mod/devicetable-offsets.h
>>   HOSTCC  scripts/mod/file2alias.o
>>   HOSTCC  scripts/mod/sumversion.o
>>   HOSTLD  scripts/mod/modpost
>>   HOSTCC  scripts/kallsyms
>>   HOSTCC  scripts/conmakehash
>>   HOSTCC  scripts/recordmcount
>>   HOSTCC  scripts/sortextable
>> root@qemux86-64:/lib/modules/4.14.19-yocto-standard/build#
>>
>> ----------------
>>
>> I've added Khem to the cc .. Khem: what in the muslc world would
>> provide 'getconf' ? I didn't see it when glancing through the packaging.
>>
>> Bruce
>>
>> On 2018-03-01 4:37 AM, Burton, Ross wrote:
>>>
>>> Also fails on musl:
>>>
>>> ERROR: Nothing RPROVIDES 'glibc-utils' (but
>>> /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-musl/build/meta/recipes-kernel/linux/kernel-devsrc.bb
>>> <http://kernel-devsrc.bb> RDEPENDS on or otherwise requires it)
>>>
>>> Ross
>>>
>>>
>>> On 1 March 2018 at 08:28, Maxin B. John <maxin.john@intel.com
>>> <mailto:maxin.john@intel.com>> wrote:
>>>
>>>     Hi,
>>>
>>>     On Wed, Feb 28, 2018 at 02:20:45PM -0500, Bruce Ashfield wrote:
>>>      > The existing kernel-devsrc package starts with a full copy of the
>>>     kernel
>>>      > source and then starts to strip out elements that are not
>>> required.
>>>      >
>>>      > This results in extra time (I/O) and extra space being taken up
>>>     in the
>>>      > final package. The main purpose of the kernel-devsrc package has
>>>     been to
>>>      > build modules against the running kernel, not to include a full
>>>     copy of
>>>      > the source code for re-building the kernel. The end result was a
>>>      > 600M kernel-devsrc package.
>>>      >
>>>      > This restructuring of the package uses an approach similar to
>>> other
>>>      > distros, where the kernel-devsrc package is for building against
>>> the
>>>      > running kernel and uses a curated set of copied infrastructure,
>>>     versus
>>>      > a mass copy of the entire kernel.
>>>      >
>>>      > The differences in this approach versus other is largely due to
>>> the
>>>      > architecture support and the split build/source directory of the
>>>      > kernel.
>>>      >
>>>      > The result is a kernel-devsrc package of about 10M, which is
>>> capable
>>>      > of running "make scripts" and compiling kernel modules against the
>>>      > running kernel.
>>>      >
>>>      > Along with the changes to the copying of the infrascture, we also
>>>      > have the following changes:
>>>      >
>>>      >  - a better/more explicit listing of dependencies for on-target
>>>      >    builds of "make scripts" or "make modules_prepare"
>>>      >
>>>      >  - The kernel source is installed into
>>> /lib/modules/<version>/build
>>>      >    and a symlink created from /usr/src/kernel to the new location.
>>>      >    This aligns with the standard location for module support
>>>      >    code
>>>      >
>>>      >  - There is also a symlink from /lib/modules/<version>/source ->
>>>     build
>>>      >    to reserve a spot for a new package that is simply the kernel
>>>      >    source. That package is not part of this update.
>>>      >
>>>      > [YOCTO #12535]
>>>      >
>>>      > Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com
>>>     <mailto:bruce.ashfield@windriver.com>>
>>>
>>>      > ---
>>>      >
>>>      >  v2: fix arch/arm devsrc builds
>>>
>>>     Noticed one kernel-devsrc build failure in autobuilder (qemuarm) :
>>>
>>>
>>> https://autobuilder.yocto.io/builders/nightly-arm/builds/876/steps/BuildImages/logs/stdio
>>>
>>> <https://autobuilder.yocto.io/builders/nightly-arm/builds/876/steps/BuildImages/logs/stdio>
>>>
>>>     ERROR: kernel-devsrc-1.0-r0 do_install: Function failed: do_install
>>>     (log file is located at
>>>
>>> /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/temp/log.do_install.25822)
>>>     ERROR: Logfile of failure stored in:
>>>
>>> /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/temp/log.do_install.25822
>>>     Log data follows:
>>>     | DEBUG: Executing python function extend_recipe_sysroot
>>>     | NOTE: Direct dependencies are
>>>
>>> ['/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-devtools/binutils/binutils-cross_2.30.bb:do_populate_sysroot',
>>>
>>> 'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-extended/xz/xz_5.2.3.bb:do_populate_sysroot',
>>>
>>> 'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-devtools/pkgconfig/pkgconfig_git.bb:do_populate_sysroot',
>>>
>>> 'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-support/lzop/lzop_1.03.bb:do_populate_sysroot',
>>>
>>> '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb:do_populate_sysroot',
>>>
>>> '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-devtools/gcc/gcc-runtime_7.3.bb:do_populate_sysroot',
>>>
>>> '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-devtools/gcc/gcc-cross_7.
>>>       3.bb:do_populate_sysroot',
>>>
>>> 'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-devtools/bison/bison_3.0.4.bb:do_populate_sysroot',
>>>
>>> 'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-devtools/pseudo/pseudo_1.8.2.bb:do_populate_sysroot',
>>>
>>> '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-core/glibc/glibc_2.26.bb:do_populate_sysroot',
>>>
>>> '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-kernel/kmod/kmod-native_git.bb:do_populate_sysroot',
>>>
>>> 'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-extended/bc/bc_1.06.bb:do_populate_sysroot',
>>>
>>> '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-devtools/quilt/quilt-native_0.65.bb:do_populate_sysroot',
>>>
>>> 'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-connectivity/openssl/openssl_1.0.2n.bb:d
>>>       o_populate_sysroot']
>>>     | NOTE: Installed into sysroot: ['pkgconfig-native', 'lzop-native',
>>>     'kern-tools-native', 'pseudo-native', 'kmod-native', 'bc-native',
>>>     'openssl-native', 'gtk-doc-native', 'lzo-native',
>>>     'makedepend-native', 'cryptodev-linux-native', 'util-macros-native',
>>>     'xproto-native']
>>>     | NOTE: Skipping as already exists in sysroot:
>>>     ['binutils-cross-arm', 'xz-native', 'gcc-runtime', 'gcc-cross-arm',
>>>     'bison-native', 'glibc', 'quilt-native', 'gettext-minimal-native',
>>>     'gnu-config-native', 'automake-native', 'autoconf-native',
>>>     'libtool-native', 'linux-libc-headers', 'libgcc', 'zlib-native',
>>>     'texinfo-dummy-native', 'flex-native', 'libmpc-native',
>>>     'gmp-native', 'mpfr-native', 'm4-native']
>>>     | DEBUG: sed -e
>>>
>>> 's:^[^/]*/:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/recipe-sysroot-native/:g'
>>>
>>> /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/sysroots-components/x86_64/pkgconfig-native/fixmepath
>>>
>>> /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/sysroots-components/x86_64/openssl-native/fixmepath
>>>
>>> /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/sysroots-components/x86_64/gtk-doc-native/fixmepath
>>>     | xargs sed -i -e
>>>
>>> 's:FIXMESTAGINGDIRTARGET:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/recipe-sysroot:g;
>>>
>>> s:FIXMESTAGINGDIRHOST:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/recipe-sysroot-native:g'
>>>     -e 's:FIXME_COMPONENTS_DIR:/home/pokybuild/yocto-autobuilder/y
>>>       octo-worker/nightly-arm/build/build/tmp/sysroots-components:g' -e
>>>
>>> 's:FIXME_HOSTTOOLS_DIR:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/hosttools:g'
>>>     -e
>>>
>>> 's:FIXME_PKGDATA_DIR:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/pkgdata/qemuarm:g'
>>>     -e
>>>
>>> 's:FIXME_PSEUDO_LOCALSTATEDIR:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/pseudo/:g'
>>>     -e
>>>
>>> 's:FIXME_LOGFIFO:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/temp/fifo.25822:g'
>>>     | DEBUG: Python function extend_recipe_sysroot finished
>>>     | DEBUG: Executing shell function do_install
>>>     | cp: with --parents, the destination must be a directory
>>>     | Try 'cp --help' for more information.
>>>     | WARNING:
>>>
>>> /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/temp/run.do_install.25822:1
>>>     exit 1 from 'rm -rf $kerneldir/build/include'
>>>     | ERROR: Function failed: do_install (log file is located at
>>>
>>> /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/temp/log.do_install.25822)
>>>     NOTE: recipe kernel-devsrc-1.0-r0: task do_install: Failed
>>>     ERROR: Task
>>>
>>> (/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-kernel/linux/kernel-devsrc.bb:do_install)
>>>     failed with exit code '1'
>>>
>>>     Best Regards,
>>>     Maxin
>>>     --
>>>     _______________________________________________
>>>     Openembedded-core mailing list
>>>     Openembedded-core@lists.openembedded.org
>>>     <mailto:Openembedded-core@lists.openembedded.org>
>>>     http://lists.openembedded.org/mailman/listinfo/openembedded-core
>>>     <http://lists.openembedded.org/mailman/listinfo/openembedded-core>
>>>
>>>
>>
>


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2] kernel-devsrc: restructure for out of tree (and on target) module builds
  2018-03-01  9:37   ` Burton, Ross
  2018-03-01 10:58     ` Maxin B. John
  2018-03-02 14:23     ` Bruce Ashfield
@ 2018-03-02 18:16     ` Khem Raj
  2018-03-02 19:29       ` Bruce Ashfield
  2 siblings, 1 reply; 36+ messages in thread
From: Khem Raj @ 2018-03-02 18:16 UTC (permalink / raw)
  To: Burton, Ross; +Cc: Bruce Ashfield, OE-core

On Thu, Mar 1, 2018 at 1:37 AM, Burton, Ross <ross.burton@intel.com> wrote:
> Also fails on musl:
>
> ERROR: Nothing RPROVIDES 'glibc-utils' (but
> /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-musl/build/meta/recipes-kernel/linux/kernel-devsrc.bb
> RDEPENDS on or otherwise requires it)
>

I sent patches to add musl-utils which should help this case. Perhaps
adding glibc-utils to
deps unconditionally is not right thing here. We can use libc-glibc
and libc-musl overrides
to select the right utils.

Other idea is to create virtual/libc-utils but that seems like an overkill.

> Ross
>
> On 1 March 2018 at 08:28, Maxin B. John <maxin.john@intel.com> wrote:
>>
>> Hi,
>>
>> On Wed, Feb 28, 2018 at 02:20:45PM -0500, Bruce Ashfield wrote:
>> > The existing kernel-devsrc package starts with a full copy of the kernel
>> > source and then starts to strip out elements that are not required.
>> >
>> > This results in extra time (I/O) and extra space being taken up in the
>> > final package. The main purpose of the kernel-devsrc package has been to
>> > build modules against the running kernel, not to include a full copy of
>> > the source code for re-building the kernel. The end result was a
>> > 600M kernel-devsrc package.
>> >
>> > This restructuring of the package uses an approach similar to other
>> > distros, where the kernel-devsrc package is for building against the
>> > running kernel and uses a curated set of copied infrastructure, versus
>> > a mass copy of the entire kernel.
>> >
>> > The differences in this approach versus other is largely due to the
>> > architecture support and the split build/source directory of the
>> > kernel.
>> >
>> > The result is a kernel-devsrc package of about 10M, which is capable
>> > of running "make scripts" and compiling kernel modules against the
>> > running kernel.
>> >
>> > Along with the changes to the copying of the infrascture, we also
>> > have the following changes:
>> >
>> >  - a better/more explicit listing of dependencies for on-target
>> >    builds of "make scripts" or "make modules_prepare"
>> >
>> >  - The kernel source is installed into /lib/modules/<version>/build
>> >    and a symlink created from /usr/src/kernel to the new location.
>> >    This aligns with the standard location for module support
>> >    code
>> >
>> >  - There is also a symlink from /lib/modules/<version>/source -> build
>> >    to reserve a spot for a new package that is simply the kernel
>> >    source. That package is not part of this update.
>> >
>> > [YOCTO #12535]
>> >
>> > Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
>> > ---
>> >
>> >  v2: fix arch/arm devsrc builds
>>
>> Noticed one kernel-devsrc build failure in autobuilder (qemuarm) :
>>
>>
>> https://autobuilder.yocto.io/builders/nightly-arm/builds/876/steps/BuildImages/logs/stdio
>>
>> ERROR: kernel-devsrc-1.0-r0 do_install: Function failed: do_install (log
>> file is located at
>> /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/temp/log.do_install.25822)
>> ERROR: Logfile of failure stored in:
>> /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/temp/log.do_install.25822
>> Log data follows:
>> | DEBUG: Executing python function extend_recipe_sysroot
>> | NOTE: Direct dependencies are
>> ['/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-devtools/binutils/binutils-cross_2.30.bb:do_populate_sysroot',
>> 'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-extended/xz/xz_5.2.3.bb:do_populate_sysroot',
>> 'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-devtools/pkgconfig/pkgconfig_git.bb:do_populate_sysroot',
>> 'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-support/lzop/lzop_1.03.bb:do_populate_sysroot',
>> '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb:do_populate_sysroot',
>> '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-devtools/gcc/gcc-runtime_7.3.bb:do_populate_sysroot',
>> '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-devtools/gcc/gcc-cross_7.
>>  3.bb:do_populate_sysroot',
>> 'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-devtools/bison/bison_3.0.4.bb:do_populate_sysroot',
>> 'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-devtools/pseudo/pseudo_1.8.2.bb:do_populate_sysroot',
>> '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-core/glibc/glibc_2.26.bb:do_populate_sysroot',
>> '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-kernel/kmod/kmod-native_git.bb:do_populate_sysroot',
>> 'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-extended/bc/bc_1.06.bb:do_populate_sysroot',
>> '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-devtools/quilt/quilt-native_0.65.bb:do_populate_sysroot',
>> 'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-connectivity/openssl/openssl_1.0.2n.bb:d
>>  o_populate_sysroot']
>> | NOTE: Installed into sysroot: ['pkgconfig-native', 'lzop-native',
>> 'kern-tools-native', 'pseudo-native', 'kmod-native', 'bc-native',
>> 'openssl-native', 'gtk-doc-native', 'lzo-native', 'makedepend-native',
>> 'cryptodev-linux-native', 'util-macros-native', 'xproto-native']
>> | NOTE: Skipping as already exists in sysroot: ['binutils-cross-arm',
>> 'xz-native', 'gcc-runtime', 'gcc-cross-arm', 'bison-native', 'glibc',
>> 'quilt-native', 'gettext-minimal-native', 'gnu-config-native',
>> 'automake-native', 'autoconf-native', 'libtool-native',
>> 'linux-libc-headers', 'libgcc', 'zlib-native', 'texinfo-dummy-native',
>> 'flex-native', 'libmpc-native', 'gmp-native', 'mpfr-native', 'm4-native']
>> | DEBUG: sed -e
>> 's:^[^/]*/:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/recipe-sysroot-native/:g'
>> /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/sysroots-components/x86_64/pkgconfig-native/fixmepath
>> /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/sysroots-components/x86_64/openssl-native/fixmepath
>> /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/sysroots-components/x86_64/gtk-doc-native/fixmepath
>> | xargs sed -i -e
>> 's:FIXMESTAGINGDIRTARGET:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/recipe-sysroot:g;
>> s:FIXMESTAGINGDIRHOST:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/recipe-sysroot-native:g'
>> -e 's:FIXME_COMPONENTS_DIR:/home/pokybuild/yocto-autobuilder/y
>>  octo-worker/nightly-arm/build/build/tmp/sysroots-components:g' -e
>> 's:FIXME_HOSTTOOLS_DIR:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/hosttools:g'
>> -e
>> 's:FIXME_PKGDATA_DIR:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/pkgdata/qemuarm:g'
>> -e
>> 's:FIXME_PSEUDO_LOCALSTATEDIR:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/pseudo/:g'
>> -e
>> 's:FIXME_LOGFIFO:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/temp/fifo.25822:g'
>> | DEBUG: Python function extend_recipe_sysroot finished
>> | DEBUG: Executing shell function do_install
>> | cp: with --parents, the destination must be a directory
>> | Try 'cp --help' for more information.
>> | WARNING:
>> /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/temp/run.do_install.25822:1
>> exit 1 from 'rm -rf $kerneldir/build/include'
>> | ERROR: Function failed: do_install (log file is located at
>> /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/temp/log.do_install.25822)
>> NOTE: recipe kernel-devsrc-1.0-r0: task do_install: Failed
>> ERROR: Task
>> (/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-kernel/linux/kernel-devsrc.bb:do_install)
>> failed with exit code '1'
>>
>> Best Regards,
>> Maxin
>> --
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
>
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2] kernel-devsrc: restructure for out of tree (and on target) module builds
  2018-03-02 18:16     ` Khem Raj
@ 2018-03-02 19:29       ` Bruce Ashfield
  2018-03-02 23:14         ` Burton, Ross
  0 siblings, 1 reply; 36+ messages in thread
From: Bruce Ashfield @ 2018-03-02 19:29 UTC (permalink / raw)
  To: Khem Raj; +Cc: OE-core

On Fri, Mar 2, 2018 at 1:16 PM, Khem Raj <raj.khem@gmail.com> wrote:
> On Thu, Mar 1, 2018 at 1:37 AM, Burton, Ross <ross.burton@intel.com> wrote:
>> Also fails on musl:
>>
>> ERROR: Nothing RPROVIDES 'glibc-utils' (but
>> /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-musl/build/meta/recipes-kernel/linux/kernel-devsrc.bb
>> RDEPENDS on or otherwise requires it)
>>
>
> I sent patches to add musl-utils which should help this case. Perhaps
> adding glibc-utils to
> deps unconditionally is not right thing here. We can use libc-glibc
> and libc-musl overrides
> to select the right utils.

Yah. I've already removed that in my updated WIP version of the patch,
I'm just trying to complete
the work and get the scripts building on target with musl .. I assume
I can use the c library variable
and select the right package ?

Bruce

>
> Other idea is to create virtual/libc-utils but that seems like an overkill.
>
>> Ross
>>
>> On 1 March 2018 at 08:28, Maxin B. John <maxin.john@intel.com> wrote:
>>>
>>> Hi,
>>>
>>> On Wed, Feb 28, 2018 at 02:20:45PM -0500, Bruce Ashfield wrote:
>>> > The existing kernel-devsrc package starts with a full copy of the kernel
>>> > source and then starts to strip out elements that are not required.
>>> >
>>> > This results in extra time (I/O) and extra space being taken up in the
>>> > final package. The main purpose of the kernel-devsrc package has been to
>>> > build modules against the running kernel, not to include a full copy of
>>> > the source code for re-building the kernel. The end result was a
>>> > 600M kernel-devsrc package.
>>> >
>>> > This restructuring of the package uses an approach similar to other
>>> > distros, where the kernel-devsrc package is for building against the
>>> > running kernel and uses a curated set of copied infrastructure, versus
>>> > a mass copy of the entire kernel.
>>> >
>>> > The differences in this approach versus other is largely due to the
>>> > architecture support and the split build/source directory of the
>>> > kernel.
>>> >
>>> > The result is a kernel-devsrc package of about 10M, which is capable
>>> > of running "make scripts" and compiling kernel modules against the
>>> > running kernel.
>>> >
>>> > Along with the changes to the copying of the infrascture, we also
>>> > have the following changes:
>>> >
>>> >  - a better/more explicit listing of dependencies for on-target
>>> >    builds of "make scripts" or "make modules_prepare"
>>> >
>>> >  - The kernel source is installed into /lib/modules/<version>/build
>>> >    and a symlink created from /usr/src/kernel to the new location.
>>> >    This aligns with the standard location for module support
>>> >    code
>>> >
>>> >  - There is also a symlink from /lib/modules/<version>/source -> build
>>> >    to reserve a spot for a new package that is simply the kernel
>>> >    source. That package is not part of this update.
>>> >
>>> > [YOCTO #12535]
>>> >
>>> > Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
>>> > ---
>>> >
>>> >  v2: fix arch/arm devsrc builds
>>>
>>> Noticed one kernel-devsrc build failure in autobuilder (qemuarm) :
>>>
>>>
>>> https://autobuilder.yocto.io/builders/nightly-arm/builds/876/steps/BuildImages/logs/stdio
>>>
>>> ERROR: kernel-devsrc-1.0-r0 do_install: Function failed: do_install (log
>>> file is located at
>>> /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/temp/log.do_install.25822)
>>> ERROR: Logfile of failure stored in:
>>> /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/temp/log.do_install.25822
>>> Log data follows:
>>> | DEBUG: Executing python function extend_recipe_sysroot
>>> | NOTE: Direct dependencies are
>>> ['/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-devtools/binutils/binutils-cross_2.30.bb:do_populate_sysroot',
>>> 'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-extended/xz/xz_5.2.3.bb:do_populate_sysroot',
>>> 'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-devtools/pkgconfig/pkgconfig_git.bb:do_populate_sysroot',
>>> 'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-support/lzop/lzop_1.03.bb:do_populate_sysroot',
>>> '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb:do_populate_sysroot',
>>> '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-devtools/gcc/gcc-runtime_7.3.bb:do_populate_sysroot',
>>> '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-devtools/gcc/gcc-cross_7.
>>>  3.bb:do_populate_sysroot',
>>> 'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-devtools/bison/bison_3.0.4.bb:do_populate_sysroot',
>>> 'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-devtools/pseudo/pseudo_1.8.2.bb:do_populate_sysroot',
>>> '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-core/glibc/glibc_2.26.bb:do_populate_sysroot',
>>> '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-kernel/kmod/kmod-native_git.bb:do_populate_sysroot',
>>> 'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-extended/bc/bc_1.06.bb:do_populate_sysroot',
>>> '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-devtools/quilt/quilt-native_0.65.bb:do_populate_sysroot',
>>> 'virtual:native:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-connectivity/openssl/openssl_1.0.2n.bb:d
>>>  o_populate_sysroot']
>>> | NOTE: Installed into sysroot: ['pkgconfig-native', 'lzop-native',
>>> 'kern-tools-native', 'pseudo-native', 'kmod-native', 'bc-native',
>>> 'openssl-native', 'gtk-doc-native', 'lzo-native', 'makedepend-native',
>>> 'cryptodev-linux-native', 'util-macros-native', 'xproto-native']
>>> | NOTE: Skipping as already exists in sysroot: ['binutils-cross-arm',
>>> 'xz-native', 'gcc-runtime', 'gcc-cross-arm', 'bison-native', 'glibc',
>>> 'quilt-native', 'gettext-minimal-native', 'gnu-config-native',
>>> 'automake-native', 'autoconf-native', 'libtool-native',
>>> 'linux-libc-headers', 'libgcc', 'zlib-native', 'texinfo-dummy-native',
>>> 'flex-native', 'libmpc-native', 'gmp-native', 'mpfr-native', 'm4-native']
>>> | DEBUG: sed -e
>>> 's:^[^/]*/:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/recipe-sysroot-native/:g'
>>> /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/sysroots-components/x86_64/pkgconfig-native/fixmepath
>>> /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/sysroots-components/x86_64/openssl-native/fixmepath
>>> /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/sysroots-components/x86_64/gtk-doc-native/fixmepath
>>> | xargs sed -i -e
>>> 's:FIXMESTAGINGDIRTARGET:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/recipe-sysroot:g;
>>> s:FIXMESTAGINGDIRHOST:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/recipe-sysroot-native:g'
>>> -e 's:FIXME_COMPONENTS_DIR:/home/pokybuild/yocto-autobuilder/y
>>>  octo-worker/nightly-arm/build/build/tmp/sysroots-components:g' -e
>>> 's:FIXME_HOSTTOOLS_DIR:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/hosttools:g'
>>> -e
>>> 's:FIXME_PKGDATA_DIR:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/pkgdata/qemuarm:g'
>>> -e
>>> 's:FIXME_PSEUDO_LOCALSTATEDIR:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/pseudo/:g'
>>> -e
>>> 's:FIXME_LOGFIFO:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/temp/fifo.25822:g'
>>> | DEBUG: Python function extend_recipe_sysroot finished
>>> | DEBUG: Executing shell function do_install
>>> | cp: with --parents, the destination must be a directory
>>> | Try 'cp --help' for more information.
>>> | WARNING:
>>> /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/temp/run.do_install.25822:1
>>> exit 1 from 'rm -rf $kerneldir/build/include'
>>> | ERROR: Function failed: do_install (log file is located at
>>> /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/kernel-devsrc/1.0-r0/temp/log.do_install.25822)
>>> NOTE: recipe kernel-devsrc-1.0-r0: task do_install: Failed
>>> ERROR: Task
>>> (/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/meta/recipes-kernel/linux/kernel-devsrc.bb:do_install)
>>> failed with exit code '1'
>>>
>>> Best Regards,
>>> Maxin
>>> --
>>> _______________________________________________
>>> Openembedded-core mailing list
>>> Openembedded-core@lists.openembedded.org
>>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>>
>>
>>
>> --
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@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"


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2] kernel-devsrc: restructure for out of tree (and on target) module builds
  2018-03-02 19:29       ` Bruce Ashfield
@ 2018-03-02 23:14         ` Burton, Ross
  0 siblings, 0 replies; 36+ messages in thread
From: Burton, Ross @ 2018-03-02 23:14 UTC (permalink / raw)
  To: Bruce Ashfield; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 638 bytes --]

On 2 March 2018 at 19:29, Bruce Ashfield <bruce.ashfield@gmail.com> wrote:

> Yah. I've already removed that in my updated WIP version of the patch,
> I'm just trying to complete
> the work and get the scripts building on target with musl .. I assume
> I can use the c library variable
> and select the right package ?
>

Until we have a virtual provider to magically pick the right one, this
would be the most correct:

RDEPENDS_append_libc-glibc = " glibc-utils"
RDEPENDS_append_libc-musl = " musl-utils"

I guess you could assume that any existing libc has a utils package and
just use ${TCLIBC}-utils though.

Ross

[-- Attachment #2: Type: text/html, Size: 1118 bytes --]

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2] kernel-devsrc: restructure for out of tree (and on target) module builds
  2018-07-30 22:26     ` richard.purdie
@ 2018-07-31  1:07       ` Bruce Ashfield
  0 siblings, 0 replies; 36+ messages in thread
From: Bruce Ashfield @ 2018-07-31  1:07 UTC (permalink / raw)
  To: Richard Purdie; +Cc: Patches and discussions about the oe-core layer

On Mon, Jul 30, 2018 at 7:26 PM,  <richard.purdie@linuxfoundation.org> wrote:
> On Thu, 2018-07-26 at 10:04 -0400, Bruce Ashfield wrote:
>> > https://autobuilder.yocto.io/builders/nightly-multilib/builds/1139/
>> > steps/BuildImages_4/logs/stdio
>> >
>> > Error: Transaction check error:
>> >    file /usr/bin/libtool from install of libtool-2.4.6-r0.0.i586
>> > conflicts with file from package lib64-libtool-2.4.6-r0.0.x86_64
>> >    file /usr/bin/libtoolize from install of libtool-2.4.6-r0.0.i586
>> > conflicts with file from package lib64-libtool-2.4.6-r0.0.x86_64
>> >
>>
>> And that leaves this error.
>>
>> I've not been able to reproduce it, and I've been looking at the
>> elfutils RDEPENDS that is part of kernel devsrc, since that is what
>> pulls in libtool as a DEPENDS.
>
> I've just sent out two patches which together should fix this one, they
> did locally at least...

Nice. I see them!

I have a v2 of this patch ready to go, but am out of the office for
the next few days. When I'm to my final vacation destination, I'll log
into my build machine and send that patch.

Bruce

>
> Cheers,
>
> Richard
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@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"


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2] kernel-devsrc: restructure for out of tree (and on target) module builds
  2018-07-26 14:04   ` Bruce Ashfield
  2018-07-26 14:17     ` richard.purdie
@ 2018-07-30 22:26     ` richard.purdie
  2018-07-31  1:07       ` Bruce Ashfield
  1 sibling, 1 reply; 36+ messages in thread
From: richard.purdie @ 2018-07-30 22:26 UTC (permalink / raw)
  To: Bruce Ashfield; +Cc: openembedded-core

On Thu, 2018-07-26 at 10:04 -0400, Bruce Ashfield wrote:
> > https://autobuilder.yocto.io/builders/nightly-multilib/builds/1139/
> > steps/BuildImages_4/logs/stdio
> > 
> > Error: Transaction check error:
> >    file /usr/bin/libtool from install of libtool-2.4.6-r0.0.i586
> > conflicts with file from package lib64-libtool-2.4.6-r0.0.x86_64
> >    file /usr/bin/libtoolize from install of libtool-2.4.6-r0.0.i586 
> > conflicts with file from package lib64-libtool-2.4.6-r0.0.x86_64
> > 
> 
> And that leaves this error.
> 
> I've not been able to reproduce it, and I've been looking at the
> elfutils RDEPENDS that is part of kernel devsrc, since that is what
> pulls in libtool as a DEPENDS.

I've just sent out two patches which together should fix this one, they
did locally at least...

Cheers,

Richard


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2] kernel-devsrc: restructure for out of tree (and on target) module builds
  2018-07-26 14:17     ` richard.purdie
@ 2018-07-26 17:01       ` Richard Purdie
  0 siblings, 0 replies; 36+ messages in thread
From: Richard Purdie @ 2018-07-26 17:01 UTC (permalink / raw)
  To: Bruce Ashfield; +Cc: openembedded-core

On Thu, 2018-07-26 at 15:17 +0100, richard.purdie@linuxfoundation.org
wrote:
> On Thu, 2018-07-26 at 10:04 -0400, Bruce Ashfield wrote:
> > On 2018-07-10 6:21 AM, Richard Purdie wrote:
> > > and also a failure in one of the multilib builds, probably from
> > > different dependencies pulled in by kernel-devsrc:
> > > 
> > > https://autobuilder.yocto.io/builders/nightly-multilib/builds/113
> > > 9/
> > > steps/BuildImages_4/logs/stdio
> > > 
> > > Error: Transaction check error:
> > >    file /usr/bin/libtool from install of libtool-2.4.6-r0.0.i586
> > > conflicts with file from package lib64-libtool-2.4.6-r0.0.x86_64
> > >    file /usr/bin/libtoolize from install of libtool-2.4.6-
> > > r0.0.i586 
> > > conflicts with file from package lib64-libtool-2.4.6-r0.0.x86_64
> > > 
> > 
> > And that leaves this error.
> > 
> > I've not been able to reproduce it, and I've been looking at the
> > elfutils RDEPENDS that is part of kernel devsrc, since that is what
> > pulls in libtool as a DEPENDS.
> > 
> > I'm not seeing any difference in the way that it is pulled in,
> > versus
> > the other uses.
> > 
> > In particular, perf also has elfutils as a REDEPENDS, but yet it
> > builds
> > in the same configuration. Can you spot the difference in how it is
> > used ?
> > 
> > elfutils is potentially required at tools build time, hence why it
> > is
> > a RDEPENDS in devsrc, but a DEPENDS in the main linux-yocto
> > recipes.
> > If there's another way to express this, let me know and I can
> > switch
> > to that.
> > 
> > And finally, I did build the old reproducing configuration for
> > multlib that you mentioned before .. can you point me at this
> > config,
> > so I can try again ?
> 
> This is a timely reminder that I've been meaning to look at this. I
> think the config is:
> t
> MACHINE=qemux86
> require conf/multilib.conf 
> MULTILIBS = "multilib:lib64" 
> DEFAULTTUNE_virtclass-multilib-lib64 = "x86-64" 
> 
> then bitbake lib64-core-image-sato-sdk
> 
> which seems like an odd mix of 64bit with a 32 bit kernel but is
> nonetheless what it appears to be building. I suspect it will fail
> the same way with the x86-64 machine too though.
> 
> I have a build running now to check if I can replicate and perhaps
> dig into it further.

I've confirmed the above does reproduce the failure. The logs are also
helpful and show that whilst it mostly installs lib64-* packages, it
also installs a handful of "normal" ones.

What appears to happen is it installs kernel-devsrc, which depends on
elfutils. Since its a "devel" image, it installs the corresponding -dev
packages, which means elfutils-dev. elfutils-dev rrecommends libtool-
dev.

Since there are other lib64-* packages, one is bound to have a -dev
package which installs lib64-libtool-dev.

libtool-dev depends on libtool, lib64-libtool-dev on lib64-libtool.

Then we discover you can't install libtool and lib64-libtool onto the
system at the same time as they're not compatible with each other,
hence the error message.

I tried a quick hack to the elfutils recipe:

package_depchains_append () {
    rreclist = bb.utils.explode_dep_versions2(d.getVar('RRECOMMENDS_elfutils-dev') or "")
    if "libtool-dev" in rreclist:
        del rreclist["libtool-dev"]
    d.setVar('RRECOMMENDS_elfutils-dev', bb.utils.join_deps(rreclist, commasep=False))
}

which is pretty evil but proves this is the only issue we have to solve
since with the hack, the build completes.

So I'm not sure how to fix it but at least we can say why it breaks...

Cheers,

Richard





^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2] kernel-devsrc: restructure for out of tree (and on target) module builds
  2018-07-26 14:04   ` Bruce Ashfield
@ 2018-07-26 14:17     ` richard.purdie
  2018-07-26 17:01       ` Richard Purdie
  2018-07-30 22:26     ` richard.purdie
  1 sibling, 1 reply; 36+ messages in thread
From: richard.purdie @ 2018-07-26 14:17 UTC (permalink / raw)
  To: Bruce Ashfield; +Cc: openembedded-core

On Thu, 2018-07-26 at 10:04 -0400, Bruce Ashfield wrote:
> On 2018-07-10 6:21 AM, Richard Purdie wrote:
> > and also a failure in one of the multilib builds, probably from
> > different dependencies pulled in by kernel-devsrc:
> > 
> > https://autobuilder.yocto.io/builders/nightly-multilib/builds/1139/
> > steps/BuildImages_4/logs/stdio
> > 
> > Error: Transaction check error:
> >    file /usr/bin/libtool from install of libtool-2.4.6-r0.0.i586
> > conflicts with file from package lib64-libtool-2.4.6-r0.0.x86_64
> >    file /usr/bin/libtoolize from install of libtool-2.4.6-r0.0.i586 
> > conflicts with file from package lib64-libtool-2.4.6-r0.0.x86_64
> > 
> 
> And that leaves this error.
> 
> I've not been able to reproduce it, and I've been looking at the
> elfutils RDEPENDS that is part of kernel devsrc, since that is what
> pulls in libtool as a DEPENDS.
> 
> I'm not seeing any difference in the way that it is pulled in, versus
> the other uses.
> 
> In particular, perf also has elfutils as a REDEPENDS, but yet it
> builds
> in the same configuration. Can you spot the difference in how it is
> used ?
> 
> elfutils is potentially required at tools build time, hence why it is
> a RDEPENDS in devsrc, but a DEPENDS in the main linux-yocto recipes.
> If there's another way to express this, let me know and I can switch
> to that.
> 
> And finally, I did build the old reproducing configuration for
> multlib that you mentioned before .. can you point me at this config,
> so I can try again ?

This is a timely reminder that I've been meaning to look at this. I
think the config is:
t
MACHINE=qemux86
require conf/multilib.conf 
MULTILIBS = "multilib:lib64" 
DEFAULTTUNE_virtclass-multilib-lib64 = "x86-64" 

then bitbake lib64-core-image-sato-sdk

which seems like an odd mix of 64bit with a 32 bit kernel but is
nonetheless what it appears to be building. I suspect it will fail the
same way with the x86-64 machine too though.

I have a build running now to check if I can replicate and perhaps dig
into it further.

Cheers,

Richard



^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2] kernel-devsrc: restructure for out of tree (and on target) module builds
  2018-07-10 10:21 ` Richard Purdie
  2018-07-10 13:09   ` Bruce Ashfield
  2018-07-10 16:38   ` Bruce Ashfield
@ 2018-07-26 14:04   ` Bruce Ashfield
  2018-07-26 14:17     ` richard.purdie
  2018-07-30 22:26     ` richard.purdie
  2 siblings, 2 replies; 36+ messages in thread
From: Bruce Ashfield @ 2018-07-26 14:04 UTC (permalink / raw)
  To: Richard Purdie; +Cc: openembedded-core

On 2018-07-10 6:21 AM, Richard Purdie wrote:
> On Mon, 2018-07-09 at 11:53 -0400, Bruce Ashfield wrote:
>> The existing kernel-devsrc package starts with a full copy of the
>> kernel
>> source and then starts to strip out elements that are not required.
>>
>> This results in extra time (I/O) and extra space being taken up in
>> the
>> final package. The main purpose of the kernel-devsrc package has been
>> to
>> build modules against the running kernel, not to include a full copy
>> of
>> the source code for re-building the kernel. The end result was a
>> 600M kernel-devsrc package.
>>
>> This restructuring of the package uses an approach similar to other
>> distros, where the kernel-devsrc package is for building against the
>> running kernel and uses a curated set of copied infrastructure,
>> versus
>> a mass copy of the entire kernel.
>>
>> The differences in this approach versus other is largely due to the
>> architecture support and the split build/source directory of the
>> kernel.
>>
>> The result is a kernel-devsrc package of about 10M, which is capable
>> of running "make scripts" and compiling kernel modules against the
>> running kernel.
>>
>> Along with the changes to the copying of the infrascture, we also
>> have the following changes:
>>
>>   - a better/more explicit listing of dependencies for on-target
>>     builds of "make scripts" or "make modules_prepare"
>>
>>   - The kernel source is installed into /lib/modules/<version>/build
>>     and a symlink created from /usr/src/kernel to the new location.
>>     This aligns with the standard location for module support
>>     code
>>
>>   - There is also a symlink from /lib/modules/<version>/source ->
>> build
>>     to reserve a spot for a new package that is simply the kernel
>>     source. That package is not part of this update.
>>
>> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
>> ---
>>
>> v2: drop DEPENDS on perf. We no longer need to depend on perf since
>> the source
>>      is copied before modification.
> 
> It probably won't surprise you to know there were some issues with this
> patch, sadly.
> 
> The main recurring issue (on all arches and poky+poky-lsb) is failure
> of the kernelmodule.KernelModuleTest.test_kernel_module test. The exact
> failure varies by arch, for x86-64:

FYI. I have fixed all of these errors, and will submit a v2 shortly.
See a few more comments below.

> 
> https://autobuilder.yocto.io/builders/nightly-x86-64/builds/1154/steps/Running%20Sanity%20Tests/logs/stdio
> 
> |   CHK     include/generated/utsrelease.h
> |   DESCEND  objtool
> | /lib/modules/4.14.48-yocto-standard/build/tools/build/Makefile.build:37: /lib/modules/4.14.48-yocto-standard/build/tools/build/Build.include: No such file or directory
> | make[4]: *** No rule to make target '/lib/modules/4.14.48-yocto-standard/build/tools/build/Build.include'.  Stop.
> | make[3]: *** [Makefile:43: /lib/modules/4.14.48-yocto-standard/build/tools/objtool/fixdep-in.o] Error 2
> | make[2]: *** [/lib/modules/4.14.48-yocto-standard/build/tools/build/Makefile.include:4: fixdep] Error 2
> | make[1]: *** [Makefile:62: objtool] Error 2
> | make: *** [Makefile:1647: tools/objtool] Error 2
> 
> For mips:
> 
> https://autobuilder.yocto.io/builders/nightly-mips/builds/1115
> 
> |   HOSTCC  scripts/sortextable
> | make[1]: *** No rule to make target 'arch/mips/boot/tools/relocs_32.c', needed by 'arch/mips/boot/tools/relocs_32.o'.  Stop.
> | make: *** [arch/mips/Makefile:16: archscripts] Error 2
> 

I still can't build lttng-modules for mips, but I have fixed the missing
file and ensured that I can make scripts/prepare on the qemu targets.

> (same for mips64)
> 
> For arm:
> 
> https://autobuilder.yocto.io/builders/nightly-arm/builds/1187/
> 
> |   HOSTCC  scripts/sortextable
> | make[1]: *** No rule to make target 'arch/arm/tools/syscall.tbl', needed by 'arch/arm/include/generated/uapi/asm/unistd-common.h'.  Stop.
> | make: *** [arch/arm/Makefile:319: archheaders] Error 2
> 
> For arm64:
> 
> https://autobuilder.yocto.io/builders/nightly-arm64/builds/1101/steps/Running%20Sanity%20Tests/logs/stdio
> 
> |   CHK     include/generated/uapi/linux/version.h
> |   CHK     include/generated/utsrelease.h
> | make[1]: *** No rule to make target 'arch/arm64/kernel/vdso/vdso.lds', needed by 'arch/arm64/kernel/vdso/vdso.so.dbg'.  Stop.
> | make: *** [arch/arm64/Makefile:160: vdso_prepare] Error 2
>   
> 
> There was also a failure in building the build-appliance image:
> 
> https://autobuilder.yocto.io/builders/build-appliance/builds/1110
> 
> and also a failure in one of the multilib builds, probably from
> different dependencies pulled in by kernel-devsrc:
> 
> https://autobuilder.yocto.io/builders/nightly-multilib/builds/1139/steps/BuildImages_4/logs/stdio
> 
> Error: Transaction check error:
>    file /usr/bin/libtool from install of libtool-2.4.6-r0.0.i586 conflicts with file from package lib64-libtool-2.4.6-r0.0.x86_64
>    file /usr/bin/libtoolize from install of libtool-2.4.6-r0.0.i586 conflicts with file from package lib64-libtool-2.4.6-r0.0.x86_64
> 

And that leaves this error.

I've not been able to reproduce it, and I've been looking at the
elfutils RDEPENDS that is part of kernel devsrc, since that is what
pulls in libtool as a DEPENDS.

I'm not seeing any difference in the way that it is pulled in, versus
the other uses.

In particular, perf also has elfutils as a REDEPENDS, but yet it builds
in the same configuration. Can you spot the difference in how it is
used ?

elfutils is potentially required at tools build time, hence why it is
a RDEPENDS in devsrc, but a DEPENDS in the main linux-yocto recipes. If
there's another way to express this, let me know and I can switch to
that.

And finally, I did build the old reproducing configuration for multlib
that you mentioned before .. can you point me at this config, so I can
try again ?

Bruce

> I'll retest with this patch removed just so we can unblock the other patches.
> 
> Cheers,
> 
> Richard
> 



^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2] kernel-devsrc: restructure for out of tree (and on target) module builds
  2018-07-12 17:22                 ` Khem Raj
@ 2018-07-12 17:26                   ` Bruce Ashfield
  0 siblings, 0 replies; 36+ messages in thread
From: Bruce Ashfield @ 2018-07-12 17:26 UTC (permalink / raw)
  To: Khem Raj, Richard Purdie; +Cc: openembedded-core

On 2018-07-12 1:22 PM, Khem Raj wrote:
> On 7/12/18 11:07 AM, Bruce Ashfield wrote:
>> On 2018-07-12 1:02 PM, Khem Raj wrote:
>>> On 7/12/18 7:55 AM, Bruce Ashfield wrote:
>>>> On 2018-07-12 9:53 AM, Richard Purdie wrote:
>>>>> On Thu, 2018-07-12 at 09:49 -0400, Bruce Ashfield wrote:
>>>>>> On 2018-07-10 5:41 PM, Richard Purdie wrote:
>>>>>>> On Tue, 2018-07-10 at 12:38 -0400, Bruce Ashfield wrote:
>>>>>>>> On 07/10/2018 06:21 AM, Richard Purdie wrote:
>>>>>>>>> On Mon, 2018-07-09 at 11:53 -0400, Bruce Ashfield wrote:
>>>>>>>>
>>>>>>>> I'll try the other configs, but clearly I have something
>>>>>>>> different in
>>>>>>>> my x86-64 build.
>>>>>>>>
>>>>>>>> I can't run the self tests directly, but am copying the files
>>>>>>>> onto my
>>>>>>>> qemu session and running things myself:
>>>>>>>>
>>>>>>>> root@qemux86-64:/lib/modules/4.14.48-yocto-standard/build# make
>>>>>>>> ARCH=x86
>>>>>>>> scripts prepare
>>>>>>>> Makefile:950: "Cannot use CONFIG_STACK_VALIDATION=y, please
>>>>>>>> install
>>>>>>>> libelf-dev, libelf-devel or elfutils-libelf-devel"
>>>>>>>>        CHK     scripts/mod/devicetable-offsets.h
>>>>>>>>        SYSTBL  arch/x86/include/generated/asm/syscalls_32.h
>>>>>>>>        SYSHDR  arch/x86/include/generated/asm/unistd_32_ia32.h
>>>>>>>>        SYSHDR  arch/x86/include/generated/asm/unistd_64_x32.h
>>>>>>>>        SYSTBL  arch/x86/include/generated/asm/syscalls_64.h
>>>>>>>>        SYSHDR  arch/x86/include/generated/uapi/asm/unistd_32.h
>>>>>>>>        SYSHDR  arch/x86/include/generated/uapi/asm/unistd_64.h
>>>>>>>>        SYSHDR  arch/x86/include/generated/uapi/asm/unistd_x32.h
>>>>>>>>        HOSTCC  arch/x86/tools/relocs_32.o
>>>>>>>>        HOSTCC  arch/x86/tools/relocs_64.o
>>>>>>>>        HOSTCC  arch/x86/tools/relocs_common.o
>>>>>>>>        HOSTLD  arch/x86/tools/relocs
>>>>>>>>        CHK     include/config/kernel.release
>>>>>>>>        CHK     include/generated/uapi/linux/version.h
>>>>>>>>        CHK     include/generated/utsrelease.h
>>>>>>>> Makefile:950: "Cannot use CONFIG_STACK_VALIDATION=y, please
>>>>>>>> install
>>>>>>>> libelf-dev, libelf-devel or elfutils-libelf-devel"
>>>>>>>>
>>>>>>>> root@qemux86-64:/tmp# make
>>>>>>>> make -C /usr/src/kernel M=/tmp modules
>>>>>>>> make[1]: Entering directory '/lib/modules/4.14.48-yocto-
>>>>>>>> standard/build'
>>>>>>>> Makefile:950: "Cannot use CONFIG_STACK_VALIDATION=y, please
>>>>>>>> install
>>>>>>>> libelf-dev, libelf-devel or elfutils-libelf-devel"
>>>>>>>>        Building modules, stage 2.
>>>>>>>>        MODPOST 1 modules
>>>>>>>> make[1]: Leaving directory '/lib/modules/4.14.48-yocto-
>>>>>>>> standard/build'
>>>>>>>> root@qemux86-64:/tmp# insmod hellomod.ko
>>>>>>>> [  419.211616] hellomod: loading out-of-tree module taints
>>>>>>>> kernel.
>>>>>>>> [  419.212586] Hello world!
>>>>>>>>
>>>>>>>> This is on the core-image-kernel-dev image, which is the one that
>>>>>>>> I created to test all this.
>>>>>>>>
>>>>>>>> What image is that using ? some sato sdk one ?
>>>>>>>
>>>>>>> We really need to find you a way to run these. The problem is the
>>>>>>> qemu
>>>>>>> graphics piece? You can't have a dummy vncserver or something to
>>>>>>> direct
>>>>>>> them at?
>>>>>>>
>>>>>>> The image is a core-image-sato-sdk...
>>>>>>
>>>>>> I was able to trigger the objtool issue with this image, looking at
>>>>>> fixing it and the other arches now.
>>>>>
>>>>> Since its image related, is it a missing package dependency? Just
>>>>> curious why its happening with some images but not your test ones...
>>>>
>>>> It is. I have extra toolchain elements being installed in
>>>> core-image-kernel-dev
>>>> that hold things together (i.e. the kernel's objtool doesn't need to
>>>> be built).
>>>>
>>>> The obvious fix is to just add an RDEPENDS, but I'm being stubborn
>>>> and trying to make it build on target, since the build of objtool from
>>>> the kernel source is showing me some sort of include path issue that
>>>> I'd like to sort out:
>>>>
>>>>     CC /lib/modules/4.14.48-yocto-standard/build/tools/objtool/exec-cmd.o
>>>> exec-cmd.c: In function 'get_pwd_cwd':
>>>> exec-cmd.c:49:4: error: implicit declaration of function 'strlcpy'; did
>>>> you mean 'strncpy'? [-Werror=implicit-function-declaration]
>>>>       strlcpy(cwd, pwd, PATH_MAX);
>>>>       ^~~~~~~
>>>>       strncpy
>>>> exec-cmd.c:49:4: error: nested extern declaration of 'strlcpy'
>>>> [-Werror=nested-externs]
>>>> cc1: all warnings being treated as errors
>>>>
>>>
>>> Kernel has this function defined in tools/include/linux/string.h so
>>>
>>
>> Well yes, a grep locates that :D
>>
>>
>>> however it has it like this
>>>
>>> #if defined(__GLIBC__) && !defined(__UCLIBC__)
>>> extern size_t strlcpy(char *dest, const char *src, size_t size);
>>> #endif
>>>
>>> Which means it will not work for musl and we need to ensure that we
>>> use -D_GNU_SOURCE for it to be included from standard musl headers
>>
>> I've never built or supported musl, and since this is using the
>> in kernel Makefiles, etc, it isn't something I can patch or fix
>> outside of linux-yocto.
>>
>> I'm just worried about the glibc cases, we can do follow up patches
>> later.
>>
> you dont have to defer since you are already touching this area you
> might very well address this too.
> Once the -I path is figured out. All we need is ensure -D_GNU_SOURCE is
> added to CFLAGS in same place.

I'll see how nasty it looks, but yah, if I'm in modifying things
anyway, I'll make sure that is added.

Bruce

> 
>> Bruce
>>
>>>
>>>
>>>> Cheers,
>>>>
>>>> Bruce
>>>>
>>>>>
>>>>> Cheers,
>>>>>
>>>>> Richard
>>>>>
>>>>
>>>
>>>
>>
> 
> 



^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2] kernel-devsrc: restructure for out of tree (and on target) module builds
  2018-07-12 17:07               ` Bruce Ashfield
@ 2018-07-12 17:22                 ` Khem Raj
  2018-07-12 17:26                   ` Bruce Ashfield
  0 siblings, 1 reply; 36+ messages in thread
From: Khem Raj @ 2018-07-12 17:22 UTC (permalink / raw)
  To: Bruce Ashfield, Richard Purdie; +Cc: openembedded-core


[-- Attachment #1.1: Type: text/plain, Size: 5561 bytes --]

On 7/12/18 11:07 AM, Bruce Ashfield wrote:
> On 2018-07-12 1:02 PM, Khem Raj wrote:
>> On 7/12/18 7:55 AM, Bruce Ashfield wrote:
>>> On 2018-07-12 9:53 AM, Richard Purdie wrote:
>>>> On Thu, 2018-07-12 at 09:49 -0400, Bruce Ashfield wrote:
>>>>> On 2018-07-10 5:41 PM, Richard Purdie wrote:
>>>>>> On Tue, 2018-07-10 at 12:38 -0400, Bruce Ashfield wrote:
>>>>>>> On 07/10/2018 06:21 AM, Richard Purdie wrote:
>>>>>>>> On Mon, 2018-07-09 at 11:53 -0400, Bruce Ashfield wrote:
>>>>>>>
>>>>>>> I'll try the other configs, but clearly I have something
>>>>>>> different in
>>>>>>> my x86-64 build.
>>>>>>>
>>>>>>> I can't run the self tests directly, but am copying the files
>>>>>>> onto my
>>>>>>> qemu session and running things myself:
>>>>>>>
>>>>>>> root@qemux86-64:/lib/modules/4.14.48-yocto-standard/build# make
>>>>>>> ARCH=x86
>>>>>>> scripts prepare
>>>>>>> Makefile:950: "Cannot use CONFIG_STACK_VALIDATION=y, please
>>>>>>> install
>>>>>>> libelf-dev, libelf-devel or elfutils-libelf-devel"
>>>>>>>       CHK     scripts/mod/devicetable-offsets.h
>>>>>>>       SYSTBL  arch/x86/include/generated/asm/syscalls_32.h
>>>>>>>       SYSHDR  arch/x86/include/generated/asm/unistd_32_ia32.h
>>>>>>>       SYSHDR  arch/x86/include/generated/asm/unistd_64_x32.h
>>>>>>>       SYSTBL  arch/x86/include/generated/asm/syscalls_64.h
>>>>>>>       SYSHDR  arch/x86/include/generated/uapi/asm/unistd_32.h
>>>>>>>       SYSHDR  arch/x86/include/generated/uapi/asm/unistd_64.h
>>>>>>>       SYSHDR  arch/x86/include/generated/uapi/asm/unistd_x32.h
>>>>>>>       HOSTCC  arch/x86/tools/relocs_32.o
>>>>>>>       HOSTCC  arch/x86/tools/relocs_64.o
>>>>>>>       HOSTCC  arch/x86/tools/relocs_common.o
>>>>>>>       HOSTLD  arch/x86/tools/relocs
>>>>>>>       CHK     include/config/kernel.release
>>>>>>>       CHK     include/generated/uapi/linux/version.h
>>>>>>>       CHK     include/generated/utsrelease.h
>>>>>>> Makefile:950: "Cannot use CONFIG_STACK_VALIDATION=y, please
>>>>>>> install
>>>>>>> libelf-dev, libelf-devel or elfutils-libelf-devel"
>>>>>>>
>>>>>>> root@qemux86-64:/tmp# make
>>>>>>> make -C /usr/src/kernel M=/tmp modules
>>>>>>> make[1]: Entering directory '/lib/modules/4.14.48-yocto-
>>>>>>> standard/build'
>>>>>>> Makefile:950: "Cannot use CONFIG_STACK_VALIDATION=y, please
>>>>>>> install
>>>>>>> libelf-dev, libelf-devel or elfutils-libelf-devel"
>>>>>>>       Building modules, stage 2.
>>>>>>>       MODPOST 1 modules
>>>>>>> make[1]: Leaving directory '/lib/modules/4.14.48-yocto-
>>>>>>> standard/build'
>>>>>>> root@qemux86-64:/tmp# insmod hellomod.ko
>>>>>>> [  419.211616] hellomod: loading out-of-tree module taints
>>>>>>> kernel.
>>>>>>> [  419.212586] Hello world!
>>>>>>>
>>>>>>> This is on the core-image-kernel-dev image, which is the one that
>>>>>>> I created to test all this.
>>>>>>>
>>>>>>> What image is that using ? some sato sdk one ?
>>>>>>
>>>>>> We really need to find you a way to run these. The problem is the
>>>>>> qemu
>>>>>> graphics piece? You can't have a dummy vncserver or something to
>>>>>> direct
>>>>>> them at?
>>>>>>
>>>>>> The image is a core-image-sato-sdk...
>>>>>
>>>>> I was able to trigger the objtool issue with this image, looking at
>>>>> fixing it and the other arches now.
>>>>
>>>> Since its image related, is it a missing package dependency? Just
>>>> curious why its happening with some images but not your test ones...
>>>
>>> It is. I have extra toolchain elements being installed in
>>> core-image-kernel-dev
>>> that hold things together (i.e. the kernel's objtool doesn't need to
>>> be built).
>>>
>>> The obvious fix is to just add an RDEPENDS, but I'm being stubborn
>>> and trying to make it build on target, since the build of objtool from
>>> the kernel source is showing me some sort of include path issue that
>>> I'd like to sort out:
>>>
>>>    CC /lib/modules/4.14.48-yocto-standard/build/tools/objtool/exec-cmd.o
>>> exec-cmd.c: In function 'get_pwd_cwd':
>>> exec-cmd.c:49:4: error: implicit declaration of function 'strlcpy'; did
>>> you mean 'strncpy'? [-Werror=implicit-function-declaration]
>>>      strlcpy(cwd, pwd, PATH_MAX);
>>>      ^~~~~~~
>>>      strncpy
>>> exec-cmd.c:49:4: error: nested extern declaration of 'strlcpy'
>>> [-Werror=nested-externs]
>>> cc1: all warnings being treated as errors
>>>
>>
>> Kernel has this function defined in tools/include/linux/string.h so
>>
> 
> Well yes, a grep locates that :D
> 
> 
>> however it has it like this
>>
>> #if defined(__GLIBC__) && !defined(__UCLIBC__)
>> extern size_t strlcpy(char *dest, const char *src, size_t size);
>> #endif
>>
>> Which means it will not work for musl and we need to ensure that we
>> use -D_GNU_SOURCE for it to be included from standard musl headers
> 
> I've never built or supported musl, and since this is using the
> in kernel Makefiles, etc, it isn't something I can patch or fix
> outside of linux-yocto.
> 
> I'm just worried about the glibc cases, we can do follow up patches
> later.
> 
you dont have to defer since you are already touching this area you
might very well address this too.
Once the -I path is figured out. All we need is ensure -D_GNU_SOURCE is
added to CFLAGS in same place.

> Bruce
> 
>>
>>
>>> Cheers,
>>>
>>> Bruce
>>>
>>>>
>>>> Cheers,
>>>>
>>>> Richard
>>>>
>>>
>>
>>
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 201 bytes --]

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2] kernel-devsrc: restructure for out of tree (and on target) module builds
  2018-07-12 17:02             ` Khem Raj
@ 2018-07-12 17:07               ` Bruce Ashfield
  2018-07-12 17:22                 ` Khem Raj
  0 siblings, 1 reply; 36+ messages in thread
From: Bruce Ashfield @ 2018-07-12 17:07 UTC (permalink / raw)
  To: Khem Raj, Richard Purdie; +Cc: openembedded-core

On 2018-07-12 1:02 PM, Khem Raj wrote:
> On 7/12/18 7:55 AM, Bruce Ashfield wrote:
>> On 2018-07-12 9:53 AM, Richard Purdie wrote:
>>> On Thu, 2018-07-12 at 09:49 -0400, Bruce Ashfield wrote:
>>>> On 2018-07-10 5:41 PM, Richard Purdie wrote:
>>>>> On Tue, 2018-07-10 at 12:38 -0400, Bruce Ashfield wrote:
>>>>>> On 07/10/2018 06:21 AM, Richard Purdie wrote:
>>>>>>> On Mon, 2018-07-09 at 11:53 -0400, Bruce Ashfield wrote:
>>>>>>
>>>>>> I'll try the other configs, but clearly I have something
>>>>>> different in
>>>>>> my x86-64 build.
>>>>>>
>>>>>> I can't run the self tests directly, but am copying the files
>>>>>> onto my
>>>>>> qemu session and running things myself:
>>>>>>
>>>>>> root@qemux86-64:/lib/modules/4.14.48-yocto-standard/build# make
>>>>>> ARCH=x86
>>>>>> scripts prepare
>>>>>> Makefile:950: "Cannot use CONFIG_STACK_VALIDATION=y, please
>>>>>> install
>>>>>> libelf-dev, libelf-devel or elfutils-libelf-devel"
>>>>>>       CHK     scripts/mod/devicetable-offsets.h
>>>>>>       SYSTBL  arch/x86/include/generated/asm/syscalls_32.h
>>>>>>       SYSHDR  arch/x86/include/generated/asm/unistd_32_ia32.h
>>>>>>       SYSHDR  arch/x86/include/generated/asm/unistd_64_x32.h
>>>>>>       SYSTBL  arch/x86/include/generated/asm/syscalls_64.h
>>>>>>       SYSHDR  arch/x86/include/generated/uapi/asm/unistd_32.h
>>>>>>       SYSHDR  arch/x86/include/generated/uapi/asm/unistd_64.h
>>>>>>       SYSHDR  arch/x86/include/generated/uapi/asm/unistd_x32.h
>>>>>>       HOSTCC  arch/x86/tools/relocs_32.o
>>>>>>       HOSTCC  arch/x86/tools/relocs_64.o
>>>>>>       HOSTCC  arch/x86/tools/relocs_common.o
>>>>>>       HOSTLD  arch/x86/tools/relocs
>>>>>>       CHK     include/config/kernel.release
>>>>>>       CHK     include/generated/uapi/linux/version.h
>>>>>>       CHK     include/generated/utsrelease.h
>>>>>> Makefile:950: "Cannot use CONFIG_STACK_VALIDATION=y, please
>>>>>> install
>>>>>> libelf-dev, libelf-devel or elfutils-libelf-devel"
>>>>>>
>>>>>> root@qemux86-64:/tmp# make
>>>>>> make -C /usr/src/kernel M=/tmp modules
>>>>>> make[1]: Entering directory '/lib/modules/4.14.48-yocto-
>>>>>> standard/build'
>>>>>> Makefile:950: "Cannot use CONFIG_STACK_VALIDATION=y, please
>>>>>> install
>>>>>> libelf-dev, libelf-devel or elfutils-libelf-devel"
>>>>>>       Building modules, stage 2.
>>>>>>       MODPOST 1 modules
>>>>>> make[1]: Leaving directory '/lib/modules/4.14.48-yocto-
>>>>>> standard/build'
>>>>>> root@qemux86-64:/tmp# insmod hellomod.ko
>>>>>> [  419.211616] hellomod: loading out-of-tree module taints
>>>>>> kernel.
>>>>>> [  419.212586] Hello world!
>>>>>>
>>>>>> This is on the core-image-kernel-dev image, which is the one that
>>>>>> I created to test all this.
>>>>>>
>>>>>> What image is that using ? some sato sdk one ?
>>>>>
>>>>> We really need to find you a way to run these. The problem is the
>>>>> qemu
>>>>> graphics piece? You can't have a dummy vncserver or something to
>>>>> direct
>>>>> them at?
>>>>>
>>>>> The image is a core-image-sato-sdk...
>>>>
>>>> I was able to trigger the objtool issue with this image, looking at
>>>> fixing it and the other arches now.
>>>
>>> Since its image related, is it a missing package dependency? Just
>>> curious why its happening with some images but not your test ones...
>>
>> It is. I have extra toolchain elements being installed in
>> core-image-kernel-dev
>> that hold things together (i.e. the kernel's objtool doesn't need to
>> be built).
>>
>> The obvious fix is to just add an RDEPENDS, but I'm being stubborn
>> and trying to make it build on target, since the build of objtool from
>> the kernel source is showing me some sort of include path issue that
>> I'd like to sort out:
>>
>>    CC /lib/modules/4.14.48-yocto-standard/build/tools/objtool/exec-cmd.o
>> exec-cmd.c: In function 'get_pwd_cwd':
>> exec-cmd.c:49:4: error: implicit declaration of function 'strlcpy'; did
>> you mean 'strncpy'? [-Werror=implicit-function-declaration]
>>      strlcpy(cwd, pwd, PATH_MAX);
>>      ^~~~~~~
>>      strncpy
>> exec-cmd.c:49:4: error: nested extern declaration of 'strlcpy'
>> [-Werror=nested-externs]
>> cc1: all warnings being treated as errors
>>
> 
> Kernel has this function defined in tools/include/linux/string.h so
>

Well yes, a grep locates that :D


> however it has it like this
> 
> #if defined(__GLIBC__) && !defined(__UCLIBC__)
> extern size_t strlcpy(char *dest, const char *src, size_t size);
> #endif
> 
> Which means it will not work for musl and we need to ensure that we
> use -D_GNU_SOURCE for it to be included from standard musl headers

I've never built or supported musl, and since this is using the
in kernel Makefiles, etc, it isn't something I can patch or fix
outside of linux-yocto.

I'm just worried about the glibc cases, we can do follow up patches
later.

Bruce

> 
> 
>> Cheers,
>>
>> Bruce
>>
>>>
>>> Cheers,
>>>
>>> Richard
>>>
>>
> 
> 



^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2] kernel-devsrc: restructure for out of tree (and on target) module builds
  2018-07-12 13:55           ` Bruce Ashfield
@ 2018-07-12 17:02             ` Khem Raj
  2018-07-12 17:07               ` Bruce Ashfield
  0 siblings, 1 reply; 36+ messages in thread
From: Khem Raj @ 2018-07-12 17:02 UTC (permalink / raw)
  To: Bruce Ashfield, Richard Purdie; +Cc: openembedded-core


[-- Attachment #1.1: Type: text/plain, Size: 4654 bytes --]

On 7/12/18 7:55 AM, Bruce Ashfield wrote:
> On 2018-07-12 9:53 AM, Richard Purdie wrote:
>> On Thu, 2018-07-12 at 09:49 -0400, Bruce Ashfield wrote:
>>> On 2018-07-10 5:41 PM, Richard Purdie wrote:
>>>> On Tue, 2018-07-10 at 12:38 -0400, Bruce Ashfield wrote:
>>>>> On 07/10/2018 06:21 AM, Richard Purdie wrote:
>>>>>> On Mon, 2018-07-09 at 11:53 -0400, Bruce Ashfield wrote:
>>>>>
>>>>> I'll try the other configs, but clearly I have something
>>>>> different in
>>>>> my x86-64 build.
>>>>>
>>>>> I can't run the self tests directly, but am copying the files
>>>>> onto my
>>>>> qemu session and running things myself:
>>>>>
>>>>> root@qemux86-64:/lib/modules/4.14.48-yocto-standard/build# make
>>>>> ARCH=x86
>>>>> scripts prepare
>>>>> Makefile:950: "Cannot use CONFIG_STACK_VALIDATION=y, please
>>>>> install
>>>>> libelf-dev, libelf-devel or elfutils-libelf-devel"
>>>>>      CHK     scripts/mod/devicetable-offsets.h
>>>>>      SYSTBL  arch/x86/include/generated/asm/syscalls_32.h
>>>>>      SYSHDR  arch/x86/include/generated/asm/unistd_32_ia32.h
>>>>>      SYSHDR  arch/x86/include/generated/asm/unistd_64_x32.h
>>>>>      SYSTBL  arch/x86/include/generated/asm/syscalls_64.h
>>>>>      SYSHDR  arch/x86/include/generated/uapi/asm/unistd_32.h
>>>>>      SYSHDR  arch/x86/include/generated/uapi/asm/unistd_64.h
>>>>>      SYSHDR  arch/x86/include/generated/uapi/asm/unistd_x32.h
>>>>>      HOSTCC  arch/x86/tools/relocs_32.o
>>>>>      HOSTCC  arch/x86/tools/relocs_64.o
>>>>>      HOSTCC  arch/x86/tools/relocs_common.o
>>>>>      HOSTLD  arch/x86/tools/relocs
>>>>>      CHK     include/config/kernel.release
>>>>>      CHK     include/generated/uapi/linux/version.h
>>>>>      CHK     include/generated/utsrelease.h
>>>>> Makefile:950: "Cannot use CONFIG_STACK_VALIDATION=y, please
>>>>> install
>>>>> libelf-dev, libelf-devel or elfutils-libelf-devel"
>>>>>
>>>>> root@qemux86-64:/tmp# make
>>>>> make -C /usr/src/kernel M=/tmp modules
>>>>> make[1]: Entering directory '/lib/modules/4.14.48-yocto-
>>>>> standard/build'
>>>>> Makefile:950: "Cannot use CONFIG_STACK_VALIDATION=y, please
>>>>> install
>>>>> libelf-dev, libelf-devel or elfutils-libelf-devel"
>>>>>      Building modules, stage 2.
>>>>>      MODPOST 1 modules
>>>>> make[1]: Leaving directory '/lib/modules/4.14.48-yocto-
>>>>> standard/build'
>>>>> root@qemux86-64:/tmp# insmod hellomod.ko
>>>>> [  419.211616] hellomod: loading out-of-tree module taints
>>>>> kernel.
>>>>> [  419.212586] Hello world!
>>>>>
>>>>> This is on the core-image-kernel-dev image, which is the one that
>>>>> I created to test all this.
>>>>>
>>>>> What image is that using ? some sato sdk one ?
>>>>
>>>> We really need to find you a way to run these. The problem is the
>>>> qemu
>>>> graphics piece? You can't have a dummy vncserver or something to
>>>> direct
>>>> them at?
>>>>
>>>> The image is a core-image-sato-sdk...
>>>
>>> I was able to trigger the objtool issue with this image, looking at
>>> fixing it and the other arches now.
>>
>> Since its image related, is it a missing package dependency? Just
>> curious why its happening with some images but not your test ones...
> 
> It is. I have extra toolchain elements being installed in
> core-image-kernel-dev
> that hold things together (i.e. the kernel's objtool doesn't need to
> be built).
> 
> The obvious fix is to just add an RDEPENDS, but I'm being stubborn
> and trying to make it build on target, since the build of objtool from
> the kernel source is showing me some sort of include path issue that
> I'd like to sort out:
> 
>   CC /lib/modules/4.14.48-yocto-standard/build/tools/objtool/exec-cmd.o
> exec-cmd.c: In function 'get_pwd_cwd':
> exec-cmd.c:49:4: error: implicit declaration of function 'strlcpy'; did
> you mean 'strncpy'? [-Werror=implicit-function-declaration]
>     strlcpy(cwd, pwd, PATH_MAX);
>     ^~~~~~~
>     strncpy
> exec-cmd.c:49:4: error: nested extern declaration of 'strlcpy'
> [-Werror=nested-externs]
> cc1: all warnings being treated as errors
> 

Kernel has this function defined in tools/include/linux/string.h so

however it has it like this

#if defined(__GLIBC__) && !defined(__UCLIBC__)
extern size_t strlcpy(char *dest, const char *src, size_t size);
#endif

Which means it will not work for musl and we need to ensure that we
use -D_GNU_SOURCE for it to be included from standard musl headers


> Cheers,
> 
> Bruce
> 
>>
>> Cheers,
>>
>> Richard
>>
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 201 bytes --]

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2] kernel-devsrc: restructure for out of tree (and on target) module builds
  2018-07-12 13:53         ` Richard Purdie
@ 2018-07-12 13:55           ` Bruce Ashfield
  2018-07-12 17:02             ` Khem Raj
  0 siblings, 1 reply; 36+ messages in thread
From: Bruce Ashfield @ 2018-07-12 13:55 UTC (permalink / raw)
  To: Richard Purdie; +Cc: openembedded-core

On 2018-07-12 9:53 AM, Richard Purdie wrote:
> On Thu, 2018-07-12 at 09:49 -0400, Bruce Ashfield wrote:
>> On 2018-07-10 5:41 PM, Richard Purdie wrote:
>>> On Tue, 2018-07-10 at 12:38 -0400, Bruce Ashfield wrote:
>>>> On 07/10/2018 06:21 AM, Richard Purdie wrote:
>>>>> On Mon, 2018-07-09 at 11:53 -0400, Bruce Ashfield wrote:
>>>>
>>>> I'll try the other configs, but clearly I have something
>>>> different in
>>>> my x86-64 build.
>>>>
>>>> I can't run the self tests directly, but am copying the files
>>>> onto my
>>>> qemu session and running things myself:
>>>>
>>>> root@qemux86-64:/lib/modules/4.14.48-yocto-standard/build# make
>>>> ARCH=x86
>>>> scripts prepare
>>>> Makefile:950: "Cannot use CONFIG_STACK_VALIDATION=y, please
>>>> install
>>>> libelf-dev, libelf-devel or elfutils-libelf-devel"
>>>>      CHK     scripts/mod/devicetable-offsets.h
>>>>      SYSTBL  arch/x86/include/generated/asm/syscalls_32.h
>>>>      SYSHDR  arch/x86/include/generated/asm/unistd_32_ia32.h
>>>>      SYSHDR  arch/x86/include/generated/asm/unistd_64_x32.h
>>>>      SYSTBL  arch/x86/include/generated/asm/syscalls_64.h
>>>>      SYSHDR  arch/x86/include/generated/uapi/asm/unistd_32.h
>>>>      SYSHDR  arch/x86/include/generated/uapi/asm/unistd_64.h
>>>>      SYSHDR  arch/x86/include/generated/uapi/asm/unistd_x32.h
>>>>      HOSTCC  arch/x86/tools/relocs_32.o
>>>>      HOSTCC  arch/x86/tools/relocs_64.o
>>>>      HOSTCC  arch/x86/tools/relocs_common.o
>>>>      HOSTLD  arch/x86/tools/relocs
>>>>      CHK     include/config/kernel.release
>>>>      CHK     include/generated/uapi/linux/version.h
>>>>      CHK     include/generated/utsrelease.h
>>>> Makefile:950: "Cannot use CONFIG_STACK_VALIDATION=y, please
>>>> install
>>>> libelf-dev, libelf-devel or elfutils-libelf-devel"
>>>>
>>>> root@qemux86-64:/tmp# make
>>>> make -C /usr/src/kernel M=/tmp modules
>>>> make[1]: Entering directory '/lib/modules/4.14.48-yocto-
>>>> standard/build'
>>>> Makefile:950: "Cannot use CONFIG_STACK_VALIDATION=y, please
>>>> install
>>>> libelf-dev, libelf-devel or elfutils-libelf-devel"
>>>>      Building modules, stage 2.
>>>>      MODPOST 1 modules
>>>> make[1]: Leaving directory '/lib/modules/4.14.48-yocto-
>>>> standard/build'
>>>> root@qemux86-64:/tmp# insmod hellomod.ko
>>>> [  419.211616] hellomod: loading out-of-tree module taints
>>>> kernel.
>>>> [  419.212586] Hello world!
>>>>
>>>> This is on the core-image-kernel-dev image, which is the one that
>>>> I created to test all this.
>>>>
>>>> What image is that using ? some sato sdk one ?
>>>
>>> We really need to find you a way to run these. The problem is the
>>> qemu
>>> graphics piece? You can't have a dummy vncserver or something to
>>> direct
>>> them at?
>>>
>>> The image is a core-image-sato-sdk...
>>
>> I was able to trigger the objtool issue with this image, looking at
>> fixing it and the other arches now.
> 
> Since its image related, is it a missing package dependency? Just
> curious why its happening with some images but not your test ones...

It is. I have extra toolchain elements being installed in 
core-image-kernel-dev
that hold things together (i.e. the kernel's objtool doesn't need to
be built).

The obvious fix is to just add an RDEPENDS, but I'm being stubborn
and trying to make it build on target, since the build of objtool from
the kernel source is showing me some sort of include path issue that
I'd like to sort out:

   CC 
/lib/modules/4.14.48-yocto-standard/build/tools/objtool/exec-cmd.o
exec-cmd.c: In function 'get_pwd_cwd':
exec-cmd.c:49:4: error: implicit declaration of function 'strlcpy'; did 
you mean 'strncpy'? [-Werror=implicit-function-declaration]
     strlcpy(cwd, pwd, PATH_MAX);
     ^~~~~~~
     strncpy
exec-cmd.c:49:4: error: nested extern declaration of 'strlcpy' 
[-Werror=nested-externs]
cc1: all warnings being treated as errors

Cheers,

Bruce

> 
> Cheers,
> 
> Richard
> 



^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2] kernel-devsrc: restructure for out of tree (and on target) module builds
  2018-07-12 13:49       ` Bruce Ashfield
@ 2018-07-12 13:53         ` Richard Purdie
  2018-07-12 13:55           ` Bruce Ashfield
  0 siblings, 1 reply; 36+ messages in thread
From: Richard Purdie @ 2018-07-12 13:53 UTC (permalink / raw)
  To: Bruce Ashfield; +Cc: openembedded-core

On Thu, 2018-07-12 at 09:49 -0400, Bruce Ashfield wrote:
> On 2018-07-10 5:41 PM, Richard Purdie wrote:
> > On Tue, 2018-07-10 at 12:38 -0400, Bruce Ashfield wrote:
> > > On 07/10/2018 06:21 AM, Richard Purdie wrote:
> > > > On Mon, 2018-07-09 at 11:53 -0400, Bruce Ashfield wrote:
> > > 
> > > I'll try the other configs, but clearly I have something
> > > different in
> > > my x86-64 build.
> > > 
> > > I can't run the self tests directly, but am copying the files
> > > onto my
> > > qemu session and running things myself:
> > > 
> > > root@qemux86-64:/lib/modules/4.14.48-yocto-standard/build# make
> > > ARCH=x86
> > > scripts prepare
> > > Makefile:950: "Cannot use CONFIG_STACK_VALIDATION=y, please
> > > install
> > > libelf-dev, libelf-devel or elfutils-libelf-devel"
> > >     CHK     scripts/mod/devicetable-offsets.h
> > >     SYSTBL  arch/x86/include/generated/asm/syscalls_32.h
> > >     SYSHDR  arch/x86/include/generated/asm/unistd_32_ia32.h
> > >     SYSHDR  arch/x86/include/generated/asm/unistd_64_x32.h
> > >     SYSTBL  arch/x86/include/generated/asm/syscalls_64.h
> > >     SYSHDR  arch/x86/include/generated/uapi/asm/unistd_32.h
> > >     SYSHDR  arch/x86/include/generated/uapi/asm/unistd_64.h
> > >     SYSHDR  arch/x86/include/generated/uapi/asm/unistd_x32.h
> > >     HOSTCC  arch/x86/tools/relocs_32.o
> > >     HOSTCC  arch/x86/tools/relocs_64.o
> > >     HOSTCC  arch/x86/tools/relocs_common.o
> > >     HOSTLD  arch/x86/tools/relocs
> > >     CHK     include/config/kernel.release
> > >     CHK     include/generated/uapi/linux/version.h
> > >     CHK     include/generated/utsrelease.h
> > > Makefile:950: "Cannot use CONFIG_STACK_VALIDATION=y, please
> > > install
> > > libelf-dev, libelf-devel or elfutils-libelf-devel"
> > > 
> > > root@qemux86-64:/tmp# make
> > > make -C /usr/src/kernel M=/tmp modules
> > > make[1]: Entering directory '/lib/modules/4.14.48-yocto-
> > > standard/build'
> > > Makefile:950: "Cannot use CONFIG_STACK_VALIDATION=y, please
> > > install
> > > libelf-dev, libelf-devel or elfutils-libelf-devel"
> > >     Building modules, stage 2.
> > >     MODPOST 1 modules
> > > make[1]: Leaving directory '/lib/modules/4.14.48-yocto-
> > > standard/build'
> > > root@qemux86-64:/tmp# insmod hellomod.ko
> > > [  419.211616] hellomod: loading out-of-tree module taints
> > > kernel.
> > > [  419.212586] Hello world!
> > > 
> > > This is on the core-image-kernel-dev image, which is the one that
> > > I created to test all this.
> > > 
> > > What image is that using ? some sato sdk one ?
> > 
> > We really need to find you a way to run these. The problem is the
> > qemu
> > graphics piece? You can't have a dummy vncserver or something to
> > direct
> > them at?
> > 
> > The image is a core-image-sato-sdk...
> 
> I was able to trigger the objtool issue with this image, looking at
> fixing it and the other arches now.

Since its image related, is it a missing package dependency? Just
curious why its happening with some images but not your test ones...

Cheers,

Richard



^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2] kernel-devsrc: restructure for out of tree (and on target) module builds
  2018-07-10 21:41     ` Richard Purdie
  2018-07-11  2:34       ` Bruce Ashfield
@ 2018-07-12 13:49       ` Bruce Ashfield
  2018-07-12 13:53         ` Richard Purdie
  1 sibling, 1 reply; 36+ messages in thread
From: Bruce Ashfield @ 2018-07-12 13:49 UTC (permalink / raw)
  To: Richard Purdie; +Cc: openembedded-core

On 2018-07-10 5:41 PM, Richard Purdie wrote:
> On Tue, 2018-07-10 at 12:38 -0400, Bruce Ashfield wrote:
>> On 07/10/2018 06:21 AM, Richard Purdie wrote:
>>> On Mon, 2018-07-09 at 11:53 -0400, Bruce Ashfield wrote:
>> I'll try the other configs, but clearly I have something different in
>> my x86-64 build.
>>
>> I can't run the self tests directly, but am copying the files onto my
>> qemu session and running things myself:
>>
>> root@qemux86-64:/lib/modules/4.14.48-yocto-standard/build# make
>> ARCH=x86
>> scripts prepare
>> Makefile:950: "Cannot use CONFIG_STACK_VALIDATION=y, please install
>> libelf-dev, libelf-devel or elfutils-libelf-devel"
>>     CHK     scripts/mod/devicetable-offsets.h
>>     SYSTBL  arch/x86/include/generated/asm/syscalls_32.h
>>     SYSHDR  arch/x86/include/generated/asm/unistd_32_ia32.h
>>     SYSHDR  arch/x86/include/generated/asm/unistd_64_x32.h
>>     SYSTBL  arch/x86/include/generated/asm/syscalls_64.h
>>     SYSHDR  arch/x86/include/generated/uapi/asm/unistd_32.h
>>     SYSHDR  arch/x86/include/generated/uapi/asm/unistd_64.h
>>     SYSHDR  arch/x86/include/generated/uapi/asm/unistd_x32.h
>>     HOSTCC  arch/x86/tools/relocs_32.o
>>     HOSTCC  arch/x86/tools/relocs_64.o
>>     HOSTCC  arch/x86/tools/relocs_common.o
>>     HOSTLD  arch/x86/tools/relocs
>>     CHK     include/config/kernel.release
>>     CHK     include/generated/uapi/linux/version.h
>>     CHK     include/generated/utsrelease.h
>> Makefile:950: "Cannot use CONFIG_STACK_VALIDATION=y, please install
>> libelf-dev, libelf-devel or elfutils-libelf-devel"
>>
>> root@qemux86-64:/tmp# make
>> make -C /usr/src/kernel M=/tmp modules
>> make[1]: Entering directory '/lib/modules/4.14.48-yocto-
>> standard/build'
>> Makefile:950: "Cannot use CONFIG_STACK_VALIDATION=y, please install
>> libelf-dev, libelf-devel or elfutils-libelf-devel"
>>     Building modules, stage 2.
>>     MODPOST 1 modules
>> make[1]: Leaving directory '/lib/modules/4.14.48-yocto-
>> standard/build'
>> root@qemux86-64:/tmp# insmod hellomod.ko
>> [  419.211616] hellomod: loading out-of-tree module taints kernel.
>> [  419.212586] Hello world!
>>
>> This is on the core-image-kernel-dev image, which is the one that
>> I created to test all this.
>>
>> What image is that using ? some sato sdk one ?
> 
> We really need to find you a way to run these. The problem is the qemu
> graphics piece? You can't have a dummy vncserver or something to direct
> them at?
> 
> The image is a core-image-sato-sdk...

I was able to trigger the objtool issue with this image, looking at
fixing it and the other arches now.

Bruce

> 
> Cheers,
> 
> Richard
> 



^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2] kernel-devsrc: restructure for out of tree (and on target) module builds
  2018-07-10 21:41     ` Richard Purdie
@ 2018-07-11  2:34       ` Bruce Ashfield
  2018-07-12 13:49       ` Bruce Ashfield
  1 sibling, 0 replies; 36+ messages in thread
From: Bruce Ashfield @ 2018-07-11  2:34 UTC (permalink / raw)
  To: Richard Purdie; +Cc: openembedded-core

On 2018-07-10 5:41 PM, Richard Purdie wrote:
> On Tue, 2018-07-10 at 12:38 -0400, Bruce Ashfield wrote:
>> On 07/10/2018 06:21 AM, Richard Purdie wrote:
>>> On Mon, 2018-07-09 at 11:53 -0400, Bruce Ashfield wrote:
>> I'll try the other configs, but clearly I have something different in
>> my x86-64 build.
>>
>> I can't run the self tests directly, but am copying the files onto my
>> qemu session and running things myself:
>>
>> root@qemux86-64:/lib/modules/4.14.48-yocto-standard/build# make
>> ARCH=x86
>> scripts prepare
>> Makefile:950: "Cannot use CONFIG_STACK_VALIDATION=y, please install
>> libelf-dev, libelf-devel or elfutils-libelf-devel"
>>     CHK     scripts/mod/devicetable-offsets.h
>>     SYSTBL  arch/x86/include/generated/asm/syscalls_32.h
>>     SYSHDR  arch/x86/include/generated/asm/unistd_32_ia32.h
>>     SYSHDR  arch/x86/include/generated/asm/unistd_64_x32.h
>>     SYSTBL  arch/x86/include/generated/asm/syscalls_64.h
>>     SYSHDR  arch/x86/include/generated/uapi/asm/unistd_32.h
>>     SYSHDR  arch/x86/include/generated/uapi/asm/unistd_64.h
>>     SYSHDR  arch/x86/include/generated/uapi/asm/unistd_x32.h
>>     HOSTCC  arch/x86/tools/relocs_32.o
>>     HOSTCC  arch/x86/tools/relocs_64.o
>>     HOSTCC  arch/x86/tools/relocs_common.o
>>     HOSTLD  arch/x86/tools/relocs
>>     CHK     include/config/kernel.release
>>     CHK     include/generated/uapi/linux/version.h
>>     CHK     include/generated/utsrelease.h
>> Makefile:950: "Cannot use CONFIG_STACK_VALIDATION=y, please install
>> libelf-dev, libelf-devel or elfutils-libelf-devel"
>>
>> root@qemux86-64:/tmp# make
>> make -C /usr/src/kernel M=/tmp modules
>> make[1]: Entering directory '/lib/modules/4.14.48-yocto-
>> standard/build'
>> Makefile:950: "Cannot use CONFIG_STACK_VALIDATION=y, please install
>> libelf-dev, libelf-devel or elfutils-libelf-devel"
>>     Building modules, stage 2.
>>     MODPOST 1 modules
>> make[1]: Leaving directory '/lib/modules/4.14.48-yocto-
>> standard/build'
>> root@qemux86-64:/tmp# insmod hellomod.ko
>> [  419.211616] hellomod: loading out-of-tree module taints kernel.
>> [  419.212586] Hello world!
>>
>> This is on the core-image-kernel-dev image, which is the one that
>> I created to test all this.
>>
>> What image is that using ? some sato sdk one ?
> 
> We really need to find you a way to run these. The problem is the qemu
> graphics piece? You can't have a dummy vncserver or something to direct
> them at?

My config never seems to build and run the tests that I need, I had
it work once, and then never again. So I prefer to just build, boot
and run tests manually.

Regardless of the automation, I can easily do "make scripts prepare"
on the kernel-devsrc package, so that is extremely odd that it doesn't
work with that image. I'll try and add devsrc to a sato build and see
of objtool goes nuts.

I'm also unable to build lttng-modules for mips at the moment, so at
least mips is untestable for me.

Bruce

> 
> The image is a core-image-sato-sdk...
> 
> Cheers,
> 
> Richard
> 



^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2] kernel-devsrc: restructure for out of tree (and on target) module builds
  2018-07-10 16:38   ` Bruce Ashfield
@ 2018-07-10 21:41     ` Richard Purdie
  2018-07-11  2:34       ` Bruce Ashfield
  2018-07-12 13:49       ` Bruce Ashfield
  0 siblings, 2 replies; 36+ messages in thread
From: Richard Purdie @ 2018-07-10 21:41 UTC (permalink / raw)
  To: Bruce Ashfield; +Cc: openembedded-core

On Tue, 2018-07-10 at 12:38 -0400, Bruce Ashfield wrote:
> On 07/10/2018 06:21 AM, Richard Purdie wrote:
> > On Mon, 2018-07-09 at 11:53 -0400, Bruce Ashfield wrote:
> I'll try the other configs, but clearly I have something different in
> my x86-64 build.
> 
> I can't run the self tests directly, but am copying the files onto my
> qemu session and running things myself:
> 
> root@qemux86-64:/lib/modules/4.14.48-yocto-standard/build# make
> ARCH=x86 
> scripts prepare
> Makefile:950: "Cannot use CONFIG_STACK_VALIDATION=y, please install 
> libelf-dev, libelf-devel or elfutils-libelf-devel"
>    CHK     scripts/mod/devicetable-offsets.h
>    SYSTBL  arch/x86/include/generated/asm/syscalls_32.h
>    SYSHDR  arch/x86/include/generated/asm/unistd_32_ia32.h
>    SYSHDR  arch/x86/include/generated/asm/unistd_64_x32.h
>    SYSTBL  arch/x86/include/generated/asm/syscalls_64.h
>    SYSHDR  arch/x86/include/generated/uapi/asm/unistd_32.h
>    SYSHDR  arch/x86/include/generated/uapi/asm/unistd_64.h
>    SYSHDR  arch/x86/include/generated/uapi/asm/unistd_x32.h
>    HOSTCC  arch/x86/tools/relocs_32.o
>    HOSTCC  arch/x86/tools/relocs_64.o
>    HOSTCC  arch/x86/tools/relocs_common.o
>    HOSTLD  arch/x86/tools/relocs
>    CHK     include/config/kernel.release
>    CHK     include/generated/uapi/linux/version.h
>    CHK     include/generated/utsrelease.h
> Makefile:950: "Cannot use CONFIG_STACK_VALIDATION=y, please install 
> libelf-dev, libelf-devel or elfutils-libelf-devel"
> 
> root@qemux86-64:/tmp# make
> make -C /usr/src/kernel M=/tmp modules
> make[1]: Entering directory '/lib/modules/4.14.48-yocto-
> standard/build'
> Makefile:950: "Cannot use CONFIG_STACK_VALIDATION=y, please install 
> libelf-dev, libelf-devel or elfutils-libelf-devel"
>    Building modules, stage 2.
>    MODPOST 1 modules
> make[1]: Leaving directory '/lib/modules/4.14.48-yocto-
> standard/build'
> root@qemux86-64:/tmp# insmod hellomod.ko
> [  419.211616] hellomod: loading out-of-tree module taints kernel.
> [  419.212586] Hello world!
> 
> This is on the core-image-kernel-dev image, which is the one that
> I created to test all this.
> 
> What image is that using ? some sato sdk one ?

We really need to find you a way to run these. The problem is the qemu
graphics piece? You can't have a dummy vncserver or something to direct
them at?

The image is a core-image-sato-sdk...

Cheers,

Richard


^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2] kernel-devsrc: restructure for out of tree (and on target) module builds
  2018-07-10 10:21 ` Richard Purdie
  2018-07-10 13:09   ` Bruce Ashfield
@ 2018-07-10 16:38   ` Bruce Ashfield
  2018-07-10 21:41     ` Richard Purdie
  2018-07-26 14:04   ` Bruce Ashfield
  2 siblings, 1 reply; 36+ messages in thread
From: Bruce Ashfield @ 2018-07-10 16:38 UTC (permalink / raw)
  To: Richard Purdie; +Cc: openembedded-core

On 07/10/2018 06:21 AM, Richard Purdie wrote:
> On Mon, 2018-07-09 at 11:53 -0400, Bruce Ashfield wrote:
>> The existing kernel-devsrc package starts with a full copy of the
>> kernel
>> source and then starts to strip out elements that are not required.
>>
>> This results in extra time (I/O) and extra space being taken up in
>> the
>> final package. The main purpose of the kernel-devsrc package has been
>> to
>> build modules against the running kernel, not to include a full copy
>> of
>> the source code for re-building the kernel. The end result was a
>> 600M kernel-devsrc package.
>>
>> This restructuring of the package uses an approach similar to other
>> distros, where the kernel-devsrc package is for building against the
>> running kernel and uses a curated set of copied infrastructure,
>> versus
>> a mass copy of the entire kernel.
>>
>> The differences in this approach versus other is largely due to the
>> architecture support and the split build/source directory of the
>> kernel.
>>
>> The result is a kernel-devsrc package of about 10M, which is capable
>> of running "make scripts" and compiling kernel modules against the
>> running kernel.
>>
>> Along with the changes to the copying of the infrascture, we also
>> have the following changes:
>>
>>   - a better/more explicit listing of dependencies for on-target
>>     builds of "make scripts" or "make modules_prepare"
>>
>>   - The kernel source is installed into /lib/modules/<version>/build
>>     and a symlink created from /usr/src/kernel to the new location.
>>     This aligns with the standard location for module support
>>     code
>>
>>   - There is also a symlink from /lib/modules/<version>/source ->
>> build
>>     to reserve a spot for a new package that is simply the kernel
>>     source. That package is not part of this update.
>>
>> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
>> ---
>>
>> v2: drop DEPENDS on perf. We no longer need to depend on perf since
>> the source
>>      is copied before modification.
> 
> It probably won't surprise you to know there were some issues with this
> patch, sadly.
> 
> The main recurring issue (on all arches and poky+poky-lsb) is failure
> of the kernelmodule.KernelModuleTest.test_kernel_module test. The exact
> failure varies by arch, for x86-64:
> 
> https://autobuilder.yocto.io/builders/nightly-x86-64/builds/1154/steps/Running%20Sanity%20Tests/logs/stdio
> 
> |   CHK     include/generated/utsrelease.h
> |   DESCEND  objtool
> | /lib/modules/4.14.48-yocto-standard/build/tools/build/Makefile.build:37: /lib/modules/4.14.48-yocto-standard/build/tools/build/Build.include: No such file or directory
> | make[4]: *** No rule to make target '/lib/modules/4.14.48-yocto-standard/build/tools/build/Build.include'.  Stop.
> | make[3]: *** [Makefile:43: /lib/modules/4.14.48-yocto-standard/build/tools/objtool/fixdep-in.o] Error 2
> | make[2]: *** [/lib/modules/4.14.48-yocto-standard/build/tools/build/Makefile.include:4: fixdep] Error 2
> | make[1]: *** [Makefile:62: objtool] Error 2
> | make: *** [Makefile:1647: tools/objtool] Error 2

I'll try the other configs, but clearly I have something different in
my x86-64 build.

I can't run the self tests directly, but am copying the files onto my
qemu session and running things myself:

root@qemux86-64:/lib/modules/4.14.48-yocto-standard/build# make ARCH=x86 
scripts prepare
Makefile:950: "Cannot use CONFIG_STACK_VALIDATION=y, please install 
libelf-dev, libelf-devel or elfutils-libelf-devel"
   CHK     scripts/mod/devicetable-offsets.h
   SYSTBL  arch/x86/include/generated/asm/syscalls_32.h
   SYSHDR  arch/x86/include/generated/asm/unistd_32_ia32.h
   SYSHDR  arch/x86/include/generated/asm/unistd_64_x32.h
   SYSTBL  arch/x86/include/generated/asm/syscalls_64.h
   SYSHDR  arch/x86/include/generated/uapi/asm/unistd_32.h
   SYSHDR  arch/x86/include/generated/uapi/asm/unistd_64.h
   SYSHDR  arch/x86/include/generated/uapi/asm/unistd_x32.h
   HOSTCC  arch/x86/tools/relocs_32.o
   HOSTCC  arch/x86/tools/relocs_64.o
   HOSTCC  arch/x86/tools/relocs_common.o
   HOSTLD  arch/x86/tools/relocs
   CHK     include/config/kernel.release
   CHK     include/generated/uapi/linux/version.h
   CHK     include/generated/utsrelease.h
Makefile:950: "Cannot use CONFIG_STACK_VALIDATION=y, please install 
libelf-dev, libelf-devel or elfutils-libelf-devel"

root@qemux86-64:/tmp# make
make -C /usr/src/kernel M=/tmp modules
make[1]: Entering directory '/lib/modules/4.14.48-yocto-standard/build'
Makefile:950: "Cannot use CONFIG_STACK_VALIDATION=y, please install 
libelf-dev, libelf-devel or elfutils-libelf-devel"
   Building modules, stage 2.
   MODPOST 1 modules
make[1]: Leaving directory '/lib/modules/4.14.48-yocto-standard/build'
root@qemux86-64:/tmp# insmod hellomod.ko
[  419.211616] hellomod: loading out-of-tree module taints kernel.
[  419.212586] Hello world!

This is on the core-image-kernel-dev image, which is the one that
I created to test all this.

What image is that using ? some sato sdk one ?

Bruce

> 
> For mips:
> 
> https://autobuilder.yocto.io/builders/nightly-mips/builds/1115
> 
> |   HOSTCC  scripts/sortextable
> | make[1]: *** No rule to make target 'arch/mips/boot/tools/relocs_32.c', needed by 'arch/mips/boot/tools/relocs_32.o'.  Stop.
> | make: *** [arch/mips/Makefile:16: archscripts] Error 2
> 
> (same for mips64)
> 
> For arm:
> 
> https://autobuilder.yocto.io/builders/nightly-arm/builds/1187/
> 
> |   HOSTCC  scripts/sortextable
> | make[1]: *** No rule to make target 'arch/arm/tools/syscall.tbl', needed by 'arch/arm/include/generated/uapi/asm/unistd-common.h'.  Stop.
> | make: *** [arch/arm/Makefile:319: archheaders] Error 2
> 
> For arm64:
> 
> https://autobuilder.yocto.io/builders/nightly-arm64/builds/1101/steps/Running%20Sanity%20Tests/logs/stdio
> 
> |   CHK     include/generated/uapi/linux/version.h
> |   CHK     include/generated/utsrelease.h
> | make[1]: *** No rule to make target 'arch/arm64/kernel/vdso/vdso.lds', needed by 'arch/arm64/kernel/vdso/vdso.so.dbg'.  Stop.
> | make: *** [arch/arm64/Makefile:160: vdso_prepare] Error 2
>   
> 
> There was also a failure in building the build-appliance image:
> 
> https://autobuilder.yocto.io/builders/build-appliance/builds/1110
> 
> and also a failure in one of the multilib builds, probably from
> different dependencies pulled in by kernel-devsrc:
> 
> https://autobuilder.yocto.io/builders/nightly-multilib/builds/1139/steps/BuildImages_4/logs/stdio
> 
> Error: Transaction check error:
>    file /usr/bin/libtool from install of libtool-2.4.6-r0.0.i586 conflicts with file from package lib64-libtool-2.4.6-r0.0.x86_64
>    file /usr/bin/libtoolize from install of libtool-2.4.6-r0.0.i586 conflicts with file from package lib64-libtool-2.4.6-r0.0.x86_64
> 
> I'll retest with this patch removed just so we can unblock the other patches.
> 
> Cheers,
> 
> Richard
> 



^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2] kernel-devsrc: restructure for out of tree (and on target) module builds
  2018-07-10 10:21 ` Richard Purdie
@ 2018-07-10 13:09   ` Bruce Ashfield
  2018-07-10 16:38   ` Bruce Ashfield
  2018-07-26 14:04   ` Bruce Ashfield
  2 siblings, 0 replies; 36+ messages in thread
From: Bruce Ashfield @ 2018-07-10 13:09 UTC (permalink / raw)
  To: Richard Purdie; +Cc: openembedded-core

On 07/10/2018 06:21 AM, Richard Purdie wrote:
> On Mon, 2018-07-09 at 11:53 -0400, Bruce Ashfield wrote:
>> The existing kernel-devsrc package starts with a full copy of the
>> kernel
>> source and then starts to strip out elements that are not required.
>>
>> This results in extra time (I/O) and extra space being taken up in
>> the
>> final package. The main purpose of the kernel-devsrc package has been
>> to
>> build modules against the running kernel, not to include a full copy
>> of
>> the source code for re-building the kernel. The end result was a
>> 600M kernel-devsrc package.
>>
>> This restructuring of the package uses an approach similar to other
>> distros, where the kernel-devsrc package is for building against the
>> running kernel and uses a curated set of copied infrastructure,
>> versus
>> a mass copy of the entire kernel.
>>
>> The differences in this approach versus other is largely due to the
>> architecture support and the split build/source directory of the
>> kernel.
>>
>> The result is a kernel-devsrc package of about 10M, which is capable
>> of running "make scripts" and compiling kernel modules against the
>> running kernel.
>>
>> Along with the changes to the copying of the infrascture, we also
>> have the following changes:
>>
>>   - a better/more explicit listing of dependencies for on-target
>>     builds of "make scripts" or "make modules_prepare"
>>
>>   - The kernel source is installed into /lib/modules/<version>/build
>>     and a symlink created from /usr/src/kernel to the new location.
>>     This aligns with the standard location for module support
>>     code
>>
>>   - There is also a symlink from /lib/modules/<version>/source ->
>> build
>>     to reserve a spot for a new package that is simply the kernel
>>     source. That package is not part of this update.
>>
>> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
>> ---
>>
>> v2: drop DEPENDS on perf. We no longer need to depend on perf since
>> the source
>>      is copied before modification.
> 
> It probably won't surprise you to know there were some issues with this
> patch, sadly.
> 

heh. No problem. These are just things I didn't have the configs
to test.

Outside of the multilib issue, I can fix things up. For the multlib,
I have no idea .. since this:

   file /usr/bin/libtool from install of libtool-2.4.6-r0.0.i586 
conflicts with file from package lib64-libtool-2.4.6-r0.0.x86_64

is greek to me :D

I'll look at these one by one, and see if anyone with more bitbake
knowledge wants to help out with that last one.

Bruce


> The main recurring issue (on all arches and poky+poky-lsb) is failure
> of the kernelmodule.KernelModuleTest.test_kernel_module test. The exact
> failure varies by arch, for x86-64:
> 
> https://autobuilder.yocto.io/builders/nightly-x86-64/builds/1154/steps/Running%20Sanity%20Tests/logs/stdio
> 
> |   CHK     include/generated/utsrelease.h
> |   DESCEND  objtool
> | /lib/modules/4.14.48-yocto-standard/build/tools/build/Makefile.build:37: /lib/modules/4.14.48-yocto-standard/build/tools/build/Build.include: No such file or directory
> | make[4]: *** No rule to make target '/lib/modules/4.14.48-yocto-standard/build/tools/build/Build.include'.  Stop.
> | make[3]: *** [Makefile:43: /lib/modules/4.14.48-yocto-standard/build/tools/objtool/fixdep-in.o] Error 2
> | make[2]: *** [/lib/modules/4.14.48-yocto-standard/build/tools/build/Makefile.include:4: fixdep] Error 2
> | make[1]: *** [Makefile:62: objtool] Error 2
> | make: *** [Makefile:1647: tools/objtool] Error 2
> 
> For mips:
> 
> https://autobuilder.yocto.io/builders/nightly-mips/builds/1115
> 
> |   HOSTCC  scripts/sortextable
> | make[1]: *** No rule to make target 'arch/mips/boot/tools/relocs_32.c', needed by 'arch/mips/boot/tools/relocs_32.o'.  Stop.
> | make: *** [arch/mips/Makefile:16: archscripts] Error 2
> 
> (same for mips64)
> 
> For arm:
> 
> https://autobuilder.yocto.io/builders/nightly-arm/builds/1187/
> 
> |   HOSTCC  scripts/sortextable
> | make[1]: *** No rule to make target 'arch/arm/tools/syscall.tbl', needed by 'arch/arm/include/generated/uapi/asm/unistd-common.h'.  Stop.
> | make: *** [arch/arm/Makefile:319: archheaders] Error 2
> 
> For arm64:
> 
> https://autobuilder.yocto.io/builders/nightly-arm64/builds/1101/steps/Running%20Sanity%20Tests/logs/stdio
> 
> |   CHK     include/generated/uapi/linux/version.h
> |   CHK     include/generated/utsrelease.h
> | make[1]: *** No rule to make target 'arch/arm64/kernel/vdso/vdso.lds', needed by 'arch/arm64/kernel/vdso/vdso.so.dbg'.  Stop.
> | make: *** [arch/arm64/Makefile:160: vdso_prepare] Error 2
>   
> 
> There was also a failure in building the build-appliance image:
> 
> https://autobuilder.yocto.io/builders/build-appliance/builds/1110
> 
> and also a failure in one of the multilib builds, probably from
> different dependencies pulled in by kernel-devsrc:
> 
> https://autobuilder.yocto.io/builders/nightly-multilib/builds/1139/steps/BuildImages_4/logs/stdio
> 
> Error: Transaction check error:
>    file /usr/bin/libtool from install of libtool-2.4.6-r0.0.i586 conflicts with file from package lib64-libtool-2.4.6-r0.0.x86_64
>    file /usr/bin/libtoolize from install of libtool-2.4.6-r0.0.i586 conflicts with file from package lib64-libtool-2.4.6-r0.0.x86_64
> 
> I'll retest with this patch removed just so we can unblock the other patches.
> 
> Cheers,
> 
> Richard
> 



^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2] kernel-devsrc: restructure for out of tree (and on target) module builds
  2018-07-09 15:53 Bruce Ashfield
@ 2018-07-10 10:21 ` Richard Purdie
  2018-07-10 13:09   ` Bruce Ashfield
                     ` (2 more replies)
  0 siblings, 3 replies; 36+ messages in thread
From: Richard Purdie @ 2018-07-10 10:21 UTC (permalink / raw)
  To: Bruce Ashfield; +Cc: openembedded-core

On Mon, 2018-07-09 at 11:53 -0400, Bruce Ashfield wrote:
> The existing kernel-devsrc package starts with a full copy of the
> kernel
> source and then starts to strip out elements that are not required.
> 
> This results in extra time (I/O) and extra space being taken up in
> the
> final package. The main purpose of the kernel-devsrc package has been
> to
> build modules against the running kernel, not to include a full copy
> of
> the source code for re-building the kernel. The end result was a
> 600M kernel-devsrc package.
> 
> This restructuring of the package uses an approach similar to other
> distros, where the kernel-devsrc package is for building against the
> running kernel and uses a curated set of copied infrastructure,
> versus
> a mass copy of the entire kernel.
> 
> The differences in this approach versus other is largely due to the
> architecture support and the split build/source directory of the
> kernel.
> 
> The result is a kernel-devsrc package of about 10M, which is capable
> of running "make scripts" and compiling kernel modules against the
> running kernel.
> 
> Along with the changes to the copying of the infrascture, we also
> have the following changes:
> 
>  - a better/more explicit listing of dependencies for on-target
>    builds of "make scripts" or "make modules_prepare"
> 
>  - The kernel source is installed into /lib/modules/<version>/build
>    and a symlink created from /usr/src/kernel to the new location.
>    This aligns with the standard location for module support
>    code
> 
>  - There is also a symlink from /lib/modules/<version>/source ->
> build
>    to reserve a spot for a new package that is simply the kernel
>    source. That package is not part of this update.
> 
> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
> ---
> 
> v2: drop DEPENDS on perf. We no longer need to depend on perf since
> the source
>     is copied before modification.

It probably won't surprise you to know there were some issues with this
patch, sadly.

The main recurring issue (on all arches and poky+poky-lsb) is failure
of the kernelmodule.KernelModuleTest.test_kernel_module test. The exact
failure varies by arch, for x86-64:

https://autobuilder.yocto.io/builders/nightly-x86-64/builds/1154/steps/Running%20Sanity%20Tests/logs/stdio

|   CHK     include/generated/utsrelease.h
|   DESCEND  objtool
| /lib/modules/4.14.48-yocto-standard/build/tools/build/Makefile.build:37: /lib/modules/4.14.48-yocto-standard/build/tools/build/Build.include: No such file or directory
| make[4]: *** No rule to make target '/lib/modules/4.14.48-yocto-standard/build/tools/build/Build.include'.  Stop.
| make[3]: *** [Makefile:43: /lib/modules/4.14.48-yocto-standard/build/tools/objtool/fixdep-in.o] Error 2
| make[2]: *** [/lib/modules/4.14.48-yocto-standard/build/tools/build/Makefile.include:4: fixdep] Error 2
| make[1]: *** [Makefile:62: objtool] Error 2
| make: *** [Makefile:1647: tools/objtool] Error 2

For mips:

https://autobuilder.yocto.io/builders/nightly-mips/builds/1115

|   HOSTCC  scripts/sortextable
| make[1]: *** No rule to make target 'arch/mips/boot/tools/relocs_32.c', needed by 'arch/mips/boot/tools/relocs_32.o'.  Stop.
| make: *** [arch/mips/Makefile:16: archscripts] Error 2

(same for mips64)

For arm:

https://autobuilder.yocto.io/builders/nightly-arm/builds/1187/

|   HOSTCC  scripts/sortextable
| make[1]: *** No rule to make target 'arch/arm/tools/syscall.tbl', needed by 'arch/arm/include/generated/uapi/asm/unistd-common.h'.  Stop.
| make: *** [arch/arm/Makefile:319: archheaders] Error 2

For arm64:

https://autobuilder.yocto.io/builders/nightly-arm64/builds/1101/steps/Running%20Sanity%20Tests/logs/stdio

|   CHK     include/generated/uapi/linux/version.h
|   CHK     include/generated/utsrelease.h
| make[1]: *** No rule to make target 'arch/arm64/kernel/vdso/vdso.lds', needed by 'arch/arm64/kernel/vdso/vdso.so.dbg'.  Stop.
| make: *** [arch/arm64/Makefile:160: vdso_prepare] Error 2
 

There was also a failure in building the build-appliance image:

https://autobuilder.yocto.io/builders/build-appliance/builds/1110

and also a failure in one of the multilib builds, probably from
different dependencies pulled in by kernel-devsrc:

https://autobuilder.yocto.io/builders/nightly-multilib/builds/1139/steps/BuildImages_4/logs/stdio

Error: Transaction check error:
  file /usr/bin/libtool from install of libtool-2.4.6-r0.0.i586 conflicts with file from package lib64-libtool-2.4.6-r0.0.x86_64
  file /usr/bin/libtoolize from install of libtool-2.4.6-r0.0.i586 conflicts with file from package lib64-libtool-2.4.6-r0.0.x86_64

I'll retest with this patch removed just so we can unblock the other patches.

Cheers,

Richard



^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH v2] kernel-devsrc: restructure for out of tree (and on target) module builds
@ 2018-07-09 15:53 Bruce Ashfield
  2018-07-10 10:21 ` Richard Purdie
  0 siblings, 1 reply; 36+ messages in thread
From: Bruce Ashfield @ 2018-07-09 15:53 UTC (permalink / raw)
  To: richard.purdie; +Cc: openembedded-core

The existing kernel-devsrc package starts with a full copy of the kernel
source and then starts to strip out elements that are not required.

This results in extra time (I/O) and extra space being taken up in the
final package. The main purpose of the kernel-devsrc package has been to
build modules against the running kernel, not to include a full copy of
the source code for re-building the kernel. The end result was a
600M kernel-devsrc package.

This restructuring of the package uses an approach similar to other
distros, where the kernel-devsrc package is for building against the
running kernel and uses a curated set of copied infrastructure, versus
a mass copy of the entire kernel.

The differences in this approach versus other is largely due to the
architecture support and the split build/source directory of the
kernel.

The result is a kernel-devsrc package of about 10M, which is capable
of running "make scripts" and compiling kernel modules against the
running kernel.

Along with the changes to the copying of the infrascture, we also
have the following changes:

 - a better/more explicit listing of dependencies for on-target
   builds of "make scripts" or "make modules_prepare"

 - The kernel source is installed into /lib/modules/<version>/build
   and a symlink created from /usr/src/kernel to the new location.
   This aligns with the standard location for module support
   code

 - There is also a symlink from /lib/modules/<version>/source -> build
   to reserve a spot for a new package that is simply the kernel
   source. That package is not part of this update.

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
---

v2: drop DEPENDS on perf. We no longer need to depend on perf since the source
    is copied before modification.

 meta/recipes-kernel/linux/kernel-devsrc.bb | 199 ++++++++++++++++++++++-------
 1 file changed, 152 insertions(+), 47 deletions(-)

diff --git a/meta/recipes-kernel/linux/kernel-devsrc.bb b/meta/recipes-kernel/linux/kernel-devsrc.bb
index 8bbfa23e4b86..1bfc011a906d 100644
--- a/meta/recipes-kernel/linux/kernel-devsrc.bb
+++ b/meta/recipes-kernel/linux/kernel-devsrc.bb
@@ -30,57 +30,162 @@ do_populate_sysroot[noexec] = "1"
 S = "${STAGING_KERNEL_DIR}"
 B = "${STAGING_KERNEL_BUILDDIR}"
 
-KERNEL_VERSION = "${@get_kernelversion_headers('${S}')}"
-
 PACKAGE_ARCH = "${MACHINE_ARCH}"
 
+KERNEL_BUILD_ROOT="/lib/modules/"
+
 do_install() {
-        kerneldir=${D}${KERNEL_SRC_PATH}
-        install -d $kerneldir
-
-        #
-        # Copy the staging dir source (and module build support) into the devsrc structure.
-        # We can keep this copy simple and take everything, since a we'll clean up any build
-        # artifacts afterwards, and the extra i/o is not significant
-        #
-        cd ${B}
-        find . -type d -name '.git*' -prune -o -path '.debug' -prune -o -type f -print0 | cpio --null -pdlu $kerneldir
-        cd ${S}
-	find . -type d -name '.git*' -prune -o -type d -name '.kernel-meta' -prune -o -type f -print0 | cpio --null -pdlu $kerneldir
-
-        # Explicitly set KBUILD_OUTPUT to ensure that the image directory is cleaned and not
-        # The main build artifacts. We clean the directory to avoid QA errors on mismatched
-        # architecture (since scripts and helpers are native format).
-        KBUILD_OUTPUT="$kerneldir"
-        oe_runmake -C $kerneldir CC="${KERNEL_CC}" LD="${KERNEL_LD}" clean _mrproper_scripts
-        # make clean generates an absolute path symlink called "source"
-        # in $kerneldir points to $kerneldir, which doesn't make any
-        # sense, so remove it.
-        if [ -L $kerneldir/source ]; then
-            bbnote "Removing $kerneldir/source symlink"
-            rm -f $kerneldir/source
-        fi
-
-        # As of Linux kernel version 3.0.1, the clean target removes
-        # arch/powerpc/lib/crtsavres.o which is present in
-        # KBUILD_LDFLAGS_MODULE, making it required to build external modules.
-        if [ ${ARCH} = "powerpc" ]; then
-                mkdir -p $kerneldir/arch/powerpc/lib/
-                cp ${B}/arch/powerpc/lib/crtsavres.o $kerneldir/arch/powerpc/lib/crtsavres.o
-        fi
-
-        # Remove fixdep/objtool as they won't be target binaries
-        for i in fixdep objtool; do
-                if [ -e $kerneldir/tools/objtool/$i ]; then
-                        rm -rf $kerneldir/tools/objtool/$i
-                fi
-        done
-
-        chown -R root:root ${D}
+    kerneldir=${D}${KERNEL_BUILD_ROOT}${KERNEL_VERSION}
+    install -d $kerneldir
+
+    # create the directory structure
+    rm -f $kerneldir/build
+    rm -f $kerneldir/source
+    mkdir -p $kerneldir/build
+
+    # for compatibility with some older variants of this package, we
+    # create  a /usr/src/kernel symlink to /lib/modules/<version>/source
+    mkdir -p ${D}/usr/src
+    (
+	cd ${D}/usr/src
+	ln -s ${KERNEL_BUILD_ROOT}${KERNEL_VERSION}/source kernel
+    )
+
+    # for on target purposes, we unify build and source
+    (
+	cd $kerneldir
+	ln -s build source
+    )
+
+    # first copy everything
+    (
+	cd ${S}
+	cp --parents $(find  -type f -name "Makefile*" -o -name "Kconfig*") $kerneldir/build
+    )
+
+    # then drop all but the needed Makefiles/Kconfig files
+    rm -rf $kerneldir/build/Documentation
+    rm -rf $kerneldir/build/scripts
+    rm -rf $kerneldir/build/include
+
+    # now copy in parts from the build that we'll need later
+    (
+	cd ${B}
+
+	cp Module.symvers $kerneldir/build
+	cp System.map* $kerneldir/build
+	if [ -s Module.markers ]; then
+	    cp Module.markers $kerneldir/build
+	fi
+
+	cp .config $kerneldir/build
+
+	# This scripts copy blow up QA, so for now, we require a more
+	# complex 'make scripts' to restore these, versus copying them
+	# here. Left as a reference to indicate that we know the scripts must
+	# be dealt with.
+	# cp -a scripts $kerneldir/build
+	# if [ -f tools/objtool/objtool ]; then
+	#     cp -a tools/objtool/objtool $kerneldir/build/tools/objtool/
+	# fi
+
+        if [ -d arch/${ARCH}/scripts ]; then
+	    cp -a arch/${ARCH}/scripts $kerneldir/build/arch/${ARCH}
+	fi
+	if [ -f arch/${ARCH}/*lds ]; then
+	    cp -a arch/${ARCH}/*lds $kerneldir/build/arch/${ARCH}
+	fi
+
+	rm -f $kerneldir/build/scripts/*.o
+	rm -f $kerneldir/build/scripts/*/*.o
+
+	if [ "${ARCH}" = "powerpc" ]; then
+	    if [ -e arch/powerpc/lib/crtsavres.S ] ||
+		   [ -e arch/powerpc/lib/crtsavres.o ]; then
+		cp -a --parents arch/powerpc/lib/crtsavres.[So] $kerneldir/build/
+	    fi
+	fi
+
+	cp -a include $kerneldir/build/include
+    )
+
+    # now grab the chunks from the source tree that we need
+    (
+	cd ${S}
+
+	cp -a scripts $kerneldir/build
+	if [ "${ARCH}" = "arm64" ]; then
+	    # arch/arm64/include/asm/xen references arch/arm
+	    cp -a --parents arch/arm/include/asm/xen $kerneldir/build/
+	    # arch/arm64/include/asm/opcodes.h references arch/arm
+	    cp -a --parents arch/arm/include/asm/opcodes.h $kerneldir/build/
+	fi
+
+	# include the machine specific headers for ARM variants, if available.
+	if [ "${ARCH}" = "arm" ]; then
+	    cp -a --parents arch/${ARCH}/mach-*/include $kerneldir/build/
+
+	    # include a few files for 'make prepare'
+	    cp -a --parents arch/arm/tools/gen-mach-types $kerneldir/build/
+	    cp -a --parents arch/arm/tools/mach-types $kerneldir/build/
+	fi
+
+	if [ -d arch/${ARCH}/include ]; then
+	    cp -a --parents arch/${ARCH}/include $kerneldir/build/
+	fi
+
+	cp -a include $kerneldir/build
+
+	cp -a --parents tools/include/tools/le_byteshift.h $kerneldir/build/
+	cp -a --parents tools/include/tools/be_byteshift.h $kerneldir/build/
+
+	if [ "${ARCH}" = "x86" ]; then
+	    # files for 'make prepare' to succeed with kernel-devel
+	    cp -a --parents arch/x86/entry/syscalls/syscall_32.tbl $kerneldir/build/
+	    cp -a --parents arch/x86/entry/syscalls/syscalltbl.sh $kerneldir/build/
+	    cp -a --parents arch/x86/entry/syscalls/syscallhdr.sh $kerneldir/build/
+	    cp -a --parents arch/x86/entry/syscalls/syscall_64.tbl $kerneldir/build/
+	    cp -a --parents arch/x86/tools/relocs_32.c $kerneldir/build/
+	    cp -a --parents arch/x86/tools/relocs_64.c $kerneldir/build/
+	    cp -a --parents arch/x86/tools/relocs.c $kerneldir/build/
+	    cp -a --parents arch/x86/tools/relocs_common.c $kerneldir/build/
+	    cp -a --parents arch/x86/tools/relocs.h $kerneldir/build/
+	    cp -a --parents arch/x86/purgatory/purgatory.c $kerneldir/build/
+	    cp -a --parents arch/x86/purgatory/sha256.h $kerneldir/build/
+	    cp -a --parents arch/x86/purgatory/sha256.c $kerneldir/build/
+	    cp -a --parents arch/x86/purgatory/stack.S $kerneldir/build/
+	    cp -a --parents arch/x86/purgatory/string.c $kerneldir/build/
+	    cp -a --parents arch/x86/purgatory/setup-x86_64.S $kerneldir/build/
+	    cp -a --parents arch/x86/purgatory/entry64.S $kerneldir/build/
+	    cp -a --parents arch/x86/boot/string.h $kerneldir/build/
+	    cp -a --parents arch/x86/boot/string.c $kerneldir/build/
+	    cp -a --parents arch/x86/boot/ctype.h $kerneldir/build/
+	fi
+
+	if [ "${ARCH}" = "mips" ]; then
+	    cp -a --parents arch/mips/Kbuild.platforms $kerneldir/build/
+	    cp --parents $(find  -type f -name "Platform") $kerneldir/build
+	fi
+    )
+
+    # Make sure the Makefile and version.h have a matching timestamp so that
+    # external modules can be built
+    touch -r $kerneldir/build/Makefile $kerneldir/build/include/generated/uapi/linux/version.h
+
+    # Copy .config to include/config/auto.conf so "make prepare" is unnecessary.
+    cp $kerneldir/build/.config $kerneldir/build/include/config/auto.conf
+
+    chown -R root:root ${D}
 }
+
 # Ensure we don't race against "make scripts" during cpio
 do_install[lockfiles] = "${TMPDIR}/kernel-scripts.lock"
 
-PACKAGES = "kernel-devsrc"
-FILES_${PN} = "${KERNEL_SRC_PATH}"
-RDEPENDS_${PN} = "bc"
+FILES_${PN} = "${KERNEL_BUILD_ROOT} ${KERNEL_SRC_PATH}"
+FILES_${PN}-dbg += "${KERNEL_BUILD_ROOT}*/build/scripts/*/.debug/*"
+
+RDEPENDS_${PN} = "bc python ${TCLIBC}-utils"
+# 4.15+ needs these next two RDEPENDS
+RDEPENDS_${PN} += "openssl-dev util-linux"
+# and x86 needs a bit more for 4.15+
+RDEPENDS_${PN} += "${@bb.utils.contains('ARCH', 'x86', 'elfutils', '', d)}"
-- 
2.5.0



^ permalink raw reply related	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2018-07-31  1:07 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-28 19:20 [PATCH v2] kernel-devsrc: restructure for out of tree (and on target) module builds Bruce Ashfield
2018-02-28 21:10 ` Mark Hatle
2018-02-28 21:12   ` Bruce Ashfield
2018-03-01  8:28 ` Maxin B. John
2018-03-01  9:37   ` Burton, Ross
2018-03-01 10:58     ` Maxin B. John
2018-03-01 12:58       ` Bruce Ashfield
2018-03-01 13:59       ` Bruce Ashfield
2018-03-01 14:22         ` Burton, Ross
2018-03-01 14:45           ` Bruce Ashfield
2018-03-01 14:57             ` Burton, Ross
2018-03-02 14:23     ` Bruce Ashfield
2018-03-02 14:26       ` Burton, Ross
2018-03-02 15:20         ` Khem Raj
2018-03-02 18:16     ` Khem Raj
2018-03-02 19:29       ` Bruce Ashfield
2018-03-02 23:14         ` Burton, Ross
2018-03-01 12:57   ` Bruce Ashfield
2018-07-09 15:53 Bruce Ashfield
2018-07-10 10:21 ` Richard Purdie
2018-07-10 13:09   ` Bruce Ashfield
2018-07-10 16:38   ` Bruce Ashfield
2018-07-10 21:41     ` Richard Purdie
2018-07-11  2:34       ` Bruce Ashfield
2018-07-12 13:49       ` Bruce Ashfield
2018-07-12 13:53         ` Richard Purdie
2018-07-12 13:55           ` Bruce Ashfield
2018-07-12 17:02             ` Khem Raj
2018-07-12 17:07               ` Bruce Ashfield
2018-07-12 17:22                 ` Khem Raj
2018-07-12 17:26                   ` Bruce Ashfield
2018-07-26 14:04   ` Bruce Ashfield
2018-07-26 14:17     ` richard.purdie
2018-07-26 17:01       ` Richard Purdie
2018-07-30 22:26     ` richard.purdie
2018-07-31  1:07       ` Bruce Ashfield

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.