iMX28: NAND boot "no init found"

cancel
Showing results for 
Search instead for 
Did you mean: 

iMX28: NAND boot "no init found"

3,602 Views
Contributor II

Hi, all. After some difficulty, I was able to get the UBIFS file system to mount on the iMX28 EVK when booting from NAND. However, it seems that there is an issue reading from the file system, as I'm getting the following:

 

UBIFS: mounted UBI device 0, volume 0, name "rootfs0"

UBIFS: file system size:   99422208 bytes (97092 KiB, 94 MiB, 783 LEBs)

UBIFS: journal size:       4952064 bytes (4836 KiB, 4 MiB, 39 LEBs)

UBIFS: media format:       w4/r0 (latest is w4/r0)

UBIFS: default compressor: lzo

UBIFS: reserved for root:  4695956 bytes (4585 KiB)

VFS: Mounted root (ubifs filesystem) on device 0:14.

Freeing init memory: 160K

Kernel panic - not syncing: No init found.  Try passing init= option to kernel. See Linux Documentation/init.txt for guidance.

 

I'm running out of ideas. Has anyone else experienced this, and can you help?

 

Thanks,

 

Steve O

Labels (1)
0 Kudos
31 Replies

97 Views
Contributor I

Hi Steve,

I have solved the problem.

Thanks for helping me with the problem during the past several days.

Thanks very much.

Steve O said:

Try using the file described by Mike in the 06/21/2011 posting. Until I did that I was getting the same results as you. Sorry, I don't have a good way to get you the Uboot env right now.

0 Kudos

97 Views
Contributor II

What is the output of mtdinfo command? Does it show the correct information on your NAND device?

Can you boot from SD card and manually attach the UBI filesystem using ubiattach command and then mount the filesystem? That will at least tell you if the image is good and your kernel driver is able to read it. This FAQ was a lot of help for me: http://www.linux-mtd.infradead.org/faq/ubi.html

Aaron Dong said:

Hi Mike,

would you please help me with the problem?

I have listed my problem above

Thanks in advance.

I have the same problem, but i can't solve it right now.


Mike Morrell said:

In ltib there is configuration options for networking. You should be able to setup eth0 as dynamic or static in ltib. It will create entries in your /etc/rc.conf file to configure networking when the /etc/rc.d/init.d/network service is started. Take a look at the /etc/rc.d/init.d/network script to understand how the environment variables set by rc.conf affect the network startup. If you want to do dhcp manually to see if it is working just run

udhcpc -b -i eth0

from command line to start dhcp. Or you could add it to the end of /etc/rc.d/rc.local. Then you should see eth0 listed in ifconfig assuming you have the correct ethernet drivers configured in your kernel.


Roy Azriel said:

in order to write the ubi image to my Nand device I used the solution of Mike Morrel above. it worked fine.the problem that I am having is that the network device eth0 is not starting when the system is up.

the same kernel and rootfs are working fine with rootfs and eth0 starts. so, I am pretty sure its not the kernel. it is something I need to configure in the file system.  I am less familiar with ltib rootfs file structure and configurations (I am used to angstrum) do you know how can I configure it to work ? "ifconfig -a" command shows eth0 but I can not set it.

can someone indicate why ?

0 Kudos

97 Views
Contributor I

Hi Mike,

would you please help me with the problem?

I have listed my problem above

Thanks in advance.

I have the same problem, but i can't solve it right now.


Mike Morrell said:

In ltib there is configuration options for networking. You should be able to setup eth0 as dynamic or static in ltib. It will create entries in your /etc/rc.conf file to configure networking when the /etc/rc.d/init.d/network service is started. Take a look at the /etc/rc.d/init.d/network script to understand how the environment variables set by rc.conf affect the network startup. If you want to do dhcp manually to see if it is working just run

udhcpc -b -i eth0

from command line to start dhcp. Or you could add it to the end of /etc/rc.d/rc.local. Then you should see eth0 listed in ifconfig assuming you have the correct ethernet drivers configured in your kernel.


