Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] webkitgtk: Add an option to disable opengl support
From: Carlos Alberto Lopez Perez @ 2016-11-09 14:39 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Carlos Alberto Lopez Perez <clopez@igalia.com>
---
 meta/recipes-sato/webkit/webkitgtk_2.14.1.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-sato/webkit/webkitgtk_2.14.1.bb b/meta/recipes-sato/webkit/webkitgtk_2.14.1.bb
index 69c9f11..d6d9c14 100644
--- a/meta/recipes-sato/webkit/webkitgtk_2.14.1.bb
+++ b/meta/recipes-sato/webkit/webkitgtk_2.14.1.bb
@@ -41,7 +41,7 @@ DEPENDS = "zlib libsoup-2.4 curl libxml2 cairo libxslt libxt libidn gnutls \
           "
 
 PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', 'wayland' ,d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'webgl', '' ,d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'webgl opengl', '' ,d)} \
                    enchant \
                    libsecret \
                   "
@@ -53,6 +53,7 @@ PACKAGECONFIG[enchant] = "-DENABLE_SPELLCHECK=ON,-DENABLE_SPELLCHECK=OFF,enchant
 PACKAGECONFIG[gtk2] = "-DENABLE_PLUGIN_PROCESS_GTK2=ON,-DENABLE_PLUGIN_PROCESS_GTK2=OFF,gtk+"
 PACKAGECONFIG[gles2] = "-DENABLE_GLES2=ON,-DENABLE_GLES2=OFF,virtual/libgles2"
 PACKAGECONFIG[webgl] = "-DENABLE_WEBGL=ON,-DENABLE_WEBGL=OFF,virtual/libgl"
+PACKAGECONFIG[opengl] = "-DENABLE_OPENGL=ON,-DENABLE_OPENGL=OFF,virtual/libgl"
 PACKAGECONFIG[libsecret] = "-DENABLE_CREDENTIAL_STORAGE=ON,-DENABLE_CREDENTIAL_STORAGE=OFF,libsecret"
 PACKAGECONFIG[libhyphen] = "-DUSE_LIBHYPHEN=ON,-DUSE_LIBHYPHEN=OFF,libhyphen"
 
-- 
2.1.4



^ permalink raw reply related

* Re: [PATCH] weston: upgrade from 1.11.1 to 1.12.0
From: Fathi Boudra @ 2016-11-09 14:41 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core
In-Reply-To: <CAJTo0LZhZi+hgbUvd87E413nEOKP3g5uGY2eqZB5yX2ydHZKGA@mail.gmail.com>

On 9 November 2016 at 14:15, Burton, Ross <ross.burton@intel.com> wrote:
>
> On 8 November 2016 at 13:54, Fathi Boudra <fathi.boudra@linaro.org> wrote:
>>
>>  FILES_${PN}-xwayland = "${libdir}/${BPN}/xwayland.so"
>
>
> Because you didn't fix this patch the weston-xwayland package is never
> built, buildhistory is huge and core-image-weston with X11 enabled doesn't
> build.

I'll spin a v2 with Jussi suggested split.


^ permalink raw reply

* [PATCH] openssl: fix bashism in c_rehash shell script
From: André Draszik @ 2016-11-09 14:48 UTC (permalink / raw)
  To: openembedded-core

From: André Draszik <adraszik@tycoint.com>

This script claims to be a /bin/sh script, but it uses
a bashism:

from checkbashisms:

possible bashism in meta/recipes-connectivity/openssl/openssl/openssl-c_rehash.sh line 151 (should be 'b = a'):
	    if [ "x/" == "x$( echo ${FILE} | cut -c1 -)" ]

This causes build issues on systems that don't have
/bin/sh symlinked to bash:

Updating certificates in ${WORKDIR}/rootfs/etc/ssl/certs...
<builddir>/tmp/sysroots/x86_64-linux/usr/bin/c_rehash: 151: [: x/: unexpected operator
 ...

Fix this by using POSIX shell syntax for the comparison.

Signed-off-by: André Draszik <adraszik@tycoint.com>
Reviewed-by: Sylvain Lemieux <slemieux@tycoint.com>
---
 meta/recipes-connectivity/openssl/openssl/openssl-c_rehash.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-connectivity/openssl/openssl/openssl-c_rehash.sh b/meta/recipes-connectivity/openssl/openssl/openssl-c_rehash.sh
index 25ea729..6620fdc 100644
--- a/meta/recipes-connectivity/openssl/openssl/openssl-c_rehash.sh
+++ b/meta/recipes-connectivity/openssl/openssl/openssl-c_rehash.sh
@@ -148,7 +148,7 @@ hash_dir()
 	then
 	    FILE=$( readlink ${FILE} )
 	    # check the symlink is absolute (or dangling in other word)
-	    if [ "x/" == "x$( echo ${FILE} | cut -c1 -)" ]
+	    if [ "x/" = "x$( echo ${FILE} | cut -c1 -)" ]
 	    then
 		REAL_FILE=${SYSROOT}/${FILE}
 	    fi
-- 
2.10.2



^ permalink raw reply related

* Re: [PATCH] curl: Upgrade 7.50.1.bb -> curl_7.51.0.bb
From: akuster808 @ 2016-11-09 15:16 UTC (permalink / raw)
  To: Sona Sarmadi, Richard Purdie (richard.purdie@linuxfoundation.org)
  Cc: openembedded-core@lists.openembedded.org
In-Reply-To: <3230301C09DEF9499B442BBE162C5E48ABEB644D@SESTOEX04.enea.se>



On 11/09/2016 03:58 AM, Sona Sarmadi wrote:
> Hi guys,
>
> curl 7.51.0-r0 addresses all these CVEs. I wonder if we can upgrade krogoth and morty to curl 7.51.0-r0 as well?
Updating morty seems plausible . I appears the changes are mostly bug fixes.
Krogoth is a large jump and I would not recommend upgrading the package.

- Armin

> Both package versions are using same share library version i.e. libcurl.so.4.4.0 so I assume full ABI compatibility.
>
> tmp/work/i586-poky-linux/curl/7.47.1-r0/sysroot-destdir/usr/lib/libcurl.so.4.4.0
> tmp/work/i586-poky-linux/curl/7.51.0-r0/sysroot-destdir/usr/lib/libcurl.so.4.4.0
>
> For more info see:
> https://bugzilla.yoctoproject.org/show_bug.cgi?id=10617
>
> Thanks
> //Sona
> -----Original Message-----
> From: openembedded-core-bounces@lists.openembedded.org [mailto:openembedded-core-bounces@lists.openembedded.org] On Behalf Of Sona Sarmadi
> Sent: den 8 november 2016 11:42
> To: openembedded-core@lists.openembedded.org
> Subject: [OE-core] [PATCH] curl: Upgrade 7.50.1.bb -> curl_7.51.0.bb
>
> The upgrade addresses following CVEs:
> CVE-2016-8615: cookie injection for other servers
> CVE-2016-8616: case insensitive password comparison
> CVE-2016-8617: OOB write via unchecked multiplication
> CVE-2016-8618: double-free in curl_maprintf
> CVE-2016-8619: double-free in krb5 code
> CVE-2016-8620: glob parser write/read out of bounds
> CVE-2016-8621: curl_getdate read out of bounds
> CVE-2016-8622: URL unescape heap overflow via integer truncation
> CVE-2016-8623: Use-after-free via shared cookies
> CVE-2016-8624: invalid URL parsing with '#'
> CVE-2016-8625: IDNA 2003 makes curl use wrong host
>
> Reference:
> https://curl.haxx.se/docs/security.html
>
> Fixes [Yocto #10617]
>
> Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
> ---
>   meta/recipes-support/curl/{curl_7.50.1.bb => curl_7.51.0.bb} | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)  rename meta/recipes-support/curl/{curl_7.50.1.bb => curl_7.51.0.bb} (94%)
>
> diff --git a/meta/recipes-support/curl/curl_7.50.1.bb b/meta/recipes-support/curl/curl_7.51.0.bb
> similarity index 94%
> rename from meta/recipes-support/curl/curl_7.50.1.bb
> rename to meta/recipes-support/curl/curl_7.51.0.bb
> index a21419a..e1a996b 100644
> --- a/meta/recipes-support/curl/curl_7.50.1.bb
> +++ b/meta/recipes-support/curl/curl_7.51.0.bb
> @@ -14,8 +14,8 @@ SRC_URI = "http://curl.haxx.se/download/curl-${PV}.tar.bz2 \  #  SRC_URI += " file://configure_ac.patch"
>   
> -SRC_URI[md5sum] = "015f6a0217ca6f2c5442ca406476920b"
> -SRC_URI[sha256sum] = "3c12c5f54ccaa1d40abc65d672107dcc75d3e1fcb38c267484334280096e5156"
> +SRC_URI[md5sum] = "09a7c5769a7eae676d5e2c86d51f167e"
> +SRC_URI[sha256sum] = "7f8240048907e5030f67be0a6129bc4b333783b9cca1391026d700835a788dde"
>   
>   inherit autotools pkgconfig binconfig multilib_header
>   
> --
> 1.9.1
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core



^ permalink raw reply

* Re: krogoth 2.1.2 status
From: akuster808 @ 2016-11-09 15:20 UTC (permalink / raw)
  To: Richard Purdie, openembedded-core
In-Reply-To: <1478694607.23123.176.camel@linuxfoundation.org>



On 11/09/2016 04:30 AM, Richard Purdie wrote:
> I ran a krogoth 2.1.2 build. It did have some issues:
>
> * one runtime sanity test had a timeout issue
> * some urls are stale (perpetual problem)
> * musl runtime testing fails (never tested on krogoth previously)
> * no-x11 runtime testing had a failure (never tested on krogoth
> previously)
Can we get those issues bugged ( if not done so already) so we can make 
decisions on what to do with each.
>
> I suspect we can call this good enough to put into QA but there were
> enough 'failures' I wanted to send this out in case someone objects.
>
> Part of the problem here is we apply our current autobuilder test setup
> to the older releases as well. I'm aware there may be better ways to do
> this but I don't know anyone with time to work on that, we have other
> more pressing problems.
I suspect Jethro will have similar or worse issues.

- Armin
>
> Cheers,
>
> Richard
>



^ permalink raw reply

* [PATCH] glib-networking: remove intltool dependency
From: Ross Burton @ 2016-11-09 17:26 UTC (permalink / raw)
  To: openembedded-core

glib-networking 2.50 moved away from intltool to modern gettext, so remove the build dependency.

Signed-off-by: Ross Burton <ross.burton@intel.com>
---
 meta/recipes-core/glib-networking/glib-networking_2.50.0.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-core/glib-networking/glib-networking_2.50.0.bb b/meta/recipes-core/glib-networking/glib-networking_2.50.0.bb
index 0baaffd..2782bd9 100644
--- a/meta/recipes-core/glib-networking/glib-networking_2.50.0.bb
+++ b/meta/recipes-core/glib-networking/glib-networking_2.50.0.bb
@@ -7,7 +7,7 @@ LICENSE = "LGPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2"
 
 SECTION = "libs"
-DEPENDS = "glib-2.0 intltool-native"
+DEPENDS = "glib-2.0"
 
 SRC_URI[archive.md5sum] = "4d06d0224646f274918b1cb6da9a07f6"
 SRC_URI[archive.sha256sum] = "3f1a442f3c2a734946983532ce59ed49120319fdb10c938447c373d5e5286bee"
-- 
2.8.1



^ permalink raw reply related

* [PATCH] Move the recommends on ca-certificates from epiphany to webkitgtk.
From: Carlos Alberto Lopez Perez @ 2016-11-09 17:39 UTC (permalink / raw)
  To: openembedded-core

 * The webkitgtk package should recommend the ca-certificates one,
   because any program usign webkit (and not only epiphany) would
   expect that the CAs certificates are available and that https
   validation works as expected.

 * For example, webkitgtk includes a MiniBrowser program that would
   fail to proper verify https sites if the ca-certificate package
   is not installed

 * Instead of making each one of the webkitgtk consumers care about
   the certificate package, do this in webkit itself.

Signed-off-by: Carlos Alberto Lopez Perez <clopez@igalia.com>
---
 meta/recipes-gnome/epiphany/epiphany_3.22.1.bb | 3 +--
 meta/recipes-sato/webkit/webkitgtk_2.14.1.bb   | 2 ++
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-gnome/epiphany/epiphany_3.22.1.bb b/meta/recipes-gnome/epiphany/epiphany_3.22.1.bb
index 3c63d33..2a9d200 100644
--- a/meta/recipes-gnome/epiphany/epiphany_3.22.1.bb
+++ b/meta/recipes-gnome/epiphany/epiphany_3.22.1.bb
@@ -2,7 +2,7 @@ SUMMARY = "WebKit based web browser for GNOME"
 LICENSE = "GPLv2+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
 
-DEPENDS = "libsoup-2.4 webkitgtk gtk+3 iso-codes ca-certificates avahi libnotify gcr \
+DEPENDS = "libsoup-2.4 webkitgtk gtk+3 iso-codes avahi libnotify gcr \
 	   gsettings-desktop-schemas gnome-desktop3 libxml2-native intltool-native"
 
 inherit gnomebase gsettings distro_features_check upstream-version-is-even
@@ -20,4 +20,3 @@ do_configure_prepend() {
 
 FILES_${PN} += "${datadir}/appdata ${datadir}/dbus-1 ${datadir}/gnome-shell/search-providers"
 RDEPENDS_${PN} = "iso-codes adwaita-icon-theme"
-RRECOMMENDS_${PN} = "ca-certificates"
diff --git a/meta/recipes-sato/webkit/webkitgtk_2.14.1.bb b/meta/recipes-sato/webkit/webkitgtk_2.14.1.bb
index d6d9c14..39197bc 100644
--- a/meta/recipes-sato/webkit/webkitgtk_2.14.1.bb
+++ b/meta/recipes-sato/webkit/webkitgtk_2.14.1.bb
@@ -90,6 +90,8 @@ SECURITY_CFLAGS_append_aarch64 = " -fPIE"
 
 FILES_${PN} += "${libdir}/webkit2gtk-4.0/injected-bundle/libwebkit2gtkinjectedbundle.so"
 
+RRECOMMENDS_${PN} += "ca-certificates"
+
 # http://errors.yoctoproject.org/Errors/Details/20370/
 ARM_INSTRUCTION_SET_armv4 = "arm"
 ARM_INSTRUCTION_SET_armv5 = "arm"
-- 
2.1.4



^ permalink raw reply related

* Re: [PATCH] kernel.bbclass: Allow ${S} to be overridden
From: Paul Barker @ 2016-11-09 18:08 UTC (permalink / raw)
  To: Bruce Ashfield; +Cc: OpenEmbedded Core
In-Reply-To: <CADkTA4NmhstuGn7cZLD-MGB1OdNbAFLkiOKrf20Bri0KSEsuQA@mail.gmail.com>

On Wed, 9 Nov 2016 08:09:09 -0500
Bruce Ashfield <bruce.ashfield@gmail.com> wrote:

> On Wed, Nov 9, 2016 at 5:04 AM, Burton, Ross <ross.burton@intel.com> wrote:
> 
> >
> > On 9 November 2016 at 02:23, Bruce Ashfield <bruce.ashfield@gmail.com>
> > wrote:
> >
> >> I can ack this patch, since no defaults change .. there's no risk to
> >> existing users.
> >>
> >
> > Saying that of course doomed the patch:
> >
> 
> interesting.
> 
> Paul: obviously you were building with this in place, and my local test did
> work here
> as well .. so any idea to the difference ?
> 
> Let me know if you want any help looking into it.
> 
> Cheers,
> 
> Bruce
> 

The reason for this patch is that I'm using a tarball for the kernel
sources in the new meta-arduino layer. That tarball doesn't get
extracted to ${STAGING_KERNEL_DIR} and so it needs to be copied over to
there. Looking at kernel.bbclass, it looks like the logic to do this is
present:


    # Old style kernels may set ${S} = ${WORKDIR}/git for example
    # We need to move these over to STAGING_KERNEL_DIR. We can't just
    # create the symlink in advance as the git fetcher can't cope with
    # the symlink.
    do_unpack[cleandirs] += " ${S} ${STAGING_KERNEL_DIR} ${B} ${STAGING_KERNEL_BUILDDIR}"
    do_clean[cleandirs] += " ${S} ${STAGING_KERNEL_DIR} ${B} ${STAGING_KERNEL_BUILDDIR}"
    base_do_unpack_append () {
        s = d.getVar("S", True)
        if s[-1] == '/':
            # drop trailing slash, so that os.symlink(kernsrc, s) doesn't use s as directory name and fail
            s=s[:-1]
        kernsrc = d.getVar("STAGING_KERNEL_DIR", True)
        if s != kernsrc:
            bb.utils.mkdirhier(kernsrc)
            bb.utils.remove(kernsrc, recurse=True)
            if d.getVar("EXTERNALSRC", True):
                # With EXTERNALSRC S will not be wiped so we can symlink to it
                os.symlink(s, kernsrc)
            else:
                import shutil
                shutil.move(s, kernsrc)
                os.symlink(kernsrc, s)
    }

The problem is we can't set S to anything unless we can override it.

I've now looked into this futher and it seems to be working for some
kernel recipes but not others. The issue may be that we have an
assignment for S in bitbake.conf:

    S = "${WORKDIR}/${BP}"

That's obviously overriding the 'S ?= ...' assignment when my patch is
applied where S isn't also explicitly assigned in the recipe, some
other class or include file.

I'm not sure on how precedence is determined if a variable is assigned
using '=' multiple times.

I'll have another look into it and see where I get. I have a workaround
in place for the meta-arduino layer for now so it doesn't need an
urgent fix.

However, if it turns out we can't reliably override S in a kernel recipe
then should we still have that comment and base_do_unpack_append() in
kernel.bbclass?

Thanks,
Paul


^ permalink raw reply

* Re: krogoth 2.1.2 status
From: Perez Carranza, Jose @ 2016-11-09 22:04 UTC (permalink / raw)
  To: Richard Purdie, openembedded-core, Armin Kuster
In-Reply-To: <1478694607.23123.176.camel@linuxfoundation.org>

Hi 

Based on below comments we will start the QA cycle for 2.1.2, we will start tomorrow once the QA cycle for meta-intel is finished. 

Regards,
José


-----Original Message-----
From: Richard Purdie [mailto:richard.purdie@linuxfoundation.org] 
Sent: Wednesday, November 9, 2016 6:30 AM
To: openembedded-core <openembedded-core@lists.openembedded.org>; Armin Kuster <akuster808@gmail.com>
Cc: Perez Carranza, Jose <jose.perez.carranza@intel.com>; Jolley, Stephen K <stephen.k.jolley@intel.com>; Delgado, Sonia <sonia.delgado@intel.com>
Subject: krogoth 2.1.2 status

I ran a krogoth 2.1.2 build. It did have some issues:

* one runtime sanity test had a timeout issue
* some urls are stale (perpetual problem)
* musl runtime testing fails (never tested on krogoth previously)
* no-x11 runtime testing had a failure (never tested on krogoth
previously)

I suspect we can call this good enough to put into QA but there were enough 'failures' I wanted to send this out in case someone objects.

Part of the problem here is we apply our current autobuilder test setup to the older releases as well. I'm aware there may be better ways to do this but I don't know anyone with time to work on that, we have other more pressing problems.

Cheers,

Richard


^ permalink raw reply

* [PATCH] python3-numpy: upgrade to 1.11.2
From: Edwin Plauchu @ 2016-11-09 23:41 UTC (permalink / raw)
  To: openembedded-core


Signed-off-by: Edwin Plauchu <edwin.plauchu.camacho@linux.intel.com>

---
 .../python-numpy/{python3-numpy_1.11.0.bb => python3-numpy_1.11.2.bb} | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
 rename meta/recipes-devtools/python-numpy/{python3-numpy_1.11.0.bb => python3-numpy_1.11.2.bb} (95%)

diff --git a/meta/recipes-devtools/python-numpy/python3-numpy_1.11.0.bb b/meta/recipes-devtools/python-numpy/python3-numpy_1.11.2.bb
similarity index 95%
rename from meta/recipes-devtools/python-numpy/python3-numpy_1.11.0.bb
rename to meta/recipes-devtools/python-numpy/python3-numpy_1.11.2.bb
index 3cca223..c34df6f 100644
--- a/meta/recipes-devtools/python-numpy/python3-numpy_1.11.0.bb
+++ b/meta/recipes-devtools/python-numpy/python3-numpy_1.11.2.bb
@@ -73,8 +73,8 @@ do_compile_prepend_class-target() {
 
 FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/numpy/core/lib/*.a"
 
-SRC_URI[md5sum] = "bc56fb9fc2895aa4961802ffbdb31d0b"
-SRC_URI[sha256sum] = "a1d1268d200816bfb9727a7a27b78d8e37ecec2e4d5ebd33eb64e2789e0db43e"
+SRC_URI[md5sum] = "03bd7927c314c43780271bf1ab795ebc"
+SRC_URI[sha256sum] = "04db2fbd64e2e7c68e740b14402b25af51418fc43a59d9e54172b38b906b0f69"
 
 # install what is needed for numpy.test()
 RDEPENDS_${PN} = "python3-unittest \
-- 
1.9.1



^ permalink raw reply related

* Re: [PATCH] kernel.bbclass: Allow ${S} to be overridden
From: Andre McCurdy @ 2016-11-09 23:42 UTC (permalink / raw)
  To: Paul Barker; +Cc: OpenEmbedded Core
In-Reply-To: <20161109180854.130d6804@nuc.betafive.co.uk>

On Wed, Nov 9, 2016 at 10:08 AM, Paul Barker <paul@paulbarker.me.uk> wrote:
> On Wed, 9 Nov 2016 08:09:09 -0500
> Bruce Ashfield <bruce.ashfield@gmail.com> wrote:
>
>> On Wed, Nov 9, 2016 at 5:04 AM, Burton, Ross <ross.burton@intel.com> wrote:
>>
>> >
>> > On 9 November 2016 at 02:23, Bruce Ashfield <bruce.ashfield@gmail.com>
>> > wrote:
>> >
>> >> I can ack this patch, since no defaults change .. there's no risk to
>> >> existing users.
>> >>
>> >
>> > Saying that of course doomed the patch:
>> >
>>
>> interesting.
>>
>> Paul: obviously you were building with this in place, and my local test did
>> work here
>> as well .. so any idea to the difference ?
>>
>> Let me know if you want any help looking into it.
>>
>> Cheers,
>>
>> Bruce
>>
>
> The reason for this patch is that I'm using a tarball for the kernel
> sources in the new meta-arduino layer. That tarball doesn't get
> extracted to ${STAGING_KERNEL_DIR} and so it needs to be copied over to
> there. Looking at kernel.bbclass, it looks like the logic to do this is
> present:
>
>
>     # Old style kernels may set ${S} = ${WORKDIR}/git for example
>     # We need to move these over to STAGING_KERNEL_DIR. We can't just
>     # create the symlink in advance as the git fetcher can't cope with
>     # the symlink.
>     do_unpack[cleandirs] += " ${S} ${STAGING_KERNEL_DIR} ${B} ${STAGING_KERNEL_BUILDDIR}"
>     do_clean[cleandirs] += " ${S} ${STAGING_KERNEL_DIR} ${B} ${STAGING_KERNEL_BUILDDIR}"
>     base_do_unpack_append () {
>         s = d.getVar("S", True)
>         if s[-1] == '/':
>             # drop trailing slash, so that os.symlink(kernsrc, s) doesn't use s as directory name and fail
>             s=s[:-1]
>         kernsrc = d.getVar("STAGING_KERNEL_DIR", True)
>         if s != kernsrc:
>             bb.utils.mkdirhier(kernsrc)
>             bb.utils.remove(kernsrc, recurse=True)
>             if d.getVar("EXTERNALSRC", True):
>                 # With EXTERNALSRC S will not be wiped so we can symlink to it
>                 os.symlink(s, kernsrc)
>             else:
>                 import shutil
>                 shutil.move(s, kernsrc)
>                 os.symlink(kernsrc, s)
>     }
>
> The problem is we can't set S to anything unless we can override it.
>
> I've now looked into this futher and it seems to be working for some
> kernel recipes but not others. The issue may be that we have an
> assignment for S in bitbake.conf:
>
>     S = "${WORKDIR}/${BP}"
>
> That's obviously overriding the 'S ?= ...' assignment when my patch is
> applied where S isn't also explicitly assigned in the recipe, some
> other class or include file.
>
> I'm not sure on how precedence is determined if a variable is assigned
> using '=' multiple times.
>
> I'll have another look into it and see where I get. I have a workaround
> in place for the meta-arduino layer for now so it doesn't need an
> urgent fix.
>
> However, if it turns out we can't reliably override S in a kernel recipe
> then should we still have that comment and base_do_unpack_append() in
> kernel.bbclass?

The solution I use (learned the hard way) is to ensure that "S = ..."
comes after "inherit kernel" in the kernel recipe.

> Thanks,
> Paul
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


^ permalink raw reply

* [PATCH 2/2] go-examples: Add an example, helloworld written in go
From: Khem Raj @ 2016-11-10  0:39 UTC (permalink / raw)
  To: openembedded-core
In-Reply-To: <20161110003935.1858-1-raj.khem@gmail.com>

This should serve as temlate for writing go recipes

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/recipes-extended/go-examples/files/helloworld.go  | 10 ++++++++++
 meta/recipes-extended/go-examples/go-examples.inc      | 10 ++++++++++
 meta/recipes-extended/go-examples/go-helloworld_0.1.bb | 15 +++++++++++++++
 3 files changed, 35 insertions(+)
 create mode 100644 meta/recipes-extended/go-examples/files/helloworld.go
 create mode 100644 meta/recipes-extended/go-examples/go-examples.inc
 create mode 100644 meta/recipes-extended/go-examples/go-helloworld_0.1.bb

diff --git a/meta/recipes-extended/go-examples/files/helloworld.go b/meta/recipes-extended/go-examples/files/helloworld.go
new file mode 100644
index 0000000..0253c40
--- /dev/null
+++ b/meta/recipes-extended/go-examples/files/helloworld.go
@@ -0,0 +1,10 @@
+// You can edit this code!
+// Click here and start typing.
+// taken from https://golang.org/
+package main
+
+import "fmt"
+
+func main() {
+	fmt.Println("Hello, 世界")
+}
diff --git a/meta/recipes-extended/go-examples/go-examples.inc b/meta/recipes-extended/go-examples/go-examples.inc
new file mode 100644
index 0000000..c632681
--- /dev/null
+++ b/meta/recipes-extended/go-examples/go-examples.inc
@@ -0,0 +1,10 @@
+DESCRIPTION = "This is a simple example recipe that cross-compiles a Go program."
+SECTION = "examples"
+HOMEPAGE = "https://golang.org/"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
+
+S = "${WORKDIR}"
+
+inherit go
diff --git a/meta/recipes-extended/go-examples/go-helloworld_0.1.bb b/meta/recipes-extended/go-examples/go-helloworld_0.1.bb
new file mode 100644
index 0000000..af9d3b7
--- /dev/null
+++ b/meta/recipes-extended/go-examples/go-helloworld_0.1.bb
@@ -0,0 +1,15 @@
+require go-examples.inc
+
+
+SRC_URI += " \
+  file://helloworld.go \
+"
+
+do_compile() {
+  go build helloworld.go
+}
+
+do_install() {
+  install -d "${D}/${bindir}"
+  install -m 0755 "${S}/helloworld" "${D}/${bindir}"
+}
-- 
2.10.2



^ permalink raw reply related

* [PATCH 1/2] go: Add recipes for golang compilers and tools
From: Khem Raj @ 2016-11-10  0:39 UTC (permalink / raw)
  To: openembedded-core

This is converging the recipes for go from
meta-virtualization and oe-meta-go

Add recipes for go 1.7

go.bbclass is added to ease out writing
recipes for go packages

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/classes/go.bbclass                            |  74 +++++++
 meta/classes/goarch.bbclass                        |  40 ++++
 meta/recipes-devtools/go/go-1.4.inc                |  15 ++
 .../go/go-1.4/016-armhf-elf-header.patch           |  24 +++
 ...ckport-cmd-link-support-new-386-amd64-rel.patch | 225 +++++++++++++++++++++
 meta/recipes-devtools/go/go-1.4/syslog.patch       |  62 ++++++
 meta/recipes-devtools/go/go-1.6.inc                |  19 ++
 .../go/go-1.6/armhf-elf-header.patch               |  23 +++
 .../go/go-1.6/fix-cc-handling.patch                |  50 +++++
 .../go/go-1.6/fix-target-cc-for-build.patch        |  17 ++
 meta/recipes-devtools/go/go-1.6/gotooldir.patch    |  30 +++
 .../go/go-1.6/split-host-and-target-build.patch    |  63 ++++++
 meta/recipes-devtools/go/go-1.6/syslog.patch       |  62 ++++++
 meta/recipes-devtools/go/go-1.7.inc                |  18 ++
 .../go/go-1.7/armhf-elf-header.patch               |  23 +++
 .../go/go-1.7/fix-cc-handling.patch                |  50 +++++
 .../go/go-1.7/fix-target-cc-for-build.patch        |  17 ++
 meta/recipes-devtools/go/go-1.7/gotooldir.patch    |  30 +++
 .../go/go-1.7/split-host-and-target-build.patch    |  62 ++++++
 meta/recipes-devtools/go/go-1.7/syslog.patch       |  62 ++++++
 meta/recipes-devtools/go/go-common.inc             |  21 ++
 meta/recipes-devtools/go/go-native.inc             |  54 +++++
 meta/recipes-devtools/go/go-native_1.4.bb          |   2 +
 meta/recipes-devtools/go/go.inc                    |  74 +++++++
 meta/recipes-devtools/go/go_1.6.bb                 |   4 +
 meta/recipes-devtools/go/go_1.7.bb                 |   4 +
 26 files changed, 1125 insertions(+)
 create mode 100644 meta/classes/go.bbclass
 create mode 100644 meta/classes/goarch.bbclass
 create mode 100644 meta/recipes-devtools/go/go-1.4.inc
 create mode 100644 meta/recipes-devtools/go/go-1.4/016-armhf-elf-header.patch
 create mode 100644 meta/recipes-devtools/go/go-1.4/go-cross-backport-cmd-link-support-new-386-amd64-rel.patch
 create mode 100644 meta/recipes-devtools/go/go-1.4/syslog.patch
 create mode 100644 meta/recipes-devtools/go/go-1.6.inc
 create mode 100644 meta/recipes-devtools/go/go-1.6/armhf-elf-header.patch
 create mode 100644 meta/recipes-devtools/go/go-1.6/fix-cc-handling.patch
 create mode 100644 meta/recipes-devtools/go/go-1.6/fix-target-cc-for-build.patch
 create mode 100644 meta/recipes-devtools/go/go-1.6/gotooldir.patch
 create mode 100644 meta/recipes-devtools/go/go-1.6/split-host-and-target-build.patch
 create mode 100644 meta/recipes-devtools/go/go-1.6/syslog.patch
 create mode 100644 meta/recipes-devtools/go/go-1.7.inc
 create mode 100644 meta/recipes-devtools/go/go-1.7/armhf-elf-header.patch
 create mode 100644 meta/recipes-devtools/go/go-1.7/fix-cc-handling.patch
 create mode 100644 meta/recipes-devtools/go/go-1.7/fix-target-cc-for-build.patch
 create mode 100644 meta/recipes-devtools/go/go-1.7/gotooldir.patch
 create mode 100644 meta/recipes-devtools/go/go-1.7/split-host-and-target-build.patch
 create mode 100644 meta/recipes-devtools/go/go-1.7/syslog.patch
 create mode 100644 meta/recipes-devtools/go/go-common.inc
 create mode 100644 meta/recipes-devtools/go/go-native.inc
 create mode 100644 meta/recipes-devtools/go/go-native_1.4.bb
 create mode 100644 meta/recipes-devtools/go/go.inc
 create mode 100644 meta/recipes-devtools/go/go_1.6.bb
 create mode 100644 meta/recipes-devtools/go/go_1.7.bb

diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass
new file mode 100644
index 0000000..e10864d
--- /dev/null
+++ b/meta/classes/go.bbclass
@@ -0,0 +1,74 @@
+inherit goarch
+
+GOROOT_class-native = "${STAGING_LIBDIR_NATIVE}/go"
+GOROOT = "${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go"
+GOBIN_FINAL_class-native = "${GOROOT_FINAL}/bin"
+GOBIN_FINAL = "${GOROOT_FINAL}/bin/${GOOS}_${GOARCH}"
+
+export GOOS = "${TARGET_GOOS}"
+export GOARCH = "${TARGET_GOARCH}"
+export GOARM = "${TARGET_GOARM}"
+export CGO_ENABLED = "1"
+export GOROOT
+export GOROOT_FINAL = "${libdir}/${TARGET_SYS}/go"
+export GOBIN_FINAL
+export GOPKG_FINAL = "${GOROOT_FINAL}/pkg/${GOOS}_${GOARCH}"
+export GOSRC_FINAL = "${GOROOT_FINAL}/src"
+export GO_GCFLAGS = "${TARGET_CFLAGS}"
+export GO_LDFLAGS = "${TARGET_LDFLAGS}"
+export CGO_CFLAGS = "${TARGET_CC_ARCH}${TOOLCHAIN_OPTIONS} ${TARGET_CFLAGS}"
+export CGO_CPPFLAGS = "${TARGET_CPPFLAGS}"
+export CGO_CXXFLAGS = "${TARGET_CC_ARCH}${TOOLCHAIN_OPTIONS} ${TARGET_CXXFLAGS}"
+export CGO_LDFLAGS = "${TARGET_CC_ARCH}${TOOLCHAIN_OPTIONS} ${TARGET_LDFLAGS}"
+
+DEPENDS += "go-cross"
+DEPENDS_class-native += "go-native"
+
+INHIBIT_PACKAGE_STRIP = "1"
+
+FILES_${PN}-staticdev += "${GOSRC_FINAL}/${GO_IMPORT}"
+FILES_${PN}-staticdev += "${GOPKG_FINAL}/${GO_IMPORT}*"
+
+GO_INSTALL ?= "${GO_IMPORT}/..."
+
+do_go_compile() {
+	GOPATH=${S}:${STAGING_LIBDIR}/${TARGET_SYS}/go go env
+	if test -n "${GO_INSTALL}" ; then
+		GOPATH=${S}:${STAGING_LIBDIR}/${TARGET_SYS}/go go install -v ${GO_INSTALL}
+	fi
+}
+
+do_go_install() {
+	rm -rf ${WORKDIR}/staging
+	install -d ${WORKDIR}/staging${GOROOT_FINAL} ${D}${GOROOT_FINAL}
+	tar -C ${S} -cf - . | tar -C ${WORKDIR}/staging${GOROOT_FINAL} -xpvf -
+
+	find ${WORKDIR}/staging${GOROOT_FINAL} \( \
+		-name \*.indirectionsymlink -o \
+		-name .git\* -o                \
+		-name .hg -o                   \
+		-name .svn -o                  \
+		-name .pc\* -o                 \
+		-name patches\*                \
+		\) -print0 | \
+	xargs -r0 rm -rf
+
+	tar -C ${WORKDIR}/staging${GOROOT_FINAL} -cf - . | \
+	tar -C ${D}${GOROOT_FINAL} -xpvf -
+
+	chown -R root:root "${D}${GOROOT_FINAL}"
+
+	if test -e "${D}${GOBIN_FINAL}" ; then
+		install -d -m 0755 "${D}${bindir}"
+		find "${D}${GOBIN_FINAL}" ! -type d -print0 | xargs -r0 mv --target-directory="${D}${bindir}"
+		rmdir -p "${D}${GOBIN_FINAL}" || true
+	fi
+}
+
+do_compile() {
+	do_go_compile
+}
+
+do_install() {
+	do_go_install
+}
diff --git a/meta/classes/goarch.bbclass b/meta/classes/goarch.bbclass
new file mode 100644
index 0000000..bb330b1
--- /dev/null
+++ b/meta/classes/goarch.bbclass
@@ -0,0 +1,40 @@
+BUILD_GOOS = "${@go_map_os(d.getVar('BUILD_OS', True), d)}"
+BUILD_GOARCH = "${@go_map_arch(d.getVar('BUILD_ARCH', True), d)}"
+BUILD_GOTUPLE = "${BUILD_GOOS}_${BUILD_GOARCH}"
+HOST_GOOS = "${@go_map_os(d.getVar('HOST_OS', True), d)}"
+HOST_GOARCH = "${@go_map_arch(d.getVar('HOST_ARCH', True), d)}"
+HOST_GOARM = "${@go_map_arm(d.getVar('HOST_ARCH', True), d.getVar('TUNE_FEATURES', True), d)}"
+HOST_GOTUPLE = "${HOST_GOOS}_${HOST_GOARCH}"
+TARGET_GOOS = "${@go_map_os(d.getVar('TARGET_OS', True), d)}"
+TARGET_GOARCH = "${@go_map_arch(d.getVar('TARGET_ARCH', True), d)}"
+TARGET_GOARM = "${@go_map_arm(d.getVar('TARGET_ARCH', True), d.getVar('TUNE_FEATURES', True), d)}"
+TARGET_GOTUPLE = "${TARGET_GOOS}_${TARGET_GOARCH}"
+GO_BUILD_BINDIR = "${@['bin/${HOST_GOTUPLE}','bin'][d.getVar('BUILD_GOTUPLE',True) == d.getVar('HOST_GOTUPLE',True)]}"
+
+def go_map_arch(a, d):
+    import re
+    if re.match('i.86', a):
+        return '386'
+    elif a == 'x86_64':
+        return 'amd64'
+    elif re.match('arm.*', a):
+        return 'arm'
+    elif re.match('aarch64.*', a):
+        return 'arm64'
+    elif re.match('p(pc|owerpc)(|64)', a):
+        return 'powerpc'
+    else:
+        bb.error("cannot map '%s' to a Go architecture" % a)
+
+def go_map_arm(a, f, d):
+    import re
+    if re.match('arm.*', a) and re.match('arm.*7.*', f):
+        return '7'
+    return ''
+
+def go_map_os(o, d):
+    if o.startswith('linux'):
+        return 'linux'
+    return o
+
+
diff --git a/meta/recipes-devtools/go/go-1.4.inc b/meta/recipes-devtools/go/go-1.4.inc
new file mode 100644
index 0000000..a65459f
--- /dev/null
+++ b/meta/recipes-devtools/go/go-1.4.inc
@@ -0,0 +1,15 @@
+require go-common.inc
+
+PV = "1.4.3"
+GO_BASEVERSION = "1.4"
+FILESEXTRAPATHS_prepend := "${FILE_DIRNAME}/go-${GO_BASEVERSION}:"
+
+SRC_URI += "\
+        file://016-armhf-elf-header.patch \
+        file://go-cross-backport-cmd-link-support-new-386-amd64-rel.patch \
+        file://syslog.patch \
+"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=591778525c869cdde0ab5a1bf283cd81"
+SRC_URI[md5sum] = "dfb604511115dd402a77a553a5923a04"
+SRC_URI[sha256sum] = "9947fc705b0b841b5938c48b22dc33e9647ec0752bae66e50278df4f23f64959"
diff --git a/meta/recipes-devtools/go/go-1.4/016-armhf-elf-header.patch b/meta/recipes-devtools/go/go-1.4/016-armhf-elf-header.patch
new file mode 100644
index 0000000..e6e414e
--- /dev/null
+++ b/meta/recipes-devtools/go/go-1.4/016-armhf-elf-header.patch
@@ -0,0 +1,24 @@
+Description: Use correct ELF header for armhf binaries.
+Author: Adam Conrad <adconrad@ubuntu.com>
+Last-Update: 2013-07-08
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: go/src/cmd/ld/elf.c
+===================================================================
+--- go.orig/src/cmd/ld/elf.c	2015-02-20 10:49:58.763451586 -0800
++++ go/src/cmd/ld/elf.c	2015-02-20 10:49:27.895478521 -0800
+@@ -57,7 +57,11 @@
+ 	case '5':
+ 		// we use EABI on both linux/arm and freebsd/arm.
+ 		if(HEADTYPE == Hlinux || HEADTYPE == Hfreebsd)
+-			hdr.flags = 0x5000002; // has entry point, Version5 EABI
++#ifdef __ARM_PCS_VFP
++			hdr.flags = 0x5000402; // has entry point, Version5 EABI, hard-float ABI
++#else
++			hdr.flags = 0x5000202; // has entry point, Version5 EABI, soft-float ABI
++#endif
+ 		// fallthrough
+ 	default:
+ 		hdr.phoff = ELF32HDRSIZE;	/* Must be be ELF32HDRSIZE: first PHdr must follow ELF header */
diff --git a/meta/recipes-devtools/go/go-1.4/go-cross-backport-cmd-link-support-new-386-amd64-rel.patch b/meta/recipes-devtools/go/go-1.4/go-cross-backport-cmd-link-support-new-386-amd64-rel.patch
new file mode 100644
index 0000000..95ca9d3
--- /dev/null
+++ b/meta/recipes-devtools/go/go-1.4/go-cross-backport-cmd-link-support-new-386-amd64-rel.patch
@@ -0,0 +1,225 @@
+From d6eefad445831c161fca130f9bdf7b3848aac23c Mon Sep 17 00:00:00 2001
+From: Paul Gortmaker <paul.gortmaker@windriver.com>
+Date: Tue, 29 Mar 2016 21:14:33 -0400
+Subject: [PATCH] go-cross: backport "cmd/link: support new 386/amd64
+ relocations"
+
+Newer binutils won't support building older go-1.4.3 as per:
+
+https://github.com/golang/go/issues/13114
+
+Upstream commit 914db9f060b1fd3eb1f74d48f3bd46a73d4ae9c7 (see subj)
+was identified as the fix and nominated for 1.4.4 but that release
+never happened.  The paths in 1.4.3 aren't the same as go1.6beta1~662
+where this commit appeared, but the NetBSD folks indicated what a
+1.4.3 backport would look like here: https://gnats.netbsd.org/50777
+
+This is based on that, but without the BSD wrapper infrastructure
+layer that makes things look like patches of patches.
+
+Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
+
+Upstream-Status: Backport [ Partial ]
+
+diff --git a/src/cmd/6l/asm.c b/src/cmd/6l/asm.c
+index 18b5aa311981..2e9d339aef87 100644
+--- a/src/cmd/6l/asm.c
++++ b/src/cmd/6l/asm.c
+@@ -118,6 +118,8 @@ adddynrel(LSym *s, Reloc *r)
+ 		return;
+ 	
+ 	case 256 + R_X86_64_GOTPCREL:
++	case 256 + R_X86_64_GOTPCRELX:
++	case 256 + R_X86_64_REX_GOTPCRELX:
+ 		if(targ->type != SDYNIMPORT) {
+ 			// have symbol
+ 			if(r->off >= 2 && s->p[r->off-2] == 0x8b) {
+diff --git a/src/cmd/8l/asm.c b/src/cmd/8l/asm.c
+index 98c04240374f..cff29488e8af 100644
+--- a/src/cmd/8l/asm.c
++++ b/src/cmd/8l/asm.c
+@@ -115,6 +115,7 @@ adddynrel(LSym *s, Reloc *r)
+ 		return;		
+ 	
+ 	case 256 + R_386_GOT32:
++	case 256 + R_386_GOT32X:
+ 		if(targ->type != SDYNIMPORT) {
+ 			// have symbol
+ 			if(r->off >= 2 && s->p[r->off-2] == 0x8b) {
+diff --git a/src/cmd/ld/elf.h b/src/cmd/ld/elf.h
+index e84d996f2596..bbf2cfaa3cc0 100644
+--- a/src/cmd/ld/elf.h
++++ b/src/cmd/ld/elf.h
+@@ -478,32 +478,47 @@ typedef struct {
+  * Relocation types.
+  */
+ 
+-#define	R_X86_64_NONE	0	/* No relocation. */
+-#define	R_X86_64_64	1	/* Add 64 bit symbol value. */
+-#define	R_X86_64_PC32	2	/* PC-relative 32 bit signed sym value. */
+-#define	R_X86_64_GOT32	3	/* PC-relative 32 bit GOT offset. */
+-#define	R_X86_64_PLT32	4	/* PC-relative 32 bit PLT offset. */
+-#define	R_X86_64_COPY	5	/* Copy data from shared object. */
+-#define	R_X86_64_GLOB_DAT 6	/* Set GOT entry to data address. */
+-#define	R_X86_64_JMP_SLOT 7	/* Set GOT entry to code address. */
+-#define	R_X86_64_RELATIVE 8	/* Add load address of shared object. */
+-#define	R_X86_64_GOTPCREL 9	/* Add 32 bit signed pcrel offset to GOT. */
+-#define	R_X86_64_32	10	/* Add 32 bit zero extended symbol value */
+-#define	R_X86_64_32S	11	/* Add 32 bit sign extended symbol value */
+-#define	R_X86_64_16	12	/* Add 16 bit zero extended symbol value */
+-#define	R_X86_64_PC16	13	/* Add 16 bit signed extended pc relative symbol value */
+-#define	R_X86_64_8	14	/* Add 8 bit zero extended symbol value */
+-#define	R_X86_64_PC8	15	/* Add 8 bit signed extended pc relative symbol value */
+-#define	R_X86_64_DTPMOD64 16	/* ID of module containing symbol */
+-#define	R_X86_64_DTPOFF64 17	/* Offset in TLS block */
+-#define	R_X86_64_TPOFF64 18	/* Offset in static TLS block */
+-#define	R_X86_64_TLSGD	19	/* PC relative offset to GD GOT entry */
+-#define	R_X86_64_TLSLD	20	/* PC relative offset to LD GOT entry */
+-#define	R_X86_64_DTPOFF32 21	/* Offset in TLS block */
+-#define	R_X86_64_GOTTPOFF 22	/* PC relative offset to IE GOT entry */
+-#define	R_X86_64_TPOFF32 23	/* Offset in static TLS block */
+-
+-#define	R_X86_64_COUNT	24	/* Count of defined relocation types. */
++#define	R_X86_64_NONE           0
++#define	R_X86_64_64             1
++#define	R_X86_64_PC32           2
++#define	R_X86_64_GOT32          3
++#define	R_X86_64_PLT32          4
++#define	R_X86_64_COPY           5
++#define	R_X86_64_GLOB_DAT       6
++#define	R_X86_64_JMP_SLOT       7
++#define	R_X86_64_RELATIVE       8
++#define	R_X86_64_GOTPCREL       9
++#define	R_X86_64_32             10
++#define	R_X86_64_32S            11
++#define	R_X86_64_16             12
++#define	R_X86_64_PC16           13
++#define	R_X86_64_8              14
++#define	R_X86_64_PC8            15
++#define	R_X86_64_DTPMOD64       16
++#define	R_X86_64_DTPOFF64       17
++#define	R_X86_64_TPOFF64        18
++#define	R_X86_64_TLSGD          19
++#define	R_X86_64_TLSLD          20
++#define	R_X86_64_DTPOFF32       21
++#define	R_X86_64_GOTTPOFF       22
++#define	R_X86_64_TPOFF32        23
++#define	R_X86_64_PC64           24
++#define	R_X86_64_GOTOFF64       25
++#define	R_X86_64_GOTPC32        26
++#define	R_X86_64_GOT64          27
++#define	R_X86_64_GOTPCREL64     28
++#define	R_X86_64_GOTPC64        29
++#define	R_X86_64_GOTPLT64       30
++#define	R_X86_64_PLTOFF64       31
++#define	R_X86_64_SIZE32         32
++#define	R_X86_64_SIZE64         33
++#define	R_X86_64_GOTPC32_TLSDEC 34
++#define	R_X86_64_TLSDESC_CALL   35
++#define	R_X86_64_TLSDESC        36
++#define	R_X86_64_IRELATIVE      37
++#define	R_X86_64_PC32_BND       40
++#define	R_X86_64_GOTPCRELX      41
++#define	R_X86_64_REX_GOTPCRELX  42
+ 
+ 
+ #define	R_ALPHA_NONE		0	/* No reloc */
+@@ -581,39 +596,42 @@ typedef struct {
+ #define	R_ARM_COUNT		38	/* Count of defined relocation types. */
+ 
+ 
+-#define	R_386_NONE	0	/* No relocation. */
+-#define	R_386_32	1	/* Add symbol value. */
+-#define	R_386_PC32	2	/* Add PC-relative symbol value. */
+-#define	R_386_GOT32	3	/* Add PC-relative GOT offset. */
+-#define	R_386_PLT32	4	/* Add PC-relative PLT offset. */
+-#define	R_386_COPY	5	/* Copy data from shared object. */
+-#define	R_386_GLOB_DAT	6	/* Set GOT entry to data address. */
+-#define	R_386_JMP_SLOT	7	/* Set GOT entry to code address. */
+-#define	R_386_RELATIVE	8	/* Add load address of shared object. */
+-#define	R_386_GOTOFF	9	/* Add GOT-relative symbol address. */
+-#define	R_386_GOTPC	10	/* Add PC-relative GOT table address. */
+-#define	R_386_TLS_TPOFF	14	/* Negative offset in static TLS block */
+-#define	R_386_TLS_IE	15	/* Absolute address of GOT for -ve static TLS */
+-#define	R_386_TLS_GOTIE	16	/* GOT entry for negative static TLS block */
+-#define	R_386_TLS_LE	17	/* Negative offset relative to static TLS */
+-#define	R_386_TLS_GD	18	/* 32 bit offset to GOT (index,off) pair */
+-#define	R_386_TLS_LDM	19	/* 32 bit offset to GOT (index,zero) pair */
+-#define	R_386_TLS_GD_32	24	/* 32 bit offset to GOT (index,off) pair */
+-#define	R_386_TLS_GD_PUSH 25	/* pushl instruction for Sun ABI GD sequence */
+-#define	R_386_TLS_GD_CALL 26	/* call instruction for Sun ABI GD sequence */
+-#define	R_386_TLS_GD_POP 27	/* popl instruction for Sun ABI GD sequence */
+-#define	R_386_TLS_LDM_32 28	/* 32 bit offset to GOT (index,zero) pair */
+-#define	R_386_TLS_LDM_PUSH 29	/* pushl instruction for Sun ABI LD sequence */
+-#define	R_386_TLS_LDM_CALL 30	/* call instruction for Sun ABI LD sequence */
+-#define	R_386_TLS_LDM_POP 31	/* popl instruction for Sun ABI LD sequence */
+-#define	R_386_TLS_LDO_32 32	/* 32 bit offset from start of TLS block */
+-#define	R_386_TLS_IE_32	33	/* 32 bit offset to GOT static TLS offset entry */
+-#define	R_386_TLS_LE_32	34	/* 32 bit offset within static TLS block */
+-#define	R_386_TLS_DTPMOD32 35	/* GOT entry containing TLS index */
+-#define	R_386_TLS_DTPOFF32 36	/* GOT entry containing TLS offset */
+-#define	R_386_TLS_TPOFF32 37	/* GOT entry of -ve static TLS offset */
+-
+-#define	R_386_COUNT	38	/* Count of defined relocation types. */
++#define	R_386_NONE          0
++#define	R_386_32            1
++#define	R_386_PC32          2
++#define	R_386_GOT32         3
++#define	R_386_PLT32         4
++#define	R_386_COPY          5
++#define	R_386_GLOB_DAT      6
++#define	R_386_JMP_SLOT      7
++#define	R_386_RELATIVE      8
++#define	R_386_GOTOFF        9
++#define	R_386_GOTPC         10
++#define	R_386_TLS_TPOFF     14
++#define	R_386_TLS_IE        15
++#define	R_386_TLS_GOTIE     16
++#define	R_386_TLS_LE        17
++#define	R_386_TLS_GD        18
++#define	R_386_TLS_LDM       19
++#define	R_386_TLS_GD_32     24
++#define	R_386_TLS_GD_PUSH   25
++#define	R_386_TLS_GD_CALL   26
++#define	R_386_TLS_GD_POP    27
++#define	R_386_TLS_LDM_32    28
++#define	R_386_TLS_LDM_PUSH  29
++#define	R_386_TLS_LDM_CALL  30
++#define	R_386_TLS_LDM_POP   31
++#define	R_386_TLS_LDO_32    32
++#define	R_386_TLS_IE_32     33
++#define	R_386_TLS_LE_32     34
++#define	R_386_TLS_DTPMOD32  35
++#define	R_386_TLS_DTPOFF32  36
++#define	R_386_TLS_TPOFF32   37
++#define	R_386_TLS_GOTDESC   39
++#define	R_386_TLS_DESC_CALL 40
++#define	R_386_TLS_DESC      41
++#define	R_386_IRELATIVE     42
++#define	R_386_GOT32X        43
+ 
+ #define	R_PPC_NONE		0	/* No relocation. */
+ #define	R_PPC_ADDR32		1
+diff --git a/src/cmd/ld/ldelf.c b/src/cmd/ld/ldelf.c
+index dd5fa0d2a839..2e2fbd17377f 100644
+--- a/src/cmd/ld/ldelf.c
++++ b/src/cmd/ld/ldelf.c
+@@ -888,12 +888,15 @@ reltype(char *pn, int elftype, uchar *siz)
+ 	case R('6', R_X86_64_PC32):
+ 	case R('6', R_X86_64_PLT32):
+ 	case R('6', R_X86_64_GOTPCREL):
++	case R('6', R_X86_64_GOTPCRELX):
++	case R('6', R_X86_64_REX_GOTPCRELX):
+ 	case R('8', R_386_32):
+ 	case R('8', R_386_PC32):
+ 	case R('8', R_386_GOT32):
+ 	case R('8', R_386_PLT32):
+ 	case R('8', R_386_GOTOFF):
+ 	case R('8', R_386_GOTPC):
++	case R('8', R_386_GOT32X):
+ 		*siz = 4;
+ 		break;
+ 	case R('6', R_X86_64_64):
+-- 
+2.7.2
+
diff --git a/meta/recipes-devtools/go/go-1.4/syslog.patch b/meta/recipes-devtools/go/go-1.4/syslog.patch
new file mode 100644
index 0000000..29be06f
--- /dev/null
+++ b/meta/recipes-devtools/go/go-1.4/syslog.patch
@@ -0,0 +1,62 @@
+Add timeouts to logger
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+diff -r -u go/src/log/syslog/syslog.go /home/achang/GOCOPY/go/src/log/syslog/syslog.go
+--- go/src/log/syslog/syslog.go	2013-11-28 13:38:28.000000000 -0800
++++ /home/achang/GOCOPY/go/src/log/syslog/syslog.go	2014-10-03 11:44:37.710403200 -0700
+@@ -33,6 +33,9 @@
+ const severityMask = 0x07
+ const facilityMask = 0xf8
+ 
++var writeTimeout = 1 * time.Second
++var connectTimeout = 1 * time.Second
++
+ const (
+ 	// Severity.
+ 
+@@ -100,6 +103,7 @@
+ type serverConn interface {
+ 	writeString(p Priority, hostname, tag, s, nl string) error
+ 	close() error
++	setWriteDeadline(t time.Time) error
+ }
+ 
+ type netConn struct {
+@@ -273,7 +277,11 @@
+ 		nl = "\n"
+ 	}
+ 
+-	err := w.conn.writeString(p, w.hostname, w.tag, msg, nl)
++	err := w.conn.setWriteDeadline(time.Now().Add(writeTimeout))
++	if err != nil {
++		return 0, err
++	}
++	err = w.conn.writeString(p, w.hostname, w.tag, msg, nl)
+ 	if err != nil {
+ 		return 0, err
+ 	}
+@@ -305,6 +313,10 @@
+ 	return n.conn.Close()
+ }
+ 
++func (n *netConn) setWriteDeadline(t time.Time) error {
++	return n.conn.SetWriteDeadline(t)
++}
++
+ // NewLogger creates a log.Logger whose output is written to
+ // the system log service with the specified priority. The logFlag
+ // argument is the flag set passed through to log.New to create
+diff -r -u go/src/log/syslog/syslog_unix.go /home/achang/GOCOPY/go/src/log/syslog/syslog_unix.go
+--- go/src/log/syslog/syslog_unix.go	2013-11-28 13:38:28.000000000 -0800
++++ /home/achang/GOCOPY/go/src/log/syslog/syslog_unix.go	2014-10-03 11:44:39.010403175 -0700
+@@ -19,7 +19,7 @@
+ 	logPaths := []string{"/dev/log", "/var/run/syslog"}
+ 	for _, network := range logTypes {
+ 		for _, path := range logPaths {
+-			conn, err := net.Dial(network, path)
++			conn, err := net.DialTimeout(network, path, connectTimeout)
+ 			if err != nil {
+ 				continue
+ 			} else {
diff --git a/meta/recipes-devtools/go/go-1.6.inc b/meta/recipes-devtools/go/go-1.6.inc
new file mode 100644
index 0000000..769c1d8
--- /dev/null
+++ b/meta/recipes-devtools/go/go-1.6.inc
@@ -0,0 +1,19 @@
+require go-common.inc
+
+PV = "1.6.3"
+GO_BASEVERSION = "1.6"
+FILESEXTRAPATHS_prepend := "${FILE_DIRNAME}/go-${GO_BASEVERSION}:"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=591778525c869cdde0ab5a1bf283cd81"
+
+SRC_URI += "\
+       file://armhf-elf-header.patch \
+       file://syslog.patch \
+       file://fix-target-cc-for-build.patch \
+       file://fix-cc-handling.patch \
+       file://split-host-and-target-build.patch \
+       file://gotooldir.patch \
+"
+SRC_URI[md5sum] = "bf3fce6ccaadd310159c9e874220e2a2"
+SRC_URI[sha256sum] = "6326aeed5f86cf18f16d6dc831405614f855e2d416a91fd3fdc334f772345b00"
+
diff --git a/meta/recipes-devtools/go/go-1.6/armhf-elf-header.patch b/meta/recipes-devtools/go/go-1.6/armhf-elf-header.patch
new file mode 100644
index 0000000..1e3a16b
--- /dev/null
+++ b/meta/recipes-devtools/go/go-1.6/armhf-elf-header.patch
@@ -0,0 +1,23 @@
+Encode arm EABI ( hard/soft ) calling convention in ELF header
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: go/src/cmd/link/internal/ld/elf.go
+===================================================================
+--- go.orig/src/cmd/link/internal/ld/elf.go
++++ go/src/cmd/link/internal/ld/elf.go
+@@ -827,7 +827,13 @@
+ 	// 32-bit architectures
+ 	case '5':
+ 		// we use EABI on both linux/arm and freebsd/arm.
+-		if HEADTYPE == obj.Hlinux || HEADTYPE == obj.Hfreebsd {
++		if HEADTYPE == obj.Hlinux {
++			if Ctxt.Goarm == 7 {
++				ehdr.flags = 0x5000402 // has entry point, Version5 EABI, hard float
++			} else {
++				ehdr.flags = 0x5000202 // has entry point, Version5 EABI, soft float
++			}
++		} else if HEADTYPE == obj.Hfreebsd {
+ 			// We set a value here that makes no indication of which
+ 			// float ABI the object uses, because this is information
+ 			// used by the dynamic linker to compare executables and
diff --git a/meta/recipes-devtools/go/go-1.6/fix-cc-handling.patch b/meta/recipes-devtools/go/go-1.6/fix-cc-handling.patch
new file mode 100644
index 0000000..983323a
--- /dev/null
+++ b/meta/recipes-devtools/go/go-1.6/fix-cc-handling.patch
@@ -0,0 +1,50 @@
+Accept CC with multiple words in its name
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: go/src/cmd/go/build.go
+===================================================================
+--- go.orig/src/cmd/go/build.go	2015-07-29 14:48:40.323185807 -0700
++++ go/src/cmd/go/build.go	2015-07-30 07:37:40.529818586 -0700
+@@ -2805,12 +2805,24 @@
+ 	return b.ccompilerCmd("CC", defaultCC, objdir)
+ }
+ 
++// gccCmd returns a gcc command line prefix
++// defaultCC is defined in zdefaultcc.go, written by cmd/dist.
++func (b *builder) gccCmdForReal() []string {
++	return envList("CC", defaultCC)
++}
++
+ // gxxCmd returns a g++ command line prefix
+ // defaultCXX is defined in zdefaultcc.go, written by cmd/dist.
+ func (b *builder) gxxCmd(objdir string) []string {
+ 	return b.ccompilerCmd("CXX", defaultCXX, objdir)
+ }
+ 
++// gxxCmd returns a g++ command line prefix
++// defaultCXX is defined in zdefaultcc.go, written by cmd/dist.
++func (b *builder) gxxCmdForReal() []string {
++	return envList("CXX", defaultCXX)
++}
++
+ // ccompilerCmd returns a command line prefix for the given environment
+ // variable and using the default command when the variable is empty.
+ func (b *builder) ccompilerCmd(envvar, defcmd, objdir string) []string {
+Index: go/src/cmd/go/env.go
+===================================================================
+--- go.orig/src/cmd/go/env.go	2015-07-29 14:48:40.323185807 -0700
++++ go/src/cmd/go/env.go	2015-07-30 07:40:54.461655721 -0700
+@@ -52,10 +52,9 @@
+ 
+ 	if goos != "plan9" {
+ 		cmd := b.gccCmd(".")
+-		env = append(env, envVar{"CC", cmd[0]})
++		env = append(env, envVar{"CC", strings.Join(b.gccCmdForReal(), " ")})
+ 		env = append(env, envVar{"GOGCCFLAGS", strings.Join(cmd[3:], " ")})
+-		cmd = b.gxxCmd(".")
+-		env = append(env, envVar{"CXX", cmd[0]})
++		env = append(env, envVar{"CXX", strings.Join(b.gxxCmdForReal(), " ")})
+ 	}
+ 
+ 	if buildContext.CgoEnabled {
diff --git a/meta/recipes-devtools/go/go-1.6/fix-target-cc-for-build.patch b/meta/recipes-devtools/go/go-1.6/fix-target-cc-for-build.patch
new file mode 100644
index 0000000..2f6156e
--- /dev/null
+++ b/meta/recipes-devtools/go/go-1.6/fix-target-cc-for-build.patch
@@ -0,0 +1,17 @@
+Put Quotes around CC_FOR_TARGET since it can be mutliple words e.g. in OE
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: go/src/make.bash
+===================================================================
+--- go.orig/src/make.bash	2015-07-29 13:28:11.334031696 -0700
++++ go/src/make.bash	2015-07-29 13:36:55.814465630 -0700
+@@ -158,7 +158,7 @@
+ fi
+ 
+ echo "##### Building packages and commands for $GOOS/$GOARCH."
+-CC=$CC_FOR_TARGET "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
++CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
+ echo
+ 
+ rm -f "$GOTOOLDIR"/go_bootstrap
diff --git a/meta/recipes-devtools/go/go-1.6/gotooldir.patch b/meta/recipes-devtools/go/go-1.6/gotooldir.patch
new file mode 100644
index 0000000..9467025
--- /dev/null
+++ b/meta/recipes-devtools/go/go-1.6/gotooldir.patch
@@ -0,0 +1,30 @@
+Define tooldir in relation to GOTOOLDIR env var
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: go/src/go/build/build.go
+===================================================================
+--- go.orig/src/go/build/build.go
++++ go/src/go/build/build.go
+@@ -1388,7 +1388,7 @@ func init() {
+ }
+ 
+ // ToolDir is the directory containing build tools.
+-var ToolDir = filepath.Join(runtime.GOROOT(), "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH)
++var ToolDir = envOr("GOTOOLDIR", filepath.Join(runtime.GOROOT(), "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH))
+ 
+ // IsLocalImport reports whether the import path is
+ // a local import path, like ".", "..", "./foo", or "../foo".
+Index: go/src/cmd/go/build.go
+===================================================================
+--- go.orig/src/cmd/go/build.go
++++ go/src/cmd/go/build.go
+@@ -1312,7 +1312,7 @@ func (b *builder) build(a *action) (err
+ 		}
+ 
+ 		cgoExe := tool("cgo")
+-		if a.cgo != nil && a.cgo.target != "" {
++		if a.cgo != nil && a.cgo.target != "" && os.Getenv("GOTOOLDIR") == "" {
+ 			cgoExe = a.cgo.target
+ 		}
+ 		outGo, outObj, err := b.cgo(a.p, cgoExe, obj, pcCFLAGS, pcLDFLAGS, cgofiles, gccfiles, cxxfiles, a.p.MFiles)
diff --git a/meta/recipes-devtools/go/go-1.6/split-host-and-target-build.patch b/meta/recipes-devtools/go/go-1.6/split-host-and-target-build.patch
new file mode 100644
index 0000000..afbae02
--- /dev/null
+++ b/meta/recipes-devtools/go/go-1.6/split-host-and-target-build.patch
@@ -0,0 +1,63 @@
+Add new option --target-only to build target components
+Separates the host and target pieces of build
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: go/src/make.bash
+===================================================================
+--- go.orig/src/make.bash
++++ go/src/make.bash
+@@ -143,12 +143,23 @@ if [ "$1" = "--no-clean" ]; then
+ 	buildall=""
+ 	shift
+ fi
+-./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap
+-# Delay move of dist tool to now, because bootstrap may clear tool directory.
+-mv cmd/dist/dist "$GOTOOLDIR"/dist
+-echo
+ 
+-if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOHOSTOS" != "$GOOS" ]; then
++do_host_build="yes"
++do_target_build="yes"
++if [ "$1" = "--target-only" ]; then
++	do_host_build="no"
++	shift
++elif [ "$1" = "--host-only" ]; then
++	do_target_build="no"
++	shift
++fi
++
++if [ "$do_host_build" = "yes" ]; then
++	./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap
++	# Delay move of dist tool to now, because bootstrap may clear tool directory.
++	mv cmd/dist/dist "$GOTOOLDIR"/dist
++	echo
++
+ 	echo "##### Building packages and commands for host, $GOHOSTOS/$GOHOSTARCH."
+ 	# CC_FOR_TARGET is recorded as the default compiler for the go tool. When building for the host, however,
+ 	# use the host compiler, CC, from `cmd/dist/dist env` instead.
+@@ -157,11 +168,20 @@ if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOH
+ 	echo
+ fi
+ 
+-echo "##### Building packages and commands for $GOOS/$GOARCH."
+-CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
+-echo
++if [ "$do_target_build" = "yes" ]; then
++    GO_INSTALL="${GO_TARGET_INSTALL:-std cmd}"
++    echo "##### Building packages and commands for $GOOS/$GOARCH."
++    if [ "$GOHOSTOS" = "$GOOS" -a "$GOHOSTARCH" = "$GOARCH" -a "$do_host_build" = "yes" ]; then
++	rm -rf ./host-tools
++	mkdir ./host-tools
++	mv "$GOTOOLDIR"/* ./host-tools
++	GOTOOLDIR="$PWD/host-tools"
++    fi
++    GOTOOLDIR="$GOTOOLDIR" CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v ${GO_INSTALL}
++    echo
+ 
+-rm -f "$GOTOOLDIR"/go_bootstrap
++    rm -f "$GOTOOLDIR"/go_bootstrap
++fi
+ 
+ if [ "$1" != "--no-banner" ]; then
+ 	"$GOTOOLDIR"/dist banner
diff --git a/meta/recipes-devtools/go/go-1.6/syslog.patch b/meta/recipes-devtools/go/go-1.6/syslog.patch
new file mode 100644
index 0000000..29be06f
--- /dev/null
+++ b/meta/recipes-devtools/go/go-1.6/syslog.patch
@@ -0,0 +1,62 @@
+Add timeouts to logger
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+diff -r -u go/src/log/syslog/syslog.go /home/achang/GOCOPY/go/src/log/syslog/syslog.go
+--- go/src/log/syslog/syslog.go	2013-11-28 13:38:28.000000000 -0800
++++ /home/achang/GOCOPY/go/src/log/syslog/syslog.go	2014-10-03 11:44:37.710403200 -0700
+@@ -33,6 +33,9 @@
+ const severityMask = 0x07
+ const facilityMask = 0xf8
+ 
++var writeTimeout = 1 * time.Second
++var connectTimeout = 1 * time.Second
++
+ const (
+ 	// Severity.
+ 
+@@ -100,6 +103,7 @@
+ type serverConn interface {
+ 	writeString(p Priority, hostname, tag, s, nl string) error
+ 	close() error
++	setWriteDeadline(t time.Time) error
+ }
+ 
+ type netConn struct {
+@@ -273,7 +277,11 @@
+ 		nl = "\n"
+ 	}
+ 
+-	err := w.conn.writeString(p, w.hostname, w.tag, msg, nl)
++	err := w.conn.setWriteDeadline(time.Now().Add(writeTimeout))
++	if err != nil {
++		return 0, err
++	}
++	err = w.conn.writeString(p, w.hostname, w.tag, msg, nl)
+ 	if err != nil {
+ 		return 0, err
+ 	}
+@@ -305,6 +313,10 @@
+ 	return n.conn.Close()
+ }
+ 
++func (n *netConn) setWriteDeadline(t time.Time) error {
++	return n.conn.SetWriteDeadline(t)
++}
++
+ // NewLogger creates a log.Logger whose output is written to
+ // the system log service with the specified priority. The logFlag
+ // argument is the flag set passed through to log.New to create
+diff -r -u go/src/log/syslog/syslog_unix.go /home/achang/GOCOPY/go/src/log/syslog/syslog_unix.go
+--- go/src/log/syslog/syslog_unix.go	2013-11-28 13:38:28.000000000 -0800
++++ /home/achang/GOCOPY/go/src/log/syslog/syslog_unix.go	2014-10-03 11:44:39.010403175 -0700
+@@ -19,7 +19,7 @@
+ 	logPaths := []string{"/dev/log", "/var/run/syslog"}
+ 	for _, network := range logTypes {
+ 		for _, path := range logPaths {
+-			conn, err := net.Dial(network, path)
++			conn, err := net.DialTimeout(network, path, connectTimeout)
+ 			if err != nil {
+ 				continue
+ 			} else {
diff --git a/meta/recipes-devtools/go/go-1.7.inc b/meta/recipes-devtools/go/go-1.7.inc
new file mode 100644
index 0000000..1f73715
--- /dev/null
+++ b/meta/recipes-devtools/go/go-1.7.inc
@@ -0,0 +1,18 @@
+require go-common.inc
+
+PV = "1.7.3"
+GO_BASEVERSION = "1.7"
+FILESEXTRAPATHS_prepend := "${FILE_DIRNAME}/go-${GO_BASEVERSION}:"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=5d4950ecb7b26d2c5e4e7b4e0dd74707"
+
+SRC_URI += "\
+       file://armhf-elf-header.patch \
+       file://syslog.patch \
+       file://fix-target-cc-for-build.patch \
+       file://fix-cc-handling.patch \
+       file://split-host-and-target-build.patch \
+       file://gotooldir.patch \
+"
+SRC_URI[md5sum] = "83d1b7bd4281479ab7d153e5152c9fc9"
+SRC_URI[sha256sum] = "79430a0027a09b0b3ad57e214c4c1acfdd7af290961dd08d322818895af1ef44"
diff --git a/meta/recipes-devtools/go/go-1.7/armhf-elf-header.patch b/meta/recipes-devtools/go/go-1.7/armhf-elf-header.patch
new file mode 100644
index 0000000..1e3a16b
--- /dev/null
+++ b/meta/recipes-devtools/go/go-1.7/armhf-elf-header.patch
@@ -0,0 +1,23 @@
+Encode arm EABI ( hard/soft ) calling convention in ELF header
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: go/src/cmd/link/internal/ld/elf.go
+===================================================================
+--- go.orig/src/cmd/link/internal/ld/elf.go
++++ go/src/cmd/link/internal/ld/elf.go
+@@ -827,7 +827,13 @@
+ 	// 32-bit architectures
+ 	case '5':
+ 		// we use EABI on both linux/arm and freebsd/arm.
+-		if HEADTYPE == obj.Hlinux || HEADTYPE == obj.Hfreebsd {
++		if HEADTYPE == obj.Hlinux {
++			if Ctxt.Goarm == 7 {
++				ehdr.flags = 0x5000402 // has entry point, Version5 EABI, hard float
++			} else {
++				ehdr.flags = 0x5000202 // has entry point, Version5 EABI, soft float
++			}
++		} else if HEADTYPE == obj.Hfreebsd {
+ 			// We set a value here that makes no indication of which
+ 			// float ABI the object uses, because this is information
+ 			// used by the dynamic linker to compare executables and
diff --git a/meta/recipes-devtools/go/go-1.7/fix-cc-handling.patch b/meta/recipes-devtools/go/go-1.7/fix-cc-handling.patch
new file mode 100644
index 0000000..a67caf4
--- /dev/null
+++ b/meta/recipes-devtools/go/go-1.7/fix-cc-handling.patch
@@ -0,0 +1,50 @@
+Accept CC with multiple words in its name
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: go/src/cmd/go/build.go
+===================================================================
+--- go.orig/src/cmd/go/build.go
++++ go/src/cmd/go/build.go
+@@ -2991,12 +2991,24 @@ func (b *builder) gccCmd(objdir string)
+ 	return b.ccompilerCmd("CC", defaultCC, objdir)
+ }
+ 
++// gccCmd returns a gcc command line prefix
++// defaultCC is defined in zdefaultcc.go, written by cmd/dist.
++func (b *builder) gccCmdForReal() []string {
++	return envList("CC", defaultCC)
++}
++
+ // gxxCmd returns a g++ command line prefix
+ // defaultCXX is defined in zdefaultcc.go, written by cmd/dist.
+ func (b *builder) gxxCmd(objdir string) []string {
+ 	return b.ccompilerCmd("CXX", defaultCXX, objdir)
+ }
+ 
++// gxxCmd returns a g++ command line prefix
++// defaultCXX is defined in zdefaultcc.go, written by cmd/dist.
++func (b *builder) gxxCmdForReal() []string {
++	return envList("CXX", defaultCXX)
++}
++
+ // gfortranCmd returns a gfortran command line prefix.
+ func (b *builder) gfortranCmd(objdir string) []string {
+ 	return b.ccompilerCmd("FC", "gfortran", objdir)
+Index: go/src/cmd/go/env.go
+===================================================================
+--- go.orig/src/cmd/go/env.go
++++ go/src/cmd/go/env.go
+@@ -51,10 +51,9 @@ func mkEnv() []envVar {
+ 
+ 	if goos != "plan9" {
+ 		cmd := b.gccCmd(".")
+-		env = append(env, envVar{"CC", cmd[0]})
++		env = append(env, envVar{"CC", strings.Join(b.gccCmdForReal(), " ")})
+ 		env = append(env, envVar{"GOGCCFLAGS", strings.Join(cmd[3:], " ")})
+-		cmd = b.gxxCmd(".")
+-		env = append(env, envVar{"CXX", cmd[0]})
++		env = append(env, envVar{"CXX", strings.Join(b.gxxCmdForReal(), " ")})
+ 	}
+ 
+ 	if buildContext.CgoEnabled {
diff --git a/meta/recipes-devtools/go/go-1.7/fix-target-cc-for-build.patch b/meta/recipes-devtools/go/go-1.7/fix-target-cc-for-build.patch
new file mode 100644
index 0000000..2f6156e
--- /dev/null
+++ b/meta/recipes-devtools/go/go-1.7/fix-target-cc-for-build.patch
@@ -0,0 +1,17 @@
+Put Quotes around CC_FOR_TARGET since it can be mutliple words e.g. in OE
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: go/src/make.bash
+===================================================================
+--- go.orig/src/make.bash	2015-07-29 13:28:11.334031696 -0700
++++ go/src/make.bash	2015-07-29 13:36:55.814465630 -0700
+@@ -158,7 +158,7 @@
+ fi
+ 
+ echo "##### Building packages and commands for $GOOS/$GOARCH."
+-CC=$CC_FOR_TARGET "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
++CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
+ echo
+ 
+ rm -f "$GOTOOLDIR"/go_bootstrap
diff --git a/meta/recipes-devtools/go/go-1.7/gotooldir.patch b/meta/recipes-devtools/go/go-1.7/gotooldir.patch
new file mode 100644
index 0000000..9467025
--- /dev/null
+++ b/meta/recipes-devtools/go/go-1.7/gotooldir.patch
@@ -0,0 +1,30 @@
+Define tooldir in relation to GOTOOLDIR env var
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: go/src/go/build/build.go
+===================================================================
+--- go.orig/src/go/build/build.go
++++ go/src/go/build/build.go
+@@ -1388,7 +1388,7 @@ func init() {
+ }
+ 
+ // ToolDir is the directory containing build tools.
+-var ToolDir = filepath.Join(runtime.GOROOT(), "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH)
++var ToolDir = envOr("GOTOOLDIR", filepath.Join(runtime.GOROOT(), "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH))
+ 
+ // IsLocalImport reports whether the import path is
+ // a local import path, like ".", "..", "./foo", or "../foo".
+Index: go/src/cmd/go/build.go
+===================================================================
+--- go.orig/src/cmd/go/build.go
++++ go/src/cmd/go/build.go
+@@ -1312,7 +1312,7 @@ func (b *builder) build(a *action) (err
+ 		}
+ 
+ 		cgoExe := tool("cgo")
+-		if a.cgo != nil && a.cgo.target != "" {
++		if a.cgo != nil && a.cgo.target != "" && os.Getenv("GOTOOLDIR") == "" {
+ 			cgoExe = a.cgo.target
+ 		}
+ 		outGo, outObj, err := b.cgo(a.p, cgoExe, obj, pcCFLAGS, pcLDFLAGS, cgofiles, gccfiles, cxxfiles, a.p.MFiles)
diff --git a/meta/recipes-devtools/go/go-1.7/split-host-and-target-build.patch b/meta/recipes-devtools/go/go-1.7/split-host-and-target-build.patch
new file mode 100644
index 0000000..b0dd95b
--- /dev/null
+++ b/meta/recipes-devtools/go/go-1.7/split-host-and-target-build.patch
@@ -0,0 +1,62 @@
+Add new option --target-only to build target components
+Separates the host and target pieces of build
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: go/src/make.bash
+===================================================================
+--- go.orig/src/make.bash
++++ go/src/make.bash
+@@ -154,13 +154,22 @@ if [ "$1" = "--no-clean" ]; then
+ 	buildall=""
+ 	shift
+ fi
+-./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap
++do_host_build="yes"
++do_target_build="yes"
++if [ "$1" = "--target-only" ]; then
++	do_host_build="no"
++	shift
++elif [ "$1" = "--host-only" ]; then
++	do_target_build="no"
++	shift
++fi
+ 
+-# Delay move of dist tool to now, because bootstrap may clear tool directory.
+-mv cmd/dist/dist "$GOTOOLDIR"/dist
+-echo
++if [ "$do_host_build" = "yes" ]; then
++	./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap
++	# Delay move of dist tool to now, because bootstrap may clear tool directory.
++	mv cmd/dist/dist "$GOTOOLDIR"/dist
++	echo
+ 
+-if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOHOSTOS" != "$GOOS" ]; then
+ 	echo "##### Building packages and commands for host, $GOHOSTOS/$GOHOSTARCH."
+ 	# CC_FOR_TARGET is recorded as the default compiler for the go tool. When building for the host, however,
+ 	# use the host compiler, CC, from `cmd/dist/dist env` instead.
+@@ -169,11 +178,20 @@ if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOH
+ 	echo
+ fi
+ 
+-echo "##### Building packages and commands for $GOOS/$GOARCH."
+-CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
+-echo
++if [ "$do_target_build" = "yes" ]; then
++    GO_INSTALL="${GO_TARGET_INSTALL:-std cmd}"
++    echo "##### Building packages and commands for $GOOS/$GOARCH."
++    if [ "$GOHOSTOS" = "$GOOS" -a "$GOHOSTARCH" = "$GOARCH" -a "$do_host_build" = "yes" ]; then
++	rm -rf ./host-tools
++	mkdir ./host-tools
++	mv "$GOTOOLDIR"/* ./host-tools
++	GOTOOLDIR="$PWD/host-tools"
++    fi
++    GOTOOLDIR="$GOTOOLDIR" CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v ${GO_INSTALL}
++    echo
+ 
+-rm -f "$GOTOOLDIR"/go_bootstrap
++    rm -f "$GOTOOLDIR"/go_bootstrap
++fi
+ 
+ if [ "$1" != "--no-banner" ]; then
+ 	"$GOTOOLDIR"/dist banner
diff --git a/meta/recipes-devtools/go/go-1.7/syslog.patch b/meta/recipes-devtools/go/go-1.7/syslog.patch
new file mode 100644
index 0000000..29be06f
--- /dev/null
+++ b/meta/recipes-devtools/go/go-1.7/syslog.patch
@@ -0,0 +1,62 @@
+Add timeouts to logger
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+diff -r -u go/src/log/syslog/syslog.go /home/achang/GOCOPY/go/src/log/syslog/syslog.go
+--- go/src/log/syslog/syslog.go	2013-11-28 13:38:28.000000000 -0800
++++ /home/achang/GOCOPY/go/src/log/syslog/syslog.go	2014-10-03 11:44:37.710403200 -0700
+@@ -33,6 +33,9 @@
+ const severityMask = 0x07
+ const facilityMask = 0xf8
+ 
++var writeTimeout = 1 * time.Second
++var connectTimeout = 1 * time.Second
++
+ const (
+ 	// Severity.
+ 
+@@ -100,6 +103,7 @@
+ type serverConn interface {
+ 	writeString(p Priority, hostname, tag, s, nl string) error
+ 	close() error
++	setWriteDeadline(t time.Time) error
+ }
+ 
+ type netConn struct {
+@@ -273,7 +277,11 @@
+ 		nl = "\n"
+ 	}
+ 
+-	err := w.conn.writeString(p, w.hostname, w.tag, msg, nl)
++	err := w.conn.setWriteDeadline(time.Now().Add(writeTimeout))
++	if err != nil {
++		return 0, err
++	}
++	err = w.conn.writeString(p, w.hostname, w.tag, msg, nl)
+ 	if err != nil {
+ 		return 0, err
+ 	}
+@@ -305,6 +313,10 @@
+ 	return n.conn.Close()
+ }
+ 
++func (n *netConn) setWriteDeadline(t time.Time) error {
++	return n.conn.SetWriteDeadline(t)
++}
++
+ // NewLogger creates a log.Logger whose output is written to
+ // the system log service with the specified priority. The logFlag
+ // argument is the flag set passed through to log.New to create
+diff -r -u go/src/log/syslog/syslog_unix.go /home/achang/GOCOPY/go/src/log/syslog/syslog_unix.go
+--- go/src/log/syslog/syslog_unix.go	2013-11-28 13:38:28.000000000 -0800
++++ /home/achang/GOCOPY/go/src/log/syslog/syslog_unix.go	2014-10-03 11:44:39.010403175 -0700
+@@ -19,7 +19,7 @@
+ 	logPaths := []string{"/dev/log", "/var/run/syslog"}
+ 	for _, network := range logTypes {
+ 		for _, path := range logPaths {
+-			conn, err := net.Dial(network, path)
++			conn, err := net.DialTimeout(network, path, connectTimeout)
+ 			if err != nil {
+ 				continue
+ 			} else {
diff --git a/meta/recipes-devtools/go/go-common.inc b/meta/recipes-devtools/go/go-common.inc
new file mode 100644
index 0000000..8897cb1
--- /dev/null
+++ b/meta/recipes-devtools/go/go-common.inc
@@ -0,0 +1,21 @@
+SUMMARY = "Go programming language compiler"
+DESCRIPTION = " The Go programming language is an open source project to make \
+ programmers more productive. Go is expressive, concise, clean, and\
+ efficient. Its concurrency mechanisms make it easy to write programs\
+ that get the most out of multicore and networked machines, while its\
+ novel type system enables flexible and modular program construction.\
+ Go compiles quickly to machine code yet has the convenience of\
+ garbage collection and the power of run-time reflection. It's a\
+ fast, statically typed, compiled language that feels like a\
+ dynamically typed, interpreted language."
+
+HOMEPAGE = " http://golang.org/"
+LICENSE = "BSD-3-Clause"
+
+inherit goarch
+
+SRC_URI = "http://golang.org/dl/go${PV}.src.tar.gz"
+S = "${WORKDIR}/go"
+B = "${S}"
+
+INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
diff --git a/meta/recipes-devtools/go/go-native.inc b/meta/recipes-devtools/go/go-native.inc
new file mode 100644
index 0000000..cb2dd2a
--- /dev/null
+++ b/meta/recipes-devtools/go/go-native.inc
@@ -0,0 +1,54 @@
+inherit native
+
+export GOOS = "${BUILD_GOOS}"
+export GOARCH = "${BUILD_GOARCH}"
+export GOROOT_FINAL = "${STAGING_LIBDIR_NATIVE}/go"
+export CGO_ENABLED = "1"
+
+do_configure[noexec] = "1"
+
+do_compile() {
+    export GOBIN="${B}/bin"
+    rm -rf ${GOBIN}
+    mkdir ${GOBIN}
+
+    export TMPDIR=${WORKDIR}/build-tmp
+    mkdir -p ${WORKDIR}/build-tmp
+
+    cd src
+    CGO_ENABLED=0 ./make.bash --host-only
+}
+
+
+make_wrapper() {
+    rm -f ${D}${bindir}/$2
+    cat <<END >${D}${bindir}/$2
+#!/bin/bash
+here=\`dirname \$0\`
+export GOROOT="${GOROOT:-\`readlink -f \$here/../lib/go\`}"
+\$here/../lib/go/bin/$1 "\$@"
+END
+    chmod +x ${D}${bindir}/$2
+}
+
+do_install() {
+    install -d ${D}${libdir}/go
+    cp -a ${B}/pkg ${D}${libdir}/go/
+    install -d ${D}${libdir}/go/src
+    (cd ${S}/src; for d in *; do \
+        [ -d $d ] && cp -a ${S}/src/$d ${D}${libdir}/go/src/; \
+    done)
+    install -d ${D}${bindir} ${D}${libdir}/go/bin
+    for f in ${B}/bin/*
+    do
+        base=`basename $f`
+        install -m755 $f ${D}${libdir}/go/bin
+        make_wrapper $base $base
+    done
+}
+
+do_package[noexec] = "1"
+do_packagedata[noexec] = "1"
+do_package_write_ipk[noexec] = "1"
+do_package_write_deb[noexec] = "1"
+do_package_write_rpm[noexec] = "1"
diff --git a/meta/recipes-devtools/go/go-native_1.4.bb b/meta/recipes-devtools/go/go-native_1.4.bb
new file mode 100644
index 0000000..bbf3c0d
--- /dev/null
+++ b/meta/recipes-devtools/go/go-native_1.4.bb
@@ -0,0 +1,2 @@
+require ${PN}.inc
+require go-${PV}.inc
diff --git a/meta/recipes-devtools/go/go.inc b/meta/recipes-devtools/go/go.inc
new file mode 100644
index 0000000..732ffa4
--- /dev/null
+++ b/meta/recipes-devtools/go/go.inc
@@ -0,0 +1,74 @@
+inherit goarch
+# libgcc is required for the target specific libraries to build properly
+DEPENDS += " go-native libgcc"
+# Prevent runstrip from running because you get errors when the host arch != target arch
+INHIBIT_PACKAGE_STRIP = "1"
+INHIBIT_SYSROOT_STRIP = "1"
+
+export GOHOSTOS = "${BUILD_GOOS}"
+export GOHOSTARCH = "${BUILD_GOARCH}"
+export GOOS = "${TARGET_GOOS}"
+export GOARCH = "${TARGET_GOARCH}"
+export GOARM = "${TARGET_GOARM}"
+export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
+export GOROOT_FINAL = "${libdir}/go"
+export CGO_ENABLED = "1"
+export CC_FOR_TARGET="${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"
+export CXX_FOR_TARGET="${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"
+
+do_configure[noexec] = "1"
+
+do_compile() {
+    export GOBIN="${B}/bin"
+    export CC="${@d.getVar('BUILD_CC', True).strip()}"
+    rm -rf ${GOBIN} ${B}/pkg
+    mkdir ${GOBIN}
+
+    export TMPDIR=${WORKDIR}/build-tmp
+    mkdir -p ${WORKDIR}/build-tmp
+
+    cd src
+    ./make.bash --host-only
+    # Ensure cgo.a is built with the target toolchain
+    export GOBIN="${B}/target/bin"
+    rm -rf ${GOBIN}
+    mkdir -p ${GOBIN}
+    GO_FLAGS="-a" ./make.bash
+}
+
+do_install_class-target() {
+    install -d ${D}${libdir}/go
+    cp -a ${B}/pkg ${D}${libdir}/go/
+    install -d ${D}${libdir}/go/src
+    (cd ${S}/src; for d in *; do \
+        [ -d $d ] && cp -a ${S}/src/$d ${D}${libdir}/go/src/; \
+    done)
+    install -d ${D}${bindir}
+    for f in ${B}/bin/${GOOS}_${GOARCH}/*
+    do
+        install -m755 $f ${D}${bindir}
+    done
+}
+
+do_install_class-cross() {
+    install -d ${D}${libdir}/go
+    cp -a ${B}/pkg ${D}${libdir}/go/
+    install -d ${D}${libdir}/go/src
+    (cd ${S}/src; for d in *; do \
+        [ -d $d ] && cp -a ${S}/src/$d ${D}${libdir}/go/src/; \
+    done)
+    install -d ${D}${bindir}
+    for f in ${B}/bin/go*
+    do
+        install -m755 $f ${D}${bindir}
+    done
+}
+
+INSANE_SKIP_${PN} += "staticdev"
+RDEPENDS_${PN} += "perl"
+
+do_package[noexec] = "1"
+do_packagedata[noexec] = "1"
+do_package_write_ipk[noexec] = "1"
+do_package_write_deb[noexec] = "1"
+do_package_write_rpm[noexec] = "1"
diff --git a/meta/recipes-devtools/go/go_1.6.bb b/meta/recipes-devtools/go/go_1.6.bb
new file mode 100644
index 0000000..2f59033
--- /dev/null
+++ b/meta/recipes-devtools/go/go_1.6.bb
@@ -0,0 +1,4 @@
+require go.inc
+require go-${PV}.inc
+
+BBCLASSEXTEND = "cross"
diff --git a/meta/recipes-devtools/go/go_1.7.bb b/meta/recipes-devtools/go/go_1.7.bb
new file mode 100644
index 0000000..8186427
--- /dev/null
+++ b/meta/recipes-devtools/go/go_1.7.bb
@@ -0,0 +1,4 @@
+require go-${PV}.inc
+require go.inc
+
+BBCLASSEXTEND = "cross"
-- 
2.10.2



^ permalink raw reply related

* [PATCH 0/7] A bunch of fixes for devtool update-recipe
From: Paul Eggleton @ 2016-11-10  1:45 UTC (permalink / raw)
  To: openembedded-core

A bunch of fixes for devtool update-recipe and associated oe-selftest tests.

The following changes since commit 9303d8055c45a0f6af295d70a6f6a8b9d8d8a7c9:

  devtool: add "rename" subcommand (2016-11-07 11:04:17 +0000)

are available in the git repository at:

  git://git.openembedded.org/openembedded-core-contrib paule/devtool23-oe
  http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/devtool23-oe

Paul Eggleton (7):
  devtool: update-recipe: check output before treating it as a string
  oe-selftest: devtool: test update-recipe with only local files
  lib/oe/patch: fix handling of patches with no header
  devtool: update-recipe: fix handling of compressed local patches
  devtool: update-recipe: support replacing remote patches
  lib/oe/recipeutils: ignore archives by default in
    get_recipe_local_files()
  oe-selftest: devtool: test that updating a file with subdir= works

 .../recipes-test/devtool/devtool-test-localonly.bb |   6 ++
 .../devtool/devtool-test-localonly/file1           |   1 +
 .../devtool/devtool-test-localonly/file2           |   1 +
 .../recipes-test/devtool/devtool-test-patch-gz.bb  |  16 ++++
 .../devtool/devtool-test-patch-gz/readme.patch.gz  | Bin 0 -> 449 bytes
 .../recipes-test/devtool/devtool-test-subdir.bb    |   7 ++
 .../devtool-test-subdir/devtool-test-subdir.tar.gz | Bin 0 -> 181 bytes
 .../devtool/devtool-test-subdir/testfile           |   1 +
 meta/classes/patch.bbclass                         |   9 ++-
 meta/lib/oe/patch.py                               |   8 +-
 meta/lib/oe/recipeutils.py                         |  22 +++--
 meta/lib/oeqa/selftest/devtool.py                  |  67 +++++++++++++++
 scripts/lib/devtool/standard.py                    |  90 +++++++++++++++------
 13 files changed, 193 insertions(+), 35 deletions(-)
 create mode 100644 meta-selftest/recipes-test/devtool/devtool-test-localonly.bb
 create mode 100644 meta-selftest/recipes-test/devtool/devtool-test-localonly/file1
 create mode 100644 meta-selftest/recipes-test/devtool/devtool-test-localonly/file2
 create mode 100644 meta-selftest/recipes-test/devtool/devtool-test-patch-gz.bb
 create mode 100644 meta-selftest/recipes-test/devtool/devtool-test-patch-gz/readme.patch.gz
 create mode 100644 meta-selftest/recipes-test/devtool/devtool-test-subdir.bb
 create mode 100644 meta-selftest/recipes-test/devtool/devtool-test-subdir/devtool-test-subdir.tar.gz
 create mode 100644 meta-selftest/recipes-test/devtool/devtool-test-subdir/testfile

-- 
2.5.5



^ permalink raw reply

* [PATCH 1/7] devtool: update-recipe: check output before treating it as a string
From: Paul Eggleton @ 2016-11-10  1:45 UTC (permalink / raw)
  To: openembedded-core
In-Reply-To: <cover.1478742229.git.paul.eggleton@linux.intel.com>

As of the move to Python 3 and the fixes we applied at that time,
bb.process.run() will return a byte array of length 0 rather than an
empty string if the output is empty. That may be a bug that we should
fix, but for now it's easiest to just check the result here before
treating it as a string. This fixes running "devtool update-recipe" or
"devtool finish" on a recipe which has no source tree, for example
initramfs-framework.

Fixes [YOCTO #10563].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 scripts/lib/devtool/standard.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 4523048..1511641 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -332,10 +332,11 @@ def _git_ls_tree(repodir, treeish='HEAD', recursive=False):
         cmd.append('-r')
     out, _ = bb.process.run(cmd, cwd=repodir)
     ret = {}
-    for line in out.split('\0'):
-        if line:
-            split = line.split(None, 4)
-            ret[split[3]] = split[0:3]
+    if out:
+        for line in out.split('\0'):
+            if line:
+                split = line.split(None, 4)
+                ret[split[3]] = split[0:3]
     return ret
 
 def _git_exclude_path(srctree, path):
-- 
2.5.5



^ permalink raw reply related

* [PATCH 2/7] oe-selftest: devtool: test update-recipe with only local files
From: Paul Eggleton @ 2016-11-10  1:45 UTC (permalink / raw)
  To: openembedded-core
In-Reply-To: <cover.1478742229.git.paul.eggleton@linux.intel.com>

Add a test to ensure devtool update-recipe works properly on recipes
that contain only local files (since the other tests we have didn't test
that).

Relates to [YOCTO #10563].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 .../recipes-test/devtool/devtool-test-localonly.bb     |  6 ++++++
 .../recipes-test/devtool/devtool-test-localonly/file1  |  1 +
 .../recipes-test/devtool/devtool-test-localonly/file2  |  1 +
 meta/lib/oeqa/selftest/devtool.py                      | 18 ++++++++++++++++++
 4 files changed, 26 insertions(+)
 create mode 100644 meta-selftest/recipes-test/devtool/devtool-test-localonly.bb
 create mode 100644 meta-selftest/recipes-test/devtool/devtool-test-localonly/file1
 create mode 100644 meta-selftest/recipes-test/devtool/devtool-test-localonly/file2

diff --git a/meta-selftest/recipes-test/devtool/devtool-test-localonly.bb b/meta-selftest/recipes-test/devtool/devtool-test-localonly.bb
new file mode 100644
index 0000000..28ff49e
--- /dev/null
+++ b/meta-selftest/recipes-test/devtool/devtool-test-localonly.bb
@@ -0,0 +1,6 @@
+LICENSE = "CLOSED"
+INHIBIT_DEFAULT_DEPS = "1"
+
+SRC_URI = "file://file1 \
+           file://file2"
+
diff --git a/meta-selftest/recipes-test/devtool/devtool-test-localonly/file1 b/meta-selftest/recipes-test/devtool/devtool-test-localonly/file1
new file mode 100644
index 0000000..f4bdcfc
--- /dev/null
+++ b/meta-selftest/recipes-test/devtool/devtool-test-localonly/file1
@@ -0,0 +1 @@
+The first file
diff --git a/meta-selftest/recipes-test/devtool/devtool-test-localonly/file2 b/meta-selftest/recipes-test/devtool/devtool-test-localonly/file2
new file mode 100644
index 0000000..a7e2414
--- /dev/null
+++ b/meta-selftest/recipes-test/devtool/devtool-test-localonly/file2
@@ -0,0 +1 @@
+The second file
diff --git a/meta/lib/oeqa/selftest/devtool.py b/meta/lib/oeqa/selftest/devtool.py
index 46f5a0b..f6226c1 100644
--- a/meta/lib/oeqa/selftest/devtool.py
+++ b/meta/lib/oeqa/selftest/devtool.py
@@ -930,6 +930,24 @@ class DevtoolTests(DevtoolBase):
                            ('??', '.*/0001-Add-new-file.patch$')]
         self._check_repo_status(os.path.dirname(recipefile), expected_status)
 
+    def test_devtool_update_recipe_local_files_3(self):
+        # First, modify the recipe
+        testrecipe = 'devtool-test-localonly'
+        recipefile = get_bb_var('FILE', testrecipe)
+        src_uri = get_bb_var('SRC_URI', testrecipe)
+        tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+        self.track_for_cleanup(tempdir)
+        self.track_for_cleanup(self.workspacedir)
+        self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+        # (don't bother with cleaning the recipe on teardown, we won't be building it)
+        result = runCmd('devtool modify %s' % testrecipe)
+        # Modify one file
+        runCmd('echo "Another line" >> file2', cwd=os.path.join(self.workspacedir, 'sources', testrecipe, 'oe-local-files'))
+        self.add_command_to_tearDown('cd %s; rm %s/*; git checkout %s %s' % (os.path.dirname(recipefile), testrecipe, testrecipe, os.path.basename(recipefile)))
+        result = runCmd('devtool update-recipe %s' % testrecipe)
+        expected_status = [(' M', '.*/%s/file2$' % testrecipe)]
+        self._check_repo_status(os.path.dirname(recipefile), expected_status)
+
     @testcase(1163)
     def test_devtool_extract(self):
         tempdir = tempfile.mkdtemp(prefix='devtoolqa')
-- 
2.5.5



^ permalink raw reply related

* [PATCH 3/7] lib/oe/patch: fix handling of patches with no header
From: Paul Eggleton @ 2016-11-10  1:45 UTC (permalink / raw)
  To: openembedded-core
In-Reply-To: <cover.1478742229.git.paul.eggleton@linux.intel.com>

If a patch applied by a recipe has no header and we turn the recipe's
source into a git tree (when PATCHTOOL = "git" or when using devtool
extract / modify / upgrade), the commit message ends up consisting only
of the original filename marker ("%% original patch: filename.patch").
When we come to do turn the commits back into a set of patches in
extractPatches(), this first line ends up in the "Subject: " part of
the file, but we were ignoring it because the line didn't start with the
marker text. The end result was we weren't able to get the original
patch name. Strip off any "Subject [PATCH x/y]" part before looking for
the marker text to fix.

This caused "devtool modify openssl" followed by "devtool update-recipe
openssl" (without any changes in-between) to remove version-script.patch
because that patch has no header and we weren't able to determine the
original filename.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 meta/lib/oe/patch.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py
index 0332f10..dbefd28 100644
--- a/meta/lib/oe/patch.py
+++ b/meta/lib/oe/patch.py
@@ -428,6 +428,7 @@ class GitApplyTree(PatchTree):
     def extractPatches(tree, startcommit, outdir, paths=None):
         import tempfile
         import shutil
+        import re
         tempdir = tempfile.mkdtemp(prefix='oepatch')
         try:
             shellcmd = ["git", "format-patch", startcommit, "-o", tempdir]
@@ -443,10 +444,13 @@ class GitApplyTree(PatchTree):
                         try:
                             with open(srcfile, 'r', encoding=encoding) as f:
                                 for line in f:
-                                    if line.startswith(GitApplyTree.patch_line_prefix):
+                                    checkline = line
+                                    if checkline.startswith('Subject: '):
+                                        checkline = re.sub(r'\[.+?\]\s*', '', checkline[9:])
+                                    if checkline.startswith(GitApplyTree.patch_line_prefix):
                                         outfile = line.split()[-1].strip()
                                         continue
-                                    if line.startswith(GitApplyTree.ignore_commit_prefix):
+                                    if checkline.startswith(GitApplyTree.ignore_commit_prefix):
                                         continue
                                     patchlines.append(line)
                         except UnicodeDecodeError:
-- 
2.5.5



^ permalink raw reply related

* [PATCH 4/7] devtool: update-recipe: fix handling of compressed local patches
From: Paul Eggleton @ 2016-11-10  1:45 UTC (permalink / raw)
  To: openembedded-core
In-Reply-To: <cover.1478742229.git.paul.eggleton@linux.intel.com>

It is possible to use gzip or bzip2 to compress patches and still refer
to them in compressed form in the SRC_URI value within a recipe. If you
run "devtool modify" on such a recipe, make changes to the commit for
the patch and then run devtool update-recipe, we need to correctly
associate the commit back to the compressed patch file and re-compress
the patch, neither of which we were doing previously.

Additionally, add an oe-selftest test to ensure this doesn't regress in
future.

Fixes [YOCTO #8278].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 .../recipes-test/devtool/devtool-test-patch-gz.bb  |  16 ++++++
 .../devtool/devtool-test-patch-gz/readme.patch.gz  | Bin 0 -> 449 bytes
 meta/classes/patch.bbclass                         |   9 ++--
 meta/lib/oe/recipeutils.py                         |   6 +--
 meta/lib/oeqa/selftest/devtool.py                  |  24 +++++++++
 scripts/lib/devtool/standard.py                    |  55 ++++++++++++++-------
 6 files changed, 85 insertions(+), 25 deletions(-)
 create mode 100644 meta-selftest/recipes-test/devtool/devtool-test-patch-gz.bb
 create mode 100644 meta-selftest/recipes-test/devtool/devtool-test-patch-gz/readme.patch.gz

diff --git a/meta-selftest/recipes-test/devtool/devtool-test-patch-gz.bb b/meta-selftest/recipes-test/devtool/devtool-test-patch-gz.bb
new file mode 100644
index 0000000..719a5f1
--- /dev/null
+++ b/meta-selftest/recipes-test/devtool/devtool-test-patch-gz.bb
@@ -0,0 +1,16 @@
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+DEPENDS = "libxres libxext virtual/libx11 ncurses"
+
+SRC_URI = "http://downloads.yoctoproject.org/releases/xrestop/xrestop-0.4.tar.gz \
+           file://readme.patch.gz \
+           "
+
+S = "${WORKDIR}/xrestop-0.4"
+
+SRC_URI[md5sum] = "d8a54596cbaf037e62b80c4585a3ca9b"
+SRC_URI[sha256sum] = "67c2fc94a7ecedbaae0d1837e82e93d1d98f4a6d759828860e552119af3ce257"
+
+inherit autotools pkgconfig
+
diff --git a/meta-selftest/recipes-test/devtool/devtool-test-patch-gz/readme.patch.gz b/meta-selftest/recipes-test/devtool/devtool-test-patch-gz/readme.patch.gz
new file mode 100644
index 0000000000000000000000000000000000000000..4752492ccd661e2c360d8fe2ca4dcef61dea89ce
GIT binary patch
literal 449
zcmV;y0Y3g8iwFpRQ6X3W19D|yWNl?GaA9;~XaJQ_O>5jR5WVYHyjxnlc4f!1V^fNk
zWJ7aE3E3?KLJs~Id)3;KYs+B+{qddME-gJ44dTsc=FQC0?PLdJlx8wZ;!344qp+#@
zPUA$yDr(w9R#{f3l}d1L4Yo8QOd(}{GDK2_;+AQ0Jd{h1P1p70IPv4iZa`<Z=(Sl6
zfi{l%pti#&aZ@_Vv0G?`D}1r9%oHX}orfw9FX4rkQi|<TeWTjtcz#&#u0OwE-83kT
zb$gn?lmutN4kjv_frR)v&W`cmZ(Zq@ImewT$8oabq`4oS9nDUg?nQ{L?hG})ZCk&3
z``_Vx-xqk?tZ(i&_=yOfClI35J)z#0rlV%XQEg_LoVI3u=e-xA(QOOg@3cet;apsu
zfzYO*1JWwKl4%(Pm5OSmDuhxdaeVCer$%_5_qVPn;D@WDUMq#75O{i|d1puH8EafP
zJ6^C*-;YAs9<7})SfibtSOq-cy4PeJc+OW=bfVcVQ%zXrvZDZk&z<A&k45v_N$Dd$
r=-|lAyjdVT;qCU^jP0L~(dLx?d(410fQSMWC?S3U{t;{<bpikYONih}

literal 0
HcmV?d00001

diff --git a/meta/classes/patch.bbclass b/meta/classes/patch.bbclass
index 1f6927b..2c1f58c 100644
--- a/meta/classes/patch.bbclass
+++ b/meta/classes/patch.bbclass
@@ -10,13 +10,13 @@ PATCH_GIT_USER_EMAIL ?= "oe.patch@oe"
 
 inherit terminal
 
-def src_patches(d, all = False ):
+def src_patches(d, all=False, expand=True):
     workdir = d.getVar('WORKDIR', True)
     fetch = bb.fetch2.Fetch([], d)
     patches = []
     sources = []
     for url in fetch.urls:
-        local = patch_path(url, fetch, workdir)
+        local = patch_path(url, fetch, workdir, expand)
         if not local:
             if all:
                 local = fetch.localpath(url)
@@ -55,13 +55,14 @@ def src_patches(d, all = False ):
 
     return patches
 
-def patch_path(url, fetch, workdir):
+def patch_path(url, fetch, workdir, expand=True):
     """Return the local path of a patch, or None if this isn't a patch"""
 
     local = fetch.localpath(url)
     base, ext = os.path.splitext(os.path.basename(local))
     if ext in ('.gz', '.bz2', '.Z'):
-        local = os.path.join(workdir, base)
+        if expand:
+            local = os.path.join(workdir, base)
         ext = os.path.splitext(base)[1]
 
     urldata = fetch.ud[url]
diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py
index 6caae5f..ab4177a 100644
--- a/meta/lib/oe/recipeutils.py
+++ b/meta/lib/oe/recipeutils.py
@@ -397,7 +397,7 @@ def get_recipe_local_files(d, patches=False):
     for uri in uris:
         if fetch.ud[uri].type == 'file':
             if (not patches and
-                    bb.utils.exec_flat_python_func('patch_path', uri, fetch, '')):
+                    bb.utils.exec_flat_python_func('patch_path', uri, fetch, '', expand=False)):
                 continue
             # Skip files that are referenced by absolute path
             fname = fetch.ud[uri].basepath
@@ -418,7 +418,7 @@ def get_recipe_patches(d):
     patchfiles = []
     # Execute src_patches() defined in patch.bbclass - this works since that class
     # is inherited globally
-    patches = bb.utils.exec_flat_python_func('src_patches', d)
+    patches = bb.utils.exec_flat_python_func('src_patches', d, expand=False)
     for patch in patches:
         _, _, local, _, _, parm = bb.fetch.decodeurl(patch)
         patchfiles.append(local)
@@ -437,7 +437,7 @@ def get_recipe_patched_files(d):
     import oe.patch
     # Execute src_patches() defined in patch.bbclass - this works since that class
     # is inherited globally
-    patches = bb.utils.exec_flat_python_func('src_patches', d)
+    patches = bb.utils.exec_flat_python_func('src_patches', d, expand=False)
     patchedfiles = {}
     for patch in patches:
         _, _, patchfile, _, _, parm = bb.fetch.decodeurl(patch)
diff --git a/meta/lib/oeqa/selftest/devtool.py b/meta/lib/oeqa/selftest/devtool.py
index f6226c1..92dc5e5 100644
--- a/meta/lib/oeqa/selftest/devtool.py
+++ b/meta/lib/oeqa/selftest/devtool.py
@@ -948,6 +948,30 @@ class DevtoolTests(DevtoolBase):
         expected_status = [(' M', '.*/%s/file2$' % testrecipe)]
         self._check_repo_status(os.path.dirname(recipefile), expected_status)
 
+    def test_devtool_update_recipe_local_patch_gz(self):
+        # First, modify the recipe
+        testrecipe = 'devtool-test-patch-gz'
+        recipefile = get_bb_var('FILE', testrecipe)
+        src_uri = get_bb_var('SRC_URI', testrecipe)
+        tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+        self.track_for_cleanup(tempdir)
+        self.track_for_cleanup(self.workspacedir)
+        self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+        # (don't bother with cleaning the recipe on teardown, we won't be building it)
+        result = runCmd('devtool modify %s' % testrecipe)
+        # Modify one file
+        srctree = os.path.join(self.workspacedir, 'sources', testrecipe)
+        runCmd('echo "Another line" >> README', cwd=srctree)
+        runCmd('git commit -a --amend --no-edit', cwd=srctree)
+        self.add_command_to_tearDown('cd %s; rm %s/*; git checkout %s %s' % (os.path.dirname(recipefile), testrecipe, testrecipe, os.path.basename(recipefile)))
+        result = runCmd('devtool update-recipe %s' % testrecipe)
+        expected_status = [(' M', '.*/%s/readme.patch.gz$' % testrecipe)]
+        self._check_repo_status(os.path.dirname(recipefile), expected_status)
+        patch_gz = os.path.join(os.path.dirname(recipefile), testrecipe, 'readme.patch.gz')
+        result = runCmd('file %s' % patch_gz)
+        if 'gzip compressed data' not in result.output:
+            self.fail('New patch file is not gzipped - file reports:\n%s' % result.output)
+
     @testcase(1163)
     def test_devtool_extract(self):
         tempdir = tempfile.mkdtemp(prefix='devtoolqa')
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 1511641..af0d467 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -1128,7 +1128,7 @@ def _remove_source_files(append, files, destpath):
                     raise
 
 
-def _export_patches(srctree, rd, start_rev, destdir):
+def _export_patches(srctree, rd, start_rev, destdir, changed_revs=None):
     """Export patches from srctree to given location.
        Returns three-tuple of dicts:
          1. updated - patches that already exist in SRCURI
@@ -1157,18 +1157,44 @@ def _export_patches(srctree, rd, start_rev, destdir):
         # revision This does assume that people are using unique shortlog
         # values, but they ought to be anyway...
         new_basename = seqpatch_re.match(new_patch).group(2)
-        found = False
+        match_name = None
         for old_patch in existing_patches:
             old_basename = seqpatch_re.match(old_patch).group(2)
-            if new_basename == old_basename:
-                updated[new_patch] = existing_patches.pop(old_patch)
-                found = True
-                # Rename patch files
-                if new_patch != old_patch:
-                    os.rename(os.path.join(destdir, new_patch),
-                              os.path.join(destdir, old_patch))
+            old_basename_splitext = os.path.splitext(old_basename)
+            if old_basename.endswith(('.gz', '.bz2', '.Z')) and old_basename_splitext[0] == new_basename:
+                old_patch_noext = os.path.splitext(old_patch)[0]
+                match_name = old_patch_noext
                 break
-        if not found:
+            elif new_basename == old_basename:
+                match_name = old_patch
+                break
+        if match_name:
+            # Rename patch files
+            if new_patch != match_name:
+                os.rename(os.path.join(destdir, new_patch),
+                          os.path.join(destdir, match_name))
+            # Need to pop it off the list now before checking changed_revs
+            oldpath = existing_patches.pop(old_patch)
+            if changed_revs is not None:
+                # Avoid updating patches that have not actually changed
+                with open(os.path.join(destdir, match_name), 'r') as f:
+                    firstlineitems = f.readline().split()
+                    # Looking for "From <hash>" line
+                    if len(firstlineitems) > 1 and len(firstlineitems[1]) == 40:
+                        if not firstlineitems[1] in changed_revs:
+                            continue
+            # Recompress if necessary
+            if oldpath.endswith(('.gz', '.Z')):
+                bb.process.run(['gzip', match_name], cwd=destdir)
+                if oldpath.endswith('.gz'):
+                    match_name += '.gz'
+                else:
+                    match_name += '.Z'
+            elif oldpath.endswith('.bz2'):
+                bb.process.run(['bzip2', match_name], cwd=destdir)
+                match_name += '.bz2'
+            updated[match_name] = oldpath
+        else:
             added[new_patch] = None
     return (updated, added, existing_patches)
 
@@ -1415,7 +1441,7 @@ def _update_recipe_patch(recipename, workspace, srctree, rd, appendlayerdir, wil
         # Get updated patches from source tree
         patches_dir = tempfile.mkdtemp(dir=tempdir)
         upd_p, new_p, del_p = _export_patches(srctree, rd, update_rev,
-                                              patches_dir)
+                                              patches_dir, changed_revs)
         updatefiles = False
         updaterecipe = False
         destpath = None
@@ -1453,13 +1479,6 @@ def _update_recipe_patch(recipename, workspace, srctree, rd, appendlayerdir, wil
                 updatefiles = True
             for basepath, path in upd_p.items():
                 patchfn = os.path.join(patches_dir, basepath)
-                if changed_revs is not None:
-                    # Avoid updating patches that have not actually changed
-                    with open(patchfn, 'r') as f:
-                        firstlineitems = f.readline().split()
-                        if len(firstlineitems) > 1 and len(firstlineitems[1]) == 40:
-                            if not firstlineitems[1] in changed_revs:
-                                continue
                 logger.info('Updating patch %s' % basepath)
                 _move_file(patchfn, path)
                 updatefiles = True
-- 
2.5.5



^ permalink raw reply related

* [PATCH 5/7] devtool: update-recipe: support replacing remote patches
From: Paul Eggleton @ 2016-11-10  1:45 UTC (permalink / raw)
  To: openembedded-core
In-Reply-To: <cover.1478742229.git.paul.eggleton@linux.intel.com>

If you have a patch remotely fetched in a recipe (e.g. from an http
server) that needs updating then add a local version and substitute the
entry in SRC_URI to point to it.

One can argue about how desirable it is to be modifying patches fetched
in this way, but then one can argue about how desirable it is to have
such patches in the recipe in the first place - and in any case if
devtool update-recipe is to correctly transfer changes to such patches
made in the git repository within the source tree to the recipe then
there isn't much choice but to do it this way.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 scripts/lib/devtool/standard.py | 26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index af0d467..34de7bd 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -1104,6 +1104,15 @@ def _remove_file_entries(srcuri, filelist):
                 break
     return entries, remaining
 
+def _replace_srcuri_entry(srcuri, filename, newentry):
+    """Replace entry corresponding to specified file with a new entry"""
+    basename = os.path.basename(filename)
+    for i in range(len(srcuri)):
+        if os.path.basename(srcuri[i].split(';')[0]) == basename:
+            srcuri.pop(i)
+            srcuri.insert(i, newentry)
+            break
+
 def _remove_source_files(append, files, destpath):
     """Unlink existing patch files"""
     for path in files:
@@ -1424,6 +1433,10 @@ def _update_recipe_patch(recipename, workspace, srctree, rd, appendlayerdir, wil
         raise DevtoolError('Unable to find initial revision - please specify '
                            'it with --initial-rev')
 
+    dl_dir = rd.getVar('DL_DIR', True)
+    if not dl_dir.endswith('/'):
+        dl_dir += '/'
+
     tempdir = tempfile.mkdtemp(prefix='devtool')
     try:
         local_files_dir = tempfile.mkdtemp(dir=tempdir)
@@ -1468,6 +1481,7 @@ def _update_recipe_patch(recipename, workspace, srctree, rd, appendlayerdir, wil
                 logger.info('No patches or local source files needed updating')
         else:
             # Update existing files
+            files_dir = _determine_files_dir(rd)
             for basepath, path in upd_f.items():
                 logger.info('Updating file %s' % basepath)
                 if os.path.isabs(basepath):
@@ -1479,11 +1493,19 @@ def _update_recipe_patch(recipename, workspace, srctree, rd, appendlayerdir, wil
                 updatefiles = True
             for basepath, path in upd_p.items():
                 patchfn = os.path.join(patches_dir, basepath)
-                logger.info('Updating patch %s' % basepath)
+                if os.path.dirname(path) + '/' == dl_dir:
+                    # This is a a downloaded patch file - we now need to
+                    # replace the entry in SRC_URI with our local version
+                    logger.info('Replacing remote patch %s with updated local version' % basepath)
+                    path = os.path.join(files_dir, basepath)
+                    _replace_srcuri_entry(srcuri, basepath, 'file://%s' % basepath)
+                    updaterecipe = True
+                else:
+                    logger.info('Updating patch %s' % basepath)
+                logger.debug('Moving new patch %s to %s' % (patchfn, path))
                 _move_file(patchfn, path)
                 updatefiles = True
             # Add any new files
-            files_dir = _determine_files_dir(rd)
             for basepath, path in new_f.items():
                 logger.info('Adding new file %s' % basepath)
                 _move_file(os.path.join(local_files_dir, basepath),
-- 
2.5.5



^ permalink raw reply related

* [PATCH 6/7] lib/oe/recipeutils: ignore archives by default in get_recipe_local_files()
From: Paul Eggleton @ 2016-11-10  1:45 UTC (permalink / raw)
  To: openembedded-core
In-Reply-To: <cover.1478742229.git.paul.eggleton@linux.intel.com>

By default, have get_recipe_local_files() not return any archive
files. This prevents a local tarball from being erroneously removed
from SRC_URI if you run "devtool modify" on a recipe followed by
"devtool update-recipe". It doesn't actually help you to directly
update the contents of such tarballs, but at least now it won't break
the recipe.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 meta/lib/oe/recipeutils.py | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py
index ab4177a..1589feb 100644
--- a/meta/lib/oe/recipeutils.py
+++ b/meta/lib/oe/recipeutils.py
@@ -389,10 +389,15 @@ def copy_recipe_files(d, tgt_dir, whole_dir=False, download=True):
     return copied, remotes
 
 
-def get_recipe_local_files(d, patches=False):
+def get_recipe_local_files(d, patches=False, archives=False):
     """Get a list of local files in SRC_URI within a recipe."""
     uris = (d.getVar('SRC_URI', True) or "").split()
     fetch = bb.fetch2.Fetch(uris, d)
+    # FIXME this list should be factored out somewhere else (such as the
+    # fetcher) though note that this only encompasses actual container formats
+    # i.e. that can contain multiple files as opposed to those that only
+    # contain a compressed stream (i.e. .tar.gz as opposed to just .gz)
+    archive_exts = ['.tar', '.tgz', '.tar.gz', '.tar.Z', '.tbz', '.tbz2', '.tar.bz2', '.tar.xz', '.tar.lz', '.zip', '.jar', '.rpm', '.srpm', '.deb', '.ipk', '.tar.7z', '.7z']
     ret = {}
     for uri in uris:
         if fetch.ud[uri].type == 'file':
@@ -409,7 +414,14 @@ def get_recipe_local_files(d, patches=False):
                 if os.path.isabs(subdir):
                     continue
                 fname = os.path.join(subdir, fname)
-            ret[fname] = fetch.localpath(uri)
+            localpath = fetch.localpath(uri)
+            if not archives:
+                # Ignore archives that will be unpacked
+                if localpath.endswith(tuple(archive_exts)):
+                    unpack = fetch.ud[uri].parm.get('unpack', True)
+                    if unpack:
+                        continue
+            ret[fname] = localpath
     return ret
 
 
-- 
2.5.5



^ permalink raw reply related

* [PATCH 7/7] oe-selftest: devtool: test that updating a file with subdir= works
From: Paul Eggleton @ 2016-11-10  1:45 UTC (permalink / raw)
  To: openembedded-core
In-Reply-To: <cover.1478742229.git.paul.eggleton@linux.intel.com>

If you have a file:// entry in SRC_URI with a subdir= parameter that
makes it extract into the source tree, then when you update that file in
oe-local-files and run devtool update-recipe then you want the original
file to be updated. This was made to work by OE-Core commit
9069fef5dad5a873c8a8f720f7bcbc7625556309 together with
31f1bbad248c36a8c86dde4ff57ce42efc664082, however until now there was no
oe-selftest test to verify it.

Note that in order to succeed this test also requires the fix
"lib/oe/recipeutils: ignore archives by default in
get_recipe_local_files()" since the test recipe uses a local tarball.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 .../recipes-test/devtool/devtool-test-subdir.bb    |   7 ++++++
 .../devtool-test-subdir/devtool-test-subdir.tar.gz | Bin 0 -> 181 bytes
 .../devtool/devtool-test-subdir/testfile           |   1 +
 meta/lib/oeqa/selftest/devtool.py                  |  25 +++++++++++++++++++++
 4 files changed, 33 insertions(+)
 create mode 100644 meta-selftest/recipes-test/devtool/devtool-test-subdir.bb
 create mode 100644 meta-selftest/recipes-test/devtool/devtool-test-subdir/devtool-test-subdir.tar.gz
 create mode 100644 meta-selftest/recipes-test/devtool/devtool-test-subdir/testfile

diff --git a/meta-selftest/recipes-test/devtool/devtool-test-subdir.bb b/meta-selftest/recipes-test/devtool/devtool-test-subdir.bb
new file mode 100644
index 0000000..1a163f8
--- /dev/null
+++ b/meta-selftest/recipes-test/devtool/devtool-test-subdir.bb
@@ -0,0 +1,7 @@
+LICENSE = "CLOSED"
+INHIBIT_DEFAULT_DEPS = "1"
+
+SRC_URI = "file://devtool-test-subdir.tar.gz \
+           file://testfile;subdir=${BPN}"
+
+S = "${WORKDIR}/${BPN}"
diff --git a/meta-selftest/recipes-test/devtool/devtool-test-subdir/devtool-test-subdir.tar.gz b/meta-selftest/recipes-test/devtool/devtool-test-subdir/devtool-test-subdir.tar.gz
new file mode 100644
index 0000000000000000000000000000000000000000..3d44f803cb996f47ddb9566a6a2c278bd2fd38a7
GIT binary patch
literal 181
zcmb2|=3q$6J|51%{Pv<F*C7Le)`x3sUG)NdZmC(erLQpYQrL27neF~E#f~elloTHQ
z&rMTkto#sVzkFZ6>!)O`V=r&CCF&amo1dGRnw5U#@gCt_C1KIoKB3%8wHJFS`o2@h
zUS??8Jmt|PpTgJocYl|^y6(&VH_HWT*GYRHymoE<Z~d>q|Cg=lnV=Qkpj&_Me<H{8
f3#NhR>Li@+zuhOx!GHt~9AEb)s!EYTgMk46=?79i

literal 0
HcmV?d00001

diff --git a/meta-selftest/recipes-test/devtool/devtool-test-subdir/testfile b/meta-selftest/recipes-test/devtool/devtool-test-subdir/testfile
new file mode 100644
index 0000000..12b519c
--- /dev/null
+++ b/meta-selftest/recipes-test/devtool/devtool-test-subdir/testfile
@@ -0,0 +1 @@
+Modified version
diff --git a/meta/lib/oeqa/selftest/devtool.py b/meta/lib/oeqa/selftest/devtool.py
index 92dc5e5..2a08721 100644
--- a/meta/lib/oeqa/selftest/devtool.py
+++ b/meta/lib/oeqa/selftest/devtool.py
@@ -972,6 +972,31 @@ class DevtoolTests(DevtoolBase):
         if 'gzip compressed data' not in result.output:
             self.fail('New patch file is not gzipped - file reports:\n%s' % result.output)
 
+    def test_devtool_update_recipe_local_files_subdir(self):
+        # Try devtool extract on a recipe that has a file with subdir= set in
+        # SRC_URI such that it overwrites a file that was in an archive that
+        # was also in SRC_URI
+        # First, modify the recipe
+        testrecipe = 'devtool-test-subdir'
+        recipefile = get_bb_var('FILE', testrecipe)
+        src_uri = get_bb_var('SRC_URI', testrecipe)
+        tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+        self.track_for_cleanup(tempdir)
+        self.track_for_cleanup(self.workspacedir)
+        self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+        # (don't bother with cleaning the recipe on teardown, we won't be building it)
+        result = runCmd('devtool modify %s' % testrecipe)
+        testfile = os.path.join(self.workspacedir, 'sources', testrecipe, 'testfile')
+        self.assertTrue(os.path.exists(testfile), 'Extracted source could not be found')
+        with open(testfile, 'r') as f:
+            contents = f.read().rstrip()
+        self.assertEqual(contents, 'Modified version', 'File has apparently not been overwritten as it should have been')
+        # Test devtool update-recipe without modifying any files
+        self.add_command_to_tearDown('cd %s; rm %s/*; git checkout %s %s' % (os.path.dirname(recipefile), testrecipe, testrecipe, os.path.basename(recipefile)))
+        result = runCmd('devtool update-recipe %s' % testrecipe)
+        expected_status = []
+        self._check_repo_status(os.path.dirname(recipefile), expected_status)
+
     @testcase(1163)
     def test_devtool_extract(self):
         tempdir = tempfile.mkdtemp(prefix='devtoolqa')
-- 
2.5.5



^ permalink raw reply related

* [RFT][PATCH] systemd: Upgrade to 232
From: Khem Raj @ 2016-11-10  6:11 UTC (permalink / raw)
  To: openembedded-core

* Drop support for rcS.d SysV init scripts.
  These are prone to cause dependency loops, and almost all packages with
  rcS scripts now ship a native systemd service.

* Drop mount propagation patch, it only happens with libseccomp, OE doesnt
  enable it

* kdbus option has disappeared from configure

* Ignore dev-so for PN now since systemd introduced private .so see
  https://github.com/systemd/systemd/issues/3810

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/recipes-core/systemd/systemd.inc              |   4 +-
 ....c-Change-the-default-device-timeout-to-2.patch |   8 +-
 ...r-getty-to-agetty-in-console-setup-system.patch |  10 +-
 .../systemd/0003-define-exp10-if-missing.patch     |  12 +-
 ...nv-when-secure-versions-are-not-available.patch |  21 ++--
 ...t-install-dependency-links-at-install-tim.patch |  10 +-
 ...heck-for-additional-features-that-uclibc-.patch |  10 +-
 ...pper-instead-of-looking-for-relative-opti.patch |  38 ++----
 ...wn-Use-execvpe-only-when-libc-supports-it.patch |  16 +--
 ...-unimplemented-_SC_PHYS_PAGES-system-conf.patch |  27 +++--
 ...0010-implment-systemd-sysv-install-for-OE.patch |   6 +-
 ...nes-Build-conditionally-when-HAVE_MYHOSTN.patch |  12 +-
 .../systemd/0012-rules-whitelist-hd-devices.patch  |  21 ++--
 ...-Make-root-s-home-directory-configurable.patch} |  90 +++++---------
 ...tor-add-support-for-executing-scripts-und.patch | 133 ---------------------
 ...vert-rules-remove-firmware-loading-rules.patch} |   6 +-
 ...remove-userspace-firmware-loading-suppor.patch} |  58 +++++----
 ...0015-systemd-user-avoid-using-system-auth.patch |  35 ------
 ...patch => 0016-make-test-dir-configurable.patch} |  21 ++--
 ...=> 0017-remove-duplicate-include-uchar.h.patch} |  10 +-
 ...h => 0018-check-for-uchar.h-in-configure.patch} |  16 ++-
 ...l-don-t-fail-if-libc-doesn-t-support-IDN.patch} |  20 ++--
 ...sing.h-for-getting-secure_getenv-definiti.patch |  27 -----
 .../systemd/systemd/CVE-2016-7795.patch            |  69 -----------
 ...dev-re-enable-mount-propagation-for-udevd.patch |  31 -----
 .../systemd/{systemd_230.bb => systemd_232.bb}     |  22 ++--
 26 files changed, 195 insertions(+), 538 deletions(-)
 rename meta/recipes-core/systemd/systemd/{0014-Make-root-s-home-directory-configurable.patch => 0013-Make-root-s-home-directory-configurable.patch} (66%)
 delete mode 100644 meta/recipes-core/systemd/systemd/0013-sysv-generator-add-support-for-executing-scripts-und.patch
 rename meta/recipes-core/systemd/systemd/{0016-Revert-rules-remove-firmware-loading-rules.patch => 0014-Revert-rules-remove-firmware-loading-rules.patch} (84%)
 rename meta/recipes-core/systemd/systemd/{0017-Revert-udev-remove-userspace-firmware-loading-suppor.patch => 0015-Revert-udev-remove-userspace-firmware-loading-suppor.patch} (89%)
 delete mode 100644 meta/recipes-core/systemd/systemd/0015-systemd-user-avoid-using-system-auth.patch
 rename meta/recipes-core/systemd/systemd/{0018-make-test-dir-configurable.patch => 0016-make-test-dir-configurable.patch} (77%)
 rename meta/recipes-core/systemd/systemd/{0019-remove-duplicate-include-uchar.h.patch => 0017-remove-duplicate-include-uchar.h.patch} (81%)
 rename meta/recipes-core/systemd/systemd/{0020-check-for-uchar.h-in-configure.patch => 0018-check-for-uchar.h-in-configure.patch} (76%)
 rename meta/recipes-core/systemd/systemd/{0022-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch => 0019-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch} (69%)
 delete mode 100644 meta/recipes-core/systemd/systemd/0021-include-missing.h-for-getting-secure_getenv-definiti.patch
 delete mode 100644 meta/recipes-core/systemd/systemd/CVE-2016-7795.patch
 delete mode 100644 meta/recipes-core/systemd/systemd/udev-re-enable-mount-propagation-for-udevd.patch
 rename meta/recipes-core/systemd/{systemd_230.bb => systemd_232.bb} (97%)

diff --git a/meta/recipes-core/systemd/systemd.inc b/meta/recipes-core/systemd/systemd.inc
index f800f42..29e0be6 100644
--- a/meta/recipes-core/systemd/systemd.inc
+++ b/meta/recipes-core/systemd/systemd.inc
@@ -14,12 +14,10 @@ LICENSE = "GPLv2 & LGPLv2.1"
 LIC_FILES_CHKSUM = "file://LICENSE.GPL2;md5=751419260aa954499f7abaabaa882bbe \
                     file://LICENSE.LGPL2.1;md5=4fbd65380cdd255951079008b364516c"
 
-SRCREV = "3a74d4fc90cb322a4784a3515bef7118c8f8c5ba"
+SRCREV = "a1e2ef7ec912902d8142e7cb5830cbfb47dba86c"
 
 SRC_URI = "git://github.com/systemd/systemd.git;protocol=git"
 
-PV = "230+git${SRCPV}"
-
 S = "${WORKDIR}/git"
 
 LDFLAGS_append_libc-uclibc = " -lrt -lssp_nonshared -lssp "
diff --git a/meta/recipes-core/systemd/systemd/0001-core-device.c-Change-the-default-device-timeout-to-2.patch b/meta/recipes-core/systemd/systemd/0001-core-device.c-Change-the-default-device-timeout-to-2.patch
index f7ef7a3..ee2cd6c 100644
--- a/meta/recipes-core/systemd/systemd/0001-core-device.c-Change-the-default-device-timeout-to-2.patch
+++ b/meta/recipes-core/systemd/systemd/0001-core-device.c-Change-the-default-device-timeout-to-2.patch
@@ -1,7 +1,7 @@
-From 3bc4552117879f57522b5972b724729ca993f1ea Mon Sep 17 00:00:00 2001
+From a544d6d15f5c418084f322349aafe341128d5fca Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Mon, 14 Dec 2015 04:09:19 +0000
-Subject: [PATCH 01/36] core/device.c: Change the default device timeout to 240
+Subject: [PATCH 01/19] core/device.c: Change the default device timeout to 240
  sec.
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
@@ -16,7 +16,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/src/core/device.c b/src/core/device.c
-index d201dc5..340d62a 100644
+index c572a67..f90774e 100644
 --- a/src/core/device.c
 +++ b/src/core/device.c
 @@ -112,7 +112,7 @@ static void device_init(Unit *u) {
@@ -29,5 +29,5 @@ index d201dc5..340d62a 100644
          u->ignore_on_isolate = true;
  }
 -- 
-1.8.3.1
+2.10.2
 
diff --git a/meta/recipes-core/systemd/systemd/0002-units-Prefer-getty-to-agetty-in-console-setup-system.patch b/meta/recipes-core/systemd/systemd/0002-units-Prefer-getty-to-agetty-in-console-setup-system.patch
index 28939eb..951a28d 100644
--- a/meta/recipes-core/systemd/systemd/0002-units-Prefer-getty-to-agetty-in-console-setup-system.patch
+++ b/meta/recipes-core/systemd/systemd/0002-units-Prefer-getty-to-agetty-in-console-setup-system.patch
@@ -1,7 +1,7 @@
-From e5f405aba347d216e7f2b73d7dd681b13be442e3 Mon Sep 17 00:00:00 2001
+From 8736d9b9bb492f60e8f3a1a7fb5a05ba3201d86b Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Fri, 20 Feb 2015 05:29:15 +0000
-Subject: [PATCH 02/36] units: Prefer getty to agetty in console setup systemd
+Subject: [PATCH 02/19] units: Prefer getty to agetty in console setup systemd
  units
 
 Upstream-Status: Inappropriate [configuration specific]
@@ -14,10 +14,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
  2 files changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/units/getty@.service.m4 b/units/getty@.service.m4
-index 46164ab..bdf6ec8 100644
+index 5b82c13..e729469 100644
 --- a/units/getty@.service.m4
 +++ b/units/getty@.service.m4
-@@ -27,7 +27,7 @@ ConditionPathExists=/dev/tty0
+@@ -33,7 +33,7 @@ ConditionPathExists=/dev/tty0
  
  [Service]
  # the VT is cleared by TTYVTDisallocate
@@ -40,5 +40,5 @@ index 4522d0d..e6d499d 100644
  Restart=always
  UtmpIdentifier=%I
 -- 
-1.8.3.1
+2.10.2
 
diff --git a/meta/recipes-core/systemd/systemd/0003-define-exp10-if-missing.patch b/meta/recipes-core/systemd/systemd/0003-define-exp10-if-missing.patch
index e62d580..37c6ac5 100644
--- a/meta/recipes-core/systemd/systemd/0003-define-exp10-if-missing.patch
+++ b/meta/recipes-core/systemd/systemd/0003-define-exp10-if-missing.patch
@@ -1,4 +1,7 @@
-Subject: [PATCH 03/36] define exp10 if missing
+From b383c286f58184575216b2bf6f185ba2ad648956 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 9 Nov 2016 19:25:45 -0800
+Subject: [PATCH 03/19] define exp10 if missing
 
 Inspired by: http://peter.korsgaard.com/patches/alsa-utils/alsamixer-fix-build-on-uClibc-exp10.patch
 
@@ -8,16 +11,15 @@ Upstream-Status: Pending
 
 Signed-off-by: Samuel Martin <s.martin49@gmail.com>
 Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
 ---
  src/basic/missing.h | 5 +++++
  1 file changed, 5 insertions(+)
 
 diff --git a/src/basic/missing.h b/src/basic/missing.h
-index 651e414..fafa233 100644
+index 4c013be..4a3fd9c 100644
 --- a/src/basic/missing.h
 +++ b/src/basic/missing.h
-@@ -1013,4 +1013,9 @@ typedef int32_t key_serial_t;
+@@ -1078,4 +1078,9 @@ typedef int32_t key_serial_t;
  
  #endif
  
@@ -28,5 +30,5 @@ index 651e414..fafa233 100644
 +
  #include "missing_syscall.h"
 -- 
-2.8.3
+2.10.2
 
diff --git a/meta/recipes-core/systemd/systemd/0004-Use-getenv-when-secure-versions-are-not-available.patch b/meta/recipes-core/systemd/systemd/0004-Use-getenv-when-secure-versions-are-not-available.patch
index 989a1fa..ab2cbe0 100644
--- a/meta/recipes-core/systemd/systemd/0004-Use-getenv-when-secure-versions-are-not-available.patch
+++ b/meta/recipes-core/systemd/systemd/0004-Use-getenv-when-secure-versions-are-not-available.patch
@@ -1,7 +1,7 @@
-From bb8d8148b16572ae17d3c308552cf73915386b05 Mon Sep 17 00:00:00 2001
+From 5765cda4f7243e240b1e8723dc536fb20503d544 Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
-Date: Sat, 12 Sep 2015 19:10:04 +0000
-Subject: [PATCH 04/36] Use getenv when secure versions are not available
+Date: Wed, 9 Nov 2016 19:28:32 -0800
+Subject: [PATCH 04/19] Use getenv when secure versions are not available
 
 musl doesnt implement secure version, so we default
 to it if configure does not detect a secure imeplementation
@@ -9,19 +9,14 @@ to it if configure does not detect a secure imeplementation
 Signed-off-by: Khem Raj <raj.khem@gmail.com>
 Upstream-Status: Denied
 ---
- src/basic/missing.h | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
+ src/basic/missing.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/src/basic/missing.h b/src/basic/missing.h
-index ee7e7ea..3170429 100644
+index 4a3fd9c..4936873 100644
 --- a/src/basic/missing.h
 +++ b/src/basic/missing.h
-@@ -585,12 +585,11 @@ static inline int name_to_handle_at(int fd, const char *name, struct file_handle
-         return syscall(__NR_name_to_handle_at, fd, name, handle, mnt_id, flags);
- }
- #endif
--
- #ifndef HAVE_SECURE_GETENV
+@@ -529,7 +529,7 @@ struct btrfs_ioctl_quota_ctl_args {
  #  ifdef HAVE___SECURE_GETENV
  #    define secure_getenv __secure_getenv
  #  else
@@ -31,5 +26,5 @@ index ee7e7ea..3170429 100644
  #endif
  
 -- 
-1.8.3.1
+2.10.2
 
diff --git a/meta/recipes-core/systemd/systemd/0005-binfmt-Don-t-install-dependency-links-at-install-tim.patch b/meta/recipes-core/systemd/systemd/0005-binfmt-Don-t-install-dependency-links-at-install-tim.patch
index f69e26e..7016e98 100644
--- a/meta/recipes-core/systemd/systemd/0005-binfmt-Don-t-install-dependency-links-at-install-tim.patch
+++ b/meta/recipes-core/systemd/systemd/0005-binfmt-Don-t-install-dependency-links-at-install-tim.patch
@@ -1,7 +1,7 @@
-From 3436b12d40bf4f4ab7e3e16600e5f6c35a470da4 Mon Sep 17 00:00:00 2001
+From 74450f0dbad2f8478c26eeaa46d4e4a987858f45 Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Fri, 20 Feb 2015 05:03:44 +0000
-Subject: [PATCH 05/36] binfmt: Don't install dependency links at install time
+Subject: [PATCH 05/19] binfmt: Don't install dependency links at install time
  for the binfmt services
 
 use [Install] blocks so that they get created when the service is enabled
@@ -24,10 +24,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
  3 files changed, 8 insertions(+), 4 deletions(-)
 
 diff --git a/Makefile.am b/Makefile.am
-index 03341fc..629740f 100644
+index 50da458..29ed1dd 100644
 --- a/Makefile.am
 +++ b/Makefile.am
-@@ -4387,10 +4387,6 @@ INSTALL_DIRS += \
+@@ -4635,10 +4635,6 @@ INSTALL_DIRS += \
  	$(prefix)/lib/binfmt.d \
  	$(sysconfdir)/binfmt.d
  
@@ -70,5 +70,5 @@ index d53073e..8c57ee0 100644
 +[Install]
 +WantedBy=sysinit.target
 -- 
-1.8.3.1
+2.10.2
 
diff --git a/meta/recipes-core/systemd/systemd/0006-configure-Check-for-additional-features-that-uclibc-.patch b/meta/recipes-core/systemd/systemd/0006-configure-Check-for-additional-features-that-uclibc-.patch
index 0d63755..43a0d3f 100644
--- a/meta/recipes-core/systemd/systemd/0006-configure-Check-for-additional-features-that-uclibc-.patch
+++ b/meta/recipes-core/systemd/systemd/0006-configure-Check-for-additional-features-that-uclibc-.patch
@@ -1,7 +1,7 @@
-From bb6f1d8a000b337280541afde7cccdcfe03cdeb1 Mon Sep 17 00:00:00 2001
+From 82d837b76618a773485b96e38b7b91083a7437e8 Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Fri, 20 Feb 2015 05:05:45 +0000
-Subject: [PATCH 06/36] configure: Check for additional features that uclibc
+Subject: [PATCH 06/19] configure: Check for additional features that uclibc
  doesnt support
 
 This helps in supporting uclibc which does not have all features that
@@ -15,10 +15,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
  1 file changed, 18 insertions(+)
 
 diff --git a/configure.ac b/configure.ac
-index f51533c..0239fd0 100644
+index 7f6b3b9..7c4b5a2 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -112,6 +112,24 @@ AC_PATH_PROG([UMOUNT_PATH], [umount], [/usr/bin/umount], [$PATH:/usr/sbin:/sbin]
+@@ -110,6 +110,24 @@ AC_PATH_PROG([UMOUNT_PATH], [umount], [/usr/bin/umount], [$PATH:/usr/sbin:/sbin]
  
  AS_IF([! ln --relative --help > /dev/null 2>&1], [AC_MSG_ERROR([*** ln doesn't support --relative ***])])
  
@@ -44,5 +44,5 @@ index f51533c..0239fd0 100644
  
  AC_CHECK_TOOL(OBJCOPY, objcopy)
 -- 
-1.8.3.1
+2.10.2
 
diff --git a/meta/recipes-core/systemd/systemd/0007-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch b/meta/recipes-core/systemd/systemd/0007-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch
index 12f6ace..fad69a5 100644
--- a/meta/recipes-core/systemd/systemd/0007-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch
+++ b/meta/recipes-core/systemd/systemd/0007-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch
@@ -1,31 +1,22 @@
-From fa5e137fbd2fb081ae897575377d718ee8cb6349 Mon Sep 17 00:00:00 2001
+From a3482c91642cf568b3ac27fa6c0cb3c6b30669b7 Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
-Date: Sun, 20 Dec 2015 04:20:28 +0000
-Subject: [PATCH 07/36] use lnr wrapper instead of looking for --relative
+Date: Wed, 9 Nov 2016 19:32:14 -0800
+Subject: [PATCH 07/19] use lnr wrapper instead of looking for --relative
  option for ln
 
 Upstream-Status: Inappropriate [OE-Specific]
 
 Signed-off-by: Khem Raj <raj.khem@gmail.com>
 ---
- Makefile.am  | 6 +++---
+ Makefile.am  | 2 +-
  configure.ac | 2 --
- 2 files changed, 3 insertions(+), 5 deletions(-)
+ 2 files changed, 1 insertion(+), 3 deletions(-)
 
 diff --git a/Makefile.am b/Makefile.am
-index 629740f..82b6553 100644
+index 29ed1dd..02f4017 100644
 --- a/Makefile.am
 +++ b/Makefile.am
-@@ -243,7 +243,7 @@ define move-to-rootlibdir
- 		$(MKDIR_P) $(DESTDIR)$(rootlibdir) && \
- 		so_img_name=$$(readlink $(DESTDIR)$(libdir)/$$libname) && \
- 		rm -f $(DESTDIR)$(libdir)/$$libname && \
--		$(LN_S) --relative -f $(DESTDIR)$(rootlibdir)/$$so_img_name $(DESTDIR)$(libdir)/$$libname && \
-+		lnr $(DESTDIR)$(rootlibdir)/$$so_img_name $(DESTDIR)$(libdir)/$$libname && \
- 		mv $(DESTDIR)$(libdir)/$$libname.* $(DESTDIR)$(rootlibdir); \
- 	fi
- endef
-@@ -317,7 +317,7 @@ define install-relative-aliases
+@@ -320,7 +320,7 @@ define install-relative-aliases
  	while [ -n "$$1" ]; do \
  		$(MKDIR_P) `dirname $(DESTDIR)$$dir/$$2` && \
  		rm -f $(DESTDIR)$$dir/$$2 && \
@@ -34,20 +25,11 @@ index 629740f..82b6553 100644
  		shift 2 || exit $$?; \
  	done
  endef
-@@ -2781,7 +2781,7 @@ systemd_dbus1_generator_LDADD = \
- dbus1-generator-install-hook:
- 	$(AM_V_at)$(MKDIR_P) $(DESTDIR)$(usergeneratordir)
- 	$(AM_V_RM)rm -f $(DESTDIR)$(usergeneratordir)/systemd-dbus1-generator
--	$(AM_V_LN)$(LN_S) --relative -f $(DESTDIR)$(systemgeneratordir)/systemd-dbus1-generator $(DESTDIR)$(usergeneratordir)/systemd-dbus1-generator
-+	$(AM_V_LN)lnr $(DESTDIR)$(systemgeneratordir)/systemd-dbus1-generator $(DESTDIR)$(usergeneratordir)/systemd-dbus1-generator
- 
- dbus1-generator-uninstall-hook:
- 	rm -f $(DESTDIR)$(usergeneratordir)/systemd-dbus1-generator
 diff --git a/configure.ac b/configure.ac
-index 0239fd0..c5ab9d0 100644
+index 7c4b5a2..b10c952 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -110,8 +110,6 @@ AC_PATH_PROG([SULOGIN], [sulogin], [/usr/sbin/sulogin], [$PATH:/usr/sbin:/sbin])
+@@ -108,8 +108,6 @@ AC_PATH_PROG([SULOGIN], [sulogin], [/usr/sbin/sulogin], [$PATH:/usr/sbin:/sbin])
  AC_PATH_PROG([MOUNT_PATH], [mount], [/usr/bin/mount], [$PATH:/usr/sbin:/sbin])
  AC_PATH_PROG([UMOUNT_PATH], [umount], [/usr/bin/umount], [$PATH:/usr/sbin:/sbin])
  
@@ -57,5 +39,5 @@ index 0239fd0..c5ab9d0 100644
  
  AC_CHECK_FUNCS_ONCE(mkostemp execvpe posix_fallocate)
 -- 
-1.8.3.1
+2.10.2
 
diff --git a/meta/recipes-core/systemd/systemd/0008-nspawn-Use-execvpe-only-when-libc-supports-it.patch b/meta/recipes-core/systemd/systemd/0008-nspawn-Use-execvpe-only-when-libc-supports-it.patch
index 6e6f199..586b5aa 100644
--- a/meta/recipes-core/systemd/systemd/0008-nspawn-Use-execvpe-only-when-libc-supports-it.patch
+++ b/meta/recipes-core/systemd/systemd/0008-nspawn-Use-execvpe-only-when-libc-supports-it.patch
@@ -1,7 +1,7 @@
-From ae999ff50efb9cc82537adef7696c6f732afcfc8 Mon Sep 17 00:00:00 2001
+From 96026a3763264eb41a2c3e374f232f6e543284a8 Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
-Date: Fri, 20 Feb 2015 05:10:37 +0000
-Subject: [PATCH 08/36] nspawn: Use execvpe only when libc supports it
+Date: Wed, 9 Nov 2016 19:33:49 -0800
+Subject: [PATCH 08/19] nspawn: Use execvpe only when libc supports it
 
 Upstream-Status: Denied [no desire for uclibc support]
 
@@ -11,10 +11,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
  1 file changed, 7 insertions(+)
 
 diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
-index 5a68fec..65e65ec 100644
+index 9b9ae90..19b47cd 100644
 --- a/src/nspawn/nspawn.c
 +++ b/src/nspawn/nspawn.c
-@@ -111,6 +111,8 @@ typedef enum LinkJournal {
+@@ -123,6 +123,8 @@ typedef enum LinkJournal {
          LINK_GUEST
  } LinkJournal;
  
@@ -23,7 +23,7 @@ index 5a68fec..65e65ec 100644
  static char *arg_directory = NULL;
  static char *arg_template = NULL;
  static char *arg_chdir = NULL;
-@@ -2637,7 +2639,12 @@ static int inner_child(
+@@ -2871,7 +2873,12 @@ static int inner_child(
                  a[0] = (char*) "/sbin/init";
                  execve(a[0], a, env_use);
          } else if (!strv_isempty(arg_parameters))
@@ -35,7 +35,7 @@ index 5a68fec..65e65ec 100644
 +#endif /* HAVE_EXECVPE */
          else {
                  if (!arg_chdir)
-                         chdir(home ?: "/root");
+                         /* If we cannot change the directory, we'll end up in /, that is expected. */
 -- 
-1.8.3.1
+2.10.2
 
diff --git a/meta/recipes-core/systemd/systemd/0009-util-bypass-unimplemented-_SC_PHYS_PAGES-system-conf.patch b/meta/recipes-core/systemd/systemd/0009-util-bypass-unimplemented-_SC_PHYS_PAGES-system-conf.patch
index 116f3d4..f150bb0 100644
--- a/meta/recipes-core/systemd/systemd/0009-util-bypass-unimplemented-_SC_PHYS_PAGES-system-conf.patch
+++ b/meta/recipes-core/systemd/systemd/0009-util-bypass-unimplemented-_SC_PHYS_PAGES-system-conf.patch
@@ -1,7 +1,7 @@
-From 3498f488b27f90398d7c8d1d06aac5ab684370e8 Mon Sep 17 00:00:00 2001
+From 085c8b6f253726ad547e7be84ff3f2b99701488b Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
-Date: Mon, 14 Dec 2015 00:47:53 +0000
-Subject: [PATCH 09/36] util: bypass unimplemented _SC_PHYS_PAGES system
+Date: Wed, 9 Nov 2016 19:38:07 -0800
+Subject: [PATCH 09/19] util: bypass unimplemented _SC_PHYS_PAGES system
  configuration API on uclibc
 
 Upstream-Status: Inappropriate [uclibc-specific]
@@ -12,12 +12,12 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
  1 file changed, 15 insertions(+)
 
 diff --git a/src/basic/util.c b/src/basic/util.c
-index ea1bed7..fdaf340 100644
+index c1b5ca1..4c62d43 100644
 --- a/src/basic/util.c
 +++ b/src/basic/util.c
-@@ -767,10 +767,25 @@ uint64_t physical_memory(void) {
-         /* We return this as uint64_t in case we are running as 32bit
-          * process on a 64bit kernel with huge amounts of memory */
+@@ -742,6 +742,20 @@ uint64_t physical_memory(void) {
+          * In order to support containers nicely that have a configured memory limit we'll take the minimum of the
+          * physically reported amount of memory and the limit configured for the root cgroup, if there is any. */
  
 +#ifdef __UCLIBC__
 +        char line[128];
@@ -33,14 +33,17 @@ index ea1bed7..fdaf340 100644
 +        fclose(f);
 +        return (uint64_t) mem;
 +#else
-         mem = sysconf(_SC_PHYS_PAGES);
-         assert(mem > 0);
+         sc = sysconf(_SC_PHYS_PAGES);
+         assert(sc > 0);
  
-         return (uint64_t) mem * (uint64_t) page_size();
+@@ -762,6 +776,7 @@ uint64_t physical_memory(void) {
+         lim *= ps;
+ 
+         return MIN(mem, lim);
 +#endif
  }
  
- int update_reboot_param_file(const char *param) {
+ uint64_t physical_memory_scale(uint64_t v, uint64_t max) {
 -- 
-1.8.3.1
+2.10.2
 
diff --git a/meta/recipes-core/systemd/systemd/0010-implment-systemd-sysv-install-for-OE.patch b/meta/recipes-core/systemd/systemd/0010-implment-systemd-sysv-install-for-OE.patch
index 75fa3a5..8828d6e 100644
--- a/meta/recipes-core/systemd/systemd/0010-implment-systemd-sysv-install-for-OE.patch
+++ b/meta/recipes-core/systemd/systemd/0010-implment-systemd-sysv-install-for-OE.patch
@@ -1,7 +1,7 @@
-From 5f94f5ad46c1ded54c3797979d384e4c1eb77bb0 Mon Sep 17 00:00:00 2001
+From 52726be92e2b841f744a96c378cc872ae0033a2b Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Sat, 5 Sep 2015 06:31:47 +0000
-Subject: [PATCH 10/36] implment systemd-sysv-install for OE
+Subject: [PATCH 10/19] implment systemd-sysv-install for OE
 
 Use update-rc.d for enabling/disabling and status command
 to check the status of the sysv service
@@ -39,5 +39,5 @@ index a53a3e6..5d877b0 100755
      *)
          usage ;;
 -- 
-1.8.3.1
+2.10.2
 
diff --git a/meta/recipes-core/systemd/systemd/0011-nss-mymachines-Build-conditionally-when-HAVE_MYHOSTN.patch b/meta/recipes-core/systemd/systemd/0011-nss-mymachines-Build-conditionally-when-HAVE_MYHOSTN.patch
index 34ae645..b01ae97 100644
--- a/meta/recipes-core/systemd/systemd/0011-nss-mymachines-Build-conditionally-when-HAVE_MYHOSTN.patch
+++ b/meta/recipes-core/systemd/systemd/0011-nss-mymachines-Build-conditionally-when-HAVE_MYHOSTN.patch
@@ -1,7 +1,7 @@
-From 2b2450f6b7197bff4637c0283e8784500471d083 Mon Sep 17 00:00:00 2001
+From 3f6f45578b828e414f50c6822375073e7174236a Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Mon, 14 Dec 2015 00:50:01 +0000
-Subject: [PATCH 11/36] nss-mymachines: Build conditionally when
+Subject: [PATCH 11/19] nss-mymachines: Build conditionally when
  HAVE_MYHOSTNAME is set
 
 Fixes build failures when building with --disable-myhostname
@@ -14,10 +14,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
  1 file changed, 2 insertions(+)
 
 diff --git a/Makefile.am b/Makefile.am
-index 82b6553..b3f3343 100644
+index 02f4017..420e0e0 100644
 --- a/Makefile.am
 +++ b/Makefile.am
-@@ -4876,6 +4876,7 @@ SYSTEM_UNIT_ALIASES += \
+@@ -5146,6 +5146,7 @@ SYSTEM_UNIT_ALIASES += \
  BUSNAMES_TARGET_WANTS += \
  	org.freedesktop.machine1.busname
  
@@ -25,7 +25,7 @@ index 82b6553..b3f3343 100644
  libnss_mymachines_la_SOURCES = \
  	src/nss-mymachines/nss-mymachines.sym \
  	src/nss-mymachines/nss-mymachines.c
-@@ -4896,6 +4897,7 @@ lib_LTLIBRARIES += \
+@@ -5167,6 +5168,7 @@ rootlib_LTLIBRARIES += \
  	libnss_mymachines.la
  
  endif
@@ -34,5 +34,5 @@ index 82b6553..b3f3343 100644
  polkitpolicy_in_files += \
  	src/machine/org.freedesktop.machine1.policy.in
 -- 
-1.8.3.1
+2.10.2
 
diff --git a/meta/recipes-core/systemd/systemd/0012-rules-whitelist-hd-devices.patch b/meta/recipes-core/systemd/systemd/0012-rules-whitelist-hd-devices.patch
index 6143088..8666bdc 100644
--- a/meta/recipes-core/systemd/systemd/0012-rules-whitelist-hd-devices.patch
+++ b/meta/recipes-core/systemd/systemd/0012-rules-whitelist-hd-devices.patch
@@ -1,7 +1,7 @@
-From 5ebc0d87565a73710dea602c00b1586d5a1364e5 Mon Sep 17 00:00:00 2001
-From: Patrick Ohly <patrick.ohly@intel.com>
-Date: Wed, 16 Sep 2015 13:55:58 +0200
-Subject: [PATCH 12/36] rules: whitelist hd* devices
+From 8cc1ae11f54dcc38ee2168b0f99703b835dd3942 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 9 Nov 2016 19:41:13 -0800
+Subject: [PATCH 12/19] rules: whitelist hd* devices
 
 qemu by default emulates IDE and the linux-yocto kernel(s) use
 CONFIG_IDE instead of the more modern libsata, so disks appear as
@@ -10,23 +10,24 @@ CONFIG_IDE instead of the more modern libsata, so disks appear as
 Upstream-Status: Denied [https://github.com/systemd/systemd/pull/1276]
 
 Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
 ---
  rules/60-persistent-storage.rules | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/rules/60-persistent-storage.rules b/rules/60-persistent-storage.rules
-index 0b14bb4..1c4d97a 100644
+index c13d05c..b14fbed 100644
 --- a/rules/60-persistent-storage.rules
 +++ b/rules/60-persistent-storage.rules
-@@ -6,7 +6,7 @@
- ACTION=="remove", GOTO="persistent_storage_end"
+@@ -7,7 +7,7 @@ ACTION=="remove", GOTO="persistent_storage_end"
+ ENV{UDEV_DISABLE_PERSISTENT_STORAGE_RULES_FLAG}=="1", GOTO="persistent_storage_end"
  
  SUBSYSTEM!="block", GOTO="persistent_storage_end"
--KERNEL!="loop*|mmcblk*[0-9]|msblk*[0-9]|mspblk*[0-9]|nvme*|sd*|sr*|vd*|xvd*|bcache*|cciss*|dasd*|ubd*", GOTO="persistent_storage_end"
-+KERNEL!="loop*|mmcblk*[0-9]|msblk*[0-9]|mspblk*[0-9]|nvme*|hd*|sd*|sr*|vd*|xvd*|bcache*|cciss*|dasd*|ubd*", GOTO="persistent_storage_end"
+-KERNEL!="loop*|mmcblk*[0-9]|msblk*[0-9]|mspblk*[0-9]|nvme*|sd*|sr*|vd*|xvd*|bcache*|cciss*|dasd*|ubd*|scm*|pmem*", GOTO="persistent_storage_end"
++KERNEL!="loop*|mmcblk*[0-9]|msblk*[0-9]|mspblk*[0-9]|nvme*|hd*|sd*|sr*|vd*|xvd*|bcache*|cciss*|dasd*|ubd*|scm*|pmem*", GOTO="persistent_storage_end"
  
  # ignore partitions that span the entire disk
  TEST=="whole_disk", GOTO="persistent_storage_end"
 -- 
-1.8.3.1
+2.10.2
 
diff --git a/meta/recipes-core/systemd/systemd/0014-Make-root-s-home-directory-configurable.patch b/meta/recipes-core/systemd/systemd/0013-Make-root-s-home-directory-configurable.patch
similarity index 66%
rename from meta/recipes-core/systemd/systemd/0014-Make-root-s-home-directory-configurable.patch
rename to meta/recipes-core/systemd/systemd/0013-Make-root-s-home-directory-configurable.patch
index 2eea0ff..2b33337 100644
--- a/meta/recipes-core/systemd/systemd/0014-Make-root-s-home-directory-configurable.patch
+++ b/meta/recipes-core/systemd/systemd/0013-Make-root-s-home-directory-configurable.patch
@@ -1,4 +1,7 @@
-Subject: [PATCH 14/36] Make root's home directory configurable
+From 79e64a07840e0d97d66e46111f1c086bf83981b7 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 9 Nov 2016 20:35:30 -0800
+Subject: [PATCH 13/19] Make root's home directory configurable
 
 OpenEmbedded has a configurable home directory for root. Allow
 systemd to be built using its idea of what root's home directory
@@ -11,23 +14,20 @@ https://github.com/systemd/systemd/issues/541
 
 Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca>
 Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
 ---
- Makefile.am                       | 2 ++
- configure.ac                      | 7 +++++++
- src/basic/user-util.c             | 4 ++--
- src/core/namespace.c              | 2 +-
- src/nspawn/nspawn.c               | 4 ++--
- units/console-shell.service.m4.in | 4 ++--
- units/emergency.service.in        | 4 ++--
- units/rescue.service.in           | 4 ++--
- 8 files changed, 20 insertions(+), 11 deletions(-)
+ Makefile.am                | 2 ++
+ configure.ac               | 7 +++++++
+ src/basic/user-util.c      | 4 ++--
+ src/nspawn/nspawn.c        | 4 ++--
+ units/emergency.service.in | 4 ++--
+ units/rescue.service.in    | 4 ++--
+ 6 files changed, 17 insertions(+), 8 deletions(-)
 
 diff --git a/Makefile.am b/Makefile.am
-index 305099a..88c1250 100644
+index 420e0e0..3010b01 100644
 --- a/Makefile.am
 +++ b/Makefile.am
-@@ -206,6 +206,7 @@ AM_CPPFLAGS = \
+@@ -213,6 +213,7 @@ AM_CPPFLAGS = \
  	-DLIBDIR=\"$(libdir)\" \
  	-DROOTLIBDIR=\"$(rootlibdir)\" \
  	-DROOTLIBEXECDIR=\"$(rootlibexecdir)\" \
@@ -35,8 +35,8 @@ index 305099a..88c1250 100644
  	-DTEST_DIR=\"$(abs_top_srcdir)/test\" \
  	-I $(top_srcdir)/src \
  	-I $(top_builddir)/src/basic \
-@@ -5863,6 +5864,7 @@ EXTRA_DIST += \
- substitutions = \
+@@ -6057,6 +6058,7 @@ substitutions = \
+        '|rootlibdir=$(rootlibdir)|' \
         '|rootlibexecdir=$(rootlibexecdir)|' \
         '|rootbindir=$(rootbindir)|' \
 +       '|roothomedir=$(roothomedir)|' \
@@ -44,10 +44,10 @@ index 305099a..88c1250 100644
         '|SYSTEMCTL=$(rootbindir)/systemctl|' \
         '|SYSTEMD_NOTIFY=$(rootbindir)/systemd-notify|' \
 diff --git a/configure.ac b/configure.ac
-index 329861a..01764f5 100644
+index b10c952..dfc0bd3 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -1478,6 +1478,11 @@ AC_ARG_WITH([rootlibdir],
+@@ -1513,6 +1513,11 @@ AC_ARG_WITH([rootlibdir],
          [with_rootlibdir=${libdir}])
  AX_NORMALIZE_PATH([with_rootlibdir])
  
@@ -59,7 +59,7 @@ index 329861a..01764f5 100644
  AC_ARG_WITH([pamlibdir],
          AS_HELP_STRING([--with-pamlibdir=DIR], [Directory for PAM modules]),
          [],
-@@ -1562,6 +1567,7 @@ AC_SUBST([pamlibdir], [$with_pamlibdir])
+@@ -1598,6 +1603,7 @@ AC_SUBST([pamlibdir], [$with_pamlibdir])
  AC_SUBST([pamconfdir], [$with_pamconfdir])
  AC_SUBST([rootprefix], [$with_rootprefix])
  AC_SUBST([rootlibdir], [$with_rootlibdir])
@@ -67,7 +67,7 @@ index 329861a..01764f5 100644
  
  AC_CONFIG_FILES([
          Makefile
-@@ -1653,6 +1659,7 @@ AC_MSG_RESULT([
+@@ -1688,6 +1694,7 @@ AC_MSG_RESULT([
          includedir:                        ${includedir}
          lib dir:                           ${libdir}
          rootlib dir:                       ${with_rootlibdir}
@@ -76,10 +76,10 @@ index 329861a..01764f5 100644
          SysV rc?.d directories:            ${SYSTEM_SYSVRCND_PATH}
          Build Python:                      ${PYTHON}
 diff --git a/src/basic/user-util.c b/src/basic/user-util.c
-index f65ca3e..da1101a 100644
+index 938533d..3f9fdc4 100644
 --- a/src/basic/user-util.c
 +++ b/src/basic/user-util.c
-@@ -123,7 +123,7 @@ int get_user_creds(
+@@ -127,7 +127,7 @@ int get_user_creds(
                          *gid = 0;
  
                  if (home)
@@ -88,7 +88,7 @@ index f65ca3e..da1101a 100644
  
                  if (shell)
                          *shell = "/bin/sh";
-@@ -354,7 +354,7 @@ int get_home_dir(char **_h) {
+@@ -387,7 +387,7 @@ int get_home_dir(char **_h) {
          /* Hardcode home directory for root to avoid NSS */
          u = getuid();
          if (u == 0) {
@@ -97,24 +97,11 @@ index f65ca3e..da1101a 100644
                  if (!h)
                          return -ENOMEM;
  
-diff --git a/src/core/namespace.c b/src/core/namespace.c
-index 203d122..45c0d11 100644
---- a/src/core/namespace.c
-+++ b/src/core/namespace.c
-@@ -415,7 +415,7 @@ int setup_namespace(
-                         home_dir = strjoina("-", home_dir);
-                         run_user_dir = prefix_roota(root_directory, "/run/user");
-                         run_user_dir = strjoina("-", run_user_dir);
--                        root_dir = prefix_roota(root_directory, "/root");
-+                        root_dir = prefix_roota(root_directory, ROOTHOMEDIR);
-                         root_dir = strjoina("-", root_dir);
- 
-                         r = append_mounts(&m, STRV_MAKE(home_dir, run_user_dir, root_dir),
 diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
-index 8ec0584..51df00b 100644
+index 19b47cd..e42bf19 100644
 --- a/src/nspawn/nspawn.c
 +++ b/src/nspawn/nspawn.c
-@@ -2739,7 +2739,7 @@ static int inner_child(
+@@ -2798,7 +2798,7 @@ static int inner_child(
          if (envp[n_env])
                  n_env++;
  
@@ -123,7 +110,7 @@ index 8ec0584..51df00b 100644
              (asprintf((char**)(envp + n_env++), "USER=%s", arg_user ? arg_user : "root") < 0) ||
              (asprintf((char**)(envp + n_env++), "LOGNAME=%s", arg_user ? arg_user : "root") < 0))
                  return log_oom();
-@@ -2816,7 +2816,7 @@ static int inner_child(
+@@ -2882,7 +2882,7 @@ static int inner_child(
          else {
                  if (!arg_chdir)
                          /* If we cannot change the directory, we'll end up in /, that is expected. */
@@ -132,23 +119,8 @@ index 8ec0584..51df00b 100644
  
                  execle("/bin/bash", "-bash", NULL, env_use);
                  execle("/bin/sh", "-sh", NULL, env_use);
-diff --git a/units/console-shell.service.m4.in b/units/console-shell.service.m4.in
-index a345ec2..3caae7d 100644
---- a/units/console-shell.service.m4.in
-+++ b/units/console-shell.service.m4.in
-@@ -15,8 +15,8 @@ After=rc-local.service
- Before=getty.target
- 
- [Service]
--Environment=HOME=/root
--WorkingDirectory=-/root
-+Environment=HOME=@roothomedir@
-+WorkingDirectory=-@roothomedir@
- ExecStart=-@SULOGIN@
- ExecStopPost=-@SYSTEMCTL@ poweroff
- Type=idle
 diff --git a/units/emergency.service.in b/units/emergency.service.in
-index 0de16f2..4826062 100644
+index da68eb8..e25f879 100644
 --- a/units/emergency.service.in
 +++ b/units/emergency.service.in
 @@ -15,8 +15,8 @@ Conflicts=syslog.socket
@@ -160,10 +132,10 @@ index 0de16f2..4826062 100644
 +Environment=HOME=@roothomedir@
 +WorkingDirectory=-@roothomedir@
  ExecStartPre=-/bin/plymouth --wait quit
- ExecStartPre=-/bin/echo -e 'Welcome to emergency mode! After logging in, type "journalctl -xb" to view\\nsystem logs, "systemctl reboot" to reboot, "systemctl default" or ^D to\\ntry again to boot into default mode.'
+ ExecStartPre=-/bin/echo -e 'You are in emergency mode. After logging in, type "journalctl -xb" to view\\nsystem logs, "systemctl reboot" to reboot, "systemctl default" or ^D to\\ntry again to boot into default mode.'
  ExecStart=-/bin/sh -c "@SULOGIN@; @SYSTEMCTL@ --job-mode=fail --no-block default"
 diff --git a/units/rescue.service.in b/units/rescue.service.in
-index 92553f6..590ae17 100644
+index 5feff69..a83439e 100644
 --- a/units/rescue.service.in
 +++ b/units/rescue.service.in
 @@ -14,8 +14,8 @@ After=sysinit.target plymouth-start.service
@@ -174,9 +146,9 @@ index 92553f6..590ae17 100644
 -WorkingDirectory=-/root
 +Environment=HOME=@roothomedir@
 +WorkingDirectory=-@roothomedir@
- ExecStartPre=-/bin/plymouth quit
- ExecStartPre=-/bin/echo -e 'Welcome to rescue mode! After logging in, type "journalctl -xb" to view\\nsystem logs, "systemctl reboot" to reboot, "systemctl default" or ^D to\\nboot into default mode.'
+ ExecStartPre=-/bin/plymouth --wait quit
+ ExecStartPre=-/bin/echo -e 'You are in rescue mode. After logging in, type "journalctl -xb" to view\\nsystem logs, "systemctl reboot" to reboot, "systemctl default" or ^D to\\nboot into default mode.'
  ExecStart=-/bin/sh -c "@SULOGIN@; @SYSTEMCTL@ --job-mode=fail --no-block default"
 -- 
-2.8.3
+2.10.2
 
diff --git a/meta/recipes-core/systemd/systemd/0013-sysv-generator-add-support-for-executing-scripts-und.patch b/meta/recipes-core/systemd/systemd/0013-sysv-generator-add-support-for-executing-scripts-und.patch
deleted file mode 100644
index ac67f65..0000000
--- a/meta/recipes-core/systemd/systemd/0013-sysv-generator-add-support-for-executing-scripts-und.patch
+++ /dev/null
@@ -1,133 +0,0 @@
-From 6736de4a3caf9a0b3c888c6cc05103ab1b86907d Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Mon, 14 Dec 2015 05:09:53 +0000
-Subject: [PATCH 13/36] sysv-generator: add support for executing scripts under
- /etc/rcS.d/
-
-To be compatible, all services translated from scripts under /etc/rcS.d would
-run before services translated from scripts under /etc/rcN.d.
-
-Upstream-Status: Inappropriate [OE specific]
-
-Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- src/sysv-generator/sysv-generator.c | 47 ++++++++++++++++++++++++++++---------
- 1 file changed, 36 insertions(+), 11 deletions(-)
-
-diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c
-index b5925a4..ea06d6a 100644
---- a/src/sysv-generator/sysv-generator.c
-+++ b/src/sysv-generator/sysv-generator.c
-@@ -44,7 +44,8 @@
- 
- typedef enum RunlevelType {
-         RUNLEVEL_UP,
--        RUNLEVEL_DOWN
-+        RUNLEVEL_DOWN,
-+        RUNLEVEL_SYSINIT
- } RunlevelType;
- 
- static const struct {
-@@ -59,6 +60,9 @@ static const struct {
-         { "rc4.d",  SPECIAL_MULTI_USER_TARGET, RUNLEVEL_UP },
-         { "rc5.d",  SPECIAL_GRAPHICAL_TARGET,  RUNLEVEL_UP },
- 
-+        /* Debian style rcS.d, also adopted by OE */
-+        { "rcS.d",  SPECIAL_SYSINIT_TARGET,   RUNLEVEL_SYSINIT},
-+
-         /* Standard SysV runlevels for shutdown */
-         { "rc0.d",  SPECIAL_POWEROFF_TARGET,  RUNLEVEL_DOWN },
-         { "rc6.d",  SPECIAL_REBOOT_TARGET,    RUNLEVEL_DOWN }
-@@ -67,7 +71,7 @@ static const struct {
-            directories in this order, and we want to make sure that
-            sysv_start_priority is known when we first load the
-            unit. And that value we only know from S links. Hence
--           UP must be read before DOWN */
-+           UP/SYSINIT must be read before DOWN */
- };
- 
- static const char *arg_dest = "/tmp";
-@@ -86,6 +90,8 @@ typedef struct SysvStub {
-         bool has_lsb;
-         bool reload;
-         bool loaded;
-+        bool default_dependencies;
-+        bool from_rcsd;
- } SysvStub;
- 
- static void free_sysvstub(SysvStub *s) {
-@@ -711,17 +717,31 @@ static int fix_order(SysvStub *s, Hashmap *all_services) {
-                 if (s->has_lsb && other->has_lsb)
-                         continue;
- 
--                if (other->sysv_start_priority < s->sysv_start_priority) {
--                        r = strv_extend(&s->after, other->name);
-+                /* All scripts under /etc/rcS.d should execute before scripts under
-+                 * /etc/rcN.d */
-+                if (!other->from_rcsd && s->from_rcsd) {
-+                        r = strv_extend(&s->before, other->name);
-                         if (r < 0)
-                                 return log_oom();
- 
--                } else if (other->sysv_start_priority > s->sysv_start_priority) {
--                        r = strv_extend(&s->before, other->name);
-+                } else if (other->from_rcsd && !s->from_rcsd) {
-+                        r = strv_extend(&s->after, other->name);
-                         if (r < 0)
-                                 return log_oom();
--                } else
--                        continue;
-+                } else {
-+                        if (other->sysv_start_priority < s->sysv_start_priority) {
-+                                r = strv_extend(&s->after, other->name);
-+                                if (r < 0)
-+                                        return log_oom();
-+                        }
-+                        else if (other->sysv_start_priority > s->sysv_start_priority) {
-+                                r = strv_extend(&s->before, other->name);
-+                                if (r < 0)
-+                                        return log_oom();
-+                        }
-+                        else
-+                                continue;
-+                }
- 
-                 /* FIXME: Maybe we should compare the name here lexicographically? */
-         }
-@@ -788,6 +808,8 @@ static int enumerate_sysv(const LookupPaths *lp, Hashmap *all_services) {
-                                 return log_oom();
- 
-                         service->sysv_start_priority = -1;
-+                        service->default_dependencies = true;
-+                        service->from_rcsd = false;
-                         service->name = name;
-                         service->path = fpath;
-                         name = fpath = NULL;
-@@ -871,9 +893,11 @@ static int set_dependencies_from_rcnd(const LookupPaths *lp, Hashmap *all_servic
- 
-                                 if (de->d_name[0] == 'S')  {
- 
--                                        if (rcnd_table[i].type == RUNLEVEL_UP)
-+                                        if (rcnd_table[i].type == RUNLEVEL_UP || rcnd_table[i].type == RUNLEVEL_SYSINIT) {
-                                                 service->sysv_start_priority = MAX(a*10 + b, service->sysv_start_priority);
--
-+                                                service->default_dependencies = (rcnd_table[i].type == RUNLEVEL_SYSINIT)?false:true;
-+                                                service->from_rcsd = (rcnd_table[i].type == RUNLEVEL_SYSINIT)?true:false;
-+                                        }
-                                         r = set_ensure_allocated(&runlevel_services[i], NULL);
-                                         if (r < 0) {
-                                                 log_oom();
-@@ -887,7 +911,8 @@ static int set_dependencies_from_rcnd(const LookupPaths *lp, Hashmap *all_servic
-                                         }
- 
-                                 } else if (de->d_name[0] == 'K' &&
--                                           (rcnd_table[i].type == RUNLEVEL_DOWN)) {
-+                                           (rcnd_table[i].type == RUNLEVEL_DOWN ||
-+                                            rcnd_table[i].type == RUNLEVEL_SYSINIT)) {
- 
-                                         r = set_ensure_allocated(&shutdown_services, NULL);
-                                         if (r < 0) {
--- 
-1.8.3.1
-
diff --git a/meta/recipes-core/systemd/systemd/0016-Revert-rules-remove-firmware-loading-rules.patch b/meta/recipes-core/systemd/systemd/0014-Revert-rules-remove-firmware-loading-rules.patch
similarity index 84%
rename from meta/recipes-core/systemd/systemd/0016-Revert-rules-remove-firmware-loading-rules.patch
rename to meta/recipes-core/systemd/systemd/0014-Revert-rules-remove-firmware-loading-rules.patch
index 66905b5..ed7c68f 100644
--- a/meta/recipes-core/systemd/systemd/0016-Revert-rules-remove-firmware-loading-rules.patch
+++ b/meta/recipes-core/systemd/systemd/0014-Revert-rules-remove-firmware-loading-rules.patch
@@ -1,7 +1,7 @@
-From 7311ecc745c17d6ed9fd9cf43039648483a87605 Mon Sep 17 00:00:00 2001
+From 0f47cfcb16e8e40a90a9221f9995f8cd8a915c22 Mon Sep 17 00:00:00 2001
 From: Jonathan Liu <net147@gmail.com>
 Date: Thu, 19 Mar 2015 15:01:29 +1100
-Subject: [PATCH 16/36] Revert "rules: remove firmware loading rules"
+Subject: [PATCH 14/19] Revert "rules: remove firmware loading rules"
 
 This reverts commit 70e7d754ddb356fb1a2942b262f8cee9650e2a19.
 Userspace firmware loading support is needed for Linux < 3.7.
@@ -24,5 +24,5 @@ index 0000000..f0ae684
 +
 +SUBSYSTEM=="firmware", ACTION=="add", RUN{builtin}="firmware"
 -- 
-1.8.3.1
+2.10.2
 
diff --git a/meta/recipes-core/systemd/systemd/0017-Revert-udev-remove-userspace-firmware-loading-suppor.patch b/meta/recipes-core/systemd/systemd/0015-Revert-udev-remove-userspace-firmware-loading-suppor.patch
similarity index 89%
rename from meta/recipes-core/systemd/systemd/0017-Revert-udev-remove-userspace-firmware-loading-suppor.patch
rename to meta/recipes-core/systemd/systemd/0015-Revert-udev-remove-userspace-firmware-loading-suppor.patch
index 642625f..f31d211 100644
--- a/meta/recipes-core/systemd/systemd/0017-Revert-udev-remove-userspace-firmware-loading-suppor.patch
+++ b/meta/recipes-core/systemd/systemd/0015-Revert-udev-remove-userspace-firmware-loading-suppor.patch
@@ -1,4 +1,7 @@
-Subject: [PATCH 17/36] Revert "udev: remove userspace firmware loading
+From 4d28d9a7d8d69fb429955d770e53e7a81640da24 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 9 Nov 2016 20:45:23 -0800
+Subject: [PATCH 15/19] Revert "udev: remove userspace firmware loading
  support"
 
 This reverts commit be2ea723b1d023b3d385d3b791ee4607cbfb20ca.
@@ -10,21 +13,21 @@ Signed-off-by: Jonathan Liu <net147@gmail.com>
 Signed-off-by: Khem Raj <raj.khem@gmail.com>
 ---
  Makefile.am                      |  12 +++
- README                           |   4 +-
+ README                           |   6 +-
  TODO                             |   1 +
- configure.ac                     |  22 ++++++
+ configure.ac                     |  18 +++++
  src/udev/udev-builtin-firmware.c | 154 +++++++++++++++++++++++++++++++++++++++
  src/udev/udev-builtin.c          |   3 +
  src/udev/udev.h                  |   6 ++
  src/udev/udevd.c                 |  13 ++++
- 8 files changed, 213 insertions(+), 2 deletions(-)
+ 8 files changed, 210 insertions(+), 3 deletions(-)
  create mode 100644 src/udev/udev-builtin-firmware.c
 
 diff --git a/Makefile.am b/Makefile.am
-index 305099a..e774976 100644
+index 3010b01..229492a 100644
 --- a/Makefile.am
 +++ b/Makefile.am
-@@ -3706,6 +3706,18 @@ libudev_core_la_LIBADD = \
+@@ -3791,6 +3791,18 @@ libudev_core_la_LIBADD = \
  	$(BLKID_LIBS) \
  	$(KMOD_LIBS)
  
@@ -44,10 +47,17 @@ index 305099a..e774976 100644
  libudev_core_la_SOURCES += \
  	src/udev/udev-builtin-kmod.c
 diff --git a/README b/README
-index ca8993c..87f3297 100644
+index 9f5bc93..f60ae11 100644
 --- a/README
 +++ b/README
-@@ -56,8 +56,8 @@ REQUIREMENTS:
+@@ -50,14 +50,14 @@ REQUIREMENTS:
+           CONFIG_PROC_FS
+           CONFIG_FHANDLE (libudev, mount and bind mount handling)
+ 
+-        udev will fail to work with the legacy sysfs layout:
++        Udev will fail to work with the legacy sysfs layout:
+           CONFIG_SYSFS_DEPRECATED=n
+ 
          Legacy hotplug slows down the system and confuses udev:
            CONFIG_UEVENT_HELPER_PATH=""
  
@@ -59,10 +69,10 @@ index ca8993c..87f3297 100644
  
          Some udev rules and virtualization detection relies on it:
 diff --git a/TODO b/TODO
-index fac9ccf..2645582 100644
+index baaac94..1ab1691 100644
 --- a/TODO
 +++ b/TODO
-@@ -642,6 +642,7 @@ Features:
+@@ -658,6 +658,7 @@ Features:
  * initialize the hostname from the fs label of /, if /etc/hostname does not exist?
  
  * udev:
@@ -71,13 +81,13 @@ index fac9ccf..2645582 100644
    - kill scsi_id
    - add trigger --subsystem-match=usb/usb_device device
 diff --git a/configure.ac b/configure.ac
-index 329861a..af85405 100644
+index dfc0bd3..1de0066 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -1361,6 +1361,25 @@ AC_ARG_ENABLE(hwdb, [AC_HELP_STRING([--disable-hwdb], [disable hardware database
+@@ -1394,6 +1394,23 @@ AM_CONDITIONAL(HAVE_MYHOSTNAME, [test "$have_myhostname" = "yes"])
+ AC_ARG_ENABLE(hwdb, [AC_HELP_STRING([--disable-hwdb], [disable hardware database support])],
+        enable_hwdb=$enableval, enable_hwdb=yes)
  AM_CONDITIONAL(ENABLE_HWDB, [test x$enable_hwdb = xyes])
- 
- # ------------------------------------------------------------------------------
 +AC_ARG_WITH(firmware-path,
 +       AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]],
 +          [Firmware search path (default="")]),
@@ -93,19 +103,15 @@ index 329861a..af85405 100644
 +done
 +IFS=$OLD_IFS
 +AC_SUBST(FIRMWARE_PATH)
-+AS_IF([test "x${FIRMWARE_PATH}" != "x"], [ AC_DEFINE(HAVE_FIRMWARE, 1, [Define if FIRMWARE is availabe]) ])
++AS_IF([test "x${FIRMWARE_PATH}" != "x"], [ AC_DEFINE(HAVE_FIRMWARE, 1, [Define if FIRMWARE is available]) ])
 +AM_CONDITIONAL(ENABLE_FIRMWARE, [test "x${FIRMWARE_PATH}" != "x"])
-+
-+# ------------------------------------------------------------------------------
+ 
+ # ------------------------------------------------------------------------------
  have_manpages=no
- AC_ARG_ENABLE(manpages, AS_HELP_STRING([--disable-manpages], [disable manpages]))
- AC_PATH_PROG([XSLTPROC], [xsltproc])
-@@ -1656,6 +1675,9 @@ AC_MSG_RESULT([
+@@ -1698,6 +1715,7 @@ AC_MSG_RESULT([
          SysV init scripts:                 ${SYSTEM_SYSVINIT_PATH}
          SysV rc?.d directories:            ${SYSTEM_SYSVRCND_PATH}
          Build Python:                      ${PYTHON}
-+        Installation Python:               ${PYTHON_BINARY}
-+        sphinx binary:                     ${SPHINX_BUILD}
 +        firmware path:                     ${FIRMWARE_PATH}
          PAM modules dir:                   ${with_pamlibdir}
          PAM configuration dir:             ${with_pamconfdir}
@@ -309,7 +315,7 @@ index 8433e8d..d32366d 100644
  extern const struct udev_builtin udev_builtin_input_id;
  extern const struct udev_builtin udev_builtin_keyboard;
 diff --git a/src/udev/udevd.c b/src/udev/udevd.c
-index e9dd2f4..0abc28e 100644
+index d336ee0..81e5dc5 100644
 --- a/src/udev/udevd.c
 +++ b/src/udev/udevd.c
 @@ -125,6 +125,9 @@ struct event {
@@ -322,7 +328,7 @@ index e9dd2f4..0abc28e 100644
  };
  
  static inline struct event *node_to_event(struct udev_list_node *node) {
-@@ -614,6 +617,10 @@ static int event_queue_insert(Manager *manager, struct udev_device *dev) {
+@@ -613,6 +616,10 @@ static int event_queue_insert(Manager *manager, struct udev_device *dev) {
          event->devnum = udev_device_get_devnum(dev);
          event->is_block = streq("block", udev_device_get_subsystem(dev));
          event->ifindex = udev_device_get_ifindex(dev);
@@ -333,7 +339,7 @@ index e9dd2f4..0abc28e 100644
  
          log_debug("seq %llu queued, '%s' '%s'", udev_device_get_seqnum(dev),
               udev_device_get_action(dev), udev_device_get_subsystem(dev));
-@@ -699,6 +706,12 @@ static bool is_devpath_busy(Manager *manager, struct event *event) {
+@@ -698,6 +705,12 @@ static bool is_devpath_busy(Manager *manager, struct event *event) {
                          return true;
                  }
  
@@ -347,5 +353,5 @@ index e9dd2f4..0abc28e 100644
                  if (event->devpath[common] == '/') {
                          event->delaying_seqnum = loop_event->seqnum;
 -- 
-2.8.3
+2.10.2
 
diff --git a/meta/recipes-core/systemd/systemd/0015-systemd-user-avoid-using-system-auth.patch b/meta/recipes-core/systemd/systemd/0015-systemd-user-avoid-using-system-auth.patch
deleted file mode 100644
index 6e6f344..0000000
--- a/meta/recipes-core/systemd/systemd/0015-systemd-user-avoid-using-system-auth.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-Subject: [PATCH 15/36] systemd-user: avoid using system-auth
-
-In OE, we don't provide system-auth, instead, we use common-* files.
-So modify systemd-user file to use common-* files.
-
-Upstream-Status: Inappropriate [oe specific]
-
-Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
----
- src/login/systemd-user.m4 | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/login/systemd-user.m4 b/src/login/systemd-user.m4
-index f188a8e..862d8d7 100644
---- a/src/login/systemd-user.m4
-+++ b/src/login/systemd-user.m4
-@@ -2,11 +2,11 @@
- #
- # Used by systemd --user instances.
- 
--account  include system-auth
-+account  include common-account
- 
- m4_ifdef(`HAVE_SELINUX',
- session  required pam_selinux.so close
- session  required pam_selinux.so nottys open
- )m4_dnl
- session  required pam_loginuid.so
--session  include system-auth
-+session  include common-session
--- 
-2.8.3
-
diff --git a/meta/recipes-core/systemd/systemd/0018-make-test-dir-configurable.patch b/meta/recipes-core/systemd/systemd/0016-make-test-dir-configurable.patch
similarity index 77%
rename from meta/recipes-core/systemd/systemd/0018-make-test-dir-configurable.patch
rename to meta/recipes-core/systemd/systemd/0016-make-test-dir-configurable.patch
index 5d13e4a..10d1df5 100644
--- a/meta/recipes-core/systemd/systemd/0018-make-test-dir-configurable.patch
+++ b/meta/recipes-core/systemd/systemd/0016-make-test-dir-configurable.patch
@@ -1,4 +1,7 @@
-Subject: [PATCH 18/36] make test dir configurable
+From 218bbc555a37f9373fbb7f03c744eb65109d3470 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 9 Nov 2016 20:47:37 -0800
+Subject: [PATCH 16/19] make test dir configurable
 
 Upstream-Status: Pending
 
@@ -6,17 +9,17 @@ test maybe be run on target in cross-compile environment, and test dir
 is not the compilation dir, so make it configurable
 
 Signed-off-by: Roy Li <rongqing.li@windriver.com>
-
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
 ---
  Makefile.am  | 2 +-
  configure.ac | 7 +++++++
  2 files changed, 8 insertions(+), 1 deletion(-)
 
 diff --git a/Makefile.am b/Makefile.am
-index a94636a..dbd3386 100644
+index 229492a..e997d82 100644
 --- a/Makefile.am
 +++ b/Makefile.am
-@@ -207,7 +207,7 @@ AM_CPPFLAGS = \
+@@ -214,7 +214,7 @@ AM_CPPFLAGS = \
  	-DROOTLIBDIR=\"$(rootlibdir)\" \
  	-DROOTLIBEXECDIR=\"$(rootlibexecdir)\" \
  	-DROOTHOMEDIR=\"$(roothomedir)\" \
@@ -26,10 +29,10 @@ index a94636a..dbd3386 100644
  	-I $(top_builddir)/src/basic \
  	-I $(top_srcdir)/src/basic \
 diff --git a/configure.ac b/configure.ac
-index 45aae8a..c53fae2 100644
+index 1de0066..b12e320 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -1518,6 +1518,11 @@ AC_ARG_WITH([roothomedir],
+@@ -1535,6 +1535,11 @@ AC_ARG_WITH([roothomedir],
          [],
          [with_roothomedir=/root])
  
@@ -41,7 +44,7 @@ index 45aae8a..c53fae2 100644
  AC_ARG_WITH([pamlibdir],
          AS_HELP_STRING([--with-pamlibdir=DIR], [Directory for PAM modules]),
          [],
-@@ -1603,6 +1608,7 @@ AC_SUBST([pamconfdir], [$with_pamconfdir])
+@@ -1621,6 +1626,7 @@ AC_SUBST([pamconfdir], [$with_pamconfdir])
  AC_SUBST([rootprefix], [$with_rootprefix])
  AC_SUBST([rootlibdir], [$with_rootlibdir])
  AC_SUBST([roothomedir], [$with_roothomedir])
@@ -49,7 +52,7 @@ index 45aae8a..c53fae2 100644
  
  AC_CONFIG_FILES([
          Makefile
-@@ -1695,6 +1701,7 @@ AC_MSG_RESULT([
+@@ -1712,6 +1718,7 @@ AC_MSG_RESULT([
          lib dir:                           ${libdir}
          rootlib dir:                       ${with_rootlibdir}
          root home dir:                     ${with_roothomedir}
@@ -58,5 +61,5 @@ index 45aae8a..c53fae2 100644
          SysV rc?.d directories:            ${SYSTEM_SYSVRCND_PATH}
          Build Python:                      ${PYTHON}
 -- 
-2.8.3
+2.10.2
 
diff --git a/meta/recipes-core/systemd/systemd/0019-remove-duplicate-include-uchar.h.patch b/meta/recipes-core/systemd/systemd/0017-remove-duplicate-include-uchar.h.patch
similarity index 81%
rename from meta/recipes-core/systemd/systemd/0019-remove-duplicate-include-uchar.h.patch
rename to meta/recipes-core/systemd/systemd/0017-remove-duplicate-include-uchar.h.patch
index 17592f8..77dbd6e 100644
--- a/meta/recipes-core/systemd/systemd/0019-remove-duplicate-include-uchar.h.patch
+++ b/meta/recipes-core/systemd/systemd/0017-remove-duplicate-include-uchar.h.patch
@@ -1,14 +1,12 @@
-From 3ca534935460647fed66e31aaa90b364e29eab5c Mon Sep 17 00:00:00 2001
+From e78af874fc9f3d3af49498b8207109993d93a596 Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Mon, 22 Feb 2016 05:59:01 +0000
-Subject: [PATCH 1/2] remove duplicate include uchar.h
+Subject: [PATCH 17/19] remove duplicate include uchar.h
 
 missing.h already includes it
 
 Signed-off-by: Khem Raj <raj.khem@gmail.com>
 ---
-Upstream-Status: Pending
-
  src/basic/escape.h | 1 -
  src/basic/utf8.h   | 1 -
  2 files changed, 2 deletions(-)
@@ -26,7 +24,7 @@ index deaa4de..36d437c 100644
  #include "string-util.h"
  #include "missing.h"
 diff --git a/src/basic/utf8.h b/src/basic/utf8.h
-index 12c272d..bea93a6 100644
+index f9b9c94..6ac9a3c 100644
 --- a/src/basic/utf8.h
 +++ b/src/basic/utf8.h
 @@ -22,7 +22,6 @@
@@ -38,5 +36,5 @@ index 12c272d..bea93a6 100644
  #include "macro.h"
  #include "missing.h"
 -- 
-1.8.3.1
+2.10.2
 
diff --git a/meta/recipes-core/systemd/systemd/0020-check-for-uchar.h-in-configure.patch b/meta/recipes-core/systemd/systemd/0018-check-for-uchar.h-in-configure.patch
similarity index 76%
rename from meta/recipes-core/systemd/systemd/0020-check-for-uchar.h-in-configure.patch
rename to meta/recipes-core/systemd/systemd/0018-check-for-uchar.h-in-configure.patch
index a027fad..5824033 100644
--- a/meta/recipes-core/systemd/systemd/0020-check-for-uchar.h-in-configure.patch
+++ b/meta/recipes-core/systemd/systemd/0018-check-for-uchar.h-in-configure.patch
@@ -1,23 +1,21 @@
-From e06eec89a22719c38e257fe07afff18e359114cb Mon Sep 17 00:00:00 2001
+From 7cc0b19d244023c7b3e557765b03b7971e047f29 Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Mon, 22 Feb 2016 06:02:38 +0000
-Subject: [PATCH 2/2] check for uchar.h in configure
+Subject: [PATCH 18/19] check for uchar.h in configure
 
 Use ifdef to include uchar.h
 
 Signed-off-by: Khem Raj <raj.khem@gmail.com>
 ---
-Upstream-Status: Pending
-
  configure.ac        | 1 +
  src/basic/missing.h | 2 ++
  2 files changed, 3 insertions(+)
 
 diff --git a/configure.ac b/configure.ac
-index ecc3e6b..62f934e 100644
+index b12e320..4e6dfdf 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -297,6 +297,7 @@ AM_CONDITIONAL([HAVE_PYTHON], [test "x$have_python" = "xyes"])
+@@ -298,6 +298,7 @@ AM_CONDITIONAL([HAVE_PYTHON], [test "x$have_python" = "xyes"])
  
  # ------------------------------------------------------------------------------
  
@@ -26,10 +24,10 @@ index ecc3e6b..62f934e 100644
  AC_CHECK_HEADERS([linux/btrfs.h], [], [])
  AC_CHECK_HEADERS([linux/memfd.h], [], [])
 diff --git a/src/basic/missing.h b/src/basic/missing.h
-index f704422..a1baa95 100644
+index 4936873..ce79404 100644
 --- a/src/basic/missing.h
 +++ b/src/basic/missing.h
-@@ -34,7 +34,9 @@
+@@ -35,7 +35,9 @@
  #include <stdlib.h>
  #include <sys/resource.h>
  #include <sys/syscall.h>
@@ -40,5 +38,5 @@ index f704422..a1baa95 100644
  
  #ifdef HAVE_AUDIT
 -- 
-1.8.3.1
+2.10.2
 
diff --git a/meta/recipes-core/systemd/systemd/0022-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch b/meta/recipes-core/systemd/systemd/0019-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch
similarity index 69%
rename from meta/recipes-core/systemd/systemd/0022-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch
rename to meta/recipes-core/systemd/systemd/0019-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch
index 96fc3d8..66aa4ca 100644
--- a/meta/recipes-core/systemd/systemd/0022-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch
+++ b/meta/recipes-core/systemd/systemd/0019-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch
@@ -1,23 +1,23 @@
-From 71e710a6c8a3879af7d50c4cb995e0615deba5c3 Mon Sep 17 00:00:00 2001
-From: Emil Renner Berthing <systemd@esmil.dk>
-Date: Sat, 12 Sep 2015 19:56:52 +0000
-Subject: [PATCH 29/38] socket-util: don't fail if libc doesn't support IDN
+From 289554d87e4fd96cae08c0fb449bf41d5641cd24 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 9 Nov 2016 20:49:53 -0800
+Subject: [PATCH 19/19] socket-util: don't fail if libc doesn't support IDN
+
+Upstream-Status: Pending
 
 Signed-off-by: Emil Renner Berthing <systemd@esmil.dk>
 Signed-off-by: Khem Raj <raj.khem@gmail.com>
 ---
-Upstream-Status: Pending
-
  src/basic/socket-util.c | 9 +++++++++
  1 file changed, 9 insertions(+)
 
 diff --git a/src/basic/socket-util.c b/src/basic/socket-util.c
-index 5851268..aefaca5 100644
+index 4ebf106..53b9a12 100644
 --- a/src/basic/socket-util.c
 +++ b/src/basic/socket-util.c
-@@ -44,6 +44,15 @@
- #include "string-util.h"
+@@ -47,6 +47,15 @@
  #include "user-util.h"
+ #include "utf8.h"
  #include "util.h"
 +/* Don't fail if the standard library
 + * doesn't support IDN */
@@ -32,5 +32,5 @@ index 5851268..aefaca5 100644
  int socket_address_parse(SocketAddress *a, const char *s) {
          char *e, *n;
 -- 
-1.8.3.1
+2.10.2
 
diff --git a/meta/recipes-core/systemd/systemd/0021-include-missing.h-for-getting-secure_getenv-definiti.patch b/meta/recipes-core/systemd/systemd/0021-include-missing.h-for-getting-secure_getenv-definiti.patch
deleted file mode 100644
index 5797a29..0000000
--- a/meta/recipes-core/systemd/systemd/0021-include-missing.h-for-getting-secure_getenv-definiti.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From 6cedbaee7964f6a6c61b9f2c8f0b87cef9370424 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Tue, 15 Dec 2015 22:51:55 +0000
-Subject: [PATCH 26/38] include missing.h for getting secure_getenv definition
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-Upstream-Status: Pending
-
- src/basic/user-util.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/basic/user-util.c b/src/basic/user-util.c
-index 55672b3..22c4a23 100644
---- a/src/basic/user-util.c
-+++ b/src/basic/user-util.c
-@@ -38,6 +38,7 @@
- #include "path-util.h"
- #include "string-util.h"
- #include "user-util.h"
-+#include "missing.h"
- 
- bool uid_is_valid(uid_t uid) {
- 
--- 
-1.8.3.1
-
diff --git a/meta/recipes-core/systemd/systemd/CVE-2016-7795.patch b/meta/recipes-core/systemd/systemd/CVE-2016-7795.patch
deleted file mode 100644
index 5ecb9c3..0000000
--- a/meta/recipes-core/systemd/systemd/CVE-2016-7795.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-Subject: Fix CVE-2016-7795
-
-This undoes 531ac2b. I acked that patch without looking at the code
-carefully enough. There are two problems:
-- we want to process the fds anyway
-- in principle empty notification messages are valid, and we should
-  process them as usual, including logging using log_unit_debug().
-
-Upstream-Status: Backport
-CVE: CVE-2016-7795
-
-Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
----
- src/core/manager.c | 11 ++++++-----
- 1 file changed, 6 insertions(+), 5 deletions(-)
-
-diff --git a/src/core/manager.c b/src/core/manager.c
-index 7838f56..f165d08e 100644
---- a/src/core/manager.c
-+++ b/src/core/manager.c
-@@ -1589,13 +1589,12 @@ static int manager_dispatch_cgroups_agent_fd(sd_event_source *source, int fd, ui
-         return 0;
- }
- 
--static void manager_invoke_notify_message(Manager *m, Unit *u, pid_t pid, const char *buf, size_t n, FDSet *fds) {
-+static void manager_invoke_notify_message(Manager *m, Unit *u, pid_t pid, const char *buf, FDSet *fds) {
-         _cleanup_strv_free_ char **tags = NULL;
- 
-         assert(m);
-         assert(u);
-         assert(buf);
--        assert(n > 0);
- 
-         tags = strv_split(buf, "\n\r");
-         if (!tags) {
-@@ -1688,25 +1687,27 @@ static int manager_dispatch_notify_fd(sd_event_source *source, int fd, uint32_t
-                 return 0;
-         }
- 
-+        /* The message should be a string. Here we make sure it's NUL-terminated,
-+         * but only the part until first NUL will be used anyway. */
-         buf[n] = 0;
- 
-         /* Notify every unit that might be interested, but try
-          * to avoid notifying the same one multiple times. */
-         u1 = manager_get_unit_by_pid_cgroup(m, ucred->pid);
-         if (u1) {
--                manager_invoke_notify_message(m, u1, ucred->pid, buf, n, fds);
-+                manager_invoke_notify_message(m, u1, ucred->pid, buf, fds);
-                 found = true;
-         }
- 
-         u2 = hashmap_get(m->watch_pids1, PID_TO_PTR(ucred->pid));
-         if (u2 && u2 != u1) {
--                manager_invoke_notify_message(m, u2, ucred->pid, buf, n, fds);
-+                manager_invoke_notify_message(m, u2, ucred->pid, buf, fds);
-                 found = true;
-         }
- 
-         u3 = hashmap_get(m->watch_pids2, PID_TO_PTR(ucred->pid));
-         if (u3 && u3 != u2 && u3 != u1) {
--                manager_invoke_notify_message(m, u3, ucred->pid, buf, n, fds);
-+                manager_invoke_notify_message(m, u3, ucred->pid, buf, fds);
-                 found = true;
-         }
- 
--- 
-2.8.3
-
diff --git a/meta/recipes-core/systemd/systemd/udev-re-enable-mount-propagation-for-udevd.patch b/meta/recipes-core/systemd/systemd/udev-re-enable-mount-propagation-for-udevd.patch
deleted file mode 100644
index 23e22d4..0000000
--- a/meta/recipes-core/systemd/systemd/udev-re-enable-mount-propagation-for-udevd.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From: Michael Biebl <biebl@debian.org>
-Date: Sat, 27 Sep 2014 04:19:24 +0200
-Subject: udev: re-enable mount propagation for udevd
-
-Upstream-Status: Backport [http://http.debian.net/debian/pool/main/s/systemd/systemd_215-17+deb8u4.debian.tar.xz]
-
-laptop-mode-tools remounts file systems from within a udev rule to apply
-certain mount options. With MountFlags=slave, those mounts then become private
-to the systemd-udevd namespace and are no longer accessible from outside the
-namespace.
-While the root cause is the broken behaviour of laptop-mode-tools, with mount
-propagation turned off, this can result in a read-only root file system.
-Therefore revert the relevant parts from commit
-c2c13f2df42e0691aecabe3979ea81cd7faa35c7 to re-enable mount propagation for
-udevd.
-
-Once affected packages have been fixed, this patch should be dropped
-again.
-
-Closes: #762018
-diff --git a/units/systemd-udevd.service.in b/units/systemd-udevd.service.in
-index e7216d6..1e9a600 100644
---- a/units/systemd-udevd.service.in
-+++ b/units/systemd-udevd.service.in
-@@ -21,6 +21,5 @@ Sockets=systemd-udevd-control.socket systemd-udevd-kernel.socket
- Restart=always
- RestartSec=0
- ExecStart=@rootlibexecdir@/systemd-udevd
--MountFlags=slave
- KillMode=mixed
- WatchdogSec=1min
diff --git a/meta/recipes-core/systemd/systemd_230.bb b/meta/recipes-core/systemd/systemd_232.bb
similarity index 97%
rename from meta/recipes-core/systemd/systemd_230.bb
rename to meta/recipes-core/systemd/systemd_232.bb
index f60dd60..892a109 100644
--- a/meta/recipes-core/systemd/systemd_230.bb
+++ b/meta/recipes-core/systemd/systemd_232.bb
@@ -25,18 +25,13 @@ SRC_URI += " \
            file://0010-implment-systemd-sysv-install-for-OE.patch \
            file://0011-nss-mymachines-Build-conditionally-when-HAVE_MYHOSTN.patch \
            file://0012-rules-whitelist-hd-devices.patch \
-           file://0013-sysv-generator-add-support-for-executing-scripts-und.patch \
-           file://0014-Make-root-s-home-directory-configurable.patch \
-           file://0015-systemd-user-avoid-using-system-auth.patch \
-           file://0016-Revert-rules-remove-firmware-loading-rules.patch \
-           file://0017-Revert-udev-remove-userspace-firmware-loading-suppor.patch \
-           file://0018-make-test-dir-configurable.patch \
-           file://0019-remove-duplicate-include-uchar.h.patch \
-           file://0020-check-for-uchar.h-in-configure.patch \
-           file://0021-include-missing.h-for-getting-secure_getenv-definiti.patch \
-           file://0022-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch \
-           file://udev-re-enable-mount-propagation-for-udevd.patch \
-           file://CVE-2016-7795.patch \
+           file://0013-Make-root-s-home-directory-configurable.patch \
+           file://0014-Revert-rules-remove-firmware-loading-rules.patch \
+           file://0015-Revert-udev-remove-userspace-firmware-loading-suppor.patch \
+           file://0016-make-test-dir-configurable.patch \
+           file://0017-remove-duplicate-include-uchar.h.patch \
+           file://0018-check-for-uchar.h-in-configure.patch \
+           file://0019-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch \
 "
 SRC_URI_append_libc-uclibc = "\
            file://0002-units-Prefer-getty-to-agetty-in-console-setup-system.patch \
@@ -61,7 +56,6 @@ PACKAGECONFIG ??= "xz \
                    timedated \
                    timesyncd \
                    localed \
-                   kdbus \
                    ima \
                    smack \
                    logind \
@@ -96,7 +90,6 @@ PACKAGECONFIG[timedated] = "--enable-timedated,--disable-timedated"
 PACKAGECONFIG[timesyncd] = "--enable-timesyncd,--disable-timesyncd"
 PACKAGECONFIG[localed] = "--enable-localed,--disable-localed"
 PACKAGECONFIG[efi] = "--enable-efi,--disable-efi"
-PACKAGECONFIG[kdbus] = "--enable-kdbus,--disable-kdbus"
 PACKAGECONFIG[ima] = "--enable-ima,--disable-ima"
 PACKAGECONFIG[smack] = "--enable-smack,--disable-smack"
 # libseccomp is found in meta-security
@@ -491,6 +484,7 @@ RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-genera
                       os-release \
 "
 
+INSANE_SKIP_${PN} += "dev-so"
 INSANE_SKIP_${PN}-doc += " libdir"
 
 PACKAGES =+ "udev udev-hwdb"
-- 
2.10.2



^ permalink raw reply related

* [PATCH 0/4] Fix CVEs and qemu run-ptest script
From: kai.kang @ 2016-11-10  7:01 UTC (permalink / raw)
  To: openembedded-core

From: Kai Kang <kai.kang@windriver.com>

The following changes since commit 09278be8c209976da03f63b5a956d212ac171317:

  conf/distro/include/maintainers: move toolchain to Khem Raj (2016-11-09 12:20:48 +0000)

are available in the git repository at:

  git://git.pokylinux.org/poky-contrib kangkai/fixes-20161110
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=kangkai/fixes-20161110

Kai Kang (4):
  openssh: fix CVE-2016-8858
  glibc: fix CVE-2016-6323
  qemu: fix CVE-2016-7909
  qemu: update run-ptest script

 .../openssh/openssh/fix-CVE-2016-8858.patch        | 39 ++++++++++++++++++
 meta/recipes-connectivity/openssh/openssh_7.3p1.bb |  1 +
 ...k-__startcontext-as-.cantunwind-bug-20435.patch | 46 ++++++++++++++++++++++
 meta/recipes-core/glibc/glibc_2.24.bb              |  1 +
 .../qemu/qemu/0004-fix-CVE-2016-7909.patch         | 42 ++++++++++++++++++++
 meta/recipes-devtools/qemu/qemu/run-ptest          |  8 ++--
 meta/recipes-devtools/qemu/qemu_2.7.0.bb           |  1 +
 7 files changed, 135 insertions(+), 3 deletions(-)
 create mode 100644 meta/recipes-connectivity/openssh/openssh/fix-CVE-2016-8858.patch
 create mode 100644 meta/recipes-core/glibc/glibc/0027-arm-mark-__startcontext-as-.cantunwind-bug-20435.patch
 create mode 100644 meta/recipes-devtools/qemu/qemu/0004-fix-CVE-2016-7909.patch

-- 
2.10.1



^ permalink raw reply

* [PATCH 1/4] openssh: fix CVE-2016-8858
From: kai.kang @ 2016-11-10  7:01 UTC (permalink / raw)
  To: openembedded-core
In-Reply-To: <cover.1478760924.git.kai.kang@windriver.com>

From: Kai Kang <kai.kang@windriver.com>

Backport patch to fix CVE-2016-8858 of openssh.

Ref:
https://bugzilla.redhat.com/show_bug.cgi?id=1384860

Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
 .../openssh/openssh/fix-CVE-2016-8858.patch        | 39 ++++++++++++++++++++++
 meta/recipes-connectivity/openssh/openssh_7.3p1.bb |  1 +
 2 files changed, 40 insertions(+)
 create mode 100644 meta/recipes-connectivity/openssh/openssh/fix-CVE-2016-8858.patch

diff --git a/meta/recipes-connectivity/openssh/openssh/fix-CVE-2016-8858.patch b/meta/recipes-connectivity/openssh/openssh/fix-CVE-2016-8858.patch
new file mode 100644
index 0000000..b26ee81
--- /dev/null
+++ b/meta/recipes-connectivity/openssh/openssh/fix-CVE-2016-8858.patch
@@ -0,0 +1,39 @@
+Fix CVE-2016-8858 of openssh
+
+Backport patch from upstream and drop the change of comment which can NOT be applied.
+
+Upstream-Status: Backport [ https://anongit.mindrot.org/openssh.git/commit/?id=ec165c3 ]
+CVE: CVE-2016-8858
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+From ec165c392ca54317dbe3064a8c200de6531e89ad Mon Sep 17 00:00:00 2001
+From: "markus@openbsd.org" <markus@openbsd.org>
+Date: Mon, 10 Oct 2016 19:28:48 +0000
+Subject: [PATCH] upstream commit
+
+Unregister the KEXINIT handler after message has been
+received. Otherwise an unauthenticated peer can repeat the KEXINIT and cause
+allocation of up to 128MB -- until the connection is closed. Reported by
+shilei-c at 360.cn
+
+Upstream-ID: 43649ae12a27ef94290db16d1a98294588b75c05
+---
+ kex.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/kex.c b/kex.c
+index 3f97f8c..6a94bc5 100644
+--- a/kex.c
++++ b/kex.c
+@@ -481,6 +481,7 @@ kex_input_kexinit(int type, u_int32_t seq, void *ctxt)
+ 	if (kex == NULL)
+ 		return SSH_ERR_INVALID_ARGUMENT;
+ 
++	ssh_dispatch_set(ssh, SSH2_MSG_KEXINIT, NULL);
+ 	ptr = sshpkt_ptr(ssh, &dlen);
+ 	if ((r = sshbuf_put(kex->peer, ptr, dlen)) != 0)
+ 		return r;
+-- 
+2.10.1
+
diff --git a/meta/recipes-connectivity/openssh/openssh_7.3p1.bb b/meta/recipes-connectivity/openssh/openssh_7.3p1.bb
index 039b0ff..94eb0ed 100644
--- a/meta/recipes-connectivity/openssh/openssh_7.3p1.bb
+++ b/meta/recipes-connectivity/openssh/openssh_7.3p1.bb
@@ -25,6 +25,7 @@ SRC_URI = "http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar
            file://openssh-7.1p1-conditional-compile-des-in-cipher.patch \
            file://openssh-7.1p1-conditional-compile-des-in-pkcs11.patch \
            file://fix-potential-signed-overflow-in-pointer-arithmatic.patch \
+           file://fix-CVE-2016-8858.patch \
            "
 
 PAM_SRC_URI = "file://sshd"
-- 
2.10.1



^ permalink raw reply related

* [PATCH 2/4] glibc: fix CVE-2016-6323
From: kai.kang @ 2016-11-10  7:01 UTC (permalink / raw)
  To: openembedded-core
In-Reply-To: <cover.1478760924.git.kai.kang@windriver.com>

From: Kai Kang <kai.kang@windriver.com>

Backport patch to fix CVE-2016-6323 of glibc. And remove the section of
file ChangeLog which can't be applied.

Ref:
https://sourceware.org/bugzilla/show_bug.cgi?id=20435

Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
 ...k-__startcontext-as-.cantunwind-bug-20435.patch | 46 ++++++++++++++++++++++
 meta/recipes-core/glibc/glibc_2.24.bb              |  1 +
 2 files changed, 47 insertions(+)
 create mode 100644 meta/recipes-core/glibc/glibc/0027-arm-mark-__startcontext-as-.cantunwind-bug-20435.patch

diff --git a/meta/recipes-core/glibc/glibc/0027-arm-mark-__startcontext-as-.cantunwind-bug-20435.patch b/meta/recipes-core/glibc/glibc/0027-arm-mark-__startcontext-as-.cantunwind-bug-20435.patch
new file mode 100644
index 0000000..95067d3
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0027-arm-mark-__startcontext-as-.cantunwind-bug-20435.patch
@@ -0,0 +1,46 @@
+Backport patch to fix CVE-2016-6323 for glibc. And remove the section of
+ChangeLog which can't be applied.
+
+Upstream-Status: Backport [https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9e2ff6c]
+CVE: CVE-2016-6323
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+From 9e2ff6c9cc54c0b4402b8d49e4abe7000fde7617 Mon Sep 17 00:00:00 2001
+From: Andreas Schwab <schwab@suse.de>
+Date: Mon, 8 Aug 2016 09:29:18 +0200
+Subject: [PATCH] arm: mark __startcontext as .cantunwind (bug 20435)
+
+__startcontext marks the bottom of the call stack of the contexts created
+by makecontext.
+---
+ ChangeLog                                | 6 ++++++
+ sysdeps/unix/sysv/linux/arm/setcontext.S | 7 +++++++
+ 2 files changed, 13 insertions(+)
+
+diff --git a/sysdeps/unix/sysv/linux/arm/setcontext.S b/sysdeps/unix/sysv/linux/arm/setcontext.S
+index 603e508..d1f168f 100644
+--- a/sysdeps/unix/sysv/linux/arm/setcontext.S
++++ b/sysdeps/unix/sysv/linux/arm/setcontext.S
+@@ -86,12 +86,19 @@ weak_alias(__setcontext, setcontext)
+ 
+ 	/* Called when a makecontext() context returns.  Start the
+ 	   context in R4 or fall through to exit().  */
++	/* Unwind descriptors are looked up based on PC - 2, so we have to
++	   make sure to mark the instruction preceding the __startcontext
++	   label as .cantunwind.  */
++	.fnstart
++	.cantunwind
++	nop
+ ENTRY(__startcontext)
+ 	movs    r0, r4
+ 	bne     PLTJMP(__setcontext)
+ 
+ 	@ New context was 0 - exit
+ 	b       PLTJMP(HIDDEN_JUMPTARGET(exit))
++	.fnend
+ END(__startcontext)
+ 
+ #ifdef PIC
+-- 
+2.10.1
+
diff --git a/meta/recipes-core/glibc/glibc_2.24.bb b/meta/recipes-core/glibc/glibc_2.24.bb
index f5a21b2..475c133 100644
--- a/meta/recipes-core/glibc/glibc_2.24.bb
+++ b/meta/recipes-core/glibc/glibc_2.24.bb
@@ -37,6 +37,7 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
            file://0024-eglibc-Forward-port-cross-locale-generation-support.patch \
            file://0025-Define-DUMMY_LOCALE_T-if-not-defined.patch \
            file://0026-build_local_scope.patch \
+           file://0027-arm-mark-__startcontext-as-.cantunwind-bug-20435.patch \
 "
 
 SRC_URI += "\
-- 
2.10.1



^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox