Patchwork [V4,3/4] opkg: modify the run-postinst script to enable postinst logging

login
register
mail settings
Submitter Qi.Chen@windriver.com
Date May 23, 2013, 4:43 a.m.
Message ID <8e87ea0d7c1a5652914fa0356e816d375530457c.1369284008.git.Qi.Chen@windriver.com>
Download mbox | patch
Permalink /patch/50363/
State Accepted
Commit 0bf2c0af71dd506e8019bdd5b2b3b826062185a3
Headers show

Comments

Qi.Chen@windriver.com - May 23, 2013, 4:43 a.m.
From: Chen Qi <Qi.Chen@windriver.com>

Enable postinst logging by checking the configuration in ${sysconfdir}
/default/postinst.

In this way, the postinst logging is enabled if 'debug-tweaks' is
in IMAGE_FEATURES, and at the same time, we avoid unnecessary rebuilt
if IMAGE_FEATURES is changed.

[YOCTO #4262]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/recipes-devtools/opkg/opkg.inc |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Patch

diff --git a/meta/recipes-devtools/opkg/opkg.inc b/meta/recipes-devtools/opkg/opkg.inc
index 631aafc..3b8c4e8 100644
--- a/meta/recipes-devtools/opkg/opkg.inc
+++ b/meta/recipes-devtools/opkg/opkg.inc
@@ -68,7 +68,12 @@  if [ "x$D" != "x" ] && [ -f $D${OPKGLIBDIR}/opkg/status ]; then
 
 	# this happens at S98 where our good 'ole packages script used to run
 	echo "#!/bin/sh
-opkg-cl configure ${REDIRECT_CMD}
+[ -e ${sysconfdir}/default/postinst ] && . ${sysconfdir}/default/postinst
+if [ \"\$POSTINST_LOGGING\" = \"1\" ]; then
+    opkg-cl configure >\$LOGFILE 2>&1
+else
+    opkg-cl configure
+fi
 rm -f ${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts
 " > $D${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts
 	chmod 0755 $D${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts