]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Drop default kernel command line
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 4 Jul 2024 14:41:53 +0000 (16:41 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 4 Jul 2024 14:45:25 +0000 (16:45 +0200)
All the latest releases of distributions now have a systemd stub
that knows how to read extra kernel command line arguments from
SMBIOS (It was backported to CentOS Stream 9), so let's drop the
default kernel command line and rely completely on passing the
console to use via SMBIOS.

This makes sure that users trying to deploy our images on bare metal
have a working console. Users that want to access the system via the
serial console will have to add the required console= argument
themselves.

NEWS.md
mkosi.conf
mkosi/config.py
mkosi/resources/mkosi.md

diff --git a/NEWS.md b/NEWS.md
index 75bdda066ddb6ee2faaa9e3fe5cbedbffbc80cf9..fa8274d48a240b5a25d3e5fcf463975e6a7b4866 100644 (file)
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,5 +1,12 @@
 # mkosi Changelog
 
+## v24
+
+- The default kernel command line of `console=ttyS0` (or equivalent for
+  other architectures) has been removed. The required `console=`
+  argument to have the kernel output to the serial console has to be
+  added manually from `v24` onwards.
+
 ## v23.1
 
 - Respin due to git tag mismatch
index 00e14b74bd816f9c4d91d9642e4e49bd0b547a53..29c8b1ab977b53745764e0d064e3f5f0c459f00b 100644 (file)
@@ -34,7 +34,7 @@ RemoveFiles=
         /usr/lib/kernel/install.d/50-dracut.install
 
 # Make sure that SELinux doesn't run in enforcing mode even if it's pulled in as a dependency.
-KernelCommandLine=console=ttyS0 enforcing=0
+KernelCommandLine=enforcing=0
 
 [Host]
 @QemuMem=4G
index 1d041fecbe567149a0f65f2f5c6c51d0a3e7b505..4b25961cc7921d1a972e068576ce626adb0aada9 100644 (file)
@@ -741,10 +741,6 @@ def config_default_proxy_url(namespace: argparse.Namespace) -> Optional[str]:
     return None
 
 
-def config_default_kernel_command_line(namespace: argparse.Namespace) -> list[str]:
-    return [f"console={namespace.architecture.default_serial_tty()}"]
-
-
 def make_enum_parser(type: type[StrEnum]) -> Callable[[str], StrEnum]:
     def parse_enum(value: str) -> StrEnum:
         try:
@@ -2449,8 +2445,6 @@ SETTINGS = (
         metavar="OPTIONS",
         section="Content",
         parse=config_make_list_parser(delimiter=" "),
-        default_factory_depends=("architecture",),
-        default_factory=config_default_kernel_command_line,
         help="Set the kernel command line (only bootable images)",
     ),
     ConfigSetting(
index 33c2f3136b099a393775f99060554fba5caa429c..c122290060d445c8e9cb75e6fb8bb128977b46d9 100644 (file)
@@ -1065,8 +1065,6 @@ boolean argument: either `1`, `yes`, or `true` to enable, or `0`, `no`,
 
 `KernelCommandLine=`, `--kernel-command-line=`
 :   Use the specified kernel command line when building images.
-    Defaults to `console=ttyS0`. For `arm`, `s390` and `ppc`, `ttyS0` is replaced
-    with `ttyAMA0`, `ttysclp0` or `hvc0`, respectively.
 
 `KernelModulesInclude=`, `--kernel-modules-include=`
 :   Takes a list of regex patterns that specify kernel modules to include in the image. Patterns should be