diff options
author | Brian Behlendorf <[email protected]> | 2011-03-24 11:34:41 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2011-03-25 10:05:09 -0700 |
commit | 1d82906dea5eb698a854d992e445e794fb5a0880 (patch) | |
tree | 99b4da105796b83317173749e85071f259e6da83 | |
parent | a5729f7b22e14aed657bd716f3ee98b02f7e7c41 (diff) |
Set cmd paths in udev rules using --prefix
The udev/rules.d scripts must use absolute paths to their support
binaries. However, where those binaries get installed depends
on what --prefix was set to when the package was configured.
This change makes the udev/rules.d helpers to *.in files which
are processed by configure. This allows them to be dynamically
updated to include the specified --prefix.
Additionally, this change updates 60-zvol.rules to handle both
the 'add' and 'change' actions. This ensures that that all
valid zvol devices are correctly linked.
-rwxr-xr-x | configure | 4 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | etc/udev/rules.d/.gitignore | 2 | ||||
-rw-r--r-- | etc/udev/rules.d/60-zpool.rules.in (renamed from etc/udev/rules.d/60-zpool.rules) | 2 | ||||
-rw-r--r-- | etc/udev/rules.d/60-zvol.rules.in (renamed from etc/udev/rules.d/60-zvol.rules) | 2 | ||||
-rw-r--r-- | etc/udev/rules.d/Makefile.am | 5 | ||||
-rw-r--r-- | etc/udev/rules.d/Makefile.in | 39 |
7 files changed, 37 insertions, 19 deletions
@@ -20008,7 +20008,7 @@ fi $as_echo "$enable_debug" >&6; } -ac_config_files="$ac_config_files Makefile dracut/Makefile dracut/90zfs/Makefile etc/Makefile etc/udev/Makefile etc/udev/rules.d/Makefile etc/init.d/Makefile etc/zfs/Makefile man/Makefile man/man8/Makefile lib/Makefile lib/libspl/Makefile lib/libspl/asm-generic/Makefile lib/libspl/asm-i386/Makefile lib/libspl/asm-x86_64/Makefile lib/libspl/include/Makefile lib/libspl/include/ia32/Makefile lib/libspl/include/ia32/sys/Makefile lib/libspl/include/rpc/Makefile lib/libspl/include/sys/Makefile lib/libspl/include/sys/sysevent/Makefile lib/libspl/include/sys/dktp/Makefile lib/libspl/include/util/Makefile lib/libavl/Makefile lib/libefi/Makefile lib/libnvpair/Makefile lib/libunicode/Makefile lib/libuutil/Makefile lib/libzpool/Makefile lib/libzfs/Makefile cmd/Makefile cmd/zdb/Makefile cmd/zfs/Makefile cmd/zinject/Makefile cmd/zpool/Makefile cmd/ztest/Makefile cmd/zpios/Makefile cmd/mount_zfs/Makefile cmd/zpool_layout/Makefile cmd/zvol_id/Makefile cmd/zpool_id/Makefile module/Makefile module/avl/Makefile module/nvpair/Makefile module/unicode/Makefile module/zcommon/Makefile module/zfs/Makefile module/zpios/Makefile include/Makefile include/linux/Makefile include/sys/Makefile include/sys/fs/Makefile include/sys/fm/Makefile include/sys/fm/fs/Makefile scripts/Makefile scripts/zpios-profile/Makefile scripts/zpios-test/Makefile scripts/zpool-config/Makefile scripts/zpool-layout/Makefile scripts/common.sh zfs.spec zfs-modules.spec zfs-script-config.sh" +ac_config_files="$ac_config_files Makefile dracut/Makefile dracut/90zfs/Makefile etc/Makefile etc/udev/Makefile etc/udev/rules.d/Makefile etc/udev/rules.d/60-zpool.rules etc/udev/rules.d/60-zvol.rules etc/init.d/Makefile etc/zfs/Makefile man/Makefile man/man8/Makefile lib/Makefile lib/libspl/Makefile lib/libspl/asm-generic/Makefile lib/libspl/asm-i386/Makefile lib/libspl/asm-x86_64/Makefile lib/libspl/include/Makefile lib/libspl/include/ia32/Makefile lib/libspl/include/ia32/sys/Makefile lib/libspl/include/rpc/Makefile lib/libspl/include/sys/Makefile lib/libspl/include/sys/sysevent/Makefile lib/libspl/include/sys/dktp/Makefile lib/libspl/include/util/Makefile lib/libavl/Makefile lib/libefi/Makefile lib/libnvpair/Makefile lib/libunicode/Makefile lib/libuutil/Makefile lib/libzpool/Makefile lib/libzfs/Makefile cmd/Makefile cmd/zdb/Makefile cmd/zfs/Makefile cmd/zinject/Makefile cmd/zpool/Makefile cmd/ztest/Makefile cmd/zpios/Makefile cmd/mount_zfs/Makefile cmd/zpool_layout/Makefile cmd/zvol_id/Makefile cmd/zpool_id/Makefile module/Makefile module/avl/Makefile module/nvpair/Makefile module/unicode/Makefile module/zcommon/Makefile module/zfs/Makefile module/zpios/Makefile include/Makefile include/linux/Makefile include/sys/Makefile include/sys/fs/Makefile include/sys/fm/Makefile include/sys/fm/fs/Makefile scripts/Makefile scripts/zpios-profile/Makefile scripts/zpios-test/Makefile scripts/zpool-config/Makefile scripts/zpool-layout/Makefile scripts/common.sh zfs.spec zfs-modules.spec zfs-script-config.sh" cat >confcache <<\_ACEOF @@ -20930,6 +20930,8 @@ do "etc/Makefile") CONFIG_FILES="$CONFIG_FILES etc/Makefile" ;; "etc/udev/Makefile") CONFIG_FILES="$CONFIG_FILES etc/udev/Makefile" ;; "etc/udev/rules.d/Makefile") CONFIG_FILES="$CONFIG_FILES etc/udev/rules.d/Makefile" ;; + "etc/udev/rules.d/60-zpool.rules") CONFIG_FILES="$CONFIG_FILES etc/udev/rules.d/60-zpool.rules" ;; + "etc/udev/rules.d/60-zvol.rules") CONFIG_FILES="$CONFIG_FILES etc/udev/rules.d/60-zvol.rules" ;; "etc/init.d/Makefile") CONFIG_FILES="$CONFIG_FILES etc/init.d/Makefile" ;; "etc/zfs/Makefile") CONFIG_FILES="$CONFIG_FILES etc/zfs/Makefile" ;; "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; diff --git a/configure.ac b/configure.ac index a188fa797..b578341b6 100644 --- a/configure.ac +++ b/configure.ac @@ -60,6 +60,8 @@ AC_CONFIG_FILES([ etc/Makefile etc/udev/Makefile etc/udev/rules.d/Makefile + etc/udev/rules.d/60-zpool.rules + etc/udev/rules.d/60-zvol.rules etc/init.d/Makefile etc/zfs/Makefile man/Makefile diff --git a/etc/udev/rules.d/.gitignore b/etc/udev/rules.d/.gitignore new file mode 100644 index 000000000..e56d65ef8 --- /dev/null +++ b/etc/udev/rules.d/.gitignore @@ -0,0 +1,2 @@ +60-zpool.rules +60-zvol.rules diff --git a/etc/udev/rules.d/60-zpool.rules b/etc/udev/rules.d/60-zpool.rules.in index 0f4a356dd..f06be6a21 100644 --- a/etc/udev/rules.d/60-zpool.rules +++ b/etc/udev/rules.d/60-zpool.rules.in @@ -2,7 +2,7 @@ # /etc/udev/rules.d/99-zpool.rules # -ENV{DEVTYPE}=="disk", IMPORT{program}="/usr/bin/zpool_id -d %p" +ENV{DEVTYPE}=="disk", IMPORT{program}="@prefix@/bin/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{ID_ZPOOL}=="?*", SYMLINK+="$env{ID_ZPOOL_PATH}-part%n" diff --git a/etc/udev/rules.d/60-zvol.rules b/etc/udev/rules.d/60-zvol.rules.in index 803d4260d..860e74b21 100644 --- a/etc/udev/rules.d/60-zvol.rules +++ b/etc/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" PROGRAM="/usr/bin/zvol_id $tempnode" SYMLINK+="zvol/%c %c" +KERNEL=="zd*" SUBSYSTEM=="block" ACTION=="add|change" PROGRAM="@prefix@/bin/zvol_id $tempnode" SYMLINK+="zvol/%c %c" diff --git a/etc/udev/rules.d/Makefile.am b/etc/udev/rules.d/Makefile.am index 04536007a..1a7a1e392 100644 --- a/etc/udev/rules.d/Makefile.am +++ b/etc/udev/rules.d/Makefile.am @@ -4,4 +4,7 @@ pkgsysconf_DATA = \ 60-zpool.rules \ 60-zvol.rules -EXTRA_DIST = $(pkgsysconf_DATA) +EXTRA_DIST = 60-zpool.rules.in 60-zvol.rules.in + +distclean-local:: + -$(RM) $(pkgsysconf_DATA) diff --git a/etc/udev/rules.d/Makefile.in b/etc/udev/rules.d/Makefile.in index 5cc5b350a..9937d06a3 100644 --- a/etc/udev/rules.d/Makefile.in +++ b/etc/udev/rules.d/Makefile.in @@ -36,7 +36,8 @@ build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = etc/udev/rules.d -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +DIST_COMMON = $(srcdir)/60-zpool.rules.in $(srcdir)/60-zvol.rules.in \ + $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bdev-block-device-operations.m4 \ @@ -56,6 +57,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-fmode-t.m4 \ $(top_srcdir)/config/kernel-fsync.m4 \ $(top_srcdir)/config/kernel-get-disk-ro.m4 \ + $(top_srcdir)/config/kernel-insert-inode-locked.m4 \ $(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \ $(top_srcdir)/config/kernel-kobj-name-len.m4 \ $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \ @@ -77,7 +79,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/zfs_config.h -CONFIG_CLEAN_FILES = +CONFIG_CLEAN_FILES = 60-zpool.rules 60-zvol.rules CONFIG_CLEAN_VPATH_FILES = AM_V_GEN = $(am__v_GEN_$(V)) am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) @@ -282,7 +284,7 @@ pkgsysconf_DATA = \ 60-zpool.rules \ 60-zvol.rules -EXTRA_DIST = $(pkgsysconf_DATA) +EXTRA_DIST = 60-zpool.rules.in 60-zvol.rules.in all: all-am .SUFFIXES: @@ -316,6 +318,10 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): +60-zpool.rules: $(top_builddir)/config.status $(srcdir)/60-zpool.rules.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +60-zvol.rules: $(top_builddir)/config.status $(srcdir)/60-zvol.rules.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo @@ -417,7 +423,7 @@ clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile -distclean-am: clean-am distclean-generic +distclean-am: clean-am distclean-generic distclean-local dvi: dvi-am @@ -480,17 +486,20 @@ uninstall-am: uninstall-pkgsysconfDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ - distclean distclean-generic distclean-libtool distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man install-pdf \ - install-pdf-am install-pkgsysconfDATA install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - uninstall uninstall-am uninstall-pkgsysconfDATA - + distclean distclean-generic distclean-libtool distclean-local \ + distdir dvi dvi-am html html-am info info-am install \ + install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-pkgsysconfDATA install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am uninstall uninstall-am uninstall-pkgsysconfDATA + + +distclean-local:: + -$(RM) $(pkgsysconf_DATA) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. |