The device-mapper-persistent-data rpms
Find a file
2025-06-26 13:53:30 +02:00
tests Fix some compatibility issues with Python3 2024-01-18 13:36:46 +01:00
.gitignore Update to version 1.1.0 2024-09-02 15:28:34 +02:00
0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch Update to version 1.1.0 2024-09-02 15:28:34 +02:00
device-mapper-persistent-data-avoid-strip.patch New upstream release v0.7.2 2017-09-22 09:05:47 +02:00
device-mapper-persistent-data.spec Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild 2025-01-16 15:37:25 +00:00
README.md Fix tarball links 2025-06-26 13:53:30 +02:00
sources Update to version 1.1.0 2024-09-02 15:28:34 +02:00

Packaging device-mapper-persitent-data (AKA dmpd)

This is rust package using vendor file for dependencies. (Vendor file is an archive of dependencies' sources.)

For most of simple fixes, there is nothing special, to add a patches simply add them to dist-git, add a corresponding PatchN: 000N-... lines, increase Release: or release_suffix for Z-stream (or for test build use suffix like .bzNNNNNN), add to %changelog, commit, push, and build the package using fedpkg build.

Alternatively before committing anything use fedpkg srpm and fedpkg scratch-build --srpm $SRPM [--arches x86_64] to create a scratch build.

However when building a new version of dmpd or when updating a dependency is needed (e.g. because of CVE in the dependency) vendor file has to be regenerated.

Updating vendor file

To build a new version of the package following tooling is needed:

  • rust >= 1.35
  • cargo providing vendor subcommand (now upstream, included in latest Fedora and RHEL8+)

To create the vendor file:

In the upstream directory:

  1. Run cargo vendor in the directory with upstream sources to create vendor directory with sources.
    • TODO: There is a cargo-vendor-filterer project used by stratisd to filter out unnecessary dependencies for other operating systems.
  2. Run tar czf device-mapper-persistent-data-vendor-$VERSION.tar.gz ./vendor to create a tarball.
  3. Copy the vendor file to dist git directory.

In the dist-git directory:

  1. Get the upstream tarball wget https://github.com/jthornber/thin-provisioning-tools/archive/v$VERSION.tar.gz
    • NOTE: Migration to https://github.com/device-mapper-utils/thin-provisioning-tools is coming.
  2. Update Source0 and Source1 to correct values.
  3. Add the tarballs to koji/brew lookaside:
    • fedpkg new-sources v$VERSION.tar.gz device-mapper-persistent-data-vendor-$VERSION.tar.gz
  4. You may need to update 0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch to modify Cargo.toml file. Some dependencies (at the moment only rio) are not using upstream from registry, but a patched version. With unmodified Cargo.toml build would fail as it would try to reach to internet.
    • NOTE: This patch MUST NOT be present in the upstream source directory when running cargo vendor.
    • I apply the patch after step 1, and use git format-patch HEAD^ to create the patch and add the patch to dist-git directory afterwards.
    • The work to replace dependency on rio is in progress.

TODO/NOTES

Some of the dependencies are already packaged by Fedora. Can we instruct cargo vendor to include only those which are not provided by Fedora? It would be possible to include these as submodules, and the rest could be used from Fedora. For RHEL and CentOS Stream using vendor file is the recommended way.

%cargo_install installs by default in /usr/bin but the package expects /usr/sbin. For now I run make install-rust-tools. Now Fedora unified the /usr/sbin and /usr/bin directories, to this can be "fixed" in Fedora and later in CentOS Stream.