From: Rick Farina <sidhayn@gmail.com>
To: mcgrof@gmail.com
Cc: linux-wireless@vger.kernel.org, Rick Farina <sidhayn@gmail.com>
Subject: [PATCH]v5 compat-wireless: replace modprobe -l with functional equivilent
Date: Fri, 24 Feb 2012 21:28:40 -0500 [thread overview]
Message-ID: <1330136920-15954-1-git-send-email-sidhayn@gmail.com> (raw)
modprobe -l is either deprecated or removed, so let's replace it
testing [ -z "$(DESTDIR)" ] appeared to only be need due to the fact
that *enable was run directly instead of being run with $(DESTDIR)/
Testing for module presence should now work properly on modern distros
and *enable will be run properly with or without $(DESTDIR) being set.
Signed-off-by: Rick Farina <sidhayn@gmail.com>
---
Makefile | 30 ++++++++++--------------------
1 files changed, 10 insertions(+), 20 deletions(-)
diff --git a/Makefile b/Makefile
index 5393b40..ef2f671 100644
--- a/Makefile
+++ b/Makefile
@@ -6,15 +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
-export MAKE
-
-ifneq ($(wildcard $(MODPROBE)),)
-MADWIFI=$(shell $(MODPROBE) -l ath_pci)
-OLD_IWL=$(shell $(MODPROBE) -l iwl4965)
-OLD_ALX=$(shell $(MODPROBE) -l atl1c)
-endif
DESTDIR?=
@@ -109,7 +100,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
@@ -121,7 +112,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/
@@ -141,7 +132,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/
@@ -154,32 +145,31 @@ 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 \
- echo ;\
+ @if $(modinfo ath_pci > /dev/null 2>&1); then \
echo -n "Note: madwifi detected, we're going to disable it. " ;\
echo "If you would like to enable it later you can run:" ;\
echo " sudo athenable madwifi" ;\
echo ;\
echo Running athenable ath5k...;\
- /usr/sbin/athenable ath5k ;\
+ $(DESTDIR)/usr/sbin/athenable ath5k ;\
fi
- @if [ ! -z "$(OLD_IWL)" ] && [ -z "$(DESTDIR)" ]; then \
+ @if $(modinfo iwl4965 > /dev/null 2>&1); 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:" ;\
echo " sudo iwl-load iwl4965" ;\
echo ;\
echo Running iwl-enable iwlagn...;\
- /usr/sbin/iwl-enable iwlagn ;\
+ $(DESTDIR)/usr/sbin/iwl-enable iwlagn ;\
fi
- @if [ ! -z "$(OLD_ALX)" ] && [ -z "$(DESTDIR)" ]; then \
+ @if $(modinfo atl1c > /dev/null 2>&1); 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:" ;\
echo " sudo alx-load atl1c" ;\
echo ;\
echo Running alx-enable alx...;\
- /usr/sbin/alx-enable alx;\
+ $(DESTDIR)/usr/sbin/alx-enable alx;\
fi
@# If on distributions like Mandriva which like to
@# compress their modules this will find out and do
@@ -205,7 +195,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
next reply other threads:[~2012-02-25 2:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-25 2:28 Rick Farina [this message]
2012-02-25 2:41 ` [PATCH]v5 compat-wireless: replace modprobe -l with functional equivilent Luis R. Rodriguez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1330136920-15954-1-git-send-email-sidhayn@gmail.com \
--to=sidhayn@gmail.com \
--cc=linux-wireless@vger.kernel.org \
--cc=mcgrof@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox