Showing results for 
Show  only  | Search instead for 
Did you mean: 
Registered: ‎07-04-2017

Building/configuring petalinux on jenkins hangs

Using Petalinux-2016.4.


I need to build a petalinux project headless, without user interaction. The steps I'm following now are:

  1. Create empty zynqMP project
  2. Import HW description exported from Vivado
  3. Build

At step 2 I'm currently using these commands to import the HW description:

cd <petalinux-project>

petalinux-config --get-hw-description <path/to/exported/sdk/from/vivado> --oldconfig


With --oldconfig this command passes on without presenting a menuconfig or interacting with the user.

This works fine when building on command line in a makefile build system locally on my computer.


But when I try to build with the same command in a shell in a Jenkins build job the output from petalinux-config command are:

INFO: Getting hardware description

INFO: Rename top.hdf to system.hdf

[INFO] generating Kconfig for project

<hangs here>


The Jenkins build node has installed the same packages as my local computer and I can perform step 2 when logging in on this build node. So the build node should be OK.


The special thing about a Jenkins build job is that the commands are run without a terminal, so starting only screen in the build job gives the error: "Must be connected to a terminal". So I guess the hang is related to the missing terminal, but even with "-v" option to petalinux-configure it doesn't output any more info.


So has anyone else experience with building petalinux projects in Jenkins or has any tip how to get past this problem?

0 Kudos
2 Replies
Registered: ‎07-26-2016



I stumbled onto the same problem while trying to setup a build with jenkins.

The problem seems to be indeed with not having a real tty attached in your building console.


The way i worked around is to start a screen session in the background emulating the missing behaviour, and afterwards print the log. I came up with a utility function like this.


function wait_screen {
    echo "${@}"
    screen -S ${SNAME} -L -m -d ${@}
    while screen -list | grep -q ${SNAME}
        echo "Waiting for screen to finish"
        sleep 5
    cat screenlog.0

so whenever i call petalinux-config or similar, i do

wait_screen petalinux-config --get-hw-description <path/to/exported/sdk/from/vivado> --oldconfig


Maybe you find this useful

0 Kudos
Registered: ‎12-03-2018

I had this issue as well (on 2018.2) and solved it with xvfb-run. 

xvfb-run petalinux-build

I also had an issue with running in a container due to it wanting to write some temporary files in the root of the home directory (which it didn't have permissions to do), so I just 'fooled' it into creating the temporary files in the current directory.

export HOME=$(pwd)
0 Kudos