Re: [OE-core] [PATCH v2] bitbake.conf: Enable ipv6/acl/xattr for nativesdk

2024-11-06 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org 
>  On Behalf Of Richard Purdie
> Sent: den 6 november 2024 11:10
> To: openembedded-core@lists.openembedded.org
> Subject: [OE-core] [PATCH v2] bitbake.conf: Enable ipv6/acl/xattr for 
> nativesdk
> 
> I was surprised to realise our buildtools doesn't support IPv6 which breaks
> usage in our own autobuilder, let alone anywhere else.
> 
> Enable ipv6 in our SDKs and enable acl/xattr as well before we have the same
> kind of issues with those, these features are now common on most linux systems
> and we should be defaulting to including them.
> 
> Signed-off-by: Richard Purdie 
> ---
> v2 - Handle mingw which doesn't support acl/attr
> 
>  meta/conf/bitbake.conf | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> index 14e761e2e7e..02bbf0e7a52 100644
> --- a/meta/conf/bitbake.conf
> +++ b/meta/conf/bitbake.conf
> @@ -916,7 +916,8 @@ IMAGE_FEATURES += "${EXTRA_IMAGE_FEATURES}"
>  # Native distro features (will always be used for -native, even if they
>  # are not enabled for target)
>  DISTRO_FEATURES_NATIVE ?= "acl x11 ipv6 xattr"
> -DISTRO_FEATURES_NATIVESDK ?= "x11"
> +DISTRO_FEATURES_NATIVESDK ?= "acl x11 ipv6 xattr"
> +DISTRO_FEATURES_NATIVESDK:mingw32 = "x11 ipv6"

While I know you do not like :remove in OE-Core, isn't this a case where it 
should be used? I.e.:

DISTRO_FEATURES_NATIVESDK:remove:mingw32 = "acl xattr"

Otherwise someone doing DISTRO_FEATURES_NATIVESDK += "foobar" in their 
configuration will get a very unexpected result if they are building for 
mingw32 after the above is integrated.

An alternative would be:

DISTRO_FEATURES_NATIVE_DEFAULT = "acl x11 ipv6 xattr"
DISTRO_FEATURES_NATIVE_DEFAULT:mingw32 = "x11 ipv6"
DISTRO_FEATURES_NATIVE ?= "${DISTRO_FEATURES_NATIVE_DEFAULT}"
DISTRO_FEATURES_NATIVESDK ?= "${DISTRO_FEATURES_NATIVE_DEFAULT}"

>  
>  # Normally target distro features will not be applied to native builds:
>  # Native distro features on this list will use the target feature value

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#206803): 
https://lists.openembedded.org/g/openembedded-core/message/206803
Mute This Topic: https://lists.openembedded.org/mt/109422356/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 4/4] local.conf.sample: use explicit IMAGE_FEATURES instead of debug-tweaks

2024-11-06 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org 
>  On Behalf Of Ross Burton
> Sent: den 5 november 2024 20:49
> To: openembedded-core@lists.openembedded.org
> Subject: [OE-core] [PATCH 4/4] local.conf.sample: use explicit IMAGE_FEATURES 
> instead of debug-tweaks
> 
> debug-tweaks is vague and doesn't give any indication that the root user
> can login over SSH without a password.  This behaviour is incredibly
> dangerous if used unwittingly, so discourage it by using the underlying
> features explicitly to spell out exactly what is being done.
> 
> This is not the complete set of features that debug-tweaks enables,
> but I don't think we need to enable serial-autologin-root or
> post-install-logging by default.
> 
> Signed-off-by: Ross Burton 
> ---
>  meta-poky/conf/templates/default/local.conf.sample | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/meta-poky/conf/templates/default/local.conf.sample 
> b/meta-poky/conf/templates/default/local.conf.sample
> index 72d35662940..cfa77106ab3 100644
> --- a/meta-poky/conf/templates/default/local.conf.sample
> +++ b/meta-poky/conf/templates/default/local.conf.sample
> @@ -145,8 +145,8 @@ DISTRO ?= "poky"

A few lines above, suitable features to use in EXTRA_IMAGE_FEATURES are 
listed. This list includes debug-tweaks, but none of the features that 
you now set as default below...

>  # There are other application targets that can be used here too, see
>  # meta/classes-recipe/image.bbclass and
>  # meta/classes-recipe/core-image.bbclass for more details.
> -# We default to enabling the debugging tweaks.
> -EXTRA_IMAGE_FEATURES ?= "debug-tweaks"
> +# We default to allowing root login without a password for convenience.
> +EXTRA_IMAGE_FEATURES ?= "allow-empty-password empty-root-password 
> allow-root-login"
> 
>  #
>  # Additional image features
> --
> 2.34.1

//Peter

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#206802): 
https://lists.openembedded.org/g/openembedded-core/message/206802
Mute This Topic: https://lists.openembedded.org/mt/109412890/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] devtool: modify: add DEVTOOL_PREFER_BRANCH support

2024-11-04 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org  c...@lists.openembedded.org> On Behalf Of Chris Laplante via
> lists.openembedded.org
> Sent: den 4 november 2024 20:58
> To: Richard Purdie ;
> alex.kana...@gmail.com
> Cc: openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH] devtool: modify: add DEVTOOL_PREFER_BRANCH
> support
> 
> Hi Richard,
> 
> > > Internally, my experience has been that users do not notice the
> > > 'devtool' branch has been checked out. They go to push their changes
> > > and end up creating a bizarre 'devtool' branch on the remote, which
> > > obviously doesn’t get picked up by our build.
> > >
> > > In the case of AUTOREV without any local patches, I'd argue that by
> > > default 'devtool modify' should checkout the branch from SRC_URI. We
> > > could add a flag to override that behavior (e.g. -d), or alternatively
> > > hint to the user they can pass '--branch devtool'.
> > >
> > > Would we be OK with this? If we're worried about it breaking backwards
> > > compatibility, then I would prefer to have an escape hatch (like
> > > DEVTOOL_PREFER_BRANCH) that I can use to opt-in to the new behavior.
> >
> > There are a few conflicting things here. We've tried to make devtool
> modify
> > behave the same whether it operates on something source control based or
> > tarball based, in both cases with and without patches or additional
> config/data
> > files. That is a good thing in general but I can see how in this case it
> doesn't do
> > what the user would like.
> >
> > How clearly is devtool saying what it is doing? Is the user being told
> that a
> > "devtool" branch is being created to hold their changes?
> 
> Currently, 'devtool modify' doesn’t say anything about creating the
> 'devtool' branch. It just says:
> 
> INFO: Source tree extracted to /wherever
> INFO: Recipe  now set up to build from /wherever
> 
> > It isn't unreasonable to hold our local changes on the basis that the
> user wants
> > to write them back into the recipe so the tool does really need a way to
> track
> > that.
> >
> > I think UI people looking at this from the bigger perspective would
> consider the
> > behaviour changing depending on context to be confusing and perhaps the
> real
> > issue is we're not telling the user what is going on (perhaps with some
> detail on
> > *why* in the docs too)?
> >
> > I'm not worried about breaking compatibility, I'm worried about making
> the
> > experience inconsistent. A new magic config option doesn't really make
> me feel
> > that much happier, it just forks our UI into two streams making things
> generally
> > more confusing to users :(.
> 
> From my POV, it kind of makes sense to have slightly different UI
> behaviors, since I see at least two different types of devtool users:
> 
> 1. Layer maintainers (like myself) who care about creating patches for
> upstream software that we probably don't control.
> 2. Developers (most of my colleagues) who use 'devtool' as a convenience
> to test and develop changes to our closed-source components. These are our
> AUTOREV recipes. Some (most?) of these users probably don't know about
> devtool's patching functionality, but that's fine since they don't need
> it.
> 
> So to me it makes sense that the UI might be a little different for these
> cases.
> 
> That being said, I understand if we don't want to fracture the UI. I'm
> perfectly happy to continue modifying our fork of poky if that's the case
> :).
> 
> > As well as making devtool clearly tell the user what it is doing, could
> we set up
> > the remotes in the git repos so that pushes did the expected thing
> instead (i.e.
> > map devtool back to master/main/whatever)?
> 
> I think trying to be crafty with remotes is going to be even more
> confusing to users. What I could *maybe* see doing is tinkering with some
> git hooks (https://git-scm.com/book/ms/v2/Customizing-Git-Git-Hooks) to
> warn or nudge the user somehow. Even that I fear is not worth the
> complications.

I would strongly advise against involving hooks. I just recently managed to 
get rid of the hook that was involved in keeping track of the patch name 
when devtool modify creates a commit from a patch, and I would hate to see 
a new usage of hooks introduced.

> > Cheers,
> >
> > Richard

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#206696): 
https://lists.openembedded.org/g/openembedded-core/message/206696
Mute This Topic: https://lists.openembedded.org/mt/109341115/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH 2/3] Revert "busybox: Make provisions to disable sha256/sha1 accelaration on x86"

2024-11-02 Thread Peter Kjellerstedt
This reverts commit 22f639d61127f4b82a79008c5305e44e090a3680.

The underlying problem has now been corrected so that acceleration can
be enabled regardless of the architecture.

Signed-off-by: Peter Kjellerstedt 
---
 meta/recipes-core/busybox/busybox/sha1sum.cfg   | 2 +-
 meta/recipes-core/busybox/busybox/sha256sum.cfg | 2 +-
 meta/recipes-core/busybox/busybox/sha_accel.cfg | 2 --
 meta/recipes-core/busybox/busybox_1.37.0.bb | 2 +-
 4 files changed, 3 insertions(+), 5 deletions(-)
 delete mode 100644 meta/recipes-core/busybox/busybox/sha_accel.cfg

diff --git a/meta/recipes-core/busybox/busybox/sha1sum.cfg 
b/meta/recipes-core/busybox/busybox/sha1sum.cfg
index 151c447658..01137a2486 100644
--- a/meta/recipes-core/busybox/busybox/sha1sum.cfg
+++ b/meta/recipes-core/busybox/busybox/sha1sum.cfg
@@ -1,3 +1,3 @@
 CONFIG_SHA1SUM=y
 CONFIG_SHA1_SMALL=3
-# CONFIG_SHA1_HWACCEL is not set
+CONFIG_SHA1_HWACCEL=y
diff --git a/meta/recipes-core/busybox/busybox/sha256sum.cfg 
b/meta/recipes-core/busybox/busybox/sha256sum.cfg
index aa0b0b0b98..a5b0ab22d1 100644
--- a/meta/recipes-core/busybox/busybox/sha256sum.cfg
+++ b/meta/recipes-core/busybox/busybox/sha256sum.cfg
@@ -1,2 +1,2 @@
 CONFIG_SHA256SUM=y
-# CONFIG_SHA256_HWACCEL is not set
+CONFIG_SHA256_HWACCEL=y
diff --git a/meta/recipes-core/busybox/busybox/sha_accel.cfg 
b/meta/recipes-core/busybox/busybox/sha_accel.cfg
deleted file mode 100644
index 70038a8509..00
--- a/meta/recipes-core/busybox/busybox/sha_accel.cfg
+++ /dev/null
@@ -1,2 +0,0 @@
-CONFIG_SHA1_HWACCEL=y
-CONFIG_SHA256_HWACCEL=y
diff --git a/meta/recipes-core/busybox/busybox_1.37.0.bb 
b/meta/recipes-core/busybox/busybox_1.37.0.bb
index 3aae6eff4d..1051fd1920 100644
--- a/meta/recipes-core/busybox/busybox_1.37.0.bb
+++ b/meta/recipes-core/busybox/busybox_1.37.0.bb
@@ -56,5 +56,5 @@ SRC_URI = 
"https://busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
file://0001-libbb-fix-sha1-on-x86-if-CONFIG_SHA1_HWACCEL-y.patch \
"
 SRC_URI:append:libc-musl = " file://musl.cfg"
-SRC_URI:append:x86-64 = " file://sha_accel.cfg"
+
 SRC_URI[tarball.sha256sum] = 
"3311dff32e746499f4df0d5df04d7eb396382d7e108bb9250e7b519b837043a4"

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#206653): 
https://lists.openembedded.org/g/openembedded-core/message/206653
Mute This Topic: https://lists.openembedded.org/mt/109357847/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [PATCH v2 2/9] busybox: disable defconfig options from simpler fragments

2024-11-02 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org 
>  On Behalf Of Enrico Jörns
> Sent: den 29 oktober 2024 21:47
> To: Andrej Valek ; Richard Purdie 
> 
> Cc: yo...@pengutronix.de; openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH v2 2/9] busybox: disable defconfig options from 
> simpler fragments
> 
> Hi Andrej,
> 
> thanks for your review!
> 
> Am Dienstag, dem 29.10.2024 um 17:32 +0100 schrieb Andrej Valek:
> > Hello Enrico,
> >
> > On 28.10.2024 11:39, Enrico Jörns wrote:
> > > Hej Andrej,
> > >
> > > Am Montag, dem 28.10.2024 um 10:06 +0100 schrieb Andrej Valek:
> > > >   Hello Enrico,
> > > >
> > > >   I tried to follow (and applied) your patch, but it looks little
> bit inconsistent to me. In
> > > > the
> > > > first round you enabled SHAx_HWACCEL, which is broken on some
> architectures. That's the
> > > > reason,
> > > > why is disabled by default. Ok, so first apply looks like this:
> > > let me rephrase my commit message.
> > >
> > > The SHAx_HWACCEL is broken on some architectures, right.
> > > However, when you take the defconfig, without the fragments, it will
> currently be enabled.
> > > Regardless of what's in my patch.
> > >
> > > Why? Because CONFIG_SHA1_HWACCEL in Busybox' kconfig is 'default y',
> has no dependency on other
> > > options and is not listed in the 'defconfig' file so far.
> > >
> > > Thus, my first patch should not change the current situation.
> > Ok, I see the point. So basically you can drop the sha1sum.cfg and
> > sha256sum.cfg and merge it to defconfing. The result will be, that the
> > acceleration is disabled.
> 
> Just to get it right: Do we talk about the HWACCEL only or about enabling
> SHA1SUM and SHA256SUM
> unconditionally and fully removing the fragments?
> 
> Personally, I'd be fine with this since the algorithm are quite essential
> anyway.
> 
> If that's the only thing to change, I'd start making a v3 for it.
> 
> > >
> > > >   Anyway, there was one commit in the usptream which was touching
> the acceleration. So I have
> > > > to
> > > > try it on the broken machine and see if it's still broken or not.
> > > If you refer to oe-core upstream, yes there have been changes.
> > > This is why I needed to rebase and rework my branch.
> > > Or are there other changes I am not aware of, yet?
> > Not sure if you caught the point. I mean, that I will take a look on the
> > upstream fixes for acceleration and then we can enable it by default.
> 
> Ok, so you referred to *busybox* upstream, not oe-core. Got it.
> 
> I've found
> https://git.busybox.net/busybox/commit/?id=bf57f732a5b6842f6fa3e0f90385f039e5d6a92c
> Is this the fix you referred to?

I have sent a patch to backport the above commit. I also sent two patches to 
remove the no longer needed sha_accel.cfg file, and to clean up the sha*sum.cfg 
files.

> > > > > [...]
> > > >
> > So if the result is, that the configuration hasn't been changed at the
> > end, I'm fine with the changes you did ;).
> 
> Sounds good!
> 
> Regards, Enrico
> 
> > Regards,
> > Andrej

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#206656): 
https://lists.openembedded.org/g/openembedded-core/message/206656
Mute This Topic: https://lists.openembedded.org/mt/109253494/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH 1/3] busybox: Backport a patch to build with CONFIG_SHA1_HWACCEL on non-x86

2024-11-02 Thread Peter Kjellerstedt
This allows CONFIG_SHA1_HWACCEL to be enabled regardless of the
architecture.

Signed-off-by: Peter Kjellerstedt 
---
 ...sha1-on-x86-if-CONFIG_SHA1_HWACCEL-y.patch | 33 +++
 meta/recipes-core/busybox/busybox_1.37.0.bb   |  1 +
 2 files changed, 34 insertions(+)
 create mode 100644 
meta/recipes-core/busybox/busybox/0001-libbb-fix-sha1-on-x86-if-CONFIG_SHA1_HWACCEL-y.patch

diff --git 
a/meta/recipes-core/busybox/busybox/0001-libbb-fix-sha1-on-x86-if-CONFIG_SHA1_HWACCEL-y.patch
 
