Commit 2dfec887 authored by Masahiro Yamada's avatar Masahiro Yamada

kbuild: reduce the number of mkdir calls during modules_install

Calling 'mkdir' for every module results in redundant syscalls.

Use $(sort ...) to drop the duplicated directories.
Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
Reviewed-by: default avatarNicolas Schier <nicolas@fjasle.eu>
parent d8131c29
...@@ -9,6 +9,8 @@ __modinst: ...@@ -9,6 +9,8 @@ __modinst:
include include/config/auto.conf include include/config/auto.conf
include $(srctree)/scripts/Kbuild.include include $(srctree)/scripts/Kbuild.include
install-y :=
modules := $(call read-file, $(MODORDER)) modules := $(call read-file, $(MODORDER))
ifeq ($(KBUILD_EXTMOD),) ifeq ($(KBUILD_EXTMOD),)
...@@ -27,6 +29,7 @@ suffix-$(CONFIG_MODULE_COMPRESS_XZ) := .xz ...@@ -27,6 +29,7 @@ suffix-$(CONFIG_MODULE_COMPRESS_XZ) := .xz
suffix-$(CONFIG_MODULE_COMPRESS_ZSTD) := .zst suffix-$(CONFIG_MODULE_COMPRESS_ZSTD) := .zst
modules := $(patsubst $(extmod_prefix)%.o, $(dst)/%.ko$(suffix-y), $(modules)) modules := $(patsubst $(extmod_prefix)%.o, $(dst)/%.ko$(suffix-y), $(modules))
install-$(CONFIG_MODULES) += $(modules)
__modinst: $(modules) __modinst: $(modules)
@: @:
...@@ -35,7 +38,7 @@ __modinst: $(modules) ...@@ -35,7 +38,7 @@ __modinst: $(modules)
# Installation # Installation
# #
quiet_cmd_install = INSTALL $@ quiet_cmd_install = INSTALL $@
cmd_install = mkdir -p $(dir $@); cp $< $@ cmd_install = cp $< $@
# Strip # Strip
# #
...@@ -81,6 +84,9 @@ endif ...@@ -81,6 +84,9 @@ endif
ifeq ($(modules_sign_only),) ifeq ($(modules_sign_only),)
# Create necessary directories
$(shell mkdir -p $(sort $(dir $(install-y))))
$(dst)/%.ko: $(extmod_prefix)%.ko FORCE $(dst)/%.ko: $(extmod_prefix)%.ko FORCE
$(call cmd,install) $(call cmd,install)
$(call cmd,strip) $(call cmd,strip)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment