The last console= argument is not used by the kernel
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
I ran into a problem with the console argument handling on a physical system with a BMC (Dell R610) and also reproduced the same behavior on a QEMU/KVM VM with multiple serial ports.
The kernel documentation notes that the last entry will be used for /dev/console
https:/
"What: /sys/class/
Shows the list of currently configured console devices, like 'tty1 ttyS0'. The last entry in the file is the active device connected to /dev/console.
The file supports poll() to detect virtual console switches."
https:/
"The last preferred console added will be used for kernel messages and stdin/out/err for init."
The actual behavior is different and the console specified in the last console argument does not become an active one. As a result, SOL functionality is not possible to use unless only one ttyS<n> argument is specified in the kernel command line arguments. Setting the arguments to only contain the right one results in a proper behavior and I can see rx counters increasing in /proc/tty/
$ cat /proc/cmdline
BOOT_IMAGE=
journalctl -k | grep ttyS
Dec 03 21:42:41 ubuntu kernel: Command line: BOOT_IMAGE=
Dec 03 21:42:41 ubuntu kernel: Kernel command line: BOOT_IMAGE=
Dec 03 21:42:41 ubuntu kernel: console [ttyS0] enabled
Dec 03 21:42:41 ubuntu kernel: 00:02: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
Dec 03 21:42:41 ubuntu kernel: 00:03: ttyS1 at I/O 0x2f8 (irq = 3, base_baud = 115200) is a 16550A
Dec 03 21:42:41 ubuntu kernel: tty ttyS3: hash matches
Full dmesg: http://
$ cat /sys/class/
ttyS0 tty0
$ sudo cat /proc/tty/
serinfo:1.0 driver revision:
0: uart:16550A port:000003F8 irq:4 tx:78 rx:0 RTS|DTR
1: uart:16550A port:000002F8 irq:3 tx:0 rx:0 CTS|DSR|CD
2: uart:unknown port:000003E8 irq:4
3: uart:unknown port:000002E8 irq:3
# ...
~~~
GRUB setttings:
# the ones that override /etc/default/grub
$ cat /etc/default/
cat: cat: No such file or directory
GRUB_CMDLINE_
# disable grub os prober that might find other OS installs.
GRUB_DISABLE_
GRUB_TERMINAL=
/etc/default/grub: https:/
# grub.cfg: http://
# two entries, both with the proper arg and properly sent to the kernel cmdline based on /proc/cmdline
grep ttyS grub.cfg
linux /vmlinuz-
linux /vmlinuz-
~~~
I managed to reproduce the exact same behavior on a VM with multiple 8250 serial ports.
ubuntu@
ttyS0
ubuntu@
BOOT_IMAGE=
ubuntu@
linux /boot/vmlinuz-
linux /boot/vmlinuz-
linux /boot/vmlinuz-
# changed to the following config with only ttyS1 present:
ubuntu@
linux /boot/vmlinuz-
linux /boot/vmlinuz-
linux /boot/vmlinuz-
# 1 tty passed only
ubuntu@
BOOT_IMAGE=
# now it's shown as active
ubuntu@
ttyS1
ubuntu@
serinfo:1.0 driver revision:
0: uart:16550A port:000003F8 irq:4 tx:0 rx:0 CTS|DSR|CD
1: uart:16550A port:000002F8 irq:3 tx:14763 rx:0 RTS|CTS|DTR|DSR|CD
2: uart:16550A port:000003E8 irq:4 tx:0 rx:0 CTS|DSR|CD
~~~~
Relevant code:
https:/
https:/
https:/
https:/
---
ProblemType: Bug
AlsaDevices:
total 0
crw-rw---- 1 root audio 116, 1 Dec 6 14:38 seq
crw-rw---- 1 root audio 116, 33 Dec 6 14:38 timer
AplayDevices: Error: [Errno 2] No such file or directory: 'aplay': 'aplay'
ApportVersion: 2.20.9-0ubuntu7.5
Architecture: amd64
ArecordDevices: Error: [Errno 2] No such file or directory: 'arecord': 'arecord'
AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/seq', '/dev/snd/timer'] failed with exit code 1:
DistroRelease: Ubuntu 18.04
IwConfig: Error: [Errno 2] No such file or directory: 'iwconfig': 'iwconfig'
Lsusb:
Bus 001 Device 002: ID 0627:0001 Adomax Technology Co., Ltd
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
MachineType: QEMU Standard PC (Q35 + ICH9, 2009)
Package: linux (not installed)
PciMultimedia:
ProcFB: 0 qxldrmfb
ProcKernelCmdLine: BOOT_IMAGE=
ProcVersionSign
RelatedPackageV
linux-
linux-
linux-firmware 1.173.2
RfKill: Error: [Errno 2] No such file or directory: 'rfkill': 'rfkill'
Tags: bionic uec-images
Uname: Linux 4.15.0-42-generic x86_64
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm audio cdrom dialout dip floppy lxd netdev plugdev sudo video
_MarkForUpload: True
dmi.bios.date: 04/01/2014
dmi.bios.vendor: SeaBIOS
dmi.bios.version: 1.10.2-1ubuntu1
dmi.chassis.type: 1
dmi.chassis.vendor: QEMU
dmi.chassis.
dmi.modalias: dmi:bvnSeaBIOS:
dmi.product.name: Standard PC (Q35 + ICH9, 2009)
dmi.product.
dmi.sys.vendor: QEMU
This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:
apport-collect 1807140
and then change the status of the bug to 'Confirmed'.
If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.
This change has been made by an automated script, maintained by the Ubuntu Kernel Team.