[OE-core] [PATCH] create-spdx: Get SPDX-License-Identifier from source

2022-02-01 Thread Saul Wold
This patch will read the begining of source files and try to find
the SPDX-License-Identifier to populate the licenseInfoInFiles
field for each source file. This does not populate licenseConculed
at this time, nor rolls it up to package level.

We read as binary to since some source code seem to have some
binary characters, the license is then converted to ascii strings.

Signed-off-by: Saul Wold 
---
Merge after Joshua's patch (spdx: Add set helper for list properties) merges

 meta/classes/create-spdx.bbclass | 23 +++
 1 file changed, 23 insertions(+)

diff --git a/meta/classes/create-spdx.bbclass b/meta/classes/create-spdx.bbclass
index 8b4203fdb5d..588489cc2b0 100644
--- a/meta/classes/create-spdx.bbclass
+++ b/meta/classes/create-spdx.bbclass
@@ -37,6 +37,24 @@ SPDX_SUPPLIER[doc] = "The SPDX PackageSupplier field for 
SPDX packages created f
 
 do_image_complete[depends] = "virtual/kernel:do_create_spdx"
 
+def extract_licenses(filename):
+import re
+import oe.spdx
+
+lic_regex = re.compile(b'SPDX-License-Identifier:\s+([-A-Za-z\d. ]+)[ 
|\n|\r\n]*?')
+
+try:
+with open(filename, 'rb') as f:
+size = min(15000, os.stat(filename).st_size)
+txt = f.read(size)
+licenses = re.findall(lic_regex, txt)
+if licenses:
+ascii_licenses = [lic.decode('ascii') for lic in licenses]
+return ascii_licenses
+except Exception as e:
+bb.warn(f"Exception reading {filename}: {e}")
+return None
+
 def get_doc_namespace(d, doc):
 import uuid
 namespace_uuid = uuid.uuid5(uuid.NAMESPACE_DNS, 
d.getVar("SPDX_UUID_NAMESPACE"))
@@ -232,6 +250,11 @@ def add_package_files(d, doc, spdx_pkg, topdir, 
get_spdxid, get_types, *, archiv
 checksumValue=bb.utils.sha256_file(filepath),
 ))
 
+if "SOURCE" in spdx_file.fileTypes:
+extracted_lics = extract_licenses(filepath)
+if extracted_lics:
+spdx_file.licenseInfoInFiles = extracted_lics
+
 doc.files.append(spdx_file)
 doc.add_relationship(spdx_pkg, "CONTAINS", spdx_file)
 spdx_pkg.hasFiles.append(spdx_file.SPDXID)
-- 
2.31.1


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



[OE-core] [PATCH v2] ruby: Fix build on riscv/musl

2022-02-01 Thread Khem Raj
This fixes a build issue that started with 3.1 upgrade
Fixes
| ../ruby-3.1.0/vm_dump.c:916:38: error: use of undeclared identifier 'REG_S1'
| dump_machine_register(mctx->__gregs[REG_S1], "s1");

Signed-off-by: Khem Raj 
---
v2: document the need to patch musl

 ...ine-REG_S1-and-REG_S2-for-musl-riscv.patch | 34 +++
 meta/recipes-devtools/ruby/ruby_3.1.0.bb  |  9 +
 2 files changed, 35 insertions(+), 8 deletions(-)
 create mode 100644 
meta/recipes-devtools/ruby/ruby/0001-vm_dump.c-Define-REG_S1-and-REG_S2-for-musl-riscv.patch

diff --git 
a/meta/recipes-devtools/ruby/ruby/0001-vm_dump.c-Define-REG_S1-and-REG_S2-for-musl-riscv.patch
 
b/meta/recipes-devtools/ruby/ruby/0001-vm_dump.c-Define-REG_S1-and-REG_S2-for-musl-riscv.patch
new file mode 100644
index 000..f7b7adb3fdb
--- /dev/null
+++ 
b/meta/recipes-devtools/ruby/ruby/0001-vm_dump.c-Define-REG_S1-and-REG_S2-for-musl-riscv.patch
@@ -0,0 +1,34 @@
+From dfb22e4d6662bf72879eda806eaa78c7b52b519e Mon Sep 17 00:00:00 2001
+From: Khem Raj 
+Date: Tue, 25 Jan 2022 20:29:14 -0800
+Subject: [PATCH] vm_dump.c: Define REG_S1 and REG_S2 for musl/riscv
+
+These defines are missing in musl, there is a possible
+patch to add them to musl, but we need a full list of
+these names for mcontext that can be added once for all
+
+Upstream-Status: Inappropriate [musl bug]
+Signed-off-by: Khem Raj 
+---
+ vm_dump.c | 5 +
+ 1 file changed, 5 insertions(+)
+
+diff --git a/vm_dump.c b/vm_dump.c
+index a98f5aa..957b785 100644
+--- a/vm_dump.c
 b/vm_dump.c
+@@ -39,6 +39,11 @@
+ 
+ #define MAX_POSBUF 128
+ 
++#if defined(__riscv) && !defined(__GLIBC__)
++# define REG_S1 9
++# define REG_S2 18
++#endif
++
+ #define VM_CFP_CNT(ec, cfp) \
+   ((rb_control_frame_t *)((ec)->vm_stack + (ec)->vm_stack_size) - \
+(rb_control_frame_t *)(cfp))
+-- 
+2.35.0
+
diff --git a/meta/recipes-devtools/ruby/ruby_3.1.0.bb 
b/meta/recipes-devtools/ruby/ruby_3.1.0.bb
index e250164d2c4..7a04a364326 100644
--- a/meta/recipes-devtools/ruby/ruby_3.1.0.bb
+++ b/meta/recipes-devtools/ruby/ruby_3.1.0.bb
@@ -11,6 +11,7 @@ SRC_URI += " \

file://0004-lib-mkmf.rb-sort-list-of-object-files-in-generated-M.patch \

file://0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patch \
file://0006-Make-gemspecs-reproducible.patch \
+   file://0001-vm_dump.c-Define-REG_S1-and-REG_S2-for-musl-riscv.patch 
\
"
 
 SRC_URI[sha256sum] = 
"50a0504c6edcb4d61ce6b8cfdbddaa95707195fab0ecd7b5e92654b2a9412854"
@@ -36,18 +37,10 @@ EXTRA_OECONF = "\
 "
 
 EXTRA_OECONF:append:libc-musl = "\
-LIBS='-lucontext' \
 ac_cv_func_isnan=yes \
 ac_cv_func_isinf=yes \
 "
 
