linux-kbuild.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kbuild: avoid long argument lists in make modules_install
@ 2023-09-11  8:01 Michal Kubecek
  2023-09-14 17:37 ` Masahiro Yamada
  0 siblings, 1 reply; 2+ messages in thread
From: Michal Kubecek @ 2023-09-11  8:01 UTC (permalink / raw)
  To: Masahiro Yamada, linux-kbuild, linux-kernel

Running "make modules_install" may fail with

  make[2]: execvp: /bin/sh: Argument list too long

if many modules are built and INSTALL_MOD_PATH is long. This is because
scripts/Makefile.modinst creates all directories with one mkdir command.
Use $(foreach ...) instead to prevent an excessive argument list.

Fixes: 2dfec887c0fd ("kbuild: reduce the number of mkdir calls during modules_install")
Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
---
 scripts/Makefile.modinst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst
index c59cc57286ba..346f5ec50682 100644
--- a/scripts/Makefile.modinst
+++ b/scripts/Makefile.modinst
@@ -113,7 +113,7 @@ quiet_cmd_sign :=
 endif
 
 # Create necessary directories
-$(shell mkdir -p $(sort $(dir $(install-y))))
+$(foreach dir, $(sort $(dir $(install-y))), $(shell mkdir -p $(dir)))
 
 $(dst)/%.ko: $(extmod_prefix)%.ko FORCE
 	$(call cmd,install)
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] kbuild: avoid long argument lists in make modules_install
  2023-09-11  8:01 [PATCH] kbuild: avoid long argument lists in make modules_install Michal Kubecek
@ 2023-09-14 17:37 ` Masahiro Yamada
  0 siblings, 0 replies; 2+ messages in thread
From: Masahiro Yamada @ 2023-09-14 17:37 UTC (permalink / raw)
  To: Michal Kubecek; +Cc: linux-kbuild, linux-kernel

On Mon, Sep 11, 2023 at 5:01 PM Michal Kubecek <mkubecek@suse.cz> wrote:
>
> Running "make modules_install" may fail with
>
>   make[2]: execvp: /bin/sh: Argument list too long
>
> if many modules are built and INSTALL_MOD_PATH is long. This is because
> scripts/Makefile.modinst creates all directories with one mkdir command.
> Use $(foreach ...) instead to prevent an excessive argument list.
>
> Fixes: 2dfec887c0fd ("kbuild: reduce the number of mkdir calls during modules_install")
> Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
> ---

Applied to linux-kbuild/fixes.
Thanks.



>  scripts/Makefile.modinst | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst
> index c59cc57286ba..346f5ec50682 100644
> --- a/scripts/Makefile.modinst
> +++ b/scripts/Makefile.modinst
> @@ -113,7 +113,7 @@ quiet_cmd_sign :=
>  endif
>
>  # Create necessary directories
> -$(shell mkdir -p $(sort $(dir $(install-y))))
> +$(foreach dir, $(sort $(dir $(install-y))), $(shell mkdir -p $(dir)))
>
>  $(dst)/%.ko: $(extmod_prefix)%.ko FORCE
>         $(call cmd,install)
> --
> 2.42.0
>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-09-14 17:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-11  8:01 [PATCH] kbuild: avoid long argument lists in make modules_install Michal Kubecek
2023-09-14 17:37 ` Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).