From e724eebed3839f169c545081c70bb3c3faf3a0de Mon Sep 17 00:00:00 2001 From: Ben Copeland Date: Tue, 6 Oct 2026 09:47:27 +0100 Subject: [PATCH] kbuild: request dtbs-legacy alongside dtbs in tuxmake builds tuxmake's dtbs target only runs when the top-level Makefile has a dtbs_install target, which kernels gained in v4.20. On older kernels it is skipped, the build still passes and no DTBs are produced, so boot jobs on device tree platforms have nothing to boot with. tuxmake handles those kernels with a separate dtbs-legacy target whose precondition is the inverse of dtbs, so at most one of the two runs. Request both whenever DTBs are built. Signed-off-by: Ben Copeland --- kernelci/kbuild.py | 2 +- tests/test_kbuild.py | 27 +++++++++++++++++++++++++-- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/kernelci/kbuild.py b/kernelci/kbuild.py index a7b97767e9..91a0e471d9 100644 --- a/kernelci/kbuild.py +++ b/kernelci/kbuild.py @@ -907,7 +907,7 @@ def _build_with_tuxmake(self): else: targets = ["kernel", "modules"] if self._arch not in DTBS_DISABLED: - targets.append("dtbs") + targets.extend(["dtbs", "dtbs-legacy"]) if self._extra_targets: targets.extend(self._extra_targets) cmd_parts.append(" ".join(targets)) diff --git a/tests/test_kbuild.py b/tests/test_kbuild.py index 599201922e..11d5d648de 100644 --- a/tests/test_kbuild.py +++ b/tests/test_kbuild.py @@ -184,9 +184,11 @@ def test_names_identify_build_results(self, tmp_path): ] -def _tuxmake_invocations(tmp_path, monkeypatch, kselftest, dtbs_check=False): +def _tuxmake_invocations( + tmp_path, monkeypatch, kselftest, dtbs_check=False, arch="x86_64" +): monkeypatch.setitem(sys.modules, "tuxmake", None) - kbuild = _kbuild(tmp_path) + kbuild = _kbuild(tmp_path, arch=arch) kbuild._dtbs_check = dtbs_check kbuild._kselftest = kselftest kbuild._extra_targets = [] @@ -219,6 +221,27 @@ def test_no_kselftest_build_for_dtbs_check(self, tmp_path, monkeypatch): assert kernel.split()[-1] == "dtbs_check" +class TestTuxmakeDtbsTargets: + def test_dtbs_legacy_requested_with_dtbs(self, tmp_path, monkeypatch): + (kernel,) = _tuxmake_invocations( + tmp_path, monkeypatch, False, arch="arm64" + ) + + assert kernel.split()[-4:] == [ + "kernel", + "modules", + "dtbs", + "dtbs-legacy", + ] + + def test_no_dtbs_targets_when_disabled(self, tmp_path, monkeypatch): + (kernel,) = _tuxmake_invocations( + tmp_path, monkeypatch, False, arch="x86_64" + ) + + assert kernel.split()[-2:] == ["kernel", "modules"] + + def _kbuild_from_params(monkeypatch, **params): monkeypatch.setenv("KCI_API_TOKEN", "test-token") params = {