Browse Source

lvm2: provide selinux and non-selinux build variants

Signed-off-by: Maxim Storchak <m.storchak@gmail.com>
lilik-openwrt-22.03
Maxim Storchak 4 years ago
committed by Daniel Golle
parent
commit
d39c77ba81
1 changed files with 63 additions and 13 deletions
  1. +63
    -13
      utils/lvm2/Makefile

+ 63
- 13
utils/lvm2/Makefile View File

@ -15,7 +15,7 @@ PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tgz PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tgz
PKG_SOURCE_URL:=https://sourceware.org/pub/lvm2 PKG_SOURCE_URL:=https://sourceware.org/pub/lvm2
PKG_HASH:=5ad1645a480440892e35f31616682acba0dc204ed049635d2df3e5a5929d0ed0 PKG_HASH:=5ad1645a480440892e35f31616682acba0dc204ed049635d2df3e5a5929d0ed0
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME).$(PKG_VERSION)
PKG_BUILD_DIR:=$(BUILD_DIR)/lvm2-$(BUILD_VARIANT)/$(PKG_NAME).$(PKG_VERSION)
PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org> PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
PKG_LICENSE:=GPL-2.0 LGPL-2.1 PKG_LICENSE:=GPL-2.0 LGPL-2.1
@ -26,40 +26,82 @@ PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
define Package/libdevmapper
define Package/libdevmapper/Default
SECTION:=libs SECTION:=libs
CATEGORY:=Libraries CATEGORY:=Libraries
TITLE:=The Linux Kernel Device Mapper userspace library TITLE:=The Linux Kernel Device Mapper userspace library
URL:=https://sourceware.org/dm/ URL:=https://sourceware.org/dm/
DEPENDS:=+kmod-dm +libpthread +libuuid +librt +libblkid +libselinux
DEPENDS:=+kmod-dm +libpthread +libuuid +librt +libblkid
endef endef
define Package/libdevmapper/description
define Package/libdevmapper-normal
$(call Package/libdevmapper/Default)
VARIANT := normal
PROVIDES := libdevmapper
endef
define Package/libdevmapper-selinux
$(call Package/libdevmapper/Default)
VARIANT := selinux
DEPENDS += +libselinux
PROVIDES := libdevmapper
endef
define Package/libdevmapper-normal/description
The device-mapper is a component of the 2.6 linux kernel that supports logical The device-mapper is a component of the 2.6 linux kernel that supports logical
volume management. It is required by LVM2 and EVMS. volume management. It is required by LVM2 and EVMS.
endef endef
define Package/lvm2
define Package/libdevmapper-selinux/description
$(call Package/libdevmapper-normal/description)
This variant supports SELinux
endef
define Package/lvm2/default
SECTION:=utils SECTION:=utils
CATEGORY:=Utilities CATEGORY:=Utilities
SUBMENU:=Disc SUBMENU:=Disc
TITLE:=The Linux Logical Volume Manager TITLE:=The Linux Logical Volume Manager
URL:=https://sourceware.org/lvm2/ URL:=https://sourceware.org/lvm2/
DEPENDS:=+libdevmapper +libreadline +libncurses +libaio
DEPENDS:=+libreadline +libncurses +libaio
endef
define Package/lvm2-normal
$(call Package/lvm2/default)
VARIANT := normal
DEPENDS += +libdevmapper-normal
PROVIDES := lvm2
endef endef
define Package/lvm2/description
define Package/lvm2-selinux
$(call Package/lvm2/default)
VARIANT := selinux
DEPENDS += +libdevmapper-selinux
PROVIDES := lvm2
endef
define Package/lvm2-normal/description
LVM2 refers to a new userspace toolset that provide logical volume management LVM2 refers to a new userspace toolset that provide logical volume management
facilities on linux. It is reasonably backwards-compatible with the original facilities on linux. It is reasonably backwards-compatible with the original
LVM toolset. LVM toolset.
endef endef
define Package/lvm2-selinux/description
$(call Package/lvm2-normal/description)
This variant supports SELinux
endef
CONFIGURE_ARGS += \ CONFIGURE_ARGS += \
--disable-o_direct \ --disable-o_direct \
--with-default-pid-dir=/var/run \ --with-default-pid-dir=/var/run \
--with-default-dm-run-dir=/var/run \ --with-default-dm-run-dir=/var/run \
--with-default-run-dir=/var/run/lvm \ --with-default-run-dir=/var/run/lvm \
--with-default-locking-dir=/var/lock/lvm
--with-default-locking-dir=/var/lock/lvm \
--$(if $(findstring selinux,$(BUILD_VARIANT)),en,dis)able-selinux
ifneq ($(shell /bin/sh -c "echo -n 'X'"),X) ifneq ($(shell /bin/sh -c "echo -n 'X'"),X)
MAKE_SHELL = SHELL=/bin/bash MAKE_SHELL = SHELL=/bin/bash
@ -83,12 +125,14 @@ define Build/InstallDev
$(CP) $(PKG_BUILD_DIR)/libdm/libdevmapper.pc $(1)/usr/lib/pkgconfig $(CP) $(PKG_BUILD_DIR)/libdm/libdevmapper.pc $(1)/usr/lib/pkgconfig
endef endef
define Package/libdevmapper/install
define Package/libdevmapper-normal/install
$(INSTALL_DIR) $(1)/usr/lib $(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libdevmapper.so.* $(1)/usr/lib $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdevmapper.so.* $(1)/usr/lib
endef endef
define Package/lvm2/install
Package/libdevmapper-selinux/install = $(Package/libdevmapper-normal/install)
define Package/lvm2-normal/install
$(INSTALL_DIR) $(1)/sbin $(INSTALL_DIR) $(1)/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/lvm $(1)/sbin $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/lvm $(1)/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dmsetup $(1)/sbin $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dmsetup $(1)/sbin
@ -105,9 +149,15 @@ define Package/lvm2/install
$(FIND) $(PKG_INSTALL_DIR)/usr/sbin/ -type l -exec $(CP) -a {} $(1)/sbin/ \; $(FIND) $(PKG_INSTALL_DIR)/usr/sbin/ -type l -exec $(CP) -a {} $(1)/sbin/ \;
endef endef
define Package/lvm2/conffiles
Package/lvm2-selinux/install = $(Package/lvm2-normal/install)
define Package/lvm2-normal/conffiles
/etc/lvm/lvm.conf /etc/lvm/lvm.conf
endef endef
$(eval $(call BuildPackage,libdevmapper))
$(eval $(call BuildPackage,lvm2))
Package/lvm2-selinux/conffiles = $(Package/lvm2/conffiles)
$(eval $(call BuildPackage,libdevmapper-normal))
$(eval $(call BuildPackage,libdevmapper-selinux))
$(eval $(call BuildPackage,lvm2-normal))
$(eval $(call BuildPackage,lvm2-selinux))

Loading…
Cancel
Save