Skip to contentSkip to conversation

modprobe -l is legacy compatibility mode and is being removed from some distros

compat-wireless Richard Farina 5 participants 8 messages Jan 24, 2012 – Feb 4, 2012 Kbuild

lore
Share & tools
lore
#0 lore raw

module-init-tools has been deprecated in favor of kmod in Arch Linux, and kmod doesn't have the legacy --list option for modprobe.
This patch fixes the areas of the Makefile which actually needed the output of modprobe -l. The other 100's of uses are just to echo info to the screen which in this case will simply fail in an extremely noisy fashion yet non-fatal way.

Please apply to all branches.

Makefile 2012-01-24 14:27:20.000000000 -0500 renamed from Makefile 2012-01-21 02:00:21.000000000 -0500 +2 -7
diff -Naur compat-wireless-3.3-rc1-2/Makefile compat-wireless-3.3-rc1-2-modinfo-migration/Makefile
@@ -9,11 +9,6 @@
 # Sometimes not available in the path
 MODPROBE := /sbin/modprobe
 
-ifneq ($(wildcard $(MODPROBE)),)
-MADWIFI=$(shell $(MODPROBE) -l ath_pci)
-OLD_IWL=$(shell $(MODPROBE) -l iwl4965)
-endif
-
 DESTDIR?=
 
 ifneq ($(KERNELRELEASE),)
@@ -188,7 +183,7 @@
     @install scripts/athload    $(DESTDIR)/usr/sbin/
     @install scripts/b43load    $(DESTDIR)/usr/sbin/
     @install scripts/iwl-load    $(DESTDIR)/usr/sbin/
-    @if [ ! -z "$(MADWIFI)" ] && [ -z "$(DESTDIR)" ]; then \
+    @if [ `modinfo ath_pci > /dev/null 2>&1` ] && [ -z "$(DESTDIR)" ]; then \
         echo ;\
         echo -n "Note: madwifi detected, we're going to disable it. "  ;\
         echo "If you would like to enable it later you can run:"  ;\
@@ -197,7 +192,7 @@
         echo Running athenable ath5k...;\
         /usr/sbin/athenable ath5k ;\
     fi
-    @if [ ! -z "$(OLD_IWL)" ] && [ -z "$(DESTDIR)" ]; then \
+    @if [ `modinfo iwl4965 > /dev/null 2>&1` ] && [ -z "$(DESTDIR)" ]; then \
         echo ;\
         echo -n "Note: iwl4965 detected, we're going to disable it. "  ;\
         echo "If you would like to enable it later you can run:"  ;\
#1 lore raw
Quoted 18 lines · Richard Farina

module-init-tools has been deprecated in favor of kmod in Arch Linux, and kmod doesn't have the legacy --list option for modprobe. This patch fixes the areas of the Makefile which actually needed the output of modprobe -l. The other 100's of uses are just to echo info to the screen which in this case will simply fail in an extremely noisy fashion yet non-fatal way.

Please apply to all branches.

diff -Naur compat-wireless-3.3-rc1-2/Makefile compat-wireless-3.3-rc1-2-modinfo-migration/Makefile
--- compat-wireless-3.3-rc1-2/Makefile 2012-01-21 02:00:21.000000000
-0500
+++ compat-wireless-3.3-rc1-2-modinfo-migration/Makefile 2012-01-24
14:27:20.000000000 -0500

Makefile 2012-01-24 14:27:20.000000000 -0500 line 16

Quoted 8 lines
Makefile 2012-01-24 14:27:20.000000000 -0500 renamed from Makefile 2012-01-21 02:00:21.000000000 -0500 +0 -5
@@ -9,11 +9,6 @@
 # Sometimes not available in the path
 MODPROBE := /sbin/modprobe
 
-ifneq ($(wildcard $(MODPROBE)),)
-MADWIFI=$(shell $(MODPROBE) -l ath_pci)
-OLD_IWL=$(shell $(MODPROBE) -l iwl4965)
-endif
-

What happens if modinfo is not available? I do not know on what systems this is the case, but I do not think that modinfo is available when modprobe is not.

Quoted 24 lines
Makefile 2012-01-24 14:27:20.000000000 -0500 renamed from Makefile 2012-01-21 02:00:21.000000000 -0500 +1 -1
 DESTDIR?=
 
 ifneq ($(KERNELRELEASE),)
@@ -188,7 +183,7 @@
     @install scripts/athload    $(DESTDIR)/usr/sbin/
     @install scripts/b43load    $(DESTDIR)/usr/sbin/
     @install scripts/iwl-load    $(DESTDIR)/usr/sbin/
-    @if [ ! -z "$(MADWIFI)" ] && [ -z "$(DESTDIR)" ]; then \
+    @if [ `modinfo ath_pci > /dev/null 2>&1` ] && [ -z "$(DESTDIR)" ];
 then \
         echo ;\
         echo -n "Note: madwifi detected, we're going to disable it. "  ;\
         echo "If you would like to enable it later you can run:"  ;\
Makefile 2012-01-24 14:27:20.000000000 -0500 renamed from Makefile 2012-01-21 02:00:21.000000000 -0500 +1 -1
@@ -197,7 +192,7 @@
         echo Running athenable ath5k...;\
         /usr/sbin/athenable ath5k ;\
     fi
-    @if [ ! -z "$(OLD_IWL)" ] && [ -z "$(DESTDIR)" ]; then \
+    @if [ `modinfo iwl4965 > /dev/null 2>&1` ] && [ -z "$(DESTDIR)" ];
 then \
         echo ;\
         echo -n "Note: iwl4965 detected, we're going to disable it. "  ;\
         echo "If you would like to enable it later you can run:"  ;\
#2 lore raw
Quoted 22 lines · Hauke Mehrtens
Quoted 21 lines · Richard Farina

module-init-tools has been deprecated in favor of kmod in Arch Linux, and kmod doesn't have the legacy --list option for modprobe. This patch fixes the areas of the Makefile which actually needed the output of modprobe -l. The other 100's of uses are just to echo info to the screen which in this case will simply fail in an extremely noisy fashion yet non-fatal way.

Please apply to all branches.

diff -Naur compat-wireless-3.3-rc1-2/Makefile compat-wireless-3.3-rc1-2-modinfo-migration/Makefile
--- compat-wireless-3.3-rc1-2/Makefile 2012-01-21 02:00:21.000000000
-0500
+++ compat-wireless-3.3-rc1-2-modinfo-migration/Makefile 2012-01-24
14:27:20.000000000 -0500

Makefile 2012-01-24 14:27:20.000000000 -0500 renamed from Makefile 2012-01-21 02:00:21.000000000 -0500 +0 -0
@@ -9,11 +9,6 @@
  # Sometimes not available in the path
  MODPROBE := /sbin/modprobe
 
Quoted 8 lines

Makefile 2012-01-24 14:27:20.000000000 -0500 line 16

Quoted 5 lines
Makefile 2012-01-24 14:27:20.000000000 -0500 renamed from Makefile 2012-01-21 02:00:21.000000000 -0500 +0 -5
-ifneq ($(wildcard $(MODPROBE)),)
-MADWIFI=$(shell $(MODPROBE) -l ath_pci)
-OLD_IWL=$(shell $(MODPROBE) -l iwl4965)
-endif
-

What happens if modinfo is not available? I do not know on what systems this is the case, but I do not think that modinfo is available when modprobe is not.

AFAIK this is never the case. modinfo is packaged with module-init-tools and on Arch module-init-tools has been replaced by KMOD which also includes modinfo. It would seem to me that at this point modinfo is a required tool and is always packaged with modprobe.

-Rick

Quoted 25 lines
Quoted 24 lines
Makefile 2012-01-24 14:27:20.000000000 -0500 renamed from Makefile 2012-01-21 02:00:21.000000000 -0500 +1 -1
  DESTDIR?=
 
  ifneq ($(KERNELRELEASE),)
@@ -188,7 +183,7 @@
      @install scripts/athload    $(DESTDIR)/usr/sbin/
      @install scripts/b43load    $(DESTDIR)/usr/sbin/
      @install scripts/iwl-load    $(DESTDIR)/usr/sbin/
