summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2024-03-14 01:08:58 -0700
committerBruce Ashfield <bruce.ashfield@gmail.com>2024-03-15 17:17:20 +0000
commit21b439042b2e3d715e21f6777127f2ee6f58ea95 (patch)
tree42762b071ef0e02c0cba635df4a729c9d72dcb3d
parent3e1ee1fda758885c17be7d4d45f514d370b1b92b (diff)
downloadmeta-virtualization-21b439042b2e3d715e21f6777127f2ee6f58ea95.tar.gz
ceph: fix do_compile/do_install failures
1. OECMAKE_C/CXX_COMPILER needs to have sysroot setting in it, because ceph's cmake files are using it to construct PY_CC. Without it, files such as stdlib.h cannot be found. 2. re2 is added to deps. Seems no way to disable it. 3. 0001-ceph-fix-build-errors-for-cross-compile.patch is dropped. It's useless and problematic for new version. 4. 0001-cmake-add-support-for-python3.11.patch is dropped as it's not needed anymore. 5. 0001-avoid-to_string-error.patch is added to fix build error, maybe caused by boost version incompatibility. 6. Some cleanups. 7. A few more options are set. 8. BUILD_DOC=1 is exported so that check_sanity() causes compilation error. This is a workaround and may need further visit in the future. 9. Delete the conditional check for /etc/debian_version which adds '--install-layout deb' and causes the following error. error: option --install-layout not recognized The patch is 0001-delete-install-layout-deb.patch. 10. ceph-volume[-systemd] are now in sbin. 11. cephfs-mirror units are added to avoid package QA issue. 12. cephfs-top is seded to fix incorrect shebang. 13. Ensure libcephsqlite.so is packaged into ceph instead of ceph-dev. 14. Add bash to RDEPENDS as rbdmap needs it. 15. Skip buildpaths QA. 16. Add ceph user/group, because ceph-crash needs it in drop_privilege function call. 17. Patch the build.py which creates the cephadm zipapp to ensure it uses the correct interpreter. We cannot simply use 'sed' against the cephadm as it's zip format. Runtime tests: cephfs-top --help cephadm --help systemctl status rbdmap systemctl --failed Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
-rw-r--r--recipes-extended/ceph/ceph/0001-avoid-to_string-error.patch73
-rw-r--r--recipes-extended/ceph/ceph/0001-ceph-fix-build-errors-for-cross-compile.patch189
-rw-r--r--recipes-extended/ceph/ceph/0001-cephadm-build.py-avoid-using-python3-from-sysroot-wh.patch43
-rw-r--r--recipes-extended/ceph/ceph/0001-cmake-add-support-for-python3.11.patch31
-rw-r--r--recipes-extended/ceph/ceph/0001-delete-install-layout-deb.patch37
-rw-r--r--recipes-extended/ceph/ceph_18.2.0.bb79
6 files changed, 195 insertions, 257 deletions
diff --git a/recipes-extended/ceph/ceph/0001-avoid-to_string-error.patch b/recipes-extended/ceph/ceph/0001-avoid-to_string-error.patch
new file mode 100644
index 00000000..0b4fc984
--- /dev/null
+++ b/recipes-extended/ceph/ceph/0001-avoid-to_string-error.patch
@@ -0,0 +1,73 @@
1From f807220d13adc0656c30d3207d11c70360b88d06 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Wed, 13 Mar 2024 03:14:55 -0700
4Subject: [PATCH] avoid to_string error
5
6Upstream-Status: Pending
7
8Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
9---
10 src/rgw/rgw_asio_client.cc | 15 ++++++++-------
11 1 file changed, 8 insertions(+), 7 deletions(-)
12
13diff --git a/src/rgw/rgw_asio_client.cc b/src/rgw/rgw_asio_client.cc
14index a0ec0bf5c..17880eda5 100644
15--- a/src/rgw/rgw_asio_client.cc
16+++ b/src/rgw/rgw_asio_client.cc
17@@ -3,6 +3,7 @@
18
19 #include <boost/algorithm/string/predicate.hpp>
20 #include <boost/asio/write.hpp>
21+#include <string_view>
22
23 #include "rgw_asio_client.h"
24 #include "rgw_perf_counters.h"
25@@ -39,11 +40,11 @@ int ClientIO::init_env(CephContext *cct)
26 const auto& value = header->value();
27
28 if (field == beast::http::field::content_length) {
29- env.set("CONTENT_LENGTH", value.to_string());
30+ env.set("CONTENT_LENGTH", std::string(value));
31 continue;
32 }
33 if (field == beast::http::field::content_type) {
34- env.set("CONTENT_TYPE", value.to_string());
35+ env.set("CONTENT_TYPE", std::string(value));
36 continue;
37 }
38
39@@ -62,26 +63,26 @@ int ClientIO::init_env(CephContext *cct)
40 }
41 *dest = '\0';
42
43- env.set(buf, value.to_string());
44+ env.set(buf, std::string(value));
45 }
46
47 int major = request.version() / 10;
48 int minor = request.version() % 10;
49 env.set("HTTP_VERSION", std::to_string(major) + '.' + std::to_string(minor));
50
51- env.set("REQUEST_METHOD", request.method_string().to_string());
52+ env.set("REQUEST_METHOD", std::string(request.method_string()));
53
54 // split uri from query
55 auto uri = request.target();
56 auto pos = uri.find('?');
57 if (pos != uri.npos) {
58 auto query = uri.substr(pos + 1);
59- env.set("QUERY_STRING", query.to_string());
60+ env.set("QUERY_STRING", std::string(query));
61 uri = uri.substr(0, pos);
62 }
63- env.set("SCRIPT_URI", uri.to_string());
64+ env.set("SCRIPT_URI", std::string(uri));
65
66- env.set("REQUEST_URI", request.target().to_string());
67+ env.set("REQUEST_URI", std::string(request.target()));
68
69 char port_buf[16];
70 snprintf(port_buf, sizeof(port_buf), "%d", local_endpoint.port());
71--
722.42.0
73
diff --git a/recipes-extended/ceph/ceph/0001-ceph-fix-build-errors-for-cross-compile.patch b/recipes-extended/ceph/ceph/0001-ceph-fix-build-errors-for-cross-compile.patch
deleted file mode 100644
index 9686becb..00000000
--- a/recipes-extended/ceph/ceph/0001-ceph-fix-build-errors-for-cross-compile.patch
+++ /dev/null
@@ -1,189 +0,0 @@
1From 4712fe18405ffea31405308357a8e7fca358bcce Mon Sep 17 00:00:00 2001
2From: Dengke Du <dengke.du@windriver.com>
3Date: Mon, 11 Mar 2019 09:14:09 +0800
4Subject: [PATCH] ceph: fix build errors for cross compile
5
61. set the cross compile sysroot to find the rocksdb library
72. correct the install path for library in Distutils.cmake
8
9Upstream-Status: Inappropriate [oe specific]
10
11Signed-off-by: Dengke Du <dengke.du@windriver.com>
12
13Adjust context for v14.2.3
14
15Signed-off-by: He Zhe <zhe.he@windriver.com>
16Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
17---
18 cmake/modules/Distutils.cmake | 25 +++++--------------------
19 cmake/modules/FindRocksDB.cmake | 4 ++--
20 src/compressor/zstd/CMakeLists.txt | 2 +-
21 src/pybind/cephfs/setup.py | 8 --------
22 src/pybind/rados/setup.py | 8 --------
23 src/pybind/rbd/setup.py | 8 --------
24 src/pybind/rgw/setup.py | 8 --------
25 7 files changed, 8 insertions(+), 55 deletions(-)
26
27Index: ceph-18.2.0/cmake/modules/Distutils.cmake
28===================================================================
29--- ceph-18.2.0.orig/cmake/modules/Distutils.cmake
30+++ ceph-18.2.0/cmake/modules/Distutils.cmake
31@@ -29,17 +29,10 @@
32 cmake_parse_arguments(DU "" "INSTALL_SCRIPT" "" ${ARGN})
33 install(CODE "
34 set(options --prefix=${CMAKE_INSTALL_PREFIX})
35- if(DEFINED ENV{DESTDIR})
36- if(EXISTS /etc/debian_version)
37- list(APPEND options --install-layout=deb)
38- endif()
39- list(APPEND options
40- --root=\$ENV{DESTDIR}
41- --single-version-externally-managed)
42- endif()
43 if(NOT \"${DU_INSTALL_SCRIPT}\" STREQUAL \"\")
44 list(APPEND options --install-script=${DU_INSTALL_SCRIPT})
45- endif()
46+ list(APPEND options --root=${CMAKE_DESTDIR})
47+ list(APPEND options --install-lib=${PYTHON_SITEPACKAGES_DIR})
48 execute_process(
49 COMMAND ${Python3_EXECUTABLE}
50 setup.py install \${options}
51@@ -65,7 +58,7 @@
52 if(DU_DISABLE_VTA AND HAS_VTA)
53 list(APPEND PY_CFLAGS -fno-var-tracking-assignments)
54 endif()
55- list(APPEND PY_CPPFLAGS -iquote${CMAKE_SOURCE_DIR}/src/include -w)
56+ list(APPEND PY_CPPFLAGS -iquote${CMAKE_SOURCE_DIR}/src/include -w --sysroot=${CMAKE_SYSROOT})
57 # This little bit of magic wipes out __Pyx_check_single_interpreter()
58 # Note: this is reproduced in distutils_install_cython_module
59 list(APPEND PY_CPPFLAGS -D'void0=dead_function\(void\)')
60@@ -135,14 +128,8 @@
61 set(ENV{CEPH_LIBDIR} \"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}\")
62
63 set(options --prefix=${CMAKE_INSTALL_PREFIX})
64- if(DEFINED ENV{DESTDIR})
65- if(EXISTS /etc/debian_version)
66- list(APPEND options --install-layout=deb)
67- endif()
68- list(APPEND options --root=\$ENV{DESTDIR})
69- else()
70- list(APPEND options --root=/)
71- endif()
72+ list(APPEND options --root=${CMAKE_DESTDIR})
73+ list(APPEND options --install-lib=${PYTHON_SITEPACKAGES_DIR})
74 execute_process(
75 COMMAND
76 ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/setup.py
77Index: ceph-18.2.0/cmake/modules/FindRocksDB.cmake
78===================================================================
79--- ceph-18.2.0.orig/cmake/modules/FindRocksDB.cmake
80+++ ceph-18.2.0/cmake/modules/FindRocksDB.cmake
81@@ -9,9 +9,9 @@
82 # ROCKSDB_VERSION_MINOR
83 # ROCKSDB_VERSION_PATCH
84
85-find_path(ROCKSDB_INCLUDE_DIR rocksdb/db.h)
86+find_path(ROCKSDB_INCLUDE_DIR rocksdb/db.h ${CMAKE_SYSROOT})
87
88-find_library(ROCKSDB_LIBRARIES rocksdb)
89+find_library(ROCKSDB_LIBRARIES rocksdb ${CMAKE_SYSROOT})
90
91 if(ROCKSDB_INCLUDE_DIR AND EXISTS "${ROCKSDB_INCLUDE_DIR}/rocksdb/version.h")
92 foreach(ver "MAJOR" "MINOR" "PATCH")
93Index: ceph-18.2.0/src/pybind/cephfs/setup.py
94===================================================================
95--- ceph-18.2.0.orig/src/pybind/cephfs/setup.py
96+++ ceph-18.2.0/src/pybind/cephfs/setup.py
97@@ -135,20 +135,6 @@
98 finally:
99 shutil.rmtree(tmp_dir)
100
101-
102-if 'BUILD_DOC' in os.environ or 'READTHEDOCS' in os.environ:
103- ext_args = {}
104- cython_constants = dict(BUILD_DOC=True)
105- cythonize_args = dict(compile_time_env=cython_constants)
106-elif check_sanity():
107- ext_args = get_python_flags(['cephfs'])
108- cython_constants = dict(BUILD_DOC=False)
109- include_path = [os.path.join(os.path.dirname(__file__), "..", "rados")]
110- cythonize_args = dict(compile_time_env=cython_constants,
111- include_path=include_path)
112-else:
113- sys.exit(1)
114-
115 cmdclass = {}
116 try:
117 from Cython.Build import cythonize
118Index: ceph-18.2.0/src/pybind/rados/setup.py
119===================================================================
120--- ceph-18.2.0.orig/src/pybind/rados/setup.py
121+++ ceph-18.2.0/src/pybind/rados/setup.py
122@@ -130,17 +130,6 @@
123 finally:
124 shutil.rmtree(tmp_dir)
125
126-
127-if 'BUILD_DOC' in os.environ or 'READTHEDOCS' in os.environ:
128- ext_args = {}
129- cython_constants = dict(BUILD_DOC=True)
130-elif check_sanity():
131- ext_args = get_python_flags(['rados'])
132- cython_constants = dict(BUILD_DOC=False)
133-else:
134- sys.exit(1)
135-
136-cmdclass = {}
137 try:
138 from Cython.Build import cythonize
139 from Cython.Distutils import build_ext
140Index: ceph-18.2.0/src/pybind/rbd/setup.py
141===================================================================
142--- ceph-18.2.0.orig/src/pybind/rbd/setup.py
143+++ ceph-18.2.0/src/pybind/rbd/setup.py
144@@ -133,20 +133,6 @@
145 finally:
146 shutil.rmtree(tmp_dir)
147
148-
149-if 'BUILD_DOC' in os.environ or 'READTHEDOCS' in os.environ:
150- ext_args = {}
151- cython_constants = dict(BUILD_DOC=True)
152- cythonize_args = dict(compile_time_env=cython_constants)
153-elif check_sanity():
154- ext_args = get_python_flags(['rados', 'rbd'])
155- cython_constants = dict(BUILD_DOC=False)
156- include_path = [os.path.join(os.path.dirname(__file__), "..", "rados")]
157- cythonize_args = dict(compile_time_env=cython_constants,
158- include_path=include_path)
159-else:
160- sys.exit(1)
161-
162 cmdclass = {}
163 try:
164 from Cython.Build import cythonize
165Index: ceph-18.2.0/src/pybind/rgw/setup.py
166===================================================================
167--- ceph-18.2.0.orig/src/pybind/rgw/setup.py
168+++ ceph-18.2.0/src/pybind/rgw/setup.py
169@@ -134,20 +134,6 @@
170 finally:
171 shutil.rmtree(tmp_dir)
172
173-
174-if 'BUILD_DOC' in os.environ or 'READTHEDOCS' in os.environ:
175- ext_args = {}
176- cython_constants = dict(BUILD_DOC=True)
177- cythonize_args = dict(compile_time_env=cython_constants)
178-elif check_sanity():
179- ext_args = get_python_flags(['rados', 'rgw'])
180- cython_constants = dict(BUILD_DOC=False)
181- include_path = [os.path.join(os.path.dirname(__file__), "..", "rados")]
182- cythonize_args = dict(compile_time_env=cython_constants,
183- include_path=include_path)
184-else:
185- sys.exit(1)
186-
187 cmdclass = {}
188 try:
189 from Cython.Build import cythonize
diff --git a/recipes-extended/ceph/ceph/0001-cephadm-build.py-avoid-using-python3-from-sysroot-wh.patch b/recipes-extended/ceph/ceph/0001-cephadm-build.py-avoid-using-python3-from-sysroot-wh.patch
new file mode 100644
index 00000000..a353a2f7
--- /dev/null
+++ b/recipes-extended/ceph/ceph/0001-cephadm-build.py-avoid-using-python3-from-sysroot-wh.patch
@@ -0,0 +1,43 @@
1From b9867e6b744b77d97d22333eca3ab3d23d47e2e2 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Thu, 14 Mar 2024 00:19:19 -0700
4Subject: [PATCH] cephadm/build.py: avoid using python3 from sysroot when
5 creating zipapp archive
6
7ceph has the assumption that the python used during build
8is the python used at target, but this is not true for
9cross compilation. We'll need to use the target python3 here,
10otherwise, the cephadm zipapp cannot be executed.
11
12Upstream-Status: Pending
13
14Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
15---
16 src/cephadm/build.py | 4 ++--
17 1 file changed, 2 insertions(+), 2 deletions(-)
18
19diff --git a/src/cephadm/build.py b/src/cephadm/build.py
20index 4264b814f1e..a4483d6f79d 100755
21--- a/src/cephadm/build.py
22+++ b/src/cephadm/build.py
23@@ -93,7 +93,7 @@ def _compile(dest, tempdir):
24 zipapp.create_archive(
25 source=tempdir,
26 target=dest,
27- interpreter=sys.executable,
28+ interpreter='/usr/bin/python3',
29 compressed=True,
30 )
31 log.info("Zipapp created with compression")
32@@ -102,7 +102,7 @@ def _compile(dest, tempdir):
33 zipapp.create_archive(
34 source=tempdir,
35 target=dest,
36- interpreter=sys.executable,
37+ interpreter='/usr/bin/python3',
38 )
39 log.info("Zipapp created without compression")
40
41--
422.42.0
43
diff --git a/recipes-extended/ceph/ceph/0001-cmake-add-support-for-python3.11.patch b/recipes-extended/ceph/ceph/0001-cmake-add-support-for-python3.11.patch
deleted file mode 100644
index c72c91b2..00000000
--- a/recipes-extended/ceph/ceph/0001-cmake-add-support-for-python3.11.patch
+++ /dev/null
@@ -1,31 +0,0 @@
1From 1060f2e4362ebd6db23870d442dcd158d219ee92 Mon Sep 17 00:00:00 2001
2From: Yanfei Xu <yanfei.xu@windriver.com>
3Date: Tue, 10 Nov 2020 17:17:30 +0800
4Subject: [PATCH] cmake: add support for python 3.9 and 3.10
5
6add support for python3.9.
7
8Signed-off-by: Yanfei Xu <yanfei.xu@windriver.com>
9
10Add support for python 3.10.
11
12Upstream-Status: Submitted [https://github.com/ceph/ceph/pull/43630]
13
14Signed-off-by: Kai Kang <kai.kang@windriver.com>
15---
16 cmake/modules/FindPython/Support.cmake | 2 +-
17 1 file changed, 1 insertion(+), 1 deletion(-)
18
19Index: ceph-18.2.0/cmake/modules/FindPython/Support.cmake
20===================================================================
21--- ceph-18.2.0.orig/cmake/modules/FindPython/Support.cmake
22+++ ceph-18.2.0/cmake/modules/FindPython/Support.cmake
23@@ -17,7 +17,7 @@
24 message (FATAL_ERROR "FindPython: INTERNAL ERROR")
25 endif()
26 if (_${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR EQUAL 3)
27- set(_${_PYTHON_PREFIX}_VERSIONS 3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
28+ set(_${_PYTHON_PREFIX}_VERSIONS 3.11 3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
29 elseif (_${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR EQUAL 2)
30 set(_${_PYTHON_PREFIX}_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0)
31 else()
diff --git a/recipes-extended/ceph/ceph/0001-delete-install-layout-deb.patch b/recipes-extended/ceph/ceph/0001-delete-install-layout-deb.patch
new file mode 100644
index 00000000..91eacfa9
--- /dev/null
+++ b/recipes-extended/ceph/ceph/0001-delete-install-layout-deb.patch
@@ -0,0 +1,37 @@
1From 903bb882a44eb5567f8b1fc7f7c4857c2f03579d Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Wed, 13 Mar 2024 03:41:47 -0700
4Subject: [PATCH] delete install-layout=deb
5
6Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
7---
8 cmake/modules/Distutils.cmake | 6 ------
9 1 file changed, 6 deletions(-)
10
11diff --git a/cmake/modules/Distutils.cmake b/cmake/modules/Distutils.cmake
12index daaae4ba6..e606e3890 100644
13--- a/cmake/modules/Distutils.cmake
14+++ b/cmake/modules/Distutils.cmake
15@@ -30,9 +30,6 @@ function(distutils_install_module name)
16 install(CODE "
17 set(options --prefix=${CMAKE_INSTALL_PREFIX})
18 if(DEFINED ENV{DESTDIR})
19- if(EXISTS /etc/debian_version)
20- list(APPEND options --install-layout=deb)
21- endif()
22 list(APPEND options
23 --root=\$ENV{DESTDIR}
24 --single-version-externally-managed)
25@@ -136,9 +133,6 @@ function(distutils_install_cython_module name)
26
27 set(options --prefix=${CMAKE_INSTALL_PREFIX})
28 if(DEFINED ENV{DESTDIR})
29- if(EXISTS /etc/debian_version)
30- list(APPEND options --install-layout=deb)
31- endif()
32 list(APPEND options --root=\$ENV{DESTDIR})
33 else()
34 list(APPEND options --root=/)
35--
362.42.0
37
diff --git a/recipes-extended/ceph/ceph_18.2.0.bb b/recipes-extended/ceph/ceph_18.2.0.bb
index 35188106..3dd75a51 100644
--- a/recipes-extended/ceph/ceph_18.2.0.bb
+++ b/recipes-extended/ceph/ceph_18.2.0.bb
@@ -4,15 +4,16 @@ LIC_FILES_CHKSUM = "file://COPYING-LGPL2.1;md5=fbc093901857fcd118f065f900982c24
4 file://COPYING-GPL2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ 4 file://COPYING-GPL2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
5 file://COPYING;md5=5351120989d78252e65dc1a2a92e3617 \ 5 file://COPYING;md5=5351120989d78252e65dc1a2a92e3617 \
6" 6"
7inherit cmake pkgconfig python3native python3-dir systemd 7inherit cmake pkgconfig python3native python3-dir systemd useradd
8# Disable python pybind support for ceph temporary, when corss compiling pybind, 8# Disable python pybind support for ceph temporary, when corss compiling pybind,
9# pybind mix cmake and python setup environment, would case a lot of errors. 9# pybind mix cmake and python setup environment, would case a lot of errors.
10 10
11SRC_URI = "http://download.ceph.com/tarballs/ceph-${PV}.tar.gz \ 11SRC_URI = "http://download.ceph.com/tarballs/ceph-${PV}.tar.gz \
12 file://0001-ceph-fix-build-errors-for-cross-compile.patch \
13 file://0001-fix-host-library-paths-were-used.patch \ 12 file://0001-fix-host-library-paths-were-used.patch \
14 file://ceph.conf \ 13 file://ceph.conf \
15 file://0001-cmake-add-support-for-python3.11.patch \ 14 file://0001-avoid-to_string-error.patch \
15 file://0001-delete-install-layout-deb.patch \
16 file://0001-cephadm-build.py-avoid-using-python3-from-sysroot-wh.patch \
16" 17"
17 18
18SRC_URI[sha256sum] = "495b63e1146c604018ae0cb29bf769b5d6235e3c95849c43513baf12bba1364d" 19SRC_URI[sha256sum] = "495b63e1146c604018ae0cb29bf769b5d6235e3c95849c43513baf12bba1364d"
@@ -23,8 +24,16 @@ DEPENDS = "boost bzip2 curl cryptsetup expat gperf-native \
23 oath openldap openssl \ 24 oath openldap openssl \
24 python3 python3-native python3-cython-native python3-pyyaml-native \ 25 python3 python3-native python3-cython-native python3-pyyaml-native \
25 rabbitmq-c rocksdb snappy thrift udev \ 26 rabbitmq-c rocksdb snappy thrift udev \
26 valgrind xfsprogs zlib libgcc \ 27 valgrind xfsprogs zlib libgcc zstd re2 \
27" 28"
29
30
31OECMAKE_C_COMPILER = "${@oecmake_map_compiler('CC', d)[0]} --sysroot=${RECIPE_SYSROOT}"
32OECMAKE_CXX_COMPILER = "${@oecmake_map_compiler('CXX', d)[0]} --sysroot=${RECIPE_SYSROOT}"
33
34USERADD_PACKAGES = "${PN}"
35USERADD_PARAM:${PN} = "--system --user-group --home-dir /var/lib/ceph --shell /sbin/nologin ceph"
36
28SYSTEMD_SERVICE:${PN} = " \ 37SYSTEMD_SERVICE:${PN} = " \
29 ceph-radosgw@.service \ 38 ceph-radosgw@.service \
30 ceph-radosgw.target \ 39 ceph-radosgw.target \
@@ -34,6 +43,8 @@ SYSTEMD_SERVICE:${PN} = " \
34 ceph-mds.target \ 43 ceph-mds.target \
35 ceph-osd@.service \ 44 ceph-osd@.service \
36 ceph-osd.target \ 45 ceph-osd.target \
46 cephfs-mirror@.service \
47 cephfs-mirror.target \
37 ceph.target \ 48 ceph.target \
38 ceph-rbd-mirror@.service \ 49 ceph-rbd-mirror@.service \
39 ceph-rbd-mirror.target \ 50 ceph-rbd-mirror.target \
@@ -45,15 +56,18 @@ SYSTEMD_SERVICE:${PN} = " \
45 ceph-immutable-object-cache@.service \ 56 ceph-immutable-object-cache@.service \
46 ceph-immutable-object-cache.target \ 57 ceph-immutable-object-cache.target \
47" 58"
48OECMAKE_GENERATOR = "Unix Makefiles"
49 59
50EXTRA_OECMAKE = "-DWITH_MANPAGE=OFF \ 60EXTRA_OECMAKE += "-DWITH_MANPAGE=OFF \
61 -DWITH_JAEGER=OFF \
62 -DWITH_SYSTEM_ZSTD=ON \
51 -DWITH_FUSE=OFF \ 63 -DWITH_FUSE=OFF \
52 -DWITH_SPDK=OFF \ 64 -DWITH_SPDK=OFF \
53 -DWITH_LEVELDB=OFF \ 65 -DWITH_LEVELDB=OFF \
54 -DWITH_LTTNG=OFF \ 66 -DWITH_LTTNG=OFF \
55 -DWITH_BABELTRACE=OFF \ 67 -DWITH_BABELTRACE=OFF \
56 -DWITH_TESTS=OFF \ 68 -DWITH_TESTS=OFF \
69 -DWITH_RADOSGW_SELECT_PARQUET=OFF \
70 -DWITH_RADOSGW_ARROW_FLIGHT=OFF \
57 -DWITH_MGR=OFF \ 71 -DWITH_MGR=OFF \
58 -DWITH_MGR_DASHBOARD_FRONTEND=OFF \ 72 -DWITH_MGR_DASHBOARD_FRONTEND=OFF \
59 -DWITH_SYSTEM_BOOST=ON \ 73 -DWITH_SYSTEM_BOOST=ON \
@@ -67,34 +81,6 @@ EXTRA_OECMAKE = "-DWITH_MANPAGE=OFF \
67 -DCMAKE_TOOLCHAIN_FILE:FILEPATH=${WORKDIR}/toolchain.cmake \ 81 -DCMAKE_TOOLCHAIN_FILE:FILEPATH=${WORKDIR}/toolchain.cmake \
68 " 82 "
69 83
70EXTRA_OECMAKE += "-DThrift_INCLUDE_DIR:PATH=${STAGING_INCDIR} \
71 -DThrift_LIBRARIES:PATH=${STAGING_LIBDIR} \
72 "
73
74# retired options:
75# -DPython3_VERSION=${PYTHON_BASEVERSION}
76# -DPython3_USE_STATIC_LIBS=FALSE
77# -DPython3_INCLUDE_DIR:PATH=${PYTHON_INCLUDE_DIR}
78# -DPython3_LIBRARY:PATH=${PYTHON_LIBRARY}
79# -DPython3_ROOT_DIR:PATH=${PYTHON_SITEPACKAGES_DIR}
80# -DPython3_EXECUTABLE:PATH="${PYTHON}"
81
82CXXFLAGS += "${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS}"
83CFLAGS += "${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS}"
84
85export STAGING_DIR_HOST
86
87do_compile:prepend() {
88 cmake_runcmake_build --target legacy-option-headers
89}
90
91# do_compile() {
92# ninja -v ${PARALLEL_MAKE}
93# }
94do_compile() {
95 cmake_runcmake_build --target all
96}
97
98do_configure:prepend () { 84do_configure:prepend () {
99 echo "set( CMAKE_SYSROOT \"${RECIPE_SYSROOT}\" )" >> ${WORKDIR}/toolchain.cmake 85 echo "set( CMAKE_SYSROOT \"${RECIPE_SYSROOT}\" )" >> ${WORKDIR}/toolchain.cmake
100 echo "set( CMAKE_DESTDIR \"${D}\" )" >> ${WORKDIR}/toolchain.cmake 86 echo "set( CMAKE_DESTDIR \"${D}\" )" >> ${WORKDIR}/toolchain.cmake
@@ -104,16 +90,24 @@ do_configure:prepend () {
104 echo "set( CMAKE_C_COMPILER_FORCED TRUE )" >> ${WORKDIR}/toolchain.cmake 90 echo "set( CMAKE_C_COMPILER_FORCED TRUE )" >> ${WORKDIR}/toolchain.cmake
105} 91}
106 92
93do_compile:prepend() {
94 export BUILD_DOC=1
95}
96
97do_install:prepend() {
98 export BUILD_DOC=1
99}
100
107do_install:append () { 101do_install:append () {
108 sed -i -e 's:^#!/usr/bin/python$:&3:' \ 102 sed -i -e 's:^#!/usr/bin/python$:&3:' \
109 -e 's:${WORKDIR}.*python3:${bindir}/python3:' \ 103 -e 's:${WORKDIR}.*python3:${bindir}/python3:' \
110 ${D}${bindir}/ceph ${D}${bindir}/ceph-crash \ 104 ${D}${bindir}/ceph ${D}${bindir}/ceph-crash \
111 ${D}${bindir}/ceph-volume ${D}${bindir}/ceph-volume-systemd 105 ${D}${bindir}/cephfs-top \
106 ${D}${sbindir}/ceph-volume ${D}${sbindir}/ceph-volume-systemd
112 find ${D} -name SOURCES.txt | xargs sed -i -e 's:${WORKDIR}::' 107 find ${D} -name SOURCES.txt | xargs sed -i -e 's:${WORKDIR}::'
113 install -d ${D}${sysconfdir}/ceph 108 install -d ${D}${sysconfdir}/ceph
114 install -m 644 ${WORKDIR}/ceph.conf ${D}${sysconfdir}/ceph/ 109 install -m 644 ${WORKDIR}/ceph.conf ${D}${sysconfdir}/ceph/
115 install -d ${D}${systemd_unitdir} 110 install -d ${D}${systemd_unitdir}
116 mv ${D}${libexecdir}/systemd/system ${D}${systemd_unitdir}
117 mv ${D}${libexecdir}/ceph/ceph-osd-prestart.sh ${D}${libdir}/ceph 111 mv ${D}${libexecdir}/ceph/ceph-osd-prestart.sh ${D}${libdir}/ceph
118 mv ${D}${libexecdir}/ceph/ceph_common.sh ${D}${libdir}/ceph 112 mv ${D}${libexecdir}/ceph/ceph_common.sh ${D}${libdir}/ceph
119 # WITH_FUSE is set to OFF, remove ceph-fuse related units 113 # WITH_FUSE is set to OFF, remove ceph-fuse related units
@@ -143,6 +137,7 @@ FILES:${PN} += "\
143 ${libdir}/ceph/compressor/*.so \ 137 ${libdir}/ceph/compressor/*.so \
144 ${libdir}/rados-classes/*.so \ 138 ${libdir}/rados-classes/*.so \
145 ${libdir}/ceph/*.so \ 139 ${libdir}/ceph/*.so \
140 ${libdir}/libcephsqlite.so \
146" 141"
147 142
148FILES:${PN} += " \ 143FILES:${PN} += " \
@@ -150,6 +145,14 @@ FILES:${PN} += " \
150 /etc/default/volatiles/99_ceph-placeholder \ 145 /etc/default/volatiles/99_ceph-placeholder \
151" 146"
152 147
148FILES:${PN}-dev = " \
149 ${includedir} \
150 ${libdir}/libcephfs.so \
151 ${libdir}/librados*.so \
152 ${libdir}/librbd.so \
153 ${libdir}/librgw.so \
154"
155
153FILES:${PN}-python = "\ 156FILES:${PN}-python = "\
154 ${PYTHON_SITEPACKAGES_DIR}/* \ 157 ${PYTHON_SITEPACKAGES_DIR}/* \
155" 158"
@@ -160,13 +163,15 @@ RDEPENDS:${PN} += "\
160 python3-prettytable \ 163 python3-prettytable \
161 ${PN}-python \ 164 ${PN}-python \
162 gawk \ 165 gawk \
166 bash \
163" 167"
164COMPATIBLE_HOST = "(x86_64).*" 168COMPATIBLE_HOST = "(x86_64).*"
165PACKAGES += " \ 169PACKAGES += " \
166 ${PN}-python \ 170 ${PN}-python \
167" 171"
168INSANE_SKIP:${PN}-python += "ldflags" 172INSANE_SKIP:${PN}-python += "ldflags buildpaths"
169INSANE_SKIP:${PN} += "dev-so" 173INSANE_SKIP:${PN} += "dev-so"
174INSANE_SKIP:${PN}-dbg += "buildpaths"
170CCACHE_DISABLE = "1" 175CCACHE_DISABLE = "1"
171 176
172CVE_PRODUCT = "ceph ceph_storage ceph_storage_mon ceph_storage_osd" 177CVE_PRODUCT = "ceph ceph_storage ceph_storage_mon ceph_storage_osd"