[pbs-devel] [PATCH v4 proxmox-backup 2/5] node: status: added bootmode

Gabriel Goller g.goller at proxmox.com
Wed Nov 29 13:44:08 CET 2023


On 11/29/23 11:18, Wolfgang Bumiller wrote:
> On Wed, Nov 29, 2023 at 10:07:43AM +0100, Gabriel Goller wrote:
>> Added field that shows the bootmode of the node. The bootmode is either
>> Legacy Bios, EFI, or EFI (Secure Boot). To detect the mode we use the
>> exact same method as in pve: We check if the `/sys/firmware/efi` folder
>> exists, then check if the `SecureBoot-xx...` file in the `efivars`
>> directory has the SecureBoot flag enabled.
>>
>> Signed-off-by: Gabriel Goller <g.goller at proxmox.com>
>> ---
>>   pbs-api-types/src/node.rs | 30 +++++++++++++++++++++++++++---
>>   src/api2/node/status.rs   | 29 +++++++++++++++++++++++++++--
>>   2 files changed, 54 insertions(+), 5 deletions(-)
>>
>> diff --git a/pbs-api-types/src/node.rs b/pbs-api-types/src/node.rs
>> index 704215bb..ab626157 100644
>> --- a/pbs-api-types/src/node.rs
>> +++ b/pbs-api-types/src/node.rs
>> @@ -1,9 +1,8 @@
>> -use serde::{Deserialize, Serialize};
>>   use proxmox_schema::*;
>> +use serde::{Deserialize, Serialize};
>>   
>>   use crate::StorageStatus;
>>   
>> -
>>   #[api]
>>   #[derive(Serialize, Deserialize, Default)]
>>   #[serde(rename_all = "kebab-case")]
>> @@ -39,6 +38,29 @@ pub struct NodeInformation {
>>       pub fingerprint: String,
>>   }
>>   
>> +
>> +#[api]
>> +#[derive(Serialize, Deserialize, Copy, Clone)]
>> +#[serde(rename_all = "kebab-case")]
>> +/// The possible BootModes
>> +pub enum BootMode {
>> +    /// The BootMode is EFI/UEFI
>> +    Efi,
>> +    /// The BootMode is Legacy BIOS
>> +    LegacyBios,
>> +}
> ^ Should be able to have a From<proxmox_sys::boot_mode::BootMode> here.
I don't know if we want to pull in `proxmox_sys` into `pbs-api-types`?




More information about the pbs-devel mailing list