initramfs fails when cpio file reaches 100MB

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

initramfs fails when cpio file reaches 100MB

1,348 Views
JohnKlug
Senior Contributor I

We are using uuu and an initramfs root file system to test our board.

We are finding that when the uncompressed cpio file reaches about 100MB, the kernel load fails.

The last thing we see is:

Starting kernel ...

When we are running with a slightly smaller cpio file, we have close to 250MB of free space according to /dev/meminfo.

We are using U-Boot 2020.04  u-boot-imx and 5.4 linux-fslc-imx.

0 Kudos
Reply
4 Replies

1,326 Views
AldoG
NXP TechSupport
NXP TechSupport

Hello,

Please share the procedure you're following, and both the UART and the tool logs.

Best regards,
Aldo.

0 Kudos
Reply

1,304 Views
JohnKlug
Senior Contributor I

It appears to make a difference where the initramfs is stored.

 

Given an initramfs, rootfs.cpio.xz of size 39547768 and expanded size of 135067648.

bdinfo:
arch_number = 0x00000000
boot_params = 0x80000100
DRAM bank = 0x00000000
-> start = 0x80000000
-> size = 0x20000000
baudrate = 115200 bps
TLB addr = 0x9fff0000
relocaddr = 0x9ff48000
reloc off = 0x18748000
irq_sp = 0x9ef01d60
sp start = 0x9ef01d50
Early malloc usage: 530 / 2000
fdt_blob = 0x9ef01d78

If one uses low memory for the initramfs, the boot fails:

bootz 86800000 868a7000:25b7378 9eef8000

Kernel image @ 0x86800000 [ 0x000000 - 0x5f6168 ]
## Flattened Device Tree blob at 9eef8000
Booting using the fdt blob at 0x9eef8000
Using Device Tree in place at 9eef8000, end 9ef01ce4
Modify /soc/aips-bus@2100000/pxp@21cc000:status disabled
ft_system_setup for mx6

Starting kernel ...




If one instead uses high memory, the boot succeeds:

bootz 86800000 9B9F0000:25b7378 9eef8000

Kernel image @ 0x86800000 [ 0x000000 - 0x5f6168 ]
## Flattened Device Tree blob at 9eef8000
   Booting using the fdt blob at 0x9eef8000
   Using Device Tree in place at 9eef8000, end 9ef01ce4
Modify /soc/aips-bus@2100000/pxp@21cc000:status disabled
ft_system_setup for mx6

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0

 

However, if one tries to use the gzip equivalent file, which is about 53MB instead of 38MB, the initramfs is corrupted:

Kernel image @ 0x86800000 [ 0x000000 - 0x5f6168 ]
## Flattened Device Tree blob at 9eef8000
   Booting using the fdt blob at 0x9eef8000
   Using Device Tree in place at 9eef8000, end 9ef01ce4
Modify /soc/aips-bus@2100000/pxp@21cc000:status disabled
ft_system_setup for mx6

Starting kernel ...
 ...
[    9.372882] rootfs image is not initramfs (write error); looks like an initrd
[    9.373011] /initrd.image: incomplete write (-28 != 55073391)
[    9.536524] Freeing initrd memory: 53784K



0 Kudos
Reply

1,256 Views
jackie2
Contributor III

This issue, the most possible reason is NXP BSP linux defaut  configuration settings using AUTO_ZRELADDR, which is better to  reserve 128M for the safe region. 

It could be smaller, just don't let decompression kernel touches the others like ramdisk, dtb. 

0 Kudos
Reply

1,280 Views
AldoG
NXP TechSupport
NXP TechSupport

Hi,

Thank you for sharing more information of this, I don't know exactly which i.MX MPU are you using but for bootz you may use the section from loadaddr to fdt_addr variables, for each i.MX you may refer to the i.MX Linux User's Guide page 40 specifying memory addresses.

AldoG_1-1686962979064.png

Best regards,
Aldo.

0 Kudos
Reply