b/meta/recipes-core/busybox/busybox/0001-libbb-fix-sha1-on-x86-if-CONFIG_SHA1_HWACCEL-y.patch
new file mode 100644
index 00..2af188938e
--- /dev/null
+++ 
b/meta/recipes-core/busybox/busybox/0001-libbb-fix-sha1-on-x86-if-CONFIG_SHA1_HWACCEL-y.patch
@@ -0,0 +1,33 @@
+From bf57f732a5b6842f6fa3e0f90385f039e5d6a92c Mon Sep 17 00:00:00 2001
+From: Rudi Heitbaum 
+Date: Sun, 29 Sep 2024 17:57:55 +
+Subject: [PATCH] libbb: fix sha1 on !x86 if CONFIG_SHA1_HWACCEL=y
+
+fixes non i386 and x86 builds
+
+libbb/hash_md5_sha.c: In function 'sha1_end':
+libbb/hash_md5_sha.c:1316:35: error: 'sha1_process_block64_shaNI' undeclared
+ 1316 |  || ctx->process_block == sha1_process_block64_shaNI
+
+Signed-off-by: Rudi Heitbaum 
+Signed-off-by: Denys Vlasenko 
+Upstream-Status: Backport 
[https://git.busybox.net/busybox/commit/?id=bf57f732a5b6842f6fa3e0f90385f039e5d6a92c]
+Signed-off-by: Peter Kjellerstedt 
+---
+ libbb/hash_md5_sha.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/libbb/hash_md5_sha.c b/libbb/hash_md5_sha.c
+index 57a801459..75a61c32c 100644
+--- a/libbb/hash_md5_sha.c
 b/libbb/hash_md5_sha.c
+@@ -1313,7 +1313,9 @@ unsigned FAST_FUNC sha1_end(sha1_ctx_t *ctx, void 
*resbuf)
+   hash_size = 8;
+   if (ctx->process_block == sha1_process_block64
+ #if ENABLE_SHA1_HWACCEL
++# if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
+|| ctx->process_block == sha1_process_block64_shaNI
++# endif
+ #endif
+   ) {
+   hash_size = 5;
diff --git a/meta/recipes-core/busybox/busybox_1.37.0.bb 
b/meta/recipes-core/busybox/busybox_1.37.0.bb
index c3131eb453..3aae6eff4d 100644
--- a/meta/recipes-core/busybox/busybox_1.37.0.bb
+++ b/meta/recipes-core/busybox/busybox_1.37.0.bb
@@ -53,6 +53,7 @@ SRC_URI = 
"https://busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
file://0001-syslogd-fix-wrong-OPT_locallog-flag-detection.patch \
file://0002-start-stop-daemon-fix-tests.patch \
file://0003-start-stop-false.patch \
+   file://0001-libbb-fix-sha1-on-x86-if-CONFIG_SHA1_HWACCEL-y.patch \
"
 SRC_URI:append:libc-musl = " file://musl.cfg"
 SRC_URI:append:x86-64 = " file://sha_accel.cfg"

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#206655): 
https://lists.openembedded.org/g/openembedded-core/message/206655
Mute This Topic: https://lists.openembedded.org/mt/109357849/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH 3/3] busybox: Remove CONFIG_SHA1_SMALL and CONFIG_SHA*_HWACCEL from sha*sum.cfg

2024-11-02 Thread Peter Kjellerstedt
The options CONFIG_SHA1_SMALL, CONFIG_SHA1_HWACCEL and
CONFIG_SHA256_HWACCEL affect the common implementations of SHA-1 and
SHA-256. These are used regardless of if the sha1sum and/or sha256sum
applets are enabled. Thus it does not make sense to configure them in
the sha*sum.cfg files. Additionally, their values in the .cfg files
match the values in the defconfig file.

Signed-off-by: Peter Kjellerstedt 
---
 meta/recipes-core/busybox/busybox/sha1sum.cfg   | 2 --
 meta/recipes-core/busybox/busybox/sha256sum.cfg | 1 -
 2 files changed, 3 deletions(-)

diff --git a/meta/recipes-core/busybox/busybox/sha1sum.cfg 
b/meta/recipes-core/busybox/busybox/sha1sum.cfg
index 01137a2486..20e72d9263 100644
--- a/meta/recipes-core/busybox/busybox/sha1sum.cfg
+++ b/meta/recipes-core/busybox/busybox/sha1sum.cfg
@@ -1,3 +1 @@
 CONFIG_SHA1SUM=y
-CONFIG_SHA1_SMALL=3
-CONFIG_SHA1_HWACCEL=y
diff --git a/meta/recipes-core/busybox/busybox/sha256sum.cfg 
b/meta/recipes-core/busybox/busybox/sha256sum.cfg
index a5b0ab22d1..ce652ae4c6 100644
--- a/meta/recipes-core/busybox/busybox/sha256sum.cfg
+++ b/meta/recipes-core/busybox/busybox/sha256sum.cfg
@@ -1,2 +1 @@
 CONFIG_SHA256SUM=y
-CONFIG_SHA256_HWACCEL=y

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#206654): 
https://lists.openembedded.org/g/openembedded-core/message/206654
Mute This Topic: https://lists.openembedded.org/mt/109357848/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] do_package/sstate/sstatesig: Change timestamp clamping to hash output only

2024-10-25 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org 
>  On Behalf Of Richard Purdie
> Sent: den 25 oktober 2024 15:48
> To: openembedded-core@lists.openembedded.org
> Subject: [OE-core] [PATCH] do_package/sstate/sstatesig: Change timestamp 
> clamping to hash output only
> 
> The code was changing the timestamps of the files in the do_pcakage output,

Typo: do_pcakage -> do_package

//Peter

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#206357): 
https://lists.openembedded.org/g/openembedded-core/message/206357
Mute This Topic: https://lists.openembedded.org/mt/109207893/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core][PATCH v2 3/4] lib: package: Check incompatible licenses at packaging time

2024-10-24 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org 
>  On Behalf Of Joshua Watt
> Sent: den 23 oktober 2024 23:15
> To: openembedded-core@lists.openembedded.org
> Cc: Joshua Watt 
> Subject: [OE-core][PATCH v2 3/4] lib: package: Check incompatible licenses at 
> packaging time
> 
> Instead of checking for incompatible licenses in the anonymous python
> and setting '_exclude_incompatible-', (re)check all the packages in
> populate_packages(). This ensures that all packages are processed, even
> dynamically generated ones.
> 
> The use of the '_exclude-incompatible-' variable set in base.bbclass has
> been the mechanism used for per-packages licenses since its it was added
> as a feature (although with different names for the variable throughout
> history). However, since this misses dynamic packages, calling
> oe.license.skip_incompatible_package_licenses() a second time on the
> actual final package set is a better solution.
> 
> Signed-off-by: Joshua Watt 
> ---
>  meta/classes-global/base.bbclass | 1 -
>  meta/lib/oe/package.py   | 6 +++---
>  2 files changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/meta/classes-global/base.bbclass 
> b/meta/classes-global/base.bbclass
> index 5b8663f454d..b81e61fdb72 100644
> --- a/meta/classes-global/base.bbclass
> +++ b/meta/classes-global/base.bbclass
> @@ -581,7 +581,6 @@ python () {
>  if unskipped_pkgs:
>  for pkg in skipped_pkgs:
>  bb.debug(1, "Skipping the package %s at do_rootfs 
> because of incompatible license(s): %s" % (pkg, ' '.join(skipped_pkgs[pkg])))
> -d.setVar('_exclude_incompatible-' + pkg, ' 
> '.join(skipped_pkgs[pkg]))
>  for pkg in unskipped_pkgs:
>  bb.debug(1, "Including the package %s" % pkg)
>  else:
> diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py
> index c213a9a3ca6..480408e41e3 100644
> --- a/meta/lib/oe/package.py
> +++ b/meta/lib/oe/package.py
> @@ -1447,10 +1447,10 @@ def populate_packages(d):
> 
>  # Handle excluding packages with incompatible licenses
>  package_list = []
> +skipped_pkgs = oe.license.skip_incompatible_package_licenses(d, pkgs):

Umm, how well did you test this? ;)
The Python interpreter is not too happy about the trailing colon on the line 
above...

>  for pkg in packages:
> -licenses = d.getVar('_exclude_incompatible-' + pkg)
> -if licenses:
> -msg = "Excluding %s from packaging as it has incompatible 
> license(s): %s" % (pkg, licenses)
> +if pkg in skipped_pkgs:
> +msg = "Excluding %s from packaging as it has incompatible 
> license(s): %s" % (pkg, skipped_pkgs[pkg])
>  oe.qa.handle_error("incompatible-license", msg, d)
>  else:
>  package_list.append(pkg)
> --
> 2.46.2

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#206283): 
https://lists.openembedded.org/g/openembedded-core/message/206283
Mute This Topic: https://lists.openembedded.org/mt/109179697/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core][PATCH v2 3/4] lib: package: Check incompatible licenses at packaging time

2024-10-24 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org 
>  On Behalf Of Joshua Watt
> Sent: den 23 oktober 2024 23:15
> To: openembedded-core@lists.openembedded.org
> Cc: Joshua Watt 
> Subject: [OE-core][PATCH v2 3/4] lib: package: Check incompatible licenses at 
> packaging time
> 
> Instead of checking for incompatible licenses in the anonymous python
> and setting '_exclude_incompatible-', (re)check all the packages in
> populate_packages(). This ensures that all packages are processed, even
> dynamically generated ones.
> 
> The use of the '_exclude-incompatible-' variable set in base.bbclass has
> been the mechanism used for per-packages licenses since its it was added

Typo: its it -> it

> as a feature (although with different names for the variable throughout
> history). However, since this misses dynamic packages, calling
> oe.license.skip_incompatible_package_licenses() a second time on the
> actual final package set is a better solution.
> 
> Signed-off-by: Joshua Watt 
> ---
>  meta/classes-global/base.bbclass | 1 -
>  meta/lib/oe/package.py   | 6 +++---
>  2 files changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/meta/classes-global/base.bbclass 
> b/meta/classes-global/base.bbclass
> index 5b8663f454d..b81e61fdb72 100644
> --- a/meta/classes-global/base.bbclass
> +++ b/meta/classes-global/base.bbclass
> @@ -581,7 +581,6 @@ python () {
>  if unskipped_pkgs:
>  for pkg in skipped_pkgs:
>  bb.debug(1, "Skipping the package %s at do_rootfs 
> because of incompatible license(s): %s" % (pkg, ' '.join(skipped_pkgs[pkg])))
> -d.setVar('_exclude_incompatible-' + pkg, ' 
> '.join(skipped_pkgs[pkg]))
>  for pkg in unskipped_pkgs:
>  bb.debug(1, "Including the package %s" % pkg)
>  else:
> diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py
> index c213a9a3ca6..480408e41e3 100644
> --- a/meta/lib/oe/package.py
> +++ b/meta/lib/oe/package.py
> @@ -1447,10 +1447,10 @@ def populate_packages(d):
> 
>  # Handle excluding packages with incompatible licenses
>  package_list = []
> +skipped_pkgs = oe.license.skip_incompatible_package_licenses(d, pkgs):
>  for pkg in packages:
> -licenses = d.getVar('_exclude_incompatible-' + pkg)
> -if licenses:
> -msg = "Excluding %s from packaging as it has incompatible 
> license(s): %s" % (pkg, licenses)
> +if pkg in skipped_pkgs:
> +msg = "Excluding %s from packaging as it has incompatible 
> license(s): %s" % (pkg, skipped_pkgs[pkg])
>  oe.qa.handle_error("incompatible-license", msg, d)
>  else:
>  package_list.append(pkg)
> --
> 2.46.2

There is still a reference to _exclude_incompatible in package.bbclass. 
Not sure what to do about it (it has to do with variable dependencies 
to trigger do_package to re-run for recipes that are affected by changes 
to INCOMPATIBLE_LICENSE). 

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#206275): 
https://lists.openembedded.org/g/openembedded-core/message/206275
Mute This Topic: https://lists.openembedded.org/mt/109179697/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core][PATCH v2 2/4] lib: license: Move package license skip to library

2024-10-23 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org 
>  On Behalf Of Peter Kjellerstedt
> Sent: den 24 oktober 2024 01:39
> To: Joshua Watt ; 
> openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core][PATCH v2 2/4] lib: license: Move package license
> skip to library
> 
> > -Original Message-
> > From: openembedded-core@lists.openembedded.org 
> >  On Behalf Of Joshua Watt
> > Sent: den 23 oktober 2024 23:15
> > To: openembedded-core@lists.openembedded.org
> > Cc: Joshua Watt 
> > Subject: [OE-core][PATCH v2 2/4] lib: license: Move package license skip to 
> > library
> >
> > Moves the code that skips packages with incompatible licenses to the
> > library code so that it can be called in other locations
> >
> > Signed-off-by: Joshua Watt 
> > ---
> >  meta/classes-global/base.bbclass | 35 
> >  meta/lib/oe/license.py   | 39 
> >  2 files changed, 43 insertions(+), 31 deletions(-)
> >
> > diff --git a/meta/classes-global/base.bbclass 
> > b/meta/classes-global/base.bbclass
> > index 88b932fc3f0..5b8663f454d 100644
> > --- a/meta/classes-global/base.bbclass
> > +++ b/meta/classes-global/base.bbclass
> > @@ -573,37 +573,10 @@ python () {
> >
> >  bad_licenses = (d.getVar('INCOMPATIBLE_LICENSE') or "").split()

Missed this in the first review pass: you can move bad_licenses down to 
where it is being used.

> >
> > -check_license = False if pn.startswith("nativesdk-") else True
> > -for t in ["-native", "-cross-${TARGET_ARCH}", 
> > "-cross-initial-${TARGET_ARCH}",
> > -  "-crosssdk-${SDK_SYS}", "-crosssdk-initial-${SDK_SYS}",
> > -  "-cross-canadian-${TRANSLATED_TARGET_ARCH}"]:
> > -if pn.endswith(d.expand(t)):
> > -check_license = False
> > -if pn.startswith("gcc-source-"):
> > -check_license = False
> > -
> > -if check_license and bad_licenses:
> > -bad_licenses = oe.license.expand_wildcard_licenses(d, 
> > bad_licenses)
> > -
> > -exceptions = (d.getVar("INCOMPATIBLE_LICENSE_EXCEPTIONS") or 
> > "").split()
> > -
> > -for lic_exception in exceptions:
> > -if ":" in lic_exception:
> > -lic_exception = lic_exception.split(":")[1]
> > -if lic_exception in oe.license.obsolete_license_list():
> > -bb.fatal("Obsolete license %s used in 
> > INCOMPATIBLE_LICENSE_EXCEPTIONS" % lic_exception)
> > -
> > -pkgs = d.getVar('PACKAGES').split()
> > -skipped_pkgs = {}
> > -unskipped_pkgs = []
> > -for pkg in pkgs:
> > -remaining_bad_licenses = 
> > oe.license.apply_pkg_license_exception(pkg, bad_licenses, exceptions)
> > -
> > -incompatible_lic = oe.license.incompatible_license(d, 
> > remaining_bad_licenses, pkg)
> > -if incompatible_lic:
> > -skipped_pkgs[pkg] = incompatible_lic
> > -else:
> > -unskipped_pkgs.append(pkg)
> > +pkgs = d.getVar('PACKAGES').split()
> > +if pkgs:
> > +skipped_pkgs = 
> > oe.license.skip_incompatible_package_licenses(d, pkgs)
> > +unskipped_pkgs = [p for p in pkgs if p not in skipped_pkgs]
> >
> >  if unskipped_pkgs:
> >  for pkg in skipped_pkgs:
> > diff --git a/meta/lib/oe/license.py b/meta/lib/oe/license.py
> > index 7739697c401..866a876d7f0 100644
> > --- a/meta/lib/oe/license.py
> > +++ b/meta/lib/oe/license.py
> > @@ -422,3 +422,42 @@ def check_license_format(d):
> >  '%s: LICENSE value "%s" has an invalid separator "%s" 
> > that is not ' \
> >  'in the valid list of separators (%s)' %
> >  (pn, licenses, element, license_operator_chars), d)
> > +
> > +def skip_incompatible_package_licenses(d, pkgs):
> > +if not pkgs:
> > +return {}
> > +
> > +pn = d.getVar("PN")
> > +bad_licenses = (d.getVar('INCOMPATIBLE_LICENSE') or "").split()
> > +
> > +check_license = False if

Re: [OE-core][PATCH v2 2/4] lib: license: Move package license skip to library

2024-10-23 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org 
>  On Behalf Of Joshua Watt
> Sent: den 23 oktober 2024 23:15
> To: openembedded-core@lists.openembedded.org
> Cc: Joshua Watt 
> Subject: [OE-core][PATCH v2 2/4] lib: license: Move package license skip to 
> library
> 
> Moves the code that skips packages with incompatible licenses to the
> library code so that it can be called in other locations
> 
> Signed-off-by: Joshua Watt 
> ---
>  meta/classes-global/base.bbclass | 35 
>  meta/lib/oe/license.py   | 39 
>  2 files changed, 43 insertions(+), 31 deletions(-)
> 
> diff --git a/meta/classes-global/base.bbclass 
> b/meta/classes-global/base.bbclass
> index 88b932fc3f0..5b8663f454d 100644
> --- a/meta/classes-global/base.bbclass
> +++ b/meta/classes-global/base.bbclass
> @@ -573,37 +573,10 @@ python () {
> 
>  bad_licenses = (d.getVar('INCOMPATIBLE_LICENSE') or "").split()
> 
> -check_license = False if pn.startswith("nativesdk-") else True
> -for t in ["-native", "-cross-${TARGET_ARCH}", 
> "-cross-initial-${TARGET_ARCH}",
> -  "-crosssdk-${SDK_SYS}", "-crosssdk-initial-${SDK_SYS}",
> -  "-cross-canadian-${TRANSLATED_TARGET_ARCH}"]:
> -if pn.endswith(d.expand(t)):
> -check_license = False
> -if pn.startswith("gcc-source-"):
> -check_license = False
> -
> -if check_license and bad_licenses:
> -bad_licenses = oe.license.expand_wildcard_licenses(d, 
> bad_licenses)
> -
> -exceptions = (d.getVar("INCOMPATIBLE_LICENSE_EXCEPTIONS") or 
> "").split()
> -
> -for lic_exception in exceptions:
> -if ":" in lic_exception:
> -lic_exception = lic_exception.split(":")[1]
> -if lic_exception in oe.license.obsolete_license_list():
> -bb.fatal("Obsolete license %s used in 
> INCOMPATIBLE_LICENSE_EXCEPTIONS" % lic_exception)
> -
> -pkgs = d.getVar('PACKAGES').split()
> -skipped_pkgs = {}
> -unskipped_pkgs = []
> -for pkg in pkgs:
> -remaining_bad_licenses = 
> oe.license.apply_pkg_license_exception(pkg, bad_licenses, exceptions)
> -
> -incompatible_lic = oe.license.incompatible_license(d, 
> remaining_bad_licenses, pkg)
> -if incompatible_lic:
> -skipped_pkgs[pkg] = incompatible_lic
> -else:
> -unskipped_pkgs.append(pkg)
> +pkgs = d.getVar('PACKAGES').split()
> +if pkgs:
> +skipped_pkgs = oe.license.skip_incompatible_package_licenses(d, 
> pkgs)
> +unskipped_pkgs = [p for p in pkgs if p not in skipped_pkgs]
> 
>  if unskipped_pkgs:
>  for pkg in skipped_pkgs:
> diff --git a/meta/lib/oe/license.py b/meta/lib/oe/license.py
> index 7739697c401..866a876d7f0 100644
> --- a/meta/lib/oe/license.py
> +++ b/meta/lib/oe/license.py
> @@ -422,3 +422,42 @@ def check_license_format(d):
>  '%s: LICENSE value "%s" has an invalid separator "%s" 
> that is not ' \
>  'in the valid list of separators (%s)' %
>  (pn, licenses, element, license_operator_chars), d)
> +
> +def skip_incompatible_package_licenses(d, pkgs):
> +if not pkgs:
> +return {}
> +
> +pn = d.getVar("PN")
> +bad_licenses = (d.getVar('INCOMPATIBLE_LICENSE') or "").split()
> +
> +check_license = False if pn.startswith("nativesdk-") else True
> +for t in ["-native", "-cross-${TARGET_ARCH}", 
> "-cross-initial-${TARGET_ARCH}",
> +"-crosssdk-${SDK_SYS}", "-crosssdk-initial-${SDK_SYS}",
> +"-cross-canadian-${TRANSLATED_TARGET_ARCH}"]:
> +if pn.endswith(d.expand(t)):
> +check_license = False
> +if pn.startswith("gcc-source-"):
> +check_license = False
> +
> +if not check_license or not bad_licenses:
> +return {}

For efficiency, it would be better to return early, i.e.:

bad_licenses = (d.getVar('INCOMPATIBLE_LICENSE') or "").split()
if not bad_licenses:
return {}

pn = d.getVar("PN")
if if pn.startswith("nativesdk-") or pn.startswith("gcc-source-"):
return {}
for t in ["-native", "-cross-${TARGET_ARCH}", 
"-cross-initial-${TARGET_ARCH}",
  "-crosssdk-${SDK_SYS}", "-crosssdk-initial-${SDK_SYS}",
  "-cross-canadian-${TRANSLATED_TARGET_ARCH}"]:
if pn.endswith(d.expand(t)):
return {}

> +
> +bad_licenses = expand_wildcard_licenses(d, bad_licenses)
> +
> +exceptions = (d.getVar("INCOMPATIBLE_LICENSE_EXCEPTIONS") or "").split()
> +
> +for lic_exception in exceptions:
> +if ":" in lic_exception:
> +lic_exception = lic_exception.split(":")[1]
> +if lic_exception in obsolete_license_list():
> +   

Re: [OE-core] [scarthgap][PATCH 2/2] bluez5: Install /etc/bluetooth/main.conf

2024-10-23 Thread Peter Kjellerstedt
This just installs a default main.conf file (which matches what 5.73+ does in 
Styhead and on master). If you have a bbappend that installs its own main.conf 
file, then that will overwrite the default file without any problems. On the 
other hand, if you have a separate recipe that installs its own version of 
main.conf, then there will now be a conflict.

Steve: I leave it to you to decide if you want to take this second patch, but 
the first patch in the series should be applied to restore the previous 
behavior.

//Peter

From: openembedded-core@lists.openembedded.org 
 On Behalf Of Guðni Már Gilbert
Sent: den 10 september 2024 10:18
To: openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [scarthgap][PATCH 2/2] bluez5: Install 
/etc/bluetooth/main.conf

Hi thanks for the patch. I have one concern. Normally one would install a 
custom main.conf and not the one from BlueZ. With these changes is that still 
possible with a bbappend? The file must be installed in the same folder, I 
worry if this creates a conflict when two recipes are installing main.conf.

Best regards,
Gudni

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#206271): 
https://lists.openembedded.org/g/openembedded-core/message/206271
Mute This Topic: https://lists.openembedded.org/mt/108366548/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] classes: rootfs-postcommands: set better sane time to systemd

2024-10-22 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org  c...@lists.openembedded.org> On Behalf Of "Gaël PORTAY
> Sent: den 21 oktober 2024 19:02
> To: Alexander Kanavin ;
> gael.portay+rt...@gmail.com
> Cc: openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH] classes: rootfs-postcommands: set better
> sane time to systemd
> 
> Hello Alex,
> 
> On Mon Oct 21, 2024 at 12:25 PM CEST, Alexander Kanavin wrote:
> > Can this be done from systemd recipe itself? Items in
> > rootfs-postprocess list should not be recipe-specific.
> >
> 
> Sure it could be done in the recipe itself ;) but...
> 
> The recipe harcodes already a sane value at configure time thanks to the
> meson option -Dtime-epoch and the environment variable $SOURCE_DATE_EPOC
> (or the date the creation of the latest git-tag or the modification time
> of the NEWS file). systemd sets the date somewhere in 2022 (kirkstone).
> 
> I have created a rootfs-postcommand to be able to set a better time **at
> image creation** to keep the systemd package untouched (not rebuilt) by
> updateing the variable $REPRODUCIBLE_TIMESTAMP_ROOTFS.

Can't you add a pkg_postinst:${PN} function to the systemd recipe and that 
way do it in the recipe while stile executing it at image creation time?

> 
> That variable is suffixed by _ROOTFS; and I guess that variable **SHOULD
> NOT** be used by package recipes.
> 
> The rootfs_systemd_timestamp() is based on rootfs_update_timestamp(); it
> touches the file and it leaves the file empty.
> 
> Also, to decrease the systemd-specific thing, I wonder if this is
> acceptable:
> 
>   rootfs_update_timestamp () {
>   if [ "${REPRODUCIBLE_TIMESTAMP_ROOTFS}" != "" ]; then
>   # Convert UTC into %4Y%2m%2d%2H%2M%2S
>   sformatted=`date -u -d 
> @${REPRODUCIBLE_TIMESTAMP_ROOTFS} +%4Y%2m%2d%2H%2M%2S`
>   else
>   sformatted=`date -u +%4Y%2m%2d%2H%2M%2S`
>   fi
>   echo $sformatted > ${IMAGE_ROOTFS}/etc/timestamp
>   bbnote "rootfs_update_timestamp: set /etc/timestamp to 
> $sformatted"
>   +
>   +   if [ -x /lib/systemd/systemd ]; then

Umm, why are you looking at the host's files?

>   +   if [ "${REPRODUCIBLE_TIMESTAMP_ROOTFS}" != "" ]; then
>   +   # Convert UTC into %4Y%2m%2d%2H%2M.%2S
>   +   sformatted=`date -u -d 
> @${REPRODUCIBLE_TIMESTAMP_ROOTFS} +%4Y%2m%2d%2H%2M.%2S`
>   +   else
>   +   sformatted=`date -u +%4Y%2m%2d%2H%2M.%2S`
>   +   fi
>   +   touch -m -t "$sformatted" 
> ${IMAGE_ROOTFS}/usr/lib/clock-epoch
>   +   bbnote "rootfs_systemd_timestamp: set /usr/lib/clock-epoch 
> mtime to $sformatted"
>   +   }
>   }
> 
> Or, linking the file instead:
> 
>   rootfs_update_timestamp () {
>   if [ "${REPRODUCIBLE_TIMESTAMP_ROOTFS}" != "" ]; then
>   # Convert UTC into %4Y%2m%2d%2H%2M%2S
>   sformatted=`date -u -d 
> @${REPRODUCIBLE_TIMESTAMP_ROOTFS} +%4Y%2m%2d%2H%2M%2S`
>   else
>   sformatted=`date -u +%4Y%2m%2d%2H%2M%2S`
>   fi
>   echo $sformatted > ${IMAGE_ROOTFS}/etc/timestamp
>   bbnote "rootfs_update_timestamp: set /etc/timestamp to 
> $sformatted"
>   +
>   +   if [ -x /lib/systemd/systemd ]; then
>   +   ln -sf /etc/timestamp /usr/lib/clock-epoch

This too is trying to create a link in the host's filesystem.

>   +   }
>   }
> 
> Does it look better for you?
> 
> > Alex
> >
> 
> Regards,
> Gaël

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#206171): 
https://lists.openembedded.org/g/openembedded-core/message/206171
Mute This Topic: https://lists.openembedded.org/mt/109095282/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][scarthgap 17/18] image_qa: fix error handling

2024-10-18 Thread Peter Kjellerstedt
> -Original Message-
> From: Steve Sakoman 
> Sent: den 18 oktober 2024 22:19
> To: Peter Kjellerstedt 
> Cc: Richard Purdie ; openembedded-
> c...@lists.openembedded.org
> Subject: Re: [OE-core][scarthgap 17/18] image_qa: fix error handling
> 
> On Fri, Oct 18, 2024 at 12:56 PM Peter Kjellerstedt
>  wrote:
> >
> > > -Original Message-
> > > From: openembedded-core@lists.openembedded.org  c...@lists.openembedded.org> On Behalf Of Steve Sakoman
> > > Sent: den 16 oktober 2024 15:27
> > > To: Richard Purdie 
> > > Cc: openembedded-core@lists.openembedded.org
> > > Subject: Re: [OE-core][scarthgap 17/18] image_qa: fix error handling
> > >
> > > On Tue, Oct 15, 2024 at 3:41 PM Richard Purdie
>  wrote:
> > > >
> > > > On Tue, 2024-10-15 at 11:50 -0700, Steve Sakoman via
> lists.openembedded.org wrote:
> > > > > From: Louis Rannou 
> > > > >
> > > > > Make ImageQAFailed inherit BBHandledException so exceptions raised
> in tests are
> > > > > catched when the actual test function is executed by
> bb.utils.better_exec.
> > > > >
> > > > > Change the do_image_qa tasks so errors are handled with
> oe.qa.handle_error. Add
> > > > > some comment to explain this requires to list the test in ERROR_QA
> or WARN_QA.
> > > > >
> > > > > [YOCTO #14807]
> > > > > https://bugzilla.yoctoproject.org/show_bug.cgi?id=14807
> > > > >
> > > > > Signed-off-by: Louis Rannou 
> > > > > Signed-off-by: Richard Purdie 
> > > > > (cherry picked from commit
> 905e224849fbbed1719e0add231b00e2d570b3b4)
> > > > > Signed-off-by: Steve Sakoman 
> > > > > ---
> > > > >  meta/classes-recipe/image.bbclass | 11 ++-
> > > > >  meta/lib/oe/utils.py  |  2 +-
> > > > >  2 files changed, 7 insertions(+), 6 deletions(-)
> > > > >
> > > > > diff --git a/meta/classes-recipe/image.bbclass b/meta/classes-
> recipe/image.bbclass
> > > > > index 28be6c6362..a682b5f3b2 100644
> > > > > --- a/meta/classes-recipe/image.bbclass
> > > > > +++ b/meta/classes-recipe/image.bbclass
> > > > > @@ -308,23 +308,24 @@ addtask do_image_complete_setscene
> > > > >  #
> > > > >  # The functions should use ${IMAGE_ROOTFS} to find the unpacked
> rootfs
> > > > >  # directory, which if QA passes will be the basis for the images.
> > > > > +#
> > > > > +# The functions should use oe.utils.ImageQAFailed(description,
> name) to raise
> > > > > +# errors. The name must be listed in ERROR_QA or WARN_QA to
> prompt.
> > > > >  fakeroot python do_image_qa () {
> > > > >  from oe.utils import ImageQAFailed
> > > > >
> > > > >  qa_cmds = (d.getVar('IMAGE_QA_COMMANDS') or '').split()
> > > > > -qamsg = ""
> > > > >
> > > > >  for cmd in qa_cmds:
> > > > >  try:
> > > > >  bb.build.exec_func(cmd, d)
> > > > >  except oe.utils.ImageQAFailed as e:
> > > > > -qamsg = qamsg + '\tImage QA function %s failed: %s\n'
> % (e.name, e.description)
> > > > > +qamsg = 'Image QA function %s failed: %s\n' %
> (e.name, e.description)
> > > > > +oe.qa.handle_error(e.name, qamsg, d)
> > > > >  except Exception as e:
> > > > >  qamsg = qamsg + '\tImage QA function %s failed: %s\n'
> % (cmd, e)
> > > > >
> > > > > -if qamsg:
> > > > > -imgname = d.getVar('IMAGE_NAME')
> > > > > -bb.fatal("QA errors found whilst validating image:
> %s\n%s" % (imgname, qamsg))
> > > > > +oe.qa.exit_if_errors(d)
> > > > >  }
> > > > >  addtask do_image_qa after do_rootfs before do_image
> > > > >
> > > > > diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py
> > > > > index 14a7d07ef0..83f1440887 100644
> > > > > --- a/meta/lib/oe/utils.py
> > > > > +++ b/meta/lib/oe/utils.py
> > > > > @@ -482,7 +482,7 @@ def get_multilib_datastore(variant, d):
> > > > >  localdata.setVar("MLPREFIX", "")
> > &

Re: [OE-core][scarthgap 17/18] image_qa: fix error handling

2024-10-18 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org 
>  On Behalf Of Steve Sakoman
> Sent: den 16 oktober 2024 15:27
> To: Richard Purdie 
> Cc: openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core][scarthgap 17/18] image_qa: fix error handling
> 
> On Tue, Oct 15, 2024 at 3:41 PM Richard Purdie 
>  wrote:
> >
> > On Tue, 2024-10-15 at 11:50 -0700, Steve Sakoman via lists.openembedded.org 
> > wrote:
> > > From: Louis Rannou 
> > >
> > > Make ImageQAFailed inherit BBHandledException so exceptions raised in 
> > > tests are
> > > catched when the actual test function is executed by bb.utils.better_exec.
> > >
> > > Change the do_image_qa tasks so errors are handled with 
> > > oe.qa.handle_error. Add
> > > some comment to explain this requires to list the test in ERROR_QA or 
> > > WARN_QA.
> > >
> > > [YOCTO #14807]
> > > https://bugzilla.yoctoproject.org/show_bug.cgi?id=14807
> > >
> > > Signed-off-by: Louis Rannou 
> > > Signed-off-by: Richard Purdie 
> > > (cherry picked from commit 905e224849fbbed1719e0add231b00e2d570b3b4)
> > > Signed-off-by: Steve Sakoman 
> > > ---
> > >  meta/classes-recipe/image.bbclass | 11 ++-
> > >  meta/lib/oe/utils.py  |  2 +-
> > >  2 files changed, 7 insertions(+), 6 deletions(-)
> > >
> > > diff --git a/meta/classes-recipe/image.bbclass 
> > > b/meta/classes-recipe/image.bbclass
> > > index 28be6c6362..a682b5f3b2 100644
> > > --- a/meta/classes-recipe/image.bbclass
> > > +++ b/meta/classes-recipe/image.bbclass
> > > @@ -308,23 +308,24 @@ addtask do_image_complete_setscene
> > >  #
> > >  # The functions should use ${IMAGE_ROOTFS} to find the unpacked rootfs
> > >  # directory, which if QA passes will be the basis for the images.
> > > +#
> > > +# The functions should use oe.utils.ImageQAFailed(description, name) to 
> > > raise
> > > +# errors. The name must be listed in ERROR_QA or WARN_QA to prompt.
> > >  fakeroot python do_image_qa () {
> > >  from oe.utils import ImageQAFailed
> > >
> > >  qa_cmds = (d.getVar('IMAGE_QA_COMMANDS') or '').split()
> > > -qamsg = ""
> > >
> > >  for cmd in qa_cmds:
> > >  try:
> > >  bb.build.exec_func(cmd, d)
> > >  except oe.utils.ImageQAFailed as e:
> > > -qamsg = qamsg + '\tImage QA function %s failed: %s\n' % 
> > > (e.name, e.description)
> > > +qamsg = 'Image QA function %s failed: %s\n' % (e.name, 
> > > e.description)
> > > +oe.qa.handle_error(e.name, qamsg, d)
> > >  except Exception as e:
> > >  qamsg = qamsg + '\tImage QA function %s failed: %s\n' % 
> > > (cmd, e)
> > >
> > > -if qamsg:
> > > -imgname = d.getVar('IMAGE_NAME')
> > > -bb.fatal("QA errors found whilst validating image: %s\n%s" % 
> > > (imgname, qamsg))
> > > +oe.qa.exit_if_errors(d)
> > >  }
> > >  addtask do_image_qa after do_rootfs before do_image
> > >
> > > diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py
> > > index 14a7d07ef0..83f1440887 100644
> > > --- a/meta/lib/oe/utils.py
> > > +++ b/meta/lib/oe/utils.py
> > > @@ -482,7 +482,7 @@ def get_multilib_datastore(variant, d):
> > >  localdata.setVar("MLPREFIX", "")
> > >  return localdata
> > >
> > > -class ImageQAFailed(Exception):
> > > +class ImageQAFailed(bb.BBHandledException):
> > >  def __init__(self, description, name=None, logfile=None):
> > >  self.description = description
> > >  self.name = name
> > >
> >
> > This caused further issues if I remember correctly.
> >
> > https://git.yoctoproject.org/poky/commit/?id=b0eb2b9b3660dfda1c4c43cfcca6a2c4a84d6dc8
> >
> > for example.
> 
> Thanks for reviewing!  I've got that one now and will also take it for
> styhead.
> 
> Steve

Do note that I sent an alternative patch for Styhead that does not 
remove the ImageQAFailed exception. While I would be happy to see the 
version that went into master backported, I assumed that removing the 
ImageQAFailed exception would be considered as a change in behavior 
and thus not eligible for backporting.

The alternative version I created for Styhead can be found here:

https://lists.openembedded.org/g/openembedded-core/message/204982

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#206068): 
https://lists.openembedded.org/g/openembedded-core/message/206068
Mute This Topic: https://lists.openembedded.org/mt/109030208/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] Patchtest results for [PATCH 5/5] python3: update 3.12.6 -> 3.13.0

2024-10-18 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org 
>  On Behalf Of Alexander Kanavin
> Sent: den 17 oktober 2024 10:36
> To: Trevor Gamblin 
> Cc: patcht...@automation.yoctoproject.org; 
> openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core] Patchtest results for [PATCH 5/5] python3: update 
> 3.12.6 -> 3.13.0
> 
> On Wed, 16 Oct 2024 at 22:41, Trevor Gamblin  wrote:
> > > Testing patch 
> > > /home/patchtest/share/mboxes/5-5-python3-update-3.12.6---3.13.0.patch
> > >
> > > FAIL: test lic files chksum modified not mentioned: LIC_FILES_CHKSUM 
> > > changed without "License-Update:" tag and description in commit message 
> > > (test_metadata.TestMetadata.test_lic_files_chksum_modified_not_mentioned)
> > Hmm, another false positive for this one. I'll need to investigate this
> > one...
> 
> Maybe the check is simply case-sensitive?
> 
> Alex

I would expect that to be intentional, just like the casing of 
Upstream-Status. 

I have also always expected License-Update to be considered a 
Git trailer, like Signed-off-by, but it seems that is perhaps 
not the general consensus. :(

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#206069): 
https://lists.openembedded.org/g/openembedded-core/message/206069
Mute This Topic: https://lists.openembedded.org/mt/109051186/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] oeqa/selftest: automatically unset SANITY_TESTED_DISTROS

2024-10-03 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org 
>  On Behalf Of Richard Purdie
> Sent: den 3 oktober 2024 23:46
> To: chris.lapla...@agilent.com; openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH] oeqa/selftest: automatically unset 
> SANITY_TESTED_DISTROS
> 
> On Thu, 2024-10-03 at 17:37 -0400, Chris Laplante via lists.openembedded.org 
> wrote:
> > From: Chris Laplante 
> >
> > It always has to be done, so just do it.
> >
> > [YOCTO #11933]
> >
> > Signed-off-by: Chris Laplante 
> > ---
> >  meta/lib/oeqa/selftest/context.py | 7 +++
> >  1 file changed, 3 insertions(+), 4 deletions(-)
> >
> > diff --git a/meta/lib/oeqa/selftest/context.py 
> > b/meta/lib/oeqa/selftest/context.py
> > index acc3b073bd..3b507d747e 100644
> > --- a/meta/lib/oeqa/selftest/context.py
> > +++ b/meta/lib/oeqa/selftest/context.py
> > @@ -129,6 +129,9 @@ class OESelftestTestContext(OETestContext):
> >  # Set SSTATE_DIR to match the parent SSTATE_DIR
> >  subprocess.check_output("echo 'SSTATE_DIR ?= \"%s\"' >> 
> > %s/conf/local.conf" % (sstatedir, newbuilddir), cwd=newbuilddir, shell=True)
> >
> > +    # Unset SANITY_TESTED_DISTROS
> > +    subprocess.check_output(f"echo 'SANITY_TESTED_DISTROS = \"\"' >> 
> > {newbuilddir}/conf/local.conf", cwd=newbuilddir, shell=True)
> > +
> >  os.chdir(newbuilddir)
> >
> >  def patch_test(t):
> > @@ -337,10 +340,6 @@ class 
> > OESelftestTestContextExecutor(OETestContextExecutor):
> >  self.tc.logger.error("Please unset PRSERV_HOST in order to run 
> > oe-selftest")
> >  raise OEQAPreRun
> >
> > -    if "SANITY_TESTED_DISTROS" in self.tc.td:
> > -    self.tc.logger.error("Please unset SANITY_TESTED_DISTROS in 
> > order to run oe-selftest")
> > -    raise OEQAPreRun
> > -
> >  _add_layer_libs()
> >
> >  self.tc.logger.info("Checking base configuration is 
> > valid/parsable")
> >
> 
> You might want to leave the test since there are ways you could set
> this which will make it hard to disable :(
> 
> A simple example would be:
> 
> SANITY_TESTES_DISTROS:poky = "x y z"
> 
> which is why this wasn't automated.
> 
> Cheers,
> 
> Richard

Wouldn't

SANITY_TESTED_DISTROS:forcevariable = ""

get you close to always work for all practical purposes? 
Though I guess if you really want you can circumvent that as well.

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#205218): 
https://lists.openembedded.org/g/openembedded-core/message/205218
Mute This Topic: https://lists.openembedded.org/mt/108807576/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] strace: download release tarballs from GitHub

2024-10-03 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org 
>  On Behalf Of Ross Burton
> Sent: den 3 oktober 2024 17:34
> To: openembedded-core@lists.openembedded.org
> Subject: [OE-core] [PATCH] strace: download release tarballs from GitHub
> 
> Switch to downloading the release tarballs from GitHub.  Their CDN is
> rock solid, and strace.io is hosted inside Russia which some networks
> are blocking.
> 
> Signed-off-by: Ross Burton 
> 
> diff --git a/meta/recipes-devtools/strace/strace_6.11.bb 
> b/meta/recipes-devtools/strace/strace_6.11.bb
> index d98b5fdec9a..a8f11ea8093 100644
> --- a/meta/recipes-devtools/strace/strace_6.11.bb
> +++ b/meta/recipes-devtools/strace/strace_6.11.bb
> @@ -5,7 +5,7 @@ SECTION = "console/utils"
>  LICENSE = "LGPL-2.1-or-later & GPL-2.0-or-later"
>  LIC_FILES_CHKSUM = "file://COPYING;md5=2433d82e1432a76dc3eadd9002bfe304"
> 
> -SRC_URI = "https://strace.io/files/${PV}/strace-${PV}.tar.xz \
> +SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/strace-${PV}.tar.xz \
> file://update-gawk-paths.patch \
> file://Makefile-ptest.patch \
> file://run-ptest \
> @@ -17,7 +17,7 @@ SRC_URI = 
> "https://strace.io/files/${PV}/strace-${PV}.tar.xz \
> "
>  SRC_URI[sha256sum] = 
> "83262583a3529f02c3501aa8b8ac772b4cbc03dc934e98bab6e4883626e283a5"
> 
> -inherit autotools ptest
> +inherit autotools github-releases ptest
> 
>  # Not yet ported to rv32
>  COMPATIBLE_HOST:riscv32 = "null"
> ---

Not sure how you did it, but I assume you did not intent to include 
the patch in the commit message (above)...

>  meta/recipes-devtools/strace/strace_6.11.bb | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/meta/recipes-devtools/strace/strace_6.11.bb 
> b/meta/recipes-devtools/strace/strace_6.11.bb
> index d98b5fdec9a..a8f11ea8093 100644
> --- a/meta/recipes-devtools/strace/strace_6.11.bb
> +++ b/meta/recipes-devtools/strace/strace_6.11.bb
> @@ -5,7 +5,7 @@ SECTION = "console/utils"
>  LICENSE = "LGPL-2.1-or-later & GPL-2.0-or-later"
>  LIC_FILES_CHKSUM = "file://COPYING;md5=2433d82e1432a76dc3eadd9002bfe304"
> 
> -SRC_URI = "https://strace.io/files/${PV}/strace-${PV}.tar.xz \
> +SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/strace-${PV}.tar.xz \
> file://update-gawk-paths.patch \
> file://Makefile-ptest.patch \
> file://run-ptest \
> @@ -17,7 +17,7 @@ SRC_URI = 
> "https://strace.io/files/${PV}/strace-${PV}.tar.xz \
> "
>  SRC_URI[sha256sum] = 
> "83262583a3529f02c3501aa8b8ac772b4cbc03dc934e98bab6e4883626e283a5"
> 
> -inherit autotools ptest
> +inherit autotools github-releases ptest
> 
>  # Not yet ported to rv32
>  COMPATIBLE_HOST:riscv32 = "null"
> --
> 2.34.1

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#205211): 
https://lists.openembedded.org/g/openembedded-core/message/205211
Mute This Topic: https://lists.openembedded.org/mt/108801282/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] release notes in commit messages

2024-10-01 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org  c...@lists.openembedded.org> On Behalf Of Richard Purdie
> Sent: den 30 september 2024 22:34
> To: openembedded-core 
> Cc: Trevor Gamblin 
> Subject: [OE-core] release notes in commit messages
> 
> Hi All,
> 
> I wanted to highlight to people that cut and pasting release notes into
> commit messages is annoying a few people:
> 
> https://github.com/openembedded/openembedded-core/commit/51fb98c6da61ad4faf5b00316e7075f3bbee9bc7#commitcomment-147394200
> 
> The issue is that usernames get pinged on the references when this gets
> into github.
> 
> There are a number of different perspectives on this but if people
> could trim the usernames out of such commit messages it would be
> helpful. It might be something to teach patchtest?

The real problem seems to be that GitHub triggers on "@username". So 
changing "@username" to "username" should be ok to keep the relevant 
information without causing annoyance.

However, based on the example above, I wonder how to make Patchtest 
differentiate between @Property (which should be left as is) and @asottile, 
@Avasam and @GTowers1 (which should be replaced)...

> 
> Cheers,
> 
> Richard

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#205132): 
https://lists.openembedded.org/g/openembedded-core/message/205132
Mute This Topic: https://lists.openembedded.org/mt/108745174/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 v3] default-distrovars: Have KERNEL_CONSOLE reference SERIAL_CONSOLES

2024-09-26 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org 
>  On Behalf Of Jon Mason
> Sent: den 20 september 2024 20:42
> To: openembedded-core@lists.openembedded.org
> Subject: [OE-core] [PATCH v3] default-distrovars: Have KERNEL_CONSOLE 
> reference SERIAL_CONSOLES
> 
> Currently, KERNEL_CONSOLE has a default value of "ttyS0".  However, Arm
> machines and those using virtio serial prefer to use "ttyAMA0" or "hvc0"
> (or something else).  These are usually defined by the machine config
> file as SERIAL_CONSOLES, which has one or more entries.  Take the first
> one of those instead of ttyS0, but default back to ttyS0 if nothing is
> set.
> 
> Also, use this variable in the efi wic file instead of "ttyS0".
> 
> This includes revisions suggested by Quentin Schulz.
> 
> Signed-off-by: Jon Mason 
> ---
>  meta/classes-recipe/image_types_wic.bbclass | 1 +
>  meta/conf/distro/include/default-distrovars.inc | 3 ++-
>  scripts/lib/wic/canned-wks/mkefidisk.wks| 2 +-
>  3 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/meta/classes-recipe/image_types_wic.bbclass b/meta/classes- 
> recipe/image_types_wic.bbclass
> index 86f40633ebcb..db598e874ad7 100644
> --- a/meta/classes-recipe/image_types_wic.bbclass
> +++ b/meta/classes-recipe/image_types_wic.bbclass
> @@ -26,6 +26,7 @@ WICVARS ?= "\
>   INITRD \
>   INITRD_LIVE \
>   ISODIR \
> +KERNEL_CONSOLE \

Inconsistent indentation (the other lines use a tab, while this uses spaces).

>   KERNEL_IMAGETYPE \
>   MACHINE \
>   PSEUDO_IGNORE_PATHS \

//Peter

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#205004): 
https://lists.openembedded.org/g/openembedded-core/message/205004
Mute This Topic: https://lists.openembedded.org/mt/108564893/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [styhead][PATCH] image.bbclass: Don't catch and ignore unexpected exceptions in image_qa

2024-09-26 Thread Peter Kjellerstedt
After commit 905e224849fbbed1719e0add231b00e2d570b3b4 (image_qa: fix
error handling), any unexpected exceptions in do_image_qa() would result
in a variable being set, but never used, effectively hiding the error.

Drop the catch for Exception and let any such exceptions pass through.

Also update the description of do_image_qa() to explain that the called
functions are expected to call oe.qa.handle_error() themselves, and that
the support for oe.utils.ImageQAFailed is deprecated and will be removed
in the next major release of OE-Core.

[ YOCTO #15601 ]

Signed-off-by: Peter Kjellerstedt 
---
 meta/classes-recipe/image.bbclass | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/meta/classes-recipe/image.bbclass 
b/meta/classes-recipe/image.bbclass
index 834ae03f3c..793b550bfb 100644
--- a/meta/classes-recipe/image.bbclass
+++ b/meta/classes-recipe/image.bbclass
@@ -324,14 +324,19 @@ addtask do_image_complete_setscene
 # IMAGE_QA_COMMANDS += " \
 # image_check_everything_ok \
 # "
+#
 # This task runs all functions in IMAGE_QA_COMMANDS after the rootfs
 # construction has completed in order to validate the resulting image.
 #
 # The functions should use ${IMAGE_ROOTFS} to find the unpacked rootfs
 # directory, which if QA passes will be the basis for the images.
 #
-# The functions should use oe.utils.ImageQAFailed(description, name) to raise
-# errors. The name must be listed in ERROR_QA or WARN_QA to prompt.
+# The functions are expected to call oe.qa.handle_error() to report any
+# problems. Alternatively, they can raise
+# oe.utils.ImageQAFailed(description, name), in which case the name
+# needs to be present in either ERROR_QA or WARN_QA for the message to
+# show. Raising ImageQAFailed is deprecated and will be removed in the
+# next major release of OE Core.
 fakeroot python do_image_qa () {
 from oe.utils import ImageQAFailed
 
@@ -343,8 +348,6 @@ fakeroot python do_image_qa () {
 except oe.utils.ImageQAFailed as e:
 qamsg = 'Image QA function %s failed: %s\n' % (e.name, 
e.description)
 oe.qa.handle_error(e.name, qamsg, d)
-except Exception as e:
-qamsg = qamsg + '\tImage QA function %s failed: %s\n' % (cmd, e)
 
 oe.qa.exit_if_errors(d)
 }

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#204982): 
https://lists.openembedded.org/g/openembedded-core/message/204982
Mute This Topic: https://lists.openembedded.org/mt/108666230/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [master][PATCH] image.bbclass: Drop support for ImageQAFailed exceptions in image_qa

2024-09-26 Thread Peter Kjellerstedt
After commit 905e224849fbbed1719e0add231b00e2d570b3b4 (image_qa: fix
error handling), any unexpected exceptions in do_image_qa() would result
in a variable being set, but never used, effectively hiding the error.

Since image_qa now calls oe.qa.exit_if_errors(), remove the support for
oe.utils.ImageQAFailed and instead rely on the called functions to call
oe.qa.handle_error() themselves. This matches what do_package_qa() does.

Also update the description of do_image_qa() to explain that the called
functions are expected to call oe.qa.handle_error() themselves.

[ YOCTO #15601 ]

Signed-off-by: Peter Kjellerstedt 
---
 meta/classes-recipe/image.bbclass | 15 ---
 meta/lib/oe/utils.py  | 13 -
 2 files changed, 4 insertions(+), 24 deletions(-)

diff --git a/meta/classes-recipe/image.bbclass 
b/meta/classes-recipe/image.bbclass
index 834ae03f3c..00f1d58f23 100644
--- a/meta/classes-recipe/image.bbclass
+++ b/meta/classes-recipe/image.bbclass
@@ -324,27 +324,20 @@ addtask do_image_complete_setscene
 # IMAGE_QA_COMMANDS += " \
 # image_check_everything_ok \
 # "
+#
 # This task runs all functions in IMAGE_QA_COMMANDS after the rootfs
 # construction has completed in order to validate the resulting image.
 #
 # The functions should use ${IMAGE_ROOTFS} to find the unpacked rootfs
 # directory, which if QA passes will be the basis for the images.
 #
-# The functions should use oe.utils.ImageQAFailed(description, name) to raise
-# errors. The name must be listed in ERROR_QA or WARN_QA to prompt.
+# The functions are expected to call oe.qa.handle_error() to report any
+# problems.
 fakeroot python do_image_qa () {
-from oe.utils import ImageQAFailed
-
 qa_cmds = (d.getVar('IMAGE_QA_COMMANDS') or '').split()
 
 for cmd in qa_cmds:
-try:
-bb.build.exec_func(cmd, d)
-except oe.utils.ImageQAFailed as e:
-qamsg = 'Image QA function %s failed: %s\n' % (e.name, 
e.description)
-oe.qa.handle_error(e.name, qamsg, d)
-except Exception as e:
-qamsg = qamsg + '\tImage QA function %s failed: %s\n' % (cmd, e)
+bb.build.exec_func(cmd, d)
 
 oe.qa.exit_if_errors(d)
 }
diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py
index 83f1440887..c9c7a47041 100644
--- a/meta/lib/oe/utils.py
+++ b/meta/lib/oe/utils.py
@@ -482,19 +482,6 @@ def get_multilib_datastore(variant, d):
 localdata.setVar("MLPREFIX", "")
 return localdata
 
-class ImageQAFailed(bb.BBHandledException):
-def __init__(self, description, name=None, logfile=None):
-self.description = description
-self.name = name
-self.logfile=logfile
-
-def __str__(self):
-msg = 'Function failed: %s' % self.name
-if self.description:
-msg = msg + ' (%s)' % self.description
-
-return msg
-
 def sh_quote(string):
 import shlex
 return shlex.quote(string)

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#204981): 
https://lists.openembedded.org/g/openembedded-core/message/204981
Mute This Topic: https://lists.openembedded.org/mt/108666218/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] go-mod.bbclass: Set GO_MOD_CACHE_DIR

2024-09-12 Thread Peter Kjellerstedt
[I can’t reply inline due to the HTML-formatting.]

I believe the goal is to have pkg/mod as a subdirectory of ${S}. At the same 
time, ${GO_MOD_CACHE_DIR} needs to be a relative path (as it is passed to the 
fetcher via the subdir= parameter). However, the suggested code only works for 
cases where ${S} matches ${WORKDIR}/subdirectory. In case it is 
${WORKDIR}/sub/directory, it will fail. I would suggest to change the code like 
this:

export GOMODCACHE = "${S}/pkg/mod"
GO_MOD_CACHE_DIR = "${@os.path.relpath(d.getVar('GOMODCACHE'), 
d.getVar('WORKDIR'))}"
do_unpack[cleandirs] += "${GOMODCACHE}"

I have verified that the above fetches a Go module into the correct directory 
with S set to ${WORKDIR}/git/${BPN}. I have also verified that crucible (one of 
the recipes in meta-oe that uses the go-mod bbclass) still builds with the 
above. And as a bonus I now also have a patch that modifies the crucible recipe 
to use the gomod fetcher (which requires the above change and also the patch I 
just sent to the bitbake list for the gomod fetcher). Unfortunately I will not 
have time to finish it until I’m back from OSS in Vienna next week.

//Peter

From: openembedded-core@lists.openembedded.org 
 On Behalf Of Jose Quaresma
Sent: den 12 september 2024 19:01
To: Christian Lindeberg 
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [PATCH] go-mod.bbclass: Set GO_MOD_CACHE_DIR

Hi Christian,

Christian Lindeberg via lists.openembedded.org 
mailto:axis@lists.openembedded.org>>
 escreveu (quinta, 12/09/2024 à(s) 15:30):
From: Christian Lindeberg 
mailto:christian.lindeb...@axis.com>>

Set the GO_MOD_CACHE_DIR variable and move the location of the module
cache to enable the use of the go module fetchers for module
dependencies.
Also, clean out the module cache before unpacking.

Signed-off-by: Christian Lindeberg 
mailto:christian.lindeb...@axis.com>>
---
 meta/classes-recipe/go-mod.bbclass | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/meta/classes-recipe/go-mod.bbclass 
b/meta/classes-recipe/go-mod.bbclass
index ca3a690d05..71a6712c47 100644
--- a/meta/classes-recipe/go-mod.bbclass
+++ b/meta/classes-recipe/go-mod.bbclass
@@ -22,9 +22,9 @@ GOBUILDFLAGS:append = " -modcacherw"

 inherit go

+GO_MOD_CACHE_DIR ?= "${@os.path.join(os.path.basename(d.getVar('S')), 
'pkg/mod')}"
+export GOMODCACHE = "${@os.path.join(os.path.dirname(d.getVar('S')), 
d.getVar('GO_MOD_CACHE_DIR'))}"

Using the default [1] bitbake S = "${WORKDIR}/${BP}" config, I think this will 
be equal to:

GO_MOD_CACHE_DIR ?= "${BP}/pkg/mod"
export GOMODCACHE = "${WORKDIR}/${BP}/pkg/mod"

in the end this can be written as:

export GOMODCACHE ?= "${S}/pkg/mod"

Is it correct or am I seeing something wrong?
[1] 
https://github.com/openembedded/openembedded-core/blob/40d2fbece1c2f6ecf62bffa44ad37850e90268cb/meta/conf/bitbake.conf#L405C6-L405C16

Jose

+do_unpack[cleandirs] += "${GOMODCACHE}"
+
 GO_WORKDIR ?= "${GO_IMPORT}"
 do_compile[dirs] += "${B}/src/${GO_WORKDIR}"
-
-export GOMODCACHE = "${B}/.mod"
-
-do_compile[cleandirs] += "${B}/.mod"
--
2.39.2





--
Best regards,

José Quaresma

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#204466): 
https://lists.openembedded.org/g/openembedded-core/message/204466
Mute This Topic: https://lists.openembedded.org/mt/108413937/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 v3 2/2] lib/buildcfg: Add is_bitbake_in_separate_repo()

2024-09-11 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org 
>  On Behalf Of Robert Yang via 
> lists.openembedded.org
> Sent: den 11 september 2024 16:36
> To: openembedded-core@lists.openembedded.org
> Cc: alex.kana...@gmail.com
> Subject: [OE-core] [PATCH v3 2/2] lib/buildcfg: Add 
> is_bitbake_in_separate_repo()
> 
> From: Robert Yang 
> 
> This would help various tooling that is being developed for setting up layers
> and builds, or creating configurations for those tasks out of pre-existing
> yocto setups.
> 
> Suggested-by: Alexander Kanavin 
> Signed-off-by: Robert Yang 
> ---
>  meta/lib/oe/buildcfg.py | 10 ++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/meta/lib/oe/buildcfg.py b/meta/lib/oe/buildcfg.py
> index dab4aa7831..9256b327ed 100644
> --- a/meta/lib/oe/buildcfg.py
> +++ b/meta/lib/oe/buildcfg.py
> @@ -71,6 +71,16 @@ def is_layer_modified(path):
>  # output and a 129 return code when a layer isn't a git repo at all.
>  return " -- modified"
> 
> +def is_bitbake_in_separate_repo(bitbake_dir):
> +"""
> +Check whether bitbake is in a separate git repo
> +"""
> +bitbake_git_dir = os.path.join(bitbake_dir, '.git')
> +if os.path.exists(bitbake_git_dir):
> +return True
> +else:
> +return False

That if-statement can be simplified to:

return os.path.exists(bitbake_git_dir)

> +
>  def get_branch_rev3(revisions):
>  # Return 3 items for each revision
>  return ["%-20s = \"%s:%s\"" % (r[1], r[2], r[3]) for r in revisions]
> --
> 2.44.1

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#204419): 
https://lists.openembedded.org/g/openembedded-core/message/204419
Mute This Topic: https://lists.openembedded.org/mt/108394690/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [scarthgap][PATCH 2/2] bluez5: Install /etc/bluetooth/main.conf

2024-09-09 Thread Peter Kjellerstedt
This matches what is installed in /etc/bluetooth by bluez 5.73+.

Also remove the if-statements testing the existence of the other files
installed to /etc/bluetooth as they are not needed (the files have
existed since bluez 4.0).

Signed-off-by: Peter Kjellerstedt 
---
 meta/recipes-connectivity/bluez5/bluez5.inc | 11 ---
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/meta/recipes-connectivity/bluez5/bluez5.inc 
b/meta/recipes-connectivity/bluez5/bluez5.inc
index e10158a6e5..fd0f58f3fc 100644
--- a/meta/recipes-connectivity/bluez5/bluez5.inc
+++ b/meta/recipes-connectivity/bluez5/bluez5.inc
@@ -87,13 +87,10 @@ do_install:append() {
install -d ${D}${INIT_D_DIR}
install -m 0755 ${WORKDIR}/init ${D}${INIT_D_DIR}/bluetooth
 
-   install -d ${D}${sysconfdir}/bluetooth/
-   if [ -f ${S}/profiles/network/network.conf ]; then
-   install -m 0644 ${S}/profiles/network/network.conf 
${D}/${sysconfdir}/bluetooth/
-   fi
-   if [ -f ${S}/profiles/input/input.conf ]; then
-   install -m 0644 ${S}/profiles/input/input.conf 
${D}/${sysconfdir}/bluetooth/
-   fi
+   install -d ${D}${sysconfdir}/bluetooth
+   install -m 0644 ${S}/src/main.conf ${D}${sysconfdir}/bluetooth
+   install -m 0644 ${S}/profiles/network/network.conf 
${D}${sysconfdir}/bluetooth
+   install -m 0644 ${S}/profiles/input/input.conf 
${D}${sysconfdir}/bluetooth
 
if [ -f ${D}/${sysconfdir}/init.d/bluetooth ]; then
sed -i -e 's#@LIBEXECDIR@#${libexecdir}#g' 
${D}/${sysconfdir}/init.d/bluetooth

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#204327): 
https://lists.openembedded.org/g/openembedded-core/message/204327
Mute This Topic: https://lists.openembedded.org/mt/108366548/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [scarthgap][PATCH 1/2] Revert "bluez5: remove configuration files from install task"

2024-09-09 Thread Peter Kjellerstedt
This reverts commit 49391fdcf71b32c5fd3c7b134c1d1c45cc1db388.

It motivated the removal of the installation of files in /etc/bluetooth
with that commit be0e796299b0 ("build: ship all config files with
--enable-datafiles") in bluez already does it. However, that commit is
part of bluez 5.73 while the recipe is only at 5.72.

Signed-off-by: Peter Kjellerstedt 
---
 meta/recipes-connectivity/bluez5/bluez5.inc | 8 
 1 file changed, 8 insertions(+)

diff --git a/meta/recipes-connectivity/bluez5/bluez5.inc 
b/meta/recipes-connectivity/bluez5/bluez5.inc
index a31d7076ba..e10158a6e5 100644
--- a/meta/recipes-connectivity/bluez5/bluez5.inc
+++ b/meta/recipes-connectivity/bluez5/bluez5.inc
@@ -87,6 +87,14 @@ do_install:append() {
install -d ${D}${INIT_D_DIR}
install -m 0755 ${WORKDIR}/init ${D}${INIT_D_DIR}/bluetooth
 
+   install -d ${D}${sysconfdir}/bluetooth/
+   if [ -f ${S}/profiles/network/network.conf ]; then
+   install -m 0644 ${S}/profiles/network/network.conf 
${D}/${sysconfdir}/bluetooth/
+   fi
+   if [ -f ${S}/profiles/input/input.conf ]; then
+   install -m 0644 ${S}/profiles/input/input.conf 
${D}/${sysconfdir}/bluetooth/
+   fi
+
if [ -f ${D}/${sysconfdir}/init.d/bluetooth ]; then
sed -i -e 's#@LIBEXECDIR@#${libexecdir}#g' 
${D}/${sysconfdir}/init.d/bluetooth
fi

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#204326): 
https://lists.openembedded.org/g/openembedded-core/message/204326
Mute This Topic: https://lists.openembedded.org/mt/108366546/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] systemd: Remove a leftover reference to ${datadir}/mime

2024-09-04 Thread Peter Kjellerstedt
${MIMEDIR} (aka ${datadir}/mime) is packaged in ${PN}-mime and the
reference to ${datadir}/mime/packages/io.systemd.xml for FILES:${PN}
should have been removed in commit
5560243137f772683e53b614f134dd632b62be8b.

Signed-off-by: Peter Kjellerstedt 
---
 meta/recipes-core/systemd/systemd_256.5.bb | 1 -
 1 file changed, 1 deletion(-)

diff --git a/meta/recipes-core/systemd/systemd_256.5.bb 
b/meta/recipes-core/systemd/systemd_256.5.bb
index 1d45670780..11b0fc5f05 100644
--- a/meta/recipes-core/systemd/systemd_256.5.bb
+++ b/meta/recipes-core/systemd/systemd_256.5.bb
@@ -717,7 +717,6 @@ FILES:${PN} = " ${base_bindir}/* \
 ${datadir}/dbus-1/system.d/org.freedesktop.portable1.conf \
 ${datadir}/dbus-1/system.d/org.freedesktop.oom1.conf \
 ${datadir}/dbus-1/system.d/org.freedesktop.home1.conf \
-${datadir}/mime/packages/io.systemd.xml \
"
 
 FILES:${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ 
${sysconfdir}/rpm/macros.systemd"

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#204227): 
https://lists.openembedded.org/g/openembedded-core/message/204227
Mute This Topic: https://lists.openembedded.org/mt/108275496/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [PATCH 2/3] bitbake.conf: add getopt to HOSTTOOLS

2024-09-02 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org 
>  On Behalf Of Mikko Rapeli
> Sent: den 2 september 2024 11:41
> To: openembedded-core@lists.openembedded.org
> Cc: Mikko Rapeli 
> Subject: [OE-core] [PATCH 2/3] bitbake.conf: add getopt to HOSTTOOLS

You are adding getent, not getopt.

> 
> Needed by systemd-tools-native
> 
> Signed-off-by: Mikko Rapeli 
> ---
>  meta/conf/bitbake.conf | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> index d8252c5b82..a8c630e7f8 100644
> --- a/meta/conf/bitbake.conf
> +++ b/meta/conf/bitbake.conf
> @@ -511,7 +511,7 @@ HOSTTOOLS_DIR = "${TMPDIR}/hosttools"
>  HOSTTOOLS += " \
>  [ ar as awk basename bash bunzip2 bzip2 cat chgrp chmod chown chrpath 
> cmp comm cp cpio \
>  cpp cut date dd diff diffstat dirname du echo egrep env expand expr 
> false \
> -fgrep file find flock g++ gawk gcc getconf getopt git grep gunzip gzip \
> +fgrep file find flock g++ gawk getent gcc getconf getopt git grep gunzip 
> gzip \

Keep the commands sorted.

>  head hostname iconv id install ld ldd ln ls lz4c make md5sum mkdir 
> mkfifo mknod \
>  mktemp mv nm objcopy objdump od patch perl pr printf pwd \
>  python3 pzstd ranlib readelf readlink realpath rm rmdir rpcgen sed seq 
> sh \
> --
> 2.34.1

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#204070): 
https://lists.openembedded.org/g/openembedded-core/message/204070
Mute This Topic: https://lists.openembedded.org/mt/108223986/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] insane: Drop oe.qa.add_message usage

2024-09-01 Thread Peter Kjellerstedt
> -Original Message-
> From: Richard Purdie 
> Sent: den 1 september 2024 13:31
> To: Peter Kjellerstedt ; 
> openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH] insane: Drop oe.qa.add_message usage
> 
> On Sun, 2024-09-01 at 11:21 +, Peter Kjellerstedt wrote:
> > > -Original Message-
> > > From: openembedded-core@lists.openembedded.org 
> > >  On Behalf Of Richard Purdie
> > > Sent: den 28 augusti 2024 18:15
> > > To: openembedded-core@lists.openembedded.org
> > > Subject: [OE-core] [PATCH] insane: Drop oe.qa.add_message usage
> > >
> > > Drop the oe.qa.add_message() usage in favour of oe.qa.handle_error() 
> > > which has
> > > code allowing it to be optimised with contains usage.
> > >
> > > The patch also drops unused return values which we stopped using a while 
> > > ago
> > > and drops the now unneeded function parameters, generally leading to 
> > > cleaner
> > > code.
> > >
> > > The code should be functionally equivalent.
> >
> > There is at least one difference. We have the following in our distro:
> >
> > WARN_QA:remove = "virtual-slash"
> > ERROR_QA:remove = "virtual-slash"
> >
> > since we do not build any package feeds and thus this QA error is not a
> > problem for us.
> >
> > After the change from add_message() to handle_error(), I now get a lot
> > of:
> >
> > NOTE: /path/to/recipe_1.2.3.bb: QA Issue: RDEPENDS is set to
> > virtual/foobar but the substring 'virtual/' holds no meaning in this
> > context. It only works for build time dependencies, not runtime ones. It
> > is suggested to use 'VIRTUAL-RUNTIME_' variables instead. [virtual-slash]
> >
> > during recipe parsing, which defeats the purpose of turning of the QA
> > error.
> >
> > Now, we can of course fix our recipes to avoid the use of runtime
> > dependencies on virtual/. I just wanted to point out that there is 
> > a difference in functionality, and one that is hard to do anything 
> > about in layers on top of OE-Core.
> 
> You're right, that is an unintended side effect. That said, I think the
> note log level is very noisy anyway?
> 
> Is the issue that notes at parse time get handled differently to those
> during task execution?

I would say so. Notes during task execution are only seen in the log, while 
notes before task execution are shown in the UI. However, I would not like 
to loose all notes shown before task execution begins, e.g., those that 
show how bitbake is progressing though its initial work are helpful to know 
what is going on. But the ones from oe.qa.handle_error() I can do without...

Also notes such as:

NOTE: Multiple providers are available for foobar (foobar, barfoo)
Consider defining a PREFERRED_PROVIDER entry to match foobar

might actually make more sense as a warning?

> 
> Cheers,
> 
> Richard

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#204052): 
https://lists.openembedded.org/g/openembedded-core/message/204052
Mute This Topic: https://lists.openembedded.org/mt/108145107/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] insane: Drop oe.qa.add_message usage

2024-09-01 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org 
>  On Behalf Of Richard Purdie
> Sent: den 28 augusti 2024 18:15
> To: openembedded-core@lists.openembedded.org
> Subject: [OE-core] [PATCH] insane: Drop oe.qa.add_message usage
> 
> Drop the oe.qa.add_message() usage in favour of oe.qa.handle_error() which has
> code allowing it to be optimised with contains usage.
> 
> The patch also drops unused return values which we stopped using a while ago
> and drops the now unneeded function parameters, generally leading to cleaner
> code.
> 
> The code should be functionally equivalent.

There is at least one difference. We have the following in our distro:

WARN_QA:remove = "virtual-slash"
ERROR_QA:remove = "virtual-slash"

since we do not build any package feeds and thus this QA error is not a problem 
for us.

After the change from add_message() to handle_error(), I now get a lot of:

NOTE: /path/to/recipe_1.2.3.bb: QA Issue: RDEPENDS is set to virtual/foobar but 
the substring 'virtual/' holds no meaning in this context. It only works for 
build time dependencies, not runtime ones. It is suggested to use 
'VIRTUAL-RUNTIME_' variables instead. [virtual-slash]

during recipe parsing, which defeats the purpose of turning of the QA error.

Now, we can of course fix our recipes to avoid the use of runtime dependencies 
on virtual/. I just wanted to point out that there is a difference in 
functionality, and one that is hard to do anything about in layers on top of 
OE-Core.

> 
> Signed-off-by: Richard Purdie 
> ---
>  meta/classes-global/insane.bbclass | 219 +++--
>  meta/lib/oe/qa.py  |   6 -
>  2 files changed, 84 insertions(+), 141 deletions(-)

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#204045): 
https://lists.openembedded.org/g/openembedded-core/message/204045
Mute This Topic: https://lists.openembedded.org/mt/108145107/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] abi-version/ssate: Bump to avoid systemd hash corruption issue

2024-09-01 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org 
>  On Behalf Of Richard Purdie
> Sent: den 1 september 2024 09:19
> To: openembedded-core@lists.openembedded.org
> Subject: [OE-core] [PATCH] abi-version/ssate: Bump to avoid systemd hash 
> corruption issue
> 
> Unfortunately some recent patches caused non-deterministic output.
> One input hash lead to both good and bad output and whilst that patch
> has been fixed, the problematic hash 'cross' linkage remains. Bump to
> a new sstate and hash equivalence version to avoid this and work from
> a clean slate.
> 
> Signed-off-by: Richard Purdie 
> ---
>  meta/classes-global/sstate.bbclass | 2 +-
>  meta/conf/abi_version.conf | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/meta/classes-global/sstate.bbclass 
> b/meta/classes-global/sstate.bbclass
> index beb22f424e8..fdd529ee4e8 100644
> --- a/meta/classes-global/sstate.bbclass
> +++ b/meta/classes-global/sstate.bbclass
> @@ -4,7 +4,7 @@
>  # SPDX-License-Identifier: MIT
>  #
> 
> -SSTATE_VERSION = "12"
> +SSTATE_VERSION = "14"
> 
>  SSTATE_ZSTD_CLEVEL ??= "8"
> 
> diff --git a/meta/conf/abi_version.conf b/meta/conf/abi_version.conf
> index 0fe91b5ddf3..ac97752c976 100644
> --- a/meta/conf/abi_version.conf
> +++ b/meta/conf/abi_version.conf
> @@ -12,4 +12,4 @@ OELAYOUT_ABI = "15"
>  # a reset of the equivalence, for example when reproducibility issues break 
> the
>  # existing match data. Distros can also append to this value for the same 
> effect.
>  #
> -HASHEQUIV_HASH_VERSION  = "17"
> +HASHEQUIV_HASH_VERSION  = "18"

Is this actually needed now after the changes to insane.bbclass? Won't those 
changes effectively invalidate the whole sstate anyway?

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#204041): 
https://lists.openembedded.org/g/openembedded-core/message/204041
Mute This Topic: https://lists.openembedded.org/mt/108207031/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] [PATCHv2 2/2] oeqa/selftest/bbclasses: Add tests for systemd and update-rc.d interaction

2024-08-24 Thread Peter Kjellerstedt
> -Original Message-
> From: Alexandre Belloni 
> Sent: den 24 augusti 2024 14:55
> To: Peter Kjellerstedt 
> Cc: openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCHv2 2/2] oeqa/selftest/bbclasses: Add tests
> for systemd and update-rc.d interaction
> 
> Hello,
> 
> This causes the following failures on the AB:
> 
> https://autobuilder.yoctoproject.org/typhoon/#/builders/131/builds/4746/steps/14/logs/stdio
> https://autobuilder.yoctoproject.org/typhoon/#/builders/102/builds/6435/steps/15/logs/stdio
> https://autobuilder.yoctoproject.org/typhoon/#/builders/107/builds/6486/steps/14/logs/stdio
> https://autobuilder.yoctoproject.org/typhoon/#/builders/109/builds/8223/steps/15/logs/stdio
> https://autobuilder.yoctoproject.org/typhoon/#/builders/101/builds/8110/steps/14/logs/stdio
> 
> Traceback (most recent call last):
>   File 
> "/home/pokybuild/yocto-worker/qemux86-alt/build/meta/lib/oeqa/core/decorator/__init__.py",
>  line 35, in wrapped_f
> return func(*args, **kwargs)
>   File 
> "/home/pokybuild/yocto-worker/qemux86-alt/build/meta/lib/oeqa/core/decorator/__init__.py",
>  line 35, in wrapped_f
> return func(*args, **kwargs)
>   File 
> "/home/pokybuild/yocto-worker/qemux86-alt/build/meta/lib/oeqa/core/decorator/__init__.py",
>  line 35, in wrapped_f
> return func(*args, **kwargs)
>   [Previous line repeated 1 more time]
>   File 
> "/home/pokybuild/yocto-worker/qemux86-alt/build/meta/lib/oeqa/runtime/cases/opkg.py",
>  line 59, in test_opkg_install_from_repo
> self.pkg('install run-postinsts-dev')
>   File 
> "/home/pokybuild/yocto-worker/qemux86-alt/build/meta/lib/oeqa/runtime/cases/opkg.py",
>  line 19, in pkg
> self.assertEqual(status, expected, message)
> AssertionError: 255 != 0 : opkg install run-postinsts-dev
> Synchronizing state of run-postinsts.service with SysV service script with 
> /usr/lib/systemd/systemd-sysv-install.
> Executing: /usr/lib/systemd/systemd-sysv-install enable run-postinsts
> Failed to execute /usr/lib/systemd/systemd-sysv-install: No such file or 
> directory
> error: pkg_run_script: package "run-postinsts" postinst script returned 
> status 1.
> error: opkg_configure: run-postinsts.postinst returned 1.

Ok, that was unexpected. Because that is the exact error that I fixed 
between v1 and v2 (and obviously do not see in my own testing anymore)...
 
//Peter

> On 23/08/2024 19:06:33+0200, Peter Kjellerstedt wrote:
> > These tests verify that the correct files are left behind when systemd
> > is inherited and depending on whether the systemd and/or sysvinit distro
> > features are enabled.
> >
> > Signed-off-by: Peter Kjellerstedt 
> > ---
> >
> > PATCHv2:
> > * Change LICENSE to MIT for the test recipes.
> > * Add EXCLUDE_FROM_WORLD to the test recipes.
> >
> >  .../bbclasses/systemd-and-sysvinit.bb |  17 +++
> >  .../recipes-test/bbclasses/systemd-only.bb|  12 ++
> >  meta/lib/oeqa/selftest/cases/bbclasses.py | 106 ++
> >  3 files changed, 135 insertions(+)
> >  create mode 100644 meta-selftest/recipes-test/bbclasses/systemd-and-
> sysvinit.bb
> >  create mode 100644 meta-selftest/recipes-test/bbclasses/systemd-only.bb
> >  create mode 100644 meta/lib/oeqa/selftest/cases/bbclasses.py
> >
> > diff --git a/meta-selftest/recipes-test/bbclasses/systemd-and-
> sysvinit.bb b/meta-selftest/recipes-test/bbclasses/systemd-and-sysvinit.bb
> > new file mode 100644
> > index 00..f9fc59a494
> > --- /dev/null
> > +++ b/meta-selftest/recipes-test/bbclasses/systemd-and-sysvinit.bb
> > @@ -0,0 +1,17 @@
> > +LICENSE = "MIT"
> > +
> > +inherit allarch systemd update-rc.d
> > +
> > +do_install() {
> > +   install -d ${D}${systemd_system_unitdir}
> > +   touch ${D}${systemd_system_unitdir}/${BPN}.service
> > +
> > +   install -d ${D}${INIT_D_DIR}
> > +   touch ${D}${INIT_D_DIR}/${BPN}
> > +}
> > +
> > +INITSCRIPT_NAME = "${BPN}"
> > +
> > +SYSTEMD_SERVICE:${PN} = "${BPN}.service"
> > +
> > +EXCLUDE_FROM_WORLD="1"
> > diff --git a/meta-selftest/recipes-test/bbclasses/systemd-only.bb
> b/meta-selftest/recipes-test/bbclasses/systemd-only.bb
> > new file mode 100644
> > index 00..590a27b9cb
> > --- /dev/null
> > +++ b/meta-selftest/recipes-test/bbclasses/systemd-only.bb
> > @@ -0,0 +1,12 @@
> > +LICENSE = "MIT"
> > +
> > +inherit allarch systemd
> > +
> > +do_install() {
> > +   install -d ${D}

[OE-core] [PATCHv2 2/2] oeqa/selftest/bbclasses: Add tests for systemd and update-rc.d interaction

2024-08-23 Thread Peter Kjellerstedt
These tests verify that the correct files are left behind when systemd
is inherited and depending on whether the systemd and/or sysvinit distro
features are enabled.

Signed-off-by: Peter Kjellerstedt 
---

PATCHv2:
* Change LICENSE to MIT for the test recipes.
* Add EXCLUDE_FROM_WORLD to the test recipes.

 .../bbclasses/systemd-and-sysvinit.bb |  17 +++
 .../recipes-test/bbclasses/systemd-only.bb|  12 ++
 meta/lib/oeqa/selftest/cases/bbclasses.py | 106 ++
 3 files changed, 135 insertions(+)
 create mode 100644 meta-selftest/recipes-test/bbclasses/systemd-and-sysvinit.bb
 create mode 100644 meta-selftest/recipes-test/bbclasses/systemd-only.bb
 create mode 100644 meta/lib/oeqa/selftest/cases/bbclasses.py

diff --git a/meta-selftest/recipes-test/bbclasses/systemd-and-sysvinit.bb 
b/meta-selftest/recipes-test/bbclasses/systemd-and-sysvinit.bb
new file mode 100644
index 00..f9fc59a494
--- /dev/null
+++ b/meta-selftest/recipes-test/bbclasses/systemd-and-sysvinit.bb
@@ -0,0 +1,17 @@
+LICENSE = "MIT"
+
+inherit allarch systemd update-rc.d
+
+do_install() {
+   install -d ${D}${systemd_system_unitdir}
+   touch ${D}${systemd_system_unitdir}/${BPN}.service
+
+   install -d ${D}${INIT_D_DIR}
+   touch ${D}${INIT_D_DIR}/${BPN}
+}
+
+INITSCRIPT_NAME = "${BPN}"
+
+SYSTEMD_SERVICE:${PN} = "${BPN}.service"
+
+EXCLUDE_FROM_WORLD="1"
diff --git a/meta-selftest/recipes-test/bbclasses/systemd-only.bb 
b/meta-selftest/recipes-test/bbclasses/systemd-only.bb
new file mode 100644
index 00..590a27b9cb
--- /dev/null
+++ b/meta-selftest/recipes-test/bbclasses/systemd-only.bb
@@ -0,0 +1,12 @@
+LICENSE = "MIT"
+
+inherit allarch systemd
+
+do_install() {
+   install -d ${D}${systemd_system_unitdir}
+   touch ${D}${systemd_system_unitdir}/${BPN}.service
+}
+
+SYSTEMD_SERVICE:${PN} = "${BPN}.service"
+
+EXCLUDE_FROM_WORLD="1"
diff --git a/meta/lib/oeqa/selftest/cases/bbclasses.py 
b/meta/lib/oeqa/selftest/cases/bbclasses.py
new file mode 100644
index 00..10545ebe65
--- /dev/null
+++ b/meta/lib/oeqa/selftest/cases/bbclasses.py
@@ -0,0 +1,106 @@
+#
+# Copyright OpenEmbedded Contributors
+#
+# SPDX-License-Identifier: MIT
+#
+
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import get_bb_vars, bitbake
+
+class Systemd(OESelftestTestCase):
+"""
+Tests related to the systemd bbclass.
+"""
+
+def getVars(self, recipe):
+self.bb_vars = get_bb_vars(
+[
+'BPN',
+'D',
+'INIT_D_DIR',
+'prefix',
+'systemd_system_unitdir',
+'sysconfdir',
+],
+recipe,
+)
+
+def fileExists(self, filename):
+self.assertExists(filename.format(**self.bb_vars))
+
+def fileNotExists(self, filename):
+self.assertNotExists(filename.format(**self.bb_vars))
+
+def test_systemd_in_distro(self):
+"""
+Summary:Verify that no sysvinit files are installed when the
+systemd distro feature is enabled, but sysvinit is not.
+Expected:   Systemd service file exists, but /etc does not.
+Product:OE-Core
+Author: Peter Kjellerstedt 
+"""
+
+self.write_config("""
+DISTRO_FEATURES:append = " systemd usrmerge"
+DISTRO_FEATURES:remove = "sysvinit"
+VIRTUAL-RUNTIME_init_manager = "systemd"
+""")
+bitbake("systemd-only systemd-and-sysvinit -c install")
+
+self.getVars("systemd-only")
+self.fileExists("{D}{systemd_system_unitdir}/{BPN}.service")
+
+self.getVars("systemd-and-sysvinit")
+self.fileExists("{D}{systemd_system_unitdir}/{BPN}.service")
+self.fileNotExists("{D}{sysconfdir}")
+
+def test_systemd_and_sysvinit_in_distro(self):
+"""
+Summary:Verify that both systemd and sysvinit files are installed
+when both the systemd and sysvinit distro features are
+enabled.
+Expected:   Systemd service file and sysvinit initscript exist.
+Product:OE-Core
+Author: Peter Kjellerstedt 
+"""
+
+self.write_config("""
+DISTRO_FEATURES:append = " systemd sysvinit usrmerge"
+VIRTUAL-RUNTIME_init_manager = "systemd"
+""")
+bitbake("systemd-only systemd-and-sysvinit -c install")
+
+self.getVars("systemd-only")
+self.fileExists("{D}{systemd_system_unitdir}/{BPN}.service")
+
+self.getVars("systemd-and-sysvinit")
+

[OE-core] [PATCHv2 1/2] systemd.bbclass: Clean up empty parent directories

2024-08-23 Thread Peter Kjellerstedt
Previously, rm_systemd_unitdir() would remove one parent directory of
${systemd_unitdir} if it was empty after removing ${systemd_unitdir}.
rm_sysvinit_initddir() would not remove any parent directory. Thus, if
the only directory created in /etc was /etc/init.d, an empty /etc would
remain after the cleanup and would be packaged.

Simplify rm_systemd_unitdir() and rm_sysvinit_initddir() by rewriting
them in shell, and use rmdir -p to remove all empty parent directories.

Signed-off-by: Peter Kjellerstedt 
---

PATCHv2:
* Rewrote rm_systemd_unitdir() to avoid having `rmdir -p` potentially
  delete ${D}.
* Add an argument to `read` used in rm_sysvinit_initddir() while
  determining if ${systemd_system_unitdir} is empty. Calling read
  without arguments is apparently a bashism.

 meta/classes-recipe/systemd.bbclass | 45 +
 1 file changed, 20 insertions(+), 25 deletions(-)

diff --git a/meta/classes-recipe/systemd.bbclass 
b/meta/classes-recipe/systemd.bbclass
index 0f7e3b5a08..fa6d3775ec 100644
--- a/meta/classes-recipe/systemd.bbclass
+++ b/meta/classes-recipe/systemd.bbclass
@@ -208,33 +208,28 @@ python systemd_populate_packages() {
 
 PACKAGESPLITFUNCS =+ "systemd_populate_packages"
 
-python rm_systemd_unitdir (){
-import shutil
-if not bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d):
-systemd_unitdir = oe.path.join(d.getVar("D"), 
d.getVar('systemd_unitdir'))
-if os.path.exists(systemd_unitdir):
-shutil.rmtree(systemd_unitdir)
-systemd_libdir = os.path.dirname(systemd_unitdir)
-if (os.path.exists(systemd_libdir) and not os.listdir(systemd_libdir)):
-os.rmdir(systemd_libdir)
+rm_systemd_unitdir() {
+   rm -rf ${D}${systemd_unitdir}
+   # Change into ${D} and use a relative path with rmdir -p to avoid
+   # having it remove ${D} if it becomes empty.
+   (cd ${D} && rmdir -p $(dirname ${systemd_unitdir#/}) 2>/dev/null || :)
 }
 
-python rm_sysvinit_initddir (){
-import shutil
-sysv_initddir = oe.path.join(d.getVar("D"), (d.getVar('INIT_D_DIR') or 
"/etc/init.d"))
-
-if bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d) and \
-not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d) 
and \
-os.path.exists(sysv_initddir):
-systemd_system_unitdir = oe.path.join(d.getVar("D"), 
d.getVar('systemd_system_unitdir'))
+rm_sysvinit_initddir() {
+   local sysv_initddir=${INIT_D_DIR}
+   : ${sysv_initddir:=${sysconfdir}/init.d}
 
-# If systemd_system_unitdir contains anything, delete sysv_initddir
-if (os.path.exists(systemd_system_unitdir) and 
os.listdir(systemd_system_unitdir)):
-shutil.rmtree(sysv_initddir)
+   # If systemd_system_unitdir contains anything, delete sysv_initddir
+if find ${D}${systemd_system_unitdir} -mindepth 1 -maxdepth 1 
2>/dev/null | read DUMMY; then
+   rm -rf ${D}$sysv_initddir
+   rmdir -p $(dirname ${D}$sysv_initddir) 2>/dev/null || :
+   fi
 }
 
-do_install[postfuncs] += "${RMINITDIR} "
-RMINITDIR:class-target = " rm_sysvinit_initddir rm_systemd_unitdir "
-RMINITDIR:class-nativesdk = " rm_sysvinit_initddir rm_systemd_unitdir "
-RMINITDIR = ""
-
+do_install[postfuncs] += "${RMINITDIR}"
+RMINITDIR = " \
+${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', 
'rm_systemd_unitdir', d)} \
+${@'rm_sysvinit_initddir' if bb.utils.contains('DISTRO_FEATURES', 
'systemd', True, False, d) and \
+ not bb.utils.contains('DISTRO_FEATURES', 
'sysvinit', True, False, d) else ''} \
+"
+RMINITDIR:class-native = ""

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#203701): 
https://lists.openembedded.org/g/openembedded-core/message/203701
Mute This Topic: https://lists.openembedded.org/mt/108059586/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 2/2] oeqa/selftest/bbclasses: Add tests for systemd and update-rc.d interaction

2024-08-20 Thread Peter Kjellerstedt
These tests verify that the correct files are left behind when systemd
is inherited and depending on whether the systemd and/or sysvinit distro
features are enabled.

Signed-off-by: Peter Kjellerstedt 
---

PATCHv2: Change LICENSE to MIT and add EXCLUDE_FROM_WORLD to the test
 recipes

 .../bbclasses/systemd-and-sysvinit.bb |  17 +++
 .../recipes-test/bbclasses/systemd-only.bb|  12 ++
 meta/lib/oeqa/selftest/cases/bbclasses.py | 106 ++
 3 files changed, 135 insertions(+)
 create mode 100644 meta-selftest/recipes-test/bbclasses/systemd-and-sysvinit.bb
 create mode 100644 meta-selftest/recipes-test/bbclasses/systemd-only.bb
 create mode 100644 meta/lib/oeqa/selftest/cases/bbclasses.py

diff --git a/meta-selftest/recipes-test/bbclasses/systemd-and-sysvinit.bb 
b/meta-selftest/recipes-test/bbclasses/systemd-and-sysvinit.bb
new file mode 100644
index 00..f9fc59a494
--- /dev/null
+++ b/meta-selftest/recipes-test/bbclasses/systemd-and-sysvinit.bb
@@ -0,0 +1,17 @@
+LICENSE = "MIT"
+
+inherit allarch systemd update-rc.d
+
+do_install() {
+   install -d ${D}${systemd_system_unitdir}
+   touch ${D}${systemd_system_unitdir}/${BPN}.service
+
+   install -d ${D}${INIT_D_DIR}
+   touch ${D}${INIT_D_DIR}/${BPN}
+}
+
+INITSCRIPT_NAME = "${BPN}"
+
+SYSTEMD_SERVICE:${PN} = "${BPN}.service"
+
+EXCLUDE_FROM_WORLD = "1"
diff --git a/meta-selftest/recipes-test/bbclasses/systemd-only.bb 
b/meta-selftest/recipes-test/bbclasses/systemd-only.bb
new file mode 100644
index 00..590a27b9cb
--- /dev/null
+++ b/meta-selftest/recipes-test/bbclasses/systemd-only.bb
@@ -0,0 +1,12 @@
+LICENSE = "MIT"
+
+inherit allarch systemd
+
+do_install() {
+   install -d ${D}${systemd_system_unitdir}
+   touch ${D}${systemd_system_unitdir}/${BPN}.service
+}
+
+SYSTEMD_SERVICE:${PN} = "${BPN}.service"
+
+EXCLUDE_FROM_WORLD = "1"
diff --git a/meta/lib/oeqa/selftest/cases/bbclasses.py 
b/meta/lib/oeqa/selftest/cases/bbclasses.py
new file mode 100644
index 00..10545ebe65
--- /dev/null
+++ b/meta/lib/oeqa/selftest/cases/bbclasses.py
@@ -0,0 +1,106 @@
+#
+# Copyright OpenEmbedded Contributors
+#
+# SPDX-License-Identifier: MIT
+#
+
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import get_bb_vars, bitbake
+
+class Systemd(OESelftestTestCase):
+"""
+Tests related to the systemd bbclass.
+"""
+
+def getVars(self, recipe):
+self.bb_vars = get_bb_vars(
+[
+'BPN',
+'D',
+'INIT_D_DIR',
+'prefix',
+'systemd_system_unitdir',
+'sysconfdir',
+],
+recipe,
+)
+
+def fileExists(self, filename):
+self.assertExists(filename.format(**self.bb_vars))
+
+def fileNotExists(self, filename):
+self.assertNotExists(filename.format(**self.bb_vars))
+
+def test_systemd_in_distro(self):
+"""
+Summary:Verify that no sysvinit files are installed when the
+systemd distro feature is enabled, but sysvinit is not.
+Expected:   Systemd service file exists, but /etc does not.
+Product:OE-Core
+Author: Peter Kjellerstedt 
+"""
+
+self.write_config("""
+DISTRO_FEATURES:append = " systemd usrmerge"
+DISTRO_FEATURES:remove = "sysvinit"
+VIRTUAL-RUNTIME_init_manager = "systemd"
+""")
+bitbake("systemd-only systemd-and-sysvinit -c install")
+
+self.getVars("systemd-only")
+self.fileExists("{D}{systemd_system_unitdir}/{BPN}.service")
+
+self.getVars("systemd-and-sysvinit")
+self.fileExists("{D}{systemd_system_unitdir}/{BPN}.service")
+self.fileNotExists("{D}{sysconfdir}")
+
+def test_systemd_and_sysvinit_in_distro(self):
+"""
+Summary:Verify that both systemd and sysvinit files are installed
+when both the systemd and sysvinit distro features are
+enabled.
+Expected:   Systemd service file and sysvinit initscript exist.
+Product:OE-Core
+Author: Peter Kjellerstedt 
+"""
+
+self.write_config("""
+DISTRO_FEATURES:append = " systemd sysvinit usrmerge"
+VIRTUAL-RUNTIME_init_manager = "systemd"
+""")
+bitbake("systemd-only systemd-and-sysvinit -c install")
+
+self.getVars("systemd-only")
+self.fileExists("{D}{systemd_system_unitdir}/{BPN}.service")
+
+self.getVars("systemd-and-sysvinit")
+self.

[OE-core] [PATCHv2 1/2] systemd.bbclass: Clean up empty parent directories

2024-08-20 Thread Peter Kjellerstedt
Previously, rm_systemd_unitdir() would remove one parent directory of
${systemd_unitdir} if it was empty after removing ${systemd_unitdir}.
rm_sysvinit_initddir() would not remove any parent directory. Thus, if
the only directory created in /etc was /etc/init.d, an empty /etc would
remain after the cleanup and would be packaged.

Simplify rm_systemd_unitdir() and rm_sysvinit_initddir() by rewriting
them in shell, and use rmdir -p to remove all empty parent directories.

Signed-off-by: Peter Kjellerstedt 
---

PATCHv2: No changes.

 meta/classes-recipe/systemd.bbclass | 46 +
 1 file changed, 21 insertions(+), 25 deletions(-)

diff --git a/meta/classes-recipe/systemd.bbclass 
b/meta/classes-recipe/systemd.bbclass
index 0f7e3b5a08..987b3fc0c7 100644
--- a/meta/classes-recipe/systemd.bbclass
+++ b/meta/classes-recipe/systemd.bbclass
@@ -208,33 +208,29 @@ python systemd_populate_packages() {
 
 PACKAGESPLITFUNCS =+ "systemd_populate_packages"
 
-python rm_systemd_unitdir (){
-import shutil
-if not bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d):
-systemd_unitdir = oe.path.join(d.getVar("D"), 
d.getVar('systemd_unitdir'))
-if os.path.exists(systemd_unitdir):
-shutil.rmtree(systemd_unitdir)
-systemd_libdir = os.path.dirname(systemd_unitdir)
-if (os.path.exists(systemd_libdir) and not os.listdir(systemd_libdir)):
-os.rmdir(systemd_libdir)
+rm_systemd_unitdir() {
+   rm -rf ${D}${systemd_unitdir}
+   rmdir -p $(dirname ${D}${systemd_unitdir}) 2>/dev/null || :
+   # Make sure ${D} still exists since rmdir -p may have removed it in
+   # case ${systemd_unitdir} was the only directory present.
+   [ -d ${D} ] || mkdir -p ${D}
 }
 
-python rm_sysvinit_initddir (){
-import shutil
-sysv_initddir = oe.path.join(d.getVar("D"), (d.getVar('INIT_D_DIR') or 
"/etc/init.d"))
-
-if bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d) and \
-not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d) 
and \
-os.path.exists(sysv_initddir):
-systemd_system_unitdir = oe.path.join(d.getVar("D"), 
d.getVar('systemd_system_unitdir'))
+rm_sysvinit_initddir() {
+   local sysv_initddir=${INIT_D_DIR}
+   : ${sysv_initddir:=${sysconfdir}/init.d}
 
-# If systemd_system_unitdir contains anything, delete sysv_initddir
-if (os.path.exists(systemd_system_unitdir) and 
os.listdir(systemd_system_unitdir)):
-shutil.rmtree(sysv_initddir)
+   # If systemd_system_unitdir contains anything, delete sysv_initddir
+if find ${D}${systemd_system_unitdir} -mindepth 1 -maxdepth 1 
2>/dev/null | read; then
+   rm -rf ${D}$sysv_initddir
+   rmdir -p $(dirname ${D}$sysv_initddir) 2>/dev/null || :
+   fi
 }
 
-do_install[postfuncs] += "${RMINITDIR} "
-RMINITDIR:class-target = " rm_sysvinit_initddir rm_systemd_unitdir "
-RMINITDIR:class-nativesdk = " rm_sysvinit_initddir rm_systemd_unitdir "
-RMINITDIR = ""
-
+do_install[postfuncs] += "${RMINITDIR}"
+RMINITDIR = " \
+${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', 
'rm_systemd_unitdir', d)} \
+${@'rm_sysvinit_initddir' if bb.utils.contains('DISTRO_FEATURES', 
'systemd', True, False, d) and \
+ not bb.utils.contains('DISTRO_FEATURES', 
'sysvinit', True, False, d) else ''} \
+"
+RMINITDIR:class-native = ""

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#203572): 
https://lists.openembedded.org/g/openembedded-core/message/203572
Mute This Topic: https://lists.openembedded.org/mt/108010123/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] oeqa/selftest/bbclasses: Add tests for systemd and update-rc.d interaction

2024-08-20 Thread Peter Kjellerstedt
These tests verify that the correct files are left behind when systemd
is inherited and depending on whether the systemd and/or sysvinit distro
features are enabled.

Signed-off-by: Peter Kjellerstedt 
---
 .../bbclasses/systemd-and-sysvinit.bb |  15 +++
 .../recipes-test/bbclasses/systemd-only.bb|  10 ++
 meta/lib/oeqa/selftest/cases/bbclasses.py | 106 ++
 3 files changed, 131 insertions(+)
 create mode 100644 meta-selftest/recipes-test/bbclasses/systemd-and-sysvinit.bb
 create mode 100644 meta-selftest/recipes-test/bbclasses/systemd-only.bb
 create mode 100644 meta/lib/oeqa/selftest/cases/bbclasses.py

diff --git a/meta-selftest/recipes-test/bbclasses/systemd-and-sysvinit.bb 
b/meta-selftest/recipes-test/bbclasses/systemd-and-sysvinit.bb
new file mode 100644
index 00..b820a10528
--- /dev/null
+++ b/meta-selftest/recipes-test/bbclasses/systemd-and-sysvinit.bb
@@ -0,0 +1,15 @@
+LICENSE = "CLOSED"
+
+inherit allarch systemd update-rc.d
+
+do_install() {
+   install -d ${D}${systemd_system_unitdir}
+   touch ${D}${systemd_system_unitdir}/${BPN}.service
+
+   install -d ${D}${INIT_D_DIR}
+   touch ${D}${INIT_D_DIR}/${BPN}
+}
+
+INITSCRIPT_NAME = "${BPN}"
+
+SYSTEMD_SERVICE:${PN} = "${BPN}.service"
diff --git a/meta-selftest/recipes-test/bbclasses/systemd-only.bb 
b/meta-selftest/recipes-test/bbclasses/systemd-only.bb
new file mode 100644
index 00..3a28713cb5
--- /dev/null
+++ b/meta-selftest/recipes-test/bbclasses/systemd-only.bb
@@ -0,0 +1,10 @@
+LICENSE = "CLOSED"
+
+inherit allarch systemd
+
+do_install() {
+   install -d ${D}${systemd_system_unitdir}
+   touch ${D}${systemd_system_unitdir}/${BPN}.service
+}
+
+SYSTEMD_SERVICE:${PN} = "${BPN}.service"
diff --git a/meta/lib/oeqa/selftest/cases/bbclasses.py 
b/meta/lib/oeqa/selftest/cases/bbclasses.py
new file mode 100644
index 00..10545ebe65
--- /dev/null
+++ b/meta/lib/oeqa/selftest/cases/bbclasses.py
@@ -0,0 +1,106 @@
+#
+# Copyright OpenEmbedded Contributors
+#
+# SPDX-License-Identifier: MIT
+#
+
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import get_bb_vars, bitbake
+
+class Systemd(OESelftestTestCase):
+"""
+Tests related to the systemd bbclass.
+"""
+
+def getVars(self, recipe):
+self.bb_vars = get_bb_vars(
+[
+'BPN',
+'D',
+'INIT_D_DIR',
+'prefix',
+'systemd_system_unitdir',
+'sysconfdir',
+],
+recipe,
+)
+
+def fileExists(self, filename):
+self.assertExists(filename.format(**self.bb_vars))
+
+def fileNotExists(self, filename):
+self.assertNotExists(filename.format(**self.bb_vars))
+
+def test_systemd_in_distro(self):
+"""
+Summary:Verify that no sysvinit files are installed when the
+systemd distro feature is enabled, but sysvinit is not.
+Expected:   Systemd service file exists, but /etc does not.
+Product:OE-Core
+Author: Peter Kjellerstedt 
+"""
+
+self.write_config("""
+DISTRO_FEATURES:append = " systemd usrmerge"
+DISTRO_FEATURES:remove = "sysvinit"
+VIRTUAL-RUNTIME_init_manager = "systemd"
+""")
+bitbake("systemd-only systemd-and-sysvinit -c install")
+
+self.getVars("systemd-only")
+self.fileExists("{D}{systemd_system_unitdir}/{BPN}.service")
+
+self.getVars("systemd-and-sysvinit")
+self.fileExists("{D}{systemd_system_unitdir}/{BPN}.service")
+self.fileNotExists("{D}{sysconfdir}")
+
+def test_systemd_and_sysvinit_in_distro(self):
+"""
+    Summary:Verify that both systemd and sysvinit files are installed
+when both the systemd and sysvinit distro features are
+enabled.
+Expected:   Systemd service file and sysvinit initscript exist.
+Product:OE-Core
+Author: Peter Kjellerstedt 
+"""
+
+self.write_config("""
+DISTRO_FEATURES:append = " systemd sysvinit usrmerge"
+VIRTUAL-RUNTIME_init_manager = "systemd"
+""")
+bitbake("systemd-only systemd-and-sysvinit -c install")
+
+self.getVars("systemd-only")
+self.fileExists("{D}{systemd_system_unitdir}/{BPN}.service")
+
+self.getVars("systemd-and-sysvinit")
+self.fileExists("{D}{systemd_system_unitdir}/{BPN}.service")
+self.fileExists("{D}{INIT_D_DIR}/{BPN}")
+
+def test_sysvinit_

[OE-core] [PATCH 1/2] systemd.bbclass: Clean up empty parent directories

2024-08-20 Thread Peter Kjellerstedt
Previously, rm_systemd_unitdir() would remove one parent directory of
${systemd_unitdir} if it was empty after removing ${systemd_unitdir}.
rm_sysvinit_initddir() would not remove any parent directory. Thus, if
the only directory created in /etc was /etc/init.d, an empty /etc would
remain after the cleanup and would be packaged.

Simplify rm_systemd_unitdir() and rm_sysvinit_initddir() by rewriting
them in shell, and use rmdir -p to remove all empty parent directories.

Signed-off-by: Peter Kjellerstedt 
---
 meta/classes-recipe/systemd.bbclass | 46 +
 1 file changed, 21 insertions(+), 25 deletions(-)

diff --git a/meta/classes-recipe/systemd.bbclass 
b/meta/classes-recipe/systemd.bbclass
index 0f7e3b5a08..987b3fc0c7 100644
--- a/meta/classes-recipe/systemd.bbclass
+++ b/meta/classes-recipe/systemd.bbclass
@@ -208,33 +208,29 @@ python systemd_populate_packages() {
 
 PACKAGESPLITFUNCS =+ "systemd_populate_packages"
 
-python rm_systemd_unitdir (){
-import shutil
-if not bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d):
-systemd_unitdir = oe.path.join(d.getVar("D"), 
d.getVar('systemd_unitdir'))
-if os.path.exists(systemd_unitdir):
-shutil.rmtree(systemd_unitdir)
-systemd_libdir = os.path.dirname(systemd_unitdir)
-if (os.path.exists(systemd_libdir) and not os.listdir(systemd_libdir)):
-os.rmdir(systemd_libdir)
+rm_systemd_unitdir() {
+   rm -rf ${D}${systemd_unitdir}
+   rmdir -p $(dirname ${D}${systemd_unitdir}) 2>/dev/null || :
+   # Make sure ${D} still exists since rmdir -p may have removed it in
+   # case ${systemd_unitdir} was the only directory present.
+   [ -d ${D} ] || mkdir -p ${D}
 }
 
-python rm_sysvinit_initddir (){
-import shutil
-sysv_initddir = oe.path.join(d.getVar("D"), (d.getVar('INIT_D_DIR') or 
"/etc/init.d"))
-
-if bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d) and \
-not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d) 
and \
-os.path.exists(sysv_initddir):
-systemd_system_unitdir = oe.path.join(d.getVar("D"), 
d.getVar('systemd_system_unitdir'))
+rm_sysvinit_initddir() {
+   local sysv_initddir=${INIT_D_DIR}
+   : ${sysv_initddir:=${sysconfdir}/init.d}
 
-# If systemd_system_unitdir contains anything, delete sysv_initddir
-if (os.path.exists(systemd_system_unitdir) and 
os.listdir(systemd_system_unitdir)):
-shutil.rmtree(sysv_initddir)
+   # If systemd_system_unitdir contains anything, delete sysv_initddir
+if find ${D}${systemd_system_unitdir} -mindepth 1 -maxdepth 1 
2>/dev/null | read; then
+   rm -rf ${D}$sysv_initddir
+   rmdir -p $(dirname ${D}$sysv_initddir) 2>/dev/null || :
+   fi
 }
 
-do_install[postfuncs] += "${RMINITDIR} "
-RMINITDIR:class-target = " rm_sysvinit_initddir rm_systemd_unitdir "
-RMINITDIR:class-nativesdk = " rm_sysvinit_initddir rm_systemd_unitdir "
-RMINITDIR = ""
-
+do_install[postfuncs] += "${RMINITDIR}"
+RMINITDIR = " \
+${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', 
'rm_systemd_unitdir', d)} \
+${@'rm_sysvinit_initddir' if bb.utils.contains('DISTRO_FEATURES', 
'systemd', True, False, d) and \
+ not bb.utils.contains('DISTRO_FEATURES', 
'sysvinit', True, False, d) else ''} \
+"
+RMINITDIR:class-native = ""

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#203569): 
https://lists.openembedded.org/g/openembedded-core/message/203569
Mute This Topic: https://lists.openembedded.org/mt/108008175/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] util-linux: Add PACKAGECONFIG option to mitigate rootfs remount error

2024-08-19 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org 
>  On Behalf Of Niko Mauno via 
> lists.openembedded.org
> Sent: den 19 augusti 2024 12:10
> To: openembedded-core@lists.openembedded.org
> Cc: Niko Mauno 
> Subject: [OE-core] [PATCH v4] util-linux: Add PACKAGECONFIG option to 
> mitigate rootfs remount error
> 

[cut]

> ---
>  meta/recipes-core/util-linux/util-linux_2.40.1.bb | 7 +++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/meta/recipes-core/util-linux/util-linux_2.40.1.bb 
> b/meta/recipes-core/util-linux/util-linux_2.40.1.bb
> index a1aab94055..0b36df8e1b 100644
> --- a/meta/recipes-core/util-linux/util-linux_2.40.1.bb
> +++ b/meta/recipes-core/util-linux/util-linux_2.40.1.bb
> @@ -107,6 +107,13 @@ PACKAGECONFIG[cryptsetup] = 
> "--with-cryptsetup,--without-cryptsetup,cryptsetup"
>  PACKAGECONFIG[chfn-chsh] = "--enable-chfn-chsh,--disable-chfn-chsh,"
>  PACKAGECONFIG[selinux] = "--with-selinux,--without-selinux,libselinux"
>  PACKAGECONFIG[lastlog2] = 
> "--enable-liblastlog2,--disable-liblastlog2,sqlite3"
> +# Using the new file descriptors based mount kernel API can cause rootfs 
> remount failure with some older kernels.
> +# Of currently supported LTS kernels, the old mount API should be used with:
> +# - versions prior to 6.6.18 in the 6.6.y series.
> +# - versions prior to 6.1.79 in the 6.1.y series.
> +# - versions till at least 5.15.164 in the 5.15.y series.
> +# - with 5.10.y, 5.4.y and 4.19.y series kernels, libmount seemed to use the 
> old API regardless of this option.
> +PACKAGECONFIG[no-new-mount-api] = 
> "--disable-libmount-mountfd-support,--enable-libmount-mountfd-support"

Please avoid negative PACKAGECONFIGs. Instead use:

PACKAGECONFIG[new-mount-api] = 
"--enable-libmount-mountfd-support,--disable-libmount-mountfd-support"

and add "new-mount-api" to the default for PACKAGECONFIG.

Also, how long will the "new" in "new-mount-api" be valid, i.e., what 
happens when the next mount API comes along? It might be better to match 
the feature name to the configuration option, e.g.:

PACKAGECONFIG[libmount-mountfd-support] = 
"--enable-libmount-mountfd-support,--disable-libmount-mountfd-support"

> 
>  EXTRA_OEMAKE = "ARCH=${TARGET_ARCH} CPU= CPUOPT= 'OPT=${CFLAGS}'"
> 
> --
> 2.39.2

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#203515): 
https://lists.openembedded.org/g/openembedded-core/message/203515
Mute This Topic: https://lists.openembedded.org/mt/107977721/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core][PATCH v2] python3: skip readline limited history tests

2024-08-14 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org  c...@lists.openembedded.org> On Behalf Of Chen Qi via
> lists.openembedded.org
> Sent: den 14 augusti 2024 17:02
> To: Trevor Gamblin ; openembedded-
> c...@lists.openembedded.org; Khem Raj 
> Cc: alex.kana...@gmail.com; alexandre.bell...@bootlin.com; Khem Raj
> 
> Subject: Re: [OE-core][PATCH v2] python3: skip readline limited history
> tests
> 
> How about using INCOMPITABLE_LICENSE to determine the default
> PACAKGECONFIG, so that the default is readline? Maybe this would be part

No. In modern configurations, INCOMPITABLE_LICENSE should only be set for 
image recipes to allow, e.g., GPL-3.0 code to be used in one image, but not 
another.

> of the new meta-gplv2 replacement work (@Khem Raj). I'm not very sure
> about it, though. As far as I can see, very few people care about this
> GPLv3 problem. The evidence is that meta-gplv2 is NOT supported for a long

Note that readline is GPL-3.0, not LGPL-3.0, which means linking with it 
directly impacts the licensing of the entire application.

And while I cannot speak for others, (L)GPL-3.0 are problematic and should be 
avoided if possible, and be optional otherwise. Which is exactly what Ross 
did when he changed the default from readline to editline in the python3 
recipe. Going back on that is definitely the wrong thing to do.

> time and nobody ever devotes any real effort to develop an alternative.
> 
> I guess when the commit was made, the underlying API incompatibility was
> NOT made clear.

If the test fails when python3 is configured to use editline, then I would 
say that it is the test that is wrong and should be corrected.

> 
> I'm OK with any choice, as long as clear statements are there to tell
> people why, though I prefer to use readline as the default, as it would
> provide better user experience.
> 
> Regards,
> Qi

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#203325): 
https://lists.openembedded.org/g/openembedded-core/message/203325
Mute This Topic: https://lists.openembedded.org/mt/107879487/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] license_image.bbclass: Rename license-incompatible to license-exception

2024-08-12 Thread Peter Kjellerstedt
There is currently both an incompatible-license and a
license-incompatible QA message. This is very confusing.
However, license-incompatible is only used to output a message when a
package is included in an image despite it having a license that is
normally incompatible (by using the INCOMPATIBLE_LICENSE_EXCEPTIONS
variable). To better match how it is used and to distinguish it from
incompatible-license, rename it to license-exception.

Signed-off-by: Peter Kjellerstedt 
---
 meta/classes-global/insane.bbclass   | 2 +-
 meta/classes-recipe/license_image.bbclass| 2 +-
 meta/lib/oeqa/selftest/cases/incompatible_lic.py | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/meta/classes-global/insane.bbclass 
b/meta/classes-global/insane.bbclass
index 04eb88364e5..6a84c4aa74d 100644
--- a/meta/classes-global/insane.bbclass
+++ b/meta/classes-global/insane.bbclass
@@ -34,7 +34,7 @@ ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch 
pkgconfig la \
 mime mime-xdg unlisted-pkg-lics unhandled-features-check \
 missing-update-alternatives missing-ptest \
 license-exists license-no-generic license-syntax license-format \
-license-incompatible license-file-missing obsolete-license \
+license-exception license-file-missing obsolete-license \
 libdir xorg-driver-abi buildpaths \
 dep-cmp pkgvarcheck perm-config perm-line perm-link \
 packages-list pkgv-undefined var-undefined \
diff --git a/meta/classes-recipe/license_image.bbclass 
b/meta/classes-recipe/license_image.bbclass
index 19b3dc55ba2..0e953856a63 100644
--- a/meta/classes-recipe/license_image.bbclass
+++ b/meta/classes-recipe/license_image.bbclass
@@ -72,7 +72,7 @@ def write_license_files(d, license_manifest, pkg_dic, 
rootfs=True):
 else:
 incompatible_licenses = incompatible_pkg_license(d, 
bad_licenses, pkg_dic[pkg]["LICENSE"])
 if incompatible_licenses:
-oe.qa.handle_error('license-incompatible', "Including %s 
with incompatible license(s) %s into the image, because it has been allowed by 
exception list." %(pkg, ' '.join(incompatible_licenses)), d)
+oe.qa.handle_error('license-exception', "Including %s with 
incompatible license(s) %s into the image, because it has been allowed by 
exception list." %(pkg, ' '.join(incompatible_licenses)), d)
 try:
 (pkg_dic[pkg]["LICENSE"], pkg_dic[pkg]["LICENSES"]) = \
 oe.license.manifest_licenses(pkg_dic[pkg]["LICENSE"],
diff --git a/meta/lib/oeqa/selftest/cases/incompatible_lic.py 
b/meta/lib/oeqa/selftest/cases/incompatible_lic.py
index 4c228de6a33..439c1b9f0ec 100644
--- a/meta/lib/oeqa/selftest/cases/incompatible_lic.py
+++ b/meta/lib/oeqa/selftest/cases/incompatible_lic.py
@@ -128,7 +128,7 @@ INCOMPATIBLE_LICENSE:pn-core-image-minimal = "GPL-3.0* 
LGPL-3.0*"
 bitbake('core-image-minimal')
 
 def test_bash_license_exceptions(self):
-self.write_config(self.default_config() + 
'\nINCOMPATIBLE_LICENSE_EXCEPTIONS:pn-core-image-minimal = 
"bash:GPL-3.0-or-later"\nERROR_QA:remove = "license-incompatible"')
+self.write_config(self.default_config() + 
'\nINCOMPATIBLE_LICENSE_EXCEPTIONS:pn-core-image-minimal = 
"bash:GPL-3.0-or-later"\nERROR_QA:remove = "license-exception"')
 
 bitbake('core-image-minimal')
 

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#203233): 
https://lists.openembedded.org/g/openembedded-core/message/203233
Mute This Topic: https://lists.openembedded.org/mt/107864351/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [PATCH v2 1/2] buildhistory: fix package output folder creation

2024-08-08 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org  c...@lists.openembedded.org> On Behalf Of Richard Purdie
> Sent: den 7 augusti 2024 18:44
> To: alexandre.bell...@bootlin.com;
> pedro.silva.ferre...@criticaltechworks.com
> Cc: openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH v2 1/2] buildhistory: fix package output
> folder creation
> 
> On Wed, 2024-08-07 at 17:55 +0200, Alexandre Belloni via
> lists.openembedded.org wrote:
> > Hello,
> >
> > Because of DMARC, you really need to add your From: here
> >
> > Also, the patch is still mangled and doesn't apply.
> 
> I manually fixed it up when I tested it and I did merge it earlier as
> the initial test run was fone.
> 
> The patch has since caused breakage unfortunately:
> 
> https://autobuilder.yoctoproject.org/typhoon/#/builders/102/builds/6389
> https://autobuilder.yoctoproject.org/typhoon/#/builders/107/builds/6441
> https://autobuilder.yoctoproject.org/typhoon/#/builders/110/builds/8203
> https://autobuilder.yoctoproject.org/typhoon/#/builders/120/builds/4576
> 
> and more. They're all glib-initial breaking as it doesn't have
> packages.
> 
> I've sent a patch to fix that recipe, I'm not sure how many more
> recipes will be affected overall though.
> 
> Cheers,
> 
> Richard

I just sent a corresponding patch for libdevmapper in meta-oe.

Would it make sense to make the buildhistory code actually handle recipes 
that do not produce packages instead? Or at least produce a meaningful 
error in this case.

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#203137): 
https://lists.openembedded.org/g/openembedded-core/message/203137
Mute This Topic: https://lists.openembedded.org/mt/107750091/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] archiver.bbclass: fix BB_GENERATE_MIRROR_TARBALLS checking

2024-08-08 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org 
>  On Behalf Of Enrico Jörns
> Sent: den 8 augusti 2024 13:04
> To: openembedded-core@lists.openembedded.org
> Cc: yo...@pengutronix.de
> Subject: [OE-core] [PATCH] archiver.bbclass: fix BB_GENERATE_MIRROR_TARBALLS 
> checking
> 
> The variable 'have_mirror_tarballs' is used as a boolean while it is
> actually the result of 'd.getVar('BB_GENERATE_MIRROR_TARBALLS')' and
> thus a string.
> 
> Fix this by converting it into a boolean before using it.
> 
> Signed-off-by: Enrico Jörns 
> ---
>  meta/classes/archiver.bbclass | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
> index 9d286224d6..9c8b0daf31 100644
> --- a/meta/classes/archiver.bbclass
> +++ b/meta/classes/archiver.bbclass
> @@ -339,7 +339,7 @@ python do_ar_mirror() {
>  dl_dir = d.getVar('DL_DIR')
>  mirror_exclusions = (d.getVar('ARCHIVER_MIRROR_EXCLUDE') or '').split()
>  mirror_mode = d.getVarFlag('ARCHIVER_MODE', 'mirror')
> -have_mirror_tarballs = d.getVar('BB_GENERATE_MIRROR_TARBALLS')
> +have_mirror_tarballs = d.getVar('BB_GENERATE_MIRROR_TARBALLS') == "1"

May I suggest:

have_mirror_tarballs = 
oe.types.boolean(d.getVar('BB_GENERATE_MIRROR_TARBALLS'))

instead?

> 
>  if mirror_mode == 'combined':
>  destdir = d.getVar('ARCHIVER_COMBINED_MIRRORDIR')
> --
> 2.39.2

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#203136): 
https://lists.openembedded.org/g/openembedded-core/message/203136
Mute This Topic: https://lists.openembedded.org/mt/107787362/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] systemd: Move the MIME file to a separate package

2024-07-17 Thread Peter Kjellerstedt
The systemd-mime package is added as a recommendation for systemd so
that it is installed by default, but can be excluded, e.g., via
BAD_RECOMMENDATIONS. Excluding it avoids pulling in the MIME database
for products that have no use for it.

Signed-off-by: Peter Kjellerstedt 
---
 meta/recipes-core/systemd/systemd_256.bb | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-core/systemd/systemd_256.bb 
b/meta/recipes-core/systemd/systemd_256.bb
index ef243c2ce1..6ef6b16f0c 100644
--- a/meta/recipes-core/systemd/systemd_256.bb
+++ b/meta/recipes-core/systemd/systemd_256.bb
@@ -429,6 +429,7 @@ PACKAGE_BEFORE_PN = "\
 ${PN}-journal-upload \
 ${PN}-journal-remote \
 ${PN}-kernel-install \
+${PN}-mime \
 ${PN}-rpm-macros \
 ${PN}-udev-rules \
 ${PN}-vconsole-setup \
@@ -634,6 +635,9 @@ FILES:${PN}-extra-utils = "\
 ${rootlibexecdir}/systemd/systemd-cgroups-agent \
 "
 
+FILES:${PN}-mime = "${MIMEDIR}"
+RRECOMMENDS:${PN} += "${PN}-mime"
+
 FILES:${PN}-udev-rules = "\
 ${rootlibexecdir}/udev/rules.d/70-uaccess.rules \
 ${rootlibexecdir}/udev/rules.d/71-seat.rules \
@@ -731,7 +735,7 @@ RDEPENDS:${PN} += "kmod dbus util-linux-mount 
util-linux-umount udev (= ${EXTEND
 RDEPENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 
'serial-getty-generator', '', 'systemd-serialgetty', d)}"
 RDEPENDS:${PN} += "volatile-binds"
 
-RRECOMMENDS:${PN} += "systemd-extra-utils \
+RRECOMMENDS:${PN} += "${PN}-extra-utils \
   udev-hwdb \
   e2fsprogs-e2fsck \
   kernel-module-autofs4 kernel-module-unix 
kernel-module-ipv6 kernel-module-sch-fq-codel \

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#202167): 
https://lists.openembedded.org/g/openembedded-core/message/202167
Mute This Topic: https://lists.openembedded.org/mt/107272584/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] systemd: Correct the indentation in do_install()

2024-07-17 Thread Peter Kjellerstedt
There was a mix of using tabs and spaces for indentation.

Signed-off-by: Peter Kjellerstedt 
---
 meta/recipes-core/systemd/systemd_256.bb | 27 
 1 file changed, 14 insertions(+), 13 deletions(-)

diff --git a/meta/recipes-core/systemd/systemd_256.bb 
b/meta/recipes-core/systemd/systemd_256.bb
index 3579c71891..ef243c2ce1 100644
--- a/meta/recipes-core/systemd/systemd_256.bb
+++ b/meta/recipes-core/systemd/systemd_256.bb
@@ -278,16 +278,17 @@ WATCHDOG_TIMEOUT ??= "60"
 
 do_install() {
meson_do_install
+
if ${@bb.utils.contains('PACKAGECONFIG', 'sysusers', 'true', 'false', 
d)}; then
-# Change the root user's home directory in 
/lib/sysusers.d/basic.conf.
-# This is done merely for backward compatibility with previous 
systemd recipes.
-# systemd hardcodes root user's HOME to be "/root". Changing to 
use other values
-# may have unexpected runtime behaviors.
-if [ "${ROOT_HOME}" != "/root" ]; then
-bbwarn "Using ${ROOT_HOME} as root user's home directory 
is not fully supported by systemd"
-sed -i -e 's#/root#${ROOT_HOME}#g' 
${D}${exec_prefix}/lib/sysusers.d/basic.conf
-fi
-fi
+   # Change the root user's home directory in 
/lib/sysusers.d/basic.conf.
+   # This is done merely for backward compatibility with previous 
systemd recipes.
+   # systemd hardcodes root user's HOME to be "/root". Changing to 
use other values
+   # may have unexpected runtime behaviors.
+   if [ "${ROOT_HOME}" != "/root" ]; then
+   bbwarn "Using ${ROOT_HOME} as root user's home 
directory is not fully supported by systemd"
+   sed -i -e 's#/root#${ROOT_HOME}#g' 
${D}${exec_prefix}/lib/sysusers.d/basic.conf
+   fi
+   fi
install -d ${D}/${base_sbindir}
if ${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', 
'false', 'true', d)}; then
# Provided by a separate recipe
@@ -395,10 +396,10 @@ do_install() {
# add a profile fragment to disable systemd pager with busybox less
install -Dm 0644 ${UNPACKDIR}/systemd-pager.sh 
${D}${sysconfdir}/profile.d/systemd-pager.sh
 
-if [ -n "${WATCHDOG_TIMEOUT}" ]; then
-sed -i -e 
's/#RebootWatchdogSec=10min/RebootWatchdogSec=${WATCHDOG_TIMEOUT}/' \
-${D}/${sysconfdir}/systemd/system.conf
-fi
+   if [ -n "${WATCHDOG_TIMEOUT}" ]; then
+   sed -i -e 
's/#RebootWatchdogSec=10min/RebootWatchdogSec=${WATCHDOG_TIMEOUT}/' \
+   ${D}/${sysconfdir}/systemd/system.conf
+   fi
 
if ${@bb.utils.contains('PACKAGECONFIG', 'pni-names', 'true', 'false', 
d)}; then
if ! grep -q '^NamePolicy=.*mac' 
${D}${rootlibexecdir}/systemd/network/99-default.link; then

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#202166): 
https://lists.openembedded.org/g/openembedded-core/message/202166
Mute This Topic: https://lists.openembedded.org/mt/107272521/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] expect-native: fix build with gcc-14

2024-06-13 Thread Peter Kjellerstedt
> -Original Message-
> From: Richard Purdie 
> Sent: den 13 juni 2024 23:59
> To: Peter Kjellerstedt ;
> changqing...@windriver.com; openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH] expect-native: fix build with gcc-14
> 
> On Thu, 2024-06-13 at 21:55 +, Peter Kjellerstedt wrote:
> > > -Original Message-
> > > From:
> > > openembedded-core@lists.openembedded.org  c...@lists.openembedded.org
> > > > On Behalf Of Richard Purdie
> > > Sent: den 13 juni 2024 10:40
> > > To: changqing...@windriver.com;
> > > openembedded-core@lists.openembedded.org
> > > Subject: Re: [OE-core] [PATCH] expect-native: fix build with gcc-14
> > >
> > > On Thu, 2024-06-13 at 14:18 +0800, Changqing Li via
> > > lists.openembedded.org wrote:
> > > > From: Changqing Li 
> > > >
> > > > * do_configure failed with gcc-14:
> > > > error in build/config.log:
> > > > conftest.c:56:3: error: return type defaults to 'int' [-
> > > > Wimplicit-int]
> > > > conftest.c:59:5: error: implicit declaration of function 'exit'
> > > > [-Wimplicit-function-declaration]
> > > >
> > > > * this recipe set "BBCLASSEXTEND = "native nativesdk", causes
> > > > "CFLAGS +="
> > > > setting not take effect, use append instead.
> > > > snip of bitbake expect-native -e:
> > > >    set /layers/oe-core/meta/conf/documentation.conf:110
> > > >  [doc] "Flags passed to the C compiler for the target system.
> > > > This variable evaluates to the same as TARGET_CFLAGS."
> > > >    append /layers/oe-core/meta/recipes-
> > > > devtools/expect/expect_5.45.4.bb:87
> > > >  "-Wno-error=incompatible-pointer-types"
> > > >    set /layers/oe-core/meta/classes-recipe/native.bbclass:44
> > > >  "${BUILD_CFLAGS}"
> > > >    override[pn-gtk4]::append[toolchain-clang] /layers/meta-
> > > > clang/conf/nonclangable.conf:336
> > > >  " -Wno-error=int-conversion"
> > > >    override[pn-pidgin-sipe]::append[toolchain-clang]
> > > > /layers/meta-clang/conf/nonclangable.conf:340
> > > >  " -Wno-error=cast-function-type-strict"
> > > >  pre-expansion value:
> > > >    "${BUILD_CFLAGS}"
> > > > export CFLAGS="-isystem/build/tmp-glibc/work/x86_64-linux/expect-
> > > > native/5.45.4/recipe-sysroot-native/usr/include -O2 -pipe"
> > > >
> > > > Signed-off-by: Changqing Li 
> > > > ---
> > > >  meta/recipes-devtools/expect/expect_5.45.4.bb | 5 -
> > > >  1 file changed, 4 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/meta/recipes-devtools/expect/expect_5.45.4.bb
> > > > b/meta/recipes-devtools/expect/expect_5.45.4.bb
> > > > index 18904ebc10..5e7b352196 100644
> > > > --- a/meta/recipes-devtools/expect/expect_5.45.4.bb
> > > > +++ b/meta/recipes-devtools/expect/expect_5.45.4.bb
> > > > @@ -84,4 +84,7 @@ BBCLASSEXTEND = "native nativesdk"
> > > >
> > > >  # http://errors.yoctoproject.org/Errors/Details/766950/
> > > >  # expect5.45.4/exp_chan.c:62:5: error: initialization of 'struct
> > > > Tcl_ChannelTypeVersion_ *' from incompatible pointer type 'int
> > > > (*)(void *, int)' [-Wincompatible-pointer-types]
> > > > -CFLAGS += "-Wno-error=incompatible-pointer-types"
> > > > +CFLAGS:append = " -Wno-error=incompatible-pointer-types"
> > > > +
> > > > +# Fix expect-native configure tests are failing with gcc-14
> > > > +CFLAGS:append:class-native = " -Wno-error=implicit-int -Wno-
> > > > error=implicit-function-declaration"
> > > >
> > >
> > > You have a valid problem here however I really don't like the "arms
> > > race" of making everything an append as the base definitions are
> > > problematic. It would be this recipe today but a quick search shows
> > > many other recipes which will have similar problems.
> > >
> > > I think I'd prefer to see if we can drop the assignments in
> > > native/nativesdk bbclass and improve things that way even if it is
> > > a
> > > bit more invasive.
> > >
> > > I'm testing a patch on master-next to test th

Re: [OE-core] [PATCH] expect-native: fix build with gcc-14

2024-06-13 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org 
>  On Behalf Of Richard Purdie
> Sent: den 13 juni 2024 10:40
> To: changqing...@windriver.com; openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH] expect-native: fix build with gcc-14
> 
> On Thu, 2024-06-13 at 14:18 +0800, Changqing Li via lists.openembedded.org 
> wrote:
> > From: Changqing Li 
> >
> > * do_configure failed with gcc-14:
> > error in build/config.log:
> > conftest.c:56:3: error: return type defaults to 'int' [-Wimplicit-int]
> > conftest.c:59:5: error: implicit declaration of function 'exit' 
> > [-Wimplicit-function-declaration]
> >
> > * this recipe set "BBCLASSEXTEND = "native nativesdk", causes "CFLAGS +="
> > setting not take effect, use append instead.
> > snip of bitbake expect-native -e:
> >    set /layers/oe-core/meta/conf/documentation.conf:110
> >  [doc] "Flags passed to the C compiler for the target system. This 
> > variable evaluates to the same as TARGET_CFLAGS."
> >    append /layers/oe-core/meta/recipes-devtools/expect/expect_5.45.4.bb:87
> >  "-Wno-error=incompatible-pointer-types"
> >    set /layers/oe-core/meta/classes-recipe/native.bbclass:44
> >  "${BUILD_CFLAGS}"
> >    override[pn-gtk4]::append[toolchain-clang] 
> > /layers/meta-clang/conf/nonclangable.conf:336
> >  " -Wno-error=int-conversion"
> >    override[pn-pidgin-sipe]::append[toolchain-clang] 
> > /layers/meta-clang/conf/nonclangable.conf:340
> >  " -Wno-error=cast-function-type-strict"
> >  pre-expansion value:
> >    "${BUILD_CFLAGS}"
> > export 
> > CFLAGS="-isystem/build/tmp-glibc/work/x86_64-linux/expect-native/5.45.4/recipe-sysroot-native/usr/include
> >  -O2 -pipe"
> >
> > Signed-off-by: Changqing Li 
> > ---
> >  meta/recipes-devtools/expect/expect_5.45.4.bb | 5 -
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/meta/recipes-devtools/expect/expect_5.45.4.bb 
> > b/meta/recipes-devtools/expect/expect_5.45.4.bb
> > index 18904ebc10..5e7b352196 100644
> > --- a/meta/recipes-devtools/expect/expect_5.45.4.bb
> > +++ b/meta/recipes-devtools/expect/expect_5.45.4.bb
> > @@ -84,4 +84,7 @@ BBCLASSEXTEND = "native nativesdk"
> >
> >  # http://errors.yoctoproject.org/Errors/Details/766950/
> >  # expect5.45.4/exp_chan.c:62:5: error: initialization of 'struct 
> > Tcl_ChannelTypeVersion_ *' from incompatible pointer type 'int (*)(void *, 
> > int)' [-Wincompatible-pointer-types]
> > -CFLAGS += "-Wno-error=incompatible-pointer-types"
> > +CFLAGS:append = " -Wno-error=incompatible-pointer-types"
> > +
> > +# Fix expect-native configure tests are failing with gcc-14
> > +CFLAGS:append:class-native = " -Wno-error=implicit-int 
> > -Wno-error=implicit-function-declaration"
> >
> 
> You have a valid problem here however I really don't like the "arms
> race" of making everything an append as the base definitions are
> problematic. It would be this recipe today but a quick search shows
> many other recipes which will have similar problems.
> 
> I think I'd prefer to see if we can drop the assignments in
> native/nativesdk bbclass and improve things that way even if it is a
> bit more invasive.
> 
> I'm testing a patch on master-next to test this and see how bad the
> fallout is.
> 
> Cheers,
> 
> Richard

Isn't the correct thing to add to CFLAGS (really TARGET_CFLAGS) and/or 
BUILD_CFLAGS as appropriate? If the same options are needed for both 
target and native, then you can use an intermediary variable. E.g., for 
the above case you would get something like:

COMMON_CFLAGS = "-Wno-error=incompatible-pointer-types"
CFLAGS += "${COMMON_CFLAGS}"
BUILD_CFLAGS += " \
${COMMON_CFLAGS} \
-Wno-error=implicit-int \
-Wno-error=implicit-function-declaration \
"

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#200639): 
https://lists.openembedded.org/g/openembedded-core/message/200639
Mute This Topic: https://lists.openembedded.org/mt/106647106/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] Patchtest results for [PATCH v2 1/2] ccache: 4.9.1 -> 4.10

2024-06-12 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org  c...@lists.openembedded.org> On Behalf Of Robert Yang via
> lists.openembedded.org
> Sent: den 12 juni 2024 07:54
> To: patcht...@automation.yoctoproject.org
> Cc: openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core] Patchtest results for [PATCH v2 1/2] ccache: 4.9.1
> -> 4.10
> 
> On 6/12/24 13:50, patcht...@automation.yoctoproject.org wrote:
> > Thank you for your submission. Patchtest identified one
> > or more issues with the patch. Please see the log below for
> > more information:
> >
> > ---
> > Testing patch /home/patchtest/share/mboxes/v2-1-2-ccache-4.9.1---
> 4.10.patch
> >
> > FAIL: test lic files chksum modified not mentioned: LIC_FILES_CHKSUM
> changed without "License-Update:" tag and description in commit message
> (test_metadata.TestMetadata.test_lic_files_chksum_modified_not_mentioned)
> 
> I did add "License-Update:" in V2:
> 
>  * License-Update:
>- Update LIC_FILES_CHKSUM becaue a few third party licenses have
> been
> removed:
>$ git diff --stat v4.9.1..v4.10 LICENSE.adoc
>  LICENSE.adoc | 222 +-
>  1 file changed, 15 insertions(+), 207 deletions(-)
> 
>And add more licenses for third party files.
> 
> // Robert

I believe it is expected to be at the start of the line, i.e., as a Git trailer 
(similar to, e.g., Signed-off-by).

//Peter

> 
> >
> > PASS: pretest src uri left files
> (test_metadata.TestMetadata.pretest_src_uri_left_files)
> > PASS: test CVE check ignore
> (test_metadata.TestMetadata.test_cve_check_ignore)
> > PASS: test Signed-off-by presence
> (test_mbox.TestMbox.test_signed_off_by_presence)
> > PASS: test author valid (test_mbox.TestMbox.test_author_valid)
> > PASS: test commit message presence
> (test_mbox.TestMbox.test_commit_message_presence)
> > PASS: test max line length
> (test_metadata.TestMetadata.test_max_line_length)
> > PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
> > PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
> > PASS: test shortlog format (test_mbox.TestMbox.test_shortlog_format)
> > PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
> > PASS: test src uri left files
> (test_metadata.TestMetadata.test_src_uri_left_files)
> >
> > SKIP: pretest pylint: No python related patches, skipping test
> (test_python_pylint.PyLint.pretest_pylint)
> > SKIP: test CVE tag format: No new CVE patches introduced
> (test_patch.TestPatch.test_cve_tag_format)
> > SKIP: test Signed-off-by presence: No new CVE patches introduced
> (test_patch.TestPatch.test_signed_off_by_presence)
> > SKIP: test Upstream-Status presence: No new CVE patches introduced
> (test_patch.TestPatch.test_upstream_status_presence_format)
> > SKIP: test bugzilla entry format: No bug ID found
> (test_mbox.TestMbox.test_bugzilla_entry_format)
> > SKIP: test lic files chksum presence: No added recipes, skipping test
> (test_metadata.TestMetadata.test_lic_files_chksum_presence)
> > SKIP: test license presence: No added recipes, skipping test
> (test_metadata.TestMetadata.test_license_presence)
> > SKIP: test pylint: No python related patches, skipping test
> (test_python_pylint.PyLint.test_pylint)
> > SKIP: test series merge on head: Merge test is disabled for now
> (test_mbox.TestMbox.test_series_merge_on_head)
> > SKIP: test summary presence: No added recipes, skipping test
> (test_metadata.TestMetadata.test_summary_presence)
> > SKIP: test target mailing list: Series merged, no reason to check other
> mailing lists (test_mbox.TestMbox.test_target_mailing_list)
> >
> > ---
> >
> > Please address the issues identified and
> > submit a new revision of the patch, or alternatively, reply to this
> > email with an explanation of why the patch should be accepted. If you
> > believe these results are due to an error in patchtest, please submit a
> > bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category
> > under 'Yocto Project Subprojects'). For more information on specific
> > failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank
> > you!

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#200567): 
https://lists.openembedded.org/g/openembedded-core/message/200567
Mute This Topic: https://lists.openembedded.org/mt/106627798/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [scarthgap][PATCH 2/3] oeqa/selftest/devtool: add test for modifying recipes using go.bbclass

2024-06-11 Thread Peter Kjellerstedt
From: Ola x Nilsson 

go.bbclass uses a special do_unpack function that causes the git root
to be different from S.  Verify that it unpacks as expected.

[ YOCTO #15483 ]

Signed-off-by: Ola x Nilsson 
Signed-off-by: Alexandre Belloni 
Signed-off-by: Richard Purdie 
(cherry picked from commit fab0c737b95b8d0c0bbf58336bc308776c956406)
Signed-off-by: Peter Kjellerstedt 
---
 meta/lib/oeqa/selftest/cases/devtool.py | 19 +++
 1 file changed, 19 insertions(+)

diff --git a/meta/lib/oeqa/selftest/cases/devtool.py 
b/meta/lib/oeqa/selftest/cases/devtool.py
index 51949e3c93..cc4cbec5ae 100644
--- a/meta/lib/oeqa/selftest/cases/devtool.py
+++ b/meta/lib/oeqa/selftest/cases/devtool.py
@@ -749,6 +749,25 @@ class DevtoolModifyTests(DevtoolBase):
 result = runCmd('devtool status')
 self.assertNotIn('mdadm', result.output)
 
+def test_devtool_modify_go(self):
+import oe.path
+from tempfile import TemporaryDirectory
+with TemporaryDirectory(prefix='devtoolqa') as tempdir:
+self.track_for_cleanup(self.workspacedir)
+self.add_command_to_tearDown('bitbake -c clean go-helloworld')
+self.add_command_to_tearDown('bitbake-layers remove-layer 
*/workspace')
+result = runCmd('devtool modify go-helloworld -x %s' % tempdir)
+self.assertExists(
+oe.path.join(tempdir, 'src', 'golang.org', 'x', 'example', 
'go.mod'),
+ 'Extracted source could not be found'
+)
+self.assertExists(
+oe.path.join(self.workspacedir, 'conf', 'layer.conf'),
+'Workspace directory not created'
+)
+matches = glob.glob(oe.path.join(self.workspacedir, 'appends', 
'go-helloworld_*.bbappend'))
+self.assertTrue(matches, 'bbappend not created %s' % result.output)
+
 def test_devtool_buildclean(self):
 def assertFile(path, *paths):
 f = os.path.join(path, *paths)

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#200555): 
https://lists.openembedded.org/g/openembedded-core/message/200555
Mute This Topic: https://lists.openembedded.org/mt/106626101/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [scarthgap][PATCH 1/3] devtool: modify: Catch git submodule error for go code

2024-06-11 Thread Peter Kjellerstedt
From: Anton Almqvist 

One of the git submodule commands failed for source extracted for
recipes using go.bbclass.  The root cause is probably the path set up
by go_do_unpack which makes S and gitroot not match.

This patch does not fix the root problem, but at least it is no worse
than before the git submodule support.

The extracted source will still have two .git folders, one in S
created by devtool and one in the go path which will contain the tru
git history.

[ YOCTO #15483 ]

Signed-off-by: Anton Almqvist 
Signed-off-by: Ola x Nilsson 
Signed-off-by: Richard Purdie 
(cherry picked from commit fe242408af40dd1f6e47d9b2b232bdc76756c80a)
Signed-off-by: Peter Kjellerstedt 
---
 scripts/lib/devtool/standard.py | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 10d0cd3b7c..2beb058de8 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -893,7 +893,10 @@ def modify(args, config, basepath, workspace):
 (stdout, _) = bb.process.run('git rev-list --reverse %s..HEAD' 
% initial_revs["."], cwd=srctree)
 commits["."] = stdout.split()
 check_commits = True
-(stdout, _) = bb.process.run('git submodule --quiet foreach 
--recursive  \'echo `git rev-parse devtool-base` $PWD\'', cwd=srctree)
+try:
+(stdout, _) = bb.process.run('git submodule --quiet 
foreach --recursive  \'echo `git rev-parse devtool-base` $PWD\'', cwd=srctree)
+except bb.process.ExecutionError:
+stdout = ""
 for line in stdout.splitlines():
 (rev, submodule_path) = line.split()
 submodule = os.path.relpath(submodule_path, srctree)

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#200556): 
https://lists.openembedded.org/g/openembedded-core/message/200556
Mute This Topic: https://lists.openembedded.org/mt/106626102/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [scarthgap][PATCH 3/3] base-files: profile: fix error sh: 1: unknown operand

2024-06-11 Thread Peter Kjellerstedt
From: Felix Nilsson 

Handle errors when SHLVL isn't set.

Signed-off-by: Felix Nilsson 
Signed-off-by: Richard Purdie 
(cherry picked from commit 5df53fcfe3b70a5312fced3fcc1ba6290f2ee794)
Signed-off-by: Peter Kjellerstedt 
---
 meta/recipes-core/base-files/base-files/profile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-core/base-files/base-files/profile 
b/meta/recipes-core/base-files/base-files/profile
index bded3757cc..5e8393c91c 100644
--- a/meta/recipes-core/base-files/base-files/profile
+++ b/meta/recipes-core/base-files/base-files/profile
@@ -58,7 +58,7 @@ resize() {
fi
# only do this for /dev/tty[A-z] which are typically
# serial ports
-   if [ $FIRSTTIMESETUP -eq 1 -a $SHLVL -eq 1 ] ; then
+   if [ $FIRSTTIMESETUP -eq 1 -a ${SHLVL:-1} -eq 1 ] ; then
case $(tty 2>/dev/null) in
/dev/tty[A-z]*) resize >/dev/null;;
esac

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#200554): 
https://lists.openembedded.org/g/openembedded-core/message/200554
Mute This Topic: https://lists.openembedded.org/mt/106626100/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] base/bitbake.conf: use default assigment for UNPACKDIR

2024-05-31 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org 
>  On Behalf Of Richard Purdie
> Sent: den 31 maj 2024 12:57
> To: samuli.pii...@gmail.com; openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH] base/bitbake.conf: use default assigment for 
> UNPACKDIR
> 
> On Fri, 2024-05-31 at 10:27 +, Samuli Piippo via lists.openembedded.org 
> wrote:
> > This lets recipes in other layers add weak default assignment as
> >   UNPACKDIR ??= "${WORKDIR}"
> > which allows the recipes to work also with older Yocto releases
> > without overriding the default value used in styhead.
> >
> > Signed-off-by: Samuli Piippo 
> > ---
> >  meta/conf/bitbake.conf | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> I'm getting a bit frustrated with the requests to make changes to core
> to make it easier for people to write layers which "work" with all
> versions of the project. That isn't something we've ever committed to
> or encourage, quite the opposite.
> 
> There isn't any analysis of what other side effects this may have, or
> whether it is actually the right decision for the variable going
> forward, the change is entirely retrospective looking and I'm not keen
> to evaluate changes that way.

Actually, is there any reason it is using "??=" rather than "="? Other 
similar variables such as WORKDIR, S, B, etc all use = when setting 
them in bitbake.conf.

> Cheers,
> 
> Richard

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#200069): 
https://lists.openembedded.org/g/openembedded-core/message/200069
Mute This Topic: https://lists.openembedded.org/mt/106405273/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] tzdata: Add tzdata.zi to tzdata-core package

2024-05-30 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org 
>  On Behalf Of Simone Weiß
> Sent: den 30 maj 2024 01:13
> To: openembedded-core@lists.openembedded.org
> Cc: Simone Weiß 
> Subject: [OE-core] [PATCH] tzdata: Add tzdata.zi to tzdata-core package
> 
> From: Simone Weiß 
> 
> Additionally build and package tzdata.zi info file, as e.g. Systemd expects it
> to be present.
> 
> [YOCTO #15172]
> 
> Signed-off-by: Simone Weiß 
> ---
>  meta/recipes-extended/timezone/tzdata.bb | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/recipes-extended/timezone/tzdata.bb 
> b/meta/recipes-extended/timezone/tzdata.bb
> index dd1960ffa7..30175740d7 100644
> --- a/meta/recipes-extended/timezone/tzdata.bb
> +++ b/meta/recipes-extended/timezone/tzdata.bb
> @@ -20,7 +20,8 @@ do_configure[cleandirs] = "${B}"
>  B = "${WORKDIR}/build"
> 
>  do_compile() {
> - for zone in ${TZONES}; do
> +oe_runmake -C ${S} tzdata.zi
> +for zone in ${TZONES}; do

Use tabs to indent shell code in OE-Core (just as it were before).

>   ${STAGING_BINDIR_NATIVE}/zic -b ${ZIC_FMT} -d ${B}/zoneinfo -L 
> /dev/null ${S}/${zone}
>   ${STAGING_BINDIR_NATIVE}/zic -b ${ZIC_FMT} -d 
> ${B}/zoneinfo/posix -L /dev/null ${S}/${zone}
>   ${STAGING_BINDIR_NATIVE}/zic -b ${ZIC_FMT} -d 
> ${B}/zoneinfo/right -L ${S}/leapseconds ${S}/${zone}
> @@ -37,6 +38,7 @@ do_install() {
>   cp -pP "${S}/iso3166.tab" ${D}${datadir}/zoneinfo
>   cp -pP "${S}/leapseconds" ${D}${datadir}/zoneinfo
>   cp -pP "${S}/leap-seconds.list" ${D}${datadir}/zoneinfo
> + cp -pP "${S}/tzdata.zi" ${D}${datadir}/zoneinfo
> 
>   # Install default timezone
>   if [ -e ${D}${datadir}/zoneinfo/${DEFAULT_TIMEZONE} ]; then
> @@ -141,6 +143,7 @@ FILES:tzdata-core += " \
>  ${sysconfdir}/timezone \
>  ${datadir}/zoneinfo/leapseconds \
>  ${datadir}/zoneinfo/leap-seconds.list \
> +${datadir}/zoneinfo/tzdata.zi \
>  ${datadir}/zoneinfo/Pacific/Honolulu \
>  ${datadir}/zoneinfo/America/Anchorage \
>  ${datadir}/zoneinfo/America/Los_Angeles \
> --
> 2.39.2

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#200022): 
https://lists.openembedded.org/g/openembedded-core/message/200022
Mute This Topic: https://lists.openembedded.org/mt/106379353/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [PATCH] [OE-core][scarthgap] rust: remove unnecessary git signature

2024-05-27 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org  c...@lists.openembedded.org> On Behalf Of Alexander Kanavin
> Sent: den 27 maj 2024 18:46
> To: 이재규 
> Cc: jaekyu@lge.com; openembedded-core@lists.openembedded.org
> Subject: Re: [PATCH] [OE-core][scarthgap] rust: remove unnecessary git
> signature
> 
> On Mon, 27 May 2024 at 18:41, 이재규  wrote:
> >
> > Thank you for reply.
> >
> > I don't think we need to remove it specifically for this patch.
> > If possible, I will update patch to remove it from all patches. Do you
> > agree that information ( git version information) is unnecessary?
> 
> It might be unnecessary, but I do not think there is a need to remove
> it. If 'git format-patch' adds that when it writes a patch file to
> disk, then we shouldn't fight with that: people will keep sending
> patch files that have it.
> 
> Alex

For the record, patches generated/updated by devtool will be created with 
`git format-patch --no-signature --no-numbered ...` and thus lack the git 
version at the end.

Personally, I have the following in my .gitconfig to avoid having 
`git format-name ...` generate the signature:

[format]
signature =

But as Alex says, some will generate patches with the Git signature, and 
some will generate them without it. So unless someone adds some check for 
their non-existence, e.g., to patchcheck, they will come and go depending 
on who generates the patches.

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#199949): 
https://lists.openembedded.org/g/openembedded-core/message/199949
Mute This Topic: https://lists.openembedded.org/mt/106323318/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [PATCH 1/3] base: Switch UNPACKDIR to a subdir of WORKDIR

2024-05-22 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org 
>  On Behalf Of Richard Purdie
> Sent: den 22 maj 2024 11:28
> To: openembedded-core@lists.openembedded.org
> Subject: [OE-core] [PATCH 1/3] base: Switch UNPACKDIR to a subdir of WORKDIR
> 
> Change do_unpack to unpack files to a subdirectory of WORKDIR instead of 
> WORKDIR
> itself. There are several good reasons for this but it is mainly about being 
> able
> to isolate the output of the unpack task and tell the files apart from other 
> things
> which are created in workdir (logs, sysroots, temp dirs and more).
> 
> This means that when the do_unpack task reruns, we can clean UNPACKDIR and 
> know
> we have a standard point to start builds from.
> 
> It also makes code in tools like devtool and recipetool easier.
> 
> To reduce the impact to users, if a subdirectory under UNPACKDIR matches
> the first subdirectory under WORKDIR of S, that directory is moved into 
> position
> inside WORKDIR. This preserves the behaviour of S = "${WORKDIR}/git",
> S = "${WORKDIR}/${BPN}" and other commonly used source directory setups.
> 
> The directory is moved since sadly many autotools based projects can't cope 
> with
> symlinks in their paths.
> 
> The patch also updates reproducible and SOURCE_DATE_EPOCH handling to
> match the new potential source locations. We can get rid of the horrible
> list of hardcoded directories in WORKDIR to ignore from that code.
> 
> Signed-off-by: Richard Purdie 
> ---
>  meta/classes-global/base.bbclass | 28 +++-
>  meta/conf/bitbake.conf   |  2 +-
>  meta/lib/oe/reproducible.py  | 19 ++-
>  3 files changed, 34 insertions(+), 15 deletions(-)
> 
> diff --git a/meta/classes-global/base.bbclass 
> b/meta/classes-global/base.bbclass
> index 066f3848f7c..13e91b24a3b 100644
> --- a/meta/classes-global/base.bbclass
> +++ b/meta/classes-global/base.bbclass
> @@ -153,20 +153,38 @@ python base_do_fetch() {
>  }
> 
>  addtask unpack after do_fetch
> -do_unpack[dirs] = "${UNPACKDIR}"
> -
> -do_unpack[cleandirs] = "${@d.getVar('S') if os.path.normpath(d.getVar('S')) 
> != os.path.normpath(d.getVar('WORKDIR')) else os.path.join('${S}', 
> 'patches')}"
> +do_unpack[cleandirs] = "${UNPACKDIR}"
> 
>  python base_do_unpack() {
> +import shutil
> +
> +sourcedir = d.getVar('S')
> +# Intentionally keep SOURCE_BASEDIR internal to the task just for SDE
> +d.setVar("SOURCE_BASEDIR", sourcedir)
> +
>  src_uri = (d.getVar('SRC_URI') or "").split()
>  if not src_uri:
>  return
> 
> +basedir = None
> +unpackdir = d.getVar('UNPACKDIR')
> +workdir = d.getVar('WORKDIR')
> +if sourcedir.startswith(workdir) and not sourcedir.startswith(unpackdir):
> +basedir = sourcedir.replace(workdir, '').strip("/").split('/')[0]
> +if basedir:
> +bb.utils.remove(workdir + '/' + basedir, True)
> +d.setVar("SOURCE_BASEDIR", workdir + '/' + basedir)
> +
>  try:
>  fetcher = bb.fetch2.Fetch(src_uri, d)
>  fetcher.unpack(d.getVar('UNPACKDIR'))
>  except bb.fetch2.BBFetchException as e:
>  bb.fatal("Bitbake Fetcher Error: " + repr(e))
> +
> +if basedir and os.path.exists(unpackdir + '/' + basedir):
> +# Compatibility magic to ensure ${WORKDIR}/git and ${WORKDIR}/${BP}
> +# as often used in S work as expected.
> +shutil.move(unpackdir + '/' + basedir, workdir + '/' + basedir)
>  }
> 
>  SSTATETASKS += "do_deploy_source_date_epoch"
> @@ -199,8 +217,8 @@ addtask do_deploy_source_date_epoch_setscene
>  addtask do_deploy_source_date_epoch before do_configure after do_patch
> 
>  python create_source_date_epoch_stamp() {
> -# Version: 1
> -source_date_epoch = oe.reproducible.get_source_date_epoch(d, 
> d.getVar('S'))
> +# Version: 2
> +source_date_epoch = oe.reproducible.get_source_date_epoch(d, 
> d.getVar('SOURCE_BASEDIR') or d.getVar('S'))
>  oe.reproducible.epochfile_write(source_date_epoch, d.getVar('SDE_FILE'), 
> d)
>  }
>  do_unpack[postfuncs] += "create_source_date_epoch_stamp"

The following code is part of the anonymous python() function in base.bbclass:

if os.path.normpath(d.getVar("WORKDIR")) != os.path.normpath(d.getVar("S")):
d.appendVar("PSEUDO_IGNORE_PATHS", ",${S}")
if os.path.normpath(d.getVar("WORKDIR")) != os.path.normpath(d.getVar("B")):
d.appendVar("PSEUDO_IGNORE_PATHS", ",${B}")

Since it is (or will be) an error to have S = "${WORKDIR}", it should now be 
possible to move the addition of ${S} to PSEUDO_IGNORE_PATHS to bitbake.conf. 
I also believe ${UNPACKDIR} should be added to PSEUDO_IGNORE_PATHS.

And on a related note, would it make sense to make B = ${WORKDIR} an error too?
In which case the addition of ${B} to PSEUDO_IGNORE_PATHS could also be moved 
to bitbake.conf.

> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> index b2c500d8739..75c850760f6 100644
> --- a/meta/conf/bitba

Re: [OE-core] [PATCH v4] ipk/rootfs: run sanity test of multilib in parallel

2024-05-16 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org 
>  On Behalf Of Seungkyun Kim
> Sent: den 16 maj 2024 02:12
> To: openembedded-core@lists.openembedded.org
> Cc: seungkyun.kim 
> Subject: [OE-core] [PATCH v4] ipk/rootfs: run sanity test of multilib in 
> parallel
> 
> From: "seungkyun.kim" 
> 
> For multilib type packages, there is an additional temporary
> installation before the actual installation. It makes almost doubles
> the do_rootfs time if having many multilib type packages.
> To avoid this overhead, run sanity test in parallel.
> Installing package groups through opkg takes much more time than
> copying directory.
> 
> - Changes in V2:
> Fix FileNotFoundError exception when copying rootfs
> - Changes in V3:
> Removed unnecessary test call
> - Changes in V4:
> Fix invalid argument when create Process
> Keep the temporary rootfs directory after sanity check

The above list of changes related to the review process should be moved to 
after the --- line below as they should not be part of the actual commit 
message.

> 
> Signed-off-by: seungkyun.kim 
> ---
>  meta/lib/oe/package_manager/ipk/rootfs.py | 34 +--
>  1 file changed, 32 insertions(+), 2 deletions(-)
> 
> diff --git a/meta/lib/oe/package_manager/ipk/rootfs.py 
> b/meta/lib/oe/package_manager/ipk/rootfs.py
> index ba93eb62ea..a3842a6264 100644
> --- a/meta/lib/oe/package_manager/ipk/rootfs.py
> +++ b/meta/lib/oe/package_manager/ipk/rootfs.py
> @@ -6,7 +6,9 @@
> 
>  import re
>  import filecmp
> +import multiprocessing
>  import shutil
> +import stat
>  from oe.rootfs import Rootfs
>  from oe.manifest import Manifest
>  from oe.utils import execute_pre_post_process
> @@ -197,11 +199,34 @@ class PkgRootfs(DpkgOpkgRootfs):
>  files[key] = item
> 
>  def _multilib_test_install(self, pkgs):
> +def _copy_rootfs(src, dst):
> +if os.path.islink(src):
> +linkto = os.readlink(src)
> +if os.path.isabs(linkto):
> +linkto = 
> os.path.normpath(os.path.join(os.path.dirname(dst),
> +  os.path.relpath(linkto, src)))
> +os.symlink(linkto, dst)
> +elif os.path.isfile(src):
> +shutil.copy2(src, dst)
> +elif stat.S_ISFIFO(os.stat(src).st_mode):
> +os.mkfifo(dst)
> +else:
> +bb.warn("Skip unsupported file type: %s" % src)
> +
>  ml_temp = self.d.getVar("MULTILIB_TEMP_ROOTFS")
> +rootfs_temp = os.path.join(ml_temp, "rootfs")
>  bb.utils.mkdirhier(ml_temp)
> +bb.utils.remove(rootfs_temp, True)
> 
> -dirs = [self.image_rootfs]
> +if os.path.exists(self.image_rootfs):
> +shutil.copytree(self.image_rootfs, rootfs_temp, 
> copy_function=_copy_rootfs)
> +else:
> +bb.utils.mkdirhier(rootfs_temp)
> +dirs = [rootfs_temp]
> +return 
> multiprocessing.Process(target=self._multilib_test_pkg_install,
> +   args=(pkgs, ml_temp, dirs,))
> 
> +def _multilib_test_pkg_install(self, pkgs, ml_temp, dirs):
>  for variant in self.d.getVar("MULTILIB_VARIANTS").split():
>  ml_target_rootfs = os.path.join(ml_temp, variant)
> 
> @@ -300,15 +325,20 @@ class PkgRootfs(DpkgOpkgRootfs):
> 
>  for pkg_type in self.install_order:
>  if pkg_type in pkgs_to_install:
> +sanity_test = None
>  # For multilib, we perform a sanity test before final install
>  # If sanity test fails, it will automatically do a bb.fatal()
>  # and the installation will stop
>  if pkg_type == Manifest.PKG_TYPE_MULTILIB:
> -self._multilib_test_install(pkgs_to_install[pkg_type])
> +sanity_test= 
> self._multilib_test_install(pkgs_to_install[pkg_type])

Add a space before the equal sign.

> +sanity_test.start()
> 
>  self.pm.install(pkgs_to_install[pkg_type],
>  [False, True][pkg_type == 
> Manifest.PKG_TYPE_ATTEMPT_ONLY])
> 
> +if sanity_test is not None:
> +sanity_test.join()
> +
>  if self.progress_reporter:
>  self.progress_reporter.next_stage()
> 
> --
> 2.34.1

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#199485): 
https://lists.openembedded.org/g/openembedded-core/message/199485
Mute This Topic: https://lists.openembedded.org/mt/106125799/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] devtool: modify: Catch git submodule error for go code

2024-05-15 Thread Peter Kjellerstedt
Steve, please cherry-pick this to Scarthgap.

//Peter

> -Original Message-
> From: openembedded-core@lists.openembedded.org 
>  On Behalf Of Ola x Nilsson
> Sent: den 14 maj 2024 11:56
> To: openembedded-core@lists.openembedded.org
> Cc: Ola x Nilsson 
> Subject: [OE-core] [PATCH] devtool: modify: Catch git submodule error for go 
> code
> 
> From: Anton Almqvist 
> 
> One of the git submodule commands failed for source extracted for
> recipes using go.bbclass.  The root cause is probably the path set up
> by go_do_unpack which makes S and gitroot not match.
> 
> This patch does not fix the root problem, but at least it is no worse
> than before the git submodule support.
> 
> The extracted source will still have two .git folders, one in S
> created by devtool and one in the go path which will contain the tru
> git history.
> 
> [ YOCTO #15483 ]
> 
> Signed-off-by: Anton Almqvist 
> Signed-off-by: Ola x Nilsson 
> ---
>  scripts/lib/devtool/standard.py | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
> index bd009f44b1..05161942b7 100644
> --- a/scripts/lib/devtool/standard.py
> +++ b/scripts/lib/devtool/standard.py
> @@ -904,7 +904,10 @@ def modify(args, config, basepath, workspace):
>  (stdout, _) = bb.process.run('git rev-list --reverse 
> %s..HEAD' % initial_revs["."], cwd=srctree)
>  commits["."] = stdout.split()
>  check_commits = True
> -(stdout, _) = bb.process.run('git submodule --quiet foreach 
> --recursive  \'echo `git rev-parse devtool-base` $PWD\'', cwd=srctree)
> +try:
> +(stdout, _) = bb.process.run('git submodule --quiet 
> foreach --recursive  \'echo `git rev-parse devtool-base` $PWD\'', cwd=srctree)
> +except bb.process.ExecutionError:
> +stdout = ""
>  for line in stdout.splitlines():
>  (rev, submodule_path) = line.split()
>  submodule = os.path.relpath(submodule_path, srctree)
> --
> 2.39.2


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#199423): 
https://lists.openembedded.org/g/openembedded-core/message/199423
Mute This Topic: https://lists.openembedded.org/mt/106091660/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 05/10] base: Switch UNPACKDIR to a subdir of WORKDIR

2024-05-15 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org 
>  On Behalf Of Richard Purdie
> Sent: den 15 maj 2024 13:56
> To: openembedded-core@lists.openembedded.org
> Subject: [OE-core] [PATCH 05/10] base: Switch UNPACKDIR to a subdir of WORKDIR
> 
> Change do_unpack to unpack files to a subdirectory of WORKDIR instead of 
> WORKDIR
> itself. There are several good reasons for this but it is mainly about being 
> able
> to isolate the output of the unpack task and tell the files apart from other 
> things
> which are created in workdir (logs, sysroots, temp dirs and more).
> 
> This means that when the do_unpack task reruns, we can clean UNPACKDIR and 
> know
> we have a standard point to start builds from.
> 
> It also makes code in tools like devtool and recipetool easier.
> 
> To reduce the impact to users, if a subdirectory under UNPACKDIR matches
> the first subdirectory under WORKDIR of S, that directory is moved into 
> position
> inside WORKDIR. This preserves the behaviour of S = "${WORKDIR}/git",
> S = "${WORKDIR}/${BPN}" and other commonly used source directory setups.
> 
> The directory is moved since sadly many autotools based projects can't cope 
> with
> symlinks in their paths.

Would it be an option to create a symbolic link by default, and instead 
let the autotools bbclass replace it with a moved directory? If it is 
in fact only autotools based projects that have this problem.

> 
> Signed-off-by: Richard Purdie 
> ---
>  meta/classes-global/base.bbclass | 21 ++---
>  meta/conf/bitbake.conf   |  2 +-
>  2 files changed, 19 insertions(+), 4 deletions(-)
> 
> diff --git a/meta/classes-global/base.bbclass b/meta/classes-
> global/base.bbclass
> index 066f3848f7c..cdce0538273 100644
> --- a/meta/classes-global/base.bbclass
> +++ b/meta/classes-global/base.bbclass
> @@ -153,20 +153,35 @@ python base_do_fetch() {
>  }
> 
>  addtask unpack after do_fetch
> -do_unpack[dirs] = "${UNPACKDIR}"
> -
> -do_unpack[cleandirs] = "${@d.getVar('S') if os.path.normpath(d.getVar('S')) 
> != os.path.normpath(d.getVar('WORKDIR')) else os.path.join('${S}', 
> 'patches')}"
> +do_unpack[cleandirs] = "${UNPACKDIR}"
> 
>  python base_do_unpack() {
> +import shutil
> +
>  src_uri = (d.getVar('SRC_URI') or "").split()
>  if not src_uri:
>  return
> 
> +sourcedir = d.getVar('S')
> +basedir = None
> +workdir = d.getVar('WORKDIR')
> +unpackdir = d.getVar('UNPACKDIR')
> +if sourcedir.startswith(workdir) and not sourcedir.startswith(unpackdir):
> +basedir = sourcedir.replace(workdir, '').strip("/").split('/')[0]
> +bb.utils.remove(sourcedir, True)

This remove() seems wrong and should not be needed. There are two 
cases here:

1) either ${S} == ${WORKDIR}, in which case the above will remove 
   ${WORKDIR}, which is sure to lead to problems, or
2) ${S} == ${WORKDIR}/foo[/...], in which case the removal of 
   workdir + '/' + basedir below will also remove ${S} as 
   basedir == "foo".

> +if basedir:
> +bb.utils.remove(workdir + '/' + basedir, True)
> +
>  try:
>  fetcher = bb.fetch2.Fetch(src_uri, d)
>  fetcher.unpack(d.getVar('UNPACKDIR'))
>  except bb.fetch2.BBFetchException as e:
>  bb.fatal("Bitbake Fetcher Error: " + repr(e))
> +
> +if basedir and os.path.exists(unpackdir + '/' + basedir):
> +# Compatibility magic to ensure ${WORKDIR}/git and ${WORKDIR}/${BP}
> +# as often used in S work as expected.
> +shutil.move(unpackdir + '/' + basedir, workdir + '/' + basedir)
>  }
> 
>  SSTATETASKS += "do_deploy_source_date_epoch"
> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> index b2c500d8739..75c850760f6 100644
> --- a/meta/conf/bitbake.conf
> +++ b/meta/conf/bitbake.conf
> @@ -405,7 +405,7 @@ STAMP =
> "${STAMPS_DIR}/${MULTIMACH_TARGET_SYS}/${PN}/${PV}"
>  STAMPCLEAN = "${STAMPS_DIR}/${MULTIMACH_TARGET_SYS}/${PN}/*-*"
>  BASE_WORKDIR ?= "${TMPDIR}/work"
>  WORKDIR = "${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}/${PN}/${PV}"
> -UNPACKDIR ??= "${WORKDIR}"
> +UNPACKDIR ??= "${WORKDIR}/sources-unpack"

"sources-unpack" does not exactly fall off the tongue.
Would "unpack" or "unpacked" be alternatives?

>  T = "${WORKDIR}/temp"
>  D = "${WORKDIR}/image"
>  S = "${WORKDIR}/${BP}"
> --
> 2.40.1

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#199422): 
https://lists.openembedded.org/g/openembedded-core/message/199422
Mute This Topic: https://lists.openembedded.org/mt/106112374/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core][PATCH 2/3] kbd: remove non-free Agafari fonts

2024-04-13 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org  c...@lists.openembedded.org> On Behalf Of Richard Purdie
> Sent: den 13 april 2024 12:47
> To: peter.ma...@siemens.com; Khem Raj 
> Cc: openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core][PATCH 2/3] kbd: remove non-free Agafari fonts
> 
> On Sat, 2024-04-13 at 06:31 +, Peter Marko via
> lists.openembedded.org wrote:
> > That surprises me but fine.
> > I'm sending a v2 moving the file removal to the recipe.
> > But you could also hand-craft the patch again locally.
> 
> Since time is against me, I did create a hybrid patch:
> 
> https://git.yoctoproject.org/poky/commit/?h=master-next&id=03b9028fe6f76da4b19c62eca102caccaf66c1b4
> 
> Let me know if anyone isn't happy with this. I'm happy to take other
> patches.
> 
> Cheers,
> 
> Richard

The do_configure:prepend() looks wrong:

+do_configure:prepend() {
+rm -rf ${S}/${S}/data/consolefonts/Agafari-1*
+}

I assume that should be:

+do_configure:prepend() {
+   rm -rf ${S}/data/consolefonts/Agafari-1*
+}

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#198199): 
https://lists.openembedded.org/g/openembedded-core/message/198199
Mute This Topic: https://lists.openembedded.org/mt/105486424/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] Replaced :append with += in multiple recipe files under meta layer.

2024-04-12 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org 
>  On Behalf Of K Sanjay Nayak
> Sent: den 12 april 2024 08:06
> To: openembedded-core@lists.openembedded.org
> Cc: K Sanjay Nayak 
> Subject: [OE-core] [PATCH] Replaced :append with += in multiple recipe files 
> under meta layer.
> 
> Fixes [YOCTO #2951]
> 
> Conditional operator is preferred over the append operation,
> hence modified multiple recipes under the meta-layer.
> 
> Reported-by : Christopher Larson 
> Signed-off-by: K Sanjay Nayak 
> ---
>  meta/recipes-bsp/grub/grub-efi_2.12.bb  | 2 +-
>  meta/recipes-core/initscripts/initscripts_1.0.bb| 2 +-
>  meta/recipes-core/sysvinit/sysvinit_3.04.bb | 2 +-
>  .../baremetal-example/baremetal-helloworld_git.bb   | 2 +-
>  meta/recipes-extended/less/less_643.bb  | 2 +-
>  meta/recipes-gnome/librsvg/librsvg_2.57.1.bb| 2 +-
>  meta/recipes-graphics/waffle/waffle_1.7.2.bb| 2 +-
>  meta/recipes-support/libgpg-error/libgpg-error_1.48.bb  | 2 +-
>  meta/recipes-support/ptest-runner/ptest-runner_2.4.3.bb | 2 +-
>  9 files changed, 9 insertions(+), 9 deletions(-)
> 

[cut]

> diff --git 
> a/meta/recipes-extended/baremetal-example/baremetal-helloworld_git.bb 
> b/meta/recipes-extended/baremetal-example/baremetal-helloworld_git.bb
> index 6832ccc541..f66581cca3 100644
> --- a/meta/recipes-extended/baremetal-example/baremetal-helloworld_git.bb
> +++ b/meta/recipes-extended/baremetal-example/baremetal-helloworld_git.bb
> @@ -25,7 +25,7 @@ inherit baremetal-image
> 
> 
>  # startup code for x86 uses NASM syntax
> -DEPENDS:qemux86:append = " nasm-native"
> +DEPENDS:qemux86 += " nasm-native"

While there may be cases where the above may be correct, I do 
not think this is one of them, especially as this is an example 
recipe. The above should be:

DEPENDS:append:qemux86 = " nasm-native"

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#198172): 
https://lists.openembedded.org/g/openembedded-core/message/198172
Mute This Topic: https://lists.openembedded.org/mt/105479729/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [PATCH v2] devtool: standard: throws appropriate error if source is in detached HEAD

2024-04-12 Thread Peter Kjellerstedt
> -Original Message-
> From: Julien Stephan 
> Sent: den 11 april 2024 16:20
> To: Peter Kjellerstedt 
> Cc: openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH v2] devtool: standard: throws appropriate error 
> if source is in detached HEAD
> 
> Le mer. 10 avr. 2024 à 13:23, Peter Kjellerstedt 
>  a écrit :
> >
> > > -Original Message-
> > > From: openembedded-core@lists.openembedded.org 
> > >  On Behalf Of Julien Stephan
> > > Sent: den 10 april 2024 09:07
> > > To: openembedded-core@lists.openembedded.org
> > > Cc: Julien Stephan 
> > > Subject: [OE-core] [PATCH v2] devtool: standard: throws appropriate error 
> > > if source is in detached HEAD
> > >
> > > If source is in detached HEAD, we get the following error when using
> > > detvool finish command:
> > >
> > > [...]
> > > File "<...>/poky/scripts/lib/devtool/standard.py", line 1938, in 
> > > _update_recipe
> > >   bb.process.run('git checkout %s' % startbranch, cwd=srctree)
> > > File "<...>/poky/bitbake/lib/bb/process.py", line 189, in run
> > >   raise ExecutionError(cmd, pipe.returncode, stdout, stderr)
> > >   bb.process.ExecutionError: Execution of 'git checkout (HEAD detached at 
> > > 9bbf87e)' failed with exit code 2:
> > >   /bin/sh: -c: line 1: syntax error near unexpected token `('
> > >   /bin/sh: -c: line 1: `git checkout (HEAD detached at 9bbf87e)'
> > >
> > > Check this and throws an appropriate error in this case
> > >
> > > Signed-off-by: Julien Stephan 
> > >
> > > ---
> > >
> > > Changes in v2:
> > >
> > > - update error message to avoid confusion with a potentially non
> > >   existing "main" branch
> >
> > As you noted in an earlier mail, the same error message is used some
> > lines later. Please change that one too.
> >
> 
> Hi Peter,
> Not sure we need to change the other error message, because in that
> case it really means the *main* branch.

Actually, all that code predates the recent idea of renaming master to 
main so the use of "main branch" here refers to a "base" branch. 

> This error message happens if we have overrides branches and if the
> currently checked out branch starts with "devtool-override" (and we
> have several other branches).
> In that case, devtool cannot determine the main branch (read it as the
> "base" branch on which the devtool-overrides-* branches are rebased).
> Most of the time it will be the "devtool" branch, but there is no
> guarantee, the user can checkout a working branch for example.
> 
> Furthermore, there is also another log message few lines after :
> logger.info('Handling main branch (%s)...' % mainbranch)
> 
> So IMHO the log messages look fine here. Maybe we can rewrite them
> using "base" branch such as (but not sure it will be more clear) :
> 
>raise DevtoolError('Unable to determine base branch - please check
> out the base branch in source tree first')
> 
> and
>logger.info('Handling base branch (%s)...' % mainbranch)
> 
> 
> (do you also want to rename the mainbranch variable?)

If we change this, it should definitely be changed as well.

> 
> Anyway, such changes have nothing to do with the Detached HEAD check,
> so I will not add this within the same commit.

I agree. If it had just been a matter of aligning the two error 
messages, then I think it would have been fine to do it, but not if 
it involves more significant changes.

> I can do another patch to respell main to base (or something else more
> meaningful?) if you think it would be beneficial for clarity

I think using "base branch" rather than "main branch" would be a 
lot less confusing.

> (or you can do it if you prefer).

Please do send a patch for it.

> 
> Let me know
> Cheers
> Julien

//Peter

> > > ---
> > >  scripts/lib/devtool/standard.py | 2 ++
> > >  1 file changed, 2 insertions(+)
> > >
> > > diff --git a/scripts/lib/devtool/standard.py 
> > > b/scripts/lib/devtool/standard.py
> > > index 2c174927ddb..51e5794a0a7 100644
> > > --- a/scripts/lib/devtool/standard.py
> > > +++ b/scripts/lib/devtool/standard.py
> > > @@ -1888,6 +1888,8 @@ def _update_recipe(recipename, workspace, rd, mode, 
> > > appendlayerdir, wildcard_ver
> > >  for line in stdout.splitlines():
> > >

Re: [OE-core] [PATCH v2] devtool: standard: throws appropriate error if source is in detached HEAD

2024-04-10 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org 
>  On Behalf Of Julien Stephan
> Sent: den 10 april 2024 09:07
> To: openembedded-core@lists.openembedded.org
> Cc: Julien Stephan 
> Subject: [OE-core] [PATCH v2] devtool: standard: throws appropriate error if 
> source is in detached HEAD
> 
> If source is in detached HEAD, we get the following error when using
> detvool finish command:
> 
> [...]
> File "<...>/poky/scripts/lib/devtool/standard.py", line 1938, in 
> _update_recipe
>   bb.process.run('git checkout %s' % startbranch, cwd=srctree)
> File "<...>/poky/bitbake/lib/bb/process.py", line 189, in run
>   raise ExecutionError(cmd, pipe.returncode, stdout, stderr)
>   bb.process.ExecutionError: Execution of 'git checkout (HEAD detached at 
> 9bbf87e)' failed with exit code 2:
>   /bin/sh: -c: line 1: syntax error near unexpected token `('
>   /bin/sh: -c: line 1: `git checkout (HEAD detached at 9bbf87e)'
> 
> Check this and throws an appropriate error in this case
> 
> Signed-off-by: Julien Stephan 
> 
> ---
> 
> Changes in v2:
> 
> - update error message to avoid confusion with a potentially non
>   existing "main" branch

As you noted in an earlier mail, the same error message is used some 
lines later. Please change that one too.

> ---
>  scripts/lib/devtool/standard.py | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/scripts/lib/devtool/standard.py
> b/scripts/lib/devtool/standard.py
> index 2c174927ddb..51e5794a0a7 100644
> --- a/scripts/lib/devtool/standard.py
> +++ b/scripts/lib/devtool/standard.py
> @@ -1888,6 +1888,8 @@ def _update_recipe(recipename, workspace, rd, mode,
> appendlayerdir, wildcard_ver
>  for line in stdout.splitlines():
>  branchname = line[2:]
>  if line.startswith('* '):
> +if 'HEAD' in line:
> +raise DevtoolError('Detached HEAD - please check out a 
> branch, e.g., "devtool"')
>  startbranch = branchname
>  if branchname.startswith(override_branch_prefix):
>  override_branches.append(branchname)
> --
> 2.44.0

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#198089): 
https://lists.openembedded.org/g/openembedded-core/message/198089
Mute This Topic: https://lists.openembedded.org/mt/105437662/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] devtool: standard: throws appropriate error if source is in detached HEAD

2024-04-09 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org 
>  On Behalf Of Julien Stephan
> Sent: den 9 april 2024 09:19
> To: openembedded-core@lists.openembedded.org
> Cc: Julien Stephan 
> Subject: [OE-core] [PATCH] devtool: standard: throws appropriate error if 
> source is in detached HEAD
> 
> If source is in detached HEAD, we get the following error when using
> detvool finish command:
> 
> [...]
> File "<...>/poky/scripts/lib/devtool/standard.py", line 1938, in 
> _update_recipe
>   bb.process.run('git checkout %s' % startbranch, cwd=srctree)
> File "<...>/poky/bitbake/lib/bb/process.py", line 189, in run
>   raise ExecutionError(cmd, pipe.returncode, stdout, stderr)
>   bb.process.ExecutionError: Execution of 'git checkout (HEAD detached at 
> 9bbf87e)' failed with exit code 2:
>   /bin/sh: -c: line 1: syntax error near unexpected token `('
>   /bin/sh: -c: line 1: `git checkout (HEAD detached at 9bbf87e)'
> 
> Check this and throws an appropriate error in this case
> 
> Signed-off-by: Julien Stephan 
> ---
>  scripts/lib/devtool/standard.py | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/scripts/lib/devtool/standard.py
> b/scripts/lib/devtool/standard.py
> index 7972b4f8223..7f32b0999a4 100644
> --- a/scripts/lib/devtool/standard.py
> +++ b/scripts/lib/devtool/standard.py
> @@ -1885,6 +1885,8 @@ def _update_recipe(recipename, workspace, rd, mode, 
> appendlayerdir, wildcard_ver
>  for line in stdout.splitlines():
>  branchname = line[2:]
>  if line.startswith('* '):
> +if 'HEAD' in line:
> +raise DevtoolError('Detached HEAD - please check out the 
> main branch in source tree first')

Using "main branch" here might lead to confusion since it is unclear 
if the error is referring to an actual "main" branch, which not all 
repositories have, or to whatever branch is primarily used.
Additionally, when using devtool, the branch is typically "devtool". 

I would change it to:

raise DevtoolError('Detached HEAD - please check out a 
branch, e.g., "devtool"')

>  startbranch = branchname
>  if branchname.startswith(override_branch_prefix):
>  override_branches.append(branchname)
> --
> 2.44.0

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#198071): 
https://lists.openembedded.org/g/openembedded-core/message/198071
Mute This Topic: https://lists.openembedded.org/mt/105417706/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] util-linux: Set the license for util-linux-fcntl-lock to MIT

2024-04-04 Thread Peter Kjellerstedt
> -Original Message-
> From: Alexandre Belloni 
> Sent: den 4 april 2024 01:45
> To: Peter Kjellerstedt 
> Cc: openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH] util-linux: Set the license for 
> util-linux-fcntl-lock to MIT
> 
> Hello,
> 
> This caused:
> 
> https://autobuilder.yoctoproject.org/typhoon/#/builders/117/builds/4604/steps/12/logs/stdio
> https://autobuilder.yocto.io/pub/repro-fail/oe-reproducible-20240403-u_hyp_wv/packages/diff-html/

Doesn't this type of breakage happen all the time for pure recipe 
changes that affect the output if the PR server is not enabled?

> 
> I guess we need to bump PR?

Given that RP removed all PR variables from the recipes in OE-Core (see 
commit d4c346e8ab8f3cae25d1b01c7331ed9f6d4f96ef), I would expect that he 
is not too keen to see them coming back...

//Peter

> 
> On 02/04/2024 06:56:54+0200, Peter Kjellerstedt wrote:
> > This avoids problems if BSD-4-Clause is in INCOMPATIBLE_LICENSE since
> > util-linux-fcntl-lock is now a dependency of run-postinsts.
> >
> > Signed-off-by: Peter Kjellerstedt 
> > ---
> >  meta/recipes-core/util-linux/util-linux.inc | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/meta/recipes-core/util-linux/util-linux.inc 
> > b/meta/recipes-core/util-linux/util-linux.inc
> > index f4b547215e..d506783f9a 100644
> > --- a/meta/recipes-core/util-linux/util-linux.inc
> > +++ b/meta/recipes-core/util-linux/util-linux.inc
> > @@ -7,6 +7,7 @@ disk partitioning, kernel message management, filesystem 
> > creation, and system lo
> >  SECTION = "base"
> >
> >  LICENSE = "GPL-1.0-or-later & GPL-2.0-or-later & LGPL-2.1-or-later & 
> > BSD-2-Clause & BSD-3-Clause & BSD-4-Clause & MIT"
> > +LICENSE:${PN}-fcntl-lock = "MIT"
> >  LICENSE:${PN}-fdisk = "GPL-1.0-or-later"
> >  LICENSE:${PN}-libblkid = "LGPL-2.1-or-later"
> >  LICENSE:${PN}-libfdisk = "LGPL-2.1-or-later"


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#197969): 
https://lists.openembedded.org/g/openembedded-core/message/197969
Mute This Topic: https://lists.openembedded.org/mt/105282531/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] New mailing list for layer patches

2024-04-02 Thread Peter Kjellerstedt
> -Original Message-
> From: yo...@lists.yoctoproject.org  On
> Behalf Of Ross Burton
> Sent: den 28 mars 2024 15:37
> To: openembedded-architecture  architect...@lists.openembedded.org>; Yocto-mailing-list
> ; OE-core  c...@lists.openembedded.org>
> Subject: [yocto] New mailing list for layer patches
> 
> Hi,
> 
> At the moment if a layer doesn’t have enough volume to justify a dedicated
> mailing list for patches (see, for example, meta-
> a...@lists.yoctoproject.org ) then
> the convention is that the patches can be sent to
> yo...@lists.yoctoproject.org .
> 
> However, that’s also the list that we encourage users of Yocto to use for
> help, so the list has a mix of patches for various layers and people
> asking for help, which isn’t ideal: users who want help don’t want to be
> flooded with patches for layers they’re not using, layer maintainers may
> not want to see the requests for help, and people who want the status
> reports have to receive patches and support.
> 
> The Yocto TSC has been discussing this, and as a solution to this we’ve
> just created a new mailing list: yocto-patc...@lists.yoctoproject.org
> .  This list is specifically
> for Yocto-related projects which don’t have their own mailing list or
> other patch submission process.   We ask that all layers currently using
> yocto@ for patches move to yocto-patches@, so that yocto@ can be used
> purely for discussion and other non-patch related subjects.
> 
> Many thanks,
> Ross
> Yocto TSC member

To whoever is responsible for updating 
https://www.yoctoproject.org/community/mailing-lists/: the links for the 
two new lists both refer to yocto-announce rather than yocto-status and 
yocto-patches.

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#197883): 
https://lists.openembedded.org/g/openembedded-core/message/197883
Mute This Topic: https://lists.openembedded.org/mt/105197687/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] util-linux: Set the license for util-linux-fcntl-lock to MIT

2024-04-01 Thread Peter Kjellerstedt
This avoids problems if BSD-4-Clause is in INCOMPATIBLE_LICENSE since
util-linux-fcntl-lock is now a dependency of run-postinsts.

Signed-off-by: Peter Kjellerstedt 
---
 meta/recipes-core/util-linux/util-linux.inc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/recipes-core/util-linux/util-linux.inc 
b/meta/recipes-core/util-linux/util-linux.inc
index f4b547215e..d506783f9a 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -7,6 +7,7 @@ disk partitioning, kernel message management, filesystem 
creation, and system lo
 SECTION = "base"
 
 LICENSE = "GPL-1.0-or-later & GPL-2.0-or-later & LGPL-2.1-or-later & 
BSD-2-Clause & BSD-3-Clause & BSD-4-Clause & MIT"
+LICENSE:${PN}-fcntl-lock = "MIT"
 LICENSE:${PN}-fdisk = "GPL-1.0-or-later"
 LICENSE:${PN}-libblkid = "LGPL-2.1-or-later"
 LICENSE:${PN}-libfdisk = "LGPL-2.1-or-later"

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#197864): 
https://lists.openembedded.org/g/openembedded-core/message/197864
Mute This Topic: https://lists.openembedded.org/mt/105282531/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] glib-2.0: backport a switch from distutils to packaging in codegen

2024-03-07 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org  c...@lists.openembedded.org> On Behalf Of Alexander Kanavin
> Sent: den 7 mars 2024 17:11
> To: Peter Kjellerstedt 
> Cc: Khem Raj ; Martin Jansa ;
> openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH] glib-2.0: backport a switch from distutils
> to packaging in codegen
> 
> On Thu, 7 Mar 2024 at 16:49, Peter Kjellerstedt
>  wrote:
> 
> > We have a lot of recipes that use gdbus-codegen and are now facing this
> > problem. To solve it, I have added a gdbus-codegen.bbclass that does:
> >
> > DEPENDS:append = " glib-2.0-native python3-packaging-native"
> >
> > inherit python3native
> >
> > This adds the dependencies needed to use gdbus-codegen, and is similar
> > in spirit to pkgconfig.bbclass, which adds the dependencies needed to use
> > pkg-config.
> >
> > I can send a patch to add it to either meta or meta-oe if it sounds
> > like this is something that would be useful to others.
> 
> I wonder if instead of a class, this can be solved by tweaking
> RDEPENDS of glib recipe (perhaps with a class-native override), so
> that python3-packaging is pulled in through that, and no special
> dependencies are needed, other than glib-2.0-native.
> 
> Alex

The problem is the need to inherit python3native. Without it, the host 
packages are used...

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#196807): 
https://lists.openembedded.org/g/openembedded-core/message/196807
Mute This Topic: https://lists.openembedded.org/mt/104560766/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] glib-2.0: backport a switch from distutils to packaging in codegen

2024-03-07 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org  c...@lists.openembedded.org> On Behalf Of Khem Raj
> Sent: den 28 februari 2024 19:30
> To: Martin Jansa 
> Cc: openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH] glib-2.0: backport a switch from distutils
> to packaging in codegen
> 
> some more failures in meta-openembedded layers ( meta-xfce)
> 
> https://errors.yoctoproject.org/Errors/Details/754995/
> https://errors.yoctoproject.org/Errors/Details/754996/
> 
> On Tue, Feb 27, 2024 at 3:39 AM Martin Jansa 
> wrote:
> >
> > Yes, it was reproducible on my host gentoo after removing distutils
> > with dev-python/setuptools (and for updated glib-2.0-native after
> > removing dev-python/packaging)
> >
> > Fixes sent:
> > https://patchwork.yoctoproject.org/project/oe/patch/20240227113711.834767-1-martin.ja...@gmail.com/
> > https://patchwork.yoctoproject.org/project/oe/patch/20240227113711.834767-2-martin.ja...@gmail.com/
> >
> > Cheers,
> >
> > On Tue, Feb 27, 2024 at 12:58 AM Martin Jansa via
> > lists.openembedded.org 
> > wrote:
> > >
> > > Thanks Khem, will try to reproduce tomorrow. Maybe these don't use
> > > CODEGEN_PYTHON_RDEPENDS.
> > >
> > > With this patch backported to kirkstone I've seen glib-2.0-native
> > > failing with the same issue as python3native there doesn't include
> > > python3-packaging.
> > >
> > > Maybe these recipes aren't using python3native and were depending on
> > > packaging from host, will debug tomorrow.
> > >
> > > On Tue, Feb 27, 2024 at 12:16 AM Khem Raj  wrote:
> > > >
> > > > I am seeing some build failures which seems to be related to this
> > > > patch
> > > >
> > > > https://autobuilder.yoctoproject.org/typhoon/#/builders/88/builds/3657/steps/15/logs/stdio
> > > >
> > > >  |   File 
> > > > "/home/pokybuild/yocto-worker/meta-oe/build/build/tmp/work/core2-64-poky-linux/gattlib/0.2+git/recipe-sysroot-native/usr/share/glib-2.0/codegen/utils.py",
> > > >  line 22, in 
> > > > | import packaging.version
> > > > | ModuleNotFoundError: No module named 'packaging'
> > > >
> > > >
> > > >
> > > >   |   File 
> > > > "/home/pokybuild/yocto-worker/meta-oe/build/build/tmp/work/core2-64-poky-linux/networkmanager-fortisslvpn/1.4.0/recipe-sysroot-native/usr/share/glib-2.0/codegen/utils.py",
> > > >  line 22, in 
> > > > | import packaging.version
> > > > | ModuleNotFoundError: No module named 'packaging'
> > > > | make: *** [Makefile:2081: src/nm-fortisslvpn-pppd-service-dbus.h] 
> > > > Error 1

We have a lot of recipes that use gdbus-codegen and are now facing this 
problem. To solve it, I have added a gdbus-codegen.bbclass that does:

DEPENDS:append = " glib-2.0-native python3-packaging-native"

inherit python3native

This adds the dependencies needed to use gdbus-codegen, and is similar 
in spirit to pkgconfig.bbclass, which adds the dependencies needed to use 
pkg-config.

I can send a patch to add it to either meta or meta-oe if it sounds 
like this is something that would be useful to others.

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#196801): 
https://lists.openembedded.org/g/openembedded-core/message/196801
Mute This Topic: https://lists.openembedded.org/mt/104560766/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [PATCH V2] dnf: remove log_lock.pid before exit

2024-03-07 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org  c...@lists.openembedded.org> On Behalf Of Alexander Kanavin
> Sent: den 7 mars 2024 12:42
> To: qi.c...@windriver.com
> Cc: Li, Changqing ; Richard Purdie
> ; openembedded-
> c...@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH V2] dnf: remove log_lock.pid before exit
> 
> On Thu, 7 Mar 2024 at 11:21, Chen Qi via lists.openembedded.org
>  wrote:
> > You can see dnf's solution is: https://github.com/rpm-software-
> management/dnf/blob/master/etc/tmpfiles.d/dnf.conf
> >
> > I don't think dnf community will look into this issue. And I would
> expect it to be a complicated one. Because dnf's own solution looks like
> more of a workaround. At the same time, yocto based systems will sometimes
> have log_lock.pid left in target filesystems. Users typing 'ls /' will
> notice it.
> >
> > We have an OE specific patch: https://git.openembedded.org/openembedded-
> core/commit/?id=742a1b71249f4da1c8d8e13e270b0eb6128a3f66
> > I can see that this OE specific patch, 0001-dnf-write-the-log-lock-to-
> root.patch, does solve some issue. Unfortunately, at the same time, it
> introduces this specific issue, a easy-to-notice one.
> >
> > My suggestion is that we merge this fix into 0001-dnf-write-the-log-
> lock-to-root.patch, because they really belong together. I guess we can't
> expect dnf community to devote time into this, as they've already got a
> solution. And I'm not sure if anyone in OE community is familiar with dnf
> enough to solve this issue. So let's make things a little better, avoiding
> users of Yocto systems see this log_lock.pid file when they type 'ls /'.
> >
> > If you have any other suggestion, please let us know.
> 
> We need to find out why it happens, and why it happens only sometimes.
> If lock file does not get properly deleted that is quite possibly
> masking a different issue which needs fixing, and the proposed patch
> just sweeps it all under the carpet in the name of giving users an
> aesthetically pleasing rootfs. So the answer is still no.
> 
> If you are having difficulty debugging the situation where the lock
> file does get left behind, can you provide a way for me to reproduce
> the issue? I just build core-image-minimal, and I'm not seeing it:
> 
> alex@Zen2:/srv/storage/alex/yocto/build-64-alt$ ls
> tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0/rootfs/
> bin  boot  dev  etc  home  lib  media  mnt  proc  root  run  sbin  srv
>  sys  tmp  usr  var
> 
> If you can't provide that, then you can certainly still do more on
> your side: build core-image-minimal with plain poky, ensure the lock
> file gets deleted, then build your own private things where the file
> does not get deleted, then investigate why the code path that deletes
> the lock file isn't being taken in the latter case. You can see the
> code where the lock log (self.rotate_lock) is used in logging.py:
> 
> def emit(self, record):
> while True:
> try:
> if self.shouldRollover(record):
> with self.rotate_lock:
> # Do rollover while preserving the mode of the new 
> log file
> mode = os.stat(self.baseFilename).st_mode
> self.doRollover()
> os.chmod(self.baseFilename, mode)
> logging.FileHandler.emit(self, record)
> return
> except (dnf.exceptions.ProcessLockError, 
> dnf.exceptions.ThreadLockError):
> time.sleep(0.01)
> except Exception:
> self.handleError(record)
> return
> 
> And the deletion happens in lock.py:
> 
> def __exit__(self, *exc_args):
> if self.count == 1:
> os.unlink(self.target)
> self._unlock_thread()
> 
> 
> 
> Alex

I did try to find a solution to this problem quite a while back, but 
unfortunately never managed to get to the bottom of it. What I did figure out 
was that the problem is related to whether dnf thinks it is running as root 
or not as that results in different paths being used. I.e., it may create the 
file in one place and then try to delete it in another. What I never could 
figure out is how/where dnf switches between root/not root as it seems to 
happen mid-run.

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#196795): 
https://lists.openembedded.org/g/openembedded-core/message/196795
Mute This Topic: https://lists.openembedded.org/mt/104784184/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [PATCH 1/2] kernel-module-dirs.bbclass: Add class

2024-03-04 Thread Peter Kjellerstedt
> -Original Message-
> From: Richard Purdie 
> Sent: den 4 mars 2024 18:39
> To: Peter Kjellerstedt ; 
> openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH 1/2] kernel-module-dirs.bbclass: Add class
> 
> On Mon, 2024-03-04 at 17:20 +, Peter Kjellerstedt wrote:
> > > -Original Message-
> > > From: Richard Purdie 
> > > Sent: den 4 mars 2024 17:17
> > > To: Peter Kjellerstedt ; 
> > > openembedded-core@lists.openembedded.org
> > > Subject: Re: [OE-core] [PATCH 1/2] kernel-module-dirs.bbclass: Add class
> > >
> > > On Mon, 2024-03-04 at 16:57 +0100, Peter Kjellerstedt wrote:
> > > > Split out the two variables modulesloaddir and modprobedir from
> > > > kernel-module-split.bbclass as they can be useful to other recipes than
> > > > kernel module recipes.
> > > >
> > > > Signed-off-by: Peter Kjellerstedt 
> > > > ---
> > > >  meta/classes-recipe/kernel-module-dirs.bbclass | 8 
> > > >  1 file changed, 8 insertions(+)
> > > >  create mode 100644 meta/classes-recipe/kernel-module-dirs.bbclass
> > > >
> > > > diff --git a/meta/classes-recipe/kernel-module-dirs.bbclass 
> > > > b/meta/classes-recipe/kernel-module-dirs.bbclass
> > > > new file mode 100644
> > > > index 00..eecc36ab52
> > > > --- /dev/null
> > > > +++ b/meta/classes-recipe/kernel-module-dirs.bbclass
> > > > @@ -0,0 +1,8 @@
> > > > +#
> > > > +# Copyright OpenEmbedded Contributors
> > > > +#
> > > > +# SPDX-License-Identifier: MIT
> > > > +#
> > > > +
> > > > +modulesloaddir ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 
> > > > '${nonarch_libdir}', '${sysconfdir}', d)}/modules-load.d"
> > > > +modprobedir ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 
> > > > '${nonarch_base_libdir}', '${sysconfdir}', d)}/modprobe.d"
> > >
> > > Absolutely not. We are not having yet more kernel classes just for two
> > > variables.
> >
> > Ok. I considered adding them to bitbake.conf where all other similar *dir
> > variables are defined, but I opted for a bbclass since I expect it to only
> > be relatively few recipes that need either of them (we currently have ~10
> > non-module recipes that could use them).
> 
> bitbake.conf is also an absolute no.

Yes, that was what I expected.

> 
> > > There is probably a better way moving some definitions to a new conf
> > > file for the kernel in general.
> >
> > I am not sure what to make of this. What I wanted to achieve was to be
> > able to make the two path variables available to non-module recipes. I am
> > not sure how that matches what you meant with "a new conf file for the
> > kernel". Did you actually mean a .conf file where the variables would be
> > added to the global state, or did you mean a .bbclass/.inc file similar to
> > the one I proposed, but with a more generic name so that it can take other
> > variables than just the two path variables above?
> 
> I mean something more like meta/conf/image-uefi.conf but kernel focused.

Hmm, the naming of that file messes with the expectations I've learnt over 
the years of working with OE. I've always  thought that .conf files are 
used for definitions that are part of the global configuration, and .inc 
files are used for more local definitions. While I of course know that 
there is no technical difference between the two, that kind of semantics 
is helpful when looking at an individual file to know the context in which 
it is used.

> 
> We need to do better about more focused conf/inc files.

In that regard, kernel-module-dirs.bbclass was very focused. ;)

Do you see a difference in, e.g., kernel-module-dirs.bbclass vs.
kernel-module-dirs.inc? I.e., why is an .inc (or .conf) file more suitable 
than a .bbclass file in this case?

One reason I can see for why a .bbclass would be preferred, is because it 
is only inherited once even if there are multiple inherits. E.g., say I 
would take the proposed kernel-module-dirs.bbclass and turn it into a more 
generic kernel-vars.inc file. This file would then most likely be needed 
by, e.g., kernel.bbclass and module.bbclass. However, based on its current 
contents, it would also be needed by kernel-module-split.bbclass that both 
of them inherit. But since it is an .inc file, requiring it from both 
kernel.bbclass and kernel-module-split.bbclass would result in a lot of 
warnings about duplicate inclusion. On the other hand, having 
kernel-module-split.bbclass rely on that whatever inherits it has already 
required the kernel-vars.inc file seems wrong.

> 
> Cheers,
> 
> Richard

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#196616): 
https://lists.openembedded.org/g/openembedded-core/message/196616
Mute This Topic: https://lists.openembedded.org/mt/104724883/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [PATCH 1/2] kernel-module-dirs.bbclass: Add class

2024-03-04 Thread Peter Kjellerstedt
> -Original Message-
> From: Richard Purdie 
> Sent: den 4 mars 2024 17:17
> To: Peter Kjellerstedt ; 
> openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH 1/2] kernel-module-dirs.bbclass: Add class
> 
> On Mon, 2024-03-04 at 16:57 +0100, Peter Kjellerstedt wrote:
> > Split out the two variables modulesloaddir and modprobedir from
> > kernel-module-split.bbclass as they can be useful to other recipes than
> > kernel module recipes.
> >
> > Signed-off-by: Peter Kjellerstedt 
> > ---
> >  meta/classes-recipe/kernel-module-dirs.bbclass | 8 
> >  1 file changed, 8 insertions(+)
> >  create mode 100644 meta/classes-recipe/kernel-module-dirs.bbclass
> >
> > diff --git a/meta/classes-recipe/kernel-module-dirs.bbclass 
> > b/meta/classes-recipe/kernel-module-dirs.bbclass
> > new file mode 100644
> > index 00..eecc36ab52
> > --- /dev/null
> > +++ b/meta/classes-recipe/kernel-module-dirs.bbclass
> > @@ -0,0 +1,8 @@
> > +#
> > +# Copyright OpenEmbedded Contributors
> > +#
> > +# SPDX-License-Identifier: MIT
> > +#
> > +
> > +modulesloaddir ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 
> > '${nonarch_libdir}', '${sysconfdir}', d)}/modules-load.d"
> > +modprobedir ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 
> > '${nonarch_base_libdir}', '${sysconfdir}', d)}/modprobe.d"
> 
> Absolutely not. We are not having yet more kernel classes just for two
> variables.

Ok. I considered adding them to bitbake.conf where all other similar *dir 
variables are defined, but I opted for a bbclass since I expect it to only 
be relatively few recipes that need either of them (we currently have ~10 
non-module recipes that could use them).

> 
> There is probably a better way moving some definitions to a new conf
> file for the kernel in general.

I am not sure what to make of this. What I wanted to achieve was to be 
able to make the two path variables available to non-module recipes. I am 
not sure how that matches what you meant with "a new conf file for the 
kernel". Did you actually mean a .conf file where the variables would be 
added to the global state, or did you mean a .bbclass/.inc file similar to 
the one I proposed, but with a more generic name so that it can take other 
variables than just the two path variables above?

> 
> Cheers,
> 
> Richard

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#196614): 
https://lists.openembedded.org/g/openembedded-core/message/196614
Mute This Topic: https://lists.openembedded.org/mt/104724883/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] kernel-module-split.bbclass: Inherit kernel-module-dirs

2024-03-04 Thread Peter Kjellerstedt
The two variables modulesloaddir and modprobedir have been moved to
their own bbclass, kernel-module-dirs.

Signed-off-by: Peter Kjellerstedt 
---
 meta/classes-recipe/kernel-module-split.bbclass | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/meta/classes-recipe/kernel-module-split.bbclass 
b/meta/classes-recipe/kernel-module-split.bbclass
index c1208d55e0..ce8e5e1c09 100644
--- a/meta/classes-recipe/kernel-module-split.bbclass
+++ b/meta/classes-recipe/kernel-module-split.bbclass
@@ -4,6 +4,8 @@
 # SPDX-License-Identifier: MIT
 #
 
+inherit kernel-module-dirs
+
 pkg_postinst:modules () {
 if [ -z "$D" ]; then
depmod -a ${KERNEL_VERSION}
@@ -30,9 +32,6 @@ fi
 
 PACKAGE_WRITE_DEPS += "kmod-native depmodwrapper-cross"
 
-modulesloaddir ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 
'${nonarch_libdir}', '${sysconfdir}', d)}/modules-load.d"
-modprobedir ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 
'${nonarch_base_libdir}', '${sysconfdir}', d)}/modprobe.d"
-
 KERNEL_SPLIT_MODULES ?= "1"
 PACKAGESPLITFUNCS =+ "split_kernel_module_packages"
 

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#196610): 
https://lists.openembedded.org/g/openembedded-core/message/196610
Mute This Topic: https://lists.openembedded.org/mt/104724882/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] kernel-module-dirs.bbclass: Add class

