linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [compat-wireless] replace modprobe -l with functional equivilent
@ 2012-02-19 16:03 Rick Farina
  2012-02-24  1:39 ` Luis R. Rodriguez
  0 siblings, 1 reply; 3+ messages in thread
From: Rick Farina @ 2012-02-19 16:03 UTC (permalink / raw)
  To: mcgrof; +Cc: linux-wireless, Rick Farina

modprobe -l is either deprecated or removed, so let's replace it

Signed-off-by: Rick Farina <sidhayn@gmail.com>
---
 Makefile |   22 +++++++---------------
 1 files changed, 7 insertions(+), 15 deletions(-)

diff --git a/Makefile b/Makefile
index 4149d8d..0403a34 100644
--- a/Makefile
+++ b/Makefile
@@ -6,14 +6,6 @@ else
 export KLIB:=          /lib/modules/$(shell uname -r)
 endif
 export KLIB_BUILD ?=	$(KLIB)/build
-# Sometimes not available in the path
-MODPROBE := /sbin/modprobe
-
-ifneq ($(wildcard $(MODPROBE)),)
-MADWIFI=$(shell $(MODPROBE) -l ath_pci)
-OLD_IWL=$(shell $(MODPROBE) -l iwl4965)
-OLD_ALX=$(shell $(MODPROBE) -l atl1c)
-endif
 
 DESTDIR?=
 
@@ -99,7 +91,7 @@ $(CREL_CHECK):
 
 btinstall: btuninstall bt-install-modules
 
-bt-install-modules: bt $(MODPROBE)
+bt-install-modules: bt
 	$(MAKE) -C $(KLIB_BUILD) M=$(PWD) $(KMODDIR_ARG) $(KMODPATH_ARG) BT=TRUE \
 		modules_install
 	@/sbin/depmod -ae
@@ -111,7 +103,7 @@ bt-install-modules: bt $(MODPROBE)
 	@echo And then load the needed bluetooth modules. If unsure reboot.
 	@echo
 
-btuninstall: $(MODPROBE)
+btuninstall:
 	@# New location, matches upstream
 	@rm -rf $(KLIB)/$(KMODDIR)/net/bluetooth/
 	@rm -rf $(KLIB)/$(KMODDIR)/drivers/bluetooth/
@@ -131,7 +123,7 @@ install-modules: modules
 		modules_install
 	@./scripts/update-initramfs
 
-install-scripts: $(MODPROBE)
+install-scripts:
 	@# All the scripts we can use
 	@mkdir -p $(DESTDIR)/usr/lib/compat-wireless/
 	@install scripts/modlib.sh	$(DESTDIR)/usr/lib/compat-wireless/
@@ -144,7 +136,7 @@ install-scripts: $(MODPROBE)
 	@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:"  ;\
@@ -153,7 +145,7 @@ install-scripts: $(MODPROBE)
 		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:"  ;\
@@ -162,7 +154,7 @@ install-scripts: $(MODPROBE)
 		echo Running iwl-enable iwlagn...;\
 		/usr/sbin/iwl-enable iwlagn ;\
 	fi
-	@if [ ! -z "$(OLD_ALX)" ] && [ -z "$(DESTDIR)" ]; then \
+	@if $(modinfo atl1c > /dev/null 2>&1) && [ -z "$(DESTDIR)" ]; then \
 		echo ;\
 		echo -n "Note: atl1c detected, we're going to disable it. "  ;\
 		echo "If you would like to enable it later you can run:"  ;\
@@ -195,7 +187,7 @@ install-scripts: $(MODPROBE)
 	@echo If unsure reboot.
 	@echo
 
-uninstall: $(MODPROBE)
+uninstall:
 	@# New location, matches upstream
 	@rm -rf $(KLIB)/$(KMODDIR)/compat/
 	@rm -rf $(KLIB)/$(KMODDIR)/net/mac80211/
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] [compat-wireless] replace modprobe -l with functional equivilent
  2012-02-19 16:03 [PATCH] [compat-wireless] replace modprobe -l with functional equivilent Rick Farina
@ 2012-02-24  1:39 ` Luis R. Rodriguez
  2012-02-24  4:58   ` Richard Farina
  0 siblings, 1 reply; 3+ messages in thread
From: Luis R. Rodriguez @ 2012-02-24  1:39 UTC (permalink / raw)
  To: Rick Farina; +Cc: linux-wireless

On Sun, Feb 19, 2012 at 8:03 AM, Rick Farina <sidhayn@gmail.com> wrote:
> modprobe -l is either deprecated or removed, so let's replace it
>
> Signed-off-by: Rick Farina <sidhayn@gmail.com>

Did you test this when one of those modules is present?

  Luis

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] [compat-wireless] replace modprobe -l with functional equivilent
  2012-02-24  1:39 ` Luis R. Rodriguez
@ 2012-02-24  4:58   ` Richard Farina
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Farina @ 2012-02-24  4:58 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: linux-wireless

On 02/23/12 20:39, Luis R. Rodriguez wrote:
> On Sun, Feb 19, 2012 at 8:03 AM, Rick Farina <sidhayn@gmail.com> wrote:
>> modprobe -l is either deprecated or removed, so let's replace it
>>
>> Signed-off-by: Rick Farina <sidhayn@gmail.com>
> Did you test this when one of those modules is present?
ozzie compat-wireless # $(modinfo compat > /dev/null 2>&1) && echo yes
yes
ozzie compat-wireless #


The logic is sound, I use the same test in another script and it works
great.  It's a bit unusual I realize, but it works and it's all I could
think of.  It tests the exit value of modinfo which is true when the
module exists and false when it doesn't.  Simple as I could manage.

-Rick

>
>   Luis
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-02-24  4:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-19 16:03 [PATCH] [compat-wireless] replace modprobe -l with functional equivilent Rick Farina
2012-02-24  1:39 ` Luis R. Rodriguez
2012-02-24  4:58   ` Richard Farina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).