ls1046ardb sd card image with RAM disk rootfs

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

ls1046ardb sd card image with RAM disk rootfs

1,048 Views
andreyrafalsky
Contributor III

Hi,

I use yocto to create an SD card using ramdisk rootfs.
Advise me, please, how can I add rootfs to the itb image or another way to boot rootfs as a ramdisk from an SD card?

Regards,
Andrey

0 Kudos
2 Replies

681 Views
Pavel
NXP Employee
NXP Employee

We use the following command sequence:

  1. SD card preparatin

Commands on Host PC after SD inserting

                dmesg | tail -20

 

2.

df

// find the similar:

                /dev/sdb1        7638904   57676   7193184   1% /media/pavel/62db768e-af9a-455a-8802-08578fce83b0

 

3.

                umount  /media/pavel/62db768e-af9a-455a-8802-08578fce83b0

 

4.

                sudo fdisk /dev/sdb1

a.

                               Command (m for help): d

                               Selected partition 1

b.

                Command (m for help): n

                               Partition type:

                               p primary (0 primary, 0 extended, 4 free)

                               e extended

                               Select (default p):

                               Using default response p

                               Partition number (1-4, default 1): note: select a default.

                               Using default value 1

                First sector (2048-499711, default 2048): 4096

// NOTE

// Skip the first 4096 blocks reserved for deploying U-Boot image.

                               Last sector, +sectors or +size{K,M,G} (4096-499711, default 499711):

                               Using default value 499711

// NOTE

// select a default.

                Command (m for help): w

                               The partition table has been altered!

 

5.

                sudo mkfs.ext2 /dev/sdb1

 

  1. // create /tftpboot/tmp and enable permission

sudo mount /dev/sdb1 /tftpboot/tmp

 

  1. // copy kernel.itb to /tftpboot/tmp

 

sudo umount /tftpboot/tmp

+++++++++++++++++++++++++++

on the board

  1. => setenv bootargs "root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200"
  2. => setenv bootcmd "ext2load mmc 0 a0000000 kernel.itb && bootm a0000000"
  3. => savenv
  4. => reset

 

or after boot:

  1. => ext2ls mmc 0 // list of files
  2. => ext2load mmc 0 a0000000 kernel.itb
  3. => bootm a0000000

 

See also the following page:

https://community.nxp.com/thread/448395

Have a great day,

Pavel Chubakov

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

0 Kudos

681 Views
andreyrafalsky
Contributor III

Hi Pavel,

Thank for your reply!

I solved this issue in another way.

It seems useful for someone else.

If you have itb image with no rootfs, you will need to create one ext2 partition for kernel.itb and rootfs. Also, you must set IMAGE_FSTYPES = "cpio.gz.u-boot". kernel.itb and rootfs must be copied to the sd card partition.

bootcmd and bootargs look like "ext2load mmc 0 a0000000 itbImage && ext2load mmc 0 a6000000 rootfs.cpio.gz.u-boot && bootm a0000000 a6000000" and  "root=/dev/ram0 rw earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200" accordingly.

BTW if you need to use ppa and fman_ucode, you will have offset large than 4096 bloks. E.g. in my project offset is 48 MB.

Best regards,

Andrey

0 Kudos