-    @if [ ! -z "$(MADWIFI)" ]&&  [ -z "$(DESTDIR)" ]; then \
+    @if [ `modinfo ath_pci>  /dev/null 2>&1` ]&&  [ -z "$(DESTDIR)" ];
 then \
          echo ;\
          echo -n "Note: madwifi detected, we're going to disable it. "  ;\
          echo "If you would like to enable it later you can run:"  ;\
Makefile 2012-01-24 14:27:20.000000000 -0500 renamed from Makefile 2012-01-21 02:00:21.000000000 -0500 +1 -1
@@ -197,7 +192,7 @@
          echo Running athenable ath5k...;\
          /usr/sbin/athenable ath5k ;\
      fi
-    @if [ ! -z "$(OLD_IWL)" ]&&  [ -z "$(DESTDIR)" ]; then \
+    @if [ `modinfo iwl4965>  /dev/null 2>&1` ]&&  [ -z "$(DESTDIR)" ];
 then \
          echo ;\
          echo -n "Note: iwl4965 detected, we're going to disable it. "  ;\
          echo "If you would like to enable it later you can run:"  ;\
#3 lore raw
Quoted 35 lines · Richard Farina
Quoted 24 lines · Hauke Mehrtens
Quoted 22 lines · Richard Farina

module-init-tools has been deprecated in favor of kmod in Arch Linux, and kmod doesn't have the legacy --list option for modprobe. This patch fixes the areas of the Makefile which actually needed the output of modprobe -l. The other 100's of uses are just to echo info to the screen which in this case will simply fail in an extremely noisy fashion yet non-fatal way.

Please apply to all branches.

diff -Naur compat-wireless-3.3-rc1-2/Makefile compat-wireless-3.3-rc1-2-modinfo-migration/Makefile
--- compat-wireless-3.3-rc1-2/Makefile    2012-01-21 02:00:21.000000000 -0500
+++ compat-wireless-3.3-rc1-2-modinfo-migration/Makefile    2012-01-24 14:27:20.000000000 -0500

Makefile 2012-01-24 14:27:20.000000000 -0500 renamed from Makefile 2012-01-21 02:00:21.000000000 -0500 +0 -0
@@ -9,11 +9,6 @@
  # Sometimes not available in the path

 MODPROBE := /sbin/modprobe

Quoted 9 lines

Makefile 2012-01-24 14:27:20.000000000 -0500 line 16

Quoted 5 lines
Makefile 2012-01-24 14:27:20.000000000 -0500 renamed from Makefile 2012-01-21 02:00:21.000000000 -0500 +0 -5
-ifneq ($(wildcard $(MODPROBE)),)
-MADWIFI=$(shell $(MODPROBE) -l ath_pci)
-OLD_IWL=$(shell $(MODPROBE) -l iwl4965)
-endif
-

What happens if modinfo is not available? I do not know on what systems this is the case, but I do not think that modinfo is available when modprobe is not.

Quoted 4 lines

AFAIK this is never the case.  modinfo is packaged with module-init-tools and on Arch module-init-tools has been replaced by KMOD which also includes modinfo.  It would seem to me that at this point modinfo is a required tool and is always packaged with modprobe.

Rusty, should all Linux distributions that carry modprobe also have modinfo ?

Luis

#4 lore raw
Quoted 36 lines · Luis R. Rodriguez
Quoted 35 lines · Richard Farina
Quoted 33 lines · Hauke Mehrtens
Quoted 22 lines · Richard Farina

module-init-tools has been deprecated in favor of kmod in Arch Linux, and kmod doesn't have the legacy --list option for modprobe. This patch fixes the areas of the Makefile which actually needed the output of modprobe -l. The other 100's of uses are just to echo info to the screen which in this case will simply fail in an extremely noisy fashion yet non-fatal way.

Please apply to all branches.

diff -Naur compat-wireless-3.3-rc1-2/Makefile compat-wireless-3.3-rc1-2-modinfo-migration/Makefile
--- compat-wireless-3.3-rc1-2/Makefile    2012-01-21 02:00:21.000000000 -0500
+++ compat-wireless-3.3-rc1-2-modinfo-migration/Makefile    2012-01-24 14:27:20.000000000 -0500

