diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8142b2dbf4..5c7b9668c3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1523,12 +1523,14 @@ jobs: if: github.event_name == 'schedule' env: IMAGE_REGISTRY: registry.dev.siderolabs.io + IMAGER_ARGS: --extra-kernel-arg=console=ttyS0 run: | make iso secureboot-iso - name: images-essential if: github.event_name == 'schedule' env: IMAGE_REGISTRY: registry.dev.siderolabs.io + IMAGER_ARGS: --extra-kernel-arg=console=ttyS0 PLATFORM: linux/amd64 run: | make images-essential @@ -3110,6 +3112,7 @@ jobs: if: github.event_name == 'schedule' env: IMAGE_REGISTRY: registry.dev.siderolabs.io + IMAGER_ARGS: --extra-kernel-arg=console=ttyS0 PLATFORM: linux/amd64 run: | make images-essential @@ -3117,6 +3120,7 @@ jobs: if: github.event_name == 'schedule' env: IMAGE_REGISTRY: registry.dev.siderolabs.io + IMAGER_ARGS: --extra-kernel-arg=console=ttyS0 PLATFORM: linux/amd64 run: | make secureboot-iso diff --git a/.github/workflows/integration-image-factory-cron.yaml b/.github/workflows/integration-image-factory-cron.yaml index f0edcff166..5f0717514d 100644 --- a/.github/workflows/integration-image-factory-cron.yaml +++ b/.github/workflows/integration-image-factory-cron.yaml @@ -1,6 +1,6 @@ # THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. # -# Generated on 2024-05-27T16:20:10Z by kres bcb280a. +# Generated on 2024-08-25T07:59:04Z by kres 8e4bbb4. name: integration-image-factory-cron concurrency: @@ -84,12 +84,14 @@ jobs: if: github.event_name == 'schedule' env: IMAGE_REGISTRY: registry.dev.siderolabs.io + IMAGER_ARGS: --extra-kernel-arg=console=ttyS0 run: | make iso secureboot-iso - name: images-essential if: github.event_name == 'schedule' env: IMAGE_REGISTRY: registry.dev.siderolabs.io + IMAGER_ARGS: --extra-kernel-arg=console=ttyS0 PLATFORM: linux/amd64 run: | make images-essential diff --git a/.github/workflows/integration-trusted-boot-cron.yaml b/.github/workflows/integration-trusted-boot-cron.yaml index 03532f1055..ea0b878ee1 100644 --- a/.github/workflows/integration-trusted-boot-cron.yaml +++ b/.github/workflows/integration-trusted-boot-cron.yaml @@ -1,6 +1,6 @@ # THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. # -# Generated on 2024-05-27T16:20:10Z by kres bcb280a. +# Generated on 2024-08-25T05:01:25Z by kres 8e4bbb4. name: integration-trusted-boot-cron concurrency: @@ -84,6 +84,7 @@ jobs: if: github.event_name == 'schedule' env: IMAGE_REGISTRY: registry.dev.siderolabs.io + IMAGER_ARGS: --extra-kernel-arg=console=ttyS0 PLATFORM: linux/amd64 run: | make images-essential @@ -91,6 +92,7 @@ jobs: if: github.event_name == 'schedule' env: IMAGE_REGISTRY: registry.dev.siderolabs.io + IMAGER_ARGS: --extra-kernel-arg=console=ttyS0 PLATFORM: linux/amd64 run: | make secureboot-iso diff --git a/.kres.yaml b/.kres.yaml index cf7b261714..70e9f4ca06 100644 --- a/.kres.yaml +++ b/.kres.yaml @@ -425,12 +425,14 @@ spec: - only-on-schedule environment: PLATFORM: linux/amd64 + IMAGER_ARGS: "--extra-kernel-arg=console=ttyS0" IMAGE_REGISTRY: registry.dev.siderolabs.io - name: secureboot-iso conditions: - only-on-schedule environment: PLATFORM: linux/amd64 + IMAGER_ARGS: "--extra-kernel-arg=console=ttyS0" IMAGE_REGISTRY: registry.dev.siderolabs.io - name: integration-trusted-boot command: e2e-qemu @@ -1425,12 +1427,14 @@ spec: - only-on-schedule command: iso secureboot-iso environment: + IMAGER_ARGS: "--extra-kernel-arg=console=ttyS0" IMAGE_REGISTRY: registry.dev.siderolabs.io - name: images-essential conditions: - only-on-schedule environment: PLATFORM: linux/amd64 + IMAGER_ARGS: "--extra-kernel-arg=console=ttyS0" IMAGE_REGISTRY: registry.dev.siderolabs.io - name: factory-1.6-iso command: e2e-image-factory diff --git a/cmd/installer/pkg/install/install.go b/cmd/installer/pkg/install/install.go index 7e2a4442fa..eb7682227d 100644 --- a/cmd/installer/pkg/install/install.go +++ b/cmd/installer/pkg/install/install.go @@ -12,6 +12,7 @@ import ( "log" "os" "path/filepath" + "slices" "syscall" "time" @@ -148,6 +149,15 @@ func Install(ctx context.Context, p runtime.Platform, mode Mode, opts *Options) cmdline.SetAll(overlayOpts.KernelArgs) } + // preserve console=ttyS0 if it was already present in cmdline for metal platform + existingCmdline := procfs.ProcCmdline() + + if *existingCmdline.Get(constants.KernelParamPlatform).First() == constants.PlatformMetal && existingCmdline.Get("console").Contains("ttyS0") { + if !slices.Contains(opts.ExtraKernelArgs, "console=ttyS0") { + cmdline.Append("console", "ttyS0") + } + } + if err := cmdline.AppendAll( opts.ExtraKernelArgs, procfs.WithOverwriteArgs("console"), diff --git a/hack/release.toml b/hack/release.toml index 2b1052a20d..9b3de8ec44 100644 --- a/hack/release.toml +++ b/hack/release.toml @@ -198,6 +198,14 @@ Talos Linux now supports a kernel command line argument `talos.device.settle_tim title = "Platform Support" description = """\ Talos Linux now supports Apache CloudStack platform. +""" + + [notes.metal-image] + title = "Metal images" + description = """\ +Starting with Talos 1.8, `console=ttyS0` kernel argument is removed from the metal images and installer. If running virtualized in QEMU (For eg: Proxmox), this can be added as an extra kernel argument if needed via Image Factory or using Imager. + +This should fix slow boot or no console output issues on most bare metal hardware. """ [make_deps] diff --git a/internal/app/machined/pkg/runtime/v1alpha1/platform/metal/metal.go b/internal/app/machined/pkg/runtime/v1alpha1/platform/metal/metal.go index 6ed75980a3..be7246d7a6 100644 --- a/internal/app/machined/pkg/runtime/v1alpha1/platform/metal/metal.go +++ b/internal/app/machined/pkg/runtime/v1alpha1/platform/metal/metal.go @@ -162,7 +162,7 @@ func (m *Metal) KernelArgs(arch string) procfs.Parameters { switch arch { case "amd64": return []*procfs.Parameter{ - procfs.NewParameter("console").Append("ttyS0").Append("tty0"), + procfs.NewParameter("console").Append("tty0"), } case "arm64": return []*procfs.Parameter{ diff --git a/pkg/imager/imager.go b/pkg/imager/imager.go index 19bfa6b4c6..13fc85b3e9 100644 --- a/pkg/imager/imager.go +++ b/pkg/imager/imager.go @@ -335,6 +335,11 @@ func (i *Imager) buildCmdline() error { // platform kernel args cmdline.Append(constants.KernelParamPlatform, p.Name()) + + if quirks.New(i.prof.Version).SupportsMetalPlatformConsoleTTYS0() && i.prof.Platform == constants.PlatformMetal { + cmdline.Append("console", "ttyS0") + } + cmdline.SetAll(p.KernelArgs(i.prof.Arch).Strings()) // board kernel args diff --git a/pkg/machinery/imager/quirks/quirks.go b/pkg/machinery/imager/quirks/quirks.go index 1b8354ca57..fb2ebbc514 100644 --- a/pkg/machinery/imager/quirks/quirks.go +++ b/pkg/machinery/imager/quirks/quirks.go @@ -98,3 +98,16 @@ func (q Quirks) SupportsMultidoc() bool { return q.v.GTE(minVersionMultidoc) } + +// maxVersionMetalPlatformConsoleTTYS0Dropped is the version that dropped console=ttyS0 for metal image. +var maxVersionMetalPlatformConsoleTTYS0Dropped = semver.MustParse("1.8.0") + +// SupportsMetalPlatformConsoleTTYS0 returns true if the Talos version supports already has console=ttyS0 kernel argument. +func (q Quirks) SupportsMetalPlatformConsoleTTYS0() bool { + // if the version doesn't parse, we assume it's latest Talos + if q.v == nil { + return false + } + + return q.v.LT(maxVersionMetalPlatformConsoleTTYS0Dropped) +} diff --git a/website/content/v1.8/talos-guides/configuration/logging.md b/website/content/v1.8/talos-guides/configuration/logging.md index ac926c03ff..fd169ef469 100644 --- a/website/content/v1.8/talos-guides/configuration/logging.md +++ b/website/content/v1.8/talos-guides/configuration/logging.md @@ -12,7 +12,7 @@ Kernel messages can be retrieved with `talosctl dmesg` command: ```sh $ talosctl -n 172.20.1.2 dmesg -172.20.1.2: kern: info: [2021-11-10T10:09:37.662764956Z]: Command line: init_on_alloc=1 slab_nomerge pti=on consoleblank=0 nvme_core.io_timeout=4294967295 printk.devkmsg=on ima_template=ima-ng ima_appraise=fix ima_hash=sha512 console=ttyS0 reboot=k panic=1 talos.shutdown=halt talos.platform=metal talos.config=http://172.20.1.1:40101/config.yaml +172.20.1.2: kern: info: [2021-11-10T10:09:37.662764956Z]: Command line: init_on_alloc=1 slab_nomerge pti=on consoleblank=0 nvme_core.io_timeout=4294967295 printk.devkmsg=on ima_template=ima-ng ima_appraise=fix ima_hash=sha512 reboot=k panic=1 talos.shutdown=halt talos.platform=metal talos.config=http://172.20.1.1:40101/config.yaml [...] ``` diff --git a/website/content/v1.8/talos-guides/install/bare-metal-platforms/matchbox.md b/website/content/v1.8/talos-guides/install/bare-metal-platforms/matchbox.md index 95bbd76d0f..002a59428a 100644 --- a/website/content/v1.8/talos-guides/install/bare-metal-platforms/matchbox.md +++ b/website/content/v1.8/talos-guides/install/bare-metal-platforms/matchbox.md @@ -1,7 +1,7 @@ --- title: "Matchbox" description: "In this guide we will create an HA Kubernetes cluster with 3 worker nodes using an existing load balancer and matchbox deployment." -aliases: +aliases: - ../../../bare-metal-platforms/matchbox --- @@ -67,7 +67,6 @@ Download these files from the [release](https://github.com/siderolabs/talos/rele "slab_nomerge", "pti=on", "console=tty0", - "console=ttyS0", "printk.devkmsg=on", "talos.platform=metal", "talos.config=http://matchbox.talos.dev/assets/controlplane.yaml" @@ -93,7 +92,6 @@ Download these files from the [release](https://github.com/siderolabs/talos/rele "slab_nomerge", "pti=on", "console=tty0", - "console=ttyS0", "printk.devkmsg=on", "talos.platform=metal", "talos.config=http://matchbox.talos.dev/assets/worker.yaml" diff --git a/website/content/v1.8/talos-guides/install/bare-metal-platforms/secureboot.md b/website/content/v1.8/talos-guides/install/bare-metal-platforms/secureboot.md index da15ad54ff..7a36c5648e 100644 --- a/website/content/v1.8/talos-guides/install/bare-metal-platforms/secureboot.md +++ b/website/content/v1.8/talos-guides/install/bare-metal-platforms/secureboot.md @@ -198,7 +198,7 @@ output: kind: iso outFormat: raw skipped initramfs rebuild (no system extensions) -kernel command line: talos.platform=metal console=ttyS0 console=tty0 init_on_alloc=1 slab_nomerge pti=on consoleblank=0 nvme_core.io_timeout=4294967295 printk.devkmsg=on ima_template=ima-ng ima_appraise=fix ima_hash=sha512 lockdown=confidentiality +kernel command line: talos.platform=metal console=tty0 init_on_alloc=1 slab_nomerge pti=on consoleblank=0 nvme_core.io_timeout=4294967295 printk.devkmsg=on ima_template=ima-ng ima_appraise=fix ima_hash=sha512 lockdown=confidentiality UKI ready ISO ready output asset path: /out/metal-amd64-secureboot.iso @@ -236,7 +236,7 @@ output: kind: installer outFormat: raw skipped initramfs rebuild (no system extensions) -kernel command line: talos.platform=metal console=ttyS0 console=tty0 init_on_alloc=1 slab_nomerge pti=on consoleblank=0 nvme_core.io_timeout=4294967295 printk.devkmsg=on ima_template=ima-ng ima_appraise=fix ima_hash=sha512 lockdown=confidentiality +kernel command line: talos.platform=metal console=tty0 init_on_alloc=1 slab_nomerge pti=on consoleblank=0 nvme_core.io_timeout=4294967295 printk.devkmsg=on ima_template=ima-ng ima_appraise=fix ima_hash=sha512 lockdown=confidentiality UKI ready installer container image ready output asset path: /out/installer-amd64-secureboot.tar