[pve-devel] [PATCH installer v3 03/20] low level: run env: ensure `secure_boot` property is dumped as int

Christoph Heiss c.heiss at proxmox.com
Wed Aug 21 11:40:05 CEST 2024


Previously, in the "false" case, it would serialize to an empty string.
In the future this property will be deserialized by (type-safe) Rust
code.

Signed-off-by: Christoph Heiss <c.heiss at proxmox.com>
---
Changes v2 -> v3:
  * new patch, found by Aaron

 Proxmox/Install/RunEnv.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Proxmox/Install/RunEnv.pm b/Proxmox/Install/RunEnv.pm
index 7eaf96a..13ee8d8 100644
--- a/Proxmox/Install/RunEnv.pm
+++ b/Proxmox/Install/RunEnv.pm
@@ -291,7 +291,7 @@ sub query_installation_environment : prototype() {
 	    log_warn("Failed to read secure boot state: $@\n");
 	} else {
 	    my @secureboot = unpack("CCCCC", $content);
-	    $output->{secure_boot} = $secureboot[4] == 1;
+	    $output->{secure_boot} = $secureboot[4] == 1 ? 1 : 0;
 	}
     }
 
-- 
2.45.2





More information about the pve-devel mailing list