[pdm-devel] [PATCH datacenter-manager 1/2] server: add pdmAtoB upgrade checker script

Shannon Sterz s.sterz at proxmox.com
Fri Sep 5 11:59:05 CEST 2025


Signed-off-by: Shannon Sterz <s.sterz at proxmox.com>
---
 Cargo.toml                                |  3 +++
 Makefile                                  |  1 +
 cli/pdmAtoB/Cargo.toml                    | 15 +++++++++++++++
 cli/pdmAtoB/src/main.rs                   | 19 +++++++++++++++++++
 debian/proxmox-datacenter-manager.install |  3 +++
 5 files changed, 41 insertions(+)
 create mode 100644 cli/pdmAtoB/Cargo.toml
 create mode 100644 cli/pdmAtoB/src/main.rs

diff --git a/Cargo.toml b/Cargo.toml
index 1e6f5a3..dce7052 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -24,6 +24,7 @@ members = [
     "cli/client",
     "cli/admin",
     "cli/proxmox-fido2",
+    "cli/pdmAtoB",
 ]
 
 [workspace.dependencies]
@@ -64,6 +65,7 @@ proxmox-uuid = "1"
 # other proxmox crates
 proxmox-acme = "0.5"
 proxmox-openid = "0.10"
+proxmox-upgrade-checks = "0.1.0"
 
 # api implementation creates
 proxmox-config-digest = "0.1"
@@ -175,4 +177,5 @@ zstd = { version = "0.12", features = [ "bindgen" ] }
 # proxmox-time-api = { path = "../proxmox/proxmox-time-api" }
 # proxmox-time = { path = "../proxmox/proxmox-time" }
 # proxmox-uuid = { path = "../proxmox/proxmox-uuid" }
+proxmox-upgrade-checks = { path = "../proxmox/proxmox-upgrade-checks" }
 # proxmox-worker-task = { path = "../proxmox/proxmox-worker-task" }
diff --git a/Makefile b/Makefile
index d18fb0d..fb2e9bd 100644
--- a/Makefile
+++ b/Makefile
@@ -42,6 +42,7 @@ USR_BIN := \
 
 USR_SBIN := \
 	proxmox-datacenter-manager-admin \
+	pdmAtoB \
 
 SERVICE_BIN := \
 	proxmox-datacenter-api \
diff --git a/cli/pdmAtoB/Cargo.toml b/cli/pdmAtoB/Cargo.toml
new file mode 100644
index 0000000..f05d839
--- /dev/null
+++ b/cli/pdmAtoB/Cargo.toml
@@ -0,0 +1,15 @@
+[package]
+name = "pdmAtoB"
+description = "Proxmox Datacenter Upgrade Checks"
+homepage = "https://www.proxmox.com"
+version.workspace = true
+authors.workspace = true
+edition.workspace = true
+license.workspace = true
+repository.workspace = true
+exclude.workspace = true
+
+[dependencies]
+anyhow.workspace = true
+proxmox-upgrade-checks.workspace = true
+pdm-buildcfg.workspace = true
diff --git a/cli/pdmAtoB/src/main.rs b/cli/pdmAtoB/src/main.rs
new file mode 100644
index 0000000..fdb6684
--- /dev/null
+++ b/cli/pdmAtoB/src/main.rs
@@ -0,0 +1,19 @@
+use pdm_buildcfg::{PROXMOX_PKG_RELEASE, PROXMOX_PKG_VERSION};
+use proxmox_upgrade_checks::UpgradeCheckerBuilder;
+
+fn main() -> Result<(), anyhow::Error> {
+    UpgradeCheckerBuilder::new(
+        "bookworm",
+        "trixie",
+        "proxmox-datacenter-manager",
+        0,
+        1,
+        11,
+        &format!("{PROXMOX_PKG_VERSION}.{PROXMOX_PKG_RELEASE}"),
+    )
+    .with_apt_state_file_location(pdm_buildcfg::APT_PKG_STATE_FN)
+    .add_service_to_checks("proxmox-datacenter-api")
+    .add_service_to_checks("proxmox-datacenter-privileged-api")
+    .build()
+    .run()
+}
diff --git a/debian/proxmox-datacenter-manager.install b/debian/proxmox-datacenter-manager.install
index 71f8da9..c12a196 100644
--- a/debian/proxmox-datacenter-manager.install
+++ b/debian/proxmox-datacenter-manager.install
@@ -10,9 +10,12 @@ usr/libexec/proxmox/proxmox-datacenter-manager-banner
 usr/libexec/proxmox/proxmox-datacenter-manager-daily-update
 usr/libexec/proxmox/proxmox-datacenter-privileged-api
 usr/sbin/proxmox-datacenter-manager-admin
+usr/sbin/pdmAtoB
 usr/share/bash-completion/completions/proxmox-datacenter-api.bc
 usr/share/bash-completion/completions/proxmox-datacenter-manager-admin.bc
 usr/share/bash-completion/completions/proxmox-datacenter-privileged-api.bc
+usr/share/bash-completion/completions/pdmAtoB.bc
 usr/share/zsh/vendor-completions/_proxmox-datacenter-api
 usr/share/zsh/vendor-completions/_proxmox-datacenter-manager-admin
 usr/share/zsh/vendor-completions/_proxmox-datacenter-privileged-api
+usr/share/zsh/vendor-completions/_pdmAtoB
-- 
2.47.2





More information about the pdm-devel mailing list