On 05/17/2013 02:32 AM, Saul Wold wrote:
On 05/16/2013 10:56 AM, qi.c...@windriver.com wrote:
From: Chen Qi <qi.c...@windriver.com>
Add a function postinst_enable_logging, so that when 'debug-tweaks'
is in IMAGE_FEATURES, we create .enable_postinst_logging under /etc,
which is used by run-postinst scripts to determine whether to log or
not.
[YOCTO #4262]
Signed-off-by: Chen Qi <qi.c...@windriver.com>
---
meta/classes/image.bbclass | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 2b42e12..fc5e23c 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -175,6 +175,8 @@ MACHINE_POSTPROCESS_COMMAND ?= ""
ROOTFS_POSTPROCESS_COMMAND_prepend = "run_intercept_scriptlets; "
# Allow dropbear/openssh to accept logins from accounts with an
empty password string if debug-tweaks is enabled
ROOTFS_POSTPROCESS_COMMAND += '${@base_contains("IMAGE_FEATURES",
"debug-tweaks", "ssh_allow_empty_password; ", "",d)}'
+# Enable postinst logging if debug-tweaks is enabled
+ROOTFS_POSTPROCESS_COMMAND += '${@base_contains("IMAGE_FEATURES",
"debug-tweaks", "postinst_enable_logging; ", "",d)}'
# some default locales
IMAGE_LINGUAS ?= "de-de fr-fr en-gb"
@@ -484,6 +486,11 @@ ssh_allow_empty_password () {
fi
}
+# Enable postinst logging if debug-tweaks is enabled
+postinst_enable_logging () {
+ touch ${IMAGE_ROOTFS}/etc/.enable_postinst_logging
I do not think this should go here, maybe better to have it in the
/etc/default dir and named postinst, since that matches what other init
related scripts do and source the file in each postinst script, it
should also have a standard guard to check existance of the file and
checks something like a "ENABLED" variable instead? This could also
be extended for getting the log file location also.
Sau!
Thanks a lot.
I'll follow your advices and send out a v2.
Best Regards,
Chen Qi
+}
+
# Turn any symbolic /sbin/init link into a file
remove_init_link () {
if [ -h ${IMAGE_ROOTFS}/sbin/init ]; then
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core