[OE-core] [PATCH] git: fix CVE-2020-5260
From: Lee Chee Yang Signed-off-by: Lee Chee Yang --- .../recipes-devtools/git/files/CVE-2020-5260.patch | 63 ++ meta/recipes-devtools/git/git.inc | 4 +- 2 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-devtools/git/files/CVE-2020-5260.patch diff --git a/meta/recipes-devtools/git/files/CVE-2020-5260.patch b/meta/recipes-devtools/git/files/CVE-2020-5260.patch new file mode 100644 index 000..9b09ef6 --- /dev/null +++ b/meta/recipes-devtools/git/files/CVE-2020-5260.patch @@ -0,0 +1,63 @@ +From 9a6bbee8006c24b46a85d29e7b38cfa79e9ab21b Mon Sep 17 00:00:00 2001 +From: Jeff King +Date: Wed, 11 Mar 2020 17:53:41 -0400 +Subject: [PATCH] credential: avoid writing values with newlines + +The credential protocol that we use to speak to helpers can't represent +values with newlines in them. This was an intentional design choice to +keep the protocol simple, since none of the values we pass should +generally have newlines. + +However, if we _do_ encounter a newline in a value, we blindly transmit +it in credential_write(). Such values may break the protocol syntax, or +worse, inject new valid lines into the protocol stream. + +The most likely way for a newline to end up in a credential struct is by +decoding a URL with a percent-encoded newline. However, since the bug +occurs at the moment we write the value to the protocol, we'll catch it +there. That should leave no possibility of accidentally missing a code +path that can trigger the problem. + +At this level of the code we have little choice but to die(). However, +since we'd not ever expect to see this case outside of a malicious URL, +that's an acceptable outcome. + +Reported-by: Felix Wilhelm + +Upstream-Status: Backport +[https://github.com/git/git/commit/9a6bbee8006c24b46a85d29e7b38cfa79e9ab21b] +CVE: CVE-2020-5260 +Signed-off-by: Chee Yang Lee +--- + credential.c | 2 ++ + t/t0300-credentials.sh | 6 ++ + 2 files changed, 8 insertions(+) + +diff --git a/credential.c b/credential.c +index 9747f47b18bf2..00ee4d62db121 100644 +--- a/credential.c b/credential.c +@@ -194,6 +194,8 @@ static void credential_write_item(FILE *fp, const char *key, const char *value) + { + if (!value) + return; ++ if (strchr(value, '\n')) ++ die("credential value for %s contains newline", key); + fprintf(fp, "%s=%s\n", key, value); + } + +diff --git a/t/t0300-credentials.sh b/t/t0300-credentials.sh +index 03bd31e9f22a1..15cc3c5abb5b1 100755 +--- a/t/t0300-credentials.sh b/t/t0300-credentials.sh +@@ -309,4 +309,10 @@ test_expect_success 'empty helper spec resets helper list' ' + EOF + ' + ++test_expect_success 'url parser rejects embedded newlines' ' ++ test_must_fail git credential fill <<-\EOF ++ url=https://one.example.com?%0ahost=two.example.com/ ++ EOF ++' ++ + test_done diff --git a/meta/recipes-devtools/git/git.inc b/meta/recipes-devtools/git/git.inc index 4131c98..cd0bd1a 100644 --- a/meta/recipes-devtools/git/git.inc +++ b/meta/recipes-devtools/git/git.inc @@ -7,7 +7,9 @@ DEPENDS = "openssl curl zlib expat" PROVIDES_append_class-native = " git-replacement-native" SRC_URI = "${KERNELORG_MIRROR}/software/scm/git/git-${PV}.tar.gz;name=tarball \ - ${KERNELORG_MIRROR}/software/scm/git/git-manpages-${PV}.tar.gz;name=manpages" + ${KERNELORG_MIRROR}/software/scm/git/git-manpages-${PV}.tar.gz;name=manpages \ + file://CVE-2020-5260.patch \ +" S = "${WORKDIR}/git-${PV}" -- 2.7.4 -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#137255): https://lists.openembedded.org/g/openembedded-core/message/137255 Mute This Topic: https://lists.openembedded.org/mt/73049876/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[OE-core] [PATCH 3/3] binutils: Install PIC version of libiberty.a
some architectures e.g. mips complain in linking apps which have shared libs that are linking with libiberty.a fixes errors like below libiberty/../../libiberty/hashtab.c:285:(.text+0xf8): relocation R_MIPS_26 against `htab_create_typed_alloc' cannot be used when making a shared object; recompile with -fPIC Signed-off-by: Khem Raj --- meta/recipes-devtools/binutils/binutils.inc | 5 + 1 file changed, 5 insertions(+) diff --git a/meta/recipes-devtools/binutils/binutils.inc b/meta/recipes-devtools/binutils/binutils.inc index 4119960c63..e93cd50b20 100644 --- a/meta/recipes-devtools/binutils/binutils.inc +++ b/meta/recipes-devtools/binutils/binutils.inc @@ -152,6 +152,11 @@ do_install () { install -m 644 ${S}/include/ansidecl.h ${D}${includedir} install -m 644 ${S}/include/libiberty.h ${D}${includedir} + # insall pic version of libiberty if available +if [ -e ${B}/libiberty/pic/libiberty.a ]; then + install -Dm 0644 ${B}/libiberty/pic/libiberty.a ${D}${libdir}/libiberty.a + fi + cd ${D}${bindir} # Symlinks for ease of running these on the native target -- 2.26.1 -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#137254): https://lists.openembedded.org/g/openembedded-core/message/137254 Mute This Topic: https://lists.openembedded.org/mt/73045312/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[OE-core] [PATCH 1/3] gcc: Configure all gccs with --disable-install-libiberty
OE uses libiberty from binutils, since its properly compiled as pic archive and applications and other libraries needing libiberty can properly link with it. With this option applied, explicit delete of libiberty headers and libraries is not required in install step, since they wont get installed in first place. Signed-off-by: Khem Raj --- meta/recipes-devtools/gcc/gcc-configure-common.inc | 1 + meta/recipes-devtools/gcc/gcc-cross-canadian.inc | 6 -- meta/recipes-devtools/gcc/gcc-cross.inc| 4 meta/recipes-devtools/gcc/gcc-target.inc | 4 4 files changed, 1 insertion(+), 14 deletions(-) diff --git a/meta/recipes-devtools/gcc/gcc-configure-common.inc b/meta/recipes-devtools/gcc/gcc-configure-common.inc index bb4f6923f2..a64c4caf00 100644 --- a/meta/recipes-devtools/gcc/gcc-configure-common.inc +++ b/meta/recipes-devtools/gcc/gcc-configure-common.inc @@ -33,6 +33,7 @@ EXTRA_OECONF = "\ --enable-libstdcxx-pch \ --program-prefix=${TARGET_PREFIX} \ --without-local-prefix \ +--disable-install-libiberty \ ${EXTRA_OECONF_BASE} \ ${EXTRA_OECONF_GCC_FLOAT} \ ${EXTRA_OECONF_PATHS} \ diff --git a/meta/recipes-devtools/gcc/gcc-cross-canadian.inc b/meta/recipes-devtools/gcc/gcc-cross-canadian.inc index 4aac345bec..553ef7fe62 100644 --- a/meta/recipes-devtools/gcc/gcc-cross-canadian.inc +++ b/meta/recipes-devtools/gcc/gcc-cross-canadian.inc @@ -108,12 +108,6 @@ do_install () { # We don't care about the gcc- copies rm -f ${D}${bindir}/*gcc-?.?* - # We use libiberty from binutils - rm -f ${D}${prefix}/${TARGET_SYS}/lib/libiberty.a - # Not sure where the strange paths come from - rm -f ${D}${libdir}/../lib/libiberty.a - rm -f ${D}${libdir}/libiberty.a - # Cleanup empty directories which are not shipped # we use rmdir instead of 'rm -f' to ensure the non empty directories are not deleted # ${D}${libdir}/../lib only seems to appear with SDKMACHINE=i686 diff --git a/meta/recipes-devtools/gcc/gcc-cross.inc b/meta/recipes-devtools/gcc/gcc-cross.inc index c68cdd5dc4..6fa8c274cd 100644 --- a/meta/recipes-devtools/gcc/gcc-cross.inc +++ b/meta/recipes-devtools/gcc/gcc-cross.inc @@ -117,10 +117,6 @@ do_install () { cp ${S}/libquadmath/quadmath.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/ cp ${S}/libquadmath/quadmath_weak.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/ - # We use libiberty from binutils - find ${D}${exec_prefix}/lib -name libiberty.a | xargs rm -f - find ${D}${exec_prefix}/lib -name libiberty.h | xargs rm -f - find ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include-fixed -type f -not -name "README" -not -name limits.h -not -name syslimits.h | xargs rm -f } diff --git a/meta/recipes-devtools/gcc/gcc-target.inc b/meta/recipes-devtools/gcc/gcc-target.inc index 34c1b2263b..8cb432780f 100644 --- a/meta/recipes-devtools/gcc/gcc-target.inc +++ b/meta/recipes-devtools/gcc/gcc-target.inc @@ -192,10 +192,6 @@ do_install () { # We don't care about the gcc- ones for this rm -f *gcc-?.?* - # We use libiberty from binutils - find ${D}${libdir} -name libiberty.a | xargs rm -f - find ${D}${libdir} -name libiberty.h | xargs rm -f - # Not sure why we end up with these but we don't want them... rm -f ${TARGET_PREFIX}${TARGET_PREFIX}* -- 2.26.1 -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#137252): https://lists.openembedded.org/g/openembedded-core/message/137252 Mute This Topic: https://lists.openembedded.org/mt/73045310/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[OE-core] [PATCH 2/3] binutils: Detect proper static-libstdc++ support when using clang
Fixes configure time tests to ensure static-libstdc++ is enabled when using clang Signed-off-by: Khem Raj --- .../binutils/binutils-2.34.inc| 1 + ...or-clang-before-checking-gcc-version.patch | 48 +++ 2 files changed, 49 insertions(+) create mode 100644 meta/recipes-devtools/binutils/binutils/0016-Check-for-clang-before-checking-gcc-version.patch diff --git a/meta/recipes-devtools/binutils/binutils-2.34.inc b/meta/recipes-devtools/binutils/binutils-2.34.inc index 4b085b6fe0..66a3850ef2 100644 --- a/meta/recipes-devtools/binutils/binutils-2.34.inc +++ b/meta/recipes-devtools/binutils/binutils-2.34.inc @@ -40,6 +40,7 @@ SRC_URI = "\ file://0013-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch \ file://0014-Detect-64-bit-MIPS-targets.patch \ file://0015-sync-with-OE-libtool-changes.patch \ + file://0016-Check-for-clang-before-checking-gcc-version.patch \ file://CVE-2020-0551.patch \ " S = "${WORKDIR}/git" diff --git a/meta/recipes-devtools/binutils/binutils/0016-Check-for-clang-before-checking-gcc-version.patch b/meta/recipes-devtools/binutils/binutils/0016-Check-for-clang-before-checking-gcc-version.patch new file mode 100644 index 00..c694b42dc3 --- /dev/null +++ b/meta/recipes-devtools/binutils/binutils/0016-Check-for-clang-before-checking-gcc-version.patch @@ -0,0 +1,48 @@ +From 67590a44c1256491fa674426f0170d5d05377d05 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 15 Apr 2020 14:17:20 -0700 +Subject: [PATCH 16/16] Check for clang before checking gcc version + +Clang advertises itself to be gcc 4.2.1, so when compiling this test +here fails since gcc < 4.4.5 did not support -static-libstdc++ but thats +not true for clang, so its better to make an additional check for clang +before resorting to gcc version check. This should let clang enable +static libstdc++ linking + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +--- + configure| 2 +- + configure.ac | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/configure b/configure +index 590b03c2da0..46f116fdb54 100755 +--- a/configure b/configure +@@ -5140,7 +5140,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + +-#if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) ++#if !defined(__clang__) && ((__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)) + #error -static-libstdc++ not implemented + #endif + int main() {} +diff --git a/configure.ac b/configure.ac +index d3f85e6f5d5..c0eb1343121 100644 +--- a/configure.ac b/configure.ac +@@ -1309,7 +1309,7 @@ if test "$GCC" = yes; then + AC_MSG_CHECKING([whether g++ accepts -static-libstdc++ -static-libgcc]) + AC_LANG_PUSH(C++) + AC_LINK_IFELSE([AC_LANG_SOURCE([ +-#if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) ++#if !defined(__clang__) && ((__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)) + #error -static-libstdc++ not implemented + #endif + int main() {}])], +-- +2.26.1 + -- 2.26.1 -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#137253): https://lists.openembedded.org/g/openembedded-core/message/137253 Mute This Topic: https://lists.openembedded.org/mt/73045311/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[OE-core] [PATCH] meson.bbclass: avoid unexpected operating-system names
For example 'linux-gnueabi' is not what meson consumers expect: See canonical table of OS names for Meson (thanks Ross). Surprisingly this did not pop up earlier but wrong system-name can break building as described in [1] [1] https://lists.openembedded.org/g/openembedded-core/topic/meson_host_machine_system/73023862 Signed-off-by: Andreas Müller --- meta/classes/meson.bbclass | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meta/classes/meson.bbclass b/meta/classes/meson.bbclass index 06034e8b47..167263f76c 100644 --- a/meta/classes/meson.bbclass +++ b/meta/classes/meson.bbclass @@ -68,6 +68,9 @@ def meson_operating_system(var, d): os = d.getVar(var) if "mingw" in os: return "windows" +# avoid e.g 'linux-gnueabi' +elif "linux" in os: +return "linux" else: return os -- 2.21.1 -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#137251): https://lists.openembedded.org/g/openembedded-core/message/137251 Mute This Topic: https://lists.openembedded.org/mt/73044279/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[oe-core][PATCH 1/1] vim: do not adjust script paths building for target
When cross-compiling, do not change scripts to use host versions of perl and gawk. Also, use INSANE_SKIP to suppress QA complaints if perl or gawk are not on the target. Signed-off-by: Joe Slater --- .../recipes-support/vim/files/no-path-adjust.patch | 27 ++ meta/recipes-support/vim/vim.inc | 12 +- 2 files changed, 33 insertions(+), 6 deletions(-) create mode 100644 meta/recipes-support/vim/files/no-path-adjust.patch diff --git a/meta/recipes-support/vim/files/no-path-adjust.patch b/meta/recipes-support/vim/files/no-path-adjust.patch new file mode 100644 index 000..05c2d80 --- /dev/null +++ b/meta/recipes-support/vim/files/no-path-adjust.patch @@ -0,0 +1,27 @@ +vim: do not adjust script pathnames + +When cross-compiling, we do not want to reference the host versions of +things like perl and awk. + +Upstream-Status: Pending + +Signed-off-by: Joe Slater + +--- a/src/Makefile b/src/Makefile +@@ -2507,11 +2507,14 @@ installtools: $(TOOLS) $(DESTDIR)$(exec_ +rm -rf $$cvs; \ + fi + -chmod $(FILEMOD) $(DEST_TOOLS)/* +-# replace the path in some tools ++ ++# replace the path in some tools, but not when cross-compiling ++ifneq ($(CROSS_COMPILING),1) + perlpath=`./which.sh perl` && sed -e "s+/usr/bin/perl+$$perlpath+" $(TOOLSSOURCE)/efm_perl.pl >$(DEST_TOOLS)/efm_perl.pl + awkpath=`./which.sh nawk` && sed -e "s+/usr/bin/nawk+$$awkpath+" $(TOOLSSOURCE)/mve.awk >$(DEST_TOOLS)/mve.awk; if test -z "$$awkpath"; then \ + awkpath=`./which.sh gawk` && sed -e "s+/usr/bin/nawk+$$awkpath+" $(TOOLSSOURCE)/mve.awk >$(DEST_TOOLS)/mve.awk; if test -z "$$awkpath"; then \ + awkpath=`./which.sh awk` && sed -e "s+/usr/bin/nawk+$$awkpath+" $(TOOLSSOURCE)/mve.awk >$(DEST_TOOLS)/mve.awk; fi; fi ++endif + -chmod $(SCRIPTMOD) `grep -l "^#!" $(DEST_TOOLS)/*` + + # install the language specific files for tools, if they were unpacked diff --git a/meta/recipes-support/vim/vim.inc b/meta/recipes-support/vim/vim.inc index 78e3f95..9f3dc08 100644 --- a/meta/recipes-support/vim/vim.inc +++ b/meta/recipes-support/vim/vim.inc @@ -11,6 +11,7 @@ SRC_URI = "git://github.com/vim/vim.git \ file://disable_acl_header_check.patch \ file://vim-add-knob-whether-elf.h-are-checked.patch \ file://0001-src-Makefile-improve-reproducibility.patch \ + file://no-path-adjust.patch \ " SRCREV = "98056533b96b6b5d8849641de93185dd7bcadc44" @@ -82,12 +83,6 @@ EXTRA_OECONF = " \ do_install() { autotools_do_install -# Work around file-rdeps picking up csh, awk, perl or python as a dep -chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/vim132 -chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/mve.awk -chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/*.pl -chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/*.py - # Install example vimrc from runtime files install -m 0644 runtime/vimrc_example.vim ${D}/${datadir}/${BPN}/vimrc @@ -110,7 +105,12 @@ FILES_${PN}-help = "${datadir}/${BPN}/${VIMDIR}/doc" FILES_${PN}-tutor = "${datadir}/${BPN}/${VIMDIR}/tutor ${bindir}/${BPN}tutor" FILES_${PN}-vimrc = "${datadir}/${BPN}/vimrc" FILES_${PN}-data = "${datadir}/${BPN}" + +# We do not want to complain if perl or gawk are not on the target. +# FILES_${PN}-tools = "${datadir}/${BPN}/${VIMDIR}/tools" +INSANE_SKIP_${PN}-tools = "file-rdeps" + FILES_${PN}-common = " \ ${datadir}/${BPN}/${VIMDIR}/*.vim \ ${datadir}/${BPN}/${VIMDIR}/autoload \ -- 2.7.4 -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#137250): https://lists.openembedded.org/g/openembedded-core/message/137250 Mute This Topic: https://lists.openembedded.org/mt/73043020/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [OE-core][PATCH v2] insane.bbclass: Add test for shebang line length
On Tue, Apr 14, 2020 at 03:20:20PM -0300, Domarys Correa wrote: > Shebang lines longer than 128 characters can give an error > depending on the operating system. > This implements a test that signals an error when locating a > faulty shebang. > > YOCTO: #11053 > > Signed-off-by: Domarys Correa > --- What are the changes from v1? Please mention briefly here to help with reviews. > meta/classes/insane.bbclass | 25 - > 1 file changed, 24 insertions(+), 1 deletion(-) > > diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass > index 9605ac2bae..bcb1464c91 100644 > --- a/meta/classes/insane.bbclass > +++ b/meta/classes/insane.bbclass > @@ -34,7 +34,7 @@ ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch > pkgconfig la \ > split-strip packages-list pkgv-undefined var-undefined \ > version-going-backwards expanded-d invalid-chars \ > license-checksum dev-elf file-rdeps configure-unsafe \ > -configure-gettext perllocalpod \ > +configure-gettext perllocalpod shebang-size \ > " > # Add usrmerge QA check based on distro feature > ERROR_QA_append = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', ' > usrmerge', '', d)}" > @@ -82,6 +82,29 @@ def package_qa_add_message(messages, section, new_msg): > else: > messages[section] = messages[section] + "\n" + new_msg > > +QAPATHTEST[shebang-size] = "package_qa_check_shebang_size" > +def package_qa_check_shebang_size(path, name, d, elf, messages): > +if os.path.islink(path) or elf: > +return > + > +try: > +with open(path, 'rb') as f: > +stanza = f.readline(130) > +except IOError: > +return > + > +if stanza.startswith(b'#!'): > +#Shebang not found > +try: > +stanza = stanza.decode("utf-8") > +except UnicodeDecodeError: > +#If it is not a text file, it is not a script > +return > + > +if len(stanza) > 129: > +package_qa_add_message(messages, "shebang-size", "%s: %s maximum > shebang size exceeded, the maximum size is 128." % (name, > package_qa_clean_path(path, d))) > +return > + > QAPATHTEST[libexec] = "package_qa_check_libexec" > def package_qa_check_libexec(path,name, d, elf, messages): > > -- > 2.17.1 > > -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#137249): https://lists.openembedded.org/g/openembedded-core/message/137249 Mute This Topic: https://lists.openembedded.org/mt/73016515/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [OE-core] [PATCH 1/2] quilt: do not test patch-wrapper as it is not enabled
Richard didn't want to merge the patch, as the intermittent nature of the failure means there may be a deeper issue that will not be solved by disabling the test that exposes it. Sadly I have not been able to reproduce this at all, so if you have better ideas or a good understanding of what the test is doing, you are welcome to help. Alex On Wed, 15 Apr 2020 at 20:35, Mingde (Matthew) Zeng < matthew.z...@windriver.com> wrote: > > Can we get an update regarding the status of this patch? It is to fix > https://bugzilla.yoctoproject.org/show_bug.cgi?id=13841 which the target > milestone is set to 3.1 M4. > > Thanks, > Matthew > > Alexander Kanavin writes: > > > Upstream only enables the test if --with-patch-wrapper > > was supplied to ./configure, and so should we. > > > > Signed-off-by: Alexander Kanavin > > --- > > meta/recipes-devtools/quilt/quilt.inc | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/meta/recipes-devtools/quilt/quilt.inc > b/meta/recipes-devtools/quilt/quilt.inc > > index d6d06c049c..d2db079e0b 100644 > > --- a/meta/recipes-devtools/quilt/quilt.inc > > +++ b/meta/recipes-devtools/quilt/quilt.inc > > @@ -71,6 +71,9 @@ do_install_ptest() { > > tar -c --exclude=mail.test --exclude=delete.test test/ | ( cd > ${D}${PTEST_PATH} && tar -xf - && chmod 777 test) > > cp ${WORKDIR}/Makefile ${D}${PTEST_PATH} > > cp ${WORKDIR}/test.sh ${D}${PTEST_PATH} > > + > > + # This is specifically excluded when --with-patch-wrapper is > absent during ./configure > > + rm ${D}${PTEST_PATH}/test/patch-wrapper.test > > } > > > > PACKAGES += "guards guards-doc" > > > -- > Mingde (Matthew) Zeng > -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#137248): https://lists.openembedded.org/g/openembedded-core/message/137248 Mute This Topic: https://lists.openembedded.org/mt/72528131/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[OE-core] [PATCH v2] runqemu: add QB_ROOTFS_EXTRA_OPT parameter
Content of the optional parameter will be appended to the rootfs-device in the qemu configuration, in case QB_ROOTFS_OPT is not specified. By default this is empty. Example use cases are: Defining 'readonly' when using squashfs, so multiple instances of qemu can share the same base image, something that cannot be done by just specifying 'snapshot'. Defining 'bootindex=0' which helps to get past the EFI shell in ovmf-binary. This also enables the use case of running WIC images with EFI bootloader through the testimage.bbclass. Signed-off-by: Konrad Weihmann --- meta/classes/qemuboot.bbclass | 5 + scripts/runqemu | 11 --- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/meta/classes/qemuboot.bbclass b/meta/classes/qemuboot.bbclass index 68f7a03619..3162e7a8eb 100644 --- a/meta/classes/qemuboot.bbclass +++ b/meta/classes/qemuboot.bbclass @@ -65,6 +65,10 @@ # " -device virtio-serial-device -chardev socket,id=virtcon,port=@PORT@,host=127.0.0.1 -device virtconsole,chardev=virtcon" # Note, runqemu will replace "@PORT@" with the port number which is used. # +# QB_ROOTFS_EXTRA_OPT: extra options to be appended to the rootfs device in case there is none specified by QB_ROOTFS_OPT. +# Can be used to automatically determine the image from the other variables +# but define things link 'bootindex' when booting from EFI or 'readonly' when using squashfs +# without the need to specify a dedicated qemu configuration # Usage: # IMAGE_CLASSES += "qemuboot" # See "runqemu help" for more info @@ -77,6 +81,7 @@ QB_OPT_APPEND ?= "-show-cursor" QB_NETWORK_DEVICE ?= "-device virtio-net-pci,netdev=net0,mac=@MAC@" QB_CMDLINE_IP_SLIRP ?= "ip=dhcp" QB_CMDLINE_IP_TAP ?= "ip=192.168.7.@CLIENT@::192.168.7.@GATEWAY@:255.255.255.0" +QB_ROOTFS_EXTRA_OPT ?= "" # This should be kept align with ROOT_VM QB_DRIVE_TYPE ?= "/dev/sd" diff --git a/scripts/runqemu b/scripts/runqemu index 6a77e3db9a..310d79fdc5 100755 --- a/scripts/runqemu +++ b/scripts/runqemu @@ -1196,6 +1196,10 @@ class BaseConfig(object): else: self.rootfs_options = '-drive file=%s,if=virtio,format=%s' % (self.rootfs, rootfs_format) +qb_rootfs_extra_opt = self.get("QB_ROOTFS_EXTRA_OPT") +if qb_rootfs_extra_opt and not qb_rootfs_extra_opt.startswith(","): +qb_rootfs_extra_opt = "," + qb_rootfs_extra_opt + if self.fstype in ('cpio.gz', 'cpio'): self.kernel_cmdline = 'root=/dev/ram0 rw debugshell' self.rootfs_options = '-initrd %s' % self.rootfs @@ -1208,14 +1212,15 @@ class BaseConfig(object): drive_type = self.get('QB_DRIVE_TYPE') if drive_type.startswith("/dev/sd"): logger.info('Using scsi drive') -vm_drive = '-drive if=none,id=hd,file=%s,format=%s -device virtio-scsi-pci,id=scsi -device scsi-hd,drive=hd' \ - % (self.rootfs, rootfs_format) +vm_drive = '-drive if=none,id=hd,file=%s,format=%s -device virtio-scsi-pci,id=scsi -device scsi-hd,drive=hd%s' \ + % (self.rootfs, rootfs_format, qb_rootfs_extra_opt) elif drive_type.startswith("/dev/hd"): logger.info('Using ide drive') vm_drive = "-drive file=%s,format=%s" % (self.rootfs, rootfs_format) elif drive_type.startswith("/dev/vdb"): logger.info('Using block virtio drive'); -vm_drive = '-drive id=disk0,file=%s,if=none,format=%s -device virtio-blk-device,drive=disk0' % (self.rootfs, rootfs_format) +vm_drive = '-drive id=disk0,file=%s,if=none,format=%s -device virtio-blk-device,drive=disk0%s' \ +% (self.rootfs, rootfs_format,qb_rootfs_extra_opt) else: # virtio might have been selected explicitly (just use it), or # is used as fallback (then warn about that). -- 2.20.1 -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#137247): https://lists.openembedded.org/g/openembedded-core/message/137247 Mute This Topic: https://lists.openembedded.org/mt/73039089/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [OE-core] [PATCH 1/2] quilt: do not test patch-wrapper as it is not enabled
Can we get an update regarding the status of this patch? It is to fix https://bugzilla.yoctoproject.org/show_bug.cgi?id=13841 which the target milestone is set to 3.1 M4. Thanks, Matthew Alexander Kanavin writes: > Upstream only enables the test if --with-patch-wrapper > was supplied to ./configure, and so should we. > > Signed-off-by: Alexander Kanavin > --- > meta/recipes-devtools/quilt/quilt.inc | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/meta/recipes-devtools/quilt/quilt.inc > b/meta/recipes-devtools/quilt/quilt.inc > index d6d06c049c..d2db079e0b 100644 > --- a/meta/recipes-devtools/quilt/quilt.inc > +++ b/meta/recipes-devtools/quilt/quilt.inc > @@ -71,6 +71,9 @@ do_install_ptest() { > tar -c --exclude=mail.test --exclude=delete.test test/ | ( cd > ${D}${PTEST_PATH} && tar -xf - && chmod 777 test) > cp ${WORKDIR}/Makefile ${D}${PTEST_PATH} > cp ${WORKDIR}/test.sh ${D}${PTEST_PATH} > + > + # This is specifically excluded when --with-patch-wrapper is absent > during ./configure > + rm ${D}${PTEST_PATH}/test/patch-wrapper.test > } > > PACKAGES += "guards guards-doc" -- Mingde (Matthew) Zeng -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#137246): https://lists.openembedded.org/g/openembedded-core/message/137246 Mute This Topic: https://lists.openembedded.org/mt/72528131/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[OE-core] [master,dunfell][PATCH] packagegroup-go-sdk-target: Enable on rv64
RISCV64 now supports golang (starting dunfell), therefore limit disabling to rv32 only. Signed-off-by: Khem Raj --- meta/recipes-core/packagegroups/packagegroup-go-sdk-target.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/recipes-core/packagegroups/packagegroup-go-sdk-target.bb b/meta/recipes-core/packagegroups/packagegroup-go-sdk-target.bb index 5afb490aac..86c71900ec 100644 --- a/meta/recipes-core/packagegroups/packagegroup-go-sdk-target.bb +++ b/meta/recipes-core/packagegroups/packagegroup-go-sdk-target.bb @@ -8,4 +8,4 @@ RDEPENDS_${PN} = " \ go-runtime-staticdev \ " -COMPATIBLE_HOST = "^(?!riscv64).*" +COMPATIBLE_HOST = "^(?!riscv32).*" -- 2.26.1 -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#137245): https://lists.openembedded.org/g/openembedded-core/message/137245 Mute This Topic: https://lists.openembedded.org/mt/73036503/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [OE-core] Meson host_machine.system() incorrect on ARM?
On Wed, Apr 15, 2020 at 4:20 PM Ross Burton wrote: > > On Wed, 15 Apr 2020 at 01:47, Andreas M?ller wrote: > > Am testing it currently but what do experts think of > > > > diff --git a/meta/classes/meson.bbclass b/meta/classes/meson.bbclass > > index 06034e8b47..167263f76c 100644 > > --- a/meta/classes/meson.bbclass > > +++ b/meta/classes/meson.bbclass > > @@ -68,6 +68,9 @@ def meson_operating_system(var, d): > > os = d.getVar(var) > > if "mingw" in os: > > return "windows" > > +# avoid e.g 'linux-gnueabi' > > +elif "linux" in os: > > +return "linux" > > else: > > return os > > Looks right. The canonical table of OS names for Meson is here: > > https://mesonbuild.com/Reference-tables.html#operating-system-names ^ Thanks - was looking for that exactly that. Will send out a patch soon > There's an argument to be made for validating the OS name is in that > list before returning it from meson_operating_system. ^ I read this several times - but am not sure if understand it correctly: Do you mean it is not correct/expected that meson accepts an incorrect name? Andreas > > Ross -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#137244): https://lists.openembedded.org/g/openembedded-core/message/137244 Mute This Topic: https://lists.openembedded.org/mt/73023862/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[OE-core] [PATCH v2] tzdata: remove exit 0 from pkg_postinst
Documentation says that if you exit 0 in a pkg_postinst it will marked as installed. If you exit 0, before running postinst-intercepts defer_to_first_boot, the pkg_postinst_ontarget script will not be present on target. The "exit 0" in tzdata makes it difficult to have a bbappend with a pkg_postinst_target step when you have `INSTALL_TIMEZONE_FILE = 0` Signed-off-by: Maxime Roussin-Bélanger --- v2: split patch series in different mailing list meta/recipes-extended/timezone/tzdata.bb | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/meta/recipes-extended/timezone/tzdata.bb b/meta/recipes-extended/timezone/tzdata.bb index 1e2d9bd1b9..1e2b440fb0 100644 --- a/meta/recipes-extended/timezone/tzdata.bb +++ b/meta/recipes-extended/timezone/tzdata.bb @@ -60,12 +60,8 @@ pkg_postinst_${PN} () { if [ -e ${src} ] ; then tz=$(sed -e 's:#.*::' -e 's:[[:space:]]*::g' -e '/^$/d' "${src}") fi - - if [ -z "${tz}" ] ; then - exit 0 - fi - - if [ ! -e "$D${datadir}/zoneinfo/${tz}" ] ; then + + if [ ! -z "${tz}" -a ! -e "$D${datadir}/zoneinfo/${tz}" ] ; then echo "You have an invalid TIMEZONE setting in ${src}" echo "Your ${etc_lt} has been reset to Universal; enjoy!" tz="Universal" -- 2.20.1 -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#137243): https://lists.openembedded.org/g/openembedded-core/message/137243 Mute This Topic: https://lists.openembedded.org/mt/73035881/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[OE-core] ✗ patchtest: failure for "dev-manual: remove postinst fa..." and 1 more
== Series Details == Series: "dev-manual: remove postinst fa..." and 1 more Revision: 1 URL : https://patchwork.openembedded.org/series/23753/ State : failure == Summary == Thank you for submitting this patch series to OpenEmbedded Core. This is an automated response. Several tests have been executed on the proposed series by patchtest resulting in the following failures: * Issue Series sent to the wrong mailing list or some patches from the series correspond to different mailing lists [test_target_mailing_list] Suggested fixSend the series again to the correct mailing list (ML) Suggested ML yo...@yoctoproject.org [http://git.yoctoproject.org/cgit/cgit.cgi/yocto-docs/] Patch's path:documentation/dev-manual/dev-manual-common-tasks.xml * Issue Series does not apply on top of target branch [test_series_merge_on_head] Suggested fixRebase your series on top of targeted branch Targeted branch master (currently at 1795f30d8a) If you believe any of these test results are incorrect, please reply to the mailing list (openembedded-core@lists.openembedded.org) raising your concerns. Otherwise we would appreciate you correcting the issues and submitting a new version of the patchset if applicable. Please ensure you add/increment the version number when sending the new version (i.e. [PATCH] -> [PATCH v2] -> [PATCH v3] -> ...). --- Guidelines: https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest Test suite: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#137242): https://lists.openembedded.org/g/openembedded-core/message/137242 Mute This Topic: https://lists.openembedded.org/mt/73035389/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[OE-core] [PATCH 2/2] tzdata: remove exit 0 from pkg_postinst
Documentation says that if you exit 0 in a pkg_postinst it will marked as installed. If you exit 0, before running postinst-intercepts defer_to_first_boot, the pkg_postinst_ontarget script will not be present on target. The "exit 0" in tzdata makes it difficult to have a bbappend with a pkg_postinst_target step when you have `INSTALL_TIMEZONE_FILE = 0` Signed-off-by: Maxime Roussin-Bélanger --- meta/recipes-extended/timezone/tzdata.bb | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/meta/recipes-extended/timezone/tzdata.bb b/meta/recipes-extended/timezone/tzdata.bb index 1e2d9bd1b9..1e2b440fb0 100644 --- a/meta/recipes-extended/timezone/tzdata.bb +++ b/meta/recipes-extended/timezone/tzdata.bb @@ -60,12 +60,8 @@ pkg_postinst_${PN} () { if [ -e ${src} ] ; then tz=$(sed -e 's:#.*::' -e 's:[[:space:]]*::g' -e '/^$/d' "${src}") fi - - if [ -z "${tz}" ] ; then - exit 0 - fi - - if [ ! -e "$D${datadir}/zoneinfo/${tz}" ] ; then + + if [ ! -z "${tz}" -a ! -e "$D${datadir}/zoneinfo/${tz}" ] ; then echo "You have an invalid TIMEZONE setting in ${src}" echo "Your ${etc_lt} has been reset to Universal; enjoy!" tz="Universal" -- 2.20.1 -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#137241): https://lists.openembedded.org/g/openembedded-core/message/137241 Mute This Topic: https://lists.openembedded.org/mt/73035224/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[OE-core] [PATCH 1/2] dev-manual: remove postinst false statement
This outdated section contradicts the real behavior expressed in the next paragraph Signed-off-by: Maxime Roussin-Bélanger --- documentation/dev-manual/dev-manual-common-tasks.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/documentation/dev-manual/dev-manual-common-tasks.xml b/documentation/dev-manual/dev-manual-common-tasks.xml index 8bb8612e0f..997e4777b0 100644 --- a/documentation/dev-manual/dev-manual-common-tasks.xml +++ b/documentation/dev-manual/dev-manual-common-tasks.xml @@ -3284,8 +3284,6 @@ The script defined in the post-installation function is called when the root filesystem is created. If the script succeeds, the package is marked as installed. -If the script fails, the package is marked as unpacked and -the script is executed when the image boots again. Any RPM post-installation script that runs on the target should return a 0 exit code. -- 2.20.1 -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#137240): https://lists.openembedded.org/g/openembedded-core/message/137240 Mute This Topic: https://lists.openembedded.org/mt/73035222/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [OE-core] Meson host_machine.system() incorrect on ARM?
On Wed, 15 Apr 2020 at 01:47, Andreas M?ller wrote: > Am testing it currently but what do experts think of > > diff --git a/meta/classes/meson.bbclass b/meta/classes/meson.bbclass > index 06034e8b47..167263f76c 100644 > --- a/meta/classes/meson.bbclass > +++ b/meta/classes/meson.bbclass > @@ -68,6 +68,9 @@ def meson_operating_system(var, d): > os = d.getVar(var) > if "mingw" in os: > return "windows" > +# avoid e.g 'linux-gnueabi' > +elif "linux" in os: > +return "linux" > else: > return os Looks right. The canonical table of OS names for Meson is here: https://mesonbuild.com/Reference-tables.html#operating-system-names There's an argument to be made for validating the OS name is in that list before returning it from meson_operating_system. Ross -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#137239): https://lists.openembedded.org/g/openembedded-core/message/137239 Mute This Topic: https://lists.openembedded.org/mt/73023862/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [OE-core] [PATCH 2/2] runqemu: add ROOTFS_EXTRA_OPT parameter
On Tue, 14 Apr 2020 21:19:15 +0200 "Konrad Weihmann" wrote: > Content of the optional parameter will be appended to the rootfs-device > in the qemu configuration, in case QB_ROOTFS_OPT is not specified. > By default this is empty. > > Example use cases are: > > Defining 'readonly' when using squashfs, so multiple instances of qemu > can share the same base image, something that cannot be done by just > specifying 'snapshot'. > > Defining 'bootindex=0' which helps to get past the EFI shell in > ovmf-binary. This also enables the use case of running WIC images with > EFI bootloader through the testimage.bbclass. > > Signed-off-by: Konrad Weihmann > --- > meta/classes/qemuboot.bbclass | 5 + > scripts/runqemu | 11 --- > 2 files changed, 13 insertions(+), 3 deletions(-) > > diff --git a/meta/classes/qemuboot.bbclass b/meta/classes/qemuboot.bbclass > index 68f7a03619..3162e7a8eb 100644 > --- a/meta/classes/qemuboot.bbclass > +++ b/meta/classes/qemuboot.bbclass > @@ -65,6 +65,10 @@ > # " -device virtio-serial-device -chardev > socket,id=virtcon,port=@PORT@,host=127.0.0.1 -device > virtconsole,chardev=virtcon" > # Note, runqemu will replace "@PORT@" with the port number > which is used. > # > +# QB_ROOTFS_EXTRA_OPT: extra options to be appended to the rootfs device in > case there is none specified by QB_ROOTFS_OPT. > +# Can be used to automatically determine the image from > the other variables > +# but define things link 'bootindex' when booting from > EFI or 'readonly' when using squashfs > +# without the need to specify a dedicated qemu > configuration The summary line of the commit should use the full variable name `QB_ROOTFS_EXTRA_OPT`. Thanks, -- Paul Barker Konsulko Group -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#137238): https://lists.openembedded.org/g/openembedded-core/message/137238 Mute This Topic: https://lists.openembedded.org/mt/73017853/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [OE-core][PATCH v2 2/2] image.bbclass: deploy image artifacts in stages
śr., 15 kwi 2020 o 12:32 Richard Purdie napisał(a): > > > > > > > > Gentle ping. > > Gentle reminder that we're in the middle of sorting out a release. This > will not merge until after the release and I don't have the cycles for > review of this kind of change right now. > Got it, I'll get back to you after the release then. > FWIW I still don't like the way this integrates into sstate and I want > to spend some time trying to find a better way. I don't have any > constructive suggestion as to what that would look like so I haven't > replied, I simply don't know and that isn't a useful answer to you. > Sure, thanks. Despite my best efforts I couldn't figure out any solution without touching sstate. > You've also ignored my request to follow the coding style used in the > rest of the class code :(. > Indeed, although "forgot" would describe it better. :) Bart -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#137237): https://lists.openembedded.org/g/openembedded-core/message/137237 Mute This Topic: https://lists.openembedded.org/mt/72816245/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [OE-core][PATCH v2 2/2] image.bbclass: deploy image artifacts in stages
On Wed, 2020-04-15 at 12:20 +0200, Bartosz Golaszewski wrote: > pon., 6 kwi 2020 o 19:02 Bartosz Golaszewski napisał(a): > > From: Bartosz Golaszewski > > > > Make each IMAGE_CMD task an sstate task with its own IMGDEPLOYDIR > > override. This way each generated set of artifacts is deployed as soon > > as it's ready instead of the do_image_complete task handling the entire > > deployement. This allows us to better fine-tune dependencies e.g. we > > can make do_image_wic depend on fitImage task which can in turn depend > > on do_image_ext4. > > > > We need delete the IMGDEPLOYDIR variable from the data object passed > > to each image task so that it gets expanded with the correct override. > > > > In order to make sure that tasks added to SSTATETASKS in anonymous python > > functions are correctly setup, move the code that assigns pre- and > > postfuncs to an event handler invoked on bb.event.RecipeTaskPreProcess > > in sstate.bbclass. This event is fired right after the anonymous > > functions. > > > > Signed-off-by: Bartosz Golaszewski > > --- > > meta/classes/image.bbclass | 17 + > > meta/classes/sstate.bbclass | 4 > > 2 files changed, 21 insertions(+) > > > > diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass > > index 07aa1f1fa5..ffd63aa82a 100644 > > --- a/meta/classes/image.bbclass > > +++ b/meta/classes/image.bbclass > > @@ -428,10 +428,12 @@ python () { > > # date/time values. It will get expanded at execution time. > > # Similarly TMPDIR since otherwise we see QA stamp comparision > > problems > > # Expand PV else it can trigger get_srcrev which can fail due to > > these variables being unset > > +# Delete IMGDEPLOYDIR so that each task gets its own, overriden > > value > > localdata.setVar('PV', d.getVar('PV')) > > localdata.delVar('DATETIME') > > localdata.delVar('DATE') > > localdata.delVar('TMPDIR') > > +localdata.delVar('IMGDEPLOYDIR') > > vardepsexclude = (d.getVarFlag('IMAGE_CMD_' + realt, > > 'vardepsexclude', True) or '').split() > > for dep in vardepsexclude: > > localdata.delVar(dep) > > @@ -502,6 +504,21 @@ python () { > > > > bb.debug(2, "Adding task %s before %s, after %s" % (task, > > 'do_image_complete', after)) > > bb.build.addtask(task, 'do_image_complete', after, d) > > + > > +imgdeploydir = d.getVar('IMGDEPLOYDIR') > > +task_override = task[3:].replace('_', '-') # 'do_image_ext4' > > becomes 'image-ext4' > > +taskdeploydir = > > '{}/deploy-{}-{}'.format(os.path.dirname(imgdeploydir), > > + d.getVar('PN'), > > task_override) > > + > > +# Each image task gets its own IMGDEPLOYDIR directory and is added > > to > > +# SSTATETASKS. This way every set of artifacts gets deployed right > > after > > +# the do_image_foo task completes. > > +d.setVar('IMGDEPLOYDIR_task-{}'.format(task_override), > > taskdeploydir) > > +d.appendVar('SSTATETASKS', ' {}'.format(task)) > > +d.setVarFlag(task, 'sstate-inputdirs', taskdeploydir) > > +d.setVarFlag(task, 'sstate-outputdirs', > > d.getVar('DEPLOY_DIR_IMAGE')) > > +d.setVarFlag(task, 'cleandirs', taskdeploydir) > > +d.setVar('SSTATE_SKIP_CREATION_task-{}'.format(task_override), '1') > > } > > > > # > > diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass > > index c73c3b42a7..3c71312010 100644 > > --- a/meta/classes/sstate.bbclass > > +++ b/meta/classes/sstate.bbclass > > @@ -138,13 +138,17 @@ python () { > > d.setVar('SSTATE_EXTRAPATH', "${NATIVELSBSTRING}/") > > d.setVar('BB_HASHFILENAME', "True ${SSTATE_PKGSPEC} > > ${SSTATE_SWSPEC}") > > d.setVar('SSTATE_EXTRAPATHWILDCARD', "${NATIVELSBSTRING}/") > > +} > > > > +python sstate_setup_tasks() { > > unique_tasks = sorted(set((d.getVar('SSTATETASKS') or "").split())) > > d.setVar('SSTATETASKS', " ".join(unique_tasks)) > > for task in unique_tasks: > > d.prependVarFlag(task, 'prefuncs', "sstate_task_prefunc ") > > d.appendVarFlag(task, 'postfuncs', " sstate_task_postfunc") > > } > > +addhandler sstate_setup_tasks > > +sstate_setup_tasks[eventmask] = "bb.event.RecipeTaskPreProcess" > > > > def sstate_init(task, d): > > ss = {} > > -- > > 2.25.0 > > > > Gentle ping. Gentle reminder that we're in the middle of sorting out a release. This will not merge until after the release and I don't have the cycles for review of this kind of change right now. FWIW I still don't like the way this integrates into sstate and I want to spend some time trying to find a better way. I don't have any constructive suggestion as to what that would look like so I haven't replied, I simply don't know and that isn't a useful answer to you. You've also ignored my request to follow the coding style used
Re: [OE-core][PATCH v2 2/2] image.bbclass: deploy image artifacts in stages
pon., 6 kwi 2020 o 19:02 Bartosz Golaszewski napisał(a): > > From: Bartosz Golaszewski > > Make each IMAGE_CMD task an sstate task with its own IMGDEPLOYDIR > override. This way each generated set of artifacts is deployed as soon > as it's ready instead of the do_image_complete task handling the entire > deployement. This allows us to better fine-tune dependencies e.g. we > can make do_image_wic depend on fitImage task which can in turn depend > on do_image_ext4. > > We need delete the IMGDEPLOYDIR variable from the data object passed > to each image task so that it gets expanded with the correct override. > > In order to make sure that tasks added to SSTATETASKS in anonymous python > functions are correctly setup, move the code that assigns pre- and > postfuncs to an event handler invoked on bb.event.RecipeTaskPreProcess > in sstate.bbclass. This event is fired right after the anonymous > functions. > > Signed-off-by: Bartosz Golaszewski > --- > meta/classes/image.bbclass | 17 + > meta/classes/sstate.bbclass | 4 > 2 files changed, 21 insertions(+) > > diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass > index 07aa1f1fa5..ffd63aa82a 100644 > --- a/meta/classes/image.bbclass > +++ b/meta/classes/image.bbclass > @@ -428,10 +428,12 @@ python () { > # date/time values. It will get expanded at execution time. > # Similarly TMPDIR since otherwise we see QA stamp comparision > problems > # Expand PV else it can trigger get_srcrev which can fail due to > these variables being unset > +# Delete IMGDEPLOYDIR so that each task gets its own, overriden value > localdata.setVar('PV', d.getVar('PV')) > localdata.delVar('DATETIME') > localdata.delVar('DATE') > localdata.delVar('TMPDIR') > +localdata.delVar('IMGDEPLOYDIR') > vardepsexclude = (d.getVarFlag('IMAGE_CMD_' + realt, > 'vardepsexclude', True) or '').split() > for dep in vardepsexclude: > localdata.delVar(dep) > @@ -502,6 +504,21 @@ python () { > > bb.debug(2, "Adding task %s before %s, after %s" % (task, > 'do_image_complete', after)) > bb.build.addtask(task, 'do_image_complete', after, d) > + > +imgdeploydir = d.getVar('IMGDEPLOYDIR') > +task_override = task[3:].replace('_', '-') # 'do_image_ext4' becomes > 'image-ext4' > +taskdeploydir = > '{}/deploy-{}-{}'.format(os.path.dirname(imgdeploydir), > + d.getVar('PN'), > task_override) > + > +# Each image task gets its own IMGDEPLOYDIR directory and is added to > +# SSTATETASKS. This way every set of artifacts gets deployed right > after > +# the do_image_foo task completes. > +d.setVar('IMGDEPLOYDIR_task-{}'.format(task_override), taskdeploydir) > +d.appendVar('SSTATETASKS', ' {}'.format(task)) > +d.setVarFlag(task, 'sstate-inputdirs', taskdeploydir) > +d.setVarFlag(task, 'sstate-outputdirs', d.getVar('DEPLOY_DIR_IMAGE')) > +d.setVarFlag(task, 'cleandirs', taskdeploydir) > +d.setVar('SSTATE_SKIP_CREATION_task-{}'.format(task_override), '1') > } > > # > diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass > index c73c3b42a7..3c71312010 100644 > --- a/meta/classes/sstate.bbclass > +++ b/meta/classes/sstate.bbclass > @@ -138,13 +138,17 @@ python () { > d.setVar('SSTATE_EXTRAPATH', "${NATIVELSBSTRING}/") > d.setVar('BB_HASHFILENAME', "True ${SSTATE_PKGSPEC} > ${SSTATE_SWSPEC}") > d.setVar('SSTATE_EXTRAPATHWILDCARD', "${NATIVELSBSTRING}/") > +} > > +python sstate_setup_tasks() { > unique_tasks = sorted(set((d.getVar('SSTATETASKS') or "").split())) > d.setVar('SSTATETASKS', " ".join(unique_tasks)) > for task in unique_tasks: > d.prependVarFlag(task, 'prefuncs', "sstate_task_prefunc ") > d.appendVarFlag(task, 'postfuncs', " sstate_task_postfunc") > } > +addhandler sstate_setup_tasks > +sstate_setup_tasks[eventmask] = "bb.event.RecipeTaskPreProcess" > > def sstate_init(task, d): > ss = {} > -- > 2.25.0 > Gentle ping. Bart -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#137235): https://lists.openembedded.org/g/openembedded-core/message/137235 Mute This Topic: https://lists.openembedded.org/mt/72816245/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-