cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
cfu000
Visitor
Visitor
7,409 Views
Registered: ‎03-27-2017

Petalinux 2016.4 'petalinux-config -c rootfs', how to do it the "Yocto"way?

Hi,

 

  I am tasked to script the whole petalinux build process (ie. no popup menu, or have to bypass patelinux-config all together) so we can do nightly build automatically, and having a revision controlled config and rootfs_config files is not desirable.

 

  Right now we can use the --oldconfig to by pass the menu for the top level configuration, yet since we do need to customize the root file system to add gdb for debugging purpose, are there ways to do it  - configuring rootfs without calling petalinux-config -  with layer/recipe, similar to what is proposed in  https://forums.xilinx.com/t5/Embedded-Linux/No-static-IP-in-PetaLinux-2016-4/td-p/743272 ?

 

  Thanks.

0 Kudos
10 Replies
debrajr
Moderator
Moderator
7,268 Views
Registered: ‎04-17-2011

Hi, we can run petalinux in a scripted mode. There are couple of config files which holds the settings of the rootfs/general/u-boot settings and can be updated before launching the petalinux-build.

 

Rootfs: <plnx-proj-root>/project-spec/configs/rootfs_config

User Settings: <plnx-proj-root>/project-spec/configs/config

U-Boot: <plnx-proj-root>/project-spec/meta-plnx-generated/recipes-bsp/u-boot/configs

 

Have you tried editing these files and run on a scripted format?

Regards,
Debraj
----------------------------------------------------------------------------------------------
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
cfu000
Visitor
Visitor
7,225 Views
Registered: ‎03-27-2017

Debraj,

 

  Thanks for the reply, yet that is not exactly what we are looking for.

 

  We did figure out the end products of select/deselect options in the popup menu during

  [1] "petalinux-config" is                      <plnx-proj-root>/project-spec/configs/config

  [2] "petalinux-config -c rootfs" is        <plnx-proj-root>/project-spec/configs/rootfs_config

  (did not need u-boot yet)

 

  We do not wish to revision-control the end products because

  a) they contain  _all_  options available, and we only want to revision-control those that are relevant for our purpose.

  b) it is not future-proof - in the event some more options become available, revision-controlled config/rootfs_config will miss those (which will be undefined) and may break the build process.

 

  So the preferred approach for us is to

  [I]    revision-control the source (ie. options we'd like to enable/disable),

  [II]   somehow pass them into the regular build flow

  [III]  use the regular flow to generate the linux build that fits our need,

 

  That is why we asked "the Yocto way" - the "somehow" part - which should be the underlying mechanism for building petalinux anyway.

 

  Thanks.

 

0 Kudos
debrajr
Moderator
Moderator
7,196 Views
Registered: ‎04-17-2011

Hi, Thanks for your reply.

Petalinux tool heavily depends on the sstate-cache and minimal downloads which has lot of pre-built information. So, while you can customize those files mentioned in my last mail, you can also add recipes under meta-user and use them. Another alternative would be to use GUI for the first time/make changes to rootfs etc and let the tool update the scripts. Then when the next time you run, use the scripted format and then it should be easier.
Regards,
Debraj
----------------------------------------------------------------------------------------------
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
cfu000
Visitor
Visitor
7,176 Views
Registered: ‎03-27-2017

Debrajr,

 

>> you can also add recipes under meta-user and use them

 

  This is what we have in mind originally, can you elaborate on exactly how to do it - some examples will definitely help - since I am no expert in (any)Linux build process.

 

  I browsed through the Yocto projects website, and all I can figure out is that we are supposed to be able to use  "something".bbappend  to modify the options, yet have no clue which options are associated with which "something", and as far as I can tell; also (the name of) "something" is very important because bitbake uses it to find the corresponding "something".bb which contains the base recipe.

 

  No info of this sort can be found at Xilinx website either.

 

>> Another alternative would be to use GUI for the first time/make changes to rootfs etc and let the tool update the scripts

 

  Don't quite understand what you mean about "update the scripts" -  All we get at the end of petalinux-config call are (modified) config and rootfs_config files, with selected options enabled/commented out in those two files; did not see scripts (tcl/sh/perl...) generated actually did those modifications to those two files.

 

  Thanks.

0 Kudos
jeffrey.johnson
Voyager
Voyager
4,144 Views
Registered: ‎02-07-2008

@cfu000

 

Did you ever get an answer on this question?

 

I was previously adding the config and roofts_config files to version control, but I have found issues with that method when moving from one version of PetaLinux to the next. How can we use a .bb file to make the modifications to only the things we want to change?

 

Jeff

 

0 Kudos
cfu000
Visitor
Visitor
4,120 Views
Registered: ‎03-27-2017

Jeff,

 

  No, what one sees in this thread is what one gets.

 

  We ended up with using scripts to patch the resulted config files before starting the petalinux build process, and revision control the scripts themselves.

 

  Hope this helps.

 

  Thanks.

 

 

0 Kudos
jeffrey.johnson
Voyager
Voyager
4,109 Views
Registered: ‎02-07-2008

@cfu000

 

Thanks for getting back to me. I ended up doing something similar.

 

I version control a text file containing ONLY the options that I want to change, then my build script appends this file to the appropriate configuration file. I have one for the config file and another for rootfs_config. I call these files config.append and rootfs_config.append respectively.

 

Here is an example config.append file that changes the FW version:

 

CONFIG_SUBSYSTEM_FW_VERSION="2.00"

Here is an example rootfs_config.append file that disables canutils and enables pciutils:

 

CONFIG_canutils=n
CONFIG_pciutils=y

I've found that if you run "petalinux-config --oldconfig" after appending to the config files, the PetaLinux tools reparse and reorder the config files, so the resulting config file is clean and easy to compare with other projects. Also, even if we append an option that is already defined in the config file, PetaLinux registers the last definition (the appended one), and it rewrites the config file so that there is only one definition of that option.

 

There are probably other ways to do this, but I find this method pretty clean.

 

Jeff

 

 

 

0 Kudos
sandeepg
Moderator
Moderator
4,101 Views
Registered: ‎04-24-2017

Hi @cfu000,

 

If you want to add or remove packages just run this and you can version control this 

 

$ echo 'IMAGE_INSTALL_append = " gdb"' >> <plnx-proj-root>/project-spec/meta-user/recipes-core/images/petalinux-user-image.bbappend
Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
0 Kudos
jeffrey.johnson
Voyager
Voyager
3,886 Views
Registered: ‎02-07-2008

Hi @sandeepg

 

How do you remove packages using that method?

 

Jeff

 

0 Kudos
sandeepg
Moderator
Moderator
3,785 Views
Registered: ‎04-24-2017

Hi @jeffrey.johnson,

 

Adding package to rootfs

 

$ echo 'IMAGE_INSTALL_append = " gdb"' >> <plnx-proj-root>/project-spec/meta-user/recipes-core/images/petalinux-user-image.bbappend

 

Removing package from rootfs

 

Option 1:

 

IMAGE_INSTALL_append = "\
    package1 \
    package2 \
    package3 \  /* Delete this line to remove package3*/
    "

Option 2:

 

IMAGE_INSTALL_remove = "\
    package3 \  
    "

 

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
0 Kudos