# Novel Issues: Quick Porting of PYNQ using Pre-built images

**URL:** <https://discuss.pynq.io/t/novel-issues-quick-porting-of-pynq-using-pre-built-images/4187>\
**Category:** Support\
**Created:** [May 13, 2022, 4:16am UTC](https://discuss.pynq.io/t/novel-issues-quick-porting-of-pynq-using-pre-built-images/4187 "2022-05-13T04:16:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![JJSterling](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/jjsterling/32/321_2.png) [@JJSterling](https://discuss.pynq.io/u/JJSterling)\
**Post date:** [May 13, 2022, 4:16am UTC](https://discuss.pynq.io/t/novel-issues-quick-porting-of-pynq-using-pre-built-images/4187/1 "2022-05-13T04:16:58Z")

</div>

Continuing the discussion from [Quick Porting of PYNQ using Pre-built Images](https://discuss.pynq.io/t/quick-porting-of-pynq-using-pre-built-images/1075):

Love your show, Peter! These types of posts are very helpful.  
I’ve been trying to build the ZC706 PYNQ 2.7 port by following the instructions in this post to the letter, and can’t find the “board-agnostic rootfs image” for PYNQ 2.7! There is no \*.img file, as in this post, only a \*.tar.gz file. I would like to use that, but in the full process, the one that uses make, instead of image\_from\_prebuilt.sh, I run into exactly the same problem described here [Package not found when making image - Support - PYNQ](https://discuss.pynq.io/t/package-not-found-when-making-image/4082) – even though I am already using Ubuntu 18.04.6 LTS!

Some clarification would be terrific. Even though I **was** able to use your post to generate PYNQ 2.5 for the ZC706, I had to look far and wide across the Interwebs to find the file bionic.arm.2.5.img. It should not be this hard! It would be terrific if the Xilinx gang supporting PYNQ would create sticky links that allow recreation of the post, especially since it’s only **just over two years** later!

Bottom line: I need to be able to perform this procedure for PYNQ 2.7, which seems to indicate I need to find the elusive “focal.arm.2.7.img” file.

Thank you in advance for your assistance!

---

<div class="post-metadata">

**Author:** ![skalade](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/skalade/32/686_2.png) [@skalade](https://discuss.pynq.io/u/skalade)\
**Post date:** [May 13, 2022, 6:06pm UTC](https://discuss.pynq.io/t/novel-issues-quick-porting-of-pynq-using-pre-built-images/4187/2 "2022-05-13T18:06:16Z")

</div>

Hi there,

As of v2.7 all board agnostic images are in tarball (tar.gz) form rather than .img. Functionally it makes no difference to the build scripts so the file you use just has a different extension.

In the post you linked, I believe the problem was a tool version incompatibility – since you were able to build a v2.5 image, I presume you were using Vivado 2019.1 and a BSP of the same version? When building for the v2.7 image, are you using a 2020.2 version of the tools and BSP?

Thanks  
Shawn

---

<div class="post-metadata">

**Author:** ![briansune](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/briansune/32/3087_2.png) [@briansune](https://discuss.pynq.io/u/briansune)\
**Post date:** [May 14, 2022, 1:15pm UTC](https://discuss.pynq.io/t/novel-issues-quick-porting-of-pynq-using-pre-built-images/4187/3 "2022-05-14T13:15:26Z")

</div>

In case toy need to setup the environment to build any image under 2.7 revision:  
I enclosed a full details on setting up the env:

> [@Stuck at extract yocoto](https://discuss.pynq.io/t/stuck-at-extract-yocoto/4134/8):
>
> Unless people having hard time on setting up the environment: Vagrant is not a good method to setup the SD build environment. I have not investigate to the bottom but what previous engineer shows there might Virtual R/W issue during such setup. STEPS: I will suggest download 18.04.06 LTS Ubuntu from official website Create a virtual disk size about 200GB or more, set the CPU \>#4, RAM \>#8192 Update Ubuntu packages before setting up the PYNQ 3b) Git clone the PYNQ to /home//PYNQ 3c) sudo ch…

Don’t try Vagrant as it can result so many variations on different PC and hard drive right etc.

---

<div class="post-metadata">

**Author:** ![JJSterling](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/jjsterling/32/321_2.png) [@JJSterling](https://discuss.pynq.io/u/JJSterling)\
**Post date:** [May 14, 2022, 1:45pm UTC](https://discuss.pynq.io/t/novel-issues-quick-porting-of-pynq-using-pre-built-images/4187/4 "2022-05-14T13:45:24Z")

</div>

Shawn,

Thank you for your speedy reply! Vitis and petalinux are both 2020.2. The problem I am wrestling with is that setup\_host.sh called out a number of packages that were not installed and/or the incorrect version. (Especially a bunch of packages that are Ubuntu 18.04.06 and not bionic versions–wait, I thought they were the same thing?)

I was hoping that image\_from\_prebuilt.sh would avoid these requirements, but if it just ends up running a modified “Make” process, I would have the same problems anyway. In any event, forcing installation with aptitude ended up corrupting the kernel, so now this is an Ubuntu problem rather than PYNQ. After I reset my VirtualBox, I will update with another error, or report success.

Thanks again for your response!

---

<div class="post-metadata">

**Author:** ![JJSterling](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/jjsterling/32/321_2.png) [@JJSterling](https://discuss.pynq.io/u/JJSterling)\
**Post date:** [May 27, 2022, 12:04am UTC](https://discuss.pynq.io/t/novel-issues-quick-porting-of-pynq-using-pre-built-images/4187/5 "2022-05-27T00:04:42Z")

</div>

@briansune had the answer. Running setup\_host.sh is the way. It’s well-written, and picks up and installs the correct versions of dependency applications, including in particular qemu and crosstool-ng.

Turns out the problem I had with VirtualBox was that aptitude, in its zeal, had broken xserver. Ubuntu would boot up, but the keyboard and mouse had zero effect. Lesson learned–stay with setup\_host.sh!

Now I have another show-stopping issue. I am following the instructions at [PYNQ SD Card image — Python productivity for Zynq (Pynq)](https://pynq.readthedocs.io/en/latest/pynq_sd_card.html), which reads as follows:

> To customise the BSP a `petalinux_bsp` folder can be included in the board directory the contents of which will be added to the provided BSP before the project is created. See the ZCU104 for an example of this in action. This is designed to allow for additional drivers, kernel or boot-file patches and device tree configuration that are helpful to support elements of PYNQ to be added to a pre-existing BSP.
> 
> If a suitable PetaLinux BSP is unavailable for the board then `BSP_${BOARD}` can be left blank; in this case, users have **two options** :
> 
> 1. Place a _\<design\_name\>.xsa_ file in the `petalinux_bsp/hardware_project` folder. As part of the build flow, a new BSP will be created from this XSA file.
> 2. Place a makefile along with tcl files which can generate the hardware design in the `petalinux_bsp/hardware_project` folder. As part of the build flow, the hardware design along with the XSA file will be generated, then a new BSP will be created from this XSA file.

Note the phrase “two options.” There’s no “or” at the end of item #1 (which is the one I chose), but it’s implied from listing them as “options.” But when I run  
`make BOARDS=ZC706 PREBUILT=/media/sf_ZC706_shared/focal.arm.2.7.0_2021_11_17.tar.gz`

I get the following output (in pertinent part):

```auto
vivado -mode batch -source \
zc706.tcl build_bitstream.tcl -notrace

****** Vivado v2020.2 (64-bit)
  **** SW Build 3064766 on Wed Nov 18 09:12:47 MST 2020
  **** IP Build 3064653 on Wed Nov 18 14:17:31 MST 2020
    ** Copyright 1986-2020 Xilinx, Inc. All Rights Reserved.

source zc706.tcl -notrace
couldn't read file "zc706.tcl": no such file or directory
INFO: [Common 17-206] Exiting Vivado at Thu May 26 19:40:07 2022...
makefile:10: recipe for target 'bit' failed
make[1]: *** [bit] Error 1
make[1]: Leaving directory '/home/jim/PYNQ/sdbuild/build/ZC706/petalinux_bsp/hardware_project'
Makefile:343: recipe for target '/home/jim/PYNQ/sdbuild/build/ZC706/petalinux_bsp/xilinx-zc706-2020.2.bsp' failed
make: *** [/home/jim/PYNQ/sdbuild/build/ZC706/petalinux_bsp/xilinx-zc706-2020.2.bsp] Error 2

```

Seems like the two “options” listed are both requirements! Another post [Pynq 2.6 custom board image build method that works - Learn - PYNQ](https://discuss.pynq.io/t/pynq-2-6-custom-board-image-build-method-that-works/2894) indicates that instead of _\<design\_name\>.xsa_ this file should be named _system.xsa,_ but the same error occurred.

Again, clear direction is requested! If the XSA file **and** the TCL file are both required, just say that!

---

<div class="post-metadata">

**Author:** ![briansune](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/briansune/32/3087_2.png) [@briansune](https://discuss.pynq.io/u/briansune)\
**Post date:** [May 27, 2022, 12:12am UTC](https://discuss.pynq.io/t/novel-issues-quick-porting-of-pynq-using-pre-built-images/4187/6 "2022-05-27T00:12:05Z")

</div>

> [@JJSterling](#):
>
> ollowing output (in pertinent part):

So the ENV setup following my steps are working?

From my experience the name of the xsa dont matter as it will rename it if it is unique on the folder.

PREBUILT=/media/sf\_ZC706\_shared/focal.arm.2.7.0\_2021\_11\_17.tar.gz  
For this don’t put this is the sharing folder right might lead to issue as well.  
Move to location home and rerun again.

$(BUILD\_ROOT)/PYNQ/build.sh remove line started @105 to 165  
to reduce the build of other unnecessary board and licensing issue.  
Try make with the same setting without clean and ensure remove these lines.  
Usually check ps -a and ensure there are no background vivado is running.
