Skip to contentSkip to conversation

cross-depmod?

PATCH Hollis Blanchard 6 participants 7 messages Aug 5, 2004 – Aug 9, 2004 Kbuild

lore
Share & tools
lore
#0 lore raw

Hi Sam, would you take a patch like this:

Makefile Thu Aug 5 17:12:07 2004 renamed from Makefile Tue Aug 3 16:11:35 2004 +5 -1
@@ -790,7 +790,11 @@
 endif
 .PHONY: _modinst_post
 _modinst_post: _modinst_
-       if [ -r System.map ]; then $(DEPMOD) -ae -F System.map $(depmod_opts) $(KERNELRELEASE); fi
+       if [ -z "$(CROSS_COMPILE)" -o "$(DEPMOD)" != "/sbin/depmod" ] ; then \
+               if [ -r System.map ]; then \
+                       $(DEPMOD) -ae -F System.map $(depmod_opts) $(KERNELRELEASE); \
+               fi \
+       fi
 
 else # CONFIG_MODULES
 

(I don't like hardcoding /sbin/depmod; this is just for conversation.)

My problem is that I cross-build my kernels, and 'make rpm' is very unhappy when it can't use depmod. I know that I can do 'make DEPMOD=/bin/true rpm', but can't we figure that out automatically?

In general if you're cross-compiling I don't think you can assume /sbin/depmod is ok. Someone could do 'make DEPMOD=powerpc-linux-depmod' though (couldn't they? does anybody bother?), so if $(DEPMOD) has been specified we still want to let that work...

Signature · 2 lines
Hollis Blanchard
IBM Linux Technology Center
#1 lore raw
Quoted 4 lines · Hollis Blanchard

My problem is that I cross-build my kernels, and 'make rpm' is very unhappy when it can't use depmod. I know that I can do 'make DEPMOD=/bin/true rpm', but can't we figure that out automatically?

I'd suggest not running depmod when building an RPM but instead run it as part of the RPMs post-installation script.

David Vrabel

Signature · 4 lines
David Vrabel, Design Engineer

Arcom, Clifton Road           Tel: +44 (0)1223 411200 ext. 3233
Cambridge CB1 7EA, UK         Web: http://www.arcom.com/
#2 lore raw
Quoted 7 lines · David Vrabel
Quoted 3 lines · Hollis Blanchard

My problem is that I cross-build my kernels, and 'make rpm' is very unhappy when it can't use depmod. I know that I can do 'make DEPMOD=/bin/true rpm', but can't we figure that out automatically?

I'd suggest not running depmod when building an RPM but instead run it as part of the RPMs post-installation script.

I guess Hollis (just like me) is mostly interested in the possible error messages of depmod, due to missing exported symbols.

Hollis: I asked the same question about six months year ago, cfr. the thread at
http://seclists.org/lists/linux-kernel/2004/Feb/3527.html

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

#3 lore raw
Quoted 11 lines · Geert Uytterhoeven
Quoted 7 lines · David Vrabel
Quoted 3 lines · Hollis Blanchard

My problem is that I cross-build my kernels, and 'make rpm' is very unhappy when it can't use depmod. I know that I can do 'make DEPMOD=/bin/true rpm', but can't we figure that out automatically?

I'd suggest not running depmod when building an RPM but instead run it as part of the RPMs post-installation script.

I guess Hollis (just like me) is mostly interested in the possible error messages of depmod, due to missing exported symbols.

This is fixed in modpost so you actually now get a warning when modpost is executed.

Sam

#4 lore raw
In reply to Hollis Blanchard
Quoted 19 lines · Hollis Blanchard

Hi Sam, would you take a patch like this:

Makefile Thu Aug 5 17:12:07 2004 renamed from Makefile Tue Aug 3 16:11:35 2004 +5 -1
@@ -790,7 +790,11 @@
 endif
 .PHONY: _modinst_post
 _modinst_post: _modinst_
-       if [ -r System.map ]; then $(DEPMOD) -ae -F System.map $(depmod_opts) $(KERNELRELEASE); fi
+       if [ -z "$(CROSS_COMPILE)" -o "$(DEPMOD)" != "/sbin/depmod" ] ; then \
+               if [ -r System.map ]; then \
+                       $(DEPMOD) -ae -F System.map $(depmod_opts) $(KERNELRELEASE); \
+               fi \
+       fi
 
 else # CONFIG_MODULES
 

(I don't like hardcoding /sbin/depmod; this is just for conversation.)

Quoted 3 lines

My problem is that I cross-build my kernels, and 'make rpm' is very unhappy when it can't use depmod. I know that I can do 'make DEPMOD=/bin/true rpm', but can't we figure that out automatically?

I assume the problem arises from the fact that depmod are only capable of reading elf files for the host it is compiled for.
OK, took a look at depmod.
It handles both 32 and 64 bit but assumes same endian.

Rusty: Would it make sense to extend module-init-tools to support endian as specified in elf file?

Sam

#5 lore raw
Quoted 7 lines · Sam Ravnborg

I assume the problem arises from the fact that depmod are only capable of reading elf files for the host it is compiled for.
OK, took a look at depmod.
It handles both 32 and 64 bit but assumes same endian.

Rusty: Would it make sense to extend module-init-tools to support endian as specified in elf file?

Frankly, yes.

In my opinion, it makes even more sense for modprobe to do the work itself, and cache the info in /lib/modules/uname -r/modules.{dep,alias,symtab}.

I was always planning on doing this after we got rid of the modules.map files, but that never happened due to reluctance from other people to transition, and I didn't fight them.

Cheers,
Rusty.

Signature · 1 line
Anyone who quotes me in their signature is an idiot -- Rusty Russell
#6 lore raw
Quoted 4 lines · Rusty Russell

I was always planning on doing this after we got rid of the modules.map files, but that never happened due to reluctance from other people to transition, and I didn't fight them.

The reluctance was just not-enough-time to update the hotplug scripts.

However, if you forced the issue and took away the files, making me fix the hotplug scripts, that might just cause it to happen a lot sooner :)

thanks,

greg k-h