Re: [oe] [meta-oe][PATCH 1/1] kernel-selftest: Add a recipe on kernel selftest

2018-07-31 Thread Hongzhi, Song

Hi Raj,

I have fixed the error for poky-lsb with patch sent to oe-core.

The patch fixed the error, 'No libelf found' and 'BPF API too old'.


With the patch above, please compile the kernel-selftest recipe again.

If there is no problem, please merge it.


--Hongzhi


On 2018年07月31日 02:38, Khem Raj wrote:
These are generic layers so adding recipes which limit them to a 
certain kernel or setup is

Not preferred generally I would suggest keep
This recipe in BSP layers where it’s certain that
They will be provided with needed pre requisites

On Mon, Jul 30, 2018 at 5:12 AM Hongzhi, Song 
mailto:hongzhi.s...@windriver.com>> wrote:


Hi Raj,

I can continue to fix the error with rpi that you build. But I
found that rpi gets kernel

from git://github.com/raspberrypi/linux.git;branch=rpi-4.14.y
, which
is not belong

to openembeded. I think that the rpi recipe must make some special
change which

cause the error.


And the recipe in meta-oe is OK both with glibc and musl. So could
you build a project

with oe-core's kernel?  If there is no problem, would you merge
the recipe?


--Hongzhi



On 2018年07月30日 12:02, Khem Raj wrote:

I can not get it compiling for musl and rpi with poky lsb
equivalent distro until there are clean builds it won’t be
possible for me to get this in

On Sun, Jul 29, 2018 at 8:34 PM Hongzhi, Song
mailto:hongzhi.s...@windriver.com>>
wrote:

ping

--Hongzhi


On 2018年07月27日 17:00, Hongzhi, Song wrote:
> Hi Raj,
>
> Could you help to confirm that if the libelf exists in your
> recipe-sysroot?
>
> Because I can't reproduce your error.
>
>
> --Hongzhi
>
>
> On 2018年07月27日 16:40, Khem Raj wrote:
>> this fails on rpi
>>
>> ERROR: Logfile of failure stored in:
>>

/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/temp/log.do_compile.22198

>>
>> Log data follows:
>> | DEBUG: Executing shell function do_compile
>> | NOTE: make -j 16 CROSS_COMPILE=arm-bec-linux-gnueabi-
ARCH=arm
>> CC=arm-bec-linux-gnueabi-gcc -march=armv7ve -mthumb
-mfpu=neon-vfpv4
>> -mfloat-abi=hard -mcpu=cortex-a7 -fstack-protector-strong
>> -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
-Werror=format-security
>> -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat
>> -Wformat-security -Werror=format-security
>>

--sysroot=/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/recipe-sysroot

>>
>> AR=arm-bec-linux-gnueabi-ar LD=arm-bec-linux-gnueabi-ld
>>

--sysroot=/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/recipe-sysroot

>>
>>

DESTDIR=/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/image
>> -C
>>

/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf
>> | make: Entering directory
>>

'/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf'

>>
>> | make -C ../../../lib/bpf
>>

OUTPUT=/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf/

>>
>> | make[1]: Entering directory
>>

'/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/lib/bpf'

>>
>> |
>> | Auto-detecting system features:
>> | ...   No libelf found libelf: [
^[[31mOFF^[[m ]
>> | ...   bpf: [ ^[[31mOFF^[[m ]
>> |
>> | BPF API too old
>> | make[1]: *** [Makefile:219: bpfdep] Error 255
>> | make[1]: *** Waiting for unfinished jobs
>> | No libelf found
>> | make[1]: *** [Makefile:216: elfdep] Error 255
>> |   HOSTCC
>>

/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf/fixdep.o
>> |   HOSTLD
>>

/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf/fixdep-in.o
>> |   LINK
>>

/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf/fixdep
>> | make[1]: Leaving directory
>>


Re: [oe] [meta-oe][PATCH 1/1] kernel-selftest: Add a recipe on kernel selftest

2018-07-30 Thread Khem Raj
These are generic layers so adding recipes which limit them to a certain
kernel or setup is
Not preferred generally I would suggest keep
This recipe in BSP layers where it’s certain that
They will be provided with needed pre requisites

On Mon, Jul 30, 2018 at 5:12 AM Hongzhi, Song 
wrote:

> Hi Raj,
>
> I can continue to fix the error with rpi that you build. But I found that
> rpi gets kernel
>
> from git://github.com/raspberrypi/linux.git;branch=rpi-4.14.y, which is
> not belong
>
> to openembeded. I think that the rpi recipe must make some special change
> which
>
> cause the error.
>
>
> And the recipe in meta-oe is OK both with glibc and musl. So could you
> build a project
>
> with oe-core's kernel?  If there is no problem, would you merge the recipe?
>
> --Hongzhi
>
>
>
> On 2018年07月30日 12:02, Khem Raj wrote:
>
> I can not get it compiling for musl and rpi with poky lsb equivalent
> distro until there are clean builds it won’t be possible for me to get this
> in
>
> On Sun, Jul 29, 2018 at 8:34 PM Hongzhi, Song 
> wrote:
>
>> ping
>>
>> --Hongzhi
>>
>>
>> On 2018年07月27日 17:00, Hongzhi, Song wrote:
>> > Hi Raj,
>> >
>> > Could you help to confirm that if the libelf exists in your
>> > recipe-sysroot?
>> >
>> > Because I can't reproduce your error.
>> >
>> >
>> > --Hongzhi
>> >
>> >
>> > On 2018年07月27日 16:40, Khem Raj wrote:
>> >> this fails on rpi
>> >>
>> >> ERROR: Logfile of failure stored in:
>> >>
>> /mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/temp/log.do_compile.22198
>>
>> >>
>> >> Log data follows:
>> >> | DEBUG: Executing shell function do_compile
>> >> | NOTE: make -j 16 CROSS_COMPILE=arm-bec-linux-gnueabi- ARCH=arm
>> >> CC=arm-bec-linux-gnueabi-gcc  -march=armv7ve -mthumb -mfpu=neon-vfpv4
>> >> -mfloat-abi=hard -mcpu=cortex-a7 -fstack-protector-strong
>> >> -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security
>> >> -fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat
>> >> -Wformat-security -Werror=format-security
>> >>
>> --sysroot=/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/recipe-sysroot
>>
>> >>
>> >> AR=arm-bec-linux-gnueabi-ar LD=arm-bec-linux-gnueabi-ld
>> >>
>> --sysroot=/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/recipe-sysroot
>>
>> >>
>> >>
>> DESTDIR=/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/image
>> >> -C
>> >>
>> /mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf
>> >> | make: Entering directory
>> >>
>> '/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf'
>>
>> >>
>> >> | make -C ../../../lib/bpf
>> >>
>> OUTPUT=/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf/
>>
>> >>
>> >> | make[1]: Entering directory
>> >>
>> '/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/lib/bpf'
>>
>> >>
>> >> |
>> >> | Auto-detecting system features:
>> >> | ...libelf: [ ^[[31mOFF^[[m ]
>> >> | ...   bpf: [ ^[[31mOFF^[[m ]
>> >> |
>> >> | BPF API too old
>> >> | make[1]: *** [Makefile:219: bpfdep] Error 255
>> >> | make[1]: *** Waiting for unfinished jobs
>> >> | No libelf found
>> >> | make[1]: *** [Makefile:216: elfdep] Error 255
>> >> |   HOSTCC
>> >>
>> /mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf/fixdep.o
>> >> |   HOSTLD
>> >>
>> /mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf/fixdep-in.o
>> >> |   LINK
>> >>
>> /mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf/fixdep
>> >> | make[1]: Leaving directory
>> >>
>> '/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/lib/bpf'
>>
>> >>
>> >> | make: *** [Makefile:33:
>> >>
>> /mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf/libbpf.a]
>>
>> >>
>> >> Error 2
>> >> | make: Leaving directory
>> >>
>> '/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf'
>>
>> >>
>> >> | ERROR: oe_runmake failed
>> >> | WARNING:
>> >>
>> /mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/temp/run.do_compile.22198:1
>> >> exit 1 from 'exit 1'
>> >> | ERROR: Function failed: do_compile (log file is located at
>> >>
>> /mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/temp/log.do_compile.22198)
>>
>> >>
>> >>
>> >> On Mon, Jul 16, 2018 at 2:51 AM Hongzhi, Song
>> >>  wrote:
>> >>>
>> >>>

Re: [oe] [meta-oe][PATCH 1/1] kernel-selftest: Add a recipe on kernel selftest

2018-07-30 Thread Hongzhi, Song

Hi Raj,

I can continue to fix the error with rpi that you build. But I found 
that rpi gets kernel


from git://github.com/raspberrypi/linux.git;branch=rpi-4.14.y, which is 
not belong


to openembeded. I think that the rpi recipe must make some special 
change which


cause the error.


And the recipe in meta-oe is OK both with glibc and musl. So could you 
build a project


with oe-core's kernel?  If there is no problem, would you merge the recipe?


--Hongzhi


On 2018年07月30日 12:02, Khem Raj wrote:
I can not get it compiling for musl and rpi with poky lsb equivalent 
distro until there are clean builds it won’t be possible for me to get 
this in


On Sun, Jul 29, 2018 at 8:34 PM Hongzhi, Song 
mailto:hongzhi.s...@windriver.com>> wrote:


ping

--Hongzhi


On 2018年07月27日 17:00, Hongzhi, Song wrote:
> Hi Raj,
>
> Could you help to confirm that if the libelf exists in your
> recipe-sysroot?
>
> Because I can't reproduce your error.
>
>
> --Hongzhi
>
>
> On 2018年07月27日 16:40, Khem Raj wrote:
>> this fails on rpi
>>
>> ERROR: Logfile of failure stored in:
>>

/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/temp/log.do_compile.22198

>>
>> Log data follows:
>> | DEBUG: Executing shell function do_compile
>> | NOTE: make -j 16 CROSS_COMPILE=arm-bec-linux-gnueabi- ARCH=arm
>> CC=arm-bec-linux-gnueabi-gcc  -march=armv7ve -mthumb
-mfpu=neon-vfpv4
>> -mfloat-abi=hard -mcpu=cortex-a7 -fstack-protector-strong
>> -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
-Werror=format-security
>> -fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat
>> -Wformat-security -Werror=format-security
>>

--sysroot=/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/recipe-sysroot

>>
>> AR=arm-bec-linux-gnueabi-ar LD=arm-bec-linux-gnueabi-ld
>>

--sysroot=/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/recipe-sysroot

>>
>>

DESTDIR=/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/image
>> -C
>>

/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf
>> | make: Entering directory
>>

'/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf'

>>
>> | make -C ../../../lib/bpf
>>

OUTPUT=/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf/

>>
>> | make[1]: Entering directory
>>

'/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/lib/bpf'

>>
>> |
>> | Auto-detecting system features:
>> | ...    libelf: [ ^[[31mOFF^[[m ]
>> | ...   bpf: [ ^[[31mOFF^[[m ]
>> |
>> | BPF API too old
>> | make[1]: *** [Makefile:219: bpfdep] Error 255
>> | make[1]: *** Waiting for unfinished jobs
>> | No libelf found
>> | make[1]: *** [Makefile:216: elfdep] Error 255
>> |   HOSTCC
>>

/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf/fixdep.o
>> |   HOSTLD
>>

/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf/fixdep-in.o
>> |   LINK
>>

/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf/fixdep
>> | make[1]: Leaving directory
>>

'/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/lib/bpf'

>>
>> | make: *** [Makefile:33:
>>

/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf/libbpf.a]

>>
>> Error 2
>> | make: Leaving directory
>>

'/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf'

>>
>> | ERROR: oe_runmake failed
>> | WARNING:
>>

/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/temp/run.do_compile.22198:1
>> exit 1 from 'exit 1'
>> | ERROR: Function failed: do_compile (log file is located at
>>

/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/temp/log.do_compile.22198)

>>
>>
>> On Mon, Jul 16, 2018 at 2:51 AM Hongzhi, Song
>> mailto:hongzhi.s...@windriver.com>> wrote:
>>>
>>>
>>> On 2018年07月14日 00:23, Burton, Ross wrote:
 On 13 July 2018 at 15:06, Hongzhi.Song
mailto:hongzhi.s...@windriver.com>>
 wrote:

Re: [oe] [meta-oe][PATCH 1/1] kernel-selftest: Add a recipe on kernel selftest

2018-07-29 Thread Khem Raj
I can not get it compiling for musl and rpi with poky lsb equivalent distro
until there are clean builds it won’t be possible for me to get this in

On Sun, Jul 29, 2018 at 8:34 PM Hongzhi, Song 
wrote:

> ping
>
> --Hongzhi
>
>
> On 2018年07月27日 17:00, Hongzhi, Song wrote:
> > Hi Raj,
> >
> > Could you help to confirm that if the libelf exists in your
> > recipe-sysroot?
> >
> > Because I can't reproduce your error.
> >
> >
> > --Hongzhi
> >
> >
> > On 2018年07月27日 16:40, Khem Raj wrote:
> >> this fails on rpi
> >>
> >> ERROR: Logfile of failure stored in:
> >>
> /mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/temp/log.do_compile.22198
>
> >>
> >> Log data follows:
> >> | DEBUG: Executing shell function do_compile
> >> | NOTE: make -j 16 CROSS_COMPILE=arm-bec-linux-gnueabi- ARCH=arm
> >> CC=arm-bec-linux-gnueabi-gcc  -march=armv7ve -mthumb -mfpu=neon-vfpv4
> >> -mfloat-abi=hard -mcpu=cortex-a7 -fstack-protector-strong
> >> -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security
> >> -fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat
> >> -Wformat-security -Werror=format-security
> >>
> --sysroot=/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/recipe-sysroot
>
> >>
> >> AR=arm-bec-linux-gnueabi-ar LD=arm-bec-linux-gnueabi-ld
> >>
> --sysroot=/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/recipe-sysroot
>
> >>
> >>
> DESTDIR=/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/image
> >> -C
> >>
> /mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf
> >> | make: Entering directory
> >>
> '/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf'
>
> >>
> >> | make -C ../../../lib/bpf
> >>
> OUTPUT=/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf/
>
> >>
> >> | make[1]: Entering directory
> >>
> '/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/lib/bpf'
>
> >>
> >> |
> >> | Auto-detecting system features:
> >> | ...libelf: [ ^[[31mOFF^[[m ]
> >> | ...   bpf: [ ^[[31mOFF^[[m ]
> >> |
> >> | BPF API too old
> >> | make[1]: *** [Makefile:219: bpfdep] Error 255
> >> | make[1]: *** Waiting for unfinished jobs
> >> | No libelf found
> >> | make[1]: *** [Makefile:216: elfdep] Error 255
> >> |   HOSTCC
> >>
> /mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf/fixdep.o
> >> |   HOSTLD
> >>
> /mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf/fixdep-in.o
> >> |   LINK
> >>
> /mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf/fixdep
> >> | make[1]: Leaving directory
> >>
> '/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/lib/bpf'
>
> >>
> >> | make: *** [Makefile:33:
> >>
> /mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf/libbpf.a]
>
> >>
> >> Error 2
> >> | make: Leaving directory
> >>
> '/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf'
>
> >>
> >> | ERROR: oe_runmake failed
> >> | WARNING:
> >>
> /mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/temp/run.do_compile.22198:1
> >> exit 1 from 'exit 1'
> >> | ERROR: Function failed: do_compile (log file is located at
> >>
> /mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/temp/log.do_compile.22198)
>
> >>
> >>
> >> On Mon, Jul 16, 2018 at 2:51 AM Hongzhi, Song
> >>  wrote:
> >>>
> >>>
> >>> On 2018年07月14日 00:23, Burton, Ross wrote:
>  On 13 July 2018 at 15:06, Hongzhi.Song 
>  wrote:
> > +LIC_FILES_CHKSUM =
> > "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7 \
>  Why are you shipping your own copy of the kernel's COPYING file even
>  though you copy another in that prefunc?
> 
>  Isn't it possible to just depend on kernel-source and build directly
>  from the kernel source tree?
> 
> > +# for bpf and vm
> > +DEPENDS = " \
> > +elfutils \
> > +libcap \
> > +libcap-ng \
> > +fuse \
> > +util-linux \
> > +rsync-native \
> > +"
>  Really not convinced these dependencies are accurate.
> 
> > +TEST_LIST = "bpf \
> > + vm \
> > +"
>  You're not listing memfd in here, but that is the only place which
>  uses fuse as far as I can tell.
> 
>  My suggestion is to trim the DEPENDS 

Re: [oe] [meta-oe][PATCH 1/1] kernel-selftest: Add a recipe on kernel selftest

2018-07-29 Thread Hongzhi, Song

ping

--Hongzhi


On 2018年07月27日 17:00, Hongzhi, Song wrote:

Hi Raj,

Could you help to confirm that if the libelf exists in your 
recipe-sysroot?


Because I can't reproduce your error.


--Hongzhi


On 2018年07月27日 16:40, Khem Raj wrote:

this fails on rpi

ERROR: Logfile of failure stored in:
/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/temp/log.do_compile.22198 


Log data follows:
| DEBUG: Executing shell function do_compile
| NOTE: make -j 16 CROSS_COMPILE=arm-bec-linux-gnueabi- ARCH=arm
CC=arm-bec-linux-gnueabi-gcc  -march=armv7ve -mthumb -mfpu=neon-vfpv4
-mfloat-abi=hard -mcpu=cortex-a7 -fstack-protector-strong
-D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security
-fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat
-Wformat-security -Werror=format-security
--sysroot=/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/recipe-sysroot 


AR=arm-bec-linux-gnueabi-ar LD=arm-bec-linux-gnueabi-ld
--sysroot=/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/recipe-sysroot 


DESTDIR=/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/image
-C 
/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf

| make: Entering directory
'/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf' 


| make -C ../../../lib/bpf
OUTPUT=/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf/ 


| make[1]: Entering directory
'/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/lib/bpf' 


|
| Auto-detecting system features:
| ...    libelf: [ ^[[31mOFF^[[m ]
| ...   bpf: [ ^[[31mOFF^[[m ]
|
| BPF API too old
| make[1]: *** [Makefile:219: bpfdep] Error 255
| make[1]: *** Waiting for unfinished jobs
| No libelf found
| make[1]: *** [Makefile:216: elfdep] Error 255
|   HOSTCC 
/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf/fixdep.o
|   HOSTLD 
/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf/fixdep-in.o
|   LINK 
/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf/fixdep

| make[1]: Leaving directory
'/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/lib/bpf' 


| make: *** [Makefile:33:
/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf/libbpf.a] 


Error 2
| make: Leaving directory
'/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf' 


| ERROR: oe_runmake failed
| WARNING: 
/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/temp/run.do_compile.22198:1

exit 1 from 'exit 1'
| ERROR: Function failed: do_compile (log file is located at
/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/temp/log.do_compile.22198) 



On Mon, Jul 16, 2018 at 2:51 AM Hongzhi, Song
 wrote:



On 2018年07月14日 00:23, Burton, Ross wrote:
On 13 July 2018 at 15:06, Hongzhi.Song  
wrote:
+LIC_FILES_CHKSUM = 
"file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7 \

Why are you shipping your own copy of the kernel's COPYING file even
though you copy another in that prefunc?

Isn't it possible to just depend on kernel-source and build directly
from the kernel source tree?


+# for bpf and vm
+DEPENDS = " \
+    elfutils \
+    libcap \
+    libcap-ng \
+    fuse \
+    util-linux \
+    rsync-native \
+"

Really not convinced these dependencies are accurate.


+TEST_LIST = "bpf \
+ vm \
+"

You're not listing memfd in here, but that is the only place which
uses fuse as far as I can tell.

My suggestion is to trim the DEPENDS back to the core minimum and use
PACKAGECONIG to select what directories get built. This means you can
have optional test suites where the dependencies are not in oe-core
(fuse for memfd, for example), and get the right RDEPENDS too.

+    oe_runmake -C ${S}/tools/testing/selftests/${i} 
INSTALL_PATH=${D}/opt/kselftest/${i} install

FHS says /opt is for sysadmin-installed tools that are not package
managed.  You're building a package.  You're also building a package
which is essentially ptest.  I'd say inherit ptest, write a runner,
and put all the binaries in $PTESTDIR.

Hi Burton,

kernel-selftest is designed to be shared by ptest and oe-self, and 
thus is

not supposed to inherit ptest.

The suggestions you mentioned above will be modified soon.

--Hongzhi


Ross





--

Re: [oe] [meta-oe][PATCH 1/1] kernel-selftest: Add a recipe on kernel selftest

2018-07-27 Thread Hongzhi, Song

Hi Raj,

Could you help to confirm that if the libelf exists in your recipe-sysroot?

Because I can't reproduce your error.


--Hongzhi


On 2018年07月27日 16:40, Khem Raj wrote:

this fails on rpi

ERROR: Logfile of failure stored in:
/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/temp/log.do_compile.22198
Log data follows:
| DEBUG: Executing shell function do_compile
| NOTE: make -j 16 CROSS_COMPILE=arm-bec-linux-gnueabi- ARCH=arm
CC=arm-bec-linux-gnueabi-gcc  -march=armv7ve -mthumb -mfpu=neon-vfpv4
-mfloat-abi=hard -mcpu=cortex-a7 -fstack-protector-strong
-D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security
-fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat
-Wformat-security -Werror=format-security
--sysroot=/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/recipe-sysroot
AR=arm-bec-linux-gnueabi-ar LD=arm-bec-linux-gnueabi-ld
--sysroot=/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/recipe-sysroot
  
DESTDIR=/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/image
-C 
/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf
| make: Entering directory
'/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf'
| make -C ../../../lib/bpf
OUTPUT=/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf/
| make[1]: Entering directory
'/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/lib/bpf'
|
| Auto-detecting system features:
| ...libelf: [ ^[[31mOFF^[[m ]
| ...   bpf: [ ^[[31mOFF^[[m ]
|
| BPF API too old
| make[1]: *** [Makefile:219: bpfdep] Error 255
| make[1]: *** Waiting for unfinished jobs
| No libelf found
| make[1]: *** [Makefile:216: elfdep] Error 255
|   HOSTCC   
/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf/fixdep.o
|   HOSTLD   
/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf/fixdep-in.o
|   LINK 
/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf/fixdep
| make[1]: Leaving directory
'/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/lib/bpf'
| make: *** [Makefile:33:
/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf/libbpf.a]
Error 2
| make: Leaving directory
'/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf'
| ERROR: oe_runmake failed
| WARNING: 
/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/temp/run.do_compile.22198:1
exit 1 from 'exit 1'
| ERROR: Function failed: do_compile (log file is located at
/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/temp/log.do_compile.22198)

On Mon, Jul 16, 2018 at 2:51 AM Hongzhi, Song
 wrote:



On 2018年07月14日 00:23, Burton, Ross wrote:

On 13 July 2018 at 15:06, Hongzhi.Song  wrote:

+LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7 \

Why are you shipping your own copy of the kernel's COPYING file even
though you copy another in that prefunc?

Isn't it possible to just depend on kernel-source and build directly
from the kernel source tree?


+# for bpf and vm
+DEPENDS = " \
+elfutils \
+libcap \
+libcap-ng \
+fuse \
+util-linux \
+rsync-native \
+"

Really not convinced these dependencies are accurate.


+TEST_LIST = "bpf \
+ vm \
+"

You're not listing memfd in here, but that is the only place which
uses fuse as far as I can tell.

My suggestion is to trim the DEPENDS back to the core minimum and use
PACKAGECONIG to select what directories get built. This means you can
have optional test suites where the dependencies are not in oe-core
(fuse for memfd, for example), and get the right RDEPENDS too.


+oe_runmake -C ${S}/tools/testing/selftests/${i} 
INSTALL_PATH=${D}/opt/kselftest/${i} install

FHS says /opt is for sysadmin-installed tools that are not package
managed.  You're building a package.  You're also building a package
which is essentially ptest.  I'd say inherit ptest, write a runner,
and put all the binaries in $PTESTDIR.

Hi Burton,

kernel-selftest is designed to be shared by ptest and oe-self, and thus is
not supposed to inherit ptest.

The suggestions you mentioned above will be modified soon.

--Hongzhi


Ross



--
___
Openembedded-devel mailing list

Re: [oe] [meta-oe][PATCH 1/1] kernel-selftest: Add a recipe on kernel selftest

2018-07-27 Thread Khem Raj
this fails on rpi

ERROR: Logfile of failure stored in:
/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/temp/log.do_compile.22198
Log data follows:
| DEBUG: Executing shell function do_compile
| NOTE: make -j 16 CROSS_COMPILE=arm-bec-linux-gnueabi- ARCH=arm
CC=arm-bec-linux-gnueabi-gcc  -march=armv7ve -mthumb -mfpu=neon-vfpv4
-mfloat-abi=hard -mcpu=cortex-a7 -fstack-protector-strong
-D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security
-fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat
-Wformat-security -Werror=format-security
--sysroot=/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/recipe-sysroot
AR=arm-bec-linux-gnueabi-ar LD=arm-bec-linux-gnueabi-ld
--sysroot=/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/recipe-sysroot
 
DESTDIR=/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/image
-C 
/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf
| make: Entering directory
'/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf'
| make -C ../../../lib/bpf
OUTPUT=/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf/
| make[1]: Entering directory
'/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/lib/bpf'
|
| Auto-detecting system features:
| ...libelf: [ ^[[31mOFF^[[m ]
| ...   bpf: [ ^[[31mOFF^[[m ]
|
| BPF API too old
| make[1]: *** [Makefile:219: bpfdep] Error 255
| make[1]: *** Waiting for unfinished jobs
| No libelf found
| make[1]: *** [Makefile:216: elfdep] Error 255
|   HOSTCC   
/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf/fixdep.o
|   HOSTLD   
/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf/fixdep-in.o
|   LINK 
/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf/fixdep
| make[1]: Leaving directory
'/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/lib/bpf'
| make: *** [Makefile:33:
/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf/libbpf.a]
Error 2
| make: Leaving directory
'/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf'
| ERROR: oe_runmake failed
| WARNING: 
/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/temp/run.do_compile.22198:1
exit 1 from 'exit 1'
| ERROR: Function failed: do_compile (log file is located at
/mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/kernel-selftest/1.0-r0/temp/log.do_compile.22198)

On Mon, Jul 16, 2018 at 2:51 AM Hongzhi, Song
 wrote:
>
>
>
> On 2018年07月14日 00:23, Burton, Ross wrote:
> > On 13 July 2018 at 15:06, Hongzhi.Song  wrote:
> >> +LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7 \
> > Why are you shipping your own copy of the kernel's COPYING file even
> > though you copy another in that prefunc?
> >
> > Isn't it possible to just depend on kernel-source and build directly
> > from the kernel source tree?
> >
> >> +# for bpf and vm
> >> +DEPENDS = " \
> >> +elfutils \
> >> +libcap \
> >> +libcap-ng \
> >> +fuse \
> >> +util-linux \
> >> +rsync-native \
> >> +"
> > Really not convinced these dependencies are accurate.
> >
> >> +TEST_LIST = "bpf \
> >> + vm \
> >> +"
> > You're not listing memfd in here, but that is the only place which
> > uses fuse as far as I can tell.
> >
> > My suggestion is to trim the DEPENDS back to the core minimum and use
> > PACKAGECONIG to select what directories get built. This means you can
> > have optional test suites where the dependencies are not in oe-core
> > (fuse for memfd, for example), and get the right RDEPENDS too.
> >
> >> +oe_runmake -C ${S}/tools/testing/selftests/${i} 
> >> INSTALL_PATH=${D}/opt/kselftest/${i} install
> > FHS says /opt is for sysadmin-installed tools that are not package
> > managed.  You're building a package.  You're also building a package
> > which is essentially ptest.  I'd say inherit ptest, write a runner,
> > and put all the binaries in $PTESTDIR.
>
> Hi Burton,
>
> kernel-selftest is designed to be shared by ptest and oe-self, and thus is
> not supposed to inherit ptest.
>
> The suggestions you mentioned above will be modified soon.
>
> --Hongzhi
>
> >
> > Ross
> >
>
-- 
___
Openembedded-devel mailing list

Re: [oe] [meta-oe][PATCH 1/1] kernel-selftest: Add a recipe on kernel selftest

2018-07-16 Thread Hongzhi, Song



On 2018年07月14日 00:23, Burton, Ross wrote:

On 13 July 2018 at 15:06, Hongzhi.Song  wrote:

+LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7 \

Why are you shipping your own copy of the kernel's COPYING file even
though you copy another in that prefunc?

Isn't it possible to just depend on kernel-source and build directly
from the kernel source tree?


+# for bpf and vm
+DEPENDS = " \
+elfutils \
+libcap \
+libcap-ng \
+fuse \
+util-linux \
+rsync-native \
+"

Really not convinced these dependencies are accurate.


+TEST_LIST = "bpf \
+ vm \
+"

You're not listing memfd in here, but that is the only place which
uses fuse as far as I can tell.

My suggestion is to trim the DEPENDS back to the core minimum and use
PACKAGECONIG to select what directories get built. This means you can
have optional test suites where the dependencies are not in oe-core
(fuse for memfd, for example), and get the right RDEPENDS too.


+oe_runmake -C ${S}/tools/testing/selftests/${i} 
INSTALL_PATH=${D}/opt/kselftest/${i} install

FHS says /opt is for sysadmin-installed tools that are not package
managed.  You're building a package.  You're also building a package
which is essentially ptest.  I'd say inherit ptest, write a runner,
and put all the binaries in $PTESTDIR.


Hi Burton,

kernel-selftest is designed to be shared by ptest and oe-self, and thus is
not supposed to inherit ptest.

The suggestions you mentioned above will be modified soon.

--Hongzhi



Ross



--
___
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel


Re: [oe] [meta-oe][PATCH 1/1] kernel-selftest: Add a recipe on kernel selftest

2018-07-13 Thread Burton, Ross
On 13 July 2018 at 15:06, Hongzhi.Song  wrote:
>+LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7 \

Why are you shipping your own copy of the kernel's COPYING file even
though you copy another in that prefunc?

Isn't it possible to just depend on kernel-source and build directly
from the kernel source tree?

> +# for bpf and vm
> +DEPENDS = " \
> +elfutils \
> +libcap \
> +libcap-ng \
> +fuse \
> +util-linux \
> +rsync-native \
> +"

Really not convinced these dependencies are accurate.

> +TEST_LIST = "bpf \
> + vm \
> +"

You're not listing memfd in here, but that is the only place which
uses fuse as far as I can tell.

My suggestion is to trim the DEPENDS back to the core minimum and use
PACKAGECONIG to select what directories get built. This means you can
have optional test suites where the dependencies are not in oe-core
(fuse for memfd, for example), and get the right RDEPENDS too.

> +oe_runmake -C ${S}/tools/testing/selftests/${i} 
> INSTALL_PATH=${D}/opt/kselftest/${i} install

FHS says /opt is for sysadmin-installed tools that are not package
managed.  You're building a package.  You're also building a package
which is essentially ptest.  I'd say inherit ptest, write a runner,
and put all the binaries in $PTESTDIR.

Ross
-- 
___
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel


[oe] [meta-oe][PATCH 1/1] kernel-selftest: Add a recipe on kernel selftest

2018-07-13 Thread Hongzhi.Song
The recipe builds the framework for kernel-selftest. Now, it just
contains two sets of testcase, bpf and vm. We are appending others
to the recipe.

It needs some features which will be written into relevant recipe.
But now, you should add them to conf/local.conf manually.
KERNEL_FEATURES_append += "features/bpf/bpf.scc"

Signed-off-by: Dengke Du 
Signed-off-by: Hongzhi.Song 
---
 .../kernel-selftest/kernel-selftest.bb | 104 ++
 .../kernel-selftest/kernel-selftest/COPYING| 356 +
 .../kernel-selftest/userfaultfd.patch  | 322 +++
 3 files changed, 782 insertions(+)
 create mode 100644 meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb
 create mode 100644 
meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/COPYING
 create mode 100644 
meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/userfaultfd.patch

diff --git a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb 
b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb
new file mode 100644
index 0..2c23b26b5
--- /dev/null
+++ b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb
@@ -0,0 +1,104 @@
+SUMMARY = "Kernel selftest for Linux"
+DESCRIPTION = "Kernel selftest for Linux"
+LICENSE = "GPLv2"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7 \
+"
+
+# vm
+SRC_URI += "file://COPYING \
+"
+SRC_URI_libc-musl += "file://userfaultfd.patch \
+"
+
+# for bpf and vm
+DEPENDS = " \
+elfutils \
+libcap \
+libcap-ng \
+fuse \
+util-linux \
+rsync-native \
+"
+# for vm
+RDEPENDS_${PN} += "libgcc \
+   bash \
+"
+
+do_configure[depends] += "virtual/kernel:do_shared_workdir"
+
+inherit linux-kernel-base kernel-arch
+
+do_populate_lic[depends] += "virtual/kernel:do_patch"
+
+S = "${WORKDIR}/${BP}"
+
+# now we just test bpf and vm
+# we will append other kernel selftest in the future
+TEST_LIST = "bpf \
+ vm \
+"
+
+EXTRA_OEMAKE = '\
+CROSS_COMPILE=${TARGET_PREFIX} \
+ARCH=${ARCH} \
+CC="${CC}" \
+AR="${AR}" \
+LD="${LD}" \
+'
+
+EXTRA_OEMAKE += "\
+'DESTDIR=${D}' \
+"
+
+KERNEL_SELFTEST_SRC ?= "Makefile \
+include \
+tools \
+scripts \
+arch \
+   COPYING \
+"
+
+do_compile() {
+for i in ${TEST_LIST}
+do
+oe_runmake -C ${S}/tools/testing/selftests/${i}
+done
+}
+
+do_install() {
+for i in ${TEST_LIST}
+do
+oe_runmake -C ${S}/tools/testing/selftests/${i} 
INSTALL_PATH=${D}/opt/kselftest/${i} install
+done
+
+chown root:root  -R ${D}/opt/kselftest
+}
+
+do_configure() {
+:
+}
+
+do_patch[prefuncs] += "copy_kselftest_source_from_kernel remove_clang_related"
+python copy_kselftest_source_from_kernel() {
+sources = (d.getVar("KERNEL_SELFTEST_SRC") or "").split()
+src_dir = d.getVar("STAGING_KERNEL_DIR")
+dest_dir = d.getVar("S")
+bb.utils.mkdirhier(dest_dir)
+for s in sources:
+src = oe.path.join(src_dir, s)
+dest = oe.path.join(dest_dir, s)
+if os.path.isdir(src):
+oe.path.copytree(src, dest)
+else:
+bb.utils.copyfile(src, dest)
+}
+
+remove_clang_related() {
+   sed -i -e '/test_pkt_access/d' -e '/test_pkt_md_access/d' 
${S}/tools/testing/selftests/bpf/Makefile
+}
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+INHIBIT_PACKAGE_DEBUG_SPLIT="1"
+FILES_${PN} += "/opt/kselftest/"
diff --git a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/COPYING 
b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/COPYING
new file mode 100644
index 0..ca442d313
--- /dev/null
+++ b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/COPYING
@@ -0,0 +1,356 @@
+
+   NOTE! This copyright does *not* cover user programs that use kernel
+ services by normal system calls - this is merely considered normal use
+ of the kernel, and does *not* fall under the heading of "derived work".
+ Also note that the GPL below is copyrighted by the Free Software
+ Foundation, but the instance of code that it refers to (the Linux
+ kernel) is copyrighted by me and others who actually wrote it.
+
+ Also note that the only valid version of the GPL as far as the kernel
+ is concerned is _this_ particular version of the license (ie v2, not
+ v2.2 or v3.x or whatever), unless explicitly otherwise stated.
+
+   Linus Torvalds
+
+
+
+   GNU GENERAL PUBLIC LICENSE
+  Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+   51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+   Preamble
+
+  The licenses for most software are designed to take away your
+freedom to