From: Dave Young Date: Mon, 26 Dec 2011 06:29:11 +0000 (+0800) Subject: deal common part of etc passwd in 99base X-Git-Tag: 015~67 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=59ee80764e08e8614c610d18b572427f8eefaa86;p=thirdparty%2Fdracut.git deal common part of etc passwd in 99base ssh module will need root user in /etc/passwd, so add root and nobody to /etc/passwd in 99base instead of nfs module Signed-off-by: Dave Young --- diff --git a/modules.d/95nfs/module-setup.sh b/modules.d/95nfs/module-setup.sh index 6778f286e..3ccdafc82 100755 --- a/modules.d/95nfs/module-setup.sh +++ b/modules.d/95nfs/module-setup.sh @@ -65,8 +65,6 @@ install() { # Rather than copy the passwd file in, just set a user for rpcbind # We'll save the state and restart the daemon from the root anyway - egrep '^root:' "$initdir/etc/passwd" 2>/dev/null || echo 'root:x:0:0::/:/bin/sh' >> "$initdir/etc/passwd" - egrep '^nobody:' /etc/passwd >> "$initdir/etc/passwd" egrep '^nfsnobody:' /etc/passwd >> "$initdir/etc/passwd" egrep '^rpc:' /etc/passwd >> "$initdir/etc/passwd" egrep '^rpcuser:' /etc/passwd >> "$initdir/etc/passwd" diff --git a/modules.d/99base/module-setup.sh b/modules.d/99base/module-setup.sh index 5297a9d35..f6c1209c7 100755 --- a/modules.d/99base/module-setup.sh +++ b/modules.d/99base/module-setup.sh @@ -20,6 +20,10 @@ install() { dracut_install bash (ln -s bash "${initdir}/bin/sh" || :) fi + + #add common users in /etc/passwd, it will be used by nfs/ssh currently + egrep '^root:' "$initdir/etc/passwd" 2>/dev/null || echo 'root:x:0:0::/:/bin/sh' >> "$initdir/etc/passwd" + egrep '^nobody:' /etc/passwd >> "$initdir/etc/passwd" # install our scripts and hooks inst "$moddir/init" "/init" inst "$moddir/initqueue" "/sbin/initqueue"