diff options
Diffstat (limited to 'external/meta-virtualization/recipes-extended/ceph')
6 files changed, 404 insertions, 0 deletions
diff --git a/external/meta-virtualization/recipes-extended/ceph/ceph/0001-Correct-the-path-to-find-version.h-in-rocksdb.patch b/external/meta-virtualization/recipes-extended/ceph/ceph/0001-Correct-the-path-to-find-version.h-in-rocksdb.patch new file mode 100644 index 00000000..788505b2 --- /dev/null +++ b/external/meta-virtualization/recipes-extended/ceph/ceph/0001-Correct-the-path-to-find-version.h-in-rocksdb.patch @@ -0,0 +1,40 @@ +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 + diff --git a/external/meta-virtualization/recipes-extended/ceph/ceph/0001-ceph-add-pybind-support-in-OE.patch b/external/meta-virtualization/recipes-extended/ceph/ceph/0001-ceph-add-pybind-support-in-OE.patch new file mode 100644 index 00000000..f9c53406 --- /dev/null +++ b/external/meta-virtualization/recipes-extended/ceph/ceph/0001-ceph-add-pybind-support-in-OE.patch @@ -0,0 +1,129 @@ +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 + diff --git a/external/meta-virtualization/recipes-extended/ceph/ceph/0001-ceph-detect-init-correct-the-installation-for-OE.patch b/external/meta-virtualization/recipes-extended/ceph/ceph/0001-ceph-detect-init-correct-the-installation-for-OE.patch new file mode 100644 index 00000000..875501bf --- /dev/null +++ b/external/meta-virtualization/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@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 + diff --git a/external/meta-virtualization/recipes-extended/ceph/ceph/0001-zstd-fix-error-for-cross-compile.patch b/external/meta-virtualization/recipes-extended/ceph/ceph/0001-zstd-fix-error-for-cross-compile.patch new file mode 100644 index 00000000..66b5f0a5 --- /dev/null +++ b/external/meta-virtualization/recipes-extended/ceph/ceph/0001-zstd-fix-error-for-cross-compile.patch @@ -0,0 +1,26 @@ +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 + diff --git a/external/meta-virtualization/recipes-extended/ceph/ceph/ceph.conf b/external/meta-virtualization/recipes-extended/ceph/ceph/ceph.conf new file mode 100644 index 00000000..fd9de6ce --- /dev/null +++ b/external/meta-virtualization/recipes-extended/ceph/ceph/ceph.conf @@ -0,0 +1,70 @@ +[global] + # Unique ID for the cluster. Run uuidgen to get this string. + fsid = %CLUSTER_UUID% + # Initial monitor + mon initial members = node1 + # IP address of the initial monitor, i.e. 128.224.149.xx + mon host = %PUBLIC_IP% + # Public network where the monitor is connected to, i.e, 128.224.0.0/16 + public network = %PUBLIC_DOMAIN% + # For version 0.55 and beyond, you must explicitly enable + # or disable authentication with "auth" entries in [global]. + auth cluster required = cephx + auth service required = cephx + auth client required = cephx + osd journal size = 1024 + + # Uncomment the following line if you are mounting with ext4 + # filestore xattr use omap = true + + # Number of replicas of objects. Write an object 2 times. + # Cluster cannot reach an active + clean state until there's enough OSDs + # to handle the number of copies of an object. In this case, it requires + # at least 2 OSDs + osd pool default size = 2 + + # Allow writing one copy in a degraded state. + osd pool default min size = 1 + + # Ensure you have a realistic number of placement groups. We recommend + # approximately 100 per OSD. E.g., total number of OSDs multiplied by 100 + # divided by the number of replicas (i.e., osd pool default size). So for + # 10 OSDs and osd pool default size = 2, we'd recommend approximately + # (100 * 10) / 2 = 500. + osd pool default pg num = 500 + osd pool default pgp num = 500 + osd crush chooseleaf type = 1 + +[osd] + osd mkfs type = xfs + osd mkfs options xfs = "-f" + osd mount options xfs = "rw,noatime,inode64,logbufs=8,logbsize=256k" + +# All port numbers below are not hard-coded, but expected by ceph, so please +# do not change the numbers. +[mon.node1] + host = node1 + mon addr = %PUBLIC_IP%:6789 + +[osd.0] + host = node1 + public addr = %PUBLIC_IP%:6800 + cluster addr = %PRIVATE_IP%:6800 + devs = /dev/sda1 + +[osd.1] + host = node1 + public addr = %PUBLIC_IP%:6801 + cluster addr = %PRIVATE_IP%:6801 + devs = /dev/sda2 + +[osd.2] + host = node1 + public addr = %PUBLIC_IP%:6802 + cluster addr = %PRIVATE_IP%:6802 + devs = /dev/sda3 + +[mds.a] + host = node1 + devs = /dev/sda4 + diff --git a/external/meta-virtualization/recipes-extended/ceph/ceph_13.2.2.bb b/external/meta-virtualization/recipes-extended/ceph/ceph_13.2.2.bb new file mode 100644 index 00000000..08021cf7 --- /dev/null +++ b/external/meta-virtualization/recipes-extended/ceph/ceph_13.2.2.bb @@ -0,0 +1,103 @@ +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 \ +" +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://ceph.conf \ +" +SRC_URI[md5sum] = "ce118be451dcb6b89e9e0a45057827dd" +SRC_URI[sha256sum] = "f3a61db4c90e00c38a2dac7239b956ec367ef56f601e07335ed3011f931d8840" + +DEPENDS = "boost bzip2 curl expat gperf-native \ + keyutils libaio libibverbs lz4 \ + nspr nss \ + oath openldap openssl \ + python python-cython-native rocksdb snappy udev \ + valgrind xfsprogs zlib \ +" +SYSTEMD_SERVICE_${PN} = " \ + ceph-radosgw@.service \ + ceph-radosgw.target \ + ceph-mon@.service \ + ceph-mon.target \ + ceph-mds@.service \ + ceph-mds.target \ + ceph-disk@.service \ + ceph-osd@.service \ + ceph-osd.target \ + ceph.target \ + ceph-fuse@.service \ + ceph-fuse.target \ + ceph-rbd-mirror@.service \ + ceph-rbd-mirror.target \ + ceph-volume@.service \ + ceph-mgr@.service \ + ceph-mgr.target \ + rbdmap.service \ +" +OECMAKE_GENERATOR = "Unix Makefiles" + +EXTRA_OECMAKE = "-DWITH_MANPAGE=OFF \ + -DWITH_FUSE=OFF \ + -DWITH_SPDK=OFF \ + -DWITH_LEVELDB=OFF \ + -DWITH_LTTNG=OFF \ + -DWITH_BABELTRACE=OFF \ + -DWITH_TESTS=OFF \ + -DWITH_MGR=OFF \ + -DWITH_MGR_DASHBOARD_FRONTEND=OFF \ + -DWITH_SYSTEM_BOOST=ON \ + -DWITH_SYSTEM_ROCKSDB=ON \ +" + +do_configure_prepend () { + echo "set( CMAKE_SYSROOT \"${RECIPE_SYSROOT}\" )" >> ${WORKDIR}/toolchain.cmake + echo "set( CMAKE_DESTDIR \"${D}\" )" >> ${WORKDIR}/toolchain.cmake + echo "set( PYTHON_SITEPACKAGES_DIR \"${PYTHON_SITEPACKAGES_DIR}\" )" >> ${WORKDIR}/toolchain.cmake +} + +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} + mv ${D}${libexecdir}/systemd/system ${D}${systemd_unitdir} + mv ${D}${libexecdir}/ceph/ceph-osd-prestart.sh ${D}${libdir}/ceph + mv ${D}${libexecdir}/ceph/ceph_common.sh ${D}${libdir}/ceph +} + +FILES_${PN} += "\ + ${libdir}/rados-classes/*.so.* \ + ${libdir}/ceph/compressor/*.so \ + ${libdir}/rados-classes/*.so \ + ${libdir}/ceph/*.so \ +" +FILES_${PN}-python = "\ + ${PYTHON_SITEPACKAGES_DIR}/* \ +" +RDEPENDS_${PN} += "\ + python \ + python-misc \ + python-modules \ + python-prettytable \ + ${PN}-python \ +" +COMPATIBLE_HOST = "(x86_64).*" +PACKAGES += " \ + ${PN}-python \ +" +INSANE_SKIP_${PN}-python += "ldflags" +INSANE_SKIP_${PN} += "dev-so" |