"Kernel panic - not syncing : No init found" when booting with roofs mounted from NFS.

Hi,
I tried to mount root fs using NFS but I get a kernel panic.
I am using Rowboat sources for Android 2.1.
The last traces I have are:

    VFS: Mounted root (nfs filesystem) on device 0:12
    Freeing init memory: 172k Warning: unable to open an initial
console
    Kernel panic - not syncing : No init found. try passing init=
option to kernel

The kernel i loaded from mmc. When I use the same root fs and kernel
on SD card all is working.

To mount root fs using NFS I have processed as following

    1) boot with uImage and rootfs on SD card (Android sources get
from Rowboat project)

    2) When boot complete create /dev/nfs directory
    3) Start eth0 interface (ethernet over USB adapter) and ping NFS
server IP.

        Beagleboard# netcfg eth0 up
        Beagleboard# netcfg eth0 dchp
        Beagleboard# netcfg
        Beagleboard# ping NFS_SERVER_IP

    4) Reset board and stop boot to update environement variable using
commands:

        Beagleboard# setenv bootargs 'console=ttyS2,115200n8 noinitrd
rw ip=dhcp root=/dev/nfs nfsroot=NFS_SERVER_IP:/
ROOT_FS_PATH,nolock,rsize=1024,wsize=1024,rootdelay=2'
        Beagleboard# setenv bootcm 'mmc init; faltload mmc 0 84000000
uImage; bootm 84000000'
        Beagleboard# boot

I also tried:

    Beagleboard# setenv bootargs 'console=ttyS2,115200n8 noinitrd rw
ip=dhcp root=/dev/nfs nfsroot=NFS_SERVER_IP:/
ROOT_FS_PATH,nolock,rsize=1024,wsize=1024,rootdelay=2 init=/init' with
no success.

I there something to change between root fs on SD card and on NFS
server to make init work?
As I am new on Beagleboard, Is it possible for somebody to give a full
step by step explanation (or link to explanation) on how to mount root
fs from NFS server on Beagleboard C3 using ethernet over USB dongle?
Thanks for your help,
Michel

nfs itself is working properly.
Did you put a rootfs in the directory that is exported by your server
( NFS_SERVER_IP:/ ROOT_FS_PATH )
And is there an init in that directory. (the same init as on your SD card).
E.g. if your nfsroot is 192.168.1.1:/nfs then you should have a file
/nfs/init on that system.

Frans.

Hi,
    Yes I have an application name init in the nfs directory on server
side.
    As I mentionned the the rootfs in the directory NFS_SERVER_IP:/
ROOT_FS_PATH is the same as the one I used to boot on SD card, the
rootfs should have all needed files.

    To put the rootfs on server directory I created a rootfs.tar.bz2
