From 85eb42f33df96d44cc1fe40555fa77c88a14ef7b Mon Sep 17 00:00:00 2001 From: Andreas Mohr Date: Sat, 23 May 2026 15:19:03 +0000 Subject: [PATCH] package/lvm2: add static build support Add static build support for device mapper Lvm2 standard install still requires dynamic library Signed-off-by: Andreas Mohr Signed-off-by: Arnout Vandecappelle --- package/lvm2/Config.in | 9 ++++++--- package/lvm2/lvm2.mk | 9 +++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/package/lvm2/Config.in b/package/lvm2/Config.in index ddb398d160..4f15504e37 100644 --- a/package/lvm2/Config.in +++ b/package/lvm2/Config.in @@ -2,7 +2,6 @@ config BR2_PACKAGE_LVM2 bool "lvm2 & device mapper" depends on BR2_TOOLCHAIN_HAS_THREADS depends on BR2_USE_MMU # needs fork() - depends on !BR2_STATIC_LIBS # It fails to build statically help This is LVM2, the rewrite of The Linux Logical Volume Manager. LVM supports enterprise level volume management of disk and @@ -26,13 +25,17 @@ if BR2_PACKAGE_LVM2 config BR2_PACKAGE_LVM2_STANDARD_INSTALL bool "standard install instead of only dmsetup" default y + depends on !BR2_STATIC_LIBS select BR2_PACKAGE_LIBAIO help Install the standard suite of lvm2 programs. When this option is not set, only dmsetup is installed. +comment "lvm2 standard install needs a toolchain w/ dynamic library" + depends on BR2_STATIC_LIBS + endif -comment "lvm2 needs a toolchain w/ threads, dynamic library" +comment "lvm2 needs a toolchain w/ threads" depends on BR2_USE_MMU - depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS + depends on !BR2_TOOLCHAIN_HAS_THREADS diff --git a/package/lvm2/lvm2.mk b/package/lvm2/lvm2.mk index 3a1dded55f..8db1899ed4 100644 --- a/package/lvm2/lvm2.mk +++ b/package/lvm2/lvm2.mk @@ -48,6 +48,15 @@ else LVM2_CONF_OPTS += --disable-selinux endif +ifeq ($(BR2_STATIC_LIBS),y) +# configure: error: --enable-cmdlib requires dynamic linking. +LVM2_CONF_OPTS += --disable-cmdlib +# configure: error: --enable-dmeventd requires --enable-cmdlib to be used as well +LVM2_CONF_OPTS += --disable-dmeventd +# install static version of the devmapper library +LVM2_CONF_OPTS += --enable-static_link +endif + ifeq ($(BR2_PACKAGE_LVM2_STANDARD_INSTALL),y) LVM2_DEPENDENCIES += libaio LVM2_INSTALL_STAGING_OPTS += install