Rebuild Pynq image failed

Hello Rock, I did as suggested; I run
sudo -E chroot /home/guido/PYNQ/sdbuild/build/bionic.arm/ bash
immediately after failure.
I had no problem to get the four chown through, and complete the qemu.sh.
But I get a strange warning while sudoing inside the qemu session, see the attached log.
failed_build_log.zip (1.4 MB)

Add ethernet package to your stage 4 spec. Your perhaps also need pynq package. The pynq package installed on that existing rootfs is not a complete one (since it does not know your board name)

Also, the correct command to build from scratch should be (I use) is

make BOARDDIR=/opt/builds/pynq-git/boards

Change the above path to the folder where you have the .spec file.

After immediate failure == do not run make clean yet. I think you massed up the building stages since a make clean will remove all the staged images.

I didn’t run make clean immediately after failure?!? the make clean in the log was long time after, and I run it because I was finished with the test and wanted to re-build.

ok. I see what you mean. It looks like chown works if you are logged onto qemu environment, but for some reason when it is running in script, it failed. This is very strange error. I am not sure why.

The weird errors attached in your log is because you did not unmount the image before you run a make clean. Since the staged images might be deleted, there is no easy way to recover. You may need to restart the VM.

So for you simple fix, you can disable the 4 chown commands in the pynq qemu.sh. The side effect is your folder will have root permissions, but you should be able to change them once you logged onto your board.

Hi Rock,
I wasn’t referring to the make clean errors, I know they are related with stuff that hasn’t been unmounted properly. Just umount them will fix it, btw.
The odd error I was referring to was the:
sudo: unable to resolve host DL-POC-TBI-366-PYNQ: Resource temporarily unavailable
when I was still inside QEMU @ 206711 after I run:
sudo chown xilinx:xilinx -R /usr/local/lib/python3.6/dist-packages/pynq
but I admit putty messed the log up there… I should have use the command syntax pointed
by peter ogden in one of the linked thread for logging, my bad.

Try not run sudo because you are already on a chroot environment. That is already root user. I had problems with sudo on qemu as well.

So just run chown to see if that helps?

chown works fine when typed in terminal. it’s when it is done inside the script that fails. I will try removing the four chown lines in qemu.sh tomorrow

Wow! it went through!!! Success!
I have got the MyBoard-2.4.img inside the output folder plus some other boot stuff.
The only thing I needed was commenting out lines 31-34 in pynqGitHub/sdbuild/packages/pynq/qemu.sh
and give my VM few more GB of disk size.
I can now progress to write the SD and cross my fingers :slight_smile:
Thanks everyone for help

Can I use, in the future, the /data/PYNQ/sdbuild/build/Ax/petalinux_bsp/xilinx-myBoard-2018.3.bsp as bsp input, and bionic.arm.2.4 as image input to the image_from_prebuilt.sh script, instead of rebuilding everything from scratch with make?

That image_from_prebuilt.sh was supposed to be used along with our released rootfs.img.

In most cases, you will just want to modify stage 4 packages. In that case, I usually just delete the output/<my_board>-2.4.img and run make without doing any clean.

Of course, if you want to start with certain stages, just make sure the outputs of that stage and later stages are removed so the make flow can pick up from what you have left in the system.

Thanks @rock for your help!
Things solved my problem:

  1. increasing (to sth like 60!) the sleep time in the rocks’ suggested scripts plus mount_image script
    2: increasing the free space linux partition (to 200GB) (cause failure in stage 2)
  2. stable internet connection

Hi, I came across the same problem. I am trying to rebuild the PYNQ-Z2 image and later build an image for the Zybo-Z7-20. Could you please help me?
Thank you

Here is the output of my console after running make.

