Skip to contentSkip to conversation

2.6.0-test4-mm3

DISCUSSION Boszormenyi Zoltan 7 participants 14 messages Aug 29, 2003 – Sep 2, 2003 2 messages not in the archive Kbuild

lore
Share & tools
lore
#0 lore raw

Hi,

I tried to "make modules_install" on the compiled tree. It says:

# make modules_install
Install a current version of module-init-tools
See http://www.codemonkey.org.uk/post-halloween-2.5.txt
make: *** [_modinst_] Error 1

But I have installed it! It's called modutils-2.4.25-8 (was -5 previously) from RH rawhide, it works on older (2.6.0-test4-mm1) kernels.
This modutils is united with module-init-tools-0.9.12, it reports version 2.4.25 but detects newer kernels and uses the new module interface.

I looked the kernel Makefile and found that it greps the version it gets from depmod -V and wants module-init-tools.
My fix against the rawhide modutils is attached.

Signature · 6 lines
Best regards,
Zoltán Böszörményi

---------------------
What did Hussein say about his knife?
One in Bush worth two in the hand.
modutils.spec renamed from modutils.spec.old +3 -1
@@ -4,7 +4,7 @@
 Summary: Kernel module management utilities.
 Name: modutils
 Version: 2.4.25
-Release: 8
+Release: 8.1
 Copyright: GPL
 Group: System Environment/Kernel
 Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/modutils/v2.4/modutils-%{version}.tar.bz2
@@ -23,6 +23,7 @@
 Patch13: module-init-tools-0.9.12-depmod-leak.patch
 Patch101: modutils-2.4.18-small.patch
 Patch1000: modutils-module-init-tools.patch
+Patch1001: module-init-tools-version-hack.patch
 Exclusiveos: Linux
 Prereq: /sbin/chkconfig sh-utils
 Obsoletes: modules
@@ -58,6 +59,7 @@
 %patch12 -p1 -b .updates
 ln -s module-init-tools-%{mitver} module-init-tools
 %patch13 -p1 -b .leak
+%patch1001 -p1 -b .version
 
 %build
 autoconf-2.13
include/version.h renamed from include/version.h.old +1 -1
@@ -1 +1 @@
-#define MODUTILS_VERSION "2.4.25"
+#define MODUTILS_VERSION "2.4.25 + module-init-tools-0.9.12 RedHat unified version"
#1 lore raw
Quoted 17 lines · Boszormenyi Zoltan

Hi,

I tried to "make modules_install" on the compiled tree. It says:

# make modules_install
Install a current version of module-init-tools
See http://www.codemonkey.org.uk/post-halloween-2.5.txt
make: *** [_modinst_] Error 1

But I have installed it! It's called modutils-2.4.25-8 (was -5 previously) from RH rawhide, it works on older (2.6.0-test4-mm1) kernels.
This modutils is united with module-init-tools-0.9.12, it reports version 2.4.25 but detects newer kernels and uses the new module interface.

Quoted 4 lines

I looked the kernel Makefile and found that it greps the version it gets from depmod -V and wants module-init-tools.
My fix against the rawhide modutils is attached.

Can you do a diff of the Makefile between 2.6.0-test4-mm1 and ...mm3

Regards,

Bas

#11 lore raw
In reply to Boszormenyi Zoltan
Quoted 9 lines · Boszormenyi Zoltan

I tried to "make modules_install" on the compiled tree. It says:

# make modules_install
Install a current version of module-init-tools
See http://www.codemonkey.org.uk/post-halloween-2.5.txt
make: *** [_modinst_] Error 1
Quoted 6 lines

But I have installed it! It's called modutils-2.4.25-8 (was -5 previously) from RH rawhide, it works on older (2.6.0-test4-mm1) kernels.
This modutils is united with module-init-tools-0.9.12, it reports version 2.4.25 but detects newer kernels and uses the new module interface.

Tricky.