2024-03-04 Thread Peter Kjellerstedt
Split out the two variables modulesloaddir and modprobedir from
kernel-module-split.bbclass as they can be useful to other recipes than
kernel module recipes.

Signed-off-by: Peter Kjellerstedt 
---
 meta/classes-recipe/kernel-module-dirs.bbclass | 8 
 1 file changed, 8 insertions(+)
 create mode 100644 meta/classes-recipe/kernel-module-dirs.bbclass

diff --git a/meta/classes-recipe/kernel-module-dirs.bbclass 
b/meta/classes-recipe/kernel-module-dirs.bbclass
new file mode 100644
index 00..eecc36ab52
--- /dev/null
+++ b/meta/classes-recipe/kernel-module-dirs.bbclass
@@ -0,0 +1,8 @@
+#
+# Copyright OpenEmbedded Contributors
+#
+# SPDX-License-Identifier: MIT
+#
+
+modulesloaddir ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 
'${nonarch_libdir}', '${sysconfdir}', d)}/modules-load.d"
+modprobedir ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 
'${nonarch_base_libdir}', '${sysconfdir}', d)}/modprobe.d"

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#196611): 
https://lists.openembedded.org/g/openembedded-core/message/196611
Mute This Topic: https://lists.openembedded.org/mt/104724883/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 V5] systemd: fix a dead link under /var/log

2024-02-29 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org 
>  On Behalf Of Alexander Kanavin
> Sent: den 29 februari 2024 10:01
> To: Changqing Li 
> Cc: Changqing Li ; 
> openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH V5] systemd: fix a dead link under /var/log
> 
> On Thu, 29 Feb 2024 at 06:56, Changqing Li  wrote:
> > The solution is also good. But package "${docdir}/systemd/README.logs"
> > in package systemd may make things more complicated.
> >
> > since in bitabke .conf, ${PN}-doc is before ${PN} in PACKAGES, and
> > FILES:${PN}-doc = "${docdir}  ...". we need to adjust the sequence,
> >
> > and may have influences to current list of files and directories that
> > are placed in a package.
> >
> > So maybe this patch is more simple and reasonable, and will not have
> > other impact.
> 
> That's right. It's possible but not obvious how to override that (I
> don't remember that from memory).
> 
> > That's ok, but can you make fixing the path to an absolute one a
> > separate, second commit then?
> >
> > if  use solution in this patch,  it is better they are in one commit.  I
> > can update description more detail.
> 
> Please no. These are two separate issues, let's deal with them as
> separate changes.
> 
> Alex

Given how much churn this patch has generated for a file that probably 
no one will read, how about just not creating it in the first place? 
That is what we do with the following patch:

From 49483effbcb920d097487c58214518f2f3a9d479 Mon Sep 17 00:00:00 2001
From: Yang Lyu 
Date: Mon, 20 Jun 2022 09:07:19 +0200
Subject: [PATCH] Do not create README in log directory

---
 tmpfiles.d/legacy.conf.in | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/tmpfiles.d/legacy.conf.in b/tmpfiles.d/legacy.conf.in
index 4f2c0d7c43..62e2ae0986 100644
--- a/tmpfiles.d/legacy.conf.in
+++ b/tmpfiles.d/legacy.conf.in
@@ -12,9 +12,6 @@

 d /run/lock 0755 root root -
 L /var/lock - - - - ../run/lock
-{% if CREATE_LOG_DIRS %}
-L /var/log/README - - - - ../..{{DOC_DIR}}/README.logs
-{% endif %}

 # /run/lock/subsys is used for serializing SysV service execution, and
 # hence without use on SysV-less systems.

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#196429): 
https://lists.openembedded.org/g/openembedded-core/message/196429
Mute This Topic: https://lists.openembedded.org/mt/104598170/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] [PATCHv2 5/5] lib/oe/patch: Use git notes to store the filenames for the patches

2024-02-19 Thread Peter Kjellerstedt


> -Original Message-
> From: Ross Burton 
> Sent: den 19 februari 2024 13:56
> To: Peter Kjellerstedt 
> Cc: openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCHv2 5/5] lib/oe/patch: Use git notes to store
> the filenames for the patches
> 
> On 19 Feb 2024, at 01:28, Peter Kjellerstedt via lists.openembedded.org
>  wrote:
> > +@staticmethod
> > +def addNote(repo, ref, key, value=None):
> > +note = key + (": %s" % value if value else "")
> > +notes_ref = GitApplyTree.notes_ref
> > +runcmd(["git", "config", "notes.rewriteMode", "ignore"], repo)
> > +runcmd(["git", "config", "notes.displayRef", notes_ref, 
> > notes_ref], repo)
> > +runcmd(["git", "config", "notes.rewriteRef", notes_ref, 
> > notes_ref], repo)
> > +runcmd(["git", "notes", "--ref", notes_ref, "append", "-m", note, 
> > ref], repo)
> 
> It feels like the config calls could be done once when setting up the
> repository somehow?

