[OE-core] [PATCH v2] u-boot-tools: Use PATH_MAX for path length

2023-06-19 Thread Yu, Mingli
From: Mingli Yu 

Fixes:
   | uboot-mkimage -D "-I dts -O dtb -p 2000" -F -k 
"/buildarea1/test/wr_build/wrtestLTS_secureboot/test1-what/test2-what/test3-what/test4-what/test5-what/test6-what/test7-what/test8-what/test9-what/test10-what/test11-what/test12-what/layers/xilinx-zynqmp/zynqmp_keys/fitImage-rsa2048-keys"
 -K "u-boot.dtb" -r 
/buildarea1/test/wr_build/wrtestLTS_secureboot/test1-what/test2-what/test3-what/test4-what/test5-what/test6-what/test7-what/test8-what/test9-what/test10-what/test11-what/test12-what/build/tmp-glibc/work/xilinx_zynqmp-wrs-linux/u-boot-xlnx/1_v2023.01-xilinx-v2023.1+gitAUTOINC+40a08d69e7-r0/build/fitImage-linux
   | 
/buildarea1/test/wr_build/wrtestLTS_secureboot/test1-what/test2-what/test3-what/test4-what/test5-what/test6-what/test7-what/test8-what/test9-what/test10-what/test11-what/test12-what/build/tmp-glibc/work/xilinx_zynqmp-wrs-linux/u-boot-xlnx/1_v2023.01-xilinx-v2023.1+gitAUTOINC+40a08d69e7-r0/build/fitImage-linux:
 Image file name (uboot-mkimage) too long, can't create tmpfile.

Signed-off-by: Mingli Yu 
---
 ...mkimage-Use-PATH_MAX-for-path-length.patch | 40 +++
 .../u-boot/u-boot-tools_2023.04.bb|  4 ++
 2 files changed, 44 insertions(+)
 create mode 100644 
meta/recipes-bsp/u-boot/files/0001-mkimage-Use-PATH_MAX-for-path-length.patch

diff --git 
a/meta/recipes-bsp/u-boot/files/0001-mkimage-Use-PATH_MAX-for-path-length.patch 
b/meta/recipes-bsp/u-boot/files/0001-mkimage-Use-PATH_MAX-for-path-length.patch
new file mode 100644
index 00..9f38736bcd
--- /dev/null
+++ 
b/meta/recipes-bsp/u-boot/files/0001-mkimage-Use-PATH_MAX-for-path-length.patch
@@ -0,0 +1,40 @@
+From dcd3d272975863128e25a4e25453cb6521cddc53 Mon Sep 17 00:00:00 2001
+From: Mingli Yu 
+Date: Wed, 14 Jun 2023 16:09:59 +0800
+Subject: [PATCH] mkimage: Use PATH_MAX for path length
+
+Fixed when build xilinx_zynqmp in long directory ( >256):
+  |  
/buildarea1/testtest/wr_build/wr1023test_secureboot/test1-what/test2-what/test3-what/test4-what/test5-what/test6-what/test7-what/test8-what/test9-what/test10-what/test11-what/test12-what/build/tmp-glibc/work/xilinx_zynqmp-wrs-linux/u-boot-xlnx/1_v2023.01-xilinx-v2023.1+gitAUTOINC+40a08d69e7-r0/build/fitImage-linux:
 Image file name (uboot-mkimage) too long, can't create tmpfile.
