deal common part of etc passwd in 99base
PATCH 1/4 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 2 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
Huh? Even for who don't use either ssh module or nfs module??
I think you just need to copy these two lines into your ssh module...
Quoted 7 lines · Cong Wang
Quoted 2 lines · Dave Young
ssh module will need root user in
/etc/passwd, so add root and nobody to/etc/passwdin 99base instead of nfs moduleHuh? Even for who don't use either ssh module or nfs module??
I think you just need to copy these two lines into your ssh module...
Thanks for your review.
in 90mdraid module there's words in its comments about passwd, so there might be more modules need passwd.
Dealing with same thing in multi module is not good, not only duplicate code, but also they could cause conflict. Ie. nfs set root home dir to / but we need /root, if nfs module added after ssh-client the home dir of root will be /.
Quoted 5 lines
--
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
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 8 lines · Dave Young
Quoted 6 lines · Cong Wang
Quoted 2 lines · Dave Young
ssh module will need root user in
/etc/passwd, so add root and nobody to/etc/passwdin 99base instead of nfs moduleHuh? Even for who don't use either ssh module or nfs module??
Quoted 7 lines
Quoted 1 line
I think you just need to copy these two lines into your ssh module...
Thanks for your review.
in 90mdraid module there's words in its comments about passwd, so there might be more modules need passwd.
But there are still more modules that don't need passwd, right?
Quoted 5 lines
Dealing with same thing in multi module is not good, not only duplicate code, but also they could cause conflict. Ie. nfs set root home dir to / but we need /root, if nfs module added after ssh-client the home dir of root will be /.
If you don't want to duplicate the code, make it a function (maybe in dracut-function?),
putting it in base module is confusing.
A message that is not in the archive (sent off-list or not yet received): CAM_iQpW2FH_ob3u22nii3tAe-yUX-iPctDb2KEPwptrugdQbsw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 22 lines · Cong Wang
Quoted 8 lines · Dave Young
Quoted 6 lines · Cong Wang
Quoted 2 lines · Dave Young
ssh module will need root user in
/etc/passwd, so add root and nobody to/etc/passwdin 99base instead of nfs moduleHuh? Even for who don't use either ssh module or nfs module??
Quoted 7 lines
Quoted 1 line
I think you just need to copy these two lines into your ssh module...
Thanks for your review.
in 90mdraid module there's words in its comments about passwd, so there might be more modules need passwd.
But there are still more modules that don't need passwd, right?
Quoted 1 line
Quoted 8 lines
Quoted 4 lines
Dealing with same thing in multi module is not good, not only duplicate code, but also they could cause conflict. Ie. nfs set root home dir to / but we need /root, if nfs module added after ssh-client the home dir of root will be /.
If you don't want to duplicate the code, make it a function (maybe in dracut-function?),
putting it in base module is confusing.
Scratching head.. I'm feeling bad to add same user multi-times, Yes not all modules need passwd, but I still think it is a base thing.
Quoted 4 lines
--
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