APU Component Development

This section describes how to build individual APU software components without building the complete Yocto image every time.

The procedures in this section assume that the target is running a development image. Build the image with kas/conf/development.yml to enable root login and passwordless file transfer for development.

$ uv run kas build --force-checkout kas/scobc-v1.yml:kas/conf/development.yml

Create the Yocto SDK

Build and install the Yocto SDK before building individual components such as the Linux kernel, U-Boot, or applications outside the full Yocto build.

$ uv run kas build --force-checkout kas/scobc-v1.yml -c populate_sdk
$ ./build/tmp/deploy/sdk/petalinux-glibc-x86_64-sc-image-minimal-cortexa72-cortexa53-versal-scobc-v1-ve2302i-sdt-full-toolchain-2025.2.sh
$ source /opt/petalinux/2025.2/environment-setup-cortexa72-cortexa53-amd-linux

The generated SDK installer is placed under build/tmp/deploy/sdk/. When the installer is executed, it installs the SDK to /opt/petalinux/ by default.

After installation, source the environment-setup-* script from the installed SDK. This configures the environment variables required for cross-compilation, including compiler variables such as CC, build flags such as CFLAGS, and target architecture settings.

Kernel

This section shows how to build the Linux kernel from the linux-xlnx repository by using the Yocto SDK environment.

Before running the kernel build commands, source the SDK environment setup script as described in Create the Yocto SDK.

Build

Set the linux-xlnx base revision used by the Yocto release.

$ export LINUX_XLNX_BASE_REV=31626ef92ff11f9d3dee01926720572666fcc65a

For v2025.2, use commit 31626ef92ff11f9d3dee01926720572666fcc65a.

Clone linux-xlnx and check out the revision used by the Yocto release.

$ git clone https://github.com/Xilinx/linux-xlnx.git
$ cd linux-xlnx
$ git checkout "$LINUX_XLNX_BASE_REV"
$ git switch -c work/kernel-sample

Create a patch from the Yocto-patched kernel source tree.

$ cd /path/to/meta-scobc/build/tmp/work-shared/versal-scobc-v1-ve2002e-sdt-full/kernel-source
$ git diff --binary "$LINUX_XLNX_BASE_REV" -- > /tmp/linux-xlnx-yocto.patch

Apply the generated patch to the external kernel source tree.

$ cd /path/to/linux-xlnx
$ git apply --check /tmp/linux-xlnx-yocto.patch
$ git apply --index /tmp/linux-xlnx-yocto.patch
$ git commit -m "Apply Yocto kernel patch set"

Prepare an output directory and copy the Yocto-generated kernel configuration.

$ export OUT=<path-to-out>
$ mkdir -p "$OUT"
$ cp /path/to/meta-scobc/build/tmp/work/versal_scobc_v1_ve2302i_sdt_full-amd-linux/linux-xlnx/6.12.40+git+v2025.2/defconfig $OUT/.config

To change the kernel release string, set LOCALVERSION in .config before running olddefconfig. For example:

$ scripts/config --file "$OUT/.config" --set-str LOCALVERSION "-manual"

Update the kernel configuration.

$ make O="$OUT" olddefconfig

Build the kernel image and kernel modules.

$ make O="$OUT" -j"$(nproc)" Image modules

Install the kernel modules into a staging directory.

$ export KREL=$(make -s --no-print-directory O="$OUT" kernelrelease)
$ make O="$OUT" INSTALL_MOD_PATH="$OUT/modinst" modules_install

KREL is the kernel release string used for the module directory under /lib/modules/$KREL. The installed modules are staged under $OUT/modinst/lib/modules/$KREL/.

Apply to the Target

U-Boot loads the kernel image from /boot/Image. Replace this file and install the matching kernel modules to apply the locally built kernel to the target.

Set the target SSH destination on the build host.

$ export TARGET=root@<target-ip>

Copy the new kernel image to the boot partition and replace the active image. The existing image is kept as Image.prev.

$ scp "$OUT/arch/arm64/boot/Image" "$TARGET:/boot/Image.new"
$ ssh "$TARGET" '
    set -e
    cd /boot
    cp -a Image Image.prev
    mv Image.new Image
    sync
'

Install the matching kernel modules from the staging directory.

$ rsync -a --delete \
    "$OUT/modinst/lib/modules/$KREL/" \
    "$TARGET:/lib/modules/$KREL/"

Update the module dependency files on the target.

$ ssh "$TARGET" "depmod -a '$KREL'; sync"

Reboot the target.

$ ssh "$TARGET" reboot

After rebooting, confirm that the running kernel release matches the built kernel.

$ ssh "$TARGET" uname -r