Skip to contentSkip to conversation

Patch review

PATCH New Steve Sakoman 1 participant 4 messages May 3, 2024

lore
Share & tools
lore
#0 lore raw

cover Patch review

Please review this set of changes for scarthgap and have comments back by end of day Monday, May 6

Passed a-full on autobuilder:

https://autobuilder.yoctoproject.org/typhoon/#/builders/83/builds/6873

The following changes since commit e38a0f1a5e515651173b1aa21d38f2b3924de8b2:

mpg123: upgrade 1.32.5 -> 1.32.6 (2024-04-30 05:57:43 -0700)

are available in the Git repository at:

https://git.openembedded.org/openembedded-core-contrib stable/scarthgap-nut
https://git.openembedded.org/openembedded-core-contrib/log/?h=stable/scarthgap-nut

Alexander Kanavin (1):
scripts/oe-setup-build: write a build environment initialization
one-liner into the build directory

Christian Bräuner Sørensen (1):
systemd: sed ROOT_HOME only if sysusers PACKAGECONFIG is set

Mark Hatle (1):
sstate.bbclass: Add _SSTATE_EXCLUDEDEPS_SYSROOT to vardepsexclude

 meta/classes-global/sstate.bbclass         |  2 +-
 meta/recipes-core/systemd/systemd_255.4.bb | 18 ++++++++++--------
 scripts/oe-setup-build                     | 11 ++++++++++-
 3 files changed, 21 insertions(+), 10 deletions(-)
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/3 sstate.bbclass: Add _SSTATE_EXCLUDEDEPS_SYSROOT to vardepsexclude

From: Mark Hatle <[email protected]>

When using tinfoil to control the build, multiple commands (serially) could trigger an error such as:

When reparsing ....bb:do_package, the basehash value changed from ... to .... The metadata is not deterministic and this needs to be fixed.
ERROR: The following commands may help:
ERROR: $ bitbake esw-conf -cdo_package -Snone
ERROR: Then:
ERROR: $ bitbake esw-conf -cdo_package -Sprintdiff

However following these commands it was not able to be reproduced. Forcing bitbake to dump the signatures and then running bitbake-diffsigs showed that the value of _SSTATE_EXCLUDEDEPS_SYSROOT was being set in one run, but was blank is a different version.

Upon inspecting the code in sstate.bbclass, one usage (without the _) is already excludes, the leading _ version is used as a cache, only if set but is not actually required to be defined. So ignoring the value should work properly.

(cherry picked from commit 4ec704ed6a1cfaf0a6c20f2038e7192e361ef590)
---
 meta/classes-global/sstate.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes-global/sstate.bbclass +1 -1
index 04539bbb99..76a7b59636 100644
@@ -1115,7 +1115,7 @@ def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True,
         bb.parse.siggen.checkhashes(sq_data, missed, found, d)
 
     return found
-setscene_depvalid[vardepsexclude] = "SSTATE_EXCLUDEDEPS_SYSROOT"
+setscene_depvalid[vardepsexclude] = "SSTATE_EXCLUDEDEPS_SYSROOT _SSTATE_EXCLUDEDEPS_SYSROOT"
 
 BB_SETSCENE_DEPVALID = "setscene_depvalid"
 
Signature · 1 line
2.34.1
#2 lore raw

PATCH 2/3 scripts/oe-setup-build: write a build environment initialization one-liner into the build directory

In reply to Steve Sakoman

From: Alexander Kanavin <[email protected]>

With this, users no longer have to know where oe-init-build-env is relative to the build directory; that information is contained in the one liner and then it's possible to simply use that:

. /path/to/build/init-build-env

This will particularly help with initializing builds in unpacked build bundles, as users won't have to know where oe-init-build-env is in the bundle directory tree - similar to esdk initialization.

(From OE-Core rev: 1cabdf287c2739accdab3a766df060f1bc802b63)

---
 scripts/oe-setup-build | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
scripts/oe-setup-build +10 -1
index 5364f2b481..c0476992a2 100755
@@ -91,7 +91,16 @@ def setup_build_env(args):
     builddir = args.b if args.b else template["buildpath"]
     no_shell = args.no_shell
     coredir = os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..'))
-    cmd = "TEMPLATECONF={} . {} {}".format(template["templatepath"], os.path.join(coredir, 'oe-init-build-env'), builddir)
+    cmd_base = ". {} {}".format(os.path.join(coredir, 'oe-init-build-env'), os.path.abspath(builddir))
+
+    initbuild = os.path.join(builddir, 'init-build-env')
+    if not os.path.exists(initbuild):
+        os.makedirs(builddir, exist_ok=True)
+        with open(initbuild, 'w') as f:
+            f.write(cmd_base)
+    print("\nRun '. {}' to initialize the build in a current shell session.\n".format(initbuild))
+
+    cmd = "TEMPLATECONF={} {}".format(template["templatepath"], cmd_base)
     if not no_shell:
         cmd = cmd + " && {}".format(os.environ['SHELL'])
     print("Running:", cmd)
Signature · 1 line
2.34.1
#3 lore raw

PATCH 3/3 systemd: sed ROOT_HOME only if sysusers PACKAGECONFIG is set

In reply to Steve Sakoman

From: Christian Bräuner Sørensen <[email protected]>

Fixes a bug introducted in ebafe46379 systemd: upgrade to 255.1.

Besides updating systemd, that commit also made other changes. One of them being when to perform the replacement in order to fix ROOT_HOME.

Previously, that happened on a configure prefunc and on ${S}/sysusers.d/basic.conf.in.
Now it happens in install and on image/usr/lib/sysusers.d/basic.conf.

However, that file is not present if sysusers is not in PACKAGECONFIG,
since that file in that case is not installed hence resulting in:
sed: can't read <redactedpath>/image/usr/lib/sysusers.d/basic.conf: No such file or directory

Previously, in the case of sysusers not being in PACKAGECONFIG, that was a "silent error" since the replacement was done but the file was not really used since the file was not installed.

---
 meta/recipes-core/systemd/systemd_255.4.bb | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)
meta/recipes-core/systemd/systemd_255.4.bb +10 -8
index e7498c802d..f58a1bc2b6 100644
@@ -271,14 +271,16 @@ WATCHDOG_TIMEOUT ??= "60"
 
 do_install() {
 	meson_do_install
-	# Change the root user's home directory in /lib/sysusers.d/basic.conf.
-	# This is done merely for backward compatibility with previous systemd recipes.
-	# systemd hardcodes root user's HOME to be "/root". Changing to use other values
-	# may have unexpected runtime behaviors.
-	if [ "${ROOT_HOME}" != "/root" ]; then
-		bbwarn "Using ${ROOT_HOME} as root user's home directory is not fully supported by systemd"
-		sed -i -e 's#/root#${ROOT_HOME}#g' ${D}${exec_prefix}/lib/sysusers.d/basic.conf
-	fi
+	if ${@bb.utils.contains('PACKAGECONFIG', 'sysusers', 'true', 'false', d)}; then
+            # Change the root user's home directory in /lib/sysusers.d/basic.conf.
+            # This is done merely for backward compatibility with previous systemd recipes.
+            # systemd hardcodes root user's HOME to be "/root". Changing to use other values
+            # may have unexpected runtime behaviors.
+            if [ "${ROOT_HOME}" != "/root" ]; then
+                    bbwarn "Using ${ROOT_HOME} as root user's home directory is not fully supported by systemd"
+                    sed -i -e 's#/root#${ROOT_HOME}#g' ${D}${exec_prefix}/lib/sysusers.d/basic.conf
+            fi
+        fi
 	install -d ${D}/${base_sbindir}
 	if ${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', 'false', 'true', d)}; then
 		# Provided by a separate recipe
Signature · 1 line
2.34.1