* [PATCH] kbuild: dtbinst: Create destination directories before installing
@ 2026-10-16 14:40 Konrad Dybcio
2026-11-05 4:42 ` Nathan Chancellor
0 siblings, 1 reply; 2+ messages in thread
From: Konrad Dybcio @ 2026-10-16 14:40 UTC (permalink / raw)
To: Rob Herring, Saravana Kannan, Nathan Chancellor, Nicolas Schier,
Masahiro Yamada
Cc: linux-kbuild, devicetree, linux-kernel, Konrad Dybcio
From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
dtbs_install installs each DTB with 'install -D', which creates the
parent directory of the destination on demand. With a parallel build,
two DTBs that share a not yet existing directory are installed
concurrently and both try to create it. The loser fails, which aborts
the whole build:
install: cannot create directory 'debian/linux-image-7.1.0/usr/lib/linux-image-7.1.0/arm'
make[6]: *** [scripts/Makefile.dtbinst:23: .../arm/foundation-v8-gicv3.dtb] Error 1
The failure depends on job scheduling, so it shows up as a build that
fails for no apparent reason and passes when re-run.
Create all destination directories up front, the same way
scripts/Makefile.modinst does for modules, so the install rules no
longer race.
Fixes: aefd80307a05 ("kbuild: refactor Makefile.dtbinst more")
Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
---
scripts/Makefile.dtbinst | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/scripts/Makefile.dtbinst b/scripts/Makefile.dtbinst
index 9d920419a62c..a55f2a7acbc2 100644
--- a/scripts/Makefile.dtbinst
+++ b/scripts/Makefile.dtbinst
@@ -37,6 +37,10 @@ dtbs := $(notdir $(dtbs))
endif # CONFIG_ARCH_WANT_FLAT_DTB_INSTALL
+# Create destination directories up front: with parallel make, concurrent
+# 'install -D' calls race on creating the same parent directory.
+$(foreach dir, $(sort $(dir $(addprefix $(dst)/, $(dtbs)))), $(shell mkdir -p $(dir)))
+
__dtbs_install: $(addprefix $(dst)/, $(dtbs))
@:
---
base-commit: d419d682257d813f6cb7a28e42b35d0edf4ad038
change-id: 20261016-topic-dtbs_install_fix-7c0d9f206fdb
Best regards,
--
Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] kbuild: dtbinst: Create destination directories before installing
2026-10-16 14:40 [PATCH] kbuild: dtbinst: Create destination directories before installing Konrad Dybcio
@ 2026-11-05 4:42 ` Nathan Chancellor
0 siblings, 0 replies; 2+ messages in thread
From: Nathan Chancellor @ 2026-11-05 4:42 UTC (permalink / raw)
To: Konrad Dybcio
Cc: Rob Herring, Saravana Kannan, Nathan Chancellor, Nicolas Schier,
Masahiro Yamada, linux-kbuild, devicetree, linux-kernel,
Konrad Dybcio
> dtbs_install installs each DTB with 'install -D', which creates the
> parent directory of the destination on demand. With a parallel build,
> two DTBs that share a not yet existing directory are installed
> concurrently and both try to create it. The loser fails, which aborts
> the whole build:
>
> install: cannot create directory 'debian/linux-image-7.1.0/usr/lib/linux-image-7.1.0/arm'
> make[6]: *** [scripts/Makefile.dtbinst:23: .../arm/foundation-v8-gicv3.dtb] Error 1
>
> The failure depends on job scheduling, so it shows up as a build that
> fails for no apparent reason and passes when re-run.
>
> Create all destination directories up front, the same way
> scripts/Makefile.modinst does for modules, so the install rules no
> longer race.
>
> Fixes: aefd80307a05 ("kbuild: refactor Makefile.dtbinst more")
> Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Seems reasonable to me.
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Rob, do you want to take this or should we take it via Kbuild?
--
Cheers,
Nathan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-05 4:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-16 14:40 [PATCH] kbuild: dtbinst: Create destination directories before installing Konrad Dybcio
2026-11-05 4:42 ` Nathan Chancellor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®