summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-03-14 09:52:18 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-03-15 15:48:00 -0700
commit6dc5aa98ce516ef63cc2f7c6c89d7bb99e5effbe (patch)
tree5b0057cf4582cb097b3e7108a7c00c4654b996dd
parenta85afd33483cf74db8f7803b58504558e017c54b (diff)
downloadpoky-6dc5aa98ce516ef63cc2f7c6c89d7bb99e5effbe.tar.gz
uninative: Add compatiblity version check
If glibc is newer on the host than in uninative, the failure mode is pretty nasty for clusters where the sstate is shared, including the Yocto Project autobuilder. This check aborts the use of uninative in such scenarios where a newer glibc version appears and avoids corruption of sstate caches. We use ldd to check the glibc version since that is included in libc-bin (or equivalent) which locales use so it should always be present. (From OE-Core rev: 676d4d91064d4e4f7abb2bd3597a0ddd5b7e2390) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/uninative.bbclass7
-rw-r--r--meta/conf/distro/include/yocto-uninative.inc2
2 files changed, 9 insertions, 0 deletions
diff --git a/meta/classes/uninative.bbclass b/meta/classes/uninative.bbclass
index 241ca742e6..62a29a139b 100644
--- a/meta/classes/uninative.bbclass
+++ b/meta/classes/uninative.bbclass
@@ -59,6 +59,11 @@ python uninative_event_fetchloader() {
59 if localpath != tarballpath and os.path.exists(localpath) and not os.path.exists(tarballpath): 59 if localpath != tarballpath and os.path.exists(localpath) and not os.path.exists(tarballpath):
60 os.symlink(localpath, tarballpath) 60 os.symlink(localpath, tarballpath)
61 61
62 # ldd output is "ldd (Ubuntu GLIBC 2.23-0ubuntu10) 2.23", extract last option from first line
63 glibcver = subprocess.check_output(["ldd", "--version"]).decode('utf-8').split('\n')[0].split()[-1]
64 if bb.utils.vercmp_string(d.getVar("UNINATIVE_MAXGLIBCVERSION", True), glibcver) < 0:
65 raise RuntimeError("Your host glibc verson (%s) is newer than that in uninative (%s). Disabling uninative so that sstate is not corrupted." % (glibcver, d.getVar("UNINATIVE_MAXGLIBCVERSION", True)))
66
62 cmd = d.expand("mkdir -p ${UNINATIVE_STAGING_DIR}-uninative; cd ${UNINATIVE_STAGING_DIR}-uninative; tar -xjf ${UNINATIVE_DLDIR}/%s/${UNINATIVE_TARBALL}; ${UNINATIVE_STAGING_DIR}-uninative/relocate_sdk.py ${UNINATIVE_STAGING_DIR}-uninative/${BUILD_ARCH}-linux ${UNINATIVE_LOADER} ${UNINATIVE_LOADER} ${UNINATIVE_STAGING_DIR}-uninative/${BUILD_ARCH}-linux/${bindir_native}/patchelf-uninative ${UNINATIVE_STAGING_DIR}-uninative/${BUILD_ARCH}-linux${base_libdir_native}/libc*.so" % chksum) 67 cmd = d.expand("mkdir -p ${UNINATIVE_STAGING_DIR}-uninative; cd ${UNINATIVE_STAGING_DIR}-uninative; tar -xjf ${UNINATIVE_DLDIR}/%s/${UNINATIVE_TARBALL}; ${UNINATIVE_STAGING_DIR}-uninative/relocate_sdk.py ${UNINATIVE_STAGING_DIR}-uninative/${BUILD_ARCH}-linux ${UNINATIVE_LOADER} ${UNINATIVE_LOADER} ${UNINATIVE_STAGING_DIR}-uninative/${BUILD_ARCH}-linux/${bindir_native}/patchelf-uninative ${UNINATIVE_STAGING_DIR}-uninative/${BUILD_ARCH}-linux${base_libdir_native}/libc*.so" % chksum)
63 subprocess.check_call(cmd, shell=True) 68 subprocess.check_call(cmd, shell=True)
64 69
@@ -67,6 +72,8 @@ python uninative_event_fetchloader() {
67 72
68 enable_uninative(d) 73 enable_uninative(d)
69 74
75 except RuntimeError as e:
76 bb.warn(str(e))
70 except bb.fetch2.BBFetchException as exc: 77 except bb.fetch2.BBFetchException as exc:
71 bb.warn("Disabling uninative as unable to fetch uninative tarball: %s" % str(exc)) 78 bb.warn("Disabling uninative as unable to fetch uninative tarball: %s" % str(exc))
72 bb.warn("To build your own uninative loader, please bitbake uninative-tarball and set UNINATIVE_TARBALL appropriately.") 79 bb.warn("To build your own uninative loader, please bitbake uninative-tarball and set UNINATIVE_TARBALL appropriately.")
diff --git a/meta/conf/distro/include/yocto-uninative.inc b/meta/conf/distro/include/yocto-uninative.inc
index b3f8c247f5..cd5fc0bfe5 100644
--- a/meta/conf/distro/include/yocto-uninative.inc
+++ b/meta/conf/distro/include/yocto-uninative.inc
@@ -6,6 +6,8 @@
6# to the distro running on the build machine. 6# to the distro running on the build machine.
7# 7#
8 8
9UNINATIVE_MAXGLIBCVERSION = "2.27"
10
9UNINATIVE_URL ?= "http://downloads.yoctoproject.org/releases/uninative/1.8/" 11UNINATIVE_URL ?= "http://downloads.yoctoproject.org/releases/uninative/1.8/"
10UNINATIVE_CHECKSUM[i686] ?= "427ce522ec97f65c75fd89587d90ef789e8cbca4a617abc4b5822abb01c2d0ae" 12UNINATIVE_CHECKSUM[i686] ?= "427ce522ec97f65c75fd89587d90ef789e8cbca4a617abc4b5822abb01c2d0ae"
11UNINATIVE_CHECKSUM[x86_64] ?= "de4947e98e09e1432d069311cc2093974ecb9138a714fd5466f73524de66a693" 13UNINATIVE_CHECKSUM[x86_64] ?= "de4947e98e09e1432d069311cc2093974ecb9138a714fd5466f73524de66a693"