From: Daan De Meyer Date: Thu, 4 Jul 2024 14:41:53 +0000 (+0200) Subject: Drop default kernel command line X-Git-Tag: v24~61^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e3b45af0b2d26363f7f72a5ed02a126ae60131f8;p=thirdparty%2Fmkosi.git Drop default kernel command line 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. --- diff --git a/NEWS.md b/NEWS.md index 75bdda066..fa8274d48 100644 --- 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 diff --git a/mkosi.conf b/mkosi.conf index 00e14b74b..29c8b1ab9 100644 --- a/mkosi.conf +++ b/mkosi.conf @@ -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 diff --git a/mkosi/config.py b/mkosi/config.py index 1d041fecb..4b25961cc 100644 --- a/mkosi/config.py +++ b/mkosi/config.py @@ -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( diff --git a/mkosi/resources/mkosi.md b/mkosi/resources/mkosi.md index 33c2f3136..c12229006 100644 --- a/mkosi/resources/mkosi.md +++ b/mkosi/resources/mkosi.md @@ -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