[V2,3/4] opkg: modify the run-postinst script to enable postinst logging
Details
Commit Message
@@ -57,10 +57,6 @@ do_install_append_class-native() {
fi
}
-POSTLOG ?= "/var/log/postinstall.log"
-REDIRECT_CMD = "${@base_contains('IMAGE_FEATURES', 'debug-tweaks', '>${POSTLOG} 2>&1', '', d)}"
-REDIRECT_CMD[vardepsexclude] += "IMAGE_FEATURES POSTLOG"
-
pkg_postinst_${PN} () {
#!/bin/sh
if [ "x$D" != "x" ] && [ -f $D${OPKGLIBDIR}/opkg/status ]; then
@@ -68,7 +64,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 /etc/default/postinst ] && . /etc/default/postinst
+if [ \"\$POSTINST_LOGGING\" = \"ENABLED\" ]; then
+ opkg-cl configure >/var/log/postinstall.log 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