From: Cong Wang <xiyou.wangcong-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 1/5 branch usrmove v2] deal common part of etc passwd in 99base
Date: Thu, 29 Dec 2011 09:27:18 +0000 (UTC) [thread overview]
Message-ID: <jdhbpl$s87$1@dough.gmane.org> (raw)
In-Reply-To: 4EFBD882.2090707@redhat.com
On Thu, 29 Dec 2011 at 03:03 GMT, Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
> On 12/27/2011 07:44 PM, Cong Wang wrote:
>
>> On Mon, 26 Dec 2011 at 06:29 GMT, Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
>>> ssh module will need root user in /etc/passwd, so add root and nobody
>>> to /etc/passwd in 99base instead of nfs module
>>>
>>
>> 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.
----
diff --git a/modules.d/95nfs/module-setup.sh b/modules.d/95nfs/module-setup.sh
index 6778f28..c97dea3 100755
--- a/modules.d/95nfs/module-setup.sh
+++ b/modules.d/95nfs/module-setup.sh
@@ -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"
diff --git a/modules.d/95ssh-client/module-setup.sh b/modules.d/95ssh-client/module-setup.sh
index 0ffc298..ef8effe 100644
--- a/modules.d/95ssh-client/module-setup.sh
+++ b/modules.d/95ssh-client/module-setup.sh
@@ -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"
}
next prev parent reply other threads:[~2011-12-29 9:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-26 6:29 [PATCH 1/5 branch usrmove v2] deal common part of etc passwd in 99base Dave Young
2011-12-27 11:44 ` Cong Wang
2011-12-29 3:03 ` Dave Young
2011-12-29 9:27 ` Cong Wang [this message]
2011-12-29 9:40 ` Cong Wang
2011-12-29 9:45 ` Dave Young
[not found] ` <4EFC36CD.8040205-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-12-29 9:48 ` Cong Wang
[not found] ` <CAM_iQpX6kWGPB_mGUWOaywQgxeWEC+Og6WjOZmknS+FPGuA0xQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-12-29 10:00 ` Dave Young
[not found] ` <4EFC3A2E.6020606-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-12-29 10:04 ` Cong Wang
[not found] ` <20111226062910.GA3141-4/PLUo9XfK+sDdueE5tM26fLeoKvNuZc@public.gmane.org>
2012-01-23 11:03 ` Harald Hoyer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='jdhbpl$s87$1@dough.gmane.org' \
--to=xiyou.wangcong-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.