Subject: Re: /sbin/init failure
To: Dan LaBell <dan4l-nospam@verizon.net>
From: Peter <plp@actcom.co.il>
List: port-i386
Date: 04/19/2005 14:20:58
On Tue, 19 Apr 2005, Dan LaBell wrote:

>> Is there perhaps an equivalent to ash or busybox on netbsd, for rescue and 
>> repair purposes ? (ash is a minimal featureset sh-compatible shell that is 
>> statically linked. It is used with some systems for installation, bootable 
>> floppies and such).
>> 
>> Peter
>> 
> I don't see it pkgsrc.  HMM.. There is osh, at a glance looks like an old 
> bourne shell, w/o the new posix features.
> 22536 /usr/pkg/bin/osh
> 128043 /bin/sh
>
> Glad you asked, I might not not have noticed, I've been complaining how 
> bloated
> /bin/sh looks these days.
>
> Wonder if replace /bin/sh with this, or do the rc scripts rely on the new 
> posixisms?

You should be able to boot normally to a shell running in a terminal 
using /rescue/sh. You could try to copy /rescue/sh to /sbin/init and 
see what happens (since init is missing). That should boot the machine 
to a root shell prompt. You can do the copying from an install 
boot diskette, then sync, umount and reboot, without the diskette.

This works for most *nices I know of (assuming the kernel comes up ok 
and the root fs can be mounted and /bin/sh is not linked against 
anything, i.e. it is totally static). I have used similar methods to 
bootstrap minimal systems on embedded pcs with low memory etc. The 
earliest I did was 1.2.13 linux based, almost 10 years ago, when you 
still needed 2 floppies to start linux and I got it down to one, without 
using a boot manager ;-)

Peter