Skip to contentSkip to conversation

fix lvm2 invoking lvcreate failed && add python3-pyparted && add python3-pyudev

PATCH In review Hongxu Jia 3 participants 7 messages May 26, 2017 – May 15, 2018

lore
Share & tools
lore

Hongxu Jia

author
#0 lore raw

cover fix lvm2 invoking lvcreate failed && add python3-pyparted && add python3-pyudev

The following changes since commit b063789560bfb9c60a7a15277b5b3a9839b5ba74:

libgpiod: add new recipe (2017-05-23 15:59:31 +0200)

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib hongxu/fix-lvm2
http://cgit.openembedded.org/openembedded-core-contrib/log/?h=hongxu/fix-lvm2

Hongxu Jia (4):
gnome-themes: remove PNBLACKLIST
python3-pyparted: add a python3 recipe
python3-pyudev: add a python3 recipe
lvm2/libdevmapper: fix invoking lvcreate failed

 .../recipes-gnome/themes/gnome-themes_2.32.1.bb    |  6 ++--
 .../recipes-support/lvm2/libdevmapper_2.02.166.bb  | 21 ++-----------
 meta-oe/recipes-support/lvm2/lvm2.inc              | 26 +++++++++++++++-
 .../0001-explicitly-do-not-install-libdm.patch     | 36 ++++++++++++++++++++++
 meta-oe/recipes-support/lvm2/lvm2_2.02.171.bb      | 31 ++-----------------
 .../recipes-devtools/python/python-pyudev.inc      | 19 ++++++++++++
 .../python/python-pyudev_0.21.0.bb                 | 22 +++----------
 .../python/python3-pyudev_0.21.0.bb                |  8 +++++
 .../python-pyparted/python-pyparted.inc            | 21 +++++++++++++
 .../python-pyparted/python-pyparted_3.10.7.bb      | 23 +++-----------
 .../0001-fix-version-float-check.patch             | 26 ++++++++++++++++
 .../python-pyparted/python3-pyparted_3.10.7.bb     | 12 ++++++++
 12 files changed, 163 insertions(+), 88 deletions(-)
 create mode 100644 meta-oe/recipes-support/lvm2/lvm2/0001-explicitly-do-not-install-libdm.patch
 create mode 100644 meta-python/recipes-devtools/python/python-pyudev.inc
 create mode 100644 meta-python/recipes-devtools/python/python3-pyudev_0.21.0.bb
 create mode 100644 meta-python/recipes-extended/python-pyparted/python-pyparted.inc
 create mode 100644 meta-python/recipes-extended/python-pyparted/python3-pyparted/0001-fix-version-float-check.patch
 create mode 100644 meta-python/recipes-extended/python-pyparted/python3-pyparted_3.10.7.bb
Signature · 1 line
2.8.1
author
#1 lore raw

PATCH 1/4 gnome-themes: remove PNBLACKLIST

- Since gtk-engines was removed from PNBLACKLIST,
so we could build gnome-themes

- Add glib-2.0-native to DEPENDS.

---
 meta-gnome/recipes-gnome/themes/gnome-themes_2.32.1.bb | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
meta-gnome/recipes-gnome/themes/gnome-themes_2.32.1.bb +4 -2
index e8f8314..1a89f48 100644
@@ -5,7 +5,10 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=2b543dc97eb7594d026af39d9b54204b"
 PR = "r3"
 
 SECTION = "x11/gnome"
-DEPENDS = "gtk-engines icon-naming-utils icon-naming-utils-native glib-2.0 intltool-native libxml-simple-perl-native"
+DEPENDS = "gtk-engines icon-naming-utils icon-naming-utils-native \
+           glib-2.0 intltool-native libxml-simple-perl-native \
+           glib-2.0-native \
+"
 RDEPENDS_${PN} = "adwaita-icon-theme"
 
 EXTRA_OECONF += "--enable-all-themes \
@@ -32,4 +35,3 @@ SRC_URI[archive.md5sum] = "41db9e3cb25d35af2675c599e67944d1"
 SRC_URI[archive.sha256sum] = "8601ee24c2e096593221cbd6ebdb6686042225a03c02a01c0d67c163f9febd1a"
 GNOME_COMPRESS_TYPE="bz2"
 
-PNBLACKLIST[gnome-themes] ?= "Depends on blacklisted gtk-engines - the recipe will be removed on 2017-09-01 unless the issue is fixed"
Signature · 1 line
2.8.1
author
#2 lore raw

PATCH 2/4 python3-pyparted: add a python3 recipe

In reply to Hongxu Jia

- Split to a common python-pyparted.inc for python2 and python3

- Tweak 0001-fix-version-float-check.patch for python3 to fix do_compile errror
----

