diff options
author | Chen Qi <Qi.Chen@windriver.com> | 2013-05-23 12:43:36 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-05-23 10:28:05 +0100 |
commit | f7b639e527a65f9ce77aef07651ac5ec1e094e52 (patch) | |
tree | c5d95cf026102f667018f9db14a5e531f3492133 /meta/recipes-devtools | |
parent | 0bf2c0af71dd506e8019bdd5b2b3b826062185a3 (diff) | |
download | ast2050-yocto-poky-f7b639e527a65f9ce77aef07651ac5ec1e094e52.zip ast2050-yocto-poky-f7b639e527a65f9ce77aef07651ac5ec1e094e52.tar.gz |
rpm-postinsts.bb: 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 rebuild
if IMAGE_FEATURES is changed.
[YOCTO #4262]
(From OE-Core rev: 6f2aa32f10c24c84e581128bb3a976ef071197ac)
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/rpm/rpm-postinsts.bb | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/meta/recipes-devtools/rpm/rpm-postinsts.bb b/meta/recipes-devtools/rpm/rpm-postinsts.bb index 3c0f520..c8fc1c3 100644 --- a/meta/recipes-devtools/rpm/rpm-postinsts.bb +++ b/meta/recipes-devtools/rpm/rpm-postinsts.bb @@ -9,10 +9,6 @@ inherit allarch # POSTINSTALL_INITPOSITION ?= "98" -POSTLOG ?= "/var/log/postinstall.log" -REDIRECT_CMD = "${@base_contains('IMAGE_FEATURES', 'debug-tweaks', '>>${POSTLOG} 2>&1', '', d)}" -REDIRECT_CMD[vardepsexclude] += "IMAGE_FEATURES POSTLOG" - do_fetch() { : } @@ -34,11 +30,16 @@ if [ "x$D" != "x" ] && [ -f $D/var/lib/rpm/Packages ]; then install -d $D/${sysconfdir}/rcS.d cat > $D${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts << "EOF" #!/bin/sh - -[ -d /etc/rpm-postinsts ] && for i in `ls /etc/rpm-postinsts/`; do - i=/etc/rpm-postinsts/$i +[ -e ${sysconfdir}/default/postinst ] && . ${sysconfdir}/default/postinst +[ -d ${sysconfdir}/rpm-postinsts ] && for i in `ls ${sysconfdir}/rpm-postinsts/`; do + i=${sysconfdir}/rpm-postinsts/$i echo "Running postinst $i..." - if [ -f $i ] && $i ${REDIRECT_CMD}; then + if [ -x $i ]; then + if [ "$POSTINST_LOGGING" = "1" ]; then + $i >>$LOGFILE 2&>1 + else + $i + fi rm $i else echo "ERROR: postinst $i failed." |