From 6dd70f472a2ad72fab1fba728cdac5b40c44895b Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Mon, 20 Feb 2012 19:38:40 +0000 Subject: [PATCH] Call built-in blkid conditionaly (udev version >= 176), call standard blkid with full path otherwise. --- udev/{13-dm-disk.rules => 13-dm-disk.rules.in} | 2 +- udev/Makefile.in | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) rename udev/{13-dm-disk.rules => 13-dm-disk.rules.in} (98%) diff --git a/udev/13-dm-disk.rules b/udev/13-dm-disk.rules.in similarity index 98% rename from udev/13-dm-disk.rules rename to udev/13-dm-disk.rules.in index 1e2d19cb4..1920260af 100644 --- a/udev/13-dm-disk.rules +++ b/udev/13-dm-disk.rules.in @@ -19,7 +19,7 @@ ENV{DM_UUID}=="?*", SYMLINK+="disk/by-id/dm-uuid-$env{DM_UUID}" ENV{DM_SUSPENDED}=="1", GOTO="dm_end" -IMPORT{program}="blkid" +(BLKID_RULE) ENV{DM_UDEV_LOW_PRIORITY_FLAG}=="1", OPTIONS="link_priority=-100" ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" diff --git a/udev/Makefile.in b/udev/Makefile.in index 11635bbc2..5c5c8410b 100644 --- a/udev/Makefile.in +++ b/udev/Makefile.in @@ -19,6 +19,12 @@ DM_RULES=10-dm.rules 13-dm-disk.rules 95-dm-notify.rules LVM_RULES=11-dm-lvm.rules DM_DIR=$(shell grep "\#define DM_DIR" $(top_srcdir)/libdm/misc/dm-ioctl.h | awk '{print $$3}') +ifeq ("@UDEV_HAS_BUILTIN_BLKID@", "yes") + BLKID_RULE=IMPORT{builtin}=\"blkid\" +else + BLKID_RULE=IMPORT{program}=\"\$$env{DM_SBIN_PATH}\/blkid -o udev -p \$$tempnode\" +endif + CLEAN_TARGETS=10-dm.rules include $(top_builddir)/make.tmpl @@ -26,7 +32,7 @@ include $(top_builddir)/make.tmpl vpath %.rules $(srcdir) %.rules: %.rules.in - $(SED) -e "s/(DM_DIR)/$(DM_DIR)/" $< >$@ + $(SED) -e "s/(DM_DIR)/$(DM_DIR)/" -e "s/(BLKID_RULE)/$(BLKID_RULE)/" $< >$@ %_install: %.rules $(INSTALL_DATA) -D $< $(udevdir)/$(