All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] samhain: rework due to changed oe cache handling
@ 2023-01-27 12:30 Max Krummenacher
  2023-01-27 12:30 ` [meta-security][PATCH] samhain: rework due to changed " Max Krummenacher
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Max Krummenacher @ 2023-01-27 12:30 UTC (permalink / raw)
  To: yocto; +Cc: Max Krummenacher

From: Max Krummenacher <max.krummenacher@toradex.com>

OE-Core changed the cache handling which made the use of ${BPN} fail.

| Parsing recipes...WARNING: .../samhain-standalone.bb: Exception during build_dependencies for do_configure
| WARNING: .../samhain-standalone.bb: Error during finalise of .../samhain-standalone.bb
| ERROR: ExpansionError during parsing .../samhain-standalone.bb
| Traceback (most recent call last):
|   File "Var <MODE_NAME>", line 1, in <module>
| bb.data_smart.ExpansionError: Failure expanding variable MODE_NAME, expression was ${@d.getVar('BPN').split('-')[1]} which triggered exception IndexError: list index out of range
| The variable dependency chain for the failure is: MODE_NAME -> SAMHAIN_MODE -> do_configure

Simplify the setting of MODE_NAME and SAMHAIN_MODE by moving them from
the inc file to the recipe files where we know their values.

Relevant commits to produce the error:
bitbake:
ee89ade5 cache/codeparser: Switch to a new BB_CACHEDIR variable for cache location
oe-core:
7c15e03dd3 bitbake.conf: Add BB_HASH_CODEPARSER_VALS

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
---
 recipes-ids/samhain/samhain-client.bb     | 3 +++
 recipes-ids/samhain/samhain-server.bb     | 3 +++
 recipes-ids/samhain/samhain-standalone.bb | 3 +++
 recipes-ids/samhain/samhain.inc           | 8 --------
 4 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/recipes-ids/samhain/samhain-client.bb b/recipes-ids/samhain/samhain-client.bb
index 2b99e20..0de9c34 100644
--- a/recipes-ids/samhain/samhain-client.bb
+++ b/recipes-ids/samhain/samhain-client.bb
@@ -8,5 +8,8 @@ EXTRA_OECONF += " \
         --with-port=${SAMHAIN_PORT} \
         "
 
+MODE_NAME = "client"
+SAMHAIN_MODE = "client"
+
 RDEPENDS:${PN} = "acl zlib attr bash"
 RCONFLICTS:${PN} = "samhain-standalone"
diff --git a/recipes-ids/samhain/samhain-server.bb b/recipes-ids/samhain/samhain-server.bb
index 51bce07..8bae2d2 100644
--- a/recipes-ids/samhain/samhain-server.bb
+++ b/recipes-ids/samhain/samhain-server.bb
@@ -8,6 +8,9 @@ SRC_URI += "file://samhain-server-volatiles \
             file://samhain-server-volatiles.conf \
            "
 
+MODE_NAME = "server"
+SAMHAIN_MODE = "server"
+
 TARGET_CC_ARCH += "${LDFLAGS}"
 
 do_install:append() {
diff --git a/recipes-ids/samhain/samhain-standalone.bb b/recipes-ids/samhain/samhain-standalone.bb
index b832dc8..ae9ed2b 100644
--- a/recipes-ids/samhain/samhain-standalone.bb
+++ b/recipes-ids/samhain/samhain-standalone.bb
@@ -7,6 +7,9 @@ SRC_URI += "file://samhain-not-run-ptest-on-host.patch \
 
 PROVIDES += "samhain"
 
+MODE_NAME = "standalone"
+SAMHAIN_MODE = "no"
+
 SYSTEMD_SERVICE:${PN} = "samhain.service"
 
 inherit ptest
diff --git a/recipes-ids/samhain/samhain.inc b/recipes-ids/samhain/samhain.inc
index eb8592d..8967d72 100644
--- a/recipes-ids/samhain/samhain.inc
+++ b/recipes-ids/samhain/samhain.inc
@@ -40,14 +40,6 @@ SYSTEMD_PACKAGES = "${PN}"
 SYSTEMD_SERVICE:${PN} = "${INITSCRIPT_NAME}.service"
 SYSTEMD_AUTO_ENABLE = "disable"
 
-# mode mapping:
-# BPN                MODE_NAME   SAMHAIN_MODE
-# samhain-standalone standalone  no
-# samhain-client     client      client
-# samhain-server     server      server
-MODE_NAME = "${@d.getVar('BPN').split('-')[1]}"
-SAMHAIN_MODE = "${@oe.utils.ifelse(d.getVar('MODE_NAME') == 'standalone', 'no', '${MODE_NAME}')}"
-
 # supports mysql|postgresql|oracle|odbc but postgresql is the only one available
 
 PACKAGECONFIG ??= "postgresql ps \
-- 
2.35.3



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

* [meta-security][PATCH] samhain: rework due to changed cache handling
  2023-01-27 12:30 [PATCH] samhain: rework due to changed oe cache handling Max Krummenacher
@ 2023-01-27 12:30 ` Max Krummenacher
  2023-01-27 12:46 ` [PATCH] samhain: rework due to changed oe " Max Krummenacher
  2023-01-27 16:14 ` [yocto] " Richard Purdie
  2 siblings, 0 replies; 6+ messages in thread
From: Max Krummenacher @ 2023-01-27 12:30 UTC (permalink / raw)
  To: yocto; +Cc: Max Krummenacher

From: Max Krummenacher <max.krummenacher@toradex.com>

OE-Core changed the cache handling which made the use of ${BPN} no fail.

| Parsing recipes...WARNING: .../samhain-standalone.bb: Exception during build_dependencies for do_configure
| WARNING: .../samhain-standalone.bb: Error during finalise of .../samhain-standalone.bb
| ERROR: ExpansionError during parsing .../samhain-standalone.bb
| Traceback (most recent call last):
|   File "Var <MODE_NAME>", line 1, in <module>
| bb.data_smart.ExpansionError: Failure expanding variable MODE_NAME, expression was ${@d.getVar('BPN').split('-')[1]} which triggered exception IndexError: list index out of range
| The variable dependency chain for the failure is: MODE_NAME -> SAMHAIN_MODE -> do_configure

Simplify the setting of MODE_NAME and SAMHAIN_MODE by setting them
in the recipe files where we know their values.

bitbake:
ee89ade5 cache/codeparser: Switch to a new BB_CACHEDIR variable for cache location
oe-core:
7c15e03dd3 bitbake.conf: Add BB_HASH_CODEPARSER_VALS

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
---
 recipes-ids/samhain/samhain-client.bb     | 3 +++
 recipes-ids/samhain/samhain-server.bb     | 3 +++
 recipes-ids/samhain/samhain-standalone.bb | 3 +++
 recipes-ids/samhain/samhain.inc           | 8 --------
 4 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/recipes-ids/samhain/samhain-client.bb b/recipes-ids/samhain/samhain-client.bb
index 2b99e20..0de9c34 100644
--- a/recipes-ids/samhain/samhain-client.bb
+++ b/recipes-ids/samhain/samhain-client.bb
@@ -8,5 +8,8 @@ EXTRA_OECONF += " \
         --with-port=${SAMHAIN_PORT} \
         "
 
+MODE_NAME = "client"
+SAMHAIN_MODE = "client"
+
 RDEPENDS:${PN} = "acl zlib attr bash"
 RCONFLICTS:${PN} = "samhain-standalone"
diff --git a/recipes-ids/samhain/samhain-server.bb b/recipes-ids/samhain/samhain-server.bb
index 51bce07..8bae2d2 100644
--- a/recipes-ids/samhain/samhain-server.bb
+++ b/recipes-ids/samhain/samhain-server.bb
@@ -8,6 +8,9 @@ SRC_URI += "file://samhain-server-volatiles \
             file://samhain-server-volatiles.conf \
            "
 
+MODE_NAME = "server"
+SAMHAIN_MODE = "server"
+
 TARGET_CC_ARCH += "${LDFLAGS}"
 
 do_install:append() {
diff --git a/recipes-ids/samhain/samhain-standalone.bb b/recipes-ids/samhain/samhain-standalone.bb
index b832dc8..ae9ed2b 100644
--- a/recipes-ids/samhain/samhain-standalone.bb
+++ b/recipes-ids/samhain/samhain-standalone.bb
@@ -7,6 +7,9 @@ SRC_URI += "file://samhain-not-run-ptest-on-host.patch \
 
 PROVIDES += "samhain"
 
+MODE_NAME = "standalone"
+SAMHAIN_MODE = "no"
+
 SYSTEMD_SERVICE:${PN} = "samhain.service"
 
 inherit ptest
diff --git a/recipes-ids/samhain/samhain.inc b/recipes-ids/samhain/samhain.inc
index eb8592d..8967d72 100644
--- a/recipes-ids/samhain/samhain.inc
+++ b/recipes-ids/samhain/samhain.inc
@@ -40,14 +40,6 @@ SYSTEMD_PACKAGES = "${PN}"
 SYSTEMD_SERVICE:${PN} = "${INITSCRIPT_NAME}.service"
 SYSTEMD_AUTO_ENABLE = "disable"
 
-# mode mapping:
-# BPN                MODE_NAME   SAMHAIN_MODE
-# samhain-standalone standalone  no
-# samhain-client     client      client
-# samhain-server     server      server
-MODE_NAME = "${@d.getVar('BPN').split('-')[1]}"
-SAMHAIN_MODE = "${@oe.utils.ifelse(d.getVar('MODE_NAME') == 'standalone', 'no', '${MODE_NAME}')}"
-
 # supports mysql|postgresql|oracle|odbc but postgresql is the only one available
 
 PACKAGECONFIG ??= "postgresql ps \
-- 
2.35.3



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

* Re: [PATCH] samhain: rework due to changed oe cache handling
  2023-01-27 12:30 [PATCH] samhain: rework due to changed oe cache handling Max Krummenacher
  2023-01-27 12:30 ` [meta-security][PATCH] samhain: rework due to changed " Max Krummenacher
@ 2023-01-27 12:46 ` Max Krummenacher
  2023-01-27 16:14 ` [yocto] " Richard Purdie
  2 siblings, 0 replies; 6+ messages in thread
From: Max Krummenacher @ 2023-01-27 12:46 UTC (permalink / raw)
  To: yocto; +Cc: Max Krummenacher

Hi

Please disregard this duplicate. Forgot to delete a backup copy before
git send-email.
Sorry about the noise.

Max


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

* Re: [yocto] [PATCH] samhain: rework due to changed oe cache handling
  2023-01-27 12:30 [PATCH] samhain: rework due to changed oe cache handling Max Krummenacher
  2023-01-27 12:30 ` [meta-security][PATCH] samhain: rework due to changed " Max Krummenacher
  2023-01-27 12:46 ` [PATCH] samhain: rework due to changed oe " Max Krummenacher
@ 2023-01-27 16:14 ` Richard Purdie
  2023-01-27 20:58   ` Max
  2 siblings, 1 reply; 6+ messages in thread
From: Richard Purdie @ 2023-01-27 16:14 UTC (permalink / raw)
  To: Max Krummenacher, yocto; +Cc: Max Krummenacher, Martin Jansa

On Fri, 2023-01-27 at 13:30 +0100, Max Krummenacher wrote:
> From: Max Krummenacher <max.krummenacher@toradex.com>
> 
> OE-Core changed the cache handling which made the use of ${BPN} fail.
> 
> > Parsing recipes...WARNING: .../samhain-standalone.bb: Exception during build_dependencies for do_configure
> > WARNING: .../samhain-standalone.bb: Error during finalise of .../samhain-standalone.bb
> > ERROR: ExpansionError during parsing .../samhain-standalone.bb
> > Traceback (most recent call last):
> >   File "Var <MODE_NAME>", line 1, in <module>
> > bb.data_smart.ExpansionError: Failure expanding variable MODE_NAME, expression was ${@d.getVar('BPN').split('-')[1]} which triggered exception IndexError: list index out of range
> > The variable dependency chain for the failure is: MODE_NAME -> SAMHAIN_MODE -> do_configure
> 
> Simplify the setting of MODE_NAME and SAMHAIN_MODE by moving them from
> the inc file to the recipe files where we know their values.
> 
> Relevant commits to produce the error:
> bitbake:
> ee89ade5 cache/codeparser: Switch to a new BB_CACHEDIR variable for cache location
> oe-core:
> 7c15e03dd3 bitbake.conf: Add BB_HASH_CODEPARSER_VALS
> 
> Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
> ---
>  recipes-ids/samhain/samhain-client.bb     | 3 +++
>  recipes-ids/samhain/samhain-server.bb     | 3 +++
>  recipes-ids/samhain/samhain-standalone.bb | 3 +++
>  recipes-ids/samhain/samhain.inc           | 8 --------
>  4 files changed, 9 insertions(+), 8 deletions(-)

This is the second report I've seen of this. I'm wondering about
changing the default PN dummy value in bitbake.conf to include a "-"...

Cheers,

Richard


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

* Re: [yocto] [PATCH] samhain: rework due to changed oe cache handling
  2023-01-27 16:14 ` [yocto] " Richard Purdie
@ 2023-01-27 20:58   ` Max
  2023-01-28 15:21     ` akuster808
  0 siblings, 1 reply; 6+ messages in thread
From: Max @ 2023-01-27 20:58 UTC (permalink / raw)
  To: Richard Purdie, yocto; +Cc: Max Krummenacher, Martin Jansa

Am Freitag, dem 27.01.2023 um 16:14 +0000 schrieb Richard Purdie:
> On Fri, 2023-01-27 at 13:30 +0100, Max Krummenacher wrote:
> > From: Max Krummenacher <max.krummenacher@toradex.com>
> > 
> > OE-Core changed the cache handling which made the use of ${BPN} fail.
> > 
> > > Parsing recipes...WARNING: .../samhain-standalone.bb: Exception during build_dependencies for
> > > do_configure
> > > WARNING: .../samhain-standalone.bb: Error during finalise of .../samhain-standalone.bb
> > > ERROR: ExpansionError during parsing .../samhain-standalone.bb
> > > Traceback (most recent call last):
> > >   File "Var <MODE_NAME>", line 1, in <module>
> > > bb.data_smart.ExpansionError: Failure expanding variable MODE_NAME, expression was
> > > ${@d.getVar('BPN').split('-')[1]} which triggered exception IndexError: list index out of
> > > range
> > > The variable dependency chain for the failure is: MODE_NAME -> SAMHAIN_MODE -> do_configure
> > 
> > Simplify the setting of MODE_NAME and SAMHAIN_MODE by moving them from
> > the inc file to the recipe files where we know their values.
> > 
> > Relevant commits to produce the error:
> > bitbake:
> > ee89ade5 cache/codeparser: Switch to a new BB_CACHEDIR variable for cache location
> > oe-core:
> > 7c15e03dd3 bitbake.conf: Add BB_HASH_CODEPARSER_VALS
> > 
> > Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
> > ---
> >  recipes-ids/samhain/samhain-client.bb     | 3 +++
> >  recipes-ids/samhain/samhain-server.bb     | 3 +++
> >  recipes-ids/samhain/samhain-standalone.bb | 3 +++
> >  recipes-ids/samhain/samhain.inc           | 8 --------
> >  4 files changed, 9 insertions(+), 8 deletions(-)
> 
> This is the second report I've seen of this. I'm wondering about
> changing the default PN dummy value in bitbake.conf to include a "-"...
> 
> Cheers,
> 
> Richard

Richards patch [1] fixes the parsing error too. So we can drop this
one unless the simpler logic is worth taking it.

[1] https://lore.kernel.org/all/20230127163308.2649311-1-richard.purdie@linuxfoundation.org/

Thanks Richard.

Regards
Max




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

* Re: [yocto] [PATCH] samhain: rework due to changed oe cache handling
  2023-01-27 20:58   ` Max
@ 2023-01-28 15:21     ` akuster808
  0 siblings, 0 replies; 6+ messages in thread
From: akuster808 @ 2023-01-28 15:21 UTC (permalink / raw)
  To: Max Krummenacher, Richard Purdie, yocto; +Cc: Max Krummenacher, Martin Jansa

Max,

On 1/27/23 3:58 PM, Max Krummenacher wrote:
> Am Freitag, dem 27.01.2023 um 16:14 +0000 schrieb Richard Purdie:
>> On Fri, 2023-01-27 at 13:30 +0100, Max Krummenacher wrote:
>>> From: Max Krummenacher <max.krummenacher@toradex.com>
>>>
>>> OE-Core changed the cache handling which made the use of ${BPN} fail.
>>>
>>>> Parsing recipes...WARNING: .../samhain-standalone.bb: Exception during build_dependencies for
>>>> do_configure
>>>> WARNING: .../samhain-standalone.bb: Error during finalise of .../samhain-standalone.bb
>>>> ERROR: ExpansionError during parsing .../samhain-standalone.bb
>>>> Traceback (most recent call last):
>>>>    File "Var <MODE_NAME>", line 1, in <module>
>>>> bb.data_smart.ExpansionError: Failure expanding variable MODE_NAME, expression was
>>>> ${@d.getVar('BPN').split('-')[1]} which triggered exception IndexError: list index out of
>>>> range
>>>> The variable dependency chain for the failure is: MODE_NAME -> SAMHAIN_MODE -> do_configure
>>> Simplify the setting of MODE_NAME and SAMHAIN_MODE by moving them from
>>> the inc file to the recipe files where we know their values.
>>>
>>> Relevant commits to produce the error:
>>> bitbake:
>>> ee89ade5 cache/codeparser: Switch to a new BB_CACHEDIR variable for cache location
>>> oe-core:
>>> 7c15e03dd3 bitbake.conf: Add BB_HASH_CODEPARSER_VALS
>>>
>>> Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
>>> ---
>>>   recipes-ids/samhain/samhain-client.bb     | 3 +++
>>>   recipes-ids/samhain/samhain-server.bb     | 3 +++
>>>   recipes-ids/samhain/samhain-standalone.bb | 3 +++
>>>   recipes-ids/samhain/samhain.inc           | 8 --------
>>>   4 files changed, 9 insertions(+), 8 deletions(-)
>> This is the second report I've seen of this. I'm wondering about
>> changing the default PN dummy value in bitbake.conf to include a "-"...
>>
>> Cheers,
>>
>> Richard
> Richards patch [1] fixes the parsing error too. So we can drop this
> one unless the simpler logic is worth taking it.
>
> [1] https://lore.kernel.org/all/20230127163308.2649311-1-richard.purdie@linuxfoundation.org/

I am going the simpler logic so I will be taking your patch.

thanks,
Armin
>
> Thanks Richard.
>
> Regards
> Max
>
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#59087): https://lists.yoctoproject.org/g/yocto/message/59087
> Mute This Topic: https://lists.yoctoproject.org/mt/96564509/3616698
> Group Owner: yocto+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [akuster808@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>



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

end of thread, other threads:[~2023-01-28 15:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-27 12:30 [PATCH] samhain: rework due to changed oe cache handling Max Krummenacher
2023-01-27 12:30 ` [meta-security][PATCH] samhain: rework due to changed " Max Krummenacher
2023-01-27 12:46 ` [PATCH] samhain: rework due to changed oe " Max Krummenacher
2023-01-27 16:14 ` [yocto] " Richard Purdie
2023-01-27 20:58   ` Max
2023-01-28 15:21     ` akuster808

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.