Linux wireless drivers development
 help / color / mirror / Atom feed
From: Natanael Copa <natanael.copa@gmail.com>
To: "Luis R. Rodriguez" <mcgrof@winlab.rutgers.edu>
Cc: linux-wireless@vger.kernel.org, Natanael Copa <natanael.copa@gmail.com>
Subject: [PATCH] compat-2.6: Make it possible to build without running depmod
Date: Sat, 12 Sep 2009 10:31:48 +0000	[thread overview]
Message-ID: <1252751508-4390-1-git-send-email-natanael.copa@gmail.com> (raw)

When building binary packages you normally don't want to run depmod
for the running kernel. This patch allows packagers override depmod.

 make DEPMOD=: ...

The patch also address the issue in the scripts called from Makefile
and it should be compatible with current behaviour.
---
 Makefile             |    3 ++-
 scripts/check_depmod |    2 +-
 scripts/modlib.sh    |    5 +++--
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index ab97de0..7c796ec 100644
--- a/Makefile
+++ b/Makefile
@@ -8,6 +8,7 @@ endif
 export KLIB_BUILD ?=	$(KLIB)/build
 # Sometimes not available in the path
 MODPROBE := /sbin/modprobe
+DEPMOD := /sbin/depmod
 MADWIFI=$(shell $(MODPROBE) -l ath_pci)
 OLD_IWL=$(shell $(MODPROBE) -l iwl4965)
 
@@ -182,7 +183,7 @@ uninstall:
 	@rm -f $(KLIB)/$(KMODDIR)/drivers/misc/eeprom/eeprom_93cx6.ko*
 	@rm -f $(KLIB)/$(KMODDIR)/drivers/misc/eeprom_93cx6.ko*
 	@rm -f $(KLIB)/$(KMODDIR)/drivers/net/b44.ko*
-	@/sbin/depmod -ae
+	@$(DEPMOD) -ae
 	@echo
 	@echo "Your old wireless subsystem modules were left intact:"
 	@echo 
diff --git a/scripts/check_depmod b/scripts/check_depmod
index f127a6a..0b81573 100755
--- a/scripts/check_depmod
+++ b/scripts/check_depmod
@@ -12,7 +12,7 @@ DEPMOD_DIR="/etc/depmod.d/"
 COMPAT_DEPMOD_FILE=compat-wireless.conf
 GREP_REGEX_UPDATES="^[[:space:]]*search.*[[:space:]]updates\([[:space:]]\|$\)"
 GREP_REGEX_SEARCH="^[[:space:]]*search[[:space:]].\+$"
-DEPMOD_CMD="depmod"
+DEPMOD_CMD="${DEPMOD:-depmod}"
 
 function add_compat_depmod_conf {
 	echo "NOTE: Your distribution lacks an $DEPMOD_DIR directory with "
diff --git a/scripts/modlib.sh b/scripts/modlib.sh
index 91e53f1..76d5b01 100755
--- a/scripts/modlib.sh
+++ b/scripts/modlib.sh
@@ -10,6 +10,7 @@ PATH=$PATH:/usr/sbin:/sbin
 # Appended to module file at the end when we want to ignore one
 IGNORE_SUFFIX=".ignore"
 VER=`uname -r`
+DEPMOD_CMD=${DEPMOD:-depmod}
 
 # If 'module' is found, its renamed to 'module.ignore'
 function module_disable {
@@ -39,7 +40,7 @@ function module_disable {
 			echo -en "Disabling $MODULE ..."
 		fi
 		mv -f $i ${i}${IGNORE_SUFFIX}
-		depmod -ae
+		${DEPMOD_CMD} -ae
 		CHECK_AGAIN=`modprobe -l $MODULE`
 		if [ "$CHECK" != "$CHECK_AGAIN" ]; then
 			echo -e "\t[OK]\tModule disabled:"
@@ -65,7 +66,7 @@ function module_enable {
 		echo -en "Enabling $MODULE ..."
 		DIR=`dirname $i`
 		mv $i $DIR/$MODULE_KO
-		depmod -ae
+		${DEPMOD_CMD} -ae
 		CHECK=`modprobe -l $MODULE`
 		if [ "$DIR/$MODULE_KO" != $CHECK ]; then
 			if [ -z $CHECK ]; then
-- 
1.6.4.2


                 reply	other threads:[~2009-09-12 10:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1252751508-4390-1-git-send-email-natanael.copa@gmail.com \
    --to=natanael.copa@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mcgrof@winlab.rutgers.edu \
    /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