Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9317,6 +9317,7 @@ dependencies = [
"uefi_specs",
"vmgs",
"vmgs_format",
"winapi",
]

[[package]]
Expand Down
8 changes: 8 additions & 0 deletions Guide/src/dev_guide/dev_tools/vmgstool.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ variables without parsers:

`vmgstool.exe uefi-nvram dump --filepath <vmgs file path> --keypath <key file path> --truncate`

### Read DLL File to Write IGVMfile to VMGS

Additionally, the VmgsTool contains a tool to read the IGVMfile from a DLL (passed in as a data file)
and write it to VMGS FileId 8 (GUEST_FIRMWARE). To do this pass one of three resource codes
(nonconfidential, snp, tdx, snp_no_hcl, tdx_no_hcl) into the cmdline tool:

`vmgstool.exe copy-igvmfile --filepath <vmgs file path> --keypath <key file path> --datapath <dll path> --resource-code <code>`

### Delete Boot Variables to Recover a VM that Fails to Boot

A VM may fail to boot if the disk configuration changes and
Expand Down
7 changes: 7 additions & 0 deletions vm/vmgs/vmgstool/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ serde_json = { workspace = true, features = ["std"] }
thiserror.workspace = true
ucs2.workspace = true

[target.'cfg(windows)'.dependencies.winapi]
features = [
"libloaderapi",
"errhandlingapi",
]
workspace = true

[dev-dependencies]
tempfile.workspace = true

Expand Down
1 change: 1 addition & 0 deletions vm/vmgs/vmgstool/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ fn main() {
if cfg!(feature = "encryption_ossl") || cfg!(feature = "encryption_win") {
println!("cargo:rustc-cfg=with_encryption")
}
println!("cargo:rustc-check-cfg=cfg(guest_arch, values(\"x86_64\"))");
}
Loading