[OE-core] [PATCH v2] perf: fail if src path does not exist

Martin Jansa martin.jansa at gmail.com
Thu Aug 16 12:07:16 UTC 2018


Thanks for updated version.

Just in case someone needs to build perf with e.g. 3.16 kernel, then you
need bbappend like this:


# need to copy few more files to support building with old 3.16 kernel
PERF_SRC_append = " scripts arch lib"

# ERROR: perf-1.0-r9 do_configure: Path does not exist:
kernel-source/tools/arch. Maybe PERF_SRC does not match the kernel version.
PERF_SRC_remove = "tools/arch tools/build"


On Mon, Aug 13, 2018 at 11:42 AM Mikko Rapeli <mikko.rapeli at bmw.de> wrote:

> A missing src directory from a broken kernel recipe resulted
> only in a warning:
>
> WARNING: copyfile: stat of
> /home/builder/src/tmp-glibc/work-shared/target/kernel-source/tools/arch
> failed ([Errno 2] No such file or directory:
> '/home/builder/src/tmp-glibc/work-shared/target/kernel-source/tools/arch')
>
> and the build failed horribly.
>
> With this change it's an error which can not be missed:
>
> ERROR: perf-1.0-r9 do_configure: Path does not exist:
> /home/builder/src/tmp-glibc/work-shared/target/kernel-source/tools/arch.
> Maybe PERF_SRC does not match the kernel version.
> ERROR: perf-1.0-r9 do_configure: Function failed:
> copy_perf_source_from_kernel
> ERROR: Logfile of failure stored in:
> /home/builder/src/tmp-glibc/work/target-linux/perf/1.0-r9/temp/log.do_configure.21083
> NOTE: recipe perf-1.0-r9: task do_configure: Failed
> ERROR: Task (/home/builder/src/poky/meta/recipes-kernel/perf/perf.bb:do_configure)
> failed with exit code '1'
>
> To get get perf compiling from a custom kernel, a perf.bbappend can be
> created which defines PERF_SRC as list of files and directories needed
> from kernel source tree to compile perf. This varies between kernel
> versions.
>
> Signed-off-by: Mikko Rapeli <mikko.rapeli at bmw.de>
> ---
>  meta/recipes-kernel/perf/perf.bb | 2 ++
>  1 file changed, 2 insertions(+)
>
> v1:
> http://lists.openembedded.org/pipermail/openembedded-core/2018-August/154028.html
> Added PERF_SRC variable to the error message and commit message
> as suggested by Martin Jansa in
>
> http://lists.openembedded.org/pipermail/openembedded-core/2018-August/154038.html
>
> diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/
> perf.bb
> index 2c6bbb4..c1ce4b4 100644
> --- a/meta/recipes-kernel/perf/perf.bb
> +++ b/meta/recipes-kernel/perf/perf.bb
> @@ -147,6 +147,8 @@ python copy_perf_source_from_kernel() {
>      for s in sources:
>          src = oe.path.join(src_dir, s)
>          dest = oe.path.join(dest_dir, s)
> +        if not os.path.exists(src):
> +            bb.fatal("Path does not exist: %s. Maybe PERF_SRC does not
> match the kernel version." % src)
>          if os.path.isdir(src):
>              oe.path.copyhardlinktree(src, dest)
>          else:
> --
> 1.9.1
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20180816/100abf9e/attachment-0002.html>


More information about the Openembedded-core mailing list