INFO: File in BOOT BIN: “/home/nelson/PYNQ/sdbuild/build/zybo/petalinux_project/images/linux/zynq_fsbl.elf”
INFO: File in BOOT BIN: “/home/nelson/PYNQ/sdbuild/build/zybo/petalinux_project/images/linux/u-boot.elf”

  • image_file=/home/nelson/PYNQ/sdbuild/build/bionic.arm.stage1.img
  • image_dir=/home/nelson/PYNQ/sdbuild/build/bionic.arm
    ++ dirname /home/nelson/PYNQ/sdbuild/scripts/create_mount_img.sh
  • script_dir=/home/nelson/PYNQ/sdbuild/scripts
  • truncate --size 7G /home/nelson/PYNQ/sdbuild/build/bionic.arm.stage1.img
  • /home/nelson/PYNQ/sdbuild/scripts/create_partitions.sh /home/nelson/PYNQ/sdbuild/build/bionic.arm.stage1.img
  • mount_points=($(sudo kpartx -av $image_file | cut -d ’ ’ -f 3))
    ++ sudo kpartx -av /home/nelson/PYNQ/sdbuild/build/bionic.arm.stage1.img
    ++ cut -d ’ ’ -f 3
  • echo loop19p1
  • echo loop19p2
  • root_part=/dev/mapper/loop19p2
  • boot_part=/dev/mapper/loop19p1
  • sleep 5
  • sudo chroot / mkfs -t fat /dev/mapper/loop19p1
  • sudo chroot / mkfs -t ext4 /dev/mapper/loop19p2
    mke2fs 1.44.1 (24-Mar-2018)
  • mkdir -p /home/nelson/PYNQ/sdbuild/build/bionic.arm
  • sudo mount /dev/mapper/loop19p2 /home/nelson/PYNQ/sdbuild/build/bionic.arm
  • sleep 5
  • sudo chroot / mkdir /home/nelson/PYNQ/sdbuild/build/bionic.arm/boot
  • sudo mount /dev/mapper/loop19p1 /home/nelson/PYNQ/sdbuild/build/bionic.arm/boot
  • sudo chroot / chmod a+w /home/nelson/PYNQ/sdbuild/build/bionic.arm
  • set -e
  • target=/home/nelson/PYNQ/sdbuild/build/bionic.arm
  • SRCDIR=/home/nelson/PYNQ/sdbuild/ubuntu/bionic/arm
  • fss=‘proc dev’
  • echo /opt/qemu/bin/qemu-arm-static
  • multistrap_conf=/home/nelson/PYNQ/sdbuild/ubuntu/bionic/arm/multistrap.config
  • ‘[’ -n ‘’ ‘]’
  • sudo -E multistrap -f /home/nelson/PYNQ/sdbuild/ubuntu/bionic/arm/multistrap.config -d /home/nelson/PYNQ/sdbuild/build/bionic.arm --no-auth
    W: GPG error: Index of /ubuntu-ports bionic InRelease: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
    E: The repository ‘Index of /ubuntu-ports bionic InRelease’ is not signed.
    apt update failed. Exit value: 100
    make: *** [/home/nelson/PYNQ/sdbuild/build/bionic.arm.stage1.img] Error 25

I also tried to build the image using make PREBUILT= as suggested here: Problem building PYNQ SD image for ZC706 - #3 by JTC. The image is generated by an error message is displayed. Futhermore, the board does not boot.

Could someone please help?
Thank you

I have never seen issues like that; after googling it, I found this page might be helpful:
https://chrisjean.com/fix-apt-get-update-the-following-signatures-couldnt-be-verified-because-the-public-key-is-not-available/

It is probably your ubuntu VM or build machine has some weird configurations that mess things up. You might just want to use vagrant file we supported to replicate the building environment (ubuntu 16 and ubuntu 18 are supported): PYNQ SD Card image — Python productivity for Zynq (Pynq)

Can you paste the error message?

Hi @rock, thank you for your reply.
The image is generated by a messsage “Failed to generate Pynq-Z2-2.5.img failed”.
I tried to write this image to SD Card but the board does not boot.

Regarding vagrant, when I made git checkout v2.5, the ubuntu image does not generate ubuntu-desktop. When I try to install ubuntu desktop the system behaves weirdly. So that is the reason I tried to use my own host machine to setup the PYNQ. I had to modify the setup_host.sh at the line of wget qemu. I replaced it with git clone GitHub - qemu/qemu: Official QEMU mirror. Please see http://wiki.qemu.org/Contribute/SubmitAPatch for how to submit changes to QEMU. Pull Requests are ignored. Please only use release tarballs from the QEMU website. and it worked fine. In addition to that I commented all the lines with fgrep in the checkenv of the Makefile in the sdbuild.

The error happens specifically when running the command
sudo -E multistrap -f $HOME/PYNQ/sdbuild/ubuntu/bionic/arm/multistrap.config -d f $HOME/PYNQ/sdbuild/build/bionic.arm --no-auth

I also tried to do the trick suggested at Fix apt-get update “the following signatures couldn’t be verified because the public key is not available” :: Chris Jean, but it fails with the message

E: The repository ‘Index of /ubuntu-ports bionic InRelease’ is not signed.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
apt update failed. Exit value: 100

Check if your apt file has been modified. If you want, you can make a backup of the original file /etc/apt/sources.list, and change it back to the original one:

And do sudo apt-get update after that. Otherwise I am not sure how this happens.

Use the master branch instead of the 2.5 branch because we have fixed the setup_host.sh. The vagrant flow should work.

1 Like