summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--tools/nfsrahead/99-nfs.rules1
-rw-r--r--tools/nfsrahead/99-nfs.rules.in1
-rw-r--r--tools/nfsrahead/Makefile.am8
4 files changed, 11 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 38ab1d3..df791a8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -62,6 +62,7 @@ tools/locktest/testlk
tools/getiversion/getiversion
tools/nfsconf/nfsconf
tools/nfsrahead/nfsrahead
+tools/nfsrahead/99-nfs_bdi.rules
support/export/mount.h
support/export/mount_clnt.c
support/export/mount_xdr.c
diff --git a/tools/nfsrahead/99-nfs.rules b/tools/nfsrahead/99-nfs.rules
new file mode 100644
index 0000000..f5a7660
--- /dev/null
+++ b/tools/nfsrahead/99-nfs.rules
@@ -0,0 +1 @@
+SUBSYSTEM=="bdi", ACTION=="add", PROGRAM="/usr/libexec/nfsrahead", ATTR{read_ahead_kb}="%c"
diff --git a/tools/nfsrahead/99-nfs.rules.in b/tools/nfsrahead/99-nfs.rules.in
new file mode 100644
index 0000000..7d55b40
--- /dev/null
+++ b/tools/nfsrahead/99-nfs.rules.in
@@ -0,0 +1 @@
+SUBSYSTEM=="bdi", ACTION=="add", PROGRAM="_libexecdir_/nfsrahead", ATTR{read_ahead_kb}="%c"
diff --git a/tools/nfsrahead/Makefile.am b/tools/nfsrahead/Makefile.am
index edff792..58a2ea2 100644
--- a/tools/nfsrahead/Makefile.am
+++ b/tools/nfsrahead/Makefile.am
@@ -1,3 +1,11 @@
libexec_PROGRAMS = nfsrahead
nfsrahead_SOURCES = main.c
+udev_rulesdir = /usr/lib/udev/rules.d/
+udev_rules_DATA = 99-nfs.rules
+
+99-nfs.rules: 99-nfs.rules.in $(builddefs)
+ $(SED) "s|_libexecdir_|@libexecdir@|g" 99-nfs.rules.in > $@
+
+clean-local:
+ $(RM) 99-nfs.rules