It's wrong of the Red Hat package to misidentify itself in this manner.

It would sort-of make sense for depmod -V' to autodetect the kernel version and print either "modutils" or "module-init-utils". But that's not accurate either: a make modules_install' would fail when performed under a 2.4 kernel.

So yes, I think that your patch to RH modutils+module-init-tools is the best
approach: after all, it tells the truth.

Meanwhile, I'll alter Valdis's patch so that it warns, but does not fail the make.

#12 lore raw
Quoted 3 lines · Andrew Morton

Meanwhile, I'll alter Valdis's patch so that it warns, but does not fail the make.

I've sent Andrew an updated patch (attached) which issues a warning if the final depmod actually fails. The user won't know there's a problem till the very end of 'make modules_install', but at least it will give them a hint of where to go for self-help.

Makefile renamed from Makefile.hold +9 -2
@@ -209,7 +209,7 @@
 RPM 		:= $(shell if [ -x "/usr/bin/rpmbuild" ]; then echo rpmbuild; \
 		    	else echo rpm; fi)
 GENKSYMS	= scripts/genksyms/genksyms
-DEPMOD		= /sbin/depmod
+DEPMOD		= /sbin/depmod.old
 KALLSYMS	= scripts/kallsyms
 PERL		= perl
 CHECK		= sparse
@@ -612,7 +612,14 @@
 endif
 .PHONY: _modinst_post
 _modinst_post: _modinst_
-	if [ -r System.map ]; then $(DEPMOD) -ae -F System.map $(depmod_opts) $(KERNELRELEASE); fi
+	@if [ -r System.map ]; then \
+		if ! $(DEPMOD) -ae -F System.map $(depmod_opts) $(KERNELRELEASE)   ; then \
+			echo "*** Depmod failed!!!"; \
+			echo "*** You may need to install a current version of module-init-tools"; \
+			echo "*** See http://www.codemonkey.org.uk/post-halloween-2.5.txt"; \
+			exit 1; \
+	 	fi \
+	fi
 
 else # CONFIG_MODULES
 
#13 lore raw
In reply to Andrew Morton
Quoted 26 lines
Quoted 9 lines · Boszormenyi Zoltan

I tried to "make modules_install" on the compiled tree. It says:

# make modules_install
Install a current version of module-init-tools
See http://www.codemonkey.org.uk/post-halloween-2.5.txt
make: *** [_modinst_] Error 1
Quoted 6 lines

But I have installed it! It's called modutils-2.4.25-8 (was -5 previously) from RH rawhide, it works on older (2.6.0-test4-mm1) kernels.
This modutils is united with module-init-tools-0.9.12, it reports version 2.4.25 but detects newer kernels and uses the new module interface.

Tricky.

It's wrong of the Red Hat package to misidentify itself in this manner.

It would sort-of make sense for depmod -V' to autodetect the kernel version and print either "modutils" or "module-init-utils". But that's not accurate either: a make modules_install' would fail when performed under a 2.4 kernel.

Quoted 6 lines

So yes, I think that your patch to RH modutils+module-init-tools is the best
approach: after all, it tells the truth.

Meanwhile, I'll alter Valdis's patch so that it warns, but does not fail the make.

This also breaks STP. We installed module-init-tools using the 'moveold' method,
so we can still run 2.4.
Our depmod is in /usr/local/sbin.
Using /sbin/depmod hoses us. Using PATH works for us.

[root@stp1-002 linux]# depmod -V
module-init-tools 0.9.12

[root@stp1-002 linux]# /sbin/depmod -V
depmod version 2.4.22

[root@stp1-002 linux]# /usr/local/sbin/depmod -V
module-init-tools 0.9.12

Please send patch, we'll get some tests moving.
cliffw

Quoted 6 lines

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#14 lore raw
Quoted 6 lines · Cliff White