-EXTRA_OECONF:append:libc-musl:riscv64 = "\
---with-coroutine=copy \
-"
-EXTRA_OECONF:append:libc-musl:riscv32 = "\
---with-coroutine=copy \
-"
-
 PARALLEL_MAKEINST = ""
 
 do_install:append:class-target () {
-- 
2.35.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#161168): 
https://lists.openembedded.org/g/openembedded-core/message/161168
Mute This Topic: https://lists.openembedded.org/mt/88844849/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] cve-check: create directory before copy

2022-02-01 Thread Alexander Kanavin
On Tue, 1 Feb 2022 at 19:58, Stefan Herbrechtsmeier <
stefan.herbrechtsmeier-...@weidmueller.com> wrote:

> Am 01.02.2022 um 18:00 schrieb Alexander Kanavin:
> > Can you please describe the issue this is fixing in the commit message?
> > Why is this not seen by others?
>
> Isn't it best practice to create a directory before copy something into
> the directory? The patch shows that the arbitrary directory of the
> CVE_CHECK_MANIFEST variable isn't created.
>

That's right, but then the commit title should mention CVE_CHECK_MESSAGE;
"create directory before copy" is too generic.

Alex


>
> > On Tue, 1 Feb 2022 at 17:17, Stefan Herbrechtsmeier
> >  > > wrote:
> >
> > From: Stefan Herbrechtsmeier  > >
> >
> > Signed-off-by: Stefan Herbrechtsmeier
> >  > >
> > ---
> >
> >   meta/classes/cve-check.bbclass | 1 +
> >   1 file changed, 1 insertion(+)
> >
> > diff --git a/meta/classes/cve-check.bbclass
> > b/meta/classes/cve-check.bbclass
> > index 70d1988a70..a4d735c323 100644
> > --- a/meta/classes/cve-check.bbclass
> > +++ b/meta/classes/cve-check.bbclass
> > @@ -143,6 +143,7 @@ python cve_check_write_rootfs_manifest () {
> >   manifest_name = d.getVar("CVE_CHECK_MANIFEST")
> >   cve_tmp_file = d.getVar("CVE_CHECK_TMP_FILE")
> >
> > +bb.utils.mkdirhier(os.path.dirname(manifest_name))
> >   shutil.copyfile(cve_tmp_file, manifest_name)
> >
> >   if manifest_name and os.path.exists(manifest_name):
> > --
> > 2.30.2
> >
> >
> > 
> >
>

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#161167): 
https://lists.openembedded.org/g/openembedded-core/message/161167
Mute This Topic: https://lists.openembedded.org/mt/88836328/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] cve-check: create directory before copy

2022-02-01 Thread Stefan Herbrechtsmeier

Am 01.02.2022 um 18:00 schrieb Alexander Kanavin:
Can you please describe the issue this is fixing in the commit message? 
Why is this not seen by others?


Isn't it best practice to create a directory before copy something into 
the directory? The patch shows that the arbitrary directory of the 
CVE_CHECK_MANIFEST variable isn't created.


On Tue, 1 Feb 2022 at 17:17, Stefan Herbrechtsmeier 
> wrote:


From: Stefan Herbrechtsmeier mailto:stefan.herbrechtsme...@weidmueller.com>>

Signed-off-by: Stefan Herbrechtsmeier
mailto:stefan.herbrechtsme...@weidmueller.com>>
---

  meta/classes/cve-check.bbclass | 1 +
  1 file changed, 1 insertion(+)

diff --git a/meta/classes/cve-check.bbclass
b/meta/classes/cve-check.bbclass
index 70d1988a70..a4d735c323 100644
--- a/meta/classes/cve-check.bbclass
+++ b/meta/classes/cve-check.bbclass
@@ -143,6 +143,7 @@ python cve_check_write_rootfs_manifest () {
          manifest_name = d.getVar("CVE_CHECK_MANIFEST")
          cve_tmp_file = d.getVar("CVE_CHECK_TMP_FILE")

+        bb.utils.mkdirhier(os.path.dirname(manifest_name))
          shutil.copyfile(cve_tmp_file, manifest_name)

          if manifest_name and os.path.exists(manifest_name):
-- 
2.30.2






-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#161166): 
https://lists.openembedded.org/g/openembedded-core/message/161166
Mute This Topic: https://lists.openembedded.org/mt/88836328/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] spdx: Add set helper for list properties

2022-02-01 Thread Joshua Watt
This adds the set helper for list properties to allow list members to be
replaced with a new list. This is necessary as it is (currently) the
only way to replace the default value for a list member.

Signed-off-by: Joshua Watt 
---
 meta/lib/oe/spdx.py | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oe/spdx.py b/meta/lib/oe/spdx.py
index 9e7ced5a15..14ca706895 100644
--- a/meta/lib/oe/spdx.py
+++ b/meta/lib/oe/spdx.py
@@ -105,10 +105,13 @@ class _ListProperty(_Property):
 obj._spdx[name] = []
 return obj._spdx[name]
 
+def set_helper(obj, value):
+obj._spdx[name] = list(value)
+
 def del_helper(obj):
 del obj._spdx[name]
 
-attrs[name] = property(get_helper, None, del_helper)
+attrs[name] = property(get_helper, set_helper, del_helper)
 
 def init(self, source):
 return [self.prop.init(o) for o in source]
-- 
2.33.0


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#161169): 
https://lists.openembedded.org/g/openembedded-core/message/161169
Mute This Topic: https://lists.openembedded.org/mt/88846657/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] create-spdx: Get SPDX-License-Identifier from source

2022-02-01 Thread Saul Wold



On 2/1/22 19:21, Peter Kjellerstedt wrote:

-Original Message-
From: openembedded-core@lists.openembedded.org 
 On Behalf Of Saul Wold
Sent: den 2 februari 2022 01:02
To: openembedded-core@lists.openembedded.org; jpewhac...@gmail.com
Cc: Saul Wold 
Subject: [OE-core] [PATCH] create-spdx: Get SPDX-License-Identifier from source

This patch will read the begining of source files and try to find
the SPDX-License-Identifier to populate the licenseInfoInFiles
field for each source file. This does not populate licenseConculed


I assume that should be "licenseConcluded".

Well that depends on if "we" want to take some "ownership" of the 
conclusion as the "preparer".  How would we handle the case of 2 
SPDX-License-Identifiers tags in a file, is it an "AND" or an "OR"? 
Simple example.


The description of licenseConcluded is:

"License expression for licenseConcluded.  The licensing that the 
preparer of this SPDX document has concluded, based on the evidence, 
actually applies to the package."


At somepoint we might be able to fill in that field, but for now I think 
we leave it as NOASSERTION.


Sau!


at this time, nor rolls it up to package level.

We read as binary to since some source code seem to have some


to -> too


binary characters, the license is then converted to ascii strings.

Signed-off-by: Saul Wold 
---
Merge after Joshua's patch (spdx: Add set helper for list properties)
merges

  meta/classes/create-spdx.bbclass | 23 +++
  1 file changed, 23 insertions(+)

diff --git a/meta/classes/create-spdx.bbclass b/meta/classes/create-spdx.bbclass
index 8b4203fdb5d..588489cc2b0 100644
--- a/meta/classes/create-spdx.bbclass
+++ b/meta/classes/create-spdx.bbclass
@@ -37,6 +37,24 @@ SPDX_SUPPLIER[doc] = "The SPDX PackageSupplier field for 
SPDX packages created f

  do_image_complete[depends] = "virtual/kernel:do_create_spdx"

+def extract_licenses(filename):
+import re
+import oe.spdx


You do not use oe.spdx in this function.


+
+lic_regex = re.compile(b'SPDX-License-Identifier:\s+([-A-Za-z\d. ]+)[ 
|\n|\r\n]*?')


I assume you meant:

 lic_regex = re.compile(b'SPDX-License-Identifier:\s+([-A-Za-z\d. ]+)(?: 
|\n|\r\n)*?')

Not that it really matters though, as it will yield the same result as:

 lic_regex = re.compile(b'SPDX-License-Identifier:\s+([-A-Za-z\d. ]+)')

However, neither of the expressions above will correctly match all the
SPDX-License-Identifier examples at https://spdx.dev/ids/#how.

Use this instead:

 lic_regex = re.compile(b'^\W*SPDX-License-Identifier:\s*([ 
\w\d.()+-]+?)(?:\s+\W*)?$', re.MULTILINE)


+
+try:
+with open(filename, 'rb') as f:
+size = min(15000, os.stat(filename).st_size)
+txt = f.read(size)
+licenses = re.findall(lic_regex, txt)
+if licenses:
+ascii_licenses = [lic.decode('ascii') for lic in licenses]
+return ascii_licenses
+except Exception as e:
+bb.warn(f"Exception reading {filename}: {e}")
+return None
+
  def get_doc_namespace(d, doc):
  import uuid
  namespace_uuid = uuid.uuid5(uuid.NAMESPACE_DNS, 
d.getVar("SPDX_UUID_NAMESPACE"))
@@ -232,6 +250,11 @@ def add_package_files(d, doc, spdx_pkg, topdir, 
get_spdxid, get_types, *, archiv
  checksumValue=bb.utils.sha256_file(filepath),
  ))

+if "SOURCE" in spdx_file.fileTypes:
+extracted_lics = extract_licenses(filepath)
+if extracted_lics:
+spdx_file.licenseInfoInFiles = extracted_lics
+
  doc.files.append(spdx_file)
  doc.add_relationship(spdx_pkg, "CONTAINS", spdx_file)
  spdx_pkg.hasFiles.append(spdx_file.SPDXID)
--
2.31.1


//Peter



--
Sau!

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



[OE-core] [PATCH v2 2/3] systemd: Add link-udev-shared PACKAGECONFIG

2022-02-01 Thread Stefan Herbrechtsmeier
From: Stefan Herbrechtsmeier 

Add a PACKAGECONFIG to link systemd-udev and its helpers to
libsystemd-shared.so. If enabled the udev package depends on the systemd
package.

Signed-off-by: Stefan Herbrechtsmeier 
---

(no changes since v1)

 meta/recipes-core/systemd/systemd_249.7.bb | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/meta/recipes-core/systemd/systemd_249.7.bb 
b/meta/recipes-core/systemd/systemd_249.7.bb
index 53e7f6738d..739f3aae86 100644
--- a/meta/recipes-core/systemd/systemd_249.7.bb
+++ b/meta/recipes-core/systemd/systemd_249.7.bb
@@ -156,6 +156,9 @@ PACKAGECONFIG[kmod] = "-Dkmod=true,-Dkmod=false,kmod"
 PACKAGECONFIG[ldconfig] = "-Dldconfig=true,-Dldconfig=false,,ldconfig"
 PACKAGECONFIG[libidn] = "-Dlibidn=true,-Dlibidn=false,libidn,,libidn"
 PACKAGECONFIG[libidn2] = "-Dlibidn2=true,-Dlibidn2=false,libidn2,,libidn2"
+# Link udev shared with systemd helper library.
+# If enabled the udev package depends on the systemd package (which has the 
needed shared library).
+PACKAGECONFIG[link-udev-shared] = 
"-Dlink-udev-shared=true,-Dlink-udev-shared=false"
 PACKAGECONFIG[localed] = "-Dlocaled=true,-Dlocaled=false"
 PACKAGECONFIG[logind] = "-Dlogind=true,-Dlogind=false"
 PACKAGECONFIG[lz4] = "-Dlz4=true,-Dlz4=false,lz4"
@@ -215,11 +218,6 @@ rootprefix ?= "${root_prefix}"
 rootlibdir ?= "${base_libdir}"
 rootlibexecdir = "${rootprefix}/lib"
 
-# This links udev statically with systemd helper library.
-# Otherwise udev package would depend on systemd package (which has the needed 
shared library),
-# and always pull it into images.
-EXTRA_OEMESON += "-Dlink-udev-shared=false"
-
 EXTRA_OEMESON += "-Dnobody-user=nobody \
   -Dnobody-group=nobody \
   -Drootlibdir=${rootlibdir} \
-- 
2.30.2


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



[OE-core] [PATCH v2 1/3] cve-check: create directory of CVE_CHECK_MANIFEST before copy

2022-02-01 Thread Stefan Herbrechtsmeier
From: Stefan Herbrechtsmeier 

Create directory of the CVE_CHECK_MANIFEST variable before copy to it,
so that the variable can use an arbitrary directory name.

Signed-off-by: Stefan Herbrechtsmeier 

---

Changes in v2:
- Reword commit

 meta/classes/cve-check.bbclass | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/classes/cve-check.bbclass b/meta/classes/cve-check.bbclass
index 70d1988a70..a4d735c323 100644
--- a/meta/classes/cve-check.bbclass
+++ b/meta/classes/cve-check.bbclass
@@ -143,6 +143,7 @@ python cve_check_write_rootfs_manifest () {
 manifest_name = d.getVar("CVE_CHECK_MANIFEST")
 cve_tmp_file = d.getVar("CVE_CHECK_TMP_FILE")
 
+bb.utils.mkdirhier(os.path.dirname(manifest_name))
 shutil.copyfile(cve_tmp_file, manifest_name)
 
 if manifest_name and os.path.exists(manifest_name):
-- 
2.30.2


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



[OE-core] [PATCH v2 3/3] systemd: Minimize udev package size if DISTRO_FEATURES contains systemd

2022-02-01 Thread Stefan Herbrechtsmeier
From: Stefan Herbrechtsmeier 

Link udev shared with systemd helper to minimize the udev package size
if DISTRO_FEATURES contains systemd.

It is only usefull to link udev static with systemd helper if udev
should be installed without systemd.

Signed-off-by: Stefan Herbrechtsmeier 

---

(no changes since v1)

 meta/recipes-core/systemd/systemd_249.7.bb | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/recipes-core/systemd/systemd_249.7.bb 
b/meta/recipes-core/systemd/systemd_249.7.bb
index 739f3aae86..431781e6c7 100644
--- a/meta/recipes-core/systemd/systemd_249.7.bb
+++ b/meta/recipes-core/systemd/systemd_249.7.bb
@@ -66,6 +66,7 @@ PACKAGECONFIG ??= " \
 ${@bb.utils.filter('DISTRO_FEATURES', 'acl audit efi ldconfig pam selinux 
smack usrmerge polkit seccomp', d)} \
 ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'rfkill', '', d)} \
 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xkbcommon', '', d)} \
+${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'link-udev-shared', '', 
d)} \
 backlight \
 binfmt \
 gshadow \
-- 
2.30.2


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#161182): 
https://lists.openembedded.org/g/openembedded-core/message/161182
Mute This Topic: https://lists.openembedded.org/mt/88853822/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] [RFC PATCH 2/2] weston: upgrade 9.0.0 -> 10.0.0

2022-02-01 Thread Denys Dmytriyenko
On Tue, Feb 01, 2022 at 12:15:01PM -0500, Denys Dmytriyenko wrote:
> On Tue, Feb 01, 2022 at 02:30:54PM +0100, Alexander Kanavin wrote:
> Just to make it clear to everyone else on the list - this is not the final 
> 10.0.0 release, but rather an RC1 that is versioned as 9.0.93, hence the RFC 
> status of the patch, just for review.