While I do agree that would be better, the reason I did it like this is because 
there is nothing in this class that is related to setting up the repositories 
that are used while calling this function. Thus it felt wrong to rely on that 
the repository has been configured correctly beforehand for the function to 
work as intended.

> > +# This loop, which is used to remove any line that
> > +# starts with "%% original patch", is kept for 
> > backwards
> > +# compatibility. If/when that compatibility is 
> > dropped,
> > +# it can be replaced with code to just read the 
> > first
> > +# line of the patch file to get the SHA-1, and the 
> > code
> > +# below that writes the modified patch file can be
> > +# replaced with a simple file move.
> 
> This is all that is needed for the new code to work correctly with an old
> worktree, right?

Well, it relies on the fallback (i.e., the exception clause) in 
GitApplyTree.getNotes() 
that reads from the commit message in case a Git note cannot be found. Do you 
want me 
to extend the comment so that it includes that refence as well?

> 
> Ross

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#195880): 
https://lists.openembedded.org/g/openembedded-core/message/195880
Mute This Topic: https://lists.openembedded.org/mt/104439182/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] [PATCHv2 3/5] devtool: Make use of oe.patch.GitApplyTree.commitIgnored()

2024-02-19 Thread Peter Kjellerstedt
> -Original Message-
> From: Ross Burton 
> Sent: den 19 februari 2024 13:54
> To: Peter Kjellerstedt 
> Cc: openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCHv2 3/5] devtool: Make use of
> oe.patch.GitApplyTree.commitIgnored()
> 
> On 19 Feb 2024, at 01:28, Peter Kjellerstedt via lists.openembedded.org
>  wrote:
> >
> > This makes use of the oe.patch.GitApplyTree.commitIgnored() function to
> > create commits that shall be ignored by `devtool finish`.
> 
> If we’re using notes to store the filename info, couldn’t the ignores
> state also be a note?
> 
> Ross

