Build Petalinux failure

Hello there,

  • I managed to setup the building environment.
  • I have my board SOC hdf file ready.

I thought the next step would be creating a myboard.bsp with petalinux and then run the image_from_prebuilt.sh letting it crunch the myBoard.bsp just created and the bionic.arm.2.4.img…
petalinux-create was OK
petalinux-config --get-hw-description=< path-to-my-hdf-folder > was OK
petalinux-build failed:
I will post on the xilinx-petallinux forum, too, as this looks PYNQ unrelated, but just in case anyone has seen this before…


Thank you

I think the right step is to get the hdf into the board folder, and then https://github.com/Xilinx/PYNQ/blob/master/sdbuild/scripts/create_bsp.sh
can take care of it. Note that before you package your bsp, you should not do petalinux build.

image_from_prebuilt.sh assumes you have the bsp ready but you need bsp built first.

For example, for our Pynq-Z1 board, we can put a single file base.hdf in boards/Pynq-Z1/petalinux_bsp/hardware_project and our makefile is able to pick the hdf up and build the image.

Hello Rock,
I have the hdf, I just need to create this folder:
mkdir <PYNQ_repository>/myboards/myboardname/petalinux_bsp/hardware_project
stuff the hdf in it and run:
make BOADDIR=<PYNQ_repository>/myboards/myboardname
is that all?

It didn’t fail, but it doesn’t seem it goes very far…

Ok. It is:
make BOADDIR=<PYNQ_repository>/myboards
Now it runs a little longer… but still fails short
terminal output is below:
vagrant@ubuntu-xenial:/pynq/sdbuild$ make BOARDDIR=/pynq/myboards
/opt/qemu/bin/qemu-arm-static -version | fgrep 2.8.0
qemu-arm version 2.8.0
which vivado | fgrep 2018.3
/sdbuild/Vivado/Vivado/2018.3/bin/vivado ****
which sdx | fgrep 2018.3
/sdbuild/Vivado/SDx/2018.3/bin/sdx
which petalinux-config | fgrep 2018.3
/sdbuild/petalinux/2018.3/tools/common/petalinux/bin/petalinux-config
which arm-linux-gnueabihf-gcc
/sdbuild/petalinux/2018.3/tools/linux-i386/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-gcc
which microblaze-xilinx-elf-gcc
/sdbuild/petalinux/2018.3/tools/linux-i386/microblaze-xilinx-elf/bin/microblaze-xilinx-elf-gcc
which ct-ng
/opt/crosstool-ng/bin/ct-ng
which python | fgrep /usr/bin/python
/usr/bin/python
sudo -n mount > /dev/null
bash /pynq/sdbuild/scripts/check_Env.sh
bash /pynq/sdbuild/scripts/check_mounts.sh
mkdir -p /pynq/sdbuild/build/Ax
cp /pynq/sdbuild/boot/image_arm.its /pynq/sdbuild/build/Ax/image.its
rm -rf /pynq/sdbuild/build/Ax/petalinux_bsp
mkdir -p /pynq/sdbuild/build/Ax/petalinux_bsp
BSP= BSP_BUILD=/pynq/sdbuild/build/Ax/petalinux_bsp BSP_ABS= BSP_PROJECT=xilinx-ax-2018.3 /pynq/sdbuild/scripts/create_bsp.sh /pynq/myboards/Ax zynq
+ set -e
+ board=/pynq/myboards/Ax
+ template=zynq
+ ‘[’ ‘!’ -z ‘’ ‘]’
+ cp -rf /pynq/myboards/Ax/petalinux_bsp/hardware_project /pynq/sdbuild/build/Ax/petalinux_bsp
+ cd /pynq/sdbuild/build/Ax/petalinux_bsp/hardware_project
+ ‘[’ -e makefile ‘]’
+ cd /pynq/sdbuild/build/Ax/petalinux_bsp
+ petalinux-create --type project --template zynq --name xilinx-ax-2018.3
INFO: Create project: xilinx-ax-2018.3
INFO: New project successfully created in /pynq/sdbuild/build/Ax/petalinux_bsp/xilinx-ax-2018.3
+ cd xilinx-ax-2018.3
+ petalinux-config --get-hw-description=/pynq/sdbuild/build/Ax/petalinux_bsp/hardware_project --oldconfig
INFO: Getting hardware description…
INFO: Rename ax_top_bd_wrapper.hdf to system.hdf
[INFO] generating Kconfig for project
[INFO] oldconfig project
[INFO] sourcing bitbake
ERROR: Failed to source bitbake
ERROR: Failed to config project.
ERROR: Get hw description Failed!.
Makefile:298: recipe for target ‘/pynq/sdbuild/build/Ax/petalinux_bsp/xilinx-ax-2018.3.bsp’ failed
make: *** [/pynq/sdbuild/build/Ax/petalinux_bsp/xilinx-ax-2018.3.bsp] Error 255
vagrant@ubuntu-xenial:/pynq/sdbuild$

This is weird. How did you generate the hdf? Which version of vivado?

I have googled it around. Maybe this post can help?
https://forums.xilinx.com/t5/Embedded-Linux/Petalinux-2017-2-Failed-to-source-bitbake/td-p/796848

I have not seen this error before. Maybe you can find some log message (build.log) there?

btw, you can use markdown for code highlighting.

make BOARDDIR=/pynq/myboards

Vivado 2018.3, Petalinux 2018.3
The complete config.log highlighting more info on the error is now attached.
I’ll check your link and see if I can come out of the hole
Thank you
config.log.txt (16.5 KB)

This thread suggests to not build on shared folder… but vagrant sets up the VM with the github pynq repository seen specifically as a shared folder… how am I supposed to build in another folder?!? And how come it works for everybody else?!?

Hi, It seems that the Petalinux is not installed correctly, please check if you can find bitbake file in the Petalinux installation folder. If you can not find the file, please re-install the Petalinux software.


Please take note that Petalinux need to be installed as a non-root user. Please use sudo chown command to give access to current user if you want to install petalinux to a folder that current user has no access, for example /opt/petalinux folder.

1 Like

It must be a path issue, then…


petalinux was installed as vagrant user, because the VM was built running “vagrant up” as instructed in the documentation. Btw I do not have root credentials on the VM
Best regards

Based on you thread, it might be better to just install petalinux inside the /opt folder?

If I knew the path was significant, I would have done so… unfortunately now the VM has sucked all the 100GB I painfully freed in my host disk and I have no breathing space left.
Probably I will delete and recreate the VM and reinstall SDx and petalinux. To be honest, as mentioned in another thread, I already created another, huger, VM in the cloud, and tried to build the SD there, but failed miserably nevertheless :disappointed:
It failed much further down the line, though


I have also encountered with the issue as you, it was resolved after reinstallation of the petalinux software.

can u send me comlete procedure with images to build pynq image for other boards

Is it a mistake to do “petalinux-build” that prohibits correct image creation (as in “one MUST NOT do it”)
or
does it just waste time, because pynq’s “make BOARD=…” only needs the output of “petalinux-package --bsp …”?

I’m still searching for a more in-depth description of the custom board build process and possible caveats.

It is the latter. The make process takes bsp as an input.

can anyone help me solve this error:

vm@ubuntu:~/Desktop/ultraZed_2020_2$ petalinux-build
INFO: Sourcing build tools [INFO] Building project [INFO] Sourcing build environment [INFO] Generating workspace directory INFO: bitbake petalinux-image-minimal Parsing recipes: 100% |#####################################################################################################################################################################################################################################################################################################################################################################| Time: 0:02:47 Parsing of 3027 .bb files complete (0 cached, 3027 parsed). 4297 targets, 177 skipped, 0 masked, 0 errors. NOTE: Resolving any missing task queue dependencies NOTE: Multiple providers are available for runtime python3-pyvenv (python3, python3-native) Consider defining a PREFERRED_RPROVIDER entry to match python3-pyvenv Initialising tasks: 100% |##################################################################################################################################################################################################################################################################################################################################################################| Time: 0:00:07 Checking sstate mirror object availability: 100% |##########################################################################################################################################################################################################################################################################################################################################| Time: 0:00:49 Sstate summary: Wanted 303 Found 70 Missed 233 Current 1667 (23% match, 88% complete) NOTE: Executing Tasks NOTE: Setscene tasks completed ERROR: petalinux-image-minimal-1.0-r0 do_image_cpio: Execution of ‘/home/vm/Desktop/ultraZed_2020_2/build/tmp/work/uz7ev_evcc-xilinx-linux/petalinux-image-minimal/1.0-r0/temp/run.do_image_cpio.85987’ failed with exit code 2: 4901376 blocks cpio: cannot seek on output: Invalid argument WARNING: exit code 2 from a shell command. ERROR: Logfile of failure stored in: /home/vm/Desktop/ultraZed_2020_2/build/tmp/work/uz7ev_evcc-xilinx-linux/petalinux-image-minimal/1.0-r0/temp/log.do_image_cpio.85987 Log data follows: | DEBUG: Executing python function set_image_size | DEBUG: 3242657.600000 = 2494352 * 1.300000 | DEBUG: 3242657.600000 = max(3242657.600000, 65536)[3242657.600000] + 0 | DEBUG: 3242658.000000 = int(3242657.600000) | DEBUG: 3242658 = aligned(3242658) | DEBUG: returning 3242658 | DEBUG: Python function set_image_size finished | DEBUG: Executing python function extend_recipe_sysroot | NOTE: Direct dependencies are [‘virtual:native:/home/vm/Desktop/ultraZed_2020_2/components/yocto/layers/core/meta/recipes-devtools/createrepo-c/createrepo-c_0.15.0.bb:do_populate_sysroot’, ‘/home/vm/Desktop/ultraZed_2020_2/components/yocto/layers/core/meta/recipes-devtools/cdrtools/cdrtools-native_3.01.bb:do_populate_sysroot’, ‘/home/vm/Desktop/ultraZed_2020_2/components/yocto/layers/core/meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb:do_populate_sysroot’, ‘virtual:native:/home/vm/Desktop/ultraZed_2020_2/components/yocto/layers/core/meta/recipes-core/update-rc.d/update-rc.d_0.8.bb:do_populate_sysroot’, ‘virtual:native:/home/vm/Desktop/ultraZed_2020_2/components/yocto/layers/core/meta/recipes-devtools/syslinux/syslinux_6.04-pre2.bb:do_populate_sysroot’, ‘virtual:native:/home/vm/Desktop/ultraZed_2020_2/components/yocto/layers/core/meta/recipes-extended/cpio/cpio_2.12.bb:do_populate_sysroot’, ‘/home/vm/Desktop/ultraZed_2020_2/components/yocto/layers/core/meta/recipes-devtools/mklibs/mklibs-native_0.1.44.bb:do_populate_sysroot’, ‘virtual:native:/home/vm/Desktop/ultraZed_2020_2/components/yocto/layers/core/meta/recipes-support/bmap-tools/bmap-tools_3.5.bb:do_populate_sysroot’, ‘virtual:native:/home/vm/Desktop/ultraZed_2020_2/components/yocto/layers/core/meta/recipes-devtools/dnf/dnf_4.2.2.bb:do_populate_sysroot’, ‘/home/vm/Desktop/ultraZed_2020_2/components/yocto/layers/core/meta/recipes-core/glibc/cross-localedef-native_2.30.bb:do_populate_sysroot’, ‘virtual:native:/home/vm/Desktop/ultraZed_2020_2/components/yocto/layers/core/meta/recipes-extended/pigz/pigz_2.4.bb:do_populate_sysroot’, ‘virtual:native:/home/vm/Desktop/ultraZed_2020_2/components/yocto/layers/core/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.45.3.bb:do_populate_sysroot’, ‘virtual:native:/home/vm/Desktop/ultraZed_2020_2/components/yocto/layers/core/meta/recipes-devtools/rpm/rpm_4.14.2.1.bb:do_populate_sysroot’, ‘virtual:native:/home/vm/Desktop/ultraZed_2020_2/components/yocto/layers/core/meta/recipes-devtools/makedevs/makedevs_1.0.1.bb:do_populate_sysroot’, ‘/home/vm/Desktop/ultraZed_2020_2/components/yocto/layers/core/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb:do_populate_sysroot’, ‘/home/vm/Desktop/ultraZed_2020_2/components/yocto/layers/core/meta/recipes-core/glibc/ldconfig-native_2.12.1.bb:do_populate_sysroot’, ‘virtual:native:/home/vm/Desktop/ultraZed_2020_2/components/yocto/layers/core/meta/recipes-bsp/u-boot/u-boot-tools_2019.07.bb:do_populate_sysroot’, ‘virtual:native:/home/vm/Desktop/ultraZed_2020_2/components/yocto/layers/core/meta/recipes-devtools/pseudo/pseudo_git.bb:do_populate_sysroot’, ‘virtual:native:/home/vm/Desktop/ultraZed_2020_2/components/yocto/layers/core/meta/recipes-devtools/opkg-utils/opkg-utils_0.4.1.bb:do_populate_sysroot’, ‘virtual:native:/home/vm/Desktop/ultraZed_2020_2/components/yocto/layers/core/meta/recipes-devtools/opkg/opkg_0.4.1.bb:do_populate_sysroot’, ‘virtual:native:/home/vm/Desktop/ultraZed_2020_2/components/yocto/layers/core/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb:do_populate_sysroot’, ‘virtual:native:/home/vm/Desktop/ultraZed_2020_2/components/yocto/layers/core/meta/recipes-devtools/btrfs-tools/btrfs-tools_5.2.2.bb:do_populate_sysroot’] | NOTE: Installed into sysroot: | NOTE: Skipping as already exists in sysroot: [‘createrepo-c-native’, ‘cdrtools-native’, ‘qemuwrapper-cross’, ‘update-rc.d-native’, ‘syslinux-native’, ‘cpio-native’, ‘mklibs-native’, ‘bmap-tools-native’, ‘dnf-native’, ‘cross-localedef-native’, ‘pigz-native’, ‘e2fsprogs-native’, ‘rpm-native’, ‘makedevs-native’, ‘depmodwrapper-cross’, ‘ldconfig-native’, ‘u-boot-tools-native’, ‘pseudo-native’, ‘opkg-utils-native’, ‘opkg-native’, ‘squashfs-tools-native’, ‘btrfs-tools-native’, ‘openssl-native’, ‘ninja-native’, ‘libmodulemd-native’, ‘glib-2.0-native’, ‘curl-native’, ‘zlib-native’, ‘expat-native’, ‘cmake-native’, ‘xz-native’, ‘file-native’, ‘python3-native’, ‘pkgconfig-native’, ‘sqlite3-native’, ‘quilt-native’, ‘libxml2-native’, ‘qemu-xilinx-native’, ‘shadow-native’, ‘mkfontdir-native’, ‘mkfontscale-native’, ‘mtools-native’, ‘util-linux-native’, ‘nasm-native’, ‘automake-native’, ‘libtool-native’, ‘gettext-minimal-native’, ‘autoconf-native’, ‘gnu-config-native’, ‘texinfo-dummy-native’, ‘debianutils-native’, ‘kmod-native’, ‘python3-setuptools-native’, ‘python3-six-native’, ‘python3-iniparse-native’, ‘librepo-native’, ‘libdnf-native’, ‘libcomps-native’, ‘gdk-pixbuf-native’, ‘gtk+3-native’, ‘attr-native’, ‘dbus-native’, ‘nss-native’, ‘popt-native’, ‘perl-native’, ‘bzip2-native’, ‘db-native’, ‘elfutils-native’, ‘libarchive-native’, ‘flex-native’, ‘libsolv-native’, ‘lzo-native’, ‘lz4-native’, ‘acl-native’, ‘re2c-native’, ‘gobject-introspection-native’, ‘meson-native’, ‘libyaml-native’, ‘gettext-native’, ‘libpcre-native’, ‘gtk-doc-native’, ‘libffi-native’, ‘ncurses-native’, ‘libtirpc-native’, ‘gdbm-native’, ‘readline-native’, ‘libnsl2-native’, ‘libgcrypt-native’, ‘dtc-native’, ‘libx11-native’, ‘util-macros-native’, ‘libfontenc-native’, ‘freetype-native’, ‘xorgproto-native’, ‘libcap-ng-native’, ‘groff-native’, ‘m4-native’, ‘unzip-native’, ‘gpgme-native’, ‘json-c-native’, ‘swig-native’, ‘libcheck-native’, ‘libjpeg-turbo-native’, ‘libpng-native’, ‘shared-mime-info-native’, ‘libxi-native’, ‘cairo-native’, ‘pango-native’, ‘libxext-native’, ‘libxfixes-native’, ‘atk-native’, ‘libxrandr-native’, ‘libxcomposite-native’, ‘at-spi2-atk-native’, ‘libxdamage-native’, ‘fontconfig-native’, ‘libxcursor-native’, ‘libxrender-native’, ‘nspr-native’, ‘libgpg-error-native’, ‘libcap-native’, ‘xtrans-native’, ‘libxcb-native’, ‘font-util-native’, ‘libassuan-native’, ‘intltool-native’, ‘pixman-native’, ‘libsm-native’, ‘libxft-native’, ‘fribidi-native’, ‘harfbuzz-native’, ‘at-spi2-core-native’, ‘gperf-native’, ‘libxdmcp-native’, ‘xcb-proto-native’, ‘libxau-native’, ‘libpthread-stubs-native’, ‘libxml-parser-perl-native’, ‘libice-native’, ‘icu-native’, ‘libxtst-native’] | DEBUG: Python function extend_recipe_sysroot finished | DEBUG: Executing shell function do_image_cpio | 4901376 blocks | cpio: cannot seek on output: Invalid argument | WARNING: exit code 2 from a shell command. | ERROR: Execution of ‘/home/vm/Desktop/ultraZed_2020_2/build/tmp/work/uz7ev_evcc-xilinx-linux/petalinux-image-minimal/1.0-r0/temp/run.do_image_cpio.85987’ failed with exit code 2: | 4901376 blocks | cpio: cannot seek on output: Invalid argument | WARNING: exit code 2 from a shell command. | ERROR: Task (/home/vm/Desktop/ultraZed_2020_2/components/yocto/layers/meta-petalinux/recipes-core/images/petalinux-image-minimal.bb:do_image_cpio) failed with exit code ‘1’ NOTE: Tasks Summary: Attempted 6570 tasks of which 6188 didn’t need to be rerun and 1 failed. Summary: 1 task failed: /home/vm/Desktop/ultraZed_2020_2/components/yocto/layers/meta-petalinux/recipes-core/images/petalinux-image-minimal.bb:do_image_cpio Summary: There was 1 ERROR message shown, returning a non-zero exit code. ERROR: Failed to build project

it fails at the very end and i dont know whyyyy. i m using ubuntu 18.04, petalinux 2020.2 and the 2020.2 bsp of UltraZed EV which i downloaded from avnet’s site : Sign in to your account

Hi @Xanthippe,

Welcome to the PYNQ community.
This post is quite old. Please, create a new topic where you provide all the relevant information