diff options
author | Patrick Williams <patrick@stwcx.xyz> | 2016-08-17 14:31:25 -0500 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2016-08-22 16:43:26 +0000 |
commit | 60f9d69e016b11c468c98ea75ba0a60c44afbbc4 (patch) | |
tree | ecb49581a9e41a37943c22cd9ef3f63451b20ee7 /import-layers/yocto-poky/meta/recipes-devtools/pseudo | |
parent | e18c61205e0234b03697129c20cc69c9b3940efc (diff) | |
download | talos-openbmc-60f9d69e016b11c468c98ea75ba0a60c44afbbc4.tar.gz talos-openbmc-60f9d69e016b11c468c98ea75ba0a60c44afbbc4.zip |
yocto-poky: Move to import-layers subdir
We are going to import additional layers, so create a subdir to
hold all of the layers that we import with git-subtree.
Change-Id: I6f732153a22be8ca663035c518837e3cc5ec0799
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Diffstat (limited to 'import-layers/yocto-poky/meta/recipes-devtools/pseudo')
9 files changed, 288 insertions, 0 deletions
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/0001-configure-Prune-PIE-flags.patch b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/0001-configure-Prune-PIE-flags.patch new file mode 100644 index 000000000..43504eaab --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/0001-configure-Prune-PIE-flags.patch @@ -0,0 +1,44 @@ +From b5545c08e6c674c49aef14b47a56a3e92df4d2a7 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Wed, 17 Feb 2016 07:36:34 +0000 +Subject: [pseudo][PATCH] configure: Prune PIE flags + +LDFLAGS are not taken from environment and CFLAGS is used for LDFLAGS +however when using security options -fpie and -pie options are coming +as part of ARCH_FLAGS and they get into LDFLAGS of shared objects as +well so we end up with conflicting options -shared -pie, which gold +rejects outright and bfd linker lets the one appearning last in cmdline +take effect. This create quite a unpleasant situation in OE when +security flags are enabled and gold or not-gold options are used +it errors out but errors are not same. + +Anyway, with this patch we filter pie options from ARCH_FLAGS +ouright and take control of generating PIC objects + +Helps with errors like + +| /mnt/oe/build/tmp-glibc/sysroots/x86_64-linux/usr/libexec/x86_64-oe-linux/gcc/x86_64-oe-linux/5.3.0/ld: pseudo_client.o: relocation R_X86_64_PC32 against symbol `pseudo_util_debug_flags' can not be used when making a shared object; recompile with -fPIC +| /mnt/oe/build/tmp-glibc/sysroots/x86_64-linux/usr/libexec/x86_64-oe-linux/gcc/x86_64-oe-linux/5.3.0/ld: final link failed: Bad value +| collect2: error: ld returned 1 exit status +| make: *** [lib/pseudo/lib64/libpseudo.so] Error 1 + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Submitted + + configure | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/configure b/configure +index e5ef9ce..83b0890 100755 +--- a/configure ++++ b/configure +@@ -339,3 +339,5 @@ sed -e ' + s,@ARCH@,'"$opt_arch"',g + s,@BITS@,'"$opt_bits"',g + ' < Makefile.in > Makefile ++ ++sed -i -e 's/\-[f]*pie//g' Makefile +-- +1.8.3.1 + diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/fallback-group b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/fallback-group new file mode 100644 index 000000000..81bf73231 --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/fallback-group @@ -0,0 +1,2 @@ +root:*:0: +mail:*:8: diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/fallback-passwd b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/fallback-passwd new file mode 100644 index 000000000..c1458dc0f --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/fallback-passwd @@ -0,0 +1 @@ +root::0:0:root:/home/root:/bin/sh diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/handle-remove-xattr.patch b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/handle-remove-xattr.patch new file mode 100644 index 000000000..8b7f30c66 --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/handle-remove-xattr.patch @@ -0,0 +1,36 @@ +From a24cf102967a4966bfabe36c3542fb65f35bf539 Mon Sep 17 00:00:00 2001 +From: Peter Seebach <peter.seebach@windriver.com> +Date: Wed, 23 Mar 2016 11:55:25 -0500 +Subject: actually handle remove_xattr correctly + +The path is required but wasn't being extracted from the client's message, +resulting in xattr removal never working. This does not fully address some +deeper problems with the xattr implementation, but at least the common +removal case works. + +Upstream-Status: Backport + +Index: pseudo-1.7.5/ChangeLog.txt +=================================================================== +--- pseudo-1.7.5.orig/ChangeLog.txt ++++ pseudo-1.7.5/ChangeLog.txt +@@ -1,3 +1,7 @@ ++2016-03-22: ++ * (seebs) extract path from message for remove_xattr so it ++ actually works. ++ + 2016-02-09: + * (seebs) 1.7.5 release + +Index: pseudo-1.7.5/pseudo.c +=================================================================== +--- pseudo-1.7.5.orig/pseudo.c ++++ pseudo-1.7.5/pseudo.c +@@ -543,6 +543,7 @@ pseudo_op(pseudo_msg_t *msg, const char + case OP_GET_XATTR: + case OP_LIST_XATTR: + case OP_REPLACE_XATTR: ++ case OP_REMOVE_XATTR: + case OP_SET_XATTR: + /* In a rename there are two paths, null separated in msg->path */ + initial_len = strlen(msg->path); diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/moreretries.patch b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/moreretries.patch new file mode 100644 index 000000000..c1e555236 --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/moreretries.patch @@ -0,0 +1,19 @@ +Increase the number of retries in pseudo due to occasional slow +server shutdowns. + +Upstream-Status: Pending +RP 2016/2/28 + +Index: pseudo-1.7.5/pseudo_client.c +=================================================================== +--- pseudo-1.7.5.orig/pseudo_client.c ++++ pseudo-1.7.5/pseudo_client.c +@@ -1214,7 +1214,7 @@ pseudo_client_setup(void) { + return 1; + } + +-#define PSEUDO_RETRIES 50 ++#define PSEUDO_RETRIES 250 + static pseudo_msg_t * + pseudo_client_request(pseudo_msg_t *msg, size_t len, const char *path) { + pseudo_msg_t *response = 0; diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo.inc b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo.inc new file mode 100644 index 000000000..0de7b3615 --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo.inc @@ -0,0 +1,134 @@ +# Note: Due to the bitbake wrapper script, making changes to pseudo can be +# difficult. To work around the current version of the wrapper use: +# BBFETCH2=True PSEUDO_BUILD=1 ../bitbake/bin/bitbake pseudo-native [-c CMD] + +SUMMARY = "Pseudo gives fake root capabilities to a normal user" +HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/pseudo" +LIC_FILES_CHKSUM = "file://COPYING;md5=243b725d71bb5df4a1e5920b344b86ad" +SECTION = "base" +LICENSE = "LGPL2.1" +DEPENDS = "sqlite3 attr" + +FILES_${PN} = "${prefix}/lib/pseudo/lib*/libpseudo.so ${bindir}/* ${localstatedir}/pseudo ${prefix}/var/pseudo" +INSANE_SKIP_${PN} += "libdir" +INSANE_SKIP_${PN}-dbg += "libdir" + +PROVIDES += "virtual/fakeroot" + +MAKEOPTS = "" + +inherit siteinfo + +do_configure () { + : +} + +NO32LIBS ??= "1" +NO32LIBS_class-nativesdk = "1" + +# Compile for the local machine arch... +do_compile () { + if [ "${SITEINFO_BITS}" = "64" ]; then + ${S}/configure ${PSEUDO_EXTRA_OPTS} --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib${SITEINFO_BITS} --with-sqlite-lib=${baselib} --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --cflags="${CFLAGS}" --bits=${SITEINFO_BITS} --enable-static-sqlite --without-rpath + else + ${S}/configure ${PSEUDO_EXTRA_OPTS} --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib --with-sqlite-lib=${baselib} --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --cflags="${CFLAGS}" --bits=${SITEINFO_BITS} --enable-static-sqlite --without-rpath + fi + oe_runmake ${MAKEOPTS} +} +do_compile[vardepsexclude] = "SITEINFO_BITS" + +maybe_make32() { + # We probably don't need to build 32-bit binaries. + make32=false + if [ "${SITEINFO_BITS}" = "64" ]; then + case "${NO32LIBS}" in + 0) make32=true + ;; + 1) make32=false + ;; + *) # If unset, build 32-bit if we think we can. + if [ -e "/usr/include/gnu/stubs-32.h" ]; then + make32=true + fi + ;; + esac + fi + if $make32; then + if ! [ -e "/usr/include/gnu/stubs-32.h" ]; then + warn_32bit_missing + else + bbnote "Attempting to build 32-bit libpseudo.so for ${PN}." + fi + else + bbnote "Building/installing only 64-bit libpseudo.so for ${PN}." + bbnote "If you need to run 32-bit executables, ensure that NO32LIBS is set to 0." + fi +} +maybe_make32[vardepsexclude] = "SITEINFO_BITS" + +warn_32bit_missing() { + bbwarn "Can't find stubs-32.h, but usually need it to build 32-bit libpseudo." + bbwarn "If the build fails, install 32-bit developer packages." + bbwarn "If you are using 32-bit binaries, the 32-bit libpseudo is NOT optional." +} + +# Two below are the same +# If necessary compile for the alternative machine arch. This is only +# necessary in a native build. +do_compile_prepend_class-native () { + maybe_make32 + if $make32; then + # We need the 32-bit libpseudo on a 64-bit machine... + # Note that this is not well-tested outside of x86/x86_64. + + # if we're being rebuilt due to a dependency change, we need to make sure + # everything is clean before we configure and build -- if we haven't previously + # built this will fail and be ignored. + make ${MAKEOPTS} distclean || : + + ./configure ${PSEUDO_EXTRA_OPTS} --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib --with-sqlite-lib=${baselib} --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --bits=32 --without-rpath + save_traps=$(trap) + trap 'warn_32bit_missing' 0 + oe_runmake ${MAKEOPTS} libpseudo + eval "$save_traps" + # prevent it from removing the lib, but remove everything else + make 'LIB=foo' ${MAKEOPTS} distclean + fi +} + +do_compile_prepend_class-nativesdk () { + maybe_make32 + if $make32; then + # We need the 32-bit libpseudo on a 64-bit machine. + # Note that this is not well-tested outside of x86/x86_64. + ./configure ${PSEUDO_EXTRA_OPTS} --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib --with-sqlite-lib=${baselib} --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --bits=32 --without-rpath + oe_runmake ${MAKEOPTS} libpseudo + # prevent it from removing the lib, but remove everything else + make 'LIB=foo' ${MAKEOPTS} distclean + fi +} + +do_install () { + oe_runmake 'DESTDIR=${D}' ${MAKEOPTS} 'LIB=lib/pseudo/lib$(MARK64)' install +} + +# Two below are the same +# If necessary install for the alternative machine arch. This is only +# necessary in a native build. +do_install_append_class-native () { + maybe_make32 + if $make32; then + mkdir -p ${D}${prefix}/lib/pseudo/lib + cp lib/pseudo/lib/libpseudo.so ${D}${prefix}/lib/pseudo/lib/. + fi +} + +do_install_append_class-nativesdk () { + maybe_make32 + if $make32; then + mkdir -p ${D}${prefix}/lib/pseudo/lib + cp lib/pseudo/lib/libpseudo.so ${D}${prefix}/lib/pseudo/lib/. + fi +} + +BBCLASSEXTEND = "native nativesdk" diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_1.6.7.bb b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_1.6.7.bb new file mode 100644 index 000000000..b8c20ad65 --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_1.6.7.bb @@ -0,0 +1,19 @@ +require pseudo.inc + +SRC_URI = " \ + http://downloads.yoctoproject.org/releases/pseudo/${BPN}-${PV}.tar.bz2 \ + file://fallback-passwd \ + file://fallback-group \ +" + +SRC_URI[md5sum] = "4cd39502f9bd0e734dee80e08b28a5f1" +SRC_URI[sha256sum] = "9f2caca5f1579a376a509cd81a81156fc208650add9f0af275da9e911f18f291" + +PSEUDO_EXTRA_OPTS ?= "--enable-force-async --without-passwd-fallback" + +do_install_append_class-native () { + install -d ${D}${sysconfdir} + # The fallback files should never be modified + install -m 444 ${WORKDIR}/fallback-passwd ${D}${sysconfdir}/passwd + install -m 444 ${WORKDIR}/fallback-group ${D}${sysconfdir}/group +} diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_1.7.5.bb b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_1.7.5.bb new file mode 100644 index 000000000..d90e64445 --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_1.7.5.bb @@ -0,0 +1,22 @@ +require pseudo.inc + +SRC_URI = " \ + http://downloads.yoctoproject.org/releases/pseudo/${BPN}-${PV}.tar.bz2 \ + file://0001-configure-Prune-PIE-flags.patch \ + file://fallback-passwd \ + file://fallback-group \ + file://moreretries.patch \ + file://handle-remove-xattr.patch \ +" + +SRC_URI[md5sum] = "c10209938f03128d0c193f041ff3596d" +SRC_URI[sha256sum] = "fd89cadec984d3b8202aca465898b1bb4350e0d63ba9aa9ac899f6f50270e688" + +PSEUDO_EXTRA_OPTS ?= "--enable-force-async --without-passwd-fallback" + +do_install_append_class-native () { + install -d ${D}${sysconfdir} + # The fallback files should never be modified + install -m 444 ${WORKDIR}/fallback-passwd ${D}${sysconfdir}/passwd + install -m 444 ${WORKDIR}/fallback-group ${D}${sysconfdir}/group +} diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_git.bb new file mode 100644 index 000000000..abff1cfd3 --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_git.bb @@ -0,0 +1,11 @@ +require pseudo.inc + +SRCREV = "786c6d3813622d18e12d36c4aa722af6a417c8fa" +PV = "1.7.5+git${SRCPV}" + +DEFAULT_PREFERENCE = "-1" + +SRC_URI = "git://git.yoctoproject.org/pseudo" + +S = "${WORKDIR}/git" + |