summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2013-05-23 12:43:34 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-05-23 10:28:04 +0100
commit45c37d629929c0ff9ff65a7fd940d06da36aa133 (patch)
tree4cd4c0caea8ba5ab0ae3f5920166dd624c21a616 /meta/recipes-devtools
parentd837fb346d465b34285df36f9533bf39502eff0e (diff)
downloadpoky-45c37d629929c0ff9ff65a7fd940d06da36aa133.tar.gz
dpkg: 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: 881880992ac0edc5f928f7e3d2a8f3f993284df6) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r--meta/recipes-devtools/dpkg/dpkg.inc11
1 files changed, 6 insertions, 5 deletions
diff --git a/meta/recipes-devtools/dpkg/dpkg.inc b/meta/recipes-devtools/dpkg/dpkg.inc
index d773fbdc5a..619777701f 100644
--- a/meta/recipes-devtools/dpkg/dpkg.inc
+++ b/meta/recipes-devtools/dpkg/dpkg.inc
@@ -35,10 +35,6 @@ do_configure () {
35 autotools_do_configure 35 autotools_do_configure
36} 36}
37 37
38POSTLOG ?= "/var/log/postinstall.log"
39REDIRECT_CMD = "${@base_contains('IMAGE_FEATURES', 'debug-tweaks', '>${POSTLOG} 2>&1', '', d)}"
40REDIRECT_CMD[vardepsexclude] += "IMAGE_FEATURES POSTLOG"
41
42DPKG_INIT_POSITION ?= "98" 38DPKG_INIT_POSITION ?= "98"
43 39
44do_install_append () { 40do_install_append () {
@@ -67,7 +63,12 @@ if [ "x$D" != "x" ] && [ -f $D/var/lib/dpkg/status ]; then
67 63
68 # this happens at S98 where our good 'ole packages script used to run 64 # this happens at S98 where our good 'ole packages script used to run
69 echo "#!/bin/sh 65 echo "#!/bin/sh
70dpkg --configure -a ${REDIRECT_CMD} 66[ -e ${sysconfdir}/default/postinst ] && . ${sysconfdir}/default/postinst
67if [ \"\$POSTINST_LOGGING\" = \"1\" ]; then
68 dpkg --configure -a >\$LOGFILE 2>&1
69else
70 dpkg --configure -a
71fi
71rm -f ${sysconfdir}/rcS.d/S${DPKG_INIT_POSITION}run-postinsts 72rm -f ${sysconfdir}/rcS.d/S${DPKG_INIT_POSITION}run-postinsts
72" > $D${sysconfdir}/rcS.d/S${DPKG_INIT_POSITION}run-postinsts 73" > $D${sysconfdir}/rcS.d/S${DPKG_INIT_POSITION}run-postinsts
73 chmod 0755 $D${sysconfdir}/rcS.d/S${DPKG_INIT_POSITION}run-postinsts 74 chmod 0755 $D${sysconfdir}/rcS.d/S${DPKG_INIT_POSITION}run-postinsts