ceph: upgrade to 14.1.0

1. set the cross compile sysroot to find the rocksdb library
2. correct the install path for library in Distutils.cmake

Signed-off-by: Dengke Du <dengke.du@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
This commit is contained in:
Dengke Du 2019-03-13 18:06:41 +08:00 committed by Bruce Ashfield
parent 2a44defc69
commit ed9045b143
6 changed files with 199 additions and 242 deletions

View File

@ -1,40 +0,0 @@
From a53605694d5301b7bb543464b17f74bbbd35d372 Mon Sep 17 00:00:00 2001
From: Dengke Du <dengke.du@windriver.com>
Date: Tue, 28 Aug 2018 10:04:40 +0800
Subject: [PATCH] Correct the path to find version.h in rocksdb
Signed-off-by: Dengke Du <dengke.du@windriver.com>
---
cmake/modules/Findrocksdb.cmake | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/cmake/modules/Findrocksdb.cmake b/cmake/modules/Findrocksdb.cmake
index f8369f7..36b67ea 100644
--- a/cmake/modules/Findrocksdb.cmake
+++ b/cmake/modules/Findrocksdb.cmake
@@ -9,17 +9,17 @@
# ROCKSDB_VERSION_MINOR
# ROCKSDB_VERSION_PATCH
-find_path(ROCKSDB_INCLUDE_DIR rocksdb/db.h)
+find_path(ROCKSDB_INCLUDE_DIR rocksdb/db.h ${CMAKE_SYSROOT})
-find_library(ROCKSDB_LIBRARIES rocksdb)
+find_library(ROCKSDB_LIBRARIES rocksdb ${CMAKE_SYSROOT})
if(ROCKSDB_INCLUDE_DIR AND EXISTS "${ROCKSDB_INCLUDE_DIR}/rocksdb/version.h")
foreach(ver "MAJOR" "MINOR" "PATCH")
- file(STRINGS "${ROCKSDB_INCLUDE_DIR}/version.h" ROCKSDB_VER_${ver}_LINE
+ file(STRINGS "${ROCKSDB_INCLUDE_DIR}/rocksdb/version.h" ROCKSDB_VER_${ver}_LINE
REGEX "^#define[ \t]+ROCKSDB_${ver}[ \t]+[0-9]+$")
string(REGEX REPLACE "^#define[ \t]+ROCKSDB_${ver}[ \t]+([0-9]+)$"
- "\\1" ROCKSDB_VERSION_${ver} "${ROCKDB_VER_${ver}_LINE}")
- unset(${ROCKDB_VER_${ver}_LINE})
+ "\\1" ROCKSDB_VERSION_${ver} "${ROCKSDB_VER_${ver}_LINE}")
+ unset(ROCKSDB_VER_${ver}_LINE)
endforeach()
set(ROCKSDB_VERSION_STRING
"${ROCKSDB_VERSION_MAJOR}.${ROCKSDB_VERSION_MINOR}.${ROCKSDB_VERSION_PATCH}")
--
2.7.4

View File

