All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-oe][PATCH v2 0/1] Add a recipe on kernel selftest
@ 2018-07-13 14:06 Hongzhi.Song
  2018-07-13 14:06 ` [meta-oe][PATCH 1/1] kernel-selftest: " Hongzhi.Song
                   ` (3 more replies)
  0 siblings, 4 replies; 18+ messages in thread
From: Hongzhi.Song @ 2018-07-13 14:06 UTC (permalink / raw)
  To: raj.khem, openembedded-devel

0001-kernel-selftest-Add-a-recipe-on-kernel-selftest.patch:
    1. This patch add support for musl libc.
    2. I don't reproduce the error about Makefile with your auto.conf.
    3. Boot failed using your auto.conf with error:
       ---
       [  576.229543] mount[2571]: segfault at 0 ip   (null) sp bfb52e0c error 
                      4 in mount.util-linux[8048000+9000]
       You are in emergency mode. After logging in, type "journalctl -xb" to view
       system logs, "systemctl reboot" to reboot, "systemctl default" or "exit"
       to boot into default mode.
       /sbin/sulogin terminated by signal SEGV.
       ---
       runqemu qemux86 nographic slirp qemuparams="-m 2048"
    4. With this patch set, I have fixed all musl related issues in my build.
       It builds and works well. But I still have not met the error in yours.

       In my case, I just start build from latest poky without any change
       other than a few necessary kernel config fragments. I'd like to
       reproduce your error but I can't. Could you please provide more info
       about your build config?

0001-x86-remove-qemu-usermode-from-MACHINE_FEATURES_BACKF.patch:
    This patch is to fix gobject-introspection do_compile.

    With m32, qemu-usermode will be back filled and gobject-introspection 
    tends to use qemu-i386. Is this the way to fix? If you have no objection 
    I will commit to oe-core next.

Hongzhi.Song (1):
  kernel-selftest: Add a recipe on kernel selftest

 .../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

-- 
2.11.0



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

* [meta-oe][PATCH 1/1] kernel-selftest: Add a recipe on kernel selftest
  2018-07-13 14:06 [meta-oe][PATCH v2 0/1] Add a recipe on kernel selftest Hongzhi.Song
