]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
oe-selftest: fitimage: add machine-agnostic test-dtbs-as-ext recipe
authorAdrian Freihofer <adrian.freihofer@siemens.com>
Fri, 19 Jun 2026 11:17:10 +0000 (13:17 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 29 Jun 2026 09:37:38 +0000 (10:37 +0100)
Add a minimal, fully standalone device-tree recipe for use by the
fitimage selftests.  The two source files have no kernel-source
dependencies, so the recipe builds on any OE-core machine without
requiring a BSP layer.

test-ext.dts   -- a tiny /dts-v1/ tree with a single aliases node and
                  an oe-selftest,test-ext compatible string.
test-overlay.dts -- a /plugin/ overlay referencing the root node.

COMPATIBLE_MACHINE = ".*" so the recipe is accepted on every target.

A test-ext-alias.dtb symlink is created in both do_install and
do_deploy (mirroring the alias pattern used by the external-DTB
fitimage tests) so that the configuration-node alias code path is
exercised.

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta-selftest/recipes-test/ext-dtb/files/test-ext.dts [new file with mode: 0644]
meta-selftest/recipes-test/ext-dtb/files/test-overlay.dts [new file with mode: 0644]
meta-selftest/recipes-test/ext-dtb/test-dtbs-as-ext.bb [new file with mode: 0644]

diff --git a/meta-selftest/recipes-test/ext-dtb/files/test-ext.dts b/meta-selftest/recipes-test/ext-dtb/files/test-ext.dts
new file mode 100644 (file)
index 0000000..53f2be0
--- /dev/null
@@ -0,0 +1,17 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Minimal standalone device tree for OE selftest external DTB testing.
+ * No kernel source dependencies required.
+ */
+/dts-v1/;
+
+/ {
+       model = "OE Selftest External DTB";
+       compatible = "oe-selftest,test-ext";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       aliases {
+               selftest = "/";
+       };
+};
diff --git a/meta-selftest/recipes-test/ext-dtb/files/test-overlay.dts b/meta-selftest/recipes-test/ext-dtb/files/test-overlay.dts
new file mode 100644 (file)
index 0000000..d9d364a
--- /dev/null
@@ -0,0 +1,14 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Device tree overlay for OE selftest external DTB overlay testing.
+ * Intentionally self-contained with no kernel source dependencies.
+ */
+/dts-v1/;
+/plugin/;
+
+&{/} {
+       oe-selftest-overlay {
+               compatible = "oe-selftest,test-overlay";
+               status = "okay";
+       };
+};
diff --git a/meta-selftest/recipes-test/ext-dtb/test-dtbs-as-ext.bb b/meta-selftest/recipes-test/ext-dtb/test-dtbs-as-ext.bb
new file mode 100644 (file)
index 0000000..217ca36
--- /dev/null
@@ -0,0 +1,25 @@
+SUMMARY = "Standalone Devicetrees for OE selftest"
+DESCRIPTION = "Standalone DTB and DTBO files used for external DTB FIT image testing. \
+Intentionally self-contained with no kernel source dependencies so any OE-core \
+build can run the FIT image selftests without a BSP layer."
+SECTION = "kernel"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
+
+inherit devicetree
+
+COMPATIBLE_MACHINE = ".*"
+
+SRC_URI = "\
+    file://test-ext.dts \
+    file://test-overlay.dts \
+"
+
+# Sym-links are handled as extra configuration nodes in FIT images.
+do_install:append() {
+    ln -sf test-ext.dtb "${D}/boot/devicetree/test-ext-alias.dtb"
+}
+
+do_deploy:append() {
+    ln -sf test-ext.dtb "${DEPLOYDIR}/devicetree/test-ext-alias.dtb"
+}