+  | Error: Bad parameters for FIT image type
+
+Upstream-Status: Submitted 
[https://patchwork.ozlabs.org/project/uboot/patch/20230619062250.3244894-1-mingli...@eng.windriver.com/]
+
+Signed-off-by: Mingli Yu 
+---
+ tools/mkimage.h | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/tools/mkimage.h b/tools/mkimage.h
+index f5ca65e2ed..d92a3ff811 100644
+--- a/tools/mkimage.h
 b/tools/mkimage.h
+@@ -17,6 +17,7 @@
+ #include 
+ #include 
+ #include 
++#include 
+ #include 
+ #include "fdt_host.h"
+ #include "imagetool.h"
+@@ -44,7 +45,7 @@ static inline ulong map_to_sysmem(void *ptr)
+ #define ALLOC_CACHE_ALIGN_BUFFER(type, name, size) type name[size]
+ 
+ #define MKIMAGE_TMPFILE_SUFFIX".tmp"
+-#define MKIMAGE_MAX_TMPFILE_LEN   256
++#define MKIMAGE_MAX_TMPFILE_LEN   PATH_MAX
+ #define MKIMAGE_DEFAULT_DTC_OPTIONS   "-I dts -O dtb -p 500"
+ #define MKIMAGE_MAX_DTC_CMDLINE_LEN   2 * MKIMAGE_MAX_TMPFILE_LEN + 35
+ 
+-- 
+2.25.1
+
diff --git a/meta/recipes-bsp/u-boot/u-boot-tools_2023.04.bb 
b/meta/recipes-bsp/u-boot/u-boot-tools_2023.04.bb
index 7eaf721ca8..b77a49af87 100644
--- a/meta/recipes-bsp/u-boot/u-boot-tools_2023.04.bb
+++ b/meta/recipes-bsp/u-boot/u-boot-tools_2023.04.bb
@@ -1,2 +1,6 @@
 require u-boot-common.inc
 require u-boot-tools.inc
+
+SRC_URI += " \
+file://0001-mkimage-Use-PATH_MAX-for-path-length.patch \
+"
-- 
2.25.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#183129): 
https://lists.openembedded.org/g/openembedded-core/message/183129
Mute This Topic: https://lists.openembedded.org/mt/99637403/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] u-boot-tools: u-boot-tools: Use PATH_MAX for path length

2023-06-19 Thread Yu, Mingli
From: Mingli Yu 

Fixes:
   | uboot-mkimage -D "-I dts -O dtb -p 2000" -F -k 
"/buildarea1/test/wr_build/wrtestLTS_secureboot/test1-what/test2-what/test3-what/test4-what/test5-what/test6-what/test7-what/test8-what/test9-what/test10-what/test11-what/test12-what/layers/xilinx-zynqmp/zynqmp_keys/fitImage-rsa2048-keys"
 -K "u-boot.dtb" -r 
/buildarea1/test/wr_build/wrtestLTS_secureboot/test1-what/test2-what/test3-what/test4-what/test5-what/test6-what/test7-what/test8-what/test9-what/test10-what/test11-what/test12-what/build/tmp-glibc/work/xilinx_zynqmp-wrs-linux/u-boot-xlnx/1_v2023.01-xilinx-v2023.1+gitAUTOINC+40a08d69e7-r0/build/fitImage-linux
   | 
/buildarea1/test/wr_build/wrtestLTS_secureboot/test1-what/test2-what/test3-what/test4-what/test5-what/test6-what/test7-what/test8-what/test9-what/test10-what/test11-what/test12-what/build/tmp-glibc/work/xilinx_zynqmp-wrs-linux/u-boot-xlnx/1_v2023.01-xilinx-v2023.1+gitAUTOINC+40a08d69e7-r0/build/fitImage-linux:
 Image file name (uboot-mkimage) too long, can't create tmpfile.

Signed-off-by: Mingli Yu 
---
 ...mkimage-Use-PATH_MAX-for-path-length.patch | 40 +++
 .../u-boot/u-boot-tools_2023.04.bb|  4 ++
 2 files changed, 44 insertions(+)
 create mode 100644 
meta/recipes-bsp/u-boot/files/0001-mkimage-Use-PATH_MAX-for-path-length.patch

diff --git 
a/meta/recipes-bsp/u-boot/files/0001-mkimage-Use-PATH_MAX-for-path-length.patch 
b/meta/recipes-bsp/u-boot/files/0001-mkimage-Use-PATH_MAX-for-path-length.patch
new file mode 100644
index 00..9f38736bcd
--- /dev/null
+++ 
b/meta/recipes-bsp/u-boot/files/0001-mkimage-Use-PATH_MAX-for-path-length.patch
@@ -0,0 +1,40 @@
+From dcd3d272975863128e25a4e25453cb6521cddc53 Mon Sep 17 00:00:00 2001
+From: Mingli Yu 
+Date: Wed, 14 Jun 2023 16:09:59 +0800
+Subject: [PATCH] mkimage: Use PATH_MAX for path length
+
+Fixed when build xilinx_zynqmp in long directory ( >256):
+  |  
/buildarea1/testtest/wr_build/wr1023test_secureboot/test1-what/test2-what/test3-what/test4-what/test5-what/test6-what/test7-what/test8-what/test9-what/test10-what/test11-what/test12-what/build/tmp-glibc/work/xilinx_zynqmp-wrs-linux/u-boot-xlnx/1_v2023.01-xilinx-v2023.1+gitAUTOINC+40a08d69e7-r0/build/fitImage-linux:
 Image file name (uboot-mkimage) too long, can't create tmpfile.
+  | Error: Bad parameters for FIT image type
+
+Upstream-Status: Submitted 
[https://patchwork.ozlabs.org/project/uboot/patch/20230619062250.3244894-1-mingli...@eng.windriver.com/]
+
+Signed-off-by: Mingli Yu 
+---
+ tools/mkimage.h | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/tools/mkimage.h b/tools/mkimage.h
+index f5ca65e2ed..d92a3ff811 100644
+--- a/tools/mkimage.h
 b/tools/mkimage.h
+@@ -17,6 +17,7 @@
+ #include 
+ #include 
+ #include 
++#include 
+ #include 
+ #include "fdt_host.h"
+ #include "imagetool.h"
+@@ -44,7 +45,7 @@ static inline ulong map_to_sysmem(void *ptr)
+ #define ALLOC_CACHE_ALIGN_BUFFER(type, name, size) type name[size]
+ 
+ #define MKIMAGE_TMPFILE_SUFFIX".tmp"
+-#define MKIMAGE_MAX_TMPFILE_LEN   256
++#define MKIMAGE_MAX_TMPFILE_LEN   PATH_MAX
+ #define MKIMAGE_DEFAULT_DTC_OPTIONS   "-I dts -O dtb -p 500"
+ #define MKIMAGE_MAX_DTC_CMDLINE_LEN   2 * MKIMAGE_MAX_TMPFILE_LEN + 35
+ 
+-- 
+2.25.1
+
diff --git a/meta/recipes-bsp/u-boot/u-boot-tools_2023.04.bb 
b/meta/recipes-bsp/u-boot/u-boot-tools_2023.04.bb
index 7eaf721ca8..b77a49af87 100644
--- a/meta/recipes-bsp/u-boot/u-boot-tools_2023.04.bb
+++ b/meta/recipes-bsp/u-boot/u-boot-tools_2023.04.bb
@@ -1,2 +1,6 @@
 require u-boot-common.inc
 require u-boot-tools.inc
+
+SRC_URI += " \
+file://0001-mkimage-Use-PATH_MAX-for-path-length.patch \
+"
-- 
2.25.1


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



Re: [OE-core] [PATCH V2 1/2] kernel-module-split: make autoload and probeconf distribution specific

2023-06-19 Thread Peter Kjellerstedt
> -Original Message-
> From: Jose Quaresma 
> Sent: den 20 juni 2023 01:14
> To: openembedded-core@lists.openembedded.org
> Cc: Jose Quaresma ; Ola x Nilsson 
> ; Peter Kjellerstedt 
> Subject: [PATCH V2 1/2] kernel-module-split: make autoload and probeconf 
> distribution specific
> 
> The modules-load.d [1] - Configure kernel modules to load at boot
> should install their configuration files in /usr/lib/modules-load.d.
> 
> The modprobe.d [2] - Configuration directory for modprobe
> should install their configuration files in /lib/modprobe.d
> 
> [1] https://www.freedesktop.org/software/systemd/man/modules-load.d.html
> [2] https://www.man7.org/linux/man-pages//man5/modprobe.d.5.html
> 
> [YOCTO #12212] https://bugzilla.yoctoproject.org/show_bug.cgi?id=12212
> 
> CC: Ola x Nilsson 
> CC: Peter Kjellerstedt 
> Signed-off-by: Jose Quaresma 
> ---
> 
> V2: use the same location as before on the class and define the new
> location just for systemd.
> 
>  .../kernel-module-split.bbclass   | 30 +--
>  .../distro/include/init-manager-systemd.inc   |  4 +++
>  2 files changed, 18 insertions(+), 16 deletions(-)
> 
> diff --git a/meta/classes-recipe/kernel-module-split.bbclass 
> b/meta/classes-recipe/kernel-module-split.bbclass
> index 50882c31a7..ee14bb6910 100644
> --- a/meta/classes-recipe/kernel-module-split.bbclass
> +++ b/meta/classes-recipe/kernel-module-split.bbclass

[cut]

> @@ -169,8 +168,7 @@ python split_kernel_module_packages () {
>  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('FILES:' + metapkg, '%s/ %s/ %s/modules/' % 
> (modulesloaddir, modprobedir, d.getVar("nonarch_base_libdir")))

There is no need for the trailing slashes in FILES:${PN}, so the above 
can be simplified to: 

d.appendVar('FILES:' + metapkg, '%s %s %s/modules' % (modulesloaddir, 
modprobedir, d.getVar("nonarch_base_libdir")))

Not sure that warrants a new patch though.

>  d.appendVar('pkg_postinst:%s' % metapkg, postinst)
>  d.prependVar('pkg_postrm:%s' % metapkg, postrm);
>  return

Reviewed-by: Peter Kjellerstedt 

//Peter


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



[OE-core] Current high bug count owners for Yocto Project 4.3

2023-06-19 Thread Stephen Jolley
All,

Below is the list as of top 31 bug owners as of the end of WW24 of who have
open medium or higher bugs and enhancements against YP 4.3. There are 90
possible work days left until the final release candidates for YP 4.3 needs
to be released.


Who

Count


michael.opdenac...@bootlin.com

32


ross.bur...@arm.com

31


richard.pur...@linuxfoundation.org

25


david.re...@windriver.com

25


bruce.ashfi...@gmail.com

24


randy.macl...@windriver.com

21


jpewhac...@gmail.com

10


pa...@zhukoff.net

7


sakib.sa...@windriver.com

6


sundeep.kokko...@windriver.com

5


pi...@pidge.org

4


yash.shi...@windriver.com

3


tim.orl...@konsulko.com

3


alexis.loth...@bootlin.com

3


p.lob...@welotec.com

2


jon.ma...@arm.com

2


yoann.con...@smile.fr

1


tvgamb...@gmail.com

1


thr...@amazon.de

1


thomas.per...@bootlin.com

1


st...@sakoman.com

1


mathew.pro...@gmail.com

1


martin.ja...@gmail.com

1


mark.ha...@kernel.crashing.org

1


mark.asselst...@windriver.com

1


louis.ran...@syslinbit.com

1


johannes.schri...@blueye.no

1


jens.ge...@desy.de

1


geissona...@yahoo.com

1


fathi.bou...@linaro.org

1


alexandre.bell...@bootlin.com

1


Grand Total

218

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 (#183126): 
https://lists.openembedded.org/g/openembedded-core/message/183126
Mute This Topic: https://lists.openembedded.org/mt/99635599/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

2023-06-19 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 432
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,  "4.3", "4.4", "4.99" and "Future", the more pressing/urgent
issues being in "4.3" and then "4.4".

 

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



Re: [OE-core][PATCH 1/2] kernel-module-split: make autoload and probeconf distribution specific

2023-06-19 Thread Jose Quaresma
Peter Kjellerstedt  escreveu no dia sexta,
16/06/2023 à(s) 17:03:

> Did anything ever become of this? This is a change that at least we would
> appreciate.
>

Hi Pete,

V2 send with your suggestions:
https://lists.openembedded.org/g/openembedded-core/message/183123

Thanks for the remainder

Jose


>
>
> //Peter
>
>
>
> *From:* Jose Quaresma 
> *Sent:* den 17 februari 2023 17:53
> *To:* Peter Kjellerstedt 
> *Cc:* Ola x Nilsson ; Otavio Salvador <
> otavio.salva...@ossystems.com.br>; Jose Quaresma <
> jose.quare...@foundries.io>; openembedded-core@lists.openembedded.org
> *Subject:* Re: [OE-core][PATCH 1/2] kernel-module-split: make autoload
> and probeconf distribution specific
>
>
>
> Hi Peter,
>
>
>
> Peter Kjellerstedt  escreveu no dia sexta,
> 17/02/2023 à(s) 10:52:
>
> Wouldn’t the easiest solution be to define two variables:
>
> modulesloaddir ??= "${sysconfdir}/modules-load.d "
> modprobedir ??= "${sysconfdir}/modprobe.d "
>
> then in init-manager-systemd.inc you could change them to:
>
> modulesloaddir ?= "${nonarch_libdir}/modules-load.d"
> modprobedir ?= "${nonarch_base_libdir}/modprobe.d"
>
> Using a single prefix variable doesn’t really work since they need
> different paths in the latter case.
>
>
> I was thinking of something similar to what you suggest but only on the
> class:
>
> modulesloaddir ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd',
> '${nonarch_libdir}', '${sysconfdir}', d)}"
> modprobedir ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd',
> '${nonarch_base_libdir}', '${sysconfdir}', d)}"
>
>
>
> Anyway your approach looks good to me too so i'll use yours, hope I can
> test it next week.
>
>
>
> Jose
>
>
>
>
>
> //Peter
>
>
>
> *From:* openembedded-core@lists.openembedded.org <
> openembedded-core@lists.openembedded.org> *On Behalf Of *Jose Quaresma
> *Sent:* den 16 februari 2023 12:08
> *To:* Ola x Nilsson 
> *Cc:* Otavio Salvador ; Jose Quaresma <
> jose.quare...@foundries.io>; openembedded-core@lists.openembedded.org
> *Subject:* Re: [OE-core][PATCH 1/2] kernel-module-split: make autoload
> and probeconf distribution specific
>
>
>
>
>
> Ola x Nilsson  escreveu no dia quinta, 16/02/2023
> à(s) 08:22:
>
>
> On Wed, Feb 15 2023, Jose Quaresma wrote:
>
> > Hi Octavio,
> >
> > Otavio Salvador  otavio.salva...@ossystems.com.br>> escreveu no dia quarta, 15/02/2023
> à(s) 13:25:
> > Em qua., 15 de fev. de 2023 às 10:01, Jose Quaresma
> > mailto:quaresma.j...@gmail.com>> escreveu:
> >>
> >> The modules-load.d [1] - Configure kernel modules to load at boot
> >> should install their configuration files in /usr/lib/modules-load.d.
> >>
> >> The modprobe.d [2] - Configuration directory for modprobe
> >> should install their configuration files in /lib/modprobe.d
> >>
> >> [1]
> https://www.freedesktop.org/software/systemd/man/modules-load.d.html
> >> [2] https://www.man7.org/linux/man-pages//man5/modprobe.d.5.html
> 
> >>
> >> Signed-off-by: Jose Quaresma  jose.quare...@foundries.io>>
> >
> >
> > Did you validate this using busybox only? Using sysv and busybox need
> > to be validated as well.
> >
> > Please drop this patch series because it doesn work with busybox.
> >
> > Looks like busybox don't support other path than /etc:
> >
> https://git.busybox.net/busybox/tree/modutils/modprobe.c?id=669c40ed8ebf480c95ce36135104e474e361a7e6#n658
> >
> > So I need to implement this in another way, maybe relocating the files
> from /etc only when systemd is enabled.
> >
> > Thanks for raising the issue.
> >
> > Jose
> >
>
> Hi,
>
> Please consider https://bugzilla.yoctoproject.org/show_bug.cgi?id=12212
> as well.
>
> --
> Ola x Nilsson
>
>
> Hi Ola,
>
> We use usermerge too but I think the weird issue here is we need to have
> this distribution specified only for systemd
>
> excluding busybox and sysint as pointed out by Octavio.
>
> The other solution is adding support on busybox and sysint if needed.
>
> My idea is add a prefix variable with path "/etc" by default but
> conditioned by systemd DISTRO_FEATURES
>
> Thanks for the bug hint.
>
> --
>
> Best regards,
>
>
> José Quaresma
>
>
>
>
> --
>
> Best regards,
>
>
> José Quaresma
>


-- 
Best regards,

José Quaresma

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#183124): 
https://lists.openembedded.org/g/openembedded-core/message/183124
Mute This Topic: https://lists.openembedded.org/mt/96981851/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/2] kernel: autoload and probeconf are handled by kernel-module-split

2023-06-19 Thread Jose Quaresma
Signed-off-by: Jose Quaresma 
---
 meta/classes-recipe/kernel.bbclass | 2 --
 1 file changed, 2 deletions(-)

diff --git a/meta/classes-recipe/kernel.bbclass 
b/meta/classes-recipe/kernel.bbclass
index e82b696d1a..855c784149 100644
--- a/meta/classes-recipe/kernel.bbclass
+++ b/meta/classes-recipe/kernel.bbclass
@@ -483,8 +483,6 @@ kernel_do_install() {
install -m 0644 .config 
${D}/${KERNEL_IMAGEDEST}/config-${KERNEL_VERSION}
install -m 0644 vmlinux 
${D}/${KERNEL_IMAGEDEST}/vmlinux-${KERNEL_VERSION}
[ -e Module.symvers ] && install -m 0644 Module.symvers 
${D}/${KERNEL_IMAGEDEST}/Module.symvers-${KERNEL_VERSION}
-   install -d ${D}${sysconfdir}/modules-load.d
-   install -d ${D}${sysconfdir}/modprobe.d
 }
 
 # Must be ran no earlier than after do_kernel_checkout or else Makefile won't 
be in ${S}/Makefile
-- 
2.34.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#183122): 
https://lists.openembedded.org/g/openembedded-core/message/183122
Mute This Topic: https://lists.openembedded.org/mt/99634396/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/2] kernel-module-split: make autoload and probeconf distribution specific

2023-06-19 Thread Jose Quaresma
The modules-load.d [1] - Configure kernel modules to load at boot
should install their configuration files in /usr/lib/modules-load.d.

The modprobe.d [2] - Configuration directory for modprobe
should install their configuration files in /lib/modprobe.d

[1] https://www.freedesktop.org/software/systemd/man/modules-load.d.html
[2] https://www.man7.org/linux/man-pages//man5/modprobe.d.5.html

[YOCTO #12212] https://bugzilla.yoctoproject.org/show_bug.cgi?id=12212

CC: Ola x Nilsson 
CC: Peter Kjellerstedt 
Signed-off-by: Jose Quaresma 
---

V2: use the same location as before on the class and define the new
location just for systemd.

 .../kernel-module-split.bbclass   | 30 +--
 .../distro/include/init-manager-systemd.inc   |  4 +++
 2 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/meta/classes-recipe/kernel-module-split.bbclass 
b/meta/classes-recipe/kernel-module-split.bbclass
index 50882c31a7..ee14bb6910 100644
--- a/meta/classes-recipe/kernel-module-split.bbclass
+++ b/meta/classes-recipe/kernel-module-split.bbclass
@@ -30,8 +30,11 @@ fi
 
 PACKAGE_WRITE_DEPS += "kmod-native depmodwrapper-cross"
 
+modulesloaddir ??= "${sysconfdir}/modules-load.d"
+modprobedir ??= "${sysconfdir}/modprobe.d"
+
 do_install:append() {
-   install -d ${D}${sysconfdir}/modules-load.d/ 
${D}${sysconfdir}/modprobe.d/
+   install -d ${D}${modulesloaddir} ${D}${modprobedir}
 }
 
 KERNEL_SPLIT_MODULES ?= "1"
@@ -93,8 +96,9 @@ python split_kernel_module_packages () {
 
 dvar = d.getVar('PKGD')
 
-# If autoloading is requested, output /etc/modules-load.d/.conf 
and append
+# If autoloading is requested, output ${modulesloaddir}/.conf 
and append
 # appropriate modprobe commands to the postinst
+autoloadpath = '%s/%s.conf' % (d.getVar('modulesloaddir'), basename)
 autoloadlist = (d.getVar("KERNEL_MODULE_AUTOLOAD") or "").split()
 autoload = d.getVar('module_autoload_%s' % basename)
 if autoload and autoload == basename:
@@ -102,8 +106,7 @@ python split_kernel_module_packages () {
 if autoload and basename not in autoloadlist:
 bb.warn("module_autoload_%s is defined but '%s' isn't included in 
KERNEL_MODULE_AUTOLOAD, please add it there" % (basename, basename))
 if basename in autoloadlist:
-name = '%s/etc/modules-load.d/%s.conf' % (dvar, basename)
-f = open(name, 'w')
+f = open("%s%s" % (dvar, autoloadpath), 'w')
 if autoload:
 for m in autoload.split():
 f.write('%s\n' % m)
@@ -117,23 +120,19 @@ python split_kernel_module_packages () {
 d.setVar('pkg_postinst:%s' % pkg, postinst)
 
 # Write out any modconf fragment
+modconfpath = '%s/%s.conf' % (d.getVar('modprobedir'), basename)
 modconflist = (d.getVar("KERNEL_MODULE_PROBECONF") or "").split()
 modconf = d.getVar('module_conf_%s' % basename)
 if modconf and basename in modconflist:
-name = '%s/etc/modprobe.d/%s.conf' % (dvar, basename)
-f = open(name, 'w')
+f = open("%s%s" % (dvar, modconfpath), 'w')
 f.write("%s\n" % modconf)
 f.close()
 elif modconf:
 bb.error("Please ensure module %s is listed in 
KERNEL_MODULE_PROBECONF since module_conf_%s is set" % (basename, basename))
 
-files = d.getVar('FILES:%s' % pkg)
-files = "%s /etc/modules-load.d/%s.conf /etc/modprobe.d/%s.conf" % 
(files, basename, basename)
-d.setVar('FILES:%s' % pkg, files)
-
-conffiles = d.getVar('CONFFILES:%s' % pkg)
-conffiles = "%s /etc/modules-load.d/%s.conf /etc/modprobe.d/%s.conf" % 
(conffiles, basename, basename)
-d.setVar('CONFFILES:%s' % pkg, conffiles)
+appendfiles = " %s %s" % (autoloadpath, modconfpath)
+d.appendVar('FILES:%s' % pkg, appendfiles)
+d.appendVar('CONFFILES:%s' % pkg, appendfiles)
 
 if "description" in vals:
 old_desc = d.getVar('DESCRIPTION:' + pkg) or ""
@@ -169,8 +168,7 @@ python split_kernel_module_packages () {
 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('FILES:' + metapkg, '%s/ %s/ %s/modules/' % 
(modulesloaddir, modprobedir, d.getVar("nonarch_base_libdir")))
 d.appendVar('pkg_postinst:%s' % metapkg, postinst)
 d.prependVar('pkg_postrm:%s' % metapkg, postrm);
 return
@@ -189,7 +187,7 @@ python split_kernel_module_packages () {
 # avoid warnings. removedirs only raises an OSError if an empty
 # directory cannot be removed.
 dvar = d.getVar('PKGD')
-for dir in ["%s/etc/modprobe.d" % (dvar), "%s/etc/modules-load.d" % 
(dvar), "%s/etc" % (dvar)]:
+for dir in ["%s%s" 

[OE-core] [PATCH] zstd: fix a reproducibility issue in 1.5.5

2023-06-19 Thread Alexander Kanavin
Signed-off-by: Alexander Kanavin 
---
 ...-use-directly-for-the-test-c-snippet.patch | 39 +++
 meta/recipes-extended/zstd/zstd_1.5.5.bb  |  3 +-
 2 files changed, 41 insertions(+), 1 deletion(-)
 create mode 100644 
meta/recipes-extended/zstd/zstd/0001-pzstd-use-directly-for-the-test-c-snippet.patch

diff --git 
a/meta/recipes-extended/zstd/zstd/0001-pzstd-use-directly-for-the-test-c-snippet.patch
 
b/meta/recipes-extended/zstd/zstd/0001-pzstd-use-directly-for-the-test-c-snippet.patch
new file mode 100644
index 000..847a641691d
--- /dev/null
+++ 
b/meta/recipes-extended/zstd/zstd/0001-pzstd-use-directly-for-the-test-c-snippet.patch
@@ -0,0 +1,39 @@
+From 121ef5253a49065dea6a89536ca7bd3dabd40e25 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin 
+Date: Mon, 19 Jun 2023 17:10:09 +0200
+Subject: [PATCH] pzstd: use c++14 without conditions
+
+Doing this check with a direct c++ snippet is prone to portability problems:
+
+- \043 is not portable between shells: dash expands it to #,
+bash does not;
+
+- using # directly works with make 4.3 but does not with make 4.2.
+
+Let's just use the c++ version that covers both the code and the gtest.
+
+Upstream-Status: Submitted [https://github.com/facebook/zstd/pull/3682]
+Signed-off-by: Alexander Kanavin 
+
+---
+ contrib/pzstd/Makefile | 7 ++-
+ 1 file changed, 2 insertions(+), 5 deletions(-)
+
+diff --git a/contrib/pzstd/Makefile b/contrib/pzstd/Makefile
+index e62f8e87..58fb82a1 100644
+--- a/contrib/pzstd/Makefile
 b/contrib/pzstd/Makefile
+@@ -37,11 +37,8 @@ CFLAGS   += -Wno-deprecated-declarations
+ PZSTD_INC  = -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(PROGDIR) -I.
+ GTEST_INC  = -isystem googletest/googletest/include
+ 
+-# If default C++ version is older than C++11, explicitly set C++11, which is 
the
+-# minimum required by the code.
+-ifeq ($(shell echo "\043if __cplusplus < 201103L\n\043error\n\043endif" | 
$(CXX) -x c++ -Werror -c - -o /dev/null 2>/dev/null && echo 1 || echo 0),0)
+-PZSTD_CXX_STD := -std=c++11
+-endif
++# Set the minimum required by gtest
++PZSTD_CXX_STD := -std=c++14
+ 
+ PZSTD_CPPFLAGS  = $(PZSTD_INC)
+ PZSTD_CCXXFLAGS =
diff --git a/meta/recipes-extended/zstd/zstd_1.5.5.bb 
b/meta/recipes-extended/zstd/zstd_1.5.5.bb
index 487465b6c70..5c5fb5e7340 100644
--- a/meta/recipes-extended/zstd/zstd_1.5.5.bb
+++ b/meta/recipes-extended/zstd/zstd_1.5.5.bb
@@ -10,7 +10,8 @@ LIC_FILES_CHKSUM = 
"file://LICENSE;md5=0822a32f7acdbe013606746641746ee8 \
 file://COPYING;md5=39bba7d2cf0ba1036f2a6e2be52fe3f0 \
 "
 
-SRC_URI = "git://github.com/facebook/zstd.git;branch=release;protocol=https"
+SRC_URI = "git://github.com/facebook/zstd.git;branch=release;protocol=https \
+   file://0001-pzstd-use-directly-for-the-test-c-snippet.patch"
 
 SRCREV = "63779c798237346c2b245c546c40b72a5a5913fe"
 UPSTREAM_CHECK_GITTAGREGEX = "v(?P\d+(\.\d+)+)"
-- 
2.30.2


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#183121): 
https://lists.openembedded.org/g/openembedded-core/message/183121
Mute This Topic: https://lists.openembedded.org/mt/99627756/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] insane: Improve patch-status layer filtering

2023-06-19 Thread Ross Burton


> On 19 Jun 2023, at 15:06, Richard Purdie via lists.openembedded.org 
>  wrote:
> 
> Now that we have layer overrides, we can easily enable patch-status in
> ERROR_QA without the hardcoded code making it easier for other layers
> to opt into the checks.
> 
> Signed-off-by: Richard Purdie 
> ---
> meta/classes-global/insane.bbclass | 16 +++-
> 1 file changed, 3 insertions(+), 13 deletions(-)
> 
> diff --git a/meta/classes-global/insane.bbclass 
> b/meta/classes-global/insane.bbclass
> index f391fa80538..114781c7803 100644
> --- a/meta/classes-global/insane.bbclass
> +++ b/meta/classes-global/insane.bbclass
> @@ -45,10 +45,11 @@ ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch 
> pkgconfig la \
> already-stripped installed-vs-shipped ldflags compile-host-path \
> install-host-path pn-overrides unknown-configure-option \
> useless-rpaths rpaths staticdev empty-dirs \
> -patch-fuzz patch-status-core\
> +patch-fuzz \
> "
> # Add usrmerge QA check based on distro feature
> ERROR_QA:append = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', ' 
> usrmerge', '', d)}"
> +ERROR_QA:append:layer-core = " patch-status"
> 
> FAKEROOT_QA = "host-user-contaminated"
> FAKEROOT_QA[doc] = "QA tests which need to run under fakeroot. If any \
> @@ -1340,24 +1341,13 @@ python do_qa_patch() {
> import re
> from oe import patch
> 
> -allpatches = False
> -if bb.utils.filter('ERROR_QA', 'patch-status-noncore', d) or 
> bb.utils.filter('WARN_QA', 'patch-status-noncore', d):
> -allpatches = True
> -
> coremeta_path = os.path.join(d.getVar('COREBASE'), 'meta', '')
> for url in patch.src_patches(d):
> (_, _, fullpath, _, _, _) = bb.fetch.decodeurl(url)
> 
> -# skip patches not in oe-core
> -patchtype = "patch-status-core"
> -if not os.path.abspath(fullpath).startswith(coremeta_path):
> -patchtype = "patch-status-noncore"
> -if not allpatches:
> -continue
> -
> msg = oe.qa.check_upstream_status(fullpath)
> if msg:
> -oe.qa.handle_error(patchtype, msg, d)
> +oe.qa.handle_error("patch-status", msg, d)
> 
> oe.qa.exit_if_errors(d)
> }
> -- 
> 2.39.2
> 
> 
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#183120): 
https://lists.openembedded.org/g/openembedded-core/message/183120
Mute This Topic: https://lists.openembedded.org/mt/99623855/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] runqemu-gen-tapdevs: pass STAGING_BINDIR_NATIVE to ifup

2023-06-19 Thread Richard Purdie
On Mon, 2023-06-19 at 10:19 -0400, Trevor Gamblin wrote:
> On 2023-06-19 10:03, Richard Purdie wrote:
> > On Mon, 2023-06-19 at 09:54 -0400, Trevor Gamblin wrote:
> > > Without this, runqemu-gen-tapdevs fails with the following error:
> > > 
> > > [tgamblin@megalith build]$ sudo 
> > > /workspace/yocto/manual/poky/scripts/runqemu-gen-tapdevs 1000 1002 4 
> > > tmp/sysroots-components/x86_64/qemu-helper-native/usr/bin
> > > Creating 4 tap devices for UID: 1000 GID: 1002...
> > > Creating tap0
> > > Error bringing up interface: sudo runqemu-ifup   
> > > 
> > > 
> > > Signed-off-by: Trevor Gamblin 
> > > ---
> > >   scripts/runqemu-gen-tapdevs | 2 +-
> > >   1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/scripts/runqemu-gen-tapdevs b/scripts/runqemu-gen-tapdevs
> > > index ec3ecb03b9..dc730e413d 100755
> > > --- a/scripts/runqemu-gen-tapdevs
> > > +++ b/scripts/runqemu-gen-tapdevs
> > > @@ -79,7 +79,7 @@ fi
> > >   echo "Creating $COUNT tap devices for UID: $TUID GID: $GID..."
> > >   for ((index=0; index < $COUNT; index++)); do
> > >   echo "Creating tap$index"
> > > - if ! ifup=`$RUNQEMU_IFUP $TUID $GID 2>&1`; then
> > > + if ! ifup=`$RUNQEMU_IFUP $TUID $GID $STAGING_BINDIR_NATIVE 2>&1`; then
> > >   echo "Error bringing up interface: $ifup"
> > >   exit 1
> > >   fi
> > I'm a bit puzzled as I removed the use of STAGING_BINDIR_NATIVE in that
> > script?
> STAGING_BINDIR_NATIVE is still present near the top of the script as a 
> variable but isn't used anywhere. When I encountered the error and saw 
> that the script wasn't passing a path, I thought including it again 
> would fix it. It appears to do so on my Fedora build system.
> > 
> > Are you mixing different releases?
> I'm using the latest poky master.
> 

My testing environment was corrupt, testing "build1" when the code was
in "build".

I've sent a couple of patches, one to fix the script parameters (the
bindir isn't used anymore) and one to fix the issue with more than 10
tap devices.

Cheers,

Richard



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



[OE-core] [PATCH 1/2] scripts/runqemu-ifup: Fix extra parameter issue

2023-06-19 Thread Richard Purdie
The third parameter was dropped in a previous commit but changes were not made
to the argument checks. Fix this.

Signed-off-by: Richard Purdie 
---
 scripts/runqemu-ifup | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/runqemu-ifup b/scripts/runqemu-ifup
index bbd624596ed..e3aa16c97df 100755
--- a/scripts/runqemu-ifup
+++ b/scripts/runqemu-ifup
@@ -21,7 +21,7 @@
 #
 
 usage() {
-   echo "sudo $(basename $0)   "
+   echo "sudo $(basename $0)  "
 }
 
 if [ $EUID -ne 0 ]; then
@@ -29,7 +29,7 @@ if [ $EUID -ne 0 ]; then
exit 1
 fi
 
-if [ $# -ne 3 ]; then
+if [ $# -ne 2 ]; then
usage
exit 1
 fi
-- 
2.39.2


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#183117): 
https://lists.openembedded.org/g/openembedded-core/message/183117
Mute This Topic: https://lists.openembedded.org/mt/99624732/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] scripts/runqemu-ifup: Fix 10 or more tap devices

2023-06-19 Thread Richard Purdie
The use of sort means that tap10 and tap1 don't sort correctly. Tweak
the shell expression to correctly handle numbers of tap devices of 10
or more.

Signed-off-by: Richard Purdie 
---
 scripts/runqemu-ifup | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/runqemu-ifup b/scripts/runqemu-ifup
index e3aa16c97df..5dc765dee82 100755
--- a/scripts/runqemu-ifup
+++ b/scripts/runqemu-ifup
@@ -38,7 +38,7 @@ USERID="-u $1"
 GROUP="-g $2"
 
 if taps=$(ip tuntap list 2>/dev/null); then
-   tap_no=$(( $(echo "$taps" |sort -r |sed 's/^tap//; s/:.*//; q') + 1 ))
+   tap_no=$(( $(echo "$taps" |cut -f 1 -d ":" | sed 's/tap//g' | sort -rn 
| head -n 1) + 1 ))
ip tuntap add tap$tap_no mode tap group $2 && TAP=tap$tap_no
 fi
 
-- 
2.39.2


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#183118): 
https://lists.openembedded.org/g/openembedded-core/message/183118
Mute This Topic: https://lists.openembedded.org/mt/99624733/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] runqemu-gen-tapdevs: pass STAGING_BINDIR_NATIVE to ifup

2023-06-19 Thread Trevor Gamblin


On 2023-06-19 10:03, Richard Purdie wrote:

On Mon, 2023-06-19 at 09:54 -0400, Trevor Gamblin wrote:

Without this, runqemu-gen-tapdevs fails with the following error:

[tgamblin@megalith build]$ sudo 
/workspace/yocto/manual/poky/scripts/runqemu-gen-tapdevs 1000 1002 4 
tmp/sysroots-components/x86_64/qemu-helper-native/usr/bin
Creating 4 tap devices for UID: 1000 GID: 1002...
Creating tap0
Error bringing up interface: sudo runqemu-ifup   


Signed-off-by: Trevor Gamblin 
---
  scripts/runqemu-gen-tapdevs | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/runqemu-gen-tapdevs b/scripts/runqemu-gen-tapdevs
index ec3ecb03b9..dc730e413d 100755
--- a/scripts/runqemu-gen-tapdevs
+++ b/scripts/runqemu-gen-tapdevs
@@ -79,7 +79,7 @@ fi
  echo "Creating $COUNT tap devices for UID: $TUID GID: $GID..."
  for ((index=0; index < $COUNT; index++)); do
echo "Creating tap$index"
-   if ! ifup=`$RUNQEMU_IFUP $TUID $GID 2>&1`; then
+   if ! ifup=`$RUNQEMU_IFUP $TUID $GID $STAGING_BINDIR_NATIVE 2>&1`; then
echo "Error bringing up interface: $ifup"
exit 1
fi

I'm a bit puzzled as I removed the use of STAGING_BINDIR_NATIVE in that
script?
STAGING_BINDIR_NATIVE is still present near the top of the script as a 
variable but isn't used anywhere. When I encountered the error and saw 
that the script wasn't passing a path, I thought including it again 
would fix it. It appears to do so on my Fedora build system.


Are you mixing different releases?

I'm using the latest poky master.


Cheers,

Richard


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



[OE-core] [PATCH 1/2] bitbake.conf: Add layer- override support

2023-06-19 Thread Richard Purdie
Add a new layer specific override based upon the FILE_LAYERNAME support now 
present
in bitbake. In particular this allows layer specific QA warnings and errors to
be made more easily.

Signed-off-by: Richard Purdie 
---
 meta/conf/bitbake.conf | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 702881144ef..9625a6fef4c 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -806,7 +806,8 @@ DISTRO_NAME ??= "OpenEmbedded"
 # And finally ':forcevariable' overrides any standard variable, with the 
highest priority.
 # This works for functions as well, they are really just variables.
 #
-OVERRIDES = 
"${TARGET_OS}:${TRANSLATED_TARGET_ARCH}:pn-${PN}:${MACHINEOVERRIDES}:${DISTROOVERRIDES}:${CLASSOVERRIDE}${LIBCOVERRIDE}:forcevariable"
+OVERRIDES = 
"${TARGET_OS}:${TRANSLATED_TARGET_ARCH}:pn-${PN}:layer-${FILE_LAYERNAME}:${MACHINEOVERRIDES}:${DISTROOVERRIDES}:${CLASSOVERRIDE}${LIBCOVERRIDE}:forcevariable"
+FILE_LAYERNAME ??= "config"
 LIBCOVERRIDE ?= ""
 CLASSOVERRIDE ?= "class-target"
 DISTROOVERRIDES ?= "${@d.getVar('DISTRO') or ''}"
-- 
2.39.2


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#183114): 
https://lists.openembedded.org/g/openembedded-core/message/183114
Mute This Topic: https://lists.openembedded.org/mt/99623852/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] insane: Improve patch-status layer filtering

2023-06-19 Thread Richard Purdie
Now that we have layer overrides, we can easily enable patch-status in
ERROR_QA without the hardcoded code making it easier for other layers
to opt into the checks.

Signed-off-by: Richard Purdie 
---
 meta/classes-global/insane.bbclass | 16 +++-
 1 file changed, 3 insertions(+), 13 deletions(-)

diff --git a/meta/classes-global/insane.bbclass 
b/meta/classes-global/insane.bbclass
index f391fa80538..114781c7803 100644
--- a/meta/classes-global/insane.bbclass
+++ b/meta/classes-global/insane.bbclass
@@ -45,10 +45,11 @@ ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch 
pkgconfig la \
 already-stripped installed-vs-shipped ldflags compile-host-path \
 install-host-path pn-overrides unknown-configure-option \
 useless-rpaths rpaths staticdev empty-dirs \
-patch-fuzz patch-status-core\
+patch-fuzz \
 "
 # Add usrmerge QA check based on distro feature
 ERROR_QA:append = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', ' 
usrmerge', '', d)}"
+ERROR_QA:append:layer-core = " patch-status"
 
 FAKEROOT_QA = "host-user-contaminated"
 FAKEROOT_QA[doc] = "QA tests which need to run under fakeroot. If any \
@@ -1340,24 +1341,13 @@ python do_qa_patch() {
 import re
 from oe import patch
 
-allpatches = False
-if bb.utils.filter('ERROR_QA', 'patch-status-noncore', d) or 
bb.utils.filter('WARN_QA', 'patch-status-noncore', d):
-allpatches = True
-
 coremeta_path = os.path.join(d.getVar('COREBASE'), 'meta', '')
 for url in patch.src_patches(d):
 (_, _, fullpath, _, _, _) = bb.fetch.decodeurl(url)
 
-# skip patches not in oe-core
-patchtype = "patch-status-core"
-if not os.path.abspath(fullpath).startswith(coremeta_path):
-patchtype = "patch-status-noncore"
-if not allpatches:
-continue
-
 msg = oe.qa.check_upstream_status(fullpath)
 if msg:
-oe.qa.handle_error(patchtype, msg, d)
+oe.qa.handle_error("patch-status", msg, d)
 
 oe.qa.exit_if_errors(d)
 }
-- 
2.39.2


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#183115): 
https://lists.openembedded.org/g/openembedded-core/message/183115
Mute This Topic: https://lists.openembedded.org/mt/99623855/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][kirkstone][PATCH V2 5/6] webkitgtk: fix CVE-2023-23517 CVE-2023-23518

2023-06-19 Thread Steve Sakoman
I wasn't able to take this patch because it too failed during do_patch
at build time.  Please submit a v2 with this corrected.

I was able to take the other patches in this series though, so you
only need to submit v2 for the two that I wasn't able to take.

Steve

On Fri, Jun 9, 2023 at 4:09 AM Urade, Yogita via
lists.openembedded.org
 wrote:
>
> The issue was addressed with improved memory handling.
> This issue is fixed in macOS Ventura 13.2, macOS Monterey
> 12.6.3, tvOS 16.3, Safari 16.3, watchOS 9.3, iOS 16.3 and
> iPadOS 16.3, macOS Big Sur 11.7.3. Processing maliciously
> crafted web content may lead to arbitrary code execution.
>
> References:
> https://nvd.nist.gov/vuln/detail/CVE-2023-23517
> https://support.apple.com/en-us/HT213638
> https://bugs.webkit.org/show_bug.cgi?id=248268
> https://github.com/WebKit/WebKit/pull/6756
>
> Signed-off-by: Yogita Urade 
> ---
>  .../CVE-2023-23517-CVE-2023-23518.patch   | 131 ++
>  meta/recipes-sato/webkit/webkitgtk_2.36.8.bb  |   1 +
>  2 files changed, 132 insertions(+)
>  create mode 100644 
> meta/recipes-sato/webkit/webkitgtk/CVE-2023-23517-CVE-2023-23518.patch
>
> diff --git 
> a/meta/recipes-sato/webkit/webkitgtk/CVE-2023-23517-CVE-2023-23518.patch 
> b/meta/recipes-sato/webkit/webkitgtk/CVE-2023-23517-CVE-2023-23518.patch
> new file mode 100644
> index 00..721f045e0d
> --- /dev/null
> +++ b/meta/recipes-sato/webkit/webkitgtk/CVE-2023-23517-CVE-2023-23518.patch
> @@ -0,0 +1,131 @@
> +From f44648f07471b6c34f61993baa8997f7519a18a1 Mon Sep 17 00:00:00 2001
> +From: Youenn Fablet 
> +Date: Mon, 28 Nov 2022 00:43:35 -0800
> +Subject: [PATCH] Type getter is not needed for internal ReadableStream 
> sources
> + https://bugs.webkit.org/show_bug.cgi?id=248268 rdar://102338913
> +
> +Reviewed by Eric Carlson.
> +
> +Make ReadableStreamSource method privates.
> +In ReadableStream, use @getters instead of private getters to allow getting 
> private values from prototype.
> +Covered by added test.
> +
> +* LayoutTests/http/wpt/fetch/fetch-stream-source-expected.txt: Added.
> +* LayoutTests/http/wpt/fetch/fetch-stream-source.html: Added.
> +* Source/WebCore/Modules/streams/ReadableStream.js:
> +(initializeReadableStream):
> +* Source/WebCore/Modules/streams/ReadableStreamSource.idl:
> +* Source/WebCore/bindings/js/JSDOMOperationReturningPromise.h:
> +(WebCore::IDLOperationReturningPromise::call):
> +
> +Canonical link: https://commits.webkit.org/257063@main
> +
> +CVE: CVE-2023-23517 CVE-2023-23518
> +
> +Upstream-Status: Backport
> +[https://github.com/WebKit/WebKit/commit/f44648f07471b6c34f61993baa8997f7519a18a1]
> +
> +Signed-off-by: Yogita Urade 
> +---
> + .../fetch/fetch-stream-source-expected.txt|  3 +++
> + .../http/wpt/fetch/fetch-stream-source.html   | 24 +++
> + .../WebCore/Modules/streams/ReadableStream.js |  4 ++--
> + .../Modules/streams/ReadableStreamSource.idl  |  8 +++
> + .../js/JSDOMOperationReturningPromise.h   |  4 +++-
> + 5 files changed, 36 insertions(+), 7 deletions(-)
> + create mode 100644 
> LayoutTests/http/wpt/fetch/fetch-stream-source-expected.txt
> + create mode 100644 LayoutTests/http/wpt/fetch/fetch-stream-source.html
> +
> +diff --git a/LayoutTests/http/wpt/fetch/fetch-stream-source-expected.txt 
> b/LayoutTests/http/wpt/fetch/fetch-stream-source-expected.txt
> +new file mode 100644
> +index ..856ea8180ca2
> +--- /dev/null
>  b/LayoutTests/http/wpt/fetch/fetch-stream-source-expected.txt
> +@@ -0,0 +1,3 @@
> ++
> ++PASS Only JS streams should check type
> ++
> +diff --git a/LayoutTests/http/wpt/fetch/fetch-stream-source.html 
> b/LayoutTests/http/wpt/fetch/fetch-stream-source.html
> +new file mode 100644
> +index ..fbebfa5e524f
> +--- /dev/null
>  b/LayoutTests/http/wpt/fetch/fetch-stream-source.html
> +@@ -0,0 +1,24 @@
> ++
> ++
> ++  
> ++
> ++Fetch and source
> ++
> ++
> ++  
> ++  
> ++
> ++promise_test(async () => {
> ++let counter = 0;
> ++Object.prototype.__defineGetter__("type", function() {
> ++counter++;
> ++});
> ++
> ++const response = await fetch('/');
> ++const fetchReadableStream = response.body;
> ++const [r1, r2] = fetchReadableStream.tee();
> ++assert_equals(counter, 0);
> ++}, "Only JS streams should check type");
> ++
> ++  
> ++
> +diff --git a/Source/WebCore/Modules/streams/ReadableStream.js 
> b/Source/WebCore/Modules/streams/ReadableStream.js
> +index ddef56ecd460..7f0def325d84 100644
> +--- a/Source/WebCore/Modules/streams/ReadableStream.js
>  b/Source/WebCore/Modules/streams/ReadableStream.js
> +@@ -48,10 +48,10 @@ function initializeReadableStream(underlyingSource, 
> strategy)
> +
> + // FIXME: We should introduce 
> https://streams.spec.whatwg.org/#create-readable-stream.
> + // For now, we emulate this with underlyingSource with private 
> properties.
> +-if (@getByIdDirectPrivate(underlyingSource, "pull") !== @undefined) {
> ++if 

Re: [OE-core][PATCH] runqemu-gen-tapdevs: pass STAGING_BINDIR_NATIVE to ifup

2023-06-19 Thread Richard Purdie
On Mon, 2023-06-19 at 09:54 -0400, Trevor Gamblin wrote:
> Without this, runqemu-gen-tapdevs fails with the following error:
> 
> [tgamblin@megalith build]$ sudo 
> /workspace/yocto/manual/poky/scripts/runqemu-gen-tapdevs 1000 1002 4 
> tmp/sysroots-components/x86_64/qemu-helper-native/usr/bin
> Creating 4 tap devices for UID: 1000 GID: 1002...
> Creating tap0
> Error bringing up interface: sudo runqemu-ifup   
> 
> 
> Signed-off-by: Trevor Gamblin 
> ---
>  scripts/runqemu-gen-tapdevs | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/runqemu-gen-tapdevs b/scripts/runqemu-gen-tapdevs
> index ec3ecb03b9..dc730e413d 100755
> --- a/scripts/runqemu-gen-tapdevs
> +++ b/scripts/runqemu-gen-tapdevs
> @@ -79,7 +79,7 @@ fi
>  echo "Creating $COUNT tap devices for UID: $TUID GID: $GID..."
>  for ((index=0; index < $COUNT; index++)); do
>   echo "Creating tap$index"
> - if ! ifup=`$RUNQEMU_IFUP $TUID $GID 2>&1`; then
> + if ! ifup=`$RUNQEMU_IFUP $TUID $GID $STAGING_BINDIR_NATIVE 2>&1`; then
>   echo "Error bringing up interface: $ifup"
>   exit 1
>   fi

I'm a bit puzzled as I removed the use of STAGING_BINDIR_NATIVE in that
script?

Are you mixing different releases?

Cheers,

Richard


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#183112): 
https://lists.openembedded.org/g/openembedded-core/message/183112
Mute This Topic: https://lists.openembedded.org/mt/99623609/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][kirkstone][PATCH V2 4/6] webkitgtk: fix CVE-2022-42856

2023-06-19 Thread Steve Sakoman
On Fri, Jun 9, 2023 at 5:54 AM Steve Sakoman via
lists.openembedded.org 
wrote:
>
> On Fri, Jun 9, 2023 at 4:09 AM Urade, Yogita via
> lists.openembedded.org
>  wrote:
> >
> > A type confusion issue was addressed with improved state handling.
> > This issue is fixed in Safari 16.2, tvOS 16.2, macOS Ventura 13.1,
> > iOS 15.7.2 and iPadOS 15.7.2, iOS 16.1.2. Processing maliciously
> > crafted web content may lead to arbitrary code execution. Apple is
> > aware of a report that this issue may have been actively exploited
> > against versions of iOS released before iOS 15.1.
> >
> > References:
> > https://support.apple.com/en-us/HT213531
> >
> > Signed-off-by: Yogita Urade 
> > ---
> >  .../webkit/webkitgtk/CVE-2022-42856.patch | 110 ++
> >  meta/recipes-sato/webkit/webkitgtk_2.36.8.bb  |   1 +
> >  2 files changed, 111 insertions(+)
> >  create mode 100644 meta/recipes-sato/webkit/webkitgtk/CVE-2022-42856.patch
> >
> > diff --git a/meta/recipes-sato/webkit/webkitgtk/CVE-2022-42856.patch 
> > b/meta/recipes-sato/webkit/webkitgtk/CVE-2022-42856.patch
> > new file mode 100644
> > index 00..97d58c955a
> > --- /dev/null
> > +++ b/meta/recipes-sato/webkit/webkitgtk/CVE-2022-42856.patch
> > @@ -0,0 +1,110 @@
> > +From 71cdc1c09ef199db74b2b60ed5de781250d96a56 Mon Sep 17 00:00:00 2001
> > +From: Mark Lam 
> > +Date: Wed, 23 Nov 2022 13:48:49 -0800
> > +Subject: [PATCH] The provenType filtering in FTL's speculateRealNumber is
> > + incorrect. https://bugs.webkit.org/show_bug.cgi?id=248266
> > + 
> > +
> > +Reviewed by Justin Michaud.
> > +
> > +speculateRealNumber does a doubleEqual compare, which filters out double 
> > values which
> > +are not NaN.  NaN values will fall through to the `intCase` block.  In the 
> > `intCase` block,
> > +the isNotInt32() check there was given a proven type that wrongly filters 
> > out ~SpecFullDouble.
> > +
> > +Consider a scenario where the edge was proven to be { SpecInt32Only, 
> > SpecDoubleReal,
> > +SpecDoublePureNaN }.  SpecFullDouble is defined as SpecDoubleReal | 
> > SpecDoubleNaN, and
> > +SpecDoubleNaN is defined as SpecDoublePureNaN | SpecDoubleImpureNaN.  
> > Hence, the filtering
> > +of the proven type with ~SpecFullDouble means that isNotInt32() will 
> > effectively be given
> > +a proven type of
> > +
> > +{ SpecInt32Only, SpecDoubleReal, SpecDoublePureNaN } - { 
> > SpecDoubleReal, SpecDoublePureNaN }
> > +
> > +which yields
> > +
> > +{ SpecInt32Only }.
> > +
> > +As a result, the compiler will think that that isNotIn32() check will 
> > always fail.  This
> > +is not correct if the actual incoming value for that edge is actually a 
> > PureNaN.  In this
> > +case, speculateRealNumber should have OSR exited, but it doesn't because 
> > it thinks that
> > +the isNotInt32() check will always fail and elide the check altogether.
> > +
> > +In this patch, we fix this by replacing the ~SpecFullDouble with 
> > ~SpecDoubleReal.  We also
> > +rename the `intCase` block to `intOrNaNCase` to document what it actually 
> > handles.
> > +
> > +* JSTests/stress/speculate-real-number-in-object-is.js: Added.
> > +(test.object_is_opt):
> > +(test):
> > +* Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:
> > +(JSC::FTL::DFG::LowerDFGToB3::compileCompareStrictEq):
> > +
> > +Canonical link: https://commits.webkit.org/252432.839@safari-7614-branch
> > +
> > +CVE: CVE-2022-42856
> > +
> > +Upstream-Status: Backport
> > +[https://github.com/WebKit/WebKit/commit/71cdc1c09ef199db74b2b60ed5de781250d96a56]
> > +
> > +Signed-off-by: Yogita Urade 
> > +---
> > + .../speculate-real-number-in-object-is.js | 22 +++
> > + Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp |  8 +++
> > + 2 files changed, 26 insertions(+), 4 deletions(-)
> > + create mode 100644 JSTests/stress/speculate-real-number-in-object-is.js
> > +
> > +diff --git a/JSTests/stress/speculate-real-number-in-object-is.js 
> > b/JSTests/stress/speculate-real-number-in-object-is.js
> > +new file mode 100644
> > +index ..0b10799954da
> > +--- /dev/null
> >  b/JSTests/stress/speculate-real-number-in-object-is.js
> > +@@ -0,0 +1,22 @@
> > ++function test() {
> > ++function object_is_opt(value) {
> > ++const tmp = {p0: value};
> > ++
> > ++if (Object.is(value, NaN))
> > ++return 0;
> > ++
> > ++return value;
> > ++}
> > ++
> > ++object_is_opt(NaN);
> > ++
> > ++for (let i = 0; i < 0x2; i++)
> > ++object_is_opt(1.1);
> > ++
> > ++return isNaN(object_is_opt(NaN));
> > ++}
> > ++
> > ++resultIsNaN = test();
> > ++if (resultIsNaN)
> > ++throw "FAILED";
> > ++
> > +diff --git a/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp 
> > b/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
> > +index 8621b554d578..588298eba350 100644
> > +--- a/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
> >  b/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
> > +@@ -20285,18 +20285,18 @@ IGNORE_CLANG_WARNINGS_END
> > +

Re: [OE-core] [PATCH] base-passwd: fix patchreview warning

2023-06-19 Thread Alexandre Belloni via lists.openembedded.org
On 19/06/2023 14:27:04+0100, Richard Purdie wrote:
> On Mon, 2023-06-19 at 15:18 +0200, Alexander Kanavin wrote:
> > Should the regex that finds these lines be fixed rather? It’s
> > entirely valid to say ‘upstream status’ somewhere, it should be
> > matching ‘Upstream-Status:’ at the start of the line exactly.
> 
> The check is deliberately doing fuzzy matching to spot "broken" lines.
> Whether we need that any more now we have other checks for correct
> lines is probably a better question...
> 

Yeah, this was my assumption that doing fuzzy matching was expected.

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#183110): 
https://lists.openembedded.org/g/openembedded-core/message/183110
Mute This Topic: https://lists.openembedded.org/mt/99611534/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] runqemu-gen-tapdevs: pass STAGING_BINDIR_NATIVE to ifup

2023-06-19 Thread Trevor Gamblin
Without this, runqemu-gen-tapdevs fails with the following error:

[tgamblin@megalith build]$ sudo 
/workspace/yocto/manual/poky/scripts/runqemu-gen-tapdevs 1000 1002 4 
tmp/sysroots-components/x86_64/qemu-helper-native/usr/bin
Creating 4 tap devices for UID: 1000 GID: 1002...
Creating tap0
Error bringing up interface: sudo runqemu-ifup   


Signed-off-by: Trevor Gamblin 
---
 scripts/runqemu-gen-tapdevs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/runqemu-gen-tapdevs b/scripts/runqemu-gen-tapdevs
index ec3ecb03b9..dc730e413d 100755
--- a/scripts/runqemu-gen-tapdevs
+++ b/scripts/runqemu-gen-tapdevs
@@ -79,7 +79,7 @@ fi
 echo "Creating $COUNT tap devices for UID: $TUID GID: $GID..."
 for ((index=0; index < $COUNT; index++)); do
echo "Creating tap$index"
-   if ! ifup=`$RUNQEMU_IFUP $TUID $GID 2>&1`; then
+   if ! ifup=`$RUNQEMU_IFUP $TUID $GID $STAGING_BINDIR_NATIVE 2>&1`; then
echo "Error bringing up interface: $ifup"
exit 1
fi
-- 
2.40.1


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



Re: [OE-core] [PATCH] base-passwd: fix patchreview warning

2023-06-19 Thread Richard Purdie
On Mon, 2023-06-19 at 15:18 +0200, Alexander Kanavin wrote:
> Should the regex that finds these lines be fixed rather? It’s
> entirely valid to say ‘upstream status’ somewhere, it should be
> matching ‘Upstream-Status:’ at the start of the line exactly.

The check is deliberately doing fuzzy matching to spot "broken" lines.
Whether we need that any more now we have other checks for correct
lines is probably a better question...

Cheers,

Richard



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#183108): 
https://lists.openembedded.org/g/openembedded-core/message/183108
Mute This Topic: https://lists.openembedded.org/mt/99611534/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] runqemu-gen-tapdevs: fix missing variable quote

2023-06-19 Thread Trevor Gamblin
Commit d43c41fcaf061eaf8bff7bc03de19cdc80226796 refactors the script but
there's a missing '"' in one line, leading to the following message:

poky/scripts/runqemu-gen-tapdevs: command substitution: line 62: unexpected EOF 
while looking for matching `"'

Signed-off-by: Trevor Gamblin 
---
 scripts/runqemu-gen-tapdevs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/runqemu-gen-tapdevs b/scripts/runqemu-gen-tapdevs
index 4f8ea979d2..ec3ecb03b9 100755
--- a/scripts/runqemu-gen-tapdevs
+++ b/scripts/runqemu-gen-tapdevs
@@ -59,7 +59,7 @@ if [ ! -x "$RUNQEMU_IFUP" ]; then
 fi
 
 if interfaces=`ip tuntap list` 2>/dev/null; then
-   interfaces=`echo "$interfaces |cut -f1 -d:`
+   interfaces=`echo "$interfaces" |cut -f1 -d:`
 else
echo "Failed to call 'ip tuntap list'" >&2
exit 1
-- 
2.40.1


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



Re: [OE-core] [PATCH] base-passwd: fix patchreview warning

2023-06-19 Thread Alexander Kanavin
Should the regex that finds these lines be fixed rather? It’s entirely
valid to say ‘upstream status’ somewhere, it should be matching
‘Upstream-Status:’ at the start of the line exactly.

Alex

On Sun 18. Jun 2023 at 23.26, Alexandre Belloni via lists.openembedded.org
 wrote:

> From: Alexandre Belloni 
>
> Fix:
>
> Malformed Upstream-Status 'Upstream status'
> (meta/recipes-core/base-passwd/base-passwd/0007-Add-wheel-group.patch)
> Unknown Upstream-Status value 'says'
> (meta/recipes-core/base-passwd/base-passwd/0007-Add-wheel-group.patch)
>
> Signed-off-by: Alexandre Belloni 
> ---
>  .../base-passwd/base-passwd/0007-Add-wheel-group.patch  | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git
> a/meta/recipes-core/base-passwd/base-passwd/0007-Add-wheel-group.patch
> b/meta/recipes-core/base-passwd/base-passwd/0007-Add-wheel-group.patch
> index 00eaec38a294..d77122789d5e 100644
> --- a/meta/recipes-core/base-passwd/base-passwd/0007-Add-wheel-group.patch
> +++ b/meta/recipes-core/base-passwd/base-passwd/0007-Add-wheel-group.patch
> @@ -2,7 +2,7 @@
>  We need to have a wheel group which has some system privileges to consult
> the
>  systemd journal or manage printers with cups.
>
> -Upstream status says the group does not exist by default.
> +Upstream says the group does not exist by default.
>
>  Upstream-Status: Inappropriate [enable feature]
>
> --
> 2.40.1
>
>
> 
>
>

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#183106): 
https://lists.openembedded.org/g/openembedded-core/message/183106
Mute This Topic: https://lists.openembedded.org/mt/99611534/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] base-passwd: add the wheel group

2023-06-19 Thread Louis Rannou



On 18/06/2023 11:37, Alexandre Belloni wrote:

On 15/06/2023 13:43:55+0200, Louis Rannou wrote:

The wheel group is not declared while it can be used to access the systemd
journal and to configure printers in CUPS. It can also be used for su and sudo
permissions.

So far it was created later in the rootfs postcommand systemd_create_users.

Signed-off-by: Louis Rannou 
---
  .../base-passwd/0007-Add-wheel-group.patch   | 20 
  meta/recipes-core/base-passwd/base-passwd_3.6.1.bb   |  1 +
  2 files changed, 21 insertions(+)

diff --git 
a/meta/recipes-core/base-passwd/base-passwd/0007-Add-wheel-group.patch 
b/meta/recipes-core/base-passwd/base-passwd/0007-Add-wheel-group.patch
new file mode 100644
index 00..00eaec38a2
--- /dev/null
+++ b/meta/recipes-core/base-passwd/base-passwd/0007-Add-wheel-group.patch
@@ -0,0 +1,20 @@
+
+We need to have a wheel group which has some system privileges to consult the
+systemd journal or manage printers with cups.
+
+Upstream status says the group does not exist by default.


This should be rephrased because it causes:

Malformed Upstream-Status 'Upstream status' 
(meta/recipes-core/base-passwd/base-passwd/0007-Add-wheel-group.patch)
Unknown Upstream-Status value 'says' 
(meta/recipes-core/base-passwd/base-passwd/0007-Add-wheel-group.patch)
Patches missing Upstream-Status: 0 (0%)
Patches with malformed Upstream-Status: 1 (0%


Sorry for that. I didn't expect it would parse any line starting with 
Upstream status...






+
+Upstream-Status: Inappropriate [enable feature]
+
+Signed-off-by: Louis Rannou 
+Index: base-passwd-3.5.26/group.master
+===
+--- base-passwd-3.5.29.orig/group.master
 base-passwd-3.5.29/group.master
+@@ -38,5 +38,6 @@
+ staff:*:50:
+ games:*:60:
+ shutdown:*:70:
++wheel:*:80:
+ users:*:100:
+ nogroup:*:65534:
diff --git a/meta/recipes-core/base-passwd/base-passwd_3.6.1.bb 
b/meta/recipes-core/base-passwd/base-passwd_3.6.1.bb
index 853717176d..204016b3e7 100644
--- a/meta/recipes-core/base-passwd/base-passwd_3.6.1.bb
+++ b/meta/recipes-core/base-passwd/base-passwd_3.6.1.bb
@@ -12,6 +12,7 @@ SRC_URI = 
"https://launchpad.net/debian/+archive/primary/+files/${BPN}_${PV}.tar
 file://0004-Add-an-input-group-for-the-dev-input-devices.patch \
 file://0005-Add-kvm-group.patch \
 
file://0006-Make-it-possible-to-configure-whether-to-use-SELinux.patch \
+   file://0007-Add-wheel-group.patch \
 "
  
  SRC_URI[sha256sum] = "6ff369be59d586ba63c0c5fcb00f75f9953fe49db88bc6c6428f2c92866f79af"


--
2.41.0












Louis

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



Re: [OE-core] [PATCH 2/3] systemd: replace the sysusers.d basic configuration

2023-06-19 Thread Louis Rannou

Hello,

On 16/06/2023 18:51, Peter Kjellerstedt wrote:

-Original Message-
From: openembedded-core@lists.openembedded.org 
 On Behalf Of Louis Rannou
Sent: den 15 juni 2023 13:44
To: openembedded-core@lists.openembedded.org
Cc: Louis Rannou ; anuj.mit...@intel.com
Subject: [OE-core] [PATCH 2/3] systemd: replace the sysusers.d basic 
configuration

The default sysusers basic.conf.in file sets the root home directory to `/root`
and does not permit its configuration. Replace the file delivered by systemd so
the root home directory matches the `ROOT_HOME` variable.

Signed-off-by: Louis Rannou 
---
  meta/recipes-core/systemd/systemd/basic.conf.in | 40 +
  meta/recipes-core/systemd/systemd_253.3.bb  |  5 
  2 files changed, 45 insertions(+)

diff --git a/meta/recipes-core/systemd/systemd/basic.conf.in 
b/meta/recipes-core/systemd/systemd/basic.conf.in
new file mode 100644
index 00..fac288f7fa
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/basic.conf.in
@@ -0,0 +1,40 @@
+#  This file is part of systemd.
+#
+#  systemd is free software; you can redistribute it and/or modify it
+#  under the terms of the GNU Lesser General Public License as published by
+#  the Free Software Foundation; either version 2.1 of the License, or
+#  (at your option) any later version.
+
+# The superuser
+u root0 "root" :ROOT_HOME:
+
+# The nobody user/group for NFS file systems
+g {{NOBODY_GROUP_NAME}} 65534   --
+u {{NOBODY_USER_NAME }} 65534:65534 "Nobody" -
+
+# Administrator group: can *see* more than normal users
+g adm {{ADM_GID}} --
+
+# Administrator group: can *do* more than normal users
+g wheel   {{WHEEL_GID  }} --
+
+# Access to shared database of users on the system
+g utmp{{UTMP_GID   }} --
+
+# Physical and virtual hardware access groups
+g audio   {{AUDIO_GID  }} --
+g cdrom   {{CDROM_GID  }} --
+g dialout {{DIALOUT_GID}} --
+g disk{{DISK_GID   }} --
+g input   {{INPUT_GID  }} --
+g kmem{{KMEM_GID   }} --
+g kvm {{KVM_GID}} --
+g lp  {{LP_GID }} --
+g render  {{RENDER_GID }} --
+g sgx {{SGX_GID}} --
+g tape{{TAPE_GID   }} --
+g tty {{TTY_GID}} --
+g video   {{VIDEO_GID  }} --
+
+# Default group for normal users
+g users   {{USERS_GID  }} --
diff --git a/meta/recipes-core/systemd/systemd_253.3.bb 
b/meta/recipes-core/systemd/systemd_253.3.bb
index 45dc6ab5bb..87fbf6f785 100644
--- a/meta/recipes-core/systemd/systemd_253.3.bb
+++ b/meta/recipes-core/systemd/systemd_253.3.bb
@@ -17,6 +17,7 @@ REQUIRED_DISTRO_FEATURES = "systemd"
  SRC_URI += " \
 file://touchscreen.rules \
 file://00-create-volatile.conf \
+   file://basic.conf.in \


Instead of including a modified copy of the basic.conf.in file
from systemd, include a patch that modifies the file that systemd
provides. Otherwise this becomes a maintenance problem where it
is easy to miss changes that upstream does to the file, and also
hard to know what you have changed.

This came to my mind, but it seems to me it's a configuration and not a 
patch. Some distribution as debian generate their own. It could also be 
replaced by the user to set its own preferences. It is not supposed to 
change the default configuration, but to set the one we need.



 ${@bb.utils.contains('PACKAGECONFIG', 'polkit_hostnamed_fallback', 
'file://org.freedesktop.hostname1_no_polkit.conf', '', d)} \
 ${@bb.utils.contains('PACKAGECONFIG', 'polkit_hostnamed_fallback', 
'file://00-hostnamed-network-user.conf', '', d)} \
 file://init \
@@ -252,6 +253,10 @@ EXTRA_OEMESON += "-Dkexec-path=${sbindir}/kexec \
  # The 60 seconds is watchdog's default vaule.
  WATCHDOG_TIMEOUT ??= "60"

+do_configure:prepend() {
+  sed s@:ROOT_HOME:@${ROOT_HOME}@g ${WORKDIR}/basic.conf.in > 
${S}/sysusers.d/basic.conf.in


Please indent shell code using tabs, and change the command to:

sed -i s@:ROOT_HOME:@${ROOT_HOME}@g ${S}/sysusers.d/basic.conf.in

once you have added the patch as per above.
I understand '@' is easier to read than ':'. I have used the colon 
because its usage is very restricted in the sysusers.d file. But it's 
fine to me as this is supposed to be a path. Also, the input file and 
the output are not in the same directory. I am not sure about the "-i" 
option.




However, I am wondering if this has to be done during do_configure()?
It might become confusing if you ever `devtool modify systemd` (which
we do). Wouldn't it be better to do it on the installed file in the
do_install() below instead?

This file is parsed at systemd compilation. The file has to be correct 
before that.



+}
+
  do_install() {

Re: [OE-core] [PATCH] rootfs-postcommands: Set vardeps for write_image_test_data

2023-06-19 Thread Richard Purdie
On Mon, 2023-06-19 at 12:47 +0100, Peter Hoyes wrote:
>  
> It sounds like moving testdata creation to a separate task doesn't
> bring much benefit so I'll revert to something based off this patch.
> 
> It looks like a relatively small number of variables are actually
> used by OEQA tests in OE-core:
>  
>  * IMAGE
>  * ARCH
>  * MACHINE
>  * PACKAGE_FEED_GPG_NAME
>  * VIRTUAL-RUNTIME_init_manager
>  * WORKDIR
>  * DISTRO_FEATURES
>  * PTEST_EXPECT_FAILURE
>  * TEST_LOG_DIR
>  * libdir
>  * T
>  * MULTILIB_VARIANTS
>  * SDKPATH
>  * SDK_DEPLOY
>  * TOOLCHAINEXT_OUTPUTNAME
>  * QEMU_USE_KVM
> 
>  * DL_DIR
> 
> Notably, DATE/TIME do not seem to be referenced at all (apart from a
> comment in oeqa/runtime/cases/ptest.py recommending *not* using
> DATETIME for test output). Additionally, DL_DIR and WORKDIR are
> updated on each testimage execution using TESTIMAGE_UPDATE_VARS.
>  
>  
> How about introducing a new variable, e.g. TESTIMAGE_EXPORT_VARS,
> containing just the list above (to which other variables could
> optionally be appended in other layers)?
> 

I think that is certainly worth trying.

Cheers,

Richard





-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#183103): 
https://lists.openembedded.org/g/openembedded-core/message/183103
Mute This Topic: https://lists.openembedded.org/mt/98951993/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] ghostscript: mostly rewrite recipe

2023-06-19 Thread Ross Burton
From: Ross Burton 

This started as a patch cleanup but escalated rapidly.

Remove unneeded patches:
- mkdir-p.patch isn't needed now the Makefiles appear to have the correct
  dependencies.
- ghostscript-9.15-parallel-make.patch appears to be unneeded for the same
  reason
- base-genht.c-add-a-preprocessor-define-to-allow-fope.patch isn't needed
- cups-no-gcrypt.patch isn't needed
- do-not-check-local-libpng-source.patch can be replaced by deleting
  the libpng/ directory, as is already done for jpeg/
- ghostscript-9.21-native-fix-disable-system-libtiff.patch is not needed
  when we stop doing native builds (see below)

Remove the need for ghostscript-native to build and install tools that
are needed at target build-time: ghostscript can do this itself.  Remove
the BBCLASSEXTEND and all of the native overrides.

Inherit pkgconfig and explicitly tell configure to use the pkgconfig
binary: unless told otherwise this configure will refuse to use an
unprefixed pkgconfig in cross builds.

Review DEPENDS and add missing freetype and zlib dependencies.

Ghostcript will use the embedded copies of libraries over system
libraries, so extend the deletion of jpeg and libpng to include expat,
freetype, and cups as we want to link to our build of those. We can't
delete zlib as it is explicitly used when building the native tools.

Add PACKAGECONFIGs for optional libidn and libpaper dependencies.

Remove HAVE_SYS_TIME_H assignments, the upstream bug was fixed in 2011.

Clean up comments: there's no need to explain how to use PACKAGECONFIG,
and justify the use of autotools-brokensep.

Signed-off-by: Ross Burton 
---
 .../avoid-host-contamination.patch|  3 +-
 ...-a-preprocessor-define-to-allow-fope.patch | 42 
 .../ghostscript/cups-no-gcrypt.patch  | 37 ---
 .../do-not-check-local-libpng-source.patch| 31 --
 .../ghostscript-9.15-parallel-make.patch  | 28 --
 ...21-native-fix-disable-system-libtiff.patch | 47 -
 .../ghostscript/ghostscript/mkdir-p.patch | 50 --
 .../ghostscript/ghostscript_10.01.1.bb| 97 ---
 8 files changed, 21 insertions(+), 314 deletions(-)
 delete mode 100644 
meta/recipes-extended/ghostscript/ghostscript/base-genht.c-add-a-preprocessor-define-to-allow-fope.patch
 delete mode 100644 
meta/recipes-extended/ghostscript/ghostscript/cups-no-gcrypt.patch
 delete mode 100644 
meta/recipes-extended/ghostscript/ghostscript/do-not-check-local-libpng-source.patch
 delete mode 100644 
meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.15-parallel-make.patch
 delete mode 100644 
meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.21-native-fix-disable-system-libtiff.patch
 delete mode 100644 meta/recipes-extended/ghostscript/ghostscript/mkdir-p.patch

diff --git 
a/meta/recipes-extended/ghostscript/ghostscript/avoid-host-contamination.patch 
b/meta/recipes-extended/ghostscript/ghostscript/avoid-host-contamination.patch
index e8cb16c36b4..15c7eb5a774 100644
--- 
a/meta/recipes-extended/ghostscript/ghostscript/avoid-host-contamination.patch
+++ 
b/meta/recipes-extended/ghostscript/ghostscript/avoid-host-contamination.patch
@@ -5,8 +5,7 @@ Subject: [PATCH 04/10] avoid host contamination
 
 Remove hardcode path refer to host to avoid host contamination.
 
-Upstream-Status: Inappropriate [embedded specific]
-
+Upstream-Status: Pending
 Signed-off-by: Kai Kang 
 
 Rebase to 9.23
diff --git 
a/meta/recipes-extended/ghostscript/ghostscript/base-genht.c-add-a-preprocessor-define-to-allow-fope.patch
 
b/meta/recipes-extended/ghostscript/ghostscript/base-genht.c-add-a-preprocessor-define-to-allow-fope.patch
deleted file mode 100644
index 7d80066a80e..000
--- 
a/meta/recipes-extended/ghostscript/ghostscript/base-genht.c-add-a-preprocessor-define-to-allow-fope.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 9ca6f795409b988d38dd98bc2a6ecb68a9392312 Mon Sep 17 00:00:00 2001
-From: Hongxu Jia 
-Date: Thu, 29 Mar 2018 16:37:40 +0800
-Subject: [PATCH 10/10] base/genht.c: add a preprocessor define to allow fopen
- calling
-
-The commit in upstream:
-http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=773c69e46e70bdd5482676437dafd2ca83397643
-
-Replace all fopen calls with gp_fopen and add a preprocessor define so
-that any unintential calls directly to fopen will cause an error.
-
-Only exceptions are those in the platform specific code, and mkromfs.c.
-This patch add a preprocessor define to allow fopen calling in
-base/genht.c.
-
-Upstream-Status: Pending
-
-Rebase to 9.23
-Signed-off-by: Hongxu Jia 

- base/genht.c | 4 
- 1 file changed, 4 insertions(+)
-
-diff --git a/base/genht.c b/base/genht.c
-index e597e72..e96bfb5 100644
 a/base/genht.c
-+++ b/base/genht.c
-@@ -16,6 +16,10 @@
- 
- /* Generate C code for compiling halftones into ROM. */
- #include "malloc_.h"
-+
-+/* prevent gp.h from defining fopen */
-+#define fopen fopen
-+
- #include "stdio_.h"
- #include "string_.h"
- #include "gscdefs.h"

Re: [OE-core] [PATCH] rootfs-postcommands: Set vardeps for write_image_test_data

2023-06-19 Thread Peter Hoyes

On 13/06/2023 12:33, Richard Purdie wrote:

On Tue, 2023-06-13 at 10:55 +0100, Peter Hoyes wrote:

On 23/05/2023 18:06, Ross Burton wrote:

On 17 May 2023, at 17:29, Peter Hoyes via lists.openembedded.org
  wrote:

The testdata.json file generated as part of the rootfs
postprocess
commands contains almost all Bitbake variables and is used by
OEQA test
cases to inspect the build environment. However it is only
regenerated
when the rootfs task is otherwise retriggered, complicating the
process
of developing OEQA test cases.

I’m about to run for dinner, but would it make more sense for this
function to be a separate task inside testimage.bbclass that
happens after rootfs?  This will stop the explosion of variable
dependencies causing rootfs to re-run.

Ross

Thanks for the suggestion - I have implemented this for consideration
in
https://lists.openembedded.org/g/openembedded-core/topic/patch_1_2/99501785

Making it a separate task is fine, the challenge is that it needs to
run at the same time as image processing so that DATE/TIME are
consistent and the image names are correct.

That implies that it has to be before do_image_complete which means any
change in variables will retrigger the image creation :(.

I think we need to try and fix this differently and stop exporting
every variable.

Cheers,

Richard


If I understand correctly...

It sounds like moving testdata creation to a separate task doesn't bring 
much benefit so I'll revert to something based off this patch.


It looks like a relatively small number of variables are actually used 
by OEQA tests in OE-core:


 * IMAGE
 * ARCH
 * MACHINE
 * PACKAGE_FEED_GPG_NAME
 * VIRTUAL-RUNTIME_init_manager
 * WORKDIR
 * DISTRO_FEATURES
 * PTEST_EXPECT_FAILURE
 * TEST_LOG_DIR
 * libdir
 * T
 * MULTILIB_VARIANTS
 * SDKPATH
 * SDK_DEPLOY
 * TOOLCHAINEXT_OUTPUTNAME
 * QEMU_USE_KVM
 * DL_DIR

Notably, DATE/TIME do not seem to be referenced at all (apart from a 
comment in oeqa/runtime/cases/ptest.py recommending *not* using DATETIME 
for test output). Additionally, DL_DIR and WORKDIR are updated on each 
testimage execution using TESTIMAGE_UPDATE_VARS.


How about introducing a new variable, e.g. TESTIMAGE_EXPORT_VARS, 
containing just the list above (to which other variables could 
optionally be appended in other layers)?


Peter

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#183101): 
https://lists.openembedded.org/g/openembedded-core/message/183101
Mute This Topic: https://lists.openembedded.org/mt/98951993/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] [yocto-security] OE-core CVE metrics for master on Sun 18 Jun 2023 01:00:01 AM HST

2023-06-19 Thread Ross Burton
On 18 Jun 2023, at 12:20, Steve Sakoman via lists.yoctoproject.org 
 wrote:
> CVE-2019-14899 (CVSS3: 7.4 HIGH): linux-yocto 
> https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2019-14899 *

An long-standing issue related to network stacks and so on. Someone needs to 
spend time deciding if we leave this open or add it to extra-exclusions.

> CVE-2023-3141 (CVSS3: 7.1 HIGH): linux-yocto 
> https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2023-3141 *

Backported to 6.1.30, exclusion sent.

> CVE-2023-33551 (CVSS3: 7.8 HIGH): erofs-utils:erofs-utils-native 
> https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2023-33551 *
> CVE-2023-33552 (CVSS3: 7.8 HIGH): erofs-utils:erofs-utils-native 
> https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2023-33552 *

Backports sent.

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



[OE-core] [PATCH 3/3] erofs-utils: backport fixes for CVE-2023-33551 and CVE-2023-33552

2023-06-19 Thread Ross Burton
From: Ross Burton 

Signed-off-by: Ross Burton 
---
 .../erofs-utils/erofs-utils_1.6.bb|   5 +-
 ...-don-t-allocate-read-too-large-exten.patch | 126 ++
 ...-block-insane-long-paths-when-extrac.patch |  80 +++
 3 files changed, 210 insertions(+), 1 deletion(-)
 create mode 100644 
meta/recipes-devtools/erofs-utils/files/0001-erofs-utils-fsck-don-t-allocate-read-too-large-exten.patch
 create mode 100644 
meta/recipes-devtools/erofs-utils/files/0002-erofs-utils-fsck-block-insane-long-paths-when-extrac.patch

diff --git a/meta/recipes-devtools/erofs-utils/erofs-utils_1.6.bb 
b/meta/recipes-devtools/erofs-utils/erofs-utils_1.6.bb
index 43643e07bbc..5a89e4b8ee6 100644
--- a/meta/recipes-devtools/erofs-utils/erofs-utils_1.6.bb
+++ b/meta/recipes-devtools/erofs-utils/erofs-utils_1.6.bb
@@ -6,7 +6,10 @@ LIC_FILES_CHKSUM = 
"file://COPYING;md5=73001d804ea1e3d84365f652242cca20"
 HOMEPAGE = 
"https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/tree/README;
 
 SRCREV = "21710612d35cd952490959bfa6ea9fe87aaa52dd"
-SRC_URI = 
"git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git;branch=master;protocol=https"
+SRC_URI = 
"git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git;branch=master;protocol=https
 \
+   
file://0001-erofs-utils-fsck-don-t-allocate-read-too-large-exten.patch \
+   
file://0002-erofs-utils-fsck-block-insane-long-paths-when-extrac.patch \
+"
 
 UPSTREAM_CHECK_GITTAGREGEX = "v(?P(\d+(\.\d+)+))"
 
diff --git 
a/meta/recipes-devtools/erofs-utils/files/0001-erofs-utils-fsck-don-t-allocate-read-too-large-exten.patch
 
b/meta/recipes-devtools/erofs-utils/files/0001-erofs-utils-fsck-don-t-allocate-read-too-large-exten.patch
new file mode 100644
index 000..52f475dc424
--- /dev/null
+++ 
b/meta/recipes-devtools/erofs-utils/files/0001-erofs-utils-fsck-don-t-allocate-read-too-large-exten.patch
@@ -0,0 +1,126 @@
+From c769805c79d5acede65d96e5786aa5ebb46c01e0 Mon Sep 17 00:00:00 2001
+From: Gao Xiang 
+Date: Fri, 2 Jun 2023 11:05:19 +0800
+Subject: [PATCH 1/2] erofs-utils: fsck: don't allocate/read too large extents
+
+Since some crafted EROFS filesystem images could have insane large
+extents, which causes unexpected bahaviors when extracting data.
+
+Fix it by extracting large extents with a buffer of a reasonable
+maximum size limit and reading multiple times instead.
+
+Note that only `--extract` option is impacted.
+
+CVE: CVE-2023-33552
+Closes: https://nvd.nist.gov/vuln/detail/CVE-2023-33552
+Reported-by: Chaoming Yang 
+Fixes: 412c8f908132 ("erofs-utils: fsck: add --extract=X support to extract to 
path X")
+Signed-off-by: Gao Xiang 
+Link: 
https://lore.kernel.org/r/20230602030519.117071-1-hsiang...@linux.alibaba.com
+
+Upstream-Status: Backport
+Signed-off-by: Ross Burton 
+---
+ fsck/main.c | 63 +
+ 1 file changed, 49 insertions(+), 14 deletions(-)
+
+diff --git a/fsck/main.c b/fsck/main.c
+index 6b42252..6689ad8 100644
+--- a/fsck/main.c
 b/fsck/main.c
+@@ -392,6 +392,8 @@ static int erofs_verify_inode_data(struct erofs_inode 
*inode, int outfd)
+   }
+ 
+   while (pos < inode->i_size) {
++  unsigned int alloc_rawsize;
++
+   map.m_la = pos;
+   if (compressed)
+   ret = z_erofs_map_blocks_iter(inode, ,
+@@ -420,10 +422,28 @@ static int erofs_verify_inode_data(struct erofs_inode 
*inode, int outfd)
+   if (!(map.m_flags & EROFS_MAP_MAPPED) || !fsckcfg.check_decomp)
+   continue;
+ 
+-  if (map.m_plen > raw_size) {
+-  raw_size = map.m_plen;
+-  raw = realloc(raw, raw_size);
+-  BUG_ON(!raw);
++  if (map.m_plen > Z_EROFS_PCLUSTER_MAX_SIZE) {
++  if (compressed) {
++  erofs_err("invalid pcluster size %" PRIu64 " @ 
offset %" PRIu64 " of nid %" PRIu64,
++map.m_plen, map.m_la,
++inode->nid | 0ULL);
++  ret = -EFSCORRUPTED;
++  goto out;
++  }
++  alloc_rawsize = Z_EROFS_PCLUSTER_MAX_SIZE;
++  } else {
++  alloc_rawsize = map.m_plen;
++  }
++
++  if (alloc_rawsize > raw_size) {
++  char *newraw = realloc(raw, alloc_rawsize);
++
++  if (!newraw) {
++  ret = -ENOMEM;
++  goto out;
++  }
++  raw = newraw;
++  raw_size = alloc_rawsize;
+   }
+ 
+   if (compressed) {
+@@ -434,18 +454,27 @@ static int erofs_verify_inode_data(struct erofs_inode 
*inode, int outfd)
+   }
+   ret = 

[OE-core] [PATCH 1/3] cve-extra-exclusions: call out an Ubuntu-specific issue explicitly

2023-06-19 Thread Ross Burton
From: Ross Burton 

Signed-off-by: Ross Burton 
---
 meta/conf/distro/include/cve-extra-exclusions.inc | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/meta/conf/distro/include/cve-extra-exclusions.inc 
b/meta/conf/distro/include/cve-extra-exclusions.inc
index f42253bff6e..6641126ec46 100644
--- a/meta/conf/distro/include/cve-extra-exclusions.inc
+++ b/meta/conf/distro/include/cve-extra-exclusions.inc
@@ -73,7 +73,10 @@ CVE_CHECK_IGNORE += "CVE-2011-0640 CVE-2014-2648 
CVE-2014-8171 CVE-2016-0774 CVE
  CVE-2017-1000255 CVE-2017-1000377 CVE-2017-5897 
CVE-2017-6264"
 # 2018
 CVE_CHECK_IGNORE += "CVE-2018-126 CVE-2018-10840 CVE-2018-10876 
CVE-2018-10882 CVE-2018-10901 CVE-2018-10902 \
- CVE-2018-14625 CVE-2018-16880 CVE-2018-16884 
CVE-2018-5873 CVE-2018-6559"
+ CVE-2018-14625 CVE-2018-16880 CVE-2018-16884 
CVE-2018-5873"
+
+# This is specific to Ubuntu
+CVE_CHECK_IGNORE += "CVE-2018-6559"
 
 # https://www.linuxkernelcves.com/cves/CVE-2019-3016
 # Fixed with 5.6
-- 
2.34.1


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



[OE-core] [PATCH 2/3] cve-extra-exclusions: CVE-2023-3141 was backported in Linux 6.1.30

2023-06-19 Thread Ross Burton
From: Ross Burton 

Signed-off-by: Ross Burton 
---
 meta/conf/distro/include/cve-extra-exclusions.inc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/conf/distro/include/cve-extra-exclusions.inc 
b/meta/conf/distro/include/cve-extra-exclusions.inc
index 6641126ec46..1c3cc36c617 100644
--- a/meta/conf/distro/include/cve-extra-exclusions.inc
+++ b/meta/conf/distro/include/cve-extra-exclusions.inc
@@ -664,3 +664,6 @@ CVE_CHECK_IGNORE += "CVE-2023-33288"
 # https://www.linuxkernelcves.com/cves/CVE-2023-34256
 # Fixed in 6.1.29
 CVE_CHECK_IGNORE += "CVE-2023-34256"
+
+# Backported to 6.1.30 as 9a342d4
+CVE_CHECK_IGNORE += "CVE-2023-3141"
-- 
2.34.1


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



[oe-core][kirkstone][PATCH 1/1] nasm: fix CVE-2022-46457

2023-06-19 Thread Polampalli, Archana via lists.openembedded.org
NASM v2.16 was discovered to contain a segmentation violation
in the component ieee_write_file at /output/outieee.c.

References:
https://nvd.nist.gov/vuln/detail/CVE-2022-46457

Upstream patches:
https://github.com/netwide-assembler/nasm/commit/c8af73112027fad0ecbb277e9cba257678c405af

Signed-off-by: Archana Polampalli 
---
 .../nasm/nasm/CVE-2022-46457.patch| 50 +++
 meta/recipes-devtools/nasm/nasm_2.15.05.bb|  1 +
 2 files changed, 51 insertions(+)
 create mode 100644 meta/recipes-devtools/nasm/nasm/CVE-2022-46457.patch

diff --git a/meta/recipes-devtools/nasm/nasm/CVE-2022-46457.patch 
b/meta/recipes-devtools/nasm/nasm/CVE-2022-46457.patch
new file mode 100644
index 00..3502d572cd
--- /dev/null
+++ b/meta/recipes-devtools/nasm/nasm/CVE-2022-46457.patch
@@ -0,0 +1,50 @@
+From c8af73112027fad0ecbb277e9cba257678c405af Mon Sep 17 00:00:00 2001
+From: "H. Peter Anvin" 
+Date: Wed, 7 Dec 2022 10:23:46 -0800
+Subject: [PATCH] outieee: fix segfault on empty input
+
+Fix the IEEE backend crashing if the input file is empty.
+
+Signed-off-by: H. Peter Anvin 
+
+Upstream-Status: Backport 
[https://github.com/netwide-assembler/nasm/commit/c8af73112027fad0ecbb277e9cba257678c405af]
+CVE: CVE-2022-46457
+
+Signed-off-by: Archana Polampalli 
+---
+ output/outieee.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/output/outieee.c b/output/outieee.c
+index cdb8333..8bc5eaa 100644
+--- a/output/outieee.c
 b/output/outieee.c
+@@ -919,7 +919,7 @@ static void ieee_write_file(void)
+  * Write the section headers
+  */
+ seg = seghead;
+-if (!debuginfo && !strcmp(seg->name, "??LINE"))
++if (!debuginfo && seg && !strcmp(seg->name, "??LINE"))
+ seg = seg->next;
+ while (seg) {
+ char buf[256];
+@@ -954,7 +954,7 @@ static void ieee_write_file(void)
+ /*
+  * write the start address if there is one
+  */
+-if (ieee_entry_seg) {
++if (ieee_entry_seg && seghead) {
+ for (seg = seghead; seg; seg = seg->next)
+ if (seg->index == ieee_entry_seg)
+ break;
+@@ -1067,7 +1067,7 @@ static void ieee_write_file(void)
+  *  put out section data;
+  */
+ seg = seghead;
+-if (!debuginfo && !strcmp(seg->name, "??LINE"))
++if (!debuginfo && seg && !strcmp(seg->name, "??LINE"))
+ seg = seg->next;
+ while (seg) {
+ if (seg->currentpos) {
+--
+2.40.0
diff --git a/meta/recipes-devtools/nasm/nasm_2.15.05.bb 
b/meta/recipes-devtools/nasm/nasm_2.15.05.bb
index 59b1121bd4..bcb7e071d6 100644
--- a/meta/recipes-devtools/nasm/nasm_2.15.05.bb
+++ b/meta/recipes-devtools/nasm/nasm_2.15.05.bb
@@ -9,6 +9,7 @@ SRC_URI = 
"http://www.nasm.us/pub/nasm/releasebuilds/${PV}/nasm-${PV}.tar.bz2 \
file://0001-stdlib-Add-strlcat.patch \
file://0002-Add-debug-prefix-map-option.patch \
file://CVE-2022-44370.patch \
+   file://CVE-2022-46457.patch \
"
 
 SRC_URI[sha256sum] = 
"3c4b8339e5ab54b1bcb2316101f8985a5da50a3f9e504d43fa6f35668bee2fd0"
-- 
2.40.0


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



[OE-core][PATCH 1/3] sdk.py: error out when moving file fails

2023-06-19 Thread Chen Qi via lists.openembedded.org
From: Chen Qi 

Instead of printing an error message and continuing, we should just
error out when moving file fails.

Signed-off-by: Chen Qi 
---
 meta/lib/oe/sdk.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/lib/oe/sdk.py b/meta/lib/oe/sdk.py
index 81fcf15371..3dc3672210 100644
--- a/meta/lib/oe/sdk.py
+++ b/meta/lib/oe/sdk.py
@@ -70,7 +70,7 @@ class Sdk(object, metaclass=ABCMeta):
 #FIXME: using umbrella exc catching because bb.utils method raises it
 except Exception as e:
 bb.debug(1, "printing the stack trace\n %s" 
%traceback.format_exc())
-bb.error("unable to place %s in final SDK location" % sourcefile)
+bb.fatal("unable to place %s in final SDK location" % sourcefile)
 
 def mkdirhier(self, dirpath):
 try:
-- 
2.40.0


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



[OE-core][PATCH 3/3] rpm: write macros under libdir

2023-06-19 Thread Chen Qi via lists.openembedded.org
From: Chen Qi 

If we create a macros file under etc/, the populate_sdk task would
fail if 'package-management' is in SDKIMAGE_FEATURES and nativesdk-rpm-build
is installed.. The error message is like below:

  unable to place /.../sdk/image/etc/rpm in final SDK location

This is because it's trying to move the etc/rpm dictory into the
host sysroot but the /etc/rpm has already exists.

To solve this problem, avoid creating /etc/rpm/macros for nativesdk-rpm-build,
use ${libdir}/macros instead. In this way, the macros file is hold
in nativesdk-rpm. As nativesdk-rpm-build depends on nativesdk-rpm,
the 'rpmbuild' command inside SDK can still correctly find find-debuginfo
binary.

Signed-off-by: Chen Qi 
---
 meta/recipes-devtools/rpm/rpm_4.18.1.bb | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-devtools/rpm/rpm_4.18.1.bb 
b/meta/recipes-devtools/rpm/rpm_4.18.1.bb
index 6da2edddf3..83537d4761 100644
--- a/meta/recipes-devtools/rpm/rpm_4.18.1.bb
+++ b/meta/recipes-devtools/rpm/rpm_4.18.1.bb
@@ -134,8 +134,8 @@ do_install:append:class-target() {
 do_install:append:class-nativesdk() {
 rm -rf ${D}${SDKPATHNATIVE}/var
 # Ensure find-debuginfo is located correctly inside SDK
-mkdir -p ${D}${SDKPATHNATIVE}/etc/rpm
-echo "%__find_debuginfo   ${SDKPATHNATIVE}/usr/bin/find-debuginfo" >> 
${D}${SDKPATHNATIVE}/etc/rpm/macros
+mkdir -p ${D}${libdir}/rpm
+echo "%__find_debuginfo   ${SDKPATHNATIVE}/usr/bin/find-debuginfo" >> 
${D}${libdir}/rpm/macros
 }
 
 do_install:append () {
@@ -173,7 +173,6 @@ FILES:${PN}-build = "\
 ${libdir}/rpm/macros.p* \
 ${libdir}/rpm/fileattrs/* \
 "
-FILES:${PN}-build:append:class-nativesdk = " ${SDKPATHNATIVE}/etc/rpm/macros"
 
 FILES:${PN}-sign = "\
 ${bindir}/rpmsign \
-- 
2.40.0


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



[OE-core][PATCH 2/3] sdk.py: fix moving dnf contents

2023-06-19 Thread Chen Qi via lists.openembedded.org
From: Chen Qi 

The dnf contents should be moved to /etc/dnf/xxx
instead of just /etc.

Signed-off-by: Chen Qi 
---
 meta/lib/oe/package_manager/rpm/sdk.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oe/package_manager/rpm/sdk.py 
b/meta/lib/oe/package_manager/rpm/sdk.py
index 0726a18b91..85df6e949c 100644
--- a/meta/lib/oe/package_manager/rpm/sdk.py
+++ b/meta/lib/oe/package_manager/rpm/sdk.py
@@ -112,5 +112,6 @@ class PkgSdk(Sdk):
 for f in glob.glob(os.path.join(self.sdk_output, "etc", "rpm*")):
 self.movefile(f, native_sysconf_dir)
 for f in glob.glob(os.path.join(self.sdk_output, "etc", "dnf", "*")):
-self.movefile(f, native_sysconf_dir)
+self.mkdirhier(native_sysconf_dir + "/dnf")
+self.movefile(f, native_sysconf_dir + "/dnf")
 self.remove(os.path.join(self.sdk_output, "etc"), True)
-- 
2.40.0


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



Re: [OE-core] [PATCH v2 1/2] rpm2cpio.sh: update to the last 4.x version

2023-06-19 Thread Alberto Planas via lists.openembedded.org
From: Khem Raj 
 
> I am seeing some race condition see
> https://errors.yoctoproject.org/Errors/Details/708923/

Confirmed. It is the second time that I do the same mistake. I hope v3 finally 
fix it.
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#183092): 
https://lists.openembedded.org/g/openembedded-core/message/183092
Mute This Topic: https://lists.openembedded.org/mt/99546092/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 2/2] bitbake.conf: add unzstd in HOSTTOOLS

2023-06-19 Thread Alberto Planas via lists.openembedded.org
From: Alberto Planas 

rpm2cpio.sh can make calls to unzstd to uncompress the RPM payload that
conform the cpio file.

zstd is already part of HOSTTOOLS, as a link to the system installed
zstd.

This patch add unzstd in HOSTOOLS list as a non-optional binary, so is
available to rpm2cpio.sh when it is required.

Signed-off-by: Alberto Planas 
---
 meta/conf/bitbake.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index e28df7478f..702881144e 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -524,7 +524,7 @@ HOSTTOOLS += " \
 python3 pzstd ranlib readelf readlink realpath rm rmdir rpcgen sed seq sh \
 sha1sum sha224sum sha256sum sha384sum sha512sum \
 sleep sort split stat strings strip tail tar tee test touch tr true uname \
-uniq wc wget which xargs zstd \
+uniq unzstd wc wget which xargs zstd \
 "
 
 # Tools needed to run testimage runtime image testing
-- 
2.41.0


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#183090): 
https://lists.openembedded.org/g/openembedded-core/message/183090
Mute This Topic: https://lists.openembedded.org/mt/99618665/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/2] rpm2cpio.sh: update to the last 4.x version

2023-06-19 Thread Alberto Planas via lists.openembedded.org
From: Alberto Planas 

openSUSE RPMs are compressing the RPM payload using zstd, that
correspond to the magic ID 0x28, 0xb5, 0x2f.

This patch update the script to the last version from the rpm project,
and add support to this compression format, and extract the cpio payload
using the "unzstd" binary.

Signed-off-by: Alberto Planas 
---
 scripts/rpm2cpio.sh | 30 --
 1 file changed, 20 insertions(+), 10 deletions(-)

diff --git a/scripts/rpm2cpio.sh b/scripts/rpm2cpio.sh
index 2034373fe4..8199b43784 100755
--- a/scripts/rpm2cpio.sh
+++ b/scripts/rpm2cpio.sh
@@ -7,7 +7,7 @@ fatal() {
 }
 
 pkg="$1"
-[ -n "$pkg" -a -e "$pkg" ] ||
+[ -n "$pkg" ] && [ -e "$pkg" ] ||
fatal "No package supplied"
 
 _dd() {
@@ -16,14 +16,23 @@ _dd() {
 }
 
 calcsize() {
+
+   case "$(_dd $1 bs=4 count=1 | tr -d '\0')" in
+   "$(printf '\216\255\350')"*) ;; # '\x8e\xad\xe8'
+   *) fatal "File doesn't look like rpm: $pkg" ;;
+   esac
+
offset=$(($1 + 8))
 
local i b b0 b1 b2 b3 b4 b5 b6 b7
 
i=0
while [ $i -lt 8 ]; do
-   b=$(_dd $(($offset + $i)) bs=1 count=1; echo X)
-   b=${b%X}
+   # add . to not loose \n
+   # strip \0 as it gets dropped with warning otherwise
+   b="$(_dd $(($offset + $i)) bs=1 count=1 | tr -d '\0' ; echo .)"
+   b=${b%.}# strip . again
+
[ -z "$b" ] &&
b="0" ||
b="$(exec printf '%u\n' "'$b")"
@@ -35,7 +44,7 @@ calcsize() {
offset=$(($offset + $rsize))
 }
 
-case "$(_dd 0 bs=8 count=1)" in
+case "$(_dd 0 bs=4 count=1 | tr -d '\0')" in
"$(printf '\355\253\356\333')"*) ;; # '\xed\xab\xee\xdb'
*) fatal "File doesn't look like rpm: $pkg" ;;
 esac
@@ -46,10 +55,11 @@ sigsize=$rsize
 calcsize $(($offset + (8 - ($sigsize % 8)) % 8))
 hdrsize=$rsize
 
-case "$(_dd $offset bs=3 count=1)" in
-   "$(printf '\102\132')"*) _dd $offset | bzip2 -d ;; # '\x42\x5a'
-   "$(printf '\037\213')"*) _dd $offset | gunzip  ;; # '\x1f\x8b'
-   "$(printf '\375\067')"*) _dd $offset | xzcat   ;; # '\xfd\x37'
-   "$(printf '\135\000')"*) _dd $offset | unlzma  ;; # '\x5d\x00'
-   *) fatal "Unrecognized rpm file: $pkg" ;;
+case "$(_dd $offset bs=2 count=1 | tr -d '\0')" in
+   "$(printf '\102\132')") _dd $offset | bunzip2 ;; # '\x42\x5a'
+   "$(printf '\037\213')") _dd $offset | gunzip  ;; # '\x1f\x8b'
+   "$(printf '\375\067')") _dd $offset | xzcat   ;; # '\xfd\x37'
+   "$(printf '\135')") _dd $offset | unlzma  ;; # '\x5d\x00'
+   "$(printf '\050\265')") _dd $offset | unzstd  ;; # '\x28\xb5'
+   *) fatal "Unrecognized payload compression format in rpm file: $pkg" ;;
 esac
-- 
2.41.0


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