Skip to contentSkip to conversation

patch review request

PATCH In review Anuj Mittal 3 participants 33 messages Feb 22, 2021 – Mar 22, 2021

lore
Share & tools
lore
#0 lore raw

cover patch review request

Please review these next set of changes for gatesgarth. Builds fine on autobuilder except for a known intermittent task hash mismatch failure.

Thanks,

Anuj

The following changes since commit ebaaee50cb3ac75112827f935c48affaf622ce7f:

build-appliance-image: Update to gatesgarth head revision (2021-02-16 11:44:29 +0000)

are available in the Git repository at:

git://push.openembedded.org/openembedded-core-contrib anujm/gatesgarth

Chee Yang Lee (1):
initrdscripts: init-install-efi.sh install extra files for ESP

Dorinda (1):
oe-pkgdata-util: Check if environment script is initialized

Joshua Watt (7):
libomxil: Fix up commercial license flag
weston: remoting backend requires GStreamer base plugins
oeqa: reproducible: Fix SSTATE_MIRRORS variable
oeqa: reproducible: Add more logging
systemd: Re-enable chvt as non-root user without polkit
bison: Fix up file name mapping
acpica: Fix reproducibility issues

Khem Raj (1):
tcf-agent: Fix build on riscv32

Lee Chee Yang (3):
wic: debug mode to keep tmp directory
qemu: fix CVE-2020-29443 CVE-2020-35517
openssh: fix CVE-2020-14145

Marek Vasut (1):
weston-init: Fix weston-keyboard path in weston.ini

Richard Leitner (1):
deb: export INTERCEPT_DIR for remove actions

Richard Purdie (13):
pseudo: Update for rename and faccessat fixes
pseudo: Update to include fixes for glibc 2.33
opkg: Fix build reproducibility issue
opkg: Fix patch glitches
cwautomacros: Ensure version is set deterministically
vim: Improve determinism
vim: Fix a race over creation of the desktop files package_manager/deb: Fix image generation with package removal
quilt: Be determnistic about column presence buildtools-extended-tarball: Add glibc-gconvs needed for build
watchdog: Fix determinism issue from sendmail host path
watchdog: Avoid reproducibility failures after fixing build
xmlto: Fix reproducibility

Vivien Didelot (1):
local.conf.sample.extended: fix double 'of' typo

akuster (1):
connman: update to 1.39

 meta/conf/local.conf.sample.extended          |   2 +-
 meta/lib/oe/package_manager/deb/__init__.py   |   6 +
 meta/lib/oeqa/selftest/cases/reproducible.py  |   5 +-
 meta/lib/oeqa/selftest/cases/wic.py           |   2 +
 .../{connman_1.38.bb => connman_1.39.bb}      |   3 +-
 .../openssh/openssh/CVE-2020-14145.patch      |  90 +++++++
 .../openssh/openssh_8.3p1.bb                  |   1 +
 .../initrdscripts/files/init-install-efi.sh   |   5 +
 .../meta/buildtools-extended-tarball.bb       |  10 +
 ...chvt-as-non-root-user-without-polkit.patch | 227 ++++++++++++++++++
 meta/recipes-core/systemd/systemd_246.9.bb    |   1 +
 ...001-Use-mapped-file-name-for-symbols.patch |  62 +++++
 meta/recipes-devtools/bison/bison_3.7.2.bb    |   1 +
 .../opkg/opkg/sourcedateepoch.patch           |  24 ++
 meta/recipes-devtools/opkg/opkg_0.4.3.bb      |   1 +
 meta/recipes-devtools/pseudo/pseudo_git.bb    |   2 +-
 meta/recipes-devtools/qemu/qemu.inc           |   2 +
 .../qemu/qemu/CVE-2020-29443.patch            |  46 ++++
 .../qemu/qemu/CVE-2020-35517.patch            | 126 ++++++++++
 meta/recipes-devtools/quilt/quilt.inc         |   2 +-
 .../tcf-agent/tcf-agent_git.bb                |   1 +
 meta/recipes-devtools/xmlto/xmlto_0.0.28.bb   |   2 +-
 .../acpica/acpica_20200717.bb                 |   2 +
 .../cwautomacros/cwautomacros_20110201.bb     |   2 +-
 .../watchdog/watchdog_5.16.bb                 |   6 +
 .../wayland/weston-init/weston.ini            |   2 +-
 meta/recipes-graphics/wayland/weston_9.0.0.bb |   2 +-
 .../libomxil/libomxil_0.9.3.bb                |   6 +-
 meta/recipes-support/vim/files/racefix.patch  |  33 +++
 meta/recipes-support/vim/vim.inc              |   3 +
 scripts/lib/wic/plugins/imager/direct.py      |   6 +-
 scripts/oe-pkgdata-util                       |   3 +
 32 files changed, 673 insertions(+), 13 deletions(-)
 rename meta/recipes-connectivity/connman/{connman_1.38.bb => connman_1.39.bb} (78%)
 create mode 100644 meta/recipes-connectivity/openssh/openssh/CVE-2020-14145.patch
 create mode 100644 meta/recipes-core/systemd/systemd/0001-logind-Restore-chvt-as-non-root-user-without-polkit.patch
 create mode 100644 meta/recipes-devtools/bison/bison/0001-Use-mapped-file-name-for-symbols.patch
 create mode 100644 meta/recipes-devtools/opkg/opkg/sourcedateepoch.patch
 create mode 100644 meta/recipes-devtools/qemu/qemu/CVE-2020-29443.patch
 create mode 100644 meta/recipes-devtools/qemu/qemu/CVE-2020-35517.patch
 create mode 100644 meta/recipes-support/vim/files/racefix.patch
Signature · 1 line
2.29.2
#1 lore raw

PATCH 1/30 initrdscripts: init-install-efi.sh install extra files for ESP

From: Chee Yang Lee <[email protected]>

Currently the install script copy only few hard coded item while setting up target ESP, kernel artifacts, all .efi in EFI/BOOT, grub & boot cfg and loader.conf.
While ESP can be much complex, eg: contain multiple initrd.

Add a ESP folder to carry any other files to setup onto ESP.

(cherry picked from commit 6eaca9cf20c42501fba27dea3a6446bad948e859)
---
 meta/recipes-core/initrdscripts/files/init-install-efi.sh | 5 +++++
 1 file changed, 5 insertions(+)
meta/recipes-core/initrdscripts/files/init-install-efi.sh +5 -0
index b6855b5aac..f667518b89 100644
@@ -279,6 +279,11 @@ fi
 
 umount /tgt_root
 
+# copy any extra files needed for ESP
+if [ -d /run/media/$1/esp ]; then
+    cp -r /run/media/$1/esp/* /boot
+fi
+
 # Copy kernel artifacts. To add more artifacts just add to types
 # For now just support kernel types already being used by something in OE-core
 for types in bzImage zImage vmlinux vmlinuz fitImage; do
Signature · 1 line
2.29.2
#4 lore raw

PATCH 2/30 wic: debug mode to keep tmp directory

In reply to Anuj Mittal

From: Lee Chee Yang <[email protected]>

files in wic tmp directory can be usefull for debugging, so do not remove tmp directory when wic create run with debugging mode (-D or --debug).

also update wic.Wic.test_debug_short and wic.Wic.test_debug_long to check for tmp directory.

[YOCTO#14216]

(cherry picked from commit a122e2418b67d38f691edcf8dd846c167d6b4fa9)
---
 meta/lib/oeqa/selftest/cases/wic.py      | 2 ++
 scripts/lib/wic/plugins/imager/direct.py | 6 ++++--
 2 files changed, 6 insertions(+), 2 deletions(-)
meta/lib/oeqa/selftest/cases/wic.py +2 -0
index 9f4a9db444..df2d2d225e 100644
@@ -318,6 +318,7 @@ class Wic(WicTestCase):
                                    "--image-name=core-image-minimal "
                                    "-D -o %s" % self.resultdir)
         self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct")))
+        self.assertEqual(1, len(glob(self.resultdir + "tmp.wic*")))
 
     def test_debug_long(self):
         """Test --debug option"""
@@ -325,6 +326,7 @@ class Wic(WicTestCase):
                                    "--image-name=core-image-minimal "
                                    "--debug -o %s" % self.resultdir)
         self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct")))
+        self.assertEqual(1, len(glob(self.resultdir + "tmp.wic*")))
 
     def test_skip_build_check_short(self):
         """Test -s option"""
scripts/lib/wic/plugins/imager/direct.py +4 -2
index 7e1c1c03ab..ea709e8c54 100644
@@ -54,6 +54,7 @@ class DirectPlugin(ImagerPlugin):
         self.native_sysroot = native_sysroot
         self.oe_builddir = oe_builddir
 
+        self.debug = options.debug
         self.outdir = options.outdir
         self.compressor = options.compressor
         self.bmap = options.bmap
@@ -274,8 +275,9 @@ class DirectPlugin(ImagerPlugin):
             if os.path.isfile(path):
                 shutil.move(path, os.path.join(self.outdir, fname))
 
-        # remove work directory
-        shutil.rmtree(self.workdir, ignore_errors=True)
+        # remove work directory when it is not in debugging mode
+        if not self.debug:
+            shutil.rmtree(self.workdir, ignore_errors=True)
 
 # Overhead of the MBR partitioning scheme (just one sector)
 MBR_OVERHEAD = 1
Signature · 1 line
2.29.2
#5 lore raw

PATCH 3/30 oe-pkgdata-util: Check if environment script is initialized

In reply to Anuj Mittal

From: Dorinda <[email protected]>

Tinfoil doesn't behave well if environment is not initialized, this check ensures a proper error log if environment is not initialized.

[YOCTO #12096]

(cherry picked from commit e88073e16f1b4cfd0f97c81a988640a84adad674)
---
 scripts/oe-pkgdata-util | 3 +++
 1 file changed, 3 insertions(+)
scripts/oe-pkgdata-util +3 -0
index 93220e3617..75dd23efa3 100755
@@ -598,6 +598,9 @@ def main():
             logger.error("Unable to find bitbake by searching parent directory of this script or PATH")
             sys.exit(1)
         logger.debug('Found bitbake path: %s' % bitbakepath)
+        if not os.environ.get('BUILDDIR', ''):
+            logger.error("This script can only be run after initialising the build environment (e.g. by using oe-init-build-env)")
+            sys.exit(1)
         tinfoil = tinfoil_init()
         try:
             args.pkgdata_dir = tinfoil.config_data.getVar('PKGDATA_DIR')
Signature · 1 line
2.29.2
#6 lore raw

PATCH 4/30 pseudo: Update for rename and faccessat fixes

In reply to Anuj Mittal

From: Richard Purdie <[email protected]>

Pull in:

ports/rename/renameat: Avoid race when renaming files ports/unix: Add faccessat and faccessat2 ports/access.c: Use EACCES, not EPERM

which includes a fix for rename race issues causing pseudo aborts.

(cherry picked from commit 330c232e4f756296331f9026e91ac26fd45f0315)
---
 meta/recipes-devtools/pseudo/pseudo_git.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-devtools/pseudo/pseudo_git.bb +1 -1
index 0072e0558b..4287cfcf93 100644
@@ -6,7 +6,7 @@ SRC_URI = "git://git.yoctoproject.org/pseudo;branch=oe-core \
            file://fallback-group \
            "
 
-SRCREV = "f332f5633b5dd73fa2b6e5d605eb33e4a446d7ad"
+SRCREV = "d03de55845edf68908879db841834584d4724c43"
 S = "${WORKDIR}/git"
 PV = "1.9.0+git${SRCPV}"
 
Signature · 1 line
2.29.2
#7 lore raw

PATCH 5/30 connman: update to 1.39

In reply to Anuj Mittal

From: akuster <[email protected]>

Bug fix only and includes two security fixes:

CVE-2021-26675
CVE-2021-26676

Changelog:
- Fix issue with scanning state synchronization and iwd.
- Fix issue with invalid key with 4-way handshake offloading.
- Fix issue with DNS proxy length checks to prevent buffer overflow.
- Fix issue with DHCP leaking stack data via uninitialized variable.

[Yocto #14231]

(cherry picked from commit eb20fd47d738f469f7bbeb4b8d85040f9163722b)
---
 .../connman/{connman_1.38.bb => connman_1.39.bb}               | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
 rename meta/recipes-connectivity/connman/{connman_1.38.bb => connman_1.39.bb} (78%)
meta/recipes-connectivity/connman/connman_1.39.bb renamed from meta/recipes-connectivity/connman/connman_1.38.bb +1 -2
similarity index 78%
rename from meta/recipes-connectivity/connman/connman_1.38.bb
rename to meta/recipes-connectivity/connman/connman_1.39.bb
index 027c41e9af..df42e9ffb8 100644
@@ -9,8 +9,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/network/${BPN}/${BP}.tar.xz \
 
 SRC_URI_append_libc-musl = " file://0002-resolve-musl-does-not-implement-res_ninit.patch"
 
-SRC_URI[md5sum] = "1ed8745354c7254bdfd4def54833ee94"
-SRC_URI[sha256sum] = "cb30aca97c2f79ccaed8802aa2909ac5100a3969de74c0af8a9d73b85fc4932b"
+SRC_URI[sha256sum] = "9f62a7169b7491c670a1ff2e335b0d966308fb2f62e285c781105eb90f181af3"
 
 RRECOMMENDS_${PN} = "connman-conf"
 RCONFLICTS_${PN} = "networkmanager"
Signature · 1 line
2.29.2
#8 lore raw

PATCH 6/30 tcf-agent: Fix build on riscv32

In reply to Anuj Mittal

From: Khem Raj <[email protected]>

LCL_STOP_SERVICES needs tcf/cpudefs-mdep.h ported

(cherry picked from commit ed5e0de938469a7fa4e6cd725d9e0c8325d890d3)
---
 meta/recipes-devtools/tcf-agent/tcf-agent_git.bb | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-devtools/tcf-agent/tcf-agent_git.bb +1 -0
index ed14fe66b1..c1b05691b8 100644
@@ -48,6 +48,7 @@ CFLAGS_append_libc-musl = " ${LCL_STOP_SERVICES}"
 CFLAGS_append_powerpc64 = " ${LCL_STOP_SERVICES}"
 CFLAGS_append_powerpc64le = " ${LCL_STOP_SERVICES}"
 CFLAGS_append_riscv64 = " ${LCL_STOP_SERVICES}"
+CFLAGS_append_riscv32 = " ${LCL_STOP_SERVICES}"
 
 do_install() {
 	oe_runmake install INSTALLROOT=${D}
Signature · 1 line
2.29.2
#9 lore raw

PATCH 7/30 libomxil: Fix up commercial license flag

In reply to Anuj Mittal

From: Joshua Watt <[email protected]>

The commercial license flag on libomxil is set because it may include the Adaptive Multi-Rate audio codec (AMR) using FFmepg, which is patent encumbered.

It turns out this component is disabled by default in the recipe; add a PACKAGECONFIG to enable it and trigger the "commercial" LICENSE_FLAGS on it. This make the default build configuration clean unless a user specifically asks for AMR support, and prevents them from marking the recipe with the "commerical" flag unnecessarily which could hide potential problems later on.

(cherry picked from commit 5f61e20002c2af93e2d6810574e23606925526ee)
---
 meta/recipes-multimedia/libomxil/libomxil_0.9.3.bb | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
meta/recipes-multimedia/libomxil/libomxil_0.9.3.bb +5 -1
index 2061c280e4..82cdaf54c7 100644
@@ -4,7 +4,7 @@ DESCRIPTION = "Bellagio is an opensource implementation of the Khronos OpenMAX \
 HOMEPAGE = "http://omxil.sourceforge.net/"
 
 LICENSE = "LGPLv2.1+"
-LICENSE_FLAGS = "commercial"
+LICENSE_FLAGS = "${@bb.utils.contains('PACKAGECONFIG', 'amr', 'commercial', '', d)}"
 LIC_FILES_CHKSUM = "file://COPYING;md5=ae6f0f4dbc7ac193b50f323a6ae191cb \
                     file://src/omxcore.h;beginline=1;endline=27;md5=806b1e5566c06486fe8e42b461e03a90"
 
@@ -28,6 +28,10 @@ PROVIDES += "virtual/libomxil"
 
 CFLAGS += "-fcommon"
 
+PACKAGECONFIG ??= ""
+
+PACKAGECONFIG[amr] = "--enable-amr,,"
+
 #
 # The .so files under ${libdir}/bellagio are not intended to be versioned and symlinked.
 # Make sure they get packaged in the main package.
Signature · 1 line
2.29.2
#10 lore raw

PATCH 8/30 weston: remoting backend requires GStreamer base plugins

In reply to Anuj Mittal

From: Joshua Watt <[email protected]>

The remoting backend of weston requires the GStreamer base plugins, so add them to the PACAKGECONFIG depends list.

(cherry picked from commit 0b45994656fee7c4b7bdb5bd8571f0c61217a182)
---
 meta/recipes-graphics/wayland/weston_9.0.0.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-graphics/wayland/weston_9.0.0.bb +1 -1
index 75f9fb05fd..d60b5e1a35 100644
@@ -73,7 +73,7 @@ PACKAGECONFIG[colord] = "-Dcolor-management-colord=true,-Dcolor-management-color
 # Clients support
 PACKAGECONFIG[clients] = "-Dsimple-clients=all -Ddemo-clients=true,-Dsimple-clients= -Ddemo-clients=false"
 # Virtual remote output with GStreamer on DRM backend
-PACKAGECONFIG[remoting] = "-Dremoting=true,-Dremoting=false,gstreamer1.0"
+PACKAGECONFIG[remoting] = "-Dremoting=true,-Dremoting=false,gstreamer1.0 gstreamer1.0-plugins-base"
 # Weston with PAM support
 PACKAGECONFIG[pam] = "-Dpam=true,-Dpam=false,libpam"
 # Weston with screen-share support
Signature · 1 line
2.29.2
#11 lore raw

PATCH 9/30 pseudo: Update to include fixes for glibc 2.33

In reply to Anuj Mittal

From: Richard Purdie <[email protected]>

Pull in the changes:
makewrappers: Fix glibc 2.33 fstatat usage issues ports/linux: Add wrapper for fstatat/fstatat64 in glibc 2.33

(cherry picked from commit dfcb1c5eb2690046f96c2bb6724e091028ddc3ec)
---
 meta/recipes-devtools/pseudo/pseudo_git.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-devtools/pseudo/pseudo_git.bb +1 -1
index 4287cfcf93..17bd02c27c 100644
@@ -6,7 +6,7 @@ SRC_URI = "git://git.yoctoproject.org/pseudo;branch=oe-core \
            file://fallback-group \
            "
 
-SRCREV = "d03de55845edf68908879db841834584d4724c43"
+SRCREV = "60e25a36558f1f07dcce1a044fe976b475bec42b"
 S = "${WORKDIR}/git"
 PV = "1.9.0+git${SRCPV}"
 
Signature · 1 line
2.29.2
#12 lore raw

PATCH 10/30 qemu: fix CVE-2020-29443 CVE-2020-35517

In reply to Anuj Mittal

From: Lee Chee Yang <[email protected]>

---
 meta/recipes-devtools/qemu/qemu.inc           |   2 +
 .../qemu/qemu/CVE-2020-29443.patch            |  46 +++++++
 .../qemu/qemu/CVE-2020-35517.patch            | 126 ++++++++++++++++++
 3 files changed, 174 insertions(+)
 create mode 100644 meta/recipes-devtools/qemu/qemu/CVE-2020-29443.patch
 create mode 100644 meta/recipes-devtools/qemu/qemu/CVE-2020-35517.patch
meta/recipes-devtools/qemu/qemu.inc +2 -0
index 69b9a5f89e..97f110cde5 100644
@@ -37,6 +37,8 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
            file://CVE-2020-25624.patch \
            file://CVE-2020-25723.patch \
            file://CVE-2020-28916.patch \
+	   file://CVE-2020-35517.patch \
+	   file://CVE-2020-29443.patch \
            "
 UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar"
 
meta/recipes-devtools/qemu/qemu/CVE-2020-29443.patch new file +46 -0

46 lines not on this page · raw message

meta/recipes-devtools/qemu/qemu/CVE-2020-35517.patch new file +126 -0

126 lines not on this page · raw message

Signature · 1 line
2.29.2
#13 lore raw

PATCH 11/30 openssh: fix CVE-2020-14145

In reply to Anuj Mittal

From: Lee Chee Yang <[email protected]>

---
 .../openssh/openssh/CVE-2020-14145.patch      | 90 +++++++++++++++++++
 .../openssh/openssh_8.3p1.bb                  |  1 +
 2 files changed, 91 insertions(+)
 create mode 100644 meta/recipes-connectivity/openssh/openssh/CVE-2020-14145.patch
meta/recipes-connectivity/openssh/openssh/CVE-2020-14145.patch new file +90 -0
new file mode 100644
index 0000000000..0046ee1a51
@@ -0,0 +1,90 @@
+From b3855ff053f5078ec3d3c653cdaedefaa5fc362d Mon Sep 17 00:00:00 2001
+From: "[email protected]" <[email protected]>
+Date: Fri, 18 Sep 2020 05:23:03 +0000
+Subject: [PATCH] upstream: tweak the client hostkey preference ordering
+ algorithm to
+
+prefer the default ordering if the user has a key that matches the
+best-preference default algorithm.
+
+feedback and ok markus@
+
+OpenBSD-Commit-ID: a92dd7d7520ddd95c0a16786a7519e6d0167d35f
+
+Upstream-Status: Backport
+[https://github.com/openssh/openssh-portable/commit/b3855ff053f5078ec3d3c653cdaedefaa5fc362d]
+CVE: CVE-2020-14145
+Signed-off-by: Chee Yang Lee <[email protected]>
+
+---
+ sshconnect2.c | 41 ++++++++++++++++++++++++++++++++++++++---
+ 1 file changed, 37 insertions(+), 2 deletions(-)
+
+diff --git a/sshconnect2.c b/sshconnect2.c
+index 347e348c60..f64aae66af 100644
+--- a/sshconnect2.c
++++ b/sshconnect2.c
+@@ -102,12 +102,25 @@ verify_host_key_callback(struct sshkey *hostkey, struct ssh *ssh)
+ 	return 0;
+ }
+ 
++/* Returns the first item from a comma-separated algorithm list */
++static char *
++first_alg(const char *algs)
++{
++	char *ret, *cp;
++
++	ret = xstrdup(algs);
++	if ((cp = strchr(ret, ',')) != NULL)
++		*cp = '\0';
++	return ret;
++}
++
+ static char *
+ order_hostkeyalgs(char *host, struct sockaddr *hostaddr, u_short port)
+ {
+-	char *oavail, *avail, *first, *last, *alg, *hostname, *ret;
++	char *oavail = NULL, *avail = NULL, *first = NULL, *last = NULL;
++	char *alg = NULL, *hostname = NULL, *ret = NULL, *best = NULL;
+ 	size_t maxlen;
+-	struct hostkeys *hostkeys;
++	struct hostkeys *hostkeys = NULL;
+ 	int ktype;
+ 	u_int i;
+ 
+@@ -119,6 +132,26 @@ order_hostkeyalgs(char *host, struct sockaddr *hostaddr, u_short port)
+ 	for (i = 0; i < options.num_system_hostfiles; i++)
+ 		load_hostkeys(hostkeys, hostname, options.system_hostfiles[i]);
+ 
++	/*
++	 * If a plain public key exists that matches the type of the best
++	 * preference HostkeyAlgorithms, then use the whole list as is.
++	 * Note that we ignore whether the best preference algorithm is a
++	 * certificate type, as sshconnect.c will downgrade certs to
++	 * plain keys if necessary.
++	 */
++	best = first_alg(options.hostkeyalgorithms);
++	if (lookup_key_in_hostkeys_by_type(hostkeys,
++	    sshkey_type_plain(sshkey_type_from_name(best)), NULL)) {
++		debug3("%s: have matching best-preference key type %s, "
++		    "using HostkeyAlgorithms verbatim", __func__, best);
++		ret = xstrdup(options.hostkeyalgorithms);
++		goto out;
++	}
++
++	/*
++	 * Otherwise, prefer the host key algorithms that match known keys
++	 * while keeping the ordering of HostkeyAlgorithms as much as possible.
++	 */
+ 	oavail = avail = xstrdup(options.hostkeyalgorithms);
+ 	maxlen = strlen(avail) + 1;
+ 	first = xmalloc(maxlen);
+@@ -159,6 +192,8 @@ order_hostkeyalgs(char *host, struct sockaddr *hostaddr, u_short port)
+ 	if (*first != '\0')
+ 		debug3("%s: prefer hostkeyalgs: %s", __func__, first);
+ 
++ out:
++	free(best);
+ 	free(first);
+ 	free(last);
+ 	free(hostname);
meta/recipes-connectivity/openssh/openssh_8.3p1.bb +1 -0
index 3061ed2975..a1e34a9379 100644
@@ -25,6 +25,7 @@ SRC_URI = "http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar
            file://sshd_check_keys \
            file://add-test-support-for-busybox.patch \
            file://0f90440ca70abab947acbd77795e9f130967956c.patch \
+           file://CVE-2020-14145.patch \
            "
 SRC_URI[sha256sum] = "f2befbe0472fe7eb75d23340eb17531cb6b3aac24075e2066b41f814e12387b2"
 
Signature · 1 line
2.29.2
#14 lore raw

PATCH 12/30 opkg: Fix build reproducibility issue

In reply to Anuj Mittal

From: Richard Purdie <[email protected]>

A build date was leaking into the generated docs and makefile used for ptests leading to reproducibility issues each time the month changed.

Add a patch to use SOURCE_DATE_EPOCH to derive it if available.

(cherry picked from commit 6a9ca7aec4991eabd425e32fdf85f51bb1686b8b)
---
 .../opkg/opkg/sourcedateepoch.patch           | 25 +++++++++++++++++++
 meta/recipes-devtools/opkg/opkg_0.4.3.bb      |  1 +
 2 files changed, 26 insertions(+)
 create mode 100644 meta/recipes-devtools/opkg/opkg/sourcedateepoch.patch
meta/recipes-devtools/opkg/opkg/sourcedateepoch.patch new file +25 -0
new file mode 100644
index 0000000000..285d258c63
@@ -0,0 +1,25 @@
+Having CLEAN_DATE come from the current date doesn't allow for build
+reproducibility. Add the option of using SOURCE_DATE_EPOCH if set
+which for OE, it will be.
+
+Upstream-Status: Pending
+RP 2021/2/2
+
+Index: opkg-0.4.4/configure.ac
+===================================================================
+--- opkg-0.4.4.orig/configure.ac
++++ opkg-0.4.4/configure.ac
+@@ -281,7 +281,12 @@ AC_FUNC_UTIME_NULL
+ AC_FUNC_VPRINTF
+ AC_CHECK_FUNCS([memmove memset mkdir regcomp strchr strcspn strdup strerror strndup strrchr strstr strtol strtoul sysinfo utime])
+ 
+-CLEAN_DATE=`date +"%B %Y" | tr -d '\n'`
++1607446883
++if [ ! -z "$SOURCE_DATE_EPOCH" ]; then
++    CLEAN_DATE=`LC_ALL=C date -d @$SOURCE_DATE_EPOCH +"%B %Y" | tr -d '\n'`
++else
++    CLEAN_DATE=`date +"%B %Y" | tr -d '\n'`
++fi
+ 
+ AC_SUBST([CLEAN_DATE])
+ 
meta/recipes-devtools/opkg/opkg_0.4.3.bb +1 -0
index 46b7aa2523..ea01d473fc 100644
@@ -14,6 +14,7 @@ PE = "1"
 SRC_URI = "http://downloads.yoctoproject.org/releases/${BPN}/${BPN}-${PV}.tar.gz \
            file://opkg.conf \
            file://0001-opkg_conf-create-opkg.lock-in-run-instead-of-var-run.patch \
+           file://sourcedateepoch.patch \
            file://run-ptest \
 "
 
Signature · 1 line
2.29.2
#15 lore raw

PATCH 13/30 opkg: Fix patch glitches

In reply to Anuj Mittal

From: Richard Purdie <[email protected]>

The original patch contained some text which shouldn't have been there and used brackets in configure which isn't a great idea. Tweak the patch to resolve this.

(cherry picked from commit 63cbf187fe189c99645fe3afee8a6361a9a32cdc)
---
 meta/recipes-devtools/opkg/opkg/sourcedateepoch.patch | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
meta/recipes-devtools/opkg/opkg/sourcedateepoch.patch +2 -3
index 285d258c63..4578fa33be 100644
@@ -9,13 +9,12 @@ Index: opkg-0.4.4/configure.ac
 ===================================================================
 --- opkg-0.4.4.orig/configure.ac
 +++ opkg-0.4.4/configure.ac
-@@ -281,7 +281,12 @@ AC_FUNC_UTIME_NULL
+@@ -281,7 +281,11 @@ AC_FUNC_UTIME_NULL
  AC_FUNC_VPRINTF
  AC_CHECK_FUNCS([memmove memset mkdir regcomp strchr strcspn strdup strerror strndup strrchr strstr strtol strtoul sysinfo utime])
  
 -CLEAN_DATE=`date +"%B %Y" | tr -d '\n'`
-+1607446883
-+if [ ! -z "$SOURCE_DATE_EPOCH" ]; then
++if ! test -z "$SOURCE_DATE_EPOCH" ; then
 +    CLEAN_DATE=`LC_ALL=C date -d @$SOURCE_DATE_EPOCH +"%B %Y" | tr -d '\n'`
 +else
 +    CLEAN_DATE=`date +"%B %Y" | tr -d '\n'`
Signature · 1 line
2.29.2
#16 lore raw

PATCH 14/30 cwautomacros: Ensure version is set deterministically

In reply to Anuj Mittal

From: Richard Purdie <[email protected]>

The makefile injects the current date into the version file. Do this deterministically with SOURCE_DATE_EPOCH.

(cherry picked from commit 31f2ad739ea776a1e11b5cef5434df188007c7bf)
---
 meta/recipes-extended/cwautomacros/cwautomacros_20110201.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-extended/cwautomacros/cwautomacros_20110201.bb +1 -1
index 65a99fc28d..02b016fdf1 100644
@@ -13,7 +13,7 @@ do_configure() {
 }
 
 do_install() {
-	oe_runmake CWAUTOMACROSPREFIX=${D}${prefix} install
+	oe_runmake LABEL=`date -d @${SOURCE_DATE_EPOCH} +%Y%m%d` CWAUTOMACROSPREFIX=${D}${prefix} install
 
 	# cleanup buildpaths in autogen.sh
 	sed -i -e 's,${D},,g' ${D}${prefix}/share/cwautomacros/scripts/autogen.sh
Signature · 1 line
2.29.2
#17 lore raw

PATCH 15/30 weston-init: Fix weston-keyboard path in weston.ini

In reply to Anuj Mittal

From: Marek Vasut <[email protected]>

The weston-keyboard executable is installed into /usr/libexec instead of /usr/lib/weston , correct the path in weston.ini .

Cc Khem Raj <[email protected]>
Cc Richard Purdie <[email protected]>
(cherry picked from commit 56dee47a5ddb1da66d30f894a282d0658dcc930c)
---
 meta/recipes-graphics/wayland/weston-init/weston.ini | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-graphics/wayland/weston-init/weston.ini +1 -1
index b48726d59c..6bd5aef55a 100644
@@ -42,7 +42,7 @@ require-input=false
 #path=/build/weston-0lEgCh/weston-1.11.0/weston-flower
 
 #[input-method]
-#path=/usr/lib/weston/weston-keyboard
+#path=/usr/libexec/weston-keyboard
 
 #[output]
 #name=LVDS1
Signature · 1 line
2.29.2
#18 lore raw

PATCH 16/30 vim: Improve determinism

In reply to Anuj Mittal

From: Richard Purdie <[email protected]>

Add a couple of configure options to avoid determism issues in the vim build. This can happen due to the addition of glib-2.0 to the native sysroot through later task additions to the sysroot through indirect dependencies.

(cherry picked from commit 914f86054f5ea0a115767c1b3d9cdb4c4ef9545b)
---
 meta/recipes-support/vim/vim.inc | 2 ++
 1 file changed, 2 insertions(+)
meta/recipes-support/vim/vim.inc +2 -0
index 4d2886c19e..1ea40e5e7f 100644
@@ -68,8 +68,10 @@ EXTRA_OECONF = " \
     --disable-gtktest \
     --disable-xim \
     --disable-netbeans \
+    --disable-desktop-database-update \
     --with-tlib=ncurses \
     ac_cv_small_wchar_t=no \
+    ac_cv_path_GLIB_COMPILE_RESOURCES=no \
     vim_cv_getcwd_broken=no \
     vim_cv_memmove_handles_overlap=yes \
     vim_cv_stat_ignores_slash=no \
Signature · 1 line
2.29.2
#19 lore raw

PATCH 17/30 vim: Fix a race over creation of the desktop files

In reply to Anuj Mittal

From: Richard Purdie <[email protected]>

The LINGUAS file can be written by two different Makefile targets and if they race, the desktop file contents isn't deterministic.

Fix the makfile to avoid this.

(cherry picked from commit 416bc7b697764075fbf73683cd8bddf36d839244)
---
 meta/recipes-support/vim/files/racefix.patch | 33 ++++++++++++++++++++
 meta/recipes-support/vim/vim.inc             |  1 +
 2 files changed, 34 insertions(+)
 create mode 100644 meta/recipes-support/vim/files/racefix.patch
meta/recipes-support/vim/files/racefix.patch new file +33 -0
new file mode 100644
index 0000000000..48dca44cad
@@ -0,0 +1,33 @@
+The creation of the LINGUAS file is duplicated for each desktop file
+which can lead the commands to race against each other. Rework
+the makefile to avoid this as the expense of leaving the file on disk.
+
+Upstream-Status: Pending
+RP 2021/2/15
+
+Index: git/src/po/Makefile
+===================================================================
+--- git.orig/src/po/Makefile
++++ git/src/po/Makefile
+@@ -165,17 +165,16 @@ $(PACKAGE).pot: ../*.c ../if_perl.xs ../
+ 		po/gvim.desktop.in po/vim.desktop.in
+ 	mv -f ../$(PACKAGE).po $(PACKAGE).pot
+ 
+-vim.desktop: vim.desktop.in $(POFILES)
++LINGUAS:
+ 	echo $(LANGUAGES) | tr " " "\n" |sed -e '/\./d' | sort > LINGUAS
++
++vim.desktop: vim.desktop.in $(POFILES) LINGUAS
+ 	$(MSGFMT) --desktop -d . --template vim.desktop.in -o tmp_vim.desktop
+-	rm -f LINGUAS
+ 	if command -v desktop-file-validate; then desktop-file-validate tmp_vim.desktop; fi
+ 	mv tmp_vim.desktop vim.desktop
+ 
+-gvim.desktop: gvim.desktop.in $(POFILES)
+-	echo $(LANGUAGES) | tr " " "\n" |sed -e '/\./d' | sort > LINGUAS
++gvim.desktop: gvim.desktop.in $(POFILES) LINGUAS
+ 	$(MSGFMT) --desktop -d . --template gvim.desktop.in -o tmp_gvim.desktop
+-	rm -f LINGUAS
+ 	if command -v desktop-file-validate; then desktop-file-validate tmp_gvim.desktop; fi
+ 	mv tmp_gvim.desktop gvim.desktop
+ 
meta/recipes-support/vim/vim.inc +1 -0
index 1ea40e5e7f..d57f784da5 100644
@@ -12,6 +12,7 @@ SRC_URI = "git://github.com/vim/vim.git \
            file://vim-add-knob-whether-elf.h-are-checked.patch \
            file://0001-src-Makefile-improve-reproducibility.patch \
            file://no-path-adjust.patch \
+           file://racefix.patch \
 "
 SRCREV = "98056533b96b6b5d8849641de93185dd7bcadc44"
 
Signature · 1 line
2.29.2
#20 lore raw

PATCH 18/30 deb: export INTERCEPT_DIR for remove actions

In reply to Anuj Mittal

From: Richard Leitner <[email protected]>

During the do_populate_sdk task apt-get purge is called by deb's remove function. This fails with error messages similiar to the following one if any of the included packages uses intercepts as the INTERCEPT_DIR isn't exported:

.../*.postinst: line 4: /postinst_intercept: No such file or directory

Therefore fix it by exporting the INTERCEPT_DIR variable within the remove function.

(cherry picked from commit f18adf53dd4bf5dd3adef82b2dcc34a6cdfd0c89)
---
 meta/lib/oe/package_manager/deb/__init__.py | 2 ++
 1 file changed, 2 insertions(+)
meta/lib/oe/package_manager/deb/__init__.py +2 -0
index 26157f591a..5120920e70 100644
@@ -312,6 +312,8 @@ class DpkgPM(OpkgDpkgPM):
         if not pkgs:
             return
 
+        os.environ['INTERCEPT_DIR'] = self.intercepts_dir
+
         if with_dependencies:
             os.environ['APT_CONFIG'] = self.apt_conf_file
             cmd = "%s purge %s" % (self.apt_get_cmd, ' '.join(pkgs))
Signature · 1 line
2.29.2
#21 lore raw

PATCH 19/30 package_manager/deb: Fix image generation with package removal

In reply to Anuj Mittal

From: Richard Purdie <[email protected]>

When building SDKs with the deb backend you could see errors like:

Setting up nativesdk-python3-ndg-httpsclient (0.5.1-r0) ...
mkdir: cannot create directory ‘/usr/lib/opkg’: Permission denied
dpkg: error processing package nativesdk-python3-ndg-httpsclient (--configure):

which is due to environment misconfiguration when removing packages.

Fix this by setting the same environment variables as used for installation.

(cherry picked from commit f23c7e319a192ada14bb9a82822ef2967309aaea)
---
 meta/lib/oe/package_manager/deb/__init__.py | 4 ++++
 1 file changed, 4 insertions(+)
meta/lib/oe/package_manager/deb/__init__.py +4 -0
index 5120920e70..0f9b27f831 100644
@@ -312,6 +312,10 @@ class DpkgPM(OpkgDpkgPM):
         if not pkgs:
             return
 
+        os.environ['D'] = self.target_rootfs
+        os.environ['OFFLINE_ROOT'] = self.target_rootfs
+        os.environ['IPKG_OFFLINE_ROOT'] = self.target_rootfs
+        os.environ['OPKG_OFFLINE_ROOT'] = self.target_rootfs
         os.environ['INTERCEPT_DIR'] = self.intercepts_dir
 
         if with_dependencies:
Signature · 1 line
2.29.2
#22 lore raw

PATCH 20/30 quilt: Be determnistic about column presence

In reply to Anuj Mittal

From: Richard Purdie <[email protected]>

I've seen local differences in the quilt output depending on whether the column binary was available in the sysroot. Fix determinism issues by being specific about configuration.

(cherry picked from commit 0cd5fba8634bcc679518f98cc25be66a51081372)
---
 meta/recipes-devtools/quilt/quilt.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-devtools/quilt/quilt.inc +1 -1
index d6d06c049c..d7ecda7aaa 100644
@@ -30,7 +30,7 @@ EXTRA_OECONF = "--with-perl='${USRBINPATH}/env perl' --with-patch=patch"
 EXTRA_OECONF_append_class-native = " --disable-nls"
 EXTRA_AUTORECONF += "--exclude=aclocal"
 
-CACHED_CONFIGUREVARS += "ac_cv_path_BASH=/bin/bash"
+CACHED_CONFIGUREVARS += "ac_cv_path_BASH=/bin/bash ac_cv_path_COLUMN=column"
 
 # Make sure we don't have "-w" in shebang lines: it breaks using
 # "/usr/bin/env perl" as parser
Signature · 1 line
2.29.2
#23 lore raw

PATCH 21/30 buildtools-extended-tarball: Add glibc-gconvs needed for build

In reply to Anuj Mittal

From: Richard Purdie <[email protected]>

When building vim it tries to rebuild files using iconv. If this fails the build continues anyway but the output is not determnistic as builds using a hosttools tarball are different from builds where there isn't a hosttools tarball. Add the needed gconvs to the tarball when iconv is present to become determistic and generate vim locales consistently.

(cherry picked from commit b945652a088f430a2adec6b968cd00c5928d4272)
---
 meta/recipes-core/meta/buildtools-extended-tarball.bb | 10 ++++++++++
 1 file changed, 10 insertions(+)
meta/recipes-core/meta/buildtools-extended-tarball.bb +10 -0
index 0816486754..83e3fddccc 100644
@@ -28,11 +28,21 @@ TOOLCHAIN_HOST_TASK += "\
     nativesdk-libtool \
     nativesdk-pkgconfig \
     nativesdk-glibc-utils \
+    nativesdk-glibc-gconv-ibm850 \
+    nativesdk-glibc-gconv-iso8859-1 \
+    nativesdk-glibc-gconv-utf-16 \
+    nativesdk-glibc-gconv-cp1250 \
+    nativesdk-glibc-gconv-cp1251 \
+    nativesdk-glibc-gconv-cp1252 \
+    nativesdk-glibc-gconv-euc-jp \
+    nativesdk-glibc-gconv-libjis \
     nativesdk-libxcrypt-dev \
     nativesdk-parted \
     nativesdk-dosfstools \
     nativesdk-gptfdisk \
     "
+# gconv-cp1250, cp1251 and euc-jp needed for iconv to work in vim builds
+# also copied list from uninative
 
 TOOLCHAIN_OUTPUTNAME = "${SDK_ARCH}-buildtools-extended-nativesdk-standalone-${DISTRO_VERSION}"
 
Signature · 1 line
2.29.2
#24 lore raw

PATCH 22/30 oeqa: reproducible: Fix SSTATE_MIRRORS variable

In reply to Anuj Mittal

From: Joshua Watt <[email protected]>

The SSTATE_MIRRORS variable was misspelled, which allowed the "clean" test build to pull from the mirror.

(cherry picked from commit e42497bd84d0bb370a9f7b0448bff29f01fd1b0c)
---
 meta/lib/oeqa/selftest/cases/reproducible.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/lib/oeqa/selftest/cases/reproducible.py +1 -1
index a7ef336143..2d675f1771 100644
@@ -184,7 +184,7 @@ class ReproducibleTests(OESelftestTestCase):
             # mirror, forcing a complete build from scratch
             config += textwrap.dedent('''\
                 SSTATE_DIR = "${TMPDIR}/sstate"
-                SSTATE_MIRROR = ""
+                SSTATE_MIRRORS = ""
                 ''')
 
         self.write_config(config)
Signature · 1 line
2.29.2
#25 lore raw

PATCH 23/30 oeqa: reproducible: Add more logging

In reply to Anuj Mittal

From: Joshua Watt <[email protected]>

The reproducible build tests can take a long time, so having more logging messages at various points in the build can help debug where the build is taking a long time.

(cherry picked from commit 6b792afe8759d62af8e713b86dad8f6721961a05)
---
 meta/lib/oeqa/selftest/cases/reproducible.py | 3 +++
 1 file changed, 3 insertions(+)
meta/lib/oeqa/selftest/cases/reproducible.py +3 -0
index 2d675f1771..4f9adaf301 100644
@@ -187,6 +187,7 @@ class ReproducibleTests(OESelftestTestCase):
                 SSTATE_MIRRORS = ""
                 ''')
 
+        self.logger.info("Building %s (sstate%s allowed)..." % (name, '' if use_sstate else ' NOT'))
         self.write_config(config)
         d = get_bb_vars(capture_vars)
         bitbake(' '.join(self.images))
@@ -213,6 +214,7 @@ class ReproducibleTests(OESelftestTestCase):
             self.logger.info('Non-reproducible packages will be copied to %s', save_dir)
 
         vars_A = self.do_test_build('reproducibleA', self.build_from_sstate)
+
         vars_B = self.do_test_build('reproducibleB', False)
 
         # NOTE: The temp directories from the reproducible build are purposely
@@ -227,6 +229,7 @@ class ReproducibleTests(OESelftestTestCase):
                 deploy_A = vars_A['DEPLOY_DIR_' + c.upper()]
                 deploy_B = vars_B['DEPLOY_DIR_' + c.upper()]
 
+                self.logger.info('Checking %s packages for differences...' % c)
                 result = self.compare_packages(deploy_A, deploy_B, diffutils_sysroot)
 
                 self.logger.info('Reproducibility summary for %s: %s' % (c, result))
Signature · 1 line
2.29.2
#26 lore raw

PATCH 24/30 watchdog: Fix determinism issue from sendmail host path

In reply to Anuj Mittal

From: Richard Purdie <[email protected]>

The build was injecting the path of the host's sendmail binary. Set this deterministically to match OE's path for it.

(cherry picked from commit 476328b91ea4417160580d28df4fcc1147d85ae2)
---
 meta/recipes-extended/watchdog/watchdog_5.16.bb | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-extended/watchdog/watchdog_5.16.bb +1 -0
index 1988952603..24a05dcda7 100644
@@ -28,6 +28,7 @@ CFLAGS += "-I${STAGING_INCDIR}/tirpc"
 LDFLAGS += "-ltirpc"
 
 EXTRA_OECONF += " --disable-nfs "
+CACHED_CONFIGUREVARS += "ac_cv_path_PATH_SENDMAIL=${sbindir}/sendmail"
 
 INITSCRIPT_PACKAGES = "${PN} ${PN}-keepalive"
 
Signature · 1 line
2.29.2
#27 lore raw

PATCH 25/30 watchdog: Avoid reproducibility failures after fixing build

In reply to Anuj Mittal

From: Richard Purdie <[email protected]>

Add some temporary bumps to versions to change the output hash so the fix applies correctly. Can be dropped next time we update the recipe and the output changes.

(cherry picked from commit 69205edcdff865048e55a6b7feaf82064ebc10c5)
---
 meta/recipes-extended/watchdog/watchdog_5.16.bb | 5 +++++
 1 file changed, 5 insertions(+)
meta/recipes-extended/watchdog/watchdog_5.16.bb +5 -0
index 24a05dcda7..a44a459c20 100644
@@ -18,6 +18,11 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/watchdog/watchdog-${PV}.tar.gz \
 SRC_URI[md5sum] = "1b4f51cabc64d1bee2fce7cdd626831f"
 SRC_URI[sha256sum] = "b8e7c070e1b72aee2663bdc13b5cc39f76c9232669cfbb1ac0adc7275a3b019d"
 
+# Can be dropped when the output next changes, avoids failures after
+# reproducibility issues
+PR = "r1"
+HASHEQUIV_HASH_VERSION .= ".1"
+
 UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/watchdog/files/watchdog/"
 UPSTREAM_CHECK_REGEX = "/watchdog/(?P<pver>(\d+[\.\-_]*)+)/"
 
Signature · 1 line
2.29.2
#28 lore raw

PATCH 26/30 xmlto: Fix reproducibility

In reply to Anuj Mittal

From: Richard Purdie <[email protected]>

Don't hardcode the host's grep path into xmlto.

(cherry picked from commit a7d78971df193c321c309481749fc30cae77788c)
---
 meta/recipes-devtools/xmlto/xmlto_0.0.28.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-devtools/xmlto/xmlto_0.0.28.bb +1 -1
index 7d27c43c83..5ed2709e31 100644
@@ -29,7 +29,7 @@ RDEPENDS_${PN}_append_class-target = " \
                   libxslt-bin \
                   coreutils \
 "
-CACHED_CONFIGUREVARS += "ac_cv_path_TAIL=tail"
+CACHED_CONFIGUREVARS += "ac_cv_path_TAIL=tail ac_cv_path_GREP=grep"
 
 BBCLASSEXTEND = "native"
 
Signature · 1 line
2.29.2
#29 lore raw

PATCH 27/30 local.conf.sample.extended: fix double 'of' typo

In reply to Anuj Mittal

From: Vivien Didelot <[email protected]>

Remove the redundant 'of' word in the INITRAMFS_IMAGE comment.

(cherry picked from commit de9544f4654510ac33821b7f170de3074205a221)
---
 meta/conf/local.conf.sample.extended | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/conf/local.conf.sample.extended +1 -1
index 420b09b7d7..411717b615 100644
@@ -331,7 +331,7 @@
 # The INITRAMFS_IMAGE image variable will cause an additional recipe to
 # be built as a dependency to the what ever rootfs recipe you might be
 # using such as core-image-sato.  The initramfs might be needed for
-# the initial boot of of the target system such as to load kernel
+# the initial boot of the target system such as to load kernel
 # modules prior to mounting the root file system.
 #
 # INITRAMFS_IMAGE_BUNDLE variable controls if the image recipe
Signature · 1 line
2.29.2
#30 lore raw

PATCH 28/30 systemd: Re-enable chvt as non-root user without polkit

In reply to Anuj Mittal

From: Joshua Watt <[email protected]>

systemd 245 introduced a regression in behavior where they removed support for non-root users to chvt from a service file. This prevents running compositors (e.g. weston) as any user other than root. The intention is for polkit to be used to allow this (and in fact the default polkit rules that ship with systemd allow this). However, polkit is a huge dependency to bring in for an embedded system, and isn't support by OE-core.

The patch has been proposed upstream to restore the previous behavior of allowing a non-root user to chvt to unbreak the regression without requiring polkit.

Upstream-Status: Submitted [https://github.com/systemd/systemd/pull/17494]

(cherry picked from commit ef8cf581b680f8b8ee35d50c75891b4fd8b91f2f)
---
 ...chvt-as-non-root-user-without-polkit.patch | 227 ++++++++++++++++++
 meta/recipes-core/systemd/systemd_246.9.bb    |   1 +
 2 files changed, 228 insertions(+)
 create mode 100644 meta/recipes-core/systemd/systemd/0001-logind-Restore-chvt-as-non-root-user-without-polkit.patch
meta/recipes-core/systemd/systemd/0001-logind-Restore-chvt-as-non-root-user-without-polkit.patch new file +227 -0
new file mode 100644
index 0000000000..89ef39bc3e
@@ -0,0 +1,227 @@
+From 150d9cade6d475570395cb418b824524dead9577 Mon Sep 17 00:00:00 2001
+From: Joshua Watt <[email protected]>
+Date: Fri, 30 Oct 2020 08:15:43 -0500
+Subject: [PATCH] logind: Restore chvt as non-root user without polkit
+
+4acf0cfd2f ("logind: check PolicyKit before allowing VT switch") broke
+the ability to write user sessions that run graphical sessions (e.g.
+weston/X11). This was partially amended in 19bb87fbfa ("login: allow
+non-console sessions to change vt") by changing the default PolicyKit
+policy so that non-root users are again allowed to switch the VT. This
+makes the policy when PolKit is not enabled (as on many embedded
+systems) match the default PolKit policy and allows launching graphical
+sessions as a non-root user.
+
+Closes #17473
+---
+ src/login/logind-dbus.c         | 11 ++-------
+ src/login/logind-polkit.c       | 26 +++++++++++++++++++++
+ src/login/logind-polkit.h       | 10 ++++++++
+ src/login/logind-seat-dbus.c    | 41 ++++-----------------------------
+ src/login/logind-session-dbus.c | 11 ++-------
+ src/login/meson.build           |  1 +
+ 6 files changed, 46 insertions(+), 54 deletions(-)
+ create mode 100644 src/login/logind-polkit.c
+ create mode 100644 src/login/logind-polkit.h
+
+diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
+index 0f83ed99bc..a3765d88ba 100644
+--- a/src/login/logind-dbus.c
++++ b/src/login/logind-dbus.c
+@@ -30,6 +30,7 @@
+ #include "format-util.h"
+ #include "fs-util.h"
+ #include "logind-dbus.h"
++#include "logind-polkit.h"
+ #include "logind-seat-dbus.h"
+ #include "logind-session-dbus.h"
+ #include "logind-user-dbus.h"
+@@ -1047,15 +1048,7 @@ static int method_activate_session_on_seat(sd_bus_message *message, void *userda
+                 return sd_bus_error_setf(error, BUS_ERROR_SESSION_NOT_ON_SEAT,
+                                          "Session %s not on seat %s", session_name, seat_name);
+ 
+-        r = bus_verify_polkit_async(
+-                        message,
+-                        CAP_SYS_ADMIN,
+-                        "org.freedesktop.login1.chvt",
+-                        NULL,
+-                        false,
+-                        UID_INVALID,
+-                        &m->polkit_registry,
+-                        error);
++        r = check_polkit_chvt(message, m, error);
+         if (r < 0)
+                 return r;
+         if (r == 0)
+diff --git a/src/login/logind-polkit.c b/src/login/logind-polkit.c
+new file mode 100644
+index 0000000000..9072570cc6
+--- /dev/null
++++ b/src/login/logind-polkit.c
+@@ -0,0 +1,26 @@
++/* SPDX-License-Identifier: LGPL-2.1+ */
++
++#include "bus-polkit.h"
++#include "logind-polkit.h"
++#include "missing_capability.h"
++#include "user-util.h"
++
++int check_polkit_chvt(sd_bus_message *message, Manager *manager, sd_bus_error *error) {
++#if ENABLE_POLKIT
++        return bus_verify_polkit_async(
++                        message,
++                        CAP_SYS_ADMIN,
++                        "org.freedesktop.login1.chvt",
++                        NULL,
++                        false,
++                        UID_INVALID,
++                        &manager->polkit_registry,
++                        error);
++#else
++        /* Allow chvt when polkit is not present. This allows a service to start a graphical session as a
++         * non-root user when polkit is not compiled in, matching the default polkit policy */
++        return 1;
++#endif
++}
++
++
+diff --git a/src/login/logind-polkit.h b/src/login/logind-polkit.h
+new file mode 100644
+index 0000000000..476c077a8a
+--- /dev/null
++++ b/src/login/logind-polkit.h
+@@ -0,0 +1,10 @@
++/* SPDX-License-Identifier: LGPL-2.1+ */
++#pragma once
++
++#include "sd-bus.h"
++
++#include "bus-object.h"
++#include "logind.h"
++
++int check_polkit_chvt(sd_bus_message *message, Manager *manager, sd_bus_error *error);
++
+diff --git a/src/login/logind-seat-dbus.c b/src/login/logind-seat-dbus.c
+index a945132284..f22e9e2734 100644
+--- a/src/login/logind-seat-dbus.c
++++ b/src/login/logind-seat-dbus.c
+@@ -9,6 +9,7 @@
+ #include "bus-polkit.h"
+ #include "bus-util.h"
+ #include "logind-dbus.h"
++#include "logind-polkit.h"
+ #include "logind-seat-dbus.h"
+ #include "logind-seat.h"
+ #include "logind-session-dbus.h"
+@@ -179,15 +180,7 @@ static int method_activate_session(sd_bus_message *message, void *userdata, sd_b
+         if (session->seat != s)
+                 return sd_bus_error_setf(error, BUS_ERROR_SESSION_NOT_ON_SEAT, "Session %s not on seat %s", name, s->id);
+ 
+-        r = bus_verify_polkit_async(
+-                        message,
+-                        CAP_SYS_ADMIN,
+-                        "org.freedesktop.login1.chvt",
+-                        NULL,
+-                        false,
+-                        UID_INVALID,
+-                        &s->manager->polkit_registry,
+-                        error);
++        r = check_polkit_chvt(message, s->manager, error);
+         if (r < 0)
+                 return r;
+         if (r == 0)
+@@ -215,15 +208,7 @@ static int method_switch_to(sd_bus_message *message, void *userdata, sd_bus_erro
+         if (to <= 0)
+                 return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid virtual terminal");
+ 
+-        r = bus_verify_polkit_async(
+-                        message,
+-                        CAP_SYS_ADMIN,
+-                        "org.freedesktop.login1.chvt",
+-                        NULL,
+-                        false,
+-                        UID_INVALID,
+-                        &s->manager->polkit_registry,
+-                        error);
++        r = check_polkit_chvt(message, s->manager, error);
+         if (r < 0)
+                 return r;
+         if (r == 0)
+@@ -243,15 +228,7 @@ static int method_switch_to_next(sd_bus_message *message, void *userdata, sd_bus
+         assert(message);
+         assert(s);
+ 
+-        r = bus_verify_polkit_async(
+-                        message,
+-                        CAP_SYS_ADMIN,
+-                        "org.freedesktop.login1.chvt",
+-                        NULL,
+-                        false,
+-                        UID_INVALID,
+-                        &s->manager->polkit_registry,
+-                        error);
++        r = check_polkit_chvt(message, s->manager, error);
+         if (r < 0)
+                 return r;
+         if (r == 0)
+@@ -271,15 +248,7 @@ static int method_switch_to_previous(sd_bus_message *message, void *userdata, sd
+         assert(message);
+         assert(s);
+ 
+-        r = bus_verify_polkit_async(
+-                        message,
+-                        CAP_SYS_ADMIN,
+-                        "org.freedesktop.login1.chvt",
+-                        NULL,
+-                        false,
+-                        UID_INVALID,
+-                        &s->manager->polkit_registry,
+-                        error);
++        r = check_polkit_chvt(message, s->manager, error);
+         if (r < 0)
+                 return r;
+         if (r == 0)
+diff --git a/src/login/logind-session-dbus.c b/src/login/logind-session-dbus.c
+index ccc5ac8df2..57c8a4e900 100644
+--- a/src/login/logind-session-dbus.c
++++ b/src/login/logind-session-dbus.c
+@@ -11,6 +11,7 @@
+ #include "fd-util.h"
+ #include "logind-brightness.h"
+ #include "logind-dbus.h"
++#include "logind-polkit.h"
+ #include "logind-seat-dbus.h"
+ #include "logind-session-dbus.h"
+ #include "logind-session-device.h"
+@@ -192,15 +193,7 @@ int bus_session_method_activate(sd_bus_message *message, void *userdata, sd_bus_
+         assert(message);
+         assert(s);
+ 
+-        r = bus_verify_polkit_async(
+-                        message,
+-                        CAP_SYS_ADMIN,
+-                        "org.freedesktop.login1.chvt",
+-                        NULL,
+-                        false,
+-                        UID_INVALID,
+-                        &s->manager->polkit_registry,
+-                        error);
++        r = check_polkit_chvt(message, s->manager, error);
+         if (r < 0)
+                 return r;
+         if (r == 0)
+diff --git a/src/login/meson.build b/src/login/meson.build
+index 0a7d3d5440..7e46be2add 100644
+--- a/src/login/meson.build
++++ b/src/login/meson.build
+@@ -26,6 +26,7 @@ liblogind_core_sources = files('''
+         logind-device.h
+         logind-inhibit.c
+         logind-inhibit.h
++        logind-polkit.c
+         logind-seat-dbus.c
+         logind-seat-dbus.h
+         logind-seat.c
+-- 
+2.28.0
+
meta/recipes-core/systemd/systemd_246.9.bb +1 -0
index 2f460e9bee..daee795cc2 100644
@@ -21,6 +21,7 @@ SRC_URI += "file://touchscreen.rules \
            file://0001-binfmt-Don-t-install-dependency-links-at-install-tim.patch \
            file://0003-implment-systemd-sysv-install-for-OE.patch \
            file://0001-systemd.pc.in-use-ROOTPREFIX-without-suffixed-slash.patch \
+           file://0001-logind-Restore-chvt-as-non-root-user-without-polkit.patch \
            "
 
 # patches needed by musl
Signature · 1 line
2.29.2
#31 lore raw

PATCH 29/30 bison: Fix up file name mapping

In reply to Anuj Mittal

From: Joshua Watt <[email protected]>

File name mapping was added to bison, but needs to be applied in more cases. Add a patch to enable file name mapping for symbols

(cherry picked from commit 5a213506377b0db4e88ca094215eadf08c21a2e1)
---
 ...001-Use-mapped-file-name-for-symbols.patch | 62 +++++++++++++++++++
 meta/recipes-devtools/bison/bison_3.7.2.bb    |  1 +
 2 files changed, 63 insertions(+)
 create mode 100644 meta/recipes-devtools/bison/bison/0001-Use-mapped-file-name-for-symbols.patch
meta/recipes-devtools/bison/bison/0001-Use-mapped-file-name-for-symbols.patch new file +62 -0
new file mode 100644
index 0000000000..568ee4df19
@@ -0,0 +1,62 @@
+From 2a3db4e3b8d33bad5577c2fcfe124ee7a202ef4f Mon Sep 17 00:00:00 2001
+From: Joshua Watt <[email protected]>
+Date: Mon, 15 Feb 2021 20:39:57 -0600
+Subject: [PATCH] Use mapped file name for symbols
+
+Applies the file name mapping before exporting it as a symbol. This
+allows the symbols to correctly respect the --file-prefix-map command
+line option.
+
+Signed-off-by: Joshua Watt <[email protected]>
+Upstream-Status: Submitted [https://lists.gnu.org/archive/html/bison-patches/2021-02/msg00014.html]
+---
+ src/muscle-tab.c | 4 +++-
+ src/output.c     | 8 ++++++--
+ 2 files changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/src/muscle-tab.c b/src/muscle-tab.c
+index b610d0b8..3e7657ca 100644
+--- a/src/muscle-tab.c
++++ b/src/muscle-tab.c
+@@ -204,8 +204,10 @@ static void
+ muscle_syncline_grow (char const *key, location loc)
+ {
+   obstack_printf (&muscle_obstack, "]b4_syncline(%d, ", loc.start.line);
++  char *f = map_file_name (loc.start.file);
+   obstack_quote (&muscle_obstack,
+-                 quotearg_style (c_quoting_style, loc.start.file));
++                 quotearg_style (c_quoting_style, f));
++  free (f);
+   obstack_sgrow (&muscle_obstack, ")dnl\n[");
+   char const *extension = obstack_finish0 (&muscle_obstack);
+   muscle_grow (key, extension, "", "");
+diff --git a/src/output.c b/src/output.c
+index 391d8e65..34dbc671 100644
+--- a/src/output.c
++++ b/src/output.c
+@@ -531,7 +531,9 @@ user_actions_output (FILE *out)
+           {
+             fprintf (out, "b4_syncline(%d, ",
+                      rules[r].action_loc.start.line);
+-            string_output (out, rules[r].action_loc.start.file);
++            char *f = map_file_name (rules[r].action_loc.start.file);
++            string_output (out, f);
++            free(f);
+             fprintf (out, ")dnl\n");
+           }
+         fprintf (out, "[%*s%s]],\n[[",
+@@ -629,8 +631,10 @@ prepare_symbol_definitions (void)
+ 
+           if (p->code)
+             {
++              char *f = map_file_name (p->location.start.file);
+               SET_KEY2 (pname, "file");
+-              MUSCLE_INSERT_C_STRING (key, p->location.start.file);
++              MUSCLE_INSERT_C_STRING (key, f);
++              free (f);
+ 
+               SET_KEY2 (pname, "line");
+               MUSCLE_INSERT_INT (key, p->location.start.line);
+-- 
+2.30.0
+
meta/recipes-devtools/bison/bison_3.7.2.bb +1 -0
index ace4ea5c3f..6fd9d288e0 100644
@@ -11,6 +11,7 @@ DEPENDS = "bison-native flex-native"
 
 SRC_URI = "${GNU_MIRROR}/bison/bison-${PV}.tar.xz \
            file://add-with-bisonlocaledir.patch \
+           file://0001-Use-mapped-file-name-for-symbols.patch \
            "
 SRC_URI[sha256sum] = "7948d193104d979c0fb0294a1854c73c89d72ae41acfc081826142578a78a91b"
 
Signature · 1 line
2.29.2
#32 lore raw

PATCH 30/30 acpica: Fix reproducibility issues

In reply to Anuj Mittal

From: Joshua Watt <[email protected]>

Fixes reproducibility when build acpica yacc sources by instructing bison on how to do the file prefix mapping

(cherry picked from commit d13a1df7bd173fca3fc2cdf889d5eb487e35d6fd)
---
 meta/recipes-extended/acpica/acpica_20200717.bb | 2 ++
 1 file changed, 2 insertions(+)
meta/recipes-extended/acpica/acpica_20200717.bb +2 -0
index d1d06c0c24..e3c8c2bdfb 100644
@@ -34,6 +34,8 @@ EXTRA_OEMAKE = "CC='${CC}' \
                 PREFIX=${prefix} \
                 INSTALLDIR=${bindir} \
                 INSTALLFLAGS= \
+                YACC=bison \
+                YFLAGS='-y --file-prefix-map=${WORKDIR}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}' \
                 "
 
 do_install() {
Signature · 1 line
2.29.2
#2 lore raw

Re: [OE-core] [gatesgarth][PATCH 01/30] initrdscripts: init-install-efi.sh install extra files for ESP

In reply to Anuj Mittal

Hi,

Can this backport to Dunfell too?

Quoted 43 lines

-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Anuj Mittal
Sent: Tuesday, 23 February, 2021 12:00 AM
To: [email protected]
Subject: [OE-core] [gatesgarth][PATCH 01/30] initrdscripts: init-install-efi.sh install extra files for ESP

From: Chee Yang Lee <[email protected]>

Currently the install script copy only few hard coded item while setting up target ESP, kernel artifacts, all .efi in EFI/BOOT, grub & boot cfg and loader.conf. While ESP can be much complex, eg: contain multiple initrd.

Add a ESP folder to carry any other files to setup onto ESP.

(cherry picked from commit 6eaca9cf20c42501fba27dea3a6446bad948e859)

---
meta/recipes-core/initrdscripts/files/init-install-efi.sh | 5 +++++

1 file changed, 5 insertions(+)
meta/recipes- renamed from meta/recipes-core/initrdscripts/files/init-install-efi.sh +0 -0

core/initrdscripts/files/init-install-efi.sh
index b6855b5aac..f667518b89 100644

meta/recipes-core/initrdscripts/files/init-install-efi.sh +0 -0
@@ -279,6 +279,11 @@ fi
 

umount /tgt_root

meta/recipes-core/initrdscripts/files/init-install-efi.sh +5 -0
+# copy any extra files needed for ESP
+if [ -d /run/media/$1/esp ]; then
+    cp -r /run/media/$1/esp/* /boot
+fi
+

# Copy kernel artifacts. To add more artifacts just add to types # For now just support kernel types already being used by something in OE-core for types in bzImage zImage vmlinux vmlinuz fitImage; do
--
2.29.2

#3 lore raw

Re: [OE-core] [gatesgarth][PATCH 01/30] initrdscripts: init-install-efi.sh install extra files for ESP

Quoted 4 lines · Lee Chee Yang

Hi,

Can this backport to Dunfell too?

Yes, I'll take care of it.

Steve

Quoted 48 lines
Quoted 44 lines

-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Anuj Mittal
Sent: Tuesday, 23 February, 2021 12:00 AM
To: [email protected]
Subject: [OE-core] [gatesgarth][PATCH 01/30] initrdscripts: init-install-efi.sh install extra files for ESP

From: Chee Yang Lee <[email protected]>

Currently the install script copy only few hard coded item while setting up target ESP, kernel artifacts, all .efi in EFI/BOOT, grub & boot cfg and loader.conf. While ESP can be much complex, eg: contain multiple initrd.

Add a ESP folder to carry any other files to setup onto ESP.

(cherry picked from commit 6eaca9cf20c42501fba27dea3a6446bad948e859)

---
meta/recipes-core/initrdscripts/files/init-install-efi.sh | 5 +++++

1 file changed, 5 insertions(+)
meta/recipes- renamed from meta/recipes-core/initrdscripts/files/init-install-efi.sh +0 -0

core/initrdscripts/files/init-install-efi.sh
index b6855b5aac..f667518b89 100644

meta/recipes-core/initrdscripts/files/init-install-efi.sh +0 -0
@@ -279,6 +279,11 @@ fi
 

umount /tgt_root

meta/recipes-core/initrdscripts/files/init-install-efi.sh +5 -0
+# copy any extra files needed for ESP
+if [ -d /run/media/$1/esp ]; then
+    cp -r /run/media/$1/esp/* /boot
+fi
+

# Copy kernel artifacts. To add more artifacts just add to types # For now just support kernel types already being used by something in OE-core for types in bzImage zImage vmlinux vmlinuz fitImage; do
--
2.29.2