This also breaks STP. We installed module-init-tools using the 'moveold' method,
so we can still run 2.4.
Our depmod is in /usr/local/sbin.
Using /sbin/depmod hoses us. Using PATH works for us.

Hrm, but your build must be playing up already:

dhcp-140-218:/usr/src/25> grep DEPMOD Makefile
DEPMOD = /sbin/depmod

        @if [ -z "`$(DEPMOD) -V | grep module-init-tools`" ]; then \
        if [ -r System.map ]; then $(DEPMOD) -ae -F System.map $(depmod_opts) $(KERNELRELEASE); fi
Quoted 10 lines

[root@stp1-002 linux]# depmod -V
module-init-tools 0.9.12

[root@stp1-002 linux]# /sbin/depmod -V
depmod version 2.4.22

[root@stp1-002 linux]# /usr/local/sbin/depmod -V
module-init-tools 0.9.12

Please send patch, we'll get some tests moving.

Makefile renamed from Makefile~old-module-tools-warning-fix +1 -1
@@ -609,7 +609,7 @@ _modinst_:
 	@if [ -z "`$(DEPMOD) -V | grep module-init-tools`" ]; then \
 		echo "Install a current version of module-init-tools"; \
 		echo "See http://www.codemonkey.org.uk/post-halloween-2.5.txt";\
-		/bin/false; \
+		sleep 1; \
 	fi
 	@rm -rf $(MODLIB)/kernel
 	@rm -f $(MODLIB)/build

_

#15 lore raw
In reply to Cliff White

On Fri, 2003-08-29 at 18:27, Cliff White wrote:

Hi

Quoted 6 lines

This also breaks STP. We installed module-init-tools using the 'moveold' method,
so we can still run 2.4.
Our depmod is in /usr/local/sbin.
Using /sbin/depmod hoses us. Using PATH works for us.

Quoted 9 lines

[root@stp1-002 linux]# depmod -V
module-init-tools 0.9.12

[root@stp1-002 linux]# /sbin/depmod -V
depmod version 2.4.22

[root@stp1-002 linux]# /usr/local/sbin/depmod -V
module-init-tools 0.9.12

You guys are sorda missing the point of 'moveold' .... You want to build it with '--prefix=/' so that both depmod and depmod.old are in /sbin ....

----------------------
workshop root # ls /sbin/depmod* -l

-rwxr-xr-x    1 root     root        58744 Aug  4 17:19 /sbin/depmod
-rwxr-xr-x    1 root     root        58712 Aug  4 13:57 /sbin/depmod.old

workshop root # ls /sbin/modprobe* -l
lrwxrwxrwx 1 root root 6 Aug 4 17:19 /sbin/modprobe
-> insmod
lrwxrwxrwx 1 root root 10 Aug 4 13:57
/sbin/modprobe.old -> insmod.old
lrwxrwxrwx 1 root root 13 Aug 4 17:19
/sbin/modprobe.static -> insmod.static
workshop root #
------------------

Any call will then thus run depmod/whatever from module-init-tools first, and if the kernel is 2.4, etc, it will call depmod.old/whatever ...

Regards,

Signature · 1 line
Martin Schlemmer
#4 lore raw
In reply to a message not in the archive
Quoted 44 lines · Martin Schlemmer
Quoted 10 lines · On Fri, 2003-08-29 at 15:00, [email protected] wrote:
Quoted 7 lines · Boszormenyi Zoltan

I tried to "make modules_install" on the compiled tree. It says:

# make modules_install
Install a current version of module-init-tools
See http://www.codemonkey.org.uk/post-halloween-2.5.txt
make: *** [_modinst_] Error 1
Quoted 4 lines

Whoops... My fault. ;)

It was mostly a proof of concept - if there's a *known* better test I'm all ears. ;)

Cannot think of one that is known. An quick solution your (and not RH) side, might be something like below. I am though not 100% sure if this will work (does the RH patches check for modules present before calling bins from module-init-tools, or do they just yield if they detect a newer kernel?), so if somebody on a RH box could test it ...

