From 36cc9cc1ec14db6ebfd645cb33d70c7d6fdbfc42 Mon Sep 17 00:00:00 2001 From: Aiden McClelland Date: Mon, 29 Jul 2024 12:20:13 -0600 Subject: [PATCH] fix firmware checker --- core/startos/src/firmware.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/startos/src/firmware.rs b/core/startos/src/firmware.rs index 7e7b9d70f..a70cf9e47 100644 --- a/core/startos/src/firmware.rs +++ b/core/startos/src/firmware.rs @@ -13,8 +13,8 @@ use crate::util::Invoke; use crate::PLATFORM; /// Part of the Firmware, look there for more about -#[derive(Clone, Deserialize, Serialize)] -#[serde(rename_all = "camelCase")] +#[derive(Debug, Clone, Deserialize, Serialize)] +#[serde(rename_all = "kebab-case")] pub struct VersionMatcher { /// Strip this prefix on the version matcher semver_prefix: Option, @@ -27,8 +27,8 @@ pub struct VersionMatcher { /// Inside a file that is firmware.json, we /// wanted a structure that could help decide what to do /// for each of the firmware versions -#[derive(Clone, Deserialize, Serialize)] -#[serde(rename_all = "camelCase")] +#[derive(Debug, Clone, Deserialize, Serialize)] +#[serde(rename_all = "kebab-case")] pub struct Firmware { id: String, /// This is the platform(s) the firmware was built for @@ -49,6 +49,7 @@ pub fn display_firmware_update_result(result: RequiresReboot) { } } +#[instrument] pub async fn check_for_firmware_update() -> Result, Error> { let system_product_name = String::from_utf8( Command::new("dmidecode") @@ -118,6 +119,7 @@ pub async fn check_for_firmware_update() -> Result, Error> { /// that the firmware was the correct and updated for /// systems like the Pure System that a new firmware /// was released and the updates where pushed through the pure os. +#[instrument] pub async fn update_firmware(firmware: Firmware) -> Result<(), Error> { let id = &firmware.id; let firmware_dir = Path::new("/usr/lib/startos/firmware");