Skip to contentSkip to conversation

rootfs: improve postinst intercept logging

PATCH New Ross Burton 1 participant 1 message Sep 5, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rootfs: improve postinst intercept logging

Ensure we capture stderr, always write the output to the log, and don't be so emotional in the warning message.

---
 meta/lib/oe/rootfs.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
meta/lib/oe/rootfs.py +4 -3
index 96591f370e6..9d4727e76c1 100644
@@ -302,10 +302,11 @@ class Rootfs(object, metaclass=ABCMeta):
             bb.note("> Executing %s intercept ..." % script)
 
             try:
-                subprocess.check_output(script_full)
+                output = subprocess.check_output(script_full, stderr=subprocess.STDOUT)
+                if output: bb.note(output.decode("utf-8"))
             except subprocess.CalledProcessError as e:
-                bb.warn("The postinstall intercept hook '%s' failed (exit code: %d)! See log for details! (Output: %s)" %
-                        (script, e.returncode, e.output))
+                bb.warn("The postinstall intercept hook '%s' failed, details in log.do_rootfs" % script)
+                bb.note("Exit code %d. Output:\n%s" % (e.returncode, e.output.decode("utf-8")))
 
                 with open(script_full) as intercept:
                     registered_pkgs = None
Signature · 1 line
2.11.0