Bug 3881

Summary: Cross-compiling fails (patch included)
Product: Other Reporter: Christian Bj (nafallo)
Component: OtherAssignee: Sam Ravnborg (sam)
Status: CLOSED CODE_FIX    
Severity: normal CC: bunk, protasnb
Priority: P2    
Hardware: i386   
OS: Linux   
Kernel Version: 2.6.8 2.6.9 (which I know of) Subsystem:
Regression: --- Bisected commit-id:
Attachments: Wraps an ifeq around depmod -ae in the Makefile

Description Christian Bj 2004-12-09 10:50:49 UTC
Distribution: Ubuntu Warty
Hardware Environment: AMD64
Software Environment: Debian sarge chroot
Problem Description:
When cross-compiling modules_install fails because depmod -ae is run from
Makefile. When using tools like for example kernel-package in Debian we need to
install those to make a kernel-package out of it. But that fails cause you can't
depmod i386 modules on x86_64 ;-).

Steps to reproduce:
Just try to make modules_install under a chroot on another architecture.

Patch for wrapping depmod -ae in the makefile in a ifeq:
diff -puN Makefile.orig Makefile
--- Makefile.orig	2004-12-09 00:08:43.000000000 +0100
+++ Makefile	2004-12-08 23:59:34.000000000 +0100
@@ -788,7 +788,9 @@ depmod_opts	:= -b $(INSTALL_MOD_PATH) -r
 endif
 .PHONY: _modinst_post
 _modinst_post: _modinst_
+ifeq ([ uname -m ],$(ARCH))
 	if [ -r System.map ]; then $(DEPMOD) -ae -F System.map $(depmod_opts)
$(KERNELRELEASE); fi
+endif
 
 else # CONFIG_MODULES
Comment 1 Christian Bj 2004-12-09 10:53:23 UTC
Created attachment 4250 [details]
Wraps an ifeq around depmod -ae in the Makefile

I'll send it as a .patch also :-).
Comment 2 Adrian Bunk 2005-08-01 10:38:33 UTC
The patch itself is wrong (note that e.g. i386 != i686), but I'm reassigning it
to Sam who should be able to comment on the problem.
Comment 3 Adrian Bunk 2006-03-20 02:55:18 UTC
Sam, can you comment on this issue?
Comment 4 Natalie Protasevich 2007-09-19 19:48:56 UTC
Any updates on this issue?
Thanks.