All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] rootfs-post: add sanity check for ROOTFS_POSTCMD
       [not found] <20200708110936.17099-1-kweihmann@outlook.com>
@ 2020-07-08 11:09 ` Konrad Weihmann
  2020-07-08 12:08   ` [OE-core] " Richard Purdie
  0 siblings, 1 reply; 3+ messages in thread
From: Konrad Weihmann @ 2020-07-08 11:09 UTC (permalink / raw)
  To: openembedded-core; +Cc: Konrad Weihmann

It warns about trailing blanks before the delimiter, as otherwise the
task can't be removed properly

Signed-off-by: Konrad Weihmann <kweihmann@outlook.com>
---
 meta/classes/rootfs-postcommands.bbclass | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass
index 984730ebe8..e33715f016 100644
--- a/meta/classes/rootfs-postcommands.bbclass
+++ b/meta/classes/rootfs-postcommands.bbclass
@@ -57,6 +57,14 @@ python () {
     d.appendVar('ROOTFS_POSTPROCESS_COMMAND', 'rootfs_reproducible;')
 }
 
+addhandler rootfs_postcmd_sanity_eventhandler
+rootfs_postcmd_sanity_eventhandler[eventmask] = "bb.event.RecipeParsed"
+python rootfs_postcmd_sanity_eventhandler() {
+    for x in (d.getVar("ROOTFS_POSTPROCESS_COMMAND") or "").split(";"):
+        if x.endswith(" "):
+            bb.warn("'%s' ends with a blank, making the task unremovable" % x.strip())
+}
+
 systemd_create_users () {
 	for conffile in ${IMAGE_ROOTFS}/usr/lib/sysusers.d/systemd.conf ${IMAGE_ROOTFS}/usr/lib/sysusers.d/systemd-remote.conf; do
 		[ -e $conffile ] || continue
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [OE-core] [PATCH 2/2] rootfs-post: add sanity check for ROOTFS_POSTCMD
  2020-07-08 11:09 ` [PATCH 2/2] rootfs-post: add sanity check for ROOTFS_POSTCMD Konrad Weihmann
@ 2020-07-08 12:08   ` Richard Purdie
  2020-07-08 18:37     ` Konrad Weihmann
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Purdie @ 2020-07-08 12:08 UTC (permalink / raw)
  To: Konrad Weihmann, openembedded-core

On Wed, 2020-07-08 at 13:09 +0200, Konrad Weihmann wrote:
> It warns about trailing blanks before the delimiter, as otherwise the
> task can't be removed properly
> 
> Signed-off-by: Konrad Weihmann <kweihmann@outlook.com>
> ---
>  meta/classes/rootfs-postcommands.bbclass | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass
> index 984730ebe8..e33715f016 100644
> --- a/meta/classes/rootfs-postcommands.bbclass
> +++ b/meta/classes/rootfs-postcommands.bbclass
> @@ -57,6 +57,14 @@ python () {
>      d.appendVar('ROOTFS_POSTPROCESS_COMMAND', 'rootfs_reproducible;')
>  }
>  
> +addhandler rootfs_postcmd_sanity_eventhandler
> +rootfs_postcmd_sanity_eventhandler[eventmask] = "bb.event.RecipeParsed"
> +python rootfs_postcmd_sanity_eventhandler() {
> +    for x in (d.getVar("ROOTFS_POSTPROCESS_COMMAND") or "").split(";"):
> +        if x.endswith(" "):
> +            bb.warn("'%s' ends with a blank, making the task unremovable" % x.strip())
> +}
> +
>  systemd_create_users () {
>  	for conffile in ${IMAGE_ROOTFS}/usr/lib/sysusers.d/systemd.conf ${IMAGE_ROOTFS}/usr/lib/sysusers.d/systemd-remote.conf; do
>  		[ -e $conffile ] || continue

I think this belongs with other sanity tests in insane.bbclass. I'd
prefer not to have another event handler in the system just for this
(they're high overhead).

Cheers,

Richard


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [OE-core] [PATCH 2/2] rootfs-post: add sanity check for ROOTFS_POSTCMD
  2020-07-08 12:08   ` [OE-core] " Richard Purdie
@ 2020-07-08 18:37     ` Konrad Weihmann
  0 siblings, 0 replies; 3+ messages in thread
From: Konrad Weihmann @ 2020-07-08 18:37 UTC (permalink / raw)
  To: Richard Purdie, openembedded-core

Then please ignore the second patch - if I find some time, I'll try to 
add that to the sanity class - but for now the first patch solve a real 
problem for me, while the second is nice 2 have at the moment

On 08.07.20 14:08, Richard Purdie wrote:
> On Wed, 2020-07-08 at 13:09 +0200, Konrad Weihmann wrote:
>> It warns about trailing blanks before the delimiter, as otherwise the
>> task can't be removed properly
>>
>> Signed-off-by: Konrad Weihmann <kweihmann@outlook.com>
>> ---
>>   meta/classes/rootfs-postcommands.bbclass | 8 ++++++++
>>   1 file changed, 8 insertions(+)
>>
>> diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass
>> index 984730ebe8..e33715f016 100644
>> --- a/meta/classes/rootfs-postcommands.bbclass
>> +++ b/meta/classes/rootfs-postcommands.bbclass
>> @@ -57,6 +57,14 @@ python () {
>>       d.appendVar('ROOTFS_POSTPROCESS_COMMAND', 'rootfs_reproducible;')
>>   }
>>   
>> +addhandler rootfs_postcmd_sanity_eventhandler
>> +rootfs_postcmd_sanity_eventhandler[eventmask] = "bb.event.RecipeParsed"
>> +python rootfs_postcmd_sanity_eventhandler() {
>> +    for x in (d.getVar("ROOTFS_POSTPROCESS_COMMAND") or "").split(";"):
>> +        if x.endswith(" "):
>> +            bb.warn("'%s' ends with a blank, making the task unremovable" % x.strip())
>> +}
>> +
>>   systemd_create_users () {
>>   	for conffile in ${IMAGE_ROOTFS}/usr/lib/sysusers.d/systemd.conf ${IMAGE_ROOTFS}/usr/lib/sysusers.d/systemd-remote.conf; do
>>   		[ -e $conffile ] || continue
> 
> I think this belongs with other sanity tests in insane.bbclass. I'd
> prefer not to have another event handler in the system just for this
> (they're high overhead).
> 
> Cheers,
> 
> Richard
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-07-08 18:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20200708110936.17099-1-kweihmann@outlook.com>
2020-07-08 11:09 ` [PATCH 2/2] rootfs-post: add sanity check for ROOTFS_POSTCMD Konrad Weihmann
2020-07-08 12:08   ` [OE-core] " Richard Purdie
2020-07-08 18:37     ` Konrad Weihmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.