[OE-core] [PATCH] layer.conf: fix adwaita-icon-theme signature change problem

2020-07-22 Thread Changqing Li
From: Changqing Li 

allarch package adwaita-icon-theme inherit both allarch and
gtk-icon-cache, since commit 31e3d34c8a9c3e8481aa837aa0bf52adf095fe62
[gtk-icon-cache.bbclass: add runtime dependency], it start depend on
non-allarch packages gdk-pixbuf and gtk+3, which make it's signature
changes when machine changed.

like for task do_prepare_recipe_sysroot:
"Hash for dependent task
gdk-pixbuf/gdk-pixbuf_2.40.0.bb:do_populate_sysroot changed from
a72aba8432699c8ce4ca1f71833ef14a89ffde0ea4063e37b9d819fdb1e407f4 to
1ad4e1bd76921b71482657f3b017184e9ade8e2a0b9f43ad64ed2dda83b1520f"

the only way to fix this is remove the task dependency.
SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS not work in class, so add it in
layer.conf.

Maybe we have other recipes under other layers have similar problem, we
can only add one by one to its layer.conf, seems not a good idea. but
add *->pixbuf will influence other packages

Signed-off-by: Changqing Li 
---
 meta/conf/layer.conf | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/conf/layer.conf b/meta/conf/layer.conf
index 098ef12ac6..c115c87043 100644
--- a/meta/conf/layer.conf
+++ b/meta/conf/layer.conf
@@ -80,6 +80,8 @@ SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS += " \
   weston-init->kbd \
   connman->xl2tpd \
   lttng-tools->lttng-modules \
+  adwaita-icon-theme->gdk-pixbuf \
+  adwaita-icon-theme->gtk+3 \
 "
 
 # Avoid adding bison-native to the sysroot without a specific
-- 
2.17.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#140889): 
https://lists.openembedded.org/g/openembedded-core/message/140889
Mute This Topic: https://lists.openembedded.org/mt/75741115/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] stress-ng: create a symlink for /usr/bin/stress

2020-07-22 Thread Khem Raj
Hi Dan

On 7/22/20 9:31 PM, Dan Callaghan wrote:
> In commit 72641004, stress-ng was made to provide the stress package,
> because it's backwards compatible with the old stress command. But it
> doesn't actually provide /usr/bin/stress which is what other recipes
> depending on stress will expect.
> 
> Symlink /usr/bin/stress to stress-ng so that it actually becomes
> a drop-in replacement for stress.
> 
> Signed-off-by: Dan Callaghan 
> ---
>  meta/recipes-extended/stress-ng/stress-ng_0.11.15.bb | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/meta/recipes-extended/stress-ng/stress-ng_0.11.15.bb 
> b/meta/recipes-extended/stress-ng/stress-ng_0.11.15.bb
> index 8ea0476db5..dcded1120d 100644
> --- a/meta/recipes-extended/stress-ng/stress-ng_0.11.15.bb
> +++ b/meta/recipes-extended/stress-ng/stress-ng_0.11.15.bb
> @@ -22,5 +22,6 @@ inherit bash-completion
>
>  do_install() {
>  oe_runmake DESTDIR=${D} install
> +ln -s stress-ng ${D}/usr/bin/stress

there is stress recipe in some layers which could provide stress utility
as well, therefore it should be using update-alternatives mechanism so
it fills in when stress is not provided by say stress recipe.

secondly please use ${D}${bindir}/stress instead of hardcoding the path

>  }
>
> 
> 
> 
> 



signature.asc
Description: OpenPGP digital signature
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#140888): 
https://lists.openembedded.org/g/openembedded-core/message/140888
Mute This Topic: https://lists.openembedded.org/mt/75740083/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] stress-ng: create a symlink for /usr/bin/stress

2020-07-22 Thread Dan Callaghan
In commit 72641004, stress-ng was made to provide the stress package,
because it's backwards compatible with the old stress command. But it
doesn't actually provide /usr/bin/stress which is what other recipes
depending on stress will expect.

Symlink /usr/bin/stress to stress-ng so that it actually becomes
a drop-in replacement for stress.

Signed-off-by: Dan Callaghan 
---
 meta/recipes-extended/stress-ng/stress-ng_0.11.15.bb | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/recipes-extended/stress-ng/stress-ng_0.11.15.bb 
b/meta/recipes-extended/stress-ng/stress-ng_0.11.15.bb
index 8ea0476db5..dcded1120d 100644
--- a/meta/recipes-extended/stress-ng/stress-ng_0.11.15.bb
+++ b/meta/recipes-extended/stress-ng/stress-ng_0.11.15.bb
@@ -22,5 +22,6 @@ inherit bash-completion
 
 do_install() {
 oe_runmake DESTDIR=${D} install
+ln -s stress-ng ${D}/usr/bin/stress
 }
 
-- 
2.25.4

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#140887): 
https://lists.openembedded.org/g/openembedded-core/message/140887
Mute This Topic: https://lists.openembedded.org/mt/75740083/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] Revert "python3: define a profile directory path"

2020-07-22 Thread Yu, Mingli
From: Mingli Yu 

After ccache upgrade to 3.7.11, there is below logic introduced.
58895dc Add knowledge about -fprofile-{correction,reorder-functions,values}

And the python3 ccache build issue [1] is fixed in ccache 3.7.11, so there
is no need to define a profile directory path for python3 any more.

[1] https://github.com/ccache/ccache/issues/615
---
 ...re.ac-define-a-path-for-profile-data.patch | 42 ---
 meta/recipes-devtools/python/python3_3.8.3.bb |  1 -
 2 files changed, 43 deletions(-)
 delete mode 100644 
meta/recipes-devtools/python/python3/0001-configure.ac-define-a-path-for-profile-data.patch

diff --git 
a/meta/recipes-devtools/python/python3/0001-configure.ac-define-a-path-for-profile-data.patch
 
b/meta/recipes-devtools/python/python3/0001-configure.ac-define-a-path-for-profile-data.patch
deleted file mode 100644
index ee3d645521..00
--- 
a/meta/recipes-devtools/python/python3/0001-configure.ac-define-a-path-for-profile-data.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 5e94e315119117898ce1a2798641848f61d796b1 Mon Sep 17 00:00:00 2001
-From: Mingli Yu 
-Date: Thu, 9 Jul 2020 07:58:44 +
-Subject: [PATCH] configure.ac: define a path for profile data
-
-There comes below error when use ccache 3.7.10 to compile python3
-and check [1] for more details.
- | Python-3.8.3/Modules/_contextvarsmodule.c:43:1: error: source locations for 
function 'PyInit__contextvars' have changed, the profile data may be out of 
date [-Werror=coverage-mismatch]
-
-That's because the logic for profile directory changes a little in
-[2] after ccache upgrades to 3.7.10.
-
-So define a profile directory path accordingly to fix the above error.
-
-[1] https://github.com/ccache/ccache/issues/615
-[2] 
https://github.com/ccache/ccache/commit/91a2954eb47b4a106e2be6cf611917b895108e35
-
-Upstream-Status: Submitted [https://github.com/python/cpython/pull/21408]
-
-Signed-off-by: Mingli Yu 

- configure.ac | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 08fe397..bb15bda 100644
 a/configure.ac
-+++ b/configure.ac
-@@ -1332,8 +1332,8 @@ case $cc_basename in
- fi
- ;;
-   *)
--PGO_PROF_GEN_FLAG="-fprofile-generate"
--PGO_PROF_USE_FLAG="-fprofile-use -fprofile-correction"
-+PGO_PROF_GEN_FLAG="-fprofile-generate=$(pwd)"
-+PGO_PROF_USE_FLAG="-fprofile-use=$(pwd) -fprofile-correction"
- LLVM_PROF_MERGER="true"
- LLVM_PROF_FILE=""
- ;;
--- 
-2.26.2
-
diff --git a/meta/recipes-devtools/python/python3_3.8.3.bb 
b/meta/recipes-devtools/python/python3_3.8.3.bb
index 7e0f35ce41..a7cfbad5cd 100644
--- a/meta/recipes-devtools/python/python3_3.8.3.bb
+++ b/meta/recipes-devtools/python/python3_3.8.3.bb
@@ -32,7 +32,6 @@ SRC_URI = 
"http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
file://0001-configure.ac-fix-LIBPL.patch \
file://0001-python3-Do-not-hardcode-lib-for-distutils.patch \

file://0020-configure.ac-setup.py-do-not-add-a-curses-include-pa.patch \
-   file://0001-configure.ac-define-a-path-for-profile-data.patch \
"
 
 SRC_URI_append_class-native = " \
-- 
2.17.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#140885): 
https://lists.openembedded.org/g/openembedded-core/message/140885
Mute This Topic: https://lists.openembedded.org/mt/75739863/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] ccache: Upgrade to 3.7.11

2020-07-22 Thread Yu, Mingli
From: Mingli Yu 

Bug fixes:
  Added knowledge about -fprofile-{correction,reorder-functions,values}.
  ccache now handles the Intel compiler option -xCODE (where CODE is a 
processor feature code) correctly.
  Added support for NVCC's -Werror and --Werror options.

Signed-off-by: Mingli Yu 
---
 .../ccache/{ccache_3.7.10.bb => ccache_3.7.11.bb}   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 rename meta/recipes-devtools/ccache/{ccache_3.7.10.bb => ccache_3.7.11.bb} 
(91%)

diff --git a/meta/recipes-devtools/ccache/ccache_3.7.10.bb 
b/meta/recipes-devtools/ccache/ccache_3.7.11.bb
similarity index 91%
rename from meta/recipes-devtools/ccache/ccache_3.7.10.bb
rename to meta/recipes-devtools/ccache/ccache_3.7.11.bb
index 852583dfd2..fd004f4c9b 100644
--- a/meta/recipes-devtools/ccache/ccache_3.7.10.bb
+++ b/meta/recipes-devtools/ccache/ccache_3.7.11.bb
@@ -12,7 +12,7 @@ LIC_FILES_CHKSUM = 
"file://LICENSE.adoc;md5=22d514dbc01fdf9a9784334b6b59417a"
 DEPENDS = "zlib"
 
 SRC_URI = 
"https://github.com/ccache/ccache/releases/download/v${PV}/${BP}.tar.gz";
-SRC_URI[sha256sum] = 
"447ddf21a5f0ffa6b6d26839ae876a6d17d0d7e3533926cdf78ecd11dad793f8"
+SRC_URI[sha256sum] = 
"34309a59d4b6b6b33756366aa9d3144a4655587be9f914476b4c0e2d36365f01"
 
 UPSTREAM_CHECK_URI = "https://github.com/ccache/ccache/releases/";
 
-- 
2.17.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#140886): 
https://lists.openembedded.org/g/openembedded-core/message/140886
Mute This Topic: https://lists.openembedded.org/mt/75739864/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][poky][dunfell] kernel-yocto: account for extracted defconfig in elements check

2020-07-22 Thread Steve Sakoman
On Wed, Jul 22, 2020 at 3:58 PM Bruce Ashfield  wrote:
>
> Adding oe-core, since that's where this would be noticed (and is the
> right list for it).
>
> Steve: this change is good for backpor, and puts everything back to a
> working state, the bug this fixes only came in after the initial fixes
> had gone to dunfell.

I already pulled thin into stable/dunfell-nut for testing, but we
should probably pull it into the upcoming dunfell 3.1.2 release!

Richard: If you are going to kick off the release build could you pull
in this patch?  If you aren't going to the build yet I'll send a pull
request tomorrow morning.

Steve

