Skip to content

Commit b8b7b83

Browse files
committed
chore: extraKernelArgs validation for UKI's
Add validation for `.machine.install.extraKernelArgs`. Fixes: #10339 Signed-off-by: Noel Georgi <[email protected]>
1 parent e2df0c6 commit b8b7b83

File tree

10 files changed

+44
-10
lines changed

10 files changed

+44
-10
lines changed

.github/workflows/ci.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2025-03-11T14:06:53Z by kres ec5ec04.
3+
# Generated on 2025-03-13T09:44:11Z by kres ec5ec04.
44

55
name: default
66
concurrency:
@@ -1575,6 +1575,10 @@ jobs:
15751575
PUSH: "true"
15761576
run: |
15771577
make talosctl-linux-amd64 kernel sd-boot sd-stub initramfs installer-base imager
1578+
- name: talosctl-cni-bundle
1579+
if: github.event_name == 'schedule'
1580+
run: |
1581+
make talosctl-cni-bundle
15781582
- name: image-cache
15791583
env:
15801584
IMAGE_REGISTRY: registry.dev.siderolabs.io

.github/workflows/integration-image-cache-cron.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2025-03-11T13:55:38Z by kres ec5ec04.
3+
# Generated on 2025-03-13T09:44:11Z by kres ec5ec04.
44

55
name: integration-image-cache-cron
66
concurrency:
@@ -80,6 +80,10 @@ jobs:
8080
PUSH: "true"
8181
run: |
8282
make talosctl-linux-amd64 kernel sd-boot sd-stub initramfs installer-base imager
83+
- name: talosctl-cni-bundle
84+
if: github.event_name == 'schedule'
85+
run: |
86+
make talosctl-cni-bundle
8387
- name: image-cache
8488
env:
8589
IMAGE_REGISTRY: registry.dev.siderolabs.io

.kres.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1705,6 +1705,9 @@ spec:
17051705
PLATFORM: linux/amd64,linux/arm64
17061706
IMAGE_REGISTRY: registry.dev.siderolabs.io
17071707
PUSH: true
1708+
- name: talosctl-cni-bundle
1709+
conditions:
1710+
- only-on-schedule
17081711
- name: image-cache
17091712
command: cache-create
17101713
environment:

hack/release.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,20 @@ System extensions must move their directories accordingly for 1.10.
147147
title = "Ingress Firewall"
148148
description = """\
149149
Talos Ingress Firewall now filters access to Kubernetes NodePort services correctly.
150+
"""
151+
152+
[notes.extraKernelArgs]
153+
title = "Extra Kernel Args"
154+
description = """\
155+
Talos 1.10 on fresh install on UEFI systems will now use systemd-boot and UKIs (Unified Kernel Images)[https://uapi-group.org/specifications/specs/unified_kernel_image/].
156+
This means the kernel command line arguments are part of the UKI and cannot be modified without an upgrade to a new UKI.
157+
158+
Upgrades to Talos 1.10 will preseve the existing bootloader (GRUB for non-secureboot) and sd-boot for Secureboot and this change will have no effect.
159+
160+
To build a [boot asset](https://www.talos.dev/v1.10/talos-guides/install/boot-assets/) with extra kernel arguments whether an `installer` or a boot image use either [Image Factory](https://www.talos.dev/v1.10/talos-guides/install/boot-assets/#image-factory) or
161+
[Imager](https://www.talos.dev/v1.10/talos-guides/install/boot-assets/#imager).
162+
163+
This means kernel arguments not part of the UKI will not be preserved across updates and a proper installer image generated via Imager Factory or Imager is required.
150164
"""
151165

152166
[make_deps]

pkg/machinery/config/schemas/config.schema.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2478,9 +2478,9 @@
24782478
},
24792479
"type": "array",
24802480
"title": "extraKernelArgs",
2481-
"description": "Allows for supplying extra kernel args via the bootloader.\nExisting kernel args can be removed by prefixing the argument with a -.\nFor example -console removes all console=\u0026lt;value\u0026gt; arguments, whereas -console=tty0 removes the console=tty0 default argument.\n",
2482-
"markdownDescription": "Allows for supplying extra kernel args via the bootloader.\nExisting kernel args can be removed by prefixing the argument with a `-`.\nFor example `-console` removes all `console=\u003cvalue\u003e` arguments, whereas `-console=tty0` removes the `console=tty0` default argument.",
2483-
"x-intellij-html-description": "\u003cp\u003eAllows for supplying extra kernel args via the bootloader.\nExisting kernel args can be removed by prefixing the argument with a \u003ccode\u003e-\u003c/code\u003e.\nFor example \u003ccode\u003e-console\u003c/code\u003e removes all \u003ccode\u003econsole=\u0026lt;value\u0026gt;\u003c/code\u003e arguments, whereas \u003ccode\u003e-console=tty0\u003c/code\u003e removes the \u003ccode\u003econsole=tty0\u003c/code\u003e default argument.\u003c/p\u003e\n"
2481+
"description": "Allows for supplying extra kernel args via the bootloader.\nExisting kernel args can be removed by prefixing the argument with a -.\nFor example -console removes all console=\u0026lt;value\u0026gt; arguments, whereas -console=tty0 removes the console=tty0 default argument.\nIf Talos is using systemd-boot as a bootloader (default for UEFI) this setting will be ignored.\n",
2482+
"markdownDescription": "Allows for supplying extra kernel args via the bootloader.\nExisting kernel args can be removed by prefixing the argument with a `-`.\nFor example `-console` removes all `console=\u003cvalue\u003e` arguments, whereas `-console=tty0` removes the `console=tty0` default argument.\nIf Talos is using systemd-boot as a bootloader (default for UEFI) this setting will be ignored.",
2483+
"x-intellij-html-description": "\u003cp\u003eAllows for supplying extra kernel args via the bootloader.\nExisting kernel args can be removed by prefixing the argument with a \u003ccode\u003e-\u003c/code\u003e.\nFor example \u003ccode\u003e-console\u003c/code\u003e removes all \u003ccode\u003econsole=\u0026lt;value\u0026gt;\u003c/code\u003e arguments, whereas \u003ccode\u003e-console=tty0\u003c/code\u003e removes the \u003ccode\u003econsole=tty0\u003c/code\u003e default argument.\nIf Talos is using systemd-boot as a bootloader (default for UEFI) this setting will be ignored.\u003c/p\u003e\n"
24842484
},
24852485
"image": {
24862486
"type": "string",

pkg/machinery/config/types/v1alpha1/v1alpha1_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,7 @@ type InstallConfig struct {
812812
// Allows for supplying extra kernel args via the bootloader.
813813
// Existing kernel args can be removed by prefixing the argument with a `-`.
814814
// For example `-console` removes all `console=<value>` arguments, whereas `-console=tty0` removes the `console=tty0` default argument.
815+
// If Talos is using systemd-boot as a bootloader (default for UEFI) this setting will be ignored.
815816
// examples:
816817
// - value: '[]string{"talos.platform=metal", "reboot=k"}'
817818
InstallExtraKernelArgs []string `yaml:"extraKernelArgs,omitempty"`

pkg/machinery/config/types/v1alpha1/v1alpha1_types_doc.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/machinery/config/types/v1alpha1/v1alpha1_validation.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"fmt"
1313
"net"
1414
"net/url"
15+
"os"
1516
"reflect"
1617
"regexp"
1718
"strconv"
@@ -971,6 +972,13 @@ func (c *Config) RuntimeValidate(ctx context.Context, st state.State, mode valid
971972
}
972973
}
973974
}
975+
976+
// if booted using sd-boot, extra kernel arguments are not supported
977+
if _, err := os.Stat("/sys/firmware/efi/efivars/StubInfo-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f"); err == nil {
978+
if len(c.MachineConfig.Install().ExtraKernelArgs()) > 0 {
979+
warnings = append(warnings, "extra kernel arguments are not supported when booting using SDBoot")
980+
}
981+
}
974982
}
975983

976984
return warnings, result.ErrorOrNil()