Roy Azriel said:

in order to write the ubi image to my Nand device I used the solution of Mike Morrel above. it worked fine.the problem that I am having is that the network device eth0 is not starting when the system is up.

the same kernel and rootfs are working fine with rootfs and eth0 starts. so, I am pretty sure its not the kernel. it is something I need to configure in the file system.  I am less familiar with ltib rootfs file structure and configurations (I am used to angstrum) do you know how can I configure it to work ? "ifconfig -a" command shows eth0 but I can not set it.

can someone indicate why ?

0 Kudos

97 Views
Contributor II

Try using the file described by Mike in the 06/21/2011 posting. Until I did that I was getting the same results as you. Sorry, I don't have a good way to get you the Uboot env right now.

0 Kudos

97 Views
Contributor I

could you please tell me all your uboot environment variables by type printenv under uboot?

I think this problem relates to Uboot environment variables.

Thanks so much for your help.


Steve O said:

I only have two more things to look at:

Is your NAND device listed in the memory device source? I can't recall exactly what the file name is right now.

The LEB count looks to be too small for a 100M file system.

0 Kudos

97 Views
Contributor I

Yeah, i have checked the Nand device, it is included in the memory device source.

Also if i use the file rootfs.tar.bz2 instead of rootfs.img.tar.bz2 in the ucl.xml.

rootfs.tar.bz2 is generated by compress the rootfs directory under LTIB directory.

<CMD type="push" body="$ mkdir -p /mnt/ubi0; mount -t ubifs ubi0_0 /mnt/ubi0" />
<CMD type="push" body="pipe tar -jxv -C /mnt/ubi0" file="files/rootfs.tar.bz2">Transfer rootfs</CMD>
<CMD type="push" body="frf">Finish Flashing NAND</CMD>
<CMD type="push" body="$ umount /mnt/ubi0">Unmounting</CMD>

I can boot the board successfully based upon above settings. It seems as if Kernel can't recognize rootfs.img.

But i have add the UBIFS under Kernel setting, both under Device driver and File system of kernel setting.

So i am a little out of mind.


Steve O said:

I only have two more things to look at:

Is your NAND device listed in the memory device source? I can't recall exactly what the file name is right now.

The LEB count looks to be too small for a 100M file system.

0 Kudos

97 Views
Contributor II

I only have two more things to look at:

Is your NAND device listed in the memory device source? I can't recall exactly what the file name is right now.

The LEB count looks to be too small for a 100M file system.

0 Kudos

97 Views
Contributor I

I have changed the Uboot settings as below

bootargs_nand=setenv bootargs ${bootargs} noinitrd console=ttyAM0, 115200 ubi.mtd=5 root=ubi0:rootfs rootfstype=ubifs rw gpmi

bootcmd_nand=run bootargs_base bootargs_nand;nand read ${loadaddr} 0xA00000 0x500000;bootm

bootargs_base=setenv bootargs console=ttymxc0,115200

bootcmd=run bootcmd_nand

And i get the same error.

So i am wondering if there are some problem while generating UBIFS image.

My Nand type is MT29F4G08ABADAWP, i generate the image with LTIB. Is there anything i should care while generating UBIFS?

The parameter used to generated UBIFS for this Nand is listed below:

(My rootfs volume is MTD5 and the size is 100M)

│ Target image: (ubifs) ---> │ │
│ │[ ] Run a command after building the target image │ │
│ │(128KiB) ubifs physical erase block(PEB) size │ │
│ │(126976) ubifs logical erase block(LEB) size in Bytes │ │
│ │(512) ubifs maximum logical erase block(LEB) count │ │
│ │(512) ubifs minimum I/O unit size

Also i find a wired problem that the nand is designed to be a 4GB, but while i boot the board with NFS/SD, it reports that the size is only 512MiB.


Steve O said:

I'm assuming the MFG Tool succeeds with the update above? If so, make sure you've set up the kernel command line correctly in the LTIB package list. Mine looks like:

noinitrd console=ttyAM0, 115200 ubi.mtd=1 root=ubi0:rootfs0 rootfstype=ubifs rw gpmi

But yours will be rootfs instead of rootfs0. Sorry I'm not more help.

0 Kudos

97 Views
Contributor II

I'm assuming the MFG Tool succeeds with the update above? If so, make sure you've set up the kernel command line correctly in the LTIB package list. Mine looks like:

noinitrd console=ttyAM0, 115200 ubi.mtd=1 root=ubi0:rootfs0 rootfstype=ubifs rw gpmi

But yours will be rootfs instead of rootfs0. Sorry I'm not more help.

0 Kudos

97 Views
Contributor I

Here is my Ucl.xml setting, please take a look and please help find out the problem. Thanks.

<CMD type="push" body="mknod class/mtd,mtd2,/dev/mtd2"/>
<CMD type="push" body="mknod class/mtd,mtd3,/dev/mtd3"/>
<CMD type="push" body="mknod class/mtd,mtd4,/dev/mtd4"/>
<CMD type="push" body="mknod class/mtd,mtd5,/dev/mtd5"/>
<CMD type="push" body="mknod class/mtd,mtd6,/dev/mtd6"/>
<CMD type="push" body="mknod class/mtd,mtd7,/dev/mtd7"/>
<CMD type="push" body="mknod class/misc,ubi_ctrl,/dev/ubi_ctrl"/>
<!-- <CMD type="push" body="mknod block,mtdblock2,/dev/mtdblock2,block"/>
<CMD type="push" body="mknod block,mtdblock3,/dev/mtdblock3,block"/>
<CMD type="push" body="mknod block,mtdblock4,/dev/mtdblock4,block"/>
<CMD type="push" body="mknod block,mtdblock5,/dev/mtdblock4,block"/>
<CMD type="push" body="mknod block,mtdblock6,/dev/mtdblock6,block"/>
<CMD type="push" body="mknod block,mtdblock7,/dev/mtdblock7,block"/>-->
<CMD type="push" body="send" file="files/u-boot.bin">Sending U-Boot</CMD>
<CMD type="push" body="$ echo 1 > /sys/devices/platform/gpmi-nfc.0/ignorebad">Ignore bad block</CMD>
<CMD type="push" body="$ kobs-ng init --chip_0_device_path=/dev/mtd2 $FILE">Flashing Bootloader</CMD>
<CMD type="push" body="$ echo 0 > /sys/devices/platform/gpmi-nfc.0/ignorebad">Care bad block</CMD>
<CMD type="push" body="$ flash_eraseall /dev/mtd3">Erasing Kernel partition</CMD>
<CMD type="push" body="send" file="files/uImage">Sending Kernel Image</CMD>
<CMD type="push" body="$ nandwrite /dev/mtd3 -p $FILE">Flashing Kernel</CMD>
<!-- <CMD type="push" body="$ flash_eraseall /dev/mtd4">Erasing application partition</CMD>
<CMD type="push" body="pipe nandwrite -p /dev/mtd4" file="files/Applications.jffs2">Sending and writing Application</CMD>-->
<CMD type="push" body="$ flash_eraseall /dev/mtd5">Erasing rootfs partition</CMD>
<!-- <CMD type="push" body="$ ubiformat /dev/mtd5">Ubiformat rootfs partition</CMD>-->
<CMD type="push" body="$ ubiattach /dev/ubi_ctrl -d 0 -m 5">Attaching UBI partition</CMD>
<CMD type="push" body="mknod class/ubi,ubi0,/dev/ubi0"/>
<CMD type="push" body="$ ubimkvol /dev/ubi0 -n 0 -N rootfs -m">Creating UBI volumes</CMD>
<!-- <CMD type="push" body="$ ubiupdatevol ubi0:rootfs -t">Transfer rootfs</CMD>
<CMD type="push" body="$ ubiupdatevol ubi0:rootfs rootfs.ubifs">Transfer rootfs</CMD>
<CMD type="push" body="sync">Sync NAND</CMD>-->
<CMD type="push" body="$ mkdir -p /mnt/ubi0; mount -t ubifs ubi0_0 /mnt/ubi0" />
<CMD type="push" body="pipe tar -xv -C /mnt/ubi0" file="files/rootfs.ubifs.tar">Transfer rootfs</CMD>
<!-- <CMD type="push" body="pipe ubiformat /dev/mtd5 -y -s 2048 -f - -S @FILESIZE" file="files/rootfs.ubifs.img">Sending and writting rootfs</CMD>-->
<CMD type="push" body="frf">Finish Flashing NAND</CMD>
<CMD type="push" body="$ umount /mnt/ubi0">Unmounting</CMD>

