diff mbox series

run-postinsts: fix post-install-script output in log file

Message ID ZRAP278MB0431A7393E12FDD3A6EBF1DC9AAAA@ZRAP278MB0431.CHEP278.PROD.OUTLOOK.COM
State New
Headers show
Series run-postinsts: fix post-install-script output in log file | expand

Commit Message

Favazza, Samuele Dec. 16, 2025, 2:33 p.m. UTC
When the POSTINST_LOGGING is enabled the output of the post-install
script is not stored in the 'postinstall.log' file. This probably
happened since commit 706410c847ac9c89317d098de5d5c580736edbbb.

Fix the post-install script execution statement to honor the
stdout/stderr redirection to the 'postinstall.log' file.

Signed-off-by: Samuele Favazza <samuele.favazza@duagon.com>
---
 meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts b/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts
index b7352aa24d..e8c31e04ce 100755
--- a/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts
+++ b/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts
@@ -67,7 +67,7 @@  exec_postinst_scriptlets() {
    echo "Running postinst $i..."
    [ "$POSTINST_LOGGING" = "1" ] && eval echo "Running postinst $i..." $append_log
    if [ -x "$i" ]; then
-     (sh -c "$i" $append_log)
+     (sh -c "$i $append_log")
      status=$?
      if [ $status -ne 0 ]; then
        echo "ERROR: postinst $i failed with exit code $status."