# PYNQ V2.7 SD image build fail for board PYNQ-Z2

**URL:** <https://discuss.pynq.io/t/pynq-v2-7-sd-image-build-fail-for-board-pynq-z2/4243>\
**Category:** Support\
**Created:** [May 24, 2022, 10:36pm UTC](https://discuss.pynq.io/t/pynq-v2-7-sd-image-build-fail-for-board-pynq-z2/4243 "2022-05-24T22:36:14Z")\
**Posts on this page:** 1\
**Showing post:** 46

<div class="post-metadata">

**Author:** ![Willy](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/willy/32/3440_2.png) [@Willy](https://discuss.pynq.io/u/Willy)\
**Post date:** [June 2, 2022, 12:28pm UTC](https://discuss.pynq.io/t/pynq-v2-7-sd-image-build-fail-for-board-pynq-z2/4243/46 "2022-06-02T12:28:33Z")

</div>

I suffer some permission related issues. So I unisntall Vitis & Vivado again, and install them without using root permission and put their location at ~/Xilinx just like your suggestion.

1. cd ~/PYNQ/sdbuild
2. make PREBUILT=focal.aarch64.2.7.0\_2021\_11\_17.tar.gz BOARDS=Pynq-Z2
3. Build a lot of time, it will fail at board ZCU104  
makefile:16: recipe for target ‘bitstream’ failed  
====================================================  
make[1]: \*\*\* [bitstream] Error 137  
make[1]: Leaving directory ‘/home/willy/PYNQ/sdbuild/build/PYNQ/boards/ZCU104/base’  
…  
…

- unmount\_special
- for fs in $fss
- sudo umount -l /home/willy/PYNQ/sdbuild/build/focal.Pynq-Z2/proc  
[sudo] password for willy:  
Sorry, try again.  
[sudo] password for willy:
- for fs in $fss
- sudo umount -l /home/willy/PYNQ/sdbuild/build/focal.Pynq-Z2/run
- for fs in $fss
- sudo umount -l /home/willy/PYNQ/sdbuild/build/focal.Pynq-Z2/dev
- sudo umount -l /home/willy/PYNQ/sdbuild/build/focal.Pynq-Z2/ccache
- rmdir /home/willy/PYNQ/sdbuild/build/focal.Pynq-Z2/ccache  
Makefile:343: recipe for target ‘/home/willy/PYNQ/sdbuild/build/Pynq-Z2.tar.gz’ failed  
make: \*\*\* [/home/willy/PYNQ/sdbuild/build/Pynq-Z2.tar.gz] Error 2  
=================================================

1. Remove lines in build/PYNQ/build.sh, and execute make again:  
make PREBUILT=focal.aarch64.2.7.0\_2021\_11\_17.tar.gz BOARDS=Pynq-Z2  
Finally, I got the success result:  
 ![image](https://us1.discourse-cdn.com/flex019/uploads/pynq1/original/2X/0/0fd8447703cb9e3bcc3d91164ce47c340b02119a.png)

One more thanks again, briansune.  
Another question, how can we compress them into the SD card image just like the below link?  
[https://bit.ly/pynqz2\_2\_7](https://bit.ly/pynqz2_2_7)

BTW, in your post:

> [@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…

==================================

Step 10 update a bit:  
apt-get install tftpd tftp openbsd-inetd  
gedit /etc/inetd.conf  
(add this) tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /tftproot  
mkdir /tftproot  
chmod 777 /tftproot  
/etc/init.d/openbsd-inetd restart  
netstat -an | more | grep udp

===========================  
The “tftproot” should be corrected to “tftpboot”, because the make script use “tftpboot” not “tftproot”.  
INFO: Failed to copy built images to tftp dir: / **tftpboot**

---

_[View the full topic](https://discuss.pynq.io/t/pynq-v2-7-sd-image-build-fail-for-board-pynq-z2/4243)._