Yes, that comes with patch 5. This was just a preparation to get the three 
different places that create ignore commits gathered into one place.

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#195879): 
https://lists.openembedded.org/g/openembedded-core/message/195879
Mute This Topic: https://lists.openembedded.org/mt/104439181/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 5/5] lib/oe/patch: Use git notes to store the filenames for the patches

2024-02-18 Thread Peter Kjellerstedt
The old way of keeping track of the filenames for the patches that
correspond to the commits was to add a special comment line to the end
of the commit message, e.g., "%% original patch: ", using a
temporary git hook. This method had some drawbacks, e.g.:

* It caused problems if one wanted to push the commits upstream as the
  comment line had to be manually removed.
* The comment line would end up in patches if someone used git
  format-path rather than devtool finish to generate the patches.
* The comment line could interfere with global Git hooks used to
  validate the format of the Git commit message.
* When regenerating patches with `devtool finish --force-patch-refresh`,
  the process typically resulted in adding empty lines to the end of the
  commit messages in the updated patches.

A better way of keeping track of the patch filenames is to use Git
notes. This way the commit messages remain unaffected, but the
information is still shown when, e.g., doing `git log`. A special Git
notes space, refs/notes/devtool, is used to not intefere with the
default Git notes. It is configured to be shown in, e.g., `git log` and
to survive rewrites (i.e., `git commit --amend` and `git rebase`).