@ 2018-07-13 14:06 ` Hongzhi.Song
  2018-07-13 16:23   ` Burton, Ross
  2018-07-13 14:06 ` [OE-core][PATCH] x86: remove "qemu-usermode" from MACHINE_FEATURES_BACKFILL_CONSIDERED Hongzhi.Song
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 18+ messages in thread
From: Hongzhi.Song @ 2018-07-13 14:06 UTC (permalink / raw)
  To: raj.khem, openembedded-devel

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 <dengke.du@windriver.com>
Signed-off-by: Hongzhi.Song <hongzhi.song@windriver.com>
---
 .../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 000000000..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 000000000..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 share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+\f
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+\f
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+\f
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+\f
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+\f
+	    How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/userfaultfd.patch b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/userfaultfd.patch
new file mode 100644
index 000000000..bed20510e
--- /dev/null
+++ b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/userfaultfd.patch
@@ -0,0 +1,322 @@
+From c7b375747cffb627d02543d946b28525455d7d46 Mon Sep 17 00:00:00 2001
+From: "Hongzhi.Song" <hongzhi.song@windriver.com>
+Date: Fri, 13 Jul 2018 06:06:19 -0700
+Subject: [PATCH] vm: add some funtions to support musl libc
+
+Signed-off-by: Hongzhi.Song <hongzhi.song@windriver.com>
+---
+ tools/testing/selftests/vm/userfaultfd.c | 298 +++++++++++++++++++++++++++++++
+ 1 file changed, 298 insertions(+)
+
+diff --git a/tools/testing/selftests/vm/userfaultfd.c b/tools/testing/selftests/vm/userfaultfd.c
+index de2f9ec..dc73021 100644
+--- a/tools/testing/selftests/vm/userfaultfd.c
++++ b/tools/testing/selftests/vm/userfaultfd.c
+@@ -71,6 +71,304 @@
+ 
+ #ifdef __NR_userfaultfd
+ 
++/* Linear congruential.  */
++#define	TYPE_0		0
++#define	BREAK_0		8
++#define	DEG_0		0
++#define	SEP_0		0
++
++/* x**7 + x**3 + 1.  */
++#define	TYPE_1		1
++#define	BREAK_1		32
++#define	DEG_1		7
++#define	SEP_1		3
++
++/* x**15 + x + 1.  */
++#define	TYPE_2		2
++#define	BREAK_2		64
++#define	DEG_2		15
++#define	SEP_2		1
++
++/* x**31 + x**3 + 1.  */
++#define	TYPE_3		3
++#define	BREAK_3		128
++#define	DEG_3		31
++#define	SEP_3		3
++
++/* x**63 + x + 1.  */
++#define	TYPE_4		4
++#define	BREAK_4		256
++#define	DEG_4		63
++#define	SEP_4		1
++
++/* Array versions of the above information to make code run faster.
++   Relies on fact that TYPE_i == i.  */
++
++#define	MAX_TYPES	5	/* Max number of types above.  */
++
++#define __set_errno(val) (errno = (val))
++
++struct random_data
++  {
++    int32_t *fptr;      /* Front pointer.  */
++    int32_t *rptr;      /* Rear pointer.  */
++    int32_t *state;     /* Array of state values.  */
++    int rand_type;      /* Type of random number generator.  */
++    int rand_deg;       /* Degree of random number generator.  */
++    int rand_sep;       /* Distance between front and rear.  */
++    int32_t *end_ptr;       /* Pointer behind state table.  */
++  };
++
++struct random_poly_info
++{
++  int seps[MAX_TYPES];
++  int degrees[MAX_TYPES];
++};
++
++static const struct random_poly_info random_poly_info =
++{
++  { SEP_0, SEP_1, SEP_2, SEP_3, SEP_4 },
++  { DEG_0, DEG_1, DEG_2, DEG_3, DEG_4 }
++};
++
++/* If we are using the trivial TYPE_0 R.N.G., just do the old linear
++   congruential bit.  Otherwise, we do our fancy trinomial stuff, which is the
++   same in all the other cases due to all the global variables that have been
++   set up.  The basic operation is to add the number at the rear pointer into
++   the one at the front pointer.  Then both pointers are advanced to the next
++   location cyclically in the table.  The value returned is the sum generated,
++   reduced to 31 bits by throwing away the "least random" low bit.
++   Note: The code takes advantage of the fact that both the front and
++   rear pointers can't wrap on the same call by not testing the rear
++   pointer if the front one has wrapped.  Returns a 31-bit random number.  */
++
++int random_r (struct random_data *buf, int32_t *result)
++{
++  int32_t *state;
++
++  if (buf == NULL || result == NULL)
++    goto fail;
++
++  state = buf->state;
++
++  if (buf->rand_type == TYPE_0)
++    {
++      int32_t val = ((state[0] * 1103515245U) + 12345U) & 0x7fffffff;
++      state[0] = val;
++      *result = val;
++    }
++  else
++    {
++      int32_t *fptr = buf->fptr;
++      int32_t *rptr = buf->rptr;
++      int32_t *end_ptr = buf->end_ptr;
++      uint32_t val;
++
++      val = *fptr += (uint32_t) *rptr;
++      /* Chucking least random bit.  */
++      *result = val >> 1;
++      ++fptr;
++      if (fptr >= end_ptr)
++	{
++	  fptr = state;
++	  ++rptr;
++	}
++      else
++	{
++	  ++rptr;
++	  if (rptr >= end_ptr)
++	    rptr = state;
++	}
++      buf->fptr = fptr;
++      buf->rptr = rptr;
++    }
++  return 0;
++
++ fail:
++  __set_errno (EINVAL);
++  return -1;
++}
++
++/* Initialize the random number generator based on the given seed.  If the
++   type is the trivial no-state-information type, just remember the seed.
++   Otherwise, initializes state[] based on the given "seed" via a linear
++   congruential generator.  Then, the pointers are set to known locations
++   that are exactly rand_sep places apart.  Lastly, it cycles the state
++   information a given number of times to get rid of any initial dependencies
++   introduced by the L.C.R.N.G.  Note that the initialization of randtbl[]
++   for default usage relies on values produced by this routine.  */
++int srandom_r (unsigned int seed, struct random_data *buf)
++{
++  int type;
++  int32_t *state;
++  long int i;
++  int32_t word;
++  int32_t *dst;
++  int kc;
++
++  if (buf == NULL)
++    goto fail;
++  type = buf->rand_type;
++  if ((unsigned int) type >= MAX_TYPES)
++    goto fail;
++
++  state = buf->state;
++  /* We must make sure the seed is not 0.  Take arbitrarily 1 in this case.  */
++  if (seed == 0)
++    seed = 1;
++  state[0] = seed;
++  if (type == TYPE_0)
++    goto done;
++
++  dst = state;
++  word = seed;
++  kc = buf->rand_deg;
++  for (i = 1; i < kc; ++i)
++    {
++      /* This does:
++	   state[i] = (16807 * state[i - 1]) % 2147483647;
++	 but avoids overflowing 31 bits.  */
++      long int hi = word / 127773;
++      long int lo = word % 127773;
++      word = 16807 * lo - 2836 * hi;
++      if (word < 0)
++	word += 2147483647;
++      *++dst = word;
++    }
++
++  buf->fptr = &state[buf->rand_sep];
++  buf->rptr = &state[0];
++  kc *= 10;
++  while (--kc >= 0)
++    {
++      int32_t discard;
++      (void) random_r (buf, &discard);
++    }
++
++ done:
++  return 0;
++
++ fail:
++  return -1;
++}
++
++/* Initialize the state information in the given array of N bytes for
++   future random number generation.  Based on the number of bytes we
++   are given, and the break values for the different R.N.G.'s, we choose
++   the best (largest) one we can and set things up for it.  srandom is
++   then called to initialize the state information.  Note that on return
++   from srandom, we set state[-1] to be the type multiplexed with the current
++   value of the rear pointer; this is so successive calls to initstate won't
++   lose this information and will be able to restart with setstate.
++   Note: The first thing we do is save the current state, if any, just like
++   setstate so that it doesn't matter when initstate is called.
++   Returns 0 on success, non-zero on failure.  */
++int initstate_r (unsigned int seed, char *arg_state, size_t n,
++	       struct random_data *buf)
++{
++  if (buf == NULL)
++    goto fail;
++
++  int32_t *old_state = buf->state;
++  if (old_state != NULL)
++    {
++      int old_type = buf->rand_type;
++      if (old_type == TYPE_0)
++	old_state[-1] = TYPE_0;
++      else
++	old_state[-1] = (MAX_TYPES * (buf->rptr - old_state)) + old_type;
++    }
++
++  int type;
++  if (n >= BREAK_3)
++    type = n < BREAK_4 ? TYPE_3 : TYPE_4;
++  else if (n < BREAK_1)
++    {
++      if (n < BREAK_0)
++	goto fail;
++
++      type = TYPE_0;
++    }
++  else
++    type = n < BREAK_2 ? TYPE_1 : TYPE_2;
++
++  int degree = random_poly_info.degrees[type];
++  int separation = random_poly_info.seps[type];
++
++  buf->rand_type = type;
++  buf->rand_sep = separation;
++  buf->rand_deg = degree;
++  int32_t *state = &((int32_t *) arg_state)[1];	/* First location.  */
++  /* Must set END_PTR before srandom.  */
++  buf->end_ptr = &state[degree];
++
++  buf->state = state;
++
++  srandom_r (seed, buf);
++
++  state[-1] = TYPE_0;
++  if (type != TYPE_0)
++    state[-1] = (buf->rptr - state) * MAX_TYPES + type;
++
++  return 0;
++
++ fail:
++  __set_errno (EINVAL);
++  return -1;
++}
++
++/* Restore the state from the given state array.
++   Note: It is important that we also remember the locations of the pointers
++   in the current state information, and restore the locations of the pointers
++   from the old state information.  This is done by multiplexing the pointer
++   location into the zeroth word of the state information. Note that due
++   to the order in which things are done, it is OK to call setstate with the
++   same state as the current state
++   Returns 0 on success, non-zero on failure.  */
++int setstate_r (char *arg_state, struct random_data *buf)
++{
++  int32_t *new_state = 1 + (int32_t *) arg_state;
++  int type;
++  int old_type;
++  int32_t *old_state;
++  int degree;
++  int separation;
++
++  if (arg_state == NULL || buf == NULL)
++    goto fail;
++
++  old_type = buf->rand_type;
++  old_state = buf->state;
++  if (old_type == TYPE_0)
++    old_state[-1] = TYPE_0;
++  else
++    old_state[-1] = (MAX_TYPES * (buf->rptr - old_state)) + old_type;
++
++  type = new_state[-1] % MAX_TYPES;
++  if (type < TYPE_0 || type > TYPE_4)
++    goto fail;
++
++  buf->rand_deg = degree = random_poly_info.degrees[type];
++  buf->rand_sep = separation = random_poly_info.seps[type];
++  buf->rand_type = type;
++
++  if (type != TYPE_0)
++    {
++      int rear = new_state[-1] / MAX_TYPES;
++      buf->rptr = &new_state[rear];
++      buf->fptr = &new_state[(rear + separation) % degree];
++    }
++  buf->state = new_state;
++  /* Set end_ptr too.  */
++  buf->end_ptr = &new_state[degree];
++
++  return 0;
++
++ fail:
++  __set_errno (EINVAL);
++  return -1;
++}
++
+ static unsigned long nr_cpus, nr_pages, nr_pages_per_cpu, page_size;
+ 
+ #define BOUNCE_RANDOM		(1<<0)
+-- 
+2.11.0
+
-- 
2.11.0



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

* [OE-core][PATCH] x86: remove "qemu-usermode" from MACHINE_FEATURES_BACKFILL_CONSIDERED
  2018-07-13 14:06 [meta-oe][PATCH v2 0/1] Add a recipe on kernel selftest Hongzhi.Song
  2018-07-13 14:06 ` [meta-oe][PATCH 1/1] kernel-selftest: " Hongzhi.Song
@ 2018-07-13 14:06 ` Hongzhi.Song
  2018-07-13 14:13   ` Alexander Kanavin
  2018-07-13 14:59   ` akuster808
  2018-07-13 14:10 ` [meta-oe][PATCH v2 0/1] Add a recipe on kernel selftest Hongzhi, Song
  2018-07-16 10:04 ` Hongzhi, Song
  3 siblings, 2 replies; 18+ messages in thread
From: Hongzhi.Song @ 2018-07-13 14:06 UTC (permalink / raw)
  To: raj.khem, openembedded-devel

error information:
---
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
If the above error message is about missing .so libraries,
then setting up GIR_EXTRA_LIBS_PATH in the recipe should help.
(typically like this: GIR_EXTRA_LIBS_PATH="${B}/something/.libs" )
---

qemux86 will face the error above.

Signed-off-by: Hongzhi.Song <hongzhi.song@windriver.com>
---
 meta/conf/machine/include/x86/arch-x86.inc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/conf/machine/include/x86/arch-x86.inc b/meta/conf/machine/include/x86/arch-x86.inc
index 70814b8d4d..091d60f507 100644
--- a/meta/conf/machine/include/x86/arch-x86.inc
+++ b/meta/conf/machine/include/x86/arch-x86.inc
@@ -26,6 +26,7 @@ TUNE_LDARGS += "${@bb.utils.contains('TUNE_FEATURES', 'mx32', '-m elf32_x86_64',
 TUNE_ASARGS += "${@bb.utils.contains('TUNE_FEATURES', 'mx32', '-x32', '', d)}"
 # user mode qemu doesn't support x32
 MACHINE_FEATURES_BACKFILL_CONSIDERED_append = " ${@bb.utils.contains('TUNE_FEATURES', 'mx32', 'qemu-usermode', '', d)}"
+MACHINE_FEATURES_BACKFILL_CONSIDERED_append = " ${@bb.utils.contains('TUNE_FEATURES', 'm32', 'qemu-usermode', '', d)}"
 MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'mx32', 'x86-x32:', '' ,d)}"
 
 # ELF64 ABI
-- 
2.11.0



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

* Re: [meta-oe][PATCH v2 0/1] Add a recipe on kernel selftest
  2018-07-13 14:06 [meta-oe][PATCH v2 0/1] Add a recipe on kernel selftest Hongzhi.Song
  2018-07-13 14:06 ` [meta-oe][PATCH 1/1] kernel-selftest: " Hongzhi.Song
  2018-07-13 14:06 ` [OE-core][PATCH] x86: remove "qemu-usermode" from MACHINE_FEATURES_BACKFILL_CONSIDERED Hongzhi.Song
@ 2018-07-13 14:10 ` Hongzhi, Song
  2018-07-13 15:02   ` akuster808
  2018-07-16 10:04 ` Hongzhi, Song
  3 siblings, 1 reply; 18+ messages in thread
From: Hongzhi, Song @ 2018-07-13 14:10 UTC (permalink / raw)
  To: raj.khem, openembedded-devel

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

Attachment is my local.conf

--Hongzhi


On 2018年07月13日 22:06, Hongzhi.Song wrote:
> 0001-kernel-selftest-Add-a-recipe-on-kernel-selftest.patch:
>      1. This patch add support for musl libc.
>      2. I don't reproduce the error about Makefile with your auto.conf.
>      3. Boot failed using your auto.conf with error:
>         ---
>         [  576.229543] mount[2571]: segfault at 0 ip   (null) sp bfb52e0c error
>                        4 in mount.util-linux[8048000+9000]
>         You are in emergency mode. After logging in, type "journalctl -xb" to view
>         system logs, "systemctl reboot" to reboot, "systemctl default" or "exit"
>         to boot into default mode.
>         /sbin/sulogin terminated by signal SEGV.
>         ---
>         runqemu qemux86 nographic slirp qemuparams="-m 2048"
>      4. With this patch set, I have fixed all musl related issues in my build.
>         It builds and works well. But I still have not met the error in yours.
>
>         In my case, I just start build from latest poky without any change
>         other than a few necessary kernel config fragments. I'd like to
>         reproduce your error but I can't. Could you please provide more info
>         about your build config?
>
> 0001-x86-remove-qemu-usermode-from-MACHINE_FEATURES_BACKF.patch:
>      This patch is to fix gobject-introspection do_compile.
>
>      With m32, qemu-usermode will be back filled and gobject-introspection
>      tends to use qemu-i386. Is this the way to fix? If you have no objection
>      I will commit to oe-core next.
>
> Hongzhi.Song (1):
>    kernel-selftest: Add a recipe on kernel selftest
>
>   .../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
>


[-- Attachment #2: local.conf --]
[-- Type: text/plain, Size: 17061 bytes --]


# This file is your local configuration file and is where all local user settings
# are placed. The comments in this file give some guide to the options a new user
# to the system might want to change but pretty much any configuration option can
# be set in this file. More adventurous users can look at local.conf.extended
# which contains other examples of configuration which can be placed in this file
# but new users likely won't need any of them initially.
#
# Lines starting with the '#' character are commented out and in some cases the
# default values are provided as comments to show people example syntax. Enabling
# the option is a question of removing the # character and making any change to the
# variable as required.

#
# Machine Selection
#
# You need to select a specific machine to target the build with. There are a selection
# of emulated machines available which can boot and run in the QEMU emulator:
#
#MACHINE ?= "qemuarm"
#MACHINE ?= "qemuarm64"
#MACHINE ?= "qemumips"
#MACHINE ?= "qemumips64"
#MACHINE ?= "qemuppc"
#MACHINE ?= "qemux86"
#MACHINE ?= "qemux86-64"
#
# There are also the following hardware board target machines included for 
# demonstration purposes:
#
#MACHINE ?= "beaglebone-yocto"
#MACHINE ?= "genericx86"
#MACHINE ?= "genericx86-64"
#MACHINE ?= "mpc8315e-rdb"
#MACHINE ?= "edgerouter"
#
# This sets the default machine to be qemux86 if no other machine is selected:
MACHINE ??= "qemux86"

#
# Where to place downloads
#
# During a first build the system will download many different source code tarballs
# from various upstream projects. This can take a while, particularly if your network
# connection is slow. These are all stored in DL_DIR. When wiping and rebuilding you
# can preserve this directory to speed up this part of subsequent builds. This directory
# is safe to share between multiple builds on the same machine too.
#
# The default is a downloads directory under TOPDIR which is the build directory.
#
DL_DIR ?= "${TOPDIR}/../downloads"

#
# Where to place shared-state files
#
# BitBake has the capability to accelerate builds based on previously built output.
# This is done using "shared state" files which can be thought of as cache objects
# and this option determines where those files are placed.
#
# You can wipe out TMPDIR leaving this directory intact and the build would regenerate
# from these files if no changes were made to the configuration. If changes were made
# to the configuration, only shared state files where the state was still valid would
# be used (done using checksums).
#
# The default is a sstate-cache directory under TOPDIR.
#
#SSTATE_DIR ?= "${TOPDIR}/sstate-cache"

#
# Where to place the build output
#
# This option specifies where the bulk of the building work should be done and
# where BitBake should place its temporary files and output. Keep in mind that
# this includes the extraction and compilation of many applications and the toolchain
# which can use Gigabytes of hard disk space.
#
# The default is a tmp directory under TOPDIR.
#
#TMPDIR = "${TOPDIR}/tmp"

#
# Default policy config
#
# The distribution setting controls which policy settings are used as defaults.
# The default value is fine for general Yocto project use, at least initially.
# Ultimately when creating custom policy, people will likely end up subclassing 
# these defaults.
#
DISTRO ?= "poky"
# As an example of a subclass there is a "bleeding" edge policy configuration
# where many versions are set to the absolute latest code from the upstream 
# source control systems. This is just mentioned here as an example, its not
# useful to most new users.
# DISTRO ?= "poky-bleeding"

#
# Package Management configuration
#
# This variable lists which packaging formats to enable. Multiple package backends
# can be enabled at once and the first item listed in the variable will be used
# to generate the root filesystems.
# Options are:
#  - 'package_deb' for debian style deb files
#  - 'package_ipk' for ipk files are used by opkg (a debian style embedded package manager)
#  - 'package_rpm' for rpm style packages
# E.g.: PACKAGE_CLASSES ?= "package_rpm package_deb package_ipk"
# We default to rpm:
PACKAGE_CLASSES ?= "package_rpm"

#
# SDK target architecture
#
# This variable specifies the architecture to build SDK items for and means
# you can build the SDK packages for architectures other than the machine you are
# running the build on (i.e. building i686 packages on an x86_64 host).
# Supported values are i686 and x86_64
#SDKMACHINE ?= "i686"

#
# Extra image configuration defaults
#
# The EXTRA_IMAGE_FEATURES variable allows extra packages to be added to the generated
# images. Some of these options are added to certain image types automatically. The
# variable can contain the following options:
#  "dbg-pkgs"       - add -dbg packages for all installed packages
#                     (adds symbol information for debugging/profiling)
#  "dev-pkgs"       - add -dev packages for all installed packages
#                     (useful if you want to develop against libs in the image)
#  "ptest-pkgs"     - add -ptest packages for all ptest-enabled packages
#                     (useful if you want to run the package test suites)
#  "tools-sdk"      - add development tools (gcc, make, pkgconfig etc.)
#  "tools-debug"    - add debugging tools (gdb, strace)
#  "eclipse-debug"  - add Eclipse remote debugging support
#  "tools-profile"  - add profiling tools (oprofile, lttng, valgrind)
#  "tools-testapps" - add useful testing tools (ts_print, aplay, arecord etc.)
#  "debug-tweaks"   - make an image suitable for development
#                     e.g. ssh root access has a blank password
# There are other application targets that can be used here too, see
# meta/classes/image.bbclass and meta/classes/core-image.bbclass for more details.
# We default to enabling the debugging tweaks.
EXTRA_IMAGE_FEATURES ?= "debug-tweaks"

#
# Additional image features
#
# The following is a list of additional classes to use when building images which
# enable extra features. Some available options which can be included in this variable
# are:
#   - 'buildstats' collect build statistics
#   - 'image-mklibs' to reduce shared library files size for an image
#   - 'image-prelink' in order to prelink the filesystem image
# NOTE: if listing mklibs & prelink both, then make sure mklibs is before prelink
# NOTE: mklibs also needs to be explicitly enabled for a given image, see local.conf.extended
USER_CLASSES ?= "buildstats image-mklibs image-prelink"

#
# Runtime testing of images
#
# The build system can test booting virtual machine images under qemu (an emulator)
# after any root filesystems are created and run tests against those images. To
# enable this uncomment this line. See classes/testimage(-auto).bbclass for
# further details.
#TEST_IMAGE = "1"
#
# Interactive shell configuration
#
# Under certain circumstances the system may need input from you and to do this it
# can launch an interactive shell. It needs to do this since the build is
# multithreaded and needs to be able to handle the case where more than one parallel
# process may require the user's attention. The default is iterate over the available
# terminal types to find one that works.
#
# Examples of the occasions this may happen are when resolving patches which cannot
# be applied, to use the devshell or the kernel menuconfig
#
# Supported values are auto, gnome, xfce, rxvt, screen, konsole (KDE 3.x only), none
# Note: currently, Konsole support only works for KDE 3.x due to the way
# newer Konsole versions behave
#OE_TERMINAL = "auto"
# By default disable interactive patch resolution (tasks will just fail instead):
PATCHRESOLVE = "noop"

#
# Disk Space Monitoring during the build
#
# Monitor the disk space during the build. If there is less that 1GB of space or less
# than 100K inodes in any key build location (TMPDIR, DL_DIR, SSTATE_DIR), gracefully
# shutdown the build. If there is less that 100MB or 1K inodes, perform a hard abort
# of the build. The reason for this is that running completely out of space can corrupt
# files and damages the build in ways which may not be easily recoverable.
# It's necesary to monitor /tmp, if there is no space left the build will fail
# with very exotic errors.
BB_DISKMON_DIRS ??= "\
    STOPTASKS,${TMPDIR},1G,100K \
    STOPTASKS,${DL_DIR},1G,100K \
    STOPTASKS,${SSTATE_DIR},1G,100K \
    STOPTASKS,/tmp,100M,100K \
    ABORT,${TMPDIR},100M,1K \
    ABORT,${DL_DIR},100M,1K \
    ABORT,${SSTATE_DIR},100M,1K \
    ABORT,/tmp,10M,1K"

#
# Shared-state files from other locations
#
# As mentioned above, shared state files are prebuilt cache data objects which can
# used to accelerate build time. This variable can be used to configure the system
# to search other mirror locations for these objects before it builds the data itself.
#
# This can be a filesystem directory, or a remote url such as http or ftp. These
# would contain the sstate-cache results from previous builds (possibly from other
# machines). This variable works like fetcher MIRRORS/PREMIRRORS and points to the
# cache locations to check for the shared objects.
# NOTE: if the mirror uses the same structure as SSTATE_DIR, you need to add PATH
# at the end as shown in the examples below. This will be substituted with the
# correct path within the directory structure.
#SSTATE_MIRRORS ?= "\
#file://.* http://someserver.tld/share/sstate/PATH;downloadfilename=PATH \n \
#file://.* file:///some/local/dir/sstate/PATH"

#
# Yocto Project SState Mirror
#
# The Yocto Project has prebuilt artefacts available for its releases, you can enable
# use of these by uncommenting the following line. This will mean the build uses
# the network to check for artefacts at the start of builds, which does slow it down
# equally, it will also speed up the builds by not having to build things if they are
# present in the cache. It assumes you can download something faster than you can build it
# which will depend on your network.
#
#SSTATE_MIRRORS ?= "file://.* http://sstate.yoctoproject.org/2.5/PATH;downloadfilename=PATH"

#
# Qemu configuration
#
# By default qemu will build with a builtin VNC server where graphical output can be
# seen. The two lines below enable the SDL backend too. By default libsdl2-native will
# be built, if you want to use your host's libSDL instead of the minimal libsdl built
# by libsdl2-native then uncomment the ASSUME_PROVIDED line below.
PACKAGECONFIG_append_pn-qemu-native = " sdl"
PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"
#ASSUME_PROVIDED += "libsdl2-native"

# CONF_VERSION is increased each time build/conf/ changes incompatibly and is used to
# track the version of this file when it was generated. This can safely be ignored if
# this doesn't mean anything to you.
CONF_VERSION = "1"

# We want musl and glibc to share the same tmpfs, so instead of appending default "-" we append "fs"
TCLIBCAPPEND = "fs"

#TMPDIR = "/home/jenkins/oe/world/oe-build/build/tmpfs"

#PARALLEL_MAKE = "-j 8"
#BB_NUMBER_THREADS = "16"
# INHERIT += "rm_work"
# Reminder to change it later when we have public instance
PRSERV_HOST = "localhost:0"
BB_GENERATE_MIRROR_TARBALLS = "1"
BUILDHISTORY_COMMIT ?= "1"
BUILDHISTORY_COMMIT_AUTHOR ?= "Khem Raj <raj.khem@gmail.com>"
BUILDHISTORY_PUSH_REPO ?= "origin oe-world"
INHERIT += "reproducible_build_simple"

BB_DISKMON_DIRS = "    STOPTASKS,,1G,100K     STOPTASKS,,1G,100K     STOPTASKS,,1G,100K     STOPTASKS,/tmp,100M,100K     ABORT,,100M,1K     ABORT,,100M,1K     ABORT,,100M,1K     ABORT,/tmp,10M,1K"

#require world_fixes.inc

PREFERRED_PROVIDER_udev = "systemd"
PREFERRED_PROVIDER_virtual/fftw = "fftw"

# use gold
DISTRO_FEATURES_append = " ld-is-gold"

# use ptest
DISTRO_FEATURES_append = " ptest"

# use systemd
DISTRO_FEATURES_append = " systemd"
DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
VIRTUAL-RUNTIME_init_manager = "systemd"
VIRTUAL-RUNTIME_initscripts = ""

# use opengl
DISTRO_FEATURES_append = " opengl"

# use wayland to fix building weston and qtwayland
DISTRO_FEATURES_append = " wayland"

PREFERRED_PROVIDER_jpeg = "libjpeg-turbo"
PREFERRED_PROVIDER_jpeg-native = "libjpeg-turbo-native"
PREFERRED_PROVIDER_gpsd = "gpsd"

# don't pull libhybris unless explicitly asked for
PREFERRED_PROVIDER_virtual/libgl ?= "mesa"
PREFERRED_PROVIDER_virtual/libgles1 ?= "mesa"
PREFERRED_PROVIDER_virtual/libgles2 ?= "mesa"
PREFERRED_PROVIDER_virtual/egl ?= "mesa"

# to fix fsoaudiod, alsa-state conflict in shr-image-all
VIRTUAL-RUNTIME_alsa-state = ""
# to prevent alsa-state being pulled into -dev or -dbg images
RDEPENDS_${PN}-dev_pn-alsa-state = ""
RDEPENDS_${PN}-dbg_pn-alsa-state = ""

# to fix dependency on conflicting x11-common from packagegroup-core-x11
VIRTUAL-RUNTIME_xserver_common ?= "xserver-common"
RDEPENDS_${PN}-dev_pn-x11-common = ""
RDEPENDS_${PN}-dbg_pn-x11-common = ""

# to fix apm, fso-apm conflict in shr-image-all
VIRTUAL-RUNTIME_apm = "fso-apm"

# require conf/distro/include/qt5-versions.inc
# QT5_VERSION = "5.4.0+git%"

# for qtwebkit etc
# see https://bugzilla.yoctoproject.org/show_bug.cgi?id=5013
# DEPENDS_append_pn-qtbase = " mesa"
PACKAGECONFIG_append_pn-qtbase = " icu gl accessibility freetype fontconfig"

# qtwayland doesn't like egl and xcomposite-glx enabled at the same time
# http://lists.openembedded.org/pipermail/openembedded-devel/2016-December/110444.html
PACKAGECONFIG_remove_pn-qtwayland = "xcomposite-egl xcomposite-glx"

# for webkit-efl
PACKAGECONFIG_append_pn-harfbuzz = " icu"

INHERIT += "blacklist"
# PNBLACKLIST[samsung-rfs-mgr] = "needs newer libsamsung-ipc with negative D_P: Requested 'samsung-ipc-1.0 >= 0.2' but version of libsamsung-ipc is 0.1.0"
PNBLACKLIST[android-system] = "depends on lxc from meta-virtualiazation which isn't included in my world builds"
PNBLACKLIST[bigbuckbunny-1080p] = "big and doesn't really need to be tested so much"
PNBLACKLIST[bigbuckbunny-480p] = "big and doesn't really need to be tested so much"
PNBLACKLIST[bigbuckbunny-720p] = "big and doesn't really need to be tested so much"
PNBLACKLIST[bigbuckbunny-720p] = "big and doesn't really need to be tested so much"
PNBLACKLIST[tearsofsteel-1080p] = "big and doesn't really need to be tested so much"
PNBLACKLIST[build-appliance-image] = "tries to include whole downloads directory in /home/builder/poky :/"

# enable reporting
# needs http://patchwork.openembedded.org/patch/68735/
ERR_REPORT_SERVER = "errors.yoctoproject.org"
ERR_REPORT_PORT = "80"
ERR_REPORT_USERNAME = "Khem Raj"
ERR_REPORT_EMAIL = "raj.khem@gmail.com"
ERR_REPORT_UPLOAD_FAILURES = "1"
INHERIT += "report-error"

# needs patch with buildstats-summary.bbclass
INHERIT += "buildstats buildstats-summary"

# be more strict with QA warnings, turn them all to errors:
ERROR_QA_append = " ldflags useless-rpaths rpaths staticdev libdir xorg-driver-abi             textrel already-stripped incompatible-license files-invalid             installed-vs-shipped compile-host-path install-host-path             pn-overrides infodir build-deps             unknown-configure-option symlink-to-sysroot multilib             invalid-packageconfig host-user-contaminated uppercase-pn"
WARN_QA_remove = " ldflags useless-rpaths rpaths staticdev libdir xorg-driver-abi             textrel already-stripped incompatible-license files-invalid             installed-vs-shipped compile-host-path install-host-path             pn-overrides infodir build-deps             unknown-configure-option symlink-to-sysroot multilib             invalid-packageconfig host-user-contaminated uppercase-pn"

# use musl for qemux86 and qemux86copy
TCLIBC_qemux86 = "musl"
TCLIBC_qemux86copy = "musl"

# Commericial licenses
# chromium
LICENSE_FLAGS_WHITELIST_append = " commercial_ffmpeg commercial_x264 "
# vlc
LICENSE_FLAGS_WHITELIST_append = " commercial_mpeg2dec "
# mpd
LICENSE_FLAGS_WHITELIST_append = " commercial_mpg123 "
# libmad
LICENSE_FLAGS_WHITELIST_append = " commercial_libmad "
# gstreamer1.0-libav
LICENSE_FLAGS_WHITELIST_append = " commercial_gstreamer1.0-libav "
# gstreamer1.0-omx
LICENSE_FLAGS_WHITELIST_append = " commercial_gstreamer1.0-omx "
# omapfbplay
LICENSE_FLAGS_WHITELIST_append = " commercial_lame "
# libomxil
LICENSE_FLAGS_WHITELIST_append = " commercial_libomxil "
# xfce
LICENSE_FLAGS_WHITELIST_append = " commercial_packagegroup-xfce-multimedia commercial_xfce4-mpc-plugin"
LICENSE_FLAGS_WHITELIST_append = " commercial_xfmpc commercial_mpd "
LICENSE_FLAGS_WHITELIST_append = " commercial_mpv "


IMAGE_INSTALL_append += "openssh \
                        openssh-sshd \
                        kernel-modules \
                        kernel-selftest \
                        strace \
                        sudo \
"

KERNEL_FEATURES_append += " features/kernel-sample/kernel-sample.scc \
                            cfg/debug-kselftest.scc \
                            features/hugetlb/hugetlb.scc \
"

#DISTRO_FEATURES_append = " pam"
#POKY_DEFAULT_DISTRO_FEATURES_append += "pam"
#MACHINE_FEATURES_BACKFILL_CONSIDERED_append = " qemu-usermode"

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

* Re: [OE-core][PATCH] x86: remove "qemu-usermode" from MACHINE_FEATURES_BACKFILL_CONSIDERED
  2018-07-13 14:06 ` [OE-core][PATCH] x86: remove "qemu-usermode" from MACHINE_FEATURES_BACKFILL_CONSIDERED Hongzhi.Song
@ 2018-07-13 14:13   ` Alexander Kanavin
  2018-07-14  8:44     ` Hongzhi, Song
  2018-07-13 14:59   ` akuster808
  1 sibling, 1 reply; 18+ messages in thread
From: Alexander Kanavin @ 2018-07-13 14:13 UTC (permalink / raw)
  To: Hongzhi.Song; +Cc: openembedded-devel

2018-07-13 16:06 GMT+02:00 Hongzhi.Song <hongzhi.song@windriver.com>:
> error information:
> ---
> qemu: uncaught target signal 11 (Segmentation fault) - core dumped
> If the above error message is about missing .so libraries,
> then setting up GIR_EXTRA_LIBS_PATH in the recipe should help.
> (typically like this: GIR_EXTRA_LIBS_PATH="${B}/something/.libs" )
> ---
>
> qemux86 will face the error above.

I believe this error does not happen on the autobuilder, and disabling
qemu-usermode on x86 is an unacceptable reduction in functionality. We
need to address the issue, not disable the feature.

Please provide information about your environment. Which version of
oe-core and qemu are you seeing this with?

Alex


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

* Re: [OE-core][PATCH] x86: remove "qemu-usermode" from MACHINE_FEATURES_BACKFILL_CONSIDERED
  2018-07-13 14:06 ` [OE-core][PATCH] x86: remove "qemu-usermode" from MACHINE_FEATURES_BACKFILL_CONSIDERED Hongzhi.Song
  2018-07-13 14:13   ` Alexander Kanavin
@ 2018-07-13 14:59   ` akuster808
  1 sibling, 0 replies; 18+ messages in thread
From: akuster808 @ 2018-07-13 14:59 UTC (permalink / raw)
  To: Hongzhi.Song, raj.khem, openembedded-devel



On 07/13/2018 07:06 AM, Hongzhi.Song wrote:
> error information:
> ---
> qemu: uncaught target signal 11 (Segmentation fault) - core dumped
> If the above error message is about missing .so libraries,
> then setting up GIR_EXTRA_LIBS_PATH in the recipe should help.
> (typically like this: GIR_EXTRA_LIBS_PATH="${B}/something/.libs" )
> ---
>
> qemux86 will face the error above.
Wrong ML
think it should be: openembedded-core@lists.openembedded.org
>
> Signed-off-by: Hongzhi.Song <hongzhi.song@windriver.com>
> ---
>  meta/conf/machine/include/x86/arch-x86.inc | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/meta/conf/machine/include/x86/arch-x86.inc b/meta/conf/machine/include/x86/arch-x86.inc
> index 70814b8d4d..091d60f507 100644
> --- a/meta/conf/machine/include/x86/arch-x86.inc
> +++ b/meta/conf/machine/include/x86/arch-x86.inc
> @@ -26,6 +26,7 @@ TUNE_LDARGS += "${@bb.utils.contains('TUNE_FEATURES', 'mx32', '-m elf32_x86_64',
>  TUNE_ASARGS += "${@bb.utils.contains('TUNE_FEATURES', 'mx32', '-x32', '', d)}"
>  # user mode qemu doesn't support x32
>  MACHINE_FEATURES_BACKFILL_CONSIDERED_append = " ${@bb.utils.contains('TUNE_FEATURES', 'mx32', 'qemu-usermode', '', d)}"
> +MACHINE_FEATURES_BACKFILL_CONSIDERED_append = " ${@bb.utils.contains('TUNE_FEATURES', 'm32', 'qemu-usermode', '', d)}"
>  MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'mx32', 'x86-x32:', '' ,d)}"
>  
>  # ELF64 ABI



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

* Re: [meta-oe][PATCH v2 0/1] Add a recipe on kernel selftest
  2018-07-13 14:10 ` [meta-oe][PATCH v2 0/1] Add a recipe on kernel selftest Hongzhi, Song
@ 2018-07-13 15:02   ` akuster808
  0 siblings, 0 replies; 18+ messages in thread
From: akuster808 @ 2018-07-13 15:02 UTC (permalink / raw)
  To: Hongzhi, Song, raj.khem, openembedded-devel



On 07/13/2018 07:10 AM, Hongzhi, Song wrote:
> Attachment is my local.conf

Thanks.  Do you think this might qualify for an FAQ ?
https://wiki.yoctoproject.org/wiki/Technical_FAQ


- armin
>
> --Hongzhi
>
>
> On 2018年07月13日 22:06, Hongzhi.Song wrote:
>> 0001-kernel-selftest-Add-a-recipe-on-kernel-selftest.patch:
>>      1. This patch add support for musl libc.
>>      2. I don't reproduce the error about Makefile with your auto.conf.
>>      3. Boot failed using your auto.conf with error:
>>         ---
>>         [  576.229543] mount[2571]: segfault at 0 ip   (null) sp
>> bfb52e0c error
>>                        4 in mount.util-linux[8048000+9000]
>>         You are in emergency mode. After logging in, type "journalctl
>> -xb" to view
>>         system logs, "systemctl reboot" to reboot, "systemctl
>> default" or "exit"
>>         to boot into default mode.
>>         /sbin/sulogin terminated by signal SEGV.
>>         ---
>>         runqemu qemux86 nographic slirp qemuparams="-m 2048"
>>      4. With this patch set, I have fixed all musl related issues in
>> my build.
>>         It builds and works well. But I still have not met the error
>> in yours.
>>
>>         In my case, I just start build from latest poky without any
>> change
>>         other than a few necessary kernel config fragments. I'd like to
>>         reproduce your error but I can't. Could you please provide
>> more info
>>         about your build config?
>>
>> 0001-x86-remove-qemu-usermode-from-MACHINE_FEATURES_BACKF.patch:
>>      This patch is to fix gobject-introspection do_compile.
>>
>>      With m32, qemu-usermode will be back filled and
>> gobject-introspection
>>      tends to use qemu-i386. Is this the way to fix? If you have no
>> objection
>>      I will commit to oe-core next.
>>
>> Hongzhi.Song (1):
>>    kernel-selftest: Add a recipe on kernel selftest
>>
>>   .../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
>>
>
>
>



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

* Re: [meta-oe][PATCH 1/1] kernel-selftest: Add a recipe on kernel selftest
  2018-07-13 14:06 ` [meta-oe][PATCH 1/1] kernel-selftest: " Hongzhi.Song
@ 2018-07-13 16:23   ` Burton, Ross
  2018-07-16  9:53     ` Hongzhi, Song
  0 siblings, 1 reply; 18+ messages in thread
From: Burton, Ross @ 2018-07-13 16:23 UTC (permalink / raw)
  To: Hongzhi.Song; +Cc: OpenEmbedded Devel List

On 13 July 2018 at 15:06, Hongzhi.Song <hongzhi.song@windriver.com> 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


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

* Re: [OE-core][PATCH] x86: remove "qemu-usermode" from MACHINE_FEATURES_BACKFILL_CONSIDERED
  2018-07-13 14:13   ` Alexander Kanavin
@ 2018-07-14  8:44     ` Hongzhi, Song
  0 siblings, 0 replies; 18+ messages in thread
From: Hongzhi, Song @ 2018-07-14  8:44 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: openembedded-devel



On 2018年07月13日 22:13, Alexander Kanavin wrote:
> 2018-07-13 16:06 GMT+02:00 Hongzhi.Song <hongzhi.song@windriver.com>:
>> error information:
>> ---
>> qemu: uncaught target signal 11 (Segmentation fault) - core dumped
>> If the above error message is about missing .so libraries,
>> then setting up GIR_EXTRA_LIBS_PATH in the recipe should help.
>> (typically like this: GIR_EXTRA_LIBS_PATH="${B}/something/.libs" )
>> ---
>>
>> qemux86 will face the error above.
> I believe this error does not happen on the autobuilder, and disabling
> qemu-usermode on x86 is an unacceptable reduction in functionality. We
> need to address the issue, not disable the feature.
>
> Please provide information about your environment. Which version of
> oe-core and qemu are you seeing this with?

qemux86
poky: master
local.conf is attached in cover-letter.
Others are default.

--Hongzhi

> Alex
>



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

* Re: [meta-oe][PATCH 1/1] kernel-selftest: Add a recipe on kernel selftest
  2018-07-13 16:23   ` Burton, Ross
@ 2018-07-16  9:53     ` Hongzhi, Song
  2018-07-27  8:40       ` Khem Raj
  0 siblings, 1 reply; 18+ messages in thread
From: Hongzhi, Song @ 2018-07-16  9:53 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OpenEmbedded Devel List



On 2018年07月14日 00:23, Burton, Ross wrote:
> On 13 July 2018 at 15:06, Hongzhi.Song <hongzhi.song@windriver.com> 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
>



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

* Re: [meta-oe][PATCH v2 0/1] Add a recipe on kernel selftest
  2018-07-13 14:06 [meta-oe][PATCH v2 0/1] Add a recipe on kernel selftest Hongzhi.Song
                   ` (2 preceding siblings ...)
  2018-07-13 14:10 ` [meta-oe][PATCH v2 0/1] Add a recipe on kernel selftest Hongzhi, Song
@ 2018-07-16 10:04 ` Hongzhi, Song
  3 siblings, 0 replies; 18+ messages in thread
From: Hongzhi, Song @ 2018-07-16 10:04 UTC (permalink / raw)
  To: raj.khem, openembedded-devel


On 2018年07月13日 22:06, Hongzhi.Song wrote:
> 0001-kernel-selftest-Add-a-recipe-on-kernel-selftest.patch:
>      1. This patch add support for musl libc.
>      2. I don't reproduce the error about Makefile with your auto.conf.
Hi all,

I really can not reproduce the error with either my own local.conf or 
Khem's.
The errors I encountered is different with Khem using Khem's conf.

>      3. Boot failed using your auto.conf with error:
>         ---
>         [  576.229543] mount[2571]: segfault at 0 ip   (null) sp bfb52e0c error
>                        4 in mount.util-linux[8048000+9000]
>         You are in emergency mode. After logging in, type "journalctl -xb" to view
>         system logs, "systemctl reboot" to reboot, "systemctl default" or "exit"
>         to boot into default mode.
>         /sbin/sulogin terminated by signal SEGV.
>         ---
>         runqemu qemux86 nographic slirp qemuparams="-m 2048"
>      4. With this patch set, I have fixed all musl related issues in my build.
>         It builds and works well. But I still have not met the error in yours.
>
>         In my case, I just start build from latest poky without any change
>         other than a few necessary kernel config fragments. I'd like to
>         reproduce your error but I can't. Could you please provide more info
>         about your build config?
>
> 0001-x86-remove-qemu-usermode-from-MACHINE_FEATURES_BACKF.patch:
>      This patch is to fix gobject-introspection do_compile.
>
>      With m32, qemu-usermode will be back filled and gobject-introspection
>      tends to use qemu-i386. Is this the way to fix? If you have no objection
>      I will commit to oe-core next.

Gobject-introspection is disable using default conf when setup a new 
poky project.
So gobject-introspection is enabled by uncertain configuration add by Khem.
And then, this error maybe has no relation with my recipe.

--Hongzhi

>
> Hongzhi.Song (1):
>    kernel-selftest: Add a recipe on kernel selftest
>
>   .../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
>



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

* Re: [meta-oe][PATCH 1/1] kernel-selftest: Add a recipe on kernel selftest
  2018-07-16  9:53     ` Hongzhi, Song
@ 2018-07-27  8:40       ` Khem Raj
  2018-07-27  9:00         ` Hongzhi, Song
  0 siblings, 1 reply; 18+ messages in thread
From: Khem Raj @ 2018-07-27  8:40 UTC (permalink / raw)
  To: Hongzhi.Song; +Cc: openembeded-devel

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
<hongzhi.song@windriver.com> wrote:
>
>
>
> On 2018年07月14日 00:23, Burton, Ross wrote:
> > On 13 July 2018 at 15:06, Hongzhi.Song <hongzhi.song@windriver.com> 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
> >
>


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

* Re: [meta-oe][PATCH 1/1] kernel-selftest: Add a recipe on kernel selftest
  2018-07-27  8:40       ` Khem Raj
@ 2018-07-27  9:00         ` Hongzhi, Song
  2018-07-30  3:36           ` Hongzhi, Song
  0 siblings, 1 reply; 18+ messages in thread
From: Hongzhi, Song @ 2018-07-27  9:00 UTC (permalink / raw)
  To: Khem Raj; +Cc: openembeded-devel

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
> <hongzhi.song@windriver.com> wrote:
>>
>>
>> On 2018年07月14日 00:23, Burton, Ross wrote:
>>> On 13 July 2018 at 15:06, Hongzhi.Song <hongzhi.song@windriver.com> 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
>>>



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

* Re: [meta-oe][PATCH 1/1] kernel-selftest: Add a recipe on kernel selftest
  2018-07-27  9:00         ` Hongzhi, Song
@ 2018-07-30  3:36           ` Hongzhi, Song
  2018-07-30  4:02             ` Khem Raj
  0 siblings, 1 reply; 18+ messages in thread
From: Hongzhi, Song @ 2018-07-30  3:36 UTC (permalink / raw)
  To: Khem Raj; +Cc: openembeded-devel

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
>> <hongzhi.song@windriver.com> wrote:
>>>
>>>
>>> On 2018年07月14日 00:23, Burton, Ross wrote:
>>>> On 13 July 2018 at 15:06, Hongzhi.Song <hongzhi.song@windriver.com> 
>>>> 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
>>>>
>



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

* Re: [meta-oe][PATCH 1/1] kernel-selftest: Add a recipe on kernel selftest
  2018-07-30  3:36           ` Hongzhi, Song
@ 2018-07-30  4:02             ` Khem Raj
  2018-07-30 12:14               ` Hongzhi, Song
  0 siblings, 1 reply; 18+ messages in thread
From: Khem Raj @ 2018-07-30  4:02 UTC (permalink / raw)
  To: Hongzhi, Song; +Cc: openembeded-devel

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 <hongzhi.song@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
> >> <hongzhi.song@windriver.com> wrote:
> >>>
> >>>
> >>> On 2018年07月14日 00:23, Burton, Ross wrote:
> >>>> On 13 July 2018 at 15:06, Hongzhi.Song <hongzhi.song@windriver.com>
> >>>> 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
> >>>>
> >
>
>


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

* Re: [meta-oe][PATCH 1/1] kernel-selftest: Add a recipe on kernel selftest
  2018-07-30  4:02             ` Khem Raj
@ 2018-07-30 12:14               ` Hongzhi, Song
  2018-07-30 18:38                 ` Khem Raj
  0 siblings, 1 reply; 18+ messages in thread
From: Hongzhi, Song @ 2018-07-30 12:14 UTC (permalink / raw)
  To: Khem Raj; +Cc: openembeded-devel

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 
> <hongzhi.song@windriver.com <mailto:hongzhi.song@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
>     >> <hongzhi.song@windriver.com
>     <mailto:hongzhi.song@windriver.com>> wrote:
>     >>>
>     >>>
>     >>> On 2018年07月14日 00:23, Burton, Ross wrote:
>     >>>> On 13 July 2018 at 15:06, Hongzhi.Song
>     <hongzhi.song@windriver.com <mailto:hongzhi.song@windriver.com>>
>     >>>> 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
>     >>>>
>     >
>



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

* Re: [meta-oe][PATCH 1/1] kernel-selftest: Add a recipe on kernel selftest
  2018-07-30 12:14               ` Hongzhi, Song
@ 2018-07-30 18:38                 ` Khem Raj
  2018-07-31 11:14                   ` Hongzhi, Song
  0 siblings, 1 reply; 18+ messages in thread
From: Khem Raj @ 2018-07-30 18:38 UTC (permalink / raw)
  To: Hongzhi, Song; +Cc: openembeded-devel

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 <hongzhi.song@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 <hongzhi.song@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
>> >> <hongzhi.song@windriver.com> wrote:
>> >>>
>> >>>
>> >>> On 2018年07月14日 00:23, Burton, Ross wrote:
>> >>>> On 13 July 2018 at 15:06, Hongzhi.Song <hongzhi.song@windriver.com>
>> >>>> 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
>> >>>>
>> >
>>
>>
>


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

* Re: [meta-oe][PATCH 1/1] kernel-selftest: Add a recipe on kernel selftest
  2018-07-30 18:38                 ` Khem Raj
@ 2018-07-31 11:14                   ` Hongzhi, Song
  0 siblings, 0 replies; 18+ messages in thread
From: Hongzhi, Song @ 2018-07-31 11:14 UTC (permalink / raw)
  To: Khem Raj; +Cc: openembeded-devel

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 
> <hongzhi.song@windriver.com <mailto:hongzhi.song@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
>     <http://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
>>     <hongzhi.song@windriver.com <mailto:hongzhi.song@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
>>         >>
>>         '/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
>>         >> <hongzhi.song@windriver.com
>>         <mailto:hongzhi.song@windriver.com>> wrote:
>>         >>>
>>         >>>
>>         >>> On 2018年07月14日 00:23, Burton, Ross wrote:
>>         >>>> On 13 July 2018 at 15:06, Hongzhi.Song
>>         <hongzhi.song@windriver.com <mailto:hongzhi.song@windriver.com>>
>>         >>>> 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
>>         >>>>
>>         >
>>
>



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

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

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-13 14:06 [meta-oe][PATCH v2 0/1] Add a recipe on kernel selftest Hongzhi.Song
2018-07-13 14:06 ` [meta-oe][PATCH 1/1] kernel-selftest: " Hongzhi.Song
2018-07-13 16:23   ` Burton, Ross
2018-07-16  9:53     ` Hongzhi, Song
2018-07-27  8:40       ` Khem Raj
2018-07-27  9:00         ` Hongzhi, Song
2018-07-30  3:36           ` Hongzhi, Song
2018-07-30  4:02             ` Khem Raj
2018-07-30 12:14               ` Hongzhi, Song
2018-07-30 18:38                 ` Khem Raj
2018-07-31 11:14                   ` Hongzhi, Song
2018-07-13 14:06 ` [OE-core][PATCH] x86: remove "qemu-usermode" from MACHINE_FEATURES_BACKFILL_CONSIDERED Hongzhi.Song
2018-07-13 14:13   ` Alexander Kanavin
2018-07-14  8:44     ` Hongzhi, Song
2018-07-13 14:59   ` akuster808
2018-07-13 14:10 ` [meta-oe][PATCH v2 0/1] Add a recipe on kernel selftest Hongzhi, Song
2018-07-13 15:02   ` akuster808
2018-07-16 10:04 ` Hongzhi, Song

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.