NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

cannot find /sbin/init on one-file-NetBSD



Hello.
Now, I'm trying
http://brianrose.net/family/fetch.php?dir=/Brian/NetBSD/Embedded&filename=single.html
It seems that my system successfully loads kernel.
But, then it panics because it cannot find /sbin/init.
I did as following.

1. compile MYKERNEL
$ cd /usr/src/sys/arch/i386/conf
$ cp GENERIC MYKERNEL
$ cat >> MYKERNEL
options MEMORY_DISK_HOOKS
options MEMORY_DISK_IS_ROOT
options MEMORY_DISK_SERVER=0
options MEMORY_DISK_ROOT_SIZE=8192
Ctrl-d
$ config MYKERNEL
$ cd /usr/src
$ ./build.sh -m i386 kernel=MYKERNEL
$ cp /usr/src/sys/arch/i386/compile/obj/MYKERNEL/netbsd /tmp/

2. create file system
$ cd /tmp
$ mkdir files files/sbin files/bin files/dev
$ cp /sbin/init /tmp/files/sbin/
$ cp /bin/sh /tmp/files/bin/
$ cp /dev/MAKEDEV /tmp/files/dev/
$ cd /tmp/files/dev
# ./MAKEDEV ramdisk
$ cd /tmp
$ makefs -s 4m -t ffs memdrive.img files

3. create image and put it on root
$ mdsetimage netbsd memdrive.img
$ gzip < netbsd > mykernel.gz
# cp /tmp/mykernel.gz /
# cat >> /grub/menu.lst
title MyKernel
kernel /mykernel.gz
Ctrl-d
# reboot


When I boot "MyKernel" from grub entry,
system successfully loads kernel, and detects some hardwares.
But, it stops like this.

boot device: wd0
root on md0a dumps on md0b
root file system type: ffs
exec /sbin/init: error 8
init: trying /sbin/init
exec /sbin/oinit: error 2
init: trying /sbin/init.bak
exec /sbin/init.bak : error 2
init: not found
panic: no init
Stopped in pid 1.1 (init) at netbsd:cpu_Debugger+0x4: pop %ebp
db>

What's the problem?
Thanks.

---
hsmtkk%gmail.com@localhost


Home | Main Index | Thread Index | Old Index