[oe] [meta-oe][PATCH 3/4] lvm2: enable native compilation

Patrick Ohly patrick.ohly at intel.com
Wed Feb 8 09:37:40 UTC 2017


Required for cryptsetup-native, which useful for setting up dm-verity
during a build.

"native-sdk" gets added just in case that this may also be used in an
SDK.

Signed-off-by: Patrick Ohly <patrick.ohly at intel.com>
---
 meta-oe/recipes-support/lvm2/lvm2.inc         | 28 ++++++++++++++++----
 meta-oe/recipes-support/lvm2/lvm2_2.02.166.bb |  2 +-
 2 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/meta-oe/recipes-support/lvm2/lvm2.inc b/meta-oe/recipes-support/lvm2/lvm2.inc
index 7bd26c0..333223a 100644
--- a/meta-oe/recipes-support/lvm2/lvm2.inc
+++ b/meta-oe/recipes-support/lvm2/lvm2.inc
@@ -1,6 +1,6 @@
 SECTION = "utils"
 DESCRIPTION = "LVM2 is a set of utilities to manage logical volumes in Linux."
-DEPENDS = "udev"
+DEPENDS_append_class-target = " udev"
 LICENSE = "GPLv2 & LGPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=12713b4d9386533feeb07d6e4831765a \
                     file://COPYING.LIB;md5=fbc093901857fcd118f065f900982c24"
@@ -16,11 +16,20 @@ S = "${WORKDIR}/LVM2.${PV}"
 
 inherit autotools-brokensep pkgconfig systemd
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)} \
+PACKAGECONFIG_class-target ??= " \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)} \
                    thin-provisioning-tools \
                    odirect \
 "
 
+# odirect is enabled by default also for native compilation because
+# there's currently a bug in lib/device/dev-io.c which prevents
+# compiling without it. It is better to stick to configurations that
+# were actually tested by upstream...
+PACKAGECONFIG ??= " \
+                   odirect \
+"
+
 PACKAGECONFIG[readline] = "--enable-readline,--disable-readline,readline"
 PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux"
 PACKAGECONFIG[thin-provisioning-tools] = "--with-thin=internal,--with-thin=none,,thin-provisioning-tools"
@@ -32,12 +41,9 @@ EXTRA_OECONF = "--with-user= \
                 --enable-realtime \
                 --enable-applib \
                 --enable-cmdlib \
-                --enable-udev_sync \
-                --enable-udev_rules \
                 --enable-pkgconfig \
                 --enable-dmeventd \
                 --enable-lvmetad \
-                --with-udev-prefix= \
                 --with-usrlibdir=${libdir} \
                 --with-systemdsystemunitdir=${systemd_system_unitdir} \
                 --disable-thin_check_needs_check \
@@ -45,12 +51,24 @@ EXTRA_OECONF = "--with-user= \
                 --with-thin-dump=${sbindir}/thin_dump \
                 --with-thin-repair=${sbindir}/thin_repair \
                 --with-thin-restore=${sbindir}/thin_restore \
+                ${EXTRA_OECONF_UDEV} \
+"
+
+EXTRA_OECONF_UDEV = " \
+                --disable-udev_sync \
+                --disable-udev_rules \
+"
+EXTRA_OECONF_UDEV_class-target = " \
+                --enable-udev_sync \
+                --enable-udev_rules \
+                --with-udev-prefix= \
 "
 
 CACHED_CONFIGUREVARS += "MODPROBE_CMD=${base_sbindir}/modprobe"
 
 do_install_append() {
     # Install machine specific configuration file
+    install -d ${D}${sysconfdir}/lvm
     install -m 0644 ${WORKDIR}/lvm.conf ${D}${sysconfdir}/lvm/lvm.conf
     sed -i -e 's:@libdir@:${libdir}:g' ${D}${sysconfdir}/lvm/lvm.conf
     if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
diff --git a/meta-oe/recipes-support/lvm2/lvm2_2.02.166.bb b/meta-oe/recipes-support/lvm2/lvm2_2.02.166.bb
index 8476b01..6983bca 100644
--- a/meta-oe/recipes-support/lvm2/lvm2_2.02.166.bb
+++ b/meta-oe/recipes-support/lvm2/lvm2_2.02.166.bb
@@ -4,3 +4,5 @@ SRC_URI[md5sum] = "c5a54ee0b86703daaad6e856439e115a"
 SRC_URI[sha256sum] = "e120b066b85b224552efda40204488c5123de068725676fd6e5c8bc655051b94"
 
 DEPENDS += "autoconf-archive"
+
+BBCLASSEXTEND = "native nativesdk"
-- 
git-series 0.9.1



More information about the Openembedded-devel mailing list