diff options
Diffstat (limited to 'meta/classes/rootfs-postcommands.bbclass')
-rw-r--r-- | meta/classes/rootfs-postcommands.bbclass | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass index 8d48a2d1d9..53a4fda4b1 100644 --- a/meta/classes/rootfs-postcommands.bbclass +++ b/meta/classes/rootfs-postcommands.bbclass | |||
@@ -30,6 +30,23 @@ ROOTFS_POSTPROCESS_COMMAND += 'empty_var_volatile;' | |||
30 | SSH_DISABLE_DNS_LOOKUP ?= " ssh_disable_dns_lookup ; " | 30 | SSH_DISABLE_DNS_LOOKUP ?= " ssh_disable_dns_lookup ; " |
31 | ROOTFS_POSTPROCESS_COMMAND_append_qemuall = "${SSH_DISABLE_DNS_LOOKUP}" | 31 | ROOTFS_POSTPROCESS_COMMAND_append_qemuall = "${SSH_DISABLE_DNS_LOOKUP}" |
32 | 32 | ||
33 | # Sort the user and group entries in /etc by ID in order to make the content | ||
34 | # deterministic. Package installs are not deterministic, causing the ordering | ||
35 | # of entries to change between builds. In case that this isn't desired, | ||
36 | # the command can be overridden. | ||
37 | # | ||
38 | # Note that useradd-staticids.bbclass has to be used to ensure that | ||
39 | # the numeric IDs of dynamically created entries remain stable. | ||
40 | # | ||
41 | # We want this to run as late as possible, in particular after | ||
42 | # systemd_sysusers_create and set_user_group. Using _append is not | ||
43 | # enough for that, set_user_group is added that way and would end | ||
44 | # up running after us. | ||
45 | SORT_PASSWD_POSTPROCESS_COMMAND ??= " sort_passwd; " | ||
46 | python () { | ||
47 | d.appendVar('ROOTFS_POSTPROCESS_COMMAND', '${SORT_PASSWD_POSTPROCESS_COMMAND}') | ||
48 | } | ||
49 | |||
33 | systemd_create_users () { | 50 | systemd_create_users () { |
34 | for conffile in ${IMAGE_ROOTFS}/usr/lib/sysusers.d/systemd.conf ${IMAGE_ROOTFS}/usr/lib/sysusers.d/systemd-remote.conf; do | 51 | for conffile in ${IMAGE_ROOTFS}/usr/lib/sysusers.d/systemd.conf ${IMAGE_ROOTFS}/usr/lib/sysusers.d/systemd-remote.conf; do |
35 | [ -e $conffile ] || continue | 52 | [ -e $conffile ] || continue |
@@ -146,6 +163,11 @@ ssh_disable_dns_lookup () { | |||
146 | fi | 163 | fi |
147 | } | 164 | } |
148 | 165 | ||
166 | python sort_passwd () { | ||
167 | import rootfspostcommands | ||
168 | rootfspostcommands.sort_passwd(d.expand('${IMAGE_ROOTFS}${sysconfdir}')) | ||
169 | } | ||
170 | |||
149 | # | 171 | # |
150 | # Enable postinst logging if debug-tweaks is enabled | 172 | # Enable postinst logging if debug-tweaks is enabled |
151 | # | 173 | # |