cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Visitor
Visitor
12,399 Views
Registered: ‎08-05-2013

Modifying Petalinux rootfs

I'm just getting my head around the Petalinux system, but I can't seem to find the answer to this: how do I modify the files that are built into the rootfs?

 

For example, the default Zedboard petalinux build has the SD card listed, but commented out in /etc/fstab. I'd like to turn that on so that it gets mounted (/mnt/card) on boot so I can use it for non-volatile storage. 

 

I understand that I could extract the resulting rootfs, make the change to the fstab, and re-cpio it back up, but I was expecting to find the various files available for tweaking pre-build, but I can't seem to find them...

 

Thanks!

0 Kudos
Reply
11 Replies
Scholar
Scholar
11,647 Views
Registered: ‎11-09-2013

maybe it will be possible in 2014.3 ?

 

so far its seems that fstab is MAJOR issue with petalinux :(

0 Kudos
Reply
Explorer
Explorer
11,167 Views
Registered: ‎07-17-2014

Did you ever figure out a solution?

I'm almost at the point where I'm about to need changes to rootfs in terms of device drivers and additional programs and so forth.

 

In another IDE for another company product, there was a top level Makefile where I could do all sorts of stuff at the end of the build process. Essentially, I copied all my files I needed here into the rootfs and that did it for me.

 

Is there something similar for Petalinux?

I've only found the "open the ramdisk image" --- which looks like out of date information.

 

 -Ben

0 Kudos
Reply
Xilinx Employee
Xilinx Employee
11,132 Views
Registered: ‎07-01-2010

Ben,

Have you referred to the details in the below answer records?

http://www.xilinx.com/support/answers/55997.html
http://www.xilinx.com/support/answers/55979.html


Regards,
Achutha
---------------------------------------------------------------------------------------------
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
Reply
Explorer
Explorer
11,123 Views
Registered: ‎07-17-2014

Yes, I saw those records and they do not relate to what I'm trying to do.

I'm talking about replacing/modifying other aspects of the rootFS like /etc/fstab and mount points and adding other outside compiled programs like 'htop' and the likes.

There's all sorts of extra "setup" that needs to be done past writing an app that says, "hello world".

I think I've already figure out how to do it though.
0 Kudos
Reply
Visitor
Visitor
10,894 Views
Registered: ‎02-11-2015

Hi,

Would you mind sharing the solution? I'm also trying to do changes to the etc/fstab where I can mount NAND flash.

Thanks!

0 Kudos
Reply
Explorer
Explorer
10,875 Views
Registered: ‎07-17-2014

create a project app...

but then delete the sample "hello world" .C file and then edit the Makefile to your needs.

(remove the stuff that compiles the .C files into an executable)

I have a subdir in that apps/project/ directory called files where I store some of the files I need to copy (startup scripts and so on)

For files I want to append, just use the append option for the install script (target_inst -- or whatever it's called) in the Makefile.

And there ya go.

 

0 Kudos
Reply
Xilinx Employee
Xilinx Employee
10,870 Views
Registered: ‎01-21-2014

0 Kudos
Reply
9,998 Views
Registered: ‎06-08-2015

hi,I have same question ,arer you solved the issue. I want to modify the targetroot/etc/mdev.conf  .but when i change the file .and re-build the priject ,the file mdev.conf  have not change, I do not why ??? do you have any idea ? thank you very much !

0 Kudos
Reply
9,860 Views
Registered: ‎05-16-2015

The solution reported in the linked forum is useful only if you want to add entire files/directories.

If a particoular change has to be done in a configuration file which is more complex then just adding a line at the end of it, seems to be not "easiliy" possible.

 

@Xilinx:

 

I tried to understand how the rootfs.cpio is generated, it seems to me that is somehow embededded in one of the peta-linux binaries. I was not able to locate a script/source file which clearely generetes it.

Can you provide more information about this topic?

To manually edit the rootfs.cpio is not a good idea, if in the next petalinux-build run it is overwritten.

 

Thank you for your support.

0 Kudos
Reply
Contributor
Contributor
3,622 Views
Registered: ‎09-11-2017

Hello everyone!

I'm using PetaLinux 2017.2and I'm trying to install a simple config file to /etc/<name of my application>/.

 

My recipe:

SRC_URI = "\

    file://config.json \

    file://usage.md \

"

 

S = "${WORKDIR}"

                                                                                                                                                                                                                   

FILES_${PN} +=  "\ 

    ${confdir}/* \

    ${confdir}/<dir of my application>/* \

    /home/root/* \

"

 

do_install() {

    install -d ${D}/home/root

    install -m 0744 ${S}/usage.md ${D}/home/root

    install -d ${D}${confdir}/<dir of my application>

    install -m 0744 ${S}/config.json ${D}${confdir}/<dir of my application>

}

 

The usage.md file is correctly installed. The config.json file is missing.

Is there a reference of the recipe syntax and conventions somewhere?

 

Thanks for your help!

Tags (1)
0 Kudos
Reply
Contributor
Contributor
3,410 Views
Registered: ‎09-11-2017

Ok, the answer to my own question:

 

I had to add the directories I'm adding files to, to FILES_${PN} variable in my recipe.

 

FILES_${PN} += "\
/etc/* \
/etc/datagatewayd/* \
"

 

 

0 Kudos
Reply