diff mbox series

useradd: Switch from --root to --prefix option

Message ID 20260416124903.3175806-1-richard.purdie@linuxfoundation.org
State Under Review
Headers show
Series useradd: Switch from --root to --prefix option | expand

Commit Message

Richard Purdie April 16, 2026, 12:49 p.m. UTC
Whilst assessing where we use chroot (which requires superuser privileges),
I realised that shadow's utilities we use have the option of specifing
a prefix for files. This provides the same outcome but avoids the chroot
call. Whist we can emulate that under pseudo, it is probably nicer to avoid
doing that and use the prefix option instead.

Therefore switch --root -> --prefix

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/classes/useradd.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/meta/classes/useradd.bbclass b/meta/classes/useradd.bbclass
index 9d857a4555d..d7ed6cb9315 100644
--- a/meta/classes/useradd.bbclass
+++ b/meta/classes/useradd.bbclass
@@ -26,7 +26,7 @@  SYSROOT=""
 if test "x$D" != "x"; then
 	# Installing into a sysroot
 	SYSROOT="$D"
-	OPT="--root $D"
+	OPT="--prefix $D"
 
 	# Make sure login.defs is there, this is to make debian package backend work
 	# correctly while doing rootfs.
@@ -37,7 +37,7 @@  if test "x$D" != "x"; then
 	    cp $D${sysconfdir}/login.defs.dpkg-new $D${sysconfdir}/login.defs
 	fi
 
-	# user/group lookups should match useradd/groupadd --root
+	# user/group lookups should match useradd/groupadd --prefix
 	export PSEUDO_PASSWD="$SYSROOT"
 fi