summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2024-01-02 17:22:14 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-01-18 10:13:41 +0000
commit0ffff2c1f80a9b79b133d787764bab164d9abd70 (patch)
tree3a7fb201a4de275bb83bfb9d4e7fa26cfb356f8e /meta/lib
parent72befdb12568fbc642022ef0a23b269c5b37a638 (diff)
downloadopenembedded-core-0ffff2c1f80a9b79b133d787764bab164d9abd70.tar.gz
rootfs-postcommands: Try and improve ordering constraints
The current code is in race to see who can set things last. This isn't scalable or sustainable and problemtic in the face of inherit ordering changes. Move the ordering issue into the actual code execution, which isn't ideal but the best of several bad options and at least lets us drop the anonymous python. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oe/rootfs.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index 3f27164536..8cd48f9450 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -194,6 +194,18 @@ class Rootfs(object, metaclass=ABCMeta):
post_process_cmds = self.d.getVar("ROOTFS_POSTPROCESS_COMMAND")
rootfs_post_install_cmds = self.d.getVar('ROOTFS_POSTINSTALL_COMMAND')
+ def make_last(command, commands):
+ commands = commands.split()
+ if command in commands:
+ commands.remove(command)
+ commands.append(command)
+ return "".join(commands)
+
+ # We want this to run as late as possible, in particular after
+ # systemd_sysusers_create and set_user_group. Using :append is not enough
+ make_last("tidy_shadowutils_files", post_process_cmds)
+ make_last("rootfs_reproducible", post_process_cmds)
+
execute_pre_post_process(self.d, pre_process_cmds)
if self.progress_reporter: