[meta-virtualization] [PATCH] ceph: fix Distutils.cmake installation for cross compile

Dengke Du dengke.du at windriver.com
Fri Oct 26 02:02:01 PDT 2018


1. Remove the detection for build host and correct the install destination
   for cross compile.
2. Delete the build host information in the results files.

Signed-off-by: Dengke Du <dengke.du at windriver.com>
---
 ...tect-init-correct-the-installation-for-OE.patch | 36 ++++++++++++++++++++++
 recipes-extended/ceph/ceph_13.2.2.bb               | 28 ++++++++++++-----
 2 files changed, 56 insertions(+), 8 deletions(-)
 create mode 100644 recipes-extended/ceph/ceph/0001-ceph-detect-init-correct-the-installation-for-OE.patch

diff --git a/recipes-extended/ceph/ceph/0001-ceph-detect-init-correct-the-installation-for-OE.patch b/recipes-extended/ceph/ceph/0001-ceph-detect-init-correct-the-installation-for-OE.patch
new file mode 100644
index 0000000..875501b
--- /dev/null
+++ b/recipes-extended/ceph/ceph/0001-ceph-detect-init-correct-the-installation-for-OE.patch
@@ -0,0 +1,36 @@
+From 6aaf04036f0affbeddda123bff111990c4d5fd72 Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du at windriver.com>
+Date: Fri, 26 Oct 2018 14:31:10 +0800
+Subject: [PATCH] ceph-detect-init: correct the installation for OE
+
+Signed-off-by: Dengke Du <dengke.du at windriver.com>
+Upstream-Status: Inappropriate [oe specific]
+---
+ cmake/modules/Distutils.cmake | 11 ++---------
+ 1 file changed, 2 insertions(+), 9 deletions(-)
+
+diff --git a/cmake/modules/Distutils.cmake b/cmake/modules/Distutils.cmake
+index 3091d97..c50fe77 100644
+--- a/cmake/modules/Distutils.cmake
++++ b/cmake/modules/Distutils.cmake
+@@ -16,15 +16,8 @@ function(distutils_install_module name)
+   cmake_parse_arguments(DU "" INSTALL_SCRIPT "" ${ARGN})
+   install(CODE "
+     set(options --prefix=${CMAKE_INSTALL_PREFIX})
+-    if(DEFINED ENV{DESTDIR})
+-      if(EXISTS /etc/debian_version)
+-        list(APPEND options --install-layout=deb)
+-      endif()
+-      list(APPEND options --root=\$ENV{DESTDIR})
+-      if(NOT \"${DU_INSTALL_SCRIPT}\" STREQUAL \"\")
+-        list(APPEND options --install-script=${DU_INSTALL_SCRIPT})
+-      endif()
+-    endif()
++    list(APPEND options --root=${CMAKE_DESTDIR})
++    list(APPEND options --install-lib=${PYTHON_SITEPACKAGES_DIR})
+     execute_process(
+     COMMAND ${PYTHON${PYTHON_VERSION}_EXECUTABLE}
+         setup.py install \${options}
+-- 
+2.7.4
+
diff --git a/recipes-extended/ceph/ceph_13.2.2.bb b/recipes-extended/ceph/ceph_13.2.2.bb
index 6c6da41..2d13df7 100644
--- a/recipes-extended/ceph/ceph_13.2.2.bb
+++ b/recipes-extended/ceph/ceph_13.2.2.bb
@@ -12,6 +12,7 @@ SRC_URI = "http://download.ceph.com/tarballs/ceph-${PV}.tar.gz \
            file://0001-Correct-the-path-to-find-version.h-in-rocksdb.patch \
            file://0001-zstd-fix-error-for-cross-compile.patch \
            file://0001-ceph-add-pybind-support-in-OE.patch \
+           file://0001-ceph-detect-init-correct-the-installation-for-OE.patch \
            file://ceph.conf \
 "
 SRC_URI[md5sum] = "ce118be451dcb6b89e9e0a45057827dd"
@@ -24,12 +25,25 @@ DEPENDS = "boost bzip2 curl expat gperf-native \
            python python-cython-native rocksdb snappy udev \
            valgrind xfsprogs zlib \
 "
-SYSTEMD_SERVICE_${PN} = "ceph-radosgw at .service \
+SYSTEMD_SERVICE_${PN} = " \
+	ceph-radosgw at .service \
+	ceph-radosgw.target \
         ceph-mon at .service \
+	ceph-mon.target \
         ceph-mds at .service \
+	ceph-mds.target \
         ceph-disk at .service \
         ceph-osd at .service \
+	ceph-osd.target \
         ceph.target \
+	ceph-fuse at .service \
+	ceph-fuse.target \
+	ceph-rbd-mirror at .service \
+	ceph-rbd-mirror.target \
+	ceph-volume at .service \
+	ceph-mgr at .service \
+	ceph-mgr.target \
+	rbdmap.service \
 "
 OECMAKE_GENERATOR = "Unix Makefiles"
 
@@ -54,15 +68,13 @@ do_configure_prepend () {
 
 do_install_append () {
 	sed -i -e 's:${WORKDIR}.*python2:${bindir}/python:' ${D}${bindir}/ceph
+	sed -i -e 's:${WORKDIR}.*python2:${bindir}/python:' ${D}${bindir}/ceph-disk
+	sed -i -e 's:${WORKDIR}.*python2:${bindir}/python:' ${D}${bindir}/ceph-detect-init
+	find ${D} -name SOURCES.txt | xargs sed -i -e 's:${WORKDIR}::'
 	install -d ${D}${sysconfdir}/ceph
 	install -m 644 ${WORKDIR}/ceph.conf ${D}${sysconfdir}/ceph/
-	install -d ${D}${systemd_unitdir}/system
-	mv ${D}${libexecdir}/systemd/system/ceph-radosgw at .service ${D}${systemd_unitdir}/system/ceph-radosgw at .service
-	mv ${D}${libexecdir}/systemd/system/ceph-mon at .service ${D}${systemd_unitdir}/system/ceph-mon at .service
-	mv ${D}${libexecdir}/systemd/system/ceph-mds at .service ${D}${systemd_unitdir}/system/ceph-mds at .service
-	mv ${D}${libexecdir}/systemd/system/ceph-disk at .service ${D}${systemd_unitdir}/system/ceph-disk at .service
-	mv ${D}${libexecdir}/systemd/system/ceph-osd at .service ${D}${systemd_unitdir}/system/ceph-osd at .service
-	mv ${D}${libexecdir}/systemd/system/ceph.target ${D}${systemd_unitdir}/system/ceph.target
+	install -d ${D}${systemd_unitdir}
+	mv ${D}${libexecdir}/systemd/system ${D}${systemd_unitdir}
 }
 
 FILES_${PN} += "\
-- 
2.7.4



More information about the meta-virtualization mailing list