<!-- <CMD type="push" body="$ flash_eraseall /dev/mtd6">Erasing data partition</CMD>
<CMD type="push" body="$ flash_eraseall /dev/mtd7">Erasing general use partition</CMD>-->
<CMD type="push" body="$ echo Update Complete!">Done</CMD>

0 Kudos

97 Views
Contributor I

Hi Steve,

I have the same settings as you done for ucl.xml. But when i boot up, it always gives the error below, would you please tell me how i can fix this problem?

My rootfs is generated by LTIB and i use rootfs.ubifs which is "non-ubinized".

Would you please help me with this?

Thanks in advance. 

UBIFS: mounted UBI device 0, volume 0, name "rootfs"
UBIFS: file system size: 98787328 bytes (96472 KiB, 94 MiB, 778 LEBs)
UBIFS: journal size: 4952064 bytes (4836 KiB, 4 MiB, 39 LEBs)
UBIFS: media format: w4/r0 (latest is w4/r0)
UBIFS: default compressor: lzo
UBIFS: reserved for root: 4665969 bytes (4556 KiB)
VFS: Mounted root (ubifs filesystem) on device 0:12.
Freeing init memory: 172K
Failed to execute /sbin/init. Attempting defaults...
Kernel panic - not syncing: No init found. Try passing init= option to kernel.
See Linux Documentation/init.txt for guidance.
[<800384c0>] (unwind_backtrace+0x0/0xf0) from [<804204ec>] (panic+0x6c/0xe0)
[<804204ec>] (panic+0x6c/0xe0) from [<80033588>] (init_post+0xac/0xd4)
[<80033588>] (init_post+0xac/0xd4) from [<800084a4>] (kernel_init+0x124/0x168)
[<800084a4>] (kernel_init+0x124/0x168) from [<800349c0>] (kernel_thread_exit+0x0
/0x8)



Steve O said:

