All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/lvm2: lvmetad systemd integration
@ 2020-02-27  7:46 Pascal de Bruijn
  2020-02-27  8:10 ` Thomas Petazzoni
  0 siblings, 1 reply; 5+ messages in thread
From: Pascal de Bruijn @ 2020-02-27  7:46 UTC (permalink / raw)
  To: buildroot

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).

Signed-off-by: Pascal de Bruijn <p.debruijn@unilogic.nl>
---
 package/lvm2/Config.in | 3 +++
 package/lvm2/lvm2.mk   | 5 +++++
 2 files changed, 8 insertions(+)

diff --git a/package/lvm2/Config.in b/package/lvm2/Config.in
index de5b972e99..a828c31714 100644
--- a/package/lvm2/Config.in
+++ b/package/lvm2/Config.in
@@ -44,6 +44,9 @@ config BR2_PACKAGE_LVM2_APP_LIBRARY
 	help
 	  Install application library (liblvm2app).
 
+	  Enable this if you need systemd integration,
+	  like automatic activation of LVM logical volumes.
+
 comment "lvm2 application library needs a glibc or uClibc toolchain"
 	depends on BR2_TOOLCHAIN_USES_MUSL
 
diff --git a/package/lvm2/lvm2.mk b/package/lvm2/lvm2.mk
index 43370b03bf..1c3ff564b3 100644
--- a/package/lvm2/lvm2.mk
+++ b/package/lvm2/lvm2.mk
@@ -54,6 +54,11 @@ else
 LVM2_CONF_OPTS += --disable-applib
 endif
 
+ifeq ($(BR2_PACKAGE_LVM2_APP_LIBRARY)$(BR2_PACKAGE_SYSTEMD),yy)
+LVM2_CONF_OPTS += --enable-lvmetad
+LVM2_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) install install_systemd_units install_systemd_generators
+endif
+
 ifeq ($(BR2_TOOLCHAIN_SUPPORTS_PIE),)
 LVM2_CONF_ENV += ac_cv_flag_HAVE_PIE=no
 endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH] package/lvm2: lvmetad systemd integration
  2020-02-27  7:46 [Buildroot] [PATCH] package/lvm2: lvmetad systemd integration Pascal de Bruijn
@ 2020-02-27  8:10 ` Thomas Petazzoni
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2020-02-27  8:10 UTC (permalink / raw)
  To: buildroot

Hello Pascal,

On Thu, 27 Feb 2020 08:46:51 +0100
Pascal de Bruijn <p.debruijn@unilogic.nl> wrote:

> 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).
> 
> Signed-off-by: Pascal de Bruijn <p.debruijn@unilogic.nl>
> ---
>  package/lvm2/Config.in | 3 +++
>  package/lvm2/lvm2.mk   | 5 +++++
>  2 files changed, 8 insertions(+)
> 
> diff --git a/package/lvm2/Config.in b/package/lvm2/Config.in
> index de5b972e99..a828c31714 100644
> --- a/package/lvm2/Config.in
> +++ b/package/lvm2/Config.in
> @@ -44,6 +44,9 @@ config BR2_PACKAGE_LVM2_APP_LIBRARY
>  	help
>  	  Install application library (liblvm2app).
>  
> +	  Enable this if you need systemd integration,
> +	  like automatic activation of LVM logical volumes.
> +
>  comment "lvm2 application library needs a glibc or uClibc toolchain"
>  	depends on BR2_TOOLCHAIN_USES_MUSL
>  
> diff --git a/package/lvm2/lvm2.mk b/package/lvm2/lvm2.mk
> index 43370b03bf..1c3ff564b3 100644
> --- a/package/lvm2/lvm2.mk
> +++ b/package/lvm2/lvm2.mk
> @@ -54,6 +54,11 @@ else
>  LVM2_CONF_OPTS += --disable-applib
>  endif
>  
> +ifeq ($(BR2_PACKAGE_LVM2_APP_LIBRARY)$(BR2_PACKAGE_SYSTEMD),yy)
> +LVM2_CONF_OPTS += --enable-lvmetad
> +LVM2_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) install install_systemd_units install_systemd_generators

Looking at the install_systemd_units target, it does install much more
than just a unit file for lvmetad.

So I think the two things should be decoupled:

 (1) When systemd is enabled, use install_systemd_units and
     install_systemd_generators.

 (2) Have an additional Config.in option to enable/disable the build of
     lvmetad

Best regards,

Thomas Petazzoni
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH] package/lvm2: lvmetad systemd integration
  2020-02-28  8:18 Pascal de Bruijn
