From: Alexander Kanavin <alex.kanavin@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: Alexander Kanavin <alex@linutronix.de>
Subject: [PATCH 3/8] classes/staging: capture output of sysroot postinsts into logs
Date: Fri, 26 Jan 2024 14:34:50 +0100 [thread overview]
Message-ID: <20240126133455.2609378-3-alex@linutronix.de> (raw)
In-Reply-To: <20240126133455.2609378-1-alex@linutronix.de>
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'
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
meta/classes-global/staging.bbclass | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/meta/classes-global/staging.bbclass b/meta/classes-global/staging.bbclass
index cf1e4600fd6..ab3e1d71b52 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):
staging_processfixme(fixme, targetdir, targetsysroot, nativesysroot, d)
for p in postinsts:
- subprocess.check_output(p, shell=True, stderr=subprocess.STDOUT)
+ bb.note("Running postinst {}, output:\n{}".format(p, subprocess.check_output(p, shell=True, stderr=subprocess.STDOUT)))
#
# Manifests here are complicated. The main sysroot area has the unpacked sstate
@@ -630,7 +630,7 @@ python extend_recipe_sysroot() {
staging_processfixme(fixme[f], f, recipesysroot, recipesysrootnative, d)
for p in postinsts:
- subprocess.check_output(p, shell=True, stderr=subprocess.STDOUT)
+ bb.note("Running postinst {}, output:\n{}".format(p, subprocess.check_output(p, shell=True, stderr=subprocess.STDOUT)))
for dep in manifests:
c = setscenedeps[dep][0]
--
2.39.2
next prev parent reply other threads:[~2024-01-26 13:35 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-26 13:34 [PATCH 1/8] sysroot user management postinsts: run with /bin/sh -e to report errors when they happen Alexander Kanavin
2024-01-26 13:34 ` [PATCH 2/8] classes/multilib: expand PACKAGE_WRITE_DEPS in addition to DEPENDS Alexander Kanavin
2024-01-26 13:34 ` Alexander Kanavin [this message]
2024-01-26 13:34 ` [PATCH 4/8] classes/package_rpm: write file permissions and ownership explicitly into .spec Alexander Kanavin
2024-01-26 13:34 ` [PATCH 5/8] classes/package_rpm: use weak user/group dependencies Alexander Kanavin
2024-01-26 13:34 ` [PATCH 6/8] classes/package_rpm: set bogus locations for passwd/group files Alexander Kanavin
2024-01-26 13:34 ` [PATCH 7/8] oeqa/runtime/rpm: fail tests if test rpm file cannot be found Alexander Kanavin
2024-01-26 14:11 ` [OE-core] " Richard Purdie
2024-01-26 14:21 ` Alexander Kanavin
2024-01-26 13:34 ` [PATCH 8/8] rpm: update 4.18.1 -> 4.19.1 Alexander Kanavin
2024-01-28 16:53 ` [OE-core] " Khem Raj
2024-01-28 19:04 ` Alexander Kanavin
[not found] ` <17AE983A55179990.23935@lists.openembedded.org>
2024-01-29 11:57 ` Alexander Kanavin
2024-01-29 12:11 ` Matt Madison
2024-01-29 12:22 ` Alexander Kanavin
2024-01-29 16:30 ` Matt Madison
2024-01-29 16:44 ` Mark Hatle
2024-02-01 21:10 ` Alexandre Belloni
2024-02-01 21:19 ` Alexander Kanavin
[not found] ` <17AFD9EAEAF14DA0.1968@lists.openembedded.org>
2024-02-02 12:27 ` Alexander Kanavin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240126133455.2609378-3-alex@linutronix.de \
--to=alex.kanavin@gmail.com \
--cc=alex@linutronix.de \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox