mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 09:13:55 -06:00
x86/loader: add -shim option
Add new -shim command line option, wire up for the x86 loader. When specified load shim into the new "etc/boot/shim" fw_cfg file. Needs OVMF changes too to be actually useful. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-ID: <20240905141211.1253307-6-kraxel@redhat.com>
This commit is contained in:
parent
f2594d9284
commit
a5bd044b15
5 changed files with 53 additions and 0 deletions
|
@ -965,6 +965,22 @@ void x86_load_linux(X86MachineState *x86ms,
|
|||
/* kernel without setup header patches */
|
||||
fw_cfg_add_file(fw_cfg, "etc/boot/kernel", kernel, kernel_size);
|
||||
|
||||
if (machine->shim_filename) {
|
||||
GMappedFile *mapped_file;
|
||||
GError *gerr = NULL;
|
||||
|
||||
mapped_file = g_mapped_file_new(machine->shim_filename, false, &gerr);
|
||||
if (!mapped_file) {
|
||||
fprintf(stderr, "qemu: error reading shim %s: %s\n",
|
||||
machine->shim_filename, gerr->message);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
fw_cfg_add_file(fw_cfg, "etc/boot/shim",
|
||||
g_mapped_file_get_contents(mapped_file),
|
||||
g_mapped_file_get_length(mapped_file));
|
||||
}
|
||||
|
||||
if (sev_enabled()) {
|
||||
sev_add_kernel_loader_hashes(&sev_load_ctx, &error_fatal);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue