diff mbox series

[meta-security] layer: add more memory for Qemu machines

Message ID 20230628125609.1327477-1-akuster808@gmail.com
State New
Headers show
Series [meta-security] layer: add more memory for Qemu machines | expand

Commit Message

akuster808 June 28, 2023, 12:56 p.m. UTC
Signed-off-by: Armin Kuster <akuster808@gmail.com>
---
 conf/layer.conf | 3 +++
 1 file changed, 3 insertions(+)

Comments

Richard Purdie June 28, 2023, 4:47 p.m. UTC | #1
On Wed, 2023-06-28 at 08:56 -0400, Armin Kuster wrote:
> Signed-off-by: Armin Kuster <akuster808@gmail.com>
> ---
>  conf/layer.conf | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/conf/layer.conf b/conf/layer.conf
> index 334a945..5f289cb 100644
> --- a/conf/layer.conf
> +++ b/conf/layer.conf
> @@ -28,4 +28,7 @@ INHERIT += "sanity-meta-security"
>  
>  QB_KERNEL_CMDLINE_APPEND = " ${@bb.utils.contains('DISTRO_FEATURES', 'apparmor', 'apparmor=1 security=apparmor', '', d)}"
>  
> +# We need more mem to run many apps in this layer
> +QB_MEM="-m 2048"
> +
>  addpylib ${LAYERDIR}/lib oeqa

Putting that unconditionally in a layer.conf is a pretty poor thing to
do for usability IMO as it effectively forces that decision on anyone
including the layer. There has to be a better way to handle that, at
least conditionally on some override?

Cheers,

Richard
akuster808 June 28, 2023, 6:18 p.m. UTC | #2
On 6/28/23 12:47 PM, Richard Purdie wrote:
> On Wed, 2023-06-28 at 08:56 -0400, Armin Kuster wrote:
>> Signed-off-by: Armin Kuster <akuster808@gmail.com>
>> ---
>>   conf/layer.conf | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/conf/layer.conf b/conf/layer.conf
>> index 334a945..5f289cb 100644
>> --- a/conf/layer.conf
>> +++ b/conf/layer.conf
>> @@ -28,4 +28,7 @@ INHERIT += "sanity-meta-security"
>>   
>>   QB_KERNEL_CMDLINE_APPEND = " ${@bb.utils.contains('DISTRO_FEATURES', 'apparmor', 'apparmor=1 security=apparmor', '', d)}"
>>   
>> +# We need more mem to run many apps in this layer
>> +QB_MEM="-m 2048"
>> +
>>   addpylib ${LAYERDIR}/lib oeqa
> Putting that unconditionally in a layer.conf is a pretty poor thing to
> do for usability IMO as it effectively forces that decision on anyone
> including the layer. There has to be a better way to handle that, at
> least conditionally on some override?

Yep. I moved it and the other qemu params to the image instead. That 
patch has not been sent.

thanks,
Armin
>
> Cheers,
>
> Richard
>
>
Mikko Rapeli June 29, 2023, 10:45 a.m. UTC | #3
Hi,

On Wed, Jun 28, 2023 at 05:47:21PM +0100, Richard Purdie wrote:
> On Wed, 2023-06-28 at 08:56 -0400, Armin Kuster wrote:
> > Signed-off-by: Armin Kuster <akuster808@gmail.com>
> > ---
> >  conf/layer.conf | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/conf/layer.conf b/conf/layer.conf
> > index 334a945..5f289cb 100644
> > --- a/conf/layer.conf
> > +++ b/conf/layer.conf
> > @@ -28,4 +28,7 @@ INHERIT += "sanity-meta-security"
> >  
> >  QB_KERNEL_CMDLINE_APPEND = " ${@bb.utils.contains('DISTRO_FEATURES', 'apparmor', 'apparmor=1 security=apparmor', '', d)}"
> >  
> > +# We need more mem to run many apps in this layer
> > +QB_MEM="-m 2048"
> > +
> >  addpylib ${LAYERDIR}/lib oeqa
> 
> Putting that unconditionally in a layer.conf is a pretty poor thing to
> do for usability IMO as it effectively forces that decision on anyone
> including the layer. There has to be a better way to handle that, at
> least conditionally on some override?

Currently these belong logically to machine config but what about generic
machine targets. Could an image config define how much memory is needed
to run the image on qemu?

Cheers,

