[PATCH] opt/lvm2: update to use udev

Michal Soltys soltys at ziu.info
Mon Mar 14 15:56:36 UTC 2011


This delegates node creation to udev. Among other things, the
important advantage of this approach is population of all the related
stuff in /dev/disk/by-* ; relying on udev can also be controlled
through lvm.conf and some commands' options.

Comments related to this version:

- another minor patch for static build scenario had to be applied;
  hopefully it will be fixed in upstream one day

- configure is now consistent with libdevmapper (they can be trivially
  merged into single package now)

- if you ran vgchange initially without udevd active (e.g. in
  initramfs), you will likely need vgchange --refresh (vgmknodes
  --refresh could work too, not tested though); this is important if you
  expect /dev/disk/by-* to be filled with lvm stuff after handover from
  udevless initramfs (fstab, mount, etc.).

Signed-off-by: Michal Soltys <soltys at ziu.info>
---
 lvm2/.footprint                |    4 ++++
 lvm2/.md5sum                   |    1 +
 lvm2/Pkgfile                   |   21 ++++++++++++++-------
 lvm2/lvm2-static_udev_rt.patch |   24 ++++++++++++++++++++++++
 4 files changed, 43 insertions(+), 7 deletions(-)
 create mode 100644 lvm2/lvm2-static_udev_rt.patch

diff --git a/lvm2/.footprint b/lvm2/.footprint
index 80075f2..e991634 100644
--- a/lvm2/.footprint
+++ b/lvm2/.footprint
@@ -3,6 +3,10 @@ drwxr-xr-x	root/root	etc/lvm/
 drwx------	root/root	etc/lvm/archive/
 drwx------	root/root	etc/lvm/backup/
 -rw-r--r--	root/root	etc/lvm/lvm.conf
+drwxr-xr-x	root/root	lib/
+drwxr-xr-x	root/root	lib/udev/
+drwxr-xr-x	root/root	lib/udev/rules.d/
+-r--r--r--	root/root	lib/udev/rules.d/11-dm-lvm.rules
 drwxr-xr-x	root/root	sbin/
 -r-xr-xr-x	root/root	sbin/fsadm
 lrwxrwxrwx	root/root	sbin/lvchange -> lvm
diff --git a/lvm2/.md5sum b/lvm2/.md5sum
index 33e7d83..2e4c6bc 100644
--- a/lvm2/.md5sum
+++ b/lvm2/.md5sum
@@ -1,2 +1,3 @@
 8b4e0897ee48f02c0dff11940e44e23b  LVM2.2.02.84.tgz
 fe77537669f1aa73c1c4bcfe13036961  lvm2-static_build.patch
+642f6be3c88a78aa2f57c8c46a678995  lvm2-static_udev_rt.patch
diff --git a/lvm2/Pkgfile b/lvm2/Pkgfile
index ed355da..a8b3df7 100644
--- a/lvm2/Pkgfile
+++ b/lvm2/Pkgfile
@@ -5,21 +5,28 @@
 
 name=lvm2
 version=2.02.84
-release=1
+release=2
 source=(ftp://sources.redhat.com/pub/lvm2/releases/LVM2.$version.tgz
-        lvm2-static_build.patch)
+	lvm2-static_udev_rt.patch
+	lvm2-static_build.patch)
 
 build() {
     cd LVM2.$version
 
     patch -p1 -i $SRC/lvm2-static_build.patch
+    patch -p1 -i $SRC/lvm2-static_udev_rt.patch
 
     ./configure --prefix=/usr \
-                --exec_prefix= \
-                --datarootdir=/usr \
-                --disable-readline \
-                --enable-static_link \
-                --with-{user,group}=root
+		--exec-prefix= \
+		--datarootdir=/usr \
+		--with-udev-prefix= \
+		--disable-readline \
+		--enable-pkgconfig \
+		--enable-static_link \
+		--enable-udev_sync \
+		--enable-udev_rules \
+		--with-{user,group}=root
+
     make
     make DESTDIR=$PKG install_lvm2
 
diff --git a/lvm2/lvm2-static_udev_rt.patch b/lvm2/lvm2-static_udev_rt.patch
new file mode 100644
index 0000000..b64f8f0
--- /dev/null
+++ b/lvm2/lvm2-static_udev_rt.patch
@@ -0,0 +1,24 @@
+diff -ur LVM2.2.02.84.orig/configure LVM2.2.02.84/configure
+--- LVM2.2.02.84.orig/configure	2011-02-17 13:52:46.028748001 +0100
++++ LVM2.2.02.84/configure	2011-02-19 23:40:55.753991226 +0100
+@@ -8799,7 +8799,7 @@
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_udev_udev_queue_get_udev_is_active" >&5
+ $as_echo "$ac_cv_lib_udev_udev_queue_get_udev_is_active" >&6; }
+ if test "x$ac_cv_lib_udev_udev_queue_get_udev_is_active" = x""yes; then :
+-  UDEV_PC="libudev"; UDEV_LIBS="-ludev"
++  UDEV_PC="libudev"; UDEV_LIBS="-ludev -lrt"
+ else
+   as_fn_error $? "bailing out... libudev library is required" "$LINENO" 5
+ fi
+diff -ur LVM2.2.02.84.orig/configure.in LVM2.2.02.84/configure.in
+--- LVM2.2.02.84.orig/configure.in	2011-02-17 13:52:46.026748001 +0100
++++ LVM2.2.02.84/configure.in	2011-02-19 23:41:42.625996529 +0100
+@@ -804,7 +804,7 @@
+ 
+ if test x$UDEV_SYNC = xyes; then
+ 	AC_CHECK_LIB(udev, udev_queue_get_udev_is_active,
+-		     [UDEV_PC="libudev"; UDEV_LIBS="-ludev"],
++		     [UDEV_PC="libudev"; UDEV_LIBS="-ludev -lrt"],
+ 		     [AC_MSG_ERROR([bailing out... libudev library is required])])
+ 	AC_DEFINE([UDEV_SYNC_SUPPORT], 1, [Define to 1 to enable synchronisation with udev processing.])
+ fi
-- 
1.7.3.5




More information about the CRUX mailing list