[pbs-devel] [PATCH proxmox-backup] pbs2to3: fix boot-mode detection

Stoiko Ivanov s.ivanov at proxmox.com
Wed Aug 9 12:34:26 CEST 2023


/sys/firmware/efi is a directory and std::path::Path seems to detect
only regular files with is_file [0].

Reported in our Enterprise support portal.

Quickly tested the fix on a VM.

https://doc.rust-lang.org/stable/std/path/struct.Path.html#method.is_file

Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
---
technically only needed on master - since the check is not run before
the upgrade
 src/bin/pbs2to3.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bin/pbs2to3.rs b/src/bin/pbs2to3.rs
index a052ae3a..9a18d7b2 100644
--- a/src/bin/pbs2to3.rs
+++ b/src/bin/pbs2to3.rs
@@ -203,7 +203,7 @@ impl Checker {
             return Ok(());
         }
 
-        if !Path::new("/sys/firmware/efi").is_file() {
+        if !Path::new("/sys/firmware/efi").is_dir() {
             self.output
                 .log_skip("System booted in legacy-mode - no need for systemd-boot")?;
             return Ok(());
-- 
2.39.2






More information about the pbs-devel mailing list