Skip to contentSkip to conversation

package/lvm2: lvmetad systemd integration

PATCH New Pascal de Bruijn 2 participants 2 messages Feb 28, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/lvm2: lvmetad systemd integration

From: Pascal de Bruijn <[email protected]>

lvmetad is usually combined with event-based system services that automatically run pvscan --cache on disks added or removed. This way, the cache is automatically updated with metadata from new disks when they appear. LVM udev rules and systemd services implement this automation. Automatic scanning is usually combined with automatic activation. For more information, see pvscan(8).

---
 package/lvm2/Config.in | 14 ++++++++++++++
 package/lvm2/lvm2.mk   |  8 ++++++++
 2 files changed, 22 insertions(+)
package/lvm2/Config.in +14 -0
index de5b972e99..1588a45f36 100644
@@ -44,6 +44,20 @@ config BR2_PACKAGE_LVM2_APP_LIBRARY
 	help
 	  Install application library (liblvm2app).
 
+config BR2_PACKAGE_LVM2_LVMETAD
+	bool "install lvmetad"
+	depends on BR2_PACKAGE_SYSTEMD
+	select BR2_PACKAGE_LVM2_APP_LIBRARY
+	help
+	  Install lvmetad
+
+	  The lvmetad daemon caches LVM metadata so that LVM commands
+	  can read metadata from the cache rather than scanning disks.
+	  This can be an advantage because scanning disks is time
+	  consuming and may interfere with the normal work of the
+	  system.  lvmetad can be a disadvantage when disk event
+	  notifications from the system are unreliable.
+
 comment "lvm2 application library needs a glibc or uClibc toolchain"
 	depends on BR2_TOOLCHAIN_USES_MUSL
 
package/lvm2/lvm2.mk +8 -0
index 43370b03bf..6b866ce92b 100644
@@ -54,6 +54,14 @@ else
 LVM2_CONF_OPTS += --disable-applib
 endif
 
+ifeq ($(BR2_PACKAGE_SYSTEMD),y)
+LVM2_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) install install_systemd_units install_systemd_generators
+endif
+
+ifeq ($(BR2_PACKAGE_LVM2_LVMETAD),y)
+LVM2_CONF_OPTS += --enable-lvmetad
+endif
+
 ifeq ($(BR2_TOOLCHAIN_SUPPORTS_PIE),)
 LVM2_CONF_ENV += ac_cv_flag_HAVE_PIE=no
 endif
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 package/lvm2: lvmetad systemd integration

Hello Pascal!

package/lvm2/lvm2.mk else · line 59

Quoted 11 lines · On Fri, 28 Feb 2020 09:18:59 +0100 Pascal de Bruijn <[email protected]>…
package/lvm2/lvm2.mk +3 -0
index 43370b03bf..6b866ce92b 100644
@@ -54,6 +54,14 @@ else
 LVM2_CONF_OPTS += --disable-applib
 endif
 
+ifeq ($(BR2_PACKAGE_SYSTEMD),y)
+LVM2_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) install install_systemd_units install_systemd_generators
+endif

This should be in a separate change, as it's unrelated.

Also, I'd prefer:

LVM2_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) install

ifeq ($(BR2_PACKAGE_SYSTEMD),y)
LVM2_INSTALL_TARGET_OPTS += install_systemd_units install_systemd_generators endif

package/lvm2/lvm2.mk else · line 62

Quoted 2 lines
package/lvm2/lvm2.mk +2 -0
+ifeq ($(BR2_PACKAGE_LVM2_LVMETAD),y)
+LVM2_CONF_OPTS += --enable-lvmetad

else

LVM2_CONF_OPTS += --disable-lvmetad

package/lvm2/lvm2.mk else · line 62

Quoted 1 line
package/lvm2/lvm2.mk +1 -0
+endif

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com