@ 2020-02-28 10:17 ` Thomas Petazzoni
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2020-02-28 10:17 UTC (permalink / raw)
  To: buildroot

Hello Pascal!

On Fri, 28 Feb 2020 09:18:59 +0100
Pascal de Bruijn <p.debruijn@unilogic.nl> wrote:

> diff --git a/package/lvm2/lvm2.mk b/package/lvm2/lvm2.mk
> index 43370b03bf..6b866ce92b 100644
> --- a/package/lvm2/lvm2.mk
> +++ b/package/lvm2/lvm2.mk
> @@ -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

> +ifeq ($(BR2_PACKAGE_LVM2_LVMETAD),y)
> +LVM2_CONF_OPTS += --enable-lvmetad

else

LVM2_CONF_OPTS += --disable-lvmetad


> +endif

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH] package/lvm2: lvmetad systemd integration
@ 2020-02-28  8:18 Pascal de Bruijn
  2020-02-28 10:17 ` Thomas Petazzoni
  0 siblings, 1 reply; 5+ messages in thread
From: Pascal de Bruijn @ 2020-02-28  8:18 UTC (permalink / raw)
  To: buildroot

From: Pascal de Bruijn <pmjdebruijn@pcode.nl>

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).

Signed-off-by: Pascal de Bruijn <p.debruijn@unilogic.nl>
---
 package/lvm2/Config.in | 14 ++++++++++++++
 package/lvm2/lvm2.mk   |  8 ++++++++
 2 files changed, 22 insertions(+)

diff --git a/package/lvm2/Config.in b/package/lvm2/Config.in
index de5b972e99..1588a45f36 100644
--- a/package/lvm2/Config.in
+++ b/package/lvm2/Config.in
@@ -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
 
diff --git a/package/lvm2/lvm2.mk b/package/lvm2/lvm2.mk
index 43370b03bf..6b866ce92b 100644
--- a/package/lvm2/lvm2.mk
+++ b/package/lvm2/lvm2.mk
@@ -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
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH] package/lvm2: lvmetad systemd integration
@ 2020-02-05  8:13 Pascal de Bruijn
  0 siblings, 0 replies; 5+ messages in thread
From: Pascal de Bruijn @ 2020-02-05  8:13 UTC (permalink / raw)
  To: buildroot

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).

Signed-off-by: Pascal de Bruijn <p.debruijn@unilogic.nl>
---
 package/lvm2/Config.in | 3 +++
 package/lvm2/lvm2.mk   | 6 ++++++
 2 files changed, 9 insertions(+)

diff --git a/package/lvm2/Config.in b/package/lvm2/Config.in
index de5b972..a828c31 100644
--- a/package/lvm2/Config.in
+++ b/package/lvm2/Config.in
@@ -44,6 +44,9 @@ config BR2_PACKAGE_LVM2_APP_LIBRARY
 	help
 	  Install application library (liblvm2app).
 
+	  Enable this if you need systemd integration,
+	  like automatic activation of LVM logical volumes.
+
 comment "lvm2 application library needs a glibc or uClibc toolchain"
 	depends on BR2_TOOLCHAIN_USES_MUSL
 
diff --git a/package/lvm2/lvm2.mk b/package/lvm2/lvm2.mk
index 3da713f..5cf6d93 100644
--- a/package/lvm2/lvm2.mk
+++ b/package/lvm2/lvm2.mk
@@ -54,6 +54,12 @@ else
 LVM2_CONF_OPTS += --disable-applib
 endif
 
+ifeq ($(BR2_PACKAGE_LVM2_APP_LIBRARY)$(BR2_PACKAGE_SYSTEMD),yy)
+LVM2_DEPENDENCIES += systemd
+LVM2_CONF_OPTS += --enable-lvmetad
+LVM2_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) install install_systemd_units install_systemd_generators
+endif
+
 ifeq ($(BR2_TOOLCHAIN_SUPPORTS_PIE),)
 LVM2_CONF_ENV += ac_cv_flag_HAVE_PIE=no
 endif
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-02-28 10:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-27  7:46 [Buildroot] [PATCH] package/lvm2: lvmetad systemd integration Pascal de Bruijn
2020-02-27  8:10 ` Thomas Petazzoni
  -- strict thread matches above, loose matches on Subject: below --
2020-02-28  8:18 Pascal de Bruijn
2020-02-28 10:17 ` Thomas Petazzoni
2020-02-05  8:13 Pascal de Bruijn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.