NetBSD-Users archive

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

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



On Thu, 21 Aug 2008, Hashimoto wrote:

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/
[snip]
What's the problem?

/sbin/init and /bin/sh are not statically linked, so you won't be able to run these from your memory disk.

Take a look at src/distrib/i386/ramdisks/ramdisk-big to see how the install memory disk is made with crunchgen. You should be able to easily adjust the Makefile and list files to build your own.

--
Stephen



Home | Main Index | Thread Index | Old Index