opkg: modify the run-postinst script to enable postinst logging

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]

(From OE-Core rev: 35be6ffc19a5156aa029397707f1e6869684b821)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Chen Qi 2013-05-23 12:43:35 +08:00 committed by Richard Purdie
parent 45c37d6299
commit 0bf2c0af71
1 changed files with 6 additions and 1 deletions

View 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