Skip to content

Commit 7d7e544

Browse files
dustymabejlebon
authored andcommitted
mantle/kola: drill COSA_TESTISO_DEBUG into platform/metal
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.
1 parent 5327a22 commit 7d7e544

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

mantle/cmd/kola/testiso.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -856,14 +856,6 @@ func testLiveIso(ctx context.Context, inst platform.Install, outdir string, mini
856856
isoKernelArgs = append(isoKernelArgs, liveISOFromRAMKarg)
857857
}
858858

859-
// Sometimes the logs that stream from various virtio streams can be
860-
// incomplete because they depend on services inside the guest.
861-
// When you are debugging earlyboot/initramfs issues this can be
862-
// problematic. Let's add a hook here to enable more debugging.
863-
if _, ok := os.LookupEnv("COSA_TESTISO_DEBUG"); ok {
864-
isoKernelArgs = append(isoKernelArgs, "systemd.log_color=0 systemd.log_level=debug systemd.journald.forward_to_console=1")
865-
}
866-
867859
mach, err := inst.InstallViaISOEmbed(isoKernelArgs, liveConfig, targetConfig, outdir, isOffline, minimal)
868860
if err != nil {
869861
return 0, errors.Wrapf(err, "running iso install")

mantle/platform/metal.go

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ func (inst *Install) PXE(kargs []string, liveIgnition, ignition conf.Conf, offli
123123
}
124124

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

139-
inst.kargs = kargs
140+
inst.kargs = append(renderCosaTestIsoDebugKargs(), kargs...)
140141
inst.ignition = ignition
141142
inst.liveIgnition = liveIgnition
142143

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

367+
// Sometimes the logs that stream from various virtio streams can be
368+
// incomplete because they depend on services inside the guest.
369+
// When you are debugging earlyboot/initramfs issues this can be
370+
// problematic. Let's add a hook here to enable more debugging.
371+
func renderCosaTestIsoDebugKargs() []string {
372+
if _, ok := os.LookupEnv("COSA_TESTISO_DEBUG"); ok {
373+
return []string{"systemd.log_color=0", "systemd.log_level=debug", "systemd.journald.forward_to_console=1"}
374+
} else {
375+
return []string{}
376+
}
377+
}
378+
366379
func (t *installerRun) destroy() error {
367380
t.builder.Close()
368381
if t.tempdir != "" {
@@ -602,6 +615,7 @@ func (inst *Install) InstallViaISOEmbed(kargs []string, liveIgnition, targetIgni
602615
installerConfig := installerConfig{
603616
IgnitionFile: "/var/opt/pointer.ign",
604617
DestDevice: "/dev/vda",
618+
AppendKargs: renderCosaTestIsoDebugKargs(),
605619
}
606620

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

618-
inst.kargs = kargs
632+
inst.kargs = append(renderCosaTestIsoDebugKargs(), kargs...)
619633
inst.ignition = targetIgnition
620634
inst.liveIgnition = liveIgnition
621635

0 commit comments

Comments
 (0)