Skip to contentSkip to conversation

fix external module install path

PATCH In review Eric Sandeen 3 participants 5 messages May 7, 2007 – Jan 1, 2008 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix external module install path

Installing external modules is supposed to put them in some path under /lib/modules/<version>/extra/subdir/, but this change:
http://linux.bkbits.net:8080/linux-2.6/?PAGE=cset&REV=1.1982.9.23
makes them go under /lib/modules/<version>/extrasubdir

(for example, make M=fs/ext3 modules_install puts ext3.ko in /lib/modules/<version>/extrafs/ext3.ko)

scripts/Makefile.modinst +1 -1
Index: linux-2.6.21/scripts/Makefile.modinst
===================================================================
@@ -21,7 +21,7 @@ quiet_cmd_modules_install = INSTALL $@
 
 # Modules built outside the kernel source tree go into extra by default
 INSTALL_MOD_DIR ?= extra
-ext-mod-dir = $(INSTALL_MOD_DIR)$(subst $(KBUILD_EXTMOD),,$(@D))
+ext-mod-dir = $(INSTALL_MOD_DIR)/$(subst $(KBUILD_EXTMOD),,$(@D))
 
 modinst_dir = $(if $(KBUILD_EXTMOD),$(ext-mod-dir),kernel/$(@D))
 
#1 lore raw
Quoted 4 lines · Eric Sandeen

Installing external modules is supposed to put them in some path under /lib/modules/<version>/extra/subdir/, but this change:
http://linux.bkbits.net:8080/linux-2.6/?PAGE=cset&REV=1.1982.9.23
makes them go under /lib/modules/<version>/extrasubdir

er, hang on. Now it's not doing it ;-) stay tuned.

Sorry... I really did get an "extrafs/" directory somehow :)

-Eric

#2 lore raw
Quoted 9 lines · Eric Sandeen
Quoted 4 lines · Eric Sandeen

Installing external modules is supposed to put them in some path under /lib/modules/<version>/extra/subdir/, but this change:
http://linux.bkbits.net:8080/linux-2.6/?PAGE=cset&REV=1.1982.9.23
makes them go under /lib/modules/<version>/extrasubdir

er, hang on. Now it's not doing it ;-) stay tuned.

Sorry... I really did get an "extrafs/" directory somehow :)

Urgh, I can't figure out what tickles it reliably.

There is at least another buglet (?) though, if you don't put a slash on the end of your M=, you lose the subdir path.

[root@marathon-01 linux-2.6.18.x86_64]# make M=fs/ext3/ modules_install
INSTALL fs/ext3/ext3.ko
DEPMOD 2.6.18-8.el5
[root@marathon-01 linux-2.6.18.x86_64]# find /lib/modules/uname -r/extra* -name ext3.ko /lib/modules/2.6.18-8.el5/extra/fs/ext3/ext3.ko

[root@marathon-01 linux-2.6.18.x86_64]# make M=fs/ext3 modules_install
INSTALL fs/ext3/ext3.ko
DEPMOD 2.6.18-8.el5
[root@marathon-01 linux-2.6.18.x86_64]# find /lib/modules/uname -r/extra* -name ext3.ko /lib/modules/2.6.18-8.el5/extra/fs/ext3/ext3.ko /lib/modules/2.6.18-8.el5/extra/ext3.ko

I'm confused. Maybe Sam knows how to fix it... :)

-Eric

#3 lore raw
In reply to Eric Sandeen
Quoted 15 lines · Eric Sandeen

Installing external modules is supposed to put them in some path under /lib/modules/<version>/extra/subdir/, but this change:
http://linux.bkbits.net:8080/linux-2.6/?PAGE=cset&REV=1.1982.9.23
makes them go under /lib/modules/<version>/extrasubdir

(for example, make M=fs/ext3 modules_install puts ext3.ko in /lib/modules/<version>/extrafs/ext3.ko)

Index: linux-2.6.21/scripts/Makefile.modinst
===================================================================

scripts/Makefile.modinst quiet_cmd_modules_install = INSTALL $@ · line 26

Quoted 7 lines
scripts/Makefile.modinst +1 -1
@@ -21,7 +21,7 @@ quiet_cmd_modules_install = INSTALL $@
 
 # Modules built outside the kernel source tree go into extra by default
 INSTALL_MOD_DIR ?= extra
-ext-mod-dir = $(INSTALL_MOD_DIR)$(subst $(KBUILD_EXTMOD),,$(@D))
+ext-mod-dir = $(INSTALL_MOD_DIR)/$(subst $(KBUILD_EXTMOD),,$(@D))
 
 modinst_dir = $(if $(KBUILD_EXTMOD),$(ext-mod-dir),kernel/$(@D))

Hi Eric.

Took a look at this now and fixed it like this. Let me know if you see other issues.

[I know this is more than 6 months ago you reported it - sorry]

Sam

Quoted 1 line

From 9af97c5f91e7dd4996b501a19b5a128b1600d511 Mon Sep 17 00:00:00 2001

From: Sam Ravnborg <[email protected]>
Date: Tue, 1 Jan 2008 13:40:28 +0100
Subject: [PATCH] kbuild: fix installing external modules

Eric Sandeen <[email protected]> reported:
Installing external modules is supposed to put them in some path under /lib/modules/<version>/extra/subdir/, but this change:
http://linux.bkbits.net:8080/linux-2.6/?PAGE=cset&REV=1.1982.9.23
makes them go under /lib/modules/<version>/extrasubdir

(for example, make M=fs/ext3 modules_install puts ext3.ko in /lib/modules/<version>/extrafs/ext3.ko)

This was the case only when specifying a trailing slash to M=..

Fixed by removing trailing slash if present so we correctly match dir part of target.

---
 scripts/Makefile.modinst |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
scripts/Makefile.modinst +1 -1
index f0ff248..efa5d94 100644
@@ -21,7 +21,7 @@ quiet_cmd_modules_install = INSTALL $@
 
 # Modules built outside the kernel source tree go into extra by default
 INSTALL_MOD_DIR ?= extra
-ext-mod-dir = $(INSTALL_MOD_DIR)$(subst $(KBUILD_EXTMOD),,$(@D))
+ext-mod-dir = $(INSTALL_MOD_DIR)$(subst $(patsubst %/,%,$(KBUILD_EXTMOD)),,$(@D))
 
 modinst_dir = $(if $(KBUILD_EXTMOD),$(ext-mod-dir),kernel/$(@D))
 
Signature · 1 line
1.5.3.7.1112.g9758e
#4 lore raw
Quoted 8 lines · Sam Ravnborg

Hi Eric.

Took a look at this now and fixed it like this.
Let me know if you see other issues.

[I know this is more than 6 months ago you reported it - sorry]

Sam

Wow, blast from the past; if you'd done it a bit earlier it would have been in the same year at least! *grin*

Anyway, thanks for fixing! This just bit me the other day, actually, so will be nice to have fixed.

-Eric