From nobody Mon Dec 29 00:37:20 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 760BCC4167B for ; Sun, 3 Dec 2023 08:05:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233002AbjLCIFv (ORCPT ); Sun, 3 Dec 2023 03:05:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229572AbjLCIFs (ORCPT ); Sun, 3 Dec 2023 03:05:48 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89B4C125 for ; Sun, 3 Dec 2023 00:05:54 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 42534C433C8; Sun, 3 Dec 2023 08:05:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701590753; bh=M2GMrw4loolCdNbmGSsgw9g7ot6QbobVN3Xw7lbG/rU=; h=From:To:Cc:Subject:Date:From; b=TNblV9JxiWK9vM5Uzfx7EhgT61zuRC+CsWQPb9fqZXVyeswt9NNqjbxL1jqTLMvag QbAyup2l15WPZEy4o7QJoG6reqzPQ6DWyIUrv4GpbUFZW15twpTbasZZ9MrR6mPenP RvcK4lyNnhV4GD+StEWvqbHz9Zfe0o6Ah91LvT883+/NCOBXlVEZwwhP8JVYs1mGmc CwyE93JcXybDN+mQN3obYGyf+1QH9EemO701U2LNCYTfJqQeMGSZuvTLLEjfr/pPEy MtCuJFxjX4BOUtxe5lp1+WtYdn7hV3WcYVG0sDiqXCcYjxSPdHwAiUpL/StN4rxOEs 8AwNWFbYaN9vw== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , Nathan Chancellor , Nick Desaulniers , Nicolas Schier , linux-kernel@vger.kernel.org Subject: [PATCH] kbuild: determine base DTB by suffix Date: Sun, 3 Dec 2023 17:05:48 +0900 Message-Id: <20231203080548.1869540-1-masahiroy@kernel.org> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" When using the -dtbs syntax, you need to ensure to list the base first, as follows: foo-dtbs :=3D foo_base.dtb foo_overlay1.dtbo foo_overlay2.dtbo dtb-y :=3D foo.dtb You cannot do this arrangement: foo-dtbs :=3D foo_overlay1.dtbo foo_overlay2.dtbo foo_base.dtb This restriction comes from $(firstword ...), but it is unneeded to rely on the order in the -dtbs syntax. Instead, you can simply determine the base by suffix because the base (*.dtb) and overlays (*.dtbo) use different suffixes. Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier --- scripts/Makefile.lib | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 1a965fe68e01..cd5b181060f1 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -83,8 +83,8 @@ dtb-$(CONFIG_OF_ALL_DTBS) +=3D $(dtb-) multi-dtb-y :=3D $(call multi-search, $(dtb-y), .dtb, -dtbs) # Primitive DTB compiled from *.dts real-dtb-y :=3D $(call real-search, $(dtb-y), .dtb, -dtbs) -# Base DTB that overlay is applied onto (each first word of $(*-dtbs) expa= nsion) -base-dtb-y :=3D $(foreach m, $(multi-dtb-y), $(firstword $(call suffix-sea= rch, $m, .dtb, -dtbs))) +# Base DTB that overlay is applied onto +base-dtb-y :=3D $(filter %.dtb, $(call real-search, $(multi-dtb-y), .dtb, = -dtbs)) =20 always-y +=3D $(dtb-y) =20 --=20 2.40.1