All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] (Again) Revert module directory hierarchy and depmod invocation
@ 2002-12-14  1:11 Rusty Russell
  0 siblings, 0 replies; only message in thread
From: Rusty Russell @ 2002-12-14  1:11 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel

[As Greg Kroah-Hartman pointed out, wrong patch appended last time.]

Linus, please apply.

While the kernel, depmod et. al. don't care, other tools want the
directory hierarchy under /lib/modules/`uname -r`/.  Sure, it's bogus
for them to rely on kernel source layout, but noone has come up with a
better alternative, so revert.

NOTE: You *still* can't have two modules of the same name!  (You never
could).

Thanks,
Rusty.
--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

Name: Revert depmod and hierarchy changes
Author: Rusty Russell
Status: Tested on 2.5.51

D: module-init-tools 0.9 and newer supply a replacement depmod, so
D: it's safe to run again.  Also, some external programs like PCMCIA
D: and mkinitrd really want the directory hierarchy in /lib/modules
D: back again: it makes no difference to the tools (since 0.9), so
D: revert it.

diff -urNp --exclude TAGS -X /home/rusty/current-dontdiff --minimal linux-2.5.51/Makefile working-2.5.51-revert-dirs/Makefile
--- linux-2.5.51/Makefile	Tue Dec 10 15:56:46 2002
+++ working-2.5.51-revert-dirs/Makefile	Fri Dec 13 09:18:06 2002
@@ -157,6 +157,7 @@ OBJCOPY		= $(CROSS_COMPILE)objcopy
 OBJDUMP		= $(CROSS_COMPILE)objdump
 AWK		= awk
 GENKSYMS	= /sbin/genksyms
+DEPMOD		= /sbin/depmod
 KALLSYMS	= scripts/kallsyms
 PERL		= perl
 MODFLAGS	= -DMODULE
@@ -534,7 +535,7 @@ modules: $(SUBDIRS)
 #	Install modules
 
 .PHONY: modules_install
-modules_install: _modinst_ $(patsubst %, _modinst_%, $(SUBDIRS))
+modules_install: _modinst_ $(patsubst %, _modinst_%, $(SUBDIRS)) _modinst_post
 
 .PHONY: _modinst_
 _modinst_:
@@ -542,6 +543,20 @@ _modinst_:
 	@rm -f $(MODLIB)/build
 	@mkdir -p $(MODLIB)/kernel
 	@ln -s $(TOPDIR) $(MODLIB)/build
+
+# If System.map exists, run depmod.  This deliberately does not have a
+# dependency on System.map since that would run the dependency tree on
+# vmlinux.  This depmod is only for convenience to give the initial
+# boot a modules.dep even before / is mounted read-write.  However the
+# boot script depmod is the master version.
+ifeq "$(strip $(INSTALL_MOD_PATH))" ""
+depmod_opts	:=
+else
+depmod_opts	:= -b $(INSTALL_MOD_PATH) -r
+endif
+.PHONY: _modinst_post
+_modinst_post:
+	if [ -r System.map ]; then $(DEPMOD) -ae -F System.map $(depmod_opts) $(KERNELRELEASE); fi
 
 .PHONY: $(patsubst %, _modinst_%, $(SUBDIRS))
 $(patsubst %, _modinst_%, $(SUBDIRS)) :
diff -urNp --exclude TAGS -X /home/rusty/current-dontdiff --minimal linux-2.5.51/scripts/Makefile.modinst working-2.5.51-revert-dirs/scripts/Makefile.modinst
--- linux-2.5.51/scripts/Makefile.modinst	Tue Dec 10 15:56:54 2002
+++ working-2.5.51-revert-dirs/scripts/Makefile.modinst	Fri Dec 13 09:28:42 2002
@@ -16,8 +16,8 @@ include scripts/Makefile.lib
 # ==========================================================================
 
 quiet_cmd_modules_install = INSTALL $(obj-m:.o=.ko)
-      cmd_modules_install = mkdir -p $(MODLIB)/kernel && \
-		      cp $(obj-m:.o=.ko) $(MODLIB)/kernel/
+      cmd_modules_install = mkdir -p $(MODLIB)/kernel/$(obj); \
+			    cp $(obj-m:.o=.ko) $(MODLIB)/kernel/$(obj)
 
 modules_install: $(subdir-ym)
 ifneq ($(obj-m:.o=.ko),)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-12-14  1:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-14  1:11 [PATCH] (Again) Revert module directory hierarchy and depmod invocation Rusty Russell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.