Present the correct version of ceph

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 <pedro.silvadacruz@windriver.com>
This commit is contained in:
Pedro Vinícius Silva da Cruz 2023-06-22 16:48:35 +00:00 committed by Pedro Vinícius Silva da Cruz
parent cc7db6baba
commit 21990f2259
3 changed files with 8 additions and 38 deletions

View File

@ -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

View File

@ -1,34 +0,0 @@
From 234a62418c56cea749e8b86618ea06cbf5cfc2c9 Mon Sep 17 00:00:00 2001
From: Leonardo Fagundes Luz Serrano
<Leonardo.FagundesLuzSerrano@windriver.com>
Date: Tue, 25 Jan 2022 19:55:28 -0300
Subject: [PATCH] Fix error related to /src/.git_version
Error message:
"force parsing /<<PKGBUILDDIR>>/src/.git_version
for CEPH_GIT_VER and CEPH_GIT_NICE_VER
CMake Error at src/CMakeLists.txt:183 (file):
file STRINGS file "/<<PKGBUILDDIR>>/src/.git_version"
cannot be read."
Signed-off-by: Leonardo Fagundes Luz Serrano <Leonardo.FagundesLuzSerrano@windriver.com>
---
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

View File

@ -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