The basic concept is that modprobe from modutils start an error message with 'modprobe:' and the one from module-init-tools starts with 'FATAL:'.

Another issue you may want to consider, is that modprobe from module-init-tools use the 'create_module' syscall to determine the kernel version, and I think that the RH patches does as well .... what are you going to do if its a 2.4 kernel running, but module-init-tools are installed? In this case even my patch are going to fail. I guess thus that you will have to try and get Boszormenyi's changes applied RH side ...

---------------
iff -puN Makefile~old-module-tools-warning Makefile

Makefile renamed from Makefile~old-module-tools-warning +0 -0
@@ -606,6 +606,11 @@ modules_install: _modinst_ _modinst_post
 

Makefile modules_install: _modinst_ _modinst_post · line 616

Quoted 10 lines
Makefile renamed from Makefile~old-module-tools-warning +5 -0
 .PHONY: _modinst_
 _modinst_:
+	@if [ -z "`modprobe -n foobar 2>&1 | egrep '^FATAL:'`" ]; then \
+		echo "Install a current version of module-init-tools"; \
+		echo "See http://www.codemonkey.org.uk/post-halloween-2.5.txt";\
+		/bin/false; \
+	fi
 	@rm -rf $(MODLIB)/kernel
 	@rm -f $(MODLIB)/build
 	@mkdir -p $(MODLIB)/kernel

----------------------

Seems like above never made it out. Anyhow, adding anything like this that fails is no good, except maybe if it checks current kernel, and if depmod then do not return a version consistent with module-init-tools if we are using a 2.5/6 kernel, fail. Reason for this, is that even with the '-V' switch, depmod.old will be called and the incorrect version supplied if we are currently on a 2.4 kernel ....

Regards,

Signature · 1 line
Martin Schlemmer
#6 lore raw
In reply to a message not in the archive
Quoted 26 lines · On Fri, 2003-08-29 at 17:53, [email protected] wrote:
Quoted 2 lines · Martin Schlemmer

Cannot think of one that is known. An quick solution your (and not RH) side, might be something like below.

What about something like this instead? I tested it with the module-init-tools and stock RH9 depmods...

Only complain if the depmod actually fails:

Makefile renamed from Makefile.hold +1 -2
@@ -209,7 +209,7 @@
 RPM 		:= $(shell if [ -x "/usr/bin/rpmbuild" ]; then echo rpmbuild; \
 		    	else echo rpm; fi)
 GENKSYMS	= scripts/genksyms/genksyms
-DEPMOD		= /sbin/depmod
+DEPMOD		= /sbin/depmod.old
 KALLSYMS	= scripts/kallsyms
 PERL		= perl
 CHECK		= sparse
@@ -612,7 +612,14 @@
 endif
 .PHONY: _modinst_post
 _modinst_post: _modinst_
-	if [ -r System.map ]; then $(DEPMOD) -ae -F System.map $(depmod_opts) $(KERNELRELEASE); fi

Makefile line 624

Quoted 10 lines
Makefile renamed from Makefile.hold +8 -0
+	@if [ -r System.map ]; then \
+		if ! $(DEPMOD) -ae -F System.map $(depmod_opts) $(KERNELRELEASE)   ; then \
+			echo "*** Depmod failed!!!"; \
+			echo "*** You may need to install a current version of module-init-tools"; \
+			echo "*** See http://www.codemonkey.org.uk/post-halloween-2.5.txt"; \
+			exit 1; \
+	 	fi \
+	fi
 
 else # CONFIG_MODULES

Hmm, this will only work with RH based systems (not using here). I think the best way is how Andrew did it to just warn if depmod fails. You may agree to disagree if need be :)

Regards,

Signature · 1 line
Martin Schlemmer
#7 lore raw
Quoted 4 lines · Martin Schlemmer

