From: Saul Wold <sgw@linux.intel.com>
To: Qi.Chen@windriver.com
Cc: qingtao.cao@windriver.com, openembedded-core@lists.openembedded.org
Subject: Re: [PATCH 1/4] image.bbclass: add postinst_enable_logging
Date: Thu, 16 May 2013 21:32:12 +0300 [thread overview]
Message-ID: <5195262C.3090709@linux.intel.com> (raw)
In-Reply-To: <d978543b3558dc8cc14379cd10506c3f0c6f2953.1368690819.git.Qi.Chen@windriver.com>
On 05/16/2013 10:56 AM, Qi.Chen@windriver.com wrote:
> From: Chen Qi <Qi.Chen@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.Chen@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!
> +}
> +
> # Turn any symbolic /sbin/init link into a file
> remove_init_link () {
> if [ -h ${IMAGE_ROOTFS}/sbin/init ]; then
>
next prev parent reply other threads:[~2013-05-16 18:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-16 7:56 [PATCH 0/4] Postinst logging reimplementation Qi.Chen
2013-05-16 7:56 ` [PATCH 1/4] image.bbclass: add postinst_enable_logging Qi.Chen
2013-05-16 9:03 ` Martin Jansa
2013-05-16 18:32 ` Saul Wold [this message]
2013-05-17 2:46 ` ChenQi
2013-05-16 7:56 ` [PATCH 2/4] dpkg: modify the run-postinst script to enable postinst logging Qi.Chen
2013-05-16 7:56 ` [PATCH 3/4] opkg: " Qi.Chen
2013-05-16 7:56 ` [PATCH 4/4] rpm-postinsts.bb: " Qi.Chen
2013-05-16 8:56 ` [PATCH 0/4] Postinst logging reimplementation Burton, Ross
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5195262C.3090709@linux.intel.com \
--to=sgw@linux.intel.com \
--cc=Qi.Chen@windriver.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=qingtao.cao@windriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox