From: "'Felix Moessbauer' via isar-users" <isar-users@googlegroups.com>
To: isar-users@googlegroups.com
Cc: adriaan.schmidt@siemens.com,
Felix Moessbauer <felix.moessbauer@siemens.com>,
Clara Kowalsky <clara.kowalsky@siemens.com>
Subject: [PATCH v2 1/1] fix: rebuild rootfs on change of USERS
Date: Fri, 11 Apr 2025 13:26:18 +0200 [thread overview]
Message-ID: <20250411112618.3992560-1-felix.moessbauer@siemens.com> (raw)
In case a change to the Isar created users is done, this currently
only re-triggers the do_rootfs_postprocess task. This task changes the
rootfs (e.g. home dirs are moved) and by that needs to operate on a
clean one. Otherwise old homedirs might still remain in the final rootfs
or move operations are not possible.
We fix this by ensuring that the do_rootfs_install task is executed
whenever a change to USERS is done. By that, we enter the
do_rootfs_postinstall with a clean rootfs.
Reported-by: Clara Kowalsky <clara.kowalsky@siemens.com>
Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
Changes since v1:
- Also add dependency to USER_<x> for all x in USERS
meta/classes/image-account-extension.bbclass | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/meta/classes/image-account-extension.bbclass b/meta/classes/image-account-extension.bbclass
index ea956cd5..3c461b1a 100644
--- a/meta/classes/image-account-extension.bbclass
+++ b/meta/classes/image-account-extension.bbclass
@@ -8,6 +8,10 @@
USERS ??= ""
GROUPS ??= ""
+# rebuild rootfs on change of USERS as homes might be moved / created
+# no need to depend on GROUPS as they don't create directories
+# groups need to be created before users, hence do not move the user creation into
+# the do_rootfs_install task but only add a dependency
python() {
for entry in (d.getVar("GROUPS") or "").split():
group_entry = "GROUP_{}".format(entry)
@@ -16,7 +20,9 @@ python() {
for entry in (d.getVar("USERS") or "").split():
user_entry = "USER_{}".format(entry)
d.appendVarFlag("image_postprocess_accounts", "vardeps", " {}".format(user_entry))
+ d.appendVarFlag("do_rootfs_install", "vardeps", " {}".format(user_entry))
}
+do_rootfs_install[vardeps] += "USERS"
def image_create_groups(d: "DataSmart") -> None:
"""Creates the groups defined in the ``GROUPS`` bitbake variable.
--
2.39.5
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/20250411112618.3992560-1-felix.moessbauer%40siemens.com.
next reply other threads:[~2025-04-11 11:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-11 11:26 'Felix Moessbauer' via isar-users [this message]
2025-04-11 15:56 ` 'Clara Kowalsky' via isar-users
2025-04-29 8:31 ` 'MOESSBAUER, Felix' via isar-users
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=20250411112618.3992560-1-felix.moessbauer@siemens.com \
--to=isar-users@googlegroups.com \
--cc=adriaan.schmidt@siemens.com \
--cc=clara.kowalsky@siemens.com \
--cc=felix.moessbauer@siemens.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