lvm2: add from old repo and update
authorDaniel Golle <daniel@makrotopia.org>
Sat, 18 Oct 2014 22:35:17 +0000 (00:35 +0200)
committerDaniel Golle <daniel@makrotopia.org>
Sat, 18 Oct 2014 23:01:14 +0000 (01:01 +0200)
Also add patch to fix blkid header location as suggested in #17877

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
utils/lvm2/Makefile [new file with mode: 0644]
utils/lvm2/files/lvm2.init [new file with mode: 0644]
utils/lvm2/patches/000-compile.patch [new file with mode: 0644]
utils/lvm2/patches/001-include_fix.patch [new file with mode: 0644]

diff --git a/utils/lvm2/Makefile b/utils/lvm2/Makefile
new file mode 100644 (file)
index 0000000..1a00944
--- /dev/null
@@ -0,0 +1,89 @@
+#
+# Copyright (C) 2009-2010 Stefan Monnier
+# Copyright (C) 2011-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v3+.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=LVM2
+PKG_VERSION:=2.02.111
+PKG_RELEASE:=1
+PKG_LICENSE:=GPL-2.0 LGPL-2.1
+
+PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tgz
+PKG_SOURCE_URL:=ftp://sources.redhat.com/pub/lvm2
+PKG_MD5SUM:=02487ab2a9e02d1ee76fe217183df28a
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME).$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libdevmapper
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=The Linux Kernel Device Mapper userspace library
+  URL:=http://sourceware.org/dm/
+  DEPENDS:=+kmod-dm +libpthread
+endef
+
+define Package/libdevmapper/description
+ The device-mapper is a component of the 2.6 linux kernel that supports logical
+ volume management. It is required by LVM2 and EVMS.
+endef
+
+define Package/lvm2
+  SECTION:=utils
+  CATEGORY:=Utilities
+  SUBMENU:=disc
+  TITLE:=The Linux Logical Volume Manager
+  URL:=http://sourceware.org/lvm2/
+  DEPENDS:=+libdevmapper +libblkid +libreadline +libncurses
+endef
+
+define Package/lvm2/description
+ LVM2 refers to a new userspace toolset that provide logical volume management
+ facilities on linux. It is reasonably backwards-compatible with the original
+ LVM toolset.
+endef
+
+CONFIGURE_ARGS += --disable-o_direct
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(FPIC)" \
+               DESTDIR="$(PKG_INSTALL_DIR)" \
+               install
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/libdevmapper.h $(1)/usr/include
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdevmapper.so* $(1)/usr/lib
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_BUILD_DIR)/libdm/libdevmapper.pc $(1)/usr/lib/pkgconfig
+endef
+
+define Package/libdevmapper/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libdevmapper.so.* $(1)/usr/lib
+endef
+
+define Package/lvm2/install
+       $(INSTALL_DIR) $(1)/sbin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/lvm $(1)/sbin
+       $(INSTALL_DIR) $(1)/etc/lvm
+       $(INSTALL_CONF) $(PKG_BUILD_DIR)/conf/example.conf $(1)/etc/lvm/lvm.conf
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/lvm2.init $(1)/etc/init.d/lvm2
+endef
+
+define Package/lvm2/conffiles
+/etc/lvm/lvm.conf
+endef
+
+$(eval $(call BuildPackage,libdevmapper))
+$(eval $(call BuildPackage,lvm2))
diff --git a/utils/lvm2/files/lvm2.init b/utils/lvm2/files/lvm2.init
new file mode 100644 (file)
index 0000000..3b542d0
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2009 Stefan Monnier
+START=15
+
+start () {
+   /sbin/lvm vgscan --ignorelockingfailure --mknodes || :
+   /sbin/lvm vgchange -aly --ignorelockingfailure || return 2
+}
+
+stop () {
+    /sbin/lvm vgchange -aln --ignorelockingfailure || return 2
+}
diff --git a/utils/lvm2/patches/000-compile.patch b/utils/lvm2/patches/000-compile.patch
new file mode 100644 (file)
index 0000000..0c7dfea
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/make.tmpl.in
++++ b/make.tmpl.in
+@@ -19,7 +19,7 @@
+ # Allow environment to override any built-in default value for CC.
+ # If there is a built-in default, CC is NOT set to @CC@ here.
+-CC ?= @CC@
++CC = @CC@
+ # If $(CC) holds the usual built-in default value of 'cc' then replace it with
+ # the configured value.
diff --git a/utils/lvm2/patches/001-include_fix.patch b/utils/lvm2/patches/001-include_fix.patch
new file mode 100644 (file)
index 0000000..0c79d5d
--- /dev/null
@@ -0,0 +1,12 @@
+diff -urN LVM2.2.02.111.old/lib/device/dev-type.c LVM2.2.02.111/lib/device/dev-type.c
+--- LVM2.2.02.111.old/lib/device/dev-type.c    2014-09-17 09:41:08.281821278 -0400
++++ LVM2.2.02.111/lib/device/dev-type.c        2014-09-17 09:41:50.773821280 -0400
+@@ -22,7 +22,7 @@
+ #include <ctype.h>
+ #ifdef BLKID_WIPING_SUPPORT
+-#include <blkid.h>
++#include <blkid/blkid.h>
+ #endif
+ #include "device-types.h"