Skip to content

Commit ad86b05

Browse files
authored
underhill_core: use correct uefi template on arm (microsoft#1605) (microsoft#1676)
Fix an old TODO to use the correct UEFI template on ARM.
1 parent 0627d92 commit ad86b05

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

openhcl/underhill_core/src/worker.rs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2005,14 +2005,25 @@ async fn new_underhill_vm(
20052005
use vmm_core::emuplat::hcl_compat_uefi_nvram_storage::VmgsStorageBackendAdapter;
20062006

20072007
// map the GET's template enum onto the hardcoded secureboot template type
2008-
// TODO: will need to update this code for underhill on ARM
20092008
let base_vars = match dps.general.secure_boot_template {
20102009
SecureBootTemplateType::None => CustomVars::default(),
20112010
SecureBootTemplateType::MicrosoftWindows => {
2012-
hyperv_secure_boot_templates::x64::microsoft_windows()
2011+
if cfg!(guest_arch = "x86_64") {
2012+
hyperv_secure_boot_templates::x64::microsoft_windows()
2013+
} else if cfg!(guest_arch = "aarch64") {
2014+
hyperv_secure_boot_templates::aarch64::microsoft_windows()
2015+
} else {
2016+
anyhow::bail!("no secure boot template for current guest_arch")
2017+
}
20132018
}
20142019
SecureBootTemplateType::MicrosoftUefiCertificateAuthority => {
2015-
hyperv_secure_boot_templates::x64::microsoft_uefi_ca()
2020+
if cfg!(guest_arch = "x86_64") {
2021+
hyperv_secure_boot_templates::x64::microsoft_uefi_ca()
2022+
} else if cfg!(guest_arch = "aarch64") {
2023+
hyperv_secure_boot_templates::aarch64::microsoft_uefi_ca()
2024+
} else {
2025+
anyhow::bail!("no secure boot template for current guest_arch")
2026+
}
20162027
}
20172028
};
20182029

0 commit comments

Comments
 (0)