From bd4ccca4a7c8e05097ba832705556e0ddd767a97 Mon Sep 17 00:00:00 2001 From: "Isaac J. Manjarres" Date: Thu, 5 Jan 2023 17:53:25 -0800 Subject: [PATCH] ANDROID: kbuild: Search external devicetree path when running clean target When running the clean target, kbuild is supposed to remove dtbs and dtbos. However, kbuild only searches for those devicetree build artifacts in the directory that the kernel binaries or kernel modules are output to. This is not sufficient in cases where an external devicetree is used, so include the external devicetree path when searching for dtb and dtbo build artifacts. Bug: 264602319 Fixes: 3d42cc9e75a3 ("ANDROID: kbuild: add support for compiling external device trees") Change-Id: I45fdfdef09c3d57401d98e5db731273147d7d265 [isaacmanjarres: resolved trivial merge conflict] Signed-off-by: Isaac J. Manjarres --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 228fa03ca139..bfd92cb667f6 100644 --- a/Makefile +++ b/Makefile @@ -2039,7 +2039,9 @@ $(clean-dirs): clean: $(clean-dirs) $(call cmd,rmfiles) - @find $(or $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \ + @find $(or $(KBUILD_EXTMOD), .) \ + $(if $(filter-out arch/$(SRCARCH)/boot/dts, $(dtstree)), $(dtstree)) \ + $(RCS_FIND_IGNORE) \ \( -name '*.[aios]' -o -name '*.rsi' -o -name '*.ko' -o -name '.*.cmd' \ -o -name '*.ko.*' \ -o -name '*.dtb' -o -name '*.dtbo' -o -name '*.dtb.S' -o -name '*.dt.yaml' \