Hmm, this will only work with RH based systems (not using here). I think the best way is how Andrew did it to just warn if depmod fails. You may agree to disagree if need be :)

Andrew's version is already in mainline.

Sam

#8 lore raw
In reply to Martin Schlemmer
Quoted 1 line · Martin Schlemmer

Review

Quoted 1 line
(quoted diff) +1 -0
+		if ! $(DEPMOD) -ae -F System.map $(depmod_opts) $(KERNELRELEASE

) ; t=

Quoted 3 lines

hen \

Review

Quoted 2 lines
(quoted diff) +2 -0
+			echo "*** Depmod failed!!!"; \
+			echo "*** You may need to install a current version of 

module-init-to=

Quoted 2 lines

ols"; \

Review

Quoted 1 line
(quoted diff) +1 -0
+			echo "*** See http://www.codemonkey.org.uk/post-hallowe

en-2.5.txt"; \

Quoted 9 lines
Quoted 5 lines
(quoted diff) +3 -0
+			exit 1; \
+	 	fi \
+	fi

=20
else # CONFIG_MODULES

Hmm, this will only work with RH based systems (not using here). I think the best way is how Andrew did it to just warn if depmod fails. You may agree to disagree if need be :)

Umm.. how will this fail for *any* system that has a sane 'depmod' (sane as in "calls exit(0) if it worked"? In this patch we never actually check the version - we just add code that "if depmod fails during 'make install_modules', it may be too old and give them a hint".

(Incidentally, I tested it with the RH9 depmod, the Rusty depmod, and the Rawhide depmod - for Rusty and Rawhide it was silent, the older RH9 depmod barfed and then gave the hint...)

#9 lore raw
Quoted 21 lines · On Tue, 2003-09-02 at 01:52, [email protected] wrote:
Quoted 1 line · Martin Schlemmer

Review

Quoted 1 line
(quoted diff) +1 -0
+		if ! $(DEPMOD) -ae -F System.map $(depmod_opts) $(KERNELRELEASE

) ; t=

Quoted 3 lines

hen \

Review

Quoted 2 lines
(quoted diff) +2 -0
+			echo "*** Depmod failed!!!"; \
+			echo "*** You may need to install a current version of 

module-init-to=

Quoted 2 lines

ols"; \

Review

Quoted 1 line
(quoted diff) +1 -0
+			echo "*** See http://www.codemonkey.org.uk/post-hallowe

en-2.5.txt"; \

Quoted 9 lines
Quoted 5 lines
(quoted diff) +3 -0
+			exit 1; \
+	 	fi \
+	fi

=20
else # CONFIG_MODULES

Hmm, this will only work with RH based systems (not using here). I think the best way is how Andrew did it to just warn if depmod fails. You may agree to disagree if need be :)

Quoted 5 lines

Umm.. how will this fail for *any* system that has a sane 'depmod' (sane as in "calls exit(0) if it worked"? In this patch we never actually check the version - we just add code that "if depmod fails during 'make install_modules', it may be too old and give them a hint".

The problem I have with the patch you had here, is you changed:

DEPMOD = /sbin/depmod

to:

DEPMOD = /sbin/depmod.old

which is only the one from module-init-tools on a RH system ....

Cheers,

Signature · 1 line
Martin Schlemmer
#10 lore raw
Quoted 9 lines · Martin Schlemmer

The problem I have with the patch you had here, is you changed:

DEPMOD = /sbin/depmod

to:

DEPMOD = /sbin/depmod.old

which is only the one from module-init-tools on a RH system ....

Damn. Somebody hand me a brown paper bag. :)

(Make note to self - next time, diff the right 2 versions, not the testing version ;)

I got misdirected by your comment "this will only work with RH based systems", because (a) neither the RH9 or Rawhide tools include a depmod.old, (b) depmod.old gets created on non-Redhat systems if you install the Rusty version, and (c) using depmod.old *wont* work - so I totally failed to notice I'd botched the value of $DEPMOD. ;)