summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.am2
-rw-r--r--cmd/sas_switch_id/Makefile.am2
-rw-r--r--cmd/zpool_id/Makefile.am2
-rw-r--r--cmd/zvol_id/Makefile.am2
-rw-r--r--config/user-udev.m414
-rw-r--r--config/user.m41
-rw-r--r--configure.ac4
-rwxr-xr-xdracut/90zfs/module-setup.sh4
-rw-r--r--etc/Makefile.am2
-rw-r--r--etc/udev/rules.d/Makefile.am15
-rw-r--r--udev/Makefile.am (renamed from etc/udev/Makefile.am)0
-rw-r--r--udev/Makefile.in (renamed from etc/udev/Makefile.in)0
-rw-r--r--udev/rules.d/.gitignore (renamed from etc/udev/rules.d/.gitignore)0
-rw-r--r--udev/rules.d/60-zpool.rules.in (renamed from etc/udev/rules.d/60-zpool.rules.in)4
-rw-r--r--udev/rules.d/60-zvol.rules.in (renamed from etc/udev/rules.d/60-zvol.rules.in)2
-rw-r--r--udev/rules.d/Makefile.am14
-rw-r--r--udev/rules.d/Makefile.in (renamed from etc/udev/rules.d/Makefile.in)0
-rw-r--r--zfs.spec.in7
18 files changed, 45 insertions, 30 deletions
diff --git a/Makefile.am b/Makefile.am
index c6ed2009f..17e4c9ccb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3,7 +3,7 @@ include $(top_srcdir)/config/deb.am
include $(top_srcdir)/config/tgz.am
if CONFIG_USER
-USER_DIR = dracut etc man scripts lib cmd
+USER_DIR = dracut udev etc man scripts lib cmd
endif
if CONFIG_KERNEL
KERNEL_DIR = module
diff --git a/cmd/sas_switch_id/Makefile.am b/cmd/sas_switch_id/Makefile.am
index 092766369..b666bea0a 100644
--- a/cmd/sas_switch_id/Makefile.am
+++ b/cmd/sas_switch_id/Makefile.am
@@ -1 +1 @@
-dist_bin_SCRIPTS = sas_switch_id
+dist_udev_SCRIPTS = sas_switch_id
diff --git a/cmd/zpool_id/Makefile.am b/cmd/zpool_id/Makefile.am
index 023e1ab59..5f492cfd7 100644
--- a/cmd/zpool_id/Makefile.am
+++ b/cmd/zpool_id/Makefile.am
@@ -1 +1 @@
-dist_bin_SCRIPTS = zpool_id
+dist_udev_SCRIPTS = zpool_id
diff --git a/cmd/zvol_id/Makefile.am b/cmd/zvol_id/Makefile.am
index dcdea58b9..88ece6b19 100644
--- a/cmd/zvol_id/Makefile.am
+++ b/cmd/zvol_id/Makefile.am
@@ -4,7 +4,7 @@ DEFAULT_INCLUDES += \
-I$(top_srcdir)/include \
-I$(top_srcdir)/lib/libspl/include
-bin_PROGRAMS = zvol_id
+udev_PROGRAMS = zvol_id
zvol_id_SOURCES = \
$(top_srcdir)/cmd/zvol_id/zvol_id_main.c
diff --git a/config/user-udev.m4 b/config/user-udev.m4
new file mode 100644
index 000000000..47da60478
--- /dev/null
+++ b/config/user-udev.m4
@@ -0,0 +1,14 @@
+AC_DEFUN([ZFS_AC_CONFIG_USER_UDEV], [
+ AC_ARG_WITH(udevdir,
+ AC_HELP_STRING([--with-udevdir=DIR],
+ [install udev helpers [[EPREFIX/lib/udev]]]),
+ udevdir=$withval, udevdir='${exec_prefix}/lib/udev')
+
+ AC_ARG_WITH(udevruledir,
+ AC_HELP_STRING([--with-udevruledir=DIR],
+ [install udev rules [[UDEVDIR/rules.d]]]),
+ udevruledir=$withval, udevruledir='${udevdir}/rules.d')
+
+ AC_SUBST(udevdir)
+ AC_SUBST(udevruledir)
+])
diff --git a/config/user.m4 b/config/user.m4
index a79deefe8..4fcef3d5b 100644
--- a/config/user.m4
+++ b/config/user.m4
@@ -2,6 +2,7 @@ dnl #
dnl # Default ZFS user configuration
dnl #
AC_DEFUN([ZFS_AC_CONFIG_USER], [
+ ZFS_AC_CONFIG_USER_UDEV
ZFS_AC_CONFIG_USER_ARCH
ZFS_AC_CONFIG_USER_IOCTL
ZFS_AC_CONFIG_USER_ZLIB
diff --git a/configure.ac b/configure.ac
index 8afd0fcad..8b0f1d5e0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -57,9 +57,9 @@ AC_CONFIG_FILES([
Makefile
dracut/Makefile
dracut/90zfs/Makefile
+ udev/Makefile
+ udev/rules.d/Makefile
etc/Makefile
- etc/udev/Makefile
- etc/udev/rules.d/Makefile
etc/init.d/Makefile
etc/init.d/zfs.arch
etc/init.d/zfs.gentoo
diff --git a/dracut/90zfs/module-setup.sh b/dracut/90zfs/module-setup.sh
index 6dd3d5c17..822f89988 100755
--- a/dracut/90zfs/module-setup.sh
+++ b/dracut/90zfs/module-setup.sh
@@ -29,8 +29,8 @@ installkernel() {
install() {
inst_rules "$moddir/90-zfs.rules"
- inst_rules /etc/udev/rules.d/60-zpool.rules
- inst_rules /etc/udev/rules.d/60-zvol.rules
+ inst_rules /lib/udev/rules.d/60-zpool.rules
+ inst_rules /lib/udev/rules.d/60-zvol.rules
inst /etc/zfs/zdev.conf
inst /etc/zfs/zpool.cache
inst /etc/hostid
diff --git a/etc/Makefile.am b/etc/Makefile.am
index 1a8c6562a..65882b55e 100644
--- a/etc/Makefile.am
+++ b/etc/Makefile.am
@@ -1 +1 @@
-SUBDIRS = init.d udev zfs
+SUBDIRS = init.d zfs
diff --git a/etc/udev/rules.d/Makefile.am b/etc/udev/rules.d/Makefile.am
deleted file mode 100644
index 9929c45bd..000000000
--- a/etc/udev/rules.d/Makefile.am
+++ /dev/null
@@ -1,15 +0,0 @@
-pkgsysconfdir = $(sysconfdir)/udev/rules.d
-
-pkgsysconf_DATA = \
- 60-zpool.rules \
- 60-zvol.rules
-
-EXTRA_DIST = \
- 60-zpool.rules.in \
- 60-zvol.rules.in
-
-$(pkgsysconf_DATA):
- -$(SED) -e 's,@bindir\@,$(bindir),g' '[email protected]' >'$@'
-
-distclean-local::
- -$(RM) $(pkgsysconf_DATA)
diff --git a/etc/udev/Makefile.am b/udev/Makefile.am
index f930941fb..f930941fb 100644
--- a/etc/udev/Makefile.am
+++ b/udev/Makefile.am
diff --git a/etc/udev/Makefile.in b/udev/Makefile.in
index 7a9a0c32f..7a9a0c32f 100644
--- a/etc/udev/Makefile.in
+++ b/udev/Makefile.in
diff --git a/etc/udev/rules.d/.gitignore b/udev/rules.d/.gitignore
index e56d65ef8..e56d65ef8 100644
--- a/etc/udev/rules.d/.gitignore
+++ b/udev/rules.d/.gitignore
diff --git a/etc/udev/rules.d/60-zpool.rules.in b/udev/rules.d/60-zpool.rules.in
index e3a1f7051..32fceed11 100644
--- a/etc/udev/rules.d/60-zpool.rules.in
+++ b/udev/rules.d/60-zpool.rules.in
@@ -1,8 +1,8 @@
#
-# /etc/udev/rules.d/60-zpool.rules
+# /lib/udev/rules.d/60-zpool.rules
#
-ENV{DEVTYPE}=="disk", IMPORT{program}="@bindir@/zpool_id -d %p"
+ENV{DEVTYPE}=="disk", IMPORT{program}="@udevdir@/zpool_id -d %p"
KERNEL=="*[!0-9]", ENV{SUBSYSTEM}=="block", ENV{ID_ZPOOL}=="?*", SYMLINK+="$env{ID_ZPOOL_PATH}"
KERNEL=="*[0-9]", ENV{SUBSYSTEM}=="block", ENV{DEVTYPE}=="partition", ENV{ID_ZPOOL}=="?*", SYMLINK+="$env{ID_ZPOOL_PATH}-part%n"
diff --git a/etc/udev/rules.d/60-zvol.rules.in b/udev/rules.d/60-zvol.rules.in
index e71e5be28..199f77e0c 100644
--- a/etc/udev/rules.d/60-zvol.rules.in
+++ b/udev/rules.d/60-zvol.rules.in
@@ -3,4 +3,4 @@
# persistent disk links: /dev/zvol/dataset_name
# also creates compatibilty symlink of /dev/dataset_name
-KERNEL=="zd*" SUBSYSTEM=="block" ACTION=="add|change" PROGRAM="@bindir@/zvol_id $tempnode" SYMLINK+="zvol/%c %c"
+KERNEL=="zd*" SUBSYSTEM=="block" ACTION=="add|change" PROGRAM="@udevdir@/zvol_id $tempnode" SYMLINK+="zvol/%c %c"
diff --git a/udev/rules.d/Makefile.am b/udev/rules.d/Makefile.am
new file mode 100644
index 000000000..41740517e
--- /dev/null
+++ b/udev/rules.d/Makefile.am
@@ -0,0 +1,14 @@
+udevrule_DATA = \
+ 60-zpool.rules \
+ 60-zvol.rules
+
+EXTRA_DIST = \
+ 60-zpool.rules.in \
+ 60-zvol.rules.in
+
+$(udevrule_DATA):
+ -$(SED) -e 's,@udevdir\@,$(udevdir),g' '[email protected]' >'$@'
+
+distclean-local::
+ -$(RM) $(udevrule_DATA)
+
diff --git a/etc/udev/rules.d/Makefile.in b/udev/rules.d/Makefile.in
index 852d44d8b..852d44d8b 100644
--- a/etc/udev/rules.d/Makefile.in
+++ b/udev/rules.d/Makefile.in
diff --git a/zfs.spec.in b/zfs.spec.in
index cba98af1d..56e8c4764 100644
--- a/zfs.spec.in
+++ b/zfs.spec.in
@@ -3,9 +3,9 @@
%define release @ZFS_META_RELEASE@
%define debug_package %{nil}
%define _prefix /
-%define _bindir /lib/udev
%define _libexecdir /usr/libexec
%define _datadir /usr/share
+%define _udevdir /lib/udev
Summary: ZFS Library and Utils
Group: Utilities/System
@@ -61,7 +61,7 @@ which are ZFS aware.
%prep
%setup
%build
-%configure --with-config=user --without-blkid
+%configure --with-config=user --without-blkid --with-udevdir=%{_udevdir}
make
%install
@@ -80,8 +80,9 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/*
%{_mandir}/man8/*
%{_sysconfdir}/init.d/*
-%{_sysconfdir}/udev/rules.d/*
%{_sysconfdir}/zfs/*
+%{_udevdir}/*
+%{_udevdir}/rules.d/*
%files devel
%defattr(-,root,root)