| 20 May 2021 |
andi- | I am guessing IRC | 12:39:27 |
| 4 Apr 2025 |
ElvishJerricco | *
You can specify multiple console= options on the kernel command line.
The behavior is well defined when each device type is mentioned only once. In this case, the output will appear on all requested consoles. And the last device will be used when you open /dev/console. So, for example:
console=ttyS1,9600 console=tty0
defines that opening /dev/console will get you the current foreground virtual console, and kernel messages will appear on both the VGA console and the 2nd serial port (ttyS1 or COM2) at 9600 baud.
The behavior is more complicated when the same device type is defined more times. In this case, there are the following two rules:
- The output will appear only on the first device of each defined type.
- /dev/console will be associated with the first registered device. Where the registration order depends on how kernel initializes various subsystems.This rule is used also when the last console= parameter is not used for other reasons. For example, because of a typo or because the hardware is not available.
The result might be surprising. For example, the following two command lines have the same result:
console=ttyS1,9600 console=tty0 console=tty1
console=tty0 console=ttyS1,9600 console=tty1
| 06:40:07 |
| 20 May 2021 |
| kevincox joined the room. | 13:25:08 |
| 4 Apr 2025 |
ElvishJerricco | *
You can specify multiple console= options on the kernel command line.
The behavior is well defined when each device type is mentioned only once. In this case, the output will appear on all requested consoles. And the last device will be used when you open /dev/console. So, for example:
console=ttyS1,9600 console=tty0
defines that opening /dev/console will get you the current foreground virtual console, and kernel messages will appear on both the VGA console and the 2nd serial port (ttyS1 or COM2) at 9600 baud.
The behavior is more complicated when the same device type is defined more times. In this case, there are the following two rules:
- The output will appear only on the first device of each defined type.
- /dev/console will be associated with the first registered device. Where the registration order depends on how kernel initializes various subsystems.This rule is used also when the last console= parameter is not used for other reasons. For example, because of a typo or because the hardware is not available.
The result might be surprising. For example, the following two command lines have the same result:
console=ttyS1,9600 console=tty0 console=tty1
console=tty0 console=ttyS1,9600 console=tty1
| 06:40:25 |
| 20 May 2021 |
| scott joined the room. | 13:29:24 |
| 4 Apr 2025 |
ElvishJerricco | *
You can specify multiple console= options on the kernel command line.
The behavior is well defined when each device type is mentioned only once. In this case, the output will appear on all requested consoles. And the last device will be used when you open /dev/console. So, for example:
console=ttyS1,9600 console=tty0
defines that opening /dev/console will get you the current foreground virtual console, and kernel messages will appear on both the VGA console and the 2nd serial port (ttyS1 or COM2) at 9600 baud.
The behavior is more complicated when the same device type is defined more times. In this case, there are the following two rules:
- The output will appear only on the first device of each defined type.
- /dev/console will be associated with the first registered device. Where the registration order depends on how kernel initializes various subsystems.This rule is used also when the last console= parameter is not used for other reasons. For example, because of a typo or because the hardware is not available.
The result might be surprising. For example, the following two command lines have the same result:
console=ttyS1,9600 console=tty0 console=tty1
console=tty0 console=ttyS1,9600 console=tty1
| 06:40:43 |
| 20 May 2021 |
| timidbit joined the room. | 13:42:23 |
| 4 Apr 2025 |
ElvishJerricco | *
You can specify multiple console= options on the kernel command line.
The behavior is well defined when each device type is mentioned only once. In this case, the output will appear on all requested consoles. And the last device will be used when you open /dev/console. So, for example:
console=ttyS1,9600 console=tty0
defines that opening /dev/console will get you the current foreground virtual console, and kernel messages will appear on both the VGA console and the 2nd serial port (ttyS1 or COM2) at 9600 baud.
The behavior is more complicated when the same device type is defined more times. In this case, there are the following two rules:
- The output will appear only on the first device of each defined type.
- /dev/console will be associated with the first registered device. Where the registration order depends on how kernel initializes various subsystems. This rule is used also when the last console= parameter is not used for other reasons. For example, because of a typo or because the hardware is not available.
The result might be surprising. For example, the following two command lines have the same result:
console=ttyS1,9600 console=tty0 console=tty1
console=tty0 console=ttyS1,9600 console=tty1
| 06:40:51 |
| 20 May 2021 |
| Gytis Ivaskevicius joined the room. | 13:57:21 |
| 4 Apr 2025 |
ElvishJerricco | *
You can specify multiple console= options on the kernel command line.
The behavior is well defined when each device type is mentioned only once. In this case, the output will appear on all requested consoles. And the last device will be used when you open /dev/console. So, for example:
console=ttyS1,9600 console=tty0
defines that opening /dev/console will get you the current foreground virtual console, and kernel messages will appear on both the VGA console and the 2nd serial port (ttyS1 or COM2) at 9600 baud.
The behavior is more complicated when the same device type is defined more times. In this case, there are the following two rules:
- The output will appear only on the first device of each defined type.
- /dev/console will be associated with the first registered device. Where the registration order depends on how kernel initializes various subsystems. This rule is used also when the last console= parameter is not used for other reasons. For example, because of a typo or because the hardware is not available.
The result might be surprising. For example, the following two command lines have the same result:
console=ttyS1,9600 console=tty0 console=tty1
console=tty0 console=ttyS1,9600 console=tty1
The kernel messages are printed only on tty0 and ttyS1. And /dev/console gets associated with tty0. It is because kernel tries to register graphical consoles before serial ones. It does it because of the default behavior when no console device is specified, see below.
Note that the last console=tty1 parameter still makes a difference. The kernel command line is used also by systemd. It would use the last defined tty1 as the login console.
| 06:41:32 |
| 20 May 2021 |
| Maximilian Marx joined the room. | 14:03:07 |
| 4 Apr 2025 |
emily | I think this came up when I was telling you we should enable the serial console by default for the ISO :) | 06:43:50 |
| 20 May 2021 |
| timidbit set a profile picture. | 14:11:29 |
| 4 Apr 2025 |
ElvishJerricco | yea this is definitely not my first time trying to figure out console= | 06:44:22 |
| 20 May 2021 |
| berdario joined the room. | 16:02:41 |
| 4 Apr 2025 |
ElvishJerricco | I guess I need to figure out how systemd uses the console. Like does it actually open /dev/console? | 06:45:29 |
| 20 May 2021 |
| berdario left the room. | 16:03:10 |
| 4 Apr 2025 |
ElvishJerricco | because it seems like we don't get stuff on serial that was sent to /dev/console since the PR I linked | 06:46:36 |
| 20 May 2021 |
| aaron joined the room. | 16:03:19 |
| 4 Apr 2025 |
ElvishJerricco | which is very confusing because we are getting some systemd-shutdown messages and I don't know how | 06:47:07 |
| 20 May 2021 |
| berdario joined the room. | 16:03:30 |
| 4 Apr 2025 |
ElvishJerricco | especially since it's not all systemd-shutdown messages | 06:47:29 |
| 20 May 2021 |
| berdario left the room. | 16:04:27 |
| 4 Apr 2025 |
ElvishJerricco | hence the failing test | 06:47:32 |
| 20 May 2021 |
| berdario joined the room. | 16:05:29 |
| 4 Apr 2025 |
ElvishJerricco | also apparently our vm tests set console= in two different places; once in qemu-vm.nix and once in test-instrumentation.nix, even though they're trying to set them to effectively the same thing | 07:00:44 |
| 20 May 2021 |
| berdario left the room. | 16:05:49 |
| 4 Apr 2025 |
@adam:robins.wtf | My experience is systemd only outputs to the last console= | 09:57:58 |
| 20 May 2021 |
| berdario joined the room. | 16:06:20 |
| 4 Apr 2025 |
@adam:robins.wtf | As mentioned in the last line of the above quote | 09:58:50 |