Skip to content

Commit

Permalink
node-installer: add boot roms for QEMU
Browse files Browse the repository at this point in the history
QEMU looks for these files when booting the VM and fails if it can't
find them.
  • Loading branch information
Freax13 committed Jul 15, 2024
1 parent a02c61a commit c9ef1c7
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion node-installer/node-installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func run(ctx context.Context, fetcher assetFetcher, platform platforms.Platform,
if err := os.MkdirAll(binDir, os.ModePerm); err != nil {
return fmt.Errorf("creating runtime bin directory: %w", err)
}
if err := os.MkdirAll(filepath.Join(hostMount, runtimeBase, "share"), os.ModePerm); err != nil {
if err := os.MkdirAll(filepath.Join(hostMount, runtimeBase, "share/qemu"), os.ModePerm); err != nil {
return fmt.Errorf("creating runtime share directory: %w", err)
}
if err := os.MkdirAll(filepath.Join(hostMount, runtimeBase, "etc"), os.ModePerm); err != nil {
Expand Down
24 changes: 24 additions & 0 deletions packages/by-name/kata/contrast-node-installer-image/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@ let
url = "file:///opt/edgeless/bin/kata-runtime";
path = "/opt/edgeless/${runtime-handler}/bin/kata-runtime";
}
{
url = "file:///opt/edgeless/share/qemu/kvmvapic.bin";
path = "/opt/edgeless/${runtime-handler}/share/qemu/kvmvapic.bin";
}
{
url = "file:///opt/edgeless/share/qemu/linuxboot_dma.bin";
path = "/opt/edgeless/${runtime-handler}/share/qemu/linuxboot_dma.bin";
}
{
url = "file:///opt/edgeless/share/qemu/efi-virtio.rom";
path = "/opt/edgeless/${runtime-handler}/share/qemu/efi-virtio.rom";
}
];
runtimeHandlerName = runtime-handler;
inherit (kata.runtime-class-files) debugRuntime;
Expand Down Expand Up @@ -99,6 +111,18 @@ let
source = kata.runtime-class-files.qemu-bin;
destination = "/opt/edgeless/bin/qemu-system-x86_64";
}
{
source = "${kata.runtime-class-files.qemu-share}/kvmvapic.bin";
destination = "/opt/edgeless/share/qemu/kvmvapic.bin";
}
{
source = "${kata.runtime-class-files.qemu-share}/linuxboot_dma.bin";
destination = "/opt/edgeless/share/qemu/linuxboot_dma.bin";
}
{
source = "${kata.runtime-class-files.qemu-share}/efi-virtio.rom";
destination = "/opt/edgeless/share/qemu/efi-virtio.rom";
}
];
};

Expand Down
2 changes: 2 additions & 0 deletions packages/by-name/kata/runtime-class-files/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ let
kernel = "${kata.kata-kernel-uvm}/bzImage";

qemu-bin = "${qemu-static}/bin/qemu-system-x86_64";
qemu-share = "${qemu-static}/share/qemu";

ovmf = "${sev-ovmf}/FV/OVMF.fd";

Expand All @@ -40,6 +41,7 @@ stdenvNoCC.mkDerivation {
kernel
image
qemu-bin
qemu-share
containerd-shim-contrast-cc-v2
ovmf
kata-runtime
Expand Down

0 comments on commit c9ef1c7

Please sign in to comment.