| ERROR: python3 setup.py build_ext execution failed.
| Traceback (most recent call last):
|   File "setup.py", line 62, in <module>
|     check_mod_version('libparted', need_libparted_version)
|   File "setup.py", line 55, in check_mod_version
|     match = re.search('([0-9]+\.[0-9]+)', modversion)
|   File "work/core2-64-wrs-linux/python3-pyparted/3.10.7+gitAU

TOINC+69c4a478e4-r0/recipe-sysroot-native/usr/lib/python3.5/re.py", line 173, in search
| return _compile(pattern, flags).search(string)
| TypeError: cannot use a string pattern on a bytes-like object
----

The reason is the return of subprocess.check_output is byte in python3, but string in python2

---
 .../python-pyparted/python-pyparted.inc            | 21 +++++++++++++++++
 .../python-pyparted/python-pyparted_3.10.7.bb      | 23 ++++---------------
 .../0001-fix-version-float-check.patch             | 26 ++++++++++++++++++++++
 .../python-pyparted/python3-pyparted_3.10.7.bb     | 12 ++++++++++
 4 files changed, 63 insertions(+), 19 deletions(-)
 create mode 100644 meta-python/recipes-extended/python-pyparted/python-pyparted.inc
 create mode 100644 meta-python/recipes-extended/python-pyparted/python3-pyparted/0001-fix-version-float-check.patch
 create mode 100644 meta-python/recipes-extended/python-pyparted/python3-pyparted_3.10.7.bb
meta-python/recipes-extended/python-pyparted/python-pyparted.inc new file +21 -0
new file mode 100644
index 0000000..65f8ca1
@@ -0,0 +1,21 @@
+DESCRIPTION = "pyparted is a set of Python modules that provide Python programmers \
+an interface to libparted, the GNU parted library for disk partitioning and \
+filesystem manipulation."
+SUMMARY = "Python bindings for libparted"
+HOMEPAGE = "https://github.com/rhinstaller/pyparted"
+LICENSE = "GPL-2.0+"
+LIC_FILES_CHKSUM = "\
+    file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \
+    file://src/_pedmodule.c;startline=10;endline=22;md5=ebcb25dde1ac9c46e986dec79b404e7e \
+"
+DEPENDS += "parted"
+
+# upstream only publishes releases in github archives which are discouraged
+SRCREV = "69c4a478e43d3eff6ae3a0116fa38da06776d5f5"
+SRC_URI = "git://github.com/rhinstaller/pyparted.git;protocol=https \
+           file://0001-fix-version-float-check.patch \
+"
+S = "${WORKDIR}/git"
+
+RDEPENDS_${PN} += "parted (>= 2.3)"
+RDEPENDS_${PN}_class-native = ""
meta-python/recipes-extended/python-pyparted/python-pyparted_3.10.7.bb +4 -19
index 8335d08..8a15a89 100644
@@ -1,27 +1,12 @@
-DESCRIPTION = "pyparted is a set of Python modules that provide Python programmers \
-an interface to libparted, the GNU parted library for disk partitioning and \
-filesystem manipulation."
-SUMMARY = "Python bindings for libparted"
-HOMEPAGE = "https://github.com/rhinstaller/pyparted"
-LICENSE = "GPL-2.0+"
-LIC_FILES_CHKSUM = "\
-    file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \
-    file://src/_pedmodule.c;startline=10;endline=22;md5=ebcb25dde1ac9c46e986dec79b404e7e \
-"
-DEPENDS += "parted python-re"
+require python-pyparted.inc
 
-PV = "3.10.7+git${SRCPV}"
+DEPENDS += "python-re"
 
-# upstream only publishes releases in github archives which are discouraged
-SRCREV = "69c4a478e43d3eff6ae3a0116fa38da06776d5f5"
-SRC_URI = "git://github.com/rhinstaller/pyparted.git;protocol=https \
-           file://0001-fix-version-float-check.patch \
-"
-S = "${WORKDIR}/git"
+PV = "3.10.7+git${SRCPV}"
 
 inherit distutils
 
-RDEPENDS_${PN} += "python-stringold python-codecs python-math parted (>= 2.3)"
+RDEPENDS_${PN} += "python-stringold python-codecs python-math"
 RDEPENDS_${PN}_class-native = ""
 
 BBCLASSEXTEND = "native"
meta-python/recipes-extended/python-pyparted/python3-pyparted/0001-fix-version-float-check.patch new file +26 -0
new file mode 100644
index 0000000..14fb0bb
@@ -0,0 +1,26 @@
+check_mod_version breaks if module version is of x.y.z form
+use a regex to help cast x.y.z version to a float
+
+Upstream-Status: Pending
+
+Index: git/setup.py
+===================================================================
+--- git.orig/setup.py
++++ git/setup.py
+@@ -25,6 +25,7 @@ import glob
+ import os
+ import platform
+ import sys
++import re
+ from distutils.ccompiler import new_compiler
+ from distutils.errors import CompileError
+ from distutils.errors import LinkError
+@@ -51,6 +52,8 @@ def pkgconfig(*packages, **kwargs):
+ 
+ def check_mod_version(module, version):
+     modversion = subprocess.check_output(["pkg-config", "--modversion", module])
++    match = re.search(b'([0-9]+\.[0-9]+)', modversion)
++    modversion = match.group(0)
+     if not float(modversion) >= float(version):
+         sys.stderr.write("*** Minimum required %s version: %s, found: %s\n" % (module, version, modversion,))
+         sys.exit(1)
meta-python/recipes-extended/python-pyparted/python3-pyparted_3.10.7.bb new file +12 -0
new file mode 100644
index 0000000..ff72c2a
@@ -0,0 +1,12 @@
+require python-pyparted.inc
+
+DEPENDS += "python3-re"
+
+PV = "3.10.7+git${SRCPV}"
+
+inherit distutils3
+
+RDEPENDS_${PN} += "python3-stringold python3-codecs python3-math"
+RDEPENDS_${PN}_class-native = ""
+
+BBCLASSEXTEND = "native"
Signature · 1 line
2.8.1
author
#3 lore raw

PATCH 3/4 python3-pyudev: add a python3 recipe

In reply to Hongxu Jia

- Split to a common python-pyudev.inc for python2 and python3

- The contextlib module is moved to python3-lang.

---
 .../recipes-devtools/python/python-pyudev.inc      | 19 +++++++++++++++++++
 .../python/python-pyudev_0.21.0.bb                 | 22 ++++------------------
 .../python/python3-pyudev_0.21.0.bb                |  8 ++++++++
 3 files changed, 31 insertions(+), 18 deletions(-)
 create mode 100644 meta-python/recipes-devtools/python/python-pyudev.inc
 create mode 100644 meta-python/recipes-devtools/python/python3-pyudev_0.21.0.bb
meta-python/recipes-devtools/python/python-pyudev.inc new file +19 -0
new file mode 100644
index 0000000..ab4c5fd
@@ -0,0 +1,19 @@
+SUMMARY = "A libudev binding"
+LICENSE = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343"
+
+SRC_URI[md5sum] = "cf4d9db7d772622144ca1be6b5d9353b"
+SRC_URI[sha256sum] = "094b7a100150114748aaa3b70663485dd360457a709bfaaafe5a977371033f2b"
+
+do_configure_prepend() {
+    sed -i "/import pyudev/d" ${S}/setup.py
+    sed -i "s/str(pyudev.__version__)/'${PV}'/g" ${S}/setup.py
+}
+
+RDEPENDS_${PN} = "\
+    ${PYTHON_PN}-ctypes \
+    ${PYTHON_PN}-misc \
+    ${PYTHON_PN}-six \
+    ${PYTHON_PN}-subprocess \
+    ${PYTHON_PN}-threading \
+"
meta-python/recipes-devtools/python/python-pyudev_0.21.0.bb +4 -18
index b0a1acb..32573b7 100644
@@ -1,22 +1,8 @@
-SUMMARY = "A libudev binding"
-LICENSE = "LGPLv2.1+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343"
-
-SRC_URI[md5sum] = "cf4d9db7d772622144ca1be6b5d9353b"
-SRC_URI[sha256sum] = "094b7a100150114748aaa3b70663485dd360457a709bfaaafe5a977371033f2b"
-
-inherit pypi setuptools
-
-do_configure_prepend() {
-    sed -i "/import pyudev/d" ${S}/setup.py
-    sed -i "s/str(pyudev.__version__)/'${PV}'/g" ${S}/setup.py
-}
+require python-pyudev.inc
 
 RDEPENDS_${PN} = "\
     ${PYTHON_PN}-contextlib \
-    ${PYTHON_PN}-ctypes \
-    ${PYTHON_PN}-misc \
-    ${PYTHON_PN}-six \
-    ${PYTHON_PN}-subprocess \
-    ${PYTHON_PN}-threading \
 "
+
+inherit pypi setuptools
+
meta-python/recipes-devtools/python/python3-pyudev_0.21.0.bb new file +8 -0
new file mode 100644
index 0000000..0292555
@@ -0,0 +1,8 @@
+require python-pyudev.inc
+
+RDEPENDS_${PN} = "\
+    ${PYTHON_PN}-lang \
+"
+
+inherit pypi setuptools3
+
Signature · 1 line
2.8.1
author
#4 lore raw

PATCH 4/4 lvm2/libdevmapper: fix invoking lvcreate failed

In reply to Hongxu Jia

Previously, libdevmapper is separated from lvm2 in the following commit:
---
commit 7f17da154372b5ec33947766783444961e8aa67c

Author: Chen Qi <[email protected]>
Date:   Mon Apr 24 16:06:41 2017 +0800

lvm2: separate libdevmapper to avoid circular dependency
---

It caused invoking lvcreate failed:
---

