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
We use the following command sequence:
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
sudo mount /dev/sdb1 /tftpboot/tmp
sudo umount /tftpboot/tmp
+++++++++++++++++++++++++++
on the board
or after boot:
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!
-----------------------------------------------------------------------------------------------------------------------
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