Making a dynamically-linked root

Tim Kientzle kientzle at acm.org
Tue Jun 3 09:43:55 PDT 2003


Jan Grant wrote:

> On Mon, 2 Jun 2003, Tim Kientzle wrote:
>>Dag-Erling Smorgrav wrote:
>>>Was /bin/sh dynamically linked?  It shouldn't be.
>>
>>Sorry, but /bin/sh calls 'getpwnam()', which means
>>/bin/sh should use NSS, and thus needs to be
>>dynamically linked.
> 
> I don't think this reasoning is completely sound. A functional (but
> minimalist) static /bin/sh (or /sbin/sh) will still let you run
> /usr/local/bells-and-whistles/sh if you need ~user.


My reasoning is correct.  The point here is that /bin/sh is not
minimalist, as evidenced by the fact that it calls getpwnam().  (Yes,
this implies that 'ps', 'ls', 'date', and even 'cat' are not "minimalist,"
either, since they require pluggable library features.)  If you want to
remove features from /bin/sh to make it truly minimal, or add a new static
shell to the base system, that's a different issue.

The current /bin/sh must be dynamically linked because it relies on NSS.

Tim

P.S. I personally doubt that a static /bin/sh would actually impact
the boot performance much at all.



More information about the freebsd-arch mailing list