public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] image-account-extenstion: rebuild on varflag changes
@ 2024-04-17  7:15 B. Niedermayr
  2024-04-17  8:01 ` Niedermayr, BENEDIKT
  2024-04-17 21:27 ` MOESSBAUER, Felix
  0 siblings, 2 replies; 7+ messages in thread
From: B. Niedermayr @ 2024-04-17  7:15 UTC (permalink / raw)
  To: isar-users

From: Benedikt Niedermayr <benedikt.niedermayr@siemens.com>

When adding items (e.g. foo) to the USER or GROUP variables, the
buildsystem automatically creates new variables (USER_foo).
One can then set these variables, or more precise, the variable
flags (e.g. USER_foo[password]) to control differents aspects
of the user creation.
Isar does not trigger a rebuild when applying changes to these
variable flags since they are not recognized by the
tasks signature generation.

Signed-off-by: Benedikt Niedermayr <benedikt.niedermayr@siemens.com>
---
 meta/classes/image-account-extension.bbclass | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/meta/classes/image-account-extension.bbclass b/meta/classes/image-account-extension.bbclass
index 3d4e1d1dd175..7cfd5a6b9de5 100644
--- a/meta/classes/image-account-extension.bbclass
+++ b/meta/classes/image-account-extension.bbclass
@@ -8,6 +8,16 @@
 USERS ??= ""
 GROUPS ??= ""
 
+python() {
+    for entry in (d.getVar("GROUPS") or "").split():
+        group_entry = "GROUP_{}".format(entry)
+        d.appendVarFlag("image_postprocess_accounts", "vardeps", " {}".format(group_entry))
+
+    for entry in (d.getVar("USERS") or "").split():
+        user_entry = "USER_{}".format(entry)
+        d.appendVarFlag("image_postprocess_accounts", "vardeps", " {}".format(user_entry))
+}
+
 def image_create_groups(d: "DataSmart") -> None:
     """Creates the groups defined in the ``GROUPS`` bitbake variable.
 
@@ -134,7 +144,7 @@ python image_postprocess_accounts() {
     import os
     if d.getVar("SOURCE_DATE_EPOCH") != None:
         os.environ["SOURCE_DATE_EPOCH"] = d.getVar("SOURCE_DATE_EPOCH")
- 
+
     image_create_groups(d)
     image_create_users(d)
 }
-- 
2.34.1


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

* Re: [PATCH] image-account-extenstion: rebuild on varflag changes
  2024-04-17  7:15 [PATCH] image-account-extenstion: rebuild on varflag changes B. Niedermayr
@ 2024-04-17  8:01 ` Niedermayr, BENEDIKT
  2024-04-17  8:30   ` Baurzhan Ismagulov
  2024-04-17 21:27 ` MOESSBAUER, Felix
  1 sibling, 1 reply; 7+ messages in thread
From: Niedermayr, BENEDIKT @ 2024-04-17  8:01 UTC (permalink / raw)
  To: isar-users

On Wed, 2024-04-17 at 09:15 +0200, 'B. Niedermayr' via isar-users wrote:
> From: Benedikt Niedermayr <benedikt.niedermayr@siemens.com>
> 
> When adding items (e.g. foo) to the USER or GROUP variables, the
> buildsystem automatically creates new variables (USER_foo).
> One can then set these variables, or more precise, the variable
> flags (e.g. USER_foo[password]) to control differents aspects
> of the user creation.
> Isar does not trigger a rebuild when applying changes to these
> variable flags since they are not recognized by the
> tasks signature generation.
> 
> Signed-off-by: Benedikt Niedermayr <benedikt.niedermayr@siemens.com>
> ---
>  meta/classes/image-account-extension.bbclass | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/classes/image-account-extension.bbclass b/meta/classes/image-account-
> extension.bbclass
> index 3d4e1d1dd175..7cfd5a6b9de5 100644
> --- a/meta/classes/image-account-extension.bbclass
> +++ b/meta/classes/image-account-extension.bbclass
> @@ -8,6 +8,16 @@
>  USERS ??= ""
>  GROUPS ??= ""
>  
> +python() {
> +    for entry in (d.getVar("GROUPS") or "").split():
> +        group_entry = "GROUP_{}".format(entry)
> +        d.appendVarFlag("image_postprocess_accounts", "vardeps", " {}".format(group_entry))
> +
> +    for entry in (d.getVar("USERS") or "").split():
> +        user_entry = "USER_{}".format(entry)
> +        d.appendVarFlag("image_postprocess_accounts", "vardeps", " {}".format(user_entry))
> +}
> +
>  def image_create_groups(d: "DataSmart") -> None:
>      """Creates the groups defined in the ``GROUPS`` bitbake variable.
>  
> @@ -134,7 +144,7 @@ python image_postprocess_accounts() {
>      import os
>      if d.getVar("SOURCE_DATE_EPOCH") != None:
>          os.environ["SOURCE_DATE_EPOCH"] = d.getVar("SOURCE_DATE_EPOCH")
> - 
> +
>      image_create_groups(d)
>      image_create_users(d)
>  }
> -- 
> 2.34.1
> 
Sorry for tripple posting!
Mails got stuck in the smpt server...


regards,
Benedikt



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

* Re: [PATCH] image-account-extenstion: rebuild on varflag changes
  2024-04-17  8:01 ` Niedermayr, BENEDIKT
@ 2024-04-17  8:30   ` Baurzhan Ismagulov
  0 siblings, 0 replies; 7+ messages in thread
From: Baurzhan Ismagulov @ 2024-04-17  8:30 UTC (permalink / raw)
  To: isar-users

On 2024-04-17 08:01, 'Niedermayr, BENEDIKT' via isar-users wrote:
> Sorry for tripple posting!
> Mails got stuck in the smpt server...

No problem. We moderate mails from new addresses to keep the list open (no
subscription required) and avoid spam.

With kind regards,
Baurzhan

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

* Re: [PATCH] image-account-extenstion: rebuild on varflag changes
  2024-04-17  7:15 [PATCH] image-account-extenstion: rebuild on varflag changes B. Niedermayr
  2024-04-17  8:01 ` Niedermayr, BENEDIKT
@ 2024-04-17 21:27 ` MOESSBAUER, Felix
  2024-04-18  7:13   ` Niedermayr, BENEDIKT
  1 sibling, 1 reply; 7+ messages in thread
From: MOESSBAUER, Felix @ 2024-04-17 21:27 UTC (permalink / raw)
  To: Niedermayr, BENEDIKT, isar-users

On Wed, 2024-04-17 at 09:15 +0200, 'B. Niedermayr' via isar-users
wrote:
> From: Benedikt Niedermayr <benedikt.niedermayr@siemens.com>
> 
> When adding items (e.g. foo) to the USER or GROUP variables, the
> buildsystem automatically creates new variables (USER_foo).
> One can then set these variables, or more precise, the variable
> flags (e.g. USER_foo[password]) to control differents aspects
> of the user creation.
> Isar does not trigger a rebuild when applying changes to these
> variable flags since they are not recognized by the
> tasks signature generation.
> 
> Signed-off-by: Benedikt Niedermayr <benedikt.niedermayr@siemens.com>
> ---
>  meta/classes/image-account-extension.bbclass | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/classes/image-account-extension.bbclass
> b/meta/classes/image-account-extension.bbclass
> index 3d4e1d1dd175..7cfd5a6b9de5 100644
> --- a/meta/classes/image-account-extension.bbclass
> +++ b/meta/classes/image-account-extension.bbclass
> @@ -8,6 +8,16 @@
>  USERS ??= ""
>  GROUPS ??= ""
>  
> +python() {
> +    for entry in (d.getVar("GROUPS") or "").split():
> +        group_entry = "GROUP_{}".format(entry)
> +        d.appendVarFlag("image_postprocess_accounts", "vardeps", "
> {}".format(group_entry))
> +
> +    for entry in (d.getVar("USERS") or "").split():
> +        user_entry = "USER_{}".format(entry)
> +        d.appendVarFlag("image_postprocess_accounts", "vardeps", "
> {}".format(user_entry))
> +}
> +
>  def image_create_groups(d: "DataSmart") -> None:
>      """Creates the groups defined in the ``GROUPS`` bitbake
> variable.
>  

Hi Benedikt,

while fixing this please also add a dependency to the USERS, GROUPS and
SDE variable as well. It looks like all that was missed in the initial
implementation.

Best regards,
Felix

> @@ -134,7 +144,7 @@ python image_postprocess_accounts() {
>      import os
>      if d.getVar("SOURCE_DATE_EPOCH") != None:
>          os.environ["SOURCE_DATE_EPOCH"] =
> d.getVar("SOURCE_DATE_EPOCH")
> - 
> +
>      image_create_groups(d)
>      image_create_users(d)
>  }
> -- 
> 2.34.1
> 

-- 
Siemens AG, Technology
Linux Expert Center



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

* Re: [PATCH] image-account-extenstion: rebuild on varflag changes
  2024-04-17 21:27 ` MOESSBAUER, Felix
@ 2024-04-18  7:13   ` Niedermayr, BENEDIKT
  0 siblings, 0 replies; 7+ messages in thread
From: Niedermayr, BENEDIKT @ 2024-04-18  7:13 UTC (permalink / raw)
  To: isar-users, MOESSBAUER, Felix

On Wed, 2024-04-17 at 21:27 +0000, Moessbauer, Felix (T CED OES-DE) wrote:
> On Wed, 2024-04-17 at 09:15 +0200, 'B. Niedermayr' via isar-users
> wrote:
> > From: Benedikt Niedermayr <benedikt.niedermayr@siemens.com>
> > 
> > When adding items (e.g. foo) to the USER or GROUP variables, the
> > buildsystem automatically creates new variables (USER_foo).
> > One can then set these variables, or more precise, the variable
> > flags (e.g. USER_foo[password]) to control differents aspects
> > of the user creation.
> > Isar does not trigger a rebuild when applying changes to these
> > variable flags since they are not recognized by the
> > tasks signature generation.
> > 
> > Signed-off-by: Benedikt Niedermayr <benedikt.niedermayr@siemens.com>
> > ---
> >  meta/classes/image-account-extension.bbclass | 12 +++++++++++-
> >  1 file changed, 11 insertions(+), 1 deletion(-)
> > 
> > diff --git a/meta/classes/image-account-extension.bbclass
> > b/meta/classes/image-account-extension.bbclass
> > index 3d4e1d1dd175..7cfd5a6b9de5 100644
> > --- a/meta/classes/image-account-extension.bbclass
> > +++ b/meta/classes/image-account-extension.bbclass
> > @@ -8,6 +8,16 @@
> >  USERS ??= ""
> >  GROUPS ??= ""
> >  
> > +python() {
> > +    for entry in (d.getVar("GROUPS") or "").split():
> > +        group_entry = "GROUP_{}".format(entry)
> > +        d.appendVarFlag("image_postprocess_accounts", "vardeps", "
> > {}".format(group_entry))
> > +
> > +    for entry in (d.getVar("USERS") or "").split():
> > +        user_entry = "USER_{}".format(entry)
> > +        d.appendVarFlag("image_postprocess_accounts", "vardeps", "
> > {}".format(user_entry))
> > +}
> > +
> >  def image_create_groups(d: "DataSmart") -> None:
> >      """Creates the groups defined in the ``GROUPS`` bitbake
> > variable.
> >  
> 
> Hi Benedikt,
> 
> while fixing this please also add a dependency to the USERS, GROUPS and
> SDE variable as well. It looks like all that was missed in the initial
> implementation.
> 
> Best regards,
> Felix
> 
> > @@ -134,7 +144,7 @@ python image_postprocess_accounts() {
> >      import os
> >      if d.getVar("SOURCE_DATE_EPOCH") != None:
> >          os.environ["SOURCE_DATE_EPOCH"] =
> > d.getVar("SOURCE_DATE_EPOCH")
> > - 
> > +
> >      image_create_groups(d)
> >      image_create_users(d)
> >  }
> > -- 
> > 2.34.1
> > 
> 
> -- 
> Siemens AG, Technology
> Linux Expert Center
> 
> 
Hi Felix,

yes makes sense. Thanks for the input. I'll send a v2.


Regards,
Benedikt


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

* [PATCH] image-account-extenstion: rebuild on varflag changes
@ 2024-04-17  7:58 B. Niedermayr
  0 siblings, 0 replies; 7+ messages in thread
From: B. Niedermayr @ 2024-04-17  7:58 UTC (permalink / raw)
  To: isar-users

From: Benedikt Niedermayr <benedikt.niedermayr@siemens.com>

When adding items (e.g. foo) to the USER or GROUP variables, the
buildsystem automatically creates new variables (USER_foo).
One can then set these variables, or more precise, the variable
flags (e.g. USER_foo[password]) to control differents aspects
of the user creation.
Isar does not trigger a rebuild when applying changes to these
variable flags since they are not recognized by the
tasks signature generation.

Signed-off-by: Benedikt Niedermayr <benedikt.niedermayr@siemens.com>
---
 meta/classes/image-account-extension.bbclass | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/meta/classes/image-account-extension.bbclass b/meta/classes/image-account-extension.bbclass
index 3d4e1d1dd175..7cfd5a6b9de5 100644
--- a/meta/classes/image-account-extension.bbclass
+++ b/meta/classes/image-account-extension.bbclass
@@ -8,6 +8,16 @@
 USERS ??= ""
 GROUPS ??= ""
 
+python() {
+    for entry in (d.getVar("GROUPS") or "").split():
+        group_entry = "GROUP_{}".format(entry)
+        d.appendVarFlag("image_postprocess_accounts", "vardeps", " {}".format(group_entry))
+
+    for entry in (d.getVar("USERS") or "").split():
+        user_entry = "USER_{}".format(entry)
+        d.appendVarFlag("image_postprocess_accounts", "vardeps", " {}".format(user_entry))
+}
+
 def image_create_groups(d: "DataSmart") -> None:
     """Creates the groups defined in the ``GROUPS`` bitbake variable.
 
@@ -134,7 +144,7 @@ python image_postprocess_accounts() {
     import os
     if d.getVar("SOURCE_DATE_EPOCH") != None:
         os.environ["SOURCE_DATE_EPOCH"] = d.getVar("SOURCE_DATE_EPOCH")
- 
+
     image_create_groups(d)
     image_create_users(d)
 }
-- 
2.34.1


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

* [PATCH] image-account-extenstion: rebuild on varflag changes
@ 2024-04-17  7:34 B. Niedermayr
  0 siblings, 0 replies; 7+ messages in thread
From: B. Niedermayr @ 2024-04-17  7:34 UTC (permalink / raw)
  To: isar-users

From: Benedikt Niedermayr <benedikt.niedermayr@siemens.com>

When adding items (e.g. foo) to the USER or GROUP variables, the
buildsystem automatically creates new variables (USER_foo).
One can then set these variables, or more precise, the variable
flags (e.g. USER_foo[password]) to control differents aspects
of the user creation.
Isar does not trigger a rebuild when applying changes to these
variable flags since they are not recognized by the
tasks signature generation.

Signed-off-by: Benedikt Niedermayr <benedikt.niedermayr@siemens.com>
---
 meta/classes/image-account-extension.bbclass | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/meta/classes/image-account-extension.bbclass b/meta/classes/image-account-extension.bbclass
index 3d4e1d1dd175..7cfd5a6b9de5 100644
--- a/meta/classes/image-account-extension.bbclass
+++ b/meta/classes/image-account-extension.bbclass
@@ -8,6 +8,16 @@
 USERS ??= ""
 GROUPS ??= ""
 
+python() {
+    for entry in (d.getVar("GROUPS") or "").split():
+        group_entry = "GROUP_{}".format(entry)
+        d.appendVarFlag("image_postprocess_accounts", "vardeps", " {}".format(group_entry))
+
+    for entry in (d.getVar("USERS") or "").split():
+        user_entry = "USER_{}".format(entry)
+        d.appendVarFlag("image_postprocess_accounts", "vardeps", " {}".format(user_entry))
+}
+
 def image_create_groups(d: "DataSmart") -> None:
     """Creates the groups defined in the ``GROUPS`` bitbake variable.
 
@@ -134,7 +144,7 @@ python image_postprocess_accounts() {
     import os
     if d.getVar("SOURCE_DATE_EPOCH") != None:
         os.environ["SOURCE_DATE_EPOCH"] = d.getVar("SOURCE_DATE_EPOCH")
- 
+
     image_create_groups(d)
     image_create_users(d)
 }
-- 
2.34.1


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

end of thread, other threads:[~2024-04-18  7:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-17  7:15 [PATCH] image-account-extenstion: rebuild on varflag changes B. Niedermayr
2024-04-17  8:01 ` Niedermayr, BENEDIKT
2024-04-17  8:30   ` Baurzhan Ismagulov
2024-04-17 21:27 ` MOESSBAUER, Felix
2024-04-18  7:13   ` Niedermayr, BENEDIKT
2024-04-17  7:34 B. Niedermayr
2024-04-17  7:58 B. Niedermayr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox