deal common part of etc passwd in 99base
PATCH v2 1/5 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
--- modules.d/95nfs/module-setup.sh | 2 -- modules.d/99base/module-setup.sh | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-)
modules.d/95nfs/module-setup.sh +0 -2
@@ -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"
modules.d/99base/module-setup.sh +4 -0
@@ -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"
Signature · 1 line
1.7.1
Quoted 3 lines · Dave Young
ssh module will need root user in
/etc/passwd, so add root and nobody to/etc/passwdin 99base instead of nfs module
Sorry, for people who don't use nfs/ssh module,
this is totally unnecessary.
And, I don't think duplicating 2 lines of code is a problem here...
Quoted 7 lines · Cong Wang
Quoted 3 lines · Dave Young
ssh module will need root user in
/etc/passwd, so add root and nobody to/etc/passwdin 99base instead of nfs moduleSorry, for people who don't use nfs/ssh module,
this is totally unnecessary.
I dont think so, but if you insist I can add an dracut function like inst_root_user
Quoted 7 lines
And, I don't think duplicating 2 lines of code is a problem here...
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
Thanks Dave
Quoted 7 lines · Dave Young
Quoted 5 lines · Cong Wang
Quoted 3 lines · Dave Young
ssh module will need root user in
/etc/passwd, so add root and nobody to/etc/passwdin 99base instead of nfs module
Quoted 7 lines
Quoted 2 lines
Sorry, for people who don't use nfs/ssh module,
this is totally unnecessary.I dont think so, but if you insist I can add an dracut function like
inst_root_user
I cooked the following patch.
The nfs module still uses "/" as home of root, while ssh module uses "/root". With you patches, you changed to "/root" for both nfs and ssh, which *maybe* a problem for nfs module since you didn't test it.
----
modules.d/95nfs/module-setup.sh +2 -2
@@ -65,8 +65,8 @@ 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 -q '^root:' "$initdir/etc/passwd" 2>/dev/null || echo 'root:x:0:0::/:/bin/sh' >> "$initdir/etc/passwd" + egrep -q '^nobody:' "$initdir/etc/passwd" 2>/dev/null || 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"
modules.d/95ssh-client/module-setup.sh +3 -0
@@ -56,5 +56,8 @@ install() { inst ssh inst scp inst_sshenv + + egrep -q '^root:' "$initdir/etc/passwd" 2>/dev/null || echo 'root:x:0:0::/root:/bin/sh' >> "$initdir/etc/passwd" + egrep -q '^nobody:' "$initdir/etc/passwd" 2>/dev/null || egrep '^nobody:' /etc/passwd >> "$initdir/etc/passwd" }
Cong Wang
AppliedHi, Dave,
I merged four patches into my tree:
https://github.com/congwang/dracut/commits/kdump
patch 1/5 and 3/5 are merged and fixed as one by myself.
Please check if they are okay for you.
Thanks.
Quoted 12 lines · Cong Wang
Quoted 11 lines · Dave Young
Quoted 7 lines · Cong Wang
Quoted 3 lines · Dave Young
ssh module will need root user in
/etc/passwd, so add root and nobody to/etc/passwdin 99base instead of nfs moduleSorry, for people who don't use nfs/ssh module,
this is totally unnecessary.
Quoted 5 lines
Quoted 3 lines
I dont think so, but if you insist I can add an dracut function like
inst_root_userI cooked the following patch.
Thanks.
Quoted 4 lines
The nfs module still uses "/" as home of root, while ssh module uses "/root". With you patches, you changed to "/root" for both nfs and ssh, which *maybe* a problem for nfs module since you didn't test it.
I tested nfs boot as well, it works ok with $HOME=/root
Also if you add both ssh-client and nfs, what's the result of /etc/passwd?
Quoted 36 lines
----
modules.d/95nfs/module-setup.sh +2
-2@@ -65,8 +65,8 @@ 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 -q '^root:' "$initdir/etc/passwd" 2>/dev/null || echo 'root:x:0:0::/:/bin/sh' >> "$initdir/etc/passwd" + egrep -q '^nobody:' "$initdir/etc/passwd" 2>/dev/null || 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"modules.d/95ssh-client/module-setup.sh +3
-1@@ -56,5 +56,8 @@ install() { inst ssh inst scp inst_sshenv + + egrep -q '^root:' "$initdir/etc/passwd" 2>/dev/null || echo 'root:x:0:0::/root:/bin/sh' >> "$initdir/etc/passwd" + egrep -q '^nobody:' "$initdir/etc/passwd" 2>/dev/null || egrep '^nobody:' /etc/passwd >> "$initdir/etc/passwd" } --To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
Thanks Dave
Quoted 7 lines · Dave Young
Quoted 3 lines · Cong Wang
The nfs module still uses "/" as home of root, while ssh module uses "/root". With you patches, you changed to "/root" for both nfs and ssh, which *maybe* a problem for nfs module since you didn't test it.
I tested nfs boot as well, it works ok with $HOME=/root
Ok, will change to "/root" too.
Quoted 2 lines
Also if you add both ssh-client and nfs, what's the result of
/etc/passwd?
If the line "root:" exists before,
egrep -q '^root:' "$initdir/etc/passwd" 2>/dev/null || echo
'root:x:0:0::/:/bin/sh' >> "$initdir/etc/passwd"
egrep will succeed and echo will not be executed...
Quoted 12 lines · Cong Wang
Quoted 7 lines · Dave Young
Quoted 3 lines · Cong Wang
The nfs module still uses "/" as home of root, while ssh module uses "/root". With you patches, you changed to "/root" for both nfs and ssh, which *maybe* a problem for nfs module since you didn't test it.
I tested nfs boot as well, it works ok with $HOME=/root
Ok, will change to "/root" too.
Quoted 1 line
Quoted 8 lines
Quoted 1 line
Also if you add both ssh-client and nfs, what's the result of
/etc/passwd?If the line "root:" exists before,
egrep -q '^root:' "$initdir/etc/passwd" 2>/dev/null || echo
'root:x:0:0::/:/bin/sh' >> "$initdir/etc/passwd"egrep will succeed and echo will not be executed...
Yes, but who knows which module will be added firstly, maybe there's other module do this in future.
But if nfs also use /root as HOME it will be ok currently
Signature · 2 lines
Thanks Dave
Quoted 21 lines · Dave Young
Quoted 19 lines · Cong Wang
Quoted 7 lines · Dave Young
Quoted 3 lines · Cong Wang
The nfs module still uses "/" as home of root, while ssh module uses "/root". With you patches, you changed to "/root" for both nfs and ssh, which *maybe* a problem for nfs module since you didn't test it.
I tested nfs boot as well, it works ok with $HOME=/root
Ok, will change to "/root" too.
Quoted 2 lines
Also if you add both ssh-client and nfs, what's the result of
/etc/passwd?If the line "root:" exists before,
 egrep -q '^root:' "$initdir/etc/passwd" 2>/dev/null || echo 'root:x:0:0::/:/bin/sh' >> "$initdir/etc/passwd"
Quoted 9 lines
Quoted 1 line
egrep will succeed and echo will not be executed...
Yes, but who knows which module will be added firstly, maybe there's other module do this in future.
But if nfs also use /root as HOME it will be ok currently
Yeah, it is in git now.
Am 26.12.2011 07:29, schrieb Dave Young:
Quoted 27 lines
ssh module will need root user in
/etc/passwd, so add root and nobody to/etc/passwdin 99base instead of nfs moduleSigned-off-by Dave Young <[email protected]>--- modules.d/95nfs/module-setup.sh | 2 -- modules.d/99base/module-setup.sh | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-)modules.d/95nfs/module-setup.sh +0
-2@@ -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"modules.d/99base/module-setup.sh +0
-0
modules.d/99base/module-setup.sh install() { · line 29
Quoted 10 lines
modules.d/99base/module-setup.sh +4
-0@@ -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"
pushed