root@qemux86-64:~# lvm pvcreate /dev/sda
  Physical volume "/dev/sda" successfully created.
root@qemux86-64:~# lvm vgcreate -s 4096K wrl /dev/sda
  Volume group "wrl" successfully created
root@qemux86-64:~# lvm lvcreate -n swap -L 2293648K -y --type linear wrl
  Rounding up size to full physical extent 2.19 GiB
  /dev/wrl/swap: not found: device not cleared
  Aborting. Failed to wipe start of new LV.
---

The lvm2 and libdevmapper should use the same PACKAGECONFIG and EXTRA_OECONF.

And do not manually remove useless files.

---
 .../recipes-support/lvm2/libdevmapper_2.02.166.bb  | 21 ++-----------
 meta-oe/recipes-support/lvm2/lvm2.inc              | 26 +++++++++++++++-
 .../0001-explicitly-do-not-install-libdm.patch     | 36 ++++++++++++++++++++++
 meta-oe/recipes-support/lvm2/lvm2_2.02.171.bb      | 31 ++-----------------
 4 files changed, 65 insertions(+), 49 deletions(-)
 create mode 100644 meta-oe/recipes-support/lvm2/lvm2/0001-explicitly-do-not-install-libdm.patch
meta-oe/recipes-support/lvm2/libdevmapper_2.02.166.bb +2 -19
index fd1fc2c..3cf939d 100644
@@ -5,27 +5,10 @@ SRC_URI[sha256sum] = "e120b066b85b224552efda40204488c5123de068725676fd6e5c8bc655
 
 DEPENDS += "autoconf-archive-native"
 
-PACKAGECONFIG = ""
-
-# Unset user/group to unbreak install.
-EXTRA_OECONF = "--with-user= \
-                --with-group= \
-                --enable-pkgconfig \
-                --with-usrlibdir=${libdir} \
-"
-
 TARGET_CC_ARCH += "${LDFLAGS}"
 
-do_install_append() {
-    # Remove things unrelated to libdevmapper
-    rm -rf ${D}${sysconfdir}
-    for i in `ls ${D}${sbindir}/*`; do
-	if [ $i != ${D}${sbindir}/dmsetup ]; then
-	    rm $i
-	fi
-    done
-    # Remove docs
-    rm -rf ${D}${datadir}
+do_install() {
+    oe_runmake 'DESTDIR=${D}' -C libdm install
 }
 
 RRECOMMENDS_${PN}_append_class-target = " lvm2-udevrules"
meta-oe/recipes-support/lvm2/lvm2.inc +25 -1
index cb5a9e0..c2dac95 100644
@@ -18,11 +18,18 @@ S = "${WORKDIR}/LVM2.${PV}"
 
 inherit autotools-brokensep pkgconfig systemd
 
+LVM2_PACKAGECONFIG = "dmeventd lvmetad"
+LVM2_PACKAGECONFIG_append_class-target = " \
+    ${@bb.utils.filter('DISTRO_FEATURES', 'selinux', d)} \
+    thin-provisioning-tools \
+    udev \
+"
+
 # 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 ??= "odirect ${LVM2_PACKAGECONFIG}"
 
 PACKAGECONFIG[dmeventd] = "--enable-dmeventd,--disable-dmeventd"
 PACKAGECONFIG[lvmetad] = "--enable-lvmetad,--disable-lvmetad"
@@ -31,3 +38,20 @@ 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[udev] = "--enable-udev_sync --enable-udev_rules --with-udevdir=${nonarch_base_libdir}/udev/rules.d,--disable-udev_sync --disable-udev_rules,udev"
+
+# Unset user/group to unbreak install.
+EXTRA_OECONF = "--with-user= \
+                --with-group= \
+                --enable-realtime \
+                --enable-applib \
+                --enable-cmdlib \
+                --enable-pkgconfig \
+                --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 \
+"
+
meta-oe/recipes-support/lvm2/lvm2/0001-explicitly-do-not-install-libdm.patch new file +36 -0
new file mode 100644
index 0000000..e85818d
@@ -0,0 +1,36 @@
+From 0a8e466fcf99622896e070c5133165e4278e8cfb Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <[email protected]>
+Date: Thu, 25 May 2017 05:27:11 -0400
+Subject: [PATCH] explicitly do not install libdm
+
+Already have package libdevmapper which split from lvm2,
+explicitly do not do the installation here.
+
+Upstream-Status: Inappropriate [meta-oe specific]
+
+Signed-off-by: Hongxu Jia <[email protected]>
+---
+ libdm/Makefile.in | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/libdm/Makefile.in b/libdm/Makefile.in
+index 3c9a4ce..45c91c6 100644
+--- a/libdm/Makefile.in
++++ b/libdm/Makefile.in
+@@ -77,9 +77,11 @@ ifeq ("@PKGCONFIG@", "yes")
+   INSTALL_TYPE += install_pkgconfig
+ endif
+ 
+-install: $(INSTALL_TYPE) install_include
++install:
++	echo "Do not install device mappler in lvm2"
+ 
+-install_device-mapper: install
++install_device-mapper:
++	echo "Do not install device mappler in lvm2"
+ 
+ install_include: $(srcdir)/libdevmapper.h
+ 	$(INSTALL_DATA) -D $< $(includedir)/$(<F)
+-- 
+2.8.1
+
meta-oe/recipes-support/lvm2/lvm2_2.02.171.bb +2 -29
index 38c4414..84881e7 100644
@@ -3,32 +3,9 @@ require lvm2.inc
 SRC_URI[md5sum] = "153b7bb643eb26073274968e9026fa8f"
 SRC_URI[sha256sum] = "b815a711a2fabaa5c3dc1a4a284df0268bf0f325f0fc0f5c9530c9bbb54b9964"
 
-DEPENDS += "autoconf-archive-native"
-
-LVM2_PACKAGECONFIG = "dmeventd lvmetad"
-LVM2_PACKAGECONFIG_append_class-target = " \
-    ${@bb.utils.filter('DISTRO_FEATURES', 'selinux', d)} \
-    thin-provisioning-tools \
-    udev \
-"
+SRC_URI += "file://0001-explicitly-do-not-install-libdm.patch"
 
-PACKAGECONFIG ??= "${LVM2_PACKAGECONFIG}"
-
-# Unset user/group to unbreak install.
-EXTRA_OECONF = "--with-user= \
-                --with-group= \
-                --enable-realtime \
-                --enable-applib \
-                --enable-cmdlib \
-                --enable-pkgconfig \
-                --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 \
-"
+DEPENDS += "autoconf-archive-native"
 
 CACHED_CONFIGUREVARS += "MODPROBE_CMD=${base_sbindir}/modprobe"
 
@@ -45,10 +22,6 @@ do_install_append() {
         mv ${D}${sysconfdir}/rc.d/init.d ${D}${sysconfdir}/init.d
         rm -rf ${D}${sysconfdir}/rc.d
     fi
-    # Remove things related to libdevmapper
-    rm -f ${D}${sbindir}/dmsetup
-    rm -f ${D}${libdir}/libdevmapper.so.*
-    rm -f ${D}${libdir}/libdevmapper.so ${D}${libdir}/pkgconfig/devmapper.pc ${D}${includedir}/libdevmapper.h
 }
 
 PACKAGE_BEFORE_PN = "${PN}-scripts ${PN}-udevrules"
Signature · 1 line
2.8.1
#5 lore raw

Re: [meta-oe][PATCH 4/4] lvm2/libdevmapper: fix invoking lvcreate failed

Sorry to resurrect such an old thread... :)

The dependency on udev brings back the c the libdevmapper circular dependency when systemd is used with cryptsetup. (systemd -> cryptsetup -> libdevmapper -> udev|systemd).

Any thoughts on how to properly fix that (other than removing udev from PACKAGECONFIG)?

Quoted 214 lines · Hongxu Jia

Previously, libdevmapper is separated from lvm2 in the following commit:
---
commit 7f17da154372b5ec33947766783444961e8aa67c

Author: Chen Qi <[email protected]>
Date:   Mon Apr 24 16:06:41 2017 +0800

lvm2: separate libdevmapper to avoid circular dependency
---

It caused invoking lvcreate failed:
---

root@qemux86-64:~# lvm pvcreate /dev/sda
  Physical volume "/dev/sda" successfully created.
root@qemux86-64:~# lvm vgcreate -s 4096K wrl /dev/sda
  Volume group "wrl" successfully created
root@qemux86-64:~# lvm lvcreate -n swap -L 2293648K -y --type linear wrl
  Rounding up size to full physical extent 2.19 GiB
  /dev/wrl/swap: not found: device not cleared
  Aborting. Failed to wipe start of new LV.
---

The lvm2 and libdevmapper should use the same PACKAGECONFIG and EXTRA_OECONF.

And do not manually remove useless files.

---
 .../recipes-support/lvm2/libdevmapper_2.02.166.bb  | 21 ++-----------
 meta-oe/recipes-support/lvm2/lvm2.inc              | 26 +++++++++++++++-
 .../0001-explicitly-do-not-install-libdm.patch     | 36 ++++++++++++++++++++++
 meta-oe/recipes-support/lvm2/lvm2_2.02.171.bb      | 31 ++-----------------
 4 files changed, 65 insertions(+), 49 deletions(-)
 create mode 100644 meta-oe/recipes-support/lvm2/lvm2/0001-explicitly-do-not-install-libdm.patch
meta-oe/recipes-support/lvm2/libdevmapper_2.02.166.bb +2 -19
index fd1fc2c..3cf939d 100644
@@ -5,27 +5,10 @@ SRC_URI[sha256sum] = "e120b066b85b224552efda40204488c5123de068725676fd6e5c8bc655
 
 DEPENDS += "autoconf-archive-native"
 
