Boot with initramfs

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

Boot with initramfs

24,945 Views
rans
Senior Contributor I

Hello,

I am trying to boot initramfs.

1. I first validate that my rootfs starts correctly when booting from sd

I use the following booargs, and it boots without issues from sd.

  • setenv boot "ext2load mmc 1:1 && ext2load mmc 1:1 $fdtaddr $fdtfile && setenv bootargs $mtdparts $params  root=mmcblk0p1 ro && bootm $loadaddr - $fdtaddr"
  • run boot

2. I then created initramfs and loaded the file with tftp to memory:

  •  sh -c 'cd rootfs/ && find . | cpio -H newc -o' | gzip -9 > new_initramfs.cpio.gz
  •  mkimage -A arm -O linux -T ramdisk -C none -a 0x40800000 -n "Root Filesystem" -d ./new_initramfs.cpio.gz ./initramfs.cpio.gz.uboot
  •  tftp 42000000 initramfs.cpio.gz.uboot;

      

3. then I boot from u-boot with simple modification in bootargs which takes care to find rootfs in memory instead of searching rootfs in sd files.

  • setenv boot "ext2load mmc 1:1 && ext2load mmc 1:1 $fdtaddr $fdtfile && setenv bootargs $mtdparts $params root=/dev/ram0 rw initrd=0x42000000,20M ramdisk_size=100000 && bootm $loadaddr - $fdtaddr"

Yet, I get failures on boot:

VGEN2: disabling
VGEN5: disabling
ALSA device list:
#0: imx-spdif
#1: imx-hdmi-soc
List of all partitions:
0100 100000 ram0 (driver?)
0101 100000 ram1 (driver?)
0102 100000 ram2 (driver?)
0103 100000 ram3 (driver?)
0104 100000 ram4 (driver?)
0105 100000 ram5 (driver?)
0106 100000 ram6 (driver?)
0107 100000 ram7 (driver?)
0108 100000 ram8 (driver?)

..

No filesystem could mount root, tried: ext3 ext2 ext4 cramfs vfat
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)
CPU2: stopping
CPU: 2 PID: 0 Comm: swapper/2 Not tainted 4.1.31-imx6+ #1
Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)

I also noticed the following in kernel boot:

rootfs image is not initramfs (junk in compressed archive); looks like an initrd
Freeing initrd memory: 20480K (b2000000 - b3400000)

I have also checked kernel .config and it seems to be OK:

CONFIG_BLK_DEV_INITRD=y
CONFIG_RD_GZIP=y

4. I then tried to change bootargs as following (removed root parameter, and bootm with 3 parameters)

sesetenv boot "ext2load mmc 1:1 && ext2load mmc 1:1 $fdtaddr $fdtfile && setenv bootargs $mtdparts $params  && bootm $loadaddr 0x42000000 $fdtaddr"

Now I get "Waiting for root device ..." , but nothing happens...... :smileysad:

smarc_usb0: disabling
VGEN2: disabling
VGEN5: disabling
ALSA device list:
#0: imx-spdif
#1: imx-hdmi-soc
Waiting for root device ...

I tried many combinations, and variables, but nothing helped.

Can anyone please help with it ?

Thank you,

Ran

0 Kudos
5 Replies

14,866 Views
diego_dorta
NXP Employee
NXP Employee

Hi Ran,

Take a look on this post to see if you can use any information: How to boot imx using ramdisk - i.MXDev Blog 

Thanks,

Diego

0 Kudos

14,866 Views
igorpadykov
NXP Employee
NXP Employee

Hi Ran

seems this may depend on used kernel and and boot with initramfs is well described on

IMX6 - booting to a roofts on ramdisk (Boundary Sabre-lite)? 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

14,866 Views
rans
Senior Contributor I

Hello Igor,

Thank you very much for commenting.

I have these in my config, but I it still keep waiting for rootfs. That's so strange...

I tried everything: initrd (ext2), initramfs (cpio), tried build fs in kernel or as seperate file, but nothing helps.

I don't understand why initramfs/initrd does not work, I thought it is not so complex... :smileysad:

Best Regards,

Ran

0 Kudos

14,866 Views
igorpadykov
NXP Employee
NXP Employee

Hi Ran

what bsp used in the case, please try to follow steps provided

by boundary devices and use its bsp.

Best regards
igor

0 Kudos

14,866 Views
rans
Senior Contributor I

Hi Igor,

Thank you.

It is adlink board (lec-imx6), and has its own build, no ltib.

I will check the instructions in boundary and see if I missed anything.

Thanks anyway,

Ran

0 Kudos