Skip to contentSkip to conversation

kbuild: disable depmod in cross-compile kernel build

DISCUSSION Geert Uytterhoeven 3 participants 3 messages Oct 21, 2007 – Oct 22, 2007 1 message not in the archive Kbuild

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 17 lines · Linux Kernel Mailing List
Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=50a8ec31c3a00594ceb7c5f1dcf2ecdaf6a5b847
Commit:     50a8ec31c3a00594ceb7c5f1dcf2ecdaf6a5b847
Parent:     6f67a00498abf8f0b29c2cecfce188c70be309d0
Author:     Sam Ravnborg <sam@neptun.(none)>
AuthorDate: Thu Oct 18 21:24:21 2007 +0200
Committer:  Sam Ravnborg <sam@neptun.(none)>
CommitDate: Thu Oct 18 23:17:06 2007 +0200

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.

Quoted 8 lines

Inspired by patches from Christian, Armin and Deepak.

This solves: http://bugzilla.kernel.org/show_bug.cgi?id=3881

Cc Christian Bjølevik <[email protected]>
Cc Deepak Saxena <[email protected]> and
Cc Armin Kuster <[email protected]>,

Euh, is these really necessary?

At work I have no problems running depmod on an i386 system for ppc64 modules after I installed module-init-tools 3.3-pre2 (from Debian).
I did have problems (depmod SEGV) using the depmod that came with CentOS 4 (from module-init-tools 3.1-pre5).

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#2 lore raw
Quoted 4 lines · Geert Uytterhoeven

Euh, is these really necessary?

At work I have no problems running depmod on an i386 system for ppc64 modules after I installed module-init-tools 3.3-pre2 (from Debian).

That's right. I do depmod on i386 and amd64 for _all_ Debian architectures without any problems and I don't see why it should be a problem when running on other arches. It used to be a problem with depmod from modutils, but with depmod from module-init-tools it works perfectly.

All it needs is the -b option and correct kernel version.

#3 lore raw
In reply to Geert Uytterhoeven
Quoted 7 lines

Euh, is these really necessary?

At work I have no problems running depmod on an i386 system for ppc64 modules after I installed module-init-tools 3.3-pre2 (from Debian).
I did have problems (depmod SEGV) using the depmod that came with CentOS 4 (from module-init-tools 3.1-pre5).

The patch was solely done due to people complaining and I even had a bugzilla entry about it.
I expext Armin or Christian to speak up if this is a real problem for them.

PS. I did not do a revert since the original patch contained a nice cleanup.

Sam

I have just committed the following:

Quoted 1 line

From d2c83557493c8595e2d3f31d0469bcf43d19b560 Mon Sep 17 00:00:00 2001

From: Sam Ravnborg <sam@neptun.(none)>
Date: Mon, 22 Oct 2007 11:30:45 +0200
Subject: [PATCH] kbuild: allow depmod in cross builds again

depmod from module-init-tools 3.3-pre2 are reported to work fine in cross build.
depmod from module-init-tools 3.1-pre5 are know to SEGV

Do not workaround older module-init-tools bug here. The right fix is for users to upgrade module-init-tools.

Cc Geert Uytterhoeven <[email protected]>
---
 Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Makefile +1 -1
index f4238b2..264f37b 100644
@@ -1505,7 +1505,7 @@ quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN   $(wildcard $(rm-files))
 # and we build for the host arch
 quiet_cmd_depmod = DEPMOD  $(KERNELRELEASE)
       cmd_depmod = \
-	if [ -r System.map -a -x $(DEPMOD) -a "$(SUBARCH)" = "$(ARCH)" ]; then \
+	if [ -r System.map -a -x $(DEPMOD) ]; then                              \
 		$(DEPMOD) -ae -F System.map                                     \
 		$(if $(strip $(INSTALL_MOD_PATH)), -b $(INSTALL_MOD_PATH) -r)   \
 		$(KERNELRELEASE);                                               \
Signature · 1 line
1.5.3.4.1157.g0e74-dirty