UPGRADE YOUR BROWSER

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!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor linux.fpga
Visitor
2,019 Views
Registered: ‎11-01-2018

How to include any files in rootfs - Petalinux 2017.1

Hi everyone,

I have the following files test1.bin, test2.bin and test3.bin and I want to add my files in rootfs.
I do not want to manually copy them to rootfs.
After the system is started, the files should appear in media folder.
Does anyone know solution to this?

Thanks

7 Replies
Observer russellsnow
Observer
1,975 Views
Registered: ‎09-17-2018

Re: How to include any files in rootfs - Petalinux 2017.1

I can't figure this out either in 2018.1.

0 Kudos
Moderator
Moderator
1,971 Views
Registered: ‎09-12-2007

Re: How to include any files in rootfs - Petalinux 2017.1

Create an application in Petalinux

petalinux-create -t apps -n add_files --enable

Then add you images to the files for in this newly created app. You will need to update the bbappend too.

 

Then update the do_install to add your files.

0 Kudos
Observer russellsnow
Observer
1,965 Views
Registered: ‎09-17-2018

Re: How to include any files in rootfs - Petalinux 2017.1

I think you are missing the point. I am trying to include the source so that I run gdb on the target when networking is not available. I assume there is a secret special lucky flag somewhere that will do this automatically, but I can't find it. I added:

             install -m 0755 ${THISDIR}/files/lptuio.c ${D}${bindir}

to the .bb files. Didn't help. I tried


install:
        $(TARGETINST) lptuio.c /usr/src

in the Makefile, but that didn't do it. Is there a canonical way to include the source?

From the README

To have other files (for example application configuration files or scripts)
copied into the root file system, add addition lines under the "install:"
target in the Makefile.  For example:

    $(TARGETINST) myfile.conf /etc

Copy the file myfile.conf from this directory into the /etc directory
on the Embedded Linux filesystem).

Another example:
    (TARGETINST) -a "some text here" /etc/system.conf

 

This doesn't work.

 

0 Kudos
Observer russellsnow
Observer
1,956 Views
Registered: ‎09-17-2018

Re: How to include any files in rootfs - Petalinux 2017.1

Looks like it put it in /usr/bin
So something worked.
0 Kudos
Moderator
Moderator
1,903 Views
Registered: ‎02-07-2018

Re: How to include any files in rootfs - Petalinux 2017.1

Hi @linux.fpga

Please follow below steps mentioned in this link to get your applications as a part of your rootfs:

https://www.xilinx.com/support/documentation/sw_manuals/xilinx2018_2/ug1144-petalinux-tools-reference-guide.pdf (section:Including Prebuilt Applications)

 

Thanks & regards

Aravind

----------------------------------------------------------------------------------------------
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.
----------------------------------------------------------------------------------------------

0 Kudos
Visitor asf3
Visitor
749 Views
Registered: ‎07-02-2019

Re: How to include any files in rootfs - Petalinux 2017.1

What if I just want to include a text file or something so I don't have to copy it over everytime the system reboots? Is there any easier way then going through the full process to include an application? I just want to have a .bashrc built-in 

Observer sponduri
Observer
737 Views
Registered: ‎07-31-2018

Re: How to include any files in rootfs - Petalinux 2017.1

If you are using an initramfs, I have a simple soluution for what you are trying to do. This will be time taking and might not be proper but it did work for me on petalinux 2018.3. I did this mainly to avoid using petalinux receips to copy over required files on to the final rootfs.  

1. After petalinux build completes and original rootfs is generated extract the rootfs.tar.gz to any folder, you have your default file system there. Now add the required files to that filesystem and customize as you want.

2. Now go to petalinux-config -c kernel go to "general setup" scroll down to the option "Initial RAM file system and RAM disk support". You will have an option to specify the folder for initramfs sources ("Initramfs sources), enter the path to the directory where you have your customized rootfs from previous step. Save and exit

3. Do a petalinux build and the image.ub generated must have the file system that you customized in step 1.

0 Kudos