-PACKAGECONFIG = ""
-
-# Unset user/group to unbreak install.
-EXTRA_OECONF = "--with-user= \
-                --with-group= \
-                --enable-pkgconfig \
-                --with-usrlibdir=${libdir} \
-"
-
 TARGET_CC_ARCH += "${LDFLAGS}"
 
-do_install_append() {
-    # Remove things unrelated to libdevmapper
-    rm -rf ${D}${sysconfdir}
-    for i in `ls ${D}${sbindir}/*`; do
-       if [ $i != ${D}${sbindir}/dmsetup ]; then
-           rm $i
-       fi
-    done
-    # Remove docs
-    rm -rf ${D}${datadir}
+do_install() {
+    oe_runmake 'DESTDIR=${D}' -C libdm install
 }
 
 RRECOMMENDS_${PN}_append_class-target = " lvm2-udevrules"
meta-oe/recipes-support/lvm2/lvm2.inc +25 -1
index cb5a9e0..c2dac95 100644
@@ -18,11 +18,18 @@ S = "${WORKDIR}/LVM2.${PV}"
 
 inherit autotools-brokensep pkgconfig systemd
 
+LVM2_PACKAGECONFIG = "dmeventd lvmetad"
+LVM2_PACKAGECONFIG_append_class-target = " \
+    ${@bb.utils.filter('DISTRO_FEATURES', 'selinux', d)} \
+    thin-provisioning-tools \
+    udev \
+"
+
 # 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 ??= "odirect ${LVM2_PACKAGECONFIG}"
 
 PACKAGECONFIG[dmeventd] = "--enable-dmeventd,--disable-dmeventd"
 PACKAGECONFIG[lvmetad] = "--enable-lvmetad,--disable-lvmetad"
@@ -31,3 +38,20 @@ 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[udev] = "--enable-udev_sync --enable-udev_rules --with-udevdir=${nonarch_base_libdir}/udev/rules.d,--disable-udev_sync --disable-udev_rules,udev"
+
+# Unset user/group to unbreak install.
+EXTRA_OECONF = "--with-user= \
+                --with-group= \
+                --enable-realtime \
+                --enable-applib \
+                --enable-cmdlib \
+                --enable-pkgconfig \
+                --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 \
+"
+
meta-oe/recipes-support/lvm2/lvm2/0001-explicitly-do-not-install-libdm.patch new file +36 -0
new file mode 100644
index 0000000..e85818d
@@ -0,0 +1,36 @@
+From 0a8e466fcf99622896e070c5133165e4278e8cfb Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <[email protected]>
+Date: Thu, 25 May 2017 05:27:11 -0400
+Subject: [PATCH] explicitly do not install libdm
+
+Already have package libdevmapper which split from lvm2,
+explicitly do not do the installation here.
+
+Upstream-Status: Inappropriate [meta-oe specific]
+
+Signed-off-by: Hongxu Jia <[email protected]>
+---
+ libdm/Makefile.in | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/libdm/Makefile.in b/libdm/Makefile.in
+index 3c9a4ce..45c91c6 100644
+--- a/libdm/Makefile.in
++++ b/libdm/Makefile.in
+@@ -77,9 +77,11 @@ ifeq ("@PKGCONFIG@", "yes")
+   INSTALL_TYPE += install_pkgconfig
+ endif
+
+-install: $(INSTALL_TYPE) install_include
++install:
++      echo "Do not install device mappler in lvm2"
+
+-install_device-mapper: install
++install_device-mapper:
++      echo "Do not install device mappler in lvm2"
+
+ install_include: $(srcdir)/libdevmapper.h
+       $(INSTALL_DATA) -D $< $(includedir)/$(<F)
+--
+2.8.1
+
meta-oe/recipes-support/lvm2/lvm2_2.02.171.bb +2 -30
index 38c4414..84881e7 100644
@@ -3,32 +3,9 @@ require lvm2.inc
 SRC_URI[md5sum] = "153b7bb643eb26073274968e9026fa8f"
 SRC_URI[sha256sum] = "b815a711a2fabaa5c3dc1a4a284df0268bf0f325f0fc0f5c9530c9bbb54b9964"
 
-DEPENDS += "autoconf-archive-native"
-
-LVM2_PACKAGECONFIG = "dmeventd lvmetad"
-LVM2_PACKAGECONFIG_append_class-target = " \
-    ${@bb.utils.filter('DISTRO_FEATURES', 'selinux', d)} \
-    thin-provisioning-tools \
-    udev \
-"
+SRC_URI += "file://0001-explicitly-do-not-install-libdm.patch"
 
-PACKAGECONFIG ??= "${LVM2_PACKAGECONFIG}"
-
-# Unset user/group to unbreak install.
-EXTRA_OECONF = "--with-user= \
-                --with-group= \
-                --enable-realtime \
-                --enable-applib \
-                --enable-cmdlib \
-                --enable-pkgconfig \
-                --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 \
-"
+DEPENDS += "autoconf-archive-native"
 
 CACHED_CONFIGUREVARS += "MODPROBE_CMD=${base_sbindir}/modprobe"
 
@@ -45,10 +22,6 @@ do_install_append() {
         mv ${D}${sysconfdir}/rc.d/init.d ${D}${sysconfdir}/init.d
         rm -rf ${D}${sysconfdir}/rc.d
     fi
-    # Remove things related to libdevmapper
-    rm -f ${D}${sbindir}/dmsetup
-    rm -f ${D}${libdir}/libdevmapper.so.*
-    rm -f ${D}${libdir}/libdevmapper.so ${D}${libdir}/pkgconfig/devmapper.pc ${D}${includedir}/libdevmapper.h
 }
 
 PACKAGE_BEFORE_PN = "${PN}-scripts ${PN}-udevrules"
--

2.8.1

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

#6 lore raw

Re: [meta-oe][PATCH 4/4] lvm2/libdevmapper: fix invoking lvcreate failed

I think I've got to reply. But frankly, I don't have any idea how to solve this circular dependency problem.

Normally we have two ways to solve circular dependency problems:
1) Add some new recipe to replace one in the chain
2) Break some recipe in the chain into multiple recipes, giving them different dependencies