@ -1,129 +0,0 @@
From 00d44940c2e83bf73101a05d2aa8f88c2e2fca58 Mon Sep 17 00:00:00 2001
From: Dengke Du <dengke.du@windriver.com>
Date: Tue, 23 Oct 2018 15:34:53 +0800
Subject: [PATCH] ceph: add pybind support in OE
1. add sysroot to CFLAGS when cross compiling pybind
2. change the pybind's INSTALL path to OE's INSTALL path
3. delete the check for header files, because the check method using
host compiler.
Signed-off-by: Dengke Du <dengke.du@windriver.com>
Upstream-Status: Inappropriate [oe specific]
---
cmake/modules/Distutils.cmake | 12 +++---------
src/pybind/cephfs/setup.py | 8 --------
src/pybind/rados/setup.py | 8 --------
src/pybind/rbd/setup.py | 8 --------
src/pybind/rgw/setup.py | 8 --------
5 files changed, 3 insertions(+), 41 deletions(-)
diff --git a/cmake/modules/Distutils.cmake b/cmake/modules/Distutils.cmake
index d6e9f38..3091d97 100644
--- a/cmake/modules/Distutils.cmake
+++ b/cmake/modules/Distutils.cmake
@@ -47,7 +47,7 @@ function(distutils_add_cython_module name src)
LDFLAGS=-L${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
CYTHON_BUILD_DIR=${CMAKE_CURRENT_BINARY_DIR}
CEPH_LIBDIR=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
- CFLAGS=\"-iquote${CMAKE_SOURCE_DIR}/src/include -w\"
+ CFLAGS=\"-iquote${CMAKE_SOURCE_DIR}/src/include -w --sysroot=${CMAKE_SYSROOT}\"
${PYTHON${PYTHON_VERSION}_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/setup.py
build --verbose --build-base ${CYTHON_MODULE_DIR}
--build-platlib ${CYTHON_MODULE_DIR}/lib.${PYTHON${PYTHON_VERSION}_VERSION_MAJOR}
@@ -69,14 +69,8 @@ function(distutils_install_cython_module name)
set(ENV{CEPH_LIBDIR} \"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}\")
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})
- else()
- list(APPEND options --root=/)
- endif()
+ list(APPEND options --root=${CMAKE_DESTDIR})
+ list(APPEND options --install-lib=${PYTHON_SITEPACKAGES_DIR})
execute_process(
COMMAND
${PYTHON${PYTHON_VERSION}_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/setup.py
diff --git a/src/pybind/cephfs/setup.py b/src/pybind/cephfs/setup.py
index 6533f41..1ee4a59 100755
--- a/src/pybind/cephfs/setup.py
+++ b/src/pybind/cephfs/setup.py
@@ -121,14 +121,6 @@ def check_sanity():
finally:
shutil.rmtree(tmp_dir)
-
-if 'BUILD_DOC' in os.environ.keys():
- pass
-elif check_sanity():
- pass
-else:
- sys.exit(1)
-
cmdclass = {}
try:
from Cython.Build import cythonize
diff --git a/src/pybind/rados/setup.py b/src/pybind/rados/setup.py
index ef7c307..5204017 100755
--- a/src/pybind/rados/setup.py
+++ b/src/pybind/rados/setup.py
@@ -117,14 +117,6 @@ def check_sanity():
finally:
shutil.rmtree(tmp_dir)
-
-if 'BUILD_DOC' in os.environ.keys():
- pass
-elif check_sanity():
- pass
-else:
- sys.exit(1)
-
cmdclass = {}
try:
from Cython.Build import cythonize
diff --git a/src/pybind/rbd/setup.py b/src/pybind/rbd/setup.py
index bcf96f2..d4cbbeb 100755
--- a/src/pybind/rbd/setup.py
+++ b/src/pybind/rbd/setup.py
@@ -120,14 +120,6 @@ def check_sanity():
finally:
shutil.rmtree(tmp_dir)
-
-if 'BUILD_DOC' in os.environ.keys():
- pass
-elif check_sanity():
- pass
-else:
- sys.exit(1)
-
cmdclass = {}
try:
from Cython.Build import cythonize
diff --git a/src/pybind/rgw/setup.py b/src/pybind/rgw/setup.py
index f14f30c..ee7570b 100755
--- a/src/pybind/rgw/setup.py
+++ b/src/pybind/rgw/setup.py
@@ -120,14 +120,6 @@ def check_sanity():
finally:
shutil.rmtree(tmp_dir)
-
-if 'BUILD_DOC' in os.environ.keys():
- pass
-elif check_sanity():
- pass
-else:
- sys.exit(1)
-
cmdclass = {}
try:
from Cython.Build import cythonize
--
2.7.4

View File

@ -1,36 +0,0 @@
From 6aaf04036f0affbeddda123bff111990c4d5fd72 Mon Sep 17 00:00:00 2001
From: Dengke Du <dengke.du@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@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

View File

@ -0,0 +1,188 @@
From 20dd3fb9e5daa780e15113a2c88f846c8f5dd904 Mon Sep 17 00:00:00 2001
From: Dengke Du <dengke.du@windriver.com>
Date: Mon, 11 Mar 2019 09:14:09 +0800
Subject: [PATCH] ceph: fix build errors for cross compile
1. set the cross compile sysroot to find the rocksdb library
2. correct the install path for library in Distutils.cmake
Upstream-Status: Inappropriate [oe specific]
Signed-off-by: Dengke Du <dengke.du@windriver.com>
---
cmake/modules/Distutils.cmake | 25 +++++--------------------
cmake/modules/FindRocksDB.cmake | 6 +++---
src/compressor/zstd/CMakeLists.txt | 2 +-
src/pybind/cephfs/setup.py | 8 --------
src/pybind/rados/setup.py | 8 --------
src/pybind/rbd/setup.py | 8 --------
src/pybind/rgw/setup.py | 8 --------
7 files changed, 9 insertions(+), 56 deletions(-)
diff --git a/cmake/modules/Distutils.cmake b/cmake/modules/Distutils.cmake
index 5697dff..de3cd57 100644
--- a/cmake/modules/Distutils.cmake
+++ b/cmake/modules/Distutils.cmake
@@ -16,17 +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}
- --single-version-externally-managed)
- 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}
@@ -48,7 +39,7 @@ function(distutils_add_cython_module name src)
# Note: no quotes, otherwise distutils will execute "/usr/bin/ccache gcc"
# CMake's implicit conversion between strings and lists is wonderful, isn't it?
string(REPLACE " " ";" cflags ${CMAKE_C_FLAGS})
- list(APPEND cflags -iquote${CMAKE_SOURCE_DIR}/src/include -w)
+ list(APPEND cflags -iquote${CMAKE_SOURCE_DIR}/src/include -w --sysroot=${CMAKE_SYSROOT})
# This little bit of magic wipes out __Pyx_check_single_interpreter()
list(APPEND cflags -D'void0=dead_function\(void\)')
list(APPEND cflags -D'__Pyx_check_single_interpreter\(ARG\)=ARG \#\# 0')
@@ -86,14 +77,8 @@ function(distutils_install_cython_module name)
set(ENV{CEPH_LIBDIR} \"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}\")
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})
- else()
- list(APPEND options --root=/)
- endif()
+ list(APPEND options --root=${CMAKE_DESTDIR})
+ list(APPEND options --install-lib=${PYTHON_SITEPACKAGES_DIR})
execute_process(
COMMAND
${PYTHON${PYTHON_VERSION}_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/setup.py
diff --git a/cmake/modules/FindRocksDB.cmake b/cmake/modules/FindRocksDB.cmake
index 9818433..be38597 100644
--- a/cmake/modules/FindRocksDB.cmake
+++ b/cmake/modules/FindRocksDB.cmake
@@ -9,9 +9,9 @@
# ROCKSDB_VERSION_MINOR
# ROCKSDB_VERSION_PATCH
-find_path(ROCKSDB_INCLUDE_DIR rocksdb/db.h)
+find_path(ROCKSDB_INCLUDE_DIR rocksdb/db.h ${CMAKE_SYSROOT})
-find_library(ROCKSDB_LIBRARIES rocksdb)
+find_library(ROCKSDB_LIBRARIES rocksdb ${CMAKE_SYSROOT})
if(ROCKSDB_INCLUDE_DIR AND EXISTS "${ROCKSDB_INCLUDE_DIR}/rocksdb/version.h")
foreach(ver "MAJOR" "MINOR" "PATCH")
@@ -40,7 +40,7 @@ if(RocksDB_FOUND)
set_target_properties(RocksDB::RocksDB PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${ROCKSDB_INCLUDE_DIR}"
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
- IMPORTED_LOCATION "${ROCKSDB_LIBRARY}"
+ IMPORTED_LOCATION "${ROCKSDB_LIBRARIES}"
VERSION "${ROCKSDB_VERSION_STRING}")
endif()
endif()
diff --git a/src/compressor/zstd/CMakeLists.txt b/src/compressor/zstd/CMakeLists.txt
index 76709bb..95bba4a 100644
--- a/src/compressor/zstd/CMakeLists.txt
+++ b/src/compressor/zstd/CMakeLists.txt
@@ -9,7 +9,7 @@ ExternalProject_Add(zstd_ext
CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_C_FLAGS=${ZSTD_C_FLAGS}
- -DCMAKE_AR=${CMAKE_AR}
+ -DCMAKE_SYSROOT=${CMAKE_SYSROOT}
-DCMAKE_POSITION_INDEPENDENT_CODE=${ENABLE_SHARED}
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/libzstd
BUILD_COMMAND $(MAKE) libzstd_static
diff --git a/src/pybind/cephfs/setup.py b/src/pybind/cephfs/setup.py
index 1f95005..8a6d136 100755
--- a/src/pybind/cephfs/setup.py
+++ b/src/pybind/cephfs/setup.py
@@ -142,14 +142,6 @@ def check_sanity():
finally:
shutil.rmtree(tmp_dir)
-
-if 'BUILD_DOC' in os.environ.keys():
- pass
-elif check_sanity():
- pass
-else:
- sys.exit(1)
-
cmdclass = {}
try:
from Cython.Build import cythonize
diff --git a/src/pybind/rados/setup.py b/src/pybind/rados/setup.py
index 75081df..4d1591c 100755
--- a/src/pybind/rados/setup.py
+++ b/src/pybind/rados/setup.py
@@ -138,14 +138,6 @@ def check_sanity():
finally:
shutil.rmtree(tmp_dir)
-
-if 'BUILD_DOC' in os.environ.keys():
- pass
-elif check_sanity():
- pass
-else:
- sys.exit(1)
-
cmdclass = {}
try:
from Cython.Build import cythonize
diff --git a/src/pybind/rbd/setup.py b/src/pybind/rbd/setup.py
index 8dd5c12..b8f4d91 100755
--- a/src/pybind/rbd/setup.py
+++ b/src/pybind/rbd/setup.py
@@ -141,14 +141,6 @@ def check_sanity():
finally:
shutil.rmtree(tmp_dir)
-
-if 'BUILD_DOC' in os.environ.keys():
- pass
-elif check_sanity():
- pass
-else:
- sys.exit(1)
-
cmdclass = {}
try:
from Cython.Build import cythonize
diff --git a/src/pybind/rgw/setup.py b/src/pybind/rgw/setup.py
index 4ee4f49..91dc7d4 100755
--- a/src/pybind/rgw/setup.py
+++ b/src/pybind/rgw/setup.py
@@ -143,14 +143,6 @@ def check_sanity():
finally:
shutil.rmtree(tmp_dir)
-
-if 'BUILD_DOC' in os.environ.keys():
- pass
-elif check_sanity():
- pass
-else:
- sys.exit(1)
-
cmdclass = {}
try:
from Cython.Build import cythonize
--
2.7.4

View File

@ -1,26 +0,0 @@
From 3e86b6d9db2682b123839e38e9bf45060e2bb2ab Mon Sep 17 00:00:00 2001
From: Dengke Du <dengke.du@windriver.com>
Date: Wed, 29 Aug 2018 16:57:52 +0800
Subject: [PATCH] zstd: fix error for cross compile
Signed-off-by: Dengke Du <dengke.du@windriver.com>
---
src/compressor/zstd/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/compressor/zstd/CMakeLists.txt b/src/compressor/zstd/CMakeLists.txt
index e30cb89..b298a3d 100644
--- a/src/compressor/zstd/CMakeLists.txt
+++ b/src/compressor/zstd/CMakeLists.txt
@@ -9,7 +9,7 @@ ExternalProject_Add(zstd_ext
CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_C_FLAGS=${ZSTD_C_FLAGS}
- -DCMAKE_AR=${CMAKE_AR}
+ -DCMAKE_SYSROOT=${CMAKE_SYSROOT}
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/libzstd
BUILD_COMMAND $(MAKE) libzstd_static
INSTALL_COMMAND "true")
--
2.7.4

View File

@ -2,27 +2,24 @@ SUMMARY = "User space components of the Ceph file system"
LICENSE = "LGPLv2.1 & GPLv2 & Apache-2.0 & MIT"
LIC_FILES_CHKSUM = "file://COPYING-LGPL2.1;md5=fbc093901857fcd118f065f900982c24 \
file://COPYING-GPL2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
file://COPYING;md5=92d301c8fccd296f2221a68a8dd53828 \
file://COPYING;md5=601c21a554d728c3038ca292b83b8af0 \
"
inherit cmake pythonnative python-dir systemd
# Disable python pybind support for ceph temporary, when corss compiling pybind,
# pybind mix cmake and python setup environment, would case a lot of errors.
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://0001-ceph-fix-build-errors-for-cross-compile.patch \
file://ceph.conf \
"
SRC_URI[md5sum] = "ce118be451dcb6b89e9e0a45057827dd"
SRC_URI[sha256sum] = "f3a61db4c90e00c38a2dac7239b956ec367ef56f601e07335ed3011f931d8840"
SRC_URI[md5sum] = "67b53eeb0f241c3011e7f40925aa7e08"
SRC_URI[sha256sum] = "9ef726d7e73ce4d9510ad899493258374f1b40ba20a26b72bbbedb0bfb6dffd8"
DEPENDS = "boost bzip2 curl expat gperf-native \
keyutils libaio libibverbs lz4 \
nspr nss \
oath openldap openssl \
python python-cython-native rocksdb snappy udev \
python python-cython-native rabbitmq-c rocksdb snappy udev \
valgrind xfsprogs zlib \
"
SYSTEMD_SERVICE_${PN} = " \
@ -32,7 +29,6 @@ SYSTEMD_SERVICE_${PN} = " \
ceph-mon.target \
ceph-mds@.service \
ceph-mds.target \
ceph-disk@.service \
ceph-osd@.service \
ceph-osd.target \
ceph.target \
@ -43,6 +39,7 @@ SYSTEMD_SERVICE_${PN} = " \
ceph-volume@.service \
ceph-mgr@.service \
ceph-mgr.target \
ceph-crash.service \
rbdmap.service \
"
OECMAKE_GENERATOR = "Unix Makefiles"
@ -58,6 +55,8 @@ EXTRA_OECMAKE = "-DWITH_MANPAGE=OFF \
-DWITH_MGR_DASHBOARD_FRONTEND=OFF \
-DWITH_SYSTEM_BOOST=ON \
-DWITH_SYSTEM_ROCKSDB=ON \
-DWITH_RDMA=OFF \
-DWITH_RADOSGW_AMQP_ENDPOINT=OFF \
"
do_configure_prepend () {
@ -68,8 +67,9 @@ 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
sed -i -e 's:${WORKDIR}.*python2:${bindir}/python:' ${D}${bindir}/ceph-crash
sed -i -e 's:${WORKDIR}.*python2:${bindir}/python:' ${D}${bindir}/ceph-volume
sed -i -e 's:${WORKDIR}.*python2:${bindir}/python:' ${D}${bindir}/ceph-volume-systemd
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/