From: Stoiko Ivanov <s.ivanov@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup 2/2] pbs2to3: check for proper grub meta-package for bootmode
Date: Wed, 29 Nov 2023 15:17:15 +0100 [thread overview]
Message-ID: <20231129141715.219393-3-s.ivanov@proxmox.com> (raw)
In-Reply-To: <20231129141715.219393-1-s.ivanov@proxmox.com>
ported over from pve-manager:
'pve7to8: check for proper grub meta-package for bootmode'
`67c655b9333714f31d5115de80961a2abc4b6506`
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
src/bin/pbs2to3.rs | 40 +++++++++++++++++++++++-----------------
1 file changed, 23 insertions(+), 17 deletions(-)
diff --git a/src/bin/pbs2to3.rs b/src/bin/pbs2to3.rs
index a9b537fd..177d3b37 100644
--- a/src/bin/pbs2to3.rs
+++ b/src/bin/pbs2to3.rs
@@ -191,34 +191,40 @@ impl Checker {
self.output
.log_info("Checking bootloader configuration...")?;
- // PBS packages version check needs to be run before
- if !self.upgraded {
- self.output
- .log_skip("not yet upgraded, no need to check the presence of systemd-boot")?;
- }
-
- if !Path::new("/etc/kernel/proxmox-boot-uuids").is_file() {
- self.output
- .log_skip("proxmox-boot-tool not used for bootloader configuration")?;
- return Ok(());
- }
-
if !Path::new("/sys/firmware/efi").is_dir() {
self.output
.log_skip("System booted in legacy-mode - no need for systemd-boot")?;
return Ok(());
}
- if Path::new("/usr/share/doc/systemd-boot/changelog.Debian.gz").is_file() {
- self.output.log_pass("systemd-boot is installed")?;
- } else {
+ 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, no need to check the presence of systemd-boot")?;
+ return Ok(());
+ }
+ if Path::new("/usr/share/doc/systemd-boot/changelog.Debian.gz").is_file() {
+ self.output.log_pass("bootloader packages installed correctly")?;
+ return Ok(());
+ }
self.output.log_warn(
"proxmox-boot-tool is used for bootloader configuration in uefi mode \
- but the separate systemd-boot package, existing in Debian Bookworm \
- is not installed.\n\
+ but the separate systemd-boot package, is not installed.\n\
initializing new ESPs will not work unitl the package is installed.",
)?;
+ return Ok(());
+ } else 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, \
+ new grub versions will not be installed to /boot/efi!
+ Install grub-efi-amd64."
+ )?;
+ return Ok(());
+ } else {
+ self.output.log_pass("bootloader packages installed correctly")?;
}
+
Ok(())
}
--
2.39.2
next prev parent reply other threads:[~2023-11-29 14:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-29 14:17 [pbs-devel] [PATCH proxmox-backup 0/2] port 2 checks from pve7to8 to pbs2to3 Stoiko Ivanov
2023-11-29 14:17 ` [pbs-devel] [PATCH proxmox-backup 1/2] pbs2to3: add check for dkms modules Stoiko Ivanov
2023-11-29 14:17 ` Stoiko Ivanov [this message]
2023-11-29 14:26 ` [pbs-devel] applied: [PATCH proxmox-backup 0/2] port 2 checks from pve7to8 to pbs2to3 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=20231129141715.219393-3-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox