Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 79b96c3

Browse files
committed
kbuild: move depmod rule to scripts/Makefile.modinst
depmod is a part of the module installation. scripts/Makefile.modinst is a better place to run it. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
1 parent eb931e1 commit 79b96c3

File tree

3 files changed

+16
-13
lines changed

3 files changed

+16
-13
lines changed

Makefile

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,6 @@ LEX = flex
509509
YACC = bison
510510
AWK = awk
511511
INSTALLKERNEL := installkernel
512-
DEPMOD = depmod
513512
PERL = perl
514513
PYTHON3 = python3
515514
CHECK = sparse
@@ -1871,15 +1870,8 @@ PHONY += modules_check
18711870
modules_check: $(MODORDER)
18721871
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/modules-check.sh $<
18731872

1874-
quiet_cmd_depmod = DEPMOD $(MODLIB)
1875-
cmd_depmod = $(CONFIG_SHELL) $(srctree)/scripts/depmod.sh $(DEPMOD) \
1876-
$(KERNELRELEASE)
1877-
18781873
modules_install:
18791874
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst
1880-
ifndef modules_sign_only
1881-
$(call cmd,depmod)
1882-
endif
18831875

18841876
else # CONFIG_MODULES
18851877

scripts/Makefile.modinst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,15 @@ $(dst)/%.ko: $(extmod_prefix)%.ko FORCE
8686
$(call cmd,strip)
8787
$(call cmd,sign)
8888

89+
__modinst: depmod
90+
91+
PHONY += depmod
92+
depmod: $(modules)
93+
$(call cmd,depmod)
94+
95+
quiet_cmd_depmod = DEPMOD $(MODLIB)
96+
cmd_depmod = $(srctree)/scripts/depmod.sh $(KERNELRELEASE)
97+
8998
else
9099

91100
$(dst)/%.ko: FORCE

scripts/depmod.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
#!/bin/sh
22
# SPDX-License-Identifier: GPL-2.0
33
#
4-
# A depmod wrapper used by the toplevel Makefile
4+
# A depmod wrapper
55

6-
if test $# -ne 2; then
7-
echo "Usage: $0 /sbin/depmod <kernelrelease>" >&2
6+
if test $# -ne 1; then
7+
echo "Usage: $0 <kernelrelease>" >&2
88
exit 1
99
fi
10-
DEPMOD=$1
11-
KERNELRELEASE=$2
10+
11+
KERNELRELEASE=$1
12+
13+
: ${DEPMOD:=depmod}
1214

1315
if ! test -r System.map ; then
1416
echo "Warning: modules_install: missing 'System.map' file. Skipping depmod." >&2

0 commit comments

Comments
 (0)