Bar
SpaceWire UK
Specialist providers of VHDL Intellectual Property & Design Services
BarBarBarBar
Tutorial
Missing Image!
Part 29 - PetaLinux 2023.2 to 2024.2 migration

Introduction

This tutorial details the steps required to migrate the zedboard_linux project from PetaLinux 2023.2 to PetaLinux 2024.2. This migration shall use the same approach as the last one. Create a brand new project from scratch and then integrate the absent & differing sources into it. By using this approach a better understanding of what has actually changed under the hood should be achieved.

There are two ways to proceed with PetaLinux 2024.2, continue with the existing XSCT flow or move to the (now recommended) SDT flow. This migration tutorial will stick with the XSCT flow but the next one will use the SDT flow.

Worth taking a look at the OS support vs. PetaLinux version at this point. The Yes & No refers to what Xilinx officially support. A green marker 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 2021YesNoNoNoNo
Ubuntu 18.04 LTSBionic Beaver26 Apr 201831 May 2023YesYesYesNoNo
Ubuntu 20.04 LTSFocal Fossa23 Apr 202029 May 2025YesYesYesYes (this)No
Ubuntu 22.04 LTSJammy Jellyfish21 Apr 202201 Jun 2027NoNoYesYesYes
Ubuntu 24.04 LTSNoble Numbat25 Apr 202431 May 2029NoNoNoNoNo

Aims

The aims of this tutorial are as follows :-

    Part 1 - Setup environment

    1. Pre-requisites

    Part 2 - Move Zedboard Linux project from 2023.2 to 2024.2

    1. Create PetaLinux project
    2. Add hardware platform
    3. Align PetaLinux - 1
    4. Check GIT status
    5. Align PetaLinux - 2
    6. Bump version

    Part 3 - Build & package PetaLinux

    1. Build PetaLinux
    2. Package PetaLinux

    Part 4 - Hardware Deployment

    1. Copy files to SD-Card
    2. Reload OS into Zedboard PetaLinux v19.0

    Part 5 - Check everything is working as expected

    1. Check BOOT sequence
    2. Check Apache2, PHP & CGI
    3. Check SQLite
    4. Check phpLiteAdmin
    5. Check HDMI
    6. Check Userspace I/O

    Part 8 - Make the changes permanent

    1. Edit the Apache2 configuration
    2. Edit the System webpage to fix the MAC address issue

    Part 9 - Revision Control

    1. Commit new & updated files
    2. Create production release

    Part 10 - Hardware Deployment

    1. Copy BOOT files to the SD-Card
    2. Reload the Operating System using the Webserver

    Part 11 - Check everything is working as expected

    1. Final checks

    Part 12 - 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 2023.2 to 2024.2 ####

    2. Create PetaLinux project

    Create a brand new PetaLinux project using the 2024.2 toolchain (slightly different command options).
    steve@Desktop:~/swuk_tutorial$ cd zedboard_linux/os
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os$ rm -rf petalinux
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os$ petalinux-create project --template zynq --name petalinux
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os$ cd petalinux

    3. Add hardware platform

    Configure the PetaLinux project to use the exported hardware platform from the Zedboard Video TPG HDMI Vivado project.
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ petalinux-config --get-hw-description ~/Documents/swuk_tutorial/hardware/zedboard_video_tpg_hdmi_v1.0.xsa --silentconfig

    4. Align PetaLinux - 1

    Align the brand new PetaLinux (2024.2) project with the existing PetaLinux (2023.2) project.

    Add back in the (now absent) Applications & Apache configuration.
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ git restore project-spec/meta-user/recipes-apps
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ git restore project-spec/meta-user/recipes-httpd/apache2/apache2_%.bbappend

    5. Check GIT status

    Check the GIT status.
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ git status -u
    On branch master
    Your branch is up to date with 'origin/master'.

    Changes not staged for commit:
      (use "git add/rm <file>..." to update what will be committed)
      (use "git restore <file>..." to discard changes in working directory)
       modified:   .gitignore
       modified:   .petalinux/metadata
       modified:   project-spec/configs/.statistics
       modified:   project-spec/configs/busybox/inetd.conf
       modified:   project-spec/configs/config
       modified:   project-spec/configs/configs/Kconfig
       modified:   project-spec/configs/configs/Kconfig.syshw
       deleted:    project-spec/configs/gen-machineconf.log.old
       modified:   project-spec/configs/init-ifupdown/interfaces
       modified:   project-spec/configs/plnx_syshw_data
       deleted:    project-spec/configs/plnxtool.conf
       modified:   project-spec/configs/rootfs_config
       modified:   project-spec/configs/rootfsconfigs/Kconfig
       modified:   project-spec/configs/rootfsconfigs/Kconfig.part
       modified:   project-spec/configs/rootfsconfigs/Kconfig.user
       modified:   project-spec/configs/rootfsconfigs/user-rootfsconfig
       deleted:    project-spec/configs/systemd-conf/wired.network
       deleted:    project-spec/configs/zynq-generic-7z020.conf
       deleted:    project-spec/hw-description/metadata
       modified:   project-spec/meta-user/conf/layer.conf
       modified:   project-spec/meta-user/conf/petalinuxbsp.conf
       modified:   project-spec/meta-user/conf/user-rootfsconfig
       modified:   project-spec/meta-user/recipes-bsp/device-tree/device-tree-sdt.inc
       modified:   project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi

    Untracked files:
      (use "git add <file>..." to include in what will be committed)
       project-spec/configs/.Xil/XSCT-1432425-Desktop/system.bda
       project-spec/configs/.Xil/XSCT-1432489-Desktop/system.bda
       project-spec/configs/configs/Kconfig.autoconfigsettings
       project-spec/configs/configs/Kconfig.bootcompconfigurations
       project-spec/configs/configs/Kconfig.dtgsettings
       project-spec/configs/configs/Kconfig.imagepkgconfigurations
       project-spec/configs/configs/Kconfig.linuxcompselection
       project-spec/configs/configs/Kconfig.main
       project-spec/configs/configs/Kconfig.yoctobuildsettings
       project-spec/configs/configs/Kconfig.yoctomachinesettings

    no changes added to commit (use "git add" and/or "git commit -a")

    6. Align PetaLinux - 2

    Quite a few changes and movements. The files that were previously edited are as follows. These need to be carefully compared with their new counterparts.
    Examine the rootfs_config file.
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ git difftool project-spec/configs/rootfs_config
    The following table shows the file differences (sections of interest).

    HeadingAction changeOriginal 2023.2 rootfs_configNew 2024.2 rootfs_config
    i2c-toolsYes CONFIG_i2c-tools=y
    # CONFIG_i2c-tools-dev is not set
    # CONFIG_i2c-tools-dbg is not set
    # CONFIG_i2c-tools-misc is not set
    # CONFIG_i2c-tools is not set
    # CONFIG_i2c-tools-dev is not set
    # CONFIG_i2c-tools-dbg is not set
    # CONFIG_i2c-tools-misc is not set
    user packagesYes CONFIG_adv7511-config=y
    CONFIG_axi-gpio-zed-test=y
    CONFIG_boot-extras=y
    # CONFIG_gpio-demo is not set
    CONFIG_led-runner=y
    CONFIG_peekpoke=y
    CONFIG_peekpokecgi=y
    CONFIG_website=y



    # CONFIG_gpio-demo is not set

    # CONFIG_peekpoke is not set


    PetaLinux RootFS SettingsNo CONFIG_ADD_EXTRA_USERS="root:root;petalinux:petalinux;"
    CONFIG_CREATE_NEW_GROUPS="aie;"
    CONFIG_ADD_USERS_TO_GROUPS="petalinux:audio,video,aie,input,disk;"
    CONFIG_ADD_USERS_TO_SUDOERS="petalinux"
    CONFIG_ADD_EXTRA_USERS="root:root;petalinux::passwd-expire;"
    CONFIG_CREATE_NEW_GROUPS="aie;"
    CONFIG_ADD_USERS_TO_GROUPS="petalinux:audio,video,aie,input;"
    CONFIG_ADD_USERS_TO_SUDOERS="petalinux"


    For now just restore the 3 sections marked with Yes. Use Beyond Compare (or equivalent) to update the new file & save the changes.
    Examine the petalinuxbsp.conf file.
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ git difftool project-spec/meta-user/conf/petalinuxbsp.conf
    The following table shows the file differences.

    Action changeOriginal 2023.2 petalinuxbsp.confNew 2024.2 petalinuxbsp.conf
    Yes
    #
    # File .......... petalinuxbsp.conf
    # Author ........ Steve Haywood
    # Website ....... http://www.spacewire.co.uk
    # Project ....... Zedboard Linux (SpaceWire UK Tutorial)
    # Date .......... 28 Feb 2026
    # Version ....... 3.0
    # Description ...
    #   Updated to install the following :-
    # -- ntp ....... Network Time Protocol
    # -- ntpdate ... Set the date and time via NTP
    # -- ntpq ...... Standard NTP query program
    # -- sntp ...... Simple Network Time Protocol
    # -- nano ...... Text editor
    # Updated to install a LAMP style stack :-
    # -- Apache .... HTTP server
    # -- SQLite .... SQL database engine
    # -- PHP ....... Scripting language
    #
    
    #User Configuration
    
    #OE_TERMINAL = "tmux"
    
    IMAGE_INSTALL:append = " ntp ntpdate ntpq sntp nano"
    PACKAGECONFIG:append:pn-php = " apache2"
    IMAGE_INSTALL:append = " apache2 sqlite3 php-modphp"
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    #User Configuration
    
    #OE_TERMINAL = "tmux"
    
    
    
    
    


    Restore the entire file.
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ git restore project-spec/meta-user/conf/petalinuxbsp.conf

    Examine the user-rootfsconfig file.
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ git difftool project-spec/meta-user/conf/user-rootfsconfig
    The following table shows the file differences.

    Action changeOriginal 2023.2 fileNew 2024.2 file
    Yes
    #Note: Mention Each package in individual line
    #These packages will get added into rootfs menu entry
    
    CONFIG_gpio-demo
    CONFIG_peekpoke
    CONFIG_led-runner
    CONFIG_website
    CONFIG_peekpokecgi
    CONFIG_axi-gpio-zed-test
    CONFIG_adv7511-config
    CONFIG_boot-extras
    
    #Note: Mention Each package in individual line
    #These packages will get added into rootfs menu entry
    
    CONFIG_gpio-demo
    CONFIG_peekpoke
    
    
    
    
    
    
    


    File does not contain the entries for the user applications. Restore the entire file.
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ git restore project-spec/meta-user/conf/user-rootfsconfig

    Examine the system-user.dtsi file.

    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ git difftool project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi
    The following table shows the file differences.

    Action changeOriginal 2023.2 fileNew 2024.2 file
    Yes
    /*
     * File .......... system-user.dtsi
     * Author ........ Steve Haywood
     * Website ....... http://www.spacewire.co.uk
     * Project ....... Zedboard Linux (SpaceWire UK Tutorial)
     * Date .......... 29 Oct 2022
     * Version ....... 2.0
     * History .......
     *   1.0 TEMPLATE
     * Description ...
     *   Added User Space I/O (UIO) for the AXI GPIO Zed module.
     */
    
    /include/ "system-conf.dtsi"
    
    / {
        chosen
        {
          bootargs = "uio_pdrv_genirq.of_id=generic-uio";
        };
    };
    
    &axi_gpio_zed_0
    {
      #interrupt-cells = <2>;
      interrupt-controller;
      interrupts = <0 29 1>;
      compatible = "generic-uio";
    };
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    /include/ "system-conf.dtsi"
    
    / {
    
    
    
    
    };
    
    
    
    
    
    
    
    
    


    Template file. Obviously missing the entries previous added. Restore the entire file.
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ git restore project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi

    7. 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/zedboard_linux/os/petalinux$ cd ../../..
    steve@Desktop:~/swuk_tutorial$ sed -i 's/18.0/19.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
    19.0
    
    Direct download available here :-
    steve@Desktop:~/swuk_tutorial$ wget https://spacewire.co.uk/tutorial/shared/repos/0036/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
    #### Part 3 - Build & package PetaLinux ####

    8. Build PetaLinux

    Attempt to build the new 2024.2 PetaLinux project.
    steve@Desktop:~/swuk_tutorial$ cd zedboard_linux/os/petalinux
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ swuk_petalinux-build
    1st warning encountered :-
    WARNING: XSCT has been deprecated. It will still be available for several releases. In the future, it's recommended to start new projects with SDT workflow.
    1st error encountered :-
    NOTE: Resolving any missing task queue dependencies
    ERROR: Nothing RPROVIDES 'ntpdate' (but ~/swuk_tutorial/zedboard_linux/os/petalinux/components/yocto/layers/meta-petalinux/recipes-core/images/petalinux-image-minimal.bb RDEPENDS on or otherwise requires it)
    NOTE: Runtime target 'ntpdate' is unbuildable, removing...
    Missing or unbuildable dependency chain was: ['ntpdate']
    NOTE: Runtime target 'kernel-modules' is unbuildable, removing...
    Missing or unbuildable dependency chain was: ['kernel-modules', 'petalinux-image-minimal', 'ntpdate']
    ERROR: Required build target 'petalinux-image-minimal' has no buildable providers.
    Missing or unbuildable dependency chain was: ['petalinux-image-minimal', 'ntpdate']


    Summary: There was 1 WARNING message.
    Summary: There were 2 ERROR messages, returning a non-zero exit code.
    [ERROR] Command bitbake petalinux-image-minimal failed
    Remove the ntpdate entry from petalinuxbsp.conf
    steve@Desktop:~/swuk_tutorial$ subl zedboard_linux/os/petalinux/project-spec/meta-user/conf/petalinuxbsp.conf

    petalinuxbsp.conf

    #
    # File .......... petalinuxbsp.conf
    # Author ........ Steve Haywood
    # Website ....... http://www.spacewire.co.uk
    # Project ....... Zedboard Linux (SpaceWire UK Tutorial)
    # Date .......... 16 Mar 2026
    # Version ....... 4.0
    # Description ...
    #   Updated to install the following :-
    # -- ntp ....... Network Time Protocol
    # -- ntpq ...... Standard NTP query program
    # -- sntp ...... Simple Network Time Protocol
    # -- nano ...... Text editor
    # Updated to install a LAMP style stack :-
    # -- Apache .... HTTP server
    # -- SQLite .... SQL database engine
    # -- PHP ....... Scripting language
    #
    
    #User Configuration
    
    #OE_TERMINAL = "tmux"
    
    IMAGE_INSTALL:append = " ntp ntpq sntp nano"
    PACKAGECONFIG:append:pn-php = " apache2"
    IMAGE_INSTALL:append = " apache2 sqlite3 php-modphp"
    
    Direct download available here :-
    steve@Desktop:~/swuk_tutorial$ wget https://spacewire.co.uk/tutorial/shared/repos/0036/zedboard_linux/os/petalinux/project-spec/meta-user/conf/petalinuxbsp.conf -O zedboard_linux/os/petalinux/project-spec/meta-user/conf/petalinuxbsp.conf
    Check out the changes.
    steve@Desktop:~/swuk_tutorial$ git difftool zedboard_linux/os/petalinux/project-spec/meta-user/conf/petalinuxbsp.conf
    Restart the build.
    steve@Desktop:~/swuk_tutorial$ cd zedboard_linux/os/petalinux
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ swuk_petalinux-build
    2nd error encountered :-
    NOTE: Tasks Summary: Attempted 8714 tasks of which 6150 didn't need to be rerun and all succeeded.

    Summary: There were 8 WARNING messages.
    Summary: There were 3 ERROR messages, returning a non-zero exit code.
    [ERROR] Command bitbake petalinux-image-minimal failed
    Scrolling back up the Terminal shows the errors are caused by Fetcher failure's.

    Simply restart the build at this stage.
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ swuk_petalinux-build
    All good!

    9. Package PetaLinux

    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
    #### Part 4 - Hardware Deployment ####

    10. Copy files to SD-Card

    Upload the newly created PetaLinux Boot & OS files.
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ swuk_ssh 192.168.2.87
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ sshpass -p petalinux ssh -t petalinux@192.168.2.87 "mkdir /media/sd-mmcblk0p1/petalinux/v19.0"
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ sshpass -p petalinux scp /tftpboot/{BOOT.BIN,boot.scr,image.ub} petalinux@192.168.2.87:/media/sd-mmcblk0p1/petalinux/v19.0

    11. Reload OS into Zedboard PetaLinux v19.0

    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. Do a "Shift-Refresh" (Hard Reset) to clear the cache & reload the page (use Shift + Reload Button or Ctrl + Shift + R).

    Select v19.0 from the Reload Operating System drop-down in an attempt to change the Operating System in use from the current v18.0 to the newly created v19.0. Missing Image!
    #### Part 5 - Check everything is working as expected ####

    12. Check BOOT sequence

    Use the Debug terminal to monitor the boot sequence. All being well it should result in the PetaLinux 2024.2 release tag followed by a login prompt.
    ::
    ::
    PetaLinux 2024.2+release-S11061705 petalinux ttyPS0

    petalinux login:
    Looks good!

    13. Check Apache2, PHP & CGI

    After the Operating System reload sequence has finished the System Information & Operating System / Firmware Load page should be reloaded. This page in itself checks the following three points :-
    1. The Apache2 server is up and running.
    2. The PHP interpreter is working.
    3. The CGI binaries are operating as expected.
    Take a look :- Missing Image! The Apache2 webserver is up & running and the PHP interpreter is working fine but it would appear Apache2 is serving up the peekstring binary instead of executing it and serving up the result!

    Scroll down on the System webpage and click on Refresh in the System table. Missing Image! Expected result! Looks like Apache2 is not executing anything CGI related.

    Also, the MAC address has dissapeared from the Network table.

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

    Check for the executable attribute on the peekstring CGI.
    petalinux:~$ ls -la /srv/www/cgi-bin/peekstring
    -rwxr-xr-x    1 root     root          5512 Mar  9  2018 /srv/www/cgi-bin/peekstring
    Looks good!

    Examine the Apache2 error log.
    petalinux:~$ cat /tmp/apache2_error_log
    [Fri Mar 09 12:35:13.734461 2018] [unixd:alert] [pid 611:tid 611] AH02155: getpwuid: couldn't determine user name from uid -1, you probably need to modify the User directive
    [Fri Mar 09 12:35:13.738481 2018] [unixd:alert] [pid 612:tid 612] AH02155: getpwuid: couldn't determine user name from uid -1, you probably need to modify the User directive
    [Fri Mar 09 12:35:13.741911 2018] [mpm_prefork:notice] [pid 604:tid 604] AH00163: Apache/2.4.62 (Unix) PHP/8.2.20 configured -- resuming normal operations
    [Fri Mar 09 12:35:13.742316 2018] [core:notice] [pid 604:tid 604] AH00094: Command line: '/usr/sbin/httpd'
    [Fri Mar 09 12:35:13.747078 2018] [unixd:alert] [pid 613:tid 613] AH02155: getpwuid: couldn't determine user name from uid -1, you probably need to modify the User directive
    [Fri Mar 09 12:35:13.748607 2018] [unixd:alert] [pid 614:tid 614] AH02155: getpwuid: couldn't determine user name from uid -1, you probably need to modify the User directive
    [Fri Mar 09 12:35:13.754288 2018] [unixd:alert] [pid 615:tid 615] AH02155: getpwuid: couldn't determine user name from uid -1, you probably need to modify the User directive
    cat: can't open '/sys/class/net/eth0/address': No such file or directory
    [Fri Mar 09 12:35:14.755520 2018] [unixd:alert] [pid 649:tid 649] AH02155: getpwuid: couldn't determine user name from uid -1, you probably need to modify the User directive
    [Fri Mar 09 12:35:15.758246 2018] [unixd:alert] [pid 681:tid 681] AH02155: getpwuid: couldn't determine user name from uid -1, you probably need to modify the User directive
    [Fri Mar 09 12:35:15.761482 2018] [unixd:alert] [pid 682:tid 682] AH02155: getpwuid: couldn't determine user name from uid -1, you probably need to modify the User directive
    [Fri Mar 09 12:35:16.764407 2018] [unixd:alert] [pid 683:tid 683] AH02155: getpwuid: couldn't determine user name from uid -1, you probably need to modify the User directive
    [Fri Mar 09 12:35:16.770937 2018] [unixd:alert] [pid 684:tid 684] AH02155: getpwuid: couldn't determine user name from uid -1, you probably need to modify the User directive
    [Fri Mar 09 12:35:16.775268 2018] [unixd:alert] [pid 685:tid 685] AH02155: getpwuid: couldn't determine user name from uid -1, you probably need to modify the User directive
    [Fri Mar 09 12:35:16.778756 2018] [unixd:alert] [pid 686:tid 686] AH02155: getpwuid: couldn't determine user name from uid -1, you probably need to modify the User directive
    Looks OK! Nothing related to the CGI issues.

    Examining the Apache2 configuration file.
    petalinux:~$ grep -i cgi /etc/apache2/httpd.conf
    #LoadModule proxy_fcgi_module /usr/libexec/apache2/modules/mod_proxy_fcgi.so
    #LoadModule proxy_scgi_module /usr/libexec/apache2/modules/mod_proxy_scgi.so
    #LoadModule cgi_module /usr/libexec/apache2/modules/mod_cgi.so
        #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
        ScriptAlias /cgi-bin/ "/srv/www/cgi-bin/"

        # socket used to communicate with the CGI daemon of mod_cgid.
        Scriptsock /var/run/cgid.sock
    # "/usr/libexec/apache2/modules/cgi-bin" should be changed to whatever your ScriptAliased
    # CGI directory exists, if you have that configured.

        # Avoid passing HTTP_PROXY environment to CGI's on this or any proxied
        # To use CGI scripts outside of ScriptAliased directories:
        # (You will also need to add "ExecCGI" to the "Options" directive.)
        #AddHandler cgi-script .cgi
    #ErrorDocument 404 "/cgi-bin/missing_handler.pl"
    The cgi_module entry is commented out! Uncomment the cgi_module entry and reload Apache2. The previous entry for this in httpd.conf used the mod_cgid.so module, hence the sed command in apache2_%.bbappend didn't perform the uncomment correctly.
    petalinux:~$ sudo sed -i 's/#LoadModule cgi_module/LoadModule cgi_module/' /etc/apache2/httpd.conf
    petalinux:~$ sudo /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! All good! The Firmware Information table updated successfully.

    Check the interface for the MAC address issue.
    petalinux:~$ ls -la /sys/class/net
    drwxr-xr-x    2 root     root             0 Jan  1  1970 .
    drwxr-xr-x   49 root     root             0 Jan  1  1970 ..
    lrwxrwxrwx    1 root     root             0 Mar 20 18:28 enx000a35001e53 -> ../../devices/soc0/axi/e000b000.ethernet/net/enx000a35001e53
    lrwxrwxrwx    1 root     root             0 Jan  1  1970 lo -> ../../devices/virtual/net/lo
    lrwxrwxrwx    1 root     root             0 Jan  1  1970 sit0 -> ../../devices/virtual/net/sit0
    Looks like the name has changed from eth0 to enx000a35001e53, lets extract the MAC address a little more cleanly.
    petalinux:~$ cat /sys/class/net/$(ip route show default | awk '/default/ {print $5}')/address
    00:0a:35:00:1e:53

    14. Check SQLite

    Select SQLite Basic Test from the Misc menu to see if the SQLite service is working. Missing Image! All good! The SQLite service is up & running and the test.db database held in the database directory on the SD-Card has been read successfully.

    15. Check phpLiteAdmin

    Select PHP Lite Admin from the Misc menu to see if the phpLiteAdmin webpage is being served. Missing Image! Looking good! Login with the default password admin. Missing Image! All good! The phpLiteAdmin webpage is being served and shows the test.db database held in the database directory on the SD-Card.

    16. Check HDMI

    Check the HDMI video output is still working OK. For this the adv7511-config auto-start application must have fired and configuration via the CGI peek & poke binaries must work.

    Select Peek & Poke from the menu bar.

    Select zedboard_video_tpg_hdmi from the Configuration drop-down in an attempt to load the configuration file from the SD-Card.

    Click on Poke All to setup the Zedboard Video TPG HDMI registers to output video via HDMI.



    All being well the monitor should fire into life with the test pattern :-



    All good!

    17. Check Userspace I/O

    Check to see if the Userspace I/O driver is still operational by running the previously created axi-gpio-zed-test application from within the Debug terminal.
    petalinux:~$ sudo axi-gpio-zed-test
    All being well the application should run and display the following :-
    Simple User Space device driver example with interrupts

    Device in use ... /dev/uio0
    Memory size ..... 65536 (obtained from /sys/class/uio/uio0/maps/map0/size)

    Use the buttons to control the LED's :-

    Centre - Reset LED's to 00111100
    Left   - Rotate LED's left
    Right  - Rotate LED's right
    Up     - Increase illuminated LED's
    Down   - Decrease illuminated LED's

    Press Ctrl-C to quit application
    Pressing a Push Button should perform the action stated and display the GPIO3 data register, for example :-
    Interrupt detected, button register = 0x00000001
    Interrupt detected, button register = 0x00000004
    All good!
    #### Part 8 - Make the changes permanent ####

    18. Edit the Apache2 configuration

    To make the changes from above permanent, the following edits need to be made to the apache2_%.bbappend BitBake recipe :-
    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 .......... 16 Mar 2026
    # Version ....... 4.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 cgi_module /usr/libexec/apache2/modules/mod_cgi.so@LoadModule cgi_module /usr/libexec/apache2/modules/mod_cgi.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/0036/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

    19. Edit the System webpage to fix the MAC address issue

    To make the changes from above permanent, the following edits need to be made to the System index.php :-
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ cd ../../..
    steve@Desktop:~/swuk_tutorial$ subl zedboard_linux/os/petalinux/project-spec/meta-user/recipes-apps/website/files/system/index.php

    index.php

    <?php
    //
    // File .......... index.php
    // Author ........ Steve Haywood
    // Website ....... http://www.spacewire.co.uk
    // Project ....... Zedboard Linux (SpaceWire UK Tutorial)
    // Date .......... 16 Mar 2026
    // Version ....... 12.0
    // History .......
    //   9.0 zedboard_linux/os/petalinux/project-spec/meta-user/recipes-apps/website/files/cgi-bin/index.php
    //   7.0 zedboard_linux/os/petalinux/project-spec/meta-user/recipes-apps/website/files/cgi-bin/index.cgi
    // Description ...
    //   Webpage for System Information & Operating System / Firmware Load.
    //
    ?>
    
    <?php
    // Get information
    $sys_host = exec('hostname', $retval);
    $sys_time = exec('date', $retval);
    $sys_load = exec('awk \'{print $1}\' /proc/loadavg', $retval);
    $sys_up = exec('awk \'{print $1}\' /proc/uptime', $retval);
    $cpu_model = exec('grep model /proc/cpuinfo | cut -d : -f2 | tail -1 | sed \'s/\s//\'', $retval);
    $cpu_cores = exec('grep -c ^processor /proc/cpuinfo', $retval);
    $mem_total = (int)((int)exec('free | awk \'NR==2{print $2}\'', $retval) / 1024);
    $mem_used = (int)((int)exec('free | awk \'NR==2{print $3}\'', $retval) / 1024);
    $mem_free = (int)((int)exec('free | awk \'NR==2{print $4}\'', $retval) / 1024);
    $net_mac = exec("cat /sys/class/net/$(ip route show default | awk '/default/ {print $5}')/address", $retval);
    $net_ip_loc = exec('ip a | grep inet | grep -vw lo | grep -v inet6 | cut -d \/ -f1 | sed \'s/[^0-9\.]*//g\'', $retval);
    $net_ip_ext = exec('wget -q -O- http://ipecho.net/plain', $retval);
    ?>
    
    <?php require '../share/header.php'; ?>
    
    <div class=content>
    
    <div class=inner>
    <?php
    $tables = array("Operating System", "Firmware");
    $id = array("os", "fw");
    $fields = array("Description", "Company", "Author", "Version", "Timestamp", "Hash");
    for ($table = 0 ; $table < count($tables) ; $table++) {
    echo "
    <table>
    <tr>
    <th colspan=2>$tables[$table] Information</th><th><button id=$id[$table]_read>Read</button></th>
    </tr>
    ";
    for ($field = 0 ; $field < count($fields) ; $field++) {
    echo "
    <tr>
    <td style='text-align:right'>$fields[$field]</td>
    <td style='text-align:left' id=$id[$table]_id_$field>Unknown</td>
    <td><img id=$id[$table]_id_status_$field style='vertical-align:middle' src='../share/amber.gif' title='Unknown!' alt='Missing Image!'></td>
    </tr>
    ";
    }
    echo "
    </table>
    ";
    }
    ?>
    </div>
    
    <div class=inner>
    <?php
    for ($table = 0 ; $table < count($tables) ; $table++) {
    $colspan = ($table == 0) ? 6 : 5;
    echo "
    <table>
    <tr><th colspan=$colspan>Reload $tables[$table]</th></tr>
    <tr>
    <td style='text-align:right'>Select</td>
    <td style='text-align:left'>
    <select id=$id[$table]_select>
    <option value=none>N/A</option>
    ";
    $location = ($table == 0) ? '/media/sd-mmcblk0p1/petalinux/*' : '/media/sd-mmcblk0p1/firmware/*.bin';
    foreach(glob("$location") as $file) {
      if (($table == 0) ? is_dir($file) : is_file($file)) {
        $basename = pathinfo($file)["basename"];
        $filename = ($table == 0) ? $basename : pathinfo($file)["filename"];
        echo "<option value=$basename>$filename</option>";
      }
    }
    $count = ($table == 0) ? "<td id=$id[$table]_count>0/120s</td>" : "";
    echo "
    </select>
    <td id=$id[$table]_action>Idle</td>
    </td><td><progress id=$id[$table]_progress value=0 max=120></progress></td>
    $count
    <td><img id=$id[$table]_status style='vertical-align:middle' src='../share/amber.gif' title='Unknown!' alt='Missing Image!'></td>
    </tr>
    </table>
    ";
    }
    ?>
    </div>
    
    <div class=inner>
    
    <table>
    <tr><th colspan=2>System</th></tr>
    <tr><td style='text-align:right'>Hostname</td>
    <td style='text-align:left'><?php echo $sys_host ?></td>
    </tr><tr><td style='text-align:right'>Time</td><td style='text-align:left'><?php echo $sys_time ?></td></tr>
    <tr><td style='text-align:right'>Uptime</td><td style='text-align:left'><span id=ut_text><?php echo $sys_up ?></span> seconds <button id=ut_refresh>Refresh</button> Auto :
    <select id=ut_select>
      <option value=0>Off</option>
      <option value=1>1s</option>
      <option value=5>5s</option>
    </select>
    </td></tr>
    </table>
    
    <table>
    <tr><th colspan=2>CPU</th></tr>
    <tr><td style='text-align:right'>Model</td>
    <td style='text-align:left'><?php echo $cpu_model ?></td></tr>
    <tr><td style='text-align:right'>Cores</td><td style='text-align:left'><?php echo $cpu_cores ?></td></tr>
    <tr><td style='text-align:right'>Load</td><td style='text-align:left'><?php echo $sys_load ?></td></tr>
    </table>
    
    <table>
    <tr><th colspan=2>Memory</th></tr>
    <tr><td style='text-align:right'>Total</td><td style='text-align:right'><?php echo $mem_total ?> Mb</td></tr>
    <tr><td style='text-align:right'>Used</td><td style='text-align:right'><?php echo $mem_used ?> Mb</td></tr>
    <tr><td style='text-align:right'>Free</td><td style='text-align:right'><?php echo $mem_free ?> Mb</td></tr>
    </table>
    
    <table>
    <tr><th colspan=2>Network</th></tr>
    <tr><td style='text-align:right'>MAC Address</td><td style='text-align:left'><?php echo $net_mac ?></td></tr>
    <tr><td style='text-align:right'>Internal IP</td><td style='text-align:left'><?php echo $net_ip_loc ?></td></tr>
    <tr><td style='text-align:right'>External IP</td><td style='text-align:left'><?php echo $net_ip_ext ?></td></tr>
    </table>
    
    </div>
    
    </div>
    
    <?php require '../share/footer.php'; ?>
    
    Direct download available here :-
    steve@Desktop:~/swuk_tutorial$ wget https://spacewire.co.uk/tutorial/shared/repos/0036/zedboard_linux/os/petalinux/project-spec/meta-user/recipes-apps/website/files/system/index.php.txt -O zedboard_linux/os/petalinux/project-spec/meta-user/recipes-apps/website/files/system/index.php
    Check out the changes.
    steve@Desktop:~/swuk_tutorial$ git difftool zedboard_linux/os/petalinux/project-spec/meta-user/recipes-apps/website/files/system/index.php
    #### Part 9 - Revision Control ####

    20. 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/rm <file>..." to update what will be committed)
      (use "git restore <file>..." to discard changes in working directory)
       modified:   zedboard_linux/os/petalinux/.gitignore
       modified:   zedboard_linux/os/petalinux/.petalinux/metadata
       modified:   zedboard_linux/os/petalinux/project-spec/configs/.statistics
       modified:   zedboard_linux/os/petalinux/project-spec/configs/busybox/inetd.conf
       modified:   zedboard_linux/os/petalinux/project-spec/configs/config
       modified:   zedboard_linux/os/petalinux/project-spec/configs/configs/Kconfig
       modified:   zedboard_linux/os/petalinux/project-spec/configs/configs/Kconfig.syshw
       modified:   zedboard_linux/os/petalinux/project-spec/configs/gen-machineconf.log.old
       modified:   zedboard_linux/os/petalinux/project-spec/configs/init-ifupdown/interfaces
       modified:   zedboard_linux/os/petalinux/project-spec/configs/plnx_syshw_data
       deleted:    zedboard_linux/os/petalinux/project-spec/configs/plnxtool.conf
       modified:   zedboard_linux/os/petalinux/project-spec/configs/rootfs_config
       modified:   zedboard_linux/os/petalinux/project-spec/configs/rootfsconfigs/Kconfig
       modified:   zedboard_linux/os/petalinux/project-spec/configs/rootfsconfigs/Kconfig.part
       deleted:    zedboard_linux/os/petalinux/project-spec/configs/systemd-conf/wired.network
       deleted:    zedboard_linux/os/petalinux/project-spec/configs/zynq-generic-7z020.conf
       deleted:    zedboard_linux/os/petalinux/project-spec/hw-description/metadata
       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/recipes-apps/website/files/project.txt
       modified:   zedboard_linux/os/petalinux/project-spec/meta-user/recipes-apps/website/files/system/index.php
       modified:   zedboard_linux/os/petalinux/project-spec/meta-user/recipes-bsp/device-tree/device-tree-sdt.inc
       modified:   zedboard_linux/os/petalinux/project-spec/meta-user/recipes-httpd/apache2/apache2_%.bbappend

    Untracked files:
      (use "git add <file>..." to include in what will be committed)
       zedboard_linux/os/petalinux/project-spec/configs/.Xil/XSCT-2357117-Desktop/system.bda
       zedboard_linux/os/petalinux/project-spec/configs/.Xil/XSCT-2357182-Desktop/system.bda
       zedboard_linux/os/petalinux/project-spec/configs/configs/Kconfig.autoconfigsettings
       zedboard_linux/os/petalinux/project-spec/configs/configs/Kconfig.bootcompconfigurations
       zedboard_linux/os/petalinux/project-spec/configs/configs/Kconfig.dtgsettings
       zedboard_linux/os/petalinux/project-spec/configs/configs/Kconfig.imagepkgconfigurations
       zedboard_linux/os/petalinux/project-spec/configs/configs/Kconfig.linuxcompselection
       zedboard_linux/os/petalinux/project-spec/configs/configs/Kconfig.main
       zedboard_linux/os/petalinux/project-spec/configs/configs/Kconfig.yoctobuildsettings
       zedboard_linux/os/petalinux/project-spec/configs/configs/Kconfig.yoctomachinesettings

    no changes added to commit (use "git add" and/or "git commit -a")
    Almost looks good! The Xilinx tools have spewed up yet again, hence remove the rubbish directory.
    steve@Desktop:~/swuk_tutorial$ rm -rf zedboard_linux/os/petalinux/project-spec/configs/.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 2024.2)."
    steve@Desktop:~/swuk_tutorial$ git push
    steve@Desktop:~/swuk_tutorial$ git tag -a my_zedboard_linux_v19.0 -m "ZYNQ & Cascading TPG's with HDMI output (PetaLinux 2024.2)"
    steve@Desktop:~/swuk_tutorial$ git push origin my_zedboard_linux_v19.0

    21. Create production release

    Create a potential production release for the PetaLinux (19.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 -u
    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.

    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/v19.0
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ cp /tftpboot/{BOOT.BIN,boot.scr,image.ub} ~/Documents/swuk_tutorial/petalinux/v19.0
    #### Part 10 - Hardware Deployment ####

    22. Copy BOOT files to the SD-Card

    Upload the newly created PetaLinux Boot & OS files to the SD-Card.
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ swuk_ssh 192.168.2.87
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ sshpass -p petalinux scp -r ~/Documents/swuk_tutorial/petalinux/v19.0 petalinux@192.168.2.87:/media/sd-mmcblk0p1/petalinux

    23. Reload the Operating System using the Webserver

    Refresh the System page. Do a "Shift-Refresh" (Hard Reset) to clear the cache & reload the page (use Shift + Reload Button or Ctrl + Shift + R).

    Select v19.0 from the drop-down menu in the Reload Operating System section. Missing Image! After the reload sequence has finished...
    #### Part 11 - Check everything is working as expected ####

    24. Final checks

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

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

    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.
    steve@Desktop:~/swuk_tutorial/zedboard_linux/os/petalinux$ git log -1
    commit 08ed9aa3d3778dec34ff43748a70889d52723696 (HEAD -> master, tag: zedboard_linux_v19.0, origin/master, origin/HEAD)
    Author: Steve Haywood <steve@spacewire.co.uk>
    Date:   Mon Mar 23 07:29:07 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 2024.2).
    Looks good!
    #### Part 12 - Final resulting build file(s) ####

    25. Resulting BOOT files

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