Skip to content

Commit

Permalink
mantle/kola: drill COSA_TESTISO_DEBUG into platform/metal
Browse files Browse the repository at this point in the history
And also have it apply to the installed target machine (not just the
install boot) such that we can try to get more information about
failures in the first boot (Ignition boot) of that machine.
  • Loading branch information
dustymabe authored and jlebon committed Sep 17, 2024
1 parent 5327a22 commit 7d7e544
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
8 changes: 0 additions & 8 deletions mantle/cmd/kola/testiso.go
Original file line number Diff line number Diff line change
Expand Up @@ -856,14 +856,6 @@ func testLiveIso(ctx context.Context, inst platform.Install, outdir string, mini
isoKernelArgs = append(isoKernelArgs, liveISOFromRAMKarg)
}

// Sometimes the logs that stream from various virtio streams can be
// incomplete because they depend on services inside the guest.
// When you are debugging earlyboot/initramfs issues this can be
// problematic. Let's add a hook here to enable more debugging.
if _, ok := os.LookupEnv("COSA_TESTISO_DEBUG"); ok {
isoKernelArgs = append(isoKernelArgs, "systemd.log_color=0 systemd.log_level=debug systemd.journald.forward_to_console=1")
}

mach, err := inst.InstallViaISOEmbed(isoKernelArgs, liveConfig, targetConfig, outdir, isOffline, minimal)
if err != nil {
return 0, errors.Wrapf(err, "running iso install")
Expand Down
20 changes: 17 additions & 3 deletions mantle/platform/metal.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ func (inst *Install) PXE(kargs []string, liveIgnition, ignition conf.Conf, offli
}

installerConfig := installerConfig{
Console: []string{consoleKernelArgument[coreosarch.CurrentRpmArch()]},
Console: []string{consoleKernelArgument[coreosarch.CurrentRpmArch()]},
AppendKargs: renderCosaTestIsoDebugKargs(),
}
installerConfigData, err := yaml.Marshal(installerConfig)
if err != nil {
Expand All @@ -136,7 +137,7 @@ func (inst *Install) PXE(kargs []string, liveIgnition, ignition conf.Conf, offli
liveIgnition.AddFile("/etc/coreos/installer.d/mantle.yaml", string(installerConfigData), mode)
}

inst.kargs = kargs
inst.kargs = append(renderCosaTestIsoDebugKargs(), kargs...)
inst.ignition = ignition
inst.liveIgnition = liveIgnition

Expand Down Expand Up @@ -363,6 +364,18 @@ func renderInstallKargs(t *installerRun, offline bool) []string {
return args
}

// Sometimes the logs that stream from various virtio streams can be
// incomplete because they depend on services inside the guest.
// When you are debugging earlyboot/initramfs issues this can be
// problematic. Let's add a hook here to enable more debugging.
func renderCosaTestIsoDebugKargs() []string {
if _, ok := os.LookupEnv("COSA_TESTISO_DEBUG"); ok {
return []string{"systemd.log_color=0", "systemd.log_level=debug", "systemd.journald.forward_to_console=1"}
} else {
return []string{}
}
}

func (t *installerRun) destroy() error {
t.builder.Close()
if t.tempdir != "" {
Expand Down Expand Up @@ -602,6 +615,7 @@ func (inst *Install) InstallViaISOEmbed(kargs []string, liveIgnition, targetIgni
installerConfig := installerConfig{
IgnitionFile: "/var/opt/pointer.ign",
DestDevice: "/dev/vda",
AppendKargs: renderCosaTestIsoDebugKargs(),
}

// XXX: https://github.com/coreos/coreos-installer/issues/1171
Expand All @@ -615,7 +629,7 @@ func (inst *Install) InstallViaISOEmbed(kargs []string, liveIgnition, targetIgni
installerConfig.AppendKargs = append(installerConfig.AppendKargs, "rd.multipath=default", "root=/dev/disk/by-label/dm-mpath-root", "rw")
}

inst.kargs = kargs
inst.kargs = append(renderCosaTestIsoDebugKargs(), kargs...)
inst.ignition = targetIgnition
inst.liveIgnition = liveIgnition

Expand Down

0 comments on commit 7d7e544

Please sign in to comment.