Since there is no longer any need for a temporary Git hook, the code
that manipulated the .git/hooks directory has also been removed. To
avoid potential problems due to global Git hooks, --no-verify was added
to the `git commit` command.

To not cause troubles for those who have done `devtool modify` for a
recipe with the old solution and then do `devtool finish` with the new
solution, the code will fall back to look for the old strings in the
commit message if no Git note can be found.

While not technically motivated like above, the way to keep track of
ignored commits is also changed to use Git notes to avoid having
different methods to store similar information.

Signed-off-by: Peter Kjellerstedt 
---

PATCHv2:
* Remove the --fixed-value option from calls to git config. It was
  added in Git version 2.30, but OE Core currently only requires Git
  version 1.8.3.1.
* Work around a bug (or feature?) in git rebase related to commits with
  notes that are completely absorbed by already existing commits during
  a rebase.
* Configure notes.rewriteMode = ignore. This is part of the solution to
  the above problem.

 meta/lib/oe/patch.py| 109 +++-
 meta/lib/oeqa/selftest/cases/devtool.py |   9 +-
 scripts/lib/devtool/standard.py |  15 ++--
 scripts/lib/devtool/upgrade.py  |  24 +-
 4 files changed, 103 insertions(+), 54 deletions(-)

diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py
index 3ded5f3601..60a0cc8291 100644
--- a/meta/lib/oe/patch.py
+++ b/meta/lib/oe/patch.py
@@ -294,8 +294,9 @@ class PatchTree(PatchSet):
 self.Pop(all=True)
 
 class GitApplyTree(PatchTree):
-patch_line_prefix = '%% original patch'
-ignore_commit_prefix = '%% ignore'
+notes_ref = "refs/notes/devtool"
+original_patch = 'original patch'
+ignore_commit = 'ignore'
 
 def __init__(self, dir, d):
 PatchTree.__init__(self, dir, d)
@@ -452,7 +453,7 @@ class GitApplyTree(PatchTree):
 # Prepare git command
 cmd = ["git"]
 GitApplyTree.gitCommandUserOptions(cmd, commituser, commitemail)
-cmd += ["commit", "-F", tmpfile]
+cmd += ["commit", "-F", tmpfile, "--no-verify"]
 # git doesn't like plain email addresses as authors
 if author and '<' in author:
 cmd.append('--author="%s"' % author)
@@ -460,15 +461,53 @@ class GitApplyTree(PatchTree):
 cmd.append('--date="%s"' % date)
 return (tmpfile, cmd)
 
+@staticmethod
+def addNote(repo, ref, key, value=None):
+note = key + (": %s" % value if value else "")
+notes_ref = GitApplyTree.notes_ref
+runcmd(["git", "config", "notes.rewriteMode", "ignore"], repo)
+runcmd(["git", "config", "notes.displayRef", notes_ref, notes_ref], 
repo)
+runcmd(["git", "config", "notes.rewriteRef", notes_ref, notes_ref], 
repo)
+runcmd(["git", "notes", "--ref", notes_ref, "append", "-m", note, 
ref], repo)
+
+@staticmethod
+def removeNote(repo, ref, key):
+notes = GitApplyTree.getNotes(repo, ref)
+notes = {k: v for k, v in notes.items() if k != key and not 
k.startswith(key + ":")}
+runcmd(["git", "notes", "--ref", GitApplyTree.notes_ref, "remove", 
"--ignore-missing", ref], repo)
+for note, value in notes.items():
+GitApplyTree.ad

[OE-core] [PATCHv2 2/5] lib/oe/patch: Add GitApplyTree.commitIgnored()

2024-02-18 Thread Peter Kjellerstedt
This function can be used to create a commit that devtool will ignore
when creating/updating the patches.

Signed-off-by: Peter Kjellerstedt 
---

PATCHv2: No changes.

 meta/lib/oe/patch.py | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py
index 70cdb1d9c0..3ded5f3601 100644
--- a/meta/lib/oe/patch.py
+++ b/meta/lib/oe/patch.py
@@ -460,6 +460,16 @@ class GitApplyTree(PatchTree):
 cmd.append('--date="%s"' % date)
 return (tmpfile, cmd)
 
+@staticmethod
+def commitIgnored(subject, dir=None, files=None, d=None):
+if files:
+runcmd(['git', 'add'] + files, dir)
+message = "%s\n\n%s" % (subject, GitApplyTree.ignore_commit_prefix)
+cmd = ["git"]
+GitApplyTree.gitCommandUserOptions(cmd, d=d)
+cmd += ["commit", "-m", message, "--no-verify"]
+runcmd(cmd, dir)
+
 @staticmethod
 def extractPatches(tree, startcommits, outdir, paths=None):
 import tempfile

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#195855): 
https://lists.openembedded.org/g/openembedded-core/message/195855
Mute This Topic: https://lists.openembedded.org/mt/104439180/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 1/5] lib/oe/patch: Make extractPatches() not extract ignored commits

2024-02-18 Thread Peter Kjellerstedt
If a commit is marked with "%% ignore" it means it is used by devtool to
keep track of changes to the source code that are not the result of
running do_patch(). These changes need to actually be ignored when
extracting the patches as they typically make no sense as actual patches
in a recipe.

This also adds a new test for oe-selftest that verifies that there are
no patches generated from ignored commits.

Signed-off-by: Peter Kjellerstedt 
---

PATCHv2: Add EXCLUDE_FROM_WORLD = "1" to the sysdig-selftest recipe.

 .../0055-Add-cstdint-for-uintXX_t-types.patch | 38 +++
 ...099-cmake-Pass-PROBE_NAME-via-CFLAGS.patch | 29 
 .../sysdig/sysdig-selftest_0.28.0.bb  | 66 +++
 meta/lib/oe/patch.py  | 16 ++---
 meta/lib/oeqa/selftest/cases/devtool.py   | 46 +
 5 files changed, 187 insertions(+), 8 deletions(-)
 create mode 100644 
meta-selftest/recipes-extended/sysdig/sysdig-selftest/0055-Add-cstdint-for-uintXX_t-types.patch
 create mode 100644 
meta-selftest/recipes-extended/sysdig/sysdig-selftest/0099-cmake-Pass-PROBE_NAME-via-CFLAGS.patch
 create mode 100644 
meta-selftest/recipes-extended/sysdig/sysdig-selftest_0.28.0.bb

diff --git 
a/meta-selftest/recipes-extended/sysdig/sysdig-selftest/0055-Add-cstdint-for-uintXX_t-types.patch
 
b/meta-selftest/recipes-extended/sysdig/sysdig-selftest/0055-Add-cstdint-for-uintXX_t-types.patch
new file mode 100644
index 00..e564958dad
--- /dev/null
+++ 
b/meta-selftest/recipes-extended/sysdig/sysdig-selftest/0055-Add-cstdint-for-uintXX_t-types.patch
@@ -0,0 +1,38 @@
+From 3d076ea588eb3c7f334133b4c31172a14beadf5b Mon Sep 17 00:00:00 2001
+From: Khem Raj 
+Date: Thu, 2 Feb 2023 20:18:27 -0800
+Subject: [PATCH] Add  for uintXX_t types
+
+gcc 13 moved some includes around and as a result  is no
+longer transitively included [1]. Explicitly include it
+for uintXX_t.
+
+[1] https://gcc.gnu.org/gcc-13/porting_to.html#header-dep-changes
+
+Upstream-Status: Submitted [https://github.com/falcosecurity/libs/pull/862]
+Signed-off-by: Khem Raj 
+---
+ userspace/libsinsp/filter/parser.h | 1 +
+ userspace/libsinsp/filter_value.h  | 1 +
+ 2 files changed, 2 insertions(+)
+
+--- a/userspace/libsinsp/filter/parser.h
 b/userspace/libsinsp/filter/parser.h
+@@ -18,6 +18,7 @@ limitations under the License.
+ #pragma once
+ 
+ #include "ast.h"
++#include 
+ 
+ //
+ // Context-free Grammar for Sinsp Filters
+--- a/userspace/libsinsp/filter_value.h
 b/userspace/libsinsp/filter_value.h
+@@ -18,6 +18,7 @@ limitations under the License.
+ #pragma once
+ 
+ #include 
++#include 
+ #include 
+ 
+ // Used for CO_IN/CO_PMATCH filterchecks using PT_CHARBUFs to allow
diff --git 
a/meta-selftest/recipes-extended/sysdig/sysdig-selftest/0099-cmake-Pass-PROBE_NAME-via-CFLAGS.patch
 
b/meta-selftest/recipes-extended/sysdig/sysdig-selftest/0099-cmake-Pass-PROBE_NAME-via-CFLAGS.patch
new file mode 100644
index 00..903ccdf36a
--- /dev/null
+++ 
b/meta-selftest/recipes-extended/sysdig/sysdig-selftest/0099-cmake-Pass-PROBE_NAME-via-CFLAGS.patch
@@ -0,0 +1,29 @@
+From ed8969a233adb6bf701de96d0fd0570e5ddcc787 Mon Sep 17 00:00:00 2001
+From: Khem Raj 
+Date: Mon, 21 Mar 2022 19:35:48 -0700
+Subject: [PATCH] cmake: Pass PROBE_NAME via CFLAGS
+
+This helps compliation of driver code where its calling modprobe on the
+given kernel module via system() API
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj 
+---
+ CMakeLists.txt | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 7dceb7ae..e156c36f 100644
+--- a/CMakeLists.txt
 b/CMakeLists.txt
+@@ -149,6 +149,7 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux")
+   if(NOT DEFINED PROBE_NAME)
+   set(PROBE_NAME "scap")
+   endif()
++  add_definitions(-DPROBE_NAME="${PROBE_NAME}")
+ 
+   set(DRIVERS_REPO "https://download.sysdig.com/scap-drivers";)
+   
+-- 
+2.35.1
+
diff --git a/meta-selftest/recipes-extended/sysdig/sysdig-selftest_0.28.0.bb 
b/meta-selftest/recipes-extended/sysdig/sysdig-selftest_0.28.0.bb
new file mode 100644
index 00..2ce85fe451
--- /dev/null
+++ b/meta-selftest/recipes-extended/sysdig/sysdig-selftest_0.28.0.bb
@@ -0,0 +1,66 @@
+SUMMARY = "A New System Troubleshooting Tool Built for the Way You Work"
+DESCRIPTION = "Sysdig is open source, system-level exploration: capture \
+system state and activity from a running Linux instance, then save, \
+filter and analyze."
+HOMEPAGE = "http://www.sysdig.org/";
+LICENSE = "Apache-2.0 & (MIT | GPL-2.0-only)"
+LIC_FILES_CHKSUM = "file://COPYING;md5=f8fee3d59797546cffab04f3b88b2d44"
+
+inherit cmake pkgconfig
+
+#OECMAKE_GENERATOR = "Unix Makefiles"
+JIT ?= "jit"
+JIT:mipsarchn32 = ""
+JIT:mipsarchn64 = ""
+JIT:riscv64 = ""
+JIT:riscv32 = ""
+JIT:powerpc = &q

[OE-core] [PATCHv2 3/5] devtool: Make use of oe.patch.GitApplyTree.commitIgnored()

2024-02-18 Thread Peter Kjellerstedt
This makes use of the oe.patch.GitApplyTree.commitIgnored() function to
create commits that shall be ignored by `devtool finish`.

Signed-off-by: Peter Kjellerstedt 
---

PATCHv2: No changes.

 scripts/lib/devtool/__init__.py | 4 +---
 scripts/lib/devtool/standard.py | 6 +-
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py
index c7fc3cfc41..6133c1c5b4 100644
--- a/scripts/lib/devtool/__init__.py
+++ b/scripts/lib/devtool/__init__.py
@@ -253,9 +253,7 @@ def setup_git_repo(repodir, version, devbranch, 
basetag='devtool-base', d=None):
 bb.process.run('git submodule add %s %s' % (remote_url, 
os.path.relpath(root, os.path.join(root, ".."))), cwd=os.path.join(root, ".."))
 found = True
 if found:
-useroptions = []
-oe.patch.GitApplyTree.gitCommandUserOptions(useroptions, 
d=d)
-bb.process.run('git %s commit -m "Adding additionnal 
submodule from SRC_URI\n\n%s"' % (' '.join(useroptions), 
oe.patch.GitApplyTree.ignore_commit_prefix), cwd=os.path.join(root, ".."))
+oe.patch.GitApplyTree.commitIgnored("Add additional 
submodule from SRC_URI", dir=os.path.join(root, ".."), d=d)
 found = False
 if os.path.exists(os.path.join(repodir, '.gitmodules')):
 bb.process.run('git submodule foreach --recursive  "git tag -f %s"' % 
basetag, cwd=repodir)
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index ccb7ea851b..6d7fd17fbd 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -484,11 +484,7 @@ def symlink_oelocal_files_srctree(rd, srctree):
 os.symlink('oe-local-files/%s' % fn, destpth)
 addfiles.append(os.path.join(relpth, fn))
 if addfiles:
-bb.process.run('git add %s' % ' '.join(addfiles), cwd=srctree)
-useroptions = []
-oe.patch.GitApplyTree.gitCommandUserOptions(useroptions, d=rd)
-bb.process.run('git %s commit -m "Committing local file 
symlinks\n\n%s"' % (' '.join(useroptions), 
oe.patch.GitApplyTree.ignore_commit_prefix), cwd=srctree)
-
+oe.patch.GitApplyTree.commitIgnored("Add local file symlinks", 
dir=srctree, files=addfiles, d=rd)
 
 def _extract_source(srctree, keep_temp, devbranch, sync, config, basepath, 
workspace, fixed_setup, d, tinfoil, no_overrides=False):
 """Extract sources of a recipe"""

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#195856): 
https://lists.openembedded.org/g/openembedded-core/message/195856
Mute This Topic: https://lists.openembedded.org/mt/104439181/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 4/5] patch.bbclass: Make use of oe.patch.GitApplyTree.commitIgnored()

2024-02-18 Thread Peter Kjellerstedt
This makes use of the oe.patch.GitApplyTree.commitIgnored() function to
create commits that shall be ignored by `devtool finish`.

Signed-off-by: Peter Kjellerstedt 
---

PATCHv2: No changes.

 meta/classes-global/patch.bbclass | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/meta/classes-global/patch.bbclass 
b/meta/classes-global/patch.bbclass
index e3157c7b18..e5786b1c9a 100644
--- a/meta/classes-global/patch.bbclass
+++ b/meta/classes-global/patch.bbclass
@@ -79,9 +79,7 @@ python patch_task_postfunc() {
 bb.process.run('git checkout patches', cwd=srcsubdir)
 stdout, _ = bb.process.run('git status --porcelain .', cwd=srcsubdir)
 if stdout:
-useroptions = []
-oe.patch.GitApplyTree.gitCommandUserOptions(useroptions, d=d)
-bb.process.run('git add .; git %s commit -a -m "Committing changes 
from %s\n\n%s"' % (' '.join(useroptions), func, 
oe.patch.GitApplyTree.ignore_commit_prefix + ' - from %s' % func), 
cwd=srcsubdir)
+oe.patch.GitApplyTree.commitIgnored("Add changes from %s" % func, 
dir=srcsubdir, files=['.'], d=d)
 }
 
 def src_patches(d, all=False, expand=True):

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#195853): 
https://lists.openembedded.org/g/openembedded-core/message/195853
Mute This Topic: https://lists.openembedded.org/mt/104439178/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 7/7] lib/oe/patch: Use git notes to store the filenames for the patches

2024-02-18 Thread Peter Kjellerstedt
> -Original Message-
> From: Richard Purdie 
> Sent: den 17 februari 2024 13:34
> To: Peter Kjellerstedt ; openembedded-
> c...@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH 7/7] lib/oe/patch: Use git notes to store
> the filenames for the patches
> 
> On Fri, 2024-02-16 at 19:59 +0100, Peter Kjellerstedt wrote:
> > The old way of keeping track of the filenames for the patches that
> > correspond to the commits was to add a special comment line to the end
> > of the commit message, e.g., "%% original patch: ", using a
> > temporary git hook. This method had some drawbacks, e.g.:
> >
> > * It caused problems if one wanted to push the commits upstream as the
> >   comment line had to be manually removed.
> > * The comment line would end up in patches if someone used git
> >   format-path rather than devtool finish to generate the patches.
> > * The comment line could interfere with global Git hooks used to
> >   validate the format of the Git commit message.
> > * When regenerating patches with `devtool finish --force-patch-refresh`,
> >   the process typically resulted in adding empty lines to the end of the
> >   commit messages in the updated patches.
> >
> > A better way of keeping track of the patch filenames is to use Git
> > notes. This way the commit messages remain unaffected, but the
> > information is still shown when, e.g., doing `git log`. A special Git
> > notes space, refs/notes/devtool, is used to not intefere with the
> > default Git notes. It is configured to be shown in, e.g., `git log` and
> > to survive rewrites (i.e., `git commit --amend` and `git rebase`).
> >
> > Since there is no longer any need for a temporary Git hook, the code
> > that manipulated the .git/hooks directory has also been removed. To
> > avoid potential problems due to global Git hooks, --no-verify was added
> > to the `git commit` command.
> >
> > To not cause troubles for those who have done `devtool modify` for a
> > recipe with the old solution and then do `devtool finish` with the new
> > solution, the code will fall back to look for the old strings in the
> > commit message if no Git note can be found.
> >
> > While not technically motivated like above, the way to keep track of
> > ignored commits is also changed to use Git notes to avoid having
> > different methods to store similar information.
> >
> > Signed-off-by: Peter Kjellerstedt 
> > ---
> >  meta/lib/oe/patch.py    | 105 +++-
> >  meta/lib/oeqa/selftest/cases/devtool.py |   9 +-
> >  scripts/lib/devtool/standard.py |  15 ++--
> >  3 files changed, 78 insertions(+), 51 deletions(-)
> 
> I've tweaked the EXCLUDE_FROM_WORLD issue and I can squash that in but
> with that we still saw:
> 
> https://autobuilder.yoctoproject.org/typhoon/#/builders/87/builds/6433/steps/14/logs/stdio
> 
> which I think is from this patch.
> 
> Cheers,
> 
> Richard

While I had checked when `git notes` was introduced (1.7.1 for the 
functionality I use), I had not realized that the --fixed-value option 
to `git config` was only introduced in 2.30 (way after the current OE 
minimum requirement of Git 1.8.3.1). Thankfully, the --fixed-value 
option is not really needed in this case and can just be removed.

I have an updated patch series that fixes this, the missing 
EXCLUDE_FROM_WORLD, and a problem related to how git rebase handles 
notes when a commit is fully absorbed during a rebase. The latter 
could trigger when devtool upgrade is used.

I will send the patches once oe-selftest -r devtool is done...

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#195851): 
https://lists.openembedded.org/g/openembedded-core/message/195851
Mute This Topic: https://lists.openembedded.org/mt/104398931/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] systemd: fix a dead link under /var/log

2024-02-18 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org 
>  On Behalf Of Changqing Li
> Sent: den 18 februari 2024 06:41
> To: openembedded-core@lists.openembedded.org
> Subject: [OE-core] [PATCH V4] systemd: fix a dead link under /var/log
> 
> From: Changqing Li 
> 
> Commit 6fe23ff31c0 changed README to a symlink to README.logs, and
> install README.logs under systemd doc dir.
> 
> But for OE, systemd doc dir is splited into package systemd-doc, when it
> is not installed on the target, there will be an dead link:
> Eg:
> root@intel-x86-64:/var/log# ls -l README
> lrwxrwxrwx 1 root root 39 Jun 20 08:57 README -> 
> ../../usr/share/doc/systemd/README.logs
> root@intel-x86-64:/var/log# ls -l ../../usr/share/doc/systemd/README.logs
> ls: cannot access '../../usr/share/doc/systemd/README.logs': No such file
> or directory
> 
> First, package this link into systemd-doc to fix above issue.  Second,
> create the symlink according to the value of VOLATILE_LOG_DIR, when
> VOLATILE_LOG_DIR is true,  /var/log is a link to /var/volatile/log, so
> /var/log/README need link to ../../../usr/share/doc/systemd/README.logs,
> while VOLATILE_LOG_DIR is false, /var/log is a dir, so /var/log/README
> need link to ../../usr/share/doc/systemd/README.logs.
> 
> Signed-off-by: Changqing Li 
> ---
>  meta/recipes-core/systemd/systemd_255.1.bb | 22 ++
>  1 file changed, 18 insertions(+), 4 deletions(-)
> 
> diff --git a/meta/recipes-core/systemd/systemd_255.1.bb b/meta/recipes-
> core/systemd/systemd_255.1.bb
> index 9e09c89355..db21b70718 100644
> --- a/meta/recipes-core/systemd/systemd_255.1.bb
> +++ b/meta/recipes-core/systemd/systemd_255.1.bb
> @@ -382,10 +382,22 @@ do_install() {
>   # add a profile fragment to disable systemd pager with busybox less
>   install -Dm 0644 ${WORKDIR}/systemd-pager.sh 
> ${D}${sysconfdir}/profile.d/systemd-pager.sh
> 
> -if [ -n "${WATCHDOG_TIMEOUT}" ]; then
> -sed -i -e 
> 's/#RebootWatchdogSec=10min/RebootWatchdogSec=${WATCHDOG_TIMEOUT}/' \
> -${D}/${sysconfdir}/systemd/system.conf
> -fi
> + if [ -n "${WATCHDOG_TIMEOUT}" ]; then
> + sed -i -e 
> 's/#RebootWatchdogSec=10min/RebootWatchdogSec=${WATCHDOG_TIMEOUT}/' \
> + ${D}/${sysconfdir}/systemd/system.conf
> + fi
> +
> + if [ -f "${D}${nonarch_libdir}/tmpfiles.d/legacy.conf" ] \
> + && grep -q '^L \/var\/log\/README' 
> ${D}${nonarch_libdir}/tmpfiles.d/legacy.conf 2>/dev/null; then

If you format the above like this instead, then the \ on the first line 
is not needed:

if [ -f "${D}${nonarch_libdir}/tmpfiles.d/legacy.conf" ] &&
   grep -q '^L \/var\/log\/README' 
${D}${nonarch_libdir}/tmpfiles.d/legacy.conf 2>/dev/null; then


Actually, since you pass grep's stderr to /dev/null, you can skip the 
first test. This will work just as well even if the file does not exist:

if grep -q '^L \/var\/log\/README' 
${D}${nonarch_libdir}/tmpfiles.d/legacy.conf 2>/dev/null; then

> +
> + sed -i -e '/^L \/var\/log\/README/d' 
> ${D}${nonarch_libdir}/tmpfiles.d/legacy.conf
> + touch ${D}${nonarch_libdir}/tmpfiles.d/legacy-doc.conf

Remove the touch, it is not needed. The echo below will create the file.

> + if "${@'true' if oe.types.boolean(d.getVar('VOLATILE_LOG_DIR')) 
> else 'false'}"; then
> + echo "L /var/log/README - - - - 
> ../../../${datadir}/doc/systemd/README.logs" > 
> ${D}${nonarch_libdir}/tmpfiles.d/legacy-doc.conf
> + else
> + echo "L /var/log/README - - - - 
> ../../${datadir}/doc/systemd/README.logs" > 
> ${D}${nonarch_libdir}/tmpfiles.d/legacy-doc.conf
> + fi

If the link information added to legacy.conf by systemd's build 
system isn't correct and we have set it ourselves, then we may as well 
create the link as an absolute link instead and thereby avoid the need 
to differentiate depending on the value of VOLATILE_LOG_DIR. Might as 
well correct /var/log to ${localstatedir}/log too:

echo "L ${localstatedir}/log/README - - - - 
${datadir}/doc/systemd/README.logs" > 
${D}${nonarch_libdir}/tmpfiles.d/legacy-doc.conf

