kernel-devsrc: fix error with old (<4.2) x86 kernels
PATCH 1/1 kernel-devsrc: fix error with old (<4.2) x86 kernels
When using kernel-devsrc for older kernels do_install fails with:
| cp: failed to get attributes of 'arch/x86/entry': No such file or directory
In the Linux kernel commit 1f57d5d85
"x86/asm/entry: Move the arch/x86/syscalls/ definitions to arch/x86/entry/syscalls/" moved some files copied in the kernel-devsrc recipe. Commit 1f57d5d85 was added in v4.2.
To be able to use kernel-devsrc for kernels older than v4.2 this commit make use of find for the files that shall be copied.
--- meta/recipes-kernel/linux/kernel-devsrc.bb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
meta/recipes-kernel/linux/kernel-devsrc.bb +5 -5
@@ -185,14 +185,14 @@ do_install() { cp -a --parents tools/include/tools/be_byteshift.h $kerneldir/build/ # required for generate missing syscalls prepare phase - cp -a --parents arch/x86/entry/syscalls/syscall_32.tbl $kerneldir/build + cp -a --parents $(find arch/x86 -type f -name "syscall_32.tbl") $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 $(find arch/x86 -type f -name "syscall_32.tbl") $kerneldir/build/ + cp -a --parents $(find arch/x86 -type f -name "syscalltbl.sh") $kerneldir/build/ + cp -a --parents $(find arch/x86 -type f -name "syscallhdr.sh") $kerneldir/build/ + cp -a --parents $(find arch/x86 -type f -name "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/
Signature · 1 line
2.7.4
Quoted 30 lines · Peter Bergin
When using kernel-devsrc for older kernels
do_installfails with:| cp: failed to get attributes of '
arch/x86/entry': No such file or directoryIn the Linux kernel commit
1f57d5d85
"x86/asm/entry: Move thearch/x86/syscalls/definitions toarch/x86/entry/syscalls/"
moved some files copied in the kernel-devsrc recipe. Commit1f57d5d85was added in
v4.2.To be able to use kernel-devsrc for kernels older than v4.2 this commit make use of find
for the files that shall be copied.Signed-off-by Peter Bergin <[email protected]>--- meta/recipes-kernel/linux/kernel-devsrc.bb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)meta/recipes-kernel/linux/kernel-devsrc.bb +0
-0@@ -185,14 +185,14 @@ do_install() { cp -a --parents tools/include/tools/be_byteshift.h$kerneldir/build/
Quoted 6 lines
# required for generate missing syscalls prepare phase - cp -a --parents arch/x86/entry/syscalls/syscall_32.tbl $kerneldir/build + cp -a --parents $(find arch/x86 -type f -name "syscall_32.tbl") $kerneldir/build
Potentially stupid question (since obviously you've tested this on versions less than v4.2) ..
Doesn't that find command return nothing in kernels < 4.1 and hence is a cp -a --parents <nothing> $kerneldir/build ?
I haven't tested it myself (yet), so I thought I'd ask.
Thanks for fixing up the older kernel support!
Bruce
Quoted 26 lines
if [ "${ARCH}" = "x86" ]; then
# files for 'make prepare' to succeed with kernel-devel
- cp -a --parentsarch/x86/entry/syscalls/syscall_32.tbl
$kerneldir/build/
- cp -a --parentsarch/x86/entry/syscalls/syscalltbl.sh
$kerneldir/build/
- cp -a --parentsarch/x86/entry/syscalls/syscallhdr.sh
$kerneldir/build/
- cp -a --parentsarch/x86/entry/syscalls/syscall_64.tbl
$kerneldir/build/
+ cp -a --parents $(findarch/x86-type f -name
"syscall_32.tbl") $kerneldir/build/
+ cp -a --parents $(findarch/x86-type f -name "syscalltbl.sh")
$kerneldir/build/
+ cp -a --parents $(findarch/x86-type f -name "syscallhdr.sh")
$kerneldir/build/
+ cp -a --parents $(findarch/x86-type f -name
"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/--
2.7.4
Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end - "Use the force Harry" - Gandalf, Star Trek II
Quoted 46 lines · Bruce Ashfield
On Thu, Nov 28, 2019 at 1:14 AM Peter Bergin <[email protected] <mailto:[email protected]>> wrote:
When using kernel-devsrc for older kernels do_install fails with: | cp: failed to get attributes of 'arch/x86/entry': No such file or directory In the Linux kernel commit 1f57d5d85 "x86/asm/entry: Move the arch/x86/syscalls/ definitions to arch/x86/entry/syscalls/" moved some files copied in the kernel-devsrc recipe. Commit 1f57d5d85 was added in v4.2. To be able to use kernel-devsrc for kernels older than v4.2 this commit make use of find for the files that shall be copied. Signed-off-by: Peter Bergin <[email protected] <mailto:[email protected]>> --- meta/recipes-kernel/linux/kernel-devsrc.bb <http://kernel-devsrc.bb> | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/meta/recipes-kernel/linux/kernel-devsrc.bb <http://kernel-devsrc.bb> b/meta/recipes-kernel/linux/kernel-devsrc.bb <http://kernel-devsrc.bb> index b68d945..b6f2dbc 100644 --- a/meta/recipes-kernel/linux/kernel-devsrc.bb <http://kernel-devsrc.bb> +++ b/meta/recipes-kernel/linux/kernel-devsrc.bb <http://kernel-devsrc.bb> @@ -185,14 +185,14 @@ do_install() { cp -a --parents tools/include/tools/be_byteshift.h $kerneldir/build/ # required for generate missing syscalls prepare phase - cp -a --parents arch/x86/entry/syscalls/syscall_32.tbl $kerneldir/build + cp -a --parents $(find arch/x86 -type f -name "syscall_32.tbl") $kerneldir/build
Quoted 4 lines
Potentially stupid question (since obviously you've tested this on versions less than v4.2) ..
Doesn't that find command return nothing in kernels < 4.1 and hence is a cp -a --parents <nothing> $kerneldir/build ?
I have tested this on v4.1 and v5.2 for qemux86-64 target. Both works well as I can see. I added '-v' flag to the changed cp statements in the kernel-devsrc recipe. The outputs in log.do_install was:
For v4.1:
'arch/x86/syscalls/syscall_32.tbl' -> '/work/yocto/master/qemux86-64/tmp/work/qemux86_64-poky-linux/kernel-devsrc/1.0-r0/image/lib/modules/4.1.0-yocto-standard-upstream/build/arch/x86/syscalls/syscall_32.tbl' 'arch/x86/syscalls/syscall_32.tbl' -> '/work/yocto/master/qemux86-64/tmp/work/qemux86_64-poky-linux/kernel-devsrc/1.0-r0/image/lib/modules/4.1.0-yocto-standard-upstream/build/arch/x86/syscalls/syscall_32.tbl' 'arch/x86/syscalls/syscalltbl.sh' -> '/work/yocto/master/qemux86-64/tmp/work/qemux86_64-poky-linux/kernel-devsrc/1.0-r0/image/lib/modules/4.1.0-yocto-standard-upstream/build/arch/x86/syscalls/syscalltbl.sh' 'arch/x86/syscalls/syscallhdr.sh' -> '/work/yocto/master/qemux86-64/tmp/work/qemux86_64-poky-linux/kernel-devsrc/1.0-r0/image/lib/modules/4.1.0-yocto-standard-upstream/build/arch/x86/syscalls/syscallhdr.sh' 'arch/x86/syscalls/syscall_64.tbl' -> '/work/yocto/master/qemux86-64/tmp/work/qemux86_64-poky-linux/kernel-devsrc/1.0-r0/image/lib/modules/4.1.0-yocto-standard-upstream/build/arch/x86/syscalls/syscall_64.tbl'
For v5.2:
'arch/x86/entry/syscalls/syscall_32.tbl' -> '/work/yocto/master/qemux86-64/tmp/work/qemux86_64-poky-linux/kernel-devsrc/1.0-r0/image/lib/modules/5.2.20-yocto-standard/build/arch/x86/entry/syscalls/syscall_32.tbl' 'arch/x86/entry/syscalls/syscall_32.tbl' -> '/work/yocto/master/qemux86-64/tmp/work/qemux86_64-poky-linux/kernel-devsrc/1.0-r0/image/lib/modules/5.2.20-yocto-standard/build/arch/x86/entry/syscalls/syscall_32.tbl' 'arch/x86/entry/syscalls/syscalltbl.sh' -> '/work/yocto/master/qemux86-64/tmp/work/qemux86_64-poky-linux/kernel-devsrc/1.0-r0/image/lib/modules/5.2.20-yocto-standard/build/arch/x86/entry/syscalls/syscalltbl.sh' 'arch/x86/entry/syscalls/syscallhdr.sh' -> '/work/yocto/master/qemux86-64/tmp/work/qemux86_64-poky-linux/kernel-devsrc/1.0-r0/image/lib/modules/5.2.20-yocto-standard/build/arch/x86/entry/syscalls/syscallhdr.sh' 'arch/x86/entry/syscalls/syscall_64.tbl' -> '/work/yocto/master/qemux86-64/tmp/work/qemux86_64-poky-linux/kernel-devsrc/1.0-r0/image/lib/modules/5.2.20-yocto-standard/build/arch/x86/entry/syscalls/syscall_64.tbl'
Best regards,
/Peter
Quoted 40 lines
I haven't tested it myself (yet), so I thought I'd ask.
Thanks for fixing up the older kernel support!
Bruce
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 $(find arch/x86 -type f -name "syscall_32.tbl") $kerneldir/build/ + cp -a --parents $(find arch/x86 -type f -name "syscalltbl.sh") $kerneldir/build/ + cp -a --parents $(find arch/x86 -type f -name "syscallhdr.sh") $kerneldir/build/ + cp -a --parents $(find arch/x86 -type f -name "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/ -- 2.7.4Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end - "Use the force Harry" - Gandalf, Star Trek II
Quoted 49 lines · Peter Bergin
On 2019-11-28 15:08, Bruce Ashfield wrote:
Quoted 23 lines · Peter Bergin
When using kernel-devsrc for older kernels
do_installfails with:| cp: failed to get attributes of '
arch/x86/entry': No such file or directoryIn the Linux kernel commit
1f57d5d85
"x86/asm/entry: Move thearch/x86/syscalls/definitions toarch/x86/entry/syscalls/" moved some files copied in the kernel-devsrc recipe. Commit1f57d5d85was added in v4.2.To be able to use kernel-devsrc for kernels older than v4.2 this commit make use of find for the files that shall be copied.
Signed-off-by Peter Bergin <[email protected]>--- meta/recipes-kernel/linux/kernel-devsrc.bb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)meta/recipes-kernel/linux/kernel-devsrc.bb +0
-0meta/recipes-kernel/linux/kernel-devsrc.bb do_install() { · line 188
Quoted 5 lines
meta/recipes-kernel/linux/kernel-devsrc.bb +1
-1@@ -185,14 +185,14 @@ do_install() { cp -a --parents tools/include/tools/be_byteshift.h $kerneldir/build/ # required for generate missing syscalls prepare phase - cp -a --parents arch/x86/entry/syscalls/syscall_32.tbl $kerneldir/build + cp -a --parents $(find arch/x86 -type f -name "syscall_32.tbl") $kerneldir/buildPotentially stupid question (since obviously you've tested this on versions less than v4.2) ..
Doesn't that find command return nothing in kernels < 4.1 and hence is a cp -a --parents <nothing> $kerneldir/build ?
I have tested this on v4.1 and v5.2 for qemux86-64 target. Both works well as I can see. I added '-v' flag to the changed cp statements in the kernel-devsrc recipe. The outputs in log.do_install was:
For v4.1:
'arch/x86/syscalls/syscall_32.tbl' -> '/work/yocto/master/qemux86-64/tmp/work/qemux86_64-poky-linux/kernel-devsrc/1.0-r0/image/lib/modules/4.1.0-yocto-standard-upstream/build/arch/x86/syscalls/syscall_32.tbl' 'arch/x86/syscalls/syscall_32.tbl' -> '/work/yocto/master/qemux86-64/tmp/work/qemux86_64-poky-linux/kernel-devsrc/1.0-r0/image/lib/modules/4.1.0-yocto-standard-upstream/build/arch/x86/syscalls/syscall_32.tbl' 'arch/x86/syscalls/syscalltbl.sh' -> '/work/yocto/master/qemux86-64/tmp/work/qemux86_64-poky-linux/kernel-devsrc/1.0-r0/image/lib/modules/4.1.0-yocto-standard-upstream/build/arch/x86/syscalls/syscalltbl.sh' 'arch/x86/syscalls/syscallhdr.sh' -> '/work/yocto/master/qemux86-64/tmp/work/qemux86_64-poky-linux/kernel-devsrc/1.0-r0/image/lib/modules/4.1.0-yocto-standard-upstream/build/arch/x86/syscalls/syscallhdr.sh' 'arch/x86/syscalls/syscall_64.tbl' -> '/work/yocto/master/qemux86-64/tmp/work/qemux86_64-poky-linux/kernel-devsrc/1.0-r0/image/lib/modules/4.1.0-yocto-standard-upstream/build/arch/x86/syscalls/syscall_64.tbl'
Quoted 7 lines
For v5.2:
'arch/x86/entry/syscalls/syscall_32.tbl' -> '/work/yocto/master/qemux86-64/tmp/work/qemux86_64-poky-linux/kernel-devsrc/1.0-r0/image/lib/modules/5.2.20-yocto-standard/build/arch/x86/entry/syscalls/syscall_32.tbl' 'arch/x86/entry/syscalls/syscall_32.tbl' -> '/work/yocto/master/qemux86-64/tmp/work/qemux86_64-poky-linux/kernel-devsrc/1.0-r0/image/lib/modules/5.2.20-yocto-standard/build/arch/x86/entry/syscalls/syscall_32.tbl' 'arch/x86/entry/syscalls/syscalltbl.sh' -> '/work/yocto/master/qemux86-64/tmp/work/qemux86_64-poky-linux/kernel-devsrc/1.0-r0/image/lib/modules/5.2.20-yocto-standard/build/arch/x86/entry/syscalls/syscalltbl.sh' 'arch/x86/entry/syscalls/syscallhdr.sh' -> '/work/yocto/master/qemux86-64/tmp/work/qemux86_64-poky-linux/kernel-devsrc/1.0-r0/image/lib/modules/5.2.20-yocto-standard/build/arch/x86/entry/syscalls/syscallhdr.sh' 'arch/x86/entry/syscalls/syscall_64.tbl' -> '/work/yocto/master/qemux86-64/tmp/work/qemux86_64-poky-linux/kernel-devsrc/1.0-r0/image/lib/modules/5.2.20-yocto-standard/build/arch/x86/entry/syscalls/syscall_64.tbl'
Ah yes! I had read that as "the files don't exist at all in 4.1" versus "they are in a different location in 4.1".
The change looks good to me.
I can't think of any more -by tags to add, so I'll leave it at that ;)
Bruce
Quoted 35 lines
Best regards,
/PeterI haven't tested it myself (yet), so I thought I'd ask.
Thanks for fixing up the older kernel support!
Bruce
Quoted 16 lines
meta/recipes-kernel/linux/kernel-devsrc.bb +4
-5if [ "${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 $(find arch/x86 -type f -name "syscall_32.tbl") $kerneldir/build/ + cp -a --parents $(find arch/x86 -type f -name "syscalltbl.sh") $kerneldir/build/ + cp -a --parents $(find arch/x86 -type f -name "syscallhdr.sh") $kerneldir/build/ + cp -a --parents $(find arch/x86 -type f -name "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/ --Quoted 2 lines
2.7.4
--
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end - "Use the force Harry" - Gandalf, Star Trek II