Skip to contentSkip to conversation

Docs: printk: add 'console=null|""' to admin/kernel-parameters

PATCH In review Randy Dunlap 2 participants 2 messages Feb 16, 2022 – Feb 21, 2022 Documentation

lore
Share & tools
lore

Randy Dunlap

author reviewer
#0 lore raw

PATCH v2 1/1 Docs: printk: add 'console=null|""' to admin/kernel-parameters

Tell about 'console=null|""' and how to use it.

It can be helpful to set (enable) CONFIG_NULL_TTY so that the ttynull driver is available. This avoids problems with stdin/stdout/stderr of the init process. Howevere, CONFIG_NULL_TTY cannot be enabled by default because it can be used by mistake [see commit a91bd6223ecd ("Revert "init/console: Use ttynull as a fallback when there is no console").]

Cc Petr Mladek <[email protected]>
Cc Sergey Senozhatsky <[email protected]>
Cc Steven Rostedt <[email protected]>
Cc John Ogness <[email protected]>
Cc Jonathan Corbet <[email protected]>

---
v2: "must be the only console=" instead of the first one. (Petr)
Add info about CONFIG_NULL_TTY to the commit message. (Petr)

 Documentation/admin-guide/kernel-parameters.txt |    6 ++++++
 1 file changed, 6 insertions(+)
Documentation/admin-guide/kernel-parameters.txt +6 -0
@@ -724,6 +724,12 @@
 		hvc<n>	Use the hypervisor console device <n>. This is for
 			both Xen and PowerPC hypervisors.
 
+		{ null | "" }
+			Use to disable console output, i.e., to have kernel
+			console messages discarded.
+			This must be only console= string used on the
+			kernel command line.
+
 		If the device connected to the port is not a TTY but a braille
 		device, prepend "brl," before the device type, for instance
 			console=brl,ttyS0
#1 lore raw
Quoted 9 lines · Randy Dunlap

Tell about 'console=null|""' and how to use it.

It can be helpful to set (enable) CONFIG_NULL_TTY so that the ttynull driver is available. This avoids problems with stdin/stdout/stderr of the init process. Howevere, CONFIG_NULL_TTY cannot be enabled by default because it can be used by mistake [see commit a91bd6223ecd ("Revert "init/console: Use ttynull as a fallback when there is no console").]

The patch is committed in printk/linux.git, branch for-5.18.

Best Regards,
Petr