Bar
SpaceWire UK
Specialist providers of VHDL Intellectual Property & Design Services
BarBarBarBar
Tutorial
Missing Image!
Part 26 - PetaLinux 2021.2 to 2022.2 migration

Introduction

This tutorial details the steps required to migrate the zedboard_linux project from PetaLinux 2021.2 to PetaLinux 2022.2.

Worth taking a look at the OS support vs. PetaLinux version at this point. A green Yes indicates the progress this tutorial is making towards bumping both the OS & PetaLinux to something later.

UbuntuPetaLinux
OS versionCode nameRelease dateStandard support untilPetaLinux 2021.2PetaLinux 2022.2PetaLinux 2023.2PetaLinux 2024.2PetaLinux 2025.2
Ubuntu 16.04 LTSXenial Xerus21 Apr 201630 Apr 2021Yes----
Ubuntu 18.04 LTSBionic Beaver26 Apr 201831 May 2023YesYesYes--
Ubuntu 20.04 LTSFocal Fossa23 Apr 202029 May 2025YesYes (this)YesYes-
Ubuntu 22.04 LTSJammy Jellyfish21 Apr 202201 Jun 2027--YesYesYes
Ubuntu 24.04 LTSNoble Numbat25 Apr 202431 May 2029-----

Aims

The aims of this tutorial are as follows :-

    Part 1 - Setup environment

    1. Pre-requisites

    Part 2 - Move Zedboard Linux project from 2021.2 to 2022.2

    1. Bump version
    2. Initial build attempt
    3. Bulk edit of files (short version)
    4. Bulk edit of files (long version)
    5. Resume build attempt
    6. Copy files to SD Card

    Part 3 - Check everything is working as expected

    1. Check the Webserver

    Part 4 - Make the changes permanent

    1. Edit the Apache2 configuration
    2. Create an auto-start application

    Part 5 - Revision Control

    1. Commit new & updated files
    2. Create production release
    3. Copy files to SD Card

    Part 6 - Check everything is working as expected

    1. OS boot & Firmware load

    Part 7 - Final resulting build file(s)

    1. Resulting BOOT files
    #### Part 1 - Setup environment ####

    1. Pre-requisites

    Starting from this point is possible but requires a few pre-requisites.
    #### Part 2 - Move Zedboard Linux project from 2021.2 to 2022.2 ####

    2. Bump version

    Change the version (or revision) number for this new development, this prevents ghost (post-release, same version) builds from appearing.
    steve@Desktop:~/swuk_tutorial$ sed -i 's/15.0/16.0/g' zedboard_linux/os/petalinux/project-spec/meta-user/recipes-apps/website/files/project.txt
    Just for completeness :-

    project.txt

    Zedboard PetaLinux
    SpaceWire UK
    Steve Haywood
    16.0
    
    Direct download available here :-
    steve@Desktop:~/swuk_tutorial$ wget https://spacewire.co.uk/tutorial/shared/repos/0033/zedboard_linux/os/petalinux/project-spec/meta-user/recipes-apps/website/files/project.txt -O zedboard_linux/os/petalinux/project-spec/meta-user/recipes-apps/website/files/project.txt
    Check out the changes.
    steve@Desktop:~/swuk_tutorial$ git difftool zedboard_linux/os/petalinux/project-spec/meta-user/recipes-apps/website/files/project.txt

    3. Initial build attempt

    Attempt to build the existing zedboard_linux (PetaLinux) project using the later 2022.2 toolchain. Resolve any of the issues along the way.

    Clear out all the superfluous files from the project area (non-tracked files).
    steve@Desktop:~/swuk_tutorial$ cd zedboard_linux/os/petalinux
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ git clean -fdx
    Clear out the transfer area.
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ rm -rf /tftpboot/*
    Build PetaLinux.
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ swuk_petalinux-build
    Select y
    WARNING: Your PetaLinux project was last modified by PetaLinux SDK version "2021.2",
    WARNING: however, you are using PetaLinux SDK version "2022.2".
    Please input "y" to continue. Otherwise it will exit![n]y
    Select y
    WARNING: "Your yocto SDK was changed in tool",
    Please input "y" to proceed the installing SDK into project, "n" to exit:y
    ERROR: Layer meta-user is not compatible with the core layer which only supports these series: honister (layer is compatible with gatesgarth)
    ERROR: Layer meta-user is not compatible with the core layer which only supports these series: honister (layer is compatible with gatesgarth)
    ERROR: Failed to create workspace directory
    ERROR: Failed to build project. Check the ~/swuk_tutorial/zedboard_linux/os/petalinux/build/build.log file for more details...
    Change the layer from gatesgarth to honister.
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ cd ../../..
    steve@Desktop:~/swuk_tutorial$ subl zedboard_linux/os/petalinux/project-spec/meta-user/conf/layer.conf

    layer.conf

    # We have a conf and classes directory, add to BBPATH
    BBPATH .= ":${LAYERDIR}"
    
    # We have recipes-* directories, add to BBFILES
    BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
    	${LAYERDIR}/recipes-*/*/*.bbappend"
    
    BBFILE_COLLECTIONS += "meta-user"
    BBFILE_PATTERN_meta-user = "^${LAYERDIR}/"
    BBFILE_PRIORITY_meta-user = "7"
    LAYERSERIES_COMPAT_meta-user = "honister"
    
    Direct download available here :-
    steve@Desktop:~/swuk_tutorial$ wget https://spacewire.co.uk/tutorial/shared/repos/0033a/zedboard_linux/os/petalinux/project-spec/meta-user/conf/layer.conf -O zedboard_linux/os/petalinux/project-spec/meta-user/conf/layer.conf
    Check out the changes.
    steve@Desktop:~/swuk_tutorial$ git difftool zedboard_linux/os/petalinux/project-spec/meta-user/conf/layer.conf
    Restart the build.
    steve@Desktop:~/swuk_tutorial$ cd zedboard_linux/os/petalinux
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ swuk_petalinux-build
    Errors now occur, around 10 iterations worth, which boils down to the following file edits :- Make the changes required and bump the version (major) of any files containing a header.

    4. Bulk edit of files (short version)

    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ find . -type f \( -name *.bb -o -name *.bbappend -o -name *.conf \) -exec sed -i -e 's/IMAGE_INSTALL_append/IMAGE_INSTALL:append/g' -e 's/PACKAGECONFIG_append_pn-php/PACKAGECONFIG:append:pn-php/g' -e 's/FILESEXTRAPATHS_prepend/FILESEXTRAPATHS:prepend/g' -e 's/CFLAGS_prepend/CFLAGS:prepend/g' -e 's/FILES_${PN}/FILES:${PN}/g' -e 's/SRC_URI_append/SRC_URI:append/g' -e 's/do_configure_append_microblaze/do_configure:append:microblaze/g' -e 's/do_configure_append/do_configure:append/g' -e 's/do_install_append/do_install:append/g' -e 's/KERNEL_FEATURES_append/KERNEL_FEATURES:append/g' {} +
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ files=$(git status -u | grep -oP '(?<=modified:   ).*')
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ for file in ${files[@]}
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ do
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$   echo $file
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$   date=$(cat ${file} | sed -n 's/^.*Date \.\{10\} \(.*\)$/\1/p')
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$   vers=$(cat ${file} | sed -n 's/^.*Version \.\{7\} \(.*\)$/\1/p')
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$   if [ -v ${vers} ]; then
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$     echo "  Not versioned!"
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$   else
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$     newdate=$(date +'%d %b %Y')
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$     versplit=(${vers//./ })
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$     ((versplit[0]+=1))
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$     newvers=$(echo ${versplit[@]} | sed 's/ /./g')
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$     echo "  Reversioning: ${vers} -> ${newvers}, ${date} -> ${newdate}"
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$     sed -i "0,/Date .......... ${date}/s//Date .......... ${newdate}/" $file
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$     sed -i "0,/Version ....... ${vers}/s//Version ....... ${newvers}/" $file
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$   fi
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ done
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ .petalinux/metadata
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$   Not versioned!
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ project-spec/configs/config
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$   Not versioned!
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ project-spec/configs/rootfs_config
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$   Not versioned!
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ project-spec/meta-user/conf/layer.conf
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$   Not versioned!
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ project-spec/meta-user/conf/petalinuxbsp.conf
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$   Reversioning: 2.0 -> 3.0, 03 Aug 2023 -> 28 Feb 2026
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ project-spec/meta-user/recipes-apps/adv7511-config/adv7511-config.bb
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$   Reversioning: 1.0 -> 2.0, 22 Dec 2025 -> 28 Feb 2026
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ project-spec/meta-user/recipes-apps/gpio-demo/gpio-demo.bb
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$   Not versioned!
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ project-spec/meta-user/recipes-apps/led-runner/led-runner.bb
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$   Reversioning: 1.0 -> 2.0, 18 Jan 2022 -> 28 Feb 2026
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ project-spec/meta-user/recipes-apps/peekpoke/peekpoke.bb
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$   Not versioned!
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ project-spec/meta-user/recipes-apps/peekpokecgi/peekpokecgi.bb
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$   Reversioning: 5.0 -> 6.0, 27 Feb 2024 -> 28 Feb 2026
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ project-spec/meta-user/recipes-apps/website/files/project.txt
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$   Not versioned!
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ project-spec/meta-user/recipes-apps/website/website.bb
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$   Reversioning: 8.0 -> 9.0, 27 Feb 2024 -> 28 Feb 2026
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ project-spec/meta-user/recipes-bsp/device-tree/device-tree.bbappend
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$   Not versioned!
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ project-spec/meta-user/recipes-bsp/u-boot/u-boot-xlnx_%.bbappend
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$   Not versioned!
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ project-spec/meta-user/recipes-bsp/uboot-device-tree/uboot-device-tree.bbappend
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$   Not versioned!
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ project-spec/meta-user/recipes-httpd/apache2/apache2_%.bbappend
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$   Reversioning: 2.0 -> 3.0, 27 Feb 2024 -> 28 Feb 2026
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ project-spec/meta-user/recipes-kernel/linux/linux-xlnx_%.bbappend
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$   Not versioned!

    5. Bulk edit of files (long version)

    6. Resume build attempt

    Restart the build.
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ swuk_petalinux-build
    Package PetaLinux to produce the boot image BOOT.BIN, this will include the first stage boot loader zynq_fsbl.elf, the programmable logic system.bit, the Linux boot loader u-boot.elf and the device tree blob system.dtb.
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ petalinux-package --boot --force --fsbl images/linux/zynq_fsbl.elf --fpga images/linux/system.bit --uboot images/linux/u-boot.elf

    7. Copy files to SD Card

    Upload the newly created PetaLinux Boot & OS files. Select 0.
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ swuk_upload_boot 192.168.2.87

    Boot files @ /tftpboot :-

    0) - BOOT.BIN - boot.scr - image.ub

    Boot files @ ~/Documents/swuk_tutorial/petalinux :-

    1) v10.0 - BOOT.BIN - boot.scr - image.ub
    2) v11.0 - BOOT.BIN - boot.scr - image.ub
    3) v12.0 - BOOT.BIN - boot.scr - image.ub
    4) v13.0 - BOOT.BIN - boot.scr - image.ub
    5) v14.0 - BOOT.BIN - boot.scr - image.ub
    6) v15.0 - BOOT.BIN - boot.scr - image.ub

    q) Quit

    Select boot files for upload or quit : 6

    Remote reboot (wait): 30 / 30s
    Remote reboot (ping): 4 / 30s
    Remote reboot (ssh): 10 / 30s

    Uploaded BOOT.BIN, boot.scr & image.ub to /media/sd-mmcblk0p1 @ 192.168.2.87.

    Remote system credentials :-
    Zedboard PetaLinux
    SpaceWire UK
    Steve Haywood
    16.0 (unstaged)
    19-Feb-2026 - 09:37:08
    6cb6af817b21f8de6d8edafb9e32595e63dab8df
    Looks good!
    #### Part 3 - Check everything is working as expected ####

    8. Check the Webserver

    Check to see if the webserver is operational by using a browser pointing at the Zedboard's IP address (192.168.2.87). Missing Image! Fail. Computer says no!

    Use the Debug terminal to login to PetaLinux and investigate what's gone wrong.

    Check the Apache2 service.
    ::
    ::
    Starting internet superserver: inetd.
    Starting ntpd: done
    Starting syslogd/klogd: done
    Starting web server: apache2failed
    Starting tcf-agent: OK

    PetaLinux 2022.2_release_S10071807 petalinux /dev/ttyPS0

    petalinux login: root
    root@petalinux:~# apachectl status
    /usr/sbin/apachectl: line 95: /usr/bin/curl: No such file or directory
    The httpd server does not work!
    Fail. Not very helpful, lets investigate further...
    root@petalinux:~# /etc/init.d/apache2 force-reload
    Reloading apache2 modules(2)No such file or directory: AH02291: Cannot access directory '/var/log/apache2/' for main error log
    AH00014: Configuration check failed
    failed
    Fail. Create the missing log directory and try again...
    root@petalinux:~# mkdir /var/log/apache2
    root@petalinux:~# /etc/init.d/apache2 force-reload
    Reloading apache2 moduleshttpd not running, trying to start
    .
    root@petalinux:~# /etc/init.d/apache2 restart
    Again check to see if the webserver is operational by using a browser pointing at the Zedboard's IP address (192.168.2.87). Missing Image! Bingo. Click on the System tab to see what's what. Missing Image! Fail. No Firmware Information and no Loadable Firmware.

    These two issues are totally independent of one and other. The lack of Firmware Information would indicate the CGI binary for reading the ID Strings didn't fire. The lack of Loadable Firmware would indicate some sort of issue with the SD-Card.

    Examine the Apache2 error log.
    root@petalinux:~# cat /var/log/apache2/error_log
    [Fri Feb 20 15:52:17.649904 2026] [cgid:error] [pid 563:tid 3069751312] (2)No such file or directory: AH01243: Couldn't bind unix domain socket /var/run/apache2/cgisock.562
    [Fri Feb 20 15:52:17.704285 2026] [mpm_worker:notice] [pid 562:tid 3069751312] AH00292: Apache/2.4.52 (Unix) PHP/7.4.21 configured -- resuming normal operations
    [Fri Feb 20 15:52:17.704465 2026] [core:notice] [pid 562:tid 3069751312] AH00094: Command line: '/usr/sbin/httpd'
    [Fri Feb 20 15:52:17.704712 2026] [cgid:crit] [pid 562:tid 3069751312] AH01238: cgid daemon failed to initialize
    [Fri Feb 20 15:52:17.705938 2026] [unixd:alert] [pid 564:tid 3069751312] AH02155: getpwuid: couldn't determine user name from uid -1, you probably need to modify the User directive
    [Fri Feb 20 15:52:17.711692 2026] [unixd:alert] [pid 565:tid 3069751312] AH02155: getpwuid: couldn't determine user name from uid -1, you probably need to modify the User directive
    [Fri Feb 20 15:52:17.712779 2026] [unixd:alert] [pid 566:tid 3069751312] AH02155: getpwuid: couldn't determine user name from uid -1, you probably need to modify the User directive
    [Fri Feb 20 15:52:25.393447 2026] [php7:warn] [pid 565:tid 2956944304] [client 192.168.2.16:57456] PHP Warning:  scandir(/media/sd-mmcblk0p1/firmware): failed to open dir: No such file or directory in /srv/www/system/index.php on l/
    [Fri Feb 20 15:52:25.393571 2026] [php7:warn] [pid 565:tid 2956944304] [client 192.168.2.16:57456] PHP Warning:  scandir(): (errno 2): No such file or directory in /srv/www/system/index.php on line 96, referer: http://192.168.2.87//
    [Fri Feb 20 15:52:25.393619 2026] [php7:warn] [pid 565:tid 2956944304] [client 192.168.2.16:57456] PHP Warning:  Invalid argument supplied for foreach() in /srv/www/system/index.php on line 97, referer: http://192.168.2.87/home/
    [Fri Feb 20 15:52:25.720214 2026] [unixd:alert] [pid 676:tid 3069751312] AH02155: getpwuid: couldn't determine user name from uid -1, you probably need to modify the User directive
    [Fri Feb 20 15:52:57.368281 2026] [cgid:error] [pid 565:tid 2965337008] (2)No such file or directory: [client 192.168.2.16:57480] AH01257: unable to connect to cgi daemon after multiple tries: /srv/www/cgi-bin/peekstring, referer: /
    [Fri Feb 20 15:52:57.368281 2026] [cgid:error] [pid 566:tid 3032478640] (2)No such file or directory: [client 192.168.2.16:57498] AH01257: unable to connect to cgi daemon after multiple tries: /srv/www/cgi-bin/peekstring, referer: /
    [Fri Feb 20 15:52:57.368962 2026] [cgid:error] [pid 565:tid 2956944304] (2)No such file or directory: [client 192.168.2.16:57456] AH01257: unable to connect to cgi daemon after multiple tries: /srv/www/cgi-bin/peekstring, referer: /
    [Fri Feb 20 15:52:57.369101 2026] [cgid:error] [pid 564:tid 3015693232] (2)No such file or directory: [client 192.168.2.16:57470] AH01257: unable to connect to cgi daemon after multiple tries: /srv/www/cgi-bin/peekstring, referer: /
    [Fri Feb 20 15:52:57.369484 2026] [cgid:error] [pid 566:tid 3024085936] (2)No such file or directory: [client 192.168.2.16:57496] AH01257: unable to connect to cgi daemon after multiple tries: /srv/www/cgi-bin/peekstring, referer: /
    [Fri Feb 20 15:52:57.370056 2026] [cgid:error] [pid 564:tid 3024085936] (2)No such file or directory: [client 192.168.2.16:57472] AH01257: unable to connect to cgi daemon after multiple tries: /srv/www/cgi-bin/peekstring, referer: /
    Lets investigate the Firmware Information issue by examining the Apache2 configuration file.
    root@petalinux:~# grep -i sock /etc/apache2/httpd.conf
        # ScriptSock: On threaded servers, designate the path to the UNIX
        # socket used to communicate with the CGI daemon of mod_cgid.
        #Scriptsock cgisock
    Uncomment the Scriptsock entry and reload Apache2.
    root@petalinux:~# sed -i 's/#Scriptsock/Scriptsock/' /etc/apache2/httpd.conf
    root@petalinux:~# /etc/init.d/apache2 force-reload
    Reloading apache2 modules.
    Refresh the System tab to see if the Firmware Information has put in an appearance.

    Fail. Lets have a look at some of the Apache2 documentation. The example looks to be more like what is required.

    Change the Scriptsock entry and reload Apache2.
    root@petalinux:~# sed -i 's/Scriptsock cgisock/ScriptSock \/var\/run\/cgid.sock/' /etc/apache2/httpd.conf
    root@petalinux:~# /etc/init.d/apache2 force-reload
    Reloading apache2 modules.
    Refresh the System tab to see if the Firmware Information has put in an appearance. Missing Image! Bingo. The Firmware Information is now displayed.

    Lets investigate the Loadable Firmware issue by examining the PetaLinux file system.
    root@petalinux:~# ls -la /media
    drwxr-xr-x    2 root     root            40 Mar  9  2018 .
    drwxr-xr-x   18 root     root           420 Mar  9  2018 ..
    root@petalinux:~# find / | grep zedboard_video_tpg_hdmi
    /run/media/mmcblk0p1/firmware/zedboard_video_tpg_hdmi_v1.0.bin
    The SD-Card has moved address and changed some of its name too. Used to be located at /media/sd-mmcblk0p1 and now is located at /run/media/mmcblk0p1. This will have a few knock on effects!

    To check the firmware load capability is still working OK create a symbolic link from the old location to the new location.
    root@petalinux:/# ln -s /run/media/mmcblk0p1 /media/sd-mmcblk0p1
    Refresh the System tab to see if the Loadable Firmware has put in an appearance. If so, attempt to load zedboard_leds_switches_v5.0.bin by clicking on its Load button. Missing Image! Bingo. It's a fair assumption to make that the Apache2 service along with its CGI are working as expected.

    Since the LEDs & Switches design is now loaded, check the CGI further by clicking on the Peek & Poke tab and loading in the zedboard_leds_switches.txt configuration. Peek & Poke around. Missing Image! All looks good!
    #### Part 4 - Make the changes permanent ####

    9. Edit the Apache2 configuration

    To make the changes from above permanent, the following edits need to be made to a Apache2 configuration.

    Change the apache2_%.bbappend BitBake recipe to include :- See lines 31-35 for the changes.
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ cd ../../..
    steve@Desktop:~/swuk_tutorial$ subl zedboard_linux/os/petalinux/project-spec/meta-user/recipes-httpd/apache2/apache2_%.bbappend

    apache2_%.bbappend

    #
    # File .......... apache2_%.bbappend
    # Author ........ Steve Haywood
    # Website ....... http://www.spacewire.co.uk
    # Project ....... Zedboard Linux (SpaceWire UK Tutorial)
    # Date .......... 28 Feb 2026
    # Version ....... 3.0
    # Description ...
    #   Modified Apache 2 recipe to suite PetaLinux. Updated to allow Apache to run as
    # root instead of deamon.
    #
    
    do_install:append() {
    
    sed -i 's@^#LoadModule cgid_module /usr/libexec/apache2/modules/mod_cgid.so@LoadModule cgid_module /usr/libexec/apache2/modules/mod_cgid.so@' ${D}/${sysconfdir}/${BPN}/httpd.conf
    
    sed -i 's@^DocumentRoot "/usr/share/apache2/default-site/htdocs"@DocumentRoot "/srv/www"@' ${D}/${sysconfdir}/${BPN}/httpd.conf
    
    sed -i 's@^<Directory "/usr/share/apache2/default-site/htdocs">@<Directory "/srv/www">@' ${D}/${sysconfdir}/${BPN}/httpd.conf
    
    sed -i 's@^    ScriptAlias /cgi-bin/ "/usr/libexec/apache2/modules/cgi-bin/"@    ScriptAlias /cgi-bin/ "/srv/www/cgi-bin/"@' ${D}/${sysconfdir}/${BPN}/httpd.conf
    
    sed -i 's@^<Directory "/usr/libexec/apache2/modules/cgi-bin">@<Directory "/srv/www/cgi-bin">@' ${D}/${sysconfdir}/${BPN}/httpd.conf
    
    sed -i 's@^    DirectoryIndex index.html@    DirectoryIndex index.html index.php@' ${D}/${sysconfdir}/${BPN}/httpd.conf
    
    sed -i 's@^User daemon@#User daemon@' ${D}/${sysconfdir}/${BPN}/httpd.conf
    
    sed -i 's@^Group daemon@#Group daemon@' ${D}/${sysconfdir}/${BPN}/httpd.conf
    
    sed -i 's@#Scriptsock cgisock@Scriptsock /var/run/cgid.sock@' ${D}/${sysconfdir}/${BPN}/httpd.conf
    
    sed -i 's@ErrorLog "/var/log/apache2/error_log"@ErrorLog "/tmp/apache2_error_log"@' ${D}/${sysconfdir}/${BPN}/httpd.conf
    
    sed -i 's@CustomLog "/var/log/apache2/access_log"@CustomLog "/tmp/apache2_access_log"@' ${D}/${sysconfdir}/${BPN}/httpd.conf
    
    }
    
    Direct download available here :-
    steve@Desktop:~/swuk_tutorial$ wget https://spacewire.co.uk/tutorial/shared/repos/0033/zedboard_linux/os/petalinux/project-spec/meta-user/recipes-httpd/apache2/apache2_%.bbappend -O zedboard_linux/os/petalinux/project-spec/meta-user/recipes-httpd/apache2/apache2_%.bbappend
    Check out the changes.
    steve@Desktop:~/swuk_tutorial$ git difftool zedboard_linux/os/petalinux/project-spec/meta-user/recipes-httpd/apache2/apache2_%.bbappend

    10. Create an auto-start application

    To make the changes from above permanent, the link from /media/sd-mmcblk0p1 to /run/media/mmcblk0p1 needs to be applied at boot time.

    Create a blank application component (auto enabled) to perform some extra boot time operations.
    steve@Desktop:~/swuk_tutorial$ cd zedboard_linux/os/petalinux
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ petalinux-create --type apps --template install --name boot-extras --enable
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ cd ../../..
    Edit the newly created auto-run application to include the boot time commands.
    steve@Desktop:~/swuk_tutorial$ subl zedboard_linux/os/petalinux/project-spec/meta-user/recipes-apps/boot-extras/files/boot-extras

    boot-extras

    #!/bin/sh
    
    #
    # File .......... boot-extras
    # Author ........ Steve Haywood
    # Website ....... http://www.spacewire.co.uk
    # Project ....... Zedboard Linux (SpaceWire UK Tutorial)
    # Date .......... 28 Feb 2026
    # Version ....... 1.0
    # Description ...
    #   Script to perform boot time operations.
    #
    
    ln -s /run/media/mmcblk0p1 /media/sd-mmcblk0p1
    
    Direct download available here :-
    steve@Desktop:~/swuk_tutorial$ wget https://spacewire.co.uk/tutorial/shared/repos/0033/zedboard_linux/os/petalinux/project-spec/meta-user/recipes-apps/boot-extras/files/boot-extras -O zedboard_linux/os/petalinux/project-spec/meta-user/recipes-apps/boot-extras/files/boot-extras
    Change the BitBake recipe to make it suitable for an auto-start application.
    steve@Desktop:~/swuk_tutorial$ subl zedboard_linux/os/petalinux/project-spec/meta-user/recipes-apps/boot-extras/boot-extras.bb

    boot-extras.bb

    #
    # File .......... boot-extras.bb
    # Author ........ Steve Haywood
    # Website ....... http://www.spacewire.co.uk
    # Project ....... Zedboard Linux (SpaceWire UK Tutorial)
    # Date .......... 28 Feb 2026
    # Version ....... 1.0
    # Description ...
    #   Recipe for an autostart application.
    #
    
    SUMMARY = "Simple boot-extras application"
    SECTION = "PETALINUX/apps"
    LICENSE = "MIT"
    LIC_FILES_CHKSUM ="file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
    
    SRC_URI = "file://boot-extras"
    
    S = "${WORKDIR}"
    
    FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
    
    inherit update-rc.d
    
    INITSCRIPT_NAME = "boot-extras"
    INITSCRIPT_PARAMS = "start 99 S ."
    
    do_install() {
      install -d ${D}${sysconfdir}/init.d
      install -m 0755 ${S}/boot-extras ${D}${sysconfdir}/init.d/boot-extras
    }
    FILES:${PN} += "${sysconfdir}/*"
    
    Direct download available here :-
    steve@Desktop:~/swuk_tutorial$ wget https://spacewire.co.uk/tutorial/shared/repos/0033/zedboard_linux/os/petalinux/project-spec/meta-user/recipes-apps/boot-extras/boot-extras.bb -O zedboard_linux/os/petalinux/project-spec/meta-user/recipes-apps/boot-extras/boot-extras.bb
    #### Part 5 - Revision Control ####

    11. Commit new & updated files

    Check GIT status to make sure all is well and there are no spurious elements.
    steve@Desktop:~/swuk_tutorial$ git status -u
    On branch master
    Your branch is up-to-date with 'origin/master'.

    Changes not staged for commit:
      (use "git add <file>..." to update what will be committed)
      (use "git restore <file>..." to discard changes in working directory)
       modified:   zedboard_linux/os/petalinux/.petalinux/metadata
       modified:   zedboard_linux/os/petalinux/project-spec/configs/config
       modified:   zedboard_linux/os/petalinux/project-spec/configs/rootfs_config
       modified:   zedboard_linux/os/petalinux/project-spec/meta-user/conf/layer.conf
       modified:   zedboard_linux/os/petalinux/project-spec/meta-user/conf/petalinuxbsp.conf
       modified:   zedboard_linux/os/petalinux/project-spec/meta-user/conf/user-rootfsconfig
       modified:   zedboard_linux/os/petalinux/project-spec/meta-user/recipes-apps/adv7511-config/adv7511-config.bb
       modified:   zedboard_linux/os/petalinux/project-spec/meta-user/recipes-apps/gpio-demo/gpio-demo.bb
       modified:   zedboard_linux/os/petalinux/project-spec/meta-user/recipes-apps/led-runner/led-runner.bb
       modified:   zedboard_linux/os/petalinux/project-spec/meta-user/recipes-apps/peekpoke/peekpoke.bb
       modified:   zedboard_linux/os/petalinux/project-spec/meta-user/recipes-apps/peekpokecgi/peekpokecgi.bb
       modified:   zedboard_linux/os/petalinux/project-spec/meta-user/recipes-apps/website/files/project.txt
       modified:   zedboard_linux/os/petalinux/project-spec/meta-user/recipes-apps/website/website.bb
       modified:   zedboard_linux/os/petalinux/project-spec/meta-user/recipes-bsp/device-tree/device-tree.bbappend
       modified:   zedboard_linux/os/petalinux/project-spec/meta-user/recipes-bsp/u-boot/u-boot-xlnx_%.bbappend
       modified:   zedboard_linux/os/petalinux/project-spec/meta-user/recipes-bsp/uboot-device-tree/uboot-device-tree.bbappend
       modified:   zedboard_linux/os/petalinux/project-spec/meta-user/recipes-httpd/apache2/apache2_%.bbappend
       modified:   zedboard_linux/os/petalinux/project-spec/meta-user/recipes-kernel/linux/linux-xlnx_%.bbappend

    Untracked files:
      (use "git add <file>..." to include in what will be committed)
       zedboard_linux/os/petalinux/.Xil/XSCT-4095775-Desktop/system.bda
       zedboard_linux/os/petalinux/project-spec/configs/systemd-conf/wired.network
       zedboard_linux/os/petalinux/project-spec/meta-user/recipes-apps/boot-extras/.gdbinit
       zedboard_linux/os/petalinux/project-spec/meta-user/recipes-apps/boot-extras/README
       zedboard_linux/os/petalinux/project-spec/meta-user/recipes-apps/boot-extras/boot-extras.bb
       zedboard_linux/os/petalinux/project-spec/meta-user/recipes-apps/boot-extras/files/boot-extras

    no changes added to commit (use "git add" and/or "git commit -a")
    Looks good! .Xil needs removal.
    steve@Desktop:~/swuk_tutorial$ rm -rf zedboard_linux/os/petalinux/.Xil
    Commit the updates, create an annotated tag and push the commit & tag up to the remote repository.
    steve@Desktop:~/swuk_tutorial$ git add -A
    steve@Desktop:~/swuk_tutorial$ git commit -a -m "Basic Zedboard design consisting of a ZYNQ7 Processing System controlling a pair of cascading Test Pattern Generators that output video via HDMI (PetaLinux 2022.2)."
    steve@Desktop:~/swuk_tutorial$ git push
    steve@Desktop:~/swuk_tutorial$ git tag -a my_zedboard_linux_v16.0 -m "ZYNQ & Cascading TPG's with HDMI output (PetaLinux 2022.2)"
    steve@Desktop:~/swuk_tutorial$ git push origin my_zedboard_linux_v16.0

    12. Create production release

    Create a potential production release for the PetaLinux (v16.0) project using pure repository source. .

    (optional) Clear out all the superfluous files from the project area (non-tracked files).
    steve@Desktop:~/swuk_tutorial$ cd zedboard_linux/os/petalinux
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ git clean -fdx
    (optional) Clear out the transfer area.
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ rm -rf /tftpboot/*
    Double check GIT status.
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ git status
    On branch master
    Your branch is up-to-date with 'origin/master'.

    nothing to commit, working tree clean
    Build/rebuild PetaLinux.
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ swuk_petalinux-build
    Note: A fresh build of PetaLinux takes a long time to complete and can be prone to failure due to internet downloads. If the build process fails, firstly check the GIT status & difftool for any noddy file changes, restore these file changes and then execute the build command again until it finally completes. Example below :-
    ::
    ::
    ERROR: Failed to build project. Check the ~/swuk_tutorial/zedboard_linux/os/petalinux/build/build.log file for more details...
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ git status -u
    On branch my_master
    Your branch is up-to-date with 'origin/my_master'.

    Changes not staged for commit:
      (use "git add <file>..." to update what will be committed)
      (use "git restore <file>..." to discard changes in working directory)
       modified:   .petalinux/metadata
       modified:   project-spec/configs/config

    no changes added to commit (use "git add" and/or "git commit -a")
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ git difftool
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ git restore .petalinux/metadata project-spec/configs/config
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ swuk_petalinux-build
    ::
    ::
    INFO: Successfully copied built images to tftp dir: /tftpboot
    [INFO] Successfully built project
    Package PetaLinux to produce the boot image BOOT.BIN, this will include the first stage boot loader zynq_fsbl.elf, the programmable logic system.bit, the Linux boot loader u-boot.elf and the device tree blob system.dtb.
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ petalinux-package --boot --force --fsbl images/linux/zynq_fsbl.elf --fpga images/linux/system.bit --uboot images/linux/u-boot.elf
    Archive the generated files for safe keeping. These files are not held in the repository as they can be recreated from source.
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ mkdir -p ~/Documents/swuk_tutorial/petalinux/v16.0
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ cp /tftpboot/{BOOT.BIN,boot.scr,image.ub} ~/Documents/swuk_tutorial/petalinux/v16.0

    13. Copy files to SD Card

    Upload the newly created PetaLinux Boot & OS files. Select 0 or 7.
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ swuk_upload_boot 192.168.2.87

    Boot files @ /tftpboot :-

    0) - BOOT.BIN - boot.scr - image.ub

    Boot files @ ~/Documents/swuk_tutorial/petalinux :-

    1) v10.0 - BOOT.BIN - boot.scr - image.ub
    2) v11.0 - BOOT.BIN - boot.scr - image.ub
    3) v12.0 - BOOT.BIN - boot.scr - image.ub
    4) v13.0 - BOOT.BIN - boot.scr - image.ub
    5) v14.0 - BOOT.BIN - boot.scr - image.ub
    6) v15.0 - BOOT.BIN - boot.scr - image.ub
    7) v16.0 - BOOT.BIN - boot.scr - image.ub

    q) Quit

    Select boot files for upload or quit : 7

    Remote reboot (wait): 30 / 30s
    Remote reboot (ping): 4 / 30s
    Remote reboot (ssh): 10 / 30s

    Uploaded BOOT.BIN, boot.scr & image.ub to /media/sd-mmcblk0p1 @ 192.168.2.87.

    Remote system credentials :-
    Zedboard PetaLinux
    SpaceWire UK
    Steve Haywood
    16.0
    09-Mar-2026 - 05:00:51
    a09289d2670bfdc9240b1cc09e95849d3339a89b
    Looks good!
    #### Part 6 - Check everything is working as expected ####

    14. OS boot & Firmware load

    Access the webserver running on the Zedboard using a browser pointing at the Zedboard's IP address (192.168.2.87).

    Select System from the menu bar (refresh page if already open).

    The Operating System Information table should show Zedboard PetaLinux description along with a version of 16.0.

    The Firmware Information table should show Zedboard Video TPG HDMI description along with a version of 1.0.

    The Loadable Firmware table should be populated.

    There should be no unsavoury comments after the version numbers! Missing Image! The Timestamp & Hash shown from GIT (1st entry) should marry up perfectly with the displayed Operating System Information. All being well the 4th GIT entry should marry up perfectly with the displayed Firmware Information.
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ git log -4
    commit a09289d2670bfdc9240b1cc09e95849d3339a89b (HEAD -> master, tag: zedboard_linux_v16.0, origin/master, origin/HEAD, bitbucket/master)
    Author: Steve Haywood <steve@spacewire.co.uk>
    Date:   Mon Mar 9 05:00:51 2026 +0000

        Basic Zedboard design consisting of a ZYNQ7 Processing System controlling a pair of cascading Test Pattern Generators that output video via HDMI (PetaLinux 2022.2).

    commit 6cb6af817b21f8de6d8edafb9e32595e63dab8df (tag: zedboard_bram_id_v1.0)
    Author: Steve Haywood <steve@spacewire.co.uk>
    Date:   Thu Feb 19 09:37:08 2026 +0000

        Basic Zedboard design consisting of a ZYNQ7 Processing System talking to an AXI4 Block RAM that provides product identification information.

    commit 457a58024d01d397f85e69d95983d7a98a38a1d0 (tag: zedboard_linux_v15.0)
    Author: Steve Haywood <steve@spacewire.co.uk>
    Date:   Mon Dec 22 19:46:13 2025 +0000

        Added ADV7511 configuration auto-start application. This version of PetaLinux includes the XSA from zedboard_video_tpg_hdmi v1.0.

    commit f8b1355c0c8a3afaf8cdf33bbb066363be4409d6 (tag: zedboard_video_tpg_hdmi_v1.0)
    Author: Steve Haywood <steve@spacewire.co.uk>
    Date:   Mon Dec 22 12:22:34 2025 +0000

        Basic Zedboard design consisting of a ZYNQ7 Processing System controlling a pair of cascading Test Pattern Generators that output video via HDMI.
    Looks good!
    #### Part 7 - Final resulting build file(s) ####

    15. Resulting BOOT files

    The resulting BOOT files from the above build can be obtained from here: v16.0 (2022.2).