diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0d12762..1de5326 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,6 +7,8 @@ jobs: - uses: actions/checkout@v4 - name: Install Rust uses: dtolnay/rust-toolchain@nightly + with: + toolchain: nightly-2024-06-01 - name: Cache Cargo uses: Swatinem/rust-cache@v2 with: diff --git a/towboot/src/boot/config_tables.rs b/towboot/src/boot/config_tables.rs index f16517d..2461a29 100644 --- a/towboot/src/boot/config_tables.rs +++ b/towboot/src/boot/config_tables.rs @@ -11,6 +11,8 @@ use uefi::table::cfg::{ SMBIOS3_GUID, }; +static mut RSDP_V2_SET: bool = false; + /// Go through all of the configuration tables. /// Some of them are interesting for Multiboot2. pub(super) fn parse_for_multiboot( @@ -49,12 +51,17 @@ fn handle_acpi(table: &ConfigTableEntry, info_builder: &mut InfoBuilder) { rsdp.revision(), rsdp.rsdt_address(), ); } else { - info_builder.set_rsdp_v2( - rsdp.signature(), rsdp.checksum(), - rsdp.oem_id().as_bytes()[0..6].try_into().unwrap(), - rsdp.revision(), rsdp.rsdt_address(), rsdp.length(), - rsdp.xsdt_address(), rsdp.ext_checksum(), - ); + unsafe { + if !RSDP_V2_SET { + info_builder.set_rsdp_v2( + rsdp.signature(), rsdp.checksum(), + rsdp.oem_id().as_bytes()[0..6].try_into().unwrap(), + rsdp.revision(), rsdp.rsdt_address(), rsdp.length(), + rsdp.xsdt_address(), rsdp.ext_checksum(), + ); + RSDP_V2_SET = true; + } + } } }