Skip to content
Merged
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
4 changes: 4 additions & 0 deletions nodeinstaller/internal/kataconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ func KataRuntimeConfig(
config.Agent["kata"]["enable_debug"] = true
config.Agent["kata"]["debug_console_enabled"] = true
config.Runtime["enable_debug"] = true
// Use legacy serial (ttyS0) instead of virtio console (hvc0) to capture
// early boot output from OVMF firmware. The console watcher reads this
// and logs it to the journal.
config.Hypervisor["qemu"]["use_legacy_serial"] = true
Comment thread
burgerdev marked this conversation as resolved.
}
// For larger images, we've been running into timeouts in e2e tests.
config.Agent["kata"]["dial_timeout"] = 120
Expand Down
17 changes: 13 additions & 4 deletions overlays/sets/debug.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,19 @@

_final: prev: {
contrastPkgs = prev.contrastPkgs.overrideScope (
_final: prev: {
contrast = prev.contrast.overrideScope (
_final: prev: {
node-installer-image = prev.node-installer-image.override {
contrastPkgsFinal: contrastPkgsPrev: {
# Build OVMF with debug output to serial port.
OVMF-SNP = contrastPkgsPrev.OVMF-SNP.override {
debug = true;
};
OVMF-TDX = contrastPkgsPrev.OVMF-TDX.override {
debug = true;
};
contrast = contrastPkgsPrev.contrast.overrideScope (
_contrastFinal: contrastPrev: {
node-installer-image = contrastPrev.node-installer-image.override {
inherit (contrastPkgsFinal) OVMF-SNP;
inherit (contrastPkgsFinal) OVMF-TDX;
Comment on lines +17 to +18
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this actually needed? shouldn't it propagate automatically via the fixpoint?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

withDebug = true;
};
}
Expand Down
5 changes: 5 additions & 0 deletions packages/by-name/OVMF-SNP/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@

{
edk2,
lib,
nasm,
acpica-tools,
debug ? false,
}:

edk2.mkDerivation "OvmfPkg/AmdSev/AmdSevX64.dsc" {
name = "OVMF-SNP";

buildFlags = lib.optionals debug [ "-D DEBUG_ON_SERIAL_PORT=TRUE" ];
buildConfig = if debug then "DEBUG" else "RELEASE";

postPatch = ''
touch OvmfPkg/AmdSev/Grub/grub.efi
'';
Expand Down
8 changes: 8 additions & 0 deletions packages/by-name/kata/runtime/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,17 @@ buildGoModule (finalAttrs: {
"root=/dev/vda1"
"rootflags=ro"
"rootfstype=erofs"
]
# In debug mode, use legacy serial (ttyS0) instead of virtio console (hvc0/hvc1)
# to capture OVMF firmware output via kata's console watcher.
# This must match use_legacy_serial=true set in kataconfig/config.go for debug.
++ lib.optionals (!debug) [
"console=hvc0"
"console=hvc1"
]
++ lib.optionals debug [
"console=ttyS0"
]
++ lib.optionals debug [
"debug"
"systemd.show_status=true"
Expand Down
Loading