Re: [PATCH] kbuild: dtbinst: Create destination directories before installing

From: Nathan Chancellor

Date: Wed Nov 04 2026 - 23:43:13 EST


> 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@xxxxxxxxxxxxxxxx>

Seems reasonable to me.

Reviewed-by: Nathan Chancellor <nathan@xxxxxxxxxx>

Rob, do you want to take this or should we take it via Kbuild?

--
Cheers,
Nathan