[OE-core] [meta][dunfell][PATCH v2] rpm: Add fix for CVE-2021-20266

2021-08-23 Thread Ranjitsinh Rathod
Adding fix for CVE-2021-20266
Upstream-Status: Backport 
[https://github.com/rpm-software-management/rpm/pull/1587/commits/9646711891df851dfbf7ef54cc171574a0914b15]

Note: Hunk#2 and Hunk#3 refreshed to apply patch and match value of
dl_max variable to make it with current version
All Hunks are refreshed to solve patch-fuzz

Signed-off-by: Ranjitsinh Rathod 
---
 .../rpm/files/CVE-2021-20266.patch| 109 ++
 meta/recipes-devtools/rpm/rpm_4.14.2.1.bb |   1 +
 2 files changed, 110 insertions(+)
 create mode 100644 meta/recipes-devtools/rpm/files/CVE-2021-20266.patch

diff --git a/meta/recipes-devtools/rpm/files/CVE-2021-20266.patch 
b/meta/recipes-devtools/rpm/files/CVE-2021-20266.patch
new file mode 100644
index 00..f2fc47e321
--- /dev/null
+++ b/meta/recipes-devtools/rpm/files/CVE-2021-20266.patch
@@ -0,0 +1,109 @@
+From ebbf0f0133c498d229e94ecf2ed0b41d6e6a142a Mon Sep 17 00:00:00 2001
+From: Demi Marie Obenour 
+Date: Mon, 8 Feb 2021 16:05:01 -0500
+Subject: [PATCH] hdrblobInit() needs bounds checks too
+
+Users can pass untrusted data to hdrblobInit() and it must be robust
+against this.
+
+Backported from commit 8f4b3c3cab8922a2022b9e47c71f1ecf906077ef
+
+Upstream-Status: Backport 
[https://github.com/rpm-software-management/rpm/pull/1587/commits/9646711891df851dfbf7ef54cc171574a0914b15]
+CVE: CVE-2021-20266
+Signed-off-by: Ranjitsinh Rathod 
+
+---
+ lib/header.c | 48 +++-
+ 1 file changed, 31 insertions(+), 17 deletions(-)
+
+diff --git a/lib/header.c b/lib/header.c
+index 5b09f8352..ad5b6dc57 100644
+--- a/lib/header.c
 b/lib/header.c
+@@ -11,6 +11,7 @@
+ #include "system.h"
+ #include 
+ #include 
++#include 
+ #include 
+ #include 
+ #include "lib/header_internal.h"
+@@ -1890,6 +1891,25 @@ hdrblob hdrblobFree(hdrblob blob)
+ return NULL;
+ }
+
++static rpmRC hdrblobVerifyLengths(rpmTagVal regionTag, uint32_t il, uint32_t 
dl,
++char **emsg) {
++uint32_t il_max = HEADER_TAGS_MAX;
++uint32_t dl_max = HEADER_DATA_MAX;
++if (regionTag == RPMTAG_HEADERSIGNATURES) {
++  il_max = 32;
++  dl_max = 8192;
++}
++if (hdrchkRange(il_max, il)) {
++  rasprintf(emsg, _("hdr tags: BAD, no. of tags(%" PRIu32 ") out of 
range"), il);
++  return RPMRC_FAIL;
++}
++if (hdrchkRange(dl_max, dl)) {
++  rasprintf(emsg, _("hdr data: BAD, no. of bytes(%" PRIu32 ") out of 
range"), dl);
++  return RPMRC_FAIL;
++}
++return RPMRC_OK;
++}
++
+ rpmRC hdrblobRead(FD_t fd, int magic, int exact_size, rpmTagVal regionTag, 
hdrblob blob, char **emsg)
+ {
+ int32_t block[4];
+@@ -1902,13 +1922,6 @@ rpmRC hdrblobRead(FD_t fd, int magic, int exact_size, 
rpmTagVal regionTag, hdrbl
+ size_t nb;
+ rpmRC rc = RPMRC_FAIL;/* assume failure */
+ int xx;
+-int32_t il_max = HEADER_TAGS_MAX;
+-int32_t dl_max = HEADER_DATA_MAX;
+-
+-if (regionTag == RPMTAG_HEADERSIGNATURES) {
+-  il_max = 32;
+-  dl_max = 8192;
+-}
+
+ memset(block, 0, sizeof(block));
+ if ((xx = Freadall(fd, bs, blen)) != blen) {
+@@ -1921,15 +1934,9 @@ rpmRC hdrblobRead(FD_t fd, int magic, int exact_size, 
rpmTagVal regionTag, hdrbl
+   goto exit;
+ }
+ il = ntohl(block[2]);
+-if (hdrchkRange(il_max, il)) {
+-  rasprintf(emsg, _("hdr tags: BAD, no. of tags(%d) out of range"), il);
+-  goto exit;
+-}
+ dl = ntohl(block[3]);
+-if (hdrchkRange(dl_max, dl)) {
+-  rasprintf(emsg, _("hdr data: BAD, no. of bytes(%d) out of range"), dl);
++if (hdrblobVerifyLengths(regionTag, il, dl, emsg))
+   goto exit;
+-}
+
+ nb = (il * sizeof(struct entryInfo_s)) + dl;
+ uc = sizeof(il) + sizeof(dl) + nb;
+@@ -1973,11 +1980,18 @@ rpmRC hdrblobInit(const void *uh, size_t uc,
+   struct hdrblob_s *blob, char **emsg)
+ {
+ rpmRC rc = RPMRC_FAIL;
+-
+ memset(blob, 0, sizeof(*blob));
++if (uc && uc < 8) {
++  rasprintf(emsg, _("hdr length: BAD"));
++  goto exit;
++}
++
+ blob->ei = (int32_t *) uh; /* discards const */
+-blob->il = ntohl(blob->ei[0]);
+-blob->dl = ntohl(blob->ei[1]);
++blob->il = ntohl((uint32_t)(blob->ei[0]));
++blob->dl = ntohl((uint32_t)(blob->ei[1]));
++if (hdrblobVerifyLengths(regionTag, blob->il, blob->dl, emsg) != RPMRC_OK)
++  goto exit;
++
+ blob->pe = (entryInfo) &(blob->ei[2]);
+ blob->pvlen = sizeof(blob->il) + sizeof(blob->dl) +
+ (blob->il * sizeof(*blob->pe)) + blob->dl;
diff --git a/meta/recipes-devtools/rpm/rpm_4.14.2.1.bb 
b/meta/recipes-devtools/rpm/rpm_4.14.2.1.bb
index 018b2f8700..c93654aa8f 100644
--- a/meta/recipes-devtools/rpm/rpm_4.14.2.1.bb
+++ b/meta/recipes-devtools/rpm/rpm_4.14.2.1.bb
@@ -45,6 +45,7 @@ SRC_URI = 
"git://github.com/rpm-software-management/rpm;branch=rpm-4.14.x \

file://0001-Rip-out-partial-support-for-unused-MD2-and-RIPEMD160.patch \

Re: [OE-core] [meta][dunfell][PATCH] rpm: Add fix for CVE-2021-20266

2021-08-23 Thread Ranjitsinh Rathod
Steve,

It is strange as I have not faced this issue during the local build.

I will update the patch and resend it.


Thanks,

Best Regards,

Ranjitsinh Rathod
Technical Leader |  | KPIT Technologies Ltd.
Cellphone: +91-84606 92403
__
KPIT | Follow us on LinkedIn

[cid:6fb72eb3-447e-4bb8-bf95-b9d1a5a6f680]


From: Steve Sakoman 
Sent: Tuesday, August 24, 2021 1:24 AM
To: Ranjitsinh Rathod 
Cc: Patches and discussions about the oe-core layer 

Subject: Re: [OE-core] [meta][dunfell][PATCH] rpm: Add fix for CVE-2021-20266

Caution: This email originated from outside of the KPIT. Do not click links or 
open attachments unless you recognize the sender and know the content is safe.

On Mon, Aug 23, 2021 at 8:12 AM Ranjitsinh Rathod
 wrote:
>
> Adding fix for CVE-2021-20266
> Upstream-Status: Backport 
> [https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Frpm-software-management%2Frpm%2Fpull%2F1587%2Fcommits%2F9646711891df851dfbf7ef54cc171574a0914b15data=04%7C01%7Cranjitsinh.rathod%40kpit.com%7C89d7c6b26cfb4e79602f08d9666feae7%7C3539451eb46e4a26a242ff61502855c7%7C0%7C0%7C637653453206357564%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=oF%2FII4zn%2BX2v6ES0%2BI14nBjIRErXpR3nsm18%2B9PWUas%3Dreserved=0]
>
> Note: Hunk#2 and Hunk#3 refreshed to apply patch and match value of
> dl_max variable to make it with current version

Causes autobuilder failures:

https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Ferrors.yoctoproject.org%2FErrors%2FDetails%2F602478%2Fdata=04%7C01%7Cranjitsinh.rathod%40kpit.com%7C89d7c6b26cfb4e79602f08d9666feae7%7C3539451eb46e4a26a242ff61502855c7%7C0%7C0%7C637653453206357564%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=QpiS8zQ%2FQ%2B2o6s1XrKsT2eRNm7k5GJGtLItDwnly1D4%3Dreserved=0

Steve

>
> Signed-off-by: Ranjitsinh Rathod 
> ---
>  .../rpm/files/CVE-2021-20266.patch| 108 ++
>  meta/recipes-devtools/rpm/rpm_4.14.2.1.bb |   1 +
>  2 files changed, 109 insertions(+)
>  create mode 100644 meta/recipes-devtools/rpm/files/CVE-2021-20266.patch
>
> diff --git a/meta/recipes-devtools/rpm/files/CVE-2021-20266.patch 
> b/meta/recipes-devtools/rpm/files/CVE-2021-20266.patch
> new file mode 100644
> index 00..d8b91d4f8e
> --- /dev/null
> +++ b/meta/recipes-devtools/rpm/files/CVE-2021-20266.patch
> @@ -0,0 +1,108 @@
> +From 9646711891df851dfbf7ef54cc171574a0914b15 Mon Sep 17 00:00:00 2001
> +From: Demi Marie Obenour 
> +Date: Mon, 8 Feb 2021 16:05:01 -0500
> +Subject: [PATCH] hdrblobInit() needs bounds checks too
> +
> +Users can pass untrusted data to hdrblobInit() and it must be robust
> +against this.
> +
> +Backported from commit 8f4b3c3cab8922a2022b9e47c71f1ecf906077ef
> +
> +Upstream-Status: Backport 
> [https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Frpm-software-management%2Frpm%2Fpull%2F1587%2Fcommits%2F9646711891df851dfbf7ef54cc171574a0914b15data=04%7C01%7Cranjitsinh.rathod%40kpit.com%7C89d7c6b26cfb4e79602f08d9666feae7%7C3539451eb46e4a26a242ff61502855c7%7C0%7C0%7C637653453206367523%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=CPPv79htmIf%2FsDEV1JN8dZWCjME%2BBH4ns%2BOM2zEDEI0%3Dreserved=0]
> +CVE: CVE-2021-20266
> +Signed-off-by: Ranjitsinh Rathod 
> +---
> + lib/header.c | 48 +++-
> + 1 file changed, 31 insertions(+), 17 deletions(-)
> +
> +diff --git a/lib/header.c b/lib/header.c
> +index 6af48e61af..46ded5dd99 100644
> +--- a/lib/header.c
>  b/lib/header.c
> +@@ -11,6 +11,7 @@
> + #include "system.h"
> + #include 
> + #include 
> ++#include 
> + #include 
> + #include 
> + #include "lib/header_internal.h"
> +@@ -1910,6 +1911,25 @@ hdrblob hdrblobFree(hdrblob blob)
> + return NULL;
> + }
> +
> ++static rpmRC hdrblobVerifyLengths(rpmTagVal regionTag, uint32_t il, 
> uint32_t dl,
> ++char **emsg) {
> ++uint32_t il_max = HEADER_TAGS_MAX;
> ++uint32_t dl_max = HEADER_DATA_MAX;
> ++if (regionTag == RPMTAG_HEADERSIGNATURES) {
> ++  il_max = 32;
> ++  dl_max = 8192;
> ++}
> ++if (hdrchkRange(il_max, il)) {
> ++  rasprintf(emsg, _("hdr tags: BAD, no. of tags(%" PRIu32 ") out of 
> range"), il);
> ++  return RPMRC_FAIL;
> ++}
> ++if (hdrchkRange(dl_max, dl)) {
> ++  rasprintf(emsg, _("hdr data: BAD, no. of bytes(%" PRIu32 ") out of 
> range"), dl);
> ++  return RPMRC_FAIL;
> ++}
> ++return RPMRC_OK;
> ++}
> ++
> + rpmRC hdrblobRead(FD_t fd, int magic, int exact_size, rpmTagVal regionTag, 
> hdrblob blob, char **emsg)
> + {
> + int32_t block[4];
> +@@ -1922,13 +1942,6 @@ rpmRC hdrblobRead(FD_t fd, int magic, int exact_size, 

[OE-core] [Dunfell][PATCH 3/3] qemu: Security fixes CVE-2021-3545/6

2021-08-23 Thread Armin Kuster
From: Armin Kuster 

Source: qemu.org
MR: 111845, 111839
Type: Security Fix
Disposition: Backport from 
https://gitlab.com/qemu-project/qemu/-/commit/9f22893a & 121841b2
ChangeID: 111b168e0fe4d2a722158c6bfdaceb06a8789e69
Description:

Fixes: CVE-2021-3545 and CVE-2021-3546

Signed-off-by: Armin Kuster 
---
 meta/recipes-devtools/qemu/qemu.inc   |  2 +
 .../qemu/qemu/CVE-2021-3545.patch | 41 
 .../qemu/qemu/CVE-2021-3546.patch | 47 +++
 3 files changed, 90 insertions(+)
 create mode 100644 meta/recipes-devtools/qemu/qemu/CVE-2021-3545.patch
 create mode 100644 meta/recipes-devtools/qemu/qemu/CVE-2021-3546.patch

diff --git a/meta/recipes-devtools/qemu/qemu.inc 
b/meta/recipes-devtools/qemu/qemu.inc
index 90549136e5..028b81ee34 100644
--- a/meta/recipes-devtools/qemu/qemu.inc
+++ b/meta/recipes-devtools/qemu/qemu.inc
@@ -77,6 +77,8 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
file://CVE-2021-3544_3.patch \
file://CVE-2021-3544_4.patch \
file://CVE-2021-3544_5.patch \
+   file://CVE-2021-3545.patch \
+   file://CVE-2021-3546.patch \
"
 UPSTREAM_CHECK_REGEX = "qemu-(?P\d+(\.\d+)+)\.tar"
 
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2021-3545.patch 
b/meta/recipes-devtools/qemu/qemu/CVE-2021-3545.patch
new file mode 100644
index 00..fcdda64437
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/CVE-2021-3545.patch
@@ -0,0 +1,41 @@
+From 121841b25d72d13f8cad554363138c360f1250ea Mon Sep 17 00:00:00 2001
+From: Li Qiang 
+Date: Sat, 15 May 2021 20:03:56 -0700
+Subject: [PATCH] vhost-user-gpu: fix memory disclosure in
+ virgl_cmd_get_capset_info (CVE-2021-3545)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Otherwise some of the 'resp' will be leaked to guest.
+
+Fixes: CVE-2021-3545
+Reported-by: Li Qiang 
+virtio-gpu fix: 42a8dadc74 ("virtio-gpu: fix information leak
+in getting capset info dispatch")
+
+Signed-off-by: Li Qiang 
+Reviewed-by: Marc-André Lureau 
+Message-Id: <20210516030403.107723-2-liq...@163.com>
+Signed-off-by: Gerd Hoffmann 
+
+Upstream-Status: Backport
+CVE: CVE-2021-3545
+Signed-off-by: Armin Kuster 
+
+---
+ contrib/vhost-user-gpu/virgl.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+Index: qemu-4.2.0/contrib/vhost-user-gpu/virgl.c
+===
+--- qemu-4.2.0.orig/contrib/vhost-user-gpu/virgl.c
 qemu-4.2.0/contrib/vhost-user-gpu/virgl.c
+@@ -132,6 +132,7 @@ virgl_cmd_get_capset_info(VuGpu *g,
+ 
+ VUGPU_FILL_CMD(info);
+ 
++memset(, 0, sizeof(resp));
+ if (info.capset_index == 0) {
+ resp.capset_id = VIRTIO_GPU_CAPSET_VIRGL;
+ virgl_renderer_get_cap_set(resp.capset_id,
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2021-3546.patch 
b/meta/recipes-devtools/qemu/qemu/CVE-2021-3546.patch
new file mode 100644
index 00..f8da428233
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/CVE-2021-3546.patch
@@ -0,0 +1,47 @@
+From 9f22893adcb02580aee5968f32baa2cd109b3ec2 Mon Sep 17 00:00:00 2001
+From: Li Qiang 
+Date: Sat, 15 May 2021 20:04:02 -0700
+Subject: [PATCH] vhost-user-gpu: fix OOB write in 'virgl_cmd_get_capset'
+ (CVE-2021-3546)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+If 'virgl_cmd_get_capset' set 'max_size' to 0,
+the 'virgl_renderer_fill_caps' will write the data after the 'resp'.
+This patch avoid this by checking the returned 'max_size'.
+
+virtio-gpu fix: abd7f08b23 ("display: virtio-gpu-3d: check
+virgl capabilities max_size")
+
+Fixes: CVE-2021-3546
+Reported-by: Li Qiang 
+Reviewed-by: Prasad J Pandit 
+Signed-off-by: Li Qiang 
+Reviewed-by: Marc-André Lureau 
+Message-Id: <20210516030403.107723-8-liq...@163.com>
+Signed-off-by: Gerd Hoffmann 
+
+Upstream-Status: Backport
+CVE: CVE-2021-3546
+Signed-off-by: Armin Kuster 
+
+---
+ contrib/vhost-user-gpu/virgl.c | 4 
+ 1 file changed, 4 insertions(+)
+
+Index: qemu-4.2.0/contrib/vhost-user-gpu/virgl.c
+===
+--- qemu-4.2.0.orig/contrib/vhost-user-gpu/virgl.c
 qemu-4.2.0/contrib/vhost-user-gpu/virgl.c
+@@ -174,6 +174,10 @@ virgl_cmd_get_capset(VuGpu *g,
+ 
+ virgl_renderer_get_cap_set(gc.capset_id, _ver,
+_size);
++if (!max_size) {
++cmd->error = VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER;
++return;
++}
+ resp = g_malloc0(sizeof(*resp) + max_size);
+ 
+ resp->hdr.type = VIRTIO_GPU_RESP_OK_CAPSET;
-- 
2.25.1


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

[OE-core] [Dunfell][PATCH 2/3] qemu: Security fix CVE-2021-3544

2021-08-23 Thread Armin Kuster
From: Armin Kuster 

Source: qemu.org
MR: 111833
Type: Security Fix
Disposition: Backport from 
https://gitlab.com/qemu-project/qemu/-/commit/86dd8fac..63736af5
ChangeID: 7f301e939cf9d1fdb826ac47d1fc96430086a68e
Description:

https://gitlab.com/qemu-project/qemu/-/commit/86dd8fac
https://gitlab.com/qemu-project/qemu/-/commit/b9f79858
https://gitlab.com/qemu-project/qemu/-/commit/b7afebcf
Tweeked the above patches as vhost-user-gpu.c does not exist.

https://gitlab.com/qemu-project/qemu/-/commit/f6091d86
https://gitlab.com/qemu-project/qemu/-/commit/63736af5

Signed-off-by: Armin Kuster 
---
 meta/recipes-devtools/qemu/qemu.inc   |  5 ++
 .../qemu/qemu/CVE-2021-3544.patch | 29 
 .../qemu/qemu/CVE-2021-3544_2.patch   | 39 +++
 .../qemu/qemu/CVE-2021-3544_3.patch   | 39 +++
 .../qemu/qemu/CVE-2021-3544_4.patch   | 46 ++
 .../qemu/qemu/CVE-2021-3544_5.patch   | 47 +++
 6 files changed, 205 insertions(+)
 create mode 100644 meta/recipes-devtools/qemu/qemu/CVE-2021-3544.patch
 create mode 100644 meta/recipes-devtools/qemu/qemu/CVE-2021-3544_2.patch
 create mode 100644 meta/recipes-devtools/qemu/qemu/CVE-2021-3544_3.patch
 create mode 100644 meta/recipes-devtools/qemu/qemu/CVE-2021-3544_4.patch
 create mode 100644 meta/recipes-devtools/qemu/qemu/CVE-2021-3544_5.patch

diff --git a/meta/recipes-devtools/qemu/qemu.inc 
b/meta/recipes-devtools/qemu/qemu.inc
index 1ddb373115..90549136e5 100644
--- a/meta/recipes-devtools/qemu/qemu.inc
+++ b/meta/recipes-devtools/qemu/qemu.inc
@@ -72,6 +72,11 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
file://CVE-2021-3416_9.patch \
file://CVE-2021-3416_10.patch \
file://CVE-2021-20257.patch \
+   file://CVE-2021-3544.patch \
+   file://CVE-2021-3544_2.patch \
+   file://CVE-2021-3544_3.patch \
+   file://CVE-2021-3544_4.patch \
+   file://CVE-2021-3544_5.patch \
"
 UPSTREAM_CHECK_REGEX = "qemu-(?P\d+(\.\d+)+)\.tar"
 
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2021-3544.patch 
b/meta/recipes-devtools/qemu/qemu/CVE-2021-3544.patch
new file mode 100644
index 00..1b4fcbfb60
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/CVE-2021-3544.patch
@@ -0,0 +1,29 @@
+vhost-user-gpu: fix resource leak in 'vg_resource_create_2d' (CVE-2021-3544)
+
+Call 'vugbm_buffer_destroy' in error path to avoid resource leak.
+
+Fixes: CVE-2021-3544
+Reported-by: default avatarLi Qiang 
+Reviewed-by: default avatarPrasad J Pandit 
+Signed-off-by: default avatarLi Qiang 
+Reviewed-by: Marc-André Lureau's avatarMarc-André Lureau 

+Message-Id: <20210516030403.107723-3-liq...@163.com>
+Signed-off-by: Gerd Hoffmann's avatarGerd Hoffmann 
+
+Upstream-Status: Backport
+[vhost-user-gpu does not exist in 4.2.0]
+CVE: CVE-2021-3544
+Signed-off-by: Armin Kuster 
+
+Index: qemu-4.2.0/contrib/vhost-user-gpu/main.c
+===
+--- qemu-4.2.0.orig/contrib/vhost-user-gpu/main.c
 qemu-4.2.0/contrib/vhost-user-gpu/main.c
+@@ -328,6 +328,7 @@ vg_resource_create_2d(VuGpu *g,
+ g_critical("%s: resource creation failed %d %d %d",
+__func__, c2d.resource_id, c2d.width, c2d.height);
+ g_free(res);
++vugbm_buffer_destroy(>buffer);
+ cmd->error = VIRTIO_GPU_RESP_ERR_OUT_OF_MEMORY;
+ return;
+ }
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2021-3544_2.patch 
b/meta/recipes-devtools/qemu/qemu/CVE-2021-3544_2.patch
new file mode 100644
index 00..36cbb127f8
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/CVE-2021-3544_2.patch
@@ -0,0 +1,39 @@
+vhost-user-gpu: fix memory leak in vg_resource_attach_backing (CVE-2021-3544)
+
+
+Check whether the 'res' has already been attach_backing to avoid
+memory leak.
+
+Fixes: CVE-2021-3544
+Reported-by: default avatarLi Qiang 
+virtio-gpu fix: 204f01b3
+
+ ("virtio-gpu: fix memory leak
+ in resource attach backing")
+ Signed-off-by: default avatarLi Qiang 
+ Reviewed-by: Marc-André Lureau's avatarMarc-André Lureau 

+ Message-Id: <20210516030403.107723-4-liq...@163.com>
+ Signed-off-by: Gerd Hoffmann's avatarGerd Hoffmann 
+
+Upstream-Status: Backport
+[vhost-user-gpu does not exist in 4.2.0 context]
+CVE: CVE-2021-3544
+Signed-off-by: Armin Kuster 
+
+
+Index: qemu-4.2.0/contrib/vhost-user-gpu/main.c
+===
+--- qemu-4.2.0.orig/contrib/vhost-user-gpu/main.c
 qemu-4.2.0/contrib/vhost-user-gpu/main.c
+@@ -468,6 +468,11 @@ vg_resource_attach_backing(VuGpu *g,
+ return;
+ }
+ 
++if (res->iov) {
++cmd->error = VIRTIO_GPU_RESP_ERR_UNSPEC;
++return;
++}
++
+ ret = vg_create_mapping_iov(g, , cmd, >iov);
+ if (ret != 0) {
+ cmd->error = VIRTIO_GPU_RESP_ERR_UNSPEC;
diff --git 

[OE-core] [Dunfell][PATCH 1/3] qemu: fix CVE-2021-20257

2021-08-23 Thread Armin Kuster
From: Sakib Sajal 

Source: https://git.yoctoproject.org/git/poky
MR: 110290
Type: Security Fix
Disposition: Backport from 
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/meta/recipes-devtools/qemu?h=hardknott=5c1a29e6deec8f92ac43363bd72439aec7e27721
ChangeID: 7f301e939cf9d1fdb826ac47d1fc96430086a68e
Description:

(From OE-Core rev: 5b66ff7972951db973d12f3dae6ccecf3bc29e56)

Signed-off-by: Sakib Sajal 
Signed-off-by: Richard Purdie 
(cherry picked from commit 547ac986a74cfcae39b691ebb92aadc8436443ea)
Signed-off-by: Anuj Mittal 
Signed-off-by: Richard Purdie 
(cherry picked from commit 5c1a29e6deec8f92ac43363bd72439aec7e27721)
Signed-off-by: Armin Kuster 
---
 meta/recipes-devtools/qemu/qemu.inc   |  1 +
 .../qemu/qemu/CVE-2021-20257.patch| 55 +++
 2 files changed, 56 insertions(+)
 create mode 100644 meta/recipes-devtools/qemu/qemu/CVE-2021-20257.patch

diff --git a/meta/recipes-devtools/qemu/qemu.inc 
b/meta/recipes-devtools/qemu/qemu.inc
index e64a6b2cb2..1ddb373115 100644
--- a/meta/recipes-devtools/qemu/qemu.inc
+++ b/meta/recipes-devtools/qemu/qemu.inc
@@ -71,6 +71,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
file://CVE-2021-3416_8.patch \
file://CVE-2021-3416_9.patch \
file://CVE-2021-3416_10.patch \
+   file://CVE-2021-20257.patch \
"
 UPSTREAM_CHECK_REGEX = "qemu-(?P\d+(\.\d+)+)\.tar"
 
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2021-20257.patch 
b/meta/recipes-devtools/qemu/qemu/CVE-2021-20257.patch
new file mode 100644
index 00..7175b24e99
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/CVE-2021-20257.patch
@@ -0,0 +1,55 @@
+From affdf476543405045c281a7c67d1eaedbcea8135 Mon Sep 17 00:00:00 2001
+From: Jason Wang 
+Date: Wed, 24 Feb 2021 13:45:28 +0800
+Subject: [PATCH] e1000: fail early for evil descriptor
+
+During procss_tx_desc(), driver can try to chain data descriptor with
+legacy descriptor, when will lead underflow for the following
+calculation in process_tx_desc() for bytes:
+
+if (tp->size + bytes > msh)
+bytes = msh - tp->size;
+
+This will lead a infinite loop. So check and fail early if tp->size if
+greater or equal to msh.
+
+Reported-by: Alexander Bulekov 
+Reported-by: Cheolwoo Myung 
+Reported-by: Ruhr-University Bochum 
+Cc: Prasad J Pandit 
+Cc: qemu-sta...@nongnu.org
+Signed-off-by: Jason Wang 
+
+Upstream-Status: Backport [3de46e6fc489c52c9431a8a832ad8170a7569bd8]
+CVE: CVE-2021-20257
+
+Signed-off-by: Sakib Sajal 
+---
+ hw/net/e1000.c | 4 
+ 1 file changed, 4 insertions(+)
+
+diff --git a/hw/net/e1000.c b/hw/net/e1000.c
+index cf22c4f07..c3564c7ce 100644
+--- a/hw/net/e1000.c
 b/hw/net/e1000.c
+@@ -670,6 +670,9 @@ process_tx_desc(E1000State *s, struct e1000_tx_desc *dp)
+ msh = tp->tso_props.hdr_len + tp->tso_props.mss;
+ do {
+ bytes = split_size;
++if (tp->size >= msh) {
++goto eop;
++}
+ if (tp->size + bytes > msh)
+ bytes = msh - tp->size;
+ 
+@@ -695,6 +698,7 @@ process_tx_desc(E1000State *s, struct e1000_tx_desc *dp)
+ tp->size += split_size;
+ }
+ 
++eop:
+ if (!(txd_lower & E1000_TXD_CMD_EOP))
+ return;
+ if (!(tp->cptse && tp->size < tp->tso_props.hdr_len)) {
+-- 
+2.29.2
+
-- 
2.25.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#155200): 
https://lists.openembedded.org/g/openembedded-core/message/155200
Mute This Topic: https://lists.openembedded.org/mt/85103921/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][hardknott][PATCH 1/1] icu: increase pkgdata command buffer size

2021-08-23 Thread Anuj Mittal
Hi Joe,

On Mon, 2021-08-23 at 14:29 -0700, Joe Slater wrote:
> Mitigate pathname truncation when installing in a project
> with a very long pathname.  The patch is on the master
> branch, but they have moved to a later version of icu
> so we cannot cherry-pick.
> 
> Signed-off-by: Joe Slater 
> ---
>  ...pkgdata-increase-command-buffer-size.patch | 43 +++
>  meta/recipes-support/icu/icu_68.2.bb  |  1 +
>  2 files changed, 44 insertions(+)
>  create mode 100644 meta/recipes-support/icu/icu/0001-pkgdata-increase-
> command-buffer-size.patch
> 
> diff --git a/meta/recipes-support/icu/icu/0001-pkgdata-increase-
> command-buffer-size.patch b/meta/recipes-support/icu/icu/0001-pkgdata-
> increase-command-buffer-size.patch
> new file mode 100644
> index 00..ea68e4be9f
> --- /dev/null
> +++ b/meta/recipes-support/icu/icu/0001-pkgdata-increase-command-
> buffer-size.patch
> @@ -0,0 +1,43 @@
> +From ab6b1acdeed76899f8227c38ab7e7675c7673ff1 Mon Sep 17 00:00:00 2001
> +From: Joe Slater 
> +Date: Thu, 5 Aug 2021 09:23:48 -0700
> +Subject: [PATCH 1/1] pkgdata: increase command buffer size
> +
> +Make cmd LARGE_BUFFER_SIZE to avoid pathname truncation
> +when install paths are longer than about 150 characters.
> +
> +Upstream-Status: Pending

I think there was a comment from Alex on the original patch for master
requesting this be sent upstream first. Can you do that please?

Thanks,

Anuj

> +
> +Signed-off-by: Joe Slater 
> +---
> + source/tools/pkgdata/pkgdata.cpp | 6 +++---
> + 1 file changed, 3 insertions(+), 3 deletions(-)
> +
> +diff --git a/source/tools/pkgdata/pkgdata.cpp
> b/source/tools/pkgdata/pkgdata.cpp
> +index 5ab682e..d4b70ef 100644
> +--- a/tools/pkgdata/pkgdata.cpp
>  b/tools/pkgdata/pkgdata.cpp
> +@@ -1131,17 +1131,17 @@ normal_symlink_mode:
> + 
> + static int32_t pkg_installLibrary(const char *installDir, const char
> *targetDir, UBool noVersion) {
> + int32_t result = 0;
> +-    char cmd[SMALL_BUFFER_MAX_SIZE];
> ++    char cmd[LARGE_BUFFER_MAX_SIZE];
> + 
> + auto ret = snprintf(cmd,
> +-    SMALL_BUFFER_MAX_SIZE,
> ++    LARGE_BUFFER_MAX_SIZE,
> + "cd %s && %s %s %s%s%s",
> + targetDir,
> + pkgDataFlags[INSTALL_CMD],
> + libFileNames[LIB_FILE_VERSION],
> + installDir, PKGDATA_FILE_SEP_STRING,
> libFileNames[LIB_FILE_VERSION]);
> + (void)ret;
> +-    U_ASSERT(0 <= ret && ret < SMALL_BUFFER_MAX_SIZE);
> ++    U_ASSERT(0 <= ret && ret < LARGE_BUFFER_MAX_SIZE);
> + 
> + result = runCommand(cmd);
> + 
> +-- 
> +2.29.2
> +
> diff --git a/meta/recipes-support/icu/icu_68.2.bb b/meta/recipes-
> support/icu/icu_68.2.bb
> index 1ca87feee4..130212d245 100644
> --- a/meta/recipes-support/icu/icu_68.2.bb
> +++ b/meta/recipes-support/icu/icu_68.2.bb
> @@ -107,6 +107,7 @@ SRC_URI = "${BASE_SRC_URI};name=code \
>     file://filter.json \
>     file://fix-install-manx.patch \
>     file://0001-icu-Added-armeb-support.patch \
> +   file://0001-pkgdata-increase-command-buffer-size.patch \
>     "
>  
>  SRC_URI_append_class-target = "\
> 
> 
> 


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



[OE-core] [dunfell][PATCH] image_types: Restore pre-btrfs-tools 4.14.1 mkfs.btrfs shrink behavior

2021-08-23 Thread Marek Vasut
Currently the mkfs.btrfs generates large images with a lot of wasted
space. This happens since OE-core updated btrfs-tools from 4.13.3 to
4.15.1 in commit 94b645aa77 ("btrfs-tools: update to 4.15.1") .

Note in mkfs.btrfs(8) manpage section -r says the following:
"
  -r|--rootdir 
...
   Note This option may enlarge the image or file to ensure
   it’s big enough to contain the files from rootdir. Since
   version 4.14.1 the filesystem size is not minimized. Please
   see option --shrink if you need that functionality.

  --shrink
 Shrink the filesystem to its minimal size, only works with
 --rootdir option.
...
   Note prior to version 4.14.1, the shrinking was done
   automatically.
"

Add the --shrink option to EXTRA_IMAGECMD_btrfs to reinstate the
original behavior and un-waste the space.

Signed-off-by: Marek Vasut 
Cc: Alexander Kanavin 
Cc: Richard Purdie 
Cc: Ross Burton 
Signed-off-by: Alexandre Belloni 
Signed-off-by: Richard Purdie 
(cherry picked from commit c4a99d36967302c176b62fad840b5e79486ea356)
Cc: Steve Sakoman 
---
 meta/classes/image_types.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
index ff42ac9423..6dc0e094d0 100644
--- a/meta/classes/image_types.bbclass
+++ b/meta/classes/image_types.bbclass
@@ -240,7 +240,7 @@ EXTRA_IMAGECMD_jffs2 ?= "--pad ${JFFS2_ENDIANNESS} 
--eraseblock=${JFFS2_ERASEBLO
 EXTRA_IMAGECMD_ext2 ?= "-i 4096"
 EXTRA_IMAGECMD_ext3 ?= "-i 4096"
 EXTRA_IMAGECMD_ext4 ?= "-i 4096"
-EXTRA_IMAGECMD_btrfs ?= "-n 4096"
+EXTRA_IMAGECMD_btrfs ?= "-n 4096 --shrink"
 EXTRA_IMAGECMD_f2fs ?= ""
 
 do_image_cpio[depends] += "cpio-native:do_populate_sysroot"
-- 
2.32.0


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#155198): 
https://lists.openembedded.org/g/openembedded-core/message/155198
Mute This Topic: https://lists.openembedded.org/mt/85101728/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 Newcomer & Unassigned Bugs - Help Needed

2021-08-23 Thread Stephen Jolley
All,

 

The triage team is starting to try and collect up and classify bugs which a
newcomer to the project would be able to work on in a way which means people
can find them. They're being listed on the triage page under the appropriate
heading:

https://wiki.yoctoproject.org/wiki/Bug_Triage#Newcomer_Bugs  Also please
review:
https://www.openembedded.org/wiki/How_to_submit_a_patch_to_OpenEmbedded and
how to create a bugzilla account at:

https://bugzilla.yoctoproject.org/createaccount.cgi

The idea is these bugs should be straight forward for a person to help work
on who doesn't have deep experience with the project.  If anyone can help,
please take ownership of the bug and send patches!  If anyone needs
help/advice there are people on irc who can likely do so, or some of the
more experienced contributors will likely be happy to help too.

 

Also, the triage team meets weekly and does its best to handle the bugs
reported into the Bugzilla. The number of people attending that meeting has
fallen, as have the number of people available to help fix bugs. One of the
things we hear users report is they don't know how to help. We (the triage
team) are therefore going to start reporting out the currently 386
unassigned or newcomer bugs.

 

We're hoping people may be able to spare some time now and again to help out
with these.  Bugs are split into two types, "true bugs" where things don't
work as they should and "enhancements" which are features we'd want to add
to the system.  There are also roughly four different "priority" classes
right now, "3.2", "3.3, "3.99" and "Future", the more pressing/urgent issues
being in "3.2" and then "3.3".

 

Please review this link and if a bug is something you would be able to help
with either take ownership of the bug, or send me (sjolley.yp...@gmail.com
 ) an e-mail with the bug number you would
like and I will assign it to you (please make sure you have a Bugzilla
account).  The list is at:
https://wiki.yoctoproject.org/wiki/Bug_Triage_Archive#Unassigned_or_Newcomer
_Bugs

 

Thanks,

 

Stephen K. Jolley

Yocto Project Program Manager

*Cell:(208) 244-4460

* Email:  sjolley.yp...@gmail.com
 

 


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



[OE-core] Update bitbake broken build

2021-08-23 Thread JH
Hi,

I updated the bitbake to run git pull in master branch, now it is
broken, what does the following error message mean, how to fix it?

$ bitbake-layers show-layers

NOTE: Starting bitbake server...
ERROR: Variable PROVIDES_prepend contains an operation using the old
override syntax. Please convert this layer/metadata before attempting
to use with a newer bitbake.

Thank you.

Kind regards,

- jupiter

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#155196): 
https://lists.openembedded.org/g/openembedded-core/message/155196
Mute This Topic: https://lists.openembedded.org/mt/85098090/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] vim: add option to disable NLS support

2021-08-23 Thread Andre McCurdy
On Mon, Aug 23, 2021 at 10:12 AM Andrej Valek  wrote:
>
> Hello Khem,
>
> I looked exactly into configure.ac which arguments are expecting for those 
> options. So I think, it has to be mentioned explicitly.

Assuming configure.ac is based around AC_ARG_ENABLE / AC_ARG_WITH then
an explicit option is not required. A default value of "yes" will be
set for --enable-foo / --with-foo and a default value of "no" will be
set for --disable-foo / --without-foo.

However, apart from that, you've also dropped the leaving "--" from
various --enable-foo options and converted dashes to underscores, all
of which looks wrong. How were the changes tested?

> Regards,
> Andrej
>
> > On 8/23/21 3:12 AM, Andrej Valek wrote:
> >> - Some distributions with UTF-8 locale have problem when National Language
> >>   Support is enabled. Add there an option to disable it.
> >> - refresh options based on configure.ac
> >>
> >> Signed-off-by: Andrej Valek 
> >> ---
> >>   meta/recipes-support/vim/vim.inc | 8 +---
> >>   1 file changed, 5 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/meta/recipes-support/vim/vim.inc
> >> b/meta/recipes-support/vim/vim.inc
> >> index 17d1c24a7c..7cc47884f2 100644
> >> --- a/meta/recipes-support/vim/vim.inc
> >> +++ b/meta/recipes-support/vim/vim.inc
> >> @@ -54,19 +54,21 @@ do_compile() {
> >>   autotools_do_compile
> >>   }
> >>
> >> -#Available PACKAGECONFIG options are gtkgui, acl, x11, tiny
> >> +#Available PACKAGECONFIG options are gtkgui, acl, x11, tiny, selinux,
> >> +elfutils, nls
> >>   PACKAGECONFIG ??= ""
> >>   PACKAGECONFIG += " \
> >>   ${@bb.utils.filter('DISTRO_FEATURES', 'acl selinux', d)} \
> >>   ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11 gtkgui', '',
> >> d)} \
> >> +nls \
> >>   "
> >>
> >>   PACKAGECONFIG[gtkgui] = "--enable-gui=gtk3,--enable-gui=no,gtk+3"
> >> -PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl,"
> >> +PACKAGECONFIG[acl] = "enable_acl="yes",--disable-acl,acl,"
> >
> >is 'yes' needed to be explicit ? I thought --enable-XYZ meant it implicitly
> >
> >>   PACKAGECONFIG[x11] = "--with-x,--without-x,xt,"
> >>   PACKAGECONFIG[tiny] = "--with-features=tiny,--with-features=big,,"
> >> -PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux,"
> >> +PACKAGECONFIG[selinux] = 
> >> "enable_selinux="yes",--disable-selinux,libselinux,"
> >>   PACKAGECONFIG[elfutils] = "--enable-elf-check,,elfutils,"
> >> +PACKAGECONFIG[nls] = "enable_nls="yes",--disable-nls,,"
> >>
> >>   EXTRA_OECONF = " \
> >>   --disable-gpm \
>
> 
>

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



[oe-core][hardknott][PATCH 1/1] icu: increase pkgdata command buffer size

2021-08-23 Thread Joe Slater
Mitigate pathname truncation when installing in a project
with a very long pathname.  The patch is on the master
branch, but they have moved to a later version of icu
so we cannot cherry-pick.

Signed-off-by: Joe Slater 
---
 ...pkgdata-increase-command-buffer-size.patch | 43 +++
 meta/recipes-support/icu/icu_68.2.bb  |  1 +
 2 files changed, 44 insertions(+)
 create mode 100644 
meta/recipes-support/icu/icu/0001-pkgdata-increase-command-buffer-size.patch

diff --git 
a/meta/recipes-support/icu/icu/0001-pkgdata-increase-command-buffer-size.patch 
b/meta/recipes-support/icu/icu/0001-pkgdata-increase-command-buffer-size.patch
new file mode 100644
index 00..ea68e4be9f
--- /dev/null
+++ 
b/meta/recipes-support/icu/icu/0001-pkgdata-increase-command-buffer-size.patch
@@ -0,0 +1,43 @@
+From ab6b1acdeed76899f8227c38ab7e7675c7673ff1 Mon Sep 17 00:00:00 2001
+From: Joe Slater 
+Date: Thu, 5 Aug 2021 09:23:48 -0700
+Subject: [PATCH 1/1] pkgdata: increase command buffer size
+
+Make cmd LARGE_BUFFER_SIZE to avoid pathname truncation
+when install paths are longer than about 150 characters.
+
+Upstream-Status: Pending
+
+Signed-off-by: Joe Slater 
+---
+ source/tools/pkgdata/pkgdata.cpp | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/source/tools/pkgdata/pkgdata.cpp 
b/source/tools/pkgdata/pkgdata.cpp
+index 5ab682e..d4b70ef 100644
+--- a/tools/pkgdata/pkgdata.cpp
 b/tools/pkgdata/pkgdata.cpp
+@@ -1131,17 +1131,17 @@ normal_symlink_mode:
+ 
+ static int32_t pkg_installLibrary(const char *installDir, const char 
*targetDir, UBool noVersion) {
+ int32_t result = 0;
+-char cmd[SMALL_BUFFER_MAX_SIZE];
++char cmd[LARGE_BUFFER_MAX_SIZE];
+ 
+ auto ret = snprintf(cmd,
+-SMALL_BUFFER_MAX_SIZE,
++LARGE_BUFFER_MAX_SIZE,
+ "cd %s && %s %s %s%s%s",
+ targetDir,
+ pkgDataFlags[INSTALL_CMD],
+ libFileNames[LIB_FILE_VERSION],
+ installDir, PKGDATA_FILE_SEP_STRING, 
libFileNames[LIB_FILE_VERSION]);
+ (void)ret;
+-U_ASSERT(0 <= ret && ret < SMALL_BUFFER_MAX_SIZE);
++U_ASSERT(0 <= ret && ret < LARGE_BUFFER_MAX_SIZE);
+ 
+ result = runCommand(cmd);
+ 
+-- 
+2.29.2
+
diff --git a/meta/recipes-support/icu/icu_68.2.bb 
b/meta/recipes-support/icu/icu_68.2.bb
index 1ca87feee4..130212d245 100644
--- a/meta/recipes-support/icu/icu_68.2.bb
+++ b/meta/recipes-support/icu/icu_68.2.bb
@@ -107,6 +107,7 @@ SRC_URI = "${BASE_SRC_URI};name=code \
file://filter.json \
file://fix-install-manx.patch \
file://0001-icu-Added-armeb-support.patch \
+   file://0001-pkgdata-increase-command-buffer-size.patch \
"
 
 SRC_URI_append_class-target = "\
-- 
2.31.1


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



[OE-core] weston systemd watchdog

2021-08-23 Thread Tom Hochstein
Hi Khem,

This is regarding the weston systemd watchdog timeout of 20 seconds:

https://github.com/openembedded/openembedded-core/commit/c21fa5a291ab207a084285935ab73a0b4225c965#diff-ac8a4b56ade4a43a070c93486fb1d7606573da5d44de96bc1529d15b0b216660R36

For GPU-limited parts, we see watchdog timeouts during intense testing, though 
the part is not hung, it's just going to take longer than 20 seconds.

I stumbled across the following systemd commit, which looks like the watchdog 
used to default to 180 seconds. Yet even then was under scrutiny because it was 
causing un-necessary failures more often than not:

https://github.com/systemd/systemd/commit/21d0dd5a89fe0ef259ca51ebea9f39dd79a341c2#diff-9d3c1cd071b0f173aaf53a7799ac5765bb3a58d0d07125f075b6b49112f0a425

Do you think the default should be raised? Or should we just make a special 
case in our layer?

Tom

<>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#155193): 
https://lists.openembedded.org/g/openembedded-core/message/155193
Mute This Topic: https://lists.openembedded.org/mt/85096163/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] glibc: ptest: Add support for running glibc test suite with ptest

2021-08-23 Thread Khem Raj
On Mon, Aug 23, 2021 at 1:09 PM Lukasz Majewski  wrote:
>
> On Mon, 23 Aug 2021 12:52:44 -0700
> Khem Raj  wrote:
>
> > On Mon, Aug 23, 2021 at 11:24 AM Lukasz Majewski 
> > wrote:
> >
> > > Hi Khem,
> > >
> > > > On 8/23/21 8:08 AM, ?ukasz Majewski wrote:
> > > > > This patch introduces new recipe - namely 'glibc-tests', which
> > > > > builds and installs glibc test suite to OE/Yocto built image.
> > > > >
> > > > > It reuses code from already available 'glibc-testsuite' recipe,
> > > > > which is run with 'bitbake glibc-testsuite -c check' and uses
> > > > > qemu to execute remotely (via SSH) tests on some emulated
> > > > > machine.
> > > > >
> > > > > This recipe installs eligible tests on some rootfs image.
> > > > > Afterwards, either all of them or only time related subset,
> > > > > those tests can be executed on the real hardware, to facilitate
> > > > > validation of this platform with for example Y2038 problem
> > > > > compliance.
> > > > >
> > > > > By default all tests are executed, with 'ptest-runner
> > > > > glibc-tests'. To test only time related subset - one needs to
> > > > > call: cd /usr/lib/glibc-tests/ptest/; rm run-ptest; \
> > > > > ln -s run-ptest-time run-ptest; cd -; ptest-runner glibc-tests
> > > > >
> > > > > To facilitate debugging, source files are provided by default
> > > > > with the unstripped debugging symbols. Such approach would
> > > > > reduce the already complex recipe (as it inherits base glibc
> > > > > one), so there is no need to also install *-dbg and *-src
> > > > > packages.
> > > >
> > > >
> > > > does it have to be a separate recipe I wonder if we can have it
> > > > built as part of glibc itself controlled via ptest knob
> > >
> > > I've followed the glibc-testsuite recipe to provide tests for ptest.
> > > Test creation is similar to it, but doesn't require QEMU run (tests
> > > are executed on the HW).
> > >
> > > Another rationale was to have some kind of "features" separation in
> > > different file (liked glibc-mtrace), which is easier to maintain and
> > > review.
> > >
> > > Last but not least - separate recipe (and built binaries) allow some
> > > kind of magic with selection of used test programs (this may be
> > > useful if one would like to have different sets of tests in
> > > different packages)
> >
> > That’s seems ok I think the names are quite confusing now not that it
> > was not so much better before but now we have glibc-tests and
> > glibc-testsuites which do same things but in very different way maybe
> > glibc-testsuite should be renamed to something like glibc-tests-crosd
> > or some such
>
> I think that glibc-testsuite_2.34.bb shall be renamed to
> glibc-tests-qemu_2.34.bb as it is more descriptive.

is it only runnable in qemu ? I thought we could use a read board as
well with IP address

>
> Then, glibc-tests_2.34.bb could be left as it is now, as inheriting
> ptest requires it to be added as 'glibc-tests-ptest' in
> meta/conf/distro/include/ptest-packagelists.inc
>
> (I've tried to rename it to glibc-tests-ptest_2.34.bb, but then it was
> required to add glibc-tests-ptest-ptest to the ptest-packagelist.inc
> file, which is a bit clumsy IMHO).
>
> >
> > >
> > > >
> > > > >
> > > > > Signed-off-by: Lukasz Majewski 
> > > > > ---
> > > > >   .../distro/include/ptest-packagelists.inc |   1 +
> > > > >   meta/recipes-core/glibc/glibc-tests_2.34.bb   | 101
> > > > > ++ meta/recipes-core/glibc/glibc/run-ptest-all
> > > > >  | 25 + meta/recipes-core/glibc/glibc/run-ptest-time  |  30
> > > > > ++ 4 files changed, 157 insertions(+)
> > > > >   create mode 100644 meta/recipes-core/glibc/glibc-tests_2.34.bb
> > > > >   create mode 100755 meta/recipes-core/glibc/glibc/run-ptest-all
> > > > >   create mode 100755
> > > > > meta/recipes-core/glibc/glibc/run-ptest-time
> > > > >
> > > > > diff --git a/meta/conf/distro/include/ptest-packagelists.inc
> > > > > b/meta/conf/distro/include/ptest-packagelists.inc index
> > > > > 3872bdc942..e460ad1c8b 100644 ---
> > > > > a/meta/conf/distro/include/ptest-packagelists.inc +++
> > > > > b/meta/conf/distro/include/ptest-packagelists.inc @@ -59,6
> > > > > +59,7 @@ PTESTS_FAST = "\ slang-ptest \
> > > > >   wayland-ptest \
> > > > >   zlib-ptest \
> > > > > +glibc-tests-ptest \
> > > > >   "
> > > > >   PTESTS_FAST:remove:mips64 = "qemu-ptest"
> > > > >   PTESTS_PROBLEMS:append:mips64 = "qemu-ptest"
> > > > > diff --git a/meta/recipes-core/glibc/glibc-tests_2.34.bb
> > > > > b/meta/recipes-core/glibc/glibc-tests_2.34.bb new file mode
> > > > > 100644 index 00..896809f700
> > > > > --- /dev/null
> > > > > +++ b/meta/recipes-core/glibc/glibc-tests_2.34.bb
> > > > > @@ -0,0 +1,101 @@
> > > > > +require glibc_${PV}.bb
> > > > > +require glibc-tests.inc
> > > > > +
> > > > > +inherit ptest
> > > > > +
> > > > > +SRC_URI:append = " \
> > > > > +   file://run-ptest-all file://run-ptest-time \
> > > > > +"
> > > > > +
> > > > > +SUMMARY = "glibc tests to be run 

Re: [OE-core] [PATCH 2/2] glibc: ptest: Add support for running glibc test suite with ptest

2021-08-23 Thread ?ukasz Majewski
On Mon, 23 Aug 2021 12:52:44 -0700
Khem Raj  wrote:

> On Mon, Aug 23, 2021 at 11:24 AM Lukasz Majewski 
> wrote:
> 
> > Hi Khem,
> >  
> > > On 8/23/21 8:08 AM, ?ukasz Majewski wrote:  
> > > > This patch introduces new recipe - namely 'glibc-tests', which
> > > > builds and installs glibc test suite to OE/Yocto built image.
> > > >
> > > > It reuses code from already available 'glibc-testsuite' recipe,
> > > > which is run with 'bitbake glibc-testsuite -c check' and uses
> > > > qemu to execute remotely (via SSH) tests on some emulated
> > > > machine.
> > > >
> > > > This recipe installs eligible tests on some rootfs image.
> > > > Afterwards, either all of them or only time related subset,
> > > > those tests can be executed on the real hardware, to facilitate
> > > > validation of this platform with for example Y2038 problem
> > > > compliance.
> > > >
> > > > By default all tests are executed, with 'ptest-runner
> > > > glibc-tests'. To test only time related subset - one needs to
> > > > call: cd /usr/lib/glibc-tests/ptest/; rm run-ptest; \
> > > > ln -s run-ptest-time run-ptest; cd -; ptest-runner glibc-tests
> > > >
> > > > To facilitate debugging, source files are provided by default
> > > > with the unstripped debugging symbols. Such approach would
> > > > reduce the already complex recipe (as it inherits base glibc
> > > > one), so there is no need to also install *-dbg and *-src
> > > > packages.  
> > >
> > >
> > > does it have to be a separate recipe I wonder if we can have it
> > > built as part of glibc itself controlled via ptest knob  
> >
> > I've followed the glibc-testsuite recipe to provide tests for ptest.
> > Test creation is similar to it, but doesn't require QEMU run (tests
> > are executed on the HW).
> >
> > Another rationale was to have some kind of "features" separation in
> > different file (liked glibc-mtrace), which is easier to maintain and
> > review.
> >
> > Last but not least - separate recipe (and built binaries) allow some
> > kind of magic with selection of used test programs (this may be
> > useful if one would like to have different sets of tests in
> > different packages) 
> 
> That’s seems ok I think the names are quite confusing now not that it
> was not so much better before but now we have glibc-tests and
> glibc-testsuites which do same things but in very different way maybe
> glibc-testsuite should be renamed to something like glibc-tests-crosd
> or some such

I think that glibc-testsuite_2.34.bb shall be renamed to
glibc-tests-qemu_2.34.bb as it is more descriptive.

Then, glibc-tests_2.34.bb could be left as it is now, as inheriting
ptest requires it to be added as 'glibc-tests-ptest' in
meta/conf/distro/include/ptest-packagelists.inc

(I've tried to rename it to glibc-tests-ptest_2.34.bb, but then it was
required to add glibc-tests-ptest-ptest to the ptest-packagelist.inc
file, which is a bit clumsy IMHO).

> 
> >  
> > >  
> > > >
> > > > Signed-off-by: Lukasz Majewski 
> > > > ---
> > > >   .../distro/include/ptest-packagelists.inc |   1 +
> > > >   meta/recipes-core/glibc/glibc-tests_2.34.bb   | 101
> > > > ++ meta/recipes-core/glibc/glibc/run-ptest-all
> > > >  | 25 + meta/recipes-core/glibc/glibc/run-ptest-time  |  30
> > > > ++ 4 files changed, 157 insertions(+)
> > > >   create mode 100644 meta/recipes-core/glibc/glibc-tests_2.34.bb
> > > >   create mode 100755 meta/recipes-core/glibc/glibc/run-ptest-all
> > > >   create mode 100755
> > > > meta/recipes-core/glibc/glibc/run-ptest-time
> > > >
> > > > diff --git a/meta/conf/distro/include/ptest-packagelists.inc
> > > > b/meta/conf/distro/include/ptest-packagelists.inc index
> > > > 3872bdc942..e460ad1c8b 100644 ---
> > > > a/meta/conf/distro/include/ptest-packagelists.inc +++
> > > > b/meta/conf/distro/include/ptest-packagelists.inc @@ -59,6
> > > > +59,7 @@ PTESTS_FAST = "\ slang-ptest \
> > > >   wayland-ptest \
> > > >   zlib-ptest \
> > > > +glibc-tests-ptest \
> > > >   "
> > > >   PTESTS_FAST:remove:mips64 = "qemu-ptest"
> > > >   PTESTS_PROBLEMS:append:mips64 = "qemu-ptest"
> > > > diff --git a/meta/recipes-core/glibc/glibc-tests_2.34.bb
> > > > b/meta/recipes-core/glibc/glibc-tests_2.34.bb new file mode
> > > > 100644 index 00..896809f700
> > > > --- /dev/null
> > > > +++ b/meta/recipes-core/glibc/glibc-tests_2.34.bb
> > > > @@ -0,0 +1,101 @@
> > > > +require glibc_${PV}.bb
> > > > +require glibc-tests.inc
> > > > +
> > > > +inherit ptest
> > > > +
> > > > +SRC_URI:append = " \
> > > > +   file://run-ptest-all file://run-ptest-time \
> > > > +"
> > > > +
> > > > +SUMMARY = "glibc tests to be run with ptest"
> > > > +
> > > > +# Erase some variables already set by glibc_${PV}
> > > > +python __anonymous() {
> > > > +   # Remove packages provided by glibc build, we only need
> > > > a subset of them
> > > > +   d.setVar("PACKAGES", "${PN}")
> > > > +
> > > > +   d.setVar("PROVIDES", "${PN}")
> > > > +   d.setVar("RPROVIDES", 

Re: [OE-core] [meta][dunfell][PATCH] rpm: Add fix for CVE-2021-20266

2021-08-23 Thread Steve Sakoman
On Mon, Aug 23, 2021 at 8:12 AM Ranjitsinh Rathod
 wrote:
>
> Adding fix for CVE-2021-20266
> Upstream-Status: Backport 
> [https://github.com/rpm-software-management/rpm/pull/1587/commits/9646711891df851dfbf7ef54cc171574a0914b15]
>
> Note: Hunk#2 and Hunk#3 refreshed to apply patch and match value of
> dl_max variable to make it with current version

Causes autobuilder failures:

https://errors.yoctoproject.org/Errors/Details/602478/

Steve

>
> Signed-off-by: Ranjitsinh Rathod 
> ---
>  .../rpm/files/CVE-2021-20266.patch| 108 ++
>  meta/recipes-devtools/rpm/rpm_4.14.2.1.bb |   1 +
>  2 files changed, 109 insertions(+)
>  create mode 100644 meta/recipes-devtools/rpm/files/CVE-2021-20266.patch
>
> diff --git a/meta/recipes-devtools/rpm/files/CVE-2021-20266.patch 
> b/meta/recipes-devtools/rpm/files/CVE-2021-20266.patch
> new file mode 100644
> index 00..d8b91d4f8e
> --- /dev/null
> +++ b/meta/recipes-devtools/rpm/files/CVE-2021-20266.patch
> @@ -0,0 +1,108 @@
> +From 9646711891df851dfbf7ef54cc171574a0914b15 Mon Sep 17 00:00:00 2001
> +From: Demi Marie Obenour 
> +Date: Mon, 8 Feb 2021 16:05:01 -0500
> +Subject: [PATCH] hdrblobInit() needs bounds checks too
> +
> +Users can pass untrusted data to hdrblobInit() and it must be robust
> +against this.
> +
> +Backported from commit 8f4b3c3cab8922a2022b9e47c71f1ecf906077ef
> +
> +Upstream-Status: Backport 
> [https://github.com/rpm-software-management/rpm/pull/1587/commits/9646711891df851dfbf7ef54cc171574a0914b15]
> +CVE: CVE-2021-20266
> +Signed-off-by: Ranjitsinh Rathod 
> +---
> + lib/header.c | 48 +++-
> + 1 file changed, 31 insertions(+), 17 deletions(-)
> +
> +diff --git a/lib/header.c b/lib/header.c
> +index 6af48e61af..46ded5dd99 100644
> +--- a/lib/header.c
>  b/lib/header.c
> +@@ -11,6 +11,7 @@
> + #include "system.h"
> + #include 
> + #include 
> ++#include 
> + #include 
> + #include 
> + #include "lib/header_internal.h"
> +@@ -1910,6 +1911,25 @@ hdrblob hdrblobFree(hdrblob blob)
> + return NULL;
> + }
> +
> ++static rpmRC hdrblobVerifyLengths(rpmTagVal regionTag, uint32_t il, 
> uint32_t dl,
> ++char **emsg) {
> ++uint32_t il_max = HEADER_TAGS_MAX;
> ++uint32_t dl_max = HEADER_DATA_MAX;
> ++if (regionTag == RPMTAG_HEADERSIGNATURES) {
> ++  il_max = 32;
> ++  dl_max = 8192;
> ++}
> ++if (hdrchkRange(il_max, il)) {
> ++  rasprintf(emsg, _("hdr tags: BAD, no. of tags(%" PRIu32 ") out of 
> range"), il);
> ++  return RPMRC_FAIL;
> ++}
> ++if (hdrchkRange(dl_max, dl)) {
> ++  rasprintf(emsg, _("hdr data: BAD, no. of bytes(%" PRIu32 ") out of 
> range"), dl);
> ++  return RPMRC_FAIL;
> ++}
> ++return RPMRC_OK;
> ++}
> ++
> + rpmRC hdrblobRead(FD_t fd, int magic, int exact_size, rpmTagVal regionTag, 
> hdrblob blob, char **emsg)
> + {
> + int32_t block[4];
> +@@ -1922,13 +1942,6 @@ rpmRC hdrblobRead(FD_t fd, int magic, int exact_size, 
> rpmTagVal regionTag, hdrbl
> + size_t nb;
> + rpmRC rc = RPMRC_FAIL;/* assume failure */
> + int xx;
> +-int32_t il_max = HEADER_TAGS_MAX;
> +-int32_t dl_max = HEADER_DATA_MAX;
> +-
> +-if (regionTag == RPMTAG_HEADERSIGNATURES) {
> +-  il_max = 32;
> +-  dl_max = 8192;
> +-}
> +
> + memset(block, 0, sizeof(block));
> + if ((xx = Freadall(fd, bs, blen)) != blen) {
> +@@ -1941,15 +1954,9 @@ rpmRC hdrblobRead(FD_t fd, int magic, int exact_size, 
> rpmTagVal regionTag, hdrbl
> +   goto exit;
> + }
> + il = ntohl(block[2]);
> +-if (hdrchkRange(il_max, il)) {
> +-  rasprintf(emsg, _("hdr tags: BAD, no. of tags(%d) out of range"), il);
> +-  goto exit;
> +-}
> + dl = ntohl(block[3]);
> +-if (hdrchkRange(dl_max, dl)) {
> +-  rasprintf(emsg, _("hdr data: BAD, no. of bytes(%d) out of range"), 
> dl);
> ++if (hdrblobVerifyLengths(regionTag, il, dl, emsg))
> +   goto exit;
> +-}
> +
> + nb = (il * sizeof(struct entryInfo_s)) + dl;
> + uc = sizeof(il) + sizeof(dl) + nb;
> +@@ -1993,11 +2000,18 @@ rpmRC hdrblobInit(const void *uh, size_t uc,
> +   struct hdrblob_s *blob, char **emsg)
> + {
> + rpmRC rc = RPMRC_FAIL;
> +-
> + memset(blob, 0, sizeof(*blob));
> ++if (uc && uc < 8) {
> ++  rasprintf(emsg, _("hdr length: BAD"));
> ++  goto exit;
> ++}
> ++
> + blob->ei = (int32_t *) uh; /* discards const */
> +-blob->il = ntohl(blob->ei[0]);
> +-blob->dl = ntohl(blob->ei[1]);
> ++blob->il = ntohl((uint32_t)(blob->ei[0]));
> ++blob->dl = ntohl((uint32_t)(blob->ei[1]));
> ++if (hdrblobVerifyLengths(regionTag, blob->il, blob->dl, emsg) != 
> RPMRC_OK)
> ++  goto exit;
> ++
> + blob->pe = (entryInfo) &(blob->ei[2]);
> + blob->pvlen = sizeof(blob->il) + sizeof(blob->dl) +
> + (blob->il * sizeof(*blob->pe)) + blob->dl;
> diff --git 

Re: [OE-core] [PATCH 2/2] glibc: ptest: Add support for running glibc test suite with ptest

2021-08-23 Thread Khem Raj
On Mon, Aug 23, 2021 at 11:24 AM Lukasz Majewski  wrote:

> Hi Khem,
>
> > On 8/23/21 8:08 AM, ?ukasz Majewski wrote:
> > > This patch introduces new recipe - namely 'glibc-tests', which
> > > builds and installs glibc test suite to OE/Yocto built image.
> > >
> > > It reuses code from already available 'glibc-testsuite' recipe,
> > > which is run with 'bitbake glibc-testsuite -c check' and uses qemu
> > > to execute remotely (via SSH) tests on some emulated machine.
> > >
> > > This recipe installs eligible tests on some rootfs image.
> > > Afterwards, either all of them or only time related subset, those
> > > tests can be executed on the real hardware, to facilitate validation
> > > of this platform with for example Y2038 problem compliance.
> > >
> > > By default all tests are executed, with 'ptest-runner glibc-tests'.
> > > To test only time related subset - one needs to call:
> > > cd /usr/lib/glibc-tests/ptest/; rm run-ptest; \
> > > ln -s run-ptest-time run-ptest; cd -; ptest-runner glibc-tests
> > >
> > > To facilitate debugging, source files are provided by default with
> > > the unstripped debugging symbols. Such approach would reduce the
> > > already complex recipe (as it inherits base glibc one), so there
> > > is no need to also install *-dbg and *-src packages.
> >
> >
> > does it have to be a separate recipe I wonder if we can have it built
> > as part of glibc itself controlled via ptest knob
>
> I've followed the glibc-testsuite recipe to provide tests for ptest.
> Test creation is similar to it, but doesn't require QEMU run (tests are
> executed on the HW).
>
> Another rationale was to have some kind of "features" separation in
> different file (liked glibc-mtrace), which is easier to maintain and
> review.
>
> Last but not least - separate recipe (and built binaries) allow some
> kind of magic with selection of used test programs (this may be useful
> if one would like to have different sets of tests in different packages)
>

That’s seems ok I think the names are quite confusing now not that it was
not so much better before but now we have glibc-tests and glibc-testsuites
which do same things but in very different way maybe glibc-testsuite should
be renamed to something like glibc-tests-crosd or some such

>
> >
> > >
> > > Signed-off-by: Lukasz Majewski 
> > > ---
> > >   .../distro/include/ptest-packagelists.inc |   1 +
> > >   meta/recipes-core/glibc/glibc-tests_2.34.bb   | 101
> > > ++ meta/recipes-core/glibc/glibc/run-ptest-all   |
> > > 25 + meta/recipes-core/glibc/glibc/run-ptest-time  |  30 ++
> > >   4 files changed, 157 insertions(+)
> > >   create mode 100644 meta/recipes-core/glibc/glibc-tests_2.34.bb
> > >   create mode 100755 meta/recipes-core/glibc/glibc/run-ptest-all
> > >   create mode 100755 meta/recipes-core/glibc/glibc/run-ptest-time
> > >
> > > diff --git a/meta/conf/distro/include/ptest-packagelists.inc
> > > b/meta/conf/distro/include/ptest-packagelists.inc index
> > > 3872bdc942..e460ad1c8b 100644 ---
> > > a/meta/conf/distro/include/ptest-packagelists.inc +++
> > > b/meta/conf/distro/include/ptest-packagelists.inc @@ -59,6 +59,7 @@
> > > PTESTS_FAST = "\ slang-ptest \
> > >   wayland-ptest \
> > >   zlib-ptest \
> > > +glibc-tests-ptest \
> > >   "
> > >   PTESTS_FAST:remove:mips64 = "qemu-ptest"
> > >   PTESTS_PROBLEMS:append:mips64 = "qemu-ptest"
> > > diff --git a/meta/recipes-core/glibc/glibc-tests_2.34.bb
> > > b/meta/recipes-core/glibc/glibc-tests_2.34.bb new file mode 100644
> > > index 00..896809f700
> > > --- /dev/null
> > > +++ b/meta/recipes-core/glibc/glibc-tests_2.34.bb
> > > @@ -0,0 +1,101 @@
> > > +require glibc_${PV}.bb
> > > +require glibc-tests.inc
> > > +
> > > +inherit ptest
> > > +
> > > +SRC_URI:append = " \
> > > +   file://run-ptest-all file://run-ptest-time \
> > > +"
> > > +
> > > +SUMMARY = "glibc tests to be run with ptest"
> > > +
> > > +# Erase some variables already set by glibc_${PV}
> > > +python __anonymous() {
> > > +   # Remove packages provided by glibc build, we only need a
> > > subset of them
> > > +   d.setVar("PACKAGES", "${PN}")
> > > +
> > > +   d.setVar("PROVIDES", "${PN}")
> > > +   d.setVar("RPROVIDES", "${PN} glibc-ptest")
> > > +
> > > +   d.setVar("RRECOMMENDS", "")
> > > +}
> > > +
> > > +# Remove any lefovers from original glibc recipe
> > > +RPROVIDES:${PN} = "${PN}"
> > > +RRECOMMENDS:${PN} = ""
> > > +RDEPENDS:${PN} = "sed"
> > > +
> > > +# Just build tests for target - do not run them
> > > +do_check:append () {
> > > +   oe_runmake -i check run-built-tests=no
> > > +}
> > > +addtask do_check after do_compile before do_install_ptest_base
> > > +
> > > +glibc_strip_build_directory () {
> > > +   # Delete all non executable files from build directory
> > > +   find ${B} ! -executable -type f -delete
> > > +
> > > +   # Remove build dynamic libraries and links to them as
> > > +   # those are already installed in the target device
> > > +   

Re: [OE-core] [PATCH 2/2] glibc: ptest: Add support for running glibc test suite with ptest

2021-08-23 Thread ?ukasz Majewski
Hi Khem,

> On 8/23/21 8:08 AM, ?ukasz Majewski wrote:
> > This patch introduces new recipe - namely 'glibc-tests', which
> > builds and installs glibc test suite to OE/Yocto built image.
> > 
> > It reuses code from already available 'glibc-testsuite' recipe,
> > which is run with 'bitbake glibc-testsuite -c check' and uses qemu
> > to execute remotely (via SSH) tests on some emulated machine.
> > 
> > This recipe installs eligible tests on some rootfs image.
> > Afterwards, either all of them or only time related subset, those
> > tests can be executed on the real hardware, to facilitate validation
> > of this platform with for example Y2038 problem compliance.
> > 
> > By default all tests are executed, with 'ptest-runner glibc-tests'.
> > To test only time related subset - one needs to call:
> > cd /usr/lib/glibc-tests/ptest/; rm run-ptest; \
> > ln -s run-ptest-time run-ptest; cd -; ptest-runner glibc-tests
> > 
> > To facilitate debugging, source files are provided by default with
> > the unstripped debugging symbols. Such approach would reduce the
> > already complex recipe (as it inherits base glibc one), so there
> > is no need to also install *-dbg and *-src packages.  
> 
> 
> does it have to be a separate recipe I wonder if we can have it built
> as part of glibc itself controlled via ptest knob

I've followed the glibc-testsuite recipe to provide tests for ptest.
Test creation is similar to it, but doesn't require QEMU run (tests are
executed on the HW).

Another rationale was to have some kind of "features" separation in
different file (liked glibc-mtrace), which is easier to maintain and
review.

Last but not least - separate recipe (and built binaries) allow some
kind of magic with selection of used test programs (this may be useful
if one would like to have different sets of tests in different packages)

> 
> > 
> > Signed-off-by: Lukasz Majewski 
> > ---
> >   .../distro/include/ptest-packagelists.inc |   1 +
> >   meta/recipes-core/glibc/glibc-tests_2.34.bb   | 101
> > ++ meta/recipes-core/glibc/glibc/run-ptest-all   |
> > 25 + meta/recipes-core/glibc/glibc/run-ptest-time  |  30 ++
> >   4 files changed, 157 insertions(+)
> >   create mode 100644 meta/recipes-core/glibc/glibc-tests_2.34.bb
> >   create mode 100755 meta/recipes-core/glibc/glibc/run-ptest-all
> >   create mode 100755 meta/recipes-core/glibc/glibc/run-ptest-time
> > 
> > diff --git a/meta/conf/distro/include/ptest-packagelists.inc
> > b/meta/conf/distro/include/ptest-packagelists.inc index
> > 3872bdc942..e460ad1c8b 100644 ---
> > a/meta/conf/distro/include/ptest-packagelists.inc +++
> > b/meta/conf/distro/include/ptest-packagelists.inc @@ -59,6 +59,7 @@
> > PTESTS_FAST = "\ slang-ptest \
> >   wayland-ptest \
> >   zlib-ptest \
> > +glibc-tests-ptest \
> >   "
> >   PTESTS_FAST:remove:mips64 = "qemu-ptest"
> >   PTESTS_PROBLEMS:append:mips64 = "qemu-ptest"
> > diff --git a/meta/recipes-core/glibc/glibc-tests_2.34.bb
> > b/meta/recipes-core/glibc/glibc-tests_2.34.bb new file mode 100644
> > index 00..896809f700
> > --- /dev/null
> > +++ b/meta/recipes-core/glibc/glibc-tests_2.34.bb
> > @@ -0,0 +1,101 @@
> > +require glibc_${PV}.bb
> > +require glibc-tests.inc
> > +
> > +inherit ptest
> > +
> > +SRC_URI:append = " \
> > +   file://run-ptest-all file://run-ptest-time \
> > +"
> > +
> > +SUMMARY = "glibc tests to be run with ptest"
> > +
> > +# Erase some variables already set by glibc_${PV}
> > +python __anonymous() {
> > +   # Remove packages provided by glibc build, we only need a
> > subset of them
> > +   d.setVar("PACKAGES", "${PN}")
> > +
> > +   d.setVar("PROVIDES", "${PN}")
> > +   d.setVar("RPROVIDES", "${PN} glibc-ptest")
> > +
> > +   d.setVar("RRECOMMENDS", "")
> > +}
> > +
> > +# Remove any lefovers from original glibc recipe
> > +RPROVIDES:${PN} = "${PN}"
> > +RRECOMMENDS:${PN} = ""
> > +RDEPENDS:${PN} = "sed"
> > +
> > +# Just build tests for target - do not run them
> > +do_check:append () {
> > +   oe_runmake -i check run-built-tests=no
> > +}
> > +addtask do_check after do_compile before do_install_ptest_base
> > +
> > +glibc_strip_build_directory () {
> > +   # Delete all non executable files from build directory
> > +   find ${B} ! -executable -type f -delete
> > +
> > +   # Remove build dynamic libraries and links to them as
> > +   # those are already installed in the target device
> > +   find ${B} -type f -name "*.so" -delete
> > +   find ${B} -type l -name "*.so*" -delete
> > +
> > +   # Remove headers (installed with glibc)
> > +   find ${B} -type f -name "*.h" -delete
> > +
> > +   find ${B} -type f -name "isomac" -delete
> > +   find ${B} -type f -name "annexc" -delete
> > +}
> > +
> > +do_install_ptest_base () {
> > +   glibc_strip_build_directory
> > +
> > +   # Install build test programs to the image
> > +   install -d ${D}${PTEST_PATH}/tests/glibc-ptest/
> > +   cp -r ${B}/* ${D}${PTEST_PATH}/tests/glibc-ptest/
> > +
> > +   

[OE-core] [meta][dunfell][PATCH] rpm: Add fix for CVE-2021-20266

2021-08-23 Thread Ranjitsinh Rathod
Adding fix for CVE-2021-20266
Upstream-Status: Backport 
[https://github.com/rpm-software-management/rpm/pull/1587/commits/9646711891df851dfbf7ef54cc171574a0914b15]

Note: Hunk#2 and Hunk#3 refreshed to apply patch and match value of
dl_max variable to make it with current version

Signed-off-by: Ranjitsinh Rathod 
---
 .../rpm/files/CVE-2021-20266.patch| 108 ++
 meta/recipes-devtools/rpm/rpm_4.14.2.1.bb |   1 +
 2 files changed, 109 insertions(+)
 create mode 100644 meta/recipes-devtools/rpm/files/CVE-2021-20266.patch

diff --git a/meta/recipes-devtools/rpm/files/CVE-2021-20266.patch 
b/meta/recipes-devtools/rpm/files/CVE-2021-20266.patch
new file mode 100644
index 00..d8b91d4f8e
--- /dev/null
+++ b/meta/recipes-devtools/rpm/files/CVE-2021-20266.patch
@@ -0,0 +1,108 @@
+From 9646711891df851dfbf7ef54cc171574a0914b15 Mon Sep 17 00:00:00 2001
+From: Demi Marie Obenour 
+Date: Mon, 8 Feb 2021 16:05:01 -0500
+Subject: [PATCH] hdrblobInit() needs bounds checks too
+
+Users can pass untrusted data to hdrblobInit() and it must be robust
+against this.
+
+Backported from commit 8f4b3c3cab8922a2022b9e47c71f1ecf906077ef
+
+Upstream-Status: Backport 
[https://github.com/rpm-software-management/rpm/pull/1587/commits/9646711891df851dfbf7ef54cc171574a0914b15]
+CVE: CVE-2021-20266
+Signed-off-by: Ranjitsinh Rathod 
+---
+ lib/header.c | 48 +++-
+ 1 file changed, 31 insertions(+), 17 deletions(-)
+
+diff --git a/lib/header.c b/lib/header.c
+index 6af48e61af..46ded5dd99 100644
+--- a/lib/header.c
 b/lib/header.c
+@@ -11,6 +11,7 @@
+ #include "system.h"
+ #include 
+ #include 
++#include 
+ #include 
+ #include 
+ #include "lib/header_internal.h"
+@@ -1910,6 +1911,25 @@ hdrblob hdrblobFree(hdrblob blob)
+ return NULL;
+ }
+
++static rpmRC hdrblobVerifyLengths(rpmTagVal regionTag, uint32_t il, uint32_t 
dl,
++char **emsg) {
++uint32_t il_max = HEADER_TAGS_MAX;
++uint32_t dl_max = HEADER_DATA_MAX;
++if (regionTag == RPMTAG_HEADERSIGNATURES) {
++  il_max = 32;
++  dl_max = 8192;
++}
++if (hdrchkRange(il_max, il)) {
++  rasprintf(emsg, _("hdr tags: BAD, no. of tags(%" PRIu32 ") out of 
range"), il);
++  return RPMRC_FAIL;
++}
++if (hdrchkRange(dl_max, dl)) {
++  rasprintf(emsg, _("hdr data: BAD, no. of bytes(%" PRIu32 ") out of 
range"), dl);
++  return RPMRC_FAIL;
++}
++return RPMRC_OK;
++}
++
+ rpmRC hdrblobRead(FD_t fd, int magic, int exact_size, rpmTagVal regionTag, 
hdrblob blob, char **emsg)
+ {
+ int32_t block[4];
+@@ -1922,13 +1942,6 @@ rpmRC hdrblobRead(FD_t fd, int magic, int exact_size, 
rpmTagVal regionTag, hdrbl
+ size_t nb;
+ rpmRC rc = RPMRC_FAIL;/* assume failure */
+ int xx;
+-int32_t il_max = HEADER_TAGS_MAX;
+-int32_t dl_max = HEADER_DATA_MAX;
+-
+-if (regionTag == RPMTAG_HEADERSIGNATURES) {
+-  il_max = 32;
+-  dl_max = 8192;
+-}
+
+ memset(block, 0, sizeof(block));
+ if ((xx = Freadall(fd, bs, blen)) != blen) {
+@@ -1941,15 +1954,9 @@ rpmRC hdrblobRead(FD_t fd, int magic, int exact_size, 
rpmTagVal regionTag, hdrbl
+   goto exit;
+ }
+ il = ntohl(block[2]);
+-if (hdrchkRange(il_max, il)) {
+-  rasprintf(emsg, _("hdr tags: BAD, no. of tags(%d) out of range"), il);
+-  goto exit;
+-}
+ dl = ntohl(block[3]);
+-if (hdrchkRange(dl_max, dl)) {
+-  rasprintf(emsg, _("hdr data: BAD, no. of bytes(%d) out of range"), dl);
++if (hdrblobVerifyLengths(regionTag, il, dl, emsg))
+   goto exit;
+-}
+
+ nb = (il * sizeof(struct entryInfo_s)) + dl;
+ uc = sizeof(il) + sizeof(dl) + nb;
+@@ -1993,11 +2000,18 @@ rpmRC hdrblobInit(const void *uh, size_t uc,
+   struct hdrblob_s *blob, char **emsg)
+ {
+ rpmRC rc = RPMRC_FAIL;
+-
+ memset(blob, 0, sizeof(*blob));
++if (uc && uc < 8) {
++  rasprintf(emsg, _("hdr length: BAD"));
++  goto exit;
++}
++
+ blob->ei = (int32_t *) uh; /* discards const */
+-blob->il = ntohl(blob->ei[0]);
+-blob->dl = ntohl(blob->ei[1]);
++blob->il = ntohl((uint32_t)(blob->ei[0]));
++blob->dl = ntohl((uint32_t)(blob->ei[1]));
++if (hdrblobVerifyLengths(regionTag, blob->il, blob->dl, emsg) != RPMRC_OK)
++  goto exit;
++
+ blob->pe = (entryInfo) &(blob->ei[2]);
+ blob->pvlen = sizeof(blob->il) + sizeof(blob->dl) +
+ (blob->il * sizeof(*blob->pe)) + blob->dl;
diff --git a/meta/recipes-devtools/rpm/rpm_4.14.2.1.bb 
b/meta/recipes-devtools/rpm/rpm_4.14.2.1.bb
index 018b2f8700..c93654aa8f 100644
--- a/meta/recipes-devtools/rpm/rpm_4.14.2.1.bb
+++ b/meta/recipes-devtools/rpm/rpm_4.14.2.1.bb
@@ -45,6 +45,7 @@ SRC_URI = 
"git://github.com/rpm-software-management/rpm;branch=rpm-4.14.x \

file://0001-Rip-out-partial-support-for-unused-MD2-and-RIPEMD160.patch \

Re: [OE-core] [PATCH] buildhistory: Add output file listing package information

2021-08-23 Thread Andres Beltran

Hello,

This is a reminder request for review.

Best,
Andres Beltran


On 8/12/2021 9:58 AM, Andres Beltran wrote:

Currently, buildhistory does not produce a single file combining relevant
information of installed packages. Produce an output file
"installed-package-info.txt" listing a package's runtime name, buildtime name,
its recipe, version, and size to avoid having to look up each package 
externally.
Leave the existing package list files as-is for backwards compatibility.

In order to support this efficiently, extend oe-pkgdata-util to accept multiple 
keys
for its read-value argument.

Signed-off-by: Andres Beltran 
---
  meta/classes/buildhistory.bbclass |  5 +
  scripts/oe-pkgdata-util   | 37 +++
  2 files changed, 28 insertions(+), 14 deletions(-)

diff --git a/meta/classes/buildhistory.bbclass 
b/meta/classes/buildhistory.bbclass
index 8a1359acbe..134b56ab71 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -491,6 +491,11 @@ buildhistory_get_installed() {
cat $1/installed-package-sizes.tmp | awk '{print $2 "\tKiB\t" $1}' | sort 
-n -r > $1/installed-package-sizes.txt
rm $1/installed-package-sizes.tmp
  
+	# Produce package info: runtime_name, buildtime_name, recipe, version, size

+   oe-pkgdata-util -p ${PKGDATA_DIR} read-value "PACKAGE,PN,PV,PKGSIZE" -n -f 
$pkgcache > $1/installed-package-info.tmp
+   cat $1/installed-package-info.tmp | sort -n -r -k 5 > 
$1/installed-package-info.txt
+   rm $1/installed-package-info.tmp
+
# We're now done with the cache, delete it
rm $pkgcache
  
diff --git a/scripts/oe-pkgdata-util b/scripts/oe-pkgdata-util

index 75dd23efa3..c30baaa580 100755
--- a/scripts/oe-pkgdata-util
+++ b/scripts/oe-pkgdata-util
@@ -171,7 +171,7 @@ def read_value(args):
  val = line.split(': ', 1)[1].rstrip()
  return val
  
-logger.debug("read-value('%s', '%s' '%s')" % (args.pkgdata_dir, args.valuename, packages))

+logger.debug("read-value('%s', '%s' '%s')" % (args.pkgdata_dir, 
args.valuenames, packages))
  for package in packages:
  pkg_split = package.split('_')
  pkg_name = pkg_split[0]
@@ -180,20 +180,29 @@ def read_value(args):
  logger.debug(revlink)
  if os.path.exists(revlink):
  mappedpkg = os.path.basename(os.readlink(revlink))
-qvar = args.valuename
-value = readvar(revlink, qvar, mappedpkg)
-if qvar == "PKGSIZE":
-# PKGSIZE is now in bytes, but we we want it in KB
-pkgsize = (int(value) + 1024 // 2) // 1024
-value = "%d" % pkgsize
-if args.unescape:
-import codecs
-# escape_decode() unescapes backslash encodings in byte streams
-value = codecs.escape_decode(bytes(value, 
"utf-8"))[0].decode("utf-8")
+qvars = args.valuenames
+val_names = qvars.split(',')
+values = []
+for qvar in val_names:
+if qvar == "PACKAGE":
+value = mappedpkg
+else:
+value = readvar(revlink, qvar, mappedpkg)
+if qvar == "PKGSIZE":
+# PKGSIZE is now in bytes, but we we want it in KB
+pkgsize = (int(value) + 1024 // 2) // 1024
+value = "%d" % pkgsize
+if args.unescape:
+import codecs
+# escape_decode() unescapes backslash encodings in byte 
streams
+value = codecs.escape_decode(bytes(value, 
"utf-8"))[0].decode("utf-8")
+values.append(value)
+
+values_str = ' '.join(values)
  if args.prefix_name:
-print('%s %s' % (pkg_name, value))
+print('%s %s' % (pkg_name, values_str))
  else:
-print(value)
+print(values_str)
  else:
  logger.debug("revlink %s does not exist", revlink)
  
@@ -570,7 +579,7 @@ def main():

  parser_read_value = subparsers.add_parser('read-value',
help='Read any pkgdata value for 
one or more packages',
description='Reads the named value 
from the pkgdata files for the specified packages')
-parser_read_value.add_argument('valuename', help='Name of the value to 
look up')
+parser_read_value.add_argument('valuenames', help='Name of the value/s to 
look up (separated by commas, no spaces)')
  parser_read_value.add_argument('pkg', nargs='*', help='Runtime package 
name to look up')
  parser_read_value.add_argument('-f', '--file', help='Read package names 
from the specified file (one per line, first field only)')
  parser_read_value.add_argument('-n', '--prefix-name', help='Prefix output 
with package name', action='store_true')


[OE-core][dunfell][PATCH v2] mklibs-native: drop deprecated cpp17 exceptions

2021-08-23 Thread Andrej Valek
gcc11 has -std=gnu++17 as default. Remove deprecated C++17 exceptions based
on http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0003r5.html.

Signed-off-by: Andrej Valek 
---
 ...-deprecated-exception-specification-cpp17.patch | 431 +
 .../mklibs/mklibs-native_0.1.44.bb |   1 +
 2 files changed, 432 insertions(+)
 create mode 100644 
meta/recipes-devtools/mklibs/files/remove-deprecated-exception-specification-cpp17.patch

diff --git 
a/meta/recipes-devtools/mklibs/files/remove-deprecated-exception-specification-cpp17.patch
 
b/meta/recipes-devtools/mklibs/files/remove-deprecated-exception-specification-cpp17.patch
new file mode 100644
index 00..f96cc7d302
--- /dev/null
+++ 
b/meta/recipes-devtools/mklibs/files/remove-deprecated-exception-specification-cpp17.patch
@@ -0,0 +1,431 @@
+From 597c7a8333df84a87cc48fb8477b603ffbf372a6 Mon Sep 17 00:00:00 2001
+From: Andrej Valek 
+Date: Mon, 23 Aug 2021 12:45:11 +0200
+Subject: [PATCH] feat(cpp17): remove deprecated exception specifications for
+ C++ 17
+
+Upstream-Status: Submitted 
[https://salsa.debian.org/installer-team/mklibs/-/merge_requests/2]
+
+based on: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0003r5.html
+
+Signed-off-by: Andrej Valek 
+---
+ src/mklibs-readelf/elf.cpp  | 48 -
+ src/mklibs-readelf/elf.hpp  | 18 
+ src/mklibs-readelf/elf_data.hpp | 36 +++
+ 3 files changed, 51 insertions(+), 51 deletions(-)
+
+diff --git a/src/mklibs-readelf/elf.cpp b/src/mklibs-readelf/elf.cpp
+index 0e4c0f3..2e6d0f6 100644
+--- a/src/mklibs-readelf/elf.cpp
 b/src/mklibs-readelf/elf.cpp
+@@ -36,7 +36,7 @@ file::~file () throw ()
+ delete *it;
+ }
+ 
+-file *file::open (const char *filename) throw (std::bad_alloc, 
std::runtime_error)
++file *file::open (const char *filename) throw ()
+ {
+   struct stat buf;
+   int fd;
+@@ -72,7 +72,7 @@ file *file::open (const char *filename) throw 
(std::bad_alloc, std::runtime_erro
+ }
+ 
+ template
+-file *file::open_class(uint8_t *mem, size_t len) throw (std::bad_alloc, 
std::runtime_error)
++file *file::open_class(uint8_t *mem, size_t len) throw ()
+ {
+   switch (mem[EI_DATA])
+   {
+@@ -86,7 +86,7 @@ file *file::open_class(uint8_t *mem, size_t len) throw 
(std::bad_alloc, std::run
+ }
+ 
+ template 
+-file_data<_class, _data>::file_data(uint8_t *mem, size_t len) throw 
(std::bad_alloc, std::runtime_error)
++file_data<_class, _data>::file_data(uint8_t *mem, size_t len) throw ()
+ : file(mem, len)
+ {
+   if (mem[EI_CLASS] != _class::id)
+@@ -190,7 +190,7 @@ section_data<_class, _data>::section_data(Shdr *shdr, 
uint8_t *mem) throw ()
+ }
+ 
+ template 
+-void section_data<_class, _data>::update(const file ) throw 
(std::bad_alloc)
++void section_data<_class, _data>::update(const file ) throw ()
+ {
+   const section_type  =
+ dynamic_cast 
&>(file.get_section(file.get_shstrndx()));
+@@ -204,7 +204,7 @@ section_type::~section_type() throw 
()
+ }
+ 
+ template 
+-section_real<_class, _data, section_type_DYNAMIC>::section_real(Shdr *header, 
uint8_t *mem) throw (std::bad_alloc)
++section_real<_class, _data, section_type_DYNAMIC>::section_real(Shdr *header, 
uint8_t *mem) throw ()
+ : section_data<_class, _data>(header, mem)
+ {
+   if (this->type != SHT_DYNAMIC)
+@@ -221,7 +221,7 @@ section_real<_class, _data, 
section_type_DYNAMIC>::section_real(Shdr *header, ui
+ }
+ 
+ template 
+-void section_real<_class, _data, section_type_DYNAMIC>::update(const file 
) throw (std::bad_alloc)
++void section_real<_class, _data, section_type_DYNAMIC>::update(const file 
) throw ()
+ {
+   section_data<_class, _data>::update(file);
+ 
+@@ -243,7 +243,7 @@ section_type::~section_type() throw ()
+ }
+ 
+ template 
+-section_real<_class, _data, section_type_DYNSYM>::section_real(Shdr *header, 
uint8_t *mem) throw (std::bad_alloc)
++section_real<_class, _data, section_type_DYNSYM>::section_real(Shdr *header, 
uint8_t *mem) throw ()
+ : section_data<_class, _data>(header, mem)
+ {
+   if (this->type != SHT_DYNSYM)
+@@ -260,7 +260,7 @@ section_real<_class, _data, 
section_type_DYNSYM>::section_real(Shdr *header, uin
+ }
+ 
+ template 
+-void section_real<_class, _data, section_type_DYNSYM>::update(const file 
) throw (std::bad_alloc)
++void section_real<_class, _data, section_type_DYNSYM>::update(const file 
) throw ()
+ {
+   section_data<_class, _data>::update (file);
+ 
+@@ -285,7 +285,7 @@ const version_definition 
*section_type::get_version_def
+ }
+ 
+ template 
+-section_real<_class, _data, section_type_GNU_VERDEF>::section_real(Shdr 
*header, uint8_t *mem) throw (std::bad_alloc)
++section_real<_class, _data, section_type_GNU_VERDEF>::section_real(Shdr 
*header, uint8_t *mem) throw ()
+ : section_data<_class, _data>(header, mem)
+ {
+   if (this->type != SHT_GNU_verdef)
+@@ -307,7 +307,7 @@ section_real<_class, _data, 
section_type_GNU_VERDEF>::section_real(Shdr *header,
+ 

Re: [OE-core][PATCH] vim: add option to disable NLS support

2021-08-23 Thread Andrej Valek
Hello Khem,

I looked exactly into configure.ac which arguments are expecting for those 
options. So I think, it has to be mentioned explicitly. 

Regards,
Andrej

> On 8/23/21 3:12 AM, Andrej Valek wrote:
>> - Some distributions with UTF-8 locale have problem when National Language
>>   Support is enabled. Add there an option to disable it.
>> - refresh options based on configure.ac
>> 
>> Signed-off-by: Andrej Valek 
>> ---
>>   meta/recipes-support/vim/vim.inc | 8 +---
>>   1 file changed, 5 insertions(+), 3 deletions(-)
>> 
>> diff --git a/meta/recipes-support/vim/vim.inc 
>> b/meta/recipes-support/vim/vim.inc
>> index 17d1c24a7c..7cc47884f2 100644
>> --- a/meta/recipes-support/vim/vim.inc
>> +++ b/meta/recipes-support/vim/vim.inc
>> @@ -54,19 +54,21 @@ do_compile() {
>>   autotools_do_compile
>>   }
>>   
>> -#Available PACKAGECONFIG options are gtkgui, acl, x11, tiny
>> +#Available PACKAGECONFIG options are gtkgui, acl, x11, tiny, selinux, 
>> +elfutils, nls
>>   PACKAGECONFIG ??= ""
>>   PACKAGECONFIG += " \
>>   ${@bb.utils.filter('DISTRO_FEATURES', 'acl selinux', d)} \
>>   ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11 gtkgui', '', 
>> d)} \
>> +nls \
>>   "
>>   
>>   PACKAGECONFIG[gtkgui] = "--enable-gui=gtk3,--enable-gui=no,gtk+3"
>> -PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl,"
>> +PACKAGECONFIG[acl] = "enable_acl="yes",--disable-acl,acl,"
>
>is 'yes' needed to be explicit ? I thought --enable-XYZ meant it implicitly
>
>>   PACKAGECONFIG[x11] = "--with-x,--without-x,xt,"
>>   PACKAGECONFIG[tiny] = "--with-features=tiny,--with-features=big,,"
>> -PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux,"
>> +PACKAGECONFIG[selinux] = 
>> "enable_selinux="yes",--disable-selinux,libselinux,"
>>   PACKAGECONFIG[elfutils] = "--enable-elf-check,,elfutils,"
>> +PACKAGECONFIG[nls] = "enable_nls="yes",--disable-nls,,"
>>   
>>   EXTRA_OECONF = " \
>>   --disable-gpm \

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#155184): 
https://lists.openembedded.org/g/openembedded-core/message/155184
Mute This Topic: https://lists.openembedded.org/mt/85082071/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] glibc: ptest: Add support for running glibc test suite with ptest

2021-08-23 Thread Khem Raj



On 8/23/21 8:08 AM, ?ukasz Majewski wrote:

This patch introduces new recipe - namely 'glibc-tests', which
builds and installs glibc test suite to OE/Yocto built image.

It reuses code from already available 'glibc-testsuite' recipe,
which is run with 'bitbake glibc-testsuite -c check' and uses qemu
to execute remotely (via SSH) tests on some emulated machine.

This recipe installs eligible tests on some rootfs image.
Afterwards, either all of them or only time related subset, those
tests can be executed on the real hardware, to facilitate validation
of this platform with for example Y2038 problem compliance.

By default all tests are executed, with 'ptest-runner glibc-tests'.
To test only time related subset - one needs to call:
cd /usr/lib/glibc-tests/ptest/; rm run-ptest; \
ln -s run-ptest-time run-ptest; cd -; ptest-runner glibc-tests

To facilitate debugging, source files are provided by default with
the unstripped debugging symbols. Such approach would reduce the
already complex recipe (as it inherits base glibc one), so there
is no need to also install *-dbg and *-src packages.



does it have to be a separate recipe I wonder if we can have it built as 
part of glibc itself controlled via ptest knob




Signed-off-by: Lukasz Majewski 
---
  .../distro/include/ptest-packagelists.inc |   1 +
  meta/recipes-core/glibc/glibc-tests_2.34.bb   | 101 ++
  meta/recipes-core/glibc/glibc/run-ptest-all   |  25 +
  meta/recipes-core/glibc/glibc/run-ptest-time  |  30 ++
  4 files changed, 157 insertions(+)
  create mode 100644 meta/recipes-core/glibc/glibc-tests_2.34.bb
  create mode 100755 meta/recipes-core/glibc/glibc/run-ptest-all
  create mode 100755 meta/recipes-core/glibc/glibc/run-ptest-time

diff --git a/meta/conf/distro/include/ptest-packagelists.inc 
b/meta/conf/distro/include/ptest-packagelists.inc
index 3872bdc942..e460ad1c8b 100644
--- a/meta/conf/distro/include/ptest-packagelists.inc
+++ b/meta/conf/distro/include/ptest-packagelists.inc
@@ -59,6 +59,7 @@ PTESTS_FAST = "\
  slang-ptest \
  wayland-ptest \
  zlib-ptest \
+glibc-tests-ptest \
  "
  PTESTS_FAST:remove:mips64 = "qemu-ptest"
  PTESTS_PROBLEMS:append:mips64 = "qemu-ptest"
diff --git a/meta/recipes-core/glibc/glibc-tests_2.34.bb 
b/meta/recipes-core/glibc/glibc-tests_2.34.bb
new file mode 100644
index 00..896809f700
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc-tests_2.34.bb
@@ -0,0 +1,101 @@
+require glibc_${PV}.bb
+require glibc-tests.inc
+
+inherit ptest
+
+SRC_URI:append = " \
+   file://run-ptest-all file://run-ptest-time \
+"
+
+SUMMARY = "glibc tests to be run with ptest"
+
+# Erase some variables already set by glibc_${PV}
+python __anonymous() {
+   # Remove packages provided by glibc build, we only need a subset of them
+   d.setVar("PACKAGES", "${PN}")
+
+   d.setVar("PROVIDES", "${PN}")
+   d.setVar("RPROVIDES", "${PN} glibc-ptest")
+
+   d.setVar("RRECOMMENDS", "")
+}
+
+# Remove any lefovers from original glibc recipe
+RPROVIDES:${PN} = "${PN}"
+RRECOMMENDS:${PN} = ""
+RDEPENDS:${PN} = "sed"
+
+# Just build tests for target - do not run them
+do_check:append () {
+   oe_runmake -i check run-built-tests=no
+}
+addtask do_check after do_compile before do_install_ptest_base
+
+glibc_strip_build_directory () {
+   # Delete all non executable files from build directory
+   find ${B} ! -executable -type f -delete
+
+   # Remove build dynamic libraries and links to them as
+   # those are already installed in the target device
+   find ${B} -type f -name "*.so" -delete
+   find ${B} -type l -name "*.so*" -delete
+
+   # Remove headers (installed with glibc)
+   find ${B} -type f -name "*.h" -delete
+
+   find ${B} -type f -name "isomac" -delete
+   find ${B} -type f -name "annexc" -delete
+}
+
+do_install_ptest_base () {
+   glibc_strip_build_directory
+
+   # Install build test programs to the image
+   install -d ${D}${PTEST_PATH}/tests/glibc-ptest/
+   cp -r ${B}/* ${D}${PTEST_PATH}/tests/glibc-ptest/
+
+   install -d ${D}${PTEST_PATH}
+   cp ${WORKDIR}/run-ptest-* ${D}${PTEST_PATH}/
+
+   # By default run all glibc tests
+   cd ${D}${PTEST_PATH}/
+   ln -s run-ptest-all run-ptest
+}
+
+# The datadir directory is required to allow core (and reused)
+# glibc cleanup function to finish correctly, as this directory
+# is not created for ptests
+stash_locale_package_cleanup:prepend () {
+   mkdir -p ${PKGD}${datadir}
+}
+
+stash_locale_sysroot_cleanup:prepend () {
+   mkdir -p ${SYSROOT_DESTDIR}${datadir}
+}
+
+# Prevent the do_package() task to set 'libc6' prefix
+# for glibc tests related packages
+python populate_packages:prepend () {
+if d.getVar('DEBIAN_NAMES'):
+d.setVar('DEBIAN_NAMES', '')
+}
+
+FILES:${PN} = "${PTEST_PATH}/* /usr/src/debug/glibc-tests/*"
+
+EXCLUDE_FROM_SHLIBS = "1"
+
+# Install debug data in .debug and sources in /usr/src/debug

Re: [OE-core][PATCH] vim: add option to disable NLS support

2021-08-23 Thread Khem Raj



On 8/23/21 3:12 AM, Andrej Valek wrote:

- Some distributions with UTF-8 locale have problem when National Language
  Support is enabled. Add there an option to disable it.
- refresh options based on configure.ac

Signed-off-by: Andrej Valek 
---
  meta/recipes-support/vim/vim.inc | 8 +---
  1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-support/vim/vim.inc b/meta/recipes-support/vim/vim.inc
index 17d1c24a7c..7cc47884f2 100644
--- a/meta/recipes-support/vim/vim.inc
+++ b/meta/recipes-support/vim/vim.inc
@@ -54,19 +54,21 @@ do_compile() {
  autotools_do_compile
  }
  
-#Available PACKAGECONFIG options are gtkgui, acl, x11, tiny

+#Available PACKAGECONFIG options are gtkgui, acl, x11, tiny, selinux, 
elfutils, nls
  PACKAGECONFIG ??= ""
  PACKAGECONFIG += " \
  ${@bb.utils.filter('DISTRO_FEATURES', 'acl selinux', d)} \
  ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11 gtkgui', '', d)} \
+nls \
  "
  
  PACKAGECONFIG[gtkgui] = "--enable-gui=gtk3,--enable-gui=no,gtk+3"

-PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl,"
+PACKAGECONFIG[acl] = "enable_acl="yes",--disable-acl,acl,"


is 'yes' needed to be explicit ? I thought --enable-XYZ meant it implicitly


  PACKAGECONFIG[x11] = "--with-x,--without-x,xt,"
  PACKAGECONFIG[tiny] = "--with-features=tiny,--with-features=big,,"
-PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux,"
+PACKAGECONFIG[selinux] = "enable_selinux="yes",--disable-selinux,libselinux,"
  PACKAGECONFIG[elfutils] = "--enable-elf-check,,elfutils,"
+PACKAGECONFIG[nls] = "enable_nls="yes",--disable-nls,,"
  
  EXTRA_OECONF = " \

  --disable-gpm \






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



Re: [OE-core][dunfell][PATCH] mklibs-native: drop deprecated cpp17 exceptions

2021-08-23 Thread Khem Raj



On 8/23/21 3:56 AM, Andrej Valek wrote:

gcc11 has -std=gnu++17 as default. Remove deprecated C++17 exceptions based
on http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0003r5.html.

Signed-off-by: Andrej Valek 
---
  ...-deprecated-exception-specification-cpp17.patch | 431 +
  .../mklibs/mklibs-native_0.1.44.bb |   1 +
  2 files changed, 432 insertions(+)
  create mode 100644 
meta/recipes-devtools/mklibs/files/remove-deprecated-exception-specification-cpp17.patch

diff --git 
a/meta/recipes-devtools/mklibs/files/remove-deprecated-exception-specification-cpp17.patch
 
b/meta/recipes-devtools/mklibs/files/remove-deprecated-exception-specification-cpp17.patch
new file mode 100644
index 00..0c4c911976
--- /dev/null
+++ 
b/meta/recipes-devtools/mklibs/files/remove-deprecated-exception-specification-cpp17.patch
@@ -0,0 +1,431 @@
+From 597c7a8333df84a87cc48fb8477b603ffbf372a6 Mon Sep 17 00:00:00 2001
+From: Andrej Valek 
+Date: Mon, 23 Aug 2021 12:45:11 +0200
+Subject: [PATCH] feat(cpp17): remove deprecated exception specifications for
+ C++ 17
+
+Upstream-Status: Submitted


the patch is good. Can you add link to upstream submission here ?


+
+based on: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0003r5.html
+
+Signed-off-by: Andrej Valek 
+---
+ src/mklibs-readelf/elf.cpp  | 48 -
+ src/mklibs-readelf/elf.hpp  | 18 
+ src/mklibs-readelf/elf_data.hpp | 36 +++
+ 3 files changed, 51 insertions(+), 51 deletions(-)
+
+diff --git a/src/mklibs-readelf/elf.cpp b/src/mklibs-readelf/elf.cpp
+index 0e4c0f3..2e6d0f6 100644
+--- a/src/mklibs-readelf/elf.cpp
 b/src/mklibs-readelf/elf.cpp
+@@ -36,7 +36,7 @@ file::~file () throw ()
+ delete *it;
+ }
+
+-file *file::open (const char *filename) throw (std::bad_alloc, 
std::runtime_error)
++file *file::open (const char *filename) throw ()
+ {
+   struct stat buf;
+   int fd;
+@@ -72,7 +72,7 @@ file *file::open (const char *filename) throw 
(std::bad_alloc, std::runtime_erro
+ }
+
+ template
+-file *file::open_class(uint8_t *mem, size_t len) throw (std::bad_alloc, 
std::runtime_error)
++file *file::open_class(uint8_t *mem, size_t len) throw ()
+ {
+   switch (mem[EI_DATA])
+   {
+@@ -86,7 +86,7 @@ file *file::open_class(uint8_t *mem, size_t len) throw 
(std::bad_alloc, std::run
+ }
+
+ template 
+-file_data<_class, _data>::file_data(uint8_t *mem, size_t len) throw 
(std::bad_alloc, std::runtime_error)
++file_data<_class, _data>::file_data(uint8_t *mem, size_t len) throw ()
+ : file(mem, len)
+ {
+   if (mem[EI_CLASS] != _class::id)
+@@ -190,7 +190,7 @@ section_data<_class, _data>::section_data(Shdr *shdr, 
uint8_t *mem) throw ()
+ }
+
+ template 
+-void section_data<_class, _data>::update(const file ) throw 
(std::bad_alloc)
++void section_data<_class, _data>::update(const file ) throw ()
+ {
+   const section_type  =
+ dynamic_cast 
&>(file.get_section(file.get_shstrndx()));
+@@ -204,7 +204,7 @@ section_type::~section_type() throw 
()
+ }
+
+ template 
+-section_real<_class, _data, section_type_DYNAMIC>::section_real(Shdr *header, 
uint8_t *mem) throw (std::bad_alloc)
++section_real<_class, _data, section_type_DYNAMIC>::section_real(Shdr *header, 
uint8_t *mem) throw ()
+ : section_data<_class, _data>(header, mem)
+ {
+   if (this->type != SHT_DYNAMIC)
+@@ -221,7 +221,7 @@ section_real<_class, _data, 
section_type_DYNAMIC>::section_real(Shdr *header, ui
+ }
+
+ template 
+-void section_real<_class, _data, section_type_DYNAMIC>::update(const file 
) throw (std::bad_alloc)
++void section_real<_class, _data, section_type_DYNAMIC>::update(const file 
) throw ()
+ {
+   section_data<_class, _data>::update(file);
+
+@@ -243,7 +243,7 @@ section_type::~section_type() throw ()
+ }
+
+ template 
+-section_real<_class, _data, section_type_DYNSYM>::section_real(Shdr *header, 
uint8_t *mem) throw (std::bad_alloc)
++section_real<_class, _data, section_type_DYNSYM>::section_real(Shdr *header, 
uint8_t *mem) throw ()
+ : section_data<_class, _data>(header, mem)
+ {
+   if (this->type != SHT_DYNSYM)
+@@ -260,7 +260,7 @@ section_real<_class, _data, 
section_type_DYNSYM>::section_real(Shdr *header, uin
+ }
+
+ template 
+-void section_real<_class, _data, section_type_DYNSYM>::update(const file 
) throw (std::bad_alloc)
++void section_real<_class, _data, section_type_DYNSYM>::update(const file 
) throw ()
+ {
+   section_data<_class, _data>::update (file);
+
+@@ -285,7 +285,7 @@ const version_definition 
*section_type::get_version_def
+ }
+
+ template 
+-section_real<_class, _data, section_type_GNU_VERDEF>::section_real(Shdr 
*header, uint8_t *mem) throw (std::bad_alloc)
++section_real<_class, _data, section_type_GNU_VERDEF>::section_real(Shdr 
*header, uint8_t *mem) throw ()
+ : section_data<_class, _data>(header, mem)
+ {
+   if (this->type != SHT_GNU_verdef)
+@@ -307,7 +307,7 @@ section_real<_class, _data, 

[OE-core] [PATCH 1/2] glibc: Exclude common code to build tests to glibc-tests.inc

2021-08-23 Thread ?ukasz Majewski
The common code to build tests has been excluded from glibc-testsuite
recipe to glibc-tests.inc

This code will be reused in the recipe necessary for providing glibc
tests executed with ptest framework.

Signed-off-by: Lukasz Majewski 
---
 meta/recipes-core/glibc/glibc-tests.inc   | 32 
 .../glibc/glibc-testsuite_2.34.bb | 37 ++-
 2 files changed, 36 insertions(+), 33 deletions(-)
 create mode 100644 meta/recipes-core/glibc/glibc-tests.inc

diff --git a/meta/recipes-core/glibc/glibc-tests.inc 
b/meta/recipes-core/glibc/glibc-tests.inc
new file mode 100644
index 00..a8fe160a54
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc-tests.inc
@@ -0,0 +1,32 @@
+EXCLUDE_FROM_WORLD = "1"
+
+# handle PN differences
+FILESEXTRAPATHS:prepend := "${THISDIR}/glibc:"
+
+# setup depends
+INHIBIT_DEFAULT_DEPS = ""
+
+python () {
+libc = d.getVar("PREFERRED_PROVIDER_virtual/libc")
+libclocale = d.getVar("PREFERRED_PROVIDER_virtual/libc-locale")
+if libc != "glibc" or libclocale != "glibc-locale":
+raise bb.parse.SkipRecipe("glibc-testsuite requires that virtual/libc 
is glibc")
+}
+
+DEPENDS += "glibc-locale libgcc gcc-runtime"
+
+# remove the initial depends
+DEPENDS:remove = "libgcc-initial"
+
+do_check[dirs] += "${B}"
+do_check () {
+# clean out previous test results
+oe_runmake tests-clean
+# makefiles don't clean entirely (and also sometimes fails due to too many 
args)
+find ${B} -type f -name "*.out" -delete
+find ${B} -type f -name "*.test-result" -delete
+find ${B}/catgets -name "*.cat" -delete
+find ${B}/conform -name "symlist-*" -delete
+[ ! -e ${B}/timezone/testdata ] || rm -rf ${B}/timezone/testdata
+}
+addtask do_check after do_compile
diff --git a/meta/recipes-core/glibc/glibc-testsuite_2.34.bb 
b/meta/recipes-core/glibc/glibc-testsuite_2.34.bb
index 72aa332171..e8ad2a938b 100644
--- a/meta/recipes-core/glibc/glibc-testsuite_2.34.bb
+++ b/meta/recipes-core/glibc/glibc-testsuite_2.34.bb
@@ -1,30 +1,12 @@
 require glibc_${PV}.bb
+require glibc-tests.inc
 
-EXCLUDE_FROM_WORLD = "1"
+inherit qemu
 
-# handle PN differences
-FILESEXTRAPATHS:prepend := "${THISDIR}/glibc:"
+SRC_URI += "file://check-test-wrapper"
 
 # strip provides
 PROVIDES = ""
-# setup depends
-INHIBIT_DEFAULT_DEPS = ""
-
-python () {
-libc = d.getVar("PREFERRED_PROVIDER_virtual/libc")
-libclocale = d.getVar("PREFERRED_PROVIDER_virtual/libc-locale")
-if libc != "glibc" or libclocale != "glibc-locale":
-raise bb.parse.SkipRecipe("glibc-testsuite requires that virtual/libc 
is glibc")
-}
-
-DEPENDS += "glibc-locale libgcc gcc-runtime"
-
-# remove the initial depends
-DEPENDS:remove = "libgcc-initial"
-
-inherit qemu
-
-SRC_URI += "file://check-test-wrapper"
 
 DEPENDS += "${@'qemu-native' if d.getVar('TOOLCHAIN_TEST_TARGET') == 'user' 
else ''}"
 
@@ -33,20 +15,10 @@ TOOLCHAIN_TEST_HOST ??= "localhost"
 TOOLCHAIN_TEST_HOST_USER ??= "root"
 TOOLCHAIN_TEST_HOST_PORT ??= ""
 
-do_check[dirs] += "${B}"
 do_check[nostamp] = "1"
-do_check () {
+do_check:append () {
 chmod 0755 ${WORKDIR}/check-test-wrapper
 
-# clean out previous test results
-oe_runmake tests-clean
-# makefiles don't clean entirely (and also sometimes fails due to too many 
args)
-find ${B} -type f -name "*.out" -delete
-find ${B} -type f -name "*.test-result" -delete
-find ${B}/catgets -name "*.cat" -delete
-find ${B}/conform -name "symlist-*" -delete
-[ ! -e ${B}/timezone/testdata ] || rm -rf ${B}/timezone/testdata
-
 oe_runmake -i \
 QEMU_SYSROOT="${RECIPE_SYSROOT}" \
 QEMU_OPTIONS="${@qemu_target_binary(d)} ${QEMU_OPTIONS}" \
@@ -56,7 +28,6 @@ do_check () {
 test-wrapper="${WORKDIR}/check-test-wrapper ${TOOLCHAIN_TEST_TARGET}" \
 check
 }
-addtask do_check after do_compile
 
 inherit nopackages
 deltask do_stash_locale
-- 
2.20.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#155179): 
https://lists.openembedded.org/g/openembedded-core/message/155179
Mute This Topic: https://lists.openembedded.org/mt/85087395/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] glibc: ptest: Add support for running glibc test suite with ptest

2021-08-23 Thread ?ukasz Majewski
This patch introduces new recipe - namely 'glibc-tests', which
builds and installs glibc test suite to OE/Yocto built image.

It reuses code from already available 'glibc-testsuite' recipe,
which is run with 'bitbake glibc-testsuite -c check' and uses qemu
to execute remotely (via SSH) tests on some emulated machine.

This recipe installs eligible tests on some rootfs image.
Afterwards, either all of them or only time related subset, those
tests can be executed on the real hardware, to facilitate validation
of this platform with for example Y2038 problem compliance.

By default all tests are executed, with 'ptest-runner glibc-tests'.
To test only time related subset - one needs to call:
cd /usr/lib/glibc-tests/ptest/; rm run-ptest; \
ln -s run-ptest-time run-ptest; cd -; ptest-runner glibc-tests

To facilitate debugging, source files are provided by default with
the unstripped debugging symbols. Such approach would reduce the
already complex recipe (as it inherits base glibc one), so there
is no need to also install *-dbg and *-src packages.

Signed-off-by: Lukasz Majewski 
---
 .../distro/include/ptest-packagelists.inc |   1 +
 meta/recipes-core/glibc/glibc-tests_2.34.bb   | 101 ++
 meta/recipes-core/glibc/glibc/run-ptest-all   |  25 +
 meta/recipes-core/glibc/glibc/run-ptest-time  |  30 ++
 4 files changed, 157 insertions(+)
 create mode 100644 meta/recipes-core/glibc/glibc-tests_2.34.bb
 create mode 100755 meta/recipes-core/glibc/glibc/run-ptest-all
 create mode 100755 meta/recipes-core/glibc/glibc/run-ptest-time

diff --git a/meta/conf/distro/include/ptest-packagelists.inc 
b/meta/conf/distro/include/ptest-packagelists.inc
index 3872bdc942..e460ad1c8b 100644
--- a/meta/conf/distro/include/ptest-packagelists.inc
+++ b/meta/conf/distro/include/ptest-packagelists.inc
@@ -59,6 +59,7 @@ PTESTS_FAST = "\
 slang-ptest \
 wayland-ptest \
 zlib-ptest \
+glibc-tests-ptest \
 "
 PTESTS_FAST:remove:mips64 = "qemu-ptest"
 PTESTS_PROBLEMS:append:mips64 = "qemu-ptest"
diff --git a/meta/recipes-core/glibc/glibc-tests_2.34.bb 
b/meta/recipes-core/glibc/glibc-tests_2.34.bb
new file mode 100644
index 00..896809f700
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc-tests_2.34.bb
@@ -0,0 +1,101 @@
+require glibc_${PV}.bb
+require glibc-tests.inc
+
+inherit ptest
+
+SRC_URI:append = " \
+   file://run-ptest-all file://run-ptest-time \
+"
+
+SUMMARY = "glibc tests to be run with ptest"
+
+# Erase some variables already set by glibc_${PV}
+python __anonymous() {
+   # Remove packages provided by glibc build, we only need a subset of them
+   d.setVar("PACKAGES", "${PN}")
+
+   d.setVar("PROVIDES", "${PN}")
+   d.setVar("RPROVIDES", "${PN} glibc-ptest")
+
+   d.setVar("RRECOMMENDS", "")
+}
+
+# Remove any lefovers from original glibc recipe
+RPROVIDES:${PN} = "${PN}"
+RRECOMMENDS:${PN} = ""
+RDEPENDS:${PN} = "sed"
+
+# Just build tests for target - do not run them
+do_check:append () {
+   oe_runmake -i check run-built-tests=no
+}
+addtask do_check after do_compile before do_install_ptest_base
+
+glibc_strip_build_directory () {
+   # Delete all non executable files from build directory
+   find ${B} ! -executable -type f -delete
+
+   # Remove build dynamic libraries and links to them as
+   # those are already installed in the target device
+   find ${B} -type f -name "*.so" -delete
+   find ${B} -type l -name "*.so*" -delete
+
+   # Remove headers (installed with glibc)
+   find ${B} -type f -name "*.h" -delete
+
+   find ${B} -type f -name "isomac" -delete
+   find ${B} -type f -name "annexc" -delete
+}
+
+do_install_ptest_base () {
+   glibc_strip_build_directory
+
+   # Install build test programs to the image
+   install -d ${D}${PTEST_PATH}/tests/glibc-ptest/
+   cp -r ${B}/* ${D}${PTEST_PATH}/tests/glibc-ptest/
+
+   install -d ${D}${PTEST_PATH}
+   cp ${WORKDIR}/run-ptest-* ${D}${PTEST_PATH}/
+
+   # By default run all glibc tests
+   cd ${D}${PTEST_PATH}/
+   ln -s run-ptest-all run-ptest
+}
+
+# The datadir directory is required to allow core (and reused)
+# glibc cleanup function to finish correctly, as this directory
+# is not created for ptests
+stash_locale_package_cleanup:prepend () {
+   mkdir -p ${PKGD}${datadir}
+}
+
+stash_locale_sysroot_cleanup:prepend () {
+   mkdir -p ${SYSROOT_DESTDIR}${datadir}
+}
+
+# Prevent the do_package() task to set 'libc6' prefix
+# for glibc tests related packages
+python populate_packages:prepend () {
+if d.getVar('DEBIAN_NAMES'):
+d.setVar('DEBIAN_NAMES', '')
+}
+
+FILES:${PN} = "${PTEST_PATH}/* /usr/src/debug/glibc-tests/*"
+
+EXCLUDE_FROM_SHLIBS = "1"
+
+# Install debug data in .debug and sources in /usr/src/debug
+# It is more handy to have _all_ the sources and symbols in one
+# place (package) as this recipe will be used for validation and
+# debugging.
+PACKAGE_DEBUG_SPLIT_STYLE = "debug"
+
+# 

[OE-core] [PATCH v3 3/4] kernel.bbclass: Use full versions for inter-package dependencies

2021-08-23 Thread Zoltan Boszormenyi via lists.openembedded.org
From: Zoltán Böszörményi 

If the kernel configuration enables module signing but no key
is provided, then the kernel generates one during the kernel build.

The current runtime-dependency references (with only package names
without full versions) allow mixed package installations from different
rebuilds of the same kernel version.

This creates an issue because then the modules either don't work
or taint the kernel.

Tighten RDEPENDS with the full package version, i.e. use (= ${EXTENDPKGV})
markers for inter-package dependencies.

The kernel will pull in the kernel-modules subpackage of the same
exact version automatically if KERNEL_SPLIT_MODULES="0" is set.
Otherwise the situation is the same as with the old default with
one subpackage per kernel module where they have to be upgraded
manually.

Signed-off-by: Zoltán Böszörményi 
---
 meta/classes/kernel.bbclass | 13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 6dc5387a9b..9ec7daa17a 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -91,17 +91,18 @@ python __anonymous () {
 kname = d.getVar('KERNEL_PACKAGE_NAME') or "kernel"
 imagedest = d.getVar('KERNEL_IMAGEDEST')
 
+fullver = d.getVar('EXTENDPKGV')
 for type in types.split():
 if bb.data.inherits_class('nopackages', d):
 continue
 typelower = type.lower()
 d.appendVar('PACKAGES', ' %s-image-%s' % (kname, typelower))
 d.setVar('FILES:' + kname + '-image-' + typelower, '/' + imagedest + 
'/' + type + '-${KERNEL_VERSION_NAME}' + ' /' + imagedest + '/' + type)
-d.appendVar('RDEPENDS:%s-image' % kname, ' %s-image-%s' % (kname, 
typelower))
+d.appendVar('RDEPENDS:%s-image' % kname, ' %s-image-%s (= %s)' % 
(kname, typelower, fullver))
 splitmods = d.getVar("KERNEL_SPLIT_MODULES")
 if splitmods != '1':
-d.appendVar('RDEPENDS:%s-image' % kname, ' %s-modules' % kname)
-d.appendVar('RDEPENDS:%s-image-%s' % (kname, typelower), ' 
%s-modules-${KERNEL_VERSION_PKG_NAME}' % kname)
+d.appendVar('RDEPENDS:%s-image' % kname, ' %s-modules (= %s)' % 
(kname, fullver))
+d.appendVar('RDEPENDS:%s-image-%s' % (kname, typelower), ' 
%s-modules-${KERNEL_VERSION_PKG_NAME} (= %s)' % (kname, fullver))
 d.setVar('PKG:%s-modules' % kname, 
'%s-modules-${KERNEL_VERSION_PKG_NAME}' % kname)
 d.appendVar('RPROVIDES:%s-modules' % kname, 
'%s-modules-${KERNEL_VERSION_PKG_NAME}' % kname)
 
@@ -628,12 +629,12 @@ FILES:${KERNEL_PACKAGE_NAME}-image = ""
 FILES:${KERNEL_PACKAGE_NAME}-dev = "/boot/System.map* /boot/Module.symvers* 
/boot/config* ${KERNEL_SRC_PATH} 
${nonarch_base_libdir}/modules/${KERNEL_VERSION}/build"
 FILES:${KERNEL_PACKAGE_NAME}-vmlinux = "/boot/vmlinux-${KERNEL_VERSION_NAME}"
 FILES:${KERNEL_PACKAGE_NAME}-modules = ""
-RDEPENDS:${KERNEL_PACKAGE_NAME} = "${KERNEL_PACKAGE_NAME}-base"
+RDEPENDS:${KERNEL_PACKAGE_NAME} = "${KERNEL_PACKAGE_NAME}-base (= 
${EXTENDPKGV})"
 # Allow machines to override this dependency if kernel image files are
 # not wanted in images as standard
-RDEPENDS:${KERNEL_PACKAGE_NAME}-base ?= "${KERNEL_PACKAGE_NAME}-image"
+RDEPENDS:${KERNEL_PACKAGE_NAME}-base ?= "${KERNEL_PACKAGE_NAME}-image (= 
${EXTENDPKGV})"
 PKG:${KERNEL_PACKAGE_NAME}-image = 
"${KERNEL_PACKAGE_NAME}-image-${@legitimize_package_name(d.getVar('KERNEL_VERSION'))}"
-RDEPENDS:${KERNEL_PACKAGE_NAME}-image += 
"${@oe.utils.conditional('KERNEL_IMAGETYPE', 'vmlinux', 
'${KERNEL_PACKAGE_NAME}-vmlinux', '', d)}"
+RDEPENDS:${KERNEL_PACKAGE_NAME}-image += 
"${@oe.utils.conditional('KERNEL_IMAGETYPE', 'vmlinux', 
'${KERNEL_PACKAGE_NAME}-vmlinux (= ${EXTENDPKGV})', '', d)}"
 PKG:${KERNEL_PACKAGE_NAME}-base = 
"${KERNEL_PACKAGE_NAME}-${@legitimize_package_name(d.getVar('KERNEL_VERSION'))}"
 RPROVIDES:${KERNEL_PACKAGE_NAME}-base += 
"${KERNEL_PACKAGE_NAME}-${KERNEL_VERSION}"
 ALLOW_EMPTY:${KERNEL_PACKAGE_NAME} = "1"
-- 
2.31.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#155177): 
https://lists.openembedded.org/g/openembedded-core/message/155177
Mute This Topic: https://lists.openembedded.org/mt/85087031/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 v3 4/4] Support zstd-compressed squashfs and cpio initramfs

2021-08-23 Thread Zoltan Boszormenyi via lists.openembedded.org
From: Zoltán Böszörményi 

Signed-off-by: Zoltán Böszörményi 
---
 meta/classes/base.bbclass|  4 
 meta/classes/image_types.bbclass |  6 --
 meta/classes/kernel-fitimage.bbclass |  2 +-
 meta/classes/kernel.bbclass  | 10 --
 4 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 11b65171d9..340ebe7d78 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -631,6 +631,10 @@ python () {
 if path.endswith('.lz4'):
 d.appendVarFlag('do_unpack', 'depends', ' 
lz4-native:do_populate_sysroot')
 
+# *.zst should DEPEND on zstd-native for unpacking
+elif path.endswith('.zst'):
+d.appendVarFlag('do_unpack', 'depends', ' 
zstd-native:do_populate_sysroot')
+
 # *.lz should DEPEND on lzip-native for unpacking
 elif path.endswith('.lz'):
 d.appendVarFlag('do_unpack', 'depends', ' 
lzip-native:do_populate_sysroot')
diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
index e0eb06c1e3..32d4cd4c76 100644
--- a/meta/classes/image_types.bbclass
+++ b/meta/classes/image_types.bbclass
@@ -107,6 +107,7 @@ IMAGE_CMD:squashfs = "mksquashfs ${IMAGE_ROOTFS} 
${IMGDEPLOYDIR}/${IMAGE_NAME}${
 IMAGE_CMD:squashfs-xz = "mksquashfs ${IMAGE_ROOTFS} 
${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.squashfs-xz ${EXTRA_IMAGECMD} 
-noappend -comp xz"
 IMAGE_CMD:squashfs-lzo = "mksquashfs ${IMAGE_ROOTFS} 
${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.squashfs-lzo 
${EXTRA_IMAGECMD} -noappend -comp lzo"
 IMAGE_CMD:squashfs-lz4 = "mksquashfs ${IMAGE_ROOTFS} 
${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.squashfs-lz4 
${EXTRA_IMAGECMD} -noappend -comp lz4"
+IMAGE_CMD:squashfs-zst = "mksquashfs ${IMAGE_ROOTFS} 
${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.squashfs-zst 
${EXTRA_IMAGECMD} -noappend -comp zstd"
 
 IMAGE_CMD:erofs = "mkfs.erofs ${EXTRA_IMAGECMD} 
${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.erofs ${IMAGE_ROOTFS}"
 IMAGE_CMD:erofs-lz4 = "mkfs.erofs -zlz4 ${EXTRA_IMAGECMD} 
${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.erofs-lz4 ${IMAGE_ROOTFS}"
@@ -244,6 +245,7 @@ do_image_squashfs[depends] += 
"squashfs-tools-native:do_populate_sysroot"
 do_image_squashfs_xz[depends] += "squashfs-tools-native:do_populate_sysroot"
 do_image_squashfs_lzo[depends] += "squashfs-tools-native:do_populate_sysroot"
 do_image_squashfs_lz4[depends] += "squashfs-tools-native:do_populate_sysroot"
+do_image_squashfs_zst[depends] += "squashfs-tools-native:do_populate_sysroot"
 do_image_ubi[depends] += "mtd-utils-native:do_populate_sysroot"
 do_image_ubifs[depends] += "mtd-utils-native:do_populate_sysroot"
 do_image_multiubi[depends] += "mtd-utils-native:do_populate_sysroot"
@@ -262,10 +264,10 @@ IMAGE_TYPES = " \
 btrfs \
 iso \
 hddimg \
-squashfs squashfs-xz squashfs-lzo squashfs-lz4 \
+squashfs squashfs-xz squashfs-lzo squashfs-lz4 squashfs-zst \
 ubi ubifs multiubi \
 tar tar.gz tar.bz2 tar.xz tar.lz4 tar.zst \
-cpio cpio.gz cpio.xz cpio.lzma cpio.lz4 \
+cpio cpio.gz cpio.xz cpio.lzma cpio.lz4 cpio.zst \
 wic wic.gz wic.bz2 wic.lzma wic.zst \
 container \
 f2fs \
diff --git a/meta/classes/kernel-fitimage.bbclass 
b/meta/classes/kernel-fitimage.bbclass
index 2ef8f06b14..38e05153e3 100644
--- a/meta/classes/kernel-fitimage.bbclass
+++ b/meta/classes/kernel-fitimage.bbclass
@@ -576,7 +576,7 @@ fitimage_assemble() {
#
if [ "x${ramdiskcount}" = "x1" ] && [ "${INITRAMFS_IMAGE_BUNDLE}" != 
"1" ]; then
# Find and use the first initramfs image archive type we find
-   for img in cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.gz ext2.gz 
cpio; do
+   for img in cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.zst cpio.gz 
ext2.gz cpio; do

initramfs_path="${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.${img}"
echo "Using $initramfs_path"
if [ -e "${initramfs_path}" ]; then
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 9ec7daa17a..ab60e060c6 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -9,6 +9,7 @@ PROVIDES += "${@ "virtual/kernel" if 
(d.getVar("KERNEL_PACKAGE_NAME") == "kernel
 DEPENDS += "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}gcc 
kmod-native bc-native bison-native"
 DEPENDS += "${@bb.utils.contains("INITRAMFS_FSTYPES", "cpio.lzo", 
"lzop-native", "", d)}"
 DEPENDS += "${@bb.utils.contains("INITRAMFS_FSTYPES", "cpio.lz4", 
"lz4-native", "", d)}"
+DEPENDS += "${@bb.utils.contains("INITRAMFS_FSTYPES", "cpio.zst", 
"zstd-native", "", d)}"
 PACKAGE_WRITE_DEPS += "depmodwrapper-cross"
 
 do_deploy[depends] += "depmodwrapper-cross:do_populate_sysroot 
gzip-native:do_populate_sysroot"
@@ -237,7 +238,7 @@ copy_initramfs() {
mkdir -p ${B}/usr
# Find and use the first 

[OE-core] [PATCH v3 2/4] Allow opt-out of split kernel modules

2021-08-23 Thread Zoltan Boszormenyi via lists.openembedded.org
From: Zoltán Böszörményi 

For some use cases, a monolithic kernel-modules package containing
all modules built from the kernel sources may be preferred.
For one, download time is shorter and installation time is faster.

Set KERNEL_SPLIT_MODULES="0" for this in. The default is one subpackage
per module.

Also, adapt kernel.bbclass to KERNEL_SPLIT_MODULES != "1" case
Extra RDEPENDS and other inter-package references are needed in
this case.

Signed-off-by: Zoltán Böszörményi 
---
 meta/classes/kernel-module-split.bbclass | 17 +
 meta/classes/kernel.bbclass  |  7 +++
 2 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/meta/classes/kernel-module-split.bbclass 
b/meta/classes/kernel-module-split.bbclass
index 6c1de4c992..a29c294810 100644
--- a/meta/classes/kernel-module-split.bbclass
+++ b/meta/classes/kernel-module-split.bbclass
@@ -28,6 +28,7 @@ do_install:append() {
install -d ${D}${sysconfdir}/modules-load.d/ 
${D}${sysconfdir}/modprobe.d/
 }
 
+KERNEL_SPLIT_MODULES ?= "1"
 PACKAGESPLITFUNCS:prepend = "split_kernel_module_packages "
 
 KERNEL_MODULES_META_PACKAGE ?= "${@ d.getVar("KERNEL_PACKAGE_NAME") or 
"kernel" }-modules"
@@ -156,18 +157,26 @@ python split_kernel_module_packages () {
 kernel_package_name = d.getVar("KERNEL_PACKAGE_NAME") or "kernel"
 kernel_version = d.getVar("KERNEL_VERSION")
 
+metapkg = d.getVar('KERNEL_MODULES_META_PACKAGE')
+splitmods = d.getVar('KERNEL_SPLIT_MODULES')
+postinst = d.getVar('pkg_postinst:modules')
+postrm = d.getVar('pkg_postrm:modules')
+
+if splitmods != '1':
+etcdir = d.getVar('sysconfdir')
+d.appendVar('FILES:' + metapkg, '%s/modules-load.d/ %s/modprobe.d/ 
%s/modules/' % (etcdir, etcdir, d.getVar("nonarch_base_libdir")))
+d.appendVar('pkg_postinst:%s' % metapkg, postinst)
+d.prependVar('pkg_postrm:%s' % metapkg, postrm);
+return
+
 module_regex = r'^(.*)\.k?o(?:\.(gz|xz|zst))?$'
 
 module_pattern_prefix = d.getVar('KERNEL_MODULE_PACKAGE_PREFIX')
 module_pattern_suffix = d.getVar('KERNEL_MODULE_PACKAGE_SUFFIX')
 module_pattern = module_pattern_prefix + kernel_package_name + 
'-module-%s' + module_pattern_suffix
 
-postinst = d.getVar('pkg_postinst:modules')
-postrm = d.getVar('pkg_postrm:modules')
-
 modules = do_split_packages(d, root='${nonarch_base_libdir}/modules', 
file_regex=module_regex, output_pattern=module_pattern, description='%s kernel 
module', postinst=postinst, postrm=postrm, recursive=True, hook=frob_metadata, 
extra_depends='%s-%s' % (kernel_package_name, kernel_version))
 if modules:
-metapkg = d.getVar('KERNEL_MODULES_META_PACKAGE')
 d.appendVar('RDEPENDS:' + metapkg, ' '+' '.join(modules))
 
 # If modules-load.d and modprobe.d are empty at this point, remove them to
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 027e66eec7..6dc5387a9b 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -98,6 +98,13 @@ python __anonymous () {
 d.appendVar('PACKAGES', ' %s-image-%s' % (kname, typelower))
 d.setVar('FILES:' + kname + '-image-' + typelower, '/' + imagedest + 
'/' + type + '-${KERNEL_VERSION_NAME}' + ' /' + imagedest + '/' + type)
 d.appendVar('RDEPENDS:%s-image' % kname, ' %s-image-%s' % (kname, 
typelower))
+splitmods = d.getVar("KERNEL_SPLIT_MODULES")
+if splitmods != '1':
+d.appendVar('RDEPENDS:%s-image' % kname, ' %s-modules' % kname)
+d.appendVar('RDEPENDS:%s-image-%s' % (kname, typelower), ' 
%s-modules-${KERNEL_VERSION_PKG_NAME}' % kname)
+d.setVar('PKG:%s-modules' % kname, 
'%s-modules-${KERNEL_VERSION_PKG_NAME}' % kname)
+d.appendVar('RPROVIDES:%s-modules' % kname, 
'%s-modules-${KERNEL_VERSION_PKG_NAME}' % kname)
+
 d.setVar('PKG:%s-image-%s' % (kname,typelower), 
'%s-image-%s-${KERNEL_VERSION_PKG_NAME}' % (kname, typelower))
 d.setVar('ALLOW_EMPTY:%s-image-%s' % (kname, typelower), '1')
 d.setVar('pkg_postinst:%s-image-%s' % (kname,typelower), """set +e
-- 
2.31.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#155176): 
https://lists.openembedded.org/g/openembedded-core/message/155176
Mute This Topic: https://lists.openembedded.org/mt/85087029/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 v3 1/4] kernel-module-split.bbclass: Support zstd-compressed modules

2021-08-23 Thread Zoltan Boszormenyi via lists.openembedded.org
From: Zoltán Böszörményi 

Signed-off-by: Zoltán Böszörményi 
---
 meta/classes/kernel-module-split.bbclass | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/meta/classes/kernel-module-split.bbclass 
b/meta/classes/kernel-module-split.bbclass
index b56dd4a9c7..6c1de4c992 100644
--- a/meta/classes/kernel-module-split.bbclass
+++ b/meta/classes/kernel-module-split.bbclass
@@ -44,17 +44,20 @@ python split_kernel_module_packages () {
 def extract_modinfo(file):
 import tempfile, subprocess
 tempfile.tempdir = d.getVar("WORKDIR")
-compressed = re.match( r'.*\.([xg])z$', file)
+compressed = re.match( r'.*\.(gz|xz|zst)$', file)
 tf = tempfile.mkstemp()
 tmpfile = tf[1]
 if compressed:
 tmpkofile = tmpfile + ".ko"
-if compressed.group(1) == 'g':
+if compressed.group(1) == 'gz':
 cmd = "gunzip -dc %s > %s" % (file, tmpkofile)
 subprocess.check_call(cmd, shell=True)
-elif compressed.group(1) == 'x':
+elif compressed.group(1) == 'xz':
 cmd = "xz -dc %s > %s" % (file, tmpkofile)
 subprocess.check_call(cmd, shell=True)
+elif compressed.group(1) == 'zst':
+cmd = "zstd -dc %s > %s" % (file, tmpkofile)
+subprocess.check_call(cmd, shell=True)
 else:
 msg = "Cannot decompress '%s'" % file
 raise msg
@@ -153,7 +156,7 @@ python split_kernel_module_packages () {
 kernel_package_name = d.getVar("KERNEL_PACKAGE_NAME") or "kernel"
 kernel_version = d.getVar("KERNEL_VERSION")
 
-module_regex = r'^(.*)\.k?o(?:\.[xg]z)?$'
+module_regex = r'^(.*)\.k?o(?:\.(gz|xz|zst))?$'
 
 module_pattern_prefix = d.getVar('KERNEL_MODULE_PACKAGE_PREFIX')
 module_pattern_suffix = d.getVar('KERNEL_MODULE_PACKAGE_SUFFIX')
-- 
2.31.1


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



[OE-core] Kernel related bbclass changes

2021-08-23 Thread Zoltan Boszormenyi via lists.openembedded.org
I have been carrying some forked bbclass recipes and I think
these can be beneficial to others, not to mention that I could
get rid of the private forks of these.

v2:
- drop the package_rpm.bbclass / posttrans patch
- squash the previous patches #3 and #4 together (patch #2 now)
- more verbose commit message for patch #3 (previously patch #5)

v3:
- fix commit message for patch #3 (stupid copy)



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#155174): 
https://lists.openembedded.org/g/openembedded-core/message/155174
Mute This Topic: https://lists.openembedded.org/mt/85086832/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 4/4] Support zstd-compressed squashfs and cpio initramfs

2021-08-23 Thread Zoltan Boszormenyi via lists.openembedded.org
From: Zoltán Böszörményi 

Signed-off-by: Zoltán Böszörményi 
---
 meta/classes/base.bbclass|  4 
 meta/classes/image_types.bbclass |  6 --
 meta/classes/kernel-fitimage.bbclass |  2 +-
 meta/classes/kernel.bbclass  | 10 --
 4 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 11b65171d9..340ebe7d78 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -631,6 +631,10 @@ python () {
 if path.endswith('.lz4'):
 d.appendVarFlag('do_unpack', 'depends', ' 
lz4-native:do_populate_sysroot')
 
+# *.zst should DEPEND on zstd-native for unpacking
+elif path.endswith('.zst'):
+d.appendVarFlag('do_unpack', 'depends', ' 
zstd-native:do_populate_sysroot')
+
 # *.lz should DEPEND on lzip-native for unpacking
 elif path.endswith('.lz'):
 d.appendVarFlag('do_unpack', 'depends', ' 
lzip-native:do_populate_sysroot')
diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
index e0eb06c1e3..32d4cd4c76 100644
--- a/meta/classes/image_types.bbclass
+++ b/meta/classes/image_types.bbclass
@@ -107,6 +107,7 @@ IMAGE_CMD:squashfs = "mksquashfs ${IMAGE_ROOTFS} 
${IMGDEPLOYDIR}/${IMAGE_NAME}${
 IMAGE_CMD:squashfs-xz = "mksquashfs ${IMAGE_ROOTFS} 
${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.squashfs-xz ${EXTRA_IMAGECMD} 
-noappend -comp xz"
 IMAGE_CMD:squashfs-lzo = "mksquashfs ${IMAGE_ROOTFS} 
${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.squashfs-lzo 
${EXTRA_IMAGECMD} -noappend -comp lzo"
 IMAGE_CMD:squashfs-lz4 = "mksquashfs ${IMAGE_ROOTFS} 
${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.squashfs-lz4 
${EXTRA_IMAGECMD} -noappend -comp lz4"
+IMAGE_CMD:squashfs-zst = "mksquashfs ${IMAGE_ROOTFS} 
${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.squashfs-zst 
${EXTRA_IMAGECMD} -noappend -comp zstd"
 
 IMAGE_CMD:erofs = "mkfs.erofs ${EXTRA_IMAGECMD} 
${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.erofs ${IMAGE_ROOTFS}"
 IMAGE_CMD:erofs-lz4 = "mkfs.erofs -zlz4 ${EXTRA_IMAGECMD} 
${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.erofs-lz4 ${IMAGE_ROOTFS}"
@@ -244,6 +245,7 @@ do_image_squashfs[depends] += 
"squashfs-tools-native:do_populate_sysroot"
 do_image_squashfs_xz[depends] += "squashfs-tools-native:do_populate_sysroot"
 do_image_squashfs_lzo[depends] += "squashfs-tools-native:do_populate_sysroot"
 do_image_squashfs_lz4[depends] += "squashfs-tools-native:do_populate_sysroot"
+do_image_squashfs_zst[depends] += "squashfs-tools-native:do_populate_sysroot"
 do_image_ubi[depends] += "mtd-utils-native:do_populate_sysroot"
 do_image_ubifs[depends] += "mtd-utils-native:do_populate_sysroot"
 do_image_multiubi[depends] += "mtd-utils-native:do_populate_sysroot"
@@ -262,10 +264,10 @@ IMAGE_TYPES = " \
 btrfs \
 iso \
 hddimg \
-squashfs squashfs-xz squashfs-lzo squashfs-lz4 \
+squashfs squashfs-xz squashfs-lzo squashfs-lz4 squashfs-zst \
 ubi ubifs multiubi \
 tar tar.gz tar.bz2 tar.xz tar.lz4 tar.zst \
-cpio cpio.gz cpio.xz cpio.lzma cpio.lz4 \
+cpio cpio.gz cpio.xz cpio.lzma cpio.lz4 cpio.zst \
 wic wic.gz wic.bz2 wic.lzma wic.zst \
 container \
 f2fs \
diff --git a/meta/classes/kernel-fitimage.bbclass 
b/meta/classes/kernel-fitimage.bbclass
index 2ef8f06b14..38e05153e3 100644
--- a/meta/classes/kernel-fitimage.bbclass
+++ b/meta/classes/kernel-fitimage.bbclass
@@ -576,7 +576,7 @@ fitimage_assemble() {
#
if [ "x${ramdiskcount}" = "x1" ] && [ "${INITRAMFS_IMAGE_BUNDLE}" != 
"1" ]; then
# Find and use the first initramfs image archive type we find
-   for img in cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.gz ext2.gz 
cpio; do
+   for img in cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.zst cpio.gz 
ext2.gz cpio; do

initramfs_path="${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.${img}"
echo "Using $initramfs_path"
if [ -e "${initramfs_path}" ]; then
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 9ec7daa17a..ab60e060c6 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -9,6 +9,7 @@ PROVIDES += "${@ "virtual/kernel" if 
(d.getVar("KERNEL_PACKAGE_NAME") == "kernel
 DEPENDS += "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}gcc 
kmod-native bc-native bison-native"
 DEPENDS += "${@bb.utils.contains("INITRAMFS_FSTYPES", "cpio.lzo", 
"lzop-native", "", d)}"
 DEPENDS += "${@bb.utils.contains("INITRAMFS_FSTYPES", "cpio.lz4", 
"lz4-native", "", d)}"
+DEPENDS += "${@bb.utils.contains("INITRAMFS_FSTYPES", "cpio.zst", 
"zstd-native", "", d)}"
 PACKAGE_WRITE_DEPS += "depmodwrapper-cross"
 
 do_deploy[depends] += "depmodwrapper-cross:do_populate_sysroot 
gzip-native:do_populate_sysroot"
@@ -237,7 +238,7 @@ copy_initramfs() {
mkdir -p ${B}/usr
# Find and use the first 

[OE-core] [PATCH v2 3/4] kernel.bbclass: Use full versions for inter-package dependencies

2021-08-23 Thread Zoltan Boszormenyi via lists.openembedded.org
From: Zoltán Böszörményi 

If the kernel configuration enables module signing but no key
is provided, then the kernel generates one during the kernel build.

The current runtime-dependency references (with only package names
without full versions) allow mixed package installations from different
rebuilds of the same kernel version.

This does create an issue if the kernel configuration enables module
signing but no key is provided, in which case the kernel generates
the signing key during the kernel build.

Tighten RDEPENDS with the full package version, i.e. use (= ${EXTENDPKGV})
markers for inter-package dependencies.

The kernel will pull in the kernel-modules subpackage of the same
exact version automatically if KERNEL_SPLIT_MODULES="0" is set.
Otherwise the situation is the same as with the old default with
one subpackage per kernel module where they have to be upgraded
manually.

Signed-off-by: Zoltán Böszörményi 
---
 meta/classes/kernel.bbclass | 13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 6dc5387a9b..9ec7daa17a 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -91,17 +91,18 @@ python __anonymous () {
 kname = d.getVar('KERNEL_PACKAGE_NAME') or "kernel"
 imagedest = d.getVar('KERNEL_IMAGEDEST')
 
+fullver = d.getVar('EXTENDPKGV')
 for type in types.split():
 if bb.data.inherits_class('nopackages', d):
 continue
 typelower = type.lower()
 d.appendVar('PACKAGES', ' %s-image-%s' % (kname, typelower))
 d.setVar('FILES:' + kname + '-image-' + typelower, '/' + imagedest + 
'/' + type + '-${KERNEL_VERSION_NAME}' + ' /' + imagedest + '/' + type)
-d.appendVar('RDEPENDS:%s-image' % kname, ' %s-image-%s' % (kname, 
typelower))
+d.appendVar('RDEPENDS:%s-image' % kname, ' %s-image-%s (= %s)' % 
(kname, typelower, fullver))
 splitmods = d.getVar("KERNEL_SPLIT_MODULES")
 if splitmods != '1':
-d.appendVar('RDEPENDS:%s-image' % kname, ' %s-modules' % kname)
-d.appendVar('RDEPENDS:%s-image-%s' % (kname, typelower), ' 
%s-modules-${KERNEL_VERSION_PKG_NAME}' % kname)
+d.appendVar('RDEPENDS:%s-image' % kname, ' %s-modules (= %s)' % 
(kname, fullver))
+d.appendVar('RDEPENDS:%s-image-%s' % (kname, typelower), ' 
%s-modules-${KERNEL_VERSION_PKG_NAME} (= %s)' % (kname, fullver))
 d.setVar('PKG:%s-modules' % kname, 
'%s-modules-${KERNEL_VERSION_PKG_NAME}' % kname)
 d.appendVar('RPROVIDES:%s-modules' % kname, 
'%s-modules-${KERNEL_VERSION_PKG_NAME}' % kname)
 
@@ -628,12 +629,12 @@ FILES:${KERNEL_PACKAGE_NAME}-image = ""
 FILES:${KERNEL_PACKAGE_NAME}-dev = "/boot/System.map* /boot/Module.symvers* 
/boot/config* ${KERNEL_SRC_PATH} 
${nonarch_base_libdir}/modules/${KERNEL_VERSION}/build"
 FILES:${KERNEL_PACKAGE_NAME}-vmlinux = "/boot/vmlinux-${KERNEL_VERSION_NAME}"
 FILES:${KERNEL_PACKAGE_NAME}-modules = ""
-RDEPENDS:${KERNEL_PACKAGE_NAME} = "${KERNEL_PACKAGE_NAME}-base"
+RDEPENDS:${KERNEL_PACKAGE_NAME} = "${KERNEL_PACKAGE_NAME}-base (= 
${EXTENDPKGV})"
 # Allow machines to override this dependency if kernel image files are
 # not wanted in images as standard
-RDEPENDS:${KERNEL_PACKAGE_NAME}-base ?= "${KERNEL_PACKAGE_NAME}-image"
+RDEPENDS:${KERNEL_PACKAGE_NAME}-base ?= "${KERNEL_PACKAGE_NAME}-image (= 
${EXTENDPKGV})"
 PKG:${KERNEL_PACKAGE_NAME}-image = 
"${KERNEL_PACKAGE_NAME}-image-${@legitimize_package_name(d.getVar('KERNEL_VERSION'))}"
-RDEPENDS:${KERNEL_PACKAGE_NAME}-image += 
"${@oe.utils.conditional('KERNEL_IMAGETYPE', 'vmlinux', 
'${KERNEL_PACKAGE_NAME}-vmlinux', '', d)}"
+RDEPENDS:${KERNEL_PACKAGE_NAME}-image += 
"${@oe.utils.conditional('KERNEL_IMAGETYPE', 'vmlinux', 
'${KERNEL_PACKAGE_NAME}-vmlinux (= ${EXTENDPKGV})', '', d)}"
 PKG:${KERNEL_PACKAGE_NAME}-base = 
"${KERNEL_PACKAGE_NAME}-${@legitimize_package_name(d.getVar('KERNEL_VERSION'))}"
 RPROVIDES:${KERNEL_PACKAGE_NAME}-base += 
"${KERNEL_PACKAGE_NAME}-${KERNEL_VERSION}"
 ALLOW_EMPTY:${KERNEL_PACKAGE_NAME} = "1"
-- 
2.31.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#155172): 
https://lists.openembedded.org/g/openembedded-core/message/155172
Mute This Topic: https://lists.openembedded.org/mt/85086835/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/4] Allow opt-out of split kernel modules

2021-08-23 Thread Zoltan Boszormenyi via lists.openembedded.org
From: Zoltán Böszörményi 

For some use cases, a monolithic kernel-modules package containing
all modules built from the kernel sources may be preferred.
For one, download time is shorter and installation time is faster.

Set KERNEL_SPLIT_MODULES="0" for this in. The default is one subpackage
per module.

Also, adapt kernel.bbclass to KERNEL_SPLIT_MODULES != "1" case
Extra RDEPENDS and other inter-package references are needed in
this case.

Signed-off-by: Zoltán Böszörményi 
---
 meta/classes/kernel-module-split.bbclass | 17 +
 meta/classes/kernel.bbclass  |  7 +++
 2 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/meta/classes/kernel-module-split.bbclass 
b/meta/classes/kernel-module-split.bbclass
index 6c1de4c992..a29c294810 100644
--- a/meta/classes/kernel-module-split.bbclass
+++ b/meta/classes/kernel-module-split.bbclass
@@ -28,6 +28,7 @@ do_install:append() {
install -d ${D}${sysconfdir}/modules-load.d/ 
${D}${sysconfdir}/modprobe.d/
 }
 
+KERNEL_SPLIT_MODULES ?= "1"
 PACKAGESPLITFUNCS:prepend = "split_kernel_module_packages "
 
 KERNEL_MODULES_META_PACKAGE ?= "${@ d.getVar("KERNEL_PACKAGE_NAME") or 
"kernel" }-modules"
@@ -156,18 +157,26 @@ python split_kernel_module_packages () {
 kernel_package_name = d.getVar("KERNEL_PACKAGE_NAME") or "kernel"
 kernel_version = d.getVar("KERNEL_VERSION")
 
+metapkg = d.getVar('KERNEL_MODULES_META_PACKAGE')
+splitmods = d.getVar('KERNEL_SPLIT_MODULES')
+postinst = d.getVar('pkg_postinst:modules')
+postrm = d.getVar('pkg_postrm:modules')
+
+if splitmods != '1':
+etcdir = d.getVar('sysconfdir')
+d.appendVar('FILES:' + metapkg, '%s/modules-load.d/ %s/modprobe.d/ 
%s/modules/' % (etcdir, etcdir, d.getVar("nonarch_base_libdir")))
+d.appendVar('pkg_postinst:%s' % metapkg, postinst)
+d.prependVar('pkg_postrm:%s' % metapkg, postrm);
+return
+
 module_regex = r'^(.*)\.k?o(?:\.(gz|xz|zst))?$'
 
 module_pattern_prefix = d.getVar('KERNEL_MODULE_PACKAGE_PREFIX')
 module_pattern_suffix = d.getVar('KERNEL_MODULE_PACKAGE_SUFFIX')
 module_pattern = module_pattern_prefix + kernel_package_name + 
'-module-%s' + module_pattern_suffix
 
-postinst = d.getVar('pkg_postinst:modules')
-postrm = d.getVar('pkg_postrm:modules')
-
 modules = do_split_packages(d, root='${nonarch_base_libdir}/modules', 
file_regex=module_regex, output_pattern=module_pattern, description='%s kernel 
module', postinst=postinst, postrm=postrm, recursive=True, hook=frob_metadata, 
extra_depends='%s-%s' % (kernel_package_name, kernel_version))
 if modules:
-metapkg = d.getVar('KERNEL_MODULES_META_PACKAGE')
 d.appendVar('RDEPENDS:' + metapkg, ' '+' '.join(modules))
 
 # If modules-load.d and modprobe.d are empty at this point, remove them to
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 027e66eec7..6dc5387a9b 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -98,6 +98,13 @@ python __anonymous () {
 d.appendVar('PACKAGES', ' %s-image-%s' % (kname, typelower))
 d.setVar('FILES:' + kname + '-image-' + typelower, '/' + imagedest + 
'/' + type + '-${KERNEL_VERSION_NAME}' + ' /' + imagedest + '/' + type)
 d.appendVar('RDEPENDS:%s-image' % kname, ' %s-image-%s' % (kname, 
typelower))
+splitmods = d.getVar("KERNEL_SPLIT_MODULES")
+if splitmods != '1':
+d.appendVar('RDEPENDS:%s-image' % kname, ' %s-modules' % kname)
+d.appendVar('RDEPENDS:%s-image-%s' % (kname, typelower), ' 
%s-modules-${KERNEL_VERSION_PKG_NAME}' % kname)
+d.setVar('PKG:%s-modules' % kname, 
'%s-modules-${KERNEL_VERSION_PKG_NAME}' % kname)
+d.appendVar('RPROVIDES:%s-modules' % kname, 
'%s-modules-${KERNEL_VERSION_PKG_NAME}' % kname)
+
 d.setVar('PKG:%s-image-%s' % (kname,typelower), 
'%s-image-%s-${KERNEL_VERSION_PKG_NAME}' % (kname, typelower))
 d.setVar('ALLOW_EMPTY:%s-image-%s' % (kname, typelower), '1')
 d.setVar('pkg_postinst:%s-image-%s' % (kname,typelower), """set +e
-- 
2.31.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#155171): 
https://lists.openembedded.org/g/openembedded-core/message/155171
Mute This Topic: https://lists.openembedded.org/mt/85086834/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/4] kernel-module-split.bbclass: Support zstd-compressed modules

2021-08-23 Thread Zoltan Boszormenyi via lists.openembedded.org
From: Zoltán Böszörményi 

Signed-off-by: Zoltán Böszörményi 
---
 meta/classes/kernel-module-split.bbclass | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/meta/classes/kernel-module-split.bbclass 
b/meta/classes/kernel-module-split.bbclass
index b56dd4a9c7..6c1de4c992 100644
--- a/meta/classes/kernel-module-split.bbclass
+++ b/meta/classes/kernel-module-split.bbclass
@@ -44,17 +44,20 @@ python split_kernel_module_packages () {
 def extract_modinfo(file):
 import tempfile, subprocess
 tempfile.tempdir = d.getVar("WORKDIR")
-compressed = re.match( r'.*\.([xg])z$', file)
+compressed = re.match( r'.*\.(gz|xz|zst)$', file)
 tf = tempfile.mkstemp()
 tmpfile = tf[1]
 if compressed:
 tmpkofile = tmpfile + ".ko"
-if compressed.group(1) == 'g':
+if compressed.group(1) == 'gz':
 cmd = "gunzip -dc %s > %s" % (file, tmpkofile)
 subprocess.check_call(cmd, shell=True)
-elif compressed.group(1) == 'x':
+elif compressed.group(1) == 'xz':
 cmd = "xz -dc %s > %s" % (file, tmpkofile)
 subprocess.check_call(cmd, shell=True)
+elif compressed.group(1) == 'zst':
+cmd = "zstd -dc %s > %s" % (file, tmpkofile)
+subprocess.check_call(cmd, shell=True)
 else:
 msg = "Cannot decompress '%s'" % file
 raise msg
@@ -153,7 +156,7 @@ python split_kernel_module_packages () {
 kernel_package_name = d.getVar("KERNEL_PACKAGE_NAME") or "kernel"
 kernel_version = d.getVar("KERNEL_VERSION")
 
-module_regex = r'^(.*)\.k?o(?:\.[xg]z)?$'
+module_regex = r'^(.*)\.k?o(?:\.(gz|xz|zst))?$'
 
 module_pattern_prefix = d.getVar('KERNEL_MODULE_PACKAGE_PREFIX')
 module_pattern_suffix = d.getVar('KERNEL_MODULE_PACKAGE_SUFFIX')
-- 
2.31.1


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



[OE-core] Kernel related bbclass changes

2021-08-23 Thread Zoltan Boszormenyi via lists.openembedded.org
I have been carrying some forked bbclass recipes and I think
these can be beneficial to others, not to mention that I could
get rid of the private forks of these.

v2:
- drop the package_rpm.bbclass / posttrans patch
- squash the previous patches #3 and #4 together (patch #2 now)
- more verbose commit message for patch #3 (previously patch #5)



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#155169): 
https://lists.openembedded.org/g/openembedded-core/message/155169
Mute This Topic: https://lists.openembedded.org/mt/85086832/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] [hardknott][PATCH] glibc: Fix CVE-2021-38604

2021-08-23 Thread Vinay Kumar
Hi Anuj,

Sent v2 patch with fix for hunk offsets.
Confirmed with below log.do_patch for both glibc and nativesdk-glibc.

glibc
==
$tail -f -n 9
/ala-lpggp31/vinay/cve/b2/tmp/work/armv7vet2hf-neon-poky-linux-gnueabi/glibc/2.33-r0/temp/log.do_patch
NOTE: Applying patch 'CVE-2021-35942.patch'
(../hardknott-new/meta/recipes-core/glibc/glibc/CVE-2021-35942.patch)
NOTE: Applying patch '0001-CVE-2021-38604.patch'
(../hardknott-new/meta/recipes-core/glibc/glibc/0001-CVE-2021-38604.patch)
NOTE: Applying patch '0002-CVE-2021-38604.patch'
(../hardknott-new/meta/recipes-core/glibc/glibc/0002-CVE-2021-38604.patch)
DEBUG: Python function patch_do_patch finished
DEBUG: Executing shell function do_fix_readlib_c
DEBUG: Shell function do_fix_readlib_c finished
DEBUG: Python function do_patch finished
DEBUG: Executing python function do_qa_patch
DEBUG: Python function do_qa_patch finished

nativesdk-glibc
==
$tail -f -n 9  
/ala-lpggp31/vinay/cve/b2/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-glibc/2.33-r0/temp/log.do_patch
NOTE: Applying patch 'CVE-2021-35942.patch'
(../hardknott-new/meta/recipes-core/glibc/glibc/CVE-2021-35942.patch)
NOTE: Applying patch '0001-CVE-2021-38604.patch'
(../hardknott-new/meta/recipes-core/glibc/glibc/0001-CVE-2021-38604.patch)
NOTE: Applying patch '0002-CVE-2021-38604.patch'
(../hardknott-new/meta/recipes-core/glibc/glibc/0002-CVE-2021-38604.patch)
DEBUG: Python function patch_do_patch finished
DEBUG: Executing shell function do_fix_readlib_c
DEBUG: Shell function do_fix_readlib_c finished
DEBUG: Python function do_patch finished
DEBUG: Executing python function do_qa_patch
DEBUG: Python function do_qa_patch finished

Regards,
Vinay

On Mon, Aug 23, 2021 at 1:16 PM Mittal, Anuj  wrote:
>
> This is giving warnings for nativesdk-glibc:
>
> Applying patch 0001-CVE-2021-38604.patch
> patching file sysdeps/unix/sysv/linux/mq_notify.c
> Hunk #1 succeeded at 132 with fuzz 1 (offset 1 line).
>
>
> Applying patch 0002-CVE-2021-38604.patch
> patching file rt/Makefile
> Hunk #1 succeeded at 44 with fuzz 1 (offset -30 lines).
> patching file rt/tst-bz28213.c
>
>
> The context lines in the patches can be updated with devtool:
>
> devtool modify nativesdk-glibc
> devtool finish --force-patch-refresh nativesdk-glibc 
>
> Thanks,
>
> Anuj
>
> On Wed, 2021-08-18 at 08:42 -0700, Vinay Kumar wrote:
> > Source: https://sourceware.org/git/glibc.git
> > Tracking -- https://sourceware.org/bugzilla/show_bug.cgi?id=28213
> >
> > Backported upstream commits b805aebd42364fe696e417808a700fdb9800c9e8
> > and 4cc79c217744743077bf7a0ec5e0a4318f1e6641
> > to glibc-2.33 source.
> >
> > Upstream-Status: Backport
> > [https://sourceware.org/git/?p=glibc.git;a=commit;h=b805aebd42364fe696e417808a700fdb9800c9e8
> > ]
> > Upstream-Status: Backport
> > [https://sourceware.org/git/?p=glibc.git;a=commit;h=4cc79c217744743077bf7a0ec5e0a4318f1e6641
> > ]
> >
> > Signed-off-by: Vinay Kumar 
> > ---
> >  .../glibc/glibc/0001-CVE-2021-38604.patch |  43 +
> >  .../glibc/glibc/0002-CVE-2021-38604.patch | 150 ++
> >  meta/recipes-core/glibc/glibc_2.33.bb |   2 +
> >  3 files changed, 195 insertions(+)
> >  create mode 100644 meta/recipes-core/glibc/glibc/0001-CVE-2021-
> > 38604.patch
> >  create mode 100644 meta/recipes-core/glibc/glibc/0002-CVE-2021-
> > 38604.patch
> >
> > diff --git a/meta/recipes-core/glibc/glibc/0001-CVE-2021-38604.patch
> > b/meta/recipes-core/glibc/glibc/0001-CVE-2021-38604.patch
> > new file mode 100644
> > index 00..1e94049004
> > --- /dev/null
> > +++ b/meta/recipes-core/glibc/glibc/0001-CVE-2021-38604.patch
> > @@ -0,0 +1,43 @@
> > +From b805aebd42364fe696e417808a700fdb9800c9e8 Mon Sep 17 00:00:00 2001
> > +From: Nikita Popov 
> > +Date: Mon, 9 Aug 2021 20:17:34 +0530
> > +Subject: [PATCH] librt: fix NULL pointer dereference (bug 28213)
> > +
> > +Helper thread frees copied attribute on NOTIFY_REMOVED message
> > +received from the OS kernel.  Unfortunately, it fails to check whether
> > +copied attribute actually exists (data.attr != NULL).  This worked
> > +earlier because free() checks passed pointer before actually
> > +attempting to release corresponding memory.  But
> > +__pthread_attr_destroy assumes pointer is not NULL.
> > +
> > +So passing NULL pointer to __pthread_attr_destroy will result in
> > +segmentation fault.  This scenario is possible if
> > +notification->sigev_notify_attributes == NULL (which means default
> > +thread attributes should be used).
> > +
> > +Upstream-Status: Backport
> > [https://sourceware.org/git/?p=glibc.git;a=commit;h=b805aebd42364fe696e417808a700fdb9800c9e8
> > ]
> > +CVE: CVE-2021-38604
> > +
> > +Signed-off-by: Nikita Popov 
> > +Reviewed-by: Siddhesh Poyarekar 
> > +Signed-off-by: Vinay Kumar 
> > +---
> > + sysdeps/unix/sysv/linux/mq_notify.c | 2 +-
> > + 1 file changed, 1 insertion(+), 1 deletion(-)
> > +
> > +diff --git 

[OE-core] [dunfell][PATCH 1/2] bitbake: fetch2: fix handling of `\` in file:// SRC_URI

2021-08-23 Thread Andrei Gherzan
From: Leif Middelschulte 

Using backslashes in file:// URIs was broken.
Either the resolver would fail or the subsequent `cp` command.
Try to avoid this by putting the filenames into quotes.

Fixes https://bugzilla.yoctoproject.org/show_bug.cgi?id=8161

(Bitbake rev: aa857fa2e9cf3b0e43a9049b04ec4b0b3c779b11)

Signed-off-by: Leif Middelschulte 
Signed-off-by: Richard Purdie 
---
 bitbake/lib/bb/fetch2/__init__.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bitbake/lib/bb/fetch2/__init__.py 
b/bitbake/lib/bb/fetch2/__init__.py
index dc99914cd9..ece07f611c 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -1525,7 +1525,7 @@ class FetchMethod(object):
 if urlpath.find("/") != -1:
 destdir = urlpath.rsplit("/", 1)[0] + '/'
 bb.utils.mkdirhier("%s/%s" % (unpackdir, destdir))
-cmd = 'cp -fpPRH %s %s' % (file, destdir)
+cmd = 'cp -fpPRH "%s" "%s"' % (file, destdir)
 
 if not cmd:
 return
-- 
2.31.1


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



[OE-core] [dunfell][PATCH 2/2] Use the label provided when formating a dos partition

2021-08-23 Thread Andrei Gherzan
From: jbouchard 

Previously the bootimg-pcbios wic plugin was not respecting
the --label option provided from the wks file. The plugin
was setting the label to 'boot'. With this fix, the --label
option is use. If no option are specified, then the default
is 'boot'.

(From OE-Core rev: 0fd7a73c1bd2486b7a022f0f69bbcb2e0d9cb141)

Signed-off-by: jbouchard 
Signed-off-by: Alexandre Belloni 
Signed-off-by: Richard Purdie 
---
 scripts/lib/wic/plugins/source/bootimg-pcbios.py | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/scripts/lib/wic/plugins/source/bootimg-pcbios.py 
b/scripts/lib/wic/plugins/source/bootimg-pcbios.py
index f2639e7004..32e47f1831 100644
--- a/scripts/lib/wic/plugins/source/bootimg-pcbios.py
+++ b/scripts/lib/wic/plugins/source/bootimg-pcbios.py
@@ -186,8 +186,10 @@ class BootimgPcbiosPlugin(SourcePlugin):
 # dosfs image, created by mkdosfs
 bootimg = "%s/boot%s.img" % (cr_workdir, part.lineno)
 
-dosfs_cmd = "mkdosfs -n boot -i %s -S 512 -C %s %d" % \
-(part.fsuuid, bootimg, blocks)
+label = part.label if part.label else "boot"
+
+dosfs_cmd = "mkdosfs -n %s -i %s -S 512 -C %s %d" % \
+(label, part.fsuuid, bootimg, blocks)
 exec_native_cmd(dosfs_cmd, native_sysroot)
 
 mcopy_cmd = "mcopy -i %s -s %s/* ::/" % (bootimg, hdddir)
-- 
2.31.1


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



[OE-core] [hardknott][PATCH v2] glibc: Fix CVE-2021-38604

2021-08-23 Thread Vinay Kumar
Source: https://sourceware.org/git/glibc.git
Tracking -- https://sourceware.org/bugzilla/show_bug.cgi?id=28213

Backported upstream commits b805aebd42364fe696e417808a700fdb9800c9e8 and 
4cc79c217744743077bf7a0ec5e0a4318f1e6641
to glibc-2.33 source.

Upstream-Status: Backport 
[https://sourceware.org/git/?p=glibc.git;a=commit;h=b805aebd42364fe696e417808a700fdb9800c9e8]
Upstream-Status: Backport 
[https://sourceware.org/git/?p=glibc.git;a=commit;h=4cc79c217744743077bf7a0ec5e0a4318f1e6641]

Signed-off-by: Vinay Kumar 
---
 .../glibc/glibc/0001-CVE-2021-38604.patch |  40 +
 .../glibc/glibc/0002-CVE-2021-38604.patch | 147 ++
 meta/recipes-core/glibc/glibc_2.33.bb |   2 +
 3 files changed, 189 insertions(+)
 create mode 100644 meta/recipes-core/glibc/glibc/0001-CVE-2021-38604.patch
 create mode 100644 meta/recipes-core/glibc/glibc/0002-CVE-2021-38604.patch

diff --git a/meta/recipes-core/glibc/glibc/0001-CVE-2021-38604.patch 
b/meta/recipes-core/glibc/glibc/0001-CVE-2021-38604.patch
new file mode 100644
index 00..8a52ac957c
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0001-CVE-2021-38604.patch
@@ -0,0 +1,40 @@
+From b805aebd42364fe696e417808a700fdb9800c9e8 Mon Sep 17 00:00:00 2001
+From: Nikita Popov 
+Date: Mon, 9 Aug 2021 20:17:34 +0530
+Subject: [PATCH] librt: fix NULL pointer dereference (bug 28213)
+
+Helper thread frees copied attribute on NOTIFY_REMOVED message
+received from the OS kernel.  Unfortunately, it fails to check whether
+copied attribute actually exists (data.attr != NULL).  This worked
+earlier because free() checks passed pointer before actually
+attempting to release corresponding memory.  But
+__pthread_attr_destroy assumes pointer is not NULL.
+
+So passing NULL pointer to __pthread_attr_destroy will result in
+segmentation fault.  This scenario is possible if
+notification->sigev_notify_attributes == NULL (which means default
+thread attributes should be used).
+
+Upstream-Status: Backport 
[https://sourceware.org/git/?p=glibc.git;a=commit;h=b805aebd42364fe696e417808a700fdb9800c9e8]
+CVE: CVE-2021-38604
+
+Signed-off-by: Nikita Popov 
+Reviewed-by: Siddhesh Poyarekar 
+Signed-off-by: Vinay Kumar 
+---
+ sysdeps/unix/sysv/linux/mq_notify.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sysdeps/unix/sysv/linux/mq_notify.c 
b/sysdeps/unix/sysv/linux/mq_notify.c
+index 6f46d29d1d..1714e1cc5f 100644
+--- a/sysdeps/unix/sysv/linux/mq_notify.c
 b/sysdeps/unix/sysv/linux/mq_notify.c
+@@ -132,7 +132,7 @@ helper_thread (void *arg)
+  to wait until it is done with it.  */
+   (void) __pthread_barrier_wait (_barrier);
+   }
+-  else if (data.raw[NOTIFY_COOKIE_LEN - 1] == NOTIFY_REMOVED)
++  else if (data.raw[NOTIFY_COOKIE_LEN - 1] == NOTIFY_REMOVED && data.attr 
!= NULL)
+   {
+ /* The only state we keep is the copy of the thread attributes.  */
+ pthread_attr_destroy (data.attr);
diff --git a/meta/recipes-core/glibc/glibc/0002-CVE-2021-38604.patch 
b/meta/recipes-core/glibc/glibc/0002-CVE-2021-38604.patch
new file mode 100644
index 00..b654cdfecb
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0002-CVE-2021-38604.patch
@@ -0,0 +1,147 @@
+From 4cc79c217744743077bf7a0ec5e0a4318f1e6641 Mon Sep 17 00:00:00 2001
+From: Nikita Popov 
+Date: Thu, 12 Aug 2021 16:09:50 +0530
+Subject: [PATCH] librt: add test (bug 28213)
+
+This test implements following logic:
+1) Create POSIX message queue.
+   Register a notification with mq_notify (using NULL attributes).
+   Then immediately unregister the notification with mq_notify.
+   Helper thread in a vulnerable version of glibc
+   should cause NULL pointer dereference after these steps.
+2) Once again, register the same notification.
+   Try to send a dummy message.
+   Test is considered successfulif the dummy message
+   is successfully received by the callback function.
+
+Upstream-Status: Backport 
[https://sourceware.org/git/?p=glibc.git;a=commit;h=4cc79c217744743077bf7a0ec5e0a4318f1e6641]
+CVE: CVE-2021-38604
+
+Signed-off-by: Nikita Popov 
+Reviewed-by: Siddhesh Poyarekar 
+Signed-off-by: Vinay Kumar 
+---
+ rt/Makefile  |   1 +
+ rt/tst-bz28213.c | 101 +++
+ 2 files changed, 102 insertions(+)
+ create mode 100644 rt/tst-bz28213.c
+
+diff --git a/rt/Makefile b/rt/Makefile
+index 7b374f2073..c87d95793a 100644
+--- a/rt/Makefile
 b/rt/Makefile
+@@ -44,6 +44,7 @@ tests := tst-shm tst-timer tst-timer2 \
+tst-aio7 tst-aio8 tst-aio9 tst-aio10 \
+tst-mqueue1 tst-mqueue2 tst-mqueue3 tst-mqueue4 \
+tst-mqueue5 tst-mqueue6 tst-mqueue7 tst-mqueue8 tst-mqueue9 \
++   tst-bz28213 \
+tst-timer3 tst-timer4 tst-timer5 \
+tst-cpuclock2 tst-cputimer1 tst-cputimer2 tst-cputimer3 \
+tst-shm-cancel
+diff --git a/rt/tst-bz28213.c b/rt/tst-bz28213.c
+new file mode 100644
+index 00..0c096b5a0a
+--- /dev/null
 b/rt/tst-bz28213.c

Re: [OE-core] [PATCH 5/6] kernel.bbclass: Use full versions for inter-package dependencies

2021-08-23 Thread Zoltan Boszormenyi via lists.openembedded.org

2021. 08. 23. 15:38 keltezéssel, Bruce Ashfield írta:

On Mon, Aug 23, 2021 at 9:30 AM Böszörményi Zoltán  wrote:


2021. 08. 23. 15:03 keltezéssel, Bruce Ashfield írta:

On Mon, Aug 23, 2021 at 8:23 AM Zoltan Boszormenyi via
lists.openembedded.org  wrote:


From: Zoltán Böszörményi 

Some Yocto users do use package repositories and sometimes the PR
value is forgotten. Use full versions for inter-package dependencies
for the kernel subpackages.


Can you expand this commit message ?


I will send a new version with the expanded message.


What is the observable problem
with the full versions not being in the rdpends ?


Currently the kernel creates such subpackages:

kernel
kernel-x.y.z
kernel-image-x.y.z
kernel-image-bzimage-x.y.z
kernel-modules-x.y.z

and in the split modules case, a lot of

kernel-module-*-x.y.z

RDEPENDS currently only references the package names.

The issue I observe is this: I have enabled kernel module signing
but I don't provide a key, so the kernel will generate one at
every rebuild.

You get the idea what problem this can make if there's a
rebuild:

x.y.z-r0.0 -> x.y.z-r1.0 (in which case the PR value was duly changed)
or
x.y.z-r0.0 -> x.y.z-r0.1 (where not)

It's actually indifferent, but the same issue occurs if
only the kernel-image-bzimage is upgraded: the modules either
won't work or taint the kernel.


Your second example is similar to the times I've seen some module
issues as well, and honestly, I can't recall if it was solved in a
similar way to this (I don't have access to my old repos from Wind
River any more).

But that does make sense to me, and the details you have in this
follow up, make a nice commit explanation.

While opkg may not handle the situation you describe as well as RPM,
we should make sure that the full version doesn't cause issues with
the package generation or standard image creation.


You can bet it doesn't. I have the same patch in a Sumo-based distro
where we still use ipk and opkg and there's no issue in either image
generation or package upgrades. Only that there's no "installonly"
knowledge in opkg (unlike dnf) so old kernel packages have to be
manually cleaned up there.



Cheers,

Bruce



This scenario is currently valid in the package manager because
of the versionless RDEPENDS.



I've run many different package feeds with different kernels and
modules, and haven't run into anything on this front, in my experience
the extended version in the package depends/provides causes issues
with some package managers .. so we'd need the testing for this
documented/provided so we could ensure that there are no hidden
issues.

Bruce




Signed-off-by: Zoltán Böszörményi 
---
   meta/classes/kernel.bbclass | 13 +++--
   1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 6dc5387a9b..9ec7daa17a 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -91,17 +91,18 @@ python __anonymous () {
   kname = d.getVar('KERNEL_PACKAGE_NAME') or "kernel"
   imagedest = d.getVar('KERNEL_IMAGEDEST')

+fullver = d.getVar('EXTENDPKGV')
   for type in types.split():
   if bb.data.inherits_class('nopackages', d):
   continue
   typelower = type.lower()
   d.appendVar('PACKAGES', ' %s-image-%s' % (kname, typelower))
   d.setVar('FILES:' + kname + '-image-' + typelower, '/' + imagedest + 
'/' + type + '-${KERNEL_VERSION_NAME}' + ' /' + imagedest + '/' + type)
-d.appendVar('RDEPENDS:%s-image' % kname, ' %s-image-%s' % (kname, 
typelower))
+d.appendVar('RDEPENDS:%s-image' % kname, ' %s-image-%s (= %s)' % 
(kname, typelower, fullver))
   splitmods = d.getVar("KERNEL_SPLIT_MODULES")
   if splitmods != '1':
-d.appendVar('RDEPENDS:%s-image' % kname, ' %s-modules' % kname)
-d.appendVar('RDEPENDS:%s-image-%s' % (kname, typelower), ' 
%s-modules-${KERNEL_VERSION_PKG_NAME}' % kname)
+d.appendVar('RDEPENDS:%s-image' % kname, ' %s-modules (= %s)' % 
(kname, fullver))
+d.appendVar('RDEPENDS:%s-image-%s' % (kname, typelower), ' 
%s-modules-${KERNEL_VERSION_PKG_NAME} (= %s)' % (kname, fullver))
   d.setVar('PKG:%s-modules' % kname, 
'%s-modules-${KERNEL_VERSION_PKG_NAME}' % kname)
   d.appendVar('RPROVIDES:%s-modules' % kname, 
'%s-modules-${KERNEL_VERSION_PKG_NAME}' % kname)

@@ -628,12 +629,12 @@ FILES:${KERNEL_PACKAGE_NAME}-image = ""
   FILES:${KERNEL_PACKAGE_NAME}-dev = "/boot/System.map* /boot/Module.symvers* 
/boot/config* ${KERNEL_SRC_PATH} 
${nonarch_base_libdir}/modules/${KERNEL_VERSION}/build"
   FILES:${KERNEL_PACKAGE_NAME}-vmlinux = "/boot/vmlinux-${KERNEL_VERSION_NAME}"
   FILES:${KERNEL_PACKAGE_NAME}-modules = ""
-RDEPENDS:${KERNEL_PACKAGE_NAME} = "${KERNEL_PACKAGE_NAME}-base"
+RDEPENDS:${KERNEL_PACKAGE_NAME} = "${KERNEL_PACKAGE_NAME}-base (= 
${EXTENDPKGV})"
   # Allow machines to override this dependency 

Re: [OE-core] [PATCH 1/6] package_rpm.bbclass: Handle posttrans scriptlets

2021-08-23 Thread Zoltan Boszormenyi via lists.openembedded.org

2021. 08. 23. 15:23 keltezéssel, Richard Purdie írta:

On Mon, 2021-08-23 at 15:14 +0200, Zoltan Boszormenyi via lists.openembedded.org
wrote:

It's documented at www.rpm.org, Red Hat and SuSE.

https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/
https://en.opensuse.org/openSUSE:Packaging_scriptlet_snippets
https://rpm-packaging-guide.github.io/

It's available since RPM 4.4. RPM 4.16.1.3 is in Hardknott.

A short Google search showed that *maybe* dpkg also supports it,
or at least there are(were?) plans to implement it:
https://wiki.debian.org/i18n/TranslationDebsProposals

With postinst, the time when the scriptlet runs may depend
on the order of the packages in the upgrade transaction and
may run with the older binaries in place.

The posttrans scriptlet runs at the very end of the
install/upgrade transaction, just like the OPKG "intercept"
scripts.

I successfully tested it long ago with a kernel upgrade
that was running dracut on the new version, plus a dracut
upgrade in the same session. Dissecting the initramfs proved
that with postinst, the old dracut version generated it,
while with posttrans, the new one did.

Who would want to use it? Anyone who needs some finalizer
script to be run at the end of an RPM/DNF transaction.

I started on Angstrom and I know opkg doesn't implement this
and Yocto inherited it. This patch is basically a heads up
that there's another way to do the same thing. Maybe opkg
implements this some day, maybe not. Anyway, Yocto in general
will need more changes before the main package.bbclass can
start to use it for all package formats.



There is a bigger issue here which is how can anyone use this without making
their recipe rpm specific? I'm very reluctant to add functionality like this
unless we have a way to emulate it or fall back on the other package formats.


Indeed. This patch can be dropped.

Full disclosure: I don't use this anymore, since I implemented
another two bbclass recipes to generate the kernel's initramfs
either during the kernel build (and ship it in a subpackage) or
during do_rootfs and move it out of the way in the image postprocess
script so e.g. a squashfs image will have it separately.
They work well for my use limited cases:
* full OS installed on disk
* squashfs for PXE-based remote booted machines

FYI: the dracutsysrootdir feature in recent dracut versions is my work.

I just carried this patch for a couple of years now and I thought maybe
someone sees some value in it.



The intercept pieces are used by both rpm and opkg and actually do something
slightly different, they stack common calls until the end of the transaction.
This means for example we can call "ldconfig" once rather than in every
postinst.

Cheers,

Richard










-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#155163): 
https://lists.openembedded.org/g/openembedded-core/message/155163
Mute This Topic: https://lists.openembedded.org/mt/85083966/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 5/6] kernel.bbclass: Use full versions for inter-package dependencies

2021-08-23 Thread Bruce Ashfield
On Mon, Aug 23, 2021 at 9:30 AM Böszörményi Zoltán  wrote:
>
> 2021. 08. 23. 15:03 keltezéssel, Bruce Ashfield írta:
> > On Mon, Aug 23, 2021 at 8:23 AM Zoltan Boszormenyi via
> > lists.openembedded.org  wrote:
> >>
> >> From: Zoltán Böszörményi 
> >>
> >> Some Yocto users do use package repositories and sometimes the PR
> >> value is forgotten. Use full versions for inter-package dependencies
> >> for the kernel subpackages.
> >
> > Can you expand this commit message ?
>
> I will send a new version with the expanded message.
>
> > What is the observable problem
> > with the full versions not being in the rdpends ?
>
> Currently the kernel creates such subpackages:
>
> kernel
> kernel-x.y.z
> kernel-image-x.y.z
> kernel-image-bzimage-x.y.z
> kernel-modules-x.y.z
>
> and in the split modules case, a lot of
>
> kernel-module-*-x.y.z
>
> RDEPENDS currently only references the package names.
>
> The issue I observe is this: I have enabled kernel module signing
> but I don't provide a key, so the kernel will generate one at
> every rebuild.
>
> You get the idea what problem this can make if there's a
> rebuild:
>
> x.y.z-r0.0 -> x.y.z-r1.0 (in which case the PR value was duly changed)
> or
> x.y.z-r0.0 -> x.y.z-r0.1 (where not)
>
> It's actually indifferent, but the same issue occurs if
> only the kernel-image-bzimage is upgraded: the modules either
> won't work or taint the kernel.

Your second example is similar to the times I've seen some module
issues as well, and honestly, I can't recall if it was solved in a
similar way to this (I don't have access to my old repos from Wind
River any more).

But that does make sense to me, and the details you have in this
follow up, make a nice commit explanation.

While opkg may not handle the situation you describe as well as RPM,
we should make sure that the full version doesn't cause issues with
the package generation or standard image creation.

Cheers,

Bruce

>
> This scenario is currently valid in the package manager because
> of the versionless RDEPENDS.
>
> >
> > I've run many different package feeds with different kernels and
> > modules, and haven't run into anything on this front, in my experience
> > the extended version in the package depends/provides causes issues
> > with some package managers .. so we'd need the testing for this
> > documented/provided so we could ensure that there are no hidden
> > issues.
> >
> > Bruce
> >
> >
> >>
> >> Signed-off-by: Zoltán Böszörményi 
> >> ---
> >>   meta/classes/kernel.bbclass | 13 +++--
> >>   1 file changed, 7 insertions(+), 6 deletions(-)
> >>
> >> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> >> index 6dc5387a9b..9ec7daa17a 100644
> >> --- a/meta/classes/kernel.bbclass
> >> +++ b/meta/classes/kernel.bbclass
> >> @@ -91,17 +91,18 @@ python __anonymous () {
> >>   kname = d.getVar('KERNEL_PACKAGE_NAME') or "kernel"
> >>   imagedest = d.getVar('KERNEL_IMAGEDEST')
> >>
> >> +fullver = d.getVar('EXTENDPKGV')
> >>   for type in types.split():
> >>   if bb.data.inherits_class('nopackages', d):
> >>   continue
> >>   typelower = type.lower()
> >>   d.appendVar('PACKAGES', ' %s-image-%s' % (kname, typelower))
> >>   d.setVar('FILES:' + kname + '-image-' + typelower, '/' + 
> >> imagedest + '/' + type + '-${KERNEL_VERSION_NAME}' + ' /' + imagedest + 
> >> '/' + type)
> >> -d.appendVar('RDEPENDS:%s-image' % kname, ' %s-image-%s' % (kname, 
> >> typelower))
> >> +d.appendVar('RDEPENDS:%s-image' % kname, ' %s-image-%s (= %s)' % 
> >> (kname, typelower, fullver))
> >>   splitmods = d.getVar("KERNEL_SPLIT_MODULES")
> >>   if splitmods != '1':
> >> -d.appendVar('RDEPENDS:%s-image' % kname, ' %s-modules' % 
> >> kname)
> >> -d.appendVar('RDEPENDS:%s-image-%s' % (kname, typelower), ' 
> >> %s-modules-${KERNEL_VERSION_PKG_NAME}' % kname)
> >> +d.appendVar('RDEPENDS:%s-image' % kname, ' %s-modules (= %s)' 
> >> % (kname, fullver))
> >> +d.appendVar('RDEPENDS:%s-image-%s' % (kname, typelower), ' 
> >> %s-modules-${KERNEL_VERSION_PKG_NAME} (= %s)' % (kname, fullver))
> >>   d.setVar('PKG:%s-modules' % kname, 
> >> '%s-modules-${KERNEL_VERSION_PKG_NAME}' % kname)
> >>   d.appendVar('RPROVIDES:%s-modules' % kname, 
> >> '%s-modules-${KERNEL_VERSION_PKG_NAME}' % kname)
> >>
> >> @@ -628,12 +629,12 @@ FILES:${KERNEL_PACKAGE_NAME}-image = ""
> >>   FILES:${KERNEL_PACKAGE_NAME}-dev = "/boot/System.map* 
> >> /boot/Module.symvers* /boot/config* ${KERNEL_SRC_PATH} 
> >> ${nonarch_base_libdir}/modules/${KERNEL_VERSION}/build"
> >>   FILES:${KERNEL_PACKAGE_NAME}-vmlinux = 
> >> "/boot/vmlinux-${KERNEL_VERSION_NAME}"
> >>   FILES:${KERNEL_PACKAGE_NAME}-modules = ""
> >> -RDEPENDS:${KERNEL_PACKAGE_NAME} = "${KERNEL_PACKAGE_NAME}-base"
> >> +RDEPENDS:${KERNEL_PACKAGE_NAME} = "${KERNEL_PACKAGE_NAME}-base (= 
> >> ${EXTENDPKGV})"
> >>   # Allow 

Re: [OE-core] [PATCH 3/6] kernel-module-split.bbclass: Allow opt-out of split kernel modules

2021-08-23 Thread Bruce Ashfield
On Mon, Aug 23, 2021 at 9:31 AM Böszörményi Zoltán  wrote:
>
> 2021. 08. 23. 15:27 keltezéssel, Bruce Ashfield írta:
> > On Mon, Aug 23, 2021 at 9:18 AM Böszörményi Zoltán  wrote:
> >>
> >> 2021. 08. 23. 14:55 keltezéssel, Bruce Ashfield írta:
> >>> On Mon, Aug 23, 2021 at 8:23 AM Zoltan Boszormenyi via
> >>> lists.openembedded.org  wrote:
> 
>  From: Zoltán Böszörményi 
> 
>  For some use cases, a monolithic kernel-modules package containing
>  all modules built from the kernel sources may be preferred.
>  For one, download time is shorter and installation time is faster.
> 
> >>>
> >>> There's still an outstanding issue though. Unless you generate the
> >>> provides/rdepends along with the monolithic package, any existing
> >>> rdepends on kernel modules break.
> >>
> >> The next patch in the thread does it.
> >
> > That's what my follow up said ;)
> >
> > See my second reply though, this gap in functionality created by this
> > commit, should be documented in the commit that it will be restored in
> > future ones.
>
> I can squash the two commits so there's no gap.

That's my preference (others may disagree), since they are related and
anyone that has poked around in this area may notice the issue (like I
did).

I don't normally bisect through oe-core, but it is nice to know that
if you were on this intermediate commit, that the dependencies would
stay valid/consistent.

Cheers,

Bruce

>
> >
> > Cheers,
> >
> > Bruce
> >
> >>
> >>>
> >>> While that likely isn't something you hit in your use case, it would
> >>> be something that would have to be covered to make this part of core.
> >>>
> >>> About 7 years ago, I was most of the way through a similar change,
> >>> that created on large package with all the rprovides generated (I'm
> >>> not sure I can track it down now, but I could have a look), since
> >>> doing an on target update with thousands of kernel module package is
> >>> very painful.
> >>
> >> Well, yes. In our defconfig, about 1500 kernel-module-* subpackages
> >> were created and had to be upgraded at once. It was *very* painful
> >> with over 50 minutes to download and upgrade the kernel.
> >>
> >>>
> >>> Cheers,
> >>>
> >>> Bruce
> >>>
>  Set KERNEL_SPLIT_MODULES="0" for this.
> 
>  The default is one subpackage per module.
> 
>  Signed-off-by: Zoltán Böszörményi 
>  ---
> meta/classes/kernel-module-split.bbclass | 17 +
> 1 file changed, 13 insertions(+), 4 deletions(-)
> 
>  diff --git a/meta/classes/kernel-module-split.bbclass 
>  b/meta/classes/kernel-module-split.bbclass
>  index 6c1de4c992..a29c294810 100644
>  --- a/meta/classes/kernel-module-split.bbclass
>  +++ b/meta/classes/kernel-module-split.bbclass
>  @@ -28,6 +28,7 @@ do_install:append() {
>    install -d ${D}${sysconfdir}/modules-load.d/ 
>  ${D}${sysconfdir}/modprobe.d/
> }
> 
>  +KERNEL_SPLIT_MODULES ?= "1"
> PACKAGESPLITFUNCS:prepend = "split_kernel_module_packages "
> 
> KERNEL_MODULES_META_PACKAGE ?= "${@ d.getVar("KERNEL_PACKAGE_NAME") 
>  or "kernel" }-modules"
>  @@ -156,18 +157,26 @@ python split_kernel_module_packages () {
> kernel_package_name = d.getVar("KERNEL_PACKAGE_NAME") or "kernel"
> kernel_version = d.getVar("KERNEL_VERSION")
> 
>  +metapkg = d.getVar('KERNEL_MODULES_META_PACKAGE')
>  +splitmods = d.getVar('KERNEL_SPLIT_MODULES')
>  +postinst = d.getVar('pkg_postinst:modules')
>  +postrm = d.getVar('pkg_postrm:modules')
>  +
>  +if splitmods != '1':
>  +etcdir = d.getVar('sysconfdir')
>  +d.appendVar('FILES:' + metapkg, '%s/modules-load.d/ 
>  %s/modprobe.d/ %s/modules/' % (etcdir, etcdir, 
>  d.getVar("nonarch_base_libdir")))
>  +d.appendVar('pkg_postinst:%s' % metapkg, postinst)
>  +d.prependVar('pkg_postrm:%s' % metapkg, postrm);
>  +return
>  +
> module_regex = r'^(.*)\.k?o(?:\.(gz|xz|zst))?$'
> 
> module_pattern_prefix = d.getVar('KERNEL_MODULE_PACKAGE_PREFIX')
> module_pattern_suffix = d.getVar('KERNEL_MODULE_PACKAGE_SUFFIX')
> module_pattern = module_pattern_prefix + kernel_package_name + 
>  '-module-%s' + module_pattern_suffix
> 
>  -postinst = d.getVar('pkg_postinst:modules')
>  -postrm = d.getVar('pkg_postrm:modules')
>  -
> modules = do_split_packages(d, 
>  root='${nonarch_base_libdir}/modules', file_regex=module_regex, 
>  output_pattern=module_pattern, description='%s kernel module', 
>  postinst=postinst, postrm=postrm, recursive=True, hook=frob_metadata, 
>  extra_depends='%s-%s' % (kernel_package_name, kernel_version))
> if modules:
>  -metapkg = d.getVar('KERNEL_MODULES_META_PACKAGE')
> d.appendVar('RDEPENDS:' + metapkg, ' '+' 

Re: [OE-core] [PATCH 3/6] kernel-module-split.bbclass: Allow opt-out of split kernel modules

2021-08-23 Thread Zoltan Boszormenyi via lists.openembedded.org

2021. 08. 23. 15:27 keltezéssel, Bruce Ashfield írta:

On Mon, Aug 23, 2021 at 9:18 AM Böszörményi Zoltán  wrote:


2021. 08. 23. 14:55 keltezéssel, Bruce Ashfield írta:

On Mon, Aug 23, 2021 at 8:23 AM Zoltan Boszormenyi via
lists.openembedded.org  wrote:


From: Zoltán Böszörményi 

For some use cases, a monolithic kernel-modules package containing
all modules built from the kernel sources may be preferred.
For one, download time is shorter and installation time is faster.



There's still an outstanding issue though. Unless you generate the
provides/rdepends along with the monolithic package, any existing
rdepends on kernel modules break.


The next patch in the thread does it.


That's what my follow up said ;)

See my second reply though, this gap in functionality created by this
commit, should be documented in the commit that it will be restored in
future ones.


I can squash the two commits so there's no gap.



Cheers,

Bruce





While that likely isn't something you hit in your use case, it would
be something that would have to be covered to make this part of core.

About 7 years ago, I was most of the way through a similar change,
that created on large package with all the rprovides generated (I'm
not sure I can track it down now, but I could have a look), since
doing an on target update with thousands of kernel module package is
very painful.


Well, yes. In our defconfig, about 1500 kernel-module-* subpackages
were created and had to be upgraded at once. It was *very* painful
with over 50 minutes to download and upgrade the kernel.



Cheers,

Bruce


Set KERNEL_SPLIT_MODULES="0" for this.

The default is one subpackage per module.

Signed-off-by: Zoltán Böszörményi 
---
   meta/classes/kernel-module-split.bbclass | 17 +
   1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/meta/classes/kernel-module-split.bbclass 
b/meta/classes/kernel-module-split.bbclass
index 6c1de4c992..a29c294810 100644
--- a/meta/classes/kernel-module-split.bbclass
+++ b/meta/classes/kernel-module-split.bbclass
@@ -28,6 +28,7 @@ do_install:append() {
  install -d ${D}${sysconfdir}/modules-load.d/ 
${D}${sysconfdir}/modprobe.d/
   }

+KERNEL_SPLIT_MODULES ?= "1"
   PACKAGESPLITFUNCS:prepend = "split_kernel_module_packages "

   KERNEL_MODULES_META_PACKAGE ?= "${@ d.getVar("KERNEL_PACKAGE_NAME") or "kernel" 
}-modules"
@@ -156,18 +157,26 @@ python split_kernel_module_packages () {
   kernel_package_name = d.getVar("KERNEL_PACKAGE_NAME") or "kernel"
   kernel_version = d.getVar("KERNEL_VERSION")

+metapkg = d.getVar('KERNEL_MODULES_META_PACKAGE')
+splitmods = d.getVar('KERNEL_SPLIT_MODULES')
+postinst = d.getVar('pkg_postinst:modules')
+postrm = d.getVar('pkg_postrm:modules')
+
+if splitmods != '1':
+etcdir = d.getVar('sysconfdir')
+d.appendVar('FILES:' + metapkg, '%s/modules-load.d/ %s/modprobe.d/ %s/modules/' 
% (etcdir, etcdir, d.getVar("nonarch_base_libdir")))
+d.appendVar('pkg_postinst:%s' % metapkg, postinst)
+d.prependVar('pkg_postrm:%s' % metapkg, postrm);
+return
+
   module_regex = r'^(.*)\.k?o(?:\.(gz|xz|zst))?$'

   module_pattern_prefix = d.getVar('KERNEL_MODULE_PACKAGE_PREFIX')
   module_pattern_suffix = d.getVar('KERNEL_MODULE_PACKAGE_SUFFIX')
   module_pattern = module_pattern_prefix + kernel_package_name + 
'-module-%s' + module_pattern_suffix

-postinst = d.getVar('pkg_postinst:modules')
-postrm = d.getVar('pkg_postrm:modules')
-
   modules = do_split_packages(d, root='${nonarch_base_libdir}/modules', 
file_regex=module_regex, output_pattern=module_pattern, description='%s kernel 
module', postinst=postinst, postrm=postrm, recursive=True, hook=frob_metadata, 
extra_depends='%s-%s' % (kernel_package_name, kernel_version))
   if modules:
-metapkg = d.getVar('KERNEL_MODULES_META_PACKAGE')
   d.appendVar('RDEPENDS:' + metapkg, ' '+' '.join(modules))

   # If modules-load.d and modprobe.d are empty at this point, remove them 
to
--
2.31.1























-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#155160): 
https://lists.openembedded.org/g/openembedded-core/message/155160
Mute This Topic: https://lists.openembedded.org/mt/85083968/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 5/6] kernel.bbclass: Use full versions for inter-package dependencies

2021-08-23 Thread Zoltan Boszormenyi via lists.openembedded.org

2021. 08. 23. 15:03 keltezéssel, Bruce Ashfield írta:

On Mon, Aug 23, 2021 at 8:23 AM Zoltan Boszormenyi via
lists.openembedded.org  wrote:


From: Zoltán Böszörményi 

Some Yocto users do use package repositories and sometimes the PR
value is forgotten. Use full versions for inter-package dependencies
for the kernel subpackages.


Can you expand this commit message ?


I will send a new version with the expanded message.


What is the observable problem
with the full versions not being in the rdpends ?


Currently the kernel creates such subpackages:

kernel
kernel-x.y.z
kernel-image-x.y.z
kernel-image-bzimage-x.y.z
kernel-modules-x.y.z

and in the split modules case, a lot of

kernel-module-*-x.y.z

RDEPENDS currently only references the package names.

The issue I observe is this: I have enabled kernel module signing
but I don't provide a key, so the kernel will generate one at
every rebuild.

You get the idea what problem this can make if there's a
rebuild:

x.y.z-r0.0 -> x.y.z-r1.0 (in which case the PR value was duly changed)
or
x.y.z-r0.0 -> x.y.z-r0.1 (where not)

It's actually indifferent, but the same issue occurs if
only the kernel-image-bzimage is upgraded: the modules either
won't work or taint the kernel.

This scenario is currently valid in the package manager because
of the versionless RDEPENDS.



I've run many different package feeds with different kernels and
modules, and haven't run into anything on this front, in my experience
the extended version in the package depends/provides causes issues
with some package managers .. so we'd need the testing for this
documented/provided so we could ensure that there are no hidden
issues.

Bruce




Signed-off-by: Zoltán Böszörményi 
---
  meta/classes/kernel.bbclass | 13 +++--
  1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 6dc5387a9b..9ec7daa17a 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -91,17 +91,18 @@ python __anonymous () {
  kname = d.getVar('KERNEL_PACKAGE_NAME') or "kernel"
  imagedest = d.getVar('KERNEL_IMAGEDEST')

+fullver = d.getVar('EXTENDPKGV')
  for type in types.split():
  if bb.data.inherits_class('nopackages', d):
  continue
  typelower = type.lower()
  d.appendVar('PACKAGES', ' %s-image-%s' % (kname, typelower))
  d.setVar('FILES:' + kname + '-image-' + typelower, '/' + imagedest + 
'/' + type + '-${KERNEL_VERSION_NAME}' + ' /' + imagedest + '/' + type)
-d.appendVar('RDEPENDS:%s-image' % kname, ' %s-image-%s' % (kname, 
typelower))
+d.appendVar('RDEPENDS:%s-image' % kname, ' %s-image-%s (= %s)' % 
(kname, typelower, fullver))
  splitmods = d.getVar("KERNEL_SPLIT_MODULES")
  if splitmods != '1':
-d.appendVar('RDEPENDS:%s-image' % kname, ' %s-modules' % kname)
-d.appendVar('RDEPENDS:%s-image-%s' % (kname, typelower), ' 
%s-modules-${KERNEL_VERSION_PKG_NAME}' % kname)
+d.appendVar('RDEPENDS:%s-image' % kname, ' %s-modules (= %s)' % 
(kname, fullver))
+d.appendVar('RDEPENDS:%s-image-%s' % (kname, typelower), ' 
%s-modules-${KERNEL_VERSION_PKG_NAME} (= %s)' % (kname, fullver))
  d.setVar('PKG:%s-modules' % kname, 
'%s-modules-${KERNEL_VERSION_PKG_NAME}' % kname)
  d.appendVar('RPROVIDES:%s-modules' % kname, 
'%s-modules-${KERNEL_VERSION_PKG_NAME}' % kname)

@@ -628,12 +629,12 @@ FILES:${KERNEL_PACKAGE_NAME}-image = ""
  FILES:${KERNEL_PACKAGE_NAME}-dev = "/boot/System.map* /boot/Module.symvers* 
/boot/config* ${KERNEL_SRC_PATH} 
${nonarch_base_libdir}/modules/${KERNEL_VERSION}/build"
  FILES:${KERNEL_PACKAGE_NAME}-vmlinux = "/boot/vmlinux-${KERNEL_VERSION_NAME}"
  FILES:${KERNEL_PACKAGE_NAME}-modules = ""
-RDEPENDS:${KERNEL_PACKAGE_NAME} = "${KERNEL_PACKAGE_NAME}-base"
+RDEPENDS:${KERNEL_PACKAGE_NAME} = "${KERNEL_PACKAGE_NAME}-base (= 
${EXTENDPKGV})"
  # Allow machines to override this dependency if kernel image files are
  # not wanted in images as standard
-RDEPENDS:${KERNEL_PACKAGE_NAME}-base ?= "${KERNEL_PACKAGE_NAME}-image"
+RDEPENDS:${KERNEL_PACKAGE_NAME}-base ?= "${KERNEL_PACKAGE_NAME}-image (= 
${EXTENDPKGV})"
  PKG:${KERNEL_PACKAGE_NAME}-image = 
"${KERNEL_PACKAGE_NAME}-image-${@legitimize_package_name(d.getVar('KERNEL_VERSION'))}"
-RDEPENDS:${KERNEL_PACKAGE_NAME}-image += 
"${@oe.utils.conditional('KERNEL_IMAGETYPE', 'vmlinux', 
'${KERNEL_PACKAGE_NAME}-vmlinux', '', d)}"
+RDEPENDS:${KERNEL_PACKAGE_NAME}-image += 
"${@oe.utils.conditional('KERNEL_IMAGETYPE', 'vmlinux', 
'${KERNEL_PACKAGE_NAME}-vmlinux (= ${EXTENDPKGV})', '', d)}"
  PKG:${KERNEL_PACKAGE_NAME}-base = 
"${KERNEL_PACKAGE_NAME}-${@legitimize_package_name(d.getVar('KERNEL_VERSION'))}"
  RPROVIDES:${KERNEL_PACKAGE_NAME}-base += 
"${KERNEL_PACKAGE_NAME}-${KERNEL_VERSION}"
  ALLOW_EMPTY:${KERNEL_PACKAGE_NAME} = "1"
--
2.31.1










-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all 

Re: [OE-core] [PATCH 3/6] kernel-module-split.bbclass: Allow opt-out of split kernel modules

2021-08-23 Thread Bruce Ashfield
On Mon, Aug 23, 2021 at 9:18 AM Böszörményi Zoltán  wrote:
>
> 2021. 08. 23. 14:55 keltezéssel, Bruce Ashfield írta:
> > On Mon, Aug 23, 2021 at 8:23 AM Zoltan Boszormenyi via
> > lists.openembedded.org  wrote:
> >>
> >> From: Zoltán Böszörményi 
> >>
> >> For some use cases, a monolithic kernel-modules package containing
> >> all modules built from the kernel sources may be preferred.
> >> For one, download time is shorter and installation time is faster.
> >>
> >
> > There's still an outstanding issue though. Unless you generate the
> > provides/rdepends along with the monolithic package, any existing
> > rdepends on kernel modules break.
>
> The next patch in the thread does it.

That's what my follow up said ;)

See my second reply though, this gap in functionality created by this
commit, should be documented in the commit that it will be restored in
future ones.

Cheers,

Bruce

>
> >
> > While that likely isn't something you hit in your use case, it would
> > be something that would have to be covered to make this part of core.
> >
> > About 7 years ago, I was most of the way through a similar change,
> > that created on large package with all the rprovides generated (I'm
> > not sure I can track it down now, but I could have a look), since
> > doing an on target update with thousands of kernel module package is
> > very painful.
>
> Well, yes. In our defconfig, about 1500 kernel-module-* subpackages
> were created and had to be upgraded at once. It was *very* painful
> with over 50 minutes to download and upgrade the kernel.
>
> >
> > Cheers,
> >
> > Bruce
> >
> >> Set KERNEL_SPLIT_MODULES="0" for this.
> >>
> >> The default is one subpackage per module.
> >>
> >> Signed-off-by: Zoltán Böszörményi 
> >> ---
> >>   meta/classes/kernel-module-split.bbclass | 17 +
> >>   1 file changed, 13 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/meta/classes/kernel-module-split.bbclass 
> >> b/meta/classes/kernel-module-split.bbclass
> >> index 6c1de4c992..a29c294810 100644
> >> --- a/meta/classes/kernel-module-split.bbclass
> >> +++ b/meta/classes/kernel-module-split.bbclass
> >> @@ -28,6 +28,7 @@ do_install:append() {
> >>  install -d ${D}${sysconfdir}/modules-load.d/ 
> >> ${D}${sysconfdir}/modprobe.d/
> >>   }
> >>
> >> +KERNEL_SPLIT_MODULES ?= "1"
> >>   PACKAGESPLITFUNCS:prepend = "split_kernel_module_packages "
> >>
> >>   KERNEL_MODULES_META_PACKAGE ?= "${@ d.getVar("KERNEL_PACKAGE_NAME") or 
> >> "kernel" }-modules"
> >> @@ -156,18 +157,26 @@ python split_kernel_module_packages () {
> >>   kernel_package_name = d.getVar("KERNEL_PACKAGE_NAME") or "kernel"
> >>   kernel_version = d.getVar("KERNEL_VERSION")
> >>
> >> +metapkg = d.getVar('KERNEL_MODULES_META_PACKAGE')
> >> +splitmods = d.getVar('KERNEL_SPLIT_MODULES')
> >> +postinst = d.getVar('pkg_postinst:modules')
> >> +postrm = d.getVar('pkg_postrm:modules')
> >> +
> >> +if splitmods != '1':
> >> +etcdir = d.getVar('sysconfdir')
> >> +d.appendVar('FILES:' + metapkg, '%s/modules-load.d/ 
> >> %s/modprobe.d/ %s/modules/' % (etcdir, etcdir, 
> >> d.getVar("nonarch_base_libdir")))
> >> +d.appendVar('pkg_postinst:%s' % metapkg, postinst)
> >> +d.prependVar('pkg_postrm:%s' % metapkg, postrm);
> >> +return
> >> +
> >>   module_regex = r'^(.*)\.k?o(?:\.(gz|xz|zst))?$'
> >>
> >>   module_pattern_prefix = d.getVar('KERNEL_MODULE_PACKAGE_PREFIX')
> >>   module_pattern_suffix = d.getVar('KERNEL_MODULE_PACKAGE_SUFFIX')
> >>   module_pattern = module_pattern_prefix + kernel_package_name + 
> >> '-module-%s' + module_pattern_suffix
> >>
> >> -postinst = d.getVar('pkg_postinst:modules')
> >> -postrm = d.getVar('pkg_postrm:modules')
> >> -
> >>   modules = do_split_packages(d, 
> >> root='${nonarch_base_libdir}/modules', file_regex=module_regex, 
> >> output_pattern=module_pattern, description='%s kernel module', 
> >> postinst=postinst, postrm=postrm, recursive=True, hook=frob_metadata, 
> >> extra_depends='%s-%s' % (kernel_package_name, kernel_version))
> >>   if modules:
> >> -metapkg = d.getVar('KERNEL_MODULES_META_PACKAGE')
> >>   d.appendVar('RDEPENDS:' + metapkg, ' '+' '.join(modules))
> >>
> >>   # If modules-load.d and modprobe.d are empty at this point, remove 
> >> them to
> >> --
> >> 2.31.1
> >>
> >>
> >>
> >>
> >
> >
> >
> >
> > 
> >
>


-- 
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#155158): 
https://lists.openembedded.org/g/openembedded-core/message/155158
Mute This Topic: https://lists.openembedded.org/mt/85083968/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/6] package_rpm.bbclass: Handle posttrans scriptlets

2021-08-23 Thread Richard Purdie
On Mon, 2021-08-23 at 15:14 +0200, Zoltan Boszormenyi via lists.openembedded.org
wrote:
> It's documented at www.rpm.org, Red Hat and SuSE.
> 
> https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/
> https://en.opensuse.org/openSUSE:Packaging_scriptlet_snippets
> https://rpm-packaging-guide.github.io/
> 
> It's available since RPM 4.4. RPM 4.16.1.3 is in Hardknott.
> 
> A short Google search showed that *maybe* dpkg also supports it,
> or at least there are(were?) plans to implement it:
> https://wiki.debian.org/i18n/TranslationDebsProposals
> 
> With postinst, the time when the scriptlet runs may depend
> on the order of the packages in the upgrade transaction and
> may run with the older binaries in place.
> 
> The posttrans scriptlet runs at the very end of the
> install/upgrade transaction, just like the OPKG "intercept"
> scripts.
> 
> I successfully tested it long ago with a kernel upgrade
> that was running dracut on the new version, plus a dracut
> upgrade in the same session. Dissecting the initramfs proved
> that with postinst, the old dracut version generated it,
> while with posttrans, the new one did.
> 
> Who would want to use it? Anyone who needs some finalizer
> script to be run at the end of an RPM/DNF transaction.
> 
> I started on Angstrom and I know opkg doesn't implement this
> and Yocto inherited it. This patch is basically a heads up
> that there's another way to do the same thing. Maybe opkg
> implements this some day, maybe not. Anyway, Yocto in general
> will need more changes before the main package.bbclass can
> start to use it for all package formats.
> 

There is a bigger issue here which is how can anyone use this without making
their recipe rpm specific? I'm very reluctant to add functionality like this
unless we have a way to emulate it or fall back on the other package formats.

The intercept pieces are used by both rpm and opkg and actually do something
slightly different, they stack common calls until the end of the transaction.
This means for example we can call "ldconfig" once rather than in every
postinst.

Cheers,

Richard




-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#155157): 
https://lists.openembedded.org/g/openembedded-core/message/155157
Mute This Topic: https://lists.openembedded.org/mt/85083966/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 3/6] kernel-module-split.bbclass: Allow opt-out of split kernel modules

2021-08-23 Thread Zoltan Boszormenyi via lists.openembedded.org

2021. 08. 23. 14:55 keltezéssel, Bruce Ashfield írta:

On Mon, Aug 23, 2021 at 8:23 AM Zoltan Boszormenyi via
lists.openembedded.org  wrote:


From: Zoltán Böszörményi 

For some use cases, a monolithic kernel-modules package containing
all modules built from the kernel sources may be preferred.
For one, download time is shorter and installation time is faster.



There's still an outstanding issue though. Unless you generate the
provides/rdepends along with the monolithic package, any existing
rdepends on kernel modules break.


The next patch in the thread does it.



While that likely isn't something you hit in your use case, it would
be something that would have to be covered to make this part of core.

About 7 years ago, I was most of the way through a similar change,
that created on large package with all the rprovides generated (I'm
not sure I can track it down now, but I could have a look), since
doing an on target update with thousands of kernel module package is
very painful.


Well, yes. In our defconfig, about 1500 kernel-module-* subpackages
were created and had to be upgraded at once. It was *very* painful
with over 50 minutes to download and upgrade the kernel.



Cheers,

Bruce


Set KERNEL_SPLIT_MODULES="0" for this.

The default is one subpackage per module.

Signed-off-by: Zoltán Böszörményi 
---
  meta/classes/kernel-module-split.bbclass | 17 +
  1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/meta/classes/kernel-module-split.bbclass 
b/meta/classes/kernel-module-split.bbclass
index 6c1de4c992..a29c294810 100644
--- a/meta/classes/kernel-module-split.bbclass
+++ b/meta/classes/kernel-module-split.bbclass
@@ -28,6 +28,7 @@ do_install:append() {
 install -d ${D}${sysconfdir}/modules-load.d/ 
${D}${sysconfdir}/modprobe.d/
  }

+KERNEL_SPLIT_MODULES ?= "1"
  PACKAGESPLITFUNCS:prepend = "split_kernel_module_packages "

  KERNEL_MODULES_META_PACKAGE ?= "${@ d.getVar("KERNEL_PACKAGE_NAME") or "kernel" 
}-modules"
@@ -156,18 +157,26 @@ python split_kernel_module_packages () {
  kernel_package_name = d.getVar("KERNEL_PACKAGE_NAME") or "kernel"
  kernel_version = d.getVar("KERNEL_VERSION")

+metapkg = d.getVar('KERNEL_MODULES_META_PACKAGE')
+splitmods = d.getVar('KERNEL_SPLIT_MODULES')
+postinst = d.getVar('pkg_postinst:modules')
+postrm = d.getVar('pkg_postrm:modules')
+
+if splitmods != '1':
+etcdir = d.getVar('sysconfdir')
+d.appendVar('FILES:' + metapkg, '%s/modules-load.d/ %s/modprobe.d/ %s/modules/' 
% (etcdir, etcdir, d.getVar("nonarch_base_libdir")))
+d.appendVar('pkg_postinst:%s' % metapkg, postinst)
+d.prependVar('pkg_postrm:%s' % metapkg, postrm);
+return
+
  module_regex = r'^(.*)\.k?o(?:\.(gz|xz|zst))?$'

  module_pattern_prefix = d.getVar('KERNEL_MODULE_PACKAGE_PREFIX')
  module_pattern_suffix = d.getVar('KERNEL_MODULE_PACKAGE_SUFFIX')
  module_pattern = module_pattern_prefix + kernel_package_name + 
'-module-%s' + module_pattern_suffix

-postinst = d.getVar('pkg_postinst:modules')
-postrm = d.getVar('pkg_postrm:modules')
-
  modules = do_split_packages(d, root='${nonarch_base_libdir}/modules', 
file_regex=module_regex, output_pattern=module_pattern, description='%s kernel 
module', postinst=postinst, postrm=postrm, recursive=True, hook=frob_metadata, 
extra_depends='%s-%s' % (kernel_package_name, kernel_version))
  if modules:
-metapkg = d.getVar('KERNEL_MODULES_META_PACKAGE')
  d.appendVar('RDEPENDS:' + metapkg, ' '+' '.join(modules))

  # If modules-load.d and modprobe.d are empty at this point, remove them to
--
2.31.1














-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#155156): 
https://lists.openembedded.org/g/openembedded-core/message/155156
Mute This Topic: https://lists.openembedded.org/mt/85083968/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/6] package_rpm.bbclass: Handle posttrans scriptlets

2021-08-23 Thread Zoltan Boszormenyi via lists.openembedded.org

It's documented at www.rpm.org, Red Hat and SuSE.

https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/
https://en.opensuse.org/openSUSE:Packaging_scriptlet_snippets
https://rpm-packaging-guide.github.io/

It's available since RPM 4.4. RPM 4.16.1.3 is in Hardknott.

A short Google search showed that *maybe* dpkg also supports it,
or at least there are(were?) plans to implement it:
https://wiki.debian.org/i18n/TranslationDebsProposals

With postinst, the time when the scriptlet runs may depend
on the order of the packages in the upgrade transaction and
may run with the older binaries in place.

The posttrans scriptlet runs at the very end of the
install/upgrade transaction, just like the OPKG "intercept"
scripts.

I successfully tested it long ago with a kernel upgrade
that was running dracut on the new version, plus a dracut
upgrade in the same session. Dissecting the initramfs proved
that with postinst, the old dracut version generated it,
while with posttrans, the new one did.

Who would want to use it? Anyone who needs some finalizer
script to be run at the end of an RPM/DNF transaction.

I started on Angstrom and I know opkg doesn't implement this
and Yocto inherited it. This patch is basically a heads up
that there's another way to do the same thing. Maybe opkg
implements this some day, maybe not. Anyway, Yocto in general
will need more changes before the main package.bbclass can
start to use it for all package formats.

Zoltán

2021. 08. 23. 14:34 keltezéssel, Alexander Kanavin írta:

This needs to be better documented and tested.

What does this posttrans thing really do?
Who would want to use it?
Can there be examples?
Can the Postinst test in meta/lib/oeqa/selftest/cases/runtime_test.py be extended to 
regression-check that it works?


Alex

On Mon, 23 Aug 2021 at 14:23, Zoltan Boszormenyi via lists.openembedded.org 
 > wrote:


From: Zoltán Böszörményi mailto:zbos...@gmail.com>>

The "posttrans" scriptlet is the RPM equivalent of the
OPKG "intercept script" concept and probably a cleaner one.

"pretrans" also exists in RPM but there's no equivalent
for it in OPKG.

Signed-off-by: Zoltán Böszörményi mailto:zbos...@gmail.com>>
---
  meta/classes/package_rpm.bbclass | 30 +-
  1 file changed, 21 insertions(+), 9 deletions(-)

diff --git a/meta/classes/package_rpm.bbclass 
b/meta/classes/package_rpm.bbclass
index 88d861c0e7..5992d3fd06 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -308,10 +308,11 @@ python write_specfile () {
      srcrconflicts  = ""
      srcrobsoletes  = ""

-    srcrpreinst  = []
-    srcrpostinst = []
-    srcrprerm    = []
-    srcrpostrm   = []
+    srcrpreinst   = []
+    srcrpostinst  = []
+    srcrprerm     = []
+    srcrpostrm    = []
+    srcrposttrans = []

      spec_preamble_top = []
      spec_preamble_bottom = []
@@ -373,11 +374,11 @@ python write_specfile () {
          splitrconflicts  = localdata.getVar('RCONFLICTS') or ""
          splitrobsoletes  = ""

-        splitrpreinst  = localdata.getVar('pkg_preinst')
-        splitrpostinst = localdata.getVar('pkg_postinst')
-        splitrprerm    = localdata.getVar('pkg_prerm')
-        splitrpostrm   = localdata.getVar('pkg_postrm')
-
+        splitrpreinst   = localdata.getVar('pkg_preinst')
+        splitrpostinst  = localdata.getVar('pkg_postinst')
+        splitrprerm     = localdata.getVar('pkg_prerm')
+        splitrpostrm    = localdata.getVar('pkg_postrm')
+        splitrposttrans = localdata.getVar('pkg_posttrans')

          if not perfiledeps:
              # Add in summary of per file dependencies
@@ -405,6 +406,7 @@ python write_specfile () {
              srcrpostinst   = splitrpostinst
              srcrprerm      = splitrprerm
              srcrpostrm     = splitrpostrm
+            srcrposttrans  = splitrposttrans

              file_list = []
              walk_files(root, file_list, conffiles, dirfiles)
@@ -496,6 +498,11 @@ python write_specfile () {
              scriptvar = wrap_uninstall(splitrpostrm)
              spec_scriptlets_bottom.append(scriptvar)
              spec_scriptlets_bottom.append('')
+        if splitrposttrans:
+            spec_scriptlets_bottom.append('%%posttrans -n %s' % splitname)
+            spec_scriptlets_bottom.append('# %s - posttrans' % splitname)
+            spec_scriptlets_bottom.append(splitrposttrans)
+            spec_scriptlets_bottom.append('')

          # Now process files
          file_list = []
@@ -590,6 +597,11 @@ python write_specfile () {
          scriptvar = wrap_uninstall(srcrpostrm)
          spec_scriptlets_top.append(scriptvar)
          

Re: [OE-core] [PATCH 5/6] kernel.bbclass: Use full versions for inter-package dependencies

2021-08-23 Thread Bruce Ashfield
On Mon, Aug 23, 2021 at 8:23 AM Zoltan Boszormenyi via
lists.openembedded.org  wrote:
>
> From: Zoltán Böszörményi 
>
> Some Yocto users do use package repositories and sometimes the PR
> value is forgotten. Use full versions for inter-package dependencies
> for the kernel subpackages.

Can you expand this commit message ? What is the observable problem
with the full versions not being in the rdpends ?

I've run many different package feeds with different kernels and
modules, and haven't run into anything on this front, in my experience
the extended version in the package depends/provides causes issues
with some package managers .. so we'd need the testing for this
documented/provided so we could ensure that there are no hidden
issues.

Bruce


>
> Signed-off-by: Zoltán Böszörményi 
> ---
>  meta/classes/kernel.bbclass | 13 +++--
>  1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index 6dc5387a9b..9ec7daa17a 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -91,17 +91,18 @@ python __anonymous () {
>  kname = d.getVar('KERNEL_PACKAGE_NAME') or "kernel"
>  imagedest = d.getVar('KERNEL_IMAGEDEST')
>
> +fullver = d.getVar('EXTENDPKGV')
>  for type in types.split():
>  if bb.data.inherits_class('nopackages', d):
>  continue
>  typelower = type.lower()
>  d.appendVar('PACKAGES', ' %s-image-%s' % (kname, typelower))
>  d.setVar('FILES:' + kname + '-image-' + typelower, '/' + imagedest + 
> '/' + type + '-${KERNEL_VERSION_NAME}' + ' /' + imagedest + '/' + type)
> -d.appendVar('RDEPENDS:%s-image' % kname, ' %s-image-%s' % (kname, 
> typelower))
> +d.appendVar('RDEPENDS:%s-image' % kname, ' %s-image-%s (= %s)' % 
> (kname, typelower, fullver))
>  splitmods = d.getVar("KERNEL_SPLIT_MODULES")
>  if splitmods != '1':
> -d.appendVar('RDEPENDS:%s-image' % kname, ' %s-modules' % kname)
> -d.appendVar('RDEPENDS:%s-image-%s' % (kname, typelower), ' 
> %s-modules-${KERNEL_VERSION_PKG_NAME}' % kname)
> +d.appendVar('RDEPENDS:%s-image' % kname, ' %s-modules (= %s)' % 
> (kname, fullver))
> +d.appendVar('RDEPENDS:%s-image-%s' % (kname, typelower), ' 
> %s-modules-${KERNEL_VERSION_PKG_NAME} (= %s)' % (kname, fullver))
>  d.setVar('PKG:%s-modules' % kname, 
> '%s-modules-${KERNEL_VERSION_PKG_NAME}' % kname)
>  d.appendVar('RPROVIDES:%s-modules' % kname, 
> '%s-modules-${KERNEL_VERSION_PKG_NAME}' % kname)
>
> @@ -628,12 +629,12 @@ FILES:${KERNEL_PACKAGE_NAME}-image = ""
>  FILES:${KERNEL_PACKAGE_NAME}-dev = "/boot/System.map* /boot/Module.symvers* 
> /boot/config* ${KERNEL_SRC_PATH} 
> ${nonarch_base_libdir}/modules/${KERNEL_VERSION}/build"
>  FILES:${KERNEL_PACKAGE_NAME}-vmlinux = "/boot/vmlinux-${KERNEL_VERSION_NAME}"
>  FILES:${KERNEL_PACKAGE_NAME}-modules = ""
> -RDEPENDS:${KERNEL_PACKAGE_NAME} = "${KERNEL_PACKAGE_NAME}-base"
> +RDEPENDS:${KERNEL_PACKAGE_NAME} = "${KERNEL_PACKAGE_NAME}-base (= 
> ${EXTENDPKGV})"
>  # Allow machines to override this dependency if kernel image files are
>  # not wanted in images as standard
> -RDEPENDS:${KERNEL_PACKAGE_NAME}-base ?= "${KERNEL_PACKAGE_NAME}-image"
> +RDEPENDS:${KERNEL_PACKAGE_NAME}-base ?= "${KERNEL_PACKAGE_NAME}-image (= 
> ${EXTENDPKGV})"
>  PKG:${KERNEL_PACKAGE_NAME}-image = 
> "${KERNEL_PACKAGE_NAME}-image-${@legitimize_package_name(d.getVar('KERNEL_VERSION'))}"
> -RDEPENDS:${KERNEL_PACKAGE_NAME}-image += 
> "${@oe.utils.conditional('KERNEL_IMAGETYPE', 'vmlinux', 
> '${KERNEL_PACKAGE_NAME}-vmlinux', '', d)}"
> +RDEPENDS:${KERNEL_PACKAGE_NAME}-image += 
> "${@oe.utils.conditional('KERNEL_IMAGETYPE', 'vmlinux', 
> '${KERNEL_PACKAGE_NAME}-vmlinux (= ${EXTENDPKGV})', '', d)}"
>  PKG:${KERNEL_PACKAGE_NAME}-base = 
> "${KERNEL_PACKAGE_NAME}-${@legitimize_package_name(d.getVar('KERNEL_VERSION'))}"
>  RPROVIDES:${KERNEL_PACKAGE_NAME}-base += 
> "${KERNEL_PACKAGE_NAME}-${KERNEL_VERSION}"
>  ALLOW_EMPTY:${KERNEL_PACKAGE_NAME} = "1"
> --
> 2.31.1
>
>
> 
>


-- 
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#155154): 
https://lists.openembedded.org/g/openembedded-core/message/155154
Mute This Topic: https://lists.openembedded.org/mt/85083971/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 3/6] kernel-module-split.bbclass: Allow opt-out of split kernel modules

2021-08-23 Thread Bruce Ashfield
On Mon, Aug 23, 2021 at 8:55 AM Bruce Ashfield via
lists.openembedded.org
 wrote:
>
> On Mon, Aug 23, 2021 at 8:23 AM Zoltan Boszormenyi via
> lists.openembedded.org  wrote:
> >
> > From: Zoltán Böszörményi 
> >
> > For some use cases, a monolithic kernel-modules package containing
> > all modules built from the kernel sources may be preferred.
> > For one, download time is shorter and installation time is faster.
> >
>
> There's still an outstanding issue though. Unless you generate the
> provides/rdepends along with the monolithic package, any existing
> rdepends on kernel modules break.

Ha.

Never mind, I see the next patch in the series.

It would be worthwhile to document that other changes handle that
detail in the commit log, that way if we are looking for issues in the
future, we know there is hope :D

Bruce

>
> While that likely isn't something you hit in your use case, it would
> be something that would have to be covered to make this part of core.
>
> About 7 years ago, I was most of the way through a similar change,
> that created on large package with all the rprovides generated (I'm
> not sure I can track it down now, but I could have a look), since
> doing an on target update with thousands of kernel module package is
> very painful.
>
> Cheers,
>
> Bruce
>
> > Set KERNEL_SPLIT_MODULES="0" for this.
> >
> > The default is one subpackage per module.
> >
> > Signed-off-by: Zoltán Böszörményi 
> > ---
> >  meta/classes/kernel-module-split.bbclass | 17 +
> >  1 file changed, 13 insertions(+), 4 deletions(-)
> >
> > diff --git a/meta/classes/kernel-module-split.bbclass 
> > b/meta/classes/kernel-module-split.bbclass
> > index 6c1de4c992..a29c294810 100644
> > --- a/meta/classes/kernel-module-split.bbclass
> > +++ b/meta/classes/kernel-module-split.bbclass
> > @@ -28,6 +28,7 @@ do_install:append() {
> > install -d ${D}${sysconfdir}/modules-load.d/ 
> > ${D}${sysconfdir}/modprobe.d/
> >  }
> >
> > +KERNEL_SPLIT_MODULES ?= "1"
> >  PACKAGESPLITFUNCS:prepend = "split_kernel_module_packages "
> >
> >  KERNEL_MODULES_META_PACKAGE ?= "${@ d.getVar("KERNEL_PACKAGE_NAME") or 
> > "kernel" }-modules"
> > @@ -156,18 +157,26 @@ python split_kernel_module_packages () {
> >  kernel_package_name = d.getVar("KERNEL_PACKAGE_NAME") or "kernel"
> >  kernel_version = d.getVar("KERNEL_VERSION")
> >
> > +metapkg = d.getVar('KERNEL_MODULES_META_PACKAGE')
> > +splitmods = d.getVar('KERNEL_SPLIT_MODULES')
> > +postinst = d.getVar('pkg_postinst:modules')
> > +postrm = d.getVar('pkg_postrm:modules')
> > +
> > +if splitmods != '1':
> > +etcdir = d.getVar('sysconfdir')
> > +d.appendVar('FILES:' + metapkg, '%s/modules-load.d/ %s/modprobe.d/ 
> > %s/modules/' % (etcdir, etcdir, d.getVar("nonarch_base_libdir")))
> > +d.appendVar('pkg_postinst:%s' % metapkg, postinst)
> > +d.prependVar('pkg_postrm:%s' % metapkg, postrm);
> > +return
> > +
> >  module_regex = r'^(.*)\.k?o(?:\.(gz|xz|zst))?$'
> >
> >  module_pattern_prefix = d.getVar('KERNEL_MODULE_PACKAGE_PREFIX')
> >  module_pattern_suffix = d.getVar('KERNEL_MODULE_PACKAGE_SUFFIX')
> >  module_pattern = module_pattern_prefix + kernel_package_name + 
> > '-module-%s' + module_pattern_suffix
> >
> > -postinst = d.getVar('pkg_postinst:modules')
> > -postrm = d.getVar('pkg_postrm:modules')
> > -
> >  modules = do_split_packages(d, root='${nonarch_base_libdir}/modules', 
> > file_regex=module_regex, output_pattern=module_pattern, description='%s 
> > kernel module', postinst=postinst, postrm=postrm, recursive=True, 
> > hook=frob_metadata, extra_depends='%s-%s' % (kernel_package_name, 
> > kernel_version))
> >  if modules:
> > -metapkg = d.getVar('KERNEL_MODULES_META_PACKAGE')
> >  d.appendVar('RDEPENDS:' + metapkg, ' '+' '.join(modules))
> >
> >  # If modules-load.d and modprobe.d are empty at this point, remove 
> > them to
> > --
> > 2.31.1
> >
> >
> >
> >
>
>
> --
> - Thou shalt not follow the NULL pointer, for chaos and madness await
> thee at its end
> - "Use the force Harry" - Gandalf, Star Trek II
>
> 
>


-- 
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#155153): 
https://lists.openembedded.org/g/openembedded-core/message/155153
Mute This Topic: https://lists.openembedded.org/mt/85083968/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 3/6] kernel-module-split.bbclass: Allow opt-out of split kernel modules

2021-08-23 Thread Bruce Ashfield
On Mon, Aug 23, 2021 at 8:23 AM Zoltan Boszormenyi via
lists.openembedded.org  wrote:
>
> From: Zoltán Böszörményi 
>
> For some use cases, a monolithic kernel-modules package containing
> all modules built from the kernel sources may be preferred.
> For one, download time is shorter and installation time is faster.
>

There's still an outstanding issue though. Unless you generate the
provides/rdepends along with the monolithic package, any existing
rdepends on kernel modules break.

While that likely isn't something you hit in your use case, it would
be something that would have to be covered to make this part of core.

About 7 years ago, I was most of the way through a similar change,
that created on large package with all the rprovides generated (I'm
not sure I can track it down now, but I could have a look), since
doing an on target update with thousands of kernel module package is
very painful.

Cheers,

Bruce

> Set KERNEL_SPLIT_MODULES="0" for this.
>
> The default is one subpackage per module.
>
> Signed-off-by: Zoltán Böszörményi 
> ---
>  meta/classes/kernel-module-split.bbclass | 17 +
>  1 file changed, 13 insertions(+), 4 deletions(-)
>
> diff --git a/meta/classes/kernel-module-split.bbclass 
> b/meta/classes/kernel-module-split.bbclass
> index 6c1de4c992..a29c294810 100644
> --- a/meta/classes/kernel-module-split.bbclass
> +++ b/meta/classes/kernel-module-split.bbclass
> @@ -28,6 +28,7 @@ do_install:append() {
> install -d ${D}${sysconfdir}/modules-load.d/ 
> ${D}${sysconfdir}/modprobe.d/
>  }
>
> +KERNEL_SPLIT_MODULES ?= "1"
>  PACKAGESPLITFUNCS:prepend = "split_kernel_module_packages "
>
>  KERNEL_MODULES_META_PACKAGE ?= "${@ d.getVar("KERNEL_PACKAGE_NAME") or 
> "kernel" }-modules"
> @@ -156,18 +157,26 @@ python split_kernel_module_packages () {
>  kernel_package_name = d.getVar("KERNEL_PACKAGE_NAME") or "kernel"
>  kernel_version = d.getVar("KERNEL_VERSION")
>
> +metapkg = d.getVar('KERNEL_MODULES_META_PACKAGE')
> +splitmods = d.getVar('KERNEL_SPLIT_MODULES')
> +postinst = d.getVar('pkg_postinst:modules')
> +postrm = d.getVar('pkg_postrm:modules')
> +
> +if splitmods != '1':
> +etcdir = d.getVar('sysconfdir')
> +d.appendVar('FILES:' + metapkg, '%s/modules-load.d/ %s/modprobe.d/ 
> %s/modules/' % (etcdir, etcdir, d.getVar("nonarch_base_libdir")))
> +d.appendVar('pkg_postinst:%s' % metapkg, postinst)
> +d.prependVar('pkg_postrm:%s' % metapkg, postrm);
> +return
> +
>  module_regex = r'^(.*)\.k?o(?:\.(gz|xz|zst))?$'
>
>  module_pattern_prefix = d.getVar('KERNEL_MODULE_PACKAGE_PREFIX')
>  module_pattern_suffix = d.getVar('KERNEL_MODULE_PACKAGE_SUFFIX')
>  module_pattern = module_pattern_prefix + kernel_package_name + 
> '-module-%s' + module_pattern_suffix
>
> -postinst = d.getVar('pkg_postinst:modules')
> -postrm = d.getVar('pkg_postrm:modules')
> -
>  modules = do_split_packages(d, root='${nonarch_base_libdir}/modules', 
> file_regex=module_regex, output_pattern=module_pattern, description='%s 
> kernel module', postinst=postinst, postrm=postrm, recursive=True, 
> hook=frob_metadata, extra_depends='%s-%s' % (kernel_package_name, 
> kernel_version))
>  if modules:
> -metapkg = d.getVar('KERNEL_MODULES_META_PACKAGE')
>  d.appendVar('RDEPENDS:' + metapkg, ' '+' '.join(modules))
>
>  # If modules-load.d and modprobe.d are empty at this point, remove them 
> to
> --
> 2.31.1
>
>
> 
>


-- 
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#155152): 
https://lists.openembedded.org/g/openembedded-core/message/155152
Mute This Topic: https://lists.openembedded.org/mt/85083968/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/6] package_rpm.bbclass: Handle posttrans scriptlets

2021-08-23 Thread Alexander Kanavin
This needs to be better documented and tested.

What does this posttrans thing really do?
Who would want to use it?
Can there be examples?
Can the Postinst test in meta/lib/oeqa/selftest/cases/runtime_test.py be
extended to regression-check that it works?

Alex

On Mon, 23 Aug 2021 at 14:23, Zoltan Boszormenyi via lists.openembedded.org
 wrote:

> From: Zoltán Böszörményi 
>
> The "posttrans" scriptlet is the RPM equivalent of the
> OPKG "intercept script" concept and probably a cleaner one.
>
> "pretrans" also exists in RPM but there's no equivalent
> for it in OPKG.
>
> Signed-off-by: Zoltán Böszörményi 
> ---
>  meta/classes/package_rpm.bbclass | 30 +-
>  1 file changed, 21 insertions(+), 9 deletions(-)
>
> diff --git a/meta/classes/package_rpm.bbclass
> b/meta/classes/package_rpm.bbclass
> index 88d861c0e7..5992d3fd06 100644
> --- a/meta/classes/package_rpm.bbclass
> +++ b/meta/classes/package_rpm.bbclass
> @@ -308,10 +308,11 @@ python write_specfile () {
>  srcrconflicts  = ""
>  srcrobsoletes  = ""
>
> -srcrpreinst  = []
> -srcrpostinst = []
> -srcrprerm= []
> -srcrpostrm   = []
> +srcrpreinst   = []
> +srcrpostinst  = []
> +srcrprerm = []
> +srcrpostrm= []
> +srcrposttrans = []
>
>  spec_preamble_top = []
>  spec_preamble_bottom = []
> @@ -373,11 +374,11 @@ python write_specfile () {
>  splitrconflicts  = localdata.getVar('RCONFLICTS') or ""
>  splitrobsoletes  = ""
>
> -splitrpreinst  = localdata.getVar('pkg_preinst')
> -splitrpostinst = localdata.getVar('pkg_postinst')
> -splitrprerm= localdata.getVar('pkg_prerm')
> -splitrpostrm   = localdata.getVar('pkg_postrm')
> -
> +splitrpreinst   = localdata.getVar('pkg_preinst')
> +splitrpostinst  = localdata.getVar('pkg_postinst')
> +splitrprerm = localdata.getVar('pkg_prerm')
> +splitrpostrm= localdata.getVar('pkg_postrm')
> +splitrposttrans = localdata.getVar('pkg_posttrans')
>
>  if not perfiledeps:
>  # Add in summary of per file dependencies
> @@ -405,6 +406,7 @@ python write_specfile () {
>  srcrpostinst   = splitrpostinst
>  srcrprerm  = splitrprerm
>  srcrpostrm = splitrpostrm
> +srcrposttrans  = splitrposttrans
>
>  file_list = []
>  walk_files(root, file_list, conffiles, dirfiles)
> @@ -496,6 +498,11 @@ python write_specfile () {
>  scriptvar = wrap_uninstall(splitrpostrm)
>  spec_scriptlets_bottom.append(scriptvar)
>  spec_scriptlets_bottom.append('')
> +if splitrposttrans:
> +spec_scriptlets_bottom.append('%%posttrans -n %s' % splitname)
> +spec_scriptlets_bottom.append('# %s - posttrans' % splitname)
> +spec_scriptlets_bottom.append(splitrposttrans)
> +spec_scriptlets_bottom.append('')
>
>  # Now process files
>  file_list = []
> @@ -590,6 +597,11 @@ python write_specfile () {
>  scriptvar = wrap_uninstall(srcrpostrm)
>  spec_scriptlets_top.append(scriptvar)
>  spec_scriptlets_top.append('')
> +if srcrposttrans:
> +spec_scriptlets_top.append('%posttrans')
> +spec_scriptlets_top.append('# %s - posttrans' % srcname)
> +spec_scriptlets_top.append(srcrposttrans)
> +spec_scriptlets_top.append('')
>
>  # Write the SPEC file
>  specfile = open(outspecfile, 'w')
> --
> 2.31.1
>
>
> 
>
>

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#155151): 
https://lists.openembedded.org/g/openembedded-core/message/155151
Mute This Topic: https://lists.openembedded.org/mt/85083966/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 3/3] lib/package_manager: Use shutil.copy instead of bb.utils.copyfile for intercepts

2021-08-23 Thread Sean Nyekjaer
On Thu, May 06, 2021 at 08:51:00AM +0100, Richard Purdie wrote:
> If the scripts/postinst-intercepts is owned by root/root then the copyfile() 
> calls
> will fail due to chown issues. We don't care about ownership of these files so
> use shutil.copy() instead which won't perform any chown.
> 
> Signed-off-by: Richard Purdie 

Anuj will you backport this to gatesgarth?

/Sean

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#155150): 
https://lists.openembedded.org/g/openembedded-core/message/155150
Mute This Topic: https://lists.openembedded.org/mt/82625316/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/6] Support zstd-compressed squashfs and cpio initramfs

2021-08-23 Thread Zoltan Boszormenyi via lists.openembedded.org
From: Zoltán Böszörményi 

Signed-off-by: Zoltán Böszörményi 
---
 meta/classes/base.bbclass|  4 
 meta/classes/image_types.bbclass |  6 --
 meta/classes/kernel-fitimage.bbclass |  2 +-
 meta/classes/kernel.bbclass  | 10 --
 4 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 11b65171d9..340ebe7d78 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -631,6 +631,10 @@ python () {
 if path.endswith('.lz4'):
 d.appendVarFlag('do_unpack', 'depends', ' 
lz4-native:do_populate_sysroot')
 
+# *.zst should DEPEND on zstd-native for unpacking
+elif path.endswith('.zst'):
+d.appendVarFlag('do_unpack', 'depends', ' 
zstd-native:do_populate_sysroot')
+
 # *.lz should DEPEND on lzip-native for unpacking
 elif path.endswith('.lz'):
 d.appendVarFlag('do_unpack', 'depends', ' 
lzip-native:do_populate_sysroot')
diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
index e0eb06c1e3..32d4cd4c76 100644
--- a/meta/classes/image_types.bbclass
+++ b/meta/classes/image_types.bbclass
@@ -107,6 +107,7 @@ IMAGE_CMD:squashfs = "mksquashfs ${IMAGE_ROOTFS} 
${IMGDEPLOYDIR}/${IMAGE_NAME}${
 IMAGE_CMD:squashfs-xz = "mksquashfs ${IMAGE_ROOTFS} 
${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.squashfs-xz ${EXTRA_IMAGECMD} 
-noappend -comp xz"
 IMAGE_CMD:squashfs-lzo = "mksquashfs ${IMAGE_ROOTFS} 
${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.squashfs-lzo 
${EXTRA_IMAGECMD} -noappend -comp lzo"
 IMAGE_CMD:squashfs-lz4 = "mksquashfs ${IMAGE_ROOTFS} 
${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.squashfs-lz4 
${EXTRA_IMAGECMD} -noappend -comp lz4"
+IMAGE_CMD:squashfs-zst = "mksquashfs ${IMAGE_ROOTFS} 
${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.squashfs-zst 
${EXTRA_IMAGECMD} -noappend -comp zstd"
 
 IMAGE_CMD:erofs = "mkfs.erofs ${EXTRA_IMAGECMD} 
${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.erofs ${IMAGE_ROOTFS}"
 IMAGE_CMD:erofs-lz4 = "mkfs.erofs -zlz4 ${EXTRA_IMAGECMD} 
${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.erofs-lz4 ${IMAGE_ROOTFS}"
@@ -244,6 +245,7 @@ do_image_squashfs[depends] += 
"squashfs-tools-native:do_populate_sysroot"
 do_image_squashfs_xz[depends] += "squashfs-tools-native:do_populate_sysroot"
 do_image_squashfs_lzo[depends] += "squashfs-tools-native:do_populate_sysroot"
 do_image_squashfs_lz4[depends] += "squashfs-tools-native:do_populate_sysroot"
+do_image_squashfs_zst[depends] += "squashfs-tools-native:do_populate_sysroot"
 do_image_ubi[depends] += "mtd-utils-native:do_populate_sysroot"
 do_image_ubifs[depends] += "mtd-utils-native:do_populate_sysroot"
 do_image_multiubi[depends] += "mtd-utils-native:do_populate_sysroot"
@@ -262,10 +264,10 @@ IMAGE_TYPES = " \
 btrfs \
 iso \
 hddimg \
-squashfs squashfs-xz squashfs-lzo squashfs-lz4 \
+squashfs squashfs-xz squashfs-lzo squashfs-lz4 squashfs-zst \
 ubi ubifs multiubi \
 tar tar.gz tar.bz2 tar.xz tar.lz4 tar.zst \
-cpio cpio.gz cpio.xz cpio.lzma cpio.lz4 \
+cpio cpio.gz cpio.xz cpio.lzma cpio.lz4 cpio.zst \
 wic wic.gz wic.bz2 wic.lzma wic.zst \
 container \
 f2fs \
diff --git a/meta/classes/kernel-fitimage.bbclass 
b/meta/classes/kernel-fitimage.bbclass
index 2ef8f06b14..38e05153e3 100644
--- a/meta/classes/kernel-fitimage.bbclass
+++ b/meta/classes/kernel-fitimage.bbclass
@@ -576,7 +576,7 @@ fitimage_assemble() {
#
if [ "x${ramdiskcount}" = "x1" ] && [ "${INITRAMFS_IMAGE_BUNDLE}" != 
"1" ]; then
# Find and use the first initramfs image archive type we find
-   for img in cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.gz ext2.gz 
cpio; do
+   for img in cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.zst cpio.gz 
ext2.gz cpio; do

initramfs_path="${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.${img}"
echo "Using $initramfs_path"
if [ -e "${initramfs_path}" ]; then
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 9ec7daa17a..ab60e060c6 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -9,6 +9,7 @@ PROVIDES += "${@ "virtual/kernel" if 
(d.getVar("KERNEL_PACKAGE_NAME") == "kernel
 DEPENDS += "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}gcc 
kmod-native bc-native bison-native"
 DEPENDS += "${@bb.utils.contains("INITRAMFS_FSTYPES", "cpio.lzo", 
"lzop-native", "", d)}"
 DEPENDS += "${@bb.utils.contains("INITRAMFS_FSTYPES", "cpio.lz4", 
"lz4-native", "", d)}"
+DEPENDS += "${@bb.utils.contains("INITRAMFS_FSTYPES", "cpio.zst", 
"zstd-native", "", d)}"
 PACKAGE_WRITE_DEPS += "depmodwrapper-cross"
 
 do_deploy[depends] += "depmodwrapper-cross:do_populate_sysroot 
gzip-native:do_populate_sysroot"
@@ -237,7 +238,7 @@ copy_initramfs() {
mkdir -p ${B}/usr
# Find and use the first 

[OE-core] [PATCH 5/6] kernel.bbclass: Use full versions for inter-package dependencies

2021-08-23 Thread Zoltan Boszormenyi via lists.openembedded.org
From: Zoltán Böszörményi 

Some Yocto users do use package repositories and sometimes the PR
value is forgotten. Use full versions for inter-package dependencies
for the kernel subpackages.

Signed-off-by: Zoltán Böszörményi 
---
 meta/classes/kernel.bbclass | 13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 6dc5387a9b..9ec7daa17a 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -91,17 +91,18 @@ python __anonymous () {
 kname = d.getVar('KERNEL_PACKAGE_NAME') or "kernel"
 imagedest = d.getVar('KERNEL_IMAGEDEST')
 
+fullver = d.getVar('EXTENDPKGV')
 for type in types.split():
 if bb.data.inherits_class('nopackages', d):
 continue
 typelower = type.lower()
 d.appendVar('PACKAGES', ' %s-image-%s' % (kname, typelower))
 d.setVar('FILES:' + kname + '-image-' + typelower, '/' + imagedest + 
'/' + type + '-${KERNEL_VERSION_NAME}' + ' /' + imagedest + '/' + type)
-d.appendVar('RDEPENDS:%s-image' % kname, ' %s-image-%s' % (kname, 
typelower))
+d.appendVar('RDEPENDS:%s-image' % kname, ' %s-image-%s (= %s)' % 
(kname, typelower, fullver))
 splitmods = d.getVar("KERNEL_SPLIT_MODULES")
 if splitmods != '1':
-d.appendVar('RDEPENDS:%s-image' % kname, ' %s-modules' % kname)
-d.appendVar('RDEPENDS:%s-image-%s' % (kname, typelower), ' 
%s-modules-${KERNEL_VERSION_PKG_NAME}' % kname)
+d.appendVar('RDEPENDS:%s-image' % kname, ' %s-modules (= %s)' % 
(kname, fullver))
+d.appendVar('RDEPENDS:%s-image-%s' % (kname, typelower), ' 
%s-modules-${KERNEL_VERSION_PKG_NAME} (= %s)' % (kname, fullver))
 d.setVar('PKG:%s-modules' % kname, 
'%s-modules-${KERNEL_VERSION_PKG_NAME}' % kname)
 d.appendVar('RPROVIDES:%s-modules' % kname, 
'%s-modules-${KERNEL_VERSION_PKG_NAME}' % kname)
 
@@ -628,12 +629,12 @@ FILES:${KERNEL_PACKAGE_NAME}-image = ""
 FILES:${KERNEL_PACKAGE_NAME}-dev = "/boot/System.map* /boot/Module.symvers* 
/boot/config* ${KERNEL_SRC_PATH} 
${nonarch_base_libdir}/modules/${KERNEL_VERSION}/build"
 FILES:${KERNEL_PACKAGE_NAME}-vmlinux = "/boot/vmlinux-${KERNEL_VERSION_NAME}"
 FILES:${KERNEL_PACKAGE_NAME}-modules = ""
-RDEPENDS:${KERNEL_PACKAGE_NAME} = "${KERNEL_PACKAGE_NAME}-base"
+RDEPENDS:${KERNEL_PACKAGE_NAME} = "${KERNEL_PACKAGE_NAME}-base (= 
${EXTENDPKGV})"
 # Allow machines to override this dependency if kernel image files are
 # not wanted in images as standard
-RDEPENDS:${KERNEL_PACKAGE_NAME}-base ?= "${KERNEL_PACKAGE_NAME}-image"
+RDEPENDS:${KERNEL_PACKAGE_NAME}-base ?= "${KERNEL_PACKAGE_NAME}-image (= 
${EXTENDPKGV})"
 PKG:${KERNEL_PACKAGE_NAME}-image = 
"${KERNEL_PACKAGE_NAME}-image-${@legitimize_package_name(d.getVar('KERNEL_VERSION'))}"
-RDEPENDS:${KERNEL_PACKAGE_NAME}-image += 
"${@oe.utils.conditional('KERNEL_IMAGETYPE', 'vmlinux', 
'${KERNEL_PACKAGE_NAME}-vmlinux', '', d)}"
+RDEPENDS:${KERNEL_PACKAGE_NAME}-image += 
"${@oe.utils.conditional('KERNEL_IMAGETYPE', 'vmlinux', 
'${KERNEL_PACKAGE_NAME}-vmlinux (= ${EXTENDPKGV})', '', d)}"
 PKG:${KERNEL_PACKAGE_NAME}-base = 
"${KERNEL_PACKAGE_NAME}-${@legitimize_package_name(d.getVar('KERNEL_VERSION'))}"
 RPROVIDES:${KERNEL_PACKAGE_NAME}-base += 
"${KERNEL_PACKAGE_NAME}-${KERNEL_VERSION}"
 ALLOW_EMPTY:${KERNEL_PACKAGE_NAME} = "1"
-- 
2.31.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#155148): 
https://lists.openembedded.org/g/openembedded-core/message/155148
Mute This Topic: https://lists.openembedded.org/mt/85083971/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/6] kernel.bbclass: Adapt to KERNEL_SPLIT_MODULES != "1" case

2021-08-23 Thread Zoltan Boszormenyi via lists.openembedded.org
From: Zoltán Böszörményi 

Extra RDEPENDS and other inter-package references are needed.

Signed-off-by: Zoltán Böszörményi 
---
 meta/classes/kernel.bbclass | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 027e66eec7..6dc5387a9b 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -98,6 +98,13 @@ python __anonymous () {
 d.appendVar('PACKAGES', ' %s-image-%s' % (kname, typelower))
 d.setVar('FILES:' + kname + '-image-' + typelower, '/' + imagedest + 
'/' + type + '-${KERNEL_VERSION_NAME}' + ' /' + imagedest + '/' + type)
 d.appendVar('RDEPENDS:%s-image' % kname, ' %s-image-%s' % (kname, 
typelower))
+splitmods = d.getVar("KERNEL_SPLIT_MODULES")
+if splitmods != '1':
+d.appendVar('RDEPENDS:%s-image' % kname, ' %s-modules' % kname)
+d.appendVar('RDEPENDS:%s-image-%s' % (kname, typelower), ' 
%s-modules-${KERNEL_VERSION_PKG_NAME}' % kname)
+d.setVar('PKG:%s-modules' % kname, 
'%s-modules-${KERNEL_VERSION_PKG_NAME}' % kname)
+d.appendVar('RPROVIDES:%s-modules' % kname, 
'%s-modules-${KERNEL_VERSION_PKG_NAME}' % kname)
+
 d.setVar('PKG:%s-image-%s' % (kname,typelower), 
'%s-image-%s-${KERNEL_VERSION_PKG_NAME}' % (kname, typelower))
 d.setVar('ALLOW_EMPTY:%s-image-%s' % (kname, typelower), '1')
 d.setVar('pkg_postinst:%s-image-%s' % (kname,typelower), """set +e
-- 
2.31.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#155147): 
https://lists.openembedded.org/g/openembedded-core/message/155147
Mute This Topic: https://lists.openembedded.org/mt/85083969/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/6] kernel-module-split.bbclass: Allow opt-out of split kernel modules

2021-08-23 Thread Zoltan Boszormenyi via lists.openembedded.org
From: Zoltán Böszörményi 

For some use cases, a monolithic kernel-modules package containing
all modules built from the kernel sources may be preferred.
For one, download time is shorter and installation time is faster.

Set KERNEL_SPLIT_MODULES="0" for this.

The default is one subpackage per module.

Signed-off-by: Zoltán Böszörményi 
---
 meta/classes/kernel-module-split.bbclass | 17 +
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/meta/classes/kernel-module-split.bbclass 
b/meta/classes/kernel-module-split.bbclass
index 6c1de4c992..a29c294810 100644
--- a/meta/classes/kernel-module-split.bbclass
+++ b/meta/classes/kernel-module-split.bbclass
@@ -28,6 +28,7 @@ do_install:append() {
install -d ${D}${sysconfdir}/modules-load.d/ 
${D}${sysconfdir}/modprobe.d/
 }
 
+KERNEL_SPLIT_MODULES ?= "1"
 PACKAGESPLITFUNCS:prepend = "split_kernel_module_packages "
 
 KERNEL_MODULES_META_PACKAGE ?= "${@ d.getVar("KERNEL_PACKAGE_NAME") or 
"kernel" }-modules"
@@ -156,18 +157,26 @@ python split_kernel_module_packages () {
 kernel_package_name = d.getVar("KERNEL_PACKAGE_NAME") or "kernel"
 kernel_version = d.getVar("KERNEL_VERSION")
 
+metapkg = d.getVar('KERNEL_MODULES_META_PACKAGE')
+splitmods = d.getVar('KERNEL_SPLIT_MODULES')
+postinst = d.getVar('pkg_postinst:modules')
+postrm = d.getVar('pkg_postrm:modules')
+
+if splitmods != '1':
+etcdir = d.getVar('sysconfdir')
+d.appendVar('FILES:' + metapkg, '%s/modules-load.d/ %s/modprobe.d/ 
%s/modules/' % (etcdir, etcdir, d.getVar("nonarch_base_libdir")))
+d.appendVar('pkg_postinst:%s' % metapkg, postinst)
+d.prependVar('pkg_postrm:%s' % metapkg, postrm);
+return
+
 module_regex = r'^(.*)\.k?o(?:\.(gz|xz|zst))?$'
 
 module_pattern_prefix = d.getVar('KERNEL_MODULE_PACKAGE_PREFIX')
 module_pattern_suffix = d.getVar('KERNEL_MODULE_PACKAGE_SUFFIX')
 module_pattern = module_pattern_prefix + kernel_package_name + 
'-module-%s' + module_pattern_suffix
 
-postinst = d.getVar('pkg_postinst:modules')
-postrm = d.getVar('pkg_postrm:modules')
-
 modules = do_split_packages(d, root='${nonarch_base_libdir}/modules', 
file_regex=module_regex, output_pattern=module_pattern, description='%s kernel 
module', postinst=postinst, postrm=postrm, recursive=True, hook=frob_metadata, 
extra_depends='%s-%s' % (kernel_package_name, kernel_version))
 if modules:
-metapkg = d.getVar('KERNEL_MODULES_META_PACKAGE')
 d.appendVar('RDEPENDS:' + metapkg, ' '+' '.join(modules))
 
 # If modules-load.d and modprobe.d are empty at this point, remove them to
-- 
2.31.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#155146): 
https://lists.openembedded.org/g/openembedded-core/message/155146
Mute This Topic: https://lists.openembedded.org/mt/85083968/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/6] kernel-module-split.bbclass: Support zstd-compressed modules

2021-08-23 Thread Zoltan Boszormenyi via lists.openembedded.org
From: Zoltán Böszörményi 

Signed-off-by: Zoltán Böszörményi 
---
 meta/classes/kernel-module-split.bbclass | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/meta/classes/kernel-module-split.bbclass 
b/meta/classes/kernel-module-split.bbclass
index b56dd4a9c7..6c1de4c992 100644
--- a/meta/classes/kernel-module-split.bbclass
+++ b/meta/classes/kernel-module-split.bbclass
@@ -44,17 +44,20 @@ python split_kernel_module_packages () {
 def extract_modinfo(file):
 import tempfile, subprocess
 tempfile.tempdir = d.getVar("WORKDIR")
-compressed = re.match( r'.*\.([xg])z$', file)
+compressed = re.match( r'.*\.(gz|xz|zst)$', file)
 tf = tempfile.mkstemp()
 tmpfile = tf[1]
 if compressed:
 tmpkofile = tmpfile + ".ko"
-if compressed.group(1) == 'g':
+if compressed.group(1) == 'gz':
 cmd = "gunzip -dc %s > %s" % (file, tmpkofile)
 subprocess.check_call(cmd, shell=True)
-elif compressed.group(1) == 'x':
+elif compressed.group(1) == 'xz':
 cmd = "xz -dc %s > %s" % (file, tmpkofile)
 subprocess.check_call(cmd, shell=True)
+elif compressed.group(1) == 'zst':
+cmd = "zstd -dc %s > %s" % (file, tmpkofile)
+subprocess.check_call(cmd, shell=True)
 else:
 msg = "Cannot decompress '%s'" % file
 raise msg
@@ -153,7 +156,7 @@ python split_kernel_module_packages () {
 kernel_package_name = d.getVar("KERNEL_PACKAGE_NAME") or "kernel"
 kernel_version = d.getVar("KERNEL_VERSION")
 
-module_regex = r'^(.*)\.k?o(?:\.[xg]z)?$'
+module_regex = r'^(.*)\.k?o(?:\.(gz|xz|zst))?$'
 
 module_pattern_prefix = d.getVar('KERNEL_MODULE_PACKAGE_PREFIX')
 module_pattern_suffix = d.getVar('KERNEL_MODULE_PACKAGE_SUFFIX')
-- 
2.31.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#155145): 
https://lists.openembedded.org/g/openembedded-core/message/155145
Mute This Topic: https://lists.openembedded.org/mt/85083967/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/6] package_rpm.bbclass: Handle posttrans scriptlets

2021-08-23 Thread Zoltan Boszormenyi via lists.openembedded.org
From: Zoltán Böszörményi 

The "posttrans" scriptlet is the RPM equivalent of the
OPKG "intercept script" concept and probably a cleaner one.

"pretrans" also exists in RPM but there's no equivalent
for it in OPKG.

Signed-off-by: Zoltán Böszörményi 
---
 meta/classes/package_rpm.bbclass | 30 +-
 1 file changed, 21 insertions(+), 9 deletions(-)

diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 88d861c0e7..5992d3fd06 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -308,10 +308,11 @@ python write_specfile () {
 srcrconflicts  = ""
 srcrobsoletes  = ""
 
-srcrpreinst  = []
-srcrpostinst = []
-srcrprerm= []
-srcrpostrm   = []
+srcrpreinst   = []
+srcrpostinst  = []
+srcrprerm = []
+srcrpostrm= []
+srcrposttrans = []
 
 spec_preamble_top = []
 spec_preamble_bottom = []
@@ -373,11 +374,11 @@ python write_specfile () {
 splitrconflicts  = localdata.getVar('RCONFLICTS') or ""
 splitrobsoletes  = ""
 
-splitrpreinst  = localdata.getVar('pkg_preinst')
-splitrpostinst = localdata.getVar('pkg_postinst')
-splitrprerm= localdata.getVar('pkg_prerm')
-splitrpostrm   = localdata.getVar('pkg_postrm')
-
+splitrpreinst   = localdata.getVar('pkg_preinst')
+splitrpostinst  = localdata.getVar('pkg_postinst')
+splitrprerm = localdata.getVar('pkg_prerm')
+splitrpostrm= localdata.getVar('pkg_postrm')
+splitrposttrans = localdata.getVar('pkg_posttrans')
 
 if not perfiledeps:
 # Add in summary of per file dependencies
@@ -405,6 +406,7 @@ python write_specfile () {
 srcrpostinst   = splitrpostinst
 srcrprerm  = splitrprerm
 srcrpostrm = splitrpostrm
+srcrposttrans  = splitrposttrans
 
 file_list = []
 walk_files(root, file_list, conffiles, dirfiles)
@@ -496,6 +498,11 @@ python write_specfile () {
 scriptvar = wrap_uninstall(splitrpostrm)
 spec_scriptlets_bottom.append(scriptvar)
 spec_scriptlets_bottom.append('')
+if splitrposttrans:
+spec_scriptlets_bottom.append('%%posttrans -n %s' % splitname)
+spec_scriptlets_bottom.append('# %s - posttrans' % splitname)
+spec_scriptlets_bottom.append(splitrposttrans)
+spec_scriptlets_bottom.append('')
 
 # Now process files
 file_list = []
@@ -590,6 +597,11 @@ python write_specfile () {
 scriptvar = wrap_uninstall(srcrpostrm)
 spec_scriptlets_top.append(scriptvar)
 spec_scriptlets_top.append('')
+if srcrposttrans:
+spec_scriptlets_top.append('%posttrans')
+spec_scriptlets_top.append('# %s - posttrans' % srcname)
+spec_scriptlets_top.append(srcrposttrans)
+spec_scriptlets_top.append('')
 
 # Write the SPEC file
 specfile = open(outspecfile, 'w')
-- 
2.31.1


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



[OE-core] Kernel and RPM related bbclass changes

2021-08-23 Thread Zoltan Boszormenyi via lists.openembedded.org
I have been carrying some forked bbclass recipes and I think
these can be beneficial to others, not to mention that I could
get rid of the private forks of these.

Please, review.

Best regards,
Zoltán Böszörményi



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#155143): 
https://lists.openembedded.org/g/openembedded-core/message/155143
Mute This Topic: https://lists.openembedded.org/mt/85083965/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] busybox: 1.33.1 -> 1.34.0

2021-08-23 Thread Andrej Valek
- update to next stable version 1.34.0
- refresh defconfig
- remove and refresh already merged patches

Signed-off-by: Andrej Valek 
---
 ...inittab_1.33.0.bb => busybox-inittab_1.34.0.bb} |   0
 ...iles-Use-C-locale-when-calling-sed-on-glo.patch |  28 --
 ...-testsuite-check-uudecode-before-using-it.patch |   6 +-
 .../busybox/busybox-udhcpc-no_deconfig.patch   | 102 +
 meta/recipes-core/busybox/busybox/defconfig|  12 ++-
 .../{busybox_1.33.1.bb => busybox_1.34.0.bb}   |   3 +-
 6 files changed, 36 insertions(+), 115 deletions(-)
 rename meta/recipes-core/busybox/{busybox-inittab_1.33.0.bb => 
busybox-inittab_1.34.0.bb} (100%)
 delete mode 100644 
meta/recipes-core/busybox/busybox/0001-gen_build_files-Use-C-locale-when-calling-sed-on-glo.patch
 rename meta/recipes-core/busybox/{busybox_1.33.1.bb => busybox_1.34.0.bb} (92%)

diff --git a/meta/recipes-core/busybox/busybox-inittab_1.33.0.bb 
b/meta/recipes-core/busybox/busybox-inittab_1.34.0.bb
similarity index 100%
rename from meta/recipes-core/busybox/busybox-inittab_1.33.0.bb
rename to meta/recipes-core/busybox/busybox-inittab_1.34.0.bb
diff --git 
a/meta/recipes-core/busybox/busybox/0001-gen_build_files-Use-C-locale-when-calling-sed-on-glo.patch
 
b/meta/recipes-core/busybox/busybox/0001-gen_build_files-Use-C-locale-when-calling-sed-on-glo.patch
deleted file mode 100644
index e0a22c5bb3..00
--- 
a/meta/recipes-core/busybox/busybox/0001-gen_build_files-Use-C-locale-when-calling-sed-on-glo.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From bff7f16f7f41de8df67beb03722f235828ef2249 Mon Sep 17 00:00:00 2001
-From: Khem Raj 
-Date: Mon, 3 May 2021 15:48:19 -0700
-Subject: [PATCH] gen_build_files: Use C locale when calling sed on globbed 
files
-
-sort order is different based on chosen locale and also default shell
-being bash or dash
-
-This sets the environment variable LC_ALL to the value C, which will
-enforce bytewise sorting, irrespective of the shell
-
-Upstream-Status: Pending
-Signed-off-by: Khem Raj 

- scripts/gen_build_files.sh | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
 a/scripts/gen_build_files.sh
-+++ b/scripts/gen_build_files.sh
-@@ -4,6 +4,8 @@
- # but users complain that many sed implementations
- # are misinterpreting --.
- 
-+export LC_ALL=C
-+
- test $# -ge 2 || { echo "Syntax: $0 SRCTREE OBJTREE"; exit 1; }
- 
- # cd to objtree
diff --git 
a/meta/recipes-core/busybox/busybox/0001-testsuite-check-uudecode-before-using-it.patch
 
b/meta/recipes-core/busybox/busybox/0001-testsuite-check-uudecode-before-using-it.patch
index 25472f0bbd..d4bda3c12f 100644
--- 
a/meta/recipes-core/busybox/busybox/0001-testsuite-check-uudecode-before-using-it.patch
+++ 
b/meta/recipes-core/busybox/busybox/0001-testsuite-check-uudecode-before-using-it.patch
@@ -18,13 +18,13 @@ diff --git a/testsuite/tar.tests b/testsuite/tar.tests
 index d71a349..8c88567 100755
 --- a/testsuite/tar.tests
 +++ b/testsuite/tar.tests
-@@ -336,7 +336,7 @@ SKIP=
- cd .. || exit 1; rm -rf tar.tempdir 2>/dev/null
+@@ -339,7 +339,7 @@ cd .. || exit 1; rm -rf tar.tempdir 2>/d
+ fi
  
  mkdir tar.tempdir && cd tar.tempdir || exit 1
 -optional FEATURE_SEAMLESS_BZ2 FEATURE_TAR_AUTODETECT LS
 +optional FEATURE_SEAMLESS_BZ2 FEATURE_TAR_AUTODETECT LS UUDECODE
- testing "Symlink attack: create symlink and then write through it" '\
+ testing "tar Symlink attack: create symlink and then write through it" '\
  exec 2>&1
  uudecode -o input && tar xvf input; echo $?
 diff --git a/testsuite/unzip.tests b/testsuite/unzip.tests
diff --git a/meta/recipes-core/busybox/busybox/busybox-udhcpc-no_deconfig.patch 
b/meta/recipes-core/busybox/busybox/busybox-udhcpc-no_deconfig.patch
index 35e981d6a2..948932a3e8 100644
--- a/meta/recipes-core/busybox/busybox/busybox-udhcpc-no_deconfig.patch
+++ b/meta/recipes-core/busybox/busybox/busybox-udhcpc-no_deconfig.patch
@@ -31,11 +31,11 @@ Signed-off-by: Andreas Oberritter 
  networking/udhcp/dhcpc.c   | 29 --
  1 file changed, 21 insertions(+), 8 deletions(-)
 
-Index: busybox-1.32.0/networking/udhcp/dhcpc.c
+Index: busybox-1.34.0/networking/udhcp/dhcpc.c
 ===
 busybox-1.32.0.orig/networking/udhcp/dhcpc.c
-+++ busybox-1.32.0/networking/udhcp/dhcpc.c
-@@ -48,6 +48,8 @@ struct tpacket_auxdata {
+--- busybox-1.34.0.orig/networking/udhcp/dhcpc.c
 busybox-1.34.0/networking/udhcp/dhcpc.c
+@@ -48,6 +48,8 @@
  };
  #endif
  
@@ -44,47 +44,37 @@ Index: busybox-1.32.0/networking/udhcp/dhcpc.c
  
  /* "struct client_data_t client_data" is in bb_common_bufsiz1 */
  
-@@ -103,8 +105,10 @@
-   OPT_x = 1 << 18,
-   OPT_f = 1 << 19,
-   OPT_B = 1 << 20,
-+  OPT_D = 1 << 21,
+@@ -100,8 +102,10 @@
+   OPT_x = 1 << 16,
+   OPT_f = 1 << 17,
+   OPT_B = 1 << 18,
++  OPT_D = 1 << 19,
  /* The rest has variable bit positions, need to be clever */
-   OPTBIT_B = 20,
-+  OPTBIT_D = 

[OE-core][dunfell][PATCH] mklibs-native: drop deprecated cpp17 exceptions

2021-08-23 Thread Andrej Valek
gcc11 has -std=gnu++17 as default. Remove deprecated C++17 exceptions based
on http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0003r5.html.

Signed-off-by: Andrej Valek 
---
 ...-deprecated-exception-specification-cpp17.patch | 431 +
 .../mklibs/mklibs-native_0.1.44.bb |   1 +
 2 files changed, 432 insertions(+)
 create mode 100644 
meta/recipes-devtools/mklibs/files/remove-deprecated-exception-specification-cpp17.patch

diff --git 
a/meta/recipes-devtools/mklibs/files/remove-deprecated-exception-specification-cpp17.patch
 
b/meta/recipes-devtools/mklibs/files/remove-deprecated-exception-specification-cpp17.patch
new file mode 100644
index 00..0c4c911976
--- /dev/null
+++ 
b/meta/recipes-devtools/mklibs/files/remove-deprecated-exception-specification-cpp17.patch
@@ -0,0 +1,431 @@
+From 597c7a8333df84a87cc48fb8477b603ffbf372a6 Mon Sep 17 00:00:00 2001
+From: Andrej Valek 
+Date: Mon, 23 Aug 2021 12:45:11 +0200
+Subject: [PATCH] feat(cpp17): remove deprecated exception specifications for
+ C++ 17
+
+Upstream-Status: Submitted
+
+based on: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0003r5.html
+
+Signed-off-by: Andrej Valek 
+---
+ src/mklibs-readelf/elf.cpp  | 48 -
+ src/mklibs-readelf/elf.hpp  | 18 
+ src/mklibs-readelf/elf_data.hpp | 36 +++
+ 3 files changed, 51 insertions(+), 51 deletions(-)
+
+diff --git a/src/mklibs-readelf/elf.cpp b/src/mklibs-readelf/elf.cpp
+index 0e4c0f3..2e6d0f6 100644
+--- a/src/mklibs-readelf/elf.cpp
 b/src/mklibs-readelf/elf.cpp
+@@ -36,7 +36,7 @@ file::~file () throw ()
+ delete *it;
+ }
+ 
+-file *file::open (const char *filename) throw (std::bad_alloc, 
std::runtime_error)
++file *file::open (const char *filename) throw ()
+ {
+   struct stat buf;
+   int fd;
+@@ -72,7 +72,7 @@ file *file::open (const char *filename) throw 
(std::bad_alloc, std::runtime_erro
+ }
+ 
+ template
+-file *file::open_class(uint8_t *mem, size_t len) throw (std::bad_alloc, 
std::runtime_error)
++file *file::open_class(uint8_t *mem, size_t len) throw ()
+ {
+   switch (mem[EI_DATA])
+   {
+@@ -86,7 +86,7 @@ file *file::open_class(uint8_t *mem, size_t len) throw 
(std::bad_alloc, std::run
+ }
+ 
+ template 
+-file_data<_class, _data>::file_data(uint8_t *mem, size_t len) throw 
(std::bad_alloc, std::runtime_error)
++file_data<_class, _data>::file_data(uint8_t *mem, size_t len) throw ()
+ : file(mem, len)
+ {
+   if (mem[EI_CLASS] != _class::id)
+@@ -190,7 +190,7 @@ section_data<_class, _data>::section_data(Shdr *shdr, 
uint8_t *mem) throw ()
+ }
+ 
+ template 
+-void section_data<_class, _data>::update(const file ) throw 
(std::bad_alloc)
++void section_data<_class, _data>::update(const file ) throw ()
+ {
+   const section_type  =
+ dynamic_cast 
&>(file.get_section(file.get_shstrndx()));
+@@ -204,7 +204,7 @@ section_type::~section_type() throw 
()
+ }
+ 
+ template 
+-section_real<_class, _data, section_type_DYNAMIC>::section_real(Shdr *header, 
uint8_t *mem) throw (std::bad_alloc)
++section_real<_class, _data, section_type_DYNAMIC>::section_real(Shdr *header, 
uint8_t *mem) throw ()
+ : section_data<_class, _data>(header, mem)
+ {
+   if (this->type != SHT_DYNAMIC)
+@@ -221,7 +221,7 @@ section_real<_class, _data, 
section_type_DYNAMIC>::section_real(Shdr *header, ui
+ }
+ 
+ template 
+-void section_real<_class, _data, section_type_DYNAMIC>::update(const file 
) throw (std::bad_alloc)
++void section_real<_class, _data, section_type_DYNAMIC>::update(const file 
) throw ()
+ {
+   section_data<_class, _data>::update(file);
+ 
+@@ -243,7 +243,7 @@ section_type::~section_type() throw ()
+ }
+ 
+ template 
+-section_real<_class, _data, section_type_DYNSYM>::section_real(Shdr *header, 
uint8_t *mem) throw (std::bad_alloc)
++section_real<_class, _data, section_type_DYNSYM>::section_real(Shdr *header, 
uint8_t *mem) throw ()
+ : section_data<_class, _data>(header, mem)
+ {
+   if (this->type != SHT_DYNSYM)
+@@ -260,7 +260,7 @@ section_real<_class, _data, 
section_type_DYNSYM>::section_real(Shdr *header, uin
+ }
+ 
+ template 
+-void section_real<_class, _data, section_type_DYNSYM>::update(const file 
) throw (std::bad_alloc)
++void section_real<_class, _data, section_type_DYNSYM>::update(const file 
) throw ()
+ {
+   section_data<_class, _data>::update (file);
+ 
+@@ -285,7 +285,7 @@ const version_definition 
*section_type::get_version_def
+ }
+ 
+ template 
+-section_real<_class, _data, section_type_GNU_VERDEF>::section_real(Shdr 
*header, uint8_t *mem) throw (std::bad_alloc)
++section_real<_class, _data, section_type_GNU_VERDEF>::section_real(Shdr 
*header, uint8_t *mem) throw ()
+ : section_data<_class, _data>(header, mem)
+ {
+   if (this->type != SHT_GNU_verdef)
+@@ -307,7 +307,7 @@ section_real<_class, _data, 
section_type_GNU_VERDEF>::section_real(Shdr *header,
+ }
+ 
+ template 
+-void section_real<_class, _data, 

[OE-core][PATCH] vim: add option to disable NLS support

2021-08-23 Thread Andrej Valek
- Some distributions with UTF-8 locale have problem when National Language
 Support is enabled. Add there an option to disable it.
- refresh options based on configure.ac

Signed-off-by: Andrej Valek 
---
 meta/recipes-support/vim/vim.inc | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-support/vim/vim.inc b/meta/recipes-support/vim/vim.inc
index 17d1c24a7c..7cc47884f2 100644
--- a/meta/recipes-support/vim/vim.inc
+++ b/meta/recipes-support/vim/vim.inc
@@ -54,19 +54,21 @@ do_compile() {
 autotools_do_compile
 }
 
-#Available PACKAGECONFIG options are gtkgui, acl, x11, tiny
+#Available PACKAGECONFIG options are gtkgui, acl, x11, tiny, selinux, 
elfutils, nls
 PACKAGECONFIG ??= ""
 PACKAGECONFIG += " \
 ${@bb.utils.filter('DISTRO_FEATURES', 'acl selinux', d)} \
 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11 gtkgui', '', d)} \
+nls \
 "
 
 PACKAGECONFIG[gtkgui] = "--enable-gui=gtk3,--enable-gui=no,gtk+3"
-PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl,"
+PACKAGECONFIG[acl] = "enable_acl="yes",--disable-acl,acl,"
 PACKAGECONFIG[x11] = "--with-x,--without-x,xt,"
 PACKAGECONFIG[tiny] = "--with-features=tiny,--with-features=big,,"
-PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux,"
+PACKAGECONFIG[selinux] = "enable_selinux="yes",--disable-selinux,libselinux,"
 PACKAGECONFIG[elfutils] = "--enable-elf-check,,elfutils,"
+PACKAGECONFIG[nls] = "enable_nls="yes",--disable-nls,,"
 
 EXTRA_OECONF = " \
 --disable-gpm \
-- 
2.11.0


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#155140): 
https://lists.openembedded.org/g/openembedded-core/message/155140
Mute This Topic: https://lists.openembedded.org/mt/85082071/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] [v4] [RFC] Merge meta-rust to oe-core - Aug 19 update

2021-08-23 Thread Richard Purdie
On Sun, 2021-08-22 at 08:45 -0400, Randy MacLeod wrote:
> On 2021-08-22 7:19 a.m., Richard Purdie wrote:
> > On Sat, 2021-08-21 at 23:12 -0400, Randy MacLeod wrote:
> > > On 2021-08-20 10:48 p.m., Randy MacLeod wrote:
> > > With a patch from Richard, and the http_proxy check removed,
> > > $ git diff | grep "^[+-]"
> > >   --- a/meta/lib/oeqa/selftest/cases/sstatetests.py
> > >   +++ b/meta/lib/oeqa/selftest/cases/sstatetests.py
> > >   -http_proxy = "http://example.com/;
> > >   +http_proxy = ""
> > >   
> > > we have fixed the oe-selftest that was failing.
> > >   Any volunteers to stub out the http[s]_proxy code in cargo ?
> > > I've written up a commit log that could use some review and pushed an 
> > > update
> > > to:
> > > 
> > > http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=rmacleod/rust-redo-aug-17-2021-a
> > > 
> > 
> > 
> > I'm not sure you need to change cargo, I think if you remove the bit in the
> > bbclass that injects http_proxy, the tests are ok. That will perhaps break
> > anyone using proxies but for now, I think that is a reasonable step of 
> > getting
> > this moved forward?
> 
> That's what I hoped for as well but not what my testing showed.
> 
> I removed (commented out actually) the http_proxy injection here:
>  
> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=rmacleod/rust-redo-aug-17-2021-a=a4808f787caf8d0b44cf3946cf204164f24f91d4
> 
> but the test still fails unless I mangle the test:
> 
> meta/lib/oeqa/selftest/cases/sstatetests.py
> 
> 
> -http_proxy = "http://example.com/;
> 
> 
> +http_proxy = ""

Right, my point is that doesn't remove it. You need to delete it, not comment it
out.

The issue is that bitbake does variable expansion on the scripts before running
them.

It can't tell that this is a comment, just that the script differs after
variable expansion.

Cheers,

Richard




-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#155139): 
https://lists.openembedded.org/g/openembedded-core/message/155139
Mute This Topic: https://lists.openembedded.org/mt/85017687/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] busybox: 1.33.1 -> 1.34.0

2021-08-23 Thread Andrej Valek
- update to next stable version 1.34.0
- refresh defconfig
- remove and refresh already merged patches

Signed-off-by: Andrej Valek 
---
 ...inittab_1.33.0.bb => busybox-inittab_1.34.0.bb} |   0
 ...iles-Use-C-locale-when-calling-sed-on-glo.patch |  28 --
 ...-testsuite-check-uudecode-before-using-it.patch |   6 +-
 .../busybox/busybox-udhcpc-no_deconfig.patch   | 102 +
 meta/recipes-core/busybox/busybox/defconfig|  12 ++-
 .../{busybox_1.33.1.bb => busybox_1.34.0.bb}   |   3 +-
 6 files changed, 36 insertions(+), 115 deletions(-)
 rename meta/recipes-core/busybox/{busybox-inittab_1.33.0.bb => 
busybox-inittab_1.34.0.bb} (100%)
 delete mode 100644 
meta/recipes-core/busybox/busybox/0001-gen_build_files-Use-C-locale-when-calling-sed-on-glo.patch
 rename meta/recipes-core/busybox/{busybox_1.33.1.bb => busybox_1.34.0.bb} (92%)

diff --git a/meta/recipes-core/busybox/busybox-inittab_1.33.0.bb 
b/meta/recipes-core/busybox/busybox-inittab_1.34.0.bb
similarity index 100%
rename from meta/recipes-core/busybox/busybox-inittab_1.33.0.bb
rename to meta/recipes-core/busybox/busybox-inittab_1.34.0.bb
diff --git 
a/meta/recipes-core/busybox/busybox/0001-gen_build_files-Use-C-locale-when-calling-sed-on-glo.patch
 
b/meta/recipes-core/busybox/busybox/0001-gen_build_files-Use-C-locale-when-calling-sed-on-glo.patch
deleted file mode 100644
index e0a22c5bb3..00
--- 
a/meta/recipes-core/busybox/busybox/0001-gen_build_files-Use-C-locale-when-calling-sed-on-glo.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From bff7f16f7f41de8df67beb03722f235828ef2249 Mon Sep 17 00:00:00 2001
-From: Khem Raj 
-Date: Mon, 3 May 2021 15:48:19 -0700
-Subject: [PATCH] gen_build_files: Use C locale when calling sed on globbed 
files
-
-sort order is different based on chosen locale and also default shell
-being bash or dash
-
-This sets the environment variable LC_ALL to the value C, which will
-enforce bytewise sorting, irrespective of the shell
-
-Upstream-Status: Pending
-Signed-off-by: Khem Raj 

- scripts/gen_build_files.sh | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
 a/scripts/gen_build_files.sh
-+++ b/scripts/gen_build_files.sh
-@@ -4,6 +4,8 @@
- # but users complain that many sed implementations
- # are misinterpreting --.
- 
-+export LC_ALL=C
-+
- test $# -ge 2 || { echo "Syntax: $0 SRCTREE OBJTREE"; exit 1; }
- 
- # cd to objtree
diff --git 
a/meta/recipes-core/busybox/busybox/0001-testsuite-check-uudecode-before-using-it.patch
 
b/meta/recipes-core/busybox/busybox/0001-testsuite-check-uudecode-before-using-it.patch
index 25472f0bbd..d4bda3c12f 100644
--- 
a/meta/recipes-core/busybox/busybox/0001-testsuite-check-uudecode-before-using-it.patch
+++ 
b/meta/recipes-core/busybox/busybox/0001-testsuite-check-uudecode-before-using-it.patch
@@ -18,13 +18,13 @@ diff --git a/testsuite/tar.tests b/testsuite/tar.tests
 index d71a349..8c88567 100755
 --- a/testsuite/tar.tests
 +++ b/testsuite/tar.tests
-@@ -336,7 +336,7 @@ SKIP=
- cd .. || exit 1; rm -rf tar.tempdir 2>/dev/null
+@@ -339,7 +339,7 @@ cd .. || exit 1; rm -rf tar.tempdir 2>/d
+ fi
  
  mkdir tar.tempdir && cd tar.tempdir || exit 1
 -optional FEATURE_SEAMLESS_BZ2 FEATURE_TAR_AUTODETECT LS
 +optional FEATURE_SEAMLESS_BZ2 FEATURE_TAR_AUTODETECT LS UUDECODE
- testing "Symlink attack: create symlink and then write through it" '\
+ testing "tar Symlink attack: create symlink and then write through it" '\
  exec 2>&1
  uudecode -o input && tar xvf input; echo $?
 diff --git a/testsuite/unzip.tests b/testsuite/unzip.tests
diff --git a/meta/recipes-core/busybox/busybox/busybox-udhcpc-no_deconfig.patch 
b/meta/recipes-core/busybox/busybox/busybox-udhcpc-no_deconfig.patch
index 35e981d6a2..d55a85420b 100644
--- a/meta/recipes-core/busybox/busybox/busybox-udhcpc-no_deconfig.patch
+++ b/meta/recipes-core/busybox/busybox/busybox-udhcpc-no_deconfig.patch
@@ -31,11 +31,11 @@ Signed-off-by: Andreas Oberritter 
  networking/udhcp/dhcpc.c   | 29 --
  1 file changed, 21 insertions(+), 8 deletions(-)
 
-Index: busybox-1.32.0/networking/udhcp/dhcpc.c
+Index: busybox-1.34.0/networking/udhcp/dhcpc.c
 ===
 busybox-1.32.0.orig/networking/udhcp/dhcpc.c
-+++ busybox-1.32.0/networking/udhcp/dhcpc.c
-@@ -48,6 +48,8 @@ struct tpacket_auxdata {
+--- busybox-1.34.0.orig/networking/udhcp/dhcpc.c
 busybox-1.34.0/networking/udhcp/dhcpc.c
+@@ -48,6 +48,8 @@
  };
  #endif
  
@@ -44,47 +44,37 @@ Index: busybox-1.32.0/networking/udhcp/dhcpc.c
  
  /* "struct client_data_t client_data" is in bb_common_bufsiz1 */
  
-@@ -103,8 +105,10 @@
-   OPT_x = 1 << 18,
-   OPT_f = 1 << 19,
-   OPT_B = 1 << 20,
-+  OPT_D = 1 << 21,
+@@ -100,8 +102,10 @@
+   OPT_x = 1 << 16,
+   OPT_f = 1 << 17,
+   OPT_B = 1 << 18,
++  OPT_D = 1 << 19,
  /* The rest has variable bit positions, need to be clever */
-   OPTBIT_B = 20,
-+  OPTBIT_D = 

Re: [OE-core] [hardknott][PATCH] glibc: Fix CVE-2021-38604

2021-08-23 Thread Anuj Mittal
This is giving warnings for nativesdk-glibc:

Applying patch 0001-CVE-2021-38604.patch
patching file sysdeps/unix/sysv/linux/mq_notify.c
Hunk #1 succeeded at 132 with fuzz 1 (offset 1 line).


Applying patch 0002-CVE-2021-38604.patch
patching file rt/Makefile
Hunk #1 succeeded at 44 with fuzz 1 (offset -30 lines).
patching file rt/tst-bz28213.c


The context lines in the patches can be updated with devtool:

devtool modify nativesdk-glibc
devtool finish --force-patch-refresh nativesdk-glibc 

Thanks,

Anuj

On Wed, 2021-08-18 at 08:42 -0700, Vinay Kumar wrote:
> Source: https://sourceware.org/git/glibc.git
> Tracking -- https://sourceware.org/bugzilla/show_bug.cgi?id=28213
> 
> Backported upstream commits b805aebd42364fe696e417808a700fdb9800c9e8
> and 4cc79c217744743077bf7a0ec5e0a4318f1e6641
> to glibc-2.33 source.
> 
> Upstream-Status: Backport
> [https://sourceware.org/git/?p=glibc.git;a=commit;h=b805aebd42364fe696e417808a700fdb9800c9e8
> ]
> Upstream-Status: Backport
> [https://sourceware.org/git/?p=glibc.git;a=commit;h=4cc79c217744743077bf7a0ec5e0a4318f1e6641
> ]
> 
> Signed-off-by: Vinay Kumar 
> ---
>  .../glibc/glibc/0001-CVE-2021-38604.patch |  43 +
>  .../glibc/glibc/0002-CVE-2021-38604.patch | 150 ++
>  meta/recipes-core/glibc/glibc_2.33.bb |   2 +
>  3 files changed, 195 insertions(+)
>  create mode 100644 meta/recipes-core/glibc/glibc/0001-CVE-2021-
> 38604.patch
>  create mode 100644 meta/recipes-core/glibc/glibc/0002-CVE-2021-
> 38604.patch
> 
> diff --git a/meta/recipes-core/glibc/glibc/0001-CVE-2021-38604.patch
> b/meta/recipes-core/glibc/glibc/0001-CVE-2021-38604.patch
> new file mode 100644
> index 00..1e94049004
> --- /dev/null
> +++ b/meta/recipes-core/glibc/glibc/0001-CVE-2021-38604.patch
> @@ -0,0 +1,43 @@
> +From b805aebd42364fe696e417808a700fdb9800c9e8 Mon Sep 17 00:00:00 2001
> +From: Nikita Popov 
> +Date: Mon, 9 Aug 2021 20:17:34 +0530
> +Subject: [PATCH] librt: fix NULL pointer dereference (bug 28213)
> +
> +Helper thread frees copied attribute on NOTIFY_REMOVED message
> +received from the OS kernel.  Unfortunately, it fails to check whether
> +copied attribute actually exists (data.attr != NULL).  This worked
> +earlier because free() checks passed pointer before actually
> +attempting to release corresponding memory.  But
> +__pthread_attr_destroy assumes pointer is not NULL.
> +
> +So passing NULL pointer to __pthread_attr_destroy will result in
> +segmentation fault.  This scenario is possible if
> +notification->sigev_notify_attributes == NULL (which means default
> +thread attributes should be used).
> +
> +Upstream-Status: Backport
> [https://sourceware.org/git/?p=glibc.git;a=commit;h=b805aebd42364fe696e417808a700fdb9800c9e8
> ]
> +CVE: CVE-2021-38604
> +
> +Signed-off-by: Nikita Popov 
> +Reviewed-by: Siddhesh Poyarekar 
> +Signed-off-by: Vinay Kumar 
> +---
> + sysdeps/unix/sysv/linux/mq_notify.c | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/sysdeps/unix/sysv/linux/mq_notify.c
> b/sysdeps/unix/sysv/linux/mq_notify.c
> +index 9799dcdaa4..eccae2e4c6 100644
> +--- a/sysdeps/unix/sysv/linux/mq_notify.c
>  b/sysdeps/unix/sysv/linux/mq_notify.c
> +@@ -131,7 +131,7 @@ helper_thread (void *arg)
> +  to wait until it is done with it.  */
> +   (void) __pthread_barrier_wait (_barrier);
> +   }
> +-  else if (data.raw[NOTIFY_COOKIE_LEN - 1] == NOTIFY_REMOVED)
> ++  else if (data.raw[NOTIFY_COOKIE_LEN - 1] == NOTIFY_REMOVED &&
> data.attr != NULL)
> +   {
> + /* The only state we keep is the copy of the thread
> attributes.  */
> + __pthread_attr_destroy (data.attr);
> +-- 
> +2.31.1
> +
> diff --git a/meta/recipes-core/glibc/glibc/0002-CVE-2021-38604.patch
> b/meta/recipes-core/glibc/glibc/0002-CVE-2021-38604.patch
> new file mode 100644
> index 00..9f71fecddb
> --- /dev/null
> +++ b/meta/recipes-core/glibc/glibc/0002-CVE-2021-38604.patch
> @@ -0,0 +1,150 @@
> +From 4cc79c217744743077bf7a0ec5e0a4318f1e6641 Mon Sep 17 00:00:00 2001
> +From: Nikita Popov 
> +Date: Thu, 12 Aug 2021 16:09:50 +0530
> +Subject: [PATCH] librt: add test (bug 28213)
> +
> +This test implements following logic:
> +1) Create POSIX message queue.
> +   Register a notification with mq_notify (using NULL attributes).
> +   Then immediately unregister the notification with mq_notify.
> +   Helper thread in a vulnerable version of glibc
> +   should cause NULL pointer dereference after these steps.
> +2) Once again, register the same notification.
> +   Try to send a dummy message.
> +   Test is considered successfulif the dummy message
> +   is successfully received by the callback function.
> +
> +Upstream-Status: Backport
> [https://sourceware.org/git/?p=glibc.git;a=commit;h=4cc79c217744743077bf7a0ec5e0a4318f1e6641
> ]
> +CVE: CVE-2021-38604
> +
> +Signed-off-by: Nikita Popov 
> +Reviewed-by: Siddhesh Poyarekar 
> +Signed-off-by: Vinay Kumar 
> +---
> +