We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

Showing results for 
Search instead for 
Did you mean: 
Registered: ‎07-01-2016

Petalinux 2018.2 - How do I populate the file system with files


I've created a project called "auxfiles" that contains a set of files I want to copy into /usr/share/companyname/dir1 and /usr/share/companyname/dir2 on the final image.  Nothing needs to be compiled - I just want the files to appear in /usr/share/companyname in their respecitve folders in the image.  There are about a dozen files that need to be copied into the two folders.

How do I do this in Yocto/BitBake & PetaLinux 2018.2?

Thanks in advance for your help!



0 Kudos
1 Reply
Registered: ‎02-07-2018

Re: Petalinux 2018.2 - How do I populate the file system with files

HI @dtubbs

Please extract the rootfs into your SDCARD 2nd partition and use the rootfs from SDCARD 2nd partition itself. So that you can edit and copy any files in your board and it will be permanently saved. 

Please follow below steps to make use of rootfs from 2nd partition.


1. petalinux-config -c kernel

General setup  --->

                [ ] Initial RAM filesystem and RAM disk (initramfs/initrd)  support -- by default is enabled , you should unselect it.

save & exit


2. Copy your BOOT.BIN and image.ub in to your SDCARD 1st partition

3. copy BOOT.BIN and Image.ub into SD-Card 1st partition and extract the rootfs to 2nd partition like this below

tar -xvf  rootfs.tar.gz -C  /media/rootfs/.

You can copy the required file to your rootfs before booting board , or you cal also copy once the board is up using ftfp.

4.  Once you get u-boot console run below command:

5  setenv bootargs 'console=ttyPS0,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait'

6.  boot


Thanks & regards


Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.