The below steps describe how to modify the content of the existing rootfs.
Steps are explained using LX2160ARDB board, however, the steps are applicable to all Layerscape devices and boards.
Create a temporary directory for extracting the contents of the cpio.gz archive image. For example: mkdir temp_folder.
For example: gunzip -c rootfs_lsdk2012_yocto_tiny_arm64.cpio.gz | sh -c 'cd temp_folder/&& cpio -i'
bin boot dev etc home init lib media mnt proc run sbin sys tmp usr var
For example:
Change directory to flexbuild_lsdk<version>/configs/linux.
gedit linux_arm64_LS.its
Update path as follows:
data = /incbin/("../../packages/rfs/initrd/new_rootfs_lsdk2012_yocto_tiny_arm64.cpio.gz");
For example: flex-builder -i mkitb -r yocto:tiny
This generates lsdk2012_yocto_tiny_LS_arm64.itb image.
Set up Ethernet connection between the board (for example, LX2160ARDB) and host machine on which you have configured the TFTP server.
DPMAC2@xlaui4, DPMAC3@xgmii, DPMAC4@xgmii, DPMAC5@25g-aui, DPMAC6@25g-aui, DPMAC17@rgmii-id, DPMAC18@rgmii-id
=> setenv serverip <ipaddress1>
Set ethact and ethprime as the ethernet interface connected to the TFTP server.
See LX2160ARDB Ethernet Port Mapping for the mapping of Ethernet port names appearing on the chassis front panel with the port names in U-Boot and Linux.
=> setenv ethprime <name of interface connected to TFTP server>
For example:
=> setenv ethprime DPMAC3@xgmii
=> setenv ethact <name of interface connected to TFTP server>
For example:
=> setenv ethact DPMAC3@xgmii
Static IP address assignment:
=> setenv ipaddr <ipaddress2>
=> setenv netmask <subnet mask>
Dynamic IP address assignment:
=> dhcp
=> saveenv
=> ping $serverip
Using DPMAC3@xgmii device
host 192.168.2.1 is alive
=> tftp 0xa0000000 <itb_file_name>
For example: => tftp 0xa0000000 lsdk2012_yocto_tiny_LS_arm64.itb
=> bootm 0xa0000000#<board_name>
For example: => bootm 0xa0000000#lx2160ardb
Let the board boots to Tiny Linux.
NXP LSDK tiny 2012 (based on Yocto)
TinyLinux login: root
root@TinyLinux:~# ls
root@TinyLinux:~# cd /
root@TinyLinux:/# ls
HelloWorld boot etc init media new_rootfs_lsdk2012_yocto_tiny_arm64.cpio.gz root sbin tmp var
bin dev home lib mnt proc run sys usr
root@TinyLinux:/#
You will observe the HelloWorld file available in the filesystem.