cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Visitor
Visitor
615 Views
Registered: ‎08-12-2020

Automate Petalinux flow configuration

Jump to solution

Hi Guys,

I'm working with Petalinux 2018.3 and want to automate the whole Petalinux flow using Gitlab CI/CD Pipelines. In order to get a clean project, i want to use my configurations of my local project.

Where can I find the necessary files (general config, rootfs config and kernel configs) and how & where can I include them in the pipeline without user interaction?

Petalinux is installed in a Docker image. The Pipeline should download necessary dependencies (which include the configuration), start the Petalinux Docker image, where a script performs the steps:

petalinux-create
petalinux-config --get-hw-description
?? petalinux-config ?? This should be replaced by simply copying the necessary files
petalinux-build
petalinux-package

Thanks for your help!

Kind Regards 
Daniel

0 Kudos
Reply
1 Solution

Accepted Solutions
Explorer
Explorer
550 Views
Registered: ‎10-04-2017

You would not do petalinux-create every time.  After you do it once, this should give you the initial framework for your petalinux build.   Look at some of the Xilinx provided BSPs to give you an idea of what you would need to commit.

Normally, the recipe for the device tree is in project-spec/meta-user and the system-user.dtsi is almost always customized for your design.    After you configure petalinux and the rootfs you should commit the config files in project-spec/config, make sure you commit the .old configs also.  Then you run petalinux-config --oldconfig; otherwise it will open up the menuconfig and obviously you don't want that in your CI flow

jeff

View solution in original post

8 Replies
580 Views
Registered: ‎02-24-2020

The configs for the PetaLinux project are stored in "project-spec/configs/." Newer versions of PetaLinux actually supply a .gitignore file as a part of a new PetaLinux project (2019.1 and newer I think). If you simply use this same ignore in your project, you should be able to setup a Git repo with a project structure that is already clean whenever cloned. This way Gitlab can easily build the project. This would usually contain your configs and your hdf file, so Github or anyone could simply clone and run petalinux-build and get a clean build.

https://www.xilinx.com/support/answers/69415.html

Ken Sloat - Embedded Software Engineer
https://www.designlinxhs.com
Explorer
Explorer
551 Views
Registered: ‎10-04-2017

You would not do petalinux-create every time.  After you do it once, this should give you the initial framework for your petalinux build.   Look at some of the Xilinx provided BSPs to give you an idea of what you would need to commit.

Normally, the recipe for the device tree is in project-spec/meta-user and the system-user.dtsi is almost always customized for your design.    After you configure petalinux and the rootfs you should commit the config files in project-spec/config, make sure you commit the .old configs also.  Then you run petalinux-config --oldconfig; otherwise it will open up the menuconfig and obviously you don't want that in your CI flow

jeff

View solution in original post

Visitor
Visitor
499 Views
Registered: ‎08-12-2020
Thanks for your input. Now I have encountered another problem while running the script:

echo E | petalinux-config --get-hw-description=/src/hardware-files/

INFO: Getting hardware description...
INFO: Rename Base_Zynq_MPSoC_wrapper.hdf to system.hdf
[INFO] generating Kconfig for project
[INFO] menuconfig project
ERROR: Failed to menu config project component
ERROR: Failed to config project.
ERROR: Get hw description Failed!.

The echo is to suppress the GUI like here: https://forums.xilinx.com/t5/Embedded-Linux/petalinux-config-get-hw-description-without-opening-menu/td-p/842796

Has anyone a solution to this? The HDF does exist in the given path.

0 Kudos
Reply
495 Views
Registered: ‎02-24-2020

You can pass the additional option "--silentconfig" 

Ken Sloat - Embedded Software Engineer
https://www.designlinxhs.com
0 Kudos
Reply
Visitor
Visitor
485 Views
Registered: ‎08-12-2020
This does not work I only get
unrecognized option '--silentconfig'
0 Kudos
Reply
Explorer
Explorer
422 Views
Registered: ‎10-04-2017
You have to have a config.old first. And the option is --oldconfig for 2018.3, --silentconfig is for 2020.

jeff
0 Kudos
Reply
Visitor
Visitor
393 Views
Registered: ‎08-12-2020
I tried this, but now the pipeline is stuck at this command:

petalinux-config --get-hw-description=<PATH TO HDF> --oldconfig
0 Kudos
Reply
Explorer
Explorer
373 Views
Registered: ‎10-04-2017

You did create a config via the menu and confirmed that the .old is in project-spec/configs?

  I never seen an issue with this across multiple versions

jeff

0 Kudos
Reply