From: Andrei Gherzan <[email protected]>

shadow utils are used when creating users at image creation time. The
useradd/usermod tools will only try to add a default configuration for
subid files if they exist.

Signed-off-by: Andrei Gherzan <[email protected]>
Signed-off-by: Steve Sakoman <[email protected]>
---
 meta/recipes-extended/shadow/shadow.inc | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/meta/recipes-extended/shadow/shadow.inc 
b/meta/recipes-extended/shadow/shadow.inc
index f5fdf436f7..b3ae2b4874 100644
--- a/meta/recipes-extended/shadow/shadow.inc
+++ b/meta/recipes-extended/shadow/shadow.inc
@@ -149,6 +149,13 @@ do_install:append() {
        # Handle link properly after rename, otherwise missing files would
        # lead rpm failed dependencies.
        ln -sf newgrp.${BPN} ${D}${bindir}/sg
+
+       # usermod requires the subuid/subgid files to be in place before being
+       # able to use the -v/-V flags otherwise it fails:
+       # usermod: /etc/subuid does not exist, you cannot use the flags -v or -V
+       install -d ${D}${sysconfdir}
+       touch ${D}${sysconfdir}/subuid
+       touch ${D}${sysconfdir}/subgid
 }
 
 PACKAGES =+ "${PN}-base"
-- 
2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#170120): 
https://lists.openembedded.org/g/openembedded-core/message/170120
Mute This Topic: https://lists.openembedded.org/mt/93372452/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to