From 03a9f822b3e3d09993429dac87705bd6fdc0155d Mon Sep 17 00:00:00 2001 From: Stoiko Ivanov Date: Wed, 9 Aug 2023 10:34:26 +0000 Subject: [PATCH] pbs2to3: fix boot-mode detection /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 --- 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 a052ae3a8..9a18d7b2f 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(());