On Tue, May 21, 2002 at 12:58:48PM -0700, Petro wrote:
> 
>     This is something that has been bothering me for a while now. 
> 
>     See, you guys who put these distributions together are pretty
>     bright. It takes a lot of work, and I see a lot of the discussions
>     that go in to figuring out all the nit-picky little details that
>     give polish to a distribution. 
> 
>     However, one thing is driving me absolutely Bug F*** crazy. 
> 
>     I use, or have used several versions of RedHat and SuSe, and now I'm
>     on my second "version" of Debian. 
> 
>     Why the sam hell is there not, by default, no questions asked, it's
>     installed because it's *right*, a statically linked /sbin/sh as
>     roots default shell? 

You do have a valid point, but a statically linked root shell will not
always work. At least you shouldn't rely on it being sufficient...

If you were to nuke /lib/ld-linux.so* (or other essential libraries),
then chances are that you won't be able to log in anyway:

$ ldd /sbin/getty
        libc.so.6 => /lib/libc.so.6 (0x4001d000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

[OK. I admit that if you can find an already-running getty, this may be
a moot point]

$ ldd /bin/login
        libcrypt.so.1 => /lib/libcrypt.so.1 (0x4001d000)
        libpam.so.0 => /lib/libpam.so.0 (0x4004a000)
        libpam_misc.so.0 => /lib/libpam_misc.so.0 (0x40053000)
        libdl.so.2 => /lib/libdl.so.2 (0x40056000)
        libc.so.6 => /lib/libc.so.6 (0x40059000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

Besides, even /sbin/init is dynamically linked, so a severly damaged
system won't be able to boot...

So, to follow your line of thought (i think), then at least getty &
login need to be statically linked too. And init if you plan on
rebooting using only the existing (hypothetically damaged) root fs. And
you need to prepare by having root's login shell be statically linked.

To repair such a system you may need other tools, e.g. dpkg, ar, apt-get
(which for the purposes of this, are rather inconveniently located in
/usr), mount, tar and gzip. All of which (i believe) are dynamically
linked.

As others have suggested, sash will help here - assuming that you can
log in...

Another solution could be to boot your kernel with init=/bin/sash. And
make sure that this boots with the root fs in read-write mode; as the
mount command is dynamically linked...

At least you should always be able to boot from the install floppies,
and mount/fsck your root filesystem from there. If not, then it's time
for you to create new boot floppies. The standard ones may not have a
suitable kernel if you have some esoteric hardware...

HTH
-- 
Karl E. Jørgensen
[EMAIL PROTECTED]
www.karl.jorgensen.com
==== Today's fortune:
Torque is cheap.

Attachment: pgpJUEfpmkyfM.pgp
Description: PGP signature

Reply via email to