busybox on NFS

Miroslaw Dach miroslaw.dach at psi.ch
Tue May 15 11:52:32 UTC 2007


Hi All,

I am dealing with xilinx ml403 evaluation board which contains the power
pc processor (PPC405).

I have built successfully the linux kernel 2.6.21rc6 for my board.
The kernel is configured to mount the rootfile system via NFS:

CONFIG_CMDLINE="console=ttyUL0,9600 root=/dev/nfs rw
nfsroot=129.129.130.106:/opt/eldk41/ppc_4xx,tcp macaddr=00:50:c2:46:d8:01
ip=129.129.107.50:129.129.130.106:129.129.107.1:255.255.255.0:ml403:eth0:off
panic=1"


I have build the kernel and busybox with crosstool-0.43 (gcc-4.0.2 
glibc-2.3.2). I have also tried to build the busybox with eldk4.1 but I 
have failed so I have decided to use crosstool.

The kernel boots up to the point:

[    9.302101] VFS: Mounted root (nfs filesystem).
[    9.357642] Freeing unused kernel memory: 96k init
[    9.481509] Kernel panic - not syncing: No init found.  Try passing init= option to kernel.

The rootfile system on the NFS server looks like below:
cd /opt/eldk41/ppc_4xx

drwxr-xr-x    2 root     root         4096 May 14 16:20 bin
drwxr-xr-x    2 root     root         4096 May 14 16:21 dev
drwxr-xr-x    3 root     root         4096 May 14 16:20 etc
lrwxrwxrwx    1 root     root           11 May 14 16:20 linuxrc -> 
bin/busybox
drwxr-xr-x    2 root     root         4096 May 15 11:06 sbin
drwxr-xr-x    4 root     root         4096 May 14 16:20 usr

ls -l sbin/init
lrwxrwxrwx    1 root     root           14 May 15 11:06 sbin/init -> ../bin/busybox
ls-l bin/busybox
-rwxr-xr-x    1 root     root       253064 May 15 11:12 bin/busybox

when I do: ldd bin/busybox
        not a dynamic executable

So it means that busybox is the statically build executable which I do not 
believe.

I have copied across the lib directory from crosstool and tried to 
restart the kernel. This time kernel stooped booting at:

[    9.302101] VFS: Mounted root (nfs filesystem).
[    9.357642] Freeing unused kernel memory: 96k init

So it means probably that busybox init has found the suitable libraries
but it has stooped due to the unknown reason.

For the test purpose I have written my own init:

#include <stdio.h>
#include <unistd.h>

int main(int argc, char *argv[])
{
    char myStr[30];

    printf("Enter the string!\n");
    gets(myStr);
    printf("My string is %s\n",myStr);
    sleep(60);
} 

When I booted the kernel I have got a prompt "Enter the string!"
I was also able to type from the keyboard the string.
When I pressed ENTER I have got "My string is <the string I have typed>"

It seems to be that the console works fine and the root file system is 
mounted properly via NFS.

I do not know however why busybox init does not work.
I have also tried to mount the eldk4.1 root file system and it also hanged 
when trying to execute init.

Would somebody have some advice

Best Regards

Mirek


=============================================================================
          Miroslaw Dach (Miroslaw.Dach at psi.ch) - SLS/Controls Group 
                PSI - Paul Scherrer Institut CH-5232 Villigen
=============================================================================




More information about the busybox mailing list