-Mikko
Richard Purdie June 29, 2023, 10:48 a.m. UTC | #4
On Thu, 2023-06-29 at 13:45 +0300, Mikko Rapeli wrote:
> Hi,
> 
> On Wed, Jun 28, 2023 at 05:47:21PM +0100, Richard Purdie wrote:
> > On Wed, 2023-06-28 at 08:56 -0400, Armin Kuster wrote:
> > > Signed-off-by: Armin Kuster <akuster808@gmail.com>
> > > ---
> > >  conf/layer.conf | 3 +++
> > >  1 file changed, 3 insertions(+)
> > > 
> > > diff --git a/conf/layer.conf b/conf/layer.conf
> > > index 334a945..5f289cb 100644
> > > --- a/conf/layer.conf
> > > +++ b/conf/layer.conf
> > > @@ -28,4 +28,7 @@ INHERIT += "sanity-meta-security"
> > >  
> > >  QB_KERNEL_CMDLINE_APPEND = " ${@bb.utils.contains('DISTRO_FEATURES', 'apparmor', 'apparmor=1 security=apparmor', '', d)}"
> > >  
> > > +# We need more mem to run many apps in this layer
> > > +QB_MEM="-m 2048"
> > > +
> > >  addpylib ${LAYERDIR}/lib oeqa
> > 
> > Putting that unconditionally in a layer.conf is a pretty poor thing to
> > do for usability IMO as it effectively forces that decision on anyone
> > including the layer. There has to be a better way to handle that, at
> > least conditionally on some override?
> 
> Currently these belong logically to machine config but what about generic
> machine targets. Could an image config define how much memory is needed
> to run the image on qemu?

I believe Armin did move these to the image recipe which is what we do
in core in some cases for this too. I think that makes more sense.

Cheers,

Richard
Mikko Rapeli June 29, 2023, 10:48 a.m. UTC | #5
Hi,

On Thu, Jun 29, 2023 at 01:45:41PM +0300, Mikko Rapeli via lists.yoctoproject.org wrote:
> Currently these belong logically to machine config but what about generic
> machine targets. Could an image config define how much memory is needed
> to run the image on qemu?

Done already in Message-Id: <20230628192752.3209428-1-akuster808@gmail.com>,
sorry for the noise...

Cheers,

-Mikko
Ross Burton June 29, 2023, 2:12 p.m. UTC | #6
On 29 Jun 2023, at 12:45, Mikko Rapeli via lists.yoctoproject.org <mikko.rapeli=linaro.org@lists.yoctoproject.org> wrote:
> On Wed, Jun 28, 2023 at 05:47:21PM +0100, Richard Purdie wrote:
>> On Wed, 2023-06-28 at 08:56 -0400, Armin Kuster wrote:
>>> Signed-off-by: Armin Kuster <akuster808@gmail.com>
>>> ---
>>> conf/layer.conf | 3 +++
>>> 1 file changed, 3 insertions(+)
>>> 
>>> diff --git a/conf/layer.conf b/conf/layer.conf
>>> index 334a945..5f289cb 100644
>>> --- a/conf/layer.conf
>>> +++ b/conf/layer.conf
>>> @@ -28,4 +28,7 @@ INHERIT += "sanity-meta-security"
>>> 
>>> QB_KERNEL_CMDLINE_APPEND = " ${@bb.utils.contains('DISTRO_FEATURES', 'apparmor', 'apparmor=1 security=apparmor', '', d)}"
>>> 
>>> +# We need more mem to run many apps in this layer
>>> +QB_MEM="-m 2048"
>>> +
>>> addpylib ${LAYERDIR}/lib oeqa
>> 
>> Putting that unconditionally in a layer.conf is a pretty poor thing to
>> do for usability IMO as it effectively forces that decision on anyone
>> including the layer. There has to be a better way to handle that, at
>> least conditionally on some override?
> 
> Currently these belong logically to machine config but what about generic
> machine targets. Could an image config define how much memory is needed
> to run the image on qemu?

$ git grep -l  QB_MEM
classes-recipe/baremetal-image.bbclass
classes-recipe/qemuboot.bbclass
recipes-core/images/build-appliance-image_15.0.0.bb
recipes-core/images/core-image-ptest.bb
recipes-graphics/images/core-image-weston-sdk.bb
recipes-graphics/images/core-image-weston.bb
recipes-graphics/images/core-image-x11.bb
recipes-sato/images/core-image-sato-sdk.bb
recipes-sato/images/core-image-sato.bb

Yes, you can set that in an image recipe.

Ross
diff mbox series

Patch

diff --git a/conf/layer.conf b/conf/layer.conf
index 334a945..5f289cb 100644
--- a/conf/layer.conf
+++ b/conf/layer.conf
@@ -28,4 +28,7 @@  INHERIT += "sanity-meta-security"
 
 QB_KERNEL_CMDLINE_APPEND = " ${@bb.utils.contains('DISTRO_FEATURES', 'apparmor', 'apparmor=1 security=apparmor', '', d)}"
 
+# We need more mem to run many apps in this layer
+QB_MEM="-m 2048"
+
 addpylib ${LAYERDIR}/lib oeqa