Makefile 2012-01-24 14:27:20.000000000 -0500 renamed from Makefile 2012-01-21 02:00:21.000000000 -0500 +0 -0
@@ -9,11 +9,6 @@
  # Sometimes not available in the path

 MODPROBE := /sbin/modprobe

Makefile 2012-01-24 14:27:20.000000000 -0500 line 16

Quoted 5 lines
Makefile 2012-01-24 14:27:20.000000000 -0500 renamed from Makefile 2012-01-21 02:00:21.000000000 -0500 +0 -5
-ifneq ($(wildcard $(MODPROBE)),)
-MADWIFI=$(shell $(MODPROBE) -l ath_pci)
-OLD_IWL=$(shell $(MODPROBE) -l iwl4965)
-endif
-

What happens if modinfo is not available? I do not know on what systems this is the case, but I do not think that modinfo is available when modprobe is not.

Quoted 6 lines
Quoted 4 lines

AFAIK this is never the case.  modinfo is packaged with module-init-tools and on Arch module-init-tools has been replaced by KMOD which also includes modinfo.  It would seem to me that at this point modinfo is a required tool and is always packaged with modprobe.

Rusty, should all Linux distributions that carry modprobe also have modinfo ?

Yes, at least so far. But you should make sure the kmod guys are in the loop, so they know exactly what you're trying to do.

This feedback allows them to decide whether to offer it in a different way...

Cheers,
Rusty.

#5 lore raw
Quoted 27 lines · Rusty Russell
Quoted 26 lines · Luis R. Rodriguez
Quoted 25 lines · Richard Farina
Quoted 24 lines · Hauke Mehrtens
Quoted 22 lines · Richard Farina

module-init-tools has been deprecated in favor of kmod in Arch Linux, and kmod doesn't have the legacy --list option for modprobe. This patch fixes the areas of the Makefile which actually needed the output of modprobe -l. The other 100's of uses are just to echo info to the screen which in this case will simply fail in an extremely noisy fashion yet non-fatal way.

Please apply to all branches.

diff -Naur compat-wireless-3.3-rc1-2/Makefile compat-wireless-3.3-rc1-2-modinfo-migration/Makefile
--- compat-wireless-3.3-rc1-2/Makefile    2012-01-21 02:00:21.000000000 -0500
+++ compat-wireless-3.3-rc1-2-modinfo-migration/Makefile    2012-01-24 14:27:20.000000000 -0500

Makefile 2012-01-24 14:27:20.000000000 -0500 renamed from Makefile 2012-01-21 02:00:21.000000000 -0500 +0 -0
@@ -9,11 +9,6 @@
  # Sometimes not available in the path

 MODPROBE := /sbin/modprobe

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

Makefile 2012-01-24 14:27:20.000000000 -0500 line 16

Quoted 5 lines
Makefile 2012-01-24 14:27:20.000000000 -0500 renamed from Makefile 2012-01-21 02:00:21.000000000 -0500 +0 -5
-ifneq ($(wildcard $(MODPROBE)),)
-MADWIFI=$(shell $(MODPROBE) -l ath_pci)
-OLD_IWL=$(shell $(MODPROBE) -l iwl4965)
-endif
-

Why do you need to know this? If you really need this, it can be well accomplished by 'find'. That's the reason it was removed from modprobe (and it was already deprecated in module-init-tools).

But what's the point in knowing where the file is?

Quoted 10 lines
Quoted 10 lines
Quoted 9 lines
Quoted 4 lines

What happens if modinfo is not available? I do not know on what systems this is the case, but I do not think that modinfo is available when modprobe is not.

AFAIK this is never the case.  modinfo is packaged with module-init-tools and on Arch module-init-tools has been replaced by KMOD which also includes modinfo.  It would seem to me that at this point modinfo is a required tool and is always packaged with modprobe.

Quoted 5 lines
Quoted 1 line

Rusty, should all Linux distributions that carry modprobe also have modinfo ?

