aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Ravnborg <sam@neptun.(none)>2007-10-18 15:24:21 -0400
committerSam Ravnborg <sam@neptun.(none)>2007-10-18 17:17:06 -0400
commit50a8ec31c3a00594ceb7c5f1dcf2ecdaf6a5b847 (patch)
tree3f71eb176762d79d4ebfc751c864e77b99aec67a
parent6f67a00498abf8f0b29c2cecfce188c70be309d0 (diff)
kbuild: disable depmod in cross-compile kernel build
When building embedded systems in a cross-compile environment and populating a target's file system image, we don't want to run the depmod on the host as we may be building for a completely different architecture. Since there's no such thing as a cross-depmod, we just disable running depmod in the cross-compile case and we just run depmod on the target at bootup. Inspired by patches from Christian, Armin and Deepak. This solves: http://bugzilla.kernel.org/show_bug.cgi?id=3881 Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Cc: Christian Bjølevik <nafallo@magicalforest.se> Cc: Deepak Saxena <dsaxena@mvista.com> and Cc: Armin Kuster <akuster@mvista.com>,
-rw-r--r--Makefile30
1 files changed, 12 insertions, 18 deletions
diff --git a/Makefile b/Makefile
index e8ace82e334f..784903a63e0f 100644
--- a/Makefile
+++ b/Makefile
@@ -1030,19 +1030,12 @@ _modinst_:
1030 fi 1030 fi
1031 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst 1031 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst
1032 1032
1033# If System.map exists, run depmod. This deliberately does not have a 1033# This depmod is only for convenience to give the initial
1034# dependency on System.map since that would run the dependency tree on
1035# vmlinux. This depmod is only for convenience to give the initial
1036# boot a modules.dep even before / is mounted read-write. However the 1034# boot a modules.dep even before / is mounted read-write. However the
1037# boot script depmod is the master version. 1035# boot script depmod is the master version.
1038ifeq "$(strip $(INSTALL_MOD_PATH))" ""
1039depmod_opts :=
1040else
1041depmod_opts := -b $(INSTALL_MOD_PATH) -r
1042endif
1043PHONY += _modinst_post 1036PHONY += _modinst_post
1044_modinst_post: _modinst_ 1037_modinst_post: _modinst_
1045 if [ -r System.map -a -x $(DEPMOD) ]; then $(DEPMOD) -ae -F System.map $(depmod_opts) $(KERNELRELEASE); fi 1038 $(call cmd,depmod)
1046 1039
1047else # CONFIG_MODULES 1040else # CONFIG_MODULES
1048 1041
@@ -1259,15 +1252,6 @@ _emodinst_:
1259 $(Q)mkdir -p $(MODLIB)/$(install-dir) 1252 $(Q)mkdir -p $(MODLIB)/$(install-dir)
1260 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst 1253 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst
1261 1254
1262# Run depmod only is we have System.map and depmod is executable
1263quiet_cmd_depmod = DEPMOD $(KERNELRELEASE)
1264 cmd_depmod = if [ -r System.map -a -x $(DEPMOD) ]; then \
1265 $(DEPMOD) -ae -F System.map \
1266 $(if $(strip $(INSTALL_MOD_PATH)), \
1267 -b $(INSTALL_MOD_PATH) -r) \
1268 $(KERNELRELEASE); \
1269 fi
1270
1271PHONY += _emodinst_post 1255PHONY += _emodinst_post
1272_emodinst_post: _emodinst_ 1256_emodinst_post: _emodinst_
1273 $(call cmd,depmod) 1257 $(call cmd,depmod)
@@ -1516,6 +1500,16 @@ quiet_cmd_rmdirs = $(if $(wildcard $(rm-dirs)),CLEAN $(wildcard $(rm-dirs)))
1516quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN $(wildcard $(rm-files))) 1500quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN $(wildcard $(rm-files)))
1517 cmd_rmfiles = rm -f $(rm-files) 1501 cmd_rmfiles = rm -f $(rm-files)
1518 1502
1503# Run depmod only is we have System.map and depmod is executable
1504# and we build for the host arch
1505quiet_cmd_depmod = DEPMOD $(KERNELRELEASE)
1506 cmd_depmod = \
1507 if [ -r System.map -a -x $(DEPMOD) -a "$(SUBARCH)" == "$(ARCH)" ]; then \
1508 $(DEPMOD) -ae -F System.map \
1509 $(if $(strip $(INSTALL_MOD_PATH)), -b $(INSTALL_MOD_PATH) -r) \
1510 $(KERNELRELEASE); \
1511 fi
1512
1519 1513
1520a_flags = -Wp,-MD,$(depfile) $(KBUILD_AFLAGS) $(AFLAGS_KERNEL) \ 1514a_flags = -Wp,-MD,$(depfile) $(KBUILD_AFLAGS) $(AFLAGS_KERNEL) \
1521 $(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) \ 1515 $(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) \