summaryrefslogtreecommitdiffstats
path: root/meta/classes-recipe
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2023-12-27 12:20:36 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-01-26 16:06:29 +0000
commit7c47ed557bc38348194b575404706ca4cd17a789 (patch)
tree2277953cf0f050369f248bd657b5946b03a76709 /meta/classes-recipe
parentdfcbfc49ca468c9ae20ccde88edfdb8b9ef16c27 (diff)
downloadpoky-7c47ed557bc38348194b575404706ca4cd17a789.tar.gz
rootfs-postcommands.bbclass: ignore comment mismatch in systemd_user_check
The check was forcing every field to be identical, this is too strict. For example, if the comment differs, there's really no impact. For example, root user's comment is 'root' in passwd, and it's 'Super User' in sysusers.d/basic.conf. Such difference is not worth a warning. In fact, previous codes use 'lower()' to avoid warning between 'nobody' and 'Nobody', and what's more, another patch puts its own basic.conf.in in systemd's SRC_URI, but it changes 'Super User' to 'root'. Such changes are all unnecessary. We should just ignore comment mismatch. (From OE-Core rev: 2a700c3102b2233e71a157f0f88ed88496fa9fbf) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes-recipe')
-rw-r--r--meta/classes-recipe/rootfs-postcommands.bbclass3
1 files changed, 1 insertions, 2 deletions
diff --git a/meta/classes-recipe/rootfs-postcommands.bbclass b/meta/classes-recipe/rootfs-postcommands.bbclass
index 163c7f41b1..3d05ff3b28 100644
--- a/meta/classes-recipe/rootfs-postcommands.bbclass
+++ b/meta/classes-recipe/rootfs-postcommands.bbclass
@@ -106,12 +106,11 @@ def compare_users(user, e_user):
106 # user and e_user must not have None values. Unset values must be '-'. 106 # user and e_user must not have None values. Unset values must be '-'.
107 (name, uid, gid, comment, homedir, ushell) = user 107 (name, uid, gid, comment, homedir, ushell) = user
108 (e_name, e_uid, e_gid, e_comment, e_homedir, e_ushell) = e_user 108 (e_name, e_uid, e_gid, e_comment, e_homedir, e_ushell) = e_user
109 # Ignore 'uid', 'gid' or 'comment' if they are not set 109 # Ignore 'uid', 'gid' or 'homedir' if they are not set
110 # Ignore 'shell' and 'ushell' if one is not set 110 # Ignore 'shell' and 'ushell' if one is not set
111 return name == e_name \ 111 return name == e_name \
112 and (uid == '-' or uid == e_uid) \ 112 and (uid == '-' or uid == e_uid) \
113 and (gid == '-' or gid == e_gid) \ 113 and (gid == '-' or gid == e_gid) \
114 and (comment == '-' or e_comment == '-' or comment.lower() == e_comment.lower()) \
115 and (homedir == '-' or e_homedir == '-' or homedir == e_homedir) \ 114 and (homedir == '-' or e_homedir == '-' or homedir == e_homedir) \
116 and (ushell == '-' or e_ushell == '-' or ushell == e_ushell) 115 and (ushell == '-' or e_ushell == '-' or ushell == e_ushell)
117 116