Yes, at least so far. But you should make sure the kmod guys are in the loop, so they know exactly what you're trying to do.

Yes, let us know what exactly you are trying to accomplish here.

Lucas De Marchi

#6 lore raw
In reply to Richard Farina
Quoted 7 lines · Richard Farina

module-init-tools has been deprecated in favor of kmod in Arch Linux, and kmod doesn't have the legacy --list option for modprobe.
This patch fixes the areas of the Makefile which actually needed the output of modprobe -l. The other 100's of uses are just to echo info to the screen which in this case will simply fail in an extremely noisy fashion yet non-fatal way.

Quoted 8 lines

Please apply to all branches.

diff -Naur compat-wireless-3.3-rc1-2/Makefile compat-wireless-3.3-rc1-2-modinfo-migration/Makefile
--- compat-wireless-3.3-rc1-2/Makefile    2012-01-21 02:00:21.000000000 -0500

This patch form is not valid. Not sure if it was your SMTP or what but its busted and I cannot apply it even if I try to salvage it manually. Please consider using git on top of the latest master branch:

git://github.com/mcgrof/compat-wireless.git

And then please consider sending me patches using ssmtp or something that will respect the form so that I can apply the patch accordingly. For instructions you can read:

http://wireless.kernel.org/en/developers/Documentation/git-guide

You can read the ssmtp section, it covers gmail.

Quoted 15 lines

+++ compat-wireless-3.3-rc1-2-modinfo-migration/Makefile    2012-01-24 14:27:20.000000000 -0500

Makefile 2012-01-24 14:27:20.000000000 -0500 renamed from Makefile 2012-01-21 02:00:21.000000000 -0500 +0 -0
@@ -9,11 +9,6 @@
  # Sometimes not available in the path

 MODPROBE := /sbin/modprobe

Makefile 2012-01-24 14:27:20.000000000 -0500 renamed from Makefile 2012-01-21 02:00:21.000000000 -0500 +0 -5
-ifneq ($(wildcard $(MODPROBE)),)
-MADWIFI=$(shell $(MODPROBE) -l ath_pci)
-OLD_IWL=$(shell $(MODPROBE) -l iwl4965)
-endif
-

 DESTDIR?=

 ifneq ($(KERNELRELEASE),)

(quoted diff) +0 -0
@@ -188,7 +183,7 @@
Quoted 6 lines

    @install scripts/athload    $(DESTDIR)/usr/sbin/
    @install scripts/b43load    $(DESTDIR)/usr/sbin/
    @install scripts/iwl-load    $(DESTDIR)/usr/sbin/
-    @if [ ! -z "$(MADWIFI)" ] && [ -z "$(DESTDIR)" ]; then \
+    @if [ modinfo ath_pci > /dev/null 2>&1 ] && [ -z "$(DESTDIR)" ]; then \

This check never values to true for me. Did you test it?

$ if [ `modinfo ath9k > /dev/null 2>&1` ] ; then echo module exists;
else echo module does not exist; fi

module does not exist

So at least for me this check does not work. Also consider using something like $(modinfo ath9k), it looks a lot nicer than the modinfo ath9k stuff.

Quoted 10 lines

        echo ;\
        echo -n "Note: madwifi detected, we're going to disable it. "  ;\
        echo "If you would like to enable it later you can run:"  ;\

Makefile 2012-01-24 14:27:20.000000000 -0500 renamed from Makefile 2012-01-21 02:00:21.000000000 -0500 +0 -0
@@ -197,7 +192,7 @@
         echo Running athenable ath5k...;\
         /usr/sbin/athenable ath5k ;\

    fi
-    @if [ ! -z "$(OLD_IWL)" ] && [ -z "$(DESTDIR)" ]; then \
+    @if [ modinfo iwl4965 > /dev/null 2>&1 ] && [ -z "$(DESTDIR)" ]; then \

Same here.

Luis

#7 lore raw
Quoted 22 lines · Luis R. Rodriguez
Quoted 7 lines · Richard Farina

