i.MX28evk initramfs doesnt work.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.MX28evk initramfs doesnt work.

1,769 Views
rootb3r
Contributor II

Hi all, I've built a kernel with support for initramfs in it but haven't linked the initramfs into the kernel. The kernel and initramfs are placed at their respective memory addresses and using u-boot iminfo command I can verify that.
As soon as the kernel starts to decompress and load the initramfs it hangs while executing init from the initramfs.
This is the error I get:--

U-Boot 2014.01 (Jan 16 2019 - 17:32:13)

CPU: Freescale i.MX28 rev1.2 at 454 MHz
BOOT: NAND, 3V3
DRAM: 64 MiB
NAND: 128 MiB
Video: MXSFB: 'videomode' variable not set!
In: serial
Out: serial
Err: serial
Net: FEC0 [PRIME], FEC1
Hit any key to stop autoboot: 5 4 0
=> prn iminfo 0x42300000

## Checking Image at 42300000 ...
Legacy image found
Image Name: Root Filesystem
Created: 2019-02-22 18:40:04 UTC
Image Type: ARM Linux RAMDisk Image (uncompressed)
Data Size: 1896596 Bytes = 1.8 MiB
Load Address: 40800000
Entry Point: 40800000
Verifying Checksum ... OK
=> iminfo 0x42300000 00000 000000

## Checking Image at 42000000 ...
Legacy image found
Image Name: Linux-2.6.35.3-flex-dvt
Created: 2019-04-09 15:46:08 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1926580 Bytes = 1.8 MiB
Load Address: 40008000
Entry Point: 40008000
Verifying Checksum ... OK
=> boot boot
Unknown command 'console=ttyAM0,115200' - try 'help'
## Booting kernel from Legacy Image at 42000000 ...
Image Name: Linux-2.6.35.3-flex-dvt
Created: 2019-04-09 15:46:08 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1926580 Bytes = 1.8 MiB
Load Address: 40008000
Entry Point: 40008000
## Loading init Ramdisk from Legacy Image at 42300000 ...
Image Name: Root Filesystem
Created: 2019-02-22 18:40:04 UTC
Image Type: ARM Linux RAMDisk Image (uncompressed)
Data Size: 1896596 Bytes = 1.8 MiB
Load Address: 40800000
Entry Point: 40800000
Loading Kernel Image ... OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
Linux version 2.6.35.3-670-g914558e-dvt-g4ea3bcd-dirty (srishti@iot-compile) (gcc version 4.4.4 (4.4.4_09.06.2010) ) #1 PREEMPT Tue Apr 9 21:11:13 IST 2019
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: Freescale MX28EVK board
Memory policy: ECC disabled, Data cache writeback
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256
Kernel command line: console=ttyAM0,115200 rootfstype=ramfs root=/dev/ram rw gpmi init=/init earlyprintk=serial
.

.

.

VFS: Mounted root (ramfs filesystem) on device 0:11.

Freeing init memory: 124K

Failed to execute /init. Attempting defaults...

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

Backtrace:

[<8002b990>] (dump_backtrace+0x0/0x110) from [<802d69a8>] (dump_stack+0x18/0x1c)
r7:00000013 r6:80046b14 r5:800221c8 r4:803dbd58

[<802d6990>] (dump_stack+0x0/0x1c) from [<802d6a24>] (panic+0x78/0xfc)

[<802d69ac>] (panic+0x0/0xfc) from [<800275ec>] (init_post+0xb4/0xdc)
r3:00000000 r2:83c72d00 r1:83c72e00 r0:80359312

[<80027538>] (init_post+0x0/0xdc) from [<800084fc>] (kernel_init+0x12c/0x170)
r5:800221c8 r4:803daf40

[<800083d0>] (kernel_init+0x0/0x170) from [<80046b14>] (do_exit+0x0/0x6a4)
r5:800083d0 r4:00000000

The arguments I pass onto the kernel command line are:--

console=ttyAM0,115200 rootfstype=ramfs root=/dev/ram rw gpmi init=/init earlyprintk=serial

My goal here is to build a minimal firmware with kernel and initramfs only as far as I can see the log initramfs gets mounted properly but don't know the reason why it cannot execute any file from initramfs. Also, in the kernel config I've enabled the following:--

 

General setup  --->

   [*] Initial RAM filesystem and RAM disk (initramfs/initrd) support 
          ( ) Initramfs source file(s) 
   [*] Optimize for size

And...

Device Drivers  ---> 
   [*] Block devices  ---> 
      <*> RAM block device support  
       (16) Default number of RAM disks  
       (4096) Default RAM disk size (kbytes)

I don't know where I'm going wrong If anyone has any clue pls post your suggestions.

Regards,
Amit.

Labels (2)
6 Replies

1,461 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hello Amit,

     The final version of linux BSP for i.MX28EVK is L2.6.35, See here, please!

--Embedded Linux for i.MX Applications Processors | NXP 

i.MX28's linux BSP source code can also be found in other versions of linux BSP, but we didn't test and validate it. If users want to use other version of BSP, she will have to test and debug it.

In addition, according to your above logs and descriptions, u-boot/linux kernel can be normally boot, but init file was not correctly loaded.

You can find many contents on how to load ram disk from internet. such as the link:

Using the initial RAM disk (initrd) — The Linux Kernel documentation 

Hope it can help you!

Have a nice day!

Best Regards,

NXP TIC Weidong

1,461 Views
rootb3r
Contributor II

So the u-boot and kernel are working fine problem is with initramfs.

Also, I've noticed the default size of initramfs is 4096 while after extracting the initramfs.cpio.gz file it expanded to 5Mb which is more than the allocated size in the kernel can this be an issue?

Thanks for the reply.    

0 Kudos

1,461 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hello Amit,

     You can try to find "Default RAM disk size kbytes" in kernel menuconfig.

device-->blocks-->Default RAM disk size kbytes.

it should be here.

Have a nice day!

NXP Tic team Weidogn sun

0 Kudos

1,461 Views
rootb3r
Contributor II

I've already increased the size of initramfs by doing what you've suggested

it doesn't help I'm still stuck at same error.

Does the problem I'm facing got anything to do with ATAGS in uboot?

I've tried building initramfs through buildroot and even manually building

busybox and then building the initramfs using the static busybox binary

nothing seems to work.

0 Kudos

1,461 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hello Amit,

     Could you try the final version of linux BSP for i.MX28 EVK ?

Have a nice day!

weidong

0 Kudos

1,461 Views
rootb3r
Contributor II

I'm actually building the firmware for Wink Hub 1 by Wink Inc which is based on i.MX28evk board and they've open sourced the kernel they use on the device here's the link:- https://github.com/winkapp/wink-hub-kernel-public. I downloaded the ltib BSP but it's giving me a lot of compatibility issues especially Perl and I'm unable to build the kernel.

Thanks for the reply.   

0 Kudos