nixpkgs/pkgs/os-specific/linux/ndiswrapper/prefix.patch
Yury G. Kudryashov eaca7f368c Added prefix patch to ndiswrapper
svn path=/nixpkgs/trunk/; revision=10323
2008-01-28 19:34:00 +00:00

79 lines
2.5 KiB
Diff

diff --git a/ndiswrapper/driver/Makefile b/ndiswrapper/driver/Makefile
index b0c2a9d..8907a05 100644
--- a/ndiswrapper/driver/Makefile
+++ b/ndiswrapper/driver/Makefile
@@ -119,6 +119,10 @@ ifdef WRAP_PREEMPT
MOD_CFLAGS += -DWRAP_PREEMPT
endif
+ifdef DIST_DESTDIR
+MOD_CFLAGS += -DPREFIX=\"$(DIST_DESTDIR)\"
+endif
+
.PHONY: prereq_check gen_exports clean dist_clean install stack_check
all : prereq_check win2lin_stubs.h gen_exports compat.h default stack_check
@@ -355,7 +359,7 @@ install: prereq_check win2lin_stubs.h gen_exports compat.h default stack_check
echo $(INST_DIR)
mkdir -p $(INST_DIR)
install -m 0644 $(MODULE) $(INST_DIR)
- -@/bin/rm -rf $(SRC_DIR)/.tmp_versions
+ -@rm -rf $(SRC_DIR)/.tmp_versions
ifndef DIST_DESTDIR
-/sbin/depmod -a $(KVERS) -b $(DESTDIR)
endif
diff --git a/ndiswrapper/driver/loader.c b/ndiswrapper/driver/loader.c
index 930606f..9a8e9f0 100644
--- a/ndiswrapper/driver/loader.c
+++ b/ndiswrapper/driver/loader.c
@@ -106,7 +106,7 @@ struct wrap_driver *load_wrap_driver(struct wrap_device *wd)
EXIT1(return NULL);
}
INIT_COMPLETION(loader_complete);
- ret = call_usermodehelper("/sbin/loadndisdriver", argv, env
+ ret = call_usermodehelper(USERMOD_HELPER, argv, env
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
, 1
#endif
@@ -272,7 +272,7 @@ struct wrap_bin_file *get_bin_file(char *bin_file_name)
EXIT1(return NULL);
}
INIT_COMPLETION(loader_complete);
- ret = call_usermodehelper("/sbin/loadndisdriver", argv, env
+ ret = call_usermodehelper(USERMOD_HELPER, argv, env
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
, 1
#endif
@@ -711,7 +711,7 @@ struct wrap_device *load_wrap_device(struct load_device *load_device)
EXIT1(return NULL);
}
INIT_COMPLETION(loader_complete);
- ret = call_usermodehelper("/sbin/loadndisdriver", argv, env
+ ret = call_usermodehelper(USERMOD_HELPER, argv, env
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
, 1
#endif
diff --git a/ndiswrapper/driver/ndiswrapper.h b/ndiswrapper/driver/ndiswrapper.h
index 4a78dc6..c11a074 100644
--- a/ndiswrapper/driver/ndiswrapper.h
+++ b/ndiswrapper/driver/ndiswrapper.h
@@ -19,8 +19,17 @@
#define DRIVER_VERSION "1.50"
#define UTILS_VERSION "1.9"
+#ifndef PREFIX
+#define PREFIX
+#endif
+
#define DRIVER_NAME "ndiswrapper"
-#define DRIVER_CONFIG_DIR "/etc/ndiswrapper"
+
+#ifndef DRIVER_CONFIG_DIR
+# define DRIVER_CONFIG_DIR PREFIX "/etc/ndiswrapper"
+#endif
+
+#define USERMOD_HELPER PREFIX "/sbin/loadndisdriver"
#define SSID_MAX_WPA_IE_LEN 40
#define NDIS_ESSID_MAX_SIZE 32