All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bitbake.conf: set FILESYSTEM_PERMS_TABLES using ??=
@ 2024-11-21  9:08 Rasmus Villemoes
  2024-11-22 19:01 ` [OE-core] " Peter Kjellerstedt
  0 siblings, 1 reply; 3+ messages in thread
From: Rasmus Villemoes @ 2024-11-21  9:08 UTC (permalink / raw)
  To: openembedded-core; +Cc: Richard Purdie, Changqing Li, emkan, Rasmus Villemoes

From: Rasmus Villemoes <ravi@prevas.dk>

This default value of FILESYSTEM_PERMS_TABLES is set before
local.conf, ${DISTRO}.conf etc. are parsed. So in order for
${DISTRO}.conf to define the value, it has to use =. But that then
precludes the ${MACHINE}.conf from having final say, unless one there
resorts to some override hack.

Demote this default setting to a weak default. Then local.conf,
${DISTRO}.conf, ${MACHINE}.conf etc. can each use ?= with the expected
precedence.

Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
---
 meta/conf/bitbake.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 02bbf0e7a5..daf2d952e4 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -381,7 +381,7 @@ FILESEXTRAPATHS ?= "__default:"
 #  base_prefix, prefix, exec_prefix, base_bindir, base_sbindir, base_libdir,
 #  datadir, sysconfdir, servicedir, sharedstatedir, localstatedir, infodir,
 #  mandir, docdir, bindir, sbindir, libexecdir, libdir and includedir
-FILESYSTEM_PERMS_TABLES ?=  "files/fs-perms.txt \
+FILESYSTEM_PERMS_TABLES ??= "files/fs-perms.txt \
                              files/fs-perms-volatile-log.txt \
                              files/fs-perms-volatile-tmp.txt"
 
-- 
2.47.0



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

* RE: [OE-core] [PATCH] bitbake.conf: set FILESYSTEM_PERMS_TABLES using ??=
  2024-11-21  9:08 [PATCH] bitbake.conf: set FILESYSTEM_PERMS_TABLES using ??= Rasmus Villemoes
@ 2024-11-22 19:01 ` Peter Kjellerstedt
  2024-11-22 23:02   ` Rasmus Villemoes
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Kjellerstedt @ 2024-11-22 19:01 UTC (permalink / raw)
  To: rasmus.villemoes@prevas.dk,
	openembedded-core@lists.openembedded.org
  Cc: Richard Purdie, Changqing Li, emkan@prevas.dk, Rasmus Villemoes

> -----Original Message-----
> From: openembedded-core@lists.openembedded.org <openembedded-core@lists.openembedded.org> On Behalf Of Rasmus Villemoes via lists.openembedded.org
> Sent: den 21 november 2024 10:09
> To: openembedded-core@lists.openembedded.org
> Cc: Richard Purdie <richard.purdie@linuxfoundation.org>; Changqing Li <changqing.li@windriver.com>; emkan@prevas.dk; Rasmus Villemoes <ravi@prevas.dk>
> Subject: [OE-core] [PATCH] bitbake.conf: set FILESYSTEM_PERMS_TABLES using ??=
> 
> From: Rasmus Villemoes <ravi@prevas.dk>
> 
> This default value of FILESYSTEM_PERMS_TABLES is set before
> local.conf, ${DISTRO}.conf etc. are parsed. So in order for
> ${DISTRO}.conf to define the value, it has to use =. But that then
> precludes the ${MACHINE}.conf from having final say, unless one there
> resorts to some override hack.
> 
> Demote this default setting to a weak default. Then local.conf,
> ${DISTRO}.conf, ${MACHINE}.conf etc. can each use ?= with the expected
> precedence.
> 
> Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
> ---
>  meta/conf/bitbake.conf | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> index 02bbf0e7a5..daf2d952e4 100644
> --- a/meta/conf/bitbake.conf
> +++ b/meta/conf/bitbake.conf
> @@ -381,7 +381,7 @@ FILESEXTRAPATHS ?= "__default:"
>  #  base_prefix, prefix, exec_prefix, base_bindir, base_sbindir, base_libdir,
>  #  datadir, sysconfdir, servicedir, sharedstatedir, localstatedir, infodir,
>  #  mandir, docdir, bindir, sbindir, libexecdir, libdir and includedir
> -FILESYSTEM_PERMS_TABLES ?=  "files/fs-perms.txt \
> +FILESYSTEM_PERMS_TABLES ??= "files/fs-perms.txt \
>                               files/fs-perms-volatile-log.txt \
>                               files/fs-perms-volatile-tmp.txt"
> 
> --
> 2.47.0

Careful now. Changing ?= to ??= means that it is no longer possible to use 
FILESYSTEM_PERMS_TABLES += "..." in, e.g., a ${DISTRO}.conf (something we do in 
our layers). Instead it requires that FILESYSTEM_PERMS_TABLES:append is used.

I guess there are pros and cons to both choices, but if it is changed then 
there needs to be a note about in the migration guide.

//Peter



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

* Re: [OE-core] [PATCH] bitbake.conf: set FILESYSTEM_PERMS_TABLES using ??=
  2024-11-22 19:01 ` [OE-core] " Peter Kjellerstedt
@ 2024-11-22 23:02   ` Rasmus Villemoes
  0 siblings, 0 replies; 3+ messages in thread
From: Rasmus Villemoes @ 2024-11-22 23:02 UTC (permalink / raw)
  To: Peter Kjellerstedt
  Cc: openembedded-core@lists.openembedded.org, Richard Purdie,
	Changqing Li, emkan@prevas.dk

On Fri, Nov 22 2024, Peter Kjellerstedt <peter.kjellerstedt@axis.com> wrote:

>> From: Rasmus Villemoes <ravi@prevas.dk>
>> 
>> This default value of FILESYSTEM_PERMS_TABLES is set before
>> local.conf, ${DISTRO}.conf etc. are parsed. So in order for
>> ${DISTRO}.conf to define the value, it has to use =. But that then
>> precludes the ${MACHINE}.conf from having final say, unless one there
>> resorts to some override hack.
>> 
>> Demote this default setting to a weak default. Then local.conf,
>> ${DISTRO}.conf, ${MACHINE}.conf etc. can each use ?= with the expected
>> precedence.
>> 
>> Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
>> ---
>>  meta/conf/bitbake.conf | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
>> index 02bbf0e7a5..daf2d952e4 100644
>> --- a/meta/conf/bitbake.conf
>> +++ b/meta/conf/bitbake.conf
>> @@ -381,7 +381,7 @@ FILESEXTRAPATHS ?= "__default:"
>>  #  base_prefix, prefix, exec_prefix, base_bindir, base_sbindir, base_libdir,
>>  #  datadir, sysconfdir, servicedir, sharedstatedir, localstatedir, infodir,
>>  #  mandir, docdir, bindir, sbindir, libexecdir, libdir and includedir
>> -FILESYSTEM_PERMS_TABLES ?=  "files/fs-perms.txt \
>> +FILESYSTEM_PERMS_TABLES ??= "files/fs-perms.txt \
>>                               files/fs-perms-volatile-log.txt \
>>                               files/fs-perms-volatile-tmp.txt"
>> 
>
> Careful now. Changing ?= to ??= means that it is no longer possible to use 
> FILESYSTEM_PERMS_TABLES += "..." in, e.g., a ${DISTRO}.conf (something we do in 
> our layers). Instead it requires that FILESYSTEM_PERMS_TABLES:append is used.
>

Ah, good point. I only considered the various forms of assignment people
might have in the distro conf etc, not the various kinds of appends.

What prompted me to send this was that we'd like to have persistent
logs, and the documentation says "remove files/fs-perms-volatile-log.txt
from FILESYSTEM_PERMS_TABLES" - but I/we would rather not do that in our
distro conf by using the :remove operator; we would rather set a default
value for FILESYSTEM_PERMS_TABLES that derived distros or individual
machines could then have final say over.

Commits 91128c651706 and 8d1ae67b89c4 don't offer much explanation why
the individual flags were removed, but it does seem to make things
somewhat less flexible.

As always, an extra level of indirection might be introduced
(i.e. FILESYSTEM_PERMS_TABLE_LOG ??=
"files/fs-perms-volatile-log.txt" and rewriting bitbake.conf's
definition in terms of that...), but I'm loath to actually suggest that
until I understand the actual motivation for those two commits.

Rasmus


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

end of thread, other threads:[~2024-11-22 23:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-21  9:08 [PATCH] bitbake.conf: set FILESYSTEM_PERMS_TABLES using ??= Rasmus Villemoes
2024-11-22 19:01 ` [OE-core] " Peter Kjellerstedt
2024-11-22 23:02   ` Rasmus Villemoes

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.