BTW, the final 10.0.0 just got released earlier today:
https://lists.freedesktop.org/archives/wayland-devel/2022-February/042103.html

Alex,

Would it be possible to includue the link above with the full Changelog in the 
commit message? Thanks.

-- 
Denys

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#161171): 
https://lists.openembedded.org/g/openembedded-core/message/161171
Mute This Topic: https://lists.openembedded.org/mt/88831953/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] package.bbclass: Split out package_debug_vars from split_and_strip_files

2022-02-01 Thread Peter Kjellerstedt
The split_and_strip_files() function is big and hard to follow. This
takes a small step to improve that by splitting out the part that sets
up the variables used to implement the various debug splitting methods
specified by PACKAGE_DEBUG_SPLIT_STYLE.

Signed-off-by: Peter Kjellerstedt 
---
 meta/classes/package.bbclass | 29 ++---
 1 file changed, 18 insertions(+), 11 deletions(-)

diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 4927fb99ff..545471468c 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1065,17 +1065,7 @@ python fixup_perms () {
 fix_perms(each_file, fs_perms_table[dir].fmode, 
fs_perms_table[dir].fuid, fs_perms_table[dir].fgid, dir)
 }
 
-python split_and_strip_files () {
-import stat, errno
-import subprocess
-
-dvar = d.getVar('PKGD')
-pn = d.getVar('PN')
-hostos = d.getVar('HOST_OS')
-
-oldcwd = os.getcwd()
-os.chdir(dvar)
-
+def package_debug_vars(d):
 # We default to '.debug' style
 if d.getVar('PACKAGE_DEBUG_SPLIT_STYLE') == 'debug-file-directory':
 # Single debug-file-directory style debug info
@@ -1113,6 +1103,23 @@ python split_and_strip_files () {
 debugstaticlibdir = ""
 debugsrcdir = "/usr/src/debug"
 
+return (debugappend, debugstaticappend, debugdir, debugstaticdir,
+debuglibdir, debugstaticlibdir, debugsrcdir)
+
+python split_and_strip_files () {
+import stat, errno
+import subprocess
+
+dvar = d.getVar('PKGD')
+pn = d.getVar('PN')
+hostos = d.getVar('HOST_OS')
+
+oldcwd = os.getcwd()
+os.chdir(dvar)
+
+debugappend, debugstaticappend, debugdir, debugstaticdir, \
+debuglibdir, debugstaticlibdir, debugsrcdir = package_debug_vars(d)
+
 #
 # First lets figure out all of the files we may have to process ... do 
this only once!
 #

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#161172): 
https://lists.openembedded.org/g/openembedded-core/message/161172
Mute This Topic: https://lists.openembedded.org/mt/88849275/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] package.bbclass: Make package_debug_vars() return a dict

2022-02-01 Thread Peter Kjellerstedt
It simplifies the API to return one dict instead of seven strings.

Signed-off-by: Peter Kjellerstedt 
---
 meta/classes/package.bbclass | 96 +++-
 1 file changed, 51 insertions(+), 45 deletions(-)

diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 545471468c..9e895b4ecc 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1069,42 +1069,49 @@ def package_debug_vars(d):
 # We default to '.debug' style
 if d.getVar('PACKAGE_DEBUG_SPLIT_STYLE') == 'debug-file-directory':
 # Single debug-file-directory style debug info
-debugappend = ".debug"
-debugstaticappend = ""
-debugdir = ""
-debugstaticdir = ""
-debuglibdir = "/usr/lib/debug"
-debugstaticlibdir = "/usr/lib/debug-static"
-debugsrcdir = "/usr/src/debug"
+debug_vars = {
+"append": ".debug",
+"staticappend": "",
+"dir": "",
+"staticdir": "",
+"libdir": "/usr/lib/debug",
+"staticlibdir": "/usr/lib/debug-static",
+"srcdir": "/usr/src/debug",
+}
 elif d.getVar('PACKAGE_DEBUG_SPLIT_STYLE') == 'debug-without-src':
 # Original OE-core, a.k.a. ".debug", style debug info, but without 
sources in /usr/src/debug
-debugappend = ""
-debugstaticappend = ""
-debugdir = "/.debug"
-debugstaticdir = "/.debug-static"
-debuglibdir = ""
-debugstaticlibdir = ""
-debugsrcdir = ""
+debug_vars = {
+"append": "",
+"staticappend": "",
+"dir": "/.debug",
+"staticdir": "/.debug-static",
+"libdir": "",
+"staticlibdir": "",
+"srcdir": "",
+}
 elif d.getVar('PACKAGE_DEBUG_SPLIT_STYLE') == 'debug-with-srcpkg':
-debugappend = ""
-debugstaticappend = ""
-debugdir = "/.debug"
-debugstaticdir = "/.debug-static"
-debuglibdir = ""
-debugstaticlibdir = ""
-debugsrcdir = "/usr/src/debug"
+debug_vars = {
+"append": "",
+"staticappend": "",
+"dir": "/.debug",
+"staticdir": "/.debug-static",
+"libdir": "",
+"staticlibdir": "",
+"srcdir": "/usr/src/debug",
+}
 else:
 # Original OE-core, a.k.a. ".debug", style debug info
-debugappend = ""
-debugstaticappend = ""
-debugdir = "/.debug"
-debugstaticdir = "/.debug-static"
-debuglibdir = ""
-debugstaticlibdir = ""
-debugsrcdir = "/usr/src/debug"
+debug_vars = {
+"append": "",
+"staticappend": "",
+"dir": "/.debug",
+"staticdir": "/.debug-static",
+"libdir": "",
+"staticlibdir": "",
+"srcdir": "/usr/src/debug",
+}
 
-return (debugappend, debugstaticappend, debugdir, debugstaticdir,
-debuglibdir, debugstaticlibdir, debugsrcdir)
+return debug_vars
 
 python split_and_strip_files () {
 import stat, errno
@@ -1117,8 +1124,7 @@ python split_and_strip_files () {
 oldcwd = os.getcwd()
 os.chdir(dvar)
 
-debugappend, debugstaticappend, debugdir, debugstaticdir, \
-debuglibdir, debugstaticlibdir, debugsrcdir = package_debug_vars(d)
+dv = package_debug_vars(d)
 
 #
 # First lets figure out all of the files we may have to process ... do 
this only once!
@@ -1139,9 +1145,9 @@ python split_and_strip_files () {
 file = os.path.join(root, f)
 
 # Skip debug files
-if debugappend and file.endswith(debugappend):
+if dv["append"] and file.endswith(dv["append"]):
 continue
-if debugdir and debugdir in os.path.dirname(file[len(dvar):]):
+if dv["dir"] and dv["dir"] in 
os.path.dirname(file[len(dvar):]):
 continue
 
 if file in skipfiles:
@@ -1238,11 +1244,11 @@ python split_and_strip_files () {
 # First lets process debug splitting
 #
 if (d.getVar('INHIBIT_PACKAGE_DEBUG_SPLIT') != '1'):
-results = oe.utils.multiprocess_launch(splitdebuginfo, list(elffiles), 
d, extraargs=(dvar, debugdir, debuglibdir, debugappend, debugsrcdir, d))
+results = oe.utils.multiprocess_launch(splitdebuginfo, list(elffiles), 
d, extraargs=(dvar, dv["dir"], dv["libdir"], dv["append"], dv["srcdir"], d))
 
-if debugsrcdir and not hostos.startswith("mingw"):
+if dv["srcdir"] and not hostos.startswith("mingw"):
 if (d.getVar('PACKAGE_DEBUG_STATIC_SPLIT') == '1'):
-results = oe.utils.multiprocess_launch(splitstaticdebuginfo, 
staticlibs, d, extraargs=(dvar, debugstaticdir, debugstaticlibdir, 
debugstaticappend, debugsrcdir, d))
+results = 

[OE-core] [PATCH 0/3] Split split_and_strip_files()

2022-02-01 Thread Peter Kjellerstedt
This is my third attempt to make it possible for me to hook into the
split_and_strip_files() function. We need this to be able to rename
the debug files for some packages to avoid conflicts when installing
them.

In this version, the first patch splits out the part of
split_and_strip_files() that is responsible for setting up the
variables used to implement the various debug splitting methods
specified by PACKAGE_DEBUG_SPLIT_STYLE into a new function,
package_debug_vars(). This I believe to be a good thing in itself as
that function is way too long anyway.

The second and third patch are not needed to allow me to hook into the
split_and_strip_files() function, but they simplify the APIs used for
passing the variables returned by package_debug_vars() around.

With these patches in place, I can now wrap the package_debug_vars()
function with the following local wrapper package.bbclass:

require ${COREBASE}/meta/classes/package.bbclass

PACKAGE_DEBUG_FILE_SUFFIX ??= ""

# Provide the original package_debug_vars() as org_package_debug_vars().
org_package_debug_vars := "${@d.getVar('package_debug_vars', 
False).replace('package_debug_vars', 'org_package_debug_vars')}"
python () {
bb.methodpool.insert_method("", d.getVar("org_package_debug_vars", False), 
"", 0)
}

# This version of package_debug_vars() wraps the original package_debug_vars()
# by calling org_package_debug_vars() and then appends PACKAGE_DEBUG_FILE_SUFFIX
# to dv["append"] and dv["staticappend"].
def package_debug_vars(d):
dv = org_package_debug_vars(d)

dv["append"] += d.getVar('PACKAGE_DEBUG_FILE_SUFFIX')
dv["staticappend"] += d.getVar('PACKAGE_DEBUG_FILE_SUFFIX')

return dv

The definition of the org_package_debug_vars() function is not very
pretty, but it seems to work, and this solution means a heck of a lot
less maintenance than to try to maintain a backported version of the
over 250 lines long split_and_strip_files() function (as it was before
my changes).

//Peter

The following changes since commit 74a8a74a553a33dc5f41939f8070d75e6d57d3da:

  busybox: Add shell arithmetic to work with poky-tiny (2022-02-01 07:32:08 
+)

are available in the Git repository at:

  git://git.yoctoproject.org/poky-contrib pkj/package_debug_vars
  
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=pkj/package_debug_vars

Peter Kjellerstedt (3):
  package.bbclass: Split out package_debug_vars from
split_and_strip_files
  package.bbclass: Make package_debug_vars() return a dict
  package.bbclass: Pass dv (debug_vars) around instead of individual
vars

 meta/classes/package.bbclass | 127 +++
 1 file changed, 70 insertions(+), 57 deletions(-)


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#161174): 
https://lists.openembedded.org/g/openembedded-core/message/161174
Mute This Topic: https://lists.openembedded.org/mt/88849297/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] package.bbclass: Pass dv (debug_vars) around instead of individual vars

2022-02-01 Thread Peter Kjellerstedt
This simplifies the APIs for splitdebuginfo(), splitstaticdebuginfo()
and inject_minidebuginfo()

Signed-off-by: Peter Kjellerstedt 
---
 meta/classes/package.bbclass | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 9e895b4ecc..f4a661ba25 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -367,7 +367,7 @@ def source_info(file, d, fatal=True):
 
 return list(debugsources)
 
-def splitdebuginfo(file, dvar, debugdir, debuglibdir, debugappend, 
debugsrcdir, d):
+def splitdebuginfo(file, dvar, dv, d):
 # Function to split a single file into two components, one is the stripped
 # target system binary, the other contains any debugging information. The
 # two files are linked to reference each other.
@@ -378,7 +378,7 @@ def splitdebuginfo(file, dvar, debugdir, debuglibdir, 
debugappend, debugsrcdir,
 import subprocess
 
 src = file[len(dvar):]
-dest = debuglibdir + os.path.dirname(src) + debugdir + "/" + 
os.path.basename(src) + debugappend
+dest = dv["libdir"] + os.path.dirname(src) + dv["dir"] + "/" + 
os.path.basename(src) + dv["append"]
 debugfile = dvar + dest
 sources = []
 
@@ -397,7 +397,7 @@ def splitdebuginfo(file, dvar, debugdir, debuglibdir, 
debugappend, debugsrcdir,
 os.chmod(file, newmode)
 
 # We need to extract the debug src information here...
-if debugsrcdir:
+if dv["srcdir"]:
 sources = source_info(file, d)
 
 bb.utils.mkdirhier(os.path.dirname(debugfile))
@@ -412,7 +412,7 @@ def splitdebuginfo(file, dvar, debugdir, debuglibdir, 
debugappend, debugsrcdir,
 
 return (file, sources)
 
-def splitstaticdebuginfo(file, dvar, debugstaticdir, debugstaticlibdir, 
debugstaticappend, debugsrcdir, d):
+def splitstaticdebuginfo(file, dvar, dv, d):
 # Unlike the function above, there is no way to split a static library
 # two components.  So to get similar results we will copy the unmodified
 # static library (containing the debug symbols) into a new directory.
@@ -425,7 +425,7 @@ def splitstaticdebuginfo(file, dvar, debugstaticdir, 
debugstaticlibdir, debugsta
 import shutil
 
 src = file[len(dvar):]
-dest = debugstaticlibdir + os.path.dirname(src) + debugstaticdir + "/" + 
os.path.basename(src) + debugstaticappend
+dest = dv["staticlibdir"] + os.path.dirname(src) + dv["staticdir"] + "/" + 
os.path.basename(src) + dv["staticappend"]
 debugfile = dvar + dest
 sources = []
 
@@ -442,7 +442,7 @@ def splitstaticdebuginfo(file, dvar, debugstaticdir, 
debugstaticlibdir, debugsta
 os.chmod(file, newmode)
 
 # We need to extract the debug src information here...
-if debugsrcdir:
+if dv["srcdir"]:
 sources = source_info(file, d)
 
 bb.utils.mkdirhier(os.path.dirname(debugfile))
@@ -455,7 +455,7 @@ def splitstaticdebuginfo(file, dvar, debugstaticdir, 
debugstaticlibdir, debugsta
 
 return (file, sources)
 
-def inject_minidebuginfo(file, dvar, debugdir, debuglibdir, debugappend, 
debugsrcdir, d):
+def inject_minidebuginfo(file, dvar, dv, d):
 # Extract just the symbols from debuginfo into minidebuginfo,
 # compress it with xz and inject it back into the binary in a 
.gnu_debugdata section.
 # https://sourceware.org/gdb/onlinedocs/gdb/MiniDebugInfo.html
@@ -469,7 +469,7 @@ def inject_minidebuginfo(file, dvar, debugdir, debuglibdir, 
debugappend, debugsr
 minidebuginfodir = d.expand('${WORKDIR}/minidebuginfo')
 
 src = file[len(dvar):]
-dest = debuglibdir + os.path.dirname(src) + debugdir + "/" + 
os.path.basename(src) + debugappend
+dest = dv["libdir"] + os.path.dirname(src) + dv["dir"] + "/" + 
os.path.basename(src) + dv["append"]
 debugfile = dvar + dest
 minidebugfile = minidebuginfodir + src + '.minidebug'
 bb.utils.mkdirhier(os.path.dirname(minidebugfile))
@@ -1244,11 +1244,11 @@ python split_and_strip_files () {
 # First lets process debug splitting
 #
 if (d.getVar('INHIBIT_PACKAGE_DEBUG_SPLIT') != '1'):
-results = oe.utils.multiprocess_launch(splitdebuginfo, list(elffiles), 
d, extraargs=(dvar, dv["dir"], dv["libdir"], dv["append"], dv["srcdir"], d))
+results = oe.utils.multiprocess_launch(splitdebuginfo, list(elffiles), 
d, extraargs=(dvar, dv, d))
 
 if dv["srcdir"] and not hostos.startswith("mingw"):
 if (d.getVar('PACKAGE_DEBUG_STATIC_SPLIT') == '1'):
-results = oe.utils.multiprocess_launch(splitstaticdebuginfo, 
staticlibs, d, extraargs=(dvar, dv["staticdir"], dv["staticlibdir"], 
dv["staticappend"], dv["srcdir"], d))
+results = oe.utils.multiprocess_launch(splitstaticdebuginfo, 
staticlibs, d, extraargs=(dvar, dv, d))
 else:
 for file in staticlibs:
 results.append( (file,source_info(file, d)) )
@@ -1329,7 +1329,7 @@ python split_and_strip_files () {
 

Re: [OE-core] [PATCH] create-spdx: Get SPDX-License-Identifier from source

2022-02-01 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core@lists.openembedded.org 
>  On Behalf Of Saul Wold
> Sent: den 2 februari 2022 01:02
> To: openembedded-core@lists.openembedded.org; jpewhac...@gmail.com
> Cc: Saul Wold 
> Subject: [OE-core] [PATCH] create-spdx: Get SPDX-License-Identifier from 
> source
> 
> This patch will read the begining of source files and try to find
> the SPDX-License-Identifier to populate the licenseInfoInFiles
> field for each source file. This does not populate licenseConculed

I assume that should be "licenseConcluded".

> at this time, nor rolls it up to package level.
> 
> We read as binary to since some source code seem to have some

to -> too

> binary characters, the license is then converted to ascii strings.
> 
> Signed-off-by: Saul Wold 
> ---
> Merge after Joshua's patch (spdx: Add set helper for list properties)
> merges
> 
>  meta/classes/create-spdx.bbclass | 23 +++
>  1 file changed, 23 insertions(+)
> 
> diff --git a/meta/classes/create-spdx.bbclass 
> b/meta/classes/create-spdx.bbclass
> index 8b4203fdb5d..588489cc2b0 100644
> --- a/meta/classes/create-spdx.bbclass
> +++ b/meta/classes/create-spdx.bbclass
> @@ -37,6 +37,24 @@ SPDX_SUPPLIER[doc] = "The SPDX PackageSupplier field for 
> SPDX packages created f
> 
>  do_image_complete[depends] = "virtual/kernel:do_create_spdx"
> 
> +def extract_licenses(filename):
> +import re
> +import oe.spdx

You do not use oe.spdx in this function.

> +
> +lic_regex = re.compile(b'SPDX-License-Identifier:\s+([-A-Za-z\d. ]+)[ 
> |\n|\r\n]*?')

I assume you meant:

lic_regex = re.compile(b'SPDX-License-Identifier:\s+([-A-Za-z\d. ]+)(?: 
|\n|\r\n)*?')

Not that it really matters though, as it will yield the same result as:

lic_regex = re.compile(b'SPDX-License-Identifier:\s+([-A-Za-z\d. ]+)')

However, neither of the expressions above will correctly match all the 
SPDX-License-Identifier examples at https://spdx.dev/ids/#how.

Use this instead:

lic_regex = re.compile(b'^\W*SPDX-License-Identifier:\s*([ 
\w\d.()+-]+?)(?:\s+\W*)?$', re.MULTILINE)

> +
> +try:
> +with open(filename, 'rb') as f:
> +size = min(15000, os.stat(filename).st_size)
> +txt = f.read(size)
> +licenses = re.findall(lic_regex, txt)
> +if licenses:
> +ascii_licenses = [lic.decode('ascii') for lic in licenses]
> +return ascii_licenses
> +except Exception as e:
> +bb.warn(f"Exception reading {filename}: {e}")
> +return None
> +
>  def get_doc_namespace(d, doc):
>  import uuid
>  namespace_uuid = uuid.uuid5(uuid.NAMESPACE_DNS, 
> d.getVar("SPDX_UUID_NAMESPACE"))
> @@ -232,6 +250,11 @@ def add_package_files(d, doc, spdx_pkg, topdir, 
> get_spdxid, get_types, *, archiv
>  checksumValue=bb.utils.sha256_file(filepath),
>  ))
> 
> +if "SOURCE" in spdx_file.fileTypes:
> +extracted_lics = extract_licenses(filepath)
> +if extracted_lics:
> +spdx_file.licenseInfoInFiles = extracted_lics
> +
>  doc.files.append(spdx_file)
>  doc.add_relationship(spdx_pkg, "CONTAINS", spdx_file)
>  spdx_pkg.hasFiles.append(spdx_file.SPDXID)
> --
> 2.31.1

//Peter


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#161176): 
https://lists.openembedded.org/g/openembedded-core/message/161176
Mute This Topic: https://lists.openembedded.org/mt/88847186/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] initramfs-framework: Add overlayroot module

2022-02-01 Thread Alejandro Hernandez Samaniego

Hey Vyacheslav,

Yes, in this case it is different and its specifically required if we 
want to overlay the entire rootfs, also like it says in the commit 
message and in the comments giving credit to the overlay-etc class I 
definitely tried extending the overlay-etc class but it simply does not 
work for this, since the rootfs becomes inaccessible once the system has 
booted, hence why this has to be done inside initramfs, this isn't meant 
to replace the overlay-etc class in any way, just to provide an 
alternative if it fits the user needs better.


Also, my apologies, your reply to my v1 somehow slipped through my 
filter and I hadn't seen it.


I think they are simply two different scenarios, I can see the potential 
the overlay-etc class has to be extended for other directories for 
example, but it is a different use case and boot flow so I believe both 
can co-exist for different workflows depending on the user needs.


Cheers,

Alejandro

On 1/31/22 20:36, Vyacheslav Yurkov wrote:

Hi Alejandro,
Thanks for the v2, but my questions from v1 are still left unanswered.

1. Do you really need the whole rootfs to be in overlay? Perhaps you 
have another use case in mind, but the more scope overlay has, the 
more migration effort you need in order to update upper layer on image 
upgrade.
2. I was thinking if perhaps that would be better to extend 
files/overlayfs-etc-preinit.sh.in to suit your needs and re-use common 
parts rather then having a good part of it copied to initramfs-framework?


Cheers,
Vyacheslav

On 29.01.2022 20:48, Alejandro Hernandez Samaniego wrote:

When installed, this module mounts a read-write (RW) overlay on
top of a root filesystem, which is kept read-only (RO), free
from modifications by the user, this might prove to be useful
if we want to access or restore the original unmodified rootfs.

The existing overlay-etc.bbclass does something similar, it
mounts an overlay on top of the /etc directory, however doing
the same for root causes the original root to be inaccessible
once the system is booted, hence why this module is added to
the initramfs boot flow, allowing us to mount the RW overlay,
while keeping the original rootfs mounted at /rofs once the
system finishes booting. This script is loosely based on that
class.

This module requires rootrw= to be passed as a kernel
parameter to specify the device/partition to be used as RW by the
overlay and has a dependency on overlayfs support being present
in the running kernel.

It does not require the read-only IMAGE_FEATURE to be enabled.

The module needs to be executed after the initramfs-module-rootfs
since it relies on it to mount the filesystem at initramfs startup
but before the finish module which normally switches root.
After overlayroot is executed the usual boot flow continues from
the real init process.

If something goes wrong while running this module, the rootfs
is still mounted RO (with no overlay) and the finish module is
executed to continue booting normally.

Its worth noting that, on purpose, this isnt installed by default
on any images that use initramfs-framework to keep the boot flow
unmodified, only when a user manually requests to install it,
then it becomes functional.

Signed-off-by: Alejandro Enedino Hernandez Samaniego 


---
  .../initramfs-framework/overlayroot   | 112 ++
  .../initrdscripts/initramfs-framework_1.0.bb  |   9 ++
  2 files changed, 121 insertions(+)
  create mode 100644 
meta/recipes-core/initrdscripts/initramfs-framework/overlayroot


diff --git 
a/meta/recipes-core/initrdscripts/initramfs-framework/overlayroot 
b/meta/recipes-core/initrdscripts/initramfs-framework/overlayroot

new file mode 100644
index 00..d40342dc59
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/initramfs-framework/overlayroot
@@ -0,0 +1,112 @@
+#!/bin/sh
+
+# SPDX-License-Identifier: MIT
+#
+# Copyright 2022 (C), Microsoft Corporation
+
+# Simple initramfs module intended to mount a read-write (RW)
+# overlayfs on top of /, keeping the original root filesystem
+# as read-only (RO), free from modifications by the user.
+#
+# NOTE: The read-only IMAGE_FEATURE is not required for this to work
+#
+# This script is based on the overlay-etc.bbclass, which sets up
+# an overlay on top of the /etc directory, but in this case allows
+# accessing the original, unmodified rootfs at /rofs after boot.
+#
+# It relies on the initramfs-module-rootfs to mount the original
+# root filesystem, and requires 'rootrw=' to be passed as a
+# kernel parameter, specifying the device/partition intended to
+# use as RW.
+#
+# This module needs to be executed after the initramfs-module-rootfs
+# since it relies on it to mount the filesystem at initramfs startup
+# but before the finish module which normally switches root.
+# After overlayroot is executed the usual boot flow continues from
+# the real init process.
+#
+# If something goes wrong while running this module, the rootfs
+# is still mounted RO 

Re: [OE-core] [PATCH] Revert "featimage: refactor style"

2022-02-01 Thread Andrej Valek
Marek,

Sorry, but these are still not an arguments, why to do that.

On Mon, 2022-01-31 at 10:39 +0100, Marek Vasut wrote:
> On 1/31/22 08:01, Valek, Andrej wrote:
> > Hi,
> 
> Hello Andrej,
> 
> (please avoid top-posting)
> 
> > Sorry, but personally I don't like your idea. What's the benefit of
> > reverting this? I would keep the ${} for bitbake and $ for shell. The
> > {} has to be placed only for variables like $a${b}c.
> 
> That's exactly the benefit of using ${} in shell scripts consistently -
> - 
> you don't have to worry about variable names being accidentally 
> conflated with surrounding strings, either due to your own mistake, or 
> some automated transformation that was applied incorrectly .
> 
> > We should respect the workflow on all recipes otherwise we're braking
> > the "unwritten" rules.
> 
> The workflow on all recipes ? What does this mean ?
> 
> broken by people. Better update the documentation.
> 
> There is one technical counter-argument to this revert from Peter,
> quote:
> "
> There is actually a technical reason to not use ${foo} for shell
> variables unless necessary in bitbake files and it is because
> bitbake will treat them all as potential bitbake variables. This
> means they are unnecessarily included in the taskhashes that
> bitbake calculates.
> "
> 
> But the patch being reverted here addresses the problem only partly, 
> because it still contains remnants like this:
> "
> conf_desc="$conf_desc${sep}setup"
> "
Just for your information, this is not remnants, this is exactly the
right {} usage. If you didn't place the {}, it will be
conf_desc="$conf_desc$sepsetup", which doesn't  make any sense.
> 
> [...]
> 
> > > > > third alternative ? I mean, besides rewriting the fitimage
> > > > > generation into python, which might make it more flexible too.
> > > > 
> > > > Replacing shell code that has grown beyond a couple of hundred
> > > > (tens?) lines with something written in a better language is
> > > > almost always a good idea.
> > > 
> > > It's grown to almost 800 LoC, so maybe it is time to reevaluate the
> > > python conversion then.
> 
> So a rewrite into something more suitable might be a good idea ^ , 
> probably python in this case.

But anyway, if you want to do that, then do not forget for other kernel
classes, where the same commits have been applied by someone else.

So from my point of view, it has to stay like it is.

Cheers,
Andrej


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#161178): 
https://lists.openembedded.org/g/openembedded-core/message/161178
Mute This Topic: https://lists.openembedded.org/mt/88758521/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] [RFC PATCH 2/2] weston: upgrade 9.0.0 -> 10.0.0

2022-02-01 Thread Ross Burton
On Tue, 1 Feb 2022 at 13:31, Alexander Kanavin  wrote:
> weston-launch can be replaced by starting weston directly, with
> a seat management daemon for support. This is provided either
> by systemd, or on systemd-less systems, by seatd. The sysvinit
> startup scripts and tests have been rewritten accordingly. Bonus
> fix: under sysvinit weston now starts under weston user as it should,
> and not under root.

Awesome, thanks!

Ross

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#161164): 
https://lists.openembedded.org/g/openembedded-core/message/161164
Mute This Topic: https://lists.openembedded.org/mt/88831953/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] [RFC PATCH 2/2] weston: upgrade 9.0.0 -> 10.0.0

2022-02-01 Thread Alexander Kanavin
On Tue, 1 Feb 2022 at 18:25, Daniel Stone 
wrote:

> Most systems use Weston's logind backend with systemd integration;
> OE/Yocto was the last system I know of using the old weston-launch
> wrapper.
>

weston-launch was used in yocto only for sysvinit based images; systemd
images have used direct rootless weston unit like everyone else for a while
now. So it's reasonably well tested here too.

Alex

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#161165): 
https://lists.openembedded.org/g/openembedded-core/message/161165
Mute This Topic: https://lists.openembedded.org/mt/88831953/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] systemd: Minimize udev package size if DISTRO_FEATURES contains systemd

2022-02-01 Thread Stefan Herbrechtsmeier
From: Stefan Herbrechtsmeier 

Link udev shared with systemd helper to minimize the udev package size
if DISTRO_FEATURES contains systemd.

It is only usefull to link udev static with systemd helper if udev
should be installed without systemd.

Signed-off-by: Stefan Herbrechtsmeier 

---

 meta/recipes-core/systemd/systemd_249.7.bb | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/recipes-core/systemd/systemd_249.7.bb 
b/meta/recipes-core/systemd/systemd_249.7.bb
index 739f3aae86..431781e6c7 100644
--- a/meta/recipes-core/systemd/systemd_249.7.bb
+++ b/meta/recipes-core/systemd/systemd_249.7.bb
@@ -66,6 +66,7 @@ PACKAGECONFIG ??= " \
 ${@bb.utils.filter('DISTRO_FEATURES', 'acl audit efi ldconfig pam selinux 
smack usrmerge polkit seccomp', d)} \
 ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'rfkill', '', d)} \
 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xkbcommon', '', d)} \
+${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'link-udev-shared', '', 
d)} \
 backlight \
 binfmt \
 gshadow \
-- 
2.30.2


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#161161): 
https://lists.openembedded.org/g/openembedded-core/message/161161
Mute This Topic: https://lists.openembedded.org/mt/88836333/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] cve-check: create directory before copy

2022-02-01 Thread Stefan Herbrechtsmeier
From: Stefan Herbrechtsmeier 

Signed-off-by: Stefan Herbrechtsmeier 
---

 meta/classes/cve-check.bbclass | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/classes/cve-check.bbclass b/meta/classes/cve-check.bbclass
index 70d1988a70..a4d735c323 100644
--- a/meta/classes/cve-check.bbclass
+++ b/meta/classes/cve-check.bbclass
@@ -143,6 +143,7 @@ python cve_check_write_rootfs_manifest () {
 manifest_name = d.getVar("CVE_CHECK_MANIFEST")
 cve_tmp_file = d.getVar("CVE_CHECK_TMP_FILE")
 
+bb.utils.mkdirhier(os.path.dirname(manifest_name))
 shutil.copyfile(cve_tmp_file, manifest_name)
 
 if manifest_name and os.path.exists(manifest_name):
-- 
2.30.2


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#161159): 
https://lists.openembedded.org/g/openembedded-core/message/161159
Mute This Topic: https://lists.openembedded.org/mt/88836328/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] systemd: Add link-udev-shared PACKAGECONFIG

2022-02-01 Thread Stefan Herbrechtsmeier
From: Stefan Herbrechtsmeier 

Add a PACKAGECONFIG to link systemd-udev and its helpers to
libsystemd-shared.so. If enabled the udev package depends on the systemd
package.

Signed-off-by: Stefan Herbrechtsmeier 
---

 meta/recipes-core/systemd/systemd_249.7.bb | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/meta/recipes-core/systemd/systemd_249.7.bb 
b/meta/recipes-core/systemd/systemd_249.7.bb
index 53e7f6738d..739f3aae86 100644
--- a/meta/recipes-core/systemd/systemd_249.7.bb
+++ b/meta/recipes-core/systemd/systemd_249.7.bb
@@ -156,6 +156,9 @@ PACKAGECONFIG[kmod] = "-Dkmod=true,-Dkmod=false,kmod"
 PACKAGECONFIG[ldconfig] = "-Dldconfig=true,-Dldconfig=false,,ldconfig"
 PACKAGECONFIG[libidn] = "-Dlibidn=true,-Dlibidn=false,libidn,,libidn"
 PACKAGECONFIG[libidn2] = "-Dlibidn2=true,-Dlibidn2=false,libidn2,,libidn2"
+# Link udev shared with systemd helper library.
+# If enabled the udev package depends on the systemd package (which has the 
needed shared library).
+PACKAGECONFIG[link-udev-shared] = 
"-Dlink-udev-shared=true,-Dlink-udev-shared=false"
 PACKAGECONFIG[localed] = "-Dlocaled=true,-Dlocaled=false"
 PACKAGECONFIG[logind] = "-Dlogind=true,-Dlogind=false"
 PACKAGECONFIG[lz4] = "-Dlz4=true,-Dlz4=false,lz4"
@@ -215,11 +218,6 @@ rootprefix ?= "${root_prefix}"
 rootlibdir ?= "${base_libdir}"
 rootlibexecdir = "${rootprefix}/lib"
 
-# This links udev statically with systemd helper library.
-# Otherwise udev package would depend on systemd package (which has the needed 
shared library),
-# and always pull it into images.
-EXTRA_OEMESON += "-Dlink-udev-shared=false"
-
 EXTRA_OEMESON += "-Dnobody-user=nobody \
   -Dnobody-group=nobody \
   -Drootlibdir=${rootlibdir} \
-- 
2.30.2


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



[OE-core] Yocto Project Status WW05`22

2022-02-01 Thread Stephen Jolley
Current Dev Position: YP 3.5 M3

Next Deadline: 21th Feb. 2022 YP 3.5 M3 build

 

Next Team Meetings:

*   Bug Triage meeting Thursday Feb. 3rd 7:30 am PDT (

https://zoom.us/j/454367603?pwd=ZGxoa2ZXL3FkM3Y0bFd5aVpHVVZ6dz09)
*   Monthly Project Meeting Tuesday Feb. 1st at 8 am PDT (

https://zoom.us/j/990892712?pwd=cHU1MjhoM2x6ck81bkcrYjRrcmJsUT09
 )
*   Weekly Engineering Sync Tuesday Feb. 8th at 8 am PDT (

https://zoom.us/j/990892712?pwd=cHU1MjhoM2x6ck81bkcrYjRrcmJsUT09
 )
*   Twitch -  See https://www.twitch.tv/theyoctojester

 

Key Status/Updates:

*   YP 3.5 M2 has passed QA with one bug highlighted (14708). Due to
vacations in Asia the release, if approved, will be made next week.
*   YP 3.1.14 is ready for QA but the release will also be delayed until
next week.
*   A new Patchwork is available at
 https://patchwork.yoctoproject.org/.
This new system is running the up to date mainline code and will receive
regular updates. The previous unmaintained fork remains up at
 https://patchwork.openembedded.org/ to
preserve history. We are seeking help updating PatchTest to run with the new
version.

Everyone can now sign up for an account on the new system. Patchwork project
maintainers please email  
mhalst...@linuxfoundation.org to have your access restored.

*   Upstream glibc are now planning to remove prelink support in 2.36. I
think we will still want to remove prelink from OE-Core before our next
release though, particularly as it is an LTS.
*   An
 email
proposing inclusive language changes for bitbake and OE-Core has been sent
to the community for review. The aim is to implement this before M3.
*   We are seeing networking issues during image testing on the
centos8/stream8 workers, possibly due to recent changes in the distro. Help
with debugging this welcome.
*   We have also realized there is an issue with hash equivalence where
the current mechanism will not account for different headers inside the
sysroot added through indirect dependencies (e.g. linux-libc-headers via
glibc). This means something like rtcwake in util-linux which uses rtc.h can
have differing debug symbols due to differing line numbers yet otherwise be
identical. There is a potential fix with downsides in master-next.
*
 CVE metrics are still under control for master with
pending patches accounted for (thanks Ross!) but work still remains on the
various stable branches which have high counts.
*   Intermittent issues continue to be at record high levels and help is
very much welcome in trying to resolve them. You can see the list of
failures we're continuing to see by searching for the "AB-INT" tag in
bugzilla:

https://bugzilla.yoctoproject.org/buglist.cgi?quicksearch=AB-INT

In particular, we're struggling to understand the intermittent network issue
with external hosts we're seeing very occasionally.

 

Ways to contribute:

*   There are bugs identified as possible for newcomers to the project:

https://wiki.yoctoproject.org/wiki/Newcomers
*   There are bugs that are currently unassigned for YP 3.5. See:

https://wiki.yoctoproject.org/wiki/Bug_Triage#Medium.2B_3.5_Unassigned_Enhan
cements.2FBugs
*   We'd welcome new maintainers for recipes in OE-Core. Please see the
list at:

http://git.yoctoproject.org/cgit.cgi/poky/tree/meta/conf/distro/include/main
tainers.inc and discuss with the existing maintainer, or ask on the OE-Core
mailing list. We will likely move a chunk of these to "Unassigned" soon to
help facilitate this.

 

YP 3.5 Milestone Dates:

*   YP 3.5 M2 is out of QA
*   YP 3.5 M3 build date 2022/02/21
*   YP 3.5 M3 Release date 2022/03/04
*   YP 3.5 M4 build date 2022/04/04
*   YP 3.5 M4 Release date 2022/04/29

 

Upcoming dot releases:

*   YP 3.1.14 is built
*   YP 3.1.14 Release date 2022/02/04
*   YP 3.4.2 build date 2022/02/07
*   YP 3.4.2 Release date 2022/02/18
*   YP 3.3.5 build date 2022/02/14
*   YP 3.3.5 Release date 2022/02/25
*   YP 3.1.15 build date 2022/03/14
*   YP 3.1.15 Release date 2022/03/25
*   

Re: [OE-core] [PATCH 1/3] cve-check: create directory before copy

2022-02-01 Thread Alexander Kanavin
Can you please describe the issue this is fixing in the commit message? Why
is this not seen by others?

Alex

On Tue, 1 Feb 2022 at 17:17, Stefan Herbrechtsmeier <
stefan.herbrechtsmeier-...@weidmueller.com> wrote:

> From: Stefan Herbrechtsmeier 
>
> Signed-off-by: Stefan Herbrechtsmeier <
> stefan.herbrechtsme...@weidmueller.com>
> ---
>
>  meta/classes/cve-check.bbclass | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/meta/classes/cve-check.bbclass
> b/meta/classes/cve-check.bbclass
> index 70d1988a70..a4d735c323 100644
> --- a/meta/classes/cve-check.bbclass
> +++ b/meta/classes/cve-check.bbclass
> @@ -143,6 +143,7 @@ python cve_check_write_rootfs_manifest () {
>  manifest_name = d.getVar("CVE_CHECK_MANIFEST")
>  cve_tmp_file = d.getVar("CVE_CHECK_TMP_FILE")
>
> +bb.utils.mkdirhier(os.path.dirname(manifest_name))
>  shutil.copyfile(cve_tmp_file, manifest_name)
>
>  if manifest_name and os.path.exists(manifest_name):
> --
> 2.30.2
>
>
> 
>
>

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#161162): 
https://lists.openembedded.org/g/openembedded-core/message/161162
Mute This Topic: https://lists.openembedded.org/mt/88836328/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] [RFC PATCH 2/2] weston: upgrade 9.0.0 -> 10.0.0

2022-02-01 Thread Denys Dmytriyenko
On Tue, Feb 01, 2022 at 02:30:54PM +0100, Alexander Kanavin wrote:
> Upstream has deprecated both weston-launch and fbdev backend, so let's
> not delay the inevitable and find replacements.
> 
> Fbdev can be replaced by passing --use-pixman to drm backend;
> this will bypass the opengl paths and use CPU for rendering.
> Apply where GL is too slow or unavailable.
> 
> weston-launch can be replaced by starting weston directly, with
> a seat management daemon for support. This is provided either
> by systemd, or on systemd-less systems, by seatd. The sysvinit
> startup scripts and tests have been rewritten accordingly. Bonus
> fix: under sysvinit weston now starts under weston user as it should,
> and not under root.

Thanks, Alex, for working on this big upgrade ahead of schedule!

Just to make it clear to everyone else on the list - this is not the final 
10.0.0 release, but rather an RC1 that is versioned as 9.0.93, hence the RFC 
status of the patch, just for review.

And this would definitely require extra testing on different actual platforms, 
as I'm a bit worried about root-less execution...

-- 
Denys


> Upstream discussion:
> https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/725
> 
> Signed-off-by: Alexander Kanavin 
> ---
>  meta/lib/oeqa/runtime/cases/weston.py |   6 +-
>  .../recipes-graphics/wayland/weston-init/init |   2 +-
>  .../wayland/weston-init/weston-start  |  30 +--
>  ...d-drm-Re-order-gbm-destruction-at-DR.patch |  50 -
>  ...001-meson.build-fix-incorrect-header.patch |  32 ---
>  ...ntl.h-for-open-O_RDWR-O_CLOEXEC-and-.patch |  47 -
>  ...ovide-a-default-version-that-doesn-t.patch | 199 --
>  .../weston/dont-use-plane-add-prop.patch  |  13 +-
>  .../{weston_9.0.0.bb => weston_9.0.93.bb} |  50 +++--
>  9 files changed, 52 insertions(+), 377 deletions(-)
>  delete mode 100644 
> meta/recipes-graphics/wayland/weston/0001-libweston-backend-drm-Re-order-gbm-destruction-at-DR.patch
>  delete mode 100644 
> meta/recipes-graphics/wayland/weston/0001-meson.build-fix-incorrect-header.patch
>  delete mode 100644 
> meta/recipes-graphics/wayland/weston/0001-tests-include-fcntl.h-for-open-O_RDWR-O_CLOEXEC-and-.patch
>  delete mode 100644 
> meta/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch
>  rename meta/recipes-graphics/wayland/{weston_9.0.0.bb => weston_9.0.93.bb} 
> (79%)
> 
> diff --git a/meta/lib/oeqa/runtime/cases/weston.py 
> b/meta/lib/oeqa/runtime/cases/weston.py
> index b3a7c2776d..b81cc299ef 100644
> --- a/meta/lib/oeqa/runtime/cases/weston.py
> +++ b/meta/lib/oeqa/runtime/cases/weston.py
> @@ -10,7 +10,7 @@ import threading
>  import time
>  
>  class WestonTest(OERuntimeTestCase):
> -weston_log_file = '/tmp/weston.log'
> +weston_log_file = '/tmp/weston-2.log'
>  
>  @classmethod
>  def tearDownClass(cls):
> @@ -31,13 +31,13 @@ class WestonTest(OERuntimeTestCase):
>  return output.split(" ")
>  
>  def get_weston_command(self, cmd):
> -return 'export XDG_RUNTIME_DIR=/run/user/0; export 
> WAYLAND_DISPLAY=wayland-0; %s' % cmd
> +return 'export XDG_RUNTIME_DIR=/run/user/`id -u weston`; export 
> WAYLAND_DISPLAY=wayland-1; %s' % cmd
>  
>  def run_weston_init(self):
>  if 'systemd' in self.tc.td['VIRTUAL-RUNTIME_init_manager']:
>  self.target.run('systemd-run --collect 
> --unit=weston-ptest.service --uid=0 -p PAMName=login -p TTYPath=/dev/tty6 -E 
> XDG_RUNTIME_DIR=/tmp -E WAYLAND_DISPLAY=wayland-0 /usr/bin/weston 
> --socket=wayland-1 --log=%s' % self.weston_log_file)
>  else:
> -self.target.run(self.get_weston_command('openvt -- weston 
> --socket=wayland-1 --log=%s' % self.weston_log_file))
> +self.target.run(self.get_weston_command('openvt -- weston 
> --socket=wayland-2 --log=%s' % self.weston_log_file))
>  
>  def get_new_wayland_processes(self, existing_wl_processes):
>  try_cnt = 0
> diff --git a/meta/recipes-graphics/wayland/weston-init/init 
> b/meta/recipes-graphics/wayland/weston-init/init
> index a849f29bcb..d3b0d1873e 100644
> --- a/meta/recipes-graphics/wayland/weston-init/init
> +++ b/meta/recipes-graphics/wayland/weston-init/init
> @@ -32,7 +32,7 @@ case "$1" in
>  . /etc/profile
>   export HOME=ROOTHOME
>  
> -weston-start -- $OPTARGS
> +WESTON_USER=weston weston-start $OPTARGS &
>;;
>  
>stop)
> diff --git a/meta/recipes-graphics/wayland/weston-init/weston-start 
> b/meta/recipes-graphics/wayland/weston-init/weston-start
> index 0f1bc4c29d..01670cd4f5 100755
> --- a/meta/recipes-graphics/wayland/weston-init/weston-start
> +++ b/meta/recipes-graphics/wayland/weston-init/weston-start
> @@ -6,7 +6,7 @@ export PATH="/sbin:/usr/sbin:/bin:/usr/bin"
>  
>  usage() {
>   cat < - $0 [] [-- ]
> + $0 []
>  EOF
>  }
>  
> @@ -18,11 +18,6 @@ add_weston_argument() {
>   weston_args="$weston_args $1"
>  }
>  

Re: [OE-core] [PATCH 2/2] packages.bbclass: Break out the debug info styles to bitbake variables

2022-02-01 Thread Richard Purdie
On Mon, 2022-01-31 at 22:39 +0100, Peter Kjellerstedt wrote:
> Break out the hardcoded values for the various debug info styles from
> split_and_strip_files() into bitbake variables. This allows the debug
> info styles to be adopted, and also allows new styles to be added
> (within the limits of the available variables).
> 
> Signed-off-by: Peter Kjellerstedt 
> ---
>  meta/classes/package.bbclass | 95 ++--
>  1 file changed, 58 insertions(+), 37 deletions(-)
> 
> diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
> index 4927fb99ff..a5358d5851 100644
> --- a/meta/classes/package.bbclass
> +++ b/meta/classes/package.bbclass
> @@ -1065,6 +1065,51 @@ python fixup_perms () {
>  fix_perms(each_file, fs_perms_table[dir].fmode, 
> fs_perms_table[dir].fuid, fs_perms_table[dir].fgid, dir)
>  }
>  
> +# Debug info
> +PACKAGE_DEBUG_APPEND = "${@d.getVarFlag('PACKAGE_DEBUG_APPEND', 
> d.getVar('PACKAGE_DEBUG_SPLIT_STYLE'))}"
> +PACKAGE_DEBUG_STATICAPPEND = "${@d.getVarFlag('PACKAGE_DEBUG_STATICAPPEND', 
> d.getVar('PACKAGE_DEBUG_SPLIT_STYLE'))}"
> +PACKAGE_DEBUG_DIR = "${@d.getVarFlag('PACKAGE_DEBUG_DIR', 
> d.getVar('PACKAGE_DEBUG_SPLIT_STYLE'))}"
> +PACKAGE_DEBUG_STATICDIR = "${@d.getVarFlag('PACKAGE_DEBUG_STATICDIR', 
> d.getVar('PACKAGE_DEBUG_SPLIT_STYLE'))}"
> +PACKAGE_DEBUG_LIBDIR = "${@d.getVarFlag('PACKAGE_DEBUG_LIBDIR', 
> d.getVar('PACKAGE_DEBUG_SPLIT_STYLE'))}"
> +PACKAGE_DEBUG_STATICLIBDIR = "${@d.getVarFlag('PACKAGE_DEBUG_STATICLIBDIR', 
> d.getVar('PACKAGE_DEBUG_SPLIT_STYLE'))}"
> +PACKAGE_DEBUG_SRCDIR = "${@d.getVarFlag('PACKAGE_DEBUG_SRCDIR', 
> d.getVar('PACKAGE_DEBUG_SPLIT_STYLE'))}"
> +
> +# Original OE-core, a.k.a. ".debug", style debug info
> +PACKAGE_DEBUG_APPEND[.debug] = ""
> +PACKAGE_DEBUG_STATICAPPEND[.debug] = ""
> +PACKAGE_DEBUG_DIR[.debug] = "/.debug"
> +PACKAGE_DEBUG_STATICDIR[.debug] = "/.debug-static"
> +PACKAGE_DEBUG_LIBDIR[.debug] = ""
> +PACKAGE_DEBUG_STATICLIBDIR[.debug] = ""
> +PACKAGE_DEBUG_SRCDIR[.debug] = "/usr/src/debug"
> +
> +# Single debug-file-directory style debug info
> +PACKAGE_DEBUG_APPEND[debug-file-directory] = ".debug"
> +PACKAGE_DEBUG_STATICAPPEND[debug-file-directory] = ""
> +PACKAGE_DEBUG_DIR[debug-file-directory] = ""
> +PACKAGE_DEBUG_STATICDIR[debug-file-directory] = ""
> +PACKAGE_DEBUG_LIBDIR[debug-file-directory] = "/usr/lib/debug"
> +PACKAGE_DEBUG_STATICLIBDIR[debug-file-directory] = "/usr/lib/debug-static"
> +PACKAGE_DEBUG_SRCDIR[debug-file-directory] = "/usr/src/debug"
> +
> +# Debug info without sources in /usr/src/debug
> +PACKAGE_DEBUG_APPEND[debug-without-src] = ""
> +PACKAGE_DEBUG_STATICAPPEND[debug-without-src] = ""
> +PACKAGE_DEBUG_DIR[debug-without-src] = "/.debug"
> +PACKAGE_DEBUG_STATICDIR[debug-without-src] = "/.debug-static"
> +PACKAGE_DEBUG_LIBDIR[debug-without-src] = ""
> +PACKAGE_DEBUG_STATICLIBDIR[debug-without-src] = ""
> +PACKAGE_DEBUG_SRCDIR[debug-without-src] = ""
> +
> +# Debug info with separate -src packages
> +PACKAGE_DEBUG_APPEND[debug-with-srcpkg] = ""
> +PACKAGE_DEBUG_STATICAPPEND[debug-with-srcpkg] = ""
> +PACKAGE_DEBUG_DIR[debug-with-srcpkg] = "/.debug"
> +PACKAGE_DEBUG_STATICDIR[debug-with-srcpkg] = "/.debug-static"
> +PACKAGE_DEBUG_LIBDIR[debug-with-srcpkg] = ""
> +PACKAGE_DEBUG_STATICLIBDIR[debug-with-srcpkg] = ""
> +PACKAGE_DEBUG_SRCDIR[debug-with-srcpkg] = "/usr/src/debug"
> +
>  python split_and_strip_files () {
>  import stat, errno
>  import subprocess


I can see what you've done and why but I'm not really sure this is an
improvement, it adds a ton of "global" variables which are only every used in a
very specific use case. I'm also particularly not keen on mapping the flags into
the real variables with online python. It isn't going to help our overall
parsing performance in the long run.

I'm torn on it but at least wanted to share my first thoughts looking at it...

Cheers,

Richard



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



[OE-core] [RFC PATCH 2/2] weston: upgrade 9.0.0 -> 10.0.0

2022-02-01 Thread Alexander Kanavin
Upstream has deprecated both weston-launch and fbdev backend, so let's
not delay the inevitable and find replacements.

Fbdev can be replaced by passing --use-pixman to drm backend;
this will bypass the opengl paths and use CPU for rendering.
Apply where GL is too slow or unavailable.

weston-launch can be replaced by starting weston directly, with
a seat management daemon for support. This is provided either
by systemd, or on systemd-less systems, by seatd. The sysvinit
startup scripts and tests have been rewritten accordingly. Bonus
fix: under sysvinit weston now starts under weston user as it should,
and not under root.

Upstream discussion:
https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/725

Signed-off-by: Alexander Kanavin 
---
 meta/lib/oeqa/runtime/cases/weston.py |   6 +-
 .../recipes-graphics/wayland/weston-init/init |   2 +-
 .../wayland/weston-init/weston-start  |  30 +--
 ...d-drm-Re-order-gbm-destruction-at-DR.patch |  50 -
 ...001-meson.build-fix-incorrect-header.patch |  32 ---
 ...ntl.h-for-open-O_RDWR-O_CLOEXEC-and-.patch |  47 -
 ...ovide-a-default-version-that-doesn-t.patch | 199 --
 .../weston/dont-use-plane-add-prop.patch  |  13 +-
 .../{weston_9.0.0.bb => weston_9.0.93.bb} |  50 +++--
 9 files changed, 52 insertions(+), 377 deletions(-)
 delete mode 100644 
meta/recipes-graphics/wayland/weston/0001-libweston-backend-drm-Re-order-gbm-destruction-at-DR.patch
 delete mode 100644 
meta/recipes-graphics/wayland/weston/0001-meson.build-fix-incorrect-header.patch
 delete mode 100644 
meta/recipes-graphics/wayland/weston/0001-tests-include-fcntl.h-for-open-O_RDWR-O_CLOEXEC-and-.patch
 delete mode 100644 
meta/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch
 rename meta/recipes-graphics/wayland/{weston_9.0.0.bb => weston_9.0.93.bb} 
(79%)

diff --git a/meta/lib/oeqa/runtime/cases/weston.py 
b/meta/lib/oeqa/runtime/cases/weston.py
index b3a7c2776d..b81cc299ef 100644
--- a/meta/lib/oeqa/runtime/cases/weston.py
+++ b/meta/lib/oeqa/runtime/cases/weston.py
@@ -10,7 +10,7 @@ import threading
 import time
 
 class WestonTest(OERuntimeTestCase):
-weston_log_file = '/tmp/weston.log'
+weston_log_file = '/tmp/weston-2.log'
 
 @classmethod
 def tearDownClass(cls):
@@ -31,13 +31,13 @@ class WestonTest(OERuntimeTestCase):
 return output.split(" ")
 
 def get_weston_command(self, cmd):
-return 'export XDG_RUNTIME_DIR=/run/user/0; export 
WAYLAND_DISPLAY=wayland-0; %s' % cmd
+return 'export XDG_RUNTIME_DIR=/run/user/`id -u weston`; export 
WAYLAND_DISPLAY=wayland-1; %s' % cmd
 
 def run_weston_init(self):
 if 'systemd' in self.tc.td['VIRTUAL-RUNTIME_init_manager']:
 self.target.run('systemd-run --collect --unit=weston-ptest.service 
--uid=0 -p PAMName=login -p TTYPath=/dev/tty6 -E XDG_RUNTIME_DIR=/tmp -E 
WAYLAND_DISPLAY=wayland-0 /usr/bin/weston --socket=wayland-1 --log=%s' % 
self.weston_log_file)
 else:
-self.target.run(self.get_weston_command('openvt -- weston 
--socket=wayland-1 --log=%s' % self.weston_log_file))
+self.target.run(self.get_weston_command('openvt -- weston 
--socket=wayland-2 --log=%s' % self.weston_log_file))
 
 def get_new_wayland_processes(self, existing_wl_processes):
 try_cnt = 0
diff --git a/meta/recipes-graphics/wayland/weston-init/init 
b/meta/recipes-graphics/wayland/weston-init/init
index a849f29bcb..d3b0d1873e 100644
--- a/meta/recipes-graphics/wayland/weston-init/init
+++ b/meta/recipes-graphics/wayland/weston-init/init
@@ -32,7 +32,7 @@ case "$1" in
 . /etc/profile
export HOME=ROOTHOME
 
-weston-start -- $OPTARGS
+WESTON_USER=weston weston-start $OPTARGS &
   ;;
 
   stop)
diff --git a/meta/recipes-graphics/wayland/weston-init/weston-start 
b/meta/recipes-graphics/wayland/weston-init/weston-start
index 0f1bc4c29d..01670cd4f5 100755
--- a/meta/recipes-graphics/wayland/weston-init/weston-start
+++ b/meta/recipes-graphics/wayland/weston-init/weston-start
@@ -6,7 +6,7 @@ export PATH="/sbin:/usr/sbin:/bin:/usr/bin"
 
 usage() {
cat <] [-- ]
+   $0 []
 EOF
 }
 
@@ -18,11 +18,6 @@ add_weston_argument() {
weston_args="$weston_args $1"
 }
 
-# Add openvt extra argument
-add_openvt_argument() {
-   openvt_args="$openvt_args $1"
-
-}
 ## Add module to --modules argument
 add_weston_module() {
if [[ "x${weston_modules}" == "x" ]]; then
@@ -37,33 +32,12 @@ if [ -n "$WAYLAND_DISPLAY" ]; then
 fi
 
 if [ -n "$WESTON_USER" ]; then
-   if [ -z "$WESTON_TTY" ]; then
-   echo "ERROR: If you have WESTON_USER variable set, you also 
need WESTON_TTY."
-   exit 1
-   fi
if [ -z "$WESTON_GROUP" ]; then
# no explicit WESTON_GROUP given, therefore use WESTON_USER
export WESTON_GROUP="${WESTON_USER}"
fi
-   weston_args_user="-u 

[OE-core] [RFC PATCH 1/2] seatd: add recipe

2022-02-01 Thread Alexander Kanavin
This is needed to run weston properly as non-root in the absence
of systemd-logind, and other compositors will likely require seatd
as well.

Signed-off-by: Alexander Kanavin 
---
 meta/conf/distro/include/maintainers.inc |  1 +
 meta/recipes-core/seatd/seatd/init   | 45 
 meta/recipes-core/seatd/seatd_0.6.3.bb   | 29 +++
 3 files changed, 75 insertions(+)
 create mode 100644 meta/recipes-core/seatd/seatd/init
 create mode 100644 meta/recipes-core/seatd/seatd_0.6.3.bb

diff --git a/meta/conf/distro/include/maintainers.inc 
b/meta/conf/distro/include/maintainers.inc
index ae25287c11..cb289a0eee 100644
--- a/meta/conf/distro/include/maintainers.inc
+++ b/meta/conf/distro/include/maintainers.inc
@@ -684,6 +684,7 @@ RECIPE_MAINTAINER:pn-rxvt-unicode = "Unassigned 
"
 RECIPE_MAINTAINER:pn-sato-screenshot = "Ross Burton "
 RECIPE_MAINTAINER:pn-sbc = "Unassigned "
 RECIPE_MAINTAINER:pn-screen = "Anuj Mittal "
+RECIPE_MAINTAINER:pn-seatd = "Alexander Kanavin "
 RECIPE_MAINTAINER:pn-sed = "Chen Qi "
 RECIPE_MAINTAINER:pn-serf = "Anuj Mittal "
 RECIPE_MAINTAINER:pn-setserial = "Yi Zhao "
diff --git a/meta/recipes-core/seatd/seatd/init 
b/meta/recipes-core/seatd/seatd/init
new file mode 100644
index 00..0589c765ac
--- /dev/null
+++ b/meta/recipes-core/seatd/seatd/init
@@ -0,0 +1,45 @@
+#!/bin/sh
+#
+### BEGIN INIT INFO
+# Provides: seatd
+# Required-Start: $local_fs $remote_fs
+# Required-Stop: $local_fs $remote_fs
+# Default-Start: 2 3 4 5
+# Default-Stop:  0 1 6
+### END INIT INFO
+
+killproc() {
+pid=`/bin/pidof $1`
+[ "$pid" != "" ] && kill $pid
+}
+
+case "$1" in
+  start)
+seatd -g video -n 1 > /tmp/seatd-start-notify &
+[ -s /tmp/seatd-start-notify ] && exit 0
+sleep 0.1
+[ -s /tmp/seatd-start-notify ] && exit 0
+sleep 0.5
+[ -s /tmp/seatd-start-notify ] && exit 0
+sleep 5
+[ -s /tmp/seatd-start-notify ] && exit 0
+exit 1
+  ;;
+
+  stop)
+echo "Stopping seatd"
+killproc seatd
+  ;;
+
+  restart)
+   $0 stop
+sleep 1
+$0 start
+  ;;
+
+  *)
+echo "usage: $0 { start | stop | restart }"
+  ;;
+esac
+
+exit 0
diff --git a/meta/recipes-core/seatd/seatd_0.6.3.bb 
b/meta/recipes-core/seatd/seatd_0.6.3.bb
new file mode 100644
index 00..0e1a79dddf
--- /dev/null
+++ b/meta/recipes-core/seatd/seatd_0.6.3.bb
@@ -0,0 +1,29 @@
+SUMMARY = "A minimal seat management daemon, and a universal seat management 
library."
+DESCRIPTION = "Seat management takes care of mediating access to shared 
devices (graphics, input), without requiring the applications needing access to 
be root."
+HOMEPAGE = "https://git.sr.ht/~kennylevinsen/seatd;
+
+LICENSE = "MIT"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=715a99d2dd552e6188e74d4ed2914d5a"
+
+SRC_URI = "git://git.sr.ht/~kennylevinsen/seatd;protocol=https;branch=master \
+   file://init"
+SRCREV = "88db55f6068c1c01d85b61aa6adff0a6b2a8dce8"
+S = "${WORKDIR}/git"
+
+inherit meson pkgconfig update-rc.d
+
+PACKAGECONFIG ?= "libseat-builtin"
+
+PACKAGECONFIG[libseat-builtin] = 
"-Dlibseat-builtin=enabled,-Dlibseat-builtin=disabled"
+
+do_install:append() {
+if [ "${VIRTUAL-RUNTIME_init_manager}" != "systemd" ]; then
+install -Dm755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/seatd
+fi
+}
+
+INITSCRIPT_NAME = "seatd"
+INITSCRIPT_PARAMS = "start 9 5 2 . stop 20 0 1 6 ."
+INHIBIT_UPDATERCD_BBCLASS = 
"${@oe.utils.conditional('VIRTUAL-RUNTIME_init_manager', 'systemd', '1', '', 
d)}"
+
-- 
2.20.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#161155): 
https://lists.openembedded.org/g/openembedded-core/message/161155
Mute This Topic: https://lists.openembedded.org/mt/88831947/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] dhcpcd: add option to set DBDIR location

2022-02-01 Thread Andrej Valek
This will allow to use the different DBDIR location, because the /var/lib
could be used as a read-only location.

Signed-off-by: Andrej Valek 
---
 meta/recipes-connectivity/dhcpcd/dhcpcd_9.4.1.bb | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/meta/recipes-connectivity/dhcpcd/dhcpcd_9.4.1.bb 
b/meta/recipes-connectivity/dhcpcd/dhcpcd_9.4.1.bb
index 4007a4bd2d..ab6ffe986c 100644
--- a/meta/recipes-connectivity/dhcpcd/dhcpcd_9.4.1.bb
+++ b/meta/recipes-connectivity/dhcpcd/dhcpcd_9.4.1.bb
@@ -32,8 +32,11 @@ PACKAGECONFIG[ntp] = "--with-hook=ntp, , ,ntp"
 PACKAGECONFIG[chrony] = "--with-hook=ntp, , ,chrony"
 PACKAGECONFIG[ypbind] = "--with-eghook=yp, , ,ypbind-mt"
 
+# add option to override DBDIR location
+DBDIR ?= "${localstatedir}/lib/${BPN}"
+
 EXTRA_OECONF = "--enable-ipv4 \
---dbdir=${localstatedir}/lib/${BPN} \
+--dbdir=${DBDIR} \
 --sbindir=${base_sbindir} \
 --runstatedir=/run \
 --enable-privsep \
@@ -43,15 +46,15 @@ EXTRA_OECONF = "--enable-ipv4 \
"
 
 USERADD_PACKAGES = "${PN}"
-USERADD_PARAM:${PN} = "--system -d ${localstatedir}/lib/${BPN} -M -s 
/bin/false -U dhcpcd"
+USERADD_PARAM:${PN} = "--system -d ${DBDIR} -M -s /bin/false -U dhcpcd"
 
 do_install:append () {
 # install systemd unit files
 install -d ${D}${systemd_system_unitdir}
 install -m 0644 ${WORKDIR}/dhcpcd*.service ${D}${systemd_system_unitdir}
 
-chmod 700 ${D}${localstatedir}/lib/${BPN}
-chown dhcpcd:dhcpcd ${D}${localstatedir}/lib/${BPN}
+chmod 700 ${D}${DBDIR}
+chown dhcpcd:dhcpcd ${D}${DBDIR}
 }
 
 FILES:${PN}-dbg += "${libdir}/dhcpcd/dev/.debug"
-- 
2.34.1


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