file using <my abdroid sdk>/build/tools/mktarball.sh.
In rootfs.tar.bz2 I copied <my android sdk>/out/target/product/
beagleboard/root/* and <my android sdk>/out/target/product/beagleboard/
system/*

    To extract the rootfs on shared nfs director i used the command:
sudo tar jxvf rootfs.tar.bz2 -C ./rootfs

"ls -l" on server shared directory gives:
total 216
drwxrwx--x 2 atelier atelier 4096 2010-06-03 15:45 data
-rw-r--r-- 1 root root 118 2010-08-06 11:34 default.prop
drwxr-xr-x 2 root root 4096 2010-06-03 15:45 dev
-rw-rw---- 1 root 2000 103120 2010-08-06 11:34 init
-rwxr-x--- 1 root 2000 1677 2010-08-06 11:34 init.goldfish.rc
-rwxr-x--- 1 root 2000 64192 2010-08-06 11:34 initlogo.rle.bak
-rwxr-x--- 1 root 2000 12888 2010-08-06 11:47 init.rc
drwxr-xr-x 2 root root 4096 2010-06-03 15:45 proc
drwxr-x--- 2 root 2000 4096 2010-08-10 16:11 sbin
drwxr-xr-x 2 root root 4096 2010-06-03 15:45 sys
drwxr-xr-x 11 root root 4096 2010-08-10 16:11 system

I read several posts but I didn't find anything helping me to solve my
issue.

Thanks
Michel

Hi,
In case it can help the NFS server is running under Ubuntu 10.04 and
the shared folder is defined in /ect/exports file using line:
<SHARED_FOLDER_PATH> *(rw,async,insecure,all_squash,async)

Maybe there is something wrong in shared folder options.

Best regards
Michel

Hi,
I am stuck with that issue.
Can somebody explain how to build and configure Android to mount
rootfs from NFS server?
A step by step explanation from kernel setup build and rootfs build to
board env setup will be very welcome.

Thanks
Michel

Hi,
I am stuck with that issue.
Can somebody explain how to build and configure Android to mount
rootfs from NFS server?
A step by step explanation from kernel setup build and rootfs build to
board env setup will be very welcome.

Thanks
Michel

Hi Michael,

Knowing very little about Android, but you don't have the execute attribute
(x) set on the init file in the file listing below.

Isn't this supposed to be set in order for init to be able to run?
  Søren

Hi,
I am stuck with that issue.
Can somebody explain how to build and configure Android to mount
rootfs from NFS server?
A step by step explanation from kernel setup build and rootfs build to
board env setup will be very welcome.

Thanks
Michel

Do you check the firewall settings on the machine that hosts NFS server?

sorry mean to say: did you check the firewall setting?

[SOLVED]
Hi,
Thank you Søren, you put me to the track to the solution.
It was a NFS server configuration and rootfs file attribute issue.

I solved the issue, as just saying "issue solved" will not help others
bellow how I solve the issue.

- I am using Beagleboard C3 board.
- First I followed Rowboat wiki for setup http://code.google.com/p/rowboat/wiki/ConfigureAndBuild.
- I updated omap3_beagle_android_defconfig to enable ethernet over
USB.
Here is my config (I am not sure that all is needed)
CONFIG_USB_GADGET=y
CONFIG_USB_MUSB_PERIPHERAL=y
CONFIG_USB_GADGET_MUSB_HDRC=y
CONFIG_USB_ETH=y
CONFIG_USB_USBNET=y
CONFIG_USB_NET_AX8817X=y
CONFIG_USB_NET_CDCETHER=y
CONFIG_USB_NET_NET1080=y
- Connect ethert over USB adapter to Beagleboard USB connector (not
the Mini USB OTG)
- Boot Android from SD card when boot is complete use a terminal to
check ethernet connection and access to NFS server:
#netcfg eth0 up
#netcfg eth0 dhcp
#netcfg
#ping <NFS_SERVER_IP>&
- Create /dev/nfs directory
#mkdir /dev/nfs
- No problem found until here now rootfs mounting from NFS server.

There was two problems in my configuration:
    1) for a reason I don't know /init file was not executable.
I re-ceated a new rootfs and make sure to extract it as root and that /
init is executable.

I created a rootfs.tar.bz2 file using <my abdroid sdk>/build/tools/
mktarball.sh.
In rootfs.tar.bz2 I copied <my android sdk>/out/target/product/
beagleboard/root/* and <my android sdk>/out/target/product/
beagleboard/
system/*

    To extract the rootfs on shared nfs director i used the command:
sudo tar jxvf rootfs.tar.bz2 -C ./rootfs

    2) My NFS shared directoty configuration was not correct, and
Beagleboard was not able to create files.
On my Ubunut 10.04 NFS server computer /etc/exports file correct
configuration is:
<PATH_TO_SHARED_FOLDER> *(rw,no_root_squash,no_subtree_check,sync)

    3) Now the remaining thing is to setup Beagleboard env variable:
setenv bootargs 'mem=128M androidroot.console=ttyS2 console=tty0
console=ttyS2,115200n8 root=/dev/nfs rw init=/init ip=dhcp rootwait
omapfb.video_mode=640x480MR-16@60
nfsroot=<SERVER_IP>:<SHARED_DIRECTORY_PATH>,nolock,rsize=1024,wsize=1024'
bootcmd remain the same as for booting usinf SD card.
saveenv
boot

After that Android and kernel from Rowboat sources are able to boot
with no error.
Regards
Michel

Hi,
I disabled firewall and also install and configure firestarter to add
beagleboard ip to allowed hots and to allow NFS service for ports 111
2049 32767 and 32771.
Thanks
Michel

Hi,
I disabled firewall and also install and configure firestarter to add
beagleboard ip to allowed hots and to allow NFS service for ports 111
2049 32767 and 32771.
Thanks
Michel

Hi,
I disabled firewall and also install and configure firestarter to add
beagleboard ip to allowed hots and to allow NFS service for ports 111
2049 32767 and 32771.
Thanks
Michel

Hi,
I disabled firewall and also install and configure firestarter to add
beagleboard ip to allowed hots and to allow NFS service for ports 111
2049 32767 and 32771.
Thanks
Michel

[SOLVED]
Hi,
Thank you Søren you put me to the track to the solution.
There was two issue one with some file attributes on shared rootfs (I
don't know why some attributes changed when copying data to shared
folder) and one with NFS server settings for shared folder.

I solved the issue, as just saying issue solved will not help others
bellow how I solve the issue.

- I am using Beagleboard C3 board.
- First I followed Rowboat wiki for setup http://code.google.com/p/rowboat/wiki/ConfigureAndBuild.
- I updated omap3_beagle_android_defconfig to enable ethernet over
USB.
Here is my config (I am not sure that all is needed)
CONFIG_USB_GADGET=y
CONFIG_USB_MUSB_PERIPHERAL=y
CONFIG_USB_GADGET_MUSB_HDRC=y
CONFIG_USB_ETH=y
CONFIG_USB_USBNET=y
CONFIG_USB_NET_AX8817X=y
CONFIG_USB_NET_CDCETHER=y
CONFIG_USB_NET_NET1080=y
- Connect ethert over USB adapter to Beagleboard USB connector (not
the Mini USB OTG)
- Boot Android from SD card when boot is complete use a terminal to
check ethernet connection and access to NFS server:
#netcfg eth0 up
#netcfg eth0 dhcp
#netcfg
#ping <NFS_SERVER_IP>&
- Create /dev/nfs directory
#mkdir /dev/nfs
- No problem found until here now rootfs mounting from NFS server.

There was two problems in my configuration:
    1) for a reason I don't know /init file was not executable.
I re-ceated a new rootfs and make sure to extract it as root and
that /
init is executable.

I created a rootfs.tar.bz2 file using <my abdroid sdk>/build/tools/
mktarball.sh.
In rootfs.tar.bz2 I copied <my android sdk>/out/target/product/
beagleboard/root/* and <my android sdk>/out/target/product/
beagleboard/
system/*

    To extract the rootfs on shared nfs director i used the command:
sudo tar jxvf rootfs.tar.bz2 -C ./rootfs

    2) My NFS shared directoty configuration was not correct, and
Beagleboard was not able to create files.
On my Ubunut 10.04 NFS server computer /etc/exports file correct
configuration is:
<PATH_TO_SHARED_FOLDER> *(rw,no_root_squash,no_subtree_check,sync)

    3) Now the remaining thing is to setup Beagleboard env variable:
setenv bootargs 'mem=128M androidroot.console=ttyS2 console=tty0
console=ttyS2,115200n8 root=/dev/nfs rw init=/init ip=dhcp rootwait
omapfb.video_mode=640x480MR-16@60
nfsroot=<SERVER_IP>:<SHARED_DIRECTORY_PATH>,nolock,rsize=1024,wsize=1024'
bootcmd remain the same as for booting usinf SD card.
saveenv
boot

After that Android is able to boot.
Regards
Michel