[Buildroot] [RESEND PATCH 1/8] linux: Only run depmod during the finalize hook

Arnout Vandecappelle arnout at rnout.be
Mon May 18 19:15:55 UTC 2026



On 10/05/2026 21:38, John Ernberg wrote:
> Commit 82e765640095 ("linux: Allow modprobe for out-of-tre modules") added
> support for running depmod as part of the target finalize hook.
> 
> However, it also originally set DEPMOD to /dev/null, a hunk that was
> removed upon apply. The kernel depmod wrapper script uses `command` to
> verify that whatever is passed into DEPMOD is known to the shell.
> These days if the DEPMOD tool is set to something incorrect the depmod
> script will just warn [1], but there are trees where the depmod script will
> stop with a hard error. [2]
> 
> Running depmod as part of out-of-tree module installations causes
> unnecessary files to be generated and installed.
> 
> Since we're already running depmod in the finalize hook, stub this call to
> `true` as it's definitely a shell callable, and it will always succeed.
> This is what is done for other packaging scripts in the kernel tree. [3]
> 
> Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/scripts/depmod.sh?id=914b087ff9e0e9a399a4927fa30793064afc0178 [1]
> Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/scripts/depmod.sh?id=934193a654c1f4d0643ddbf4b2529b508cae926e [2]
> Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/package/PKGBUILD?id=8bdd53e066012bed431667393676d1b5e8cce153#n70 [3]
> Signed-off-by: John Ernberg <j at j-ernberg.se>
> ---
> 
> RESEND:
>   - Forgot to subscribe this e-mail to the list
> 
>   linux/linux.mk | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/linux/linux.mk b/linux/linux.mk
> index c61089bfe0..3c7ebe7e9a 100644
> --- a/linux/linux.mk
> +++ b/linux/linux.mk
> @@ -164,7 +164,7 @@ LINUX_MAKE_FLAGS = \
>   	CROSS_COMPILE="$(TARGET_CROSS)" \
>   	WERROR=0 \
>   	REGENERATE_PARSERS=1 \
> -	DEPMOD=$(HOST_DIR)/sbin/depmod
> +	DEPMOD=true

  For a moment, I thought that this meant that we could remove the dependency on 
host-kmod. But of course, we still need that for the call in the finalize hook.

  Applied to next, thanks!

  Regards,
  Arnout

>   
>   ifeq ($(BR2_REPRODUCIBLE),y)
>   LINUX_MAKE_ENV += \



More information about the buildroot mailing list