> + fi
>  }
> 
>  python populate_packages:prepend (){
> @@ -622,6 +634,8 @@ FILES:${PN}-udev-rules = "\
>  ${rootlibexecdir}/udev/rules.d/99-systemd.rules \
>  "
> 
> +FILES:${PN}-doc  += "${nonarch_libdir}/tmpfiles.d/legacy-doc.conf"
> +
>  CONFFILES:${PN} = "${sysconfdir}/systemd/coredump.conf \
>   ${sysconfdir}/systemd/journald.conf \
>   ${sysconfdir}/systemd/logind.conf \
> --
> 2.25.1

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#195850): 
https://lists.openembedded.org/g/openembedded-core/message/195850
Mute This Topic: https://lists.openembedded.org/mt/104424110/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://list

[OE-core] [PATCH 7/7] lib/oe/patch: Use git notes to store the filenames for the patches

2024-02-16 Thread Peter Kjellerstedt
The old way of keeping track of the filenames for the patches that
correspond to the commits was to add a special comment line to the end
of the commit message, e.g., "%% original patch: ", using a
temporary git hook. This method had some drawbacks, e.g.:

* It caused problems if one wanted to push the commits upstream as the
  comment line had to be manually removed.
* The comment line would end up in patches if someone used git
  format-path rather than devtool finish to generate the patches.
* The comment line could interfere with global Git hooks used to
  validate the format of the Git commit message.
* When regenerating patches with `devtool finish --force-patch-refresh`,
  the process typically resulted in adding empty lines to the end of the
  commit messages in the updated patches.

A better way of keeping track of the patch filenames is to use Git
notes. This way the commit messages remain unaffected, but the
information is still shown when, e.g., doing `git log`. A special Git
notes space, refs/notes/devtool, is used to not intefere with the
default Git notes. It is configured to be shown in, e.g., `git log` and
to survive rewrites (i.e., `git commit --amend` and `git rebase`).

Since there is no longer any need for a temporary Git hook, the code
that manipulated the .git/hooks directory has also been removed. To
avoid potential problems due to global Git hooks, --no-verify was added
to the `git commit` command.

To not cause troubles for those who have done `devtool modify` for a
recipe with the old solution and then do `devtool finish` with the new
solution, the code will fall back to look for the old strings in the
commit message if no Git note can be found.

While not technically motivated like above, the way to keep track of
ignored commits is also changed to use Git notes to avoid having
different methods to store similar information.

Signed-off-by: Peter Kjellerstedt 
---
 meta/lib/oe/patch.py| 105 +++-
 meta/lib/oeqa/selftest/cases/devtool.py |   9 +-
 scripts/lib/devtool/standard.py |  15 ++--
 3 files changed, 78 insertions(+), 51 deletions(-)

diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py
index 3ded5f3601..4e971f8b30 100644
--- a/meta/lib/oe/patch.py
+++ b/meta/lib/oe/patch.py
@@ -294,8 +294,9 @@ class PatchTree(PatchSet):
 self.Pop(all=True)
 
 class GitApplyTree(PatchTree):
-patch_line_prefix = '%% original patch'
-ignore_commit_prefix = '%% ignore'
+notes_ref = "refs/notes/devtool"
+original_patch = 'original patch'
+ignore_commit = 'ignore'
 
 def __init__(self, dir, d):
 PatchTree.__init__(self, dir, d)
@@ -452,7 +453,7 @@ class GitApplyTree(PatchTree):
 # Prepare git command
 cmd = ["git"]
 GitApplyTree.gitCommandUserOptions(cmd, commituser, commitemail)
-cmd += ["commit", "-F", tmpfile]
+cmd += ["commit", "-F", tmpfile, "--no-verify"]
 # git doesn't like plain email addresses as authors
 if author and '<' in author:
 cmd.append('--author="%s"' % author)
@@ -460,15 +461,49 @@ class GitApplyTree(PatchTree):
 cmd.append('--date="%s"' % date)
 return (tmpfile, cmd)
 
+@staticmethod
+def addNote(repo, ref, key, value=None):
+note = key + (": %s" % value if value else "")
+notes_ref = GitApplyTree.notes_ref
+cmd = ["git", "config", "--fixed-value", "notes.displayRef", 
notes_ref, notes_ref]
+runcmd(cmd, repo)
+cmd = ["git", "config", "--fixed-value", "notes.rewriteRef", 
notes_ref, notes_ref]
+runcmd(cmd, repo)
+cmd = ["git", "notes", "--ref", notes_ref, "append", "-m", note, ref]
+runcmd(cmd, repo)
+
+@staticmethod
+def getNotes(repo, ref):
+import re
+
+note = None
+cmd = ["git", "notes", "--ref", GitApplyTree.notes_ref, "show", ref]
+try:
+note = runcmd(cmd, repo)
+prefix = ""
+except CmdError:
+cmd = ['git', 'show', '-s', '--format=%B', ref]
+note = runcmd(cmd, repo)
+prefix = "%% "
+
+note_re = re.compile(r'^%s(.*?)(?::\s*(.*))?$' % prefix)
+notes = dict()
+for line in note.splitlines():
+m = note_re.match(line)
+if m:
+notes[m.group(1)] = m.group(2)
+
+return notes
+
 @staticmethod
 def commitIgnored(subject, dir=None, files=None, d=None):
 if files:
 runcmd(['git', 'add

[OE-core] [PATCH 1/7] devtool: standard: Add some missing whitespace

2024-02-16 Thread Peter Kjellerstedt
Makes it a little bit easier when reading the code.

Signed-off-by: Peter Kjellerstedt 
---
 scripts/lib/devtool/standard.py | 24 
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 0243e3bc75..dd9232da1c 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -460,7 +460,7 @@ def sync(args, config, basepath, workspace):
 finally:
 tinfoil.shutdown()
 
-def symlink_oelocal_files_srctree(rd,srctree):
+def symlink_oelocal_files_srctree(rd, srctree):
 import oe.patch
 if os.path.abspath(rd.getVar('S')) == 
os.path.abspath(rd.getVar('WORKDIR')):
 # If recipe extracts to ${WORKDIR}, symlink the files into the srctree
@@ -657,9 +657,9 @@ def _extract_source(srctree, keep_temp, devbranch, sync, 
config, basepath, works
 
 if os.path.exists(workshareddir) and (not 
os.listdir(workshareddir) or kernelVersion != staging_kerVer):
 shutil.rmtree(workshareddir)
-oe.path.copyhardlinktree(srcsubdir,workshareddir)
+oe.path.copyhardlinktree(srcsubdir, workshareddir)
 elif not os.path.exists(workshareddir):
-oe.path.copyhardlinktree(srcsubdir,workshareddir)
+oe.path.copyhardlinktree(srcsubdir, workshareddir)
 
 tempdir_localdir = os.path.join(tempdir, 'oe-local-files')
 srctree_localdir = os.path.join(srctree, 'oe-local-files')
@@ -689,7 +689,7 @@ def _extract_source(srctree, keep_temp, devbranch, sync, 
config, basepath, works
 shutil.move(tempdir_localdir, srcsubdir)
 
 shutil.move(srcsubdir, srctree)
-symlink_oelocal_files_srctree(d,srctree)
+symlink_oelocal_files_srctree(d, srctree)
 
 if is_kernel_yocto:
 logger.info('Copying kernel config to srctree')
@@ -762,7 +762,7 @@ def get_staging_kver(srcdir):
 kerver = []
 staging_kerVer=""
 if os.path.exists(srcdir) and os.listdir(srcdir):
-with open(os.path.join(srcdir,"Makefile")) as f:
+with open(os.path.join(srcdir, "Makefile")) as f:
 version = [next(f) for x in range(5)][1:4]
 for word in version:
 kerver.append(word.split('= ')[1].split('\n')[0])
@@ -843,10 +843,10 @@ def modify(args, config, basepath, workspace):
 staging_kerVer = get_staging_kver(srcdir)
 staging_kbranch = get_staging_kbranch(srcdir)
 if (os.path.exists(srcdir) and os.listdir(srcdir)) and 
(kernelVersion in staging_kerVer and staging_kbranch == kbranch):
-oe.path.copyhardlinktree(srcdir,srctree)
+oe.path.copyhardlinktree(srcdir, srctree)
 workdir = rd.getVar('WORKDIR')
 srcsubdir = rd.getVar('S')
-localfilesdir = os.path.join(srctree,'oe-local-files')
+localfilesdir = os.path.join(srctree, 'oe-local-files')
 # Move local source files into separate subdir
 recipe_patches = [os.path.basename(patch) for patch in 
oe.recipeutils.get_recipe_patches(rd)]
 local_files = oe.recipeutils.get_recipe_local_files(rd)
@@ -870,9 +870,9 @@ def modify(args, config, basepath, workspace):
 for fname in local_files:
 _move_file(os.path.join(workdir, fname), 
os.path.join(srctree, 'oe-local-files', fname))
 with open(os.path.join(srctree, 'oe-local-files', 
'.gitignore'), 'w') as f:
-f.write('# Ignore local files, by default. Remove this 
file ''if you want to commit the directory to Git\n*\n')
+f.write('# Ignore local files, by default. Remove this 
file if you want to commit the directory to Git\n*\n')
 
-symlink_oelocal_files_srctree(rd,srctree)
+symlink_oelocal_files_srctree(rd, srctree)
 
 task = 'do_configure'
 res = tinfoil.build_targets(pn, task, handle_events=True)
@@ -880,7 +880,7 @@ def modify(args, config, basepath, workspace):
 # Copy .config to workspace
 kconfpath = rd.getVar('B')
 logger.info('Copying kernel config to workspace')
-shutil.copy2(os.path.join(kconfpath, '.config'),srctree)
+shutil.copy2(os.path.join(kconfpath, '.config'), srctree)
 
 # Set this to true, we still need to get initial_rev
 # by parsing the git repo
@@ -1004,7 +1004,7 @@ def modify(args, config, basepath, workspace):
 'mv ${S}/.config ${S}/.config.

[OE-core] [PATCH 3/7] lib/oe/patch: Make extractPatches() not extract ignored commits

2024-02-16 Thread Peter Kjellerstedt
If a commit is marked with "%% ignore" it means it is used by devtool to
keep track of changes to the source code that are not the result of
running do_patch(). These changes need to actually be ignored when
extracting the patches as they typically make no sense as actual patches
in a recipe.

This also adds a new test for oe-selftest that verifies that there are
no patches generated from ignored commits.

Signed-off-by: Peter Kjellerstedt 
---
 .../0055-Add-cstdint-for-uintXX_t-types.patch | 38 +++
 ...099-cmake-Pass-PROBE_NAME-via-CFLAGS.patch | 29 +
 .../sysdig/sysdig-selftest_0.28.0.bb  | 64 +++
 meta/lib/oe/patch.py  | 16 ++---
 meta/lib/oeqa/selftest/cases/devtool.py   | 46 +
 5 files changed, 185 insertions(+), 8 deletions(-)
 create mode 100644 
meta-selftest/recipes-extended/sysdig/sysdig-selftest/0055-Add-cstdint-for-uintXX_t-types.patch
 create mode 100644 
meta-selftest/recipes-extended/sysdig/sysdig-selftest/0099-cmake-Pass-PROBE_NAME-via-CFLAGS.patch
 create mode 100644 
meta-selftest/recipes-extended/sysdig/sysdig-selftest_0.28.0.bb

diff --git 
a/meta-selftest/recipes-extended/sysdig/sysdig-selftest/0055-Add-cstdint-for-uintXX_t-types.patch
 
b/meta-selftest/recipes-extended/sysdig/sysdig-selftest/0055-Add-cstdint-for-uintXX_t-types.patch
new file mode 100644
index 00..e564958dad
--- /dev/null
+++ 
b/meta-selftest/recipes-extended/sysdig/sysdig-selftest/0055-Add-cstdint-for-uintXX_t-types.patch
@@ -0,0 +1,38 @@
+From 3d076ea588eb3c7f334133b4c31172a14beadf5b Mon Sep 17 00:00:00 2001
+From: Khem Raj 
+Date: Thu, 2 Feb 2023 20:18:27 -0800
+Subject: [PATCH] Add  for uintXX_t types
+
+gcc 13 moved some includes around and as a result  is no
+longer transitively included [1]. Explicitly include it
+for uintXX_t.
+
+[1] https://gcc.gnu.org/gcc-13/porting_to.html#header-dep-changes
+
+Upstream-Status: Submitted [https://github.com/falcosecurity/libs/pull/862]
+Signed-off-by: Khem Raj 
+---
+ userspace/libsinsp/filter/parser.h | 1 +
+ userspace/libsinsp/filter_value.h  | 1 +
+ 2 files changed, 2 insertions(+)
+
+--- a/userspace/libsinsp/filter/parser.h
 b/userspace/libsinsp/filter/parser.h
+@@ -18,6 +18,7 @@ limitations under the License.
+ #pragma once
+ 
+ #include "ast.h"
++#include 
+ 
+ //
+ // Context-free Grammar for Sinsp Filters
+--- a/userspace/libsinsp/filter_value.h
 b/userspace/libsinsp/filter_value.h
+@@ -18,6 +18,7 @@ limitations under the License.
+ #pragma once
+ 
+ #include 
++#include 
+ #include 
+ 
+ // Used for CO_IN/CO_PMATCH filterchecks using PT_CHARBUFs to allow
diff --git 
a/meta-selftest/recipes-extended/sysdig/sysdig-selftest/0099-cmake-Pass-PROBE_NAME-via-CFLAGS.patch
 
b/meta-selftest/recipes-extended/sysdig/sysdig-selftest/0099-cmake-Pass-PROBE_NAME-via-CFLAGS.patch
new file mode 100644
index 00..903ccdf36a
--- /dev/null
+++ 
b/meta-selftest/recipes-extended/sysdig/sysdig-selftest/0099-cmake-Pass-PROBE_NAME-via-CFLAGS.patch
@@ -0,0 +1,29 @@
+From ed8969a233adb6bf701de96d0fd0570e5ddcc787 Mon Sep 17 00:00:00 2001
+From: Khem Raj 
+Date: Mon, 21 Mar 2022 19:35:48 -0700
+Subject: [PATCH] cmake: Pass PROBE_NAME via CFLAGS
+
+This helps compliation of driver code where its calling modprobe on the
+given kernel module via system() API
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj 
+---
+ CMakeLists.txt | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 7dceb7ae..e156c36f 100644
+--- a/CMakeLists.txt
 b/CMakeLists.txt
+@@ -149,6 +149,7 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux")
+   if(NOT DEFINED PROBE_NAME)
+   set(PROBE_NAME "scap")
+   endif()
++  add_definitions(-DPROBE_NAME="${PROBE_NAME}")
+ 
+   set(DRIVERS_REPO "https://download.sysdig.com/scap-drivers";)
+   
+-- 
+2.35.1
+
diff --git a/meta-selftest/recipes-extended/sysdig/sysdig-selftest_0.28.0.bb 
b/meta-selftest/recipes-extended/sysdig/sysdig-selftest_0.28.0.bb
new file mode 100644
index 00..e114f465a0
--- /dev/null
+++ b/meta-selftest/recipes-extended/sysdig/sysdig-selftest_0.28.0.bb
@@ -0,0 +1,64 @@
+SUMMARY = "A New System Troubleshooting Tool Built for the Way You Work"
+DESCRIPTION = "Sysdig is open source, system-level exploration: capture \
+system state and activity from a running Linux instance, then save, \
+filter and analyze."
+HOMEPAGE = "http://www.sysdig.org/";
+LICENSE = "Apache-2.0 & (MIT | GPL-2.0-only)"
+LIC_FILES_CHKSUM = "file://COPYING;md5=f8fee3d59797546cffab04f3b88b2d44"
+
+inherit cmake pkgconfig
+
+#OECMAKE_GENERATOR = "Unix Makefiles"
+JIT ?= "jit"
+JIT:mipsarchn32 = ""
+JIT:mipsarchn64 = ""
+JIT:riscv64 = ""
+JIT:riscv32 = ""
+JIT:powerpc = ""
+JIT:powerpc64le = ""
+JIT:powerpc64 = ""
+

[OE-core] [PATCH 5/7] devtool: Make use of oe.patch.GitApplyTree.commitIgnored()

2024-02-16 Thread Peter Kjellerstedt
This makes use of the oe.patch.GitApplyTree.commitIgnored() function to
create commits that shall be ignored by `devtool finish`.

Signed-off-by: Peter Kjellerstedt 
---
 scripts/lib/devtool/__init__.py | 4 +---
 scripts/lib/devtool/standard.py | 6 +-
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py
index c7fc3cfc41..6133c1c5b4 100644
--- a/scripts/lib/devtool/__init__.py
+++ b/scripts/lib/devtool/__init__.py
@@ -253,9 +253,7 @@ def setup_git_repo(repodir, version, devbranch, 
basetag='devtool-base', d=None):
 bb.process.run('git submodule add %s %s' % (remote_url, 
os.path.relpath(root, os.path.join(root, ".."))), cwd=os.path.join(root, ".."))
 found = True
 if found:
-useroptions = []
-oe.patch.GitApplyTree.gitCommandUserOptions(useroptions, 
d=d)
-bb.process.run('git %s commit -m "Adding additionnal 
submodule from SRC_URI\n\n%s"' % (' '.join(useroptions), 
oe.patch.GitApplyTree.ignore_commit_prefix), cwd=os.path.join(root, ".."))
+oe.patch.GitApplyTree.commitIgnored("Add additional 
submodule from SRC_URI", dir=os.path.join(root, ".."), d=d)
 found = False
 if os.path.exists(os.path.join(repodir, '.gitmodules')):
 bb.process.run('git submodule foreach --recursive  "git tag -f %s"' % 
basetag, cwd=repodir)
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index ccb7ea851b..6d7fd17fbd 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -484,11 +484,7 @@ def symlink_oelocal_files_srctree(rd, srctree):
 os.symlink('oe-local-files/%s' % fn, destpth)
 addfiles.append(os.path.join(relpth, fn))
 if addfiles:
-bb.process.run('git add %s' % ' '.join(addfiles), cwd=srctree)
-useroptions = []
-oe.patch.GitApplyTree.gitCommandUserOptions(useroptions, d=rd)
-bb.process.run('git %s commit -m "Committing local file 
symlinks\n\n%s"' % (' '.join(useroptions), 
oe.patch.GitApplyTree.ignore_commit_prefix), cwd=srctree)
-
+oe.patch.GitApplyTree.commitIgnored("Add local file symlinks", 
dir=srctree, files=addfiles, d=rd)
 
 def _extract_source(srctree, keep_temp, devbranch, sync, config, basepath, 
workspace, fixed_setup, d, tinfoil, no_overrides=False):
 """Extract sources of a recipe"""

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#195797): 
https://lists.openembedded.org/g/openembedded-core/message/195797
Mute This Topic: https://lists.openembedded.org/mt/104398930/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 6/7] patch.bbclass: Make use of oe.patch.GitApplyTree.commitIgnored()

2024-02-16 Thread Peter Kjellerstedt
This makes use of the oe.patch.GitApplyTree.commitIgnored() function to
create commits that shall be ignored by `devtool finish`.

Signed-off-by: Peter Kjellerstedt 
---
 meta/classes-global/patch.bbclass | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/meta/classes-global/patch.bbclass 
b/meta/classes-global/patch.bbclass
index e3157c7b18..e5786b1c9a 100644
--- a/meta/classes-global/patch.bbclass
+++ b/meta/classes-global/patch.bbclass
@@ -79,9 +79,7 @@ python patch_task_postfunc() {
 bb.process.run('git checkout patches', cwd=srcsubdir)
 stdout, _ = bb.process.run('git status --porcelain .', cwd=srcsubdir)
 if stdout:
-useroptions = []
-oe.patch.GitApplyTree.gitCommandUserOptions(useroptions, d=d)
-bb.process.run('git add .; git %s commit -a -m "Committing changes 
from %s\n\n%s"' % (' '.join(useroptions), func, 
oe.patch.GitApplyTree.ignore_commit_prefix + ' - from %s' % func), 
cwd=srcsubdir)
+oe.patch.GitApplyTree.commitIgnored("Add changes from %s" % func, 
dir=srcsubdir, files=['.'], d=d)
 }
 
 def src_patches(d, all=False, expand=True):

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#195794): 
https://lists.openembedded.org/g/openembedded-core/message/195794
Mute This Topic: https://lists.openembedded.org/mt/104398927/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 4/7] lib/oe/patch: Add GitApplyTree.commitIgnored()

2024-02-16 Thread Peter Kjellerstedt
This function can be used to create a commit that devtool will ignore
when creating/updating the patches.

Signed-off-by: Peter Kjellerstedt 
---
 meta/lib/oe/patch.py | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py
index 70cdb1d9c0..3ded5f3601 100644
--- a/meta/lib/oe/patch.py
+++ b/meta/lib/oe/patch.py
@@ -460,6 +460,16 @@ class GitApplyTree(PatchTree):
 cmd.append('--date="%s"' % date)
 return (tmpfile, cmd)
 
+@staticmethod
+def commitIgnored(subject, dir=None, files=None, d=None):
+if files:
+runcmd(['git', 'add'] + files, dir)
+message = "%s\n\n%s" % (subject, GitApplyTree.ignore_commit_prefix)
+cmd = ["git"]
+GitApplyTree.gitCommandUserOptions(cmd, d=d)
+cmd += ["commit", "-m", message, "--no-verify"]
+runcmd(cmd, dir)
+
 @staticmethod
 def extractPatches(tree, startcommits, outdir, paths=None):
 import tempfile

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#195795): 
https://lists.openembedded.org/g/openembedded-core/message/195795
Mute This Topic: https://lists.openembedded.org/mt/104398928/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/7] devtool: _extract_source: Correct the removal of an old backup directory

2024-02-16 Thread Peter Kjellerstedt
Also correct the comment describing what is happening.

Signed-off-by: Peter Kjellerstedt 
---
 scripts/lib/devtool/standard.py | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index dd9232da1c..ccb7ea851b 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -667,13 +667,13 @@ def _extract_source(srctree, keep_temp, devbranch, sync, 
config, basepath, works
 if sync:
 bb.process.run('git fetch file://' + srcsubdir + ' ' + devbranch + 
':' + devbranch, cwd=srctree)
 
-# Move oe-local-files directory to srctree
-# As the oe-local-files is not part of the constructed git tree,
-# remove them directly during the synchrounizating might surprise
-# the users.  Instead, we move it to oe-local-files.bak and remind
-# user in the log message.
+# Move the oe-local-files directory to srctree.
+# As oe-local-files is not part of the constructed git tree,
+# removing it directly during the synchronization might surprise
+# the user.  Instead, we move it to oe-local-files.bak and remind
+# the user in the log message.
 if os.path.exists(srctree_localdir + '.bak'):
-shutil.rmtree(srctree_localdir, srctree_localdir + '.bak')
+shutil.rmtree(srctree_localdir + '.bak')
 
 if os.path.exists(srctree_localdir):
 logger.info('Backing up current local file directory %s' % 
srctree_localdir)

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#195793): 
https://lists.openembedded.org/g/openembedded-core/message/195793
Mute This Topic: https://lists.openembedded.org/mt/104398926/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 0/6] devtool: ide: Improve VSCode support

2024-02-15 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org 
>  On Behalf Of Richard Purdie
> Sent: den 15 februari 2024 18:11
> To: Enguerrand de Ribaucourt ; 
> openembedded-core@lists.openembedded.org
> Cc: adrian.freiho...@gmail.com; ross.bur...@arm.com; 
> mohammed.r...@savoirfairelinux.com
> Subject: Re: [OE-core] [PATCH 0/6] devtool: ide: Improve VSCode support
> 
> On Thu, 2024-02-15 at 18:04 +0100, Enguerrand de Ribaucourt wrote:
> > These patches improve the VSCode support in devtool ide-sdk from
> > Adrian Freihofer.
> >
> > I added a generic C++ configuration for the VScode
> > extension while awaiting for autotools support.
> >
> > A refactoring is proposed for the meson class. Without absolute compiler
> > paths, the linter inside VSCode will not be able to find the
> > cross-compiler. Let me know if you have any concerns about this
> > refactoring.
> >
> > The other bug fixes are relatively minor and make the tool work for some 
> > edge
> > cases.
> 
> I noticed none of the patches in this series have Signed-off-by lines
> which needs to be fixed before we can merge them. Patchtest should be
> along shortly to say that too!

Actually, there does not seem to be any messages about this from patchtest. 
There have been other inconsistencies reported by it since, but not these...

> 
> I need to think about and test the meson one a bit more as absolute
> paths can be a source of problems. I've not looked into the others in
> detail yet.
> 
> Cheers,
> 
> Richard

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#195724): 
https://lists.openembedded.org/g/openembedded-core/message/195724
Mute This Topic: https://lists.openembedded.org/mt/104376742/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] devtool: modify: Correct appending of type=git-dependency to URIs

2024-02-15 Thread Peter Kjellerstedt
A missing space when using :append would lead to run-on URIs if there
was no whitespace at the end of the original SRC_URI.

Signed-off-by: Peter Kjellerstedt 
---
 scripts/lib/devtool/standard.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 8fb4b934d4..0243e3bc75 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -966,7 +966,7 @@ def modify(args, config, basepath, workspace):
 # Assume first entry is main source extracted in ${S} so skip it
 src_uri = src_uri[1::]
 
-#Add "type=git-dependency" to all non local sources
+# Add "type=git-dependency" to all non local sources
 for url in src_uri:
 if not url.startswith('file://') and not 'type=' in url:
 src_uri_remove.append(url)
@@ -974,7 +974,7 @@ def modify(args, config, basepath, workspace):
 
 if src_uri_remove:
 f.write('SRC_URI:remove = "%s"\n' % ' '.join(src_uri_remove))
-f.write('SRC_URI:append = "%s"\n\n' % ' '.join(src_uri_append))
+f.write('SRC_URI:append = " %s"\n\n' % ' 
'.join(src_uri_append))
 
 f.write('FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"\n')
 # Local files can be modified/tracked in separate subdir under 
srctree

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#195708): 
https://lists.openembedded.org/g/openembedded-core/message/195708
Mute This Topic: https://lists.openembedded.org/mt/104382740/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [PATCH 1/2] create-spdx-2.2: Correct the default value of SPDX_NAMESPACE_PREFIX

2024-02-15 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org  c...@lists.openembedded.org> On Behalf Of Alexandre Belloni via
> lists.openembedded.org
> Sent: den 15 februari 2024 10:26
> To: belouargamoha...@gmail.com
> Cc: openembedded-core@lists.openembedded.org;
> f.lahoud...@technologyandstrategy.com; BELOUARGA Mohamed
> 
> Subject: Re: [OE-core] [PATCH 1/2] create-spdx-2.2: Correct the default
> value of SPDX_NAMESPACE_PREFIX
> 
> Hello,
> 
> This is 1/2, but I couldn't find a 2/2.

The 2/2 patch was sent to d...@lists.yoctoproject.org.

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#195509): 
https://lists.openembedded.org/g/openembedded-core/message/195509
Mute This Topic: https://lists.openembedded.org/mt/104362313/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] insane.bbclass: Allow the warning about virtual/ to be disabled

2024-01-22 Thread Peter Kjellerstedt
> -Original Message-
> From: Richard Purdie 
> Sent: den 22 januari 2024 15:02
> To: Peter Kjellerstedt ; openembedded-
> c...@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH] insane.bbclass: Allow the warning about
> virtual/ to be disabled
> 
> On Mon, 2024-01-22 at 06:52 +0100, Peter Kjellerstedt wrote:
> > Commit f673d3d239799fb1ab50f4aa5d44187666aa0cd7 introduced a warning for
> > virtual/ being used in RPROVIDES and RDEPENDS. Make it possible to
> > disable the warning by removing "virtual-slash from WARN_QA.
> >
> > Signed-off-by: Peter Kjellerstedt 
> > ---
> >  meta/classes-global/insane.bbclass | 13 +++--
> >  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> Whilst I can understand why you might want to make this configurable,
> I'm not sure if is a great idea since people are just going to turn it
> off and continue to ignore it :/.
> 
> virtual/ in the runtime namespace has never been supported and always
> been strongly recommended against.

We do not produce any package feeds and AFAIK in that case virtual/ works 
fine for runtime dependencies since it is only a name, just like, e.g., 
virtual-.

We get a gazillion warnings due to this during parsing, and it is not 
anything I can solve easily. And since it is just a warning that currently 
doesn't affect us, I would like to turn it off for now.

And as Martin mentioned, with my change applied, those who want can turn 
the warning into an error. And being able to do that is typically the only 
way to actually get rid of all warnings and keep them from coming back.

> 
> Cheers,
> 
> Richard

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#194168): 
https://lists.openembedded.org/g/openembedded-core/message/194168
Mute This Topic: https://lists.openembedded.org/mt/103881481/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] insane.bbclass: Allow the warning about virtual/ to be disabled

2024-01-21 Thread Peter Kjellerstedt
Commit f673d3d239799fb1ab50f4aa5d44187666aa0cd7 introduced a warning for
virtual/ being used in RPROVIDES and RDEPENDS. Make it possible to
disable the warning by removing "virtual-slash from WARN_QA.

Signed-off-by: Peter Kjellerstedt 
---
 meta/classes-global/insane.bbclass | 13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/meta/classes-global/insane.bbclass 
b/meta/classes-global/insane.bbclass
index 828f618cda..4ab7e4069d 100644
--- a/meta/classes-global/insane.bbclass
+++ b/meta/classes-global/insane.bbclass
@@ -34,7 +34,7 @@ WARN_QA ?= " libdir xorg-driver-abi buildpaths \
 missing-update-alternatives native-last missing-ptest \
 license-exists license-no-generic license-syntax license-format \
 license-incompatible license-file-missing obsolete-license \
-32bit-time \
+32bit-time virtual-slash \
 "
 ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch pkgconfig la \
 perms dep-cmp pkgvarcheck perm-config perm-line perm-link \
@@ -1607,11 +1607,12 @@ python () {
 if (d.getVar(d.expand('DEPENDS:${PN}'))):
 oe.qa.handle_error("pkgvarcheck", "recipe uses DEPENDS:${PN}, should 
use DEPENDS", d)
 
-# virtual/ is meaningless for those variables
-for k in ['RDEPENDS', 'RPROVIDES']:
-for var in bb.utils.explode_deps(d.getVar(k + ':' + pn) or ""):
-if var.startswith("virtual/"):
-bb.warn("%s is set to %s, the substring 'virtual/' holds no 
meaning in this context. It is suggested to use the 'virtual-' instead." % (k, 
var))
+# virtual/ is meaningless for these variables
+if "virtual-slash" in (d.getVar("ALL_QA") or "").split():
+for k in ['RDEPENDS', 'RPROVIDES']:
+for var in bb.utils.explode_deps(d.getVar(k + ':' + pn) or ""):
+if var.startswith("virtual/"):
+oe.qa.handle_error("virtual-slash", "%s is set to %s, but 
the substring 'virtual/' holds no meaning in this context. It is suggested to 
use 'virtual-' instead." % (k, var), d)
 
 issues = []
 if (d.getVar('PACKAGES') or "").split():

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#194116): 
https://lists.openembedded.org/g/openembedded-core/message/194116
Mute This Topic: https://lists.openembedded.org/mt/103881481/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] devtool: modify: Handle recipes with a menuconfig task correctly

2023-12-15 Thread Peter Kjellerstedt
This avoids the following error when running `devtool modify` on a
recipe that has a menuconfig task, but does not have
KCONFIG_CONFIG_ENABLE_MENUCONFIG set.

  .../temp/run.do_configure.4163366: line 152:
  ${@ oe.types.boolean('${KCONFIG_CONFIG_ENABLE_MENUCONFIG}') }: bad 
substitution
  WARNING: .../temp/run.do_configure.4163366:152 exit 1 from
  '[ ${@ oe.types.boolean('${KCONFIG_CONFIG_ENABLE_MENUCONFIG}') } = True ]'

Signed-off-by: Peter Kjellerstedt 
---
 scripts/lib/devtool/standard.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index c5b6458d06..559fd45676 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -986,7 +986,7 @@ def modify(args, config, basepath, workspace):
 '}\n')
 if rd.getVarFlag('do_menuconfig','task'):
 f.write('\ndo_configure:append() {\n'
-'if [ ${@ 
oe.types.boolean(\'${KCONFIG_CONFIG_ENABLE_MENUCONFIG}\') } = True ]; then\n'
+'if [ 
${@oe.types.boolean(d.getVar("KCONFIG_CONFIG_ENABLE_MENUCONFIG"))} = True ]; 
then\n'
 'cp ${KCONFIG_CONFIG_ROOTDIR}/.config 
${S}/.config.baseline\n'
 'ln -sfT ${KCONFIG_CONFIG_ROOTDIR}/.config 
${S}/.config.new\n'
 'fi\n'

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#192427): 
https://lists.openembedded.org/g/openembedded-core/message/192427
Mute This Topic: https://lists.openembedded.org/mt/103189021/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [PATCH 2/2] staging: ensure postinst-useradd is run in order

2023-12-13 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org 
>  On Behalf Of Eilís 'pidge' Ní 
> Fhlannagáin
> Sent: den 12 december 2023 18:17
> To: openembedded-core@lists.openembedded.org
> Cc: Eilís 'pidge' Ní Fhlannagáin 
> Subject: [OE-core] [PATCH 2/2] staging: ensure postinst-useradd is run in 
> order
> 
> This patch is based off the work of Piotr Łobacz found here:
> https://bugzilla.yoctoproject.org/attachment.cgi?id=4972&action=diff
> 
> The one issue with this is I'm not entirely certain that errors are
> filtering up from postinsts, as the test for base-passwd's postinst
> declares that if it's not found, we'll just call it later, but if so,
> I'm not seeing where exactly that's happening.
> 
> Signed-off-by: Eilís 'pidge' Ní Fhlannagáin 
> ---
>  meta/classes-global/staging.bbclass |  6 +--
>  meta/classes/useradd.bbclass| 74 ++---
>  2 files changed, 49 insertions(+), 31 deletions(-)
> 
> diff --git a/meta/classes-global/staging.bbclass 
> b/meta/classes-global/staging.bbclass
> index cf1e4600fd6..e879333aeb9 100644
> --- a/meta/classes-global/staging.bbclass
> +++ b/meta/classes-global/staging.bbclass
> @@ -245,7 +245,7 @@ def staging_populate_sysroot_dir(targetsysroot, 
> nativesysroot, native, d):
>  continue
> 
>  staging_processfixme(fixme, targetdir, targetsysroot, nativesysroot, d)
> -for p in postinsts:
> +for p in sorted(postinsts):
>  subprocess.check_output(p, shell=True, stderr=subprocess.STDOUT)
> 
>  #
> @@ -629,9 +629,9 @@ python extend_recipe_sysroot() {
>  for f in fixme:
>  staging_processfixme(fixme[f], f, recipesysroot, 
> recipesysrootnative, d)
> 
> -for p in postinsts:
> +for p in sorted(postinsts):
>  subprocess.check_output(p, shell=True, stderr=subprocess.STDOUT)
> -
> +

This introduces trailing whitespace.

>  for dep in manifests:
>  c = setscenedeps[dep][0]
>  os.symlink(manifests[dep], depdir + "/" + c + ".complete")
> diff --git a/meta/classes/useradd.bbclass b/meta/classes/useradd.bbclass
> index 0997b3da7a5..b044b926d99 100644
> --- a/meta/classes/useradd.bbclass
> +++ b/meta/classes/useradd.bbclass
> @@ -103,6 +103,18 @@ fi
>  }
> 
>  useradd_sysroot () {
> + user_group_groupmems_add_sysroot user
> +}
> +
> +groupadd_sysroot () {
> + user_group_groupmems_add_sysroot group
> +}
> +
> +groupmemsadd_sysroot () {
> + user_group_groupmems_add_sysroot groupmems
> +}
> +
> +user_group_groupmems_add_sysroot () {
>   # Pseudo may (do_prepare_recipe_sysroot) or may not 
> (do_populate_sysroot_setscene) be running
>   # at this point so we're explicit about the environment so pseudo can 
> load if
>   # not already present.
> @@ -130,10 +142,19 @@ useradd_sysroot () {
>   exit 0
>   fi
> 
> - # Add groups and users defined for all recipe packages
> - GROUPADD_PARAM="${@get_all_cmd_params(d, 'groupadd')}"
> - USERADD_PARAM="${@get_all_cmd_params(d, 'useradd')}"
> - GROUPMEMS_PARAM="${@get_all_cmd_params(d, 'groupmems')}"
> + if test "x$1" = "xgroup"; then
> + GROUPADD_PARAM="${@get_all_cmd_params(d, 'groupadd')}"
> + fi
> + if test "x$1" = "xuser"; then
> + USERADD_PARAM="${@get_all_cmd_params(d, 'useradd')}"
> + fi
> + if test "x$1" = "xgroupmems"; then
> + GROUPMEMS_PARAM="${@get_all_cmd_params(d, 'groupmems')}"
> + fi
> + if test "x$1" = "x"; then
> + bbwarn "missing type of passwd db action"
> + exit 0
> + fi

Use a case statement instead:

case $1 in
group) GROUPADD_PARAM="${@get_all_cmd_params(d, 
'groupadd')}";;
user)  USERADD_PARAM="${@get_all_cmd_params(d, 
'useradd')}";;
groupmems) GROUPMEMS_PARAM="${@get_all_cmd_params(d, 
'groupmems')}";;
*) bbfatal "Unknown/missing type of passwd db action: 
$1";;
esac

> 
>   # Tell the system to use the environment vars
>   UA_SYSROOT=1
> @@ -148,29 +169,26 @@ useradd_sysroot () {
>  EXTRA_STAGING_FIXMES += "PSEUDO_SYSROOT PSEUDO_LOCALSTATEDIR LOGFIFO"
> 
>  python useradd_sysroot_sstate () {
> -scriptfile = None
> -task = d.getVar("BB_CURRENTTASK")
> -if task == "package_setscene":
> -bb.build.exec_func("useradd_sysroot", d)
> -elif task == "prepare_recipe_sysroot":
> -# Used to update this recipe's own sysroot so the user/groups are 
> available to do_install
> -
> -# If do_populate_sysroot is triggered and we write the file here, 
> there would be an overlapping
> -# files. See 
> usergrouptests.UserGroupTests.test_add_task_between_p_sysroot_and_package
> -scriptfile = 
> d.expand("${RECIPE_SYSROOT}${bindir}/postinst-useradd-${PN}-recipedebug")
> -
> -bb.build.exec_func("useradd_sysroot", d)
> -elif task == "populate_sysroot":
> -# Used when installed in d

Re: [OE-core] [PATCH] recipetool: pypi: do not clobber SRC_URI checksums

2023-12-08 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org 
>  On Behalf Of Tim Orling
> Sent: den 9 december 2023 02:37
> To: openembedded-core@lists.openembedded.org
> Cc: Tim Orling 
> Subject: [OE-core] [PATCH] recipetool: pypi: do not clobber SRC_URI checksums
> 
> The pypi change:
> "85a2a6f68af recipetool: create_buildsys_python: add pypi support"
> deleted all the SRC_URI variables, including the SRC_URI checksums.
> These are not generated by the pypi.bbclass (how could they be trusted?)
> 
> Without the checksum(s), we are vulnerable to a man-in-the-middle attack
> and zero checks on the validity of the downloaded tarball from pypi.org.
> 
> Fix by only setting S and SRC_URI to None.
> 
> Signed-off-by: Tim Orling 
> ---
>  scripts/lib/recipetool/create_buildsys_python.py | 5 -
>  1 file changed, 5 deletions(-)
> 
> diff --git a/scripts/lib/recipetool/create_buildsys_python.py 
> b/scripts/lib/recipetool/create_buildsys_python.py
> index 5e07222ece1..66de36ba3e4 100644
> --- a/scripts/lib/recipetool/create_buildsys_python.py
> +++ b/scripts/lib/recipetool/create_buildsys_python.py
> @@ -172,11 +172,6 @@ class PythonRecipeHandler(RecipeHandler):
>  # extravalues['SRC_URI(?:\[.*?\])?'] = None

The TODO comment above should also be removed as it should not be done.

>  extravalues['S'] = None
>  extravalues['SRC_URI'] = None
> -extravalues['SRC_URI[md5sum]'] = None
> -extravalues['SRC_URI[sha1sum]'] = None
> -extravalues['SRC_URI[sha256sum]'] = None
> -extravalues['SRC_URI[sha384sum]'] = None
> -extravalues['SRC_URI[sha512sum]'] = None
> 
>  classes.append('pypi')
> 
> --
> 2.34.1

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#192095): 
https://lists.openembedded.org/g/openembedded-core/message/192095
Mute This Topic: https://lists.openembedded.org/mt/103067452/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 4/6] gnu-config: add a do_compile task

2023-12-08 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org 
>  On Behalf Of Richard Purdie
> Sent: den 8 december 2023 12:35
> To: Alexander Kanavin ; 
> openembedded-core@lists.openembedded.org
> Cc: Alexander Kanavin 
> Subject: Re: [OE-core] [PATCH 4/6] gnu-config: add a do_compile task
> 
> On Fri, 2023-12-08 at 11:15 +0100, Alexander Kanavin wrote:
> > noexec flag has an unfortunate side effect of not writing out the .siginfo
> > file into sstate (because that is done in sstate bbclass
> > from a task-completed event handler).
> >
> > In the absence of the siginfo file, diffsigs code is unable to trace back
> > the change in task signatures if the change is really basic and
> > affects tasks coming ahead of gnu-config-native:do_compile.
> >
> > Signed-off-by: Alexander Kanavin 
> > ---
> >  meta/recipes-devtools/gnu-config/gnu-config_git.bb | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/meta/recipes-devtools/gnu-config/gnu-config_git.bb 
> > b/meta/recipes-devtools/gnu-config/gnu-config_git.bb
> > index 718f798a00e..c72de159ce2 100644
> > --- a/meta/recipes-devtools/gnu-config/gnu-config_git.bb
> > +++ b/meta/recipes-devtools/gnu-config/gnu-config_git.bb
> > @@ -19,7 +19,8 @@ UPSTREAM_CHECK_COMMITS = "1"
> >
> >  CLEANBROKEN = "1"
> >
> > -do_compile[noexec] = "1"
> > +do_compile () {
> > +}
> >
> >  do_install () {
> > install -d ${D}${datadir}/gnu-config \
> >
> 
> You have a good point here but by this logic, we need to remove *all*
> noexec tasks. We don't really want to do that and I'm not sure we want
> to set this precedent.
> 
> I wonder if we could just remove the compile task entirely and what
> that would break...
> 
> Cheers,
> 
> Richard

Would it be possible to change the code so that the .siginfo files are 
still produced for noexec tasks? Otherwise it seems using noexec tasks 
is a real blocker for being able to trace the signatures for any 
subsequent task.

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#192088): 
https://lists.openembedded.org/g/openembedded-core/message/192088
Mute This Topic: https://lists.openembedded.org/mt/103052553/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



  1   2   3   4   5   6   7   8   9   10   >