Yocto 2.3

Move OpenBMC to Yocto 2.3(pyro).

Tested: Built and verified Witherspoon and Palmetto images
Change-Id: I50744030e771f4850afc2a93a10d3507e76d36bc
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Resolves: openbmc/openbmc#2461
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2.inc b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2.inc
index 74b7211..cb5a9e0 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2.inc
+++ b/import-layers/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2.inc
@@ -1,80 +1,33 @@
 SECTION = "utils"
 DESCRIPTION = "LVM2 is a set of utilities to manage logical volumes in Linux."
-DEPENDS = "udev"
 LICENSE = "GPLv2 & LGPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+LIC_FILES_CHKSUM = "file://COPYING;md5=12713b4d9386533feeb07d6e4831765a \
                     file://COPYING.LIB;md5=fbc093901857fcd118f065f900982c24"
 
+DEPENDS += "util-linux"
+
 SRC_URI = "ftp://sources.redhat.com/pub/lvm2/old/LVM2.${PV}.tgz \
            file://lvm.conf \
-           file://0001-implement-libc-specific-_reopen_stream.patch \
-           file://0002-use-PTHREAD_MUTEX_RECURSIVE-instead-of-PTHREAD_MUTEX.patch \
-           file://0003-Guard-use-of-mallinfo-with-__GLIBC__.patch \
-           file://0004-include-fcntl.h-for-O_-defines-and-fcntl-signature.patch \
-           file://0005-tweak-MODPROBE_CMD-for-cross-compile.patch \
+           file://0001-implement-libc-specific-reopen_stream.patch \
+           file://0002-Guard-use-of-mallinfo-with-__GLIBC__.patch \
+           file://0003-include-fcntl.h-for-O_-defines-and-fcntl-signature.patch \
+           file://0004-tweak-MODPROBE_CMD-for-cross-compile.patch \
+           file://0001-Avoid-bashisms-in-init-scripts.patch \
            "
-
 S = "${WORKDIR}/LVM2.${PV}"
 
 inherit autotools-brokensep pkgconfig systemd
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)} \
-                   thin-provisioning-tools \
-                   odirect \
-"
+# odirect is always enabled because there currently is 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_append = " odirect"
 
+PACKAGECONFIG[dmeventd] = "--enable-dmeventd,--disable-dmeventd"
+PACKAGECONFIG[lvmetad] = "--enable-lvmetad,--disable-lvmetad"
+PACKAGECONFIG[odirect] = "--enable-o_direct,--disable-o_direct"
 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"
-PACKAGECONFIG[odirect] = "--enable-o_direct,--disable-o_direct"
-
-# Unset user/group to unbreak install.
-EXTRA_OECONF = "--with-user= \
-                --with-group= \
-                --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 \
-                --with-thin-check=${sbindir}/thin_check \
-                --with-thin-dump=${sbindir}/thin_dump \
-                --with-thin-repair=${sbindir}/thin_repair \
-                --with-thin-restore=${sbindir}/thin_restore \
-"
-
-CACHED_CONFIGUREVARS += "MODPROBE_CMD=${base_sbindir}/modprobe"
-
-do_install_append() {
-    # Install machine specific configuration file
-    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
-        oe_runmake 'DESTDIR=${D}' install install_systemd_units
-        sed -i -e 's:/usr/bin/true:${base_bindir}/true:g' ${D}${systemd_system_unitdir}/blk-availability.service
-    else
-        oe_runmake 'DESTDIR=${D}' install install_initscripts
-        mv ${D}${sysconfdir}/rc.d/init.d ${D}${sysconfdir}/init.d
-        rm -rf ${D}${sysconfdir}/rc.d
-    fi
-}
-
-SYSTEMD_PACKAGES = "${PN}"
-SYSTEMD_SERVICE_${PN} = "lvm2-monitor.service dm-event.socket dm-event.service lvm2-lvmetad.socket \
-                         lvm2-pvscan@.service blk-availability.service"
-SYSTEMD_AUTO_ENABLE = "disable"
-
-TARGET_CC_ARCH += "${LDFLAGS}"
-
-FILES_${PN} += "${libdir}/device-mapper/*.so ${base_libdir}/udev"
-FILES_${PN}-dbg += "${libdir}/device-mapper/.debug"
-
-RDEPENDS_${PN} = "bash"
-
-CONFFILES_${PN} += "${sysconfdir}/lvm/lvm.conf"
+PACKAGECONFIG[udev] = "--enable-udev_sync --enable-udev_rules --with-udevdir=${nonarch_base_libdir}/udev/rules.d,--disable-udev_sync --disable-udev_rules,udev"