> On Wed, Jul 22, 2020 at 3:53 AM Gary Bisson
>  wrote:
> >
> > From: Bruce Ashfield 
> >
> > The test for whether or not scc should to invoked to generate a
> > config.queue was missing the newly created sccs_defconfig variable.
> > We need to test for that variable as well, or we may miss generating
> > the config.queue in some cases.
> >
> > (From OE-Core rev: 3a95e171d3eaa6ab143d4f422c98a0ac7ad31761)
> >
> > Signed-off-by: Bruce Ashfield 
> > Signed-off-by: Richard Purdie 
> > ---
> > Hi,
> >
> > I believe this patch log should also say:
> > Fixes: 23dcff0d39 (kernel/yocto: ensure that defconfigs are processed first)
> >
> > What I see on dunfell HEAD currently is that it's impossible to build my
> > kernel (that uses KBUILD_DEFCONFIG) as the configme step fails because
> > the config.queue in meta folder is not created.
> >
> > Adding this patch on dunfell branch fixed the issue, hence this backport
> > request.
> >
> > Let me know if you have any questions.
> >
> > Regards,
> > Gary
> > ---
> >  meta/classes/kernel-yocto.bbclass | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/meta/classes/kernel-yocto.bbclass 
> > b/meta/classes/kernel-yocto.bbclass
> > index 54a1a1627a..3311f6e84e 100644
> > --- a/meta/classes/kernel-yocto.bbclass
> > +++ b/meta/classes/kernel-yocto.bbclass
> > @@ -213,7 +213,7 @@ do_kernel_metadata() {
> > meta_dir=$(kgit --meta)
> >
> > # run1: pull all the configuration fragments, no matter where they 
> > come from
> > -   elements="`echo -n ${bsp_definition} ${sccs} ${patches} 
> > ${KERNEL_FEATURES}`"
> > +   elements="`echo -n ${bsp_definition} $sccs_defconfig ${sccs} 
> > ${patches} ${KERNEL_FEATURES}`"
> > if [ -n "${elements}" ]; then
> > echo "${bsp_definition}" > ${S}/${meta_dir}/bsp_definition
> > scc --force -o ${S}/${meta_dir}:cfg,merge,meta ${includes} 
> > $sccs_defconfig $bsp_definition $sccs $patches ${KERNEL_FEATURES}
> > --
> > 2.27.0
> >
>
>
> --
> - Thou shalt not follow the NULL pointer, for chaos and madness await
> thee at its end
> - "Use the force Harry" - Gandalf, Star Trek II
> 
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#140884): 
https://lists.openembedded.org/g/openembedded-core/message/140884
Mute This Topic: https://lists.openembedded.org/mt/75738482/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][dunfell 04/25] kernel/yocto: ensure that defconfigs are processed first

2020-07-22 Thread Steve Sakoman
On Wed, Jul 22, 2020 at 3:58 PM Bruce Ashfield  wrote:
>
> On Wed, Jul 22, 2020 at 5:27 PM Ryan Harkin  wrote:
> >
> > Just an FYI, but when this was submitted, my imx7s-warp builds began to 
> > fail when building linux-fslc from meta-freescale / meta-freescale-3rdparty.
> >
> > I'm not sure why yet, I've only discovered the problem, but I thought I'd 
> > report it in case anyone else sees the problem.
> >
>
> Someone already sent a dunfell backport request for a follow up patch to this.
>
> It went to the poky list, but I just replied to it and copied oe-core.

Both patches are already in dunfell!

https://git.openembedded.org/openembedded-core/commit/?h=dunfell&id=7ecc81baeacaa1149a4947791200e8819c3df677
https://git.openembedded.org/openembedded-core/commit/?h=dunfell&id=11089e06bfb3d0defb52825ffba978d085385569

Steve

> > Here's a link to my failing build for reference:
> > https://ci.linaro.org/job/warp7-openembedded-dunfell/67/DISTRO=rpb,MACHINE=imx7s-warp,label=docker-buster-amd64/consoleText
> >
> > And a snippet from the failure:
> >
> > ERROR: linux-fslc-5.4.46+gitAUTOINC+38d6c3525e-r0 do_kernel_configme: 
> > Execution of 
> > '/srv/oe/build/tmp-rpb-glibc/work/imx7s_warp-linaro-linux-gnueabi/linux-fslc/5.4.46+gitAUTOINC+38d6c3525e-r0/temp/run.do_kernel_configme.7123'
> >  failed with exit code 1:
> > WARNING: exit code 1 from a shell command.
> >
> > ERROR: Logfile of failure stored in: 
> > /srv/oe/build/tmp-rpb-glibc/work/imx7s_warp-linaro-linux-gnueabi/linux-fslc/5.4.46+gitAUTOINC+38d6c3525e-r0/temp/log.do_kernel_configme.7123
> > Log data follows:
> > | DEBUG: Executing python function extend_recipe_sysroot
> > | NOTE: Direct dependencies are 
> > ['virtual:native:/srv/oe/build/conf/../../layers/openembedded-core/meta/recipes-devtools/bison/bison_3.5.3.bb:do_populate_sysroot',
> >  
> > '/srv/oe/build/conf/../../layers/openembedded-core/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb:do_populate_sysroot',
> >  
> > '/srv/oe/build/conf/../../layers/openembedded-core/meta/recipes-devtools/binutils/binutils-cross_2.34.bb:do_populate_sysroot',
> >  
> > '/srv/oe/build/conf/../../layers/openembedded-core/meta/recipes-devtools/quilt/quilt-native_0.66.bb:do_populate_sysroot',
> >  
> > 'virtual:native:/srv/oe/build/conf/../../layers/openembedded-core/meta/recipes-devtools/patch/patch_2.7.6.bb:do_populate_sysroot',
> >  
> > 'virtual:native:/srv/oe/build/conf/../../layers/openembedded-core/meta/recipes-extended/bc/bc_1.07.1.bb:do_populate_sysroot',
> >  
> > '/srv/oe/build/conf/../../layers/meta-arm/meta-arm-toolchain/recipes-devtools/gcc/gcc-cross_arm-9.2.bb:do_populate_sysroot']
> > | NOTE: Installed into sysroot: []
> > | NOTE: Skipping as already exists in sysroot: ['bison-native', 
> > 'kern-tools-native', 'binutils-cross-arm', 'quilt-native', 'patch-native', 
> > 'bc-native', 'gcc-cross-arm', 'flex-native', 'texinfo-dummy-native', 
> > 'gnu-config-native', 'readline-native', 'libtool-native', 
> > 'automake-native', 'autoconf-native', 'xz-native', 'linux-libc-headers', 
> > 'gmp-native', 'libmpc-native', 'mpfr-native', 'zlib-native', 
> > 'gettext-minimal-native', 'attr-native', 'm4-native', 'ncurses-native', 
> > 'pkgconfig-native']
> > | DEBUG: Python function extend_recipe_sysroot finished
> > | DEBUG: Executing shell function do_kernel_configme
> > | WARNING: exit code 1 from a shell command.
> > | ERROR: Execution of 
> > '/srv/oe/build/tmp-rpb-glibc/work/imx7s_warp-linaro-linux-gnueabi/linux-fslc/5.4.46+gitAUTOINC+38d6c3525e-r0/temp/run.do_kernel_configme.7123'
> >  failed with exit code 1:
> > | WARNING: exit code 1 from a shell command.
> > |
> > NOTE: recipe linux-fslc-5.4.46+gitAUTOINC+38d6c3525e-r0: task 
> > do_kernel_configme: Failed
> > ERROR: Task 
> > (/srv/oe/build/conf/../../layers/meta-freescale/recipes-kernel/linux/linux-fslc_5.4.bb:do_kernel_configme)
> >  failed with exit code '1'
> >
> >
> >
> > On Mon, 6 Jul 2020 at 17:38, Steve Sakoman  wrote:
> >>
> >> On Mon, Jul 6, 2020 at 6:29 AM Bruce Ashfield  
> >> wrote:
> >> >
> >> > We have a fixup patch for this one in test right now, so we don't want
> >> > this patch, without the follow up.
> >> >
> >> > But this is useful for dunfell, since it was an unexpected behaviour
> >> > that needed to be fixed.
> >>
> >> Thanks, I'll drop this patch from the pull request and include it
> >> along with the fixup patch in next week's patch set.
> >>
> >> Steve
> >>
> >> > On Mon, Jul 6, 2020 at 12:11 PM Steve Sakoman  wrote:
> >> > >
> >> > > From: Bruce Ashfield 
> >> > >
> >> > > It is uncommon that a BSP definition and a defconfig are used in
> >> > > a single configuration. That being said, it is a valid way to
> >> > > organize kernel configuration meta data.
> >> > >
> >> > > When a defconfig is used, either on the src_uri or from in
> >> > > the kernel tree, it is normally expected that it is the baseline,
> >> > > with all options applied on top of it.
> >> > >
> >> > > With this commit, we detect either type of def

Re: [OE-core] [PATCH][poky][dunfell] kernel-yocto: account for extracted defconfig in elements check

2020-07-22 Thread Bruce Ashfield
Adding oe-core, since that's where this would be noticed (and is the
right list for it).

Steve: this change is good for backpor, and puts everything back to a
working state, the bug this fixes only came in after the initial fixes
had gone to dunfell.

Bruce

On Wed, Jul 22, 2020 at 3:53 AM Gary Bisson
 wrote:
>
> From: Bruce Ashfield 
>
> The test for whether or not scc should to invoked to generate a
> config.queue was missing the newly created sccs_defconfig variable.
> We need to test for that variable as well, or we may miss generating
> the config.queue in some cases.
>
> (From OE-Core rev: 3a95e171d3eaa6ab143d4f422c98a0ac7ad31761)
>
> Signed-off-by: Bruce Ashfield 
> Signed-off-by: Richard Purdie 
> ---
> Hi,
>
> I believe this patch log should also say:
> Fixes: 23dcff0d39 (kernel/yocto: ensure that defconfigs are processed first)
>
> What I see on dunfell HEAD currently is that it's impossible to build my
> kernel (that uses KBUILD_DEFCONFIG) as the configme step fails because
> the config.queue in meta folder is not created.
>
> Adding this patch on dunfell branch fixed the issue, hence this backport
> request.
>
> Let me know if you have any questions.
>
> Regards,
> Gary
> ---
>  meta/classes/kernel-yocto.bbclass | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/classes/kernel-yocto.bbclass 
> b/meta/classes/kernel-yocto.bbclass
> index 54a1a1627a..3311f6e84e 100644
> --- a/meta/classes/kernel-yocto.bbclass
> +++ b/meta/classes/kernel-yocto.bbclass
> @@ -213,7 +213,7 @@ do_kernel_metadata() {
> meta_dir=$(kgit --meta)
>
> # run1: pull all the configuration fragments, no matter where they 
> come from
> -   elements="`echo -n ${bsp_definition} ${sccs} ${patches} 
> ${KERNEL_FEATURES}`"
> +   elements="`echo -n ${bsp_definition} $sccs_defconfig ${sccs} 
> ${patches} ${KERNEL_FEATURES}`"
> if [ -n "${elements}" ]; then
> echo "${bsp_definition}" > ${S}/${meta_dir}/bsp_definition
> scc --force -o ${S}/${meta_dir}:cfg,merge,meta ${includes} 
> $sccs_defconfig $bsp_definition $sccs $patches ${KERNEL_FEATURES}
> --
> 2.27.0
>


-- 
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#140881): 
https://lists.openembedded.org/g/openembedded-core/message/140881
Mute This Topic: https://lists.openembedded.org/mt/75738482/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][dunfell 04/25] kernel/yocto: ensure that defconfigs are processed first

2020-07-22 Thread Bruce Ashfield
On Wed, Jul 22, 2020 at 5:27 PM Ryan Harkin  wrote:
>
> Just an FYI, but when this was submitted, my imx7s-warp builds began to fail 
> when building linux-fslc from meta-freescale / meta-freescale-3rdparty.
>
> I'm not sure why yet, I've only discovered the problem, but I thought I'd 
> report it in case anyone else sees the problem.
>

Someone already sent a dunfell backport request for a follow up patch to this.

It went to the poky list, but I just replied to it and copied oe-core.

Bruce


Bruce

> Here's a link to my failing build for reference:
> https://ci.linaro.org/job/warp7-openembedded-dunfell/67/DISTRO=rpb,MACHINE=imx7s-warp,label=docker-buster-amd64/consoleText
>
> And a snippet from the failure:
>
> ERROR: linux-fslc-5.4.46+gitAUTOINC+38d6c3525e-r0 do_kernel_configme: 
> Execution of 
> '/srv/oe/build/tmp-rpb-glibc/work/imx7s_warp-linaro-linux-gnueabi/linux-fslc/5.4.46+gitAUTOINC+38d6c3525e-r0/temp/run.do_kernel_configme.7123'
>  failed with exit code 1:
> WARNING: exit code 1 from a shell command.
>
> ERROR: Logfile of failure stored in: 
> /srv/oe/build/tmp-rpb-glibc/work/imx7s_warp-linaro-linux-gnueabi/linux-fslc/5.4.46+gitAUTOINC+38d6c3525e-r0/temp/log.do_kernel_configme.7123
> Log data follows:
> | DEBUG: Executing python function extend_recipe_sysroot
> | NOTE: Direct dependencies are 
> ['virtual:native:/srv/oe/build/conf/../../layers/openembedded-core/meta/recipes-devtools/bison/bison_3.5.3.bb:do_populate_sysroot',
>  
> '/srv/oe/build/conf/../../layers/openembedded-core/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb:do_populate_sysroot',
>  
> '/srv/oe/build/conf/../../layers/openembedded-core/meta/recipes-devtools/binutils/binutils-cross_2.34.bb:do_populate_sysroot',
>  
> '/srv/oe/build/conf/../../layers/openembedded-core/meta/recipes-devtools/quilt/quilt-native_0.66.bb:do_populate_sysroot',
>  
> 'virtual:native:/srv/oe/build/conf/../../layers/openembedded-core/meta/recipes-devtools/patch/patch_2.7.6.bb:do_populate_sysroot',
>  
> 'virtual:native:/srv/oe/build/conf/../../layers/openembedded-core/meta/recipes-extended/bc/bc_1.07.1.bb:do_populate_sysroot',
>  
> '/srv/oe/build/conf/../../layers/meta-arm/meta-arm-toolchain/recipes-devtools/gcc/gcc-cross_arm-9.2.bb:do_populate_sysroot']
> | NOTE: Installed into sysroot: []
> | NOTE: Skipping as already exists in sysroot: ['bison-native', 
> 'kern-tools-native', 'binutils-cross-arm', 'quilt-native', 'patch-native', 
> 'bc-native', 'gcc-cross-arm', 'flex-native', 'texinfo-dummy-native', 
> 'gnu-config-native', 'readline-native', 'libtool-native', 'automake-native', 
> 'autoconf-native', 'xz-native', 'linux-libc-headers', 'gmp-native', 
> 'libmpc-native', 'mpfr-native', 'zlib-native', 'gettext-minimal-native', 
> 'attr-native', 'm4-native', 'ncurses-native', 'pkgconfig-native']
> | DEBUG: Python function extend_recipe_sysroot finished
> | DEBUG: Executing shell function do_kernel_configme
> | WARNING: exit code 1 from a shell command.
> | ERROR: Execution of 
> '/srv/oe/build/tmp-rpb-glibc/work/imx7s_warp-linaro-linux-gnueabi/linux-fslc/5.4.46+gitAUTOINC+38d6c3525e-r0/temp/run.do_kernel_configme.7123'
>  failed with exit code 1:
> | WARNING: exit code 1 from a shell command.
> |
> NOTE: recipe linux-fslc-5.4.46+gitAUTOINC+38d6c3525e-r0: task 
> do_kernel_configme: Failed
> ERROR: Task 
> (/srv/oe/build/conf/../../layers/meta-freescale/recipes-kernel/linux/linux-fslc_5.4.bb:do_kernel_configme)
>  failed with exit code '1'
>
>
>
> On Mon, 6 Jul 2020 at 17:38, Steve Sakoman  wrote:
>>
>> On Mon, Jul 6, 2020 at 6:29 AM Bruce Ashfield  
>> wrote:
>> >
>> > We have a fixup patch for this one in test right now, so we don't want
>> > this patch, without the follow up.
>> >
>> > But this is useful for dunfell, since it was an unexpected behaviour
>> > that needed to be fixed.
>>
>> Thanks, I'll drop this patch from the pull request and include it
>> along with the fixup patch in next week's patch set.
>>
>> Steve
>>
>> > On Mon, Jul 6, 2020 at 12:11 PM Steve Sakoman  wrote:
>> > >
>> > > From: Bruce Ashfield 
>> > >
>> > > It is uncommon that a BSP definition and a defconfig are used in
>> > > a single configuration. That being said, it is a valid way to
>> > > organize kernel configuration meta data.
>> > >
>> > > When a defconfig is used, either on the src_uri or from in
>> > > the kernel tree, it is normally expected that it is the baseline,
>> > > with all options applied on top of it.
>> > >
>> > > With this commit, we detect either type of defconfig and ensure
>> > > that it is used first, followed by the fragments in their
>> > > previous order. This allows existing configuration stacks to
>> > > remain the same, while ensuring that a defconfig combined stack
>> > > works as expected.
>> > >
>> > > Signed-off-by: Bruce Ashfield 
>> > > Signed-off-by: Richard Purdie 
>> > > (cherry picked from commit e6845327b69396d843a2f3c4c3ac9400ae9caedf)
>> > > Signed-off-by: Steve Sakoman 
>> > > ---
>> > >  meta/classes/kernel-yocto.bbclass 

[OE-core] [PATCH] buildhistory: use pid for temporary txt file name

2020-07-22 Thread Lee Chee Yang
From: Lee Chee Yang 

buildhistory create .txt file bh_installed_pkgs.txt and
bh_installed_pkgs_deps.txt while listing down installed package.
These file is later removed in buildhistory_get_installed().

when multiple process runs in parellal there are chances to race for
the file where one process created the file while another task remove
the file right after it.

using different file name for each process should avoid the race. So
add PID to the file name to make it unique.

[yocto #13709]

Signed-off-by: Lee Chee Yang 
---
 meta/classes/buildhistory.bbclass | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/meta/classes/buildhistory.bbclass 
b/meta/classes/buildhistory.bbclass
index a4288ef9e1..805e976ac5 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -429,8 +429,8 @@ def buildhistory_list_installed(d, rootfs_type="image"):
 from oe.sdk import sdk_list_installed_packages
 from oe.utils import format_pkg_list
 
-process_list = [('file', 'bh_installed_pkgs.txt'),\
-('deps', 'bh_installed_pkgs_deps.txt')]
+process_list = [('file', 'bh_installed_pkgs_%s.txt' % os.getpid()),\
+('deps', 'bh_installed_pkgs_deps_%s.txt' % os.getpid())]
 
 if rootfs_type == "image":
 pkgs = image_list_installed_packages(d)
@@ -460,9 +460,10 @@ buildhistory_get_installed() {
 
# Get list of installed packages
pkgcache="$1/installed-packages.tmp"
-   cat ${WORKDIR}/bh_installed_pkgs.txt | sort > $pkgcache && rm 
${WORKDIR}/bh_installed_pkgs.txt
+   cat ${WORKDIR}/bh_installed_pkgs_${PID}.txt | sort > $pkgcache && rm 
${WORKDIR}/bh_installed_pkgs_${PID}.txt
 
cat $pkgcache | awk '{ print $1 }' > $1/installed-package-names.txt
+
if [ -s $pkgcache ] ; then
cat $pkgcache | awk '{ print $2 }' | xargs -n1 basename > 
$1/installed-packages.txt
else
@@ -471,8 +472,8 @@ buildhistory_get_installed() {
 
# Produce dependency graph
# First, quote each name to handle characters that cause issues for dot
-   sed 's:\([^| ]*\):"\1":g' ${WORKDIR}/bh_installed_pkgs_deps.txt > 
$1/depends.tmp &&
-   rm ${WORKDIR}/bh_installed_pkgs_deps.txt
+   sed 's:\([^| ]*\):"\1":g' ${WORKDIR}/bh_installed_pkgs_deps_${PID}.txt 
> $1/depends.tmp &&
+   rm ${WORKDIR}/bh_installed_pkgs_deps_${PID}.txt
# Remove lines with rpmlib(...) and config(...) dependencies, change the
# delimiter from pipe to "->", set the style for recommend lines and
# turn versioned dependencies into edge labels.
-- 
2.17.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#140880): 
https://lists.openembedded.org/g/openembedded-core/message/140880
Mute This Topic: https://lists.openembedded.org/mt/75737969/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] [master][dunfell][PATCH] glibc: Secruity fix for CVE-2020-6096

2020-07-22 Thread Armin Kuster


On 7/20/20 2:49 PM, akuster via lists.openembedded.org wrote:
> From: Armin Kuster 
>
> Source: glibc.org
> MR: 104799
> Type: Security Fix
> Disposition: Backport from  beea361050728138b82c57dda0c4810402d342b9
> ChangeID: 29df826fb697fdd2742c3bace33388bda962c5f1
> Description:

Any issues with this?

-armin
>
> Signed-off-by: Armin Kuster 
> ---
>  .../glibc/glibc/CVE-2020-6096.patch   | 112 ++
>  .../glibc/glibc/CVE-2020-6096_2.patch | 194 ++
>  meta/recipes-core/glibc/glibc_2.31.bb |   2 +
>  3 files changed, 308 insertions(+)
>  create mode 100644 meta/recipes-core/glibc/glibc/CVE-2020-6096.patch
>  create mode 100644 meta/recipes-core/glibc/glibc/CVE-2020-6096_2.patch
>
> diff --git a/meta/recipes-core/glibc/glibc/CVE-2020-6096.patch 
> b/meta/recipes-core/glibc/glibc/CVE-2020-6096.patch
> new file mode 100644
> index 000..9c26f76432d
> --- /dev/null
> +++ b/meta/recipes-core/glibc/glibc/CVE-2020-6096.patch
> @@ -0,0 +1,112 @@
> +From beea361050728138b82c57dda0c4810402d342b9 Mon Sep 17 00:00:00 2001
> +From: Alexander Anisimov 
> +Date: Wed, 8 Jul 2020 14:18:31 +0200
> +Subject: [PATCH] arm: CVE-2020-6096: Fix multiarch memcpy for negative length
> + [BZ #25620]
> +
> +Unsigned branch instructions could be used for r2 to fix the wrong
> +behavior when a negative length is passed to memcpy.
> +This commit fixes the armv7 version.
> +
> +Upstream-Status: Backport
> +CVE: CVE-2020-6096 patch #1
> +Signed-off-by: Armin Kuster 
> +
> +---
> + sysdeps/arm/armv7/multiarch/memcpy_impl.S | 22 +++---
> + 1 file changed, 11 insertions(+), 11 deletions(-)
> +
> +diff --git a/sysdeps/arm/armv7/multiarch/memcpy_impl.S 
> b/sysdeps/arm/armv7/multiarch/memcpy_impl.S
> +index bf4ac7077f..379bb56fc9 100644
> +--- a/sysdeps/arm/armv7/multiarch/memcpy_impl.S
>  b/sysdeps/arm/armv7/multiarch/memcpy_impl.S
> +@@ -268,7 +268,7 @@ ENTRY(memcpy)
> + 
> + mov dst, dstin  /* Preserve dstin, we need to return it.  */
> + cmp count, #64
> +-bge .Lcpy_not_short
> ++bhs .Lcpy_not_short
> + /* Deal with small copies quickly by dropping straight into the
> +exit block.  */
> + 
> +@@ -351,10 +351,10 @@ ENTRY(memcpy)
> + 
> + 1:
> + substmp2, count, #64/* Use tmp2 for count.  */
> +-blt .Ltail63aligned
> ++blo .Ltail63aligned
> + 
> + cmp tmp2, #512
> +-bge .Lcpy_body_long
> ++bhs .Lcpy_body_long
> + 
> + .Lcpy_body_medium:  /* Count in tmp2.  */
> + #ifdef USE_VFP
> +@@ -378,7 +378,7 @@ ENTRY(memcpy)
> + add src, src, #64
> + vstrd1, [dst, #56]
> + add dst, dst, #64
> +-bge 1b
> ++bhs 1b
> + tst tmp2, #0x3f
> + beq .Ldone
> + 
> +@@ -412,7 +412,7 @@ ENTRY(memcpy)
> + ldrdA_l, A_h, [src, #64]!
> + strdA_l, A_h, [dst, #64]!
> + substmp2, tmp2, #64
> +-bge 1b
> ++bhs 1b
> + tst tmp2, #0x3f
> + bne 1f
> + ldr tmp2,[sp], #FRAME_SIZE
> +@@ -482,7 +482,7 @@ ENTRY(memcpy)
> + add src, src, #32
> + 
> + substmp2, tmp2, #prefetch_lines * 64 * 2
> +-blt 2f
> ++blo 2f
> + 1:
> + cpy_line_vfpd3, 0
> + cpy_line_vfpd4, 64
> +@@ -494,7 +494,7 @@ ENTRY(memcpy)
> + add dst, dst, #2 * 64
> + add src, src, #2 * 64
> + substmp2, tmp2, #prefetch_lines * 64
> +-bge 1b
> ++bhs 1b
> + 
> + 2:
> + cpy_tail_vfpd3, 0
> +@@ -615,8 +615,8 @@ ENTRY(memcpy)
> + 1:
> + pld [src, #(3 * 64)]
> + subscount, count, #64
> +-ldrmi   tmp2, [sp], #FRAME_SIZE
> +-bmi .Ltail63unaligned
> ++ldrlo   tmp2, [sp], #FRAME_SIZE
> ++blo .Ltail63unaligned
> + pld [src, #(4 * 64)]
> + 
> + #ifdef USE_NEON
> +@@ -633,7 +633,7 @@ ENTRY(memcpy)
> + neon_load_multi d0-d3, src
> + neon_load_multi d4-d7, src
> + subscount, count, #64
> +-bmi 2f
> ++blo 2f
> + 1:
> + pld [src, #(4 * 64)]
> + neon_store_multi d0-d3, dst
> +@@ -641,7 +641,7 @@ ENTRY(memcpy)
> + neon_store_multi d4-d7, dst
> + neon_load_multi d4-d7, src
> + subscount, count, #64
> +-bpl 1b
> ++bhs 1b
> + 2:
> + neon_store_multi d0-d3, dst
> + neon_store_multi d4-d7, dst
> +-- 
> +2.17.1
> +
> diff --git a/meta/recipes-core/glibc/glibc/CVE-2020-6096_2.patch 
> b/meta/recipes-core/glibc/glibc/CVE-2020-6096_2.patch
> new file mode 100644
> index 000..905e44c8e33
> --- /dev/null
> +++ b/meta/recipes-core/glibc/glibc/CVE-2020-6096_2.patch
> @@ -0,0 +1,194 @@
> +From 79a4fa341b8a89cb03f84564fd72abaa1a2db394 Mon Sep 17 00:00:00 2001
> +From: Evgeny Eremin 
> +Date: Wed, 8 Jul 2020 14:18:19 +0200
> +Subject: [PATCH] arm: CVE-2020-6096: fix memcpy and memmove for negative
> + length [BZ #25620]
> +
> +Unsigned branch instructions could be used for r2 to fix the wrong
> +behavior when a negative

Re: [oe-core][PATCH 1/1] libdnf: allow reproducible binary builds

2020-07-22 Thread Richard Purdie
On Wed, 2020-07-22 at 13:31 -0700, Joe Slater wrote:
> Use a static TESTDATADIR if tests are disabled.  Allow
> override of TESTDATADIR if tests are enabled since the
> default will be wrong for target builds.
> 
> Signed-off-by: Joe Slater 
> ---
>  .../libdnf/libdnf/enable_test_data_dir_set.patch   | 26 
> ++
>  meta/recipes-devtools/libdnf/libdnf_0.48.0.bb  |  1 +
>  2 files changed, 27 insertions(+)
>  create mode 100644 
> meta/recipes-devtools/libdnf/libdnf/enable_test_data_dir_set.patch
> 
> diff --git 
> a/meta/recipes-devtools/libdnf/libdnf/enable_test_data_dir_set.patch 
> b/meta/recipes-devtools/libdnf/libdnf/enable_test_data_dir_set.patch
> new file mode 100644
> index 000..e3784cc
> --- /dev/null
> +++ b/meta/recipes-devtools/libdnf/libdnf/enable_test_data_dir_set.patch
> @@ -0,0 +1,26 @@
> +libdnf: allow reproducible binary builds
> +
> +Use a dummy directory for test data if not built WITH_TESTS.  Allow for 
> overriding
> +TESTDATADIR, since the default is guaranteed to be wrong for target builds.
> +
> +Upstream-Status: Pending
> +
> +Signed-off-by: Joe Slater 
> +
> +
> +--- a/CMakeLists.txt
>  b/CMakeLists.txt
> +@@ -133,7 +133,12 @@ add_definitions(-DG_LOG_DOMAIN=\\"libdnf
> + add_definitions(-D_FILE_OFFSET_BITS=64)
> + 
> + # tests
> +-add_definitions(-DTESTDATADIR=\\"${CMAKE_SOURCE_DIR}/data/tests\\")
> ++if(NOT WITH_TESTS)
> ++  set(TEST_DATA_DIR "/notests")
> ++elseif(NOT DEFINED TEST_DATA_DIR)
> ++  set(TEST_DATA_DIR "${CMAKE_SOURCE_DIR}/data/tests")
> ++endif()
> ++add_definitions(-DTESTDATADIR=\\"${TEST_DATA_DIR}\\")

Do we need to set a value in the build or do we never enable the tests?

Cheers,

Richard

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#140878): 
https://lists.openembedded.org/g/openembedded-core/message/140878
Mute This Topic: https://lists.openembedded.org/mt/75733268/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][dunfell 04/25] kernel/yocto: ensure that defconfigs are processed first

2020-07-22 Thread Ryan Harkin
Just an FYI, but when this was submitted, my imx7s-warp builds began to
fail when building linux-fslc from meta-freescale / meta-freescale-3rdparty.

I'm not sure why yet, I've only discovered the problem, but I thought I'd
report it in case anyone else sees the problem.

Here's a link to my failing build for reference:
https://ci.linaro.org/job/warp7-openembedded-dunfell/67/DISTRO=rpb,MACHINE=imx7s-warp,label=docker-buster-amd64/consoleText

And a snippet from the failure:

ERROR: linux-fslc-5.4.46+gitAUTOINC+38d6c3525e-r0 do_kernel_configme:
Execution of 
'/srv/oe/build/tmp-rpb-glibc/work/imx7s_warp-linaro-linux-gnueabi/linux-fslc/5.4.46+gitAUTOINC+38d6c3525e-r0/temp/run.do_kernel_configme.7123'
failed with exit code 1:
WARNING: exit code 1 from a shell command.

ERROR: Logfile of failure stored in:
/srv/oe/build/tmp-rpb-glibc/work/imx7s_warp-linaro-linux-gnueabi/linux-fslc/5.4.46+gitAUTOINC+38d6c3525e-r0/temp/log.do_kernel_configme.7123
Log data follows:
| DEBUG: Executing python function extend_recipe_sysroot
| NOTE: Direct dependencies are
['virtual:native:/srv/oe/build/conf/../../layers/openembedded-core/meta/recipes-devtools/bison/bison_3.5.3.bb:do_populate_sysroot',
'/srv/oe/build/conf/../../layers/openembedded-core/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb:do_populate_sysroot',
'/srv/oe/build/conf/../../layers/openembedded-core/meta/recipes-devtools/binutils/binutils-cross_2.34.bb:do_populate_sysroot',
'/srv/oe/build/conf/../../layers/openembedded-core/meta/recipes-devtools/quilt/quilt-native_0.66.bb:do_populate_sysroot',
'virtual:native:/srv/oe/build/conf/../../layers/openembedded-core/meta/recipes-devtools/patch/patch_2.7.6.bb:do_populate_sysroot',
'virtual:native:/srv/oe/build/conf/../../layers/openembedded-core/meta/recipes-extended/bc/bc_1.07.1.bb:do_populate_sysroot',
'/srv/oe/build/conf/../../layers/meta-arm/meta-arm-toolchain/recipes-devtools/gcc/gcc-cross_arm-9.2.bb:do_populate_sysroot']
| NOTE: Installed into sysroot: []
| NOTE: Skipping as already exists in sysroot: ['bison-native',
'kern-tools-native', 'binutils-cross-arm', 'quilt-native',
'patch-native', 'bc-native', 'gcc-cross-arm', 'flex-native',
'texinfo-dummy-native', 'gnu-config-native', 'readline-native',
'libtool-native', 'automake-native', 'autoconf-native', 'xz-native',
'linux-libc-headers', 'gmp-native', 'libmpc-native', 'mpfr-native',
'zlib-native', 'gettext-minimal-native', 'attr-native', 'm4-native',
'ncurses-native', 'pkgconfig-native']
| DEBUG: Python function extend_recipe_sysroot finished
| DEBUG: Executing shell function do_kernel_configme
| WARNING: exit code 1 from a shell command.
| ERROR: Execution of
'/srv/oe/build/tmp-rpb-glibc/work/imx7s_warp-linaro-linux-gnueabi/linux-fslc/5.4.46+gitAUTOINC+38d6c3525e-r0/temp/run.do_kernel_configme.7123'
failed with exit code 1:
| WARNING: exit code 1 from a shell command.
|
NOTE: recipe linux-fslc-5.4.46+gitAUTOINC+38d6c3525e-r0: task
do_kernel_configme: Failed
ERROR: Task 
(/srv/oe/build/conf/../../layers/meta-freescale/recipes-kernel/linux/linux-fslc_5.4.bb:do_kernel_configme)
failed with exit code '1'



On Mon, 6 Jul 2020 at 17:38, Steve Sakoman  wrote:

> On Mon, Jul 6, 2020 at 6:29 AM Bruce Ashfield 
> wrote:
> >
> > We have a fixup patch for this one in test right now, so we don't want
> > this patch, without the follow up.
> >
> > But this is useful for dunfell, since it was an unexpected behaviour
> > that needed to be fixed.
>
> Thanks, I'll drop this patch from the pull request and include it
> along with the fixup patch in next week's patch set.
>
> Steve
>
> > On Mon, Jul 6, 2020 at 12:11 PM Steve Sakoman  wrote:
> > >
> > > From: Bruce Ashfield 
> > >
> > > It is uncommon that a BSP definition and a defconfig are used in
> > > a single configuration. That being said, it is a valid way to
> > > organize kernel configuration meta data.
> > >
> > > When a defconfig is used, either on the src_uri or from in
> > > the kernel tree, it is normally expected that it is the baseline,
> > > with all options applied on top of it.
> > >
> > > With this commit, we detect either type of defconfig and ensure
> > > that it is used first, followed by the fragments in their
> > > previous order. This allows existing configuration stacks to
> > > remain the same, while ensuring that a defconfig combined stack
> > > works as expected.
> > >
> > > Signed-off-by: Bruce Ashfield 
> > > Signed-off-by: Richard Purdie 
> > > (cherry picked from commit e6845327b69396d843a2f3c4c3ac9400ae9caedf)
> > > Signed-off-by: Steve Sakoman 
> > > ---
> > >  meta/classes/kernel-yocto.bbclass | 33 ---
> > >  1 file changed, 21 insertions(+), 12 deletions(-)
> > >
> > > diff --git a/meta/classes/kernel-yocto.bbclass
> b/meta/classes/kernel-yocto.bbclass
> > > index 5bc627066e..41d8620e67 100644
> > > --- a/meta/classes/kernel-yocto.bbclass
> > > +++ b/meta/classes/kernel-yocto.bbclass
> > > @@ -131,7 +131,7 @@ do_kernel_metadata() {
> > >

Re: [OE-core] [PATCH] gcc-10.1: add fix for PR 96130

2020-07-22 Thread Khem Raj
I am fine with this fix backported to master and perhaps dunfell too.

On Wed, Jul 22, 2020 at 4:08 AM Nicolas Dechesne
 wrote:
>
> Khem, Richard,
>
> On Fri, Jul 17, 2020 at 12:36 AM Dmitry Baryshkov  
> wrote:
> >
> > From: Dmitry Baryshkov 
> >
> > Fix for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96130 causing ICE
> > (SegFault) when compiling current Mesa git tree.
>
> This fixes the build issue reported when trying to build mesa master
> branch, see:
> https://github.com/ndechesne/meta-qcom/pull/174
>
> While we aren't using mesa/master in OE core, some BSP layer might be
> doing that. If mesa gets released before gcc, we might hit this issue.
> The gcc is queued for 10.2 already. If we can't get this patch in OE
> core, we will host in our layer..
>
> >
> > Signed-off-by: Dmitry Baryshkov 
> > ---
> >  meta/recipes-devtools/gcc/gcc-10.1.inc|   1 +
> >  .../gcc/gcc-10.1/pr96130.patch| 106 ++
> >  2 files changed, 107 insertions(+)
> >  create mode 100644 meta/recipes-devtools/gcc/gcc-10.1/pr96130.patch
> >
> > diff --git a/meta/recipes-devtools/gcc/gcc-10.1.inc 
> > b/meta/recipes-devtools/gcc/gcc-10.1.inc
> > index a3de91a2c6a3..a2dd2ae252a5 100644
> > --- a/meta/recipes-devtools/gcc/gcc-10.1.inc
> > +++ b/meta/recipes-devtools/gcc/gcc-10.1.inc
> > @@ -66,6 +66,7 @@ SRC_URI = "\
> > file://0036-Enable-CET-in-cross-compiler-if-possible.patch \
> > file://0037-mingw32-Enable-operation_not_supported.patch \
> > file://0038-libatomic-Do-not-enforce-march-on-aarch64.patch \
> > +   file://pr96130.patch \
> >  "
> >  SRC_URI[sha256sum] = 
> > "b6898a23844b656f1b68691c5c012036c2e694ac4b53a8918d4712ad876e7ea2"
> >
> > diff --git a/meta/recipes-devtools/gcc/gcc-10.1/pr96130.patch 
> > b/meta/recipes-devtools/gcc/gcc-10.1/pr96130.patch
> > new file mode 100644
> > index ..f0e6f85e22f9
> > --- /dev/null
> > +++ b/meta/recipes-devtools/gcc/gcc-10.1/pr96130.patch
> > @@ -0,0 +1,106 @@
> > +From 0d03c0ee5213703ec6d9ffa632fa5298d83adaaa Mon Sep 17 00:00:00 2001
> > +From: Jakub Jelinek 
> > +Date: Mon, 13 Jul 2020 18:25:53 +0200
> > +Subject: [PATCH] ipa-fnsummary: Fix ICE with switch predicates [PR96130]
> > +
> > +The following testcase ICEs since r10-3199.
> > +There is a switch with default label, where the controlling expression has
> > +range just 0..7 and there are case labels for all those 8 values, but
> > +nothing has yet optimized away the default.
> > +Since r10-3199, set_switch_stmt_execution_predicate sets the switch to
> > +default label's edge's predicate to a false predicate and then
> > +compute_bb_predicates propagates the predicates through the cfg, but false
> > +predicates aren't really added.  The caller of compute_bb_predicates
> > +in one place handles NULL bb->aux as false predicate:
> > +  if (fbi.info)
> > +   {
> > + if (bb->aux)
> > +   bb_predicate = *(predicate *) bb->aux;
> > + else
> > +   bb_predicate = false;
> > +   }
> > +  else
> > +   bb_predicate = true;
> > +but then in two further spots that the patch below is changing
> > +it assumes bb->aux must be non-NULL.  Those two spots are guarded by a
> > +condition that is only true if fbi.info is non-NULL, so I think the right
> > +fix is to treat NULL aux as false predicate in those spots too.
> > +
> > +2020-07-13  Jakub Jelinek  
> > +
> > +   PR ipa/96130
> > +   * ipa-fnsummary.c (analyze_function_body): Treat NULL bb->aux
> > +   as false predicate.
> > +
> > +   * gcc.dg/torture/pr96130.c: New test.
> > +
> > +(cherry picked from commit 776e48e0931db69f158f40e5cb8e15463d879a42)
> > +---
> > + gcc/ipa-fnsummary.c| 10 --
> > + gcc/testsuite/gcc.dg/torture/pr96130.c | 26 ++
> > + 2 files changed, 34 insertions(+), 2 deletions(-)
> > + create mode 100644 gcc/testsuite/gcc.dg/torture/pr96130.c
> > +
> > +diff --git a/gcc/ipa-fnsummary.c b/gcc/ipa-fnsummary.c
> > +index 045a0ecf766..55a0b272a96 100644
> > +--- a/gcc/ipa-fnsummary.c
> >  b/gcc/ipa-fnsummary.c
> > +@@ -2766,7 +2766,10 @@ analyze_function_body (struct cgraph_node *node, 
> > bool early)
> > + edge ex;
> > + unsigned int j;
> > + class tree_niter_desc niter_desc;
> > +-bb_predicate = *(predicate *) loop->header->aux;
> > ++if (loop->header->aux)
> > ++  bb_predicate = *(predicate *) loop->header->aux;
> > ++else
> > ++  bb_predicate = false;
> > +
> > + exits = get_loop_exit_edges (loop);
> > + FOR_EACH_VEC_ELT (exits, j, ex)
> > +@@ -2799,7 +2802,10 @@ analyze_function_body (struct cgraph_node *node, 
> > bool early)
> > + for (unsigned i = 0; i < loop->num_nodes; i++)
> > +   {
> > + gimple_stmt_iterator gsi;
> > +-bb_predicate = *(predicate *) body[i]->aux;
> > ++if (body[i]->aux)
> > ++  bb_predicate

[oe-core][PATCH 1/1] libdnf: allow reproducible binary builds

2020-07-22 Thread Joe Slater
Use a static TESTDATADIR if tests are disabled.  Allow
override of TESTDATADIR if tests are enabled since the
default will be wrong for target builds.

Signed-off-by: Joe Slater 
---
 .../libdnf/libdnf/enable_test_data_dir_set.patch   | 26 ++
 meta/recipes-devtools/libdnf/libdnf_0.48.0.bb  |  1 +
 2 files changed, 27 insertions(+)
 create mode 100644 
meta/recipes-devtools/libdnf/libdnf/enable_test_data_dir_set.patch

diff --git a/meta/recipes-devtools/libdnf/libdnf/enable_test_data_dir_set.patch 
b/meta/recipes-devtools/libdnf/libdnf/enable_test_data_dir_set.patch
new file mode 100644
index 000..e3784cc
--- /dev/null
+++ b/meta/recipes-devtools/libdnf/libdnf/enable_test_data_dir_set.patch
@@ -0,0 +1,26 @@
+libdnf: allow reproducible binary builds
+
+Use a dummy directory for test data if not built WITH_TESTS.  Allow for 
overriding
+TESTDATADIR, since the default is guaranteed to be wrong for target builds.
+
+Upstream-Status: Pending
+
+Signed-off-by: Joe Slater 
+
+
+--- a/CMakeLists.txt
 b/CMakeLists.txt
+@@ -133,7 +133,12 @@ add_definitions(-DG_LOG_DOMAIN=\\"libdnf
+ add_definitions(-D_FILE_OFFSET_BITS=64)
+ 
+ # tests
+-add_definitions(-DTESTDATADIR=\\"${CMAKE_SOURCE_DIR}/data/tests\\")
++if(NOT WITH_TESTS)
++  set(TEST_DATA_DIR "/notests")
++elseif(NOT DEFINED TEST_DATA_DIR)
++  set(TEST_DATA_DIR "${CMAKE_SOURCE_DIR}/data/tests")
++endif()
++add_definitions(-DTESTDATADIR=\\"${TEST_DATA_DIR}\\")
+ 
+ # librhsm
+ if(ENABLE_RHSM_SUPPORT)
diff --git a/meta/recipes-devtools/libdnf/libdnf_0.48.0.bb 
b/meta/recipes-devtools/libdnf/libdnf_0.48.0.bb
index 947b2f2..37991e6 100644
--- a/meta/recipes-devtools/libdnf/libdnf_0.48.0.bb
+++ b/meta/recipes-devtools/libdnf/libdnf_0.48.0.bb
@@ -8,6 +8,7 @@ SRC_URI = 
"git://github.com/rpm-software-management/libdnf;branch=dnf-4-master \

file://0001-Get-parameters-for-both-libsolv-and-libsolvext-libdn.patch \
file://0001-Add-WITH_TESTS-option.patch \

file://0001-Look-fo-sphinx-only-if-documentation-is-actually-ena.patch \
+   file://enable_test_data_dir_set.patch \
"
 
 SRCREV = "46a28d0cf09277fffc11392e5e362a2eda0d53a8"
-- 
2.7.4

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#140875): 
https://lists.openembedded.org/g/openembedded-core/message/140875
Mute This Topic: https://lists.openembedded.org/mt/75733268/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


[OE-core] [PATCHv3] net-tools: upgrade to latest revision in upstream repo instead of old debian snapshot

2020-07-22 Thread Martin Jansa
* debian switched to upstream snapshot as well in 2015:
  net-tools (1.60+git20150829.73cef8a-1) unstable; urgency=medium

  * After 14 years without an upstream release, I am producing a new package
based on today's upstream repository.
Closes: #391495, #486448, #323261, #260587, #545328, #511395.
  * Remove many patches now merged upstream, delete unmaintainable and
undocumented local changes, and update the rest.

 -- Martín Ferrari   Mon, 07 Sep 2015 01:54:07 +

* this allows dropping nettools_do_patch task and other weird parts of the 
recipe

* LIC_FILES_CHKSUM change is caused by formatting changes in:
  d613e1d Updated COPYING file.

* patches now included in upstream:
  0001-added-ull-prefix-to-unsigned-long-long-constants-to-.patch
  eb04ef3 added 'ull' prefix to unsigned long long constants to make gcc 3.3 
happy

  ifconfig-interface-0-del-IP-will-remove-the-aliased-.patch
  81814dc ifconfig interface:0 del  will remove the aliased IP on IA64

  musl-fixes.patch (only lib/inet_sr.c and netstat.c chunks weren't applied, but
  maybe not needed anymore)
  86b2c77 Remove support for IPV6 with libc5 and glibc 2.0
  ecae4b3 lib/util-ank: Include  for UINT_MAX
  c35607e Remove inconsistent conditional includes for libc5 and glibc 2.0

  net-tools-1.60-sctp1.patch
  net-tools-1.60-sctp2-quiet.patch
  net-tools-1.60-sctp3-addrs.patch
  7af4859 netstat: update SCTP support
  3bbfa09 statistics: add SCTP support
  4932915 Add netstat -S/--sctp parameter into help and manpages
  8306063 netstat: add sctp connection decoding (Debian #306428 and Gentoo 
#258714)

  0001-lib-inet6.c-INET6_rresolve-various-fixes.patch
  a70c568 lib/inet6.c:INET6_rresolve() - various fixes

  net-tools-fix-building-with-linux-4.8.patch
  ea3935b iptunnel: fix building w/older linux headers
  45d573a iptunnel: drop netinet/ip.h include

* add 3 new patches from debian

* add PACKAGECONFIG for parts which are now optional since:
  
https://salsa.debian.org/debian/net-tools/-/commit/939123848205c8745542c2052b2c53de49461f4b
  
https://salsa.debian.org/debian/net-tools/-/commit/fbc11bb9cfb5acb4b3c3b24a57c02f2b2338c656
  
https://salsa.debian.org/debian/net-tools/-/commit/bd8bceaed2311651710331a7f8990c3e31be9840
  but unlike debian, keep building them to limit the changes from this upgrade

* ifconfig and route were moved from sbin to bin adjust u-a accordingly

* debian changelog:
net-tools (1.60+git20180626.aebd88e-1) unstable; urgency=medium

  * New upstream snapshot
  * Refresh patches.
  * Fix typos in German manpages. Thanks to Prof. Dr. Steffen Wendzel and
Dr. Tobias Quathamer for the patch. Closes: #900962.

 -- Martín Ferrari   Mon, 24 Sep 2018 19:08:57 +

net-tools (1.60+git20161116.90da8a0-4) unstable; urgency=medium

  * Update maintainer email address. Closes: #899617.
  * Update Standards-Version with no changes.

 -- Martín Ferrari   Mon, 24 Sep 2018 17:16:31 +

net-tools (1.60+git20161116.90da8a0-3) unstable; urgency=medium

  * debian/control: Update Vcs-* and Standards-Version.
  * debian/control: remove references to ancient package ja-trans.
  * debian/gbp.conf: Update repo layout.

 -- Martín Ferrari   Tue, 31 Jul 2018 19:09:00 +

net-tools (1.60+git20161116.90da8a0-2) unstable; urgency=medium

  * Fix typo in French manpage. Thanks to  Michel Grigaut for the patch.
  * Add manpage for iptunnel, thanks to Sergio Durigan Junior.
Closes: #88910
  * Rename patches so CME does not choke on them.
  * Automated cme fixes; packaging improvements.
  * Remove unused and ancient patch.

 -- Martín Ferrari   Sun, 11 Feb 2018 17:29:24 +

net-tools (1.60+git20161116.90da8a0-1) unstable; urgency=medium

  * New upstream snapshot.
  * Re-synced translations.patch.
  * Acknowledge NMUs. Thanks a lot to Andrey Rahmatullin for the
fixes and uploads. Closes: 846509.
  * Fix FTCBFS, thanks to Helmut Grohne for the patch. Closes: #811561.
+ Really assign CC for cross compilation.
+ Use triplet prefixed pkg-config.
  * Add debian/NEWS warning about changing output in net-tools commands.
Closing bugs that reported problems in 3rd-party scripts arising from these
changes.  Closes: #845153, #843892, #820212.
  * Update Standards-Version, with no changes.

 -- Martín Ferrari   Mon, 26 Dec 2016 05:58:42 +

net-tools (1.60+git20150829.73cef8a-2.2) unstable; urgency=medium

  * Non-maintainer upload.
  * Apply an additional fix for the previous FTBFS for some architectures.

 -- Andrey Rahmatullin   Thu, 01 Dec 2016 22:49:27 +0500

net-tools (1.60+git20150829.73cef8a-2.1) unstable; urgency=medium

  * Non-maintainer upload.
  * Fix FTBFS by applying the upstream patch (Closes: #844073).

 -- Andrey Rahmatullin   Sun, 20 Nov 2016 15:23:12 +0500

net-tools (1.60+git20150829.73cef8a-2) unstable; urgency=medium

  [ Laurent Bigonville ]
  * Enable SELinux support. Closes: #666204.

  [ Martín Ferrari ]
  * Mark the package "Multi-Arch: foreign", thanks to Frédéric Brière
. Clos

[OE-core] [PATCH] ltp: remove --with-power-management-testsuite from EXTRA_OECONF

2020-07-22 Thread Matthew
Commit [b74bbed51b0c0d44b70b136326a8a23cbc64db01 power_management:
compile testcases/kernel/power_management by default] from ltp upstream
removed --with-power-management-testsuite option, it's on by default.

Signed-off-by: Mingde (Matthew) Zeng 
---
 meta/recipes-extended/ltp/ltp_20200515.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-extended/ltp/ltp_20200515.bb 
b/meta/recipes-extended/ltp/ltp_20200515.bb
index b283add12f..ece3acf0f9 100644
--- a/meta/recipes-extended/ltp/ltp_20200515.bb
+++ b/meta/recipes-extended/ltp/ltp_20200515.bb
@@ -50,7 +50,7 @@ export exec_prefix = "/opt/${PN}"
 
 PACKAGECONFIG[numa] = "--with-numa, --without-numa, numactl,"
 EXTRA_AUTORECONF += "-I ${S}/testcases/realtime/m4"
-EXTRA_OECONF = " --with-power-management-testsuite --with-realtime-testsuite 
--with-open-posix-testsuite "
+EXTRA_OECONF = " --with-realtime-testsuite --with-open-posix-testsuite "
 # ltp network/rpc test cases ftbfs when libtirpc is found
 EXTRA_OECONF += " --without-tirpc "
 
-- 
2.27.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#140873): 
https://lists.openembedded.org/g/openembedded-core/message/140873
Mute This Topic: https://lists.openembedded.org/mt/75732146/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 net-tools: upgrade to latest revision in upstream repo instead of old debian snapshot

2020-07-22 Thread Patchwork
== Series Details ==

Series: net-tools: upgrade to latest revision in upstream repo instead of old 
debian snapshot
Revision: 1
URL   : https://patchwork.openembedded.org/series/25236/
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 A patch file has been added, but does not have a 
Signed-off-by tag [test_signed_off_by_presence] 
  Suggested fixSign off the added patch file 
(meta/recipes-extended/net-tools/net-tools/Add_missing_headers.patch)

* Issue Added patch file is missing Upstream-Status in the header 
[test_upstream_status_presence_format] 
  Suggested fixAdd Upstream-Status:  to the header of 
meta/recipes-extended/net-tools/net-tools/Add_missing_headers.patch
  Standard format  Upstream-Status: 
  Valid status Pending, Accepted, Backport, Denied, Inappropriate [reason], 
Submitted [where]



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 (#140871): 
https://lists.openembedded.org/g/openembedded-core/message/140871
Mute This Topic: https://lists.openembedded.org/mt/75731464/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


[OE-core] [PATCHv2] net-tools: upgrade to latest revision in upstream repo instead of old debian snapshot

2020-07-22 Thread Martin Jansa
* debian switched to upstream snapshot as well in 2015:
  net-tools (1.60+git20150829.73cef8a-1) unstable; urgency=medium

  * After 14 years without an upstream release, I am producing a new package
based on today's upstream repository.
Closes: #391495, #486448, #323261, #260587, #545328, #511395.
  * Remove many patches now merged upstream, delete unmaintainable and
undocumented local changes, and update the rest.

 -- Martín Ferrari   Mon, 07 Sep 2015 01:54:07 +

* this allows dropping nettools_do_patch task and other weird parts of the 
recipe

* LIC_FILES_CHKSUM change is caused by formatting changes in:
  d613e1d Updated COPYING file.

* patches now included in upstream:
  0001-added-ull-prefix-to-unsigned-long-long-constants-to-.patch
  eb04ef3 added 'ull' prefix to unsigned long long constants to make gcc 3.3 
happy

  ifconfig-interface-0-del-IP-will-remove-the-aliased-.patch
  81814dc ifconfig interface:0 del  will remove the aliased IP on IA64

  musl-fixes.patch (only lib/inet_sr.c and netstat.c chunks weren't applied, but
  maybe not needed anymore)
  86b2c77 Remove support for IPV6 with libc5 and glibc 2.0
  ecae4b3 lib/util-ank: Include  for UINT_MAX
  c35607e Remove inconsistent conditional includes for libc5 and glibc 2.0

  net-tools-1.60-sctp1.patch
  net-tools-1.60-sctp2-quiet.patch
  net-tools-1.60-sctp3-addrs.patch
  7af4859 netstat: update SCTP support
  3bbfa09 statistics: add SCTP support
  4932915 Add netstat -S/--sctp parameter into help and manpages
  8306063 netstat: add sctp connection decoding (Debian #306428 and Gentoo 
#258714)

  0001-lib-inet6.c-INET6_rresolve-various-fixes.patch
  a70c568 lib/inet6.c:INET6_rresolve() - various fixes

  net-tools-fix-building-with-linux-4.8.patch
  ea3935b iptunnel: fix building w/older linux headers
  45d573a iptunnel: drop netinet/ip.h include

* add 3 new patches from debian

* add PACKAGECONFIG for parts which are now optional since:
  
https://salsa.debian.org/debian/net-tools/-/commit/939123848205c8745542c2052b2c53de49461f4b
  
https://salsa.debian.org/debian/net-tools/-/commit/fbc11bb9cfb5acb4b3c3b24a57c02f2b2338c656
  
https://salsa.debian.org/debian/net-tools/-/commit/bd8bceaed2311651710331a7f8990c3e31be9840
  but unlike debian, keep building them to limit the changes from this upgrade

* ifconfig and route were moved from sbin to bin adjust u-a accordingly

* debian changelog:
net-tools (1.60+git20180626.aebd88e-1) unstable; urgency=medium

  * New upstream snapshot
  * Refresh patches.
  * Fix typos in German manpages. Thanks to Prof. Dr. Steffen Wendzel and
Dr. Tobias Quathamer for the patch. Closes: #900962.

 -- Martín Ferrari   Mon, 24 Sep 2018 19:08:57 +

net-tools (1.60+git20161116.90da8a0-4) unstable; urgency=medium

  * Update maintainer email address. Closes: #899617.
  * Update Standards-Version with no changes.

 -- Martín Ferrari   Mon, 24 Sep 2018 17:16:31 +

net-tools (1.60+git20161116.90da8a0-3) unstable; urgency=medium

  * debian/control: Update Vcs-* and Standards-Version.
  * debian/control: remove references to ancient package ja-trans.
  * debian/gbp.conf: Update repo layout.

 -- Martín Ferrari   Tue, 31 Jul 2018 19:09:00 +

net-tools (1.60+git20161116.90da8a0-2) unstable; urgency=medium

  * Fix typo in French manpage. Thanks to  Michel Grigaut for the patch.
  * Add manpage for iptunnel, thanks to Sergio Durigan Junior.
Closes: #88910
  * Rename patches so CME does not choke on them.
  * Automated cme fixes; packaging improvements.
  * Remove unused and ancient patch.

 -- Martín Ferrari   Sun, 11 Feb 2018 17:29:24 +

net-tools (1.60+git20161116.90da8a0-1) unstable; urgency=medium

  * New upstream snapshot.
  * Re-synced translations.patch.
  * Acknowledge NMUs. Thanks a lot to Andrey Rahmatullin for the
fixes and uploads. Closes: 846509.
  * Fix FTCBFS, thanks to Helmut Grohne for the patch. Closes: #811561.
+ Really assign CC for cross compilation.
+ Use triplet prefixed pkg-config.
  * Add debian/NEWS warning about changing output in net-tools commands.
Closing bugs that reported problems in 3rd-party scripts arising from these
changes.  Closes: #845153, #843892, #820212.
  * Update Standards-Version, with no changes.

 -- Martín Ferrari   Mon, 26 Dec 2016 05:58:42 +

net-tools (1.60+git20150829.73cef8a-2.2) unstable; urgency=medium

  * Non-maintainer upload.
  * Apply an additional fix for the previous FTBFS for some architectures.

 -- Andrey Rahmatullin   Thu, 01 Dec 2016 22:49:27 +0500

net-tools (1.60+git20150829.73cef8a-2.1) unstable; urgency=medium

  * Non-maintainer upload.
  * Fix FTBFS by applying the upstream patch (Closes: #844073).

 -- Andrey Rahmatullin   Sun, 20 Nov 2016 15:23:12 +0500

net-tools (1.60+git20150829.73cef8a-2) unstable; urgency=medium

  [ Laurent Bigonville ]
  * Enable SELinux support. Closes: #666204.

  [ Martín Ferrari ]
  * Mark the package "Multi-Arch: foreign", thanks to Frédéric Brière
. Clos

[OE-core] [PATCH] net-tools: upgrade to latest revision in upstream repo instead of old debian snapshot

2020-07-22 Thread Martin Jansa
* debian switched to upstream snapshot as well in 2015:
  net-tools (1.60+git20150829.73cef8a-1) unstable; urgency=medium

  * After 14 years without an upstream release, I am producing a new package
based on today's upstream repository.
Closes: #391495, #486448, #323261, #260587, #545328, #511395.
  * Remove many patches now merged upstream, delete unmaintainable and
undocumented local changes, and update the rest.

 -- Martín Ferrari   Mon, 07 Sep 2015 01:54:07 +

* this allows dropping nettools_do_patch task and other weird parts of the 
recipe

* LIC_FILES_CHKSUM change is caused by formatting changes in:
  d613e1d Updated COPYING file.

* patches now included in upstream:
  0001-added-ull-prefix-to-unsigned-long-long-constants-to-.patch
  eb04ef3 added 'ull' prefix to unsigned long long constants to make gcc 3.3 
happy

  ifconfig-interface-0-del-IP-will-remove-the-aliased-.patch
  81814dc ifconfig interface:0 del  will remove the aliased IP on IA64

  musl-fixes.patch (only lib/inet_sr.c and netstat.c chunks weren't applied, but
  maybe not needed anymore)
  86b2c77 Remove support for IPV6 with libc5 and glibc 2.0
  ecae4b3 lib/util-ank: Include  for UINT_MAX
  c35607e Remove inconsistent conditional includes for libc5 and glibc 2.0

  net-tools-1.60-sctp1.patch
  net-tools-1.60-sctp2-quiet.patch
  net-tools-1.60-sctp3-addrs.patch
  7af4859 netstat: update SCTP support
  3bbfa09 statistics: add SCTP support
  4932915 Add netstat -S/--sctp parameter into help and manpages
  8306063 netstat: add sctp connection decoding (Debian #306428 and Gentoo 
#258714)

  0001-lib-inet6.c-INET6_rresolve-various-fixes.patch
  a70c568 lib/inet6.c:INET6_rresolve() - various fixes

  net-tools-fix-building-with-linux-4.8.patch
  ea3935b iptunnel: fix building w/older linux headers
  45d573a iptunnel: drop netinet/ip.h include

* add 3 new patches from debian

* add PACKAGECONFIG for parts which are now optional since:
  
https://salsa.debian.org/debian/net-tools/-/commit/939123848205c8745542c2052b2c53de49461f4b
  
https://salsa.debian.org/debian/net-tools/-/commit/fbc11bb9cfb5acb4b3c3b24a57c02f2b2338c656
  
https://salsa.debian.org/debian/net-tools/-/commit/bd8bceaed2311651710331a7f8990c3e31be9840
  but unlike debian, keep building them to limit the changes from this upgrade

* ifconfig and route were moved from sbin to bin adjust u-a accordingly

* debian changelog:
net-tools (1.60+git20180626.aebd88e-1) unstable; urgency=medium

  * New upstream snapshot
  * Refresh patches.
  * Fix typos in German manpages. Thanks to Prof. Dr. Steffen Wendzel and
Dr. Tobias Quathamer for the patch. Closes: #900962.

 -- Martín Ferrari   Mon, 24 Sep 2018 19:08:57 +

net-tools (1.60+git20161116.90da8a0-4) unstable; urgency=medium

  * Update maintainer email address. Closes: #899617.
  * Update Standards-Version with no changes.

 -- Martín Ferrari   Mon, 24 Sep 2018 17:16:31 +

net-tools (1.60+git20161116.90da8a0-3) unstable; urgency=medium

  * debian/control: Update Vcs-* and Standards-Version.
  * debian/control: remove references to ancient package ja-trans.
  * debian/gbp.conf: Update repo layout.

 -- Martín Ferrari   Tue, 31 Jul 2018 19:09:00 +

net-tools (1.60+git20161116.90da8a0-2) unstable; urgency=medium

  * Fix typo in French manpage. Thanks to  Michel Grigaut for the patch.
  * Add manpage for iptunnel, thanks to Sergio Durigan Junior.
Closes: #88910
  * Rename patches so CME does not choke on them.
  * Automated cme fixes; packaging improvements.
  * Remove unused and ancient patch.

 -- Martín Ferrari   Sun, 11 Feb 2018 17:29:24 +

net-tools (1.60+git20161116.90da8a0-1) unstable; urgency=medium

  * New upstream snapshot.
  * Re-synced translations.patch.
  * Acknowledge NMUs. Thanks a lot to Andrey Rahmatullin for the
fixes and uploads. Closes: 846509.
  * Fix FTCBFS, thanks to Helmut Grohne for the patch. Closes: #811561.
+ Really assign CC for cross compilation.
+ Use triplet prefixed pkg-config.
  * Add debian/NEWS warning about changing output in net-tools commands.
Closing bugs that reported problems in 3rd-party scripts arising from these
changes.  Closes: #845153, #843892, #820212.
  * Update Standards-Version, with no changes.

 -- Martín Ferrari   Mon, 26 Dec 2016 05:58:42 +

net-tools (1.60+git20150829.73cef8a-2.2) unstable; urgency=medium

  * Non-maintainer upload.
  * Apply an additional fix for the previous FTBFS for some architectures.

 -- Andrey Rahmatullin   Thu, 01 Dec 2016 22:49:27 +0500

net-tools (1.60+git20150829.73cef8a-2.1) unstable; urgency=medium

  * Non-maintainer upload.
  * Fix FTBFS by applying the upstream patch (Closes: #844073).

 -- Andrey Rahmatullin   Sun, 20 Nov 2016 15:23:12 +0500

net-tools (1.60+git20150829.73cef8a-2) unstable; urgency=medium

  [ Laurent Bigonville ]
  * Enable SELinux support. Closes: #666204.

  [ Martín Ferrari ]
  * Mark the package "Multi-Arch: foreign", thanks to Frédéric Brière
. Clos

[OE-core] [PATCH v2] gcc: mitigate the Straight-line Speculation attack

2020-07-22 Thread Ross Burton
From: Ross Burton 

Straight-line Speculation is a SPECTRE-like attack on Armv8-A, further
details can be found in the white paper here:

https://developer.arm.com/support/arm-security-updates/speculative-processor-vulnerability/downloads/straight-line-speculation

Backport the GCC patches to mitigate the attack.

CVE: CVE-2020-13844
Signed-off-by: Ross Burton 
---
 meta/recipes-devtools/gcc/gcc-10.1.inc|   3 +
 ...ight-Line-Speculation-SLS-mitigation.patch | 202 ++
 ...e-SLS-mitigation-for-RET-and-BR-inst.patch | 607 
 ...h64-Mitigate-SLS-for-BLR-instruction.patch | 658 ++
 4 files changed, 1470 insertions(+)
 create mode 100644 
meta/recipes-devtools/gcc/gcc-10.1/0001-aarch64-New-Straight-Line-Speculation-SLS-mitigation.patch
 create mode 100644 
meta/recipes-devtools/gcc/gcc-10.1/0002-aarch64-Introduce-SLS-mitigation-for-RET-and-BR-inst.patch
 create mode 100644 
meta/recipes-devtools/gcc/gcc-10.1/0003-aarch64-Mitigate-SLS-for-BLR-instruction.patch

diff --git a/meta/recipes-devtools/gcc/gcc-10.1.inc 
b/meta/recipes-devtools/gcc/gcc-10.1.inc
index a3de91a2c6..7c1201a2e3 100644
--- a/meta/recipes-devtools/gcc/gcc-10.1.inc
+++ b/meta/recipes-devtools/gcc/gcc-10.1.inc
@@ -66,6 +66,9 @@ SRC_URI = "\
file://0036-Enable-CET-in-cross-compiler-if-possible.patch \
file://0037-mingw32-Enable-operation_not_supported.patch \
file://0038-libatomic-Do-not-enforce-march-on-aarch64.patch \
+   
file://0001-aarch64-New-Straight-Line-Speculation-SLS-mitigation.patch \
+   
file://0002-aarch64-Introduce-SLS-mitigation-for-RET-and-BR-inst.patch \
+   file://0003-aarch64-Mitigate-SLS-for-BLR-instruction.patch \
 "
 SRC_URI[sha256sum] = 
"b6898a23844b656f1b68691c5c012036c2e694ac4b53a8918d4712ad876e7ea2"
 
diff --git 
a/meta/recipes-devtools/gcc/gcc-10.1/0001-aarch64-New-Straight-Line-Speculation-SLS-mitigation.patch
 
b/meta/recipes-devtools/gcc/gcc-10.1/0001-aarch64-New-Straight-Line-Speculation-SLS-mitigation.patch
new file mode 100644
index 00..73de4c7590
--- /dev/null
+++ 
b/meta/recipes-devtools/gcc/gcc-10.1/0001-aarch64-New-Straight-Line-Speculation-SLS-mitigation.patch
@@ -0,0 +1,202 @@
+CVE: CVE-2020-13844
+Upstream-Status: Backport
+Signed-off-by: Ross Burton 
+
+From 1ff243934ac443b5f58cd02a5012ce58ecc31fb2 Mon Sep 17 00:00:00 2001
+From: Matthew Malcomson 
+Date: Thu, 9 Jul 2020 09:11:58 +0100
+Subject: [PATCH 1/3] aarch64: New Straight Line Speculation (SLS) mitigation
+ flags
+
+Here we introduce the flags that will be used for straight line speculation.
+
+The new flag introduced is `-mharden-sls=`.
+This flag can take arguments of `none`, `all`, or a comma seperated list of one
+or more of `retbr` or `blr`.
+`none` indicates no special mitigation of the straight line speculation
+vulnerability.
+`all` requests all mitigations currently implemented.
+`retbr` requests that the RET and BR instructions have a speculation barrier
+inserted after them.
+`blr` requests that BLR instructions are replaced by a BL to a function stub
+using a BR with a speculation barrier after it.
+
+Setting this on a per-function basis using attributes or the like is not
+enabled, but may be in the future.
+
+gcc/ChangeLog:
+
+2020-06-02  Matthew Malcomson  
+
+   * config/aarch64/aarch64-protos.h (aarch64_harden_sls_retbr_p):
+   New.
+   (aarch64_harden_sls_blr_p): New.
+   * config/aarch64/aarch64.c (enum aarch64_sls_hardening_type):
+   New.
+   (aarch64_harden_sls_retbr_p): New.
+   (aarch64_harden_sls_blr_p): New.
+   (aarch64_validate_sls_mitigation): New.
+   (aarch64_override_options): Parse options for SLS mitigation.
+   * config/aarch64/aarch64.opt (-mharden-sls): New option.
+   * doc/invoke.texi: Document new option.
+---
+ gcc/config/aarch64/aarch64-protos.h |  3 ++
+ gcc/config/aarch64/aarch64.c| 76 +
+ gcc/config/aarch64/aarch64.opt  |  4 ++
+ gcc/doc/invoke.texi | 12 ++
+ 4 files changed, 95 insertions(+)
+
+diff --git a/gcc/config/aarch64/aarch64-protos.h 
b/gcc/config/aarch64/aarch64-protos.h
+index 723d9ba..eb5f4b4 100644
+--- a/gcc/config/aarch64/aarch64-protos.h
 b/gcc/config/aarch64/aarch64-protos.h
+@@ -781,4 +781,7 @@ extern const atomic_ool_names aarch64_ool_ldeor_names;
+ 
+ tree aarch64_resolve_overloaded_builtin_general (location_t, tree, void *);
+ 
++extern bool aarch64_harden_sls_retbr_p (void);
++extern bool aarch64_harden_sls_blr_p (void);
++
+ #endif /* GCC_AARCH64_PROTOS_H */
+diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
+index b86434a..437a9cf 100644
+--- a/gcc/config/aarch64/aarch64.c
 b/gcc/config/aarch64/aarch64.c
+@@ -14494,6 +14494,79 @@ aarch64_validate_mcpu (const char *str, const struct 
processor **res,
+   return false;
+ }
+ 
++/* Straight line speculation indicators.  */
++enum aarch64_sls_hardening_type
++{
++  SLS_NONE = 0,
++  S

[OE-core] ✗ patchtest: failure for "[v5] package_manager: Move to ..." and 12 more

2020-07-22 Thread Patchwork
== Series Details ==

Series: "[v5] package_manager: Move to ..." and 12 more
Revision: 1
URL   : https://patchwork.openembedded.org/series/25233/
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:



* Patch[v5,01/13] package_manager: Move to 
package_manager/__init__.py
 Issue Patch is missing Signed-off-by [test_signed_off_by_presence] 
  Suggested fixSign off the patch (either manually or with "git commit 
--amend -s")



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 (#140868): 
https://lists.openembedded.org/g/openembedded-core/message/140868
Mute This Topic: https://lists.openembedded.org/mt/75725009/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 v4 01/12] Move rpm manifest to its own subdir

2020-07-22 Thread Fredrik Gustafsson
Hi Paul,
thank you for your review, I hope you're feeling better!
I think I've managed to fix all your comments.
Some imports was not possible to move to the top of the file but those
who where possible to move I've moved.

Please note that I'll be away from monday and four weeks forward. Please
don't take my silence then as a lack of interest. This has my highest priority.

Best regards
Fredrik

From: Paul Barker 
Sent: Saturday, July 18, 2020 5:29 PM
To: Fredrik Gustafsson
Cc: openembedded-core@lists.openembedded.org; tools-cfpbuild-internal; Richard 
Purdie
Subject: Re: [PATCH v4 01/12] Move rpm manifest to its own subdir

On Tue, 14 Jul 2020 at 08:02, Fredrik Gustafsson
 wrote:
>
> Thank you, just let me know if I can make it any easier to review this,
> I know it's a big patch.

Hi Fredrik,

Sorry for the delays here, I've been unable to get back to this until
today due to other commitments and a few health issues.

Here's my feedback on the series as a whole. Overall I think it's
excellent, I much prefer the result where the code is grouped by
package manager (opkg, dpkg or rpm) to the existing code where it's
spread across package_manager.py, rootfs.py, manifest.py and sdk.py.

1) Please edit the first line of each commit message to follow the
style guide at 
https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines.

2) Please also fix the following whitespace errors reported when
applying these patches:

$ git am ../v4-Move-rpm-manifest-to-its-...-and-11-more.mbox
Applying: Move rpm manifest to its own subdir
.git/rebase-apply/patch:148: new blank line at EOF.
+
warning: 1 line adds whitespace errors.
Applying: Move ipk manifest to its own subdir
.git/rebase-apply/patch:187: new blank line at EOF.
+
warning: 1 line adds whitespace errors.
Applying: Move deb manifest to its own subdir
Applying: Move rpm rootfs to its own dir
.git/rebase-apply/patch:161: new blank line at EOF.
+
warning: 1 line adds whitespace errors.
Applying: Move ipk rootfs to its own dir
Applying: Move deb rootfs to its own dir
.git/rebase-apply/patch:222: new blank line at EOF.
+
warning: 1 line adds whitespace errors.
Applying: Move rpm sdk to its own dir
.git/rebase-apply/patch:127: new blank line at EOF.
+
warning: 1 line adds whitespace errors.
Applying: Move ipk sdk to its own dir
.git/rebase-apply/patch:42: trailing whitespace.
self.d.getVar("ALL_MULTILIB_PACKAGE_ARCHS"),
.git/rebase-apply/patch:109: new blank line at EOF.
+
warning: 2 lines add whitespace errors.
Applying: Move deb sdk to its own dir
.git/rebase-apply/patch:108: new blank line at EOF.
+
warning: 1 line adds whitespace errors.
Applying: Move rpm package manager to its own dir
.git/rebase-apply/patch:840: new blank line at EOF.
+
warning: 1 line adds whitespace errors.
Applying: Move ipk package manager to its own dir
.git/rebase-apply/patch:951: new blank line at EOF.
+
warning: 1 line adds whitespace errors.
Applying: Move deb package manager to its own dir
.git/rebase-apply/patch:1042: new blank line at EOF.
+
warning: 1 line adds whitespace errors.

3) I'd recommend the new module keeps the name package_manager. You
can do this by moving the existing code into
package_manager/__init__.py and then splitting it up inside that
directory. Imports and wrappers in the __init__.py file can be used to
ensure no other bit of the code needs to worry about the changes.

4) Please avoid unnecessarily using imports inside functions. In
rootfs.py, manifest.py and sdk.py you can import the required classes
at the top level. Functions like create_rootfs(), populate_sdk(), etc
should not require any changes as part of this patch series.

I'll run as much of the selftest suite as I can on this series as-is
to see if there are any other issues.

Thanks,

--
Paul Barker
Konsulko Group
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#140867): 
https://lists.openembedded.org/g/openembedded-core/message/140867
Mute This Topic: https://lists.openembedded.org/mt/75277396/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 v5 06/13] ipk: Move rootfs to its own dir

2020-07-22 Thread Fredrik Gustafsson
This is a part of a refactor that will split the package manager
code so that it's possible to use other package managers in other
layers.

Signed-off-by: Fredrik Gustafsson 
---
 meta/lib/oe/package_manager/ipk/rootfs.py | 385 ++
 meta/lib/oe/rootfs.py | 268 +--
 2 files changed, 387 insertions(+), 266 deletions(-)
 create mode 100644 meta/lib/oe/package_manager/ipk/rootfs.py

diff --git a/meta/lib/oe/package_manager/ipk/rootfs.py 
b/meta/lib/oe/package_manager/ipk/rootfs.py
new file mode 100644
index 00..067831be00
--- /dev/null
+++ b/meta/lib/oe/package_manager/ipk/rootfs.py
@@ -0,0 +1,385 @@
+#
+# SPDX-License-Identifier: GPL-2.0-only
+#
+
+from oe.rootfs import Rootfs
+from oe.package_manager import OpkgPM
+from oe.manifest import Manifest
+from oe.utils import execute_pre_post_process
+import re
+from oe.package_manager.ipk.manifest import OpkgManifest
+
+class DpkgOpkgRootfs(Rootfs):
+def __init__(self, d, progress_reporter=None, logcatcher=None):
+super(DpkgOpkgRootfs, self).__init__(d, progress_reporter, logcatcher)
+
+def _get_pkgs_postinsts(self, status_file):
+def _get_pkg_depends_list(pkg_depends):
+pkg_depends_list = []
+# filter version requirements like libc (>= 1.1)
+for dep in pkg_depends.split(', '):
+m_dep = re.match(r"^(.*) \(.*\)$", dep)
+if m_dep:
+dep = m_dep.group(1)
+pkg_depends_list.append(dep)
+
+return pkg_depends_list
+
+pkgs = {}
+pkg_name = ""
+pkg_status_match = False
+pkg_depends = ""
+
+with open(status_file) as status:
+data = status.read()
+status.close()
+for line in data.split('\n'):
+m_pkg = re.match(r"^Package: (.*)", line)
+m_status = re.match(r"^Status:.*unpacked", line)
+m_depends = re.match(r"^Depends: (.*)", line)
+
+#Only one of m_pkg, m_status or m_depends is not None at time
+#If m_pkg is not None, we started a new package
+if m_pkg is not None:
+#Get Package name
+pkg_name = m_pkg.group(1)
+#Make sure we reset other variables
+pkg_status_match = False
+pkg_depends = ""
+elif m_status is not None:
+#New status matched
+pkg_status_match = True
+elif m_depends is not None:
+#New depends macthed
+pkg_depends = m_depends.group(1)
+else:
+pass
+
+#Now check if we can process package depends and postinst
+if "" != pkg_name and pkg_status_match:
+pkgs[pkg_name] = _get_pkg_depends_list(pkg_depends)
+else:
+#Not enough information
+pass
+
+# remove package dependencies not in postinsts
+pkg_names = list(pkgs.keys())
+for pkg_name in pkg_names:
+deps = pkgs[pkg_name][:]
+
+for d in deps:
+if d not in pkg_names:
+pkgs[pkg_name].remove(d)
+
+return pkgs
+
+def _get_delayed_postinsts_common(self, status_file):
+def _dep_resolve(graph, node, resolved, seen):
+seen.append(node)
+
+for edge in graph[node]:
+if edge not in resolved:
+if edge in seen:
+raise RuntimeError("Packages %s and %s have " \
+"a circular dependency in postinsts scripts." \
+% (node, edge))
+_dep_resolve(graph, edge, resolved, seen)
+
+resolved.append(node)
+
+pkg_list = []
+
+pkgs = None
+if not self.d.getVar('PACKAGE_INSTALL').strip():
+bb.note("Building empty image")
+else:
+pkgs = self._get_pkgs_postinsts(status_file)
+if pkgs:
+root = "__packagegroup_postinst__"
+pkgs[root] = list(pkgs.keys())
+_dep_resolve(pkgs, root, pkg_list, [])
+pkg_list.remove(root)
+
+if len(pkg_list) == 0:
+return None
+
+return pkg_list
+
+def _save_postinsts_common(self, dst_postinst_dir, src_postinst_dir):
+if bb.utils.contains("IMAGE_FEATURES", "package-management",
+ True, False, self.d):
+return
+num = 0
+for p in self._get_delayed_postinsts():
+bb.utils.mkdirhier(dst_postinst_dir)
+
+if os.path.exists(os.path.join(src_postinst_dir, p + ".postinst")):
+shutil.copy(os.path.join(src_postinst_dir, p + ".postinst"),
+os.path.join(dst_postinst_dir, "%03d-%s" % (n

[OE-core] [PATCH v5 09/13] ipk: Move sdk to its own dir

2020-07-22 Thread Fredrik Gustafsson
This is a part of a refactor that will split the package manager
code so that it's possible to use other package managers in other
layers.

Signed-off-by: Fredrik Gustafsson 
---
 meta/lib/oe/package_manager/ipk/sdk.py | 96 ++
 meta/lib/oe/sdk.py | 87 +--
 2 files changed, 97 insertions(+), 86 deletions(-)
 create mode 100644 meta/lib/oe/package_manager/ipk/sdk.py

diff --git a/meta/lib/oe/package_manager/ipk/sdk.py 
b/meta/lib/oe/package_manager/ipk/sdk.py
new file mode 100644
index 00..a687ef4a06
--- /dev/null
+++ b/meta/lib/oe/package_manager/ipk/sdk.py
@@ -0,0 +1,96 @@
+#
+# SPDX-License-Identifier: GPL-2.0-only
+#
+
+from oe.utils import execute_pre_post_process
+from oe.sdk import Sdk
+from oe.manifest import Manifest
+from oe.package_manager import OpkgPM
+import shutil
+import glob
+
+class OpkgSdk(Sdk):
+def __init__(self, d, manifest_dir=None):
+super(OpkgSdk, self).__init__(d, manifest_dir)
+
+self.target_conf = self.d.getVar("IPKGCONF_TARGET")
+self.host_conf = self.d.getVar("IPKGCONF_SDK")
+
+from oe.package_managers.ipk.manifest import OpkgManifest
+self.target_manifest = OpkgManifest(d, self.manifest_dir,
+Manifest.MANIFEST_TYPE_SDK_TARGET)
+self.host_manifest = OpkgManifest(d, self.manifest_dir,
+  Manifest.MANIFEST_TYPE_SDK_HOST)
+
+ipk_repo_workdir = "oe-sdk-repo"
+if "sdk_ext" in d.getVar("BB_RUNTASK"):
+ipk_repo_workdir = "oe-sdk-ext-repo"
+
+self.target_pm = OpkgPM(d, self.sdk_target_sysroot, self.target_conf,
+self.d.getVar("ALL_MULTILIB_PACKAGE_ARCHS"),
+ipk_repo_workdir=ipk_repo_workdir)
+
+self.host_pm = OpkgPM(d, self.sdk_host_sysroot, self.host_conf,
+  self.d.getVar("SDK_PACKAGE_ARCHS"),
+ipk_repo_workdir=ipk_repo_workdir)
+
+def _populate_sysroot(self, pm, manifest):
+pkgs_to_install = manifest.parse_initial_manifest()
+
+if (self.d.getVar('BUILD_IMAGES_FROM_FEEDS') or "") != "1":
+pm.write_index()
+
+pm.update()
+
+for pkg_type in self.install_order:
+if pkg_type in pkgs_to_install:
+pm.install(pkgs_to_install[pkg_type],
+   [False, True][pkg_type == 
Manifest.PKG_TYPE_ATTEMPT_ONLY])
+
+def _populate(self):
+execute_pre_post_process(self.d, 
self.d.getVar("POPULATE_SDK_PRE_TARGET_COMMAND"))
+
+bb.note("Installing TARGET packages")
+self._populate_sysroot(self.target_pm, self.target_manifest)
+
+
self.target_pm.install_complementary(self.d.getVar('SDKIMAGE_INSTALL_COMPLEMENTARY'))
+
+self.target_pm.run_intercepts(populate_sdk='target')
+
+execute_pre_post_process(self.d, 
self.d.getVar("POPULATE_SDK_POST_TARGET_COMMAND"))
+
+if not bb.utils.contains("SDKIMAGE_FEATURES", "package-management", 
True, False, self.d):
+self.target_pm.remove_packaging_data()
+
+bb.note("Installing NATIVESDK packages")
+self._populate_sysroot(self.host_pm, self.host_manifest)
+self.install_locales(self.host_pm)
+
+self.host_pm.run_intercepts(populate_sdk='host')
+
+execute_pre_post_process(self.d, 
self.d.getVar("POPULATE_SDK_POST_HOST_COMMAND"))
+
+if not bb.utils.contains("SDKIMAGE_FEATURES", "package-management", 
True, False, self.d):
+self.host_pm.remove_packaging_data()
+
+target_sysconfdir = os.path.join(self.sdk_target_sysroot, 
self.sysconfdir)
+host_sysconfdir = os.path.join(self.sdk_host_sysroot, self.sysconfdir)
+
+self.mkdirhier(target_sysconfdir)
+shutil.copy(self.target_conf, target_sysconfdir)
+os.chmod(os.path.join(target_sysconfdir,
+  os.path.basename(self.target_conf)), 0o644)
+
+self.mkdirhier(host_sysconfdir)
+shutil.copy(self.host_conf, host_sysconfdir)
+os.chmod(os.path.join(host_sysconfdir,
+  os.path.basename(self.host_conf)), 0o644)
+
+native_opkg_state_dir = os.path.join(self.sdk_output, 
self.sdk_native_path,
+ 
self.d.getVar('localstatedir_nativesdk').strip('/'),
+ "lib", "opkg")
+self.mkdirhier(native_opkg_state_dir)
+for f in glob.glob(os.path.join(self.sdk_output, "var", "lib", "opkg", 
"*")):
+self.movefile(f, native_opkg_state_dir)
+
+self.remove(os.path.join(self.sdk_output, "var"), True)
diff --git a/meta/lib/oe/sdk.py b/meta/lib/oe/sdk.py
index 29053e69ee..6907d3a6d8 100644
--- a/meta/lib/oe/sdk.py
+++ b/meta/lib/oe/sdk.py
@@ -110,92 +110,6 @@ class Sdk(object, metaclass=ABCMeta):
 pass
 
 
-class OpkgSdk(Sd

[OE-core] [PATCH v5 13/13] deb: Move package manager to its own dir

2020-07-22 Thread Fredrik Gustafsson
This is a part of a refactor that will split the package manager
code so that it's possible to use other package managers in other
layers.

Signed-off-by: Fredrik Gustafsson 
---
 meta/lib/oe/package_manager/__init__.py   | 487 -
 .../oe/package_manager/deb/package_manager.py | 490 ++
 meta/lib/oe/package_manager/deb/rootfs.py |   2 +-
 meta/lib/oe/rootfs.py |   1 +
 4 files changed, 492 insertions(+), 488 deletions(-)
 create mode 100644 meta/lib/oe/package_manager/deb/package_manager.py

diff --git a/meta/lib/oe/package_manager/__init__.py 
b/meta/lib/oe/package_manager/__init__.py
index af254fcf6e..538da3a14c 100644
--- a/meta/lib/oe/package_manager/__init__.py
+++ b/meta/lib/oe/package_manager/__init__.py
@@ -149,81 +149,6 @@ class Indexer(object, metaclass=ABCMeta):
 def write_index(self):
 pass
 
-class DpkgIndexer(Indexer):
-def _create_configs(self):
-bb.utils.mkdirhier(self.apt_conf_dir)
-bb.utils.mkdirhier(os.path.join(self.apt_conf_dir, "lists", "partial"))
-bb.utils.mkdirhier(os.path.join(self.apt_conf_dir, "apt.conf.d"))
-bb.utils.mkdirhier(os.path.join(self.apt_conf_dir, "preferences.d"))
-
-with open(os.path.join(self.apt_conf_dir, "preferences"),
-"w") as prefs_file:
-pass
-with open(os.path.join(self.apt_conf_dir, "sources.list"),
-"w+") as sources_file:
-pass
-
-with open(self.apt_conf_file, "w") as apt_conf:
-with open(os.path.join(self.d.expand("${STAGING_ETCDIR_NATIVE}"),
-"apt", "apt.conf.sample")) as apt_conf_sample:
-for line in apt_conf_sample.read().split("\n"):
-line = re.sub(r"#ROOTFS#", "/dev/null", line)
-line = re.sub(r"#APTCONF#", self.apt_conf_dir, line)
-apt_conf.write(line + "\n")
-
-def write_index(self):
-self.apt_conf_dir = os.path.join(self.d.expand("${APTCONF_TARGET}"),
-"apt-ftparchive")
-self.apt_conf_file = os.path.join(self.apt_conf_dir, "apt.conf")
-self._create_configs()
-
-os.environ['APT_CONFIG'] = self.apt_conf_file
-
-pkg_archs = self.d.getVar('PACKAGE_ARCHS')
-if pkg_archs is not None:
-arch_list = pkg_archs.split()
-sdk_pkg_archs = self.d.getVar('SDK_PACKAGE_ARCHS')
-if sdk_pkg_archs is not None:
-for a in sdk_pkg_archs.split():
-if a not in pkg_archs:
-arch_list.append(a)
-
-all_mlb_pkg_arch_list = (self.d.getVar('ALL_MULTILIB_PACKAGE_ARCHS') 
or "").split()
-arch_list.extend(arch for arch in all_mlb_pkg_arch_list if arch not in 
arch_list)
-
-apt_ftparchive = bb.utils.which(os.getenv('PATH'), "apt-ftparchive")
-gzip = bb.utils.which(os.getenv('PATH'), "gzip")
-
-index_cmds = []
-deb_dirs_found = False
-for arch in arch_list:
-arch_dir = os.path.join(self.deploy_dir, arch)
-if not os.path.isdir(arch_dir):
-continue
-
-cmd = "cd %s; PSEUDO_UNLOAD=1 %s packages . > Packages;" % 
(arch_dir, apt_ftparchive)
-
-cmd += "%s -fcn Packages > Packages.gz;" % gzip
-
-with open(os.path.join(arch_dir, "Release"), "w+") as release:
-release.write("Label: %s\n" % arch)
-
-cmd += "PSEUDO_UNLOAD=1 %s release . >> Release" % apt_ftparchive
-
-index_cmds.append(cmd)
-
-deb_dirs_found = True
-
-if not deb_dirs_found:
-bb.note("There are no packages in %s" % self.deploy_dir)
-return
-
-oe.utils.multiprocess_launch(create_index, index_cmds, self.d)
-if self.d.getVar('PACKAGE_FEED_SIGN') == '1':
-raise NotImplementedError('Package feed signing not implementd for 
dpkg')
-
-
-
 class PkgsList(object, metaclass=ABCMeta):
 def __init__(self, d, rootfs_dir):
 self.d = d
@@ -233,24 +158,6 @@ class PkgsList(object, metaclass=ABCMeta):
 def list_pkgs(self):
 pass
 
-class DpkgPkgsList(PkgsList):
-
-def list_pkgs(self):
-cmd = [bb.utils.which(os.getenv('PATH'), "dpkg-query"),
-   "--admindir=%s/var/lib/dpkg" % self.rootfs_dir,
-   "-W"]
-
-cmd.append("-f=Package: ${Package}\nArchitecture: 
${PackageArch}\nVersion: ${Version}\nFile: 
${Package}_${Version}_${Architecture}.deb\nDepends: ${Depends}\nRecommends: 
${Recommends}\nProvides: ${Provides}\n\n")
-
-try:
-cmd_output = subprocess.check_output(cmd, 
stderr=subprocess.STDOUT).strip().decode("utf-8")
-except subprocess.CalledProcessError as e:
-bb.fatal("Cannot get the installed packages list. Command '%s' "
- "returned %d:\n%s" % (' '.join(cmd), e.returncode, 
e.output.decode("utf-8")))
-
-return opkg_query(cmd_output)
-
-
 class

[OE-core] [PATCH v5 04/13] deb: Move deb manifest to its own subdir

2020-07-22 Thread Fredrik Gustafsson
This is a part of a refactor that will split the package manager
code so that it's possible to use other package managers in other
layers.

Signed-off-by: Fredrik Gustafsson 
---
 meta/lib/oe/manifest.py | 21 +
 meta/lib/oe/package_manager/deb/__init__.py |  3 +++
 meta/lib/oe/package_manager/deb/manifest.py | 26 +
 meta/lib/oe/rootfs.py   |  1 +
 4 files changed, 31 insertions(+), 20 deletions(-)
 create mode 100644 meta/lib/oe/package_manager/deb/__init__.py
 create mode 100644 meta/lib/oe/package_manager/deb/manifest.py

diff --git a/meta/lib/oe/manifest.py b/meta/lib/oe/manifest.py
index f87c150d33..47bd622412 100644
--- a/meta/lib/oe/manifest.py
+++ b/meta/lib/oe/manifest.py
@@ -187,32 +187,13 @@ class Manifest(object, metaclass=ABCMeta):
 
 return installed_pkgs
 
-class DpkgManifest(Manifest):
-def create_initial(self):
-with open(self.initial_manifest, "w+") as manifest:
-manifest.write(self.initial_manifest_file_header)
-
-for var in self.var_maps[self.manifest_type]:
-pkg_list = self.d.getVar(var)
-
-if pkg_list is None:
-continue
-
-for pkg in pkg_list.split():
-manifest.write("%s,%s\n" %
-   (self.var_maps[self.manifest_type][var], 
pkg))
-
-def create_final(self):
-pass
-
-def create_full(self, pm):
-pass
 
 
 def create_manifest(d, final_manifest=False, manifest_dir=None,
 manifest_type=Manifest.MANIFEST_TYPE_IMAGE):
 from oe.package_manager.rpm.manifest import RpmManifest
 from oe.package_manager.ipk.manifest import OpkgManifest
+from oe.package_manager.deb.manifest import DpkgManifest
 manifest_map = {'rpm': RpmManifest,
 'ipk': OpkgManifest,
 'deb': DpkgManifest}
diff --git a/meta/lib/oe/package_manager/deb/__init__.py 
b/meta/lib/oe/package_manager/deb/__init__.py
new file mode 100644
index 00..a2094304c9
--- /dev/null
+++ b/meta/lib/oe/package_manager/deb/__init__.py
@@ -0,0 +1,3 @@
+#
+# SPDX-License-Identifier: GPL-2.0-only
+#
diff --git a/meta/lib/oe/package_manager/deb/manifest.py 
b/meta/lib/oe/package_manager/deb/manifest.py
new file mode 100644
index 00..0b12036644
--- /dev/null
+++ b/meta/lib/oe/package_manager/deb/manifest.py
@@ -0,0 +1,26 @@
+#
+# SPDX-License-Identifier: GPL-2.0-only
+#
+
+from oe.manifest import Manifest
+
+class DpkgManifest(Manifest):
+def create_initial(self):
+with open(self.initial_manifest, "w+") as manifest:
+manifest.write(self.initial_manifest_file_header)
+
+for var in self.var_maps[self.manifest_type]:
+pkg_list = self.d.getVar(var)
+
+if pkg_list is None:
+continue
+
+for pkg in pkg_list.split():
+manifest.write("%s,%s\n" %
+   (self.var_maps[self.manifest_type][var], 
pkg))
+
+def create_final(self):
+pass
+
+def create_full(self, pm):
+pass
diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index 1ba0a71253..876e13079c 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -13,6 +13,7 @@ import subprocess
 import re
 from oe.package_manager.rpm.manifest import RpmManifest
 from oe.package_manager.ipk.manifest import OpkgManifest
+from oe.package_manager.deb.manifest import DpkgManifest
 
 class Rootfs(object, metaclass=ABCMeta):
 """
-- 
2.20.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#140860): 
https://lists.openembedded.org/g/openembedded-core/message/140860
Mute This Topic: https://lists.openembedded.org/mt/75724416/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 v5 05/13] rpm: Move rootfs to its own dir

2020-07-22 Thread Fredrik Gustafsson
This is a part of a refactor that will split the package manager
code so that it's possible to use other package managers in other
layers.

Signed-off-by: Fredrik Gustafsson 
---
 meta/lib/oe/package_manager/rpm/rootfs.py | 148 ++
 meta/lib/oe/rootfs.py | 142 +
 2 files changed, 150 insertions(+), 140 deletions(-)
 create mode 100644 meta/lib/oe/package_manager/rpm/rootfs.py

diff --git a/meta/lib/oe/package_manager/rpm/rootfs.py 
b/meta/lib/oe/package_manager/rpm/rootfs.py
new file mode 100644
index 00..3d9eb95528
--- /dev/null
+++ b/meta/lib/oe/package_manager/rpm/rootfs.py
@@ -0,0 +1,148 @@
+#
+# SPDX-License-Identifier: GPL-2.0-only
+#
+
+from oe.rootfs import Rootfs
+from oe.package_manager import RpmPM
+from oe.manifest import Manifest
+from oe.utils import execute_pre_post_process
+from oe.package_manager.rpm.manifest import RpmManifest
+
+class RpmRootfs(Rootfs):
+def __init__(self, d, manifest_dir, progress_reporter=None, 
logcatcher=None):
+super(RpmRootfs, self).__init__(d, progress_reporter, logcatcher)
+self.log_check_regex = r'(unpacking of archive failed|Cannot find 
package'\
+   r'|exit 1|ERROR: |Error: |Error |ERROR '\
+   r'|Failed |Failed: |Failed$|Failed\(\d+\):)'
+
+self.manifest = RpmManifest(d, manifest_dir)
+
+self.pm = RpmPM(d,
+d.getVar('IMAGE_ROOTFS'),
+self.d.getVar('TARGET_VENDOR')
+)
+
+self.inc_rpm_image_gen = self.d.getVar('INC_RPM_IMAGE_GEN')
+if self.inc_rpm_image_gen != "1":
+bb.utils.remove(self.image_rootfs, True)
+else:
+self.pm.recovery_packaging_data()
+bb.utils.remove(self.d.getVar('MULTILIB_TEMP_ROOTFS'), True)
+
+self.pm.create_configs()
+
+'''
+While rpm incremental image generation is enabled, it will remove the
+unneeded pkgs by comparing the new install solution manifest and the
+old installed manifest.
+'''
+def _create_incremental(self, pkgs_initial_install):
+if self.inc_rpm_image_gen == "1":
+
+pkgs_to_install = list()
+for pkg_type in pkgs_initial_install:
+pkgs_to_install += pkgs_initial_install[pkg_type]
+
+installed_manifest = self.pm.load_old_install_solution()
+solution_manifest = self.pm.dump_install_solution(pkgs_to_install)
+
+pkg_to_remove = list()
+for pkg in installed_manifest:
+if pkg not in solution_manifest:
+pkg_to_remove.append(pkg)
+
+self.pm.update()
+
+bb.note('incremental update -- upgrade packages in place ')
+self.pm.upgrade()
+if pkg_to_remove != []:
+bb.note('incremental removed: %s' % ' '.join(pkg_to_remove))
+self.pm.remove(pkg_to_remove)
+
+self.pm.autoremove()
+
+def _create(self):
+pkgs_to_install = self.manifest.parse_initial_manifest()
+rpm_pre_process_cmds = self.d.getVar('RPM_PREPROCESS_COMMANDS')
+rpm_post_process_cmds = self.d.getVar('RPM_POSTPROCESS_COMMANDS')
+
+# update PM index files
+self.pm.write_index()
+
+execute_pre_post_process(self.d, rpm_pre_process_cmds)
+
+if self.progress_reporter:
+self.progress_reporter.next_stage()
+
+if self.inc_rpm_image_gen == "1":
+self._create_incremental(pkgs_to_install)
+
+if self.progress_reporter:
+self.progress_reporter.next_stage()
+
+self.pm.update()
+
+pkgs = []
+pkgs_attempt = []
+for pkg_type in pkgs_to_install:
+if pkg_type == Manifest.PKG_TYPE_ATTEMPT_ONLY:
+pkgs_attempt += pkgs_to_install[pkg_type]
+else:
+pkgs += pkgs_to_install[pkg_type]
+
+if self.progress_reporter:
+self.progress_reporter.next_stage()
+
+self.pm.install(pkgs)
+
+if self.progress_reporter:
+self.progress_reporter.next_stage()
+
+self.pm.install(pkgs_attempt, True)
+
+if self.progress_reporter:
+self.progress_reporter.next_stage()
+
+self.pm.install_complementary()
+
+if self.progress_reporter:
+self.progress_reporter.next_stage()
+
+self._setup_dbg_rootfs(['/etc', '/var/lib/rpm', '/var/cache/dnf', 
'/var/lib/dnf'])
+
+execute_pre_post_process(self.d, rpm_post_process_cmds)
+
+if self.inc_rpm_image_gen == "1":
+self.pm.backup_packaging_data()
+
+if self.progress_reporter:
+self.progress_reporter.next_stage()
+
+
+@staticmethod
+def _depends_list():
+return ['DEPLOY_DIR_RPM', 'INC_RPM_IMAGE_GEN', 
'RPM_PREPROCESS_COMMANDS',
+'RPM_POSTPROCESS_COMMANDS', 'RPM_PREFER_ELF_ARCH']
+
+

[OE-core] [PATCH v5 11/13] rpm: Move package manager to its own dir

2020-07-22 Thread Fredrik Gustafsson
This is part of a refactor that will split the package manager
code so that it's possible to use other package managers in other
layers.

Signed-off-by: Fredrik Gustafsson 
---
 meta/lib/oe/package_manager/__init__.py   | 398 -
 .../oe/package_manager/rpm/package_manager.py | 402 ++
 meta/lib/oe/package_manager/rpm/rootfs.py |   2 +-
 meta/lib/oe/rootfs.py |   2 +
 4 files changed, 405 insertions(+), 399 deletions(-)
 create mode 100644 meta/lib/oe/package_manager/rpm/package_manager.py

diff --git a/meta/lib/oe/package_manager/__init__.py 
b/meta/lib/oe/package_manager/__init__.py
index 35e5cff073..2ca47e5109 100644
--- a/meta/lib/oe/package_manager/__init__.py
+++ b/meta/lib/oe/package_manager/__init__.py
@@ -149,43 +149,6 @@ class Indexer(object, metaclass=ABCMeta):
 def write_index(self):
 pass
 
-
-class RpmIndexer(Indexer):
-def write_index(self):
-self.do_write_index(self.deploy_dir)
-
-def do_write_index(self, deploy_dir):
-if self.d.getVar('PACKAGE_FEED_SIGN') == '1':
-signer = get_signer(self.d, 
self.d.getVar('PACKAGE_FEED_GPG_BACKEND'))
-else:
-signer = None
-
-createrepo_c = bb.utils.which(os.environ['PATH'], "createrepo_c")
-result = create_index("%s --update -q %s" % (createrepo_c, deploy_dir))
-if result:
-bb.fatal(result)
-
-# Sign repomd
-if signer:
-sig_type = self.d.getVar('PACKAGE_FEED_GPG_SIGNATURE_TYPE')
-is_ascii_sig = (sig_type.upper() != "BIN")
-signer.detach_sign(os.path.join(deploy_dir, 'repodata', 
'repomd.xml'),
-   self.d.getVar('PACKAGE_FEED_GPG_NAME'),
-   
self.d.getVar('PACKAGE_FEED_GPG_PASSPHRASE_FILE'),
-   armor=is_ascii_sig)
-
-class RpmSubdirIndexer(RpmIndexer):
-def write_index(self):
-bb.note("Generating package index for %s" %(self.deploy_dir))
-self.do_write_index(self.deploy_dir)
-for entry in os.walk(self.deploy_dir):
-if os.path.samefile(self.deploy_dir, entry[0]):
-for dir in entry[1]:
-if dir != 'repodata':
-dir_path = oe.path.join(self.deploy_dir, dir)
-bb.note("Generating package index for %s" %(dir_path))
-self.do_write_index(dir_path)
-
 class OpkgIndexer(Indexer):
 def write_index(self):
 arch_vars = ["ALL_MULTILIB_PACKAGE_ARCHS",
@@ -323,10 +286,6 @@ class PkgsList(object, metaclass=ABCMeta):
 def list_pkgs(self):
 pass
 
-class RpmPkgsList(PkgsList):
-def list_pkgs(self):
-return RpmPM(self.d, self.rootfs_dir, self.d.getVar('TARGET_VENDOR'), 
needfeed=False).list_installed()
-
 class OpkgPkgsList(PkgsList):
 def __init__(self, d, rootfs_dir, config_file):
 super(OpkgPkgsList, self).__init__(d, rootfs_dir)
@@ -737,363 +696,6 @@ def create_packages_dir(d, subrepo_dir, deploydir, 
taskname, filterbydependencie
 else:
 raise
 
-class RpmPM(PackageManager):
-def __init__(self,
- d,
- target_rootfs,
- target_vendor,
- task_name='target',
- arch_var=None,
- os_var=None,
- rpm_repo_workdir="oe-rootfs-repo",
- filterbydependencies=True,
- needfeed=True):
-super(RpmPM, self).__init__(d, target_rootfs)
-self.target_vendor = target_vendor
-self.task_name = task_name
-if arch_var == None:
-self.archs = 
self.d.getVar('ALL_MULTILIB_PACKAGE_ARCHS').replace("-","_")
-else:
-self.archs = self.d.getVar(arch_var).replace("-","_")
-if task_name == "host":
-self.primary_arch = self.d.getVar('SDK_ARCH')
-else:
-self.primary_arch = self.d.getVar('MACHINE_ARCH')
-
-if needfeed:
-self.rpm_repo_dir = oe.path.join(self.d.getVar('WORKDIR'), 
rpm_repo_workdir)
-create_packages_dir(self.d, oe.path.join(self.rpm_repo_dir, 
"rpm"), d.getVar("DEPLOY_DIR_RPM"), "package_write_rpm", filterbydependencies)
-
-self.saved_packaging_data = 
self.d.expand('${T}/saved_packaging_data/%s' % self.task_name)
-if not os.path.exists(self.d.expand('${T}/saved_packaging_data')):
-bb.utils.mkdirhier(self.d.expand('${T}/saved_packaging_data'))
-self.packaging_data_dirs = ['etc/rpm', 'etc/rpmrc', 'etc/dnf', 
'var/lib/rpm', 'var/lib/dnf', 'var/cache/dnf']
-self.solution_manifest = self.d.expand('${T}/saved/%s_solution' %
-   self.task_name)
-if not os.path.exists(self.d.expand('${T}/saved')):
-bb.utils.mkdirhier(self.d.expand('${T}/saved'))
-
-def _configure_dnf(self):
-# li

[OE-core] [PATCH v5] Add package managers as a plugin

2020-07-22 Thread Fredrik Gustafsson
OE-core today has three different package managers, the well-known formats deb
and rpm is supported as well as ipkg that is good for embedded devices.

When building and having a good cache hit, a significant amount of time is
spent in the phase of generating a rootfs, which is really about the
performance of the package manager. To save build time and also get a
package manager that is suitanle for use on targets where flash memory is a
concern, support for apk is suggested.

However, it might or might not be what's wanted for OE-core since it increases
the test matrix. Therefore I will refactor the package management code to
allow a layer to add a new package manager without editing the meta layer.

This refactor will be divided into multiple patch series to be easier to review,
this series will only move code but keep existing functionality.

Changes since v4:
* Removed blank lines in end of new files
* Rename package_managers to package_manager
* Move import statements out from function when it's possible.
* Edit commit message to prepend subject with rpm:, ipk:, deb:, etc.
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#140857): 
https://lists.openembedded.org/g/openembedded-core/message/140857
Mute This Topic: https://lists.openembedded.org/mt/75724413/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 v5 07/13] deb: Move rootfs to its own dir

2020-07-22 Thread Fredrik Gustafsson
This is a part of a refactor that will split the package manager
code so that it's possible to use other package managers in other
layers.

Signed-off-by: Fredrik Gustafsson 
---
 meta/lib/oe/package_manager/deb/rootfs.py | 209 ++
 meta/lib/oe/rootfs.py | 201 +
 2 files changed, 211 insertions(+), 199 deletions(-)
 create mode 100644 meta/lib/oe/package_manager/deb/rootfs.py

diff --git a/meta/lib/oe/package_manager/deb/rootfs.py 
b/meta/lib/oe/package_manager/deb/rootfs.py
new file mode 100644
index 00..0661ee7c5b
--- /dev/null
+++ b/meta/lib/oe/package_manager/deb/rootfs.py
@@ -0,0 +1,209 @@
+#
+# SPDX-License-Identifier: GPL-2.0-only
+#
+
+from oe.rootfs import Rootfs
+from oe.package_manager import DpkgPM
+from oe.manifest import Manifest
+from oe.utils import execute_pre_post_process
+from oe.package_manager.deb.manifest import DpkgManifest
+import re
+
+class DpkgOpkgRootfs(Rootfs):
+def __init__(self, d, progress_reporter=None, logcatcher=None):
+super(DpkgOpkgRootfs, self).__init__(d, progress_reporter, logcatcher)
+
+def _get_pkgs_postinsts(self, status_file):
+def _get_pkg_depends_list(pkg_depends):
+pkg_depends_list = []
+# filter version requirements like libc (>= 1.1)
+for dep in pkg_depends.split(', '):
+m_dep = re.match(r"^(.*) \(.*\)$", dep)
+if m_dep:
+dep = m_dep.group(1)
+pkg_depends_list.append(dep)
+
+return pkg_depends_list
+
+pkgs = {}
+pkg_name = ""
+pkg_status_match = False
+pkg_depends = ""
+
+with open(status_file) as status:
+data = status.read()
+status.close()
+for line in data.split('\n'):
+m_pkg = re.match(r"^Package: (.*)", line)
+m_status = re.match(r"^Status:.*unpacked", line)
+m_depends = re.match(r"^Depends: (.*)", line)
+
+#Only one of m_pkg, m_status or m_depends is not None at time
+#If m_pkg is not None, we started a new package
+if m_pkg is not None:
+#Get Package name
+pkg_name = m_pkg.group(1)
+#Make sure we reset other variables
+pkg_status_match = False
+pkg_depends = ""
+elif m_status is not None:
+#New status matched
+pkg_status_match = True
+elif m_depends is not None:
+#New depends macthed
+pkg_depends = m_depends.group(1)
+else:
+pass
+
+#Now check if we can process package depends and postinst
+if "" != pkg_name and pkg_status_match:
+pkgs[pkg_name] = _get_pkg_depends_list(pkg_depends)
+else:
+#Not enough information
+pass
+
+# remove package dependencies not in postinsts
+pkg_names = list(pkgs.keys())
+for pkg_name in pkg_names:
+deps = pkgs[pkg_name][:]
+
+for d in deps:
+if d not in pkg_names:
+pkgs[pkg_name].remove(d)
+
+return pkgs
+
+def _get_delayed_postinsts_common(self, status_file):
+def _dep_resolve(graph, node, resolved, seen):
+seen.append(node)
+
+for edge in graph[node]:
+if edge not in resolved:
+if edge in seen:
+raise RuntimeError("Packages %s and %s have " \
+"a circular dependency in postinsts scripts." \
+% (node, edge))
+_dep_resolve(graph, edge, resolved, seen)
+
+resolved.append(node)
+
+pkg_list = []
+
+pkgs = None
+if not self.d.getVar('PACKAGE_INSTALL').strip():
+bb.note("Building empty image")
+else:
+pkgs = self._get_pkgs_postinsts(status_file)
+if pkgs:
+root = "__packagegroup_postinst__"
+pkgs[root] = list(pkgs.keys())
+_dep_resolve(pkgs, root, pkg_list, [])
+pkg_list.remove(root)
+
+if len(pkg_list) == 0:
+return None
+
+return pkg_list
+
+def _save_postinsts_common(self, dst_postinst_dir, src_postinst_dir):
+if bb.utils.contains("IMAGE_FEATURES", "package-management",
+ True, False, self.d):
+return
+num = 0
+for p in self._get_delayed_postinsts():
+bb.utils.mkdirhier(dst_postinst_dir)
+
+if os.path.exists(os.path.join(src_postinst_dir, p + ".postinst")):
+shutil.copy(os.path.join(src_postinst_dir, p + ".postinst"),
+os.path.join(dst_postinst_dir, "%03d-%s

[OE-core] [PATCH v5 03/13] ipk: Move ipk manifest to its own subdir

2020-07-22 Thread Fredrik Gustafsson
This is a part of a refactor that will split the package manager
code so that it's possible to use other package managers in other
layers.

Signed-off-by: Fredrik Gustafsson 
---
 meta/lib/oe/manifest.py | 72 +---
 meta/lib/oe/package_manager/ipk/__init__.py |  3 +
 meta/lib/oe/package_manager/ipk/manifest.py | 73 +
 meta/lib/oe/rootfs.py   |  1 +
 4 files changed, 78 insertions(+), 71 deletions(-)
 create mode 100644 meta/lib/oe/package_manager/ipk/__init__.py
 create mode 100644 meta/lib/oe/package_manager/ipk/manifest.py

diff --git a/meta/lib/oe/manifest.py b/meta/lib/oe/manifest.py
index 17461cda64..f87c150d33 100644
--- a/meta/lib/oe/manifest.py
+++ b/meta/lib/oe/manifest.py
@@ -187,76 +187,6 @@ class Manifest(object, metaclass=ABCMeta):
 
 return installed_pkgs
 
-
-class OpkgManifest(Manifest):
-"""
-Returns a dictionary object with mip and mlp packages.
-"""
-def _split_multilib(self, pkg_list):
-pkgs = dict()
-
-for pkg in pkg_list.split():
-pkg_type = self.PKG_TYPE_MUST_INSTALL
-
-ml_variants = self.d.getVar('MULTILIB_VARIANTS').split()
-
-for ml_variant in ml_variants:
-if pkg.startswith(ml_variant + '-'):
-pkg_type = self.PKG_TYPE_MULTILIB
-
-if not pkg_type in pkgs:
-pkgs[pkg_type] = pkg
-else:
-pkgs[pkg_type] += " " + pkg
-
-return pkgs
-
-def create_initial(self):
-pkgs = dict()
-
-with open(self.initial_manifest, "w+") as manifest:
-manifest.write(self.initial_manifest_file_header)
-
-for var in self.var_maps[self.manifest_type]:
-if var in self.vars_to_split:
-split_pkgs = self._split_multilib(self.d.getVar(var))
-if split_pkgs is not None:
-pkgs = dict(list(pkgs.items()) + 
list(split_pkgs.items()))
-else:
-pkg_list = self.d.getVar(var)
-if pkg_list is not None:
-pkgs[self.var_maps[self.manifest_type][var]] = 
self.d.getVar(var)
-
-for pkg_type in sorted(pkgs):
-for pkg in sorted(pkgs[pkg_type].split()):
-manifest.write("%s,%s\n" % (pkg_type, pkg))
-
-def create_final(self):
-pass
-
-def create_full(self, pm):
-if not os.path.exists(self.initial_manifest):
-self.create_initial()
-
-initial_manifest = self.parse_initial_manifest()
-pkgs_to_install = list()
-for pkg_type in initial_manifest:
-pkgs_to_install += initial_manifest[pkg_type]
-if len(pkgs_to_install) == 0:
-return
-
-output = pm.dummy_install(pkgs_to_install)
-
-with open(self.full_manifest, 'w+') as manifest:
-pkg_re = re.compile('^Installing ([^ ]+) [^ ].*')
-for line in set(output.split('\n')):
-m = pkg_re.match(line)
-if m:
-manifest.write(m.group(1) + '\n')
-
-return
-
-
 class DpkgManifest(Manifest):
 def create_initial(self):
 with open(self.initial_manifest, "w+") as manifest:
@@ -281,8 +211,8 @@ class DpkgManifest(Manifest):
 
 def create_manifest(d, final_manifest=False, manifest_dir=None,
 manifest_type=Manifest.MANIFEST_TYPE_IMAGE):
-
 from oe.package_manager.rpm.manifest import RpmManifest
+from oe.package_manager.ipk.manifest import OpkgManifest
 manifest_map = {'rpm': RpmManifest,
 'ipk': OpkgManifest,
 'deb': DpkgManifest}
diff --git a/meta/lib/oe/package_manager/ipk/__init__.py 
b/meta/lib/oe/package_manager/ipk/__init__.py
new file mode 100644
index 00..a2094304c9
--- /dev/null
+++ b/meta/lib/oe/package_manager/ipk/__init__.py
@@ -0,0 +1,3 @@
+#
+# SPDX-License-Identifier: GPL-2.0-only
+#
diff --git a/meta/lib/oe/package_manager/ipk/manifest.py 
b/meta/lib/oe/package_manager/ipk/manifest.py
new file mode 100644
index 00..69676903ab
--- /dev/null
+++ b/meta/lib/oe/package_manager/ipk/manifest.py
@@ -0,0 +1,73 @@
+#
+# SPDX-License-Identifier: GPL-2.0-only
+#
+
+from oe.manifest import Manifest
+
+class OpkgManifest(Manifest):
+"""
+Returns a dictionary object with mip and mlp packages.
+"""
+def _split_multilib(self, pkg_list):
+pkgs = dict()
+
+for pkg in pkg_list.split():
+pkg_type = self.PKG_TYPE_MUST_INSTALL
+
+ml_variants = self.d.getVar('MULTILIB_VARIANTS').split()
+
+for ml_variant in ml_variants:
+if pkg.startswith(ml_variant + '-'):
+pkg_type = self.PKG_TYPE_MULTILIB
+
+if not pkg_type in pkgs:
+pkgs[pkg_type] = pkg
+else:
+pkgs[pkg_type] += " " + pkg
+
+re

[OE-core] [PATCH v5 01/13] package_manager: Move to package_manager/__init__.py

2020-07-22 Thread Fredrik Gustafsson
This is part of a refactor that will split the package manager
code so that it's possible to use other package managers in other
layers.
---
 meta/lib/oe/{package_manager.py => package_manager/__init__.py} | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename meta/lib/oe/{package_manager.py => package_manager/__init__.py} (100%)

diff --git a/meta/lib/oe/package_manager.py 
b/meta/lib/oe/package_manager/__init__.py
similarity index 100%
rename from meta/lib/oe/package_manager.py
rename to meta/lib/oe/package_manager/__init__.py
-- 
2.20.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#140853): 
https://lists.openembedded.org/g/openembedded-core/message/140853
Mute This Topic: https://lists.openembedded.org/mt/75724408/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 v5 02/13] rpm: Move manifest to its own subdir

2020-07-22 Thread Fredrik Gustafsson
This is a part of a refactor that will split the package manager
code so that it's possible to use other package managers in other
layers.

Signed-off-by: Fredrik Gustafsson 
---
 meta/lib/oe/manifest.py | 53 +---
 meta/lib/oe/package_manager/rpm/__init__.py |  3 ++
 meta/lib/oe/package_manager/rpm/manifest.py | 54 +
 meta/lib/oe/rootfs.py   |  3 +-
 4 files changed, 61 insertions(+), 52 deletions(-)
 create mode 100644 meta/lib/oe/package_manager/rpm/__init__.py
 create mode 100644 meta/lib/oe/package_manager/rpm/manifest.py

diff --git a/meta/lib/oe/manifest.py b/meta/lib/oe/manifest.py
index f7c88f9a09..17461cda64 100644
--- a/meta/lib/oe/manifest.py
+++ b/meta/lib/oe/manifest.py
@@ -7,7 +7,6 @@ import os
 import re
 import bb
 
-
 class Manifest(object, metaclass=ABCMeta):
 """
 This is an abstract class. Do not instantiate this directly.
@@ -189,56 +188,6 @@ class Manifest(object, metaclass=ABCMeta):
 return installed_pkgs
 
 
-class RpmManifest(Manifest):
-"""
-Returns a dictionary object with mip and mlp packages.
-"""
-def _split_multilib(self, pkg_list):
-pkgs = dict()
-
-for pkg in pkg_list.split():
-pkg_type = self.PKG_TYPE_MUST_INSTALL
-
-ml_variants = self.d.getVar('MULTILIB_VARIANTS').split()
-
-for ml_variant in ml_variants:
-if pkg.startswith(ml_variant + '-'):
-pkg_type = self.PKG_TYPE_MULTILIB
-
-if not pkg_type in pkgs:
-pkgs[pkg_type] = pkg
-else:
-pkgs[pkg_type] += " " + pkg
-
-return pkgs
-
-def create_initial(self):
-pkgs = dict()
-
-with open(self.initial_manifest, "w+") as manifest:
-manifest.write(self.initial_manifest_file_header)
-
-for var in self.var_maps[self.manifest_type]:
-if var in self.vars_to_split:
-split_pkgs = self._split_multilib(self.d.getVar(var))
-if split_pkgs is not None:
-pkgs = dict(list(pkgs.items()) + 
list(split_pkgs.items()))
-else:
-pkg_list = self.d.getVar(var)
-if pkg_list is not None:
-pkgs[self.var_maps[self.manifest_type][var]] = 
self.d.getVar(var)
-
-for pkg_type in pkgs:
-for pkg in pkgs[pkg_type].split():
-manifest.write("%s,%s\n" % (pkg_type, pkg))
-
-def create_final(self):
-pass
-
-def create_full(self, pm):
-pass
-
-
 class OpkgManifest(Manifest):
 """
 Returns a dictionary object with mip and mlp packages.
@@ -332,6 +281,8 @@ class DpkgManifest(Manifest):
 
 def create_manifest(d, final_manifest=False, manifest_dir=None,
 manifest_type=Manifest.MANIFEST_TYPE_IMAGE):
+
+from oe.package_manager.rpm.manifest import RpmManifest
 manifest_map = {'rpm': RpmManifest,
 'ipk': OpkgManifest,
 'deb': DpkgManifest}
diff --git a/meta/lib/oe/package_manager/rpm/__init__.py 
b/meta/lib/oe/package_manager/rpm/__init__.py
new file mode 100644
index 00..a2094304c9
--- /dev/null
+++ b/meta/lib/oe/package_manager/rpm/__init__.py
@@ -0,0 +1,3 @@
+#
+# SPDX-License-Identifier: GPL-2.0-only
+#
diff --git a/meta/lib/oe/package_manager/rpm/manifest.py 
b/meta/lib/oe/package_manager/rpm/manifest.py
new file mode 100644
index 00..a75f6bdabf
--- /dev/null
+++ b/meta/lib/oe/package_manager/rpm/manifest.py
@@ -0,0 +1,54 @@
+#
+# SPDX-License-Identifier: GPL-2.0-only
+#
+
+from oe.manifest import Manifest
+
+class RpmManifest(Manifest):
+"""
+Returns a dictionary object with mip and mlp packages.
+"""
+def _split_multilib(self, pkg_list):
+pkgs = dict()
+
+for pkg in pkg_list.split():
+pkg_type = self.PKG_TYPE_MUST_INSTALL
+
+ml_variants = self.d.getVar('MULTILIB_VARIANTS').split()
+
+for ml_variant in ml_variants:
+if pkg.startswith(ml_variant + '-'):
+pkg_type = self.PKG_TYPE_MULTILIB
+
+if not pkg_type in pkgs:
+pkgs[pkg_type] = pkg
+else:
+pkgs[pkg_type] += " " + pkg
+
+return pkgs
+
+def create_initial(self):
+pkgs = dict()
+
+with open(self.initial_manifest, "w+") as manifest:
+manifest.write(self.initial_manifest_file_header)
+
+for var in self.var_maps[self.manifest_type]:
+if var in self.vars_to_split:
+split_pkgs = self._split_multilib(self.d.getVar(var))
+if split_pkgs is not None:
+pkgs = dict(list(pkgs.items()) + 
list(split_pkgs.items()))
+else:
+pkg_list = self.d.getVar(var)
+if pkg_list is not None

[OE-core] [PATCH v5 08/13] rpm: Move sdk to its own dir

2020-07-22 Thread Fredrik Gustafsson
This is part of a refactor that will split the package manager
code so that it's possible to use other package managers in other
layers.

Signed-off-by: Fredrik Gustafsson 
---
 meta/lib/oe/package_manager/rpm/sdk.py | 114 +
 meta/lib/oe/sdk.py | 106 +--
 2 files changed, 115 insertions(+), 105 deletions(-)
 create mode 100644 meta/lib/oe/package_manager/rpm/sdk.py

diff --git a/meta/lib/oe/package_manager/rpm/sdk.py 
b/meta/lib/oe/package_manager/rpm/sdk.py
new file mode 100644
index 00..0d44b0ee6c
--- /dev/null
+++ b/meta/lib/oe/package_manager/rpm/sdk.py
@@ -0,0 +1,114 @@
+#
+# SPDX-License-Identifier: GPL-2.0-only
+#
+
+from oe.utils import execute_pre_post_process
+from oe.sdk import Sdk
+from oe.manifest import Manifest
+from oe.package_manager import RpmPM
+import glob
+
+class RpmSdk(Sdk):
+def __init__(self, d, manifest_dir=None, rpm_workdir="oe-sdk-repo"):
+super(RpmSdk, self).__init__(d, manifest_dir)
+
+from oe.package_managers.rpm.manifest import RpmManifest
+self.target_manifest = RpmManifest(d, self.manifest_dir,
+   Manifest.MANIFEST_TYPE_SDK_TARGET)
+self.host_manifest = RpmManifest(d, self.manifest_dir,
+ Manifest.MANIFEST_TYPE_SDK_HOST)
+
+rpm_repo_workdir = "oe-sdk-repo"
+if "sdk_ext" in d.getVar("BB_RUNTASK"):
+rpm_repo_workdir = "oe-sdk-ext-repo"
+
+self.target_pm = RpmPM(d,
+   self.sdk_target_sysroot,
+   self.d.getVar('TARGET_VENDOR'),
+   'target',
+   rpm_repo_workdir=rpm_repo_workdir
+   )
+
+self.host_pm = RpmPM(d,
+ self.sdk_host_sysroot,
+ self.d.getVar('SDK_VENDOR'),
+ 'host',
+ "SDK_PACKAGE_ARCHS",
+ "SDK_OS",
+ rpm_repo_workdir=rpm_repo_workdir
+ )
+
+def _populate_sysroot(self, pm, manifest):
+pkgs_to_install = manifest.parse_initial_manifest()
+
+pm.create_configs()
+pm.write_index()
+pm.update()
+
+pkgs = []
+pkgs_attempt = []
+for pkg_type in pkgs_to_install:
+if pkg_type == Manifest.PKG_TYPE_ATTEMPT_ONLY:
+pkgs_attempt += pkgs_to_install[pkg_type]
+else:
+pkgs += pkgs_to_install[pkg_type]
+
+pm.install(pkgs)
+
+pm.install(pkgs_attempt, True)
+
+def _populate(self):
+execute_pre_post_process(self.d, 
self.d.getVar("POPULATE_SDK_PRE_TARGET_COMMAND"))
+
+bb.note("Installing TARGET packages")
+self._populate_sysroot(self.target_pm, self.target_manifest)
+
+
self.target_pm.install_complementary(self.d.getVar('SDKIMAGE_INSTALL_COMPLEMENTARY'))
+
+self.target_pm.run_intercepts(populate_sdk='target')
+
+execute_pre_post_process(self.d, 
self.d.getVar("POPULATE_SDK_POST_TARGET_COMMAND"))
+
+if not bb.utils.contains("SDKIMAGE_FEATURES", "package-management", 
True, False, self.d):
+self.target_pm.remove_packaging_data()
+
+bb.note("Installing NATIVESDK packages")
+self._populate_sysroot(self.host_pm, self.host_manifest)
+self.install_locales(self.host_pm)
+
+self.host_pm.run_intercepts(populate_sdk='host')
+
+execute_pre_post_process(self.d, 
self.d.getVar("POPULATE_SDK_POST_HOST_COMMAND"))
+
+if not bb.utils.contains("SDKIMAGE_FEATURES", "package-management", 
True, False, self.d):
+self.host_pm.remove_packaging_data()
+
+# Move host RPM library data
+native_rpm_state_dir = os.path.join(self.sdk_output,
+self.sdk_native_path,
+
self.d.getVar('localstatedir_nativesdk').strip('/'),
+"lib",
+"rpm"
+)
+self.mkdirhier(native_rpm_state_dir)
+for f in glob.glob(os.path.join(self.sdk_output,
+"var",
+"lib",
+"rpm",
+"*")):
+self.movefile(f, native_rpm_state_dir)
+
+self.remove(os.path.join(self.sdk_output, "var"), True)
+
+# Move host sysconfig data
+native_sysconf_dir = os.path.join(self.sdk_output,
+  self.sdk_native_path,
+  self.d.getVar('sysconfdir',
+True).strip('/'),
+ 

[OE-core] [PATCH v5 10/13] deb: Move sdk to its own dir

2020-07-22 Thread Fredrik Gustafsson
This is a part of a refactor that will split the package manager
code so that it's possible to use other package managers in other
layers.

Signed-off-by: Fredrik Gustafsson 
---
 meta/lib/oe/package_manager/deb/sdk.py | 95 ++
 meta/lib/oe/sdk.py | 87 +--
 2 files changed, 96 insertions(+), 86 deletions(-)
 create mode 100644 meta/lib/oe/package_manager/deb/sdk.py

diff --git a/meta/lib/oe/package_manager/deb/sdk.py 
b/meta/lib/oe/package_manager/deb/sdk.py
new file mode 100644
index 00..26daed66a8
--- /dev/null
+++ b/meta/lib/oe/package_manager/deb/sdk.py
@@ -0,0 +1,95 @@
+#
+# SPDX-License-Identifier: GPL-2.0-only
+#
+
+from oe.utils import execute_pre_post_process
+from oe.sdk import Sdk
+from oe.manifest import Manifest
+from oe.package_manager import DpkgPM
+import shutil
+
+class DpkgSdk(Sdk):
+def __init__(self, d, manifest_dir=None):
+super(DpkgSdk, self).__init__(d, manifest_dir)
+
+self.target_conf_dir = os.path.join(self.d.getVar("APTCONF_TARGET"), 
"apt")
+self.host_conf_dir = os.path.join(self.d.getVar("APTCONF_TARGET"), 
"apt-sdk")
+
+from oe.package_managers.deb.manifest import DpkgManifest
+
+self.target_manifest = DpkgManifest(d, self.manifest_dir,
+Manifest.MANIFEST_TYPE_SDK_TARGET)
+self.host_manifest = DpkgManifest(d, self.manifest_dir,
+  Manifest.MANIFEST_TYPE_SDK_HOST)
+
+deb_repo_workdir = "oe-sdk-repo"
+if "sdk_ext" in d.getVar("BB_RUNTASK"):
+deb_repo_workdir = "oe-sdk-ext-repo"
+
+self.target_pm = DpkgPM(d, self.sdk_target_sysroot,
+self.d.getVar("PACKAGE_ARCHS"),
+self.d.getVar("DPKG_ARCH"),
+self.target_conf_dir,
+deb_repo_workdir=deb_repo_workdir)
+
+self.host_pm = DpkgPM(d, self.sdk_host_sysroot,
+  self.d.getVar("SDK_PACKAGE_ARCHS"),
+  self.d.getVar("DEB_SDK_ARCH"),
+  self.host_conf_dir,
+  deb_repo_workdir=deb_repo_workdir)
+
+def _copy_apt_dir_to(self, dst_dir):
+staging_etcdir_native = self.d.getVar("STAGING_ETCDIR_NATIVE")
+
+self.remove(dst_dir, True)
+
+shutil.copytree(os.path.join(staging_etcdir_native, "apt"), dst_dir)
+
+def _populate_sysroot(self, pm, manifest):
+pkgs_to_install = manifest.parse_initial_manifest()
+
+pm.write_index()
+pm.update()
+
+for pkg_type in self.install_order:
+if pkg_type in pkgs_to_install:
+pm.install(pkgs_to_install[pkg_type],
+   [False, True][pkg_type == 
Manifest.PKG_TYPE_ATTEMPT_ONLY])
+
+def _populate(self):
+execute_pre_post_process(self.d, 
self.d.getVar("POPULATE_SDK_PRE_TARGET_COMMAND"))
+
+bb.note("Installing TARGET packages")
+self._populate_sysroot(self.target_pm, self.target_manifest)
+
+
self.target_pm.install_complementary(self.d.getVar('SDKIMAGE_INSTALL_COMPLEMENTARY'))
+
+self.target_pm.run_intercepts(populate_sdk='target')
+
+execute_pre_post_process(self.d, 
self.d.getVar("POPULATE_SDK_POST_TARGET_COMMAND"))
+
+self._copy_apt_dir_to(os.path.join(self.sdk_target_sysroot, "etc", 
"apt"))
+
+if not bb.utils.contains("SDKIMAGE_FEATURES", "package-management", 
True, False, self.d):
+self.target_pm.remove_packaging_data()
+
+bb.note("Installing NATIVESDK packages")
+self._populate_sysroot(self.host_pm, self.host_manifest)
+self.install_locales(self.host_pm)
+
+self.host_pm.run_intercepts(populate_sdk='host')
+
+execute_pre_post_process(self.d, 
self.d.getVar("POPULATE_SDK_POST_HOST_COMMAND"))
+
+self._copy_apt_dir_to(os.path.join(self.sdk_output, 
self.sdk_native_path,
+   "etc", "apt"))
+
+if not bb.utils.contains("SDKIMAGE_FEATURES", "package-management", 
True, False, self.d):
+self.host_pm.remove_packaging_data()
+
+native_dpkg_state_dir = os.path.join(self.sdk_output, 
self.sdk_native_path,
+ "var", "lib", "dpkg")
+self.mkdirhier(native_dpkg_state_dir)
+for f in glob.glob(os.path.join(self.sdk_output, "var", "lib", "dpkg", 
"*")):
+self.movefile(f, native_dpkg_state_dir)
+self.remove(os.path.join(self.sdk_output, "var"), True)
diff --git a/meta/lib/oe/sdk.py b/meta/lib/oe/sdk.py
index 6907d3a6d8..eb70a87832 100644
--- a/meta/lib/oe/sdk.py
+++ b/meta/lib/oe/sdk.py
@@ -110,92 +110,6 @@ class Sdk(object, metaclass=ABCMeta):
 pass
 
 
-class DpkgSdk(Sdk):
-def __init__(self, d, manifest_dir=None):
-super(DpkgSdk, self).__init__(d

[OE-core] [PATCH v5 12/13] ipk: Move package manager to its own dir

2020-07-22 Thread Fredrik Gustafsson
This is part of a refactor that will split the package manager
code so that it's possible to use other package managers in other
layers.

Signed-off-by: Fredrik Gustafsson 
---
 meta/lib/oe/package_manager/__init__.py   | 432 ---
 .../oe/package_manager/ipk/package_manager.py | 504 ++
 meta/lib/oe/package_manager/ipk/rootfs.py |   2 +-
 3 files changed, 505 insertions(+), 433 deletions(-)
 create mode 100644 meta/lib/oe/package_manager/ipk/package_manager.py

diff --git a/meta/lib/oe/package_manager/__init__.py 
b/meta/lib/oe/package_manager/__init__.py
index 2ca47e5109..af254fcf6e 100644
--- a/meta/lib/oe/package_manager/__init__.py
+++ b/meta/lib/oe/package_manager/__init__.py
@@ -149,59 +149,6 @@ class Indexer(object, metaclass=ABCMeta):
 def write_index(self):
 pass
 
-class OpkgIndexer(Indexer):
-def write_index(self):
-arch_vars = ["ALL_MULTILIB_PACKAGE_ARCHS",
- "SDK_PACKAGE_ARCHS",
- ]
-
-opkg_index_cmd = bb.utils.which(os.getenv('PATH'), "opkg-make-index")
-if self.d.getVar('PACKAGE_FEED_SIGN') == '1':
-signer = get_signer(self.d, 
self.d.getVar('PACKAGE_FEED_GPG_BACKEND'))
-else:
-signer = None
-
-if not os.path.exists(os.path.join(self.deploy_dir, "Packages")):
-open(os.path.join(self.deploy_dir, "Packages"), "w").close()
-
-index_cmds = set()
-index_sign_files = set()
-for arch_var in arch_vars:
-archs = self.d.getVar(arch_var)
-if archs is None:
-continue
-
-for arch in archs.split():
-pkgs_dir = os.path.join(self.deploy_dir, arch)
-pkgs_file = os.path.join(pkgs_dir, "Packages")
-
-if not os.path.isdir(pkgs_dir):
-continue
-
-if not os.path.exists(pkgs_file):
-open(pkgs_file, "w").close()
-
-index_cmds.add('%s --checksum md5 --checksum sha256 -r %s -p 
%s -m %s' %
-  (opkg_index_cmd, pkgs_file, pkgs_file, 
pkgs_dir))
-
-index_sign_files.add(pkgs_file)
-
-if len(index_cmds) == 0:
-bb.note("There are no packages in %s!" % self.deploy_dir)
-return
-
-oe.utils.multiprocess_launch(create_index, index_cmds, self.d)
-
-if signer:
-feed_sig_type = self.d.getVar('PACKAGE_FEED_GPG_SIGNATURE_TYPE')
-is_ascii_sig = (feed_sig_type.upper() != "BIN")
-for f in index_sign_files:
-signer.detach_sign(f,
-   self.d.getVar('PACKAGE_FEED_GPG_NAME'),
-   
self.d.getVar('PACKAGE_FEED_GPG_PASSPHRASE_FILE'),
-   armor=is_ascii_sig)
-
-
 class DpkgIndexer(Indexer):
 def _create_configs(self):
 bb.utils.mkdirhier(self.apt_conf_dir)
@@ -286,33 +233,6 @@ class PkgsList(object, metaclass=ABCMeta):
 def list_pkgs(self):
 pass
 
-class OpkgPkgsList(PkgsList):
-def __init__(self, d, rootfs_dir, config_file):
-super(OpkgPkgsList, self).__init__(d, rootfs_dir)
-
-self.opkg_cmd = bb.utils.which(os.getenv('PATH'), "opkg")
-self.opkg_args = "-f %s -o %s " % (config_file, rootfs_dir)
-self.opkg_args += self.d.getVar("OPKG_ARGS")
-
-def list_pkgs(self, format=None):
-cmd = "%s %s status" % (self.opkg_cmd, self.opkg_args)
-
-# opkg returns success even when it printed some
-# "Collected errors:" report to stderr. Mixing stderr into
-# stdout then leads to random failures later on when
-# parsing the output. To avoid this we need to collect both
-# output streams separately and check for empty stderr.
-p = subprocess.Popen(cmd, stdout=subprocess.PIPE, 
stderr=subprocess.PIPE, shell=True)
-cmd_output, cmd_stderr = p.communicate()
-cmd_output = cmd_output.decode("utf-8")
-cmd_stderr = cmd_stderr.decode("utf-8")
-if p.returncode or cmd_stderr:
-bb.fatal("Cannot get the installed packages list. Command '%s' "
- "returned %d and stderr:\n%s" % (cmd, p.returncode, 
cmd_stderr))
-
-return opkg_query(cmd_output)
-
-
 class DpkgPkgsList(PkgsList):
 
 def list_pkgs(self):
@@ -763,358 +683,6 @@ class OpkgDpkgPM(PackageManager):
 def _handle_intercept_failure(self, registered_pkgs):
 self.mark_packages("unpacked", registered_pkgs.split())
 
-class OpkgPM(OpkgDpkgPM):
-def __init__(self, d, target_rootfs, config_file, archs, 
task_name='target', ipk_repo_workdir="oe-rootfs-repo", 
filterbydependencies=True, prepare_index=True):
-super(OpkgPM, self).__init__(d, target_rootfs)
-
-self.config_file = config_file
-self.pkg_archs = archs
-self.task_name = task_name
-
-self.deploy_dir = oe.path.join(self.d.getV

Re: [OE-core] [PATCH] qemurunner: Use tempfile.mkstemp to create pidfile name

2020-07-22 Thread Richard Purdie
On Tue, 2020-07-21 at 18:49 -0500, Joshua Watt wrote:
> 
> 
> On Tue, Jul 21, 2020, 4:56 PM Richard Purdie 
>  wrote:
> > We continue to see qemu races where qemu fails to write out a pidfile. The
> > pidfile name being used was based on the parent process starting the qemus
> > so in theory, a qemu shutting down could have deleted the file into which
> > the new qemu's pid was about to be written. This shouldn't happen as qemu
> > processes should be exitting completely before the code returns.
> > 
> > In the absence of better theory for the failure, use a random pid filename
> > rather than the parent pid so there is no overlap in the pid filename,
> > thereby removing any theoretical race.
> > 
> > Signed-off-by: Richard Purdie 
> > ---
> >  meta/lib/oeqa/utils/qemurunner.py | 9 ++---
> >  1 file changed, 6 insertions(+), 3 deletions(-)
> > 
> > diff --git a/meta/lib/oeqa/utils/qemurunner.py 
> > b/meta/lib/oeqa/utils/qemurunner.py
> > index 519aa9aa1e5..73a3efdc964 100644
> > --- a/meta/lib/oeqa/utils/qemurunner.py
> > +++ b/meta/lib/oeqa/utils/qemurunner.py
> > @@ -20,6 +20,7 @@ import string
> >  import threading
> >  import codecs
> >  import logging
> > +import tempfile
> >  from oeqa.utils.dump import HostDumper
> >  from collections import defaultdict
> > 
> > @@ -65,7 +66,11 @@ class QemuRunner:
> >  self.runqemutime = 120
> >  if not workdir:
> >  workdir = os.getcwd()
> > -self.qemu_pidfile = workdir + '/pidfile_' + str(os.getpid())
> > +# Use tempfile to obtain a unique name. We own the directory
> > +# so closing the file isn't an issue as long as we don't delete it
> > +self.qemu_pidfile = tempfile.mkstemp(dir=workdir, 
> > prefix="qemupid_")
> > +os.close(self.qemu_pidfile[0])
> > +self.qemu_pidfile = self.qemu_pidfile[1]
> 
> Minor, but more idiomatic python:
> 
>  (fd, self.qemu_pidfile) = tempfile.mkstemp(...)
>  os.close(fd)

Yes!

I'd changed the code a few too many times and it ended up a bit silly.

Sadly the autobuilder showed the same fault with this applied so this
patch doesn't work anyway and probably isn't worth applying :(

If anyone can spot the race...

Cheers,

Richard

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#140852): 
https://lists.openembedded.org/g/openembedded-core/message/140852
Mute This Topic: https://lists.openembedded.org/mt/75713689/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] gcc-10.1: add fix for PR 96130

2020-07-22 Thread Nicolas Dechesne
Khem, Richard,

On Fri, Jul 17, 2020 at 12:36 AM Dmitry Baryshkov  wrote:
>
> From: Dmitry Baryshkov 
>
> Fix for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96130 causing ICE
> (SegFault) when compiling current Mesa git tree.

This fixes the build issue reported when trying to build mesa master
branch, see:
https://github.com/ndechesne/meta-qcom/pull/174

While we aren't using mesa/master in OE core, some BSP layer might be
doing that. If mesa gets released before gcc, we might hit this issue.
The gcc is queued for 10.2 already. If we can't get this patch in OE
core, we will host in our layer..

>
> Signed-off-by: Dmitry Baryshkov 
> ---
>  meta/recipes-devtools/gcc/gcc-10.1.inc|   1 +
>  .../gcc/gcc-10.1/pr96130.patch| 106 ++
>  2 files changed, 107 insertions(+)
>  create mode 100644 meta/recipes-devtools/gcc/gcc-10.1/pr96130.patch
>
> diff --git a/meta/recipes-devtools/gcc/gcc-10.1.inc 
> b/meta/recipes-devtools/gcc/gcc-10.1.inc
> index a3de91a2c6a3..a2dd2ae252a5 100644
> --- a/meta/recipes-devtools/gcc/gcc-10.1.inc
> +++ b/meta/recipes-devtools/gcc/gcc-10.1.inc
> @@ -66,6 +66,7 @@ SRC_URI = "\
> file://0036-Enable-CET-in-cross-compiler-if-possible.patch \
> file://0037-mingw32-Enable-operation_not_supported.patch \
> file://0038-libatomic-Do-not-enforce-march-on-aarch64.patch \
> +   file://pr96130.patch \
>  "
>  SRC_URI[sha256sum] = 
> "b6898a23844b656f1b68691c5c012036c2e694ac4b53a8918d4712ad876e7ea2"
>
> diff --git a/meta/recipes-devtools/gcc/gcc-10.1/pr96130.patch 
> b/meta/recipes-devtools/gcc/gcc-10.1/pr96130.patch
> new file mode 100644
> index ..f0e6f85e22f9
> --- /dev/null
> +++ b/meta/recipes-devtools/gcc/gcc-10.1/pr96130.patch
> @@ -0,0 +1,106 @@
> +From 0d03c0ee5213703ec6d9ffa632fa5298d83adaaa Mon Sep 17 00:00:00 2001
> +From: Jakub Jelinek 
> +Date: Mon, 13 Jul 2020 18:25:53 +0200
> +Subject: [PATCH] ipa-fnsummary: Fix ICE with switch predicates [PR96130]
> +
> +The following testcase ICEs since r10-3199.
> +There is a switch with default label, where the controlling expression has
> +range just 0..7 and there are case labels for all those 8 values, but
> +nothing has yet optimized away the default.
> +Since r10-3199, set_switch_stmt_execution_predicate sets the switch to
> +default label's edge's predicate to a false predicate and then
> +compute_bb_predicates propagates the predicates through the cfg, but false
> +predicates aren't really added.  The caller of compute_bb_predicates
> +in one place handles NULL bb->aux as false predicate:
> +  if (fbi.info)
> +   {
> + if (bb->aux)
> +   bb_predicate = *(predicate *) bb->aux;
> + else
> +   bb_predicate = false;
> +   }
> +  else
> +   bb_predicate = true;
> +but then in two further spots that the patch below is changing
> +it assumes bb->aux must be non-NULL.  Those two spots are guarded by a
> +condition that is only true if fbi.info is non-NULL, so I think the right
> +fix is to treat NULL aux as false predicate in those spots too.
> +
> +2020-07-13  Jakub Jelinek  
> +
> +   PR ipa/96130
> +   * ipa-fnsummary.c (analyze_function_body): Treat NULL bb->aux
> +   as false predicate.
> +
> +   * gcc.dg/torture/pr96130.c: New test.
> +
> +(cherry picked from commit 776e48e0931db69f158f40e5cb8e15463d879a42)
> +---
> + gcc/ipa-fnsummary.c| 10 --
> + gcc/testsuite/gcc.dg/torture/pr96130.c | 26 ++
> + 2 files changed, 34 insertions(+), 2 deletions(-)
> + create mode 100644 gcc/testsuite/gcc.dg/torture/pr96130.c
> +
> +diff --git a/gcc/ipa-fnsummary.c b/gcc/ipa-fnsummary.c
> +index 045a0ecf766..55a0b272a96 100644
> +--- a/gcc/ipa-fnsummary.c
>  b/gcc/ipa-fnsummary.c
> +@@ -2766,7 +2766,10 @@ analyze_function_body (struct cgraph_node *node, bool 
> early)
> + edge ex;
> + unsigned int j;
> + class tree_niter_desc niter_desc;
> +-bb_predicate = *(predicate *) loop->header->aux;
> ++if (loop->header->aux)
> ++  bb_predicate = *(predicate *) loop->header->aux;
> ++else
> ++  bb_predicate = false;
> +
> + exits = get_loop_exit_edges (loop);
> + FOR_EACH_VEC_ELT (exits, j, ex)
> +@@ -2799,7 +2802,10 @@ analyze_function_body (struct cgraph_node *node, bool 
> early)
> + for (unsigned i = 0; i < loop->num_nodes; i++)
> +   {
> + gimple_stmt_iterator gsi;
> +-bb_predicate = *(predicate *) body[i]->aux;
> ++if (body[i]->aux)
> ++  bb_predicate = *(predicate *) body[i]->aux;
> ++else
> ++  bb_predicate = false;
> + for (gsi = gsi_start_bb (body[i]); !gsi_end_p (gsi);
> +  gsi_next (&gsi))
> +   {
> +diff --git a/gcc/testsuite/gcc.dg/torture/pr96130.c 
> b/gcc/testsuite/gcc.dg/torture/pr96130.c
> +new file mode 100644
> +index 000

Re: [OE-core] "DEPENDS =" versus "DEPENDS +=" in recipe files

2020-07-22 Thread Quentin Schulz
Hi Robert,

On Tue, Jul 21, 2020 at 05:26:50PM -0400, Robert P. J. Day wrote:
> pursuant to cleaning up some docs and tweaking the style guide,
> i just want to clarify that the *proper* assignment to DEPENDS
> in recipe files is:
> 
>   DEPENDS = "..."
> 
> unless (of course) that assignment is preceded by a "require"
> of a .inc file that assigns to that variable, whereupon the "+="
> would make sense.
> 

And inherited class(es). In which case, I guess the use of _append or +=
at least are required (in the class ideally I'd say), otherwise if
DEPENDS is set in the recipe before inheriting, it'll be overwritten by
the class's `DEPENDS =`.

Quentin
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#140850): 
https://lists.openembedded.org/g/openembedded-core/message/140850
Mute This Topic: https://lists.openembedded.org/mt/75713204/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-