summaryrefslogtreecommitdiffstats
path: root/package/hotplug2
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2007-05-05 18:33:18 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2007-05-05 18:33:18 +0000
commit2d6b53deec9dab294cb8e0aafe81ecc7aba5ba4e (patch)
treee281bcd95cb9e165ddac1b4ae8f002f20e6acff9 /package/hotplug2
parentb755dc66dfca48518b24450277173be4671fcde5 (diff)
use hotplug2 for serializing hotplug events on 2.6
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@7097 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/hotplug2')
-rw-r--r--package/hotplug2/Makefile4
-rw-r--r--package/hotplug2/files/hotplug2-init.rules9
-rw-r--r--package/hotplug2/files/hotplug2.rules12
-rw-r--r--package/hotplug2/patches/100-rules_override.patch34
4 files changed, 58 insertions, 1 deletions
diff --git a/package/hotplug2/Makefile b/package/hotplug2/Makefile
index 6c2a0a105..6b69bac73 100644
--- a/package/hotplug2/Makefile
+++ b/package/hotplug2/Makefile
@@ -21,7 +21,6 @@ include $(INCLUDE_DIR)/package.mk
define Package/hotplug2
SECTION:=utils
CATEGORY:=Utilities
- DEPENDS:=@LINUX_2_6 +udevtrigger
TITLE:=Dynamic device management subsystem for embedded systems
URL:=http://isteve.bofh.cz/~isteve/hotplug2/
endef
@@ -32,6 +31,9 @@ in a tiny pack, intended for Linux early userspace: Init RAM FS and InitRD.
endef
define Package/hotplug2/install
+ $(INSTALL_DIR) $(1)/etc
+ $(INSTALL_DATA) ./files/hotplug2.rules $(1)/etc/
+ $(INSTALL_DATA) ./files/hotplug2-init.rules $(1)/etc/
$(INSTALL_DIR) $(1)/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/hotplug2 $(1)/sbin/
endef
diff --git a/package/hotplug2/files/hotplug2-init.rules b/package/hotplug2/files/hotplug2-init.rules
new file mode 100644
index 000000000..6efd54668
--- /dev/null
+++ b/package/hotplug2/files/hotplug2-init.rules
@@ -0,0 +1,9 @@
+DEVICENAME ~~ (tun|tap[0-9]) {
+ makedev /dev/net/%DEVICENAME% 0644
+ next
+}
+
+DEVPATH is set {
+ makedev /dev/%DEVICENAME% 0644
+}
+
diff --git a/package/hotplug2/files/hotplug2.rules b/package/hotplug2/files/hotplug2.rules
new file mode 100644
index 000000000..ebd96fa33
--- /dev/null
+++ b/package/hotplug2/files/hotplug2.rules
@@ -0,0 +1,12 @@
+DEVICENAME ~~ (tun|tap[0-9]) {
+ makedev /dev/net/%DEVICENAME% 0644
+ next
+}
+
+DEVPATH is set {
+ makedev /dev/%DEVICENAME% 0644
+}
+
+SUBSYSTEM ~~ (net|button) {
+ exec /sbin/hotplug-call %SUBSYSTEM%;
+}
diff --git a/package/hotplug2/patches/100-rules_override.patch b/package/hotplug2/patches/100-rules_override.patch
new file mode 100644
index 000000000..0d3b672e6
--- /dev/null
+++ b/package/hotplug2/patches/100-rules_override.patch
@@ -0,0 +1,34 @@
+diff -ur hotplug2.old/hotplug2.c hotplug2.dev/hotplug2.c
+--- hotplug2.old/hotplug2.c 2006-10-08 15:18:23.000000000 +0200
++++ hotplug2.dev/hotplug2.c 2007-05-05 11:38:51.456551560 +0200
+@@ -391,6 +391,7 @@
+ int rv = 0;
+ int i;
+ char *coldplug_command = NULL;
++ char *rules_file = HOTPLUG2_RULE_PATH;
+ sigset_t block_mask;
+
+ struct rules_t *rules = NULL;
+@@ -435,6 +436,13 @@
+ break;
+
+ modprobe_command = *argv;
++ } else if (!strcmp(*argv, "--set-rules-file")) {
++ argv++;
++ argc--;
++ if (argc <= 0)
++ break;
++
++ rules_file = *argv;
+ }
+ }
+ }
+@@ -443,7 +451,7 @@
+ #ifdef HAVE_RULES
+ if (!dumb) {
+ filemap = MAP_FAILED;
+- rule_fd = open(HOTPLUG2_RULE_PATH, O_RDONLY | O_NOATIME);
++ rule_fd = open(rules_file, O_RDONLY | O_NOATIME);
+ if (rule_fd == -1) {
+ dumb = 1;
+ ERROR("rules parse","Unable to open rules file: %s.", strerror(errno));