website/content/v1.10/reference/configuration/v1alpha1/config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1946,7 +1946,7 @@ diskSelector:
19461946
# busPath: /pci0000:00/0000:00:17.0/ata1/host0/target0:0:0/0:0:0:0
19471947
# busPath: /pci0000:00/*
19481948
{{< /highlight >}}</details> | |
1949-
|`extraKernelArgs` |[]string |<details><summary>Allows for supplying extra kernel args via the bootloader.</summary>Existing kernel args can be removed by prefixing the argument with a `-`.<br />For example `-console` removes all `console=<value>` arguments, whereas `-console=tty0` removes the `console=tty0` default argument.</details> <details><summary>Show example(s)</summary>{{< highlight yaml >}}
1949+
|`extraKernelArgs` |[]string |<details><summary>Allows for supplying extra kernel args via the bootloader.</summary>Existing kernel args can be removed by prefixing the argument with a `-`.<br />For example `-console` removes all `console=<value>` arguments, whereas `-console=tty0` removes the `console=tty0` default argument.<br />If Talos is using systemd-boot as a bootloader (default for UEFI) this setting will be ignored.</details> <details><summary>Show example(s)</summary>{{< highlight yaml >}}
19501950
extraKernelArgs:
19511951
- talos.platform=metal
19521952
- reboot=k

website/content/v1.10/schemas/config.schema.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2478,9 +2478,9 @@
24782478
},
24792479
"type": "array",
24802480
"title": "extraKernelArgs",
2481-
"description": "Allows for supplying extra kernel args via the bootloader.\nExisting kernel args can be removed by prefixing the argument with a -.\nFor example -console removes all console=\u0026lt;value\u0026gt; arguments, whereas -console=tty0 removes the console=tty0 default argument.\n",
2482-
"markdownDescription": "Allows for supplying extra kernel args via the bootloader.\nExisting kernel args can be removed by prefixing the argument with a `-`.\nFor example `-console` removes all `console=\u003cvalue\u003e` arguments, whereas `-console=tty0` removes the `console=tty0` default argument.",
2483-
"x-intellij-html-description": "\u003cp\u003eAllows for supplying extra kernel args via the bootloader.\nExisting kernel args can be removed by prefixing the argument with a \u003ccode\u003e-\u003c/code\u003e.\nFor example \u003ccode\u003e-console\u003c/code\u003e removes all \u003ccode\u003econsole=\u0026lt;value\u0026gt;\u003c/code\u003e arguments, whereas \u003ccode\u003e-console=tty0\u003c/code\u003e removes the \u003ccode\u003econsole=tty0\u003c/code\u003e default argument.\u003c/p\u003e\n"
2481+
"description": "Allows for supplying extra kernel args via the bootloader.\nExisting kernel args can be removed by prefixing the argument with a -.\nFor example -console removes all console=\u0026lt;value\u0026gt; arguments, whereas -console=tty0 removes the console=tty0 default argument.\nIf Talos is using systemd-boot as a bootloader (default for UEFI) this setting will be ignored.\n",
2482+
"markdownDescription": "Allows for supplying extra kernel args via the bootloader.\nExisting kernel args can be removed by prefixing the argument with a `-`.\nFor example `-console` removes all `console=\u003cvalue\u003e` arguments, whereas `-console=tty0` removes the `console=tty0` default argument.\nIf Talos is using systemd-boot as a bootloader (default for UEFI) this setting will be ignored.",
2483+
"x-intellij-html-description": "\u003cp\u003eAllows for supplying extra kernel args via the bootloader.\nExisting kernel args can be removed by prefixing the argument with a \u003ccode\u003e-\u003c/code\u003e.\nFor example \u003ccode\u003e-console\u003c/code\u003e removes all \u003ccode\u003econsole=\u0026lt;value\u0026gt;\u003c/code\u003e arguments, whereas \u003ccode\u003e-console=tty0\u003c/code\u003e removes the \u003ccode\u003econsole=tty0\u003c/code\u003e default argument.\nIf Talos is using systemd-boot as a bootloader (default for UEFI) this setting will be ignored.\u003c/p\u003e\n"
24842484
},
24852485
"image": {
24862486
"type": "string",

0 commit comments

Comments
 (0)