Kernel panic - not syncing: No init found

Hi All,

I am trying to boot my kernel from ram using the bootm command in u-boot. the kernel image is stored on my host machine ip = 192.168.1.50. The two directories have been setup with relevant images as follows:-

Kernel Image directory => /tftpboot/uImage-cme9210js
Squash fs directory => /exports/nfsroot-cme9210js

Below is the entry to my kernel command line arguments

rootpath=/exports/nfsroot-cmd9210js
bootargs=root=/dev/nfs rw rootfstype=squashfs mtdparts=physmap-flash.0:0x30000(U-Boot),0x20000@0x30000(NVRAM),0x120000@0x2e0000(User-JFFS2) nfsroot=192.168.1.50:/exports/nfsroot-cme9210js ip=192.168.1.51:192.168.1.50:192.168.1.1:255.255.0.0::::eth0

After saving the variables I issue the following command

tftpboot 0x400000 /tftpboot/uImage-9210js

followed by

bootm

After issuing the following command the boot message ends with the following line.

Looking up port of RPC 100005/1 on 192.168.1.50
VFS: Mounted root (nfs filesystem).
Freeing init memory: 80K
Warning: unable to open an initial console.
Kernel panic - not syncing: No init found. Try passing init= option to kernel.

What init option do I need to pass to the kernel?

Many thanks in advance

Ola

please use command
dboot linux tftp

it looks like manual commands you are trying to use do not pass all necessary arguments to the kernel

Hi LeonidM,

I tried your command but didn’t get far see output I get

Looking up port of RPC 100003/2 on 192.168.1.50
Looking up port of RPC 100005/1 on 192.168.1.50
Root-NFS: Server returned error -13 while mounting /exports/nfsroot-cme9210js
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device “nfs” or unknown-block(2,0)
Please append a correct “root=” boot option; here are the available partitions:
1f00 192 mtdblock0 (driver?)
1f01 128 mtdblock1 (driver?)
1f02 960 mtdblock2 (driver?)
1f03 1664 mtdblock3 (driver?)
1f04 1152 mtdblock4 (driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)

Regards

onio

Hi forum,

I have managed to boot the kernel and load the rootfs by passing the following parameters into uboot bootargs environment variable.

on the host (NFS server) I export the nfs directory by adding to the /etc/exports file as follows:-

/nfs *(rw,sync,no_root_squash,no_all_squash,no_subtree_check)

I also modified my uboot environment variable as follows:-

bootargs=root=/dev/nfs rw rootfstype=jffs2 mtdparts=physmap-flash.0:0x30000(U-Boot),0x20000@0x30000(NVRAM),0x120000@0x2e0000(User-JFFS2) nfsroot=192.168.1.50:/nfs ip=192.168.1.51:192.168.1.50:192.168.1.1:255.255.255.0:: eth0 init=/sbin/init

The serverip address is 192.168.1.50 while the target board ip address is 192.168.1.51 and the gateway 192.168.1.1.

I later copied the following contents of the created rootfs to the nfs directory on the serverip which were as follows:-

rootfs $ ls
bin  dev  etc  home  lib  media  mnt  nfs  opt  proc  root  sbin  sys  tmp  usr  var

Passing the init=/sbin/init into the bootargs solved the Kernel panic - not syncing: No init found. Try passing init= option to kernel

As the init is an executable that resides in the sbin directory.

With above configuration I have been able to boot the kernel which loads the root file system.

I also made changes to the /nfs/etc/init.d/S05userfs.sh by adding the

mkdir -p /tmp/mnt/User-JFFS2
sleep 1
mount -t jffs2 /dev/mtdblock2 /tmp/mnt/User-JFFS2

to mount the JFFS2 filesystem which contains script to start all other user process and applications.

Regards

onio