module-init-tools has been deprecated in favor of kmod in Arch Linux, and kmod doesn't have the legacy --list option for modprobe.
This patch fixes the areas of the Makefile which actually needed the output of modprobe -l. The other 100's of uses are just to echo info to the screen which in this case will simply fail in an extremely noisy fashion yet non-fatal way.

Quoted 8 lines

Please apply to all branches.

diff -Naur compat-wireless-3.3-rc1-2/Makefile compat-wireless-3.3-rc1-2-modinfo-migration/Makefile
--- compat-wireless-3.3-rc1-2/Makefile 2012-01-21 02:00:21.000000000
-0500

This patch form is not valid. Not sure if it was your SMTP or what but its busted and I cannot apply it even if I try to salvage it manually. Please consider using git on top of the latest master branch:

git://github.com/mcgrof/compat-wireless.git

Quoted 7 lines

And then please consider sending me patches using ssmtp or something that will respect the form so that I can apply the patch accordingly. For instructions you can read:

http://wireless.kernel.org/en/developers/Documentation/git-guide

You can read the ssmtp section, it covers gmail.

I read like 10 guides on how to submit patches, I just sent, I hope I got it right....

Quoted 24 lines
Quoted 16 lines

+++ compat-wireless-3.3-rc1-2-modinfo-migration/Makefile 2012-01-24
14:27:20.000000000 -0500

Makefile 2012-01-24 14:27:20.000000000 -0500 renamed from Makefile 2012-01-21 02:00:21.000000000 -0500 +0 -5
@@ -9,11 +9,6 @@
 # Sometimes not available in the path
 MODPROBE := /sbin/modprobe
 
-ifneq ($(wildcard $(MODPROBE)),)
-MADWIFI=$(shell $(MODPROBE) -l ath_pci)
-OLD_IWL=$(shell $(MODPROBE) -l iwl4965)
-endif
-
 DESTDIR?=
 
 ifneq ($(KERNELRELEASE),)

Makefile 2012-01-24 14:27:20.000000000 -0500 line 187

Quoted 6 lines
Makefile 2012-01-24 14:27:20.000000000 -0500 renamed from Makefile 2012-01-21 02:00:21.000000000 -0500 +1 -1
@@ -188,7 +183,7 @@
    @install scripts/athload    $(DESTDIR)/usr/sbin/
    @install scripts/b43load    $(DESTDIR)/usr/sbin/
    @install scripts/iwl-load    $(DESTDIR)/usr/sbin/
-    @if [ ! -z "$(MADWIFI)" ] && [ -z "$(DESTDIR)" ]; then \
+    @if [ `modinfo ath_pci > /dev/null 2>&1` ] && [ -z "$(DESTDIR)" ]; then
 \

This check never values to true for me. Did you test it?

Quoted 8 lines
$ if [ `modinfo ath9k > /dev/null 2>&1` ] ; then echo module exists;
else echo module does not exist; fi

module does not exist

So at least for me this check does not work. Also consider using something like $(modinfo ath9k), it looks a lot nicer than the modinfo ath9k stuff.

Yeah... I messed up on that check in this patch as well as somewhere else, the resend fixes it.

Thanks,
Rick Farina

Quoted 14 lines

Makefile 2012-01-24 14:27:20.000000000 -0500 line 196

Quoted 10 lines
Makefile 2012-01-24 14:27:20.000000000 -0500 renamed from Makefile 2012-01-21 02:00:21.000000000 -0500 +0 -0
        echo ;\
        echo -n "Note: madwifi detected, we're going to disable it. "  ;\
        echo "If you would like to enable it later you can run:"  ;\
Makefile 2012-01-24 14:27:20.000000000 -0500 renamed from Makefile 2012-01-21 02:00:21.000000000 -0500 +1 -1
@@ -197,7 +192,7 @@
        echo Running athenable ath5k...;\
        /usr/sbin/athenable ath5k ;\
    fi
-    @if [ ! -z "$(OLD_IWL)" ] && [ -z "$(DESTDIR)" ]; then \
+    @if [ `modinfo iwl4965 > /dev/null 2>&1` ] && [ -z "$(DESTDIR)" ]; then
 \

Same here.

Luis