From: "B. Niedermayr" <benedikt.niedermayr@siemens.com>
To: isar-users@googlegroups.com
Subject: [PATCH] image-account-extenstion: rebuild on varflag changes
Date: Wed, 17 Apr 2024 09:34:16 +0200 [thread overview]
Message-ID: <20240417073416.3742334-1-benedikt.niedermayr@siemens.com> (raw)
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
next reply other threads:[~2024-04-17 7:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-17 7:34 B. Niedermayr [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-04-17 7:58 B. Niedermayr
2024-04-17 7:15 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240417073416.3742334-1-benedikt.niedermayr@siemens.com \
--to=benedikt.niedermayr@siemens.com \
--cc=isar-users@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox