2 # Copyright (C) 2009, 2010 Stefan Monnier
4 # This is free software, licensed under the GNU General Public License v3+.
5 # See /LICENSE for more information.
7 include $(TOPDIR)/rules.mk
9 MAINTAINER:=Stefan Monnier <monnier@iro.umontreal.ca>
15 PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tgz
16 PKG_SOURCE_URL:=ftp://sources.redhat.com/pub/lvm2/ \
17 http://netbsd.mirrors.tds.net/pub/sourceware.org/lvm2/
18 PKG_MD5SUM:=74bb3beeefe68d539ab712e92fddfb39
19 # 2.02.43 = fc34655706a2aa116b92328b24fad619
20 # 2.02.44 = 4ed7b99903a6fc5165b7b0b8def42486
21 # 2.02.53 = f9ae3579bf15467b7f1d7aea8b9ed9b3
22 # 2.02.60 = 33e0e0f4b4582d495ff619696c634b2a
23 # 2.02.63 = 74bb3beeefe68d539ab712e92fddfb39
25 # OpenWRT normally expects the tarball to expand into
26 # $(PKG_NAME)-$(PKG_VERSION), and this magic incantation seems to make it
27 # understand that LVM2's tarball expands into $(PKG_NAME).$(PKG_VERSION).
28 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME).$(PKG_VERSION)
30 include $(INCLUDE_DIR)/package.mk
32 define Package/libdevmapper
37 TITLE:=The Linux Kernel Device Mapper userspace library
38 URL:=http://sourceware.org/dm/
41 define Package/libdevmapper/description
42 The Linux Kernel Device Mapper is the LVM (Linux Logical Volume Management)
43 Team\'s implementation of a minimalistic kernel-space driver that handles
44 volume management, while keeping knowledge of the underlying device layout
45 in user-space. This makes it useful for not only LVM, but EVMS, software
46 raid, and other drivers that create "virtual" block devices.
48 This package contains the (user-space) shared library for accessing the
49 device-mapper; it allows usage of the device-mapper through a clean,
50 consistent interface (as opposed to through kernel ioctls).
57 TITLE:=The Linux Logical Volume Manager
58 DEPENDS:=+libdevmapper +libreadline
59 URL:=http://sourceware.org/lvm2/
62 define Package/lvm2/description
63 This is LVM2, the rewrite of The Linux Logical Volume Manager. LVM
64 supports enterprise level volume management of disk and disk subsystems
65 by grouping arbitrary disks into volume groups. The total capacity of
66 volume groups can be allocated to logical volumes, which are accessed as
67 regular block devices.
70 # I got problems building with readline, so I originally just disabled it.
71 # I've since added patch 100-readline-link which fixes the problem instead.
72 # CONFIGURE_ARGS += --disable-readline
74 # Apparently we have problems when "read"ing using O_DIRECT, maybe because
75 # of uClibc. More specifically, with O_DIRECT lvm becomes erratic, showing
76 # non-deterministic behavior: `lvs', `pvs' and friends can return anything
77 # from empty lists, to completely correct result, as well as checksum errors,
78 # complaints about missing volume groups, ... each run of the command can
79 # return something different. The "root" of the problem is (maybe among
80 # other places) in the "_io" function in dev-io.c, where calls to the "read"
81 # function often return garbage, although not always. There's nothing
82 # obviously wrong with the dev-io.c code, so the bug may just as well be in
83 # uClibc or in the kernel (it appeared on the MIPS platform and could be
84 # related to cache coherency issues).
85 # Debian Lenny's lvm2 also disables O_DIRECT on "arm armeb hppa mips mipsel".
86 CONFIGURE_ARGS += --disable-o_direct
89 $(MAKE) -C $(PKG_BUILD_DIR) \
90 CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(FPIC)" \
91 DESTDIR="$(PKG_INSTALL_DIR)" \
95 define Build/InstallDev
96 mkdir -p $(1)/usr/include
97 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/libdevmapper.h $(1)/usr/include/
99 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdevmapper.so* $(1)/usr/lib/
100 mkdir -p $(1)/usr/lib/pkgconfig
101 $(CP) $(PKG_BUILD_DIR)/libdm/libdevmapper.pc $(1)/usr/lib/pkgconfig/
104 define Package/libdevmapper/install
105 $(INSTALL_DIR) $(1)/usr/lib
106 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libdevmapper.so.* $(1)/usr/lib/
109 # This rule only installs the `lvm' executable. Debian also installs
110 # a whole bunch of symlinks so that instead of `lvm <foo>' you can directly
112 define Package/lvm2/install
113 $(INSTALL_DIR) $(1)/sbin
114 $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/lvm $(1)/sbin/
115 $(INSTALL_DIR) $(1)/etc/lvm
116 $(INSTALL_DATA) $(PKG_BUILD_DIR)/doc/example.conf $(1)/etc/lvm/lvm.conf
117 $(INSTALL_DIR) $(1)/etc/init.d
118 $(INSTALL_BIN) ./files/lvm2.init $(1)/etc/init.d/lvm2
121 define Package/lvm2/conffiles
125 $(eval $(call BuildPackage,libdevmapper))
126 $(eval $(call BuildPackage,lvm2))