In this systemd/cryptsetup/libdevmapper case, I don't think the above approaches would work.

Hope someone in the mailing list could give me some suggestions.

Best Regards,
Chen Qi

Quoted 224 lines · Chris Patterson

Sorry to resurrect such an old thread... :)

The dependency on udev brings back the c the libdevmapper circular dependency when systemd is used with cryptsetup. (systemd -> cryptsetup -> libdevmapper -> udev|systemd).

Any thoughts on how to properly fix that (other than removing udev from PACKAGECONFIG)?

Quoted 214 lines · Hongxu Jia

Previously, libdevmapper is separated from lvm2 in the following commit:
---
commit 7f17da154372b5ec33947766783444961e8aa67c

Author: Chen Qi <[email protected]>
Date:   Mon Apr 24 16:06:41 2017 +0800

lvm2: separate libdevmapper to avoid circular dependency
---

It caused invoking lvcreate failed:
---

root@qemux86-64:~# lvm pvcreate /dev/sda
   Physical volume "/dev/sda" successfully created.
root@qemux86-64:~# lvm vgcreate -s 4096K wrl /dev/sda
   Volume group "wrl" successfully created
root@qemux86-64:~# lvm lvcreate -n swap -L 2293648K -y --type linear wrl
   Rounding up size to full physical extent 2.19 GiB
   /dev/wrl/swap: not found: device not cleared
   Aborting. Failed to wipe start of new LV.
---

The lvm2 and libdevmapper should use the same PACKAGECONFIG and EXTRA_OECONF.

And do not manually remove useless files.

---
  .../recipes-support/lvm2/libdevmapper_2.02.166.bb  | 21 ++-----------
  meta-oe/recipes-support/lvm2/lvm2.inc              | 26 +++++++++++++++-
  .../0001-explicitly-do-not-install-libdm.patch     | 36 ++++++++++++++++++++++
  meta-oe/recipes-support/lvm2/lvm2_2.02.171.bb      | 31 ++-----------------
  4 files changed, 65 insertions(+), 49 deletions(-)

create mode 100644 meta-oe/recipes-support/lvm2/lvm2/0001-explicitly-do-not-install-libdm.patch

meta-oe/recipes-support/lvm2/libdevmapper_2.02.166.bb +2 -19
index fd1fc2c..3cf939d 100644
@@ -5,27 +5,10 @@ SRC_URI[sha256sum] = "e120b066b85b224552efda40204488c5123de068725676fd6e5c8bc655
 
  DEPENDS += "autoconf-archive-native"
 
-PACKAGECONFIG = ""
-
-# Unset user/group to unbreak install.
-EXTRA_OECONF = "--with-user= \
-                --with-group= \
-                --enable-pkgconfig \
-                --with-usrlibdir=${libdir} \
-"
-
  TARGET_CC_ARCH += "${LDFLAGS}"
 
