Openembedded Core Discussions
 help / color / mirror / Atom feed
From: ChenQi <Qi.Chen@windriver.com>
To: Saul Wold <sgw@linux.intel.com>
Cc: qingtao.cao@windriver.com, openembedded-core@lists.openembedded.org
Subject: Re: [PATCH 1/4] image.bbclass: add postinst_enable_logging
Date: Fri, 17 May 2013 10:46:40 +0800	[thread overview]
Message-ID: <51959A10.8000402@windriver.com> (raw)
In-Reply-To: <5195262C.3090709@linux.intel.com>

On 05/17/2013 02:32 AM, Saul Wold wrote:
> 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!
>

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
>>
>
>




  reply	other threads:[~2013-05-17  3:05 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
2013-05-17  2:46     ` ChenQi [this message]
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=51959A10.8000402@windriver.com \
    --to=qi.chen@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=qingtao.cao@windriver.com \
    --cc=sgw@linux.intel.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