summaryrefslogtreecommitdiffstats
path: root/meta/classes-global
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2024-01-26 14:34:50 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-01-27 08:20:02 +0000
commitd00682ab5c2d472b2fdddfe86198dc2816028359 (patch)
tree98a56200e7b73a772c7a3f355430e0e705e65cf6 /meta/classes-global
parent55bfa994518ab5a0532c0ffb021f8131f0a8ba77 (diff)
downloadpoky-d00682ab5c2d472b2fdddfe86198dc2816028359.tar.gz
classes/staging: capture output of sysroot postinsts into logs
This particularly helps with user management postinsts as otherwise there's no trace left of what was run, in which order, and what was the output. Here's an example from the logs: NOTE: Running postinst /srv/storage/alex/yocto/build-multilib/tmp/work/x86_64-pokymllib64-linux/lib64-quilt/0.67/lib64-recipe-sysroot/usr/bin/postinst-lib64-base-passwd, output: b'/srv/storage/alex/yocto/build-multilib/tmp/work/x86_64-pokymllib64-linux/lib64-quilt/0.67/recipe-sysroot-native/usr/sbin/useradd\nRunning useradd commands...\nNOTE: lib64-ptest-runner: Performing useradd with [--root /srv/storage/alex/yocto/build-multilib/tmp/work/x86_64-pokymllib64-linux/lib64-quilt/0.67/lib64-recipe-sysroot --system --no-create-home --home / --user-group ptest]\n' NOTE: Running postinst /srv/storage/alex/yocto/build-multilib/tmp/work/x86_64-pokymllib64-linux/lib64-quilt/0.67/lib64-recipe-sysroot/usr/bin/postinst-useradd-lib64-ptest-runner, output: b'/srv/storage/alex/yocto/build-multilib/tmp/work/x86_64-pokymllib64-linux/lib64-quilt/0.67/recipe-sysroot-native/usr/sbin/useradd\nRunning useradd commands...\nNOTE: lib64-ptest-runner: Performing useradd with [--root /srv/storage/alex/yocto/build-multilib/tmp/work/x86_64-pokymllib64-linux/lib64-quilt/0.67/lib64-recipe-sysroot --system --no-create-home --home / --user-group ptest]\nNOTE: lib64-ptest-runner: user ptest already exists, not re-creating it\n' (From OE-Core rev: a4dc96293268804b214a02e08d266205fad428b0) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes-global')
-rw-r--r--meta/classes-global/staging.bbclass4
1 files changed, 2 insertions, 2 deletions
diff --git a/meta/classes-global/staging.bbclass b/meta/classes-global/staging.bbclass
index cf1e4600fd..ab3e1d71b5 100644
--- a/meta/classes-global/staging.bbclass
+++ b/meta/classes-global/staging.bbclass
@@ -246,7 +246,7 @@ def staging_populate_sysroot_dir(targetsysroot, nativesysroot, native, d):
246 246
247 staging_processfixme(fixme, targetdir, targetsysroot, nativesysroot, d) 247 staging_processfixme(fixme, targetdir, targetsysroot, nativesysroot, d)
248 for p in postinsts: 248 for p in postinsts:
249 subprocess.check_output(p, shell=True, stderr=subprocess.STDOUT) 249 bb.note("Running postinst {}, output:\n{}".format(p, subprocess.check_output(p, shell=True, stderr=subprocess.STDOUT)))
250 250
251# 251#
252# Manifests here are complicated. The main sysroot area has the unpacked sstate 252# Manifests here are complicated. The main sysroot area has the unpacked sstate
@@ -630,7 +630,7 @@ python extend_recipe_sysroot() {
630 staging_processfixme(fixme[f], f, recipesysroot, recipesysrootnative, d) 630 staging_processfixme(fixme[f], f, recipesysroot, recipesysrootnative, d)
631 631
632 for p in postinsts: 632 for p in postinsts:
633 subprocess.check_output(p, shell=True, stderr=subprocess.STDOUT) 633 bb.note("Running postinst {}, output:\n{}".format(p, subprocess.check_output(p, shell=True, stderr=subprocess.STDOUT)))
634 634
635 for dep in manifests: 635 for dep in manifests:
636 c = setscenedeps[dep][0] 636 c = setscenedeps[dep][0]