Skip to contentSkip to conversation

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

PATCH New Richard Purdie 1 participant 1 message Apr 16

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 useradd: Switch from --root to --prefix option

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

---
 meta/classes/useradd.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/classes/useradd.bbclass +2 -2
index 9d857a4555d..d7ed6cb9315 100644
@@ -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