* Re: why does OE's systemd have a hard dependency on qemu-native?
From: Burton, Ross @ 2016-12-13 10:48 UTC (permalink / raw)
To: Robert P. J. Day; +Cc: OE Core mailing list
In-Reply-To: <alpine.LFD.2.20.1612130530170.7395@localhost.localdomain>
[-- Attachment #1: Type: text/plain, Size: 1255 bytes --]
On 13 December 2016 at 10:34, Robert P. J. Day <rpjday@crashcourse.ca>
wrote:
> DEPENDS = "kmod intltool-native gperf-native acl readline libcap
> libcgroup qemu-native util-linux"
> ^^^^^^^^^^^ ?
>
> now, i *am* building for qemuppc for testing, but the above is an
> unconditional dependency on qemu-native. what does systemd need
> qemu-native for?
>
> right below, we read:
>
> inherit ... qemu ...
>
> so, again, qemu. yet a bit further down:
>
Using the qemu class means you generally need to depend on qemu-native.
SRC_URI_append_qemuall = "
> file://0001-core-device.c-Change-the-default-device-timeout-to-2.patch"
>
> so now SRC_URI is modified *conditionally* based on qemuall.
>
This is a MACHINE-specific tweak for qemu machines, and unrelated to the
qemu class.
Carry on searching for qemu:
pkg_postinst_udev-hwdb () {
if test -n "$D"; then
${@qemu_run_binary(d, '$D', '${base_bindir}/udevadm')} hwdb
--update \
--root $D
chown root:root $D${sysconfdir}/udev/hwdb.bin
else
udevadm hwdb --update
fi
}
There is a rootfs-time postinst that uses qemu-user to run hwdb.
Ross
[-- Attachment #2: Type: text/html, Size: 2635 bytes --]
^ permalink raw reply
* why does OE's systemd have a hard dependency on qemu-native?
From: Robert P. J. Day @ 2016-12-13 10:34 UTC (permalink / raw)
To: OE Core mailing list
currently messing with systemd-coredump and, in systemd_232.bb, i
see:
DEPENDS = "kmod intltool-native gperf-native acl readline libcap
libcgroup qemu-native util-linux"
^^^^^^^^^^^ ?
now, i *am* building for qemuppc for testing, but the above is an
unconditional dependency on qemu-native. what does systemd need
qemu-native for?
right below, we read:
inherit ... qemu ...
so, again, qemu. yet a bit further down:
SRC_URI_append_qemuall = "
file://0001-core-device.c-Change-the-default-device-timeout-to-2.patch"
so now SRC_URI is modified *conditionally* based on qemuall.
can someone clarify what relationship systemd has with qemu?
rday
--
========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================
^ permalink raw reply
* Re: [PATCH] glibc: add -fno-builtin-strlen when not using -O2
From: Andre McCurdy @ 2016-12-13 9:16 UTC (permalink / raw)
To: Huang, Jie (Jackie); +Cc: Patches and discussions about the oe-core layer
In-Reply-To: <1B858668EC6A94408DCA5225FDFA85AA013DE4A0F6@ALA-MBA.corp.ad.wrs.com>
On Mon, Dec 12, 2016 at 9:14 PM, Huang, Jie (Jackie)
<Jackie.Huang@windriver.com> wrote:
>> From: Andre McCurdy [mailto:armccurdy@gmail.com]
>> For reference, here's the patch I've been using. It's a slightly more
>> generic fix than the one in the KDE bug report.
>
> Thanks, It's a better patch and I will take it and send as v2 of this issue if you're
> not going to send it yourself, is it fine for you and could you provide extra info
> for the patch header like, upstream-status, written by or Signed-off-by?
Sure. I forget why I didn't submit this at the time. The full patch is:
From d34e2a50ca5493f5a0ce9ccad83a36ac33689266 Mon Sep 17 00:00:00 2001
From: Andre McCurdy <armccurdy@gmail.com>
Date: Fri, 12 Feb 2016 18:22:12 -0800
Subject: [PATCH] make ld-XXX.so strlen intercept optional
Hack: Depending on how glibc was compiled (e.g. optimised for size or
built with _FORTIFY_SOURCE enabled) the strlen symbol might not be
found in ld-XXX.so. Therefore although we should still try to
intercept it, don't make it mandatory to do so.
Upstream-Status: Inappropriate
Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
---
coregrind/m_redir.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/coregrind/m_redir.c b/coregrind/m_redir.c
index 7e4df8d..640a346 100644
--- a/coregrind/m_redir.c
+++ b/coregrind/m_redir.c
@@ -1220,7 +1220,18 @@ static void add_hardwired_spec (const HChar*
sopatt, const HChar* fnpatt,
spec->from_fnpatt = CONST_CAST(HChar *,fnpatt);
spec->to_addr = to_addr;
spec->isWrap = False;
- spec->mandatory = mandatory;
+
+ /* Hack: Depending on how glibc was compiled (e.g. optimised for size or
+ built with _FORTIFY_SOURCE enabled) the strlen symbol might not be found.
+ Therefore although we should still try to intercept it, don't make it
+ mandatory to do so. We over-ride "mandatory" here to avoid the need to
+ patch the many different architecture specific callers to
+ add_hardwired_spec(). */
+ if (0==VG_(strcmp)("strlen", fnpatt))
+ spec->mandatory = NULL;
+ else
+ spec->mandatory = mandatory;
+
/* VARIABLE PARTS */
spec->mark = False; /* not significant */
spec->done = False; /* not significant */
--
1.9.1
^ permalink raw reply related
* [PATCH] libepoxy: move to tip of Emmanuele Bassi's fork
From: Andreas Müller @ 2016-12-13 9:09 UTC (permalink / raw)
To: openembedded-core
* fixes starting of kde-plasma for wayland:
| No provider of glGenFramebuffers found. Requires one of:
| Desktop OpenGL 3.0
| GL extension "GL_ARB_framebuffer_object"
| OpenGL ES 2.0
| GL extension "GL_EXT_framebuffer_object"
| /usr/bin/startplasmacompositor: line 223: 787 Aborted (core dumped) /usr/bin/kwin_wayland --xwayland --libinput --exit-with-session=/usr/libexec/startplasma
* fixes some strange behavour on kde-plasma for x11: Black screen on logout /
Lock screen does not return.
* Eric Anholt seems to have passed maintainership of libepoxy over to
Yaron Cohen-Tal. I agree that things didn't really turn out well since then [1].
* 0001-select-platforms-based-on-configuration-results.patch and
0002-add-an-option-to-disable-glx-support.patch wre replaced by
0001-make-x11-support-optional.patch
[1] https://github.com/ebassi/libepoxy/commit/8dead45cb366bf5c08539bef2ccaa36b80eb1483
Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
---
....patch => 0001-make-x11-support-optional.patch} | 87 +++++++++-------------
...0002-add-an-option-to-disable-glx-support.patch | 42 -----------
meta/recipes-graphics/libepoxy/libepoxy_git.bb | 9 +--
3 files changed, 40 insertions(+), 98 deletions(-)
rename meta/recipes-graphics/libepoxy/libepoxy/{0001-select-platforms-based-on-configuration-results.patch => 0001-make-x11-support-optional.patch} (55%)
delete mode 100644 meta/recipes-graphics/libepoxy/libepoxy/0002-add-an-option-to-disable-glx-support.patch
diff --git a/meta/recipes-graphics/libepoxy/libepoxy/0001-select-platforms-based-on-configuration-results.patch b/meta/recipes-graphics/libepoxy/libepoxy/0001-make-x11-support-optional.patch
similarity index 55%
rename from meta/recipes-graphics/libepoxy/libepoxy/0001-select-platforms-based-on-configuration-results.patch
rename to meta/recipes-graphics/libepoxy/libepoxy/0001-make-x11-support-optional.patch
index 674c8e8..7b08fd1 100644
--- a/meta/recipes-graphics/libepoxy/libepoxy/0001-select-platforms-based-on-configuration-results.patch
+++ b/meta/recipes-graphics/libepoxy/libepoxy/0001-make-x11-support-optional.patch
@@ -1,38 +1,52 @@
-From 3a93150bc0aec86afdb7d053247dc2448925e09a Mon Sep 17 00:00:00 2001
+From f08cd639eb731c0d8fdbbba9e4beb1041c07e0c2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
-Date: Wed, 6 May 2015 10:45:22 +0200
-Subject: [PATCH 1/2] select platforms based on configuration results
+Date: Tue, 13 Dec 2016 00:01:47 +0100
+Subject: [PATCH] make x11 support optional
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
-Upstream-Status: Submitted [1]
+X11 support is build by default if x11 libs are found. This can be disabled
+by --disable-glx.
+
+A similar (bit too overenthusiastic) pull request was sent long time ago [1]
+before we saw cmake trouble. There was a follow up PR in [2] but I cannot test
+it so took only very common parts.
+
+Upstream-Status: Submitted [3]
[1] https://github.com/anholt/libepoxy/pull/52
+[2] https://github.com/anholt/libepoxy/pull/81
+[3] https://github.com/ebassi/libepoxy/pull/1
Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
---
- configure.ac | 13 +++++--------
- src/dispatch_common.c | 9 ++++++---
- src/dispatch_common.h | 9 +++++----
- 3 files changed, 16 insertions(+), 15 deletions(-)
+ configure.ac | 18 ++++++++++--------
+ src/dispatch_common.c | 5 ++++-
+ src/dispatch_common.h | 3 ++-
+ 3 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/configure.ac b/configure.ac
-index a52fc58..bdd70da 100644
+index 2d67726..3df9966 100644
--- a/configure.ac
+++ b/configure.ac
-@@ -58,6 +58,10 @@ AC_CHECK_HEADER([KHR/khrplatform.h],
+@@ -58,6 +58,15 @@ AC_CHECK_HEADER([KHR/khrplatform.h],
# uintptr_t to a void *") by default. Kill that.
XORG_TESTSET_CFLAG(CWARNFLAGS, [-Wno-int-conversion])
-+PKG_CHECK_MODULES(X11, [x11], [x11=yes], [x11=no])
++AC_ARG_ENABLE([glx],
++ [AS_HELP_STRING([--disable-glx],
++ [disable if you do not want x11/glx support])],
++ [enable_glx=$enableval],
++ [enable_glx=yes]
++ )
+
-+AM_CONDITIONAL(HAVE_X11, test x$x11 = xyes)
++PKG_CHECK_MODULES(X11, [x11], [x11=$enable_glx], [x11=no])
+
has_znow=yes
case $host_os in
-@@ -86,7 +90,7 @@ case $host_os in
+@@ -86,7 +95,7 @@ case $host_os in
;;
*)
build_egl=yes
@@ -41,7 +55,7 @@ index a52fc58..bdd70da 100644
build_wgl=no
# On platforms with dlopen, we load everything dynamically and
# don't link against a specific window system or GL implementation.
-@@ -144,13 +148,6 @@ esac
+@@ -144,13 +153,6 @@ esac
AC_SUBST([VISIBILITY_CFLAGS])
@@ -56,10 +70,10 @@ index a52fc58..bdd70da 100644
AC_CONFIG_FILES([
diff --git a/src/dispatch_common.c b/src/dispatch_common.c
-index 4e34d6e..2ab84ed 100644
+index c0c7156..a2699d2 100644
--- a/src/dispatch_common.c
+++ b/src/dispatch_common.c
-@@ -615,10 +615,13 @@ epoxy_get_proc_address(const char *name)
+@@ -643,9 +643,12 @@ epoxy_get_proc_address(const char *name)
#elif defined(__APPLE__)
return epoxy_gl_dlsym(name);
#else
@@ -69,29 +83,15 @@ index 4e34d6e..2ab84ed 100644
- } else {
+ } else
+#endif /* PLATFORM_HAS_GLX */
- #if PLATFORM_HAS_EGL
+ {
+ #if PLATFORM_HAS_EGL
GLenum egl_api = epoxy_egl_get_current_gl_context_api();
- switch (egl_api) {
-@@ -628,10 +631,10 @@ epoxy_get_proc_address(const char *name)
- case EGL_NONE:
- break;
- }
--#endif
- }
-+#endif /* PLATFORM_HAS_EGL */
- errx(1, "Couldn't find current GLX or EGL context.\n");
--#endif
-+#endif /* _WIN32 | __APPLE__*/
- }
-
- void
diff --git a/src/dispatch_common.h b/src/dispatch_common.h
-index 6b8503a..82681e4 100644
+index 676a4d5..1c487eb 100644
--- a/src/dispatch_common.h
+++ b/src/dispatch_common.h
-@@ -21,12 +21,13 @@
+@@ -21,6 +21,7 @@
* IN THE SOFTWARE.
*/
@@ -99,30 +99,15 @@ index 6b8503a..82681e4 100644
#include <stdbool.h>
#ifdef _WIN32
- #define PLATFORM_HAS_EGL 0
- #define PLATFORM_HAS_GLX 0
--#define PLATFORM_HAS_WGL 1
-+#define PLATFORM_HAS_WGL BUILD_WGL
- #define EPOXY_IMPORTEXPORT __declspec(dllexport)
- #elif defined(__APPLE__)
- #define PLATFORM_HAS_EGL 0
-@@ -34,13 +35,13 @@
- #define PLATFORM_HAS_WGL 0
- #define EPOXY_IMPORTEXPORT
- #elif defined(ANDROID)
--#define PLATFORM_HAS_EGL 1
-+#define PLATFORM_HAS_EGL BUILD_EGL
- #define PLATFORM_HAS_GLX 0
- #define PLATFORM_HAS_WGL 0
+@@ -40,7 +41,7 @@
#define EPOXY_IMPORTEXPORT
#else
--#define PLATFORM_HAS_EGL 1
+ #define PLATFORM_HAS_EGL 1
-#define PLATFORM_HAS_GLX 1
-+#define PLATFORM_HAS_EGL BUILD_EGL
+#define PLATFORM_HAS_GLX BUILD_GLX
#define PLATFORM_HAS_WGL 0
#define EPOXY_IMPORTEXPORT
#endif
--
-1.9.3
+2.5.5
diff --git a/meta/recipes-graphics/libepoxy/libepoxy/0002-add-an-option-to-disable-glx-support.patch b/meta/recipes-graphics/libepoxy/libepoxy/0002-add-an-option-to-disable-glx-support.patch
deleted file mode 100644
index 262d684..0000000
--- a/meta/recipes-graphics/libepoxy/libepoxy/0002-add-an-option-to-disable-glx-support.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 24868cbfb9dda5f6929dd277c47d35df016e8754 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
-Date: Wed, 6 May 2015 11:05:48 +0200
-Subject: [PATCH 2/2] add an option to disable glx support
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-this option would help us in yocto to get deterministic build results
-
-Upstream-Status: Submitted [1]
-
-[1] https://github.com/anholt/libepoxy/pull/52
-
-Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
----
- configure.ac | 9 ++++++++-
- 1 file changed, 8 insertions(+), 1 deletion(-)
-
-diff --git a/configure.ac b/configure.ac
-index bdd70da..6c7153d 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -58,7 +58,14 @@ AC_CHECK_HEADER([KHR/khrplatform.h],
- # uintptr_t to a void *") by default. Kill that.
- XORG_TESTSET_CFLAG(CWARNFLAGS, [-Wno-int-conversion])
-
--PKG_CHECK_MODULES(X11, [x11], [x11=yes], [x11=no])
-+AC_ARG_ENABLE([glx],
-+ [AS_HELP_STRING([--disable-glx],
-+ [disable if you don't want x11/glx support])],
-+ [],
-+ [enable_glx=yes]
-+ )
-+
-+PKG_CHECK_MODULES(X11, [x11], [x11=$enable_glx], [x11=no])
-
- AM_CONDITIONAL(HAVE_X11, test x$x11 = xyes)
-
---
-1.9.3
-
diff --git a/meta/recipes-graphics/libepoxy/libepoxy_git.bb b/meta/recipes-graphics/libepoxy/libepoxy_git.bb
index 6c247cc..54f9ef9 100644
--- a/meta/recipes-graphics/libepoxy/libepoxy_git.bb
+++ b/meta/recipes-graphics/libepoxy/libepoxy_git.bb
@@ -7,13 +7,12 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=58ef4c80d401e07bd9ee8b6b58cf464b"
SRC_URI = " \
- git://github.com/anholt/libepoxy.git \
- file://0001-select-platforms-based-on-configuration-results.patch \
- file://0002-add-an-option-to-disable-glx-support.patch \
+ git://github.com/ebassi/libepoxy.git \
+ file://0001-make-x11-support-optional.patch \
file://no-need-for-python3.patch \
"
-SRCREV="e2c33af5bfcfc9d168f9e776156dd47c33f428b3"
-PV = "1.3.1"
+SRCREV="269b4690b9222f53f24c3b97becebab8f8f6bbcb"
+PV = "1.3.1+git${SRCPV}"
S = "${WORKDIR}/git"
--
2.7.4
^ permalink raw reply related
* Re: can "IMAGE_INSTALL ?= ..." not be written in a more obvious way?
From: Peter Kjellerstedt @ 2016-12-13 8:52 UTC (permalink / raw)
To: Khem Raj, Robert P. J. Day; +Cc: OE Core mailing list
In-Reply-To: <CAMKF1sp_R_qapapbcZ8mu-b1BumWekvKjA-QXUDLOTSWgOoXQA@mail.gmail.com>
> -----Original Message-----
> From: openembedded-core-bounces@lists.openembedded.org
> [mailto:openembedded-core-bounces@lists.openembedded.org] On Behalf Of
> Khem Raj
> Sent: den 10 december 2016 22:16
> To: Robert P. J. Day
> Cc: OE Core mailing list
> Subject: Re: [OE-core] can "IMAGE_INSTALL ?= ..." not be written in a
> more obvious way?
>
> On Sat, Dec 10, 2016 at 3:40 AM, Robert P. J. Day
> <rpjday@crashcourse.ca> wrote:
> >
> > i've nattered about this before but not sure i ever got an answer --
> > here's the last bit of core-image.bbclass:
> >
> > CORE_IMAGE_BASE_INSTALL = '\
> > packagegroup-core-boot \
> > packagegroup-base-extended \
> > \
> > ${CORE_IMAGE_EXTRA_INSTALL} \
> > '
> >
> > CORE_IMAGE_EXTRA_INSTALL ?= ""
> >
> > IMAGE_INSTALL ?= "${CORE_IMAGE_BASE_INSTALL}"
> >
> > the first time i saw that (long ago), it took me a few looks to figure
> > out what was happening. can this not be written in a more obvious way:
> >
> > CORE_IMAGE_BASE_INSTALL = '\
> > packagegroup-core-boot \
> > packagegroup-base-extended \
> > '
> >
> > CORE_IMAGE_EXTRA_INSTALL ?= ""
> >
> > IMAGE_INSTALL ?= " \
> > ${CORE_IMAGE_BASE_INSTALL} \
> > ${CORE_IMAGE_EXTRA_INSTALL} \
> > "
> >
> > is that not equivalent, or am i missing something? it's certainly
> > clearer as to what's happening if people are perusing the code.
>
> They are same AFAICT, dont feel strongly about readability but feel
> free to send a patch
Careful now. Changing these can affect image recipes outside of OE-core.
If one has an image recipe that inherits core-image and then defines
IMAGE_INSTALL = "${CORE_IMAGE_BASE_INSTALL} my-own-packages ..."
then changing CORE_IMAGE_BASE_INSTALL as per above would suddenly
cause that image to miss including packages that it previously did.
I recommend leaving it as is.
//Peter
^ permalink raw reply
* Re: [PATCH] busybox: allow libiproute to handle table ids larger than 255
From: Burton, Ross @ 2016-12-13 8:40 UTC (permalink / raw)
To: André Draszik; +Cc: OE-core
In-Reply-To: <20161212154016.1076-1-git@andred.net>
[-- Attachment #1: Type: text/plain, Size: 388 bytes --]
On 12 December 2016 at 15:40, André Draszik <git@andred.net> wrote:
> ++ printf("table %s ", rtnl_rttable_n2a(tid));
>
Sorry but this doesn't build here:
| networking/libiproute/lib.a(iproute.o): In function `print_route':
|
/usr/src/debug/busybox/1.24.1-r0/busybox-1.24.1/networking/libiproute/iproute.c:294:
undefined reference to `rtnl_rttable_n2a'
Ross
[-- Attachment #2: Type: text/html, Size: 995 bytes --]
^ permalink raw reply
* Re: [PATCH V2 4/4] package.bbclass: support persistent /var/log
From: Patrick Ohly @ 2016-12-13 8:38 UTC (permalink / raw)
To: Chen Qi; +Cc: openembedded-core
In-Reply-To: <6c128696461dd6e37818cbad168a048575b97f5a.1481616098.git.Qi.Chen@windriver.com>
On Tue, 2016-12-13 at 16:04 +0800, Chen Qi wrote:
> - fs_perms_tables = 'files/fs-perms.txt'
> + fs_perms_tables = ['files/fs-perms-persistent-log.txt',
> 'files/fs-perms.txt'][d.getVar('VOLATILE_LOG_DIR', True) == 'yes']
Now that the rest of the changes treat VOLATILE_LOG_DIR as a boolean,
this code here also needs to be changed. Otherwise VOLATILE_LOG_DIR=1 or
VOLATILE_LOG_DIR=y won't work correctly.
You might also want to change the description of the variable in the
first patch to mention those other values.
--
Best Regards, Patrick Ohly
The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.
^ permalink raw reply
* Re: [PATCH 2/8] oeqa/sdkext/devtool.py: remove workspace/sources before running test cases
From: Robert Yang @ 2016-12-13 8:31 UTC (permalink / raw)
To: Paul Eggleton
Cc: Francisco Pedraza, Limon, Anibal, Lopez, Mariano,
openembedded-core
In-Reply-To: <1611902.KszYoSQub8@peggleto-mobl.ger.corp.intel.com>
On 12/13/2016 04:21 PM, Paul Eggleton wrote:
> On Tue, 13 Dec 2016 14:47:10 Robert Yang wrote:
>> On 12/13/2016 02:29 PM, Paul Eggleton wrote:
>>> On Tue, 13 Dec 2016 13:56:05 Robert Yang wrote:
>>>> On 12/13/2016 12:45 PM, Paul Eggleton wrote:
>>>>> It seems to me that's what's missing here is a proper teardown process
>>>>> like we have for oe-selftest, so that tests clean up after themselves
>>>>> whether they succeed or fail. I'm unsure as to whether that is part of
>>>>> the plan for the new QA refactoring though.
>>>>
>>>> There is already a 'devtool reset' which can do the cleanup, but it
>>>> can't remove sources as I said in the commit log.
>>>
>>> devtool reset not deleting the source tree is intentional - I don't want
>>
>> Add an option like "devtool reset --force" ? When I met the error, the first
>> I did was check "devtool reset", but there is no way to remove resources,
>> so I have to remove it here to allow multilib test cases runs.
>
> I've considered this and decided against it - it just seems to me that at
> least one person will use it every time until one day when they wipe out their
> source with their changes in it. I'd really rather not be enabling that.
> Besides, in everyday use repeated runs of devtool add / modify on the same
> recipe should be at a minimum, if that's not the case then we have other
> issues to look at.
>
> You say there's no way to remove these, but there is - just delete the files
> explicitly.
>
>> Or maybe fix "devtool add" to check the git repo correclty ? For example,
>> when there is already a repo, just update it rather than clone it again.
>
> Right, that has been suggested - and it's all fine if the source tree is
> unmodified and just a straight update to get from where it is currently to
> match the upstream. However, what if it's not fast-forward, or a different
> repo entirely? What if there are local modifications?
>
>> The multilib + testsdkext would fail without this fix.
>
> Yes, that's why I ultimately said we haven't much choice but to apply this
> patch. We must acknowledge however that the problem exists because the tests
Got it, thanks.
// Robert
> aren't cleaning up after themselves, which should be their responsibility.
>
> Cheers,
> Paul
>
^ permalink raw reply
* [PATCH] extrausers.bbclass: Use PACKAGE_INSTALL instead of IMAGE_INSTALL
From: jackie.huang @ 2016-12-13 8:24 UTC (permalink / raw)
To: openembedded-core
From: Jackie Huang <jackie.huang@windriver.com>
The initramfs image recipes changed to use PACKAGE_INSTALL
so they will not be affected by IMAGE_INSTALL, and will cause
error when inherit extrausers:
| ERROR: core-image-minimal-initramfs-1.0-r0 do_rootfs:
core-image-minimal-initramfs: usermod command did not succeed.
So use PACKAGE_INSTALL as well in extrausers.bbclass to fix it.
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
---
| 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--git a/meta/classes/extrausers.bbclass b/meta/classes/extrausers.bbclass
index 43900f3..852810e 100644
--- a/meta/classes/extrausers.bbclass
+++ b/meta/classes/extrausers.bbclass
@@ -15,7 +15,7 @@
inherit useradd_base
-IMAGE_INSTALL_append = " ${@['', 'base-passwd shadow'][bool(d.getVar('EXTRA_USERS_PARAMS', True))]}"
+PACKAGE_INSTALL_append = " ${@['', 'base-passwd shadow'][bool(d.getVar('EXTRA_USERS_PARAMS', True))]}"
# Image level user / group settings
ROOTFS_POSTPROCESS_COMMAND_append = " set_user_group;"
--
2.8.3
^ permalink raw reply related
* Re: [PATCH 2/8] oeqa/sdkext/devtool.py: remove workspace/sources before running test cases
From: Paul Eggleton @ 2016-12-13 8:21 UTC (permalink / raw)
To: Robert Yang
Cc: Francisco Pedraza, Limon, Anibal, Lopez, Mariano,
openembedded-core
In-Reply-To: <d0d8f45f-774f-0965-2a60-6acd17aca09a@windriver.com>
On Tue, 13 Dec 2016 14:47:10 Robert Yang wrote:
> On 12/13/2016 02:29 PM, Paul Eggleton wrote:
> > On Tue, 13 Dec 2016 13:56:05 Robert Yang wrote:
> >> On 12/13/2016 12:45 PM, Paul Eggleton wrote:
> >>> It seems to me that's what's missing here is a proper teardown process
> >>> like we have for oe-selftest, so that tests clean up after themselves
> >>> whether they succeed or fail. I'm unsure as to whether that is part of
> >>> the plan for the new QA refactoring though.
> >>
> >> There is already a 'devtool reset' which can do the cleanup, but it
> >> can't remove sources as I said in the commit log.
> >
> > devtool reset not deleting the source tree is intentional - I don't want
>
> Add an option like "devtool reset --force" ? When I met the error, the first
> I did was check "devtool reset", but there is no way to remove resources,
> so I have to remove it here to allow multilib test cases runs.
I've considered this and decided against it - it just seems to me that at
least one person will use it every time until one day when they wipe out their
source with their changes in it. I'd really rather not be enabling that.
Besides, in everyday use repeated runs of devtool add / modify on the same
recipe should be at a minimum, if that's not the case then we have other
issues to look at.
You say there's no way to remove these, but there is - just delete the files
explicitly.
> Or maybe fix "devtool add" to check the git repo correclty ? For example,
> when there is already a repo, just update it rather than clone it again.
Right, that has been suggested - and it's all fine if the source tree is
unmodified and just a straight update to get from where it is currently to
match the upstream. However, what if it's not fast-forward, or a different
repo entirely? What if there are local modifications?
> The multilib + testsdkext would fail without this fix.
Yes, that's why I ultimately said we haven't much choice but to apply this
patch. We must acknowledge however that the problem exists because the tests
aren't cleaning up after themselves, which should be their responsibility.
Cheers,
Paul
--
Paul Eggleton
Intel Open Source Technology Centre
^ permalink raw reply
* Re: [PATCH 5/8] oeqa/sdkext/devtool.py: don't reset when the test is failed
From: Robert Yang @ 2016-12-13 8:09 UTC (permalink / raw)
To: Paul Eggleton; +Cc: openembedded-core
In-Reply-To: <3698001.Ed7gRfCEom@peggleto-mobl.ger.corp.intel.com>
On 12/13/2016 04:07 PM, Paul Eggleton wrote:
> On Tue, 13 Dec 2016 14:39:46 Robert Yang wrote:
>> On 12/13/2016 02:33 PM, Paul Eggleton wrote:
>>> On Tue, 13 Dec 2016 14:01:08 Robert Yang wrote:
>>>> On 12/13/2016 12:48 PM, Paul Eggleton wrote:
>>>>> On Wed, 16 Nov 2016 22:19:34 Robert Yang wrote:
>>>>>> The contents are helpful to debug when the error happens.
>>>>>
>>>>> In this case removing this is OK because we're operating on an eSDK that
>>>>> the tests install. However, this wouldn't be appropriate for the devtool
>>>>> oe- selftest tests since they are operating on the user's build system
>>>>> itself - not that you probably have any intention of changing those, I
>>>>> just wanted to note that.
>>>>
>>>> Sorry, I don't quite understand, does selftest uses
>>>> oeqa/sdkext/devtool.py,
>>>> please ?
>>>
>>> No, this is for bitbake -c testsdkext.
>>>
>>>> Even if it uses devtool.py, I still think that we need keep the
>>>> error contents for debugging when the error happens. It's very hard to
>>>> debug when there is no error log or no workspace.
>>>
>>> I mean the equivalent oe-selftest tests in oeqa/selftest/devtool.py.
>>>
>>> Actually, I've realised something that applies here as well - leaving the
>>> files around would be OK if we stopped on the first failure, but we don't
>>> -
>>> the next test proceeds after it. How will you be able to rely on what's in
>>> the workspace if several other tests have run afterwards - not to mention
>>> ensure those tests aren't disrupted by the leftover files?
>>
>> That's a problem, but we really need consider debugging, otherwise it's
>> painful when test are failed but nothing left. How about run test cases
>> in different workspaces ?
>
> Currently when I need to debug a test, I tend to either run the test commands
> manually, or comment out the cleanup. If we really want to improve debugging
> then we ought to do it properly - have proper teardown infrastructure and then
> provide a mode that disables it.
Thanks, I will drop the patch atm.
// Robert
>
> Cheers,
> Paul
>
^ permalink raw reply
* Re: [PATCH v5 0/6] wic: bugfixes & --fixed-size support, tests, oe-selftest: minor fixes
From: Maciej Borzęcki @ 2016-12-13 8:07 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
Cc: Paul Eggleton, Maciej Borzecki
In-Reply-To: <cover.1479970230.git.maciej.borzecki@rndity.com>
On Thu, Nov 24, 2016 at 8:08 AM, Maciej Borzecki
<maciej.borzecki@rndity.com> wrote:
> v5 of a patch series previously posted here [1].
>
> Changes since v4:
>
> * dropped `wic: selftest: do not repeat core-image-minimal` & rebased
> dependant patches
>
> * minor formatting fix in `wic: selftest: add tests for --fixed-size
> partition flags`
>
> [1]. http://lists.openembedded.org/pipermail/openembedded-core/2016-November/129103.html
>
> Maciej Borzecki (6):
> oe-selftest: enforce en_US.UTF-8 locale
> oeqa/utils/commands.py: allow use of binaries from native sysroot
> wic: add --fixed-size wks option
> wic: selftest: avoid COMPATIBLE_HOST issues
> wic: selftest: do not assume bzImage kernel image
> wic: selftest: add tests for --fixed-size partition flags
>
> meta/lib/oeqa/selftest/wic.py | 123 +++++++++++++++++++++++++++++++--
> meta/lib/oeqa/utils/commands.py | 9 ++-
> scripts/lib/wic/help.py | 14 +++-
> scripts/lib/wic/imager/direct.py | 2 +-
> scripts/lib/wic/ksparser.py | 41 +++++++++--
> scripts/lib/wic/partition.py | 88 ++++++++++++++---------
> scripts/lib/wic/utils/partitionedfs.py | 2 +-
> scripts/oe-selftest | 3 +
> 8 files changed, 234 insertions(+), 48 deletions(-)
Is there any additional action needed from me at this point? A rebase
or a resend perhaps?
Cheers,
--
Maciej Borzecki
RnDity
^ permalink raw reply
* Re: [PATCH 5/8] oeqa/sdkext/devtool.py: don't reset when the test is failed
From: Paul Eggleton @ 2016-12-13 8:07 UTC (permalink / raw)
To: Robert Yang; +Cc: openembedded-core
In-Reply-To: <18078b0a-ede2-41ff-491b-9151b5b2aa1c@windriver.com>
On Tue, 13 Dec 2016 14:39:46 Robert Yang wrote:
> On 12/13/2016 02:33 PM, Paul Eggleton wrote:
> > On Tue, 13 Dec 2016 14:01:08 Robert Yang wrote:
> >> On 12/13/2016 12:48 PM, Paul Eggleton wrote:
> >>> On Wed, 16 Nov 2016 22:19:34 Robert Yang wrote:
> >>>> The contents are helpful to debug when the error happens.
> >>>
> >>> In this case removing this is OK because we're operating on an eSDK that
> >>> the tests install. However, this wouldn't be appropriate for the devtool
> >>> oe- selftest tests since they are operating on the user's build system
> >>> itself - not that you probably have any intention of changing those, I
> >>> just wanted to note that.
> >>
> >> Sorry, I don't quite understand, does selftest uses
> >> oeqa/sdkext/devtool.py,
> >> please ?
> >
> > No, this is for bitbake -c testsdkext.
> >
> >> Even if it uses devtool.py, I still think that we need keep the
> >> error contents for debugging when the error happens. It's very hard to
> >> debug when there is no error log or no workspace.
> >
> > I mean the equivalent oe-selftest tests in oeqa/selftest/devtool.py.
> >
> > Actually, I've realised something that applies here as well - leaving the
> > files around would be OK if we stopped on the first failure, but we don't
> > -
> > the next test proceeds after it. How will you be able to rely on what's in
> > the workspace if several other tests have run afterwards - not to mention
> > ensure those tests aren't disrupted by the leftover files?
>
> That's a problem, but we really need consider debugging, otherwise it's
> painful when test are failed but nothing left. How about run test cases
> in different workspaces ?
Currently when I need to debug a test, I tend to either run the test commands
manually, or comment out the cleanup. If we really want to improve debugging
then we ought to do it properly - have proper teardown infrastructure and then
provide a mode that disables it.
Cheers,
Paul
--
Paul Eggleton
Intel Open Source Technology Centre
^ permalink raw reply
* [PATCH V2 4/4] package.bbclass: support persistent /var/log
From: Chen Qi @ 2016-12-13 8:04 UTC (permalink / raw)
To: openembedded-core
In-Reply-To: <cover.1481616098.git.Qi.Chen@windriver.com>
Add a new file, fs-perms-persistent-log.txt, which treats /var/log
as a directory instead of a link.
Modify package.bbclass to use this file if VOLATILE_LOG_DIR is not set to "yes".
[YOCTO #6132]
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
meta/classes/package.bbclass | 2 +-
meta/files/fs-perms-persistent-log.txt | 69 ++++++++++++++++++++++++++++++++++
2 files changed, 70 insertions(+), 1 deletion(-)
create mode 100644 meta/files/fs-perms-persistent-log.txt
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index a6f0a7a..9a423f8 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -733,7 +733,7 @@ python fixup_perms () {
bbpath = d.getVar('BBPATH', True)
fs_perms_tables = d.getVar('FILESYSTEM_PERMS_TABLES', True)
if not fs_perms_tables:
- fs_perms_tables = 'files/fs-perms.txt'
+ fs_perms_tables = ['files/fs-perms-persistent-log.txt', 'files/fs-perms.txt'][d.getVar('VOLATILE_LOG_DIR', True) == 'yes']
for conf_file in fs_perms_tables.split():
str += " %s" % bb.utils.which(bbpath, conf_file)
return str
diff --git a/meta/files/fs-perms-persistent-log.txt b/meta/files/fs-perms-persistent-log.txt
new file mode 100644
index 0000000..2487a68
--- /dev/null
+++ b/meta/files/fs-perms-persistent-log.txt
@@ -0,0 +1,69 @@
+# This file contains a list of files and directories with known permissions.
+# It is used by the packaging class to ensure that the permissions, owners and
+# group of listed files and directories are in sync across the system.
+#
+# The format of this file
+#
+#<path> <mode> <uid> <gid> <walk> <fmode> <fuid> <fgid>
+#
+# or
+#
+#<path> link <target>
+#
+# <path>: directory path
+# <mode>: mode for directory
+# <uid>: uid for directory
+# <gid>: gid for directory
+# <walk>: recursively walk the directory? true or false
+# <fmode>: if walking, new mode for files
+# <fuid>: if walking, new uid for files
+# <fgid>: if walking, new gid for files
+# <target>: turn the directory into a symlink point to target
+#
+# in mode, uid or gid, a "-" means don't change any existing values
+#
+# /usr/src 0755 root root false - - -
+# /usr/share/man 0755 root root true 0644 root root
+
+# Note: all standard config directories are automatically assigned "0755 root root false - - -"
+
+# Documentation should always be corrected
+${mandir} 0755 root root true 0644 root root
+${infodir} 0755 root root true 0644 root root
+${docdir} 0755 root root true 0644 root root
+${datadir}/gtk-doc 0755 root root true 0644 root root
+
+# Fixup locales
+${datadir}/locale 0755 root root true 0644 root root
+
+# Cleanup headers
+${includedir} 0755 root root true 0644 root root
+${oldincludedir} 0755 root root true 0644 root root
+
+# Cleanup debug src
+/usr/src/debug 0755 root root true - root root
+
+# Items from base-files
+# Links
+${localstatedir}/run link /run
+${localstatedir}/lock link /run/lock
+${localstatedir}/tmp link volatile/tmp
+
+/home 0755 root root false - - -
+/srv 0755 root root false - - -
+${prefix}/src 0755 root root false - - -
+${localstatedir}/local 0755 root root false - - -
+
+# Special permissions from base-files
+# Set 1777
+/tmp 01777 root root false - - -
+${localstatedir}/volatile/tmp 01777 root root false - - -
+
+# Set 0700
+${ROOT_HOME} 0700 root root false - - -
+
+# Set 755-lsb
+/srv 0755 root root false - - -
+
+# Set 2775-lsb
+/var/mail 02775 root mail false - - -
--
1.9.1
^ permalink raw reply related
* [PATCH V2 3/4] initscripts: support persistent /var/log
From: Chen Qi @ 2016-12-13 8:04 UTC (permalink / raw)
To: openembedded-core
In-Reply-To: <cover.1481616098.git.Qi.Chen@windriver.com>
Respect VOLATILE_VAR_LOG variable so that if it's set to "no", we could
have persistent /var/log on the final image.
[YOCTO #6132]
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
meta/recipes-core/initscripts/initscripts-1.0/volatiles | 1 -
meta/recipes-core/initscripts/initscripts_1.0.bb | 3 +++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/volatiles b/meta/recipes-core/initscripts/initscripts-1.0/volatiles
index 297245d..6cccab7 100644
--- a/meta/recipes-core/initscripts/initscripts-1.0/volatiles
+++ b/meta/recipes-core/initscripts/initscripts-1.0/volatiles
@@ -25,7 +25,6 @@ d root root 1777 /run/lock none
d root root 0755 /var/volatile/log none
d root root 1777 /var/volatile/tmp none
l root root 1777 /var/lock /run/lock
-l root root 0755 /var/log /var/volatile/log
l root root 0755 /var/run /run
l root root 1777 /var/tmp /var/volatile/tmp
l root root 1777 /tmp /var/tmp
diff --git a/meta/recipes-core/initscripts/initscripts_1.0.bb b/meta/recipes-core/initscripts/initscripts_1.0.bb
index 8f110b0..453116c 100644
--- a/meta/recipes-core/initscripts/initscripts_1.0.bb
+++ b/meta/recipes-core/initscripts/initscripts_1.0.bb
@@ -102,6 +102,9 @@ do_install () {
install -m 0755 ${WORKDIR}/read-only-rootfs-hook.sh ${D}${sysconfdir}/init.d
install -m 0755 ${WORKDIR}/save-rtc.sh ${D}${sysconfdir}/init.d
install -m 0644 ${WORKDIR}/volatiles ${D}${sysconfdir}/default/volatiles/00_core
+ if [ ${@ oe.types.boolean('${VOLATILE_LOG_DIR}') } = True ]; then
+ echo "l root root 0755 /var/log /var/volatile/log" >> ${D}${sysconfdir}/default/volatiles/00_core
+ fi
install -m 0755 ${WORKDIR}/dmesg.sh ${D}${sysconfdir}/init.d
install -m 0644 ${WORKDIR}/logrotate-dmesg.conf ${D}${sysconfdir}/
--
1.9.1
^ permalink raw reply related
* [PATCH V2 2/4] base-files: respect VOLATILE_LOG_DIR
From: Chen Qi @ 2016-12-13 8:04 UTC (permalink / raw)
To: openembedded-core
In-Reply-To: <cover.1481616098.git.Qi.Chen@windriver.com>
Respect VOLATILE_LOG_DIR variable. In this way, if the user overrides
this variable to be "no", /var/log on the final image would reside on
persistent storage.
[YOCTO #6132]
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
meta/recipes-core/base-files/base-files_3.0.14.bb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/meta/recipes-core/base-files/base-files_3.0.14.bb b/meta/recipes-core/base-files/base-files_3.0.14.bb
index 5333110..c065499 100644
--- a/meta/recipes-core/base-files/base-files_3.0.14.bb
+++ b/meta/recipes-core/base-files/base-files_3.0.14.bb
@@ -41,7 +41,7 @@ dirs755 = "/bin /boot /dev ${sysconfdir} ${sysconfdir}/default \
${localstatedir}/backups ${localstatedir}/lib \
/sys ${localstatedir}/lib/misc ${localstatedir}/spool \
${localstatedir}/volatile \
- ${localstatedir}/volatile/log \
+ ${localstatedir}/${@'volatile/' if oe.types.boolean('${VOLATILE_LOG_DIR}') else ''}log \
/home ${prefix}/src ${localstatedir}/local \
/media"
@@ -52,7 +52,7 @@ dirs755-lsb = "/srv \
${prefix}/lib/locale"
dirs2775-lsb = "/var/mail"
-volatiles = "log tmp"
+volatiles = "${@'log' if oe.types.boolean('${VOLATILE_LOG_DIR}') else ''} tmp"
conffiles = "${sysconfdir}/debian_version ${sysconfdir}/host.conf \
${sysconfdir}/issue /${sysconfdir}/issue.net \
${sysconfdir}/nsswitch.conf ${sysconfdir}/profile \
--
1.9.1
^ permalink raw reply related
* [PATCH V2 1/4] bitbake.conf: add VOLATILE_LOG_DIR variable
From: Chen Qi @ 2016-12-13 8:04 UTC (permalink / raw)
To: openembedded-core
In-Reply-To: <cover.1481616098.git.Qi.Chen@windriver.com>
The default value is "yes" which results in the /var/log being a link
pointing to /var/volatile/log which is on tmpfs.
The user could override this value to "no" which causes /var/log to be
a directory on persistent storage.
[YOCTO #6132]
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
meta/conf/bitbake.conf | 3 +++
1 file changed, 3 insertions(+)
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 1472e8f..794f422 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -83,6 +83,9 @@ USRBINPATH_class-nativesdk = "/usr/bin"
# Root home directory
ROOT_HOME ??= "/home/root"
+# If set to "yes", /var/log links to /var/volatile/log; otherwise, /var/log is on persistent storage.
+VOLATILE_LOG_DIR ?= "yes"
+
##################################################################
# Architecture-dependent build variables.
##################################################################
--
1.9.1
^ permalink raw reply related
* [PATCH V2 0/4] Persistent /var/log support
From: Chen Qi @ 2016-12-13 8:04 UTC (permalink / raw)
To: openembedded-core
The following changes since commit d62f18c39bc0ed3b0f5ac8465b393c15f2143ecf:
targetloader.py: drop test for ClassType (2016-12-12 15:16:39 +0000)
are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib ChenQi/persistent-var-log
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=ChenQi/persistent-var-log
Chen Qi (4):
bitbake.conf: add VOLATILE_LOG_DIR variable
base-files: respect VOLATILE_LOG_DIR
initscripts: support persistent /var/log
package.bbclass: support persistent /var/log
meta/classes/package.bbclass | 2 +-
meta/conf/bitbake.conf | 3 +
meta/files/fs-perms-persistent-log.txt | 69 ++++++++++++++++++++++
meta/recipes-core/base-files/base-files_3.0.14.bb | 4 +-
.../initscripts/initscripts-1.0/volatiles | 1 -
meta/recipes-core/initscripts/initscripts_1.0.bb | 3 +
6 files changed, 78 insertions(+), 4 deletions(-)
create mode 100644 meta/files/fs-perms-persistent-log.txt
--
1.9.1
^ permalink raw reply
* Re: [PATCH 3/4] initscripts: support persistent /var/log
From: ChenQi @ 2016-12-13 8:00 UTC (permalink / raw)
To: Patrick Ohly; +Cc: openembedded-core
In-Reply-To: <1481529942.17535.198.camel@intel.com>
On 12/12/2016 04:05 PM, Patrick Ohly wrote:
> On Tue, 2016-11-22 at 18:10 +0800, Chen Qi wrote:
>> ${WORKDIR}/volatiles ${D}${sysconfdir}/default/volatiles/00_core
>> + if [ "${VOLATILE_LOG_DIR}" = "log" ]; then
>> + echo "l root root 0755 /var/log /var/volatile/log" >>
>> ${D}${sysconfdir}/default/volatiles/00_core
>> + fi
> Why are you checking for "log" here? I thought VOLATILE_LOG_DIR was
> supposed to be a boolean?
>
> Using oe.types.boolean in shell code is a bit awkward, but would be
> necessary for the sake of consistency when allowing VOLATILE_LOG_DIR to
> have more than just yes/no. Untested (relies on bool->str conversion):
>
> if [ ${@ oe.types.boolean('${VOLATILE_LOG_DIR}') } = True ]; then
>
Thanks for your suggestion.
I'll send out V2.
Best Regards,
Chen Qi
^ permalink raw reply
* [PATCH] wpa-supplicant: 2.5 -> 2.6
From: Zheng Ruoqin @ 2016-12-13 7:49 UTC (permalink / raw)
To: openembedded-core
1)Upgrade wpa-supplicant from 2.5 to 2.6.
2)Delete 5 patches below, since they are integrated upstream.
0001-Reject-psk-parameter-set-with-invalid-passphrase-cha.patch
0001-WPS-Reject-a-Credential-with-invalid-passphrase.patch
0002-Reject-SET_CRED-commands-with-newline-characters-in-.patch
0002-Remove-newlines-from-wpa_supplicant-config-network-o.patch
0003-Reject-SET-commands-with-newline-characters-in-the-s.patch
3)License checksum changes are not related to license changes.
Signed-off-by: Zheng Ruoqin <zhengrq.fnst@cn.fujitsu.com>
---
...parameter-set-with-invalid-passphrase-cha.patch | 55 --------------
...ject-a-Credential-with-invalid-passphrase.patch | 86 ----------------------
...CRED-commands-with-newline-characters-in-.patch | 66 -----------------
...ines-from-wpa_supplicant-config-network-o.patch | 86 ----------------------
...commands-with-newline-characters-in-the-s.patch | 54 --------------
...wpa-supplicant_2.5.bb => wpa-supplicant_2.6.bb} | 15 ++--
6 files changed, 5 insertions(+), 357 deletions(-)
delete mode 100644 meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0001-Reject-psk-parameter-set-with-invalid-passphrase-cha.patch
delete mode 100644 meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0001-WPS-Reject-a-Credential-with-invalid-passphrase.patch
delete mode 100644 meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0002-Reject-SET_CRED-commands-with-newline-characters-in-.patch
delete mode 100644 meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0002-Remove-newlines-from-wpa_supplicant-config-network-o.patch
delete mode 100644 meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0003-Reject-SET-commands-with-newline-characters-in-the-s.patch
rename meta/recipes-connectivity/wpa-supplicant/{wpa-supplicant_2.5.bb => wpa-supplicant_2.6.bb} (82%)
diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0001-Reject-psk-parameter-set-with-invalid-passphrase-cha.patch b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0001-Reject-psk-parameter-set-with-invalid-passphrase-cha.patch
deleted file mode 100644
index dd7d5f7..0000000
--- a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0001-Reject-psk-parameter-set-with-invalid-passphrase-cha.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From 73e4abb24a936014727924d8b0b2965edfc117dd Mon Sep 17 00:00:00 2001
-From: Jouni Malinen <jouni@qca.qualcomm.com>
-Date: Fri, 4 Mar 2016 18:46:41 +0200
-Subject: [PATCH 1/3] Reject psk parameter set with invalid passphrase
- character
-
-WPA/WPA2-Personal passphrase is not allowed to include control
-characters. Reject a passphrase configuration attempt if that passphrase
-includes an invalid passphrase.
-
-This fixes an issue where wpa_supplicant could have updated the
-configuration file psk parameter with arbitrary data from the control
-interface or D-Bus interface. While those interfaces are supposed to be
-accessible only for trusted users/applications, it may be possible that
-an untrusted user has access to a management software component that
-does not validate the passphrase value before passing it to
-wpa_supplicant.
-
-This could allow such an untrusted user to inject up to 63 characters of
-almost arbitrary data into the configuration file. Such configuration
-file could result in wpa_supplicant trying to load a library (e.g.,
-opensc_engine_path, pkcs11_engine_path, pkcs11_module_path,
-load_dynamic_eap) from user controlled location when starting again.
-This would allow code from that library to be executed under the
-wpa_supplicant process privileges.
-
-Upstream-Status: Backport
-
-CVE: CVE-2016-4477
-
-Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
-Signed-off-by: Zhixiong Chi <Zhixiong.Chi@windriver.com>
----
- wpa_supplicant/config.c | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
-index b1c7870..fdd9643 100644
---- a/wpa_supplicant/config.c
-+++ b/wpa_supplicant/config.c
-@@ -478,6 +478,12 @@ static int wpa_config_parse_psk(const struct parse_data *data,
- }
- wpa_hexdump_ascii_key(MSG_MSGDUMP, "PSK (ASCII passphrase)",
- (u8 *) value, len);
-+ if (has_ctrl_char((u8 *) value, len)) {
-+ wpa_printf(MSG_ERROR,
-+ "Line %d: Invalid passphrase character",
-+ line);
-+ return -1;
-+ }
- if (ssid->passphrase && os_strlen(ssid->passphrase) == len &&
- os_memcmp(ssid->passphrase, value, len) == 0) {
- /* No change to the previously configured value */
---
-1.9.1
diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0001-WPS-Reject-a-Credential-with-invalid-passphrase.patch b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0001-WPS-Reject-a-Credential-with-invalid-passphrase.patch
deleted file mode 100644
index db222e4..0000000
--- a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0001-WPS-Reject-a-Credential-with-invalid-passphrase.patch
+++ /dev/null
@@ -1,86 +0,0 @@
-From ecbb0b3dc122b0d290987cf9c84010bbe53e1022 Mon Sep 17 00:00:00 2001
-From: Jouni Malinen <jouni@qca.qualcomm.com>
-Date: Fri, 4 Mar 2016 17:20:18 +0200
-Subject: [PATCH 1/2] WPS: Reject a Credential with invalid passphrase
-
-WPA/WPA2-Personal passphrase is not allowed to include control
-characters. Reject a Credential received from a WPS Registrar both as
-STA (Credential) and AP (AP Settings) if the credential is for WPAPSK or
-WPA2PSK authentication type and includes an invalid passphrase.
-
-This fixes an issue where hostapd or wpa_supplicant could have updated
-the configuration file PSK/passphrase parameter with arbitrary data from
-an external device (Registrar) that may not be fully trusted. Should
-such data include a newline character, the resulting configuration file
-could become invalid and fail to be parsed.
-
-Upstream-Status: Backport
-
-CVE: CVE-2016-4476
-
-Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
-Signed-off-by: Zhixiong Chi <Zhixiong.Chi@windriver.com>
----
- src/utils/common.c | 12 ++++++++++++
- src/utils/common.h | 1 +
- src/wps/wps_attr_process.c | 10 ++++++++++
- 3 files changed, 23 insertions(+)
-
-diff --git a/src/utils/common.c b/src/utils/common.c
-index 450e2c6..27b7c02 100644
---- a/src/utils/common.c
-+++ b/src/utils/common.c
-@@ -697,6 +697,18 @@ int is_hex(const u8 *data, size_t len)
- }
-
-
-+int has_ctrl_char(const u8 *data, size_t len)
-+{
-+ size_t i;
-+
-+ for (i = 0; i < len; i++) {
-+ if (data[i] < 32 || data[i] == 127)
-+ return 1;
-+ }
-+ return 0;
-+}
-+
-+
- size_t merge_byte_arrays(u8 *res, size_t res_len,
- const u8 *src1, size_t src1_len,
- const u8 *src2, size_t src2_len)
-diff --git a/src/utils/common.h b/src/utils/common.h
-index 701dbb2..a972240 100644
---- a/src/utils/common.h
-+++ b/src/utils/common.h
-@@ -488,6 +488,7 @@ const char * wpa_ssid_txt(const u8 *ssid, size_t ssid_len);
-
- char * wpa_config_parse_string(const char *value, size_t *len);
- int is_hex(const u8 *data, size_t len);
-+int has_ctrl_char(const u8 *data, size_t len);
- size_t merge_byte_arrays(u8 *res, size_t res_len,
- const u8 *src1, size_t src1_len,
- const u8 *src2, size_t src2_len);
-diff --git a/src/wps/wps_attr_process.c b/src/wps/wps_attr_process.c
-index eadb22f..e8c4579 100644
---- a/src/wps/wps_attr_process.c
-+++ b/src/wps/wps_attr_process.c
-@@ -229,6 +229,16 @@ static int wps_workaround_cred_key(struct wps_credential *cred)
- cred->key_len--;
- #endif /* CONFIG_WPS_STRICT */
- }
-+
-+
-+ if (cred->auth_type & (WPS_AUTH_WPAPSK | WPS_AUTH_WPA2PSK) &&
-+ (cred->key_len < 8 || has_ctrl_char(cred->key, cred->key_len))) {
-+ wpa_printf(MSG_INFO, "WPS: Reject credential with invalid WPA/WPA2-Personal passphrase");
-+ wpa_hexdump_ascii_key(MSG_INFO, "WPS: Network Key",
-+ cred->key, cred->key_len);
-+ return -1;
-+ }
-+
- return 0;
- }
-
---
-1.9.1
diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0002-Reject-SET_CRED-commands-with-newline-characters-in-.patch b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0002-Reject-SET_CRED-commands-with-newline-characters-in-.patch
deleted file mode 100644
index cad7425..0000000
--- a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0002-Reject-SET_CRED-commands-with-newline-characters-in-.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-From b166cd84a77a6717be9600bf95378a0055d6f5a5 Mon Sep 17 00:00:00 2001
-From: Jouni Malinen <jouni@qca.qualcomm.com>
-Date: Tue, 5 Apr 2016 23:33:10 +0300
-Subject: [PATCH 2/3] Reject SET_CRED commands with newline characters in the
- string values
-
-Most of the cred block parameters are written as strings without
-filtering and if there is an embedded newline character in the value,
-unexpected configuration file data might be written.
-
-This fixes an issue where wpa_supplicant could have updated the
-configuration file cred parameter with arbitrary data from the control
-interface or D-Bus interface. While those interfaces are supposed to be
-accessible only for trusted users/applications, it may be possible that
-an untrusted user has access to a management software component that
-does not validate the credential value before passing it to
-wpa_supplicant.
-
-This could allow such an untrusted user to inject almost arbitrary data
-into the configuration file. Such configuration file could result in
-wpa_supplicant trying to load a library (e.g., opensc_engine_path,
-pkcs11_engine_path, pkcs11_module_path, load_dynamic_eap) from user
-controlled location when starting again. This would allow code from that
-library to be executed under the wpa_supplicant process privileges.
-
-Upstream-Status: Backport
-
-CVE: CVE-2016-4477
-
-Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
-Signed-off-by: Zhixiong Chi <Zhixiong.Chi@windriver.com>
----
- wpa_supplicant/config.c | 9 ++++++++-
- 1 file changed, 8 insertions(+), 1 deletion(-)
-
-diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
-index eb97cd5..69152ef 100644
---- a/wpa_supplicant/config.c
-+++ b/wpa_supplicant/config.c
-@@ -2896,6 +2896,8 @@ int wpa_config_set_cred(struct wpa_cred *cred, const char *var,
-
- if (os_strcmp(var, "password") == 0 &&
- os_strncmp(value, "ext:", 4) == 0) {
-+ if (has_newline(value))
-+ return -1;
- str_clear_free(cred->password);
- cred->password = os_strdup(value);
- cred->ext_password = 1;
-@@ -2946,9 +2948,14 @@ int wpa_config_set_cred(struct wpa_cred *cred, const char *var,
- }
-
- val = wpa_config_parse_string(value, &len);
-- if (val == NULL) {
-+ if (val == NULL ||
-+ (os_strcmp(var, "excluded_ssid") != 0 &&
-+ os_strcmp(var, "roaming_consortium") != 0 &&
-+ os_strcmp(var, "required_roaming_consortium") != 0 &&
-+ has_newline(val))) {
- wpa_printf(MSG_ERROR, "Line %d: invalid field '%s' string "
- "value '%s'.", line, var, value);
-+ os_free(val);
- return -1;
- }
-
---
-1.9.1
diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0002-Remove-newlines-from-wpa_supplicant-config-network-o.patch b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0002-Remove-newlines-from-wpa_supplicant-config-network-o.patch
deleted file mode 100644
index cc7b01a..0000000
--- a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0002-Remove-newlines-from-wpa_supplicant-config-network-o.patch
+++ /dev/null
@@ -1,86 +0,0 @@
-From 0fe5a234240a108b294a87174ad197f6b5cb38e9 Mon Sep 17 00:00:00 2001
-From: Paul Stewart <pstew@google.com>
-Date: Thu, 3 Mar 2016 15:40:19 -0800
-Subject: [PATCH 2/2] Remove newlines from wpa_supplicant config network
- output
-
-Spurious newlines output while writing the config file can corrupt the
-wpa_supplicant configuration. Avoid writing these for the network block
-parameters. This is a generic filter that cover cases that may not have
-been explicitly addressed with a more specific commit to avoid control
-characters in the psk parameter.
-
-Upstream-Status: Backport
-
-CVE: CVE-2016-4476
-
-Signed-off-by: Paul Stewart <pstew@google.com>
-Signed-off-by: Zhixiong Chi <Zhixiong.Chi.wrs.com>
----
- src/utils/common.c | 11 +++++++++++
- src/utils/common.h | 1 +
- wpa_supplicant/config.c | 15 +++++++++++++--
- 3 files changed, 25 insertions(+), 2 deletions(-)
-
-diff --git a/src/utils/common.c b/src/utils/common.c
-index 27b7c02..9856463 100644
---- a/src/utils/common.c
-+++ b/src/utils/common.c
-@@ -709,6 +709,17 @@ int has_ctrl_char(const u8 *data, size_t len)
- }
-
-
-+int has_newline(const char *str)
-+{
-+ while (*str) {
-+ if (*str == '\n' || *str == '\r')
-+ return 1;
-+ str++;
-+ }
-+ return 0;
-+}
-+
-+
- size_t merge_byte_arrays(u8 *res, size_t res_len,
- const u8 *src1, size_t src1_len,
- const u8 *src2, size_t src2_len)
-diff --git a/src/utils/common.h b/src/utils/common.h
-index a972240..d19927b 100644
---- a/src/utils/common.h
-+++ b/src/utils/common.h
-@@ -489,6 +489,7 @@ const char * wpa_ssid_txt(const u8 *ssid, size_t ssid_len);
- char * wpa_config_parse_string(const char *value, size_t *len);
- int is_hex(const u8 *data, size_t len);
- int has_ctrl_char(const u8 *data, size_t len);
-+int has_newline(const char *str);
- size_t merge_byte_arrays(u8 *res, size_t res_len,
- const u8 *src1, size_t src1_len,
- const u8 *src2, size_t src2_len);
-diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
-index fdd9643..eb97cd5 100644
---- a/wpa_supplicant/config.c
-+++ b/wpa_supplicant/config.c
-@@ -2699,8 +2699,19 @@ char * wpa_config_get(struct wpa_ssid *ssid, const char *var)
-
- for (i = 0; i < NUM_SSID_FIELDS; i++) {
- const struct parse_data *field = &ssid_fields[i];
-- if (os_strcmp(var, field->name) == 0)
-- return field->writer(field, ssid);
-+ if (os_strcmp(var, field->name) == 0) {
-+ char *ret = field->writer(field, ssid);
-+
-+ if (ret && has_newline(ret)) {
-+ wpa_printf(MSG_ERROR,
-+ "Found newline in value for %s; not returning it",
-+ var);
-+ os_free(ret);
-+ ret = NULL;
-+ }
-+
-+ return ret;
-+ }
- }
-
- return NULL;
---
-1.9.1
diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0003-Reject-SET-commands-with-newline-characters-in-the-s.patch b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0003-Reject-SET-commands-with-newline-characters-in-the-s.patch
deleted file mode 100644
index 5375db7..0000000
--- a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0003-Reject-SET-commands-with-newline-characters-in-the-s.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From 2a3f56502b52375c3bf113cf92adfa99bad6b488 Mon Sep 17 00:00:00 2001
-From: Jouni Malinen <jouni@qca.qualcomm.com>
-Date: Tue, 5 Apr 2016 23:55:48 +0300
-Subject: [PATCH 3/3] Reject SET commands with newline characters in the
- string values
-
-Many of the global configuration parameters are written as strings
-without filtering and if there is an embedded newline character in the
-value, unexpected configuration file data might be written.
-
-This fixes an issue where wpa_supplicant could have updated the
-configuration file global parameter with arbitrary data from the control
-interface or D-Bus interface. While those interfaces are supposed to be
-accessible only for trusted users/applications, it may be possible that
-an untrusted user has access to a management software component that
-does not validate the value of a parameter before passing it to
-wpa_supplicant.
-
-This could allow such an untrusted user to inject almost arbitrary data
-into the configuration file. Such configuration file could result in
-wpa_supplicant trying to load a library (e.g., opensc_engine_path,
-pkcs11_engine_path, pkcs11_module_path, load_dynamic_eap) from user
-controlled location when starting again. This would allow code from that
-library to be executed under the wpa_supplicant process privileges.
-
-Upstream-Status: Backport
-
-CVE: CVE-2016-4477
-
-Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
-Signed-off-by: Zhixiong Chi <Zhixiong.Chi@windriver.com>
----
- wpa_supplicant/config.c | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
-index 69152ef..d9a1603 100644
---- a/wpa_supplicant/config.c
-+++ b/wpa_supplicant/config.c
-@@ -3764,6 +3764,12 @@ static int wpa_global_config_parse_str(const struct global_parse_data *data,
- return -1;
- }
-
-+ if (has_newline(pos)) {
-+ wpa_printf(MSG_ERROR, "Line %d: invalid %s value with newline",
-+ line, data->name);
-+ return -1;
-+ }
-+
- tmp = os_strdup(pos);
- if (tmp == NULL)
- return -1;
---
-1.9.1
diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.5.bb b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.6.bb
similarity index 82%
rename from meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.5.bb
rename to meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.6.bb
index a4160e1..b96f9d2 100644
--- a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.5.bb
+++ b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.6.bb
@@ -3,9 +3,9 @@ HOMEPAGE = "http://w1.fi/wpa_supplicant/"
BUGTRACKER = "http://w1.fi/security/"
SECTION = "network"
LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://COPYING;md5=36b27801447e0662ee0138d17fe93880 \
- file://README;beginline=1;endline=56;md5=7f393579f8b109fe91f3b9765d26c7d3 \
- file://wpa_supplicant/wpa_supplicant.c;beginline=1;endline=12;md5=3430fda79f2ba1dd545f0b3c4d6e4d24"
+LIC_FILES_CHKSUM = "file://COPYING;md5=292eece3f2ebbaa25608eed8464018a3 \
+ file://README;beginline=1;endline=56;md5=3f01d778be8f953962388307ee38ed2b \
+ file://wpa_supplicant/wpa_supplicant.c;beginline=1;endline=12;md5=4061612fc5715696134e3baf933e8aba"
DEPENDS = "dbus libnl"
RRECOMMENDS_${PN} = "wpa-supplicant-passphrase wpa-supplicant-cli"
@@ -24,14 +24,9 @@ SRC_URI = "http://w1.fi/releases/wpa_supplicant-${PV}.tar.gz \
file://wpa_supplicant.conf \
file://wpa_supplicant.conf-sane \
file://99_wpa_supplicant \
- file://0001-WPS-Reject-a-Credential-with-invalid-passphrase.patch \
- file://0002-Remove-newlines-from-wpa_supplicant-config-network-o.patch \
- file://0001-Reject-psk-parameter-set-with-invalid-passphrase-cha.patch \
- file://0002-Reject-SET_CRED-commands-with-newline-characters-in-.patch \
- file://0003-Reject-SET-commands-with-newline-characters-in-the-s.patch \
"
-SRC_URI[md5sum] = "96ff75c3a514f1f324560a2376f13110"
-SRC_URI[sha256sum] = "cce55bae483b364eae55c35ba567c279be442ed8bab5b80a3c7fb0d057b9b316"
+SRC_URI[md5sum] = "091569eb4440b7d7f2b4276dbfc03c3c"
+SRC_URI[sha256sum] = "b4936d34c4e6cdd44954beba74296d964bc2c9668ecaa5255e499636fe2b1450"
S = "${WORKDIR}/wpa_supplicant-${PV}"
--
2.7.4
^ permalink raw reply related
* [PATCH 14/14] oe-selftest: add basic tinfoil tests
From: Paul Eggleton @ 2016-12-13 7:09 UTC (permalink / raw)
To: openembedded-core
In-Reply-To: <cover.1481612135.git.paul.eggleton@linux.intel.com>
Add some tests to verify that the new tinfoil API is operating
correctly.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
meta/lib/oeqa/selftest/tinfoil.py | 146 ++++++++++++++++++++++++++++++++++++++
1 file changed, 146 insertions(+)
create mode 100644 meta/lib/oeqa/selftest/tinfoil.py
diff --git a/meta/lib/oeqa/selftest/tinfoil.py b/meta/lib/oeqa/selftest/tinfoil.py
new file mode 100644
index 0000000..4f70e0d
--- /dev/null
+++ b/meta/lib/oeqa/selftest/tinfoil.py
@@ -0,0 +1,146 @@
+import unittest
+import os
+import re
+import bb.tinfoil
+
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.commands import runCmd, get_bb_var
+from oeqa.utils.decorators import testcase
+
+class TinfoilTests(oeSelfTest):
+ """ Basic tests for the tinfoil API """
+
+ def test_getvar(self):
+ with bb.tinfoil.Tinfoil() as tinfoil:
+ tinfoil.prepare(True)
+ machine = tinfoil.config_data.getVar('MACHINE', True)
+ if not machine:
+ self.fail('Unable to get MACHINE value - returned %s' % machine)
+
+ def test_expand(self):
+ with bb.tinfoil.Tinfoil() as tinfoil:
+ tinfoil.prepare(True)
+ expr = '${@os.getpid()}'
+ pid = tinfoil.config_data.expand(expr)
+ if not pid:
+ self.fail('Unable to expand "%s" - returned %s' % (expr, pid))
+
+ def test_getvar_bb_origenv(self):
+ with bb.tinfoil.Tinfoil() as tinfoil:
+ tinfoil.prepare(True)
+ origenv = tinfoil.config_data.getVar('BB_ORIGENV', False)
+ if not origenv:
+ self.fail('Unable to get BB_ORIGENV value - returned %s' % origenv)
+ self.assertEqual(origenv.getVar('HOME', False), os.environ['HOME'])
+
+ def test_parse_recipe(self):
+ with bb.tinfoil.Tinfoil() as tinfoil:
+ tinfoil.prepare(config_only=False, quiet=2)
+ testrecipe = 'mdadm'
+ best = tinfoil.find_best_provider(testrecipe)
+ if not best:
+ self.fail('Unable to find recipe providing %s' % testrecipe)
+ rd = tinfoil.parse_recipe_file(best[3])
+ self.assertEqual(testrecipe, rd.getVar('PN', True))
+
+ def test_parse_recipe_copy_expand(self):
+ with bb.tinfoil.Tinfoil() as tinfoil:
+ tinfoil.prepare(config_only=False, quiet=2)
+ testrecipe = 'mdadm'
+ best = tinfoil.find_best_provider(testrecipe)
+ if not best:
+ self.fail('Unable to find recipe providing %s' % testrecipe)
+ rd = tinfoil.parse_recipe_file(best[3])
+ # Check we can get variable values
+ self.assertEqual(testrecipe, rd.getVar('PN', True))
+ # Check that expanding a value that includes a variable reference works
+ self.assertEqual(testrecipe, rd.getVar('BPN', True))
+ # Now check that changing the referenced variable's value in a copy gives that
+ # value when expanding
+ localdata = bb.data.createCopy(rd)
+ localdata.setVar('PN', 'hello')
+ self.assertEqual('hello', localdata.getVar('BPN', True))
+
+ def test_parse_recipe_initial_datastore(self):
+ with bb.tinfoil.Tinfoil() as tinfoil:
+ tinfoil.prepare(config_only=False, quiet=2)
+ testrecipe = 'mdadm'
+ best = tinfoil.find_best_provider(testrecipe)
+ if not best:
+ self.fail('Unable to find recipe providing %s' % testrecipe)
+ dcopy = bb.data.createCopy(tinfoil.config_data)
+ dcopy.setVar('MYVARIABLE', 'somevalue')
+ rd = tinfoil.parse_recipe_file(best[3], config_data=dcopy)
+ # Check we can get variable values
+ self.assertEqual('somevalue', rd.getVar('MYVARIABLE', True))
+
+ def test_list_recipes(self):
+ with bb.tinfoil.Tinfoil() as tinfoil:
+ tinfoil.prepare(config_only=False, quiet=2)
+ # Check pkg_pn
+ checkpns = ['tar', 'automake', 'coreutils', 'm4-native', 'nativesdk-gcc']
+ pkg_pn = tinfoil.cooker.recipecaches[''].pkg_pn
+ for pn in checkpns:
+ self.assertIn(pn, pkg_pn)
+ # Check pkg_fn
+ checkfns = {'nativesdk-gcc': '^virtual:nativesdk:.*', 'coreutils': '.*/coreutils_.*.bb'}
+ for fn, pn in tinfoil.cooker.recipecaches[''].pkg_fn.items():
+ if pn in checkpns:
+ if pn in checkfns:
+ self.assertTrue(re.match(checkfns[pn], fn), 'Entry for %s: %s did not match %s' % (pn, fn, checkfns[pn]))
+ checkpns.remove(pn)
+ if checkpns:
+ self.fail('Unable to find pkg_fn entries for: %s' % ', '.join(checkpns))
+
+ def test_wait_event(self):
+ with bb.tinfoil.Tinfoil() as tinfoil:
+ tinfoil.prepare(config_only=True)
+ # Need to drain events otherwise events that will be masked will still be in the queue
+ while tinfoil.wait_event(0.25):
+ pass
+ tinfoil.set_event_mask(['bb.event.FilesMatchingFound', 'bb.command.CommandCompleted'])
+ pattern = 'conf'
+ res = tinfoil.run_command('findFilesMatchingInDir', pattern, 'conf/machine')
+ self.assertTrue(res)
+
+ eventreceived = False
+ waitcount = 5
+ while waitcount > 0:
+ event = tinfoil.wait_event(1)
+ if event:
+ if isinstance(event, bb.command.CommandCompleted):
+ break
+ elif isinstance(event, bb.event.FilesMatchingFound):
+ self.assertEqual(pattern, event._pattern)
+ self.assertIn('qemuarm.conf', event._matches)
+ eventreceived = True
+ else:
+ self.fail('Unexpected event: %s' % event)
+
+ waitcount = waitcount - 1
+
+ self.assertNotEqual(waitcount, 0, 'Timed out waiting for CommandCompleted event from bitbake server')
+ self.assertTrue(eventreceived, 'Did not receive FilesMatchingFound event from bitbake server')
+
+ def test_setvariable_clean(self):
+ # First check that setVariable affects the datastore
+ with bb.tinfoil.Tinfoil() as tinfoil:
+ tinfoil.prepare(config_only=True)
+ tinfoil.run_command('setVariable', 'TESTVAR', 'specialvalue')
+ self.assertEqual(tinfoil.config_data.getVar('TESTVAR', True), 'specialvalue', 'Value set using setVariable is not reflected in client-side getVar()')
+
+ # Now check that the setVariable's effects are no longer present
+ # (this may legitimately break in future if we stop reinitialising
+ # the datastore, in which case we'll have to reconsider use of
+ # setVariable entirely)
+ with bb.tinfoil.Tinfoil() as tinfoil:
+ tinfoil.prepare(config_only=True)
+ self.assertNotEqual(tinfoil.config_data.getVar('TESTVAR', True), 'specialvalue', 'Value set using setVariable is still present!')
+
+ # Now check that setVar on the main datastore works (uses setVariable internally)
+ with bb.tinfoil.Tinfoil() as tinfoil:
+ tinfoil.prepare(config_only=True)
+ tinfoil.config_data.setVar('TESTVAR', 'specialvalue')
+ value = tinfoil.run_command('getVariable', 'TESTVAR')
+ self.assertEqual(value, 'specialvalue', 'Value set using config_data.setVar() is not reflected in config_data.getVar()')
+
--
2.5.5
^ permalink raw reply related
* [PATCH 13/14] oe-selftest: devtool: improve test_devtool_modify slightly
From: Paul Eggleton @ 2016-12-13 7:09 UTC (permalink / raw)
To: openembedded-core
In-Reply-To: <cover.1481612135.git.paul.eggleton@linux.intel.com>
* Check that man .in file actually gets modified, since sed -i doesn't
fail if it it doesn't
* Use a variable for man file path
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
meta/lib/oeqa/selftest/devtool.py | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/meta/lib/oeqa/selftest/devtool.py b/meta/lib/oeqa/selftest/devtool.py
index 7db286f..5f4e828 100644
--- a/meta/lib/oeqa/selftest/devtool.py
+++ b/meta/lib/oeqa/selftest/devtool.py
@@ -439,7 +439,15 @@ class DevtoolTests(DevtoolBase):
# Try building
bitbake('mdadm')
# Try making (minor) modifications to the source
- result = runCmd("sed -i 's!^\.TH.*!.TH MDADM 8 \"\" v9.999-custom!' %s" % os.path.join(tempdir, 'mdadm.8.in'))
+ modfile = os.path.join(tempdir, 'mdadm.8.in')
+ result = runCmd("sed -i 's!^\.TH.*!.TH MDADM 8 \"\" v9.999-custom!' %s" % modfile)
+ sedline = ''
+ with open(modfile, 'r') as f:
+ for line in f:
+ if line.startswith('.TH'):
+ sedline = line.rstrip()
+ break
+ self.assertEqual(sedline, '.TH MDADM 8 "" v9.999-custom', 'man .in file not modified (sed failed)')
bitbake('mdadm -c package')
pkgd = get_bb_var('PKGD', 'mdadm')
self.assertTrue(pkgd, 'Could not query PKGD variable')
@@ -447,10 +455,11 @@ class DevtoolTests(DevtoolBase):
self.assertTrue(mandir, 'Could not query mandir variable')
if mandir[0] == '/':
mandir = mandir[1:]
- with open(os.path.join(pkgd, mandir, 'man8', 'mdadm.8'), 'r') as f:
+ manfile = os.path.join(pkgd, mandir, 'man8', 'mdadm.8')
+ with open(manfile, 'r') as f:
for line in f:
if line.startswith('.TH'):
- self.assertEqual(line.rstrip(), '.TH MDADM 8 "" v9.999-custom', 'man file not modified. man searched file path: %s' % os.path.join(pkgd, mandir, 'man8', 'mdadm.8'))
+ self.assertEqual(line.rstrip(), '.TH MDADM 8 "" v9.999-custom', 'man file not modified. man searched file path: %s' % manfile)
# Test devtool reset
stampprefix = get_bb_var('STAMP', 'mdadm')
result = runCmd('devtool reset mdadm')
--
2.5.5
^ permalink raw reply related
* [PATCH 12/14] devtool: prevent BBHandledException from showing traceback
From: Paul Eggleton @ 2016-12-13 7:09 UTC (permalink / raw)
To: openembedded-core
In-Reply-To: <cover.1481612135.git.paul.eggleton@linux.intel.com>
If we don't catch this then attempting to run devtool in non-memres mode
when bitbake is already running will produce a traceback instead of just
an error message.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
scripts/devtool | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/scripts/devtool b/scripts/devtool
index 0c32c50..656898a 100755
--- a/scripts/devtool
+++ b/scripts/devtool
@@ -288,11 +288,14 @@ def main():
scriptutils.logger_setup_color(logger, global_args.color)
if global_args.bbpath is None:
- tinfoil = setup_tinfoil(config_only=True, basepath=basepath)
try:
- global_args.bbpath = tinfoil.config_data.getVar('BBPATH', True)
- finally:
- tinfoil.shutdown()
+ tinfoil = setup_tinfoil(config_only=True, basepath=basepath)
+ try:
+ global_args.bbpath = tinfoil.config_data.getVar('BBPATH', True)
+ finally:
+ tinfoil.shutdown()
+ except bb.BBHandledException:
+ return 2
for path in [scripts_path] + global_args.bbpath.split(':'):
pluginpath = os.path.join(path, 'lib', 'devtool')
--
2.5.5
^ permalink raw reply related
* [PATCH 11/14] devtool: extract: disable basehash mismatch errors
From: Paul Eggleton @ 2016-12-13 7:09 UTC (permalink / raw)
To: openembedded-core
In-Reply-To: <cover.1481612135.git.paul.eggleton@linux.intel.com>
Using the setVariable commands here followed by buildFile will result in
"basehash mismatch" errors, and that's expected since we are deviating
*at runtime* from what was previously seen by changing these variable
values. Set BB_HASH_IGNORE_MISMATCH to turn off the errors.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
scripts/lib/devtool/standard.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index fbd8a71..c52b006 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -497,6 +497,7 @@ def _extract_source(srctree, keep_temp, devbranch, sync, d, tinfoil):
tinfoil.config_data.setVar('T', os.path.join(tempdir, 'temp'))
tinfoil.config_data.setVar('BUILDCFG_FUNCS', '')
tinfoil.config_data.setVar('BUILDCFG_HEADER', '')
+ tinfoil.config_data.setVar('BB_HASH_IGNORE_MISMATCH', '1')
tinfoil.set_event_mask(['bb.event.BuildStarted',
'bb.event.BuildCompleted',
--
2.5.5
^ permalink raw reply related
* [PATCH 10/14] lib/oe/recipeutils: drop parse_recipe_simple()
From: Paul Eggleton @ 2016-12-13 7:09 UTC (permalink / raw)
To: openembedded-core
In-Reply-To: <cover.1481612135.git.paul.eggleton@linux.intel.com>
This was intended to be used with tinfoil, but tinfoil now has its own
parse_recipe() method to do this which works properly in the memres
case.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
meta/lib/oe/recipeutils.py | 22 ----------------------
1 file changed, 22 deletions(-)
diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py
index 92fa431..26c926f 100644
--- a/meta/lib/oe/recipeutils.py
+++ b/meta/lib/oe/recipeutils.py
@@ -52,28 +52,6 @@ def parse_recipe(cooker, fn, appendfiles):
return envdata
-def parse_recipe_simple(cooker, pn, d, appends=True):
- """
- Parse a recipe and optionally all bbappends that apply to it
- in the current configuration.
- """
- import bb.providers
-
- recipefile = pn_to_recipe(cooker, pn)
- if not recipefile:
- skipreasons = get_unavailable_reasons(cooker, pn)
- # We may as well re-use bb.providers.NoProvider here
- if skipreasons:
- raise bb.providers.NoProvider(skipreasons)
- else:
- raise bb.providers.NoProvider('Unable to find any recipe file matching %s' % pn)
- if appends:
- appendfiles = cooker.collection.get_file_appends(recipefile)
- else:
- appendfiles = None
- return parse_recipe(cooker, recipefile, appendfiles)
-
-
def get_var_files(fn, varlist, d):
"""Find the file in which each of a list of variables is set.
Note: requires variable history to be enabled when parsing.
--
2.5.5
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox