]> code.ossystems Code Review - openembedded-core.git/commitdiff
opkg: modify the run-postinst script to enable postinst logging
authorChen Qi <Qi.Chen@windriver.com>
Thu, 23 May 2013 04:43:35 +0000 (12:43 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 23 May 2013 09:27:53 +0000 (10:27 +0100)
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>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/opkg/opkg.inc

index 631aafc7683690b4786f1002128f12437d4220d1..3b8c4e8e40e8dd95adae3376dac9a4a0cd2b397a 100644 (file)
@@ -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