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 = {