]> code.ossystems Code Review - openembedded-core.git/commitdiff
run-postinsts: add more logging to the log file to make things clearer
authorChen Qi <Qi.Chen@windriver.com>
Fri, 19 Jul 2013 09:39:27 +0000 (17:39 +0800)
committerSaul Wold <sgw@linux.intel.com>
Fri, 26 Jul 2013 07:07:43 +0000 (00:07 -0700)
When all postinsts scripts succeed at system startup, it's very possible
that the log file /var/log/postinstall.log is empty. This is kind of
confusing, as that file is supposed to hold information about the postinsts.

Add more logging to the log file to make things clearer.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts

index 2a8d1d6e83a581bd1f85303befe036bd4e119133..c94c3e92ece0000a8510c10da73f2d17ff474203 100755 (executable)
@@ -24,6 +24,7 @@ remove_pi_dir=1
 for i in `ls $pi_dir`; do
        i=$pi_dir/$i
        echo "Running postinst $i..."
+       [ "$POSTINST_LOGGING" = "1" ] && echo "Running postinst $i..." >> $LOGFILE
        if [ -x $i ]; then
                if [ "$POSTINST_LOGGING" = "1" ]; then
                        sh -c $i >>$LOGFILE 2>&1
@@ -33,6 +34,7 @@ for i in `ls $pi_dir`; do
                rm $i
        else
                echo "ERROR: postinst $i failed."
+               [ "$POSTINST_LOGGING" = "1" ] && echo "ERROR: postinst $i failed." >> $LOGFILE
                remove_pi_dir=0
        fi
 done