public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH ceph] cherry-pick changes to use system packages for bundled deps
@ 2026-01-21 15:12 Kefu Chai
  2026-01-22  8:29 ` [pve-devel] [PATCH ceph] cherry-pick changes to buiild crimson package Kefu Chai
  0 siblings, 1 reply; 6+ messages in thread
From: Kefu Chai @ 2026-01-21 15:12 UTC (permalink / raw)
  To: pve-devel

Previously, cephadm's build process pulled dependencies from PyPI,
which failed in environments with restricted network access. This
change backports upstream improvements that enable building cephadm
using system packages instead, mirroring the existing RPM packaging
workflow.

And the vendored Arrow pulled xsimd from GitHub, this also failed in
building environment without network access. This change backports
upstream improvements enabling the build to use libxsimd-dev package
when building debian packages.

Backported changes:
- https://github.com/ceph/ceph/pull/66256 - Use system packages for
  cephadm bundled dependencies
- https://github.com/ceph/ceph/pull/66248 - Add libxsimd-dev build
  dependency for vendored Arrow
- https://github.com/ceph/ceph/pull/65292 - cephadm: fix building
  rpm-sourced cephadm zippapp on el10

Note: Test commits from these PRs are excluded from this backport.

Signed-off-by: Kefu Chai <k.chai@proxmox.com>
---
 ...-issues-running-existing-cephadm-bui.patch |  66 +++++
 ...root_entries-population-in-version-c.patch |  62 +++++
 ...cephadm-rpm-based-builds-without-top.patch |  89 ++++++
 ...d-Debian-package-support-for-bundled.patch | 261 ++++++++++++++++++
 ...m-packages-for-cephadm-bundled-depen.patch |  54 ++++
 ...-Use-AUTO-mode-for-xsimd-dependency-.patch |  55 ++++
 ...dd-libxsimd-dev-build-dependency-for.patch |  41 +++
 patches/series                                |   8 +
 8 files changed, 636 insertions(+)
 create mode 100644 patches/0042-cephadm-fix-some-issues-running-existing-cephadm-bui.patch
 create mode 100644 patches/0043-cephadm-fix-zip_root_entries-population-in-version-c.patch
 create mode 100644 patches/0044-cephadm-support-cephadm-rpm-based-builds-without-top.patch
 create mode 100644 patches/0045-cephadm-build-Add-Debian-package-support-for-bundled.patch
 create mode 100644 patches/0046-debian-Use-system-packages-for-cephadm-bundled-depen.patch
 create mode 100644 patches/0047-cmake-BuildArrow-Use-AUTO-mode-for-xsimd-dependency-.patch
 create mode 100644 patches/0048-debian-control-Add-libxsimd-dev-build-dependency-for.patch

diff --git a/patches/0042-cephadm-fix-some-issues-running-existing-cephadm-bui.patch b/patches/0042-cephadm-fix-some-issues-running-existing-cephadm-bui.patch
new file mode 100644
index 00000000000..c6208b0db2a
--- /dev/null
+++ b/patches/0042-cephadm-fix-some-issues-running-existing-cephadm-bui.patch
@@ -0,0 +1,66 @@
+From 2685f6c35245d033e73e16ece3e356fcead44cea Mon Sep 17 00:00:00 2001
+From: John Mulligan <jmulligan@redhat.com>
+Date: Thu, 21 Aug 2025 12:30:55 -0400
+Subject: [PATCH 42/46] cephadm: fix some issues running existing cephadm build
+ tests
+
+As time has marched on and people changed things our tests no longer
+match the expected inputs.
+
+Signed-off-by: John Mulligan <jmulligan@redhat.com>
+(cherry picked from commit 31c8010faa417ca53614bd30379a9b9c0c9199de)
+---
+ src/cephadm/tests/build/test_cephadm_build.py | 18 ++++++++++++------
+ 1 file changed, 12 insertions(+), 6 deletions(-)
+
+diff --git a/src/cephadm/tests/build/test_cephadm_build.py b/src/cephadm/tests/build/test_cephadm_build.py
+index c2995a76d4b..9beef67ffe0 100644
+--- a/src/cephadm/tests/build/test_cephadm_build.py
++++ b/src/cephadm/tests/build/test_cephadm_build.py
+@@ -34,12 +34,12 @@ CONTAINERS = {
+     },
+     'ubuntu-20.04': {
+         'name': 'cephadm-build-test:ubuntu-20-04-py3',
+-        'base_image': 'quay.io/library/ubuntu:20.04',
++        'base_image': 'docker.io/library/ubuntu:20.04',
+         'script': 'apt update && apt install -y python3-venv',
+     },
+     'ubuntu-22.04': {
+         'name': 'cephadm-build-test:ubuntu-22-04-py3',
+-        'base_image': 'quay.io/library/ubuntu:22.04',
++        'base_image': 'docker.io/library/ubuntu:22.04',
+         'script': 'apt update && apt install -y python3-venv',
+     },
+ }
+@@ -128,8 +128,8 @@ def test_cephadm_build(env, source_dir, tmp_path):
+     assert all('requirements_entry' in v for v in data['bundled_packages'])
+     assert 'zip_root_entries' in data
+     zre = data['zip_root_entries']
+-    assert any(e.startswith('Jinja2') for e in zre)
+-    assert any(e.startswith('MarkupSafe') for e in zre)
++    assert any(_dist_info(e, 'Jinja2') for e in zre)
++    assert any(_dist_info(e, 'MarkupSafe') for e in zre)
+     assert any(e.startswith('jinja2') for e in zre)
+     assert any(e.startswith('markupsafe') for e in zre)
+     assert any(e.startswith('cephadmlib') for e in zre)
+@@ -184,9 +184,15 @@ def test_cephadm_build_from_rpms(env, source_dir, tmp_path):
+     assert all('requirements_entry' in v for v in data['bundled_packages'])
+     assert 'zip_root_entries' in data
+     zre = data['zip_root_entries']
+-    assert any(e.startswith('Jinja2') for e in zre)
+-    assert any(e.startswith('MarkupSafe') for e in zre)
++    assert any(_dist_info(e, 'Jinja2') for e in zre)
++    assert any(_dist_info(e, 'MarkupSafe') for e in zre)
+     assert any(e.startswith('jinja2') for e in zre)
+     assert any(e.startswith('markupsafe') for e in zre)
+     assert any(e.startswith('cephadmlib') for e in zre)
+     assert any(e.startswith('_cephadmmeta') for e in zre)
++
++
++def _dist_info(entry, name):
++    return (
++        entry.startswith(entry) or entry.startswith(entry.lower())
++    ) and (entry.endswith('.dist-info') or entry.endswith('.egg-info'))
+-- 
+2.47.3
+
diff --git a/patches/0043-cephadm-fix-zip_root_entries-population-in-version-c.patch b/patches/0043-cephadm-fix-zip_root_entries-population-in-version-c.patch
new file mode 100644
index 00000000000..7a0b1a18d68
--- /dev/null
+++ b/patches/0043-cephadm-fix-zip_root_entries-population-in-version-c.patch
@@ -0,0 +1,62 @@
+From 2c20ae95f32a2bdf78576252f1c9171f00a2790e Mon Sep 17 00:00:00 2001
+From: Kefu Chai <k.chai@proxmox.com>
+Date: Mon, 10 Nov 2025 12:11:08 +0800
+Subject: [PATCH 43/46] cephadm: fix zip_root_entries population in version
+ command
+
+The 'cephadm version --verbose' command was returning an empty
+zip_root_entries list because it relied on the private '_files'
+attribute of zipimport.zipimporter, which is not reliably populated
+across Python versions.
+
+This commit fixes the issue by using the zipfile module to properly
+read the archive contents via the loader.archive path. This ensures
+that zip_root_entries is correctly populated with the root-level
+directories in the zipapp.
+
+This fix is necessary for the cephadm build tests to properly validate
+that all expected packages and modules are included in the built zipapp.
+
+Signed-off-by: Kefu Chai <k.chai@proxmox.com>
+(cherry picked from commit 2c68c1496dbb7cd01bf783e31510940445040a34)
+---
+ src/cephadm/cephadm.py | 16 ++++++++++++----
+ 1 file changed, 12 insertions(+), 4 deletions(-)
+
+diff --git a/src/cephadm/cephadm.py b/src/cephadm/cephadm.py
+index f75aaa86dac..8d08c700868 100755
+--- a/src/cephadm/cephadm.py
++++ b/src/cephadm/cephadm.py
+@@ -1688,6 +1688,7 @@ def command_version(ctx):
+     # type: (CephadmContext) -> int
+     import importlib
+     import zipimport
++    import zipfile
+     import types
+ 
+     vmod: Optional[types.ModuleType]
+@@ -1744,10 +1745,17 @@ def command_version(ctx):
+             out['bundled_packages'] = deps_info
+         except OSError:
+             pass
+-        files = getattr(loader, '_files', {})
+-        out['zip_root_entries'] = sorted(
+-            {p.split('/')[0] for p in files.keys()}
+-        )
++        # Use zipfile module to properly read the archive contents
++        # loader.archive contains the path to the zip file
++        try:
++            with zipfile.ZipFile(loader.archive, 'r') as zf:
++                files = zf.namelist()
++                out['zip_root_entries'] = sorted(
++                    {p.split('/')[0] for p in files if p}
++                )
++        except (OSError, zipfile.BadZipFile):
++            # Fallback to empty list if we can't read the zip
++            out['zip_root_entries'] = []
+ 
+     json.dump(out, sys.stdout, indent=2)
+     print()
+-- 
+2.47.3
+
diff --git a/patches/0044-cephadm-support-cephadm-rpm-based-builds-without-top.patch b/patches/0044-cephadm-support-cephadm-rpm-based-builds-without-top.patch
new file mode 100644
index 00000000000..6e1b4dd2e0e
--- /dev/null
+++ b/patches/0044-cephadm-support-cephadm-rpm-based-builds-without-top.patch
@@ -0,0 +1,89 @@
+From 5ce72178a782dfe2e80648063b025ba23d96d5d8 Mon Sep 17 00:00:00 2001
+From: John Mulligan <jmulligan@redhat.com>
+Date: Thu, 21 Aug 2025 12:44:17 -0400
+Subject: [PATCH 44/46] cephadm: support cephadm rpm based builds without
+ top_level.txt
+
+Signed-off-by: John Mulligan <jmulligan@redhat.com>
+(cherry picked from commit 26a499a8da339d870af193ea964368afbc84c694)
+---
+ src/cephadm/build.py | 56 +++++++++++++++++++++++++++++++++-----------
+ 1 file changed, 42 insertions(+), 14 deletions(-)
+
+diff --git a/src/cephadm/build.py b/src/cephadm/build.py
+index 43bc58a4003..01c91fc1680 100755
+--- a/src/cephadm/build.py
++++ b/src/cephadm/build.py
+@@ -434,6 +434,47 @@ def _install_rpm_deps(tempdir, config):
+     return dinfo
+ 
+ 
++def _gather_rpm_package_dirs(paths):
++    # = The easy way =
++    # the top_level.txt file can be used to determine where the python packages
++    # actually are. We need all of those and the meta-data dir (parent of
++    # top_level.txt) to be included in our zipapp
++    top_level = None
++    for path in paths:
++        if path.endswith('top_level.txt'):
++            top_level = pathlib.Path(path)
++    if top_level:
++        meta_dir = top_level.parent
++        pkg_dirs = [
++            top_level.parent.parent / p
++            for p in top_level.read_text().splitlines()
++        ]
++        return meta_dir, pkg_dirs
++    # = The hard way =
++    # loop through the directories to find the .dist-info dir (containing the
++    # mandatory METADATA file, according to the spec) and once we know the
++    # location of dist info we find the sibling paths from the rpm listing
++    dist_info = None
++    ppaths = []
++    for path in paths:
++        ppath = pathlib.Path(path)
++        ppaths.append(ppath)
++        if ppath.name == 'METADATA' and ppath.parent.name.endswith('.dist-info'):
++            dist_info = ppath.parent
++            break
++    if not dist_info:
++        raise ValueError('no .dist-info METADATA found')
++    if not dist_info.parent.name == 'site-packages':
++        raise ValueError(
++            'unexpected parent directory (not site-packages):'
++            f' {dist_info.parent.name}'
++        )
++    siblings = [
++        p for p in ppaths if p.parent == dist_info.parent and p != dist_info
++    ]
++    return dist_info, siblings
++
++
+ def _deps_from_rpm(tempdir, config, dinfo, pkg):
+     # first, figure out what rpm provides a particular python lib
+     dist = f'python3.{sys.version_info.minor}dist({pkg})'.lower()
+@@ -469,20 +510,7 @@ def _deps_from_rpm(tempdir, config, dinfo, pkg):
+         ['rpm', '-ql', rpmname], check=True, stdout=subprocess.PIPE
+     )
+     paths = [l.decode('utf8') for l in res.stdout.splitlines()]
+-    # the top_level.txt file can be used to determine where the python packages
+-    # actually are. We need all of those and the meta-data dir (parent of
+-    # top_level.txt) to be included in our zipapp
+-    top_level = None
+-    for path in paths:
+-        if path.endswith('top_level.txt'):
+-            top_level = pathlib.Path(path)
+-    if not top_level:
+-        raise ValueError('top_level not found')
+-    meta_dir = top_level.parent
+-    pkg_dirs = [
+-        top_level.parent.parent / p
+-        for p in top_level.read_text().splitlines()
+-    ]
++    meta_dir, pkg_dirs = _gather_rpm_package_dirs(paths)
+     meta_dest = tempdir / meta_dir.name
+     log.info(f"Copying {meta_dir} to {meta_dest}")
+     # copy the meta data directory
+-- 
+2.47.3
+
diff --git a/patches/0045-cephadm-build-Add-Debian-package-support-for-bundled.patch b/patches/0045-cephadm-build-Add-Debian-package-support-for-bundled.patch
new file mode 100644
index 00000000000..94241490b64
--- /dev/null
+++ b/patches/0045-cephadm-build-Add-Debian-package-support-for-bundled.patch
@@ -0,0 +1,261 @@
+From a4744feb1457aa7fb3f47b42f29138682cc7d41c Mon Sep 17 00:00:00 2001
+From: Kefu Chai <k.chai@proxmox.com>
+Date: Tue, 14 Oct 2025 21:04:42 +0800
+Subject: [PATCH 45/46] cephadm/build: Add Debian package support for bundled
+ dependencies
+
+Extends the cephadm build script to support bundling dependencies from
+Debian packages in addition to pip and RPM packages. This allows building
+cephadm on Debian-based distributions using system packages.
+
+Key changes:
+- Add 'deb' to DependencyMode enum to enable Debian package mode
+- Implement _setup_deb() to configure Debian dependency requirements
+- Add _install_deb_deps() to orchestrate Debian package installation
+- Add _gather_deb_package_dirs() to parse Debian package file listings
+  and locate Python package directories (handles both site-packages and
+  dist-packages directories used by Debian)
+- Add _deps_from_deb() to extract Python dependencies from installed
+  Debian packages using dpkg/apt-cache tools
+- Fix variable reference bug in _install_deps() (deps.mode -> config.deps_mode)
+
+The Debian implementation follows a similar pattern to the existing RPM
+support, using dpkg-query and dpkg -L to locate installed packages and
+their files, with special handling for Debian naming conventions
+(e.g., PyYAML -> python3-yaml).
+
+Signed-off-by: Kefu Chai <k.chai@proxmox.com>
+(cherry picked from commit 3ff9b0c24e33debe95a0a0c6b42da30be788871c)
+---
+ src/cephadm/build.py | 158 +++++++++++++++++++++++++++++++++++++++----
+ 1 file changed, 143 insertions(+), 15 deletions(-)
+
+diff --git a/src/cephadm/build.py b/src/cephadm/build.py
+index 01c91fc1680..53d3983de89 100755
+--- a/src/cephadm/build.py
++++ b/src/cephadm/build.py
+@@ -154,6 +154,7 @@ class PipEnv(enum.Enum):
+ class DependencyMode(enum.Enum):
+     pip = enum.auto()
+     rpm = enum.auto()
++    deb = enum.auto()
+     none = enum.auto()
+ 
+ 
+@@ -169,6 +170,8 @@ class Config:
+             self._setup_pip()
+         elif self.deps_mode == DependencyMode.rpm:
+             self._setup_rpm()
++        elif self.deps_mode == DependencyMode.deb:
++            self._setup_deb()
+ 
+     def _setup_pip(self):
+         if self._maj_min == (3, 6):
+@@ -180,6 +183,9 @@ class Config:
+     def _setup_rpm(self):
+         self.requirements = [InstallSpec(**v) for v in PY_REQUIREMENTS]
+ 
++    def _setup_deb(self):
++        self.requirements = [InstallSpec(**v) for v in PY_REQUIREMENTS]
++
+ 
+ class DependencyInfo:
+     """Type for tracking bundled dependencies."""
+@@ -333,7 +339,9 @@ def _install_deps(tempdir, config):
+         return _install_pip_deps(tempdir, config)
+     if config.deps_mode == DependencyMode.rpm:
+         return _install_rpm_deps(tempdir, config)
+-    raise ValueError(f'unexpected deps mode: {deps.mode}')
++    if config.deps_mode == DependencyMode.deb:
++        return _install_deb_deps(tempdir, config)
++    raise ValueError(f'unexpected deps mode: {config.deps_mode}')
+ 
+ 
+ def _install_pip_deps(tempdir, config):
+@@ -434,7 +442,26 @@ def _install_rpm_deps(tempdir, config):
+     return dinfo
+ 
+ 
+-def _gather_rpm_package_dirs(paths):
++def _install_deb_deps(tempdir, config):
++    log.info("Installing dependencies using Debian packages")
++    dinfo = DependencyInfo(config)
++    for pkg in config.requirements:
++        log.info(f"Looking for debian package for: {pkg.name!r}")
++        _deps_from_deb(tempdir, config, dinfo, pkg.name)
++    return dinfo
++
++
++def _gather_package_dirs(paths, expected_parent_dir):
++    """Parse package file listing to find Python package directories.
++
++    Args:
++        paths: List of file paths from package listing
++        expected_parent_dir: Expected parent directory name (e.g., 'site-packages' for RPM,
++                           'dist-packages' for Debian)
++
++    Returns:
++        Tuple of (metadata_dir, package_dirs)
++    """
+     # = The easy way =
+     # the top_level.txt file can be used to determine where the python packages
+     # actually are. We need all of those and the meta-data dir (parent of
+@@ -453,7 +480,7 @@ def _gather_rpm_package_dirs(paths):
+     # = The hard way =
+     # loop through the directories to find the .dist-info dir (containing the
+     # mandatory METADATA file, according to the spec) and once we know the
+-    # location of dist info we find the sibling paths from the rpm listing
++    # location of dist info we find the sibling paths from the package listing
+     dist_info = None
+     ppaths = []
+     for path in paths:
+@@ -464,9 +491,9 @@ def _gather_rpm_package_dirs(paths):
+             break
+     if not dist_info:
+         raise ValueError('no .dist-info METADATA found')
+-    if not dist_info.parent.name == 'site-packages':
++    if dist_info.parent.name != expected_parent_dir:
+         raise ValueError(
+-            'unexpected parent directory (not site-packages):'
++            f'unexpected parent directory (not {expected_parent_dir}):'
+             f' {dist_info.parent.name}'
+         )
+     siblings = [
+@@ -475,6 +502,31 @@ def _gather_rpm_package_dirs(paths):
+     return dist_info, siblings
+ 
+ 
++def _copy_package_files(tempdir, paths, expected_parent_dir):
++    """Copy package files to the build directory.
++
++    Args:
++        tempdir: Temporary directory to copy files to
++        paths: List of file paths from package listing
++        expected_parent_dir: Expected parent directory name per packaging convention:
++            - 'site-packages' for RPM-based distributions
++            - 'dist-packages' for Debian-based distributions
++
++    Returns:
++        None
++    """
++    meta_dir, pkg_dirs = _gather_package_dirs(paths, expected_parent_dir)
++    meta_dest = tempdir / meta_dir.name
++    log.info(f"Copying {meta_dir} to {meta_dest}")
++    # copy the meta data directory
++    shutil.copytree(meta_dir, meta_dest, ignore=_ignore_cephadmlib)
++    # copy all the package directories
++    for pkg_dir in pkg_dirs:
++        pkg_dest = tempdir / pkg_dir.name
++        log.info(f"Copying {pkg_dir} to {pkg_dest}")
++        shutil.copytree(pkg_dir, pkg_dest, ignore=_ignore_cephadmlib)
++
++
+ def _deps_from_rpm(tempdir, config, dinfo, pkg):
+     # first, figure out what rpm provides a particular python lib
+     dist = f'python3.{sys.version_info.minor}dist({pkg})'.lower()
+@@ -510,16 +562,92 @@ def _deps_from_rpm(tempdir, config, dinfo, pkg):
+         ['rpm', '-ql', rpmname], check=True, stdout=subprocess.PIPE
+     )
+     paths = [l.decode('utf8') for l in res.stdout.splitlines()]
+-    meta_dir, pkg_dirs = _gather_rpm_package_dirs(paths)
+-    meta_dest = tempdir / meta_dir.name
+-    log.info(f"Copying {meta_dir} to {meta_dest}")
+-    # copy the meta data directory
+-    shutil.copytree(meta_dir, meta_dest, ignore=_ignore_cephadmlib)
+-    # copy all the package directories
+-    for pkg_dir in pkg_dirs:
+-        pkg_dest = tempdir / pkg_dir.name
+-        log.info(f"Copying {pkg_dir} to {pkg_dest}")
+-        shutil.copytree(pkg_dir, pkg_dest, ignore=_ignore_cephadmlib)
++    # RPM-based distributions use 'site-packages' for Python packages
++    _copy_package_files(tempdir, paths, 'site-packages')
++
++
++def _deps_from_deb(tempdir, config, dinfo, pkg):
++    """Extract Python dependencies from Debian packages.
++
++    Args:
++        tempdir: Temporary directory to copy package files to
++        config: Build configuration
++        dinfo: DependencyInfo instance to track dependencies
++        pkg: Python package name (e.g., 'MarkupSafe', 'Jinja2', 'PyYAML')
++    """
++    # Convert Python package name to Debian package name
++    # Python packages are typically named python3-<lowercase-name>
++    # Handle special cases: PyYAML -> python3-yaml, MarkupSafe -> python3-markupsafe
++    pkg_lower = pkg.lower()
++    if pkg_lower == 'pyyaml':
++        deb_pkg_name = 'python3-yaml'
++    else:
++        deb_pkg_name = f'python3-{pkg_lower}'
++
++    # First, try to find the package using apt-cache
++    # This helps verify the package exists before trying to list its files
++    try:
++        res = subprocess.run(
++            ['apt-cache', 'show', deb_pkg_name],
++            check=True,
++            stdout=subprocess.PIPE,
++            stderr=subprocess.PIPE,
++        )
++    except subprocess.CalledProcessError:
++        # Package not found, try alternative naming
++        log.warning(f"Package {deb_pkg_name} not found via apt-cache, trying dpkg -S")
++        # Try to search for files that might belong to this package
++        # Search for the Python module in site-packages
++        search_pattern = f'/usr/lib/python3*/dist-packages/{pkg.lower()}*'
++        try:
++            res = subprocess.run(
++                ['dpkg', '-S', search_pattern],
++                check=True,
++                stdout=subprocess.PIPE,
++                stderr=subprocess.PIPE,
++            )
++            # dpkg -S output format: "package: /path/to/file"
++            deb_pkg_name = res.stdout.decode('utf8').split(':')[0].strip()
++        except subprocess.CalledProcessError as err:
++            log.error(f"Could not find Debian package for {pkg}")
++            log.error(f"Tried: {deb_pkg_name} and pattern search")
++            sys.exit(1)
++
++    # Get version information using dpkg-query
++    try:
++        res = subprocess.run(
++            ['dpkg-query', '-W', '-f=${Version}\\n', deb_pkg_name],
++            check=True,
++            stdout=subprocess.PIPE,
++        )
++        version = res.stdout.decode('utf8').strip()
++    except subprocess.CalledProcessError as err:
++        log.error(f"Could not query version for package {deb_pkg_name}: {err}")
++        sys.exit(1)
++
++    log.info(f"Debian Package: {deb_pkg_name} (version: {version})")
++    dinfo.add(
++        pkg,
++        deb_name=deb_pkg_name,
++        version=version,
++        package_source='deb',
++    )
++
++    # Get the list of files provided by the Debian package
++    try:
++        res = subprocess.run(
++            ['dpkg', '-L', deb_pkg_name],
++            check=True,
++            stdout=subprocess.PIPE,
++        )
++    except subprocess.CalledProcessError as err:
++        log.error(f"Could not list files for package {deb_pkg_name}: {err}")
++        sys.exit(1)
++
++    paths = [l.decode('utf8') for l in res.stdout.splitlines()]
++    # Debian-based distributions use 'dist-packages' for system-managed Python packages
++    # per Debian Python Policy: https://www.debian.org/doc/packaging-manuals/python-policy/
++    _copy_package_files(tempdir, paths, 'dist-packages')
+ 
+ 
+ def generate_version_file(versioning_vars, dest):
+-- 
+2.47.3
+
diff --git a/patches/0046-debian-Use-system-packages-for-cephadm-bundled-depen.patch b/patches/0046-debian-Use-system-packages-for-cephadm-bundled-depen.patch
new file mode 100644
index 00000000000..0b4daa63f79
--- /dev/null
+++ b/patches/0046-debian-Use-system-packages-for-cephadm-bundled-depen.patch
@@ -0,0 +1,54 @@
+From 779c9251669b65b7ed77a841f281e2d957174db2 Mon Sep 17 00:00:00 2001
+From: Kefu Chai <k.chai@proxmox.com>
+Date: Tue, 21 Oct 2025 11:25:00 +0800
+Subject: [PATCH 46/46] debian: Use system packages for cephadm bundled
+ dependencies
+
+Configure the Debian build to use CEPHADM_BUNDLED_DEPENDENCIES=deb,
+which instructs the cephadm build script to bundle dependencies from
+system-installed Debian packages instead of downloading from PyPI.
+
+This change addresses build failures in restricted network environments
+where Debian build tools do not permit internet access. By leveraging
+the Debian package support added in commit 9378a2988e1, the build now
+uses python3-markupsafe, python3-jinja2, and python3-yaml packages
+that are already installed as build dependencies.
+
+This approach mirrors the existing RPM packaging workflow, ensuring
+consistent behavior across different distribution package formats.
+
+Signed-off-by: Kefu Chai <k.chai@proxmox.com>
+(cherry picked from commit 25680021ee2422f8b8b4075b3ab77af39126eecc)
+---
+ debian/control | 2 ++
+ debian/rules   | 1 +
+ 2 files changed, 3 insertions(+)
+
+diff --git a/debian/control b/debian/control
+index 35c1dbe5bd2..94997827bd2 100644
+--- a/debian/control
++++ b/debian/control
+@@ -106,6 +106,8 @@ Build-Depends: automake,
+                python3-requests <pkg.ceph.check>,
+                python3-scipy <pkg.ceph.check>,
+                python3-onelogin-saml2 <pkg.ceph.check>,
++               python3-jinja2,
++               python3-markupsafe,
+                python3-setuptools,
+                python3-sphinx,
+                python3-venv,
+diff --git a/debian/rules b/debian/rules
+index b935efaa8cd..ee4eff2bdc5 100755
+--- a/debian/rules
++++ b/debian/rules
+@@ -30,6 +30,7 @@ extraopts += -DWITH_CEPHFS_JAVA=ON
+ extraopts += -DWITH_CEPHFS_SHELL=ON
+ extraopts += -DWITH_SYSTEMD=ON -DCEPH_SYSTEMD_ENV_DIR=/etc/default
+ extraopts += -DWITH_GRAFANA=ON
++extraopts += -DCEPHADM_BUNDLED_DEPENDENCIES=deb
+ ifeq ($(DEB_HOST_ARCH), amd64)
+   extraopts += -DWITH_RBD_RWL=ON
+ else
+-- 
+2.47.3
+
diff --git a/patches/0047-cmake-BuildArrow-Use-AUTO-mode-for-xsimd-dependency-.patch b/patches/0047-cmake-BuildArrow-Use-AUTO-mode-for-xsimd-dependency-.patch
new file mode 100644
index 00000000000..ab5681bece0
--- /dev/null
+++ b/patches/0047-cmake-BuildArrow-Use-AUTO-mode-for-xsimd-dependency-.patch
@@ -0,0 +1,55 @@
+From 46803fcaa3b2b4f14318b1320e8e3beb9cf3eec4 Mon Sep 17 00:00:00 2001
+From: Kefu Chai <k.chai@proxmox.com>
+Date: Wed, 15 Oct 2025 15:46:22 +0800
+Subject: [PATCH 47/48] cmake/BuildArrow: Use AUTO mode for xsimd dependency
+ detection
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Arrow requires xsimd >= 9.0.1 according to arrow/cpp/thirdparty/versions.txt.
+Previously, we unconditionally set -Dxsimd_SOURCE=BUNDLED, forcing the use
+of Arrow's vendored xsimd regardless of system package availability.
+
+This commit changes to -Dxsimd_SOURCE=AUTO, which allows Arrow's
+resolve_dependency mechanism to automatically:
+1. Try to find system xsimd package
+2. Check if version >= 9.0.1
+3. Use system version if found and sufficient
+4. Fall back to bundled version otherwise
+
+This reduces build time and dependencies on systems with sufficient xsimd,
+while maintaining compatibility with older distributions.
+
+Distribution availability:
+- Ubuntu Noble (24.04): libxsimd-dev 12.1.1 (✓ will use system)
+- Ubuntu Jammy (22.04): libxsimd-dev 7.6.0 (✗ will use bundled)
+- Debian Trixie (13): libxsimd-dev 13.2.0 (✓ will use system)
+- CentOS Stream 9: xsimd-devel 7.4.9 (✗ will use bundled)
+
+Signed-off-by: Kefu Chai <k.chai@proxmox.com>
+(cherry picked from commit 2defde30e4c61cd9f33196b91ac16505928ce774)
+---
+ cmake/modules/BuildArrow.cmake | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/cmake/modules/BuildArrow.cmake b/cmake/modules/BuildArrow.cmake
+index 0ee1d85b49f..cadc2909fa4 100644
+--- a/cmake/modules/BuildArrow.cmake
++++ b/cmake/modules/BuildArrow.cmake
+@@ -69,9 +69,9 @@ function(build_arrow)
+     list(APPEND arrow_DEPENDS Boost)
+   endif()
+ 
+-  # since Arrow 15.0.0 needs xsimd>=8.1.0 and since Ubuntu Jammy
+-  # Jellyfish only provides 7.6.0, we'll have arrow build it as source
+-  list(APPEND arrow_CMAKE_ARGS -Dxsimd_SOURCE=BUNDLED)
++  # Arrow requires xsimd >= 9.0.1 (see arrow/cpp/thirdparty/versions.txt).
++  # Use AUTO to let Arrow detect system xsimd and fall back to bundled if needed.
++  list(APPEND arrow_CMAKE_ARGS -Dxsimd_SOURCE=AUTO)
+ 
+   # cmake doesn't properly handle arguments containing ";", such as
+   # CMAKE_PREFIX_PATH, for which reason we'll have to use some other separator.
+-- 
+2.47.3
+
diff --git a/patches/0048-debian-control-Add-libxsimd-dev-build-dependency-for.patch b/patches/0048-debian-control-Add-libxsimd-dev-build-dependency-for.patch
new file mode 100644
index 00000000000..c431fb6edc1
--- /dev/null
+++ b/patches/0048-debian-control-Add-libxsimd-dev-build-dependency-for.patch
@@ -0,0 +1,41 @@
+From 20fb1b8eff9d9b4e683c33e556752085b408c24b Mon Sep 17 00:00:00 2001
+From: Kefu Chai <k.chai@proxmox.com>
+Date: Wed, 15 Oct 2025 15:46:26 +0800
+Subject: [PATCH 48/48] debian/control: Add libxsimd-dev build dependency for
+ vendored Arrow
+
+In commit e8460cbd, we introduced the "pkg.ceph.arrow" build profile to
+support building with system Arrow packages. However, neither Debian nor
+Ubuntu currently ships Arrow packages.
+
+Since WITH_RADOSGW_SELECT_PARQUET is always enabled in debian/rules,
+Arrow support is required for all builds. When the pkg.ceph.arrow profile
+is not selected, the build uses vendored Arrow. With the recent change to
+use AUTO mode for xsimd detection, Arrow will attempt to find system xsimd
+>= 9.0.1. Adding libxsimd-dev as a build dependency ensures it's available
+for Arrow to detect and use, reducing build time on supported distributions.
+
+On distributions with insufficient xsimd versions (< 9.0.1), Arrow will
+automatically fall back to its bundled version.
+
+Signed-off-by: Kefu Chai <k.chai@proxmox.com>
+(cherry picked from commit 929b47f83880683b376b9dcc0060938447f11c88)
+---
+ debian/control | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/debian/control b/debian/control
+index 94997827bd2..7d30e1faa70 100644
+--- a/debian/control
++++ b/debian/control
+@@ -85,6 +85,7 @@ Build-Depends: automake,
+                libpmem-dev <pkg.ceph.pmdk>,
+                libpmemobj-dev (>= 1.8) <pkg.ceph.pmdk>,
+                libprotobuf-dev <pkg.ceph.crimson>,
++               libxsimd-dev <!pkg.ceph.arrow>,
+                ninja-build,
+                nlohmann-json3-dev,
+                patch,
+-- 
+2.47.3
+
diff --git a/patches/series b/patches/series
index d775a8a068d..f2bfed1b939 100644
--- a/patches/series
+++ b/patches/series
@@ -39,3 +39,11 @@
 0039-mgr-fix-module-import-by-making-NOTIFY_TYPES-in-py-m.patch
 0040-pybind-rbd-disable-on_progress-callbacks-to-prevent-.patch
 0041-systemd-services-fix-installing-ceph-volume.patch
+0042-cephadm-fix-some-issues-running-existing-cephadm-bui.patch
+0043-cephadm-fix-zip_root_entries-population-in-version-c.patch
+0044-cephadm-support-cephadm-rpm-based-builds-without-top.patch
+0045-cephadm-build-Add-Debian-package-support-for-bundled.patch
+0046-debian-Use-system-packages-for-cephadm-bundled-depen.patch
+0047-cmake-BuildArrow-Use-AUTO-mode-for-xsimd-dependency-.patch
+0048-debian-control-Add-libxsimd-dev-build-dependency-for.patch
+  
-- 
2.47.3



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [pve-devel] [PATCH ceph] cherry-pick changes to buiild crimson package
  2026-01-21 15:12 [pve-devel] [PATCH ceph] cherry-pick changes to use system packages for bundled deps Kefu Chai
@ 2026-01-22  8:29 ` Kefu Chai
  2026-01-22 10:14   ` [pve-devel] [PATCH ceph 2/3 v2] " Kefu Chai
                     ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Kefu Chai @ 2026-01-22  8:29 UTC (permalink / raw)
  To: Kefu Chai, pve-devel

Backport changes to enable building both classic and crimson OSD packages
from the same source tree while maintaining upgrade compatibility.

Previously, crimson could only be built with the ceph.pkg.crimson profile,
which replaced the classic OSD entirely since both components shared the
same executable name. This made it impossible to provide both variants
simultaneously.

These changes introduce separate packages for classic and crimson OSD
components:
- ceph-osd-classic: Traditional OSD implementation
- ceph-osd-crimson: New crimson OSD implementation
- ceph-osd: Meta-package that depends on ceph-osd-classic by default

Users can switch between implementations using update-alternatives.

Rationale for downstream backport:
While these changes introduce breaking changes and were not backported to
the tentacle branch upstream, we are backporting them to allow users to
experiment with crimson. The package structure ensures safe upgrades:
existing installations automatically get ceph-osd-classic through the
ceph-osd dependency, preventing system breakage.

Backported PRs:
- https://github.com/ceph/ceph/pull/65782: Split ceph-osd into shared
  base and implementation packages
- https://github.com/ceph/ceph/pull/66568: Fix ceph-osd upgrade
  conflicts in debian/ceph.spec

Signed-off-by: Kefu Chai <k.chai@proxmox.com>
---
 ....in-install-crimson-objectstore-tool.patch |  49 ++
 ...-split-ceph-osd-into-shared-base-and.patch | 464 ++++++++++++++++++
 ....spec-fix-ceph-osd-upgrade-conflicts.patch | 108 ++++
 patches/series                                |   4 +-
 4 files changed, 624 insertions(+), 1 deletion(-)
 create mode 100644 patches/0049-ceph.spec.in-install-crimson-objectstore-tool.patch
 create mode 100644 patches/0050-debian-ceph.spec-split-ceph-osd-into-shared-base-and.patch
 create mode 100644 patches/0051-debian-ceph.spec-fix-ceph-osd-upgrade-conflicts.patch

diff --git a/patches/0049-ceph.spec.in-install-crimson-objectstore-tool.patch b/patches/0049-ceph.spec.in-install-crimson-objectstore-tool.patch
new file mode 100644
index 00000000000..1703d3efa21
--- /dev/null
+++ b/patches/0049-ceph.spec.in-install-crimson-objectstore-tool.patch
@@ -0,0 +1,49 @@
+From 152537074b2725d86c14744670925d55ea845d3d Mon Sep 17 00:00:00 2001
+From: Matan Breizman <mbreizma@redhat.com>
+Date: Wed, 23 Jul 2025 13:17:51 +0000
+Subject: [PATCH 49/51] ceph.spec.in: install crimson-objectstore-tool
+
+Include the tool when packaging for deb/rpm.
+
+Signed-off-by: Matan Breizman <mbreizma@redhat.com>
+(cherry picked from commit 47a15af8ddbf2276e1bbf4b68c88114d003357b1)
+---
+ ceph.spec.in            | 2 ++
+ debian/ceph-osd.install | 1 +
+ 2 files changed, 3 insertions(+)
+
+diff --git a/ceph.spec.in b/ceph.spec.in
+index 226fe72192b..659dbade0dc 100644
+--- a/ceph.spec.in
++++ b/ceph.spec.in
+@@ -1565,6 +1565,7 @@ popd
+ %if 0%{with crimson}
+ # package crimson-osd with the name of ceph-osd
+ install -m 0755 %{buildroot}%{_bindir}/crimson-osd %{buildroot}%{_bindir}/ceph-osd
++install -m 0755 %{buildroot}%{_bindir}/crimson-objectstore-tool %{buildroot}%{_bindir}/ceph-objectstore-tool
+ %endif
+ 
+ install -m 0644 -D src/etc-rbdmap %{buildroot}%{_sysconfdir}/ceph/rbdmap
+@@ -2337,6 +2338,7 @@ fi
+ %if 0%{with crimson}
+ %files crimson-osd
+ %{_bindir}/crimson-osd
++%{_bindir}/crimson-objectstore-tool
+ %endif
+ 
+ %files volume
+diff --git a/debian/ceph-osd.install b/debian/ceph-osd.install
+index 217c9bea719..f45e407f4b5 100755
+--- a/debian/ceph-osd.install
++++ b/debian/ceph-osd.install
+@@ -6,6 +6,7 @@ usr/bin/ceph-clsinfo
+ usr/bin/ceph-erasure-code-tool
+ usr/bin/ceph-objectstore-tool
+ <pkg.ceph.crimson> usr/bin/crimson-store-nbd
++<pkg.ceph.crimson> usr/bin/crimson-objectstore-tool
+ usr/bin/${CEPH_OSD_BASENAME} => /usr/bin/ceph-osd
+ usr/bin/ceph_objectstore_bench
+ usr/libexec/ceph/ceph-osd-prestart.sh
+-- 
+2.47.3
+
diff --git a/patches/0050-debian-ceph.spec-split-ceph-osd-into-shared-base-and.patch b/patches/0050-debian-ceph.spec-split-ceph-osd-into-shared-base-and.patch
new file mode 100644
index 00000000000..c4e8270425a
--- /dev/null
+++ b/patches/0050-debian-ceph.spec-split-ceph-osd-into-shared-base-and.patch
@@ -0,0 +1,464 @@
+From 3fcd25c26a9b6c6438a72bed98e577ed9749a65c Mon Sep 17 00:00:00 2001
+From: Kefu Chai <k.chai@proxmox.com>
+Date: Tue, 30 Sep 2025 21:04:46 +0800
+Subject: [PATCH 50/51] debian,ceph.spec: split ceph-osd into shared base and
+ implementation packages
+
+Previously, ceph-osd packaging had two mutually exclusive flavors that
+could only be built one at a time: one with classic OSD and another
+with crimson OSD. Both provided /usr/bin/ceph-osd, making them
+impossible to coexist and confusing from a user perspective.
+This commit restructures the packaging to enable both implementations
+to coexist on the same system:
+
+- ceph-osd: Contains shared components (systemd units, sysctl configs,
+  common executables like ceph-erasure-code-tool) and depends on exactly
+  one OSD implementation
+- ceph-osd-classic: Contains the classic OSD implementation binary and
+  classic-specific tools
+- ceph-osd-crimson: Contains the crimson OSD implementation binary and
+  crimson-specific tools
+
+The two implementation packages install different sets of file, so they
+don't conflict with each other anymore, and both depend on ceph-osd for
+shared resources.
+
+Changes:
+
+Debian packaging:
+
+- Revert e5f00d2f
+- Add ceph-osd-crimson package
+- Add Recommends: ceph-osd-classic to prefer classic on upgrades
+- Add Replaces/Breaks for smooth upgrades from old monolithic package
+- Create separate .install files for crimson and classic osd packages
+  Enforce exact version matching using ${binary:Version}
+
+RPM packaging:
+
+- Use rich dependencies for OR requirement (classic or crimson)
+- Add Recommends: ceph-osd-classic for upgrade preference
+
+Upgrade behavior:
+
+Users upgrading from older versions will automatically get
+ceph-osd-classic due to the Recommends directive, maintaining
+backward compatibility. Users can explicitly choose crimson by
+installing ceph-osd-crimson, which will coexist with classic.
+Switching between implementations is supported via standard package
+operations, with the alternatives system ensuring /usr/bin/ceph-osd
+always points to the active implementation.
+
+Signed-off-by: Kefu Chai <k.chai@proxmox.com>
+(cherry picked from commit a37b5b5bde8c2e8d6890f16b31046119ed55f25d)
+---
+ ceph.spec.in                     | 60 +++++++++++++++------
+ debian/ceph-osd-classic.install  |  9 ++++
+ debian/ceph-osd-classic.postinst | 13 +++++
+ debian/ceph-osd-classic.prerm    | 12 +++++
+ debian/ceph-osd-crimson.install  |  5 ++
+ debian/ceph-osd-crimson.postinst | 13 +++++
+ debian/ceph-osd-crimson.prerm    | 12 +++++
+ debian/ceph-osd.install          | 11 ----
+ debian/control                   | 93 +++++++++++++++++++++++++++-----
+ debian/rules                     |  5 --
+ 10 files changed, 189 insertions(+), 44 deletions(-)
+ create mode 100755 debian/ceph-osd-classic.install
+ create mode 100644 debian/ceph-osd-classic.postinst
+ create mode 100644 debian/ceph-osd-classic.prerm
+ create mode 100755 debian/ceph-osd-crimson.install
+ create mode 100644 debian/ceph-osd-crimson.postinst
+ create mode 100644 debian/ceph-osd-crimson.prerm
+ mode change 100755 => 100644 debian/ceph-osd.install
+
+diff --git a/ceph.spec.in b/ceph.spec.in
+index 659dbade0dc..00de179d417 100644
+--- a/ceph.spec.in
++++ b/ceph.spec.in
+@@ -912,28 +912,39 @@ Summary:	Ceph Object Storage Daemon
+ Group:		System/Filesystems
+ %endif
+ Requires:	ceph-base = %{_epoch_prefix}%{version}-%{release}
++Requires:	(ceph-osd-classic = %{_epoch_prefix}%{version}-%{release} or ceph-osd-crimson = %{_epoch_prefix}%{version}-%{release})
+ Requires:	sudo
+ Requires:	libstoragemgmt
+-%if 0%{with crimson}
+-Requires:	protobuf
+-%endif
+ %if 0%{?weak_deps}
+ Recommends:	ceph-volume = %{_epoch_prefix}%{version}-%{release}
+ %endif
+ %description osd
+ ceph-osd is the object storage daemon for the Ceph distributed file
++system.  It provides components shared between classic and crimson OSD
++implementations. It requires either the classic or crimson OSD
++to provide the core OSD daemon.
++
++%package osd-classic
++Summary:	Ceph Object Storage Daemon (classic)
++%if 0%{?suse_version}
++Group:		System/Filesystems
++%endif
++Requires:   ceph-osd = %{_epoch_prefix}%{version}-%{release}
++%description osd-classic
++classic-osd is the object storage daemon for the Ceph distributed file
+ system.  It is responsible for storing objects on a local file system
+ and providing access to them over the network.
+ 
+ %if 0%{with crimson}
+-%package crimson-osd
++%package osd-crimson
+ Summary:	Ceph Object Storage Daemon (crimson)
+ %if 0%{?suse_version}
+ Group:		System/Filesystems
+ %endif
+ Requires:	ceph-osd = %{_epoch_prefix}%{version}-%{release}
+ Requires:	binutils
+-%description crimson-osd
++Requires:	protobuf
++%description osd-crimson
+ crimson-osd is the object storage daemon for the Ceph distributed file
+ system.  It is responsible for storing objects on a local file system
+ and providing access to them over the network.
+@@ -1563,10 +1574,9 @@ rm -f %{buildroot}/%{_sysconfdir}/init.d/ceph
+ popd
+ 
+ %if 0%{with crimson}
+-# package crimson-osd with the name of ceph-osd
+-install -m 0755 %{buildroot}%{_bindir}/crimson-osd %{buildroot}%{_bindir}/ceph-osd
+-install -m 0755 %{buildroot}%{_bindir}/crimson-objectstore-tool %{buildroot}%{_bindir}/ceph-objectstore-tool
++mv %{buildroot}%{_bindir}/crimson-osd %{buildroot}%{_bindir}/ceph-osd-crimson
+ %endif
++mv %{buildroot}%{_bindir}/ceph-osd %{buildroot}%{_bindir}/ceph-osd-classic
+ 
+ install -m 0644 -D src/etc-rbdmap %{buildroot}%{_sysconfdir}/ceph/rbdmap
+ %if 0%{?fedora} || 0%{?rhel} || 0%{?openEuler}
+@@ -2286,17 +2296,12 @@ fi
+ 
+ %files osd
+ %{_bindir}/ceph-clsinfo
+-%{_bindir}/ceph-bluestore-tool
+ %{_bindir}/ceph-erasure-code-tool
+-%{_bindir}/ceph-objectstore-tool
+-%{_bindir}/ceph-osd
+ %{_libexecdir}/ceph/ceph-osd-prestart.sh
+ %{_mandir}/man8/ceph-clsinfo.8*
+ %{_mandir}/man8/ceph-osd.8*
+-%{_mandir}/man8/ceph-bluestore-tool.8*
+ %{_unitdir}/ceph-osd@.service
+ %{_unitdir}/ceph-osd.target
+-%attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/osd
+ %config(noreplace) %{_sysctldir}/90-ceph-osd.conf
+ 
+ %post osd
+@@ -2335,12 +2340,37 @@ if [ $1 -ge 1 ] ; then
+   fi
+ fi
+ 
++%files osd-classic
++%{_bindir}/ceph-bluestore-tool
++%{_bindir}/ceph-objectstore-tool
++%{_bindir}/ceph-osd-classic
++%{_mandir}/man8/ceph-bluestore-tool.8*
++%attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/osd
++
+ %if 0%{with crimson}
+-%files crimson-osd
+-%{_bindir}/crimson-osd
++%files osd-crimson
++%{_bindir}/ceph-osd-crimson
+ %{_bindir}/crimson-objectstore-tool
++
++%post osd-crimson
++%{_sbindir}/update-alternatives --install %{_bindir}/ceph-osd ceph-osd \
++    %{_bindir}/ceph-osd-crimson 50
++
++%preun osd-crimson
++if [ $1 -eq 0 ]; then
++    ${_sbindir}/update-alternatives --remove ceph-osd %{_bindir}/ceph-osd-crimson
++fi
+ %endif
+ 
++%post osd-classic
++%{_sbindir}/update-alternatives --install %{_bindir}/ceph-osd ceph-osd \
++    %{_bindir}/ceph-osd-classic 100
++
++%preun osd-classic
++if [ $1 -eq 0 ]; then
++    ${_sbindir}/update-alternatives --remove ceph-osd %{_bindir}/ceph-osd-classic
++fi
++
+ %files volume
+ %{_sbindir}/ceph-volume
+ %{_sbindir}/ceph-volume-systemd
+diff --git a/debian/ceph-osd-classic.install b/debian/ceph-osd-classic.install
+new file mode 100755
+index 00000000000..2f1f6281821
+--- /dev/null
++++ b/debian/ceph-osd-classic.install
+@@ -0,0 +1,9 @@
++#! /usr/bin/dh-exec
++
++usr/bin/ceph-bluestore-tool
++usr/bin/ceph-objectstore-tool
++usr/bin/ceph-osd => /usr/bin/ceph-osd-classic
++usr/bin/ceph_objectstore_bench
++usr/lib/libos_tp.so*
++usr/lib/libosd_tp.so*
++usr/share/man/man8/ceph-bluestore-tool.8
+diff --git a/debian/ceph-osd-classic.postinst b/debian/ceph-osd-classic.postinst
+new file mode 100644
+index 00000000000..e475e7e38ca
+--- /dev/null
++++ b/debian/ceph-osd-classic.postinst
+@@ -0,0 +1,13 @@
++#!/bin/sh
++set -e
++
++case "$1" in
++    configure)
++        update-alternatives --install /usr/bin/ceph-osd ceph-osd \
++            /usr/bin/ceph-osd-classic 100
++        ;;
++esac
++
++#DEBHELPER#
++
++exit 0
+diff --git a/debian/ceph-osd-classic.prerm b/debian/ceph-osd-classic.prerm
+new file mode 100644
+index 00000000000..1b3e65b6d70
+--- /dev/null
++++ b/debian/ceph-osd-classic.prerm
+@@ -0,0 +1,12 @@
++#!/bin/sh
++set -e
++
++case "$1" in
++    remove)
++        update-alternatives --remove ceph-osd /usr/bin/ceph-osd-classic
++        ;;
++esac
++
++#DEBHELPER#
++
++exit 0
+diff --git a/debian/ceph-osd-crimson.install b/debian/ceph-osd-crimson.install
+new file mode 100755
+index 00000000000..4c206865960
+--- /dev/null
++++ b/debian/ceph-osd-crimson.install
+@@ -0,0 +1,5 @@
++#! /usr/bin/dh-exec
++
++usr/bin/crimson-objectstore-tool
++usr/bin/crimson-osd => /usr/bin/ceph-osd-crimson
++usr/bin/crimson-store-nbd
+diff --git a/debian/ceph-osd-crimson.postinst b/debian/ceph-osd-crimson.postinst
+new file mode 100644
+index 00000000000..49fc8b3c9a6
+--- /dev/null
++++ b/debian/ceph-osd-crimson.postinst
+@@ -0,0 +1,13 @@
++#!/bin/sh
++set -e
++
++case "$1" in
++    configure)
++        update-alternatives --install /usr/bin/ceph-osd ceph-osd \
++            /usr/bin/ceph-osd-crimson 50
++        ;;
++esac
++
++#DEBHELPER#
++
++exit 0
+diff --git a/debian/ceph-osd-crimson.prerm b/debian/ceph-osd-crimson.prerm
+new file mode 100644
+index 00000000000..6acbecb375e
+--- /dev/null
++++ b/debian/ceph-osd-crimson.prerm
+@@ -0,0 +1,12 @@
++#!/bin/sh
++set -e
++
++case "$1" in
++    remove)
++        update-alternatives --remove ceph-osd /usr/bin/ceph-osd-crimson
++        ;;
++esac
++
++#DEBHELPER#
++
++exit 0
+diff --git a/debian/ceph-osd.install b/debian/ceph-osd.install
+old mode 100755
+new mode 100644
+index f45e407f4b5..19e1d5055b8
+--- a/debian/ceph-osd.install
++++ b/debian/ceph-osd.install
+@@ -1,18 +1,7 @@
+-#! /usr/bin/dh-exec
+-
+ {usr/,}lib/systemd/system/ceph-osd*
+-usr/bin/ceph-bluestore-tool
+ usr/bin/ceph-clsinfo
+ usr/bin/ceph-erasure-code-tool
+-usr/bin/ceph-objectstore-tool
+-<pkg.ceph.crimson> usr/bin/crimson-store-nbd
+-<pkg.ceph.crimson> usr/bin/crimson-objectstore-tool
+-usr/bin/${CEPH_OSD_BASENAME} => /usr/bin/ceph-osd
+-usr/bin/ceph_objectstore_bench
+ usr/libexec/ceph/ceph-osd-prestart.sh
+-usr/lib/libos_tp.so*
+-usr/lib/libosd_tp.so*
+ usr/share/man/man8/ceph-clsinfo.8
+ usr/share/man/man8/ceph-osd.8
+-usr/share/man/man8/ceph-bluestore-tool.8
+ etc/sysctl.d/30-ceph-osd.conf
+diff --git a/debian/control b/debian/control
+index 7d30e1faa70..9b4ade7e336 100644
+--- a/debian/control
++++ b/debian/control
+@@ -416,42 +416,109 @@ Description: debugging symbols for ceph-mon
+ 
+ Package: ceph-osd
+ Architecture: linux-any
+-Depends: ceph-base (= ${binary:Version}),
++Depends: ceph-osd-classic (= ${binary:Version}) | ceph-osd-crimson (= ${binary:Version}),
+          sudo,
+-         ${misc:Depends},
+          ${python3:Depends},
++         ${misc:Depends},
++         ${shlibs:Depends},
++Recommends: ceph-osd-classic (= ${binary:Version})
++Description: OSD server for the ceph storage system - shared components
++ Ceph is a massively scalable, open-source, distributed
++ storage system that runs on commodity hardware and delivers object,
++ block and file system storage.
++ .
++ This package contains components shared between classic and crimson OSD implementations.
++ It ensures a Ceph OSD implementation is installed. By default,
++ it installs the classic OSD implementation (ceph-osd-classic). Users can
++ substitute with the experimental Crimson implementation (ceph-osd-crimson)
++ for improved performance and scalability.
++
++Package: ceph-osd-dbg
++Architecture: linux-any
++Section: debug
++Priority: extra
++Depends: ceph-osd (= ${binary:Version}),
++         ${misc:Depends},
++Description: debugging symbols for ceph-osd
++ Ceph is a massively scalable, open-source, distributed
++ storage system that runs on commodity hardware and delivers object,
++ block and file system storage.
++ .
++ This package contains the debugging symbols for ceph-osd.
++
++Package: ceph-osd-classic
++Architecture: linux-any
++Depends: ceph-base (= ${binary:Version}),
++         ${misc:Depends},
+          ${shlibs:Depends},
+-         libprotobuf23 <pkg.ceph.crimson>,
+ Replaces: ceph (<< 10),
+           ceph-test (<< 12.2.2-14),
+-          ceph-osd (<< 17.0.0)
++          ceph-osd (<< 20.1.1)
+ Breaks: ceph (<< 10),
+         ceph-test (<< 12.2.2-14),
+-        ceph-osd (<< 17.0.0)
++        ceph-osd (<< 20.1.1)
+ Recommends: ceph-volume (= ${binary:Version}),
+             nvme-cli,
+             smartmontools,
+-Description: OSD server for the ceph storage system
++Description: Classic OSD server for the ceph storage system
+  Ceph is a massively scalable, open-source, distributed
+  storage system that runs on commodity hardware and delivers object,
+  block and file system storage.
+  .
+- This package contains the Object Storage Daemon for the Ceph storage system.
+- It is responsible for storing objects on a local file system
+- and providing access to them over the network.
++ This package contains the classic Object Storage Daemon and
++ classic-specific components for the Ceph storage system. It is
++ responsible for storing objects on a local file system and providing
++ access to them over the network.
+ 
+-Package: ceph-osd-dbg
++Package: ceph-osd-classic-dbg
+ Architecture: linux-any
+ Section: debug
+ Priority: extra
+-Depends: ceph-osd (= ${binary:Version}),
++Depends: ceph-osd-classic (= ${binary:Version}),
+          ${misc:Depends},
+-Description: debugging symbols for ceph-osd
++Description: debugging symbols for ceph-osd-classic
+  Ceph is a massively scalable, open-source, distributed
+  storage system that runs on commodity hardware and delivers object,
+  block and file system storage.
+  .
+- This package contains the debugging symbols for ceph-osd.
++ This package contains the debugging symbols for ceph-osd-classic.
++
++Package: ceph-osd-crimson
++Build-Profiles: <pkg.ceph.crimson>
++Architecture: any
++Depends: ceph-base (= ${binary:Version}),
++         ${misc:Depends},
++         ${shlibs:Depends},
++         libprotobuf23,
++Recommends: ceph-volume (= ${binary:Version}),
++            nvme-cli,
++            smartmontools,
++Description: Crimson OSD server for the ceph storage system
++ Ceph is a massively scalable, open-source, distributed
++ storage system that runs on commodity hardware and delivers object,
++ block and file system storage.
++ .
++ Crimson is the next generation of ceph-osd daemon featuring enhanced
++ performance on fast network and storage devices.
++ .
++ This package contains the Crimson Object Storage Daemon and
++ crimson-specific components for the Ceph storage system. It is
++ responsible for storing objects on a local file system and providing
++ access to them over the network.
++
++Package: ceph-osd-crimson-dbg
++Build-Profiles: <pkg.ceph.crimson>
++Architecture: linux-any
++Section: debug
++Priority: extra
++Depends: ceph-osd-crimson (= ${binary:Version}),
++         ${misc:Depends},
++Description: debugging symbols for ceph-osd-crimson
++ Ceph is a massively scalable, open-source, distributed
++ storage system that runs on commodity hardware and delivers object,
++ block and file system storage.
++ .
++ This package contains the debugging symbols for ceph-osd-crimson.
+ 
+ Package: ceph-volume
+ Architecture: all
+diff --git a/debian/rules b/debian/rules
+index ee4eff2bdc5..bbd2f5ed2e7 100755
+--- a/debian/rules
++++ b/debian/rules
+@@ -12,11 +12,6 @@ ifneq (,$(findstring WITH_STATIC_LIBSTDCXX,$(CEPH_EXTRA_CMAKE_ARGS)))
+   # see http://tracker.ceph.com/issues/25209
+   export DEB_LDFLAGS_MAINT_STRIP = -Wl,-Bsymbolic-functions
+ endif
+-ifeq (,$(findstring WITH_CRIMSON,$(CEPH_EXTRA_CMAKE_ARGS)))
+-  export CEPH_OSD_BASENAME = ceph-osd
+-else
+-  export CEPH_OSD_BASENAME = crimson-osd
+-endif
+ ifneq ($(filter pkg.ceph.arrow,$(DEB_BUILD_PROFILES)),)
+   extraopts += -DWITH_SYSTEM_ARROW=ON
+ endif
+-- 
+2.47.3
+
diff --git a/patches/0051-debian-ceph.spec-fix-ceph-osd-upgrade-conflicts.patch b/patches/0051-debian-ceph.spec-fix-ceph-osd-upgrade-conflicts.patch
new file mode 100644
index 00000000000..e7f29ba5dab
--- /dev/null
+++ b/patches/0051-debian-ceph.spec-fix-ceph-osd-upgrade-conflicts.patch
@@ -0,0 +1,108 @@
+From 717fc32a83c040accc0a640aed58d0d77b11ff21 Mon Sep 17 00:00:00 2001
+From: Matan Breizman <mbreizma@redhat.com>
+Date: Tue, 9 Dec 2025 09:52:08 +0000
+Subject: [PATCH 51/51] debian,ceph.spec: fix ceph-osd upgrade conflicts
+
+With https://github.com/ceph/ceph/pull/65782 merged, upgrading ceph-osd
+would need to replace the previous ceph-osd existing on the machine.
+Otherwise, we won't be able to symlink the newly installed package:
+```
+2025-12-05T21:09:20.472 INFO:teuthology.orchestra.run.smithi077.stdout:
+Installing       : ceph-osd-classic-2:20.3.0-4434.g8611241d.el9.x86_6
+24/87
+2025-12-05T21:09:20.478 INFO:teuthology.orchestra.run.smithi077.stdout:
+Running scriptlet: ceph-osd-classic-2:20.3.0-4434.g8611241d.el9.x86_6
+24/87
+2025-12-05T21:09:20.479
+INFO:teuthology.orchestra.run.smithi077.stdout:failed to link
+/usr/bin/ceph-osd -> /etc/alternatives/ceph-osd: /usr/bin/ceph-osd
+exists and it is not a symlink
+```
+
+Note: debian/control ceph-osd-classic already had Replace and Breaks:
+      - Breaks is replaced with Conflicts to not allow coexistence.
+      - Release version is bumped up to be relevant for latest main
+
+Signed-off-by: Matan Breizman <mbreizma@redhat.com>
+(cherry picked from commit 9f1c8f9447026f5ef4965a96d1aaaae7ee59dad4)
+---
+ ceph.spec.in   |  6 ++++--
+ debian/control | 12 +++++++-----
+ 2 files changed, 11 insertions(+), 7 deletions(-)
+
+diff --git a/ceph.spec.in b/ceph.spec.in
+index 00de179d417..2880899af18 100644
+--- a/ceph.spec.in
++++ b/ceph.spec.in
+@@ -930,6 +930,7 @@ Summary:	Ceph Object Storage Daemon (classic)
+ Group:		System/Filesystems
+ %endif
+ Requires:   ceph-osd = %{_epoch_prefix}%{version}-%{release}
++Obsoletes:  ceph-osd < %{_epoch_prefix}%{version}-%{release}
+ %description osd-classic
+ classic-osd is the object storage daemon for the Ceph distributed file
+ system.  It is responsible for storing objects on a local file system
+@@ -942,6 +943,7 @@ Summary:	Ceph Object Storage Daemon (crimson)
+ Group:		System/Filesystems
+ %endif
+ Requires:	ceph-osd = %{_epoch_prefix}%{version}-%{release}
++Obsoletes:	ceph-osd < %{_epoch_prefix}%{version}-%{release}
+ Requires:	binutils
+ Requires:	protobuf
+ %description osd-crimson
+@@ -2352,7 +2354,7 @@ fi
+ %{_bindir}/ceph-osd-crimson
+ %{_bindir}/crimson-objectstore-tool
+ 
+-%post osd-crimson
++%posttrans osd-crimson
+ %{_sbindir}/update-alternatives --install %{_bindir}/ceph-osd ceph-osd \
+     %{_bindir}/ceph-osd-crimson 50
+ 
+@@ -2362,7 +2364,7 @@ if [ $1 -eq 0 ]; then
+ fi
+ %endif
+ 
+-%post osd-classic
++%posttrans osd-classic
+ %{_sbindir}/update-alternatives --install %{_bindir}/ceph-osd ceph-osd \
+     %{_bindir}/ceph-osd-classic 100
+ 
+diff --git a/debian/control b/debian/control
+index 9b4ade7e336..01008f38e2c 100644
+--- a/debian/control
++++ b/debian/control
+@@ -450,16 +450,16 @@ Package: ceph-osd-classic
+ Architecture: linux-any
+ Depends: ceph-base (= ${binary:Version}),
+          ${misc:Depends},
+-         ${shlibs:Depends},
++         ${shlibs:Depends}
++Conflicts: ceph-osd (<< 20.3)
+ Replaces: ceph (<< 10),
+           ceph-test (<< 12.2.2-14),
+-          ceph-osd (<< 20.1.1)
++          ceph-osd (<< 20.3)
+ Breaks: ceph (<< 10),
+-        ceph-test (<< 12.2.2-14),
+-        ceph-osd (<< 20.1.1)
++        ceph-test (<< 12.2.2-14)
+ Recommends: ceph-volume (= ${binary:Version}),
+             nvme-cli,
+-            smartmontools,
++            smartmontools
+ Description: Classic OSD server for the ceph storage system
+  Ceph is a massively scalable, open-source, distributed
+  storage system that runs on commodity hardware and delivers object,
+@@ -493,6 +493,8 @@ Depends: ceph-base (= ${binary:Version}),
+ Recommends: ceph-volume (= ${binary:Version}),
+             nvme-cli,
+             smartmontools,
++Conflicts: ceph-osd (<< 20.3)
++Replaces:  ceph-osd (<< 20.3)
+ Description: Crimson OSD server for the ceph storage system
+  Ceph is a massively scalable, open-source, distributed
+  storage system that runs on commodity hardware and delivers object,
+-- 
+2.47.3
+
diff --git a/patches/series b/patches/series
index f2bfed1b939..2535bd0c287 100644
--- a/patches/series
+++ b/patches/series
@@ -46,4 +46,6 @@
 0046-debian-Use-system-packages-for-cephadm-bundled-depen.patch
 0047-cmake-BuildArrow-Use-AUTO-mode-for-xsimd-dependency-.patch
 0048-debian-control-Add-libxsimd-dev-build-dependency-for.patch
-  
+0049-ceph.spec.in-install-crimson-objectstore-tool.patch
+0050-debian-ceph.spec-split-ceph-osd-into-shared-base-and.patch
+0051-debian-ceph.spec-fix-ceph-osd-upgrade-conflicts.patch
-- 
2.47.3



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [pve-devel] [PATCH ceph 2/3 v2] cherry-pick changes to buiild crimson package
  2026-01-22  8:29 ` [pve-devel] [PATCH ceph] cherry-pick changes to buiild crimson package Kefu Chai
@ 2026-01-22 10:14   ` Kefu Chai
  2026-01-22 10:14   ` [pve-devel] [PATCH ceph 3/3] make: build with pkg.ceph.crimson build profile Kefu Chai
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Kefu Chai @ 2026-01-22 10:14 UTC (permalink / raw)
  To: pve-devel

Backport changes to enable building both classic and crimson OSD packages
from the same source tree while maintaining upgrade compatibility.

Previously, crimson could only be built with the ceph.pkg.crimson profile,
which replaced the classic OSD entirely since both components shared the
same executable name. This made it impossible to provide both variants
simultaneously.

These changes introduce separate packages for classic and crimson OSD
components:
- ceph-osd-classic: Traditional OSD implementation
- ceph-osd-crimson: New crimson OSD implementation
- ceph-osd: Meta-package that depends on ceph-osd-classic by default

Users can switch between implementations using update-alternatives.

Rationale for downstream backport:
While these changes introduce breaking changes and were not backported to
the tentacle branch upstream, we are backporting them to allow users to
experiment with crimson. The package structure ensures safe upgrades:
existing installations automatically get ceph-osd-classic through the
ceph-osd dependency, preventing system breakage.

Backported PRs:
- https://github.com/ceph/ceph/pull/65782: Split ceph-osd into shared
  base and implementation packages
- https://github.com/ceph/ceph/pull/66568: Fix ceph-osd upgrade
  conflicts in debian/ceph.spec

Signed-off-by: Kefu Chai <k.chai@proxmox.com>
---
 ....in-install-crimson-objectstore-tool.patch |  49 ++
 ...-split-ceph-osd-into-shared-base-and.patch | 464 ++++++++++++++++++
 ...ble-WITH_CRIMSON-when-pkg.ceph.crims.patch |  46 ++
 ....spec-fix-ceph-osd-upgrade-conflicts.patch | 108 ++++
 patches/series                                |   5 +-
 5 files changed, 671 insertions(+), 1 deletion(-)
 create mode 100644 patches/0049-ceph.spec.in-install-crimson-objectstore-tool.patch
 create mode 100644 patches/0050-debian-ceph.spec-split-ceph-osd-into-shared-base-and.patch
 create mode 100644 patches/0051-debian-rules-enable-WITH_CRIMSON-when-pkg.ceph.crims.patch
 create mode 100644 patches/0052-debian-ceph.spec-fix-ceph-osd-upgrade-conflicts.patch

diff --git a/patches/0049-ceph.spec.in-install-crimson-objectstore-tool.patch b/patches/0049-ceph.spec.in-install-crimson-objectstore-tool.patch
new file mode 100644
index 00000000000..8ce412f6ac2
--- /dev/null
+++ b/patches/0049-ceph.spec.in-install-crimson-objectstore-tool.patch
@@ -0,0 +1,49 @@
+From 152537074b2725d86c14744670925d55ea845d3d Mon Sep 17 00:00:00 2001
+From: Matan Breizman <mbreizma@redhat.com>
+Date: Wed, 23 Jul 2025 13:17:51 +0000
+Subject: [PATCH 49/52] ceph.spec.in: install crimson-objectstore-tool
+
+Include the tool when packaging for deb/rpm.
+
+Signed-off-by: Matan Breizman <mbreizma@redhat.com>
+(cherry picked from commit 47a15af8ddbf2276e1bbf4b68c88114d003357b1)
+---
+ ceph.spec.in            | 2 ++
+ debian/ceph-osd.install | 1 +
+ 2 files changed, 3 insertions(+)
+
+diff --git a/ceph.spec.in b/ceph.spec.in
+index 226fe72192b..659dbade0dc 100644
+--- a/ceph.spec.in
++++ b/ceph.spec.in
+@@ -1565,6 +1565,7 @@ popd
+ %if 0%{with crimson}
+ # package crimson-osd with the name of ceph-osd
+ install -m 0755 %{buildroot}%{_bindir}/crimson-osd %{buildroot}%{_bindir}/ceph-osd
++install -m 0755 %{buildroot}%{_bindir}/crimson-objectstore-tool %{buildroot}%{_bindir}/ceph-objectstore-tool
+ %endif
+ 
+ install -m 0644 -D src/etc-rbdmap %{buildroot}%{_sysconfdir}/ceph/rbdmap
+@@ -2337,6 +2338,7 @@ fi
+ %if 0%{with crimson}
+ %files crimson-osd
+ %{_bindir}/crimson-osd
++%{_bindir}/crimson-objectstore-tool
+ %endif
+ 
+ %files volume
+diff --git a/debian/ceph-osd.install b/debian/ceph-osd.install
+index 217c9bea719..f45e407f4b5 100755
+--- a/debian/ceph-osd.install
++++ b/debian/ceph-osd.install
+@@ -6,6 +6,7 @@ usr/bin/ceph-clsinfo
+ usr/bin/ceph-erasure-code-tool
+ usr/bin/ceph-objectstore-tool
+ <pkg.ceph.crimson> usr/bin/crimson-store-nbd
++<pkg.ceph.crimson> usr/bin/crimson-objectstore-tool
+ usr/bin/${CEPH_OSD_BASENAME} => /usr/bin/ceph-osd
+ usr/bin/ceph_objectstore_bench
+ usr/libexec/ceph/ceph-osd-prestart.sh
+-- 
+2.47.3
+
diff --git a/patches/0050-debian-ceph.spec-split-ceph-osd-into-shared-base-and.patch b/patches/0050-debian-ceph.spec-split-ceph-osd-into-shared-base-and.patch
new file mode 100644
index 00000000000..2a858961de9
--- /dev/null
+++ b/patches/0050-debian-ceph.spec-split-ceph-osd-into-shared-base-and.patch
@@ -0,0 +1,464 @@
+From 3fcd25c26a9b6c6438a72bed98e577ed9749a65c Mon Sep 17 00:00:00 2001
+From: Kefu Chai <k.chai@proxmox.com>
+Date: Tue, 30 Sep 2025 21:04:46 +0800
+Subject: [PATCH 50/52] debian,ceph.spec: split ceph-osd into shared base and
+ implementation packages
+
+Previously, ceph-osd packaging had two mutually exclusive flavors that
+could only be built one at a time: one with classic OSD and another
+with crimson OSD. Both provided /usr/bin/ceph-osd, making them
+impossible to coexist and confusing from a user perspective.
+This commit restructures the packaging to enable both implementations
+to coexist on the same system:
+
+- ceph-osd: Contains shared components (systemd units, sysctl configs,
+  common executables like ceph-erasure-code-tool) and depends on exactly
+  one OSD implementation
+- ceph-osd-classic: Contains the classic OSD implementation binary and
+  classic-specific tools
+- ceph-osd-crimson: Contains the crimson OSD implementation binary and
+  crimson-specific tools
+
+The two implementation packages install different sets of file, so they
+don't conflict with each other anymore, and both depend on ceph-osd for
+shared resources.
+
+Changes:
+
+Debian packaging:
+
+- Revert e5f00d2f
+- Add ceph-osd-crimson package
+- Add Recommends: ceph-osd-classic to prefer classic on upgrades
+- Add Replaces/Breaks for smooth upgrades from old monolithic package
+- Create separate .install files for crimson and classic osd packages
+  Enforce exact version matching using ${binary:Version}
+
+RPM packaging:
+
+- Use rich dependencies for OR requirement (classic or crimson)
+- Add Recommends: ceph-osd-classic for upgrade preference
+
+Upgrade behavior:
+
+Users upgrading from older versions will automatically get
+ceph-osd-classic due to the Recommends directive, maintaining
+backward compatibility. Users can explicitly choose crimson by
+installing ceph-osd-crimson, which will coexist with classic.
+Switching between implementations is supported via standard package
+operations, with the alternatives system ensuring /usr/bin/ceph-osd
+always points to the active implementation.
+
+Signed-off-by: Kefu Chai <k.chai@proxmox.com>
+(cherry picked from commit a37b5b5bde8c2e8d6890f16b31046119ed55f25d)
+---
+ ceph.spec.in                     | 60 +++++++++++++++------
+ debian/ceph-osd-classic.install  |  9 ++++
+ debian/ceph-osd-classic.postinst | 13 +++++
+ debian/ceph-osd-classic.prerm    | 12 +++++
+ debian/ceph-osd-crimson.install  |  5 ++
+ debian/ceph-osd-crimson.postinst | 13 +++++
+ debian/ceph-osd-crimson.prerm    | 12 +++++
+ debian/ceph-osd.install          | 11 ----
+ debian/control                   | 93 +++++++++++++++++++++++++++-----
+ debian/rules                     |  5 --
+ 10 files changed, 189 insertions(+), 44 deletions(-)
+ create mode 100755 debian/ceph-osd-classic.install
+ create mode 100644 debian/ceph-osd-classic.postinst
+ create mode 100644 debian/ceph-osd-classic.prerm
+ create mode 100755 debian/ceph-osd-crimson.install
+ create mode 100644 debian/ceph-osd-crimson.postinst
+ create mode 100644 debian/ceph-osd-crimson.prerm
+ mode change 100755 => 100644 debian/ceph-osd.install
+
+diff --git a/ceph.spec.in b/ceph.spec.in
+index 659dbade0dc..00de179d417 100644
+--- a/ceph.spec.in
++++ b/ceph.spec.in
+@@ -912,28 +912,39 @@ Summary:	Ceph Object Storage Daemon
+ Group:		System/Filesystems
+ %endif
+ Requires:	ceph-base = %{_epoch_prefix}%{version}-%{release}
++Requires:	(ceph-osd-classic = %{_epoch_prefix}%{version}-%{release} or ceph-osd-crimson = %{_epoch_prefix}%{version}-%{release})
+ Requires:	sudo
+ Requires:	libstoragemgmt
+-%if 0%{with crimson}
+-Requires:	protobuf
+-%endif
+ %if 0%{?weak_deps}
+ Recommends:	ceph-volume = %{_epoch_prefix}%{version}-%{release}
+ %endif
+ %description osd
+ ceph-osd is the object storage daemon for the Ceph distributed file
++system.  It provides components shared between classic and crimson OSD
++implementations. It requires either the classic or crimson OSD
++to provide the core OSD daemon.
++
++%package osd-classic
++Summary:	Ceph Object Storage Daemon (classic)
++%if 0%{?suse_version}
++Group:		System/Filesystems
++%endif
++Requires:   ceph-osd = %{_epoch_prefix}%{version}-%{release}
++%description osd-classic
++classic-osd is the object storage daemon for the Ceph distributed file
+ system.  It is responsible for storing objects on a local file system
+ and providing access to them over the network.
+ 
+ %if 0%{with crimson}
+-%package crimson-osd
++%package osd-crimson
+ Summary:	Ceph Object Storage Daemon (crimson)
+ %if 0%{?suse_version}
+ Group:		System/Filesystems
+ %endif
+ Requires:	ceph-osd = %{_epoch_prefix}%{version}-%{release}
+ Requires:	binutils
+-%description crimson-osd
++Requires:	protobuf
++%description osd-crimson
+ crimson-osd is the object storage daemon for the Ceph distributed file
+ system.  It is responsible for storing objects on a local file system
+ and providing access to them over the network.
+@@ -1563,10 +1574,9 @@ rm -f %{buildroot}/%{_sysconfdir}/init.d/ceph
+ popd
+ 
+ %if 0%{with crimson}
+-# package crimson-osd with the name of ceph-osd
+-install -m 0755 %{buildroot}%{_bindir}/crimson-osd %{buildroot}%{_bindir}/ceph-osd
+-install -m 0755 %{buildroot}%{_bindir}/crimson-objectstore-tool %{buildroot}%{_bindir}/ceph-objectstore-tool
++mv %{buildroot}%{_bindir}/crimson-osd %{buildroot}%{_bindir}/ceph-osd-crimson
+ %endif
++mv %{buildroot}%{_bindir}/ceph-osd %{buildroot}%{_bindir}/ceph-osd-classic
+ 
+ install -m 0644 -D src/etc-rbdmap %{buildroot}%{_sysconfdir}/ceph/rbdmap
+ %if 0%{?fedora} || 0%{?rhel} || 0%{?openEuler}
+@@ -2286,17 +2296,12 @@ fi
+ 
+ %files osd
+ %{_bindir}/ceph-clsinfo
+-%{_bindir}/ceph-bluestore-tool
+ %{_bindir}/ceph-erasure-code-tool
+-%{_bindir}/ceph-objectstore-tool
+-%{_bindir}/ceph-osd
+ %{_libexecdir}/ceph/ceph-osd-prestart.sh
+ %{_mandir}/man8/ceph-clsinfo.8*
+ %{_mandir}/man8/ceph-osd.8*
+-%{_mandir}/man8/ceph-bluestore-tool.8*
+ %{_unitdir}/ceph-osd@.service
+ %{_unitdir}/ceph-osd.target
+-%attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/osd
+ %config(noreplace) %{_sysctldir}/90-ceph-osd.conf
+ 
+ %post osd
+@@ -2335,12 +2340,37 @@ if [ $1 -ge 1 ] ; then
+   fi
+ fi
+ 
++%files osd-classic
++%{_bindir}/ceph-bluestore-tool
++%{_bindir}/ceph-objectstore-tool
++%{_bindir}/ceph-osd-classic
++%{_mandir}/man8/ceph-bluestore-tool.8*
++%attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/osd
++
+ %if 0%{with crimson}
+-%files crimson-osd
+-%{_bindir}/crimson-osd
++%files osd-crimson
++%{_bindir}/ceph-osd-crimson
+ %{_bindir}/crimson-objectstore-tool
++
++%post osd-crimson
++%{_sbindir}/update-alternatives --install %{_bindir}/ceph-osd ceph-osd \
++    %{_bindir}/ceph-osd-crimson 50
++
++%preun osd-crimson
++if [ $1 -eq 0 ]; then
++    ${_sbindir}/update-alternatives --remove ceph-osd %{_bindir}/ceph-osd-crimson
++fi
+ %endif
+ 
++%post osd-classic
++%{_sbindir}/update-alternatives --install %{_bindir}/ceph-osd ceph-osd \
++    %{_bindir}/ceph-osd-classic 100
++
++%preun osd-classic
++if [ $1 -eq 0 ]; then
++    ${_sbindir}/update-alternatives --remove ceph-osd %{_bindir}/ceph-osd-classic
++fi
++
+ %files volume
+ %{_sbindir}/ceph-volume
+ %{_sbindir}/ceph-volume-systemd
+diff --git a/debian/ceph-osd-classic.install b/debian/ceph-osd-classic.install
+new file mode 100755
+index 00000000000..2f1f6281821
+--- /dev/null
++++ b/debian/ceph-osd-classic.install
+@@ -0,0 +1,9 @@
++#! /usr/bin/dh-exec
++
++usr/bin/ceph-bluestore-tool
++usr/bin/ceph-objectstore-tool
++usr/bin/ceph-osd => /usr/bin/ceph-osd-classic
++usr/bin/ceph_objectstore_bench
++usr/lib/libos_tp.so*
++usr/lib/libosd_tp.so*
++usr/share/man/man8/ceph-bluestore-tool.8
+diff --git a/debian/ceph-osd-classic.postinst b/debian/ceph-osd-classic.postinst
+new file mode 100644
+index 00000000000..e475e7e38ca
+--- /dev/null
++++ b/debian/ceph-osd-classic.postinst
+@@ -0,0 +1,13 @@
++#!/bin/sh
++set -e
++
++case "$1" in
++    configure)
++        update-alternatives --install /usr/bin/ceph-osd ceph-osd \
++            /usr/bin/ceph-osd-classic 100
++        ;;
++esac
++
++#DEBHELPER#
++
++exit 0
+diff --git a/debian/ceph-osd-classic.prerm b/debian/ceph-osd-classic.prerm
+new file mode 100644
+index 00000000000..1b3e65b6d70
+--- /dev/null
++++ b/debian/ceph-osd-classic.prerm
+@@ -0,0 +1,12 @@
++#!/bin/sh
++set -e
++
++case "$1" in
++    remove)
++        update-alternatives --remove ceph-osd /usr/bin/ceph-osd-classic
++        ;;
++esac
++
++#DEBHELPER#
++
++exit 0
+diff --git a/debian/ceph-osd-crimson.install b/debian/ceph-osd-crimson.install
+new file mode 100755
+index 00000000000..4c206865960
+--- /dev/null
++++ b/debian/ceph-osd-crimson.install
+@@ -0,0 +1,5 @@
++#! /usr/bin/dh-exec
++
++usr/bin/crimson-objectstore-tool
++usr/bin/crimson-osd => /usr/bin/ceph-osd-crimson
++usr/bin/crimson-store-nbd
+diff --git a/debian/ceph-osd-crimson.postinst b/debian/ceph-osd-crimson.postinst
+new file mode 100644
+index 00000000000..49fc8b3c9a6
+--- /dev/null
++++ b/debian/ceph-osd-crimson.postinst
+@@ -0,0 +1,13 @@
++#!/bin/sh
++set -e
++
++case "$1" in
++    configure)
++        update-alternatives --install /usr/bin/ceph-osd ceph-osd \
++            /usr/bin/ceph-osd-crimson 50
++        ;;
++esac
++
++#DEBHELPER#
++
++exit 0
+diff --git a/debian/ceph-osd-crimson.prerm b/debian/ceph-osd-crimson.prerm
+new file mode 100644
+index 00000000000..6acbecb375e
+--- /dev/null
++++ b/debian/ceph-osd-crimson.prerm
+@@ -0,0 +1,12 @@
++#!/bin/sh
++set -e
++
++case "$1" in
++    remove)
++        update-alternatives --remove ceph-osd /usr/bin/ceph-osd-crimson
++        ;;
++esac
++
++#DEBHELPER#
++
++exit 0
+diff --git a/debian/ceph-osd.install b/debian/ceph-osd.install
+old mode 100755
+new mode 100644
+index f45e407f4b5..19e1d5055b8
+--- a/debian/ceph-osd.install
++++ b/debian/ceph-osd.install
+@@ -1,18 +1,7 @@
+-#! /usr/bin/dh-exec
+-
+ {usr/,}lib/systemd/system/ceph-osd*
+-usr/bin/ceph-bluestore-tool
+ usr/bin/ceph-clsinfo
+ usr/bin/ceph-erasure-code-tool
+-usr/bin/ceph-objectstore-tool
+-<pkg.ceph.crimson> usr/bin/crimson-store-nbd
+-<pkg.ceph.crimson> usr/bin/crimson-objectstore-tool
+-usr/bin/${CEPH_OSD_BASENAME} => /usr/bin/ceph-osd
+-usr/bin/ceph_objectstore_bench
+ usr/libexec/ceph/ceph-osd-prestart.sh
+-usr/lib/libos_tp.so*
+-usr/lib/libosd_tp.so*
+ usr/share/man/man8/ceph-clsinfo.8
+ usr/share/man/man8/ceph-osd.8
+-usr/share/man/man8/ceph-bluestore-tool.8
+ etc/sysctl.d/30-ceph-osd.conf
+diff --git a/debian/control b/debian/control
+index 7d30e1faa70..9b4ade7e336 100644
+--- a/debian/control
++++ b/debian/control
+@@ -416,42 +416,109 @@ Description: debugging symbols for ceph-mon
+ 
+ Package: ceph-osd
+ Architecture: linux-any
+-Depends: ceph-base (= ${binary:Version}),
++Depends: ceph-osd-classic (= ${binary:Version}) | ceph-osd-crimson (= ${binary:Version}),
+          sudo,
+-         ${misc:Depends},
+          ${python3:Depends},
++         ${misc:Depends},
++         ${shlibs:Depends},
++Recommends: ceph-osd-classic (= ${binary:Version})
++Description: OSD server for the ceph storage system - shared components
++ Ceph is a massively scalable, open-source, distributed
++ storage system that runs on commodity hardware and delivers object,
++ block and file system storage.
++ .
++ This package contains components shared between classic and crimson OSD implementations.
++ It ensures a Ceph OSD implementation is installed. By default,
++ it installs the classic OSD implementation (ceph-osd-classic). Users can
++ substitute with the experimental Crimson implementation (ceph-osd-crimson)
++ for improved performance and scalability.
++
++Package: ceph-osd-dbg
++Architecture: linux-any
++Section: debug
++Priority: extra
++Depends: ceph-osd (= ${binary:Version}),
++         ${misc:Depends},
++Description: debugging symbols for ceph-osd
++ Ceph is a massively scalable, open-source, distributed
++ storage system that runs on commodity hardware and delivers object,
++ block and file system storage.
++ .
++ This package contains the debugging symbols for ceph-osd.
++
++Package: ceph-osd-classic
++Architecture: linux-any
++Depends: ceph-base (= ${binary:Version}),
++         ${misc:Depends},
+          ${shlibs:Depends},
+-         libprotobuf23 <pkg.ceph.crimson>,
+ Replaces: ceph (<< 10),
+           ceph-test (<< 12.2.2-14),
+-          ceph-osd (<< 17.0.0)
++          ceph-osd (<< 20.1.1)
+ Breaks: ceph (<< 10),
+         ceph-test (<< 12.2.2-14),
+-        ceph-osd (<< 17.0.0)
++        ceph-osd (<< 20.1.1)
+ Recommends: ceph-volume (= ${binary:Version}),
+             nvme-cli,
+             smartmontools,
+-Description: OSD server for the ceph storage system
++Description: Classic OSD server for the ceph storage system
+  Ceph is a massively scalable, open-source, distributed
+  storage system that runs on commodity hardware and delivers object,
+  block and file system storage.
+  .
+- This package contains the Object Storage Daemon for the Ceph storage system.
+- It is responsible for storing objects on a local file system
+- and providing access to them over the network.
++ This package contains the classic Object Storage Daemon and
++ classic-specific components for the Ceph storage system. It is
++ responsible for storing objects on a local file system and providing
++ access to them over the network.
+ 
+-Package: ceph-osd-dbg
++Package: ceph-osd-classic-dbg
+ Architecture: linux-any
+ Section: debug
+ Priority: extra
+-Depends: ceph-osd (= ${binary:Version}),
++Depends: ceph-osd-classic (= ${binary:Version}),
+          ${misc:Depends},
+-Description: debugging symbols for ceph-osd
++Description: debugging symbols for ceph-osd-classic
+  Ceph is a massively scalable, open-source, distributed
+  storage system that runs on commodity hardware and delivers object,
+  block and file system storage.
+  .
+- This package contains the debugging symbols for ceph-osd.
++ This package contains the debugging symbols for ceph-osd-classic.
++
++Package: ceph-osd-crimson
++Build-Profiles: <pkg.ceph.crimson>
++Architecture: any
++Depends: ceph-base (= ${binary:Version}),
++         ${misc:Depends},
++         ${shlibs:Depends},
++         libprotobuf23,
++Recommends: ceph-volume (= ${binary:Version}),
++            nvme-cli,
++            smartmontools,
++Description: Crimson OSD server for the ceph storage system
++ Ceph is a massively scalable, open-source, distributed
++ storage system that runs on commodity hardware and delivers object,
++ block and file system storage.
++ .
++ Crimson is the next generation of ceph-osd daemon featuring enhanced
++ performance on fast network and storage devices.
++ .
++ This package contains the Crimson Object Storage Daemon and
++ crimson-specific components for the Ceph storage system. It is
++ responsible for storing objects on a local file system and providing
++ access to them over the network.
++
++Package: ceph-osd-crimson-dbg
++Build-Profiles: <pkg.ceph.crimson>
++Architecture: linux-any
++Section: debug
++Priority: extra
++Depends: ceph-osd-crimson (= ${binary:Version}),
++         ${misc:Depends},
++Description: debugging symbols for ceph-osd-crimson
++ Ceph is a massively scalable, open-source, distributed
++ storage system that runs on commodity hardware and delivers object,
++ block and file system storage.
++ .
++ This package contains the debugging symbols for ceph-osd-crimson.
+ 
+ Package: ceph-volume
+ Architecture: all
+diff --git a/debian/rules b/debian/rules
+index ee4eff2bdc5..bbd2f5ed2e7 100755
+--- a/debian/rules
++++ b/debian/rules
+@@ -12,11 +12,6 @@ ifneq (,$(findstring WITH_STATIC_LIBSTDCXX,$(CEPH_EXTRA_CMAKE_ARGS)))
+   # see http://tracker.ceph.com/issues/25209
+   export DEB_LDFLAGS_MAINT_STRIP = -Wl,-Bsymbolic-functions
+ endif
+-ifeq (,$(findstring WITH_CRIMSON,$(CEPH_EXTRA_CMAKE_ARGS)))
+-  export CEPH_OSD_BASENAME = ceph-osd
+-else
+-  export CEPH_OSD_BASENAME = crimson-osd
+-endif
+ ifneq ($(filter pkg.ceph.arrow,$(DEB_BUILD_PROFILES)),)
+   extraopts += -DWITH_SYSTEM_ARROW=ON
+ endif
+-- 
+2.47.3
+
diff --git a/patches/0051-debian-rules-enable-WITH_CRIMSON-when-pkg.ceph.crims.patch b/patches/0051-debian-rules-enable-WITH_CRIMSON-when-pkg.ceph.crims.patch
new file mode 100644
index 00000000000..98fd272d367
--- /dev/null
+++ b/patches/0051-debian-rules-enable-WITH_CRIMSON-when-pkg.ceph.crims.patch
@@ -0,0 +1,46 @@
+From 505b28d84f504e58c40d65ee7d403f77626507a0 Mon Sep 17 00:00:00 2001
+From: Kefu Chai <k.chai@proxmox.com>
+Date: Sat, 18 Oct 2025 22:23:56 +0800
+Subject: [PATCH 51/52] debian/rules: enable WITH_CRIMSON when pkg.ceph.crimson
+ profile is set
+
+Since commit 9b1d524839 ("debian: mark "crimson" specific deps with
+"pkg.ceph.crimson""), crimson-specific build dependencies have been
+gated by the Build-Profiles: <pkg.ceph.crimson> tag. However,
+debian/rules was never updated to pass -DWITH_CRIMSON=ON when this
+build profile is active.
+
+This causes builds with the crimson profile enabled to fail during
+dh_install, as the crimson-osd binary is never built but the install
+file tries to package it:
+
+  Failed to copy 'usr/bin/crimson-osd': No such file or directory
+  dh_install: error: debian/ceph-crimson-osd.install returned exit code 127
+
+Fix this by checking for pkg.ceph.crimson in DEB_BUILD_PROFILES and
+enabling the CMake option accordingly, following the same pattern used
+for pkg.ceph.arrow.
+
+Signed-off-by: Kefu Chai <k.chai@proxmox.com>
+(cherry picked from commit ceb3272fdae035d2a7376c423c69e5770f8e2fb1)
+---
+ debian/rules | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/debian/rules b/debian/rules
+index bbd2f5ed2e7..4d31ffd069f 100755
+--- a/debian/rules
++++ b/debian/rules
+@@ -15,6 +15,9 @@ endif
+ ifneq ($(filter pkg.ceph.arrow,$(DEB_BUILD_PROFILES)),)
+   extraopts += -DWITH_SYSTEM_ARROW=ON
+ endif
++ifneq ($(filter pkg.ceph.crimson,$(DEB_BUILD_PROFILES)),)
++  extraopts += -DWITH_CRIMSON=ON
++endif
+ 
+ extraopts += -DWITH_JAEGER=ON
+ extraopts += -DWITH_SYSTEM_UTF8PROC=ON
+-- 
+2.47.3
+
diff --git a/patches/0052-debian-ceph.spec-fix-ceph-osd-upgrade-conflicts.patch b/patches/0052-debian-ceph.spec-fix-ceph-osd-upgrade-conflicts.patch
new file mode 100644
index 00000000000..bd854f9e08b
--- /dev/null
+++ b/patches/0052-debian-ceph.spec-fix-ceph-osd-upgrade-conflicts.patch
@@ -0,0 +1,108 @@
+From 164c74b6d1cdb0017d3a4d043d402c7dbffb417b Mon Sep 17 00:00:00 2001
+From: Matan Breizman <mbreizma@redhat.com>
+Date: Tue, 9 Dec 2025 09:52:08 +0000
+Subject: [PATCH 52/52] debian,ceph.spec: fix ceph-osd upgrade conflicts
+
+With https://github.com/ceph/ceph/pull/65782 merged, upgrading ceph-osd
+would need to replace the previous ceph-osd existing on the machine.
+Otherwise, we won't be able to symlink the newly installed package:
+```
+2025-12-05T21:09:20.472 INFO:teuthology.orchestra.run.smithi077.stdout:
+Installing       : ceph-osd-classic-2:20.3.0-4434.g8611241d.el9.x86_6
+24/87
+2025-12-05T21:09:20.478 INFO:teuthology.orchestra.run.smithi077.stdout:
+Running scriptlet: ceph-osd-classic-2:20.3.0-4434.g8611241d.el9.x86_6
+24/87
+2025-12-05T21:09:20.479
+INFO:teuthology.orchestra.run.smithi077.stdout:failed to link
+/usr/bin/ceph-osd -> /etc/alternatives/ceph-osd: /usr/bin/ceph-osd
+exists and it is not a symlink
+```
+
+Note: debian/control ceph-osd-classic already had Replace and Breaks:
+      - Breaks is replaced with Conflicts to not allow coexistence.
+      - Release version is bumped up to be relevant for latest main
+
+Signed-off-by: Matan Breizman <mbreizma@redhat.com>
+(cherry picked from commit 9f1c8f9447026f5ef4965a96d1aaaae7ee59dad4)
+---
+ ceph.spec.in   |  6 ++++--
+ debian/control | 12 +++++++-----
+ 2 files changed, 11 insertions(+), 7 deletions(-)
+
+diff --git a/ceph.spec.in b/ceph.spec.in
+index 00de179d417..2880899af18 100644
+--- a/ceph.spec.in
++++ b/ceph.spec.in
+@@ -930,6 +930,7 @@ Summary:	Ceph Object Storage Daemon (classic)
+ Group:		System/Filesystems
+ %endif
+ Requires:   ceph-osd = %{_epoch_prefix}%{version}-%{release}
++Obsoletes:  ceph-osd < %{_epoch_prefix}%{version}-%{release}
+ %description osd-classic
+ classic-osd is the object storage daemon for the Ceph distributed file
+ system.  It is responsible for storing objects on a local file system
+@@ -942,6 +943,7 @@ Summary:	Ceph Object Storage Daemon (crimson)
+ Group:		System/Filesystems
+ %endif
+ Requires:	ceph-osd = %{_epoch_prefix}%{version}-%{release}
++Obsoletes:	ceph-osd < %{_epoch_prefix}%{version}-%{release}
+ Requires:	binutils
+ Requires:	protobuf
+ %description osd-crimson
+@@ -2352,7 +2354,7 @@ fi
+ %{_bindir}/ceph-osd-crimson
+ %{_bindir}/crimson-objectstore-tool
+ 
+-%post osd-crimson
++%posttrans osd-crimson
+ %{_sbindir}/update-alternatives --install %{_bindir}/ceph-osd ceph-osd \
+     %{_bindir}/ceph-osd-crimson 50
+ 
+@@ -2362,7 +2364,7 @@ if [ $1 -eq 0 ]; then
+ fi
+ %endif
+ 
+-%post osd-classic
++%posttrans osd-classic
+ %{_sbindir}/update-alternatives --install %{_bindir}/ceph-osd ceph-osd \
+     %{_bindir}/ceph-osd-classic 100
+ 
+diff --git a/debian/control b/debian/control
+index 9b4ade7e336..01008f38e2c 100644
+--- a/debian/control
++++ b/debian/control
+@@ -450,16 +450,16 @@ Package: ceph-osd-classic
+ Architecture: linux-any
+ Depends: ceph-base (= ${binary:Version}),
+          ${misc:Depends},
+-         ${shlibs:Depends},
++         ${shlibs:Depends}
++Conflicts: ceph-osd (<< 20.3)
+ Replaces: ceph (<< 10),
+           ceph-test (<< 12.2.2-14),
+-          ceph-osd (<< 20.1.1)
++          ceph-osd (<< 20.3)
+ Breaks: ceph (<< 10),
+-        ceph-test (<< 12.2.2-14),
+-        ceph-osd (<< 20.1.1)
++        ceph-test (<< 12.2.2-14)
+ Recommends: ceph-volume (= ${binary:Version}),
+             nvme-cli,
+-            smartmontools,
++            smartmontools
+ Description: Classic OSD server for the ceph storage system
+  Ceph is a massively scalable, open-source, distributed
+  storage system that runs on commodity hardware and delivers object,
+@@ -493,6 +493,8 @@ Depends: ceph-base (= ${binary:Version}),
+ Recommends: ceph-volume (= ${binary:Version}),
+             nvme-cli,
+             smartmontools,
++Conflicts: ceph-osd (<< 20.3)
++Replaces:  ceph-osd (<< 20.3)
+ Description: Crimson OSD server for the ceph storage system
+  Ceph is a massively scalable, open-source, distributed
+  storage system that runs on commodity hardware and delivers object,
+-- 
+2.47.3
+
diff --git a/patches/series b/patches/series
index f2bfed1b939..5ba4192b1db 100644
--- a/patches/series
+++ b/patches/series
@@ -46,4 +46,7 @@
 0046-debian-Use-system-packages-for-cephadm-bundled-depen.patch
 0047-cmake-BuildArrow-Use-AUTO-mode-for-xsimd-dependency-.patch
 0048-debian-control-Add-libxsimd-dev-build-dependency-for.patch
-  
+0049-ceph.spec.in-install-crimson-objectstore-tool.patch
+0050-debian-ceph.spec-split-ceph-osd-into-shared-base-and.patch
+0051-debian-rules-enable-WITH_CRIMSON-when-pkg.ceph.crims.patch
+0052-debian-ceph.spec-fix-ceph-osd-upgrade-conflicts.patch
-- 
2.47.3



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [pve-devel] [PATCH ceph 3/3] make: build with pkg.ceph.crimson build profile
  2026-01-22  8:29 ` [pve-devel] [PATCH ceph] cherry-pick changes to buiild crimson package Kefu Chai
  2026-01-22 10:14   ` [pve-devel] [PATCH ceph 2/3 v2] " Kefu Chai
@ 2026-01-22 10:14   ` Kefu Chai
  2026-01-22 10:56   ` [pve-devel] [PATCH ceph 2/3 v3] cherry-pick changes to build crimson package Kefu Chai
  2026-01-22 11:43   ` [pve-devel] [PATCH ceph 2/3 v4] " Kefu Chai
  3 siblings, 0 replies; 6+ messages in thread
From: Kefu Chai @ 2026-01-22 10:14 UTC (permalink / raw)
  To: pve-devel

Enable the pkg.ceph.crimson build profile to build Crimson OSD packages.
While the previous commit added patches for Crimson support, the build
profile must be explicitly activated to generate the ceph-osd-crimson
package.

Additionally, add ceph-osd-classic and ceph-osd-crimson to DEBS_REST
and DBG_DEBS so they are included in the default "all" Makefile target.

Signed-off-by: Kefu Chai <k.chai@proxmox.com>
---
 Makefile | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 3e9749bd65f..671d84a9419 100644
--- a/Makefile
+++ b/Makefile
@@ -17,6 +17,8 @@ ceph-mds-dbg_${PKGVER}_${ARCH}.deb \
 ceph-mgr-dbg_${PKGVER}_${ARCH}.deb \
 ceph-mon-dbg_${PKGVER}_${ARCH}.deb \
 ceph-osd-dbg_${PKGVER}_${ARCH}.deb \
+ceph-osd-classic-dbg_${PKGVER}_${ARCH}.deb \
+ceph-osd-crimson-dbg_${PKGVER}_${ARCH}.deb \
 ceph-test-dbg_${PKGVER}_${ARCH}.deb \
 libcephfs2-dbg_${PKGVER}_${ARCH}.deb \
 librados2-dbg_${PKGVER}_${ARCH}.deb \
@@ -36,6 +38,8 @@ ceph-mds_${PKGVER}_${ARCH}.deb \
 ceph-mgr_${PKGVER}_${ARCH}.deb \
 ceph-mon_${PKGVER}_${ARCH}.deb \
 ceph-osd_${PKGVER}_${ARCH}.deb \
+ceph-osd-classic_${PKGVER}_${ARCH}.deb \
+ceph-osd-crimson_${PKGVER}_${ARCH}.deb \
 ceph-resource-agents_${PKGVER}_${ARCH}.deb \
 ceph-test_${PKGVER}_${ARCH}.deb \
 libcephfs2_${PKGVER}_${ARCH}.deb \
@@ -90,7 +94,7 @@ ${BUILDSRC}: ${SRCDIR} patches
 deb: ${DEBS} ${DBG_DEBS}
 ${DEBS_REST} ${DBG_DEBS}: $(MAIN_DEB)
 $(MAIN_DEB): ${BUILDSRC}
-	cd ${BUILDSRC}; dpkg-buildpackage -b -uc -us
+	cd ${BUILDSRC}; dpkg-buildpackage -b -uc -us -Ppkg.ceph.crimson
 	lintian ${DEBS}
 	@echo ${DEBS}
 
-- 
2.47.3



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [pve-devel] [PATCH ceph 2/3 v3] cherry-pick changes to build crimson package
  2026-01-22  8:29 ` [pve-devel] [PATCH ceph] cherry-pick changes to buiild crimson package Kefu Chai
  2026-01-22 10:14   ` [pve-devel] [PATCH ceph 2/3 v2] " Kefu Chai
  2026-01-22 10:14   ` [pve-devel] [PATCH ceph 3/3] make: build with pkg.ceph.crimson build profile Kefu Chai
@ 2026-01-22 10:56   ` Kefu Chai
  2026-01-22 11:43   ` [pve-devel] [PATCH ceph 2/3 v4] " Kefu Chai
  3 siblings, 0 replies; 6+ messages in thread
From: Kefu Chai @ 2026-01-22 10:56 UTC (permalink / raw)
  To: pve-devel

Backport changes to enable building both classic and crimson OSD packages
from the same source tree while maintaining upgrade compatibility.

Previously, crimson could only be built with the ceph.pkg.crimson profile,
which replaced the classic OSD entirely since both components shared the
same executable name. This made it impossible to provide both variants
simultaneously.

These changes introduce separate packages for classic and crimson OSD
components:
- ceph-osd-classic: Traditional OSD implementation
- ceph-osd-crimson: New crimson OSD implementation
- ceph-osd: Meta-package that depends on ceph-osd-classic by default

Users can switch between implementations using update-alternatives.

Rationale for downstream backport:
While these changes introduce breaking changes and were not backported to
the tentacle branch upstream, we are backporting them to allow users to
experiment with crimson. The package structure ensures safe upgrades:
existing installations automatically get ceph-osd-classic through the
ceph-osd dependency, preventing system breakage.

Backported PRs:
- https://github.com/ceph/ceph/pull/65782: Split ceph-osd into shared
  base and implementation packages
- https://github.com/ceph/ceph/pull/66568: Fix ceph-osd upgrade
  conflicts in debian/ceph.spec

crimson-objectstore-tool was dropped from from ceph-osd-crimson package
when backport the related change. As this tool was not backported to
upstream's tentacle branch.

Signed-off-by: Kefu Chai <k.chai@proxmox.com>
---
 ...-split-ceph-osd-into-shared-base-and.patch | 460 ++++++++++++++++++
 ...ble-WITH_CRIMSON-when-pkg.ceph.crims.patch |  46 ++
 ....spec-fix-ceph-osd-upgrade-conflicts.patch | 108 ++++
 patches/series                                |   4 +-
 4 files changed, 617 insertions(+), 1 deletion(-)
 create mode 100644 patches/0049-debian-ceph.spec-split-ceph-osd-into-shared-base-and.patch
 create mode 100644 patches/0050-debian-rules-enable-WITH_CRIMSON-when-pkg.ceph.crims.patch
 create mode 100644 patches/0051-debian-ceph.spec-fix-ceph-osd-upgrade-conflicts.patch

diff --git a/patches/0049-debian-ceph.spec-split-ceph-osd-into-shared-base-and.patch b/patches/0049-debian-ceph.spec-split-ceph-osd-into-shared-base-and.patch
new file mode 100644
index 00000000000..838f02dbced
--- /dev/null
+++ b/patches/0049-debian-ceph.spec-split-ceph-osd-into-shared-base-and.patch
@@ -0,0 +1,460 @@
+From 69888b0f6575b41fca2509e1399c2642664d8e47 Mon Sep 17 00:00:00 2001
+From: Kefu Chai <k.chai@proxmox.com>
+Date: Tue, 30 Sep 2025 21:04:46 +0800
+Subject: [PATCH 49/51] debian,ceph.spec: split ceph-osd into shared base and
+ implementation packages
+
+Previously, ceph-osd packaging had two mutually exclusive flavors that
+could only be built one at a time: one with classic OSD and another
+with crimson OSD. Both provided /usr/bin/ceph-osd, making them
+impossible to coexist and confusing from a user perspective.
+This commit restructures the packaging to enable both implementations
+to coexist on the same system:
+
+- ceph-osd: Contains shared components (systemd units, sysctl configs,
+  common executables like ceph-erasure-code-tool) and depends on exactly
+  one OSD implementation
+- ceph-osd-classic: Contains the classic OSD implementation binary and
+  classic-specific tools
+- ceph-osd-crimson: Contains the crimson OSD implementation binary and
+  crimson-specific tools
+
+The two implementation packages install different sets of file, so they
+don't conflict with each other anymore, and both depend on ceph-osd for
+shared resources.
+
+Changes:
+
+Debian packaging:
+
+- Revert e5f00d2f
+- Add ceph-osd-crimson package
+- Add Recommends: ceph-osd-classic to prefer classic on upgrades
+- Add Replaces/Breaks for smooth upgrades from old monolithic package
+- Create separate .install files for crimson and classic osd packages
+  Enforce exact version matching using ${binary:Version}
+
+RPM packaging:
+
+- Use rich dependencies for OR requirement (classic or crimson)
+- Add Recommends: ceph-osd-classic for upgrade preference
+
+Upgrade behavior:
+
+Users upgrading from older versions will automatically get
+ceph-osd-classic due to the Recommends directive, maintaining
+backward compatibility. Users can explicitly choose crimson by
+installing ceph-osd-crimson, which will coexist with classic.
+Switching between implementations is supported via standard package
+operations, with the alternatives system ensuring /usr/bin/ceph-osd
+always points to the active implementation.
+
+Signed-off-by: Kefu Chai <k.chai@proxmox.com>
+(cherry picked from commit a37b5b5bde8c2e8d6890f16b31046119ed55f25d)
+---
+ ceph.spec.in                     | 59 +++++++++++++++-----
+ debian/ceph-osd-classic.install  |  9 ++++
+ debian/ceph-osd-classic.postinst | 13 +++++
+ debian/ceph-osd-classic.prerm    | 12 +++++
+ debian/ceph-osd-crimson.install  |  4 ++
+ debian/ceph-osd-crimson.postinst | 13 +++++
+ debian/ceph-osd-crimson.prerm    | 12 +++++
+ debian/ceph-osd.install          | 10 ----
+ debian/control                   | 93 +++++++++++++++++++++++++++-----
+ debian/rules                     |  5 --
+ 10 files changed, 188 insertions(+), 42 deletions(-)
+ create mode 100755 debian/ceph-osd-classic.install
+ create mode 100644 debian/ceph-osd-classic.postinst
+ create mode 100644 debian/ceph-osd-classic.prerm
+ create mode 100755 debian/ceph-osd-crimson.install
+ create mode 100644 debian/ceph-osd-crimson.postinst
+ create mode 100644 debian/ceph-osd-crimson.prerm
+ mode change 100755 => 100644 debian/ceph-osd.install
+
+diff --git a/ceph.spec.in b/ceph.spec.in
+index 226fe72192b..e3fc7ff6952 100644
+--- a/ceph.spec.in
++++ b/ceph.spec.in
+@@ -912,28 +912,39 @@ Summary:	Ceph Object Storage Daemon
+ Group:		System/Filesystems
+ %endif
+ Requires:	ceph-base = %{_epoch_prefix}%{version}-%{release}
++Requires:	(ceph-osd-classic = %{_epoch_prefix}%{version}-%{release} or ceph-osd-crimson = %{_epoch_prefix}%{version}-%{release})
+ Requires:	sudo
+ Requires:	libstoragemgmt
+-%if 0%{with crimson}
+-Requires:	protobuf
+-%endif
+ %if 0%{?weak_deps}
+ Recommends:	ceph-volume = %{_epoch_prefix}%{version}-%{release}
+ %endif
+ %description osd
+ ceph-osd is the object storage daemon for the Ceph distributed file
++system.  It provides components shared between classic and crimson OSD
++implementations. It requires either the classic or crimson OSD
++to provide the core OSD daemon.
++
++%package osd-classic
++Summary:	Ceph Object Storage Daemon (classic)
++%if 0%{?suse_version}
++Group:		System/Filesystems
++%endif
++Requires:   ceph-osd = %{_epoch_prefix}%{version}-%{release}
++%description osd-classic
++classic-osd is the object storage daemon for the Ceph distributed file
+ system.  It is responsible for storing objects on a local file system
+ and providing access to them over the network.
+ 
+ %if 0%{with crimson}
+-%package crimson-osd
++%package osd-crimson
+ Summary:	Ceph Object Storage Daemon (crimson)
+ %if 0%{?suse_version}
+ Group:		System/Filesystems
+ %endif
+ Requires:	ceph-osd = %{_epoch_prefix}%{version}-%{release}
+ Requires:	binutils
+-%description crimson-osd
++Requires:	protobuf
++%description osd-crimson
+ crimson-osd is the object storage daemon for the Ceph distributed file
+ system.  It is responsible for storing objects on a local file system
+ and providing access to them over the network.
+@@ -1563,9 +1574,9 @@ rm -f %{buildroot}/%{_sysconfdir}/init.d/ceph
+ popd
+ 
+ %if 0%{with crimson}
+-# package crimson-osd with the name of ceph-osd
+-install -m 0755 %{buildroot}%{_bindir}/crimson-osd %{buildroot}%{_bindir}/ceph-osd
++mv %{buildroot}%{_bindir}/crimson-osd %{buildroot}%{_bindir}/ceph-osd-crimson
+ %endif
++mv %{buildroot}%{_bindir}/ceph-osd %{buildroot}%{_bindir}/ceph-osd-classic
+ 
+ install -m 0644 -D src/etc-rbdmap %{buildroot}%{_sysconfdir}/ceph/rbdmap
+ %if 0%{?fedora} || 0%{?rhel} || 0%{?openEuler}
+@@ -2285,17 +2296,12 @@ fi
+ 
+ %files osd
+ %{_bindir}/ceph-clsinfo
+-%{_bindir}/ceph-bluestore-tool
+ %{_bindir}/ceph-erasure-code-tool
+-%{_bindir}/ceph-objectstore-tool
+-%{_bindir}/ceph-osd
+ %{_libexecdir}/ceph/ceph-osd-prestart.sh
+ %{_mandir}/man8/ceph-clsinfo.8*
+ %{_mandir}/man8/ceph-osd.8*
+-%{_mandir}/man8/ceph-bluestore-tool.8*
+ %{_unitdir}/ceph-osd@.service
+ %{_unitdir}/ceph-osd.target
+-%attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/osd
+ %config(noreplace) %{_sysctldir}/90-ceph-osd.conf
+ 
+ %post osd
+@@ -2334,11 +2340,36 @@ if [ $1 -ge 1 ] ; then
+   fi
+ fi
+ 
++%files osd-classic
++%{_bindir}/ceph-bluestore-tool
++%{_bindir}/ceph-objectstore-tool
++%{_bindir}/ceph-osd-classic
++%{_mandir}/man8/ceph-bluestore-tool.8*
++%attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/osd
++
+ %if 0%{with crimson}
+-%files crimson-osd
+-%{_bindir}/crimson-osd
++%files osd-crimson
++%{_bindir}/ceph-osd-crimson
++
++%post osd-crimson
++%{_sbindir}/update-alternatives --install %{_bindir}/ceph-osd ceph-osd \
++    %{_bindir}/ceph-osd-crimson 50
++
++%preun osd-crimson
++if [ $1 -eq 0 ]; then
++    ${_sbindir}/update-alternatives --remove ceph-osd %{_bindir}/ceph-osd-crimson
++fi
+ %endif
+ 
++%post osd-classic
++%{_sbindir}/update-alternatives --install %{_bindir}/ceph-osd ceph-osd \
++    %{_bindir}/ceph-osd-classic 100
++
++%preun osd-classic
++if [ $1 -eq 0 ]; then
++    ${_sbindir}/update-alternatives --remove ceph-osd %{_bindir}/ceph-osd-classic
++fi
++
+ %files volume
+ %{_sbindir}/ceph-volume
+ %{_sbindir}/ceph-volume-systemd
+diff --git a/debian/ceph-osd-classic.install b/debian/ceph-osd-classic.install
+new file mode 100755
+index 00000000000..2f1f6281821
+--- /dev/null
++++ b/debian/ceph-osd-classic.install
+@@ -0,0 +1,9 @@
++#! /usr/bin/dh-exec
++
++usr/bin/ceph-bluestore-tool
++usr/bin/ceph-objectstore-tool
++usr/bin/ceph-osd => /usr/bin/ceph-osd-classic
++usr/bin/ceph_objectstore_bench
++usr/lib/libos_tp.so*
++usr/lib/libosd_tp.so*
++usr/share/man/man8/ceph-bluestore-tool.8
+diff --git a/debian/ceph-osd-classic.postinst b/debian/ceph-osd-classic.postinst
+new file mode 100644
+index 00000000000..e475e7e38ca
+--- /dev/null
++++ b/debian/ceph-osd-classic.postinst
+@@ -0,0 +1,13 @@
++#!/bin/sh
++set -e
++
++case "$1" in
++    configure)
++        update-alternatives --install /usr/bin/ceph-osd ceph-osd \
++            /usr/bin/ceph-osd-classic 100
++        ;;
++esac
++
++#DEBHELPER#
++
++exit 0
+diff --git a/debian/ceph-osd-classic.prerm b/debian/ceph-osd-classic.prerm
+new file mode 100644
+index 00000000000..1b3e65b6d70
+--- /dev/null
++++ b/debian/ceph-osd-classic.prerm
+@@ -0,0 +1,12 @@
++#!/bin/sh
++set -e
++
++case "$1" in
++    remove)
++        update-alternatives --remove ceph-osd /usr/bin/ceph-osd-classic
++        ;;
++esac
++
++#DEBHELPER#
++
++exit 0
+diff --git a/debian/ceph-osd-crimson.install b/debian/ceph-osd-crimson.install
+new file mode 100755
+index 00000000000..6f3b4b75770
+--- /dev/null
++++ b/debian/ceph-osd-crimson.install
+@@ -0,0 +1,4 @@
++#! /usr/bin/dh-exec
++
++usr/bin/crimson-osd => /usr/bin/ceph-osd-crimson
++usr/bin/crimson-store-nbd
+diff --git a/debian/ceph-osd-crimson.postinst b/debian/ceph-osd-crimson.postinst
+new file mode 100644
+index 00000000000..49fc8b3c9a6
+--- /dev/null
++++ b/debian/ceph-osd-crimson.postinst
+@@ -0,0 +1,13 @@
++#!/bin/sh
++set -e
++
++case "$1" in
++    configure)
++        update-alternatives --install /usr/bin/ceph-osd ceph-osd \
++            /usr/bin/ceph-osd-crimson 50
++        ;;
++esac
++
++#DEBHELPER#
++
++exit 0
+diff --git a/debian/ceph-osd-crimson.prerm b/debian/ceph-osd-crimson.prerm
+new file mode 100644
+index 00000000000..6acbecb375e
+--- /dev/null
++++ b/debian/ceph-osd-crimson.prerm
+@@ -0,0 +1,12 @@
++#!/bin/sh
++set -e
++
++case "$1" in
++    remove)
++        update-alternatives --remove ceph-osd /usr/bin/ceph-osd-crimson
++        ;;
++esac
++
++#DEBHELPER#
++
++exit 0
+diff --git a/debian/ceph-osd.install b/debian/ceph-osd.install
+old mode 100755
+new mode 100644
+index 217c9bea719..19e1d5055b8
+--- a/debian/ceph-osd.install
++++ b/debian/ceph-osd.install
+@@ -1,17 +1,7 @@
+-#! /usr/bin/dh-exec
+-
+ {usr/,}lib/systemd/system/ceph-osd*
+-usr/bin/ceph-bluestore-tool
+ usr/bin/ceph-clsinfo
+ usr/bin/ceph-erasure-code-tool
+-usr/bin/ceph-objectstore-tool
+-<pkg.ceph.crimson> usr/bin/crimson-store-nbd
+-usr/bin/${CEPH_OSD_BASENAME} => /usr/bin/ceph-osd
+-usr/bin/ceph_objectstore_bench
+ usr/libexec/ceph/ceph-osd-prestart.sh
+-usr/lib/libos_tp.so*
+-usr/lib/libosd_tp.so*
+ usr/share/man/man8/ceph-clsinfo.8
+ usr/share/man/man8/ceph-osd.8
+-usr/share/man/man8/ceph-bluestore-tool.8
+ etc/sysctl.d/30-ceph-osd.conf
+diff --git a/debian/control b/debian/control
+index 7d30e1faa70..9b4ade7e336 100644
+--- a/debian/control
++++ b/debian/control
+@@ -416,42 +416,109 @@ Description: debugging symbols for ceph-mon
+ 
+ Package: ceph-osd
+ Architecture: linux-any
+-Depends: ceph-base (= ${binary:Version}),
++Depends: ceph-osd-classic (= ${binary:Version}) | ceph-osd-crimson (= ${binary:Version}),
+          sudo,
+-         ${misc:Depends},
+          ${python3:Depends},
++         ${misc:Depends},
++         ${shlibs:Depends},
++Recommends: ceph-osd-classic (= ${binary:Version})
++Description: OSD server for the ceph storage system - shared components
++ Ceph is a massively scalable, open-source, distributed
++ storage system that runs on commodity hardware and delivers object,
++ block and file system storage.
++ .
++ This package contains components shared between classic and crimson OSD implementations.
++ It ensures a Ceph OSD implementation is installed. By default,
++ it installs the classic OSD implementation (ceph-osd-classic). Users can
++ substitute with the experimental Crimson implementation (ceph-osd-crimson)
++ for improved performance and scalability.
++
++Package: ceph-osd-dbg
++Architecture: linux-any
++Section: debug
++Priority: extra
++Depends: ceph-osd (= ${binary:Version}),
++         ${misc:Depends},
++Description: debugging symbols for ceph-osd
++ Ceph is a massively scalable, open-source, distributed
++ storage system that runs on commodity hardware and delivers object,
++ block and file system storage.
++ .
++ This package contains the debugging symbols for ceph-osd.
++
++Package: ceph-osd-classic
++Architecture: linux-any
++Depends: ceph-base (= ${binary:Version}),
++         ${misc:Depends},
+          ${shlibs:Depends},
+-         libprotobuf23 <pkg.ceph.crimson>,
+ Replaces: ceph (<< 10),
+           ceph-test (<< 12.2.2-14),
+-          ceph-osd (<< 17.0.0)
++          ceph-osd (<< 20.1.1)
+ Breaks: ceph (<< 10),
+         ceph-test (<< 12.2.2-14),
+-        ceph-osd (<< 17.0.0)
++        ceph-osd (<< 20.1.1)
+ Recommends: ceph-volume (= ${binary:Version}),
+             nvme-cli,
+             smartmontools,
+-Description: OSD server for the ceph storage system
++Description: Classic OSD server for the ceph storage system
+  Ceph is a massively scalable, open-source, distributed
+  storage system that runs on commodity hardware and delivers object,
+  block and file system storage.
+  .
+- This package contains the Object Storage Daemon for the Ceph storage system.
+- It is responsible for storing objects on a local file system
+- and providing access to them over the network.
++ This package contains the classic Object Storage Daemon and
++ classic-specific components for the Ceph storage system. It is
++ responsible for storing objects on a local file system and providing
++ access to them over the network.
+ 
+-Package: ceph-osd-dbg
++Package: ceph-osd-classic-dbg
+ Architecture: linux-any
+ Section: debug
+ Priority: extra
+-Depends: ceph-osd (= ${binary:Version}),
++Depends: ceph-osd-classic (= ${binary:Version}),
+          ${misc:Depends},
+-Description: debugging symbols for ceph-osd
++Description: debugging symbols for ceph-osd-classic
+  Ceph is a massively scalable, open-source, distributed
+  storage system that runs on commodity hardware and delivers object,
+  block and file system storage.
+  .
+- This package contains the debugging symbols for ceph-osd.
++ This package contains the debugging symbols for ceph-osd-classic.
++
++Package: ceph-osd-crimson
++Build-Profiles: <pkg.ceph.crimson>
++Architecture: any
++Depends: ceph-base (= ${binary:Version}),
++         ${misc:Depends},
++         ${shlibs:Depends},
++         libprotobuf23,
++Recommends: ceph-volume (= ${binary:Version}),
++            nvme-cli,
++            smartmontools,
++Description: Crimson OSD server for the ceph storage system
++ Ceph is a massively scalable, open-source, distributed
++ storage system that runs on commodity hardware and delivers object,
++ block and file system storage.
++ .
++ Crimson is the next generation of ceph-osd daemon featuring enhanced
++ performance on fast network and storage devices.
++ .
++ This package contains the Crimson Object Storage Daemon and
++ crimson-specific components for the Ceph storage system. It is
++ responsible for storing objects on a local file system and providing
++ access to them over the network.
++
++Package: ceph-osd-crimson-dbg
++Build-Profiles: <pkg.ceph.crimson>
++Architecture: linux-any
++Section: debug
++Priority: extra
++Depends: ceph-osd-crimson (= ${binary:Version}),
++         ${misc:Depends},
++Description: debugging symbols for ceph-osd-crimson
++ Ceph is a massively scalable, open-source, distributed
++ storage system that runs on commodity hardware and delivers object,
++ block and file system storage.
++ .
++ This package contains the debugging symbols for ceph-osd-crimson.
+ 
+ Package: ceph-volume
+ Architecture: all
+diff --git a/debian/rules b/debian/rules
+index ee4eff2bdc5..bbd2f5ed2e7 100755
+--- a/debian/rules
++++ b/debian/rules
+@@ -12,11 +12,6 @@ ifneq (,$(findstring WITH_STATIC_LIBSTDCXX,$(CEPH_EXTRA_CMAKE_ARGS)))
+   # see http://tracker.ceph.com/issues/25209
+   export DEB_LDFLAGS_MAINT_STRIP = -Wl,-Bsymbolic-functions
+ endif
+-ifeq (,$(findstring WITH_CRIMSON,$(CEPH_EXTRA_CMAKE_ARGS)))
+-  export CEPH_OSD_BASENAME = ceph-osd
+-else
+-  export CEPH_OSD_BASENAME = crimson-osd
+-endif
+ ifneq ($(filter pkg.ceph.arrow,$(DEB_BUILD_PROFILES)),)
+   extraopts += -DWITH_SYSTEM_ARROW=ON
+ endif
+-- 
+2.47.3
+
diff --git a/patches/0050-debian-rules-enable-WITH_CRIMSON-when-pkg.ceph.crims.patch b/patches/0050-debian-rules-enable-WITH_CRIMSON-when-pkg.ceph.crims.patch
new file mode 100644
index 00000000000..72641bc96f0
--- /dev/null
+++ b/patches/0050-debian-rules-enable-WITH_CRIMSON-when-pkg.ceph.crims.patch
@@ -0,0 +1,46 @@
+From c39545c5464a84b705b2c765bed2ac198f7d5959 Mon Sep 17 00:00:00 2001
+From: Kefu Chai <k.chai@proxmox.com>
+Date: Sat, 18 Oct 2025 22:23:56 +0800
+Subject: [PATCH 50/51] debian/rules: enable WITH_CRIMSON when pkg.ceph.crimson
+ profile is set
+
+Since commit 9b1d524839 ("debian: mark "crimson" specific deps with
+"pkg.ceph.crimson""), crimson-specific build dependencies have been
+gated by the Build-Profiles: <pkg.ceph.crimson> tag. However,
+debian/rules was never updated to pass -DWITH_CRIMSON=ON when this
+build profile is active.
+
+This causes builds with the crimson profile enabled to fail during
+dh_install, as the crimson-osd binary is never built but the install
+file tries to package it:
+
+  Failed to copy 'usr/bin/crimson-osd': No such file or directory
+  dh_install: error: debian/ceph-crimson-osd.install returned exit code 127
+
+Fix this by checking for pkg.ceph.crimson in DEB_BUILD_PROFILES and
+enabling the CMake option accordingly, following the same pattern used
+for pkg.ceph.arrow.
+
+Signed-off-by: Kefu Chai <k.chai@proxmox.com>
+(cherry picked from commit ceb3272fdae035d2a7376c423c69e5770f8e2fb1)
+---
+ debian/rules | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/debian/rules b/debian/rules
+index bbd2f5ed2e7..4d31ffd069f 100755
+--- a/debian/rules
++++ b/debian/rules
+@@ -15,6 +15,9 @@ endif
+ ifneq ($(filter pkg.ceph.arrow,$(DEB_BUILD_PROFILES)),)
+   extraopts += -DWITH_SYSTEM_ARROW=ON
+ endif
++ifneq ($(filter pkg.ceph.crimson,$(DEB_BUILD_PROFILES)),)
++  extraopts += -DWITH_CRIMSON=ON
++endif
+ 
+ extraopts += -DWITH_JAEGER=ON
+ extraopts += -DWITH_SYSTEM_UTF8PROC=ON
+-- 
+2.47.3
+
diff --git a/patches/0051-debian-ceph.spec-fix-ceph-osd-upgrade-conflicts.patch b/patches/0051-debian-ceph.spec-fix-ceph-osd-upgrade-conflicts.patch
new file mode 100644
index 00000000000..c553f7554db
--- /dev/null
+++ b/patches/0051-debian-ceph.spec-fix-ceph-osd-upgrade-conflicts.patch
@@ -0,0 +1,108 @@
+From 9da967184da17dbcddb86befddbe7d084f3f66be Mon Sep 17 00:00:00 2001
+From: Matan Breizman <mbreizma@redhat.com>
+Date: Tue, 9 Dec 2025 09:52:08 +0000
+Subject: [PATCH 51/51] debian,ceph.spec: fix ceph-osd upgrade conflicts
+
+With https://github.com/ceph/ceph/pull/65782 merged, upgrading ceph-osd
+would need to replace the previous ceph-osd existing on the machine.
+Otherwise, we won't be able to symlink the newly installed package:
+```
+2025-12-05T21:09:20.472 INFO:teuthology.orchestra.run.smithi077.stdout:
+Installing       : ceph-osd-classic-2:20.3.0-4434.g8611241d.el9.x86_6
+24/87
+2025-12-05T21:09:20.478 INFO:teuthology.orchestra.run.smithi077.stdout:
+Running scriptlet: ceph-osd-classic-2:20.3.0-4434.g8611241d.el9.x86_6
+24/87
+2025-12-05T21:09:20.479
+INFO:teuthology.orchestra.run.smithi077.stdout:failed to link
+/usr/bin/ceph-osd -> /etc/alternatives/ceph-osd: /usr/bin/ceph-osd
+exists and it is not a symlink
+```
+
+Note: debian/control ceph-osd-classic already had Replace and Breaks:
+      - Breaks is replaced with Conflicts to not allow coexistence.
+      - Release version is bumped up to be relevant for latest main
+
+Signed-off-by: Matan Breizman <mbreizma@redhat.com>
+(cherry picked from commit 9f1c8f9447026f5ef4965a96d1aaaae7ee59dad4)
+---
+ ceph.spec.in   |  6 ++++--
+ debian/control | 12 +++++++-----
+ 2 files changed, 11 insertions(+), 7 deletions(-)
+
+diff --git a/ceph.spec.in b/ceph.spec.in
+index e3fc7ff6952..6ae79fbb1b3 100644
+--- a/ceph.spec.in
++++ b/ceph.spec.in
+@@ -930,6 +930,7 @@ Summary:	Ceph Object Storage Daemon (classic)
+ Group:		System/Filesystems
+ %endif
+ Requires:   ceph-osd = %{_epoch_prefix}%{version}-%{release}
++Obsoletes:  ceph-osd < %{_epoch_prefix}%{version}-%{release}
+ %description osd-classic
+ classic-osd is the object storage daemon for the Ceph distributed file
+ system.  It is responsible for storing objects on a local file system
+@@ -942,6 +943,7 @@ Summary:	Ceph Object Storage Daemon (crimson)
+ Group:		System/Filesystems
+ %endif
+ Requires:	ceph-osd = %{_epoch_prefix}%{version}-%{release}
++Obsoletes:	ceph-osd < %{_epoch_prefix}%{version}-%{release}
+ Requires:	binutils
+ Requires:	protobuf
+ %description osd-crimson
+@@ -2351,7 +2353,7 @@ fi
+ %files osd-crimson
+ %{_bindir}/ceph-osd-crimson
+ 
+-%post osd-crimson
++%posttrans osd-crimson
+ %{_sbindir}/update-alternatives --install %{_bindir}/ceph-osd ceph-osd \
+     %{_bindir}/ceph-osd-crimson 50
+ 
+@@ -2361,7 +2363,7 @@ if [ $1 -eq 0 ]; then
+ fi
+ %endif
+ 
+-%post osd-classic
++%posttrans osd-classic
+ %{_sbindir}/update-alternatives --install %{_bindir}/ceph-osd ceph-osd \
+     %{_bindir}/ceph-osd-classic 100
+ 
+diff --git a/debian/control b/debian/control
+index 9b4ade7e336..01008f38e2c 100644
+--- a/debian/control
++++ b/debian/control
+@@ -450,16 +450,16 @@ Package: ceph-osd-classic
+ Architecture: linux-any
+ Depends: ceph-base (= ${binary:Version}),
+          ${misc:Depends},
+-         ${shlibs:Depends},
++         ${shlibs:Depends}
++Conflicts: ceph-osd (<< 20.3)
+ Replaces: ceph (<< 10),
+           ceph-test (<< 12.2.2-14),
+-          ceph-osd (<< 20.1.1)
++          ceph-osd (<< 20.3)
+ Breaks: ceph (<< 10),
+-        ceph-test (<< 12.2.2-14),
+-        ceph-osd (<< 20.1.1)
++        ceph-test (<< 12.2.2-14)
+ Recommends: ceph-volume (= ${binary:Version}),
+             nvme-cli,
+-            smartmontools,
++            smartmontools
+ Description: Classic OSD server for the ceph storage system
+  Ceph is a massively scalable, open-source, distributed
+  storage system that runs on commodity hardware and delivers object,
+@@ -493,6 +493,8 @@ Depends: ceph-base (= ${binary:Version}),
+ Recommends: ceph-volume (= ${binary:Version}),
+             nvme-cli,
+             smartmontools,
++Conflicts: ceph-osd (<< 20.3)
++Replaces:  ceph-osd (<< 20.3)
+ Description: Crimson OSD server for the ceph storage system
+  Ceph is a massively scalable, open-source, distributed
+  storage system that runs on commodity hardware and delivers object,
+-- 
+2.47.3
+
diff --git a/patches/series b/patches/series
index f2bfed1b939..fb9ac6031fa 100644
--- a/patches/series
+++ b/patches/series
@@ -46,4 +46,6 @@
 0046-debian-Use-system-packages-for-cephadm-bundled-depen.patch
 0047-cmake-BuildArrow-Use-AUTO-mode-for-xsimd-dependency-.patch
 0048-debian-control-Add-libxsimd-dev-build-dependency-for.patch
-  
+0049-debian-ceph.spec-split-ceph-osd-into-shared-base-and.patch
+0050-debian-rules-enable-WITH_CRIMSON-when-pkg.ceph.crims.patch
+0051-debian-ceph.spec-fix-ceph-osd-upgrade-conflicts.patch
-- 
2.47.3



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [pve-devel] [PATCH ceph 2/3 v4] cherry-pick changes to build crimson package
  2026-01-22  8:29 ` [pve-devel] [PATCH ceph] cherry-pick changes to buiild crimson package Kefu Chai
                     ` (2 preceding siblings ...)
  2026-01-22 10:56   ` [pve-devel] [PATCH ceph 2/3 v3] cherry-pick changes to build crimson package Kefu Chai
@ 2026-01-22 11:43   ` Kefu Chai
  3 siblings, 0 replies; 6+ messages in thread
From: Kefu Chai @ 2026-01-22 11:43 UTC (permalink / raw)
  To: pve-devel

Backport changes to enable building both classic and crimson OSD packages
from the same source tree while maintaining upgrade compatibility.

Previously, crimson could only be built with the ceph.pkg.crimson profile,
which replaced the classic OSD entirely since both components shared the
same executable name. This made it impossible to provide both variants
simultaneously.

These changes introduce separate packages for classic and crimson OSD
components:
- ceph-osd-classic: Traditional OSD implementation
- ceph-osd-crimson: New crimson OSD implementation
- ceph-osd: Meta-package that depends on ceph-osd-classic by default

Users can switch between implementations using update-alternatives.

Rationale for downstream backport:
While these changes introduce breaking changes and were not backported to
the tentacle branch upstream, we are backporting them to allow users to
experiment with crimson. The package structure ensures safe upgrades:
existing installations automatically get ceph-osd-classic through the
ceph-osd dependency, preventing system breakage.

Backported PRs:
- https://github.com/ceph/ceph/pull/65782: Split ceph-osd into shared
  base and implementation packages
- https://github.com/ceph/ceph/pull/66568: Fix ceph-osd upgrade
  conflicts in debian/ceph.spec
https://github.com/ceph/ceph/pull/66682: build static seastar for
  release builds

crimson-objectstore-tool was dropped from from ceph-osd-crimson package
when backport the related change. As this tool was not backported to
upstream's tentacle branch.

Signed-off-by: Kefu Chai <k.chai@proxmox.com>
---
 ...-split-ceph-osd-into-shared-base-and.patch | 460 ++++++++++++++++++
 ...ble-WITH_CRIMSON-when-pkg.ceph.crims.patch |  46 ++
 ....spec-fix-ceph-osd-upgrade-conflicts.patch | 108 ++++
 ...ld-static-seastar-for-release-builds.patch |  71 +++
 patches/series                                |   5 +-
 5 files changed, 689 insertions(+), 1 deletion(-)
 create mode 100644 patches/0049-debian-ceph.spec-split-ceph-osd-into-shared-base-and.patch
 create mode 100644 patches/0050-debian-rules-enable-WITH_CRIMSON-when-pkg.ceph.crims.patch
 create mode 100644 patches/0051-debian-ceph.spec-fix-ceph-osd-upgrade-conflicts.patch
 create mode 100644 patches/0052-cmake-build-static-seastar-for-release-builds.patch

diff --git a/patches/0049-debian-ceph.spec-split-ceph-osd-into-shared-base-and.patch b/patches/0049-debian-ceph.spec-split-ceph-osd-into-shared-base-and.patch
new file mode 100644
index 00000000000..838f02dbced
--- /dev/null
+++ b/patches/0049-debian-ceph.spec-split-ceph-osd-into-shared-base-and.patch
@@ -0,0 +1,460 @@
+From 69888b0f6575b41fca2509e1399c2642664d8e47 Mon Sep 17 00:00:00 2001
+From: Kefu Chai <k.chai@proxmox.com>
+Date: Tue, 30 Sep 2025 21:04:46 +0800
+Subject: [PATCH 49/51] debian,ceph.spec: split ceph-osd into shared base and
+ implementation packages
+
+Previously, ceph-osd packaging had two mutually exclusive flavors that
+could only be built one at a time: one with classic OSD and another
+with crimson OSD. Both provided /usr/bin/ceph-osd, making them
+impossible to coexist and confusing from a user perspective.
+This commit restructures the packaging to enable both implementations
+to coexist on the same system:
+
+- ceph-osd: Contains shared components (systemd units, sysctl configs,
+  common executables like ceph-erasure-code-tool) and depends on exactly
+  one OSD implementation
+- ceph-osd-classic: Contains the classic OSD implementation binary and
+  classic-specific tools
+- ceph-osd-crimson: Contains the crimson OSD implementation binary and
+  crimson-specific tools
+
+The two implementation packages install different sets of file, so they
+don't conflict with each other anymore, and both depend on ceph-osd for
+shared resources.
+
+Changes:
+
+Debian packaging:
+
+- Revert e5f00d2f
+- Add ceph-osd-crimson package
+- Add Recommends: ceph-osd-classic to prefer classic on upgrades
+- Add Replaces/Breaks for smooth upgrades from old monolithic package
+- Create separate .install files for crimson and classic osd packages
+  Enforce exact version matching using ${binary:Version}
+
+RPM packaging:
+
+- Use rich dependencies for OR requirement (classic or crimson)
+- Add Recommends: ceph-osd-classic for upgrade preference
+
+Upgrade behavior:
+
+Users upgrading from older versions will automatically get
+ceph-osd-classic due to the Recommends directive, maintaining
+backward compatibility. Users can explicitly choose crimson by
+installing ceph-osd-crimson, which will coexist with classic.
+Switching between implementations is supported via standard package
+operations, with the alternatives system ensuring /usr/bin/ceph-osd
+always points to the active implementation.
+
+Signed-off-by: Kefu Chai <k.chai@proxmox.com>
+(cherry picked from commit a37b5b5bde8c2e8d6890f16b31046119ed55f25d)
+---
+ ceph.spec.in                     | 59 +++++++++++++++-----
+ debian/ceph-osd-classic.install  |  9 ++++
+ debian/ceph-osd-classic.postinst | 13 +++++
+ debian/ceph-osd-classic.prerm    | 12 +++++
+ debian/ceph-osd-crimson.install  |  4 ++
+ debian/ceph-osd-crimson.postinst | 13 +++++
+ debian/ceph-osd-crimson.prerm    | 12 +++++
+ debian/ceph-osd.install          | 10 ----
+ debian/control                   | 93 +++++++++++++++++++++++++++-----
+ debian/rules                     |  5 --
+ 10 files changed, 188 insertions(+), 42 deletions(-)
+ create mode 100755 debian/ceph-osd-classic.install
+ create mode 100644 debian/ceph-osd-classic.postinst
+ create mode 100644 debian/ceph-osd-classic.prerm
+ create mode 100755 debian/ceph-osd-crimson.install
+ create mode 100644 debian/ceph-osd-crimson.postinst
+ create mode 100644 debian/ceph-osd-crimson.prerm
+ mode change 100755 => 100644 debian/ceph-osd.install
+
+diff --git a/ceph.spec.in b/ceph.spec.in
+index 226fe72192b..e3fc7ff6952 100644
+--- a/ceph.spec.in
++++ b/ceph.spec.in
+@@ -912,28 +912,39 @@ Summary:	Ceph Object Storage Daemon
+ Group:		System/Filesystems
+ %endif
+ Requires:	ceph-base = %{_epoch_prefix}%{version}-%{release}
++Requires:	(ceph-osd-classic = %{_epoch_prefix}%{version}-%{release} or ceph-osd-crimson = %{_epoch_prefix}%{version}-%{release})
+ Requires:	sudo
+ Requires:	libstoragemgmt
+-%if 0%{with crimson}
+-Requires:	protobuf
+-%endif
+ %if 0%{?weak_deps}
+ Recommends:	ceph-volume = %{_epoch_prefix}%{version}-%{release}
+ %endif
+ %description osd
+ ceph-osd is the object storage daemon for the Ceph distributed file
++system.  It provides components shared between classic and crimson OSD
++implementations. It requires either the classic or crimson OSD
++to provide the core OSD daemon.
++
++%package osd-classic
++Summary:	Ceph Object Storage Daemon (classic)
++%if 0%{?suse_version}
++Group:		System/Filesystems
++%endif
++Requires:   ceph-osd = %{_epoch_prefix}%{version}-%{release}
++%description osd-classic
++classic-osd is the object storage daemon for the Ceph distributed file
+ system.  It is responsible for storing objects on a local file system
+ and providing access to them over the network.
+ 
+ %if 0%{with crimson}
+-%package crimson-osd
++%package osd-crimson
+ Summary:	Ceph Object Storage Daemon (crimson)
+ %if 0%{?suse_version}
+ Group:		System/Filesystems
+ %endif
+ Requires:	ceph-osd = %{_epoch_prefix}%{version}-%{release}
+ Requires:	binutils
+-%description crimson-osd
++Requires:	protobuf
++%description osd-crimson
+ crimson-osd is the object storage daemon for the Ceph distributed file
+ system.  It is responsible for storing objects on a local file system
+ and providing access to them over the network.
+@@ -1563,9 +1574,9 @@ rm -f %{buildroot}/%{_sysconfdir}/init.d/ceph
+ popd
+ 
+ %if 0%{with crimson}
+-# package crimson-osd with the name of ceph-osd
+-install -m 0755 %{buildroot}%{_bindir}/crimson-osd %{buildroot}%{_bindir}/ceph-osd
++mv %{buildroot}%{_bindir}/crimson-osd %{buildroot}%{_bindir}/ceph-osd-crimson
+ %endif
++mv %{buildroot}%{_bindir}/ceph-osd %{buildroot}%{_bindir}/ceph-osd-classic
+ 
+ install -m 0644 -D src/etc-rbdmap %{buildroot}%{_sysconfdir}/ceph/rbdmap
+ %if 0%{?fedora} || 0%{?rhel} || 0%{?openEuler}
+@@ -2285,17 +2296,12 @@ fi
+ 
+ %files osd
+ %{_bindir}/ceph-clsinfo
+-%{_bindir}/ceph-bluestore-tool
+ %{_bindir}/ceph-erasure-code-tool
+-%{_bindir}/ceph-objectstore-tool
+-%{_bindir}/ceph-osd
+ %{_libexecdir}/ceph/ceph-osd-prestart.sh
+ %{_mandir}/man8/ceph-clsinfo.8*
+ %{_mandir}/man8/ceph-osd.8*
+-%{_mandir}/man8/ceph-bluestore-tool.8*
+ %{_unitdir}/ceph-osd@.service
+ %{_unitdir}/ceph-osd.target
+-%attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/osd
+ %config(noreplace) %{_sysctldir}/90-ceph-osd.conf
+ 
+ %post osd
+@@ -2334,11 +2340,36 @@ if [ $1 -ge 1 ] ; then
+   fi
+ fi
+ 
++%files osd-classic
++%{_bindir}/ceph-bluestore-tool
++%{_bindir}/ceph-objectstore-tool
++%{_bindir}/ceph-osd-classic
++%{_mandir}/man8/ceph-bluestore-tool.8*
++%attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/osd
++
+ %if 0%{with crimson}
+-%files crimson-osd
+-%{_bindir}/crimson-osd
++%files osd-crimson
++%{_bindir}/ceph-osd-crimson
++
++%post osd-crimson
++%{_sbindir}/update-alternatives --install %{_bindir}/ceph-osd ceph-osd \
++    %{_bindir}/ceph-osd-crimson 50
++
++%preun osd-crimson
++if [ $1 -eq 0 ]; then
++    ${_sbindir}/update-alternatives --remove ceph-osd %{_bindir}/ceph-osd-crimson
++fi
+ %endif
+ 
++%post osd-classic
++%{_sbindir}/update-alternatives --install %{_bindir}/ceph-osd ceph-osd \
++    %{_bindir}/ceph-osd-classic 100
++
++%preun osd-classic
++if [ $1 -eq 0 ]; then
++    ${_sbindir}/update-alternatives --remove ceph-osd %{_bindir}/ceph-osd-classic
++fi
++
+ %files volume
+ %{_sbindir}/ceph-volume
+ %{_sbindir}/ceph-volume-systemd
+diff --git a/debian/ceph-osd-classic.install b/debian/ceph-osd-classic.install
+new file mode 100755
+index 00000000000..2f1f6281821
+--- /dev/null
++++ b/debian/ceph-osd-classic.install
+@@ -0,0 +1,9 @@
++#! /usr/bin/dh-exec
++
++usr/bin/ceph-bluestore-tool
++usr/bin/ceph-objectstore-tool
++usr/bin/ceph-osd => /usr/bin/ceph-osd-classic
++usr/bin/ceph_objectstore_bench
++usr/lib/libos_tp.so*
++usr/lib/libosd_tp.so*
++usr/share/man/man8/ceph-bluestore-tool.8
+diff --git a/debian/ceph-osd-classic.postinst b/debian/ceph-osd-classic.postinst
+new file mode 100644
+index 00000000000..e475e7e38ca
+--- /dev/null
++++ b/debian/ceph-osd-classic.postinst
+@@ -0,0 +1,13 @@
++#!/bin/sh
++set -e
++
++case "$1" in
++    configure)
++        update-alternatives --install /usr/bin/ceph-osd ceph-osd \
++            /usr/bin/ceph-osd-classic 100
++        ;;
++esac
++
++#DEBHELPER#
++
++exit 0
+diff --git a/debian/ceph-osd-classic.prerm b/debian/ceph-osd-classic.prerm
+new file mode 100644
+index 00000000000..1b3e65b6d70
+--- /dev/null
++++ b/debian/ceph-osd-classic.prerm
+@@ -0,0 +1,12 @@
++#!/bin/sh
++set -e
++
++case "$1" in
++    remove)
++        update-alternatives --remove ceph-osd /usr/bin/ceph-osd-classic
++        ;;
++esac
++
++#DEBHELPER#
++
++exit 0
+diff --git a/debian/ceph-osd-crimson.install b/debian/ceph-osd-crimson.install
+new file mode 100755
+index 00000000000..6f3b4b75770
+--- /dev/null
++++ b/debian/ceph-osd-crimson.install
+@@ -0,0 +1,4 @@
++#! /usr/bin/dh-exec
++
++usr/bin/crimson-osd => /usr/bin/ceph-osd-crimson
++usr/bin/crimson-store-nbd
+diff --git a/debian/ceph-osd-crimson.postinst b/debian/ceph-osd-crimson.postinst
+new file mode 100644
+index 00000000000..49fc8b3c9a6
+--- /dev/null
++++ b/debian/ceph-osd-crimson.postinst
+@@ -0,0 +1,13 @@
++#!/bin/sh
++set -e
++
++case "$1" in
++    configure)
++        update-alternatives --install /usr/bin/ceph-osd ceph-osd \
++            /usr/bin/ceph-osd-crimson 50
++        ;;
++esac
++
++#DEBHELPER#
++
++exit 0
+diff --git a/debian/ceph-osd-crimson.prerm b/debian/ceph-osd-crimson.prerm
+new file mode 100644
+index 00000000000..6acbecb375e
+--- /dev/null
++++ b/debian/ceph-osd-crimson.prerm
+@@ -0,0 +1,12 @@
++#!/bin/sh
++set -e
++
++case "$1" in
++    remove)
++        update-alternatives --remove ceph-osd /usr/bin/ceph-osd-crimson
++        ;;
++esac
++
++#DEBHELPER#
++
++exit 0
+diff --git a/debian/ceph-osd.install b/debian/ceph-osd.install
+old mode 100755
+new mode 100644
+index 217c9bea719..19e1d5055b8
+--- a/debian/ceph-osd.install
++++ b/debian/ceph-osd.install
+@@ -1,17 +1,7 @@
+-#! /usr/bin/dh-exec
+-
+ {usr/,}lib/systemd/system/ceph-osd*
+-usr/bin/ceph-bluestore-tool
+ usr/bin/ceph-clsinfo
+ usr/bin/ceph-erasure-code-tool
+-usr/bin/ceph-objectstore-tool
+-<pkg.ceph.crimson> usr/bin/crimson-store-nbd
+-usr/bin/${CEPH_OSD_BASENAME} => /usr/bin/ceph-osd
+-usr/bin/ceph_objectstore_bench
+ usr/libexec/ceph/ceph-osd-prestart.sh
+-usr/lib/libos_tp.so*
+-usr/lib/libosd_tp.so*
+ usr/share/man/man8/ceph-clsinfo.8
+ usr/share/man/man8/ceph-osd.8
+-usr/share/man/man8/ceph-bluestore-tool.8
+ etc/sysctl.d/30-ceph-osd.conf
+diff --git a/debian/control b/debian/control
+index 7d30e1faa70..9b4ade7e336 100644
+--- a/debian/control
++++ b/debian/control
+@@ -416,42 +416,109 @@ Description: debugging symbols for ceph-mon
+ 
+ Package: ceph-osd
+ Architecture: linux-any
+-Depends: ceph-base (= ${binary:Version}),
++Depends: ceph-osd-classic (= ${binary:Version}) | ceph-osd-crimson (= ${binary:Version}),
+          sudo,
+-         ${misc:Depends},
+          ${python3:Depends},
++         ${misc:Depends},
++         ${shlibs:Depends},
++Recommends: ceph-osd-classic (= ${binary:Version})
++Description: OSD server for the ceph storage system - shared components
++ Ceph is a massively scalable, open-source, distributed
++ storage system that runs on commodity hardware and delivers object,
++ block and file system storage.
++ .
++ This package contains components shared between classic and crimson OSD implementations.
++ It ensures a Ceph OSD implementation is installed. By default,
++ it installs the classic OSD implementation (ceph-osd-classic). Users can
++ substitute with the experimental Crimson implementation (ceph-osd-crimson)
++ for improved performance and scalability.
++
++Package: ceph-osd-dbg
++Architecture: linux-any
++Section: debug
++Priority: extra
++Depends: ceph-osd (= ${binary:Version}),
++         ${misc:Depends},
++Description: debugging symbols for ceph-osd
++ Ceph is a massively scalable, open-source, distributed
++ storage system that runs on commodity hardware and delivers object,
++ block and file system storage.
++ .
++ This package contains the debugging symbols for ceph-osd.
++
++Package: ceph-osd-classic
++Architecture: linux-any
++Depends: ceph-base (= ${binary:Version}),
++         ${misc:Depends},
+          ${shlibs:Depends},
+-         libprotobuf23 <pkg.ceph.crimson>,
+ Replaces: ceph (<< 10),
+           ceph-test (<< 12.2.2-14),
+-          ceph-osd (<< 17.0.0)
++          ceph-osd (<< 20.1.1)
+ Breaks: ceph (<< 10),
+         ceph-test (<< 12.2.2-14),
+-        ceph-osd (<< 17.0.0)
++        ceph-osd (<< 20.1.1)
+ Recommends: ceph-volume (= ${binary:Version}),
+             nvme-cli,
+             smartmontools,
+-Description: OSD server for the ceph storage system
++Description: Classic OSD server for the ceph storage system
+  Ceph is a massively scalable, open-source, distributed
+  storage system that runs on commodity hardware and delivers object,
+  block and file system storage.
+  .
+- This package contains the Object Storage Daemon for the Ceph storage system.
+- It is responsible for storing objects on a local file system
+- and providing access to them over the network.
++ This package contains the classic Object Storage Daemon and
++ classic-specific components for the Ceph storage system. It is
++ responsible for storing objects on a local file system and providing
++ access to them over the network.
+ 
+-Package: ceph-osd-dbg
++Package: ceph-osd-classic-dbg
+ Architecture: linux-any
+ Section: debug
+ Priority: extra
+-Depends: ceph-osd (= ${binary:Version}),
++Depends: ceph-osd-classic (= ${binary:Version}),
+          ${misc:Depends},
+-Description: debugging symbols for ceph-osd
++Description: debugging symbols for ceph-osd-classic
+  Ceph is a massively scalable, open-source, distributed
+  storage system that runs on commodity hardware and delivers object,
+  block and file system storage.
+  .
+- This package contains the debugging symbols for ceph-osd.
++ This package contains the debugging symbols for ceph-osd-classic.
++
++Package: ceph-osd-crimson
++Build-Profiles: <pkg.ceph.crimson>
++Architecture: any
++Depends: ceph-base (= ${binary:Version}),
++         ${misc:Depends},
++         ${shlibs:Depends},
++         libprotobuf23,
++Recommends: ceph-volume (= ${binary:Version}),
++            nvme-cli,
++            smartmontools,
++Description: Crimson OSD server for the ceph storage system
++ Ceph is a massively scalable, open-source, distributed
++ storage system that runs on commodity hardware and delivers object,
++ block and file system storage.
++ .
++ Crimson is the next generation of ceph-osd daemon featuring enhanced
++ performance on fast network and storage devices.
++ .
++ This package contains the Crimson Object Storage Daemon and
++ crimson-specific components for the Ceph storage system. It is
++ responsible for storing objects on a local file system and providing
++ access to them over the network.
++
++Package: ceph-osd-crimson-dbg
++Build-Profiles: <pkg.ceph.crimson>
++Architecture: linux-any
++Section: debug
++Priority: extra
++Depends: ceph-osd-crimson (= ${binary:Version}),
++         ${misc:Depends},
++Description: debugging symbols for ceph-osd-crimson
++ Ceph is a massively scalable, open-source, distributed
++ storage system that runs on commodity hardware and delivers object,
++ block and file system storage.
++ .
++ This package contains the debugging symbols for ceph-osd-crimson.
+ 
+ Package: ceph-volume
+ Architecture: all
+diff --git a/debian/rules b/debian/rules
+index ee4eff2bdc5..bbd2f5ed2e7 100755
+--- a/debian/rules
++++ b/debian/rules
+@@ -12,11 +12,6 @@ ifneq (,$(findstring WITH_STATIC_LIBSTDCXX,$(CEPH_EXTRA_CMAKE_ARGS)))
+   # see http://tracker.ceph.com/issues/25209
+   export DEB_LDFLAGS_MAINT_STRIP = -Wl,-Bsymbolic-functions
+ endif
+-ifeq (,$(findstring WITH_CRIMSON,$(CEPH_EXTRA_CMAKE_ARGS)))
+-  export CEPH_OSD_BASENAME = ceph-osd
+-else
+-  export CEPH_OSD_BASENAME = crimson-osd
+-endif
+ ifneq ($(filter pkg.ceph.arrow,$(DEB_BUILD_PROFILES)),)
+   extraopts += -DWITH_SYSTEM_ARROW=ON
+ endif
+-- 
+2.47.3
+
diff --git a/patches/0050-debian-rules-enable-WITH_CRIMSON-when-pkg.ceph.crims.patch b/patches/0050-debian-rules-enable-WITH_CRIMSON-when-pkg.ceph.crims.patch
new file mode 100644
index 00000000000..72641bc96f0
--- /dev/null
+++ b/patches/0050-debian-rules-enable-WITH_CRIMSON-when-pkg.ceph.crims.patch
@@ -0,0 +1,46 @@
+From c39545c5464a84b705b2c765bed2ac198f7d5959 Mon Sep 17 00:00:00 2001
+From: Kefu Chai <k.chai@proxmox.com>
+Date: Sat, 18 Oct 2025 22:23:56 +0800
+Subject: [PATCH 50/51] debian/rules: enable WITH_CRIMSON when pkg.ceph.crimson
+ profile is set
+
+Since commit 9b1d524839 ("debian: mark "crimson" specific deps with
+"pkg.ceph.crimson""), crimson-specific build dependencies have been
+gated by the Build-Profiles: <pkg.ceph.crimson> tag. However,
+debian/rules was never updated to pass -DWITH_CRIMSON=ON when this
+build profile is active.
+
+This causes builds with the crimson profile enabled to fail during
+dh_install, as the crimson-osd binary is never built but the install
+file tries to package it:
+
+  Failed to copy 'usr/bin/crimson-osd': No such file or directory
+  dh_install: error: debian/ceph-crimson-osd.install returned exit code 127
+
+Fix this by checking for pkg.ceph.crimson in DEB_BUILD_PROFILES and
+enabling the CMake option accordingly, following the same pattern used
+for pkg.ceph.arrow.
+
+Signed-off-by: Kefu Chai <k.chai@proxmox.com>
+(cherry picked from commit ceb3272fdae035d2a7376c423c69e5770f8e2fb1)
+---
+ debian/rules | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/debian/rules b/debian/rules
+index bbd2f5ed2e7..4d31ffd069f 100755
+--- a/debian/rules
++++ b/debian/rules
+@@ -15,6 +15,9 @@ endif
+ ifneq ($(filter pkg.ceph.arrow,$(DEB_BUILD_PROFILES)),)
+   extraopts += -DWITH_SYSTEM_ARROW=ON
+ endif
++ifneq ($(filter pkg.ceph.crimson,$(DEB_BUILD_PROFILES)),)
++  extraopts += -DWITH_CRIMSON=ON
++endif
+ 
+ extraopts += -DWITH_JAEGER=ON
+ extraopts += -DWITH_SYSTEM_UTF8PROC=ON
+-- 
+2.47.3
+
diff --git a/patches/0051-debian-ceph.spec-fix-ceph-osd-upgrade-conflicts.patch b/patches/0051-debian-ceph.spec-fix-ceph-osd-upgrade-conflicts.patch
new file mode 100644
index 00000000000..c553f7554db
--- /dev/null
+++ b/patches/0051-debian-ceph.spec-fix-ceph-osd-upgrade-conflicts.patch
@@ -0,0 +1,108 @@
+From 9da967184da17dbcddb86befddbe7d084f3f66be Mon Sep 17 00:00:00 2001
+From: Matan Breizman <mbreizma@redhat.com>
+Date: Tue, 9 Dec 2025 09:52:08 +0000
+Subject: [PATCH 51/51] debian,ceph.spec: fix ceph-osd upgrade conflicts
+
+With https://github.com/ceph/ceph/pull/65782 merged, upgrading ceph-osd
+would need to replace the previous ceph-osd existing on the machine.
+Otherwise, we won't be able to symlink the newly installed package:
+```
+2025-12-05T21:09:20.472 INFO:teuthology.orchestra.run.smithi077.stdout:
+Installing       : ceph-osd-classic-2:20.3.0-4434.g8611241d.el9.x86_6
+24/87
+2025-12-05T21:09:20.478 INFO:teuthology.orchestra.run.smithi077.stdout:
+Running scriptlet: ceph-osd-classic-2:20.3.0-4434.g8611241d.el9.x86_6
+24/87
+2025-12-05T21:09:20.479
+INFO:teuthology.orchestra.run.smithi077.stdout:failed to link
+/usr/bin/ceph-osd -> /etc/alternatives/ceph-osd: /usr/bin/ceph-osd
+exists and it is not a symlink
+```
+
+Note: debian/control ceph-osd-classic already had Replace and Breaks:
+      - Breaks is replaced with Conflicts to not allow coexistence.
+      - Release version is bumped up to be relevant for latest main
+
+Signed-off-by: Matan Breizman <mbreizma@redhat.com>
+(cherry picked from commit 9f1c8f9447026f5ef4965a96d1aaaae7ee59dad4)
+---
+ ceph.spec.in   |  6 ++++--
+ debian/control | 12 +++++++-----
+ 2 files changed, 11 insertions(+), 7 deletions(-)
+
+diff --git a/ceph.spec.in b/ceph.spec.in
+index e3fc7ff6952..6ae79fbb1b3 100644
+--- a/ceph.spec.in
++++ b/ceph.spec.in
+@@ -930,6 +930,7 @@ Summary:	Ceph Object Storage Daemon (classic)
+ Group:		System/Filesystems
+ %endif
+ Requires:   ceph-osd = %{_epoch_prefix}%{version}-%{release}
++Obsoletes:  ceph-osd < %{_epoch_prefix}%{version}-%{release}
+ %description osd-classic
+ classic-osd is the object storage daemon for the Ceph distributed file
+ system.  It is responsible for storing objects on a local file system
+@@ -942,6 +943,7 @@ Summary:	Ceph Object Storage Daemon (crimson)
+ Group:		System/Filesystems
+ %endif
+ Requires:	ceph-osd = %{_epoch_prefix}%{version}-%{release}
++Obsoletes:	ceph-osd < %{_epoch_prefix}%{version}-%{release}
+ Requires:	binutils
+ Requires:	protobuf
+ %description osd-crimson
+@@ -2351,7 +2353,7 @@ fi
+ %files osd-crimson
+ %{_bindir}/ceph-osd-crimson
+ 
+-%post osd-crimson
++%posttrans osd-crimson
+ %{_sbindir}/update-alternatives --install %{_bindir}/ceph-osd ceph-osd \
+     %{_bindir}/ceph-osd-crimson 50
+ 
+@@ -2361,7 +2363,7 @@ if [ $1 -eq 0 ]; then
+ fi
+ %endif
+ 
+-%post osd-classic
++%posttrans osd-classic
+ %{_sbindir}/update-alternatives --install %{_bindir}/ceph-osd ceph-osd \
+     %{_bindir}/ceph-osd-classic 100
+ 
+diff --git a/debian/control b/debian/control
+index 9b4ade7e336..01008f38e2c 100644
+--- a/debian/control
++++ b/debian/control
+@@ -450,16 +450,16 @@ Package: ceph-osd-classic
+ Architecture: linux-any
+ Depends: ceph-base (= ${binary:Version}),
+          ${misc:Depends},
+-         ${shlibs:Depends},
++         ${shlibs:Depends}
++Conflicts: ceph-osd (<< 20.3)
+ Replaces: ceph (<< 10),
+           ceph-test (<< 12.2.2-14),
+-          ceph-osd (<< 20.1.1)
++          ceph-osd (<< 20.3)
+ Breaks: ceph (<< 10),
+-        ceph-test (<< 12.2.2-14),
+-        ceph-osd (<< 20.1.1)
++        ceph-test (<< 12.2.2-14)
+ Recommends: ceph-volume (= ${binary:Version}),
+             nvme-cli,
+-            smartmontools,
++            smartmontools
+ Description: Classic OSD server for the ceph storage system
+  Ceph is a massively scalable, open-source, distributed
+  storage system that runs on commodity hardware and delivers object,
+@@ -493,6 +493,8 @@ Depends: ceph-base (= ${binary:Version}),
+ Recommends: ceph-volume (= ${binary:Version}),
+             nvme-cli,
+             smartmontools,
++Conflicts: ceph-osd (<< 20.3)
++Replaces:  ceph-osd (<< 20.3)
+ Description: Crimson OSD server for the ceph storage system
+  Ceph is a massively scalable, open-source, distributed
+  storage system that runs on commodity hardware and delivers object,
+-- 
+2.47.3
+
diff --git a/patches/0052-cmake-build-static-seastar-for-release-builds.patch b/patches/0052-cmake-build-static-seastar-for-release-builds.patch
new file mode 100644
index 00000000000..9847eaa6790
--- /dev/null
+++ b/patches/0052-cmake-build-static-seastar-for-release-builds.patch
@@ -0,0 +1,71 @@
+From 3388c81a09c2eeaf6f6a11504b53ff39d275e603 Mon Sep 17 00:00:00 2001
+From: Kefu Chai <k.chai@proxmox.com>
+Date: Thu, 18 Dec 2025 16:41:49 +0800
+Subject: [PATCH] cmake: build static seastar for release builds
+
+When BUILD_SHARED_LIBS is set, seastar inherits this setting from the
+parent CMake project, causing crimson to link against libseastar.so.
+While this works in development environments, it breaks package
+installation because libseastar.so is not included in the distribution:
+
+```
+  can't install ceph-crimson-osd:
+    - nothing provides libseastar.so()(64bit) needed by
+      ceph-crimson-osd-2:20.2.0-2.fc44.x86_64
+
+  can't install ceph-osd:
+    - nothing provides libseastar.so()(64bit) needed by
+      ceph-osd-2:20.2.0-2.fc44.x86_64
+
+  can't install ceph-test:
+    - nothing provides libseastar.so()(64bit) needed by
+      ceph-test-2:20.2.0-2.fc44.x86_64
+```
+
+Force seastar to build as a static library regardless of the parent
+project's BUILD_SHARED_LIBS setting. This fixes the packaging issue
+and provides a modest performance improvement by eliminating PLT/GOT
+indirection overhead for seastar function calls.
+
+Fixes: https://tracker.ceph.com/issues/74138
+
+Signed-off-by: Kefu Chai <k.chai@proxmox.com>
+(cherry picked from commit 2cf8e4b095c8cdc3d583bcd570f8a5a5a27e459a)
+---
+ src/CMakeLists.txt | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index a0e8c583ab5..5739e4108c8 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -406,6 +406,17 @@ if(WITH_CRIMSON)
+       build_dpdk(${CMAKE_BINARY_DIR}/src/dpdk)
+     endif()
+   endif()
++  set(old_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
++  if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
++    # - Debug: shared seastar for faster development iteration
++    #   shared seastar is allowed for faster linking and smaller executables during
++    #   development.
++    #   Note: shared seastar won't be packaged, so this is for developers only
++    # - RelWithDebInfo/Release/MinSizeRel: static seastar for production packages
++    #   This ensures packages don't depend on libseastar.so, and avoids the performance penalty
++    #   of calling functions in shared library.
++    set(BUILD_SHARED_LIBS FALSE)
++  endif()
+   list(APPEND Seastar_CXX_FLAGS
+     "-DSEASTAR_NO_EXCEPTION_HACK"
+     "-Wno-error"
+@@ -416,6 +427,8 @@ if(WITH_CRIMSON)
+     "-Wno-non-virtual-dtor")
+   set(Seastar_CXX_FLAGS "${Seastar_CXX_FLAGS}" CACHE STRING "" FORCE)
+   add_subdirectory(seastar)
++  set(BUILD_SHARED_LIBS ${old_BUILD_SHARED_LIBS})
++  unset(old_BUILD_SHARED_LIBS)
+   # create the directory so cmake won't complain when looking at the imported
+   # target: Seastar exports this directory created at build-time
+   file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/seastar/gen/include")
+-- 
+2.47.3
+
diff --git a/patches/series b/patches/series
index f2bfed1b939..53e0e6b83ca 100644
--- a/patches/series
+++ b/patches/series
@@ -46,4 +46,7 @@
 0046-debian-Use-system-packages-for-cephadm-bundled-depen.patch
 0047-cmake-BuildArrow-Use-AUTO-mode-for-xsimd-dependency-.patch
 0048-debian-control-Add-libxsimd-dev-build-dependency-for.patch
-  
+0049-debian-ceph.spec-split-ceph-osd-into-shared-base-and.patch
+0050-debian-rules-enable-WITH_CRIMSON-when-pkg.ceph.crims.patch
+0051-debian-ceph.spec-fix-ceph-osd-upgrade-conflicts.patch
+0052-cmake-build-static-seastar-for-release-builds.patch
-- 
2.47.3



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-01-22 11:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-21 15:12 [pve-devel] [PATCH ceph] cherry-pick changes to use system packages for bundled deps Kefu Chai
2026-01-22  8:29 ` [pve-devel] [PATCH ceph] cherry-pick changes to buiild crimson package Kefu Chai
2026-01-22 10:14   ` [pve-devel] [PATCH ceph 2/3 v2] " Kefu Chai
2026-01-22 10:14   ` [pve-devel] [PATCH ceph 3/3] make: build with pkg.ceph.crimson build profile Kefu Chai
2026-01-22 10:56   ` [pve-devel] [PATCH ceph 2/3 v3] cherry-pick changes to build crimson package Kefu Chai
2026-01-22 11:43   ` [pve-devel] [PATCH ceph 2/3 v4] " Kefu Chai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal