From 21990f2259d32950f0dc3d273d59e7ea9f2c27a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Vin=C3=ADcius=20Silva=20da=20Cruz?= Date: Thu, 22 Jun 2023 16:48:35 +0000 Subject: [PATCH] Present the correct version of ceph MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Ceph is reporting the wrong version when running the commands: ceph --version; ceph mgr versions; ceph tell osd.* version. To avoid this, dl_hook was adjusted so that the ceph version is returned and the SHA of the last commit is taken and saved inside the .git_version file. Patch 0001 was removed as it was not letting the .git_version file be read. With this fix, the following output is shown after running the 'ceph --version' command: ceph version 14.2.22 (2ebd6bae80aca32269eb24d6471ebd72c22da03b) nautilus (stable) Test Plan: PASS AIO-SX fresh install PASS Run and check output ceph version commands Closes-Bug: 2024681 Change-Id: I331e8b74b964b752e57b7a27b7c0c9054119ea51 Signed-off-by: Pedro Vinícius Silva da Cruz --- ceph/ceph/debian/dl_hook | 11 ++++-- ...ix-error-related-to-src-.git_version.patch | 34 ------------------- ceph/ceph/debian/patches/series | 1 - 3 files changed, 8 insertions(+), 38 deletions(-) delete mode 100644 ceph/ceph/debian/patches/0001-Fix-error-related-to-src-.git_version.patch diff --git a/ceph/ceph/debian/dl_hook b/ceph/ceph/debian/dl_hook index c4a3a91f5..958a10121 100755 --- a/ceph/ceph/debian/dl_hook +++ b/ceph/ceph/debian/dl_hook @@ -2,10 +2,12 @@ set -x +VERSION="14.2.22" + STX_BASE=$(realpath ${MY_REPO}/stx) PKG_BASE=$(realpath ${STX_BASE}/integ/ceph/ceph) -PKG_SRC_DIR=/ceph +CEPH_GIT_SRC_DIR=${STX_GIT_SRC_DIR}/ceph PKG_BUILD_NAME=$1 PKG_BUILD_DIR=$(realpath `pwd`/${PKG_BUILD_NAME}) @@ -14,6 +16,9 @@ PKG_BUILD_DIR=$(realpath `pwd`/${PKG_BUILD_NAME}) mkdir ${PKG_BUILD_NAME} tar -acvvzf - -C ${STX_GIT_SRC_DIR} ceph | tar -xvvzf - --directory ${PKG_BUILD_DIR} --strip-components 1 +# Set ceph version +(git -C ${CEPH_GIT_SRC_DIR} rev-parse HEAD ; echo "v${VERSION}") 2> /dev/null > ${PKG_BUILD_DIR}/src/.git_version + # Remove upstream's debian folder rm -rf ${PKG_BUILD_DIR}/debian @@ -94,8 +99,8 @@ unpack_submodule "${SOURCE24}" "$(dirname ${SOURCE24})" unpack_submodule "${SOURCE25}" "$(dirname ${SOURCE25})" # Alpine configs -sed -e "s/@VERSION@/14.2.22/g" \ +sed -e "s/@VERSION@/${VERSION}/g" \ -e "s/@RPM_RELEASE@/1.stx.1/g" \ - -e "s/@TARBALL_BASENAME@/ceph-14.2.22/g" \ + -e "s/@TARBALL_BASENAME@/${PKG_BUILD_NAME}/g" \ -i ${PKG_BUILD_DIR}/alpine/APKBUILD.in mv ${PKG_BUILD_DIR}/alpine/APKBUILD.in ${PKG_BUILD_DIR}/alpine/APKBUILD diff --git a/ceph/ceph/debian/patches/0001-Fix-error-related-to-src-.git_version.patch b/ceph/ceph/debian/patches/0001-Fix-error-related-to-src-.git_version.patch deleted file mode 100644 index ef13923be..000000000 --- a/ceph/ceph/debian/patches/0001-Fix-error-related-to-src-.git_version.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 234a62418c56cea749e8b86618ea06cbf5cfc2c9 Mon Sep 17 00:00:00 2001 -From: Leonardo Fagundes Luz Serrano - -Date: Tue, 25 Jan 2022 19:55:28 -0300 -Subject: [PATCH] Fix error related to /src/.git_version - -Error message: -"force parsing /<>/src/.git_version -for CEPH_GIT_VER and CEPH_GIT_NICE_VER -CMake Error at src/CMakeLists.txt:183 (file): -file STRINGS file "/<>/src/.git_version" -cannot be read." - -Signed-off-by: Leonardo Fagundes Luz Serrano ---- - src/CMakeLists.txt | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index be06fe5016..3c26d1d7f7 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -177,7 +177,7 @@ set(GCOV_PREFIX_STRIP 4) - - # the src/.git_version file may be written out by make-dist; otherwise - # we pull the git version from .git --option(ENABLE_GIT_VERSION "build Ceph with git version string" ON) -+option(ENABLE_GIT_VERSION "build Ceph with git version string" OFF) - if(${ENABLE_GIT_VERSION}) - message(STATUS "force parsing ${CMAKE_CURRENT_SOURCE_DIR}/.git_version for CEPH_GIT_VER and CEPH_GIT_NICE_VER") - file(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/.git_version CEPH_GIT_SHA_AND_TAG) --- -2.17.1 - diff --git a/ceph/ceph/debian/patches/series b/ceph/ceph/debian/patches/series index e4d6aec6f..8b22df529 100644 --- a/ceph/ceph/debian/patches/series +++ b/ceph/ceph/debian/patches/series @@ -20,5 +20,4 @@ cmake_add_1.74_to_known_versions.patch another-cmakelists-fix.patch fix-ceph-osd-systemd-target.patch # allow-bgp-to-host.patch ## Not applicable to stx/14.2.22 version -0001-Fix-error-related-to-src-.git_version.patch 0002-Fix-src-CMakeLists.txts-DESTINATION-error.patch