-do_install_append() {
-    # Remove things unrelated to libdevmapper
-    rm -rf ${D}${sysconfdir}
-    for i in `ls ${D}${sbindir}/*`; do
-       if [ $i != ${D}${sbindir}/dmsetup ]; then
-           rm $i
-       fi
-    done
-    # Remove docs
-    rm -rf ${D}${datadir}
+do_install() {
+    oe_runmake 'DESTDIR=${D}' -C libdm install
  }
 
  RRECOMMENDS_${PN}_append_class-target = " lvm2-udevrules"
meta-oe/recipes-support/lvm2/lvm2.inc +25 -1
index cb5a9e0..c2dac95 100644
@@ -18,11 +18,18 @@ S = "${WORKDIR}/LVM2.${PV}"
 
  inherit autotools-brokensep pkgconfig systemd
 
+LVM2_PACKAGECONFIG = "dmeventd lvmetad"
+LVM2_PACKAGECONFIG_append_class-target = " \
+    ${@bb.utils.filter('DISTRO_FEATURES', 'selinux', d)} \
+    thin-provisioning-tools \
+    udev \
+"
+
  # 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 ??= "odirect ${LVM2_PACKAGECONFIG}"
 
  PACKAGECONFIG[dmeventd] = "--enable-dmeventd,--disable-dmeventd"
  PACKAGECONFIG[lvmetad] = "--enable-lvmetad,--disable-lvmetad"
@@ -31,3 +38,20 @@ 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[udev] = "--enable-udev_sync --enable-udev_rules --with-udevdir=${nonarch_base_libdir}/udev/rules.d,--disable-udev_sync --disable-udev_rules,udev"
+
+# Unset user/group to unbreak install.
+EXTRA_OECONF = "--with-user= \
+                --with-group= \
+                --enable-realtime \
+                --enable-applib \
+                --enable-cmdlib \
+                --enable-pkgconfig \
+                --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 \
+"
+
meta-oe/recipes-support/lvm2/lvm2/0001-explicitly-do-not-install-libdm.patch new file +36 -0
new file mode 100644
index 0000000..e85818d
@@ -0,0 +1,36 @@
+From 0a8e466fcf99622896e070c5133165e4278e8cfb Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <[email protected]>
+Date: Thu, 25 May 2017 05:27:11 -0400
+Subject: [PATCH] explicitly do not install libdm
+
+Already have package libdevmapper which split from lvm2,
+explicitly do not do the installation here.
+
+Upstream-Status: Inappropriate [meta-oe specific]
+
+Signed-off-by: Hongxu Jia <[email protected]>
+---
+ libdm/Makefile.in | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/libdm/Makefile.in b/libdm/Makefile.in
+index 3c9a4ce..45c91c6 100644
+--- a/libdm/Makefile.in
++++ b/libdm/Makefile.in
+@@ -77,9 +77,11 @@ ifeq ("@PKGCONFIG@", "yes")
+   INSTALL_TYPE += install_pkgconfig
+ endif
+
+-install: $(INSTALL_TYPE) install_include
++install:
++      echo "Do not install device mappler in lvm2"
+
+-install_device-mapper: install
++install_device-mapper:
++      echo "Do not install device mappler in lvm2"
+
+ install_include: $(srcdir)/libdevmapper.h
+       $(INSTALL_DATA) -D $< $(includedir)/$(<F)
+--
+2.8.1
+
meta-oe/recipes-support/lvm2/lvm2_2.02.171.bb +2 -30
index 38c4414..84881e7 100644
@@ -3,32 +3,9 @@ require lvm2.inc
  SRC_URI[md5sum] = "153b7bb643eb26073274968e9026fa8f"
  SRC_URI[sha256sum] = "b815a711a2fabaa5c3dc1a4a284df0268bf0f325f0fc0f5c9530c9bbb54b9964"
 
-DEPENDS += "autoconf-archive-native"
-
-LVM2_PACKAGECONFIG = "dmeventd lvmetad"
-LVM2_PACKAGECONFIG_append_class-target = " \
-    ${@bb.utils.filter('DISTRO_FEATURES', 'selinux', d)} \
-    thin-provisioning-tools \
-    udev \
-"
+SRC_URI += "file://0001-explicitly-do-not-install-libdm.patch"
 
-PACKAGECONFIG ??= "${LVM2_PACKAGECONFIG}"
-
-# Unset user/group to unbreak install.
-EXTRA_OECONF = "--with-user= \
-                --with-group= \
-                --enable-realtime \
-                --enable-applib \
-                --enable-cmdlib \
-                --enable-pkgconfig \
-                --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 \
-"
+DEPENDS += "autoconf-archive-native"
 
  CACHED_CONFIGUREVARS += "MODPROBE_CMD=${base_sbindir}/modprobe"
 
@@ -45,10 +22,6 @@ do_install_append() {
          mv ${D}${sysconfdir}/rc.d/init.d ${D}${sysconfdir}/init.d
          rm -rf ${D}${sysconfdir}/rc.d
      fi
-    # Remove things related to libdevmapper
-    rm -f ${D}${sbindir}/dmsetup
-    rm -f ${D}${libdir}/libdevmapper.so.*
-    rm -f ${D}${libdir}/libdevmapper.so ${D}${libdir}/pkgconfig/devmapper.pc ${D}${includedir}/libdevmapper.h
  }
 
  PACKAGE_BEFORE_PN = "${PN}-scripts ${PN}-udevrules"
--

2.8.1

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel