desc: "Raspberry 5 with xen dom0less" min_ver: "0.24" variables: # Common build configuration YOCTOS_WORK_DIR: "yocto" DOM0_OS: "zephyr" # Raspberry 5 build configuration ZEPHYR_DOM0_DIR: "zephyr" ZEPHYR_DOM0_MACHINE: "rpi_5" ZEPHYR_DOM0_TARGET: "zephyr-dom0-xt" ZEPHYR_DOM0_BUILD_DIR: "build-dom0" ZEPHYR_DOMU1_DIR: "zephyr_sync" ZEPHYR_DOMU1_BUILD_DIR: "build-sync" ZEPHYR_DOMU2_DIR: "zephyr_blinky" ZEPHYR_DOMU2_BUILD_DIR: "build-blinky" DOMD_BUILD_DIR: "build-domd" DOMU_BUILD_DIR: "build-domu" XT_XEN_DTBO_NAME: "%{SOC_FAMILY}-%{MACHINE}-xen.dtbo" XT_DOMD_DTB_NAME: "%{SOC_FAMILY}-%{MACHINE}-domd.dtb" XT_DOMD_IMAGE: "rpi5-image-xt-domd" XT_DOMU_IMAGE: "core-image-thin-initramfs" DOMU_MACHINE: "generic-armv8-xt" common_data: common_yocto_sources: &COMMON_YOCTO_SOURCES - type: git url: "https://git.yoctoproject.org/poky" rev: "83793ccd865e3e72563e6d5733b6bd02943feb8a" - type: git url: "https://git.openembedded.org/meta-openembedded" rev: "4a7bb77f7ebe0ac8be5bab5103d8bd993e17e18d" - type: git url: "https://github.com/xen-troops/meta-xt-common.git" rev: "09d7a4c5fd4ebff2f78129f6798af1f4d699b26d" - type: git url: "https://git.yoctoproject.org/meta-virtualization" rev: "37c06acf58f9020bccfc61954eeefe160642d5f3" - type: git url: "https://git.yoctoproject.org/meta-selinux" rev: "07f3233374f013412d691732adfa2c20167a0ea0" - type: git url: "https://github.com/xen-troops/meta-xt-prod-devel-rpi5.git" rev: "b963ceff58543690f79962a20528053a090ab9a4" common_yocto_layers: &COMMON_YOCTO_LAYERS - "../meta-openembedded/meta-oe" - "../meta-openembedded/meta-python" - "../meta-openembedded/meta-networking" - "../meta-openembedded/meta-filesystems" - "../meta-xt-common/meta-xt-domx" - "../meta-selinux" - "../meta-virtualization" components: dom0: default: true build-dir: "%{ZEPHYR_DOM0_DIR}" sources: - type: west url: "https://github.com/xen-troops/zephyr-dom0-xt.git" rev: "rpi5-v0.1.1" builder: type: zephyr board: "%{ZEPHYR_DOM0_MACHINE}" target: "%{ZEPHYR_DOM0_TARGET}" work_dir: "%{ZEPHYR_DOM0_BUILD_DIR}" vars: - "CONFIG_DOM_STORAGE_FATFS_LOGICAL_DRIVE_NAME=\"1\"" target_images: - "%{ZEPHYR_DOM0_BUILD_DIR}/zephyr/zephyr.bin" additional_deps: - "%{YOCTOS_WORK_DIR}/%{DOMD_BUILD_DIR}/tmp/deploy/images/%{MACHINE}/Image.gz" - "%{YOCTOS_WORK_DIR}/%{DOMU_BUILD_DIR}/tmp/deploy/images/%{DOMU_MACHINE}/Image-initramfs-%{DOMU_MACHINE}.bin" domu_sync: default: true build-dir: "%{ZEPHYR_DOMU1_DIR}" sources: - type: west url: "https://github.com/xen-troops/zephyr.git" rev: "rpi5_dev" builder: type: zephyr board: xenvm target: zephyr/samples/synchronization work_dir: "%{ZEPHYR_DOMU1_BUILD_DIR}" target_images: - "%{ZEPHYR_DOMU1_BUILD_DIR}/zephyr/zephyr.bin" domu_blinky: default: true build-dir: "%{ZEPHYR_DOMU2_DIR}" sources: - type: west url: "https://github.com/xen-troops/zephyr.git" rev: "rpi5_dev" builder: type: zephyr board: xenvm target: zephyr/samples/basic/blinky work_dir: "%{ZEPHYR_DOMU2_BUILD_DIR}" snippets: - "rpi_5_xen_domd" target_images: - "%{ZEPHYR_DOMU2_BUILD_DIR}/zephyr/zephyr.bin" domu_unikraft: default: true build-dir: domu_unikraft sources: - type: http url: https://github.com/aoscloud/demo-services/raw/main/monkey_zephyr/src/helloworld_xen-arm64 file: helloworld_xen-arm64 dir: "." builder: type: "null" domd: build-dir: "%{YOCTOS_WORK_DIR}" sources: - *COMMON_YOCTO_SOURCES - type: git url: "https://git.yoctoproject.org/meta-raspberrypi" rev: "1918a27419dcd5e79954c0dc0edddcde91057a7e" - type: git url: "https://github.com/xen-troops/meta-xt-rpi5.git" rev: "v0.1.1" builder: type: yocto work_dir: "%{DOMD_BUILD_DIR}" conf: - [SSTATE_DIR, "${TOPDIR}/../../../common_data/sstate"] - [DL_DIR, "${TOPDIR}/../../../common_data/downloads"] # Skip warning about missing "virtualization" distro feature - [SKIP_META_VIRT_SANITY_CHECK, "1"] # Init manager - [INIT_MANAGER, "systemd"] # Do not install kernel image to rootfs to decrease initrd size - ["RDEPENDS_${KERNEL_PACKAGE_NAME}-base", ""] # Remove features that we are not using - [DISTRO_FEATURES:remove, "x11 gtk gobject-introspection-data nfc irda zeroconf 3g sysvinit acl alsa argp pcmcia usbgadget opengl ptest multiarch wayland vulkan sysvinit"] - [MACHINE, "%{MACHINE}"] - [RPI_SOC_FAMILY, "%{SOC_FAMILY}"] - [XT_DOM_NAME, "domd"] - [XT_DEVICE_TREES, "%{XT_XEN_DTBO_NAME}"] - [DOM0_OS, "%{DOM0_OS}"] - [PREFERRED_VERSION_xen,"4.19.0+git"] - [PREFERRED_VERSION_xen-tools, "4.19.0+git"] - [PREFERRED_VERSION_u-boot, "2024.04"] # RPI specific - [ENABLE_UART, "1"] - [RPI_USE_U_BOOT, "1"] - [PREFERRED_PROVIDER_u-boot-default-script, "xt-rpi-u-boot-scr"] - [UART_BOORLOADER, "1"] - [KERNEL_IMAGETYPE_UBOOT, "Image"] - [DISTRO_FEATURES:append, " xen"] build_target: "%{XT_DOMD_IMAGE}" layers: - *COMMON_YOCTO_LAYERS - "../meta-raspberrypi" - "../meta-openembedded/meta-perl" - "../meta-xt-common/meta-xt-driver-domain" - "../meta-xt-common/meta-xt-security" - "../meta-xt-rpi5" - "../meta-xt-prod-devel-rpi5/xt-prod-devel-rpi5-domd" target_images: - "tmp/deploy/images/%{MACHINE}/xen-%{MACHINE}" - "tmp/deploy/images/%{MACHINE}/xenpolicy-%{MACHINE}" - "tmp/deploy/images/%{MACHINE}/%{XT_XEN_DTBO_NAME}" - "tmp/deploy/images/%{MACHINE}/%{XT_DOMD_DTB_NAME}" - "tmp/deploy/images/%{MACHINE}/%{SOC_FAMILY}-%{MACHINE}-mmc.dtbo" - "tmp/deploy/images/%{MACHINE}/%{SOC_FAMILY}-%{MACHINE}-usb.dtbo" - "tmp/deploy/images/%{MACHINE}/mmc-passthrough.dtbo" - "tmp/deploy/images/%{MACHINE}/usb-passthrough.dtbo" - "tmp/deploy/images/%{MACHINE}/bcm2712-rpi-5-b.dtb" - "tmp/deploy/images/%{MACHINE}/%{XT_DOMD_IMAGE}-%{MACHINE}.rootfs.ext4" - "tmp/deploy/images/%{MACHINE}/Image.gz" - "tmp/deploy/images/%{MACHINE}/armstub8-2712.bin" - "tmp/deploy/images/%{MACHINE}/bootfiles/bootcode.bin" - "tmp/deploy/images/%{MACHINE}/bootfiles/config.txt" - "tmp/deploy/images/%{MACHINE}/bootfiles/cmdline.txt" - "tmp/deploy/images/%{MACHINE}/bootfiles/fixup.dat" - "tmp/deploy/images/%{MACHINE}/bootfiles/fixup_cd.dat" - "tmp/deploy/images/%{MACHINE}/bootfiles/fixup_db.dat" - "tmp/deploy/images/%{MACHINE}/bootfiles/fixup_x.dat" - "tmp/deploy/images/%{MACHINE}/bootfiles/fixup4.dat" - "tmp/deploy/images/%{MACHINE}/bootfiles/fixup4cd.dat" - "tmp/deploy/images/%{MACHINE}/bootfiles/fixup4db.dat" - "tmp/deploy/images/%{MACHINE}/bootfiles/fixup4x.dat" - "tmp/deploy/images/%{MACHINE}/bootfiles/start.elf" - "tmp/deploy/images/%{MACHINE}/bootfiles/start_cd.elf" - "tmp/deploy/images/%{MACHINE}/bootfiles/start_db.elf" - "tmp/deploy/images/%{MACHINE}/bootfiles/start_x.elf" - "tmp/deploy/images/%{MACHINE}/bootfiles/start4.elf" - "tmp/deploy/images/%{MACHINE}/bootfiles/start4db.elf" - "tmp/deploy/images/%{MACHINE}/bootfiles/start4cd.elf" - "tmp/deploy/images/%{MACHINE}/bootfiles/start4x.elf" domu: build-dir: "%{YOCTOS_WORK_DIR}" sources: - *COMMON_YOCTO_SOURCES builder: type: yocto work_dir: "%{DOMU_BUILD_DIR}" conf: - [SSTATE_DIR, "${TOPDIR}/../../../common_data/sstate"] - [DL_DIR, "${TOPDIR}/../../../common_data/downloads"] # Skip warning about missing "virtualization" distro feature - [SKIP_META_VIRT_SANITY_CHECK, "1"] # Init manager - [INIT_MANAGER, "systemd"] # Do not install kernel image to rootfs to decrease initrd size - ["RDEPENDS_${KERNEL_PACKAGE_NAME}-base", ""] # Remove features that we are not using - [DISTRO_FEATURES:remove, "x11 gtk gobject-introspection-data nfc irda zeroconf 3g sysvinit acl alsa argp pcmcia usbgadget opengl ptest multiarch wayland vulkan sysvinit"] - [MACHINE, "%{DOMU_MACHINE}"] - [XT_DOM_NAME, "domu"] - [PREFERRED_VERSION_xen-tools, "4.19.0+git"] # Bundle initramfs into kernel image - [INITRAMFS_IMAGE, "%{XT_DOMU_IMAGE}"] - [INITRAMFS_IMAGE_NAME, "${INITRAMFS_IMAGE}${IMAGE_MACHINE_SUFFIX}.rootfs"] - [INITRAMFS_IMAGE_BUNDLE, "1"] build_target: "%{XT_DOMU_IMAGE}" layers: - *COMMON_YOCTO_LAYERS - "../meta-xt-common/meta-xt-domu" - "../meta-xt-prod-devel-rpi5/xt-prod-devel-rpi5-domu" target_images: - "tmp/deploy/images/%{DOMU_MACHINE}/Image-initramfs-%{DOMU_MACHINE}.bin" images: full: type: gpt desc: "Full RPI image" sector_size: 512 partitions: boot: gpt_type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 type: vfat size: 512 MiB items: "armstub8-2712.bin": "%{YOCTOS_WORK_DIR}/%{DOMD_BUILD_DIR}/tmp/deploy/images/%{MACHINE}/armstub8-2712.bin" "bootcode.bin": "%{YOCTOS_WORK_DIR}/%{DOMD_BUILD_DIR}/tmp/deploy/images/%{MACHINE}/bootfiles/bootcode.bin" "config.txt": "%{YOCTOS_WORK_DIR}/%{DOMD_BUILD_DIR}/tmp/deploy/images/%{MACHINE}/bootfiles/config.txt" "cmdline.txt": "%{YOCTOS_WORK_DIR}/%{DOMD_BUILD_DIR}/tmp/deploy/images/%{MACHINE}/bootfiles/cmdline.txt" "fixup.dat": "%{YOCTOS_WORK_DIR}/%{DOMD_BUILD_DIR}/tmp/deploy/images/%{MACHINE}/bootfiles/fixup.dat" "fixup_cd.dat": "%{YOCTOS_WORK_DIR}/%{DOMD_BUILD_DIR}/tmp/deploy/images/%{MACHINE}/bootfiles/fixup_cd.dat" "fixup_db.dat": "%{YOCTOS_WORK_DIR}/%{DOMD_BUILD_DIR}/tmp/deploy/images/%{MACHINE}/bootfiles/fixup_db.dat" "fixup_x.dat": "%{YOCTOS_WORK_DIR}/%{DOMD_BUILD_DIR}/tmp/deploy/images/%{MACHINE}/bootfiles/fixup_x.dat" "fixup4.dat": "%{YOCTOS_WORK_DIR}/%{DOMD_BUILD_DIR}/tmp/deploy/images/%{MACHINE}/bootfiles/fixup4.dat" "fixup4cd.dat": "%{YOCTOS_WORK_DIR}/%{DOMD_BUILD_DIR}/tmp/deploy/images/%{MACHINE}/bootfiles/fixup4cd.dat" "fixup4db.dat": "%{YOCTOS_WORK_DIR}/%{DOMD_BUILD_DIR}/tmp/deploy/images/%{MACHINE}/bootfiles/fixup4db.dat" "fixup4x.dat": "%{YOCTOS_WORK_DIR}/%{DOMD_BUILD_DIR}/tmp/deploy/images/%{MACHINE}/bootfiles/fixup4x.dat" "start.elf": "%{YOCTOS_WORK_DIR}/%{DOMD_BUILD_DIR}/tmp/deploy/images/%{MACHINE}/bootfiles/start.elf" "start_cd.elf": "%{YOCTOS_WORK_DIR}/%{DOMD_BUILD_DIR}/tmp/deploy/images/%{MACHINE}/bootfiles/start_cd.elf" "start_db.elf": "%{YOCTOS_WORK_DIR}/%{DOMD_BUILD_DIR}/tmp/deploy/images/%{MACHINE}/bootfiles/start_db.elf" "start_x.elf": "%{YOCTOS_WORK_DIR}/%{DOMD_BUILD_DIR}/tmp/deploy/images/%{MACHINE}/bootfiles/start_x.elf" "start4.elf": "%{YOCTOS_WORK_DIR}/%{DOMD_BUILD_DIR}/tmp/deploy/images/%{MACHINE}/bootfiles/start4.elf" "start4db.elf": "%{YOCTOS_WORK_DIR}/%{DOMD_BUILD_DIR}/tmp/deploy/images/%{MACHINE}/bootfiles/start4db.elf" "start4cd.elf": "%{YOCTOS_WORK_DIR}/%{DOMD_BUILD_DIR}/tmp/deploy/images/%{MACHINE}/bootfiles/start4cd.elf" "start4x.elf": "%{YOCTOS_WORK_DIR}/%{DOMD_BUILD_DIR}/tmp/deploy/images/%{MACHINE}/bootfiles/start4x.elf" "Image.gz": "%{YOCTOS_WORK_DIR}/%{DOMD_BUILD_DIR}/tmp/deploy/images/%{MACHINE}/Image.gz" "xen": "%{YOCTOS_WORK_DIR}/%{DOMD_BUILD_DIR}/tmp/deploy/images/%{MACHINE}/xen-%{MACHINE}" "xenpolicy": "%{YOCTOS_WORK_DIR}/%{DOMD_BUILD_DIR}/tmp/deploy/images/%{MACHINE}/xenpolicy-%{MACHINE}" "u-boot": "%{YOCTOS_WORK_DIR}/%{DOMD_BUILD_DIR}/tmp/deploy/images/%{MACHINE}/u-boot-%{MACHINE}.bin" "boot.scr": "%{YOCTOS_WORK_DIR}/%{DOMD_BUILD_DIR}/tmp/deploy/images/%{MACHINE}/boot.scr" "%{XT_XEN_DTBO_NAME}": "%{YOCTOS_WORK_DIR}/%{DOMD_BUILD_DIR}/tmp/deploy/images/%{MACHINE}/%{XT_XEN_DTBO_NAME}" "%{XT_DOMD_DTB_NAME}": "%{YOCTOS_WORK_DIR}/%{DOMD_BUILD_DIR}/tmp/deploy/images/%{MACHINE}/%{XT_DOMD_DTB_NAME}" "bcm2712-rpi-5-b.dtb": "%{YOCTOS_WORK_DIR}/%{DOMD_BUILD_DIR}/tmp/deploy/images/%{MACHINE}/bcm2712-rpi-5-b.dtb" "mmc-passthrough.dtbo": "%{YOCTOS_WORK_DIR}/%{DOMD_BUILD_DIR}/tmp/deploy/images/%{MACHINE}/mmc-passthrough.dtbo" "usb-passthrough.dtbo": "%{YOCTOS_WORK_DIR}/%{DOMD_BUILD_DIR}/tmp/deploy/images/%{MACHINE}/usb-passthrough.dtbo" "%{SOC_FAMILY}-%{MACHINE}-usb.dtbo": "%{YOCTOS_WORK_DIR}/%{DOMD_BUILD_DIR}/tmp/deploy/images/%{MACHINE}/%{SOC_FAMILY}-%{MACHINE}-usb.dtbo" "%{SOC_FAMILY}-%{MACHINE}-mmc.dtbo": "%{YOCTOS_WORK_DIR}/%{DOMD_BUILD_DIR}/tmp/deploy/images/%{MACHINE}/%{SOC_FAMILY}-%{MACHINE}-mmc.dtbo" "zephyr.bin": "%{ZEPHYR_DOM0_DIR}/%{ZEPHYR_DOM0_BUILD_DIR}/zephyr/zephyr.bin" dom0: gpt_type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 type: vfat size: 512 MiB items: "dom0/z_sync.bin": "%{ZEPHYR_DOMU1_DIR}/%{ZEPHYR_DOMU1_BUILD_DIR}/zephyr/zephyr.bin" "dom0/z_blinky.bin": "%{ZEPHYR_DOMU2_DIR}/%{ZEPHYR_DOMU2_BUILD_DIR}/zephyr/zephyr.bin" "dom0/helloworld_xen-arm64": "domu_unikraft/helloworld_xen-arm64" "dom0/linux-pv-image": "%{YOCTOS_WORK_DIR}/%{DOMU_BUILD_DIR}/tmp/deploy/images/%{DOMU_MACHINE}/Image-initramfs-%{DOMU_MACHINE}.bin" parameters: # Machines MACHINE: desc: "Raspberry Pi machines" rpi5: default: true overrides: variables: MACHINE: "raspberrypi5" SOC_FAMILY: "bcm2712" ZEPHYR_DOM0_DIR: "zephyr" DOMD_ROOT: desc: "Domd root device" usb: default: true overrides: components: domd: builder: conf: - [DOMD_OVERLAYS, "%{SOC_FAMILY}-%{MACHINE}-usb.dtbo"] - [MACHINE_FEATURES:append, " domd_usb"] - [DOMD_BOOTARGS, "console=ttyAMA0 earlycon=xen earlyprintk=xen clk_ignore_unused root=\\\\/dev\\\\/sda1 rootfstype=ext4 rootwait quiet"] images: rootfs: type: gpt desc: "Full RPI image" sector_size: 512 partitions: rootfs: gpt_type: B921B045-1DF0-41C3-AF44-4C6F280D3FAE # Linux aarch64 root type: raw_image size: 8 GiB image_path: "%{YOCTOS_WORK_DIR}/%{DOMD_BUILD_DIR}/tmp/deploy/images/%{MACHINE}/%{XT_DOMD_IMAGE}-%{MACHINE}.rootfs.ext4"