[pve-devel] [PATCH pve-cluster v5 1/1] cfs: add fabrics.cfg to observed files
Thomas Lamprecht
t.lamprecht at proxmox.com
Wed Jul 16 16:41:17 CEST 2025
Am 16.07.25 um 15:07 schrieb Gabriel Goller:
> From: Stefan Hanreich <s.hanreich at proxmox.com>
>
> In a previous commit we already added the openfabric / ospf
> configuration files, but the configuration format changed since then,
> so we replace them with the single configuration file used by the
> fabrics now.
>
> Also add a postinst script that removes the leftover folder from that
> change.
>
> Signed-off-by: Stefan Hanreich <s.hanreich at proxmox.com>
> ---
> debian/pve-cluster.postinst | 24 ++++++++++++++++++++++++
> src/PVE/Cluster.pm | 3 +--
> src/pmxcfs/status.c | 3 +--
> 3 files changed, 26 insertions(+), 4 deletions(-)
> create mode 100644 debian/pve-cluster.postinst
>
> diff --git a/debian/pve-cluster.postinst b/debian/pve-cluster.postinst
> new file mode 100644
> index 000000000000..5ca091db6c26
> --- /dev/null
> +++ b/debian/pve-cluster.postinst
Oh, before I forget: If you create a new postinst file you need to watch out for
not overriding existing auto-generated ones, as here this would have dropped the
enable and restart handling for pve-cluster.service.
For such changes to packaging related files it's good to either diff a new .deb
build with an older one using debdiff or diffoscope, or at least check the "living"
<package>.postinst file inside /var/lib/dpkg/info/ before/after.
And if one merely wants to add extra postinst stuff, one can place a line like
#DEBHELPER#
to make the deb-helper replace that line with the autogenerated stuff, I did that
in a follow-up.
> @@ -0,0 +1,24 @@
> +#!/bin/sh
> +
> +set -e
> +
> +remove_fabrics_directory() {
> + LEGACY_FABRICS_DIRECTORY="/etc/pve/sdn/fabrics/"
> +
> + if test -d "$LEGACY_FABRICS_DIRECTORY"; then
> + echo "Removing legacy sdn fabrics directory ..."
> + rm -d $LEGACY_FABRICS_DIRECTORY || echo "Failed to remove legacy sdn folder ${LEGACY_FABRICS_DIRECTORY}!"
> + fi
> +}
> +
> +case "$1" in
> + configure)
> + # TODO: remove with PVE 10+
> + if dpkg --compare-versions "$2" 'lt' '9.0.0'; then
> + remove_fabrics_directory
> + fi
> + ;;
> +esac
> +
> +exit 0
> +
More information about the pve-devel
mailing list