From: Stoiko Ivanov <s.ivanov@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup v2 3/3] pbs3to4: bootloader: only allow systemd-boot before upgrade when used
Date: Thu, 21 Aug 2025 16:17:19 +0200 [thread overview]
Message-ID: <20250821141719.4130062-4-s.ivanov@proxmox.com> (raw)
In-Reply-To: <20250821141719.4130062-1-s.ivanov@proxmox.com>
This carries over the changes from pve-manager:
7e168453 ("pve8to9: only allow systemd-boot when it is actually used before upgrade")
additionally it pushes the check for systemd-boot being present to the
bottom (there is an early return for the single case which is not
problematic (used by p-b-t on a system still on bookworm) - and logs a
failure with a link to the upgrade guide in all cases.
The previous suggestion of installing systemd-boot-tools and
systemd-boot-efi explicitly is not fitting when systemd-boot is not
really used for booting (mostly: secure-boot enabled p-b-t setups)
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
src/bin/pbs3to4.rs | 54 +++++++++++++++++++++++-----------------------
1 file changed, 27 insertions(+), 27 deletions(-)
diff --git a/src/bin/pbs3to4.rs b/src/bin/pbs3to4.rs
index 3c3a020f..4b432beb 100644
--- a/src/bin/pbs3to4.rs
+++ b/src/bin/pbs3to4.rs
@@ -211,7 +211,7 @@ impl Checker {
if !Path::new("/sys/firmware/efi").is_dir() {
if sd_boot_installed {
- self.output.log_info(
+ self.output.log_warn(
"systemd-boot package installed on legacy-boot system is not \
necessary, consider removing it",
)?;
@@ -226,29 +226,21 @@ impl Checker {
if Path::new("/etc/kernel/proxmox-boot-uuids").is_file() {
// PBS packages version check needs to be run before
if !self.upgraded {
- self.output
- .log_skip("not yet upgraded, systemd-boot still needed for bootctl")?;
- return Ok(());
- }
- if sd_boot_installed {
- self.output.log_fail(
- "systemd-boot meta-package installed. This will cause issues on upgrades of \
- boot-related packages.\n\
- Install 'systemd-boot-efi' and 'systemd-boot-tools' explicitly and remove \
- 'systemd-boot'",
- )?;
- return Ok(());
+ let output = std::process::Command::new("proxmox-boot-tool")
+ .arg("status")
+ .output()
+ .map_err(|err| {
+ format_err!("failed to retrieve proxmox-boot-tool status - {err}")
+ })?;
+ let re = Regex::new(r"configured with:.* (uefi|systemd-boot) \(versions:")
+ .expect("failed to proxmox-boot-tool status");
+ if re.is_match(std::str::from_utf8(&output.stdout)?) {
+ self.output
+ .log_skip("not yet upgraded, systemd-boot still needed for bootctl")?;
+ return Ok(());
+ }
}
} else {
- if sd_boot_installed {
- self.output.log_fail(
- "systemd-boot meta-package installed. This will cause problems on upgrades of other \
- boot-related packages.\n\
- Remove the 'systemd-boot' package.\n\
- See https://pbs.proxmox.com/wiki/Upgrade_from_3_to_4#sd-boot-warning for more information."
- )?;
- boot_ok = false;
- }
if !Path::new("/usr/share/doc/grub-efi-amd64/changelog.Debian.gz").is_file() {
self.output.log_warn(
"System booted in uefi mode but grub-efi-amd64 meta-package not installed, \
@@ -277,12 +269,20 @@ impl Checker {
boot_ok = false;
}
}
- if boot_ok {
- self.output
- .log_pass("bootloader packages installed correctly")?;
- }
}
-
+ if sd_boot_installed {
+ self.output.log_fail(
+ "systemd-boot meta-package installed. This will cause problems on upgrades of other \
+ boot-related packages.\n\
+ Remove the 'systemd-boot' package.\n\
+ See https://pbs.proxmox.com/wiki/Upgrade_from_3_to_4#sd-boot-warning for more information."
+ )?;
+ boot_ok = false;
+ }
+ if boot_ok {
+ self.output
+ .log_pass("bootloader packages installed correctly")?;
+ }
Ok(())
}
--
2.39.5
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
next prev parent reply other threads:[~2025-08-21 14:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-21 14:17 [pbs-devel] [PATCH proxmox-backup v2 0/3] pbs3to4: rework bootloader checks Stoiko Ivanov
2025-08-21 14:17 ` [pbs-devel] [PATCH proxmox-backup v2 1/3] pbs3to4: fix logic error and typo in log message Stoiko Ivanov
2025-08-21 14:17 ` [pbs-devel] [PATCH proxmox-backup v2 2/3] pbs3to4: use boolean variable for systemd-boot installation state Stoiko Ivanov
2025-08-21 14:17 ` Stoiko Ivanov [this message]
2025-08-21 14:50 ` [pbs-devel] [PATCH proxmox-backup v2 0/3] pbs3to4: rework bootloader checks Shannon Sterz
2025-08-22 13:41 ` [pbs-devel] applied: " Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250821141719.4130062-4-s.ivanov@proxmox.com \
--to=s.ivanov@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.