From 68d2193f53bbb588680a71571485d1fe370662eb Mon Sep 17 00:00:00 2001
From: =?utf8?q?Jos=C3=A9=20Bollo?= <jose.bollo@iot.bzh>
Date: Tue, 13 Feb 2018 17:11:31 +0100
Subject: [PATCH] run-(agl-)postinst: Emit progress to console
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit

It can be useful to get the progression of the
postinstallation scripts.

Change-Id: I21f70ee1a5cae36c924a1c664855ba4179b5acd7
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
---
 .../run-agl-postinsts/run-agl-postinsts/run-agl-postinsts.service    | 1 +
 meta-agl/recipes-devtools/run-postinsts/run-postinsts_%.bbappend     | 5 +++++
 2 files changed, 6 insertions(+)
 create mode 100644 meta-agl/recipes-devtools/run-postinsts/run-postinsts_%.bbappend

diff --git a/meta-agl/recipes-devtools/run-agl-postinsts/run-agl-postinsts/run-agl-postinsts.service b/meta-agl/recipes-devtools/run-agl-postinsts/run-agl-postinsts/run-agl-postinsts.service
index 61d6d4679..8f8667db6 100644
--- a/meta-agl/recipes-devtools/run-agl-postinsts/run-agl-postinsts/run-agl-postinsts.service
+++ b/meta-agl/recipes-devtools/run-agl-postinsts/run-agl-postinsts/run-agl-postinsts.service
@@ -7,6 +7,7 @@ ConditionPathExists=#SYSCONFDIR#/agl-postinsts
 
 [Service]
 Type=oneshot
+StandardOutput=journal+console
 ExecStart=#SBINDIR#/run-agl-postinsts
 ExecStartPost=#BASE_BINDIR#/systemctl disable run-agl-postinsts.service
 RemainAfterExit=No
diff --git a/meta-agl/recipes-devtools/run-postinsts/run-postinsts_%.bbappend b/meta-agl/recipes-devtools/run-postinsts/run-postinsts_%.bbappend
new file mode 100644
index 000000000..fc327b6ef
--- /dev/null
+++ b/meta-agl/recipes-devtools/run-postinsts/run-postinsts_%.bbappend
@@ -0,0 +1,5 @@
+do_configure_append() {
+	if ! grep -q StandardOutput= ${WORKDIR}/run-postinsts.service; then
+		sed -i '/ExecStart=/iStandardOutput=journal+console' ${WORKDIR}/run-postinsts.service
+	fi
+}
-- 
2.16.6