In regards to the last question - I now have the Freescale MFG Tool working with the ubifs file created from LTIB. (Refer to Mike's instructions for commenting out the removal of the "non-ubinized" file during the build process). I didn't have to resort to manually creating the image myself. I have attached the XML file used with the MFG tool in case anyone else is having this difficulty. The flash file system can also be programmed using Mike's handy script, either from SD or through NFS.

 

0 Kudos

97 Views
Contributor II

I was able to use the MFG Tool from Freescale along with the "non-ubinized" file system output from LTIB as described above, both on the EVK and our target board. The ucl.xml file attached above is used with the tool to flash the NAND.

fanqipin said:

how to mount the ubifs to imx28evk, can you give me same advises;thanks

0 Kudos

98 Views
Contributor I

how to mount the ubifs to imx28evk, can you give me same advises;thanks

0 Kudos

98 Views
Contributor II

In ltib there is configuration options for networking. You should be able to setup eth0 as dynamic or static in ltib. It will create entries in your /etc/rc.conf file to configure networking when the /etc/rc.d/init.d/network service is started. Take a look at the /etc/rc.d/init.d/network script to understand how the environment variables set by rc.conf affect the network startup. If you want to do dhcp manually to see if it is working just run

udhcpc -b -i eth0

from command line to start dhcp. Or you could add it to the end of /etc/rc.d/rc.local. Then you should see eth0 listed in ifconfig assuming you have the correct ethernet drivers configured in your kernel.


Roy Azriel said:

in order to write the ubi image to my Nand device I used the solution of Mike Morrel above. it worked fine.the problem that I am having is that the network device eth0 is not starting when the system is up.

the same kernel and rootfs are working fine with rootfs and eth0 starts. so, I am pretty sure its not the kernel. it is something I need to configure in the file system.  I am less familiar with ltib rootfs file structure and configurations (I am used to angstrum) do you know how can I configure it to work ? "ifconfig -a" command shows eth0 but I can not set it.

can someone indicate why ?

0 Kudos

98 Views
Contributor I

in order to write the ubi image to my Nand device I used the solution of Mike Morrel above. it worked fine.the problem that I am having is that the network device eth0 is not starting when the system is up.

the same kernel and rootfs are working fine with rootfs and eth0 starts. so, I am pretty sure its not the kernel. it is something I need to configure in the file system.  I am less familiar with ltib rootfs file structure and configurations (I am used to angstrum) do you know how can I configure it to work ? "ifconfig -a" command shows eth0 but I can not set it.

can someone indicate why ?

0 Kudos

98 Views
Contributor II

In regards to the last question - I now have the Freescale MFG Tool working with the ubifs file created from LTIB. (Refer to Mike's instructions for commenting out the removal of the "non-ubinized" file during the build process). I didn't have to resort to manually creating the image myself. I have attached the XML file used with the MFG tool in case anyone else is having this difficulty. The flash file system can also be programmed using Mike's handy script, either from SD or through NFS.

0 Kudos

98 Views
Contributor II

That worked, Mike, thanks again.

I was wondering if you've ever used the MFG Tool from Freescale? When I use the exact same commands as listed, the tool doesn't work (the target fails to find /dev/ubi0_0), but I can program from the terminal no problem.

0 Kudos

98 Views
Contributor II

Here is an explanation of the difference between the two files and when to use them.

 

How do I create an UBIFS image?

 

I found that you have to boot from the SD card and mount a rootfs from the SD card in order to burn a rootfs image on NAND. I usually copy the new rootfs.ubifs  and imx28_ivt_linux.sb file and the update.sh script to the /root directory on the SD card and then boot from SD. You cannot flash the rootfs to NAND if you currently have the rootfs mounted from NAND. It makes sense if you think about it, since you cannot overwrite your currently mounted root file system (although if  you try, it will try to do it and fails). Kernel image doesn't matter since it is loaded into RAM so you could boot the kernel from NAND and mount the rootfs from SD card. That should work too.

Mike Morrell said:

Here is a script I wrote to flash the kernel and rootfs images to NAND.

Mike Morrell said:

Yeah, I had that problem too. Edit ~/ltib/bin/Ltibutils.pm and comment out line 904 "rm $tdir/rootfs.ubifs $tdir/rootfs_image". Then you can burn the rootfs.ubifs file to NAND using the following commands. It seems that the rootfs.ubifs.img file is ubinized but I don't know what that does to the file format, but you can't use that file with these commands.

 


flash_eraseall /dev/mtd1 ubiattach /dev/ubi_ctrl -d 0 -m 1

ubimkvol /dev/ubi0 -N rootfs -m

ubiupdatevol /dev/ubi0_0 rootfs.ubifs sync



Steve Otzman said:

Appreciate your help, Mike thanks.

I was finally successful in getting the UBIFS file system to work from NAND. However, I had to go outside of the documented methods: 

What I had to do was to move the entire file system on my host machine to a temporary directory, then manually remove the boot, man pages, locale, etc.. directories to get the file system to a manageable size. Then I created a tar file (with no parent directories included - that's important) from this temporary file system. Once I had that I was successful in programming the NAND both from the console and also using the MFG tool. 

I never was able to get the ".img" file created by LTIB (or Ubuntu, I tried both) to expand into a directory structure on the target. The result was always that the file system would mount, but all it contained was a file named "rootfs.ubifs.img". Therefore the init file was not found in the expected place, and a kernel panic was generated. 

I would like to be able to use the image file created by LTIB, as the above process is time consuming and prone to errors, so if anyone finds a solution I would be interested in it. In the meantime, our system is now functioning from NAND.

 

Steve O

0 Kudos

98 Views
Contributor II
Here is a script I wrote to flash the kernel and rootfs images to NAND.

Mike Morrell said:

Yeah, I had that problem too. Edit ~/ltib/bin/Ltibutils.pm and comment out line 904 "rm $tdir/rootfs.ubifs $tdir/rootfs_image". Then you can burn the rootfs.ubifs file to NAND using the following commands. It seems that the rootfs.ubifs.img file is ubinized but I don't know what that does to the file format, but you can't use that file with these commands.

 


flash_eraseall /dev/mtd1 ubiattach /dev/ubi_ctrl -d 0 -m 1

ubimkvol /dev/ubi0 -N rootfs -m

ubiupdatevol /dev/ubi0_0 rootfs.ubifs sync



Steve Otzman said:

Appreciate your help, Mike thanks.

I was finally successful in getting the UBIFS file system to work from NAND. However, I had to go outside of the documented methods: 

What I had to do was to move the entire file system on my host machine to a temporary directory, then manually remove the boot, man pages, locale, etc.. directories to get the file system to a manageable size. Then I created a tar file (with no parent directories included - that's important) from this temporary file system. Once I had that I was successful in programming the NAND both from the console and also using the MFG tool. 

I never was able to get the ".img" file created by LTIB (or Ubuntu, I tried both) to expand into a directory structure on the target. The result was always that the file system would mount, but all it contained was a file named "rootfs.ubifs.img". Therefore the init file was not found in the expected place, and a kernel panic was generated. 

I would like to be able to use the image file created by LTIB, as the above process is time consuming and prone to errors, so if anyone finds a solution I would be interested in it. In the meantime, our system is now functioning from NAND.

 

Steve O

0 Kudos

98 Views
Contributor II

Yeah, I had that problem too. Edit ~/ltib/bin/Ltibutils.pm and comment out line 904 "rm $tdir/rootfs.ubifs $tdir/rootfs_image". Then you can burn the rootfs.ubifs file to NAND using the following commands. It seems that the rootfs.ubifs.img file is ubinized but I don't know what that does to the file format, but you can't use that file with these commands.

 


flash_eraseall /dev/mtd1 ubiattach /dev/ubi_ctrl -d 0 -m 1

ubimkvol /dev/ubi0 -N rootfs -m

ubiupdatevol /dev/ubi0_0 rootfs.ubifs sync



Steve Otzman said:

Appreciate your help, Mike thanks.

I was finally successful in getting the UBIFS file system to work from NAND. However, I had to go outside of the documented methods: 

What I had to do was to move the entire file system on my host machine to a temporary directory, then manually remove the boot, man pages, locale, etc.. directories to get the file system to a manageable size. Then I created a tar file (with no parent directories included - that's important) from this temporary file system. Once I had that I was successful in programming the NAND both from the console and also using the MFG tool. 

I never was able to get the ".img" file created by LTIB (or Ubuntu, I tried both) to expand into a directory structure on the target. The result was always that the file system would mount, but all it contained was a file named "rootfs.ubifs.img". Therefore the init file was not found in the expected place, and a kernel panic was generated. 

I would like to be able to use the image file created by LTIB, as the above process is time consuming and prone to errors, so if anyone finds a solution I would be interested in it. In the meantime, our system is now functioning from NAND.

 

Steve O

0 Kudos