Subject: Re: Tests of mdsetimage -s
To: None <tech-embed@NetBSD.org>
From: Brian Rose <firstname.lastname@example.org>
Date: 04/01/2005 21:38:08
Marcin Jessa wrote:
> I copied over /sbin/init to my image's /sbin/oinit and it still does not execute ...
> wd0 at atabus0 drive 0: <Hitachi Flash Card>
> wd0: drive supports 1-sector PIO transfers, LBA addressing
> wd0: 62592 KB, 978 cyl, 4 head, 32 sec, 512 bytes/sect x 125184 sectors
> boot device: <unknown>
> root on md0a
> WARNING: NVRAM century is 19 but RTC year is 2005
> root file system type: ffs
> warning: no /dev/console
> exec /sbin/init: error 8
> init: trying /sbin/oinit
> Then it just hangs ...
> On Sat, 2 Apr 2005 01:49:27 +0000
> Marcin Jessa <email@example.com> wrote:
>>I am not sure how big the mounted memory fs is since I have problems with kernel refusing to execute /sbin/init
>>It stops right before that.
>>So I made a simple printf C code and replaced init with it
>>Tell YazzY you started!
>>exec /sbin/init: error 8
>>init: trying /sbin/oinit
>>exec /sbin/oinit: error 2
>>nit: trying /sbin/init.bak
>>exec /sbin/init.bak: error 2
>>init: not found
>>panic: no init
>>syncing disks... done
>>Any idea why init cannot be not started ?
init needs to set up STDIN, STDOUT, and STDERR so that your printf's are
connected to the console. I usually build init with the smallprog define
and then make a custom /bin/sh which is what init will call.
Someone once provided me with a custom init that just does this, but I
found the SMALLPROG define to be much more convenient.
For more info look at my embedded netbsd article near the bottom of page 1.