-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFE] Allow overriding the main kernel serial console on bare-metal #1507
Comments
Another implementation option and probably the simplest, moving the hardcoded console parameters after the cmdline part controlled by Ignition. This way operators would be able to override them. |
The logic regarding kernel parameters is here: https://github.com/flatcar/scripts/blob/main/build_library/grub.cfg#L71-L96:
You can override the default console by providing a value for |
I can indeed get a serial console working with the following post-install script: # Override the default serial console
mount $(blkid -l -t "LABEL=OEM" -o device /dev/disk/by-path/{{ .InstallPath }}) /mnt
cat > /mnt/grub.cfg <<EOF
set linux_console="console=tty0 console={{ .SerialConsole }}"
umount /mnt
EOF Thanks a lot for the help, this does solve my issue. |
Current situation
Flatcar seems to hardcode the following console kernel parameters with disk-based boot on bare-metal:
console=ttyS0,115200n8 console=tty0
. I haven't fully investigated the boot chain, but the likeliest source is/usr/boot/syslinux/root.A.cfg
, which contains the following line:My full cmdline currently looks like this:
Impact
Serial console stops working on hardware using ttyS1 instead of ttyS0 once the kernel is executed by the bootloader. ttyS1 is the default for some manufacturers (ie: Supermicro, Gigabyte), and some do not provide the necessary firmware configuration to change this setting. And even when they do provide this setting, changing the serial console parameters can be a tedious operation to do at scale depending on the hardware Redfish capabilities, and having the ability to adapt the OS provisioning to the default hardware settings would be a lot more flexible.
Sadly, the Linux kernel does not support multiple consoles of the same type and subsequent serial consoles are ignored, like adding
console=ttyS1
afterconsole=ttyS0
in my example above. See the kernel serial console documentation for further details : https://www.kernel.org/doc/html/v6.9/admin-guide/serial-console.htmlIdeal future situation
Ability to override the serial console, ideally in a way that can be easily automated during provisioning.
Implementation options
Off the top of my head, I can think of the following:
kernel_arguments.should_not_exist
. Using this option does not work currently for console flags as it can only act on a subset of the kernel cmdline, but could be expected to.flatcar-install
script could offer a way to customize this parameter as it is the one responsible for writing the initial imageAdditional information
Note that the serial console does work with PXE ramdisks as those artifacts let the operator in control of the full kernel cmdline. It only becomes an issue after
flatcar-install
is run and the server switches to disk-based boot.Also of note, starting the serial console from userland once boot is finished with
systemctl start [email protected]
does not work either. I tried adding ttyS1 to a copy of/usr/share/shadow/securetty
file in/etc
, to no avail. But even if I did manage to get this to work, it would only partially solve my issue as ttyS1 would not receive any kernel message if setup only with systemd.The text was updated successfully, but these errors were encountered: