Silent boot: Difference between revisions

From Alpine Linux
mNo edit summary
(Added a section about getty & edited headers according to Help:Style)
 
Line 1: Line 1:
== What is silent boot? ==
Silent boot means to almost completely remove all kernel and OpenRC messages on boot from your system. This may make it harder to debug issues when booting your computer, but it is also relatively <u>simple</u> to get back a verbose message boot, with this following wiki page guide.
Silent boot means to almost completely remove all kernel and OpenRC messages on boot from your system. This may make it harder to debug issues when booting your computer, but it is also relatively <u>simple</u> to get back a verbose message boot, with this following wiki page guide.


Line 6: Line 5:
{{note| This wiki guide is done without any frame buffers. You may use frame buffers to add a gui boot (such as adding a logo) when booting linux.}}
{{note| This wiki guide is done without any frame buffers. You may use frame buffers to add a gui boot (such as adding a logo) when booting linux.}}


== Setting up silent-boot ==
== Disable kernel messages ==


=== Disable kernel messages: ===
=== Grub ===
 
==== Grub ====
Edit /etc/default/grub and add quiet to the GRUB_CMDLINE_LINUX variable:
Edit /etc/default/grub and add quiet to the GRUB_CMDLINE_LINUX variable:
{{cat|/etc/default/grub|
{{cat|/etc/default/grub|
Line 16: Line 13:
}}
}}


==== Kernel-hooks ====
=== Kernel-hooks ===
Modify /etc/kernel-hooks.d/secureboot.conf and add quiet to cmdline:
Modify /etc/kernel-hooks.d/secureboot.conf and add quiet to cmdline:
{{cat|/etc/kernel-hooks.d/secureboot.conf|
{{cat|/etc/kernel-hooks.d/secureboot.conf|
Line 22: Line 19:
}}
}}


=== Disable OpenRC Boot messages: ===
== Disable OpenRC Boot messages ==
Make your <code>/etc/inittab</code> similar to this:
Make your <code>/etc/inittab</code> similar to this:
{{cat|/etc/inittab|
{{cat|/etc/inittab|
Line 48: Line 45:
while keeping a clean and silent boot  
while keeping a clean and silent boot  


==== External sources ====
== Clear screen on login prompt ==
Alpine Linux Silent Boot with cmatrix (youtube) (not mine)
 
* [https://www.youtube.com/watch?v=HoltBFnu0yo https://www.youtube.com/watch?v=HoltBFnu0yo] [1]
If you do not use a graphical display manager, you might want to clear screen when a login prompt appears. You can achieve it in several ways.
 
First option is to use getty's INITSTR argument, which allows to send a string before getty's main output, and [https://en.wikipedia.org/wiki/ANSI_escape_code#Control_Sequence_Introducer_commands escape codes] to clear screen:
 
{{cat|/etc/inittab|...
tty1::respawn:/sbin/getty -I '\033[2J\033[H' 38400 tty1
...}}
 
Alternatively, you can install [https://pkgs.alpinelinux.org/packages?name=agetty agetty], which clears screen by default, and modify <code>/etc/inittab</code> to use it:
 
{{cat|/etc/inittab|...
tty1::respawn:/sbin/agetty 38400 tty1
...}}
 
== See also ==
 
* [https://www.youtube.com/watch?v=HoltBFnu0yo Alpine Linux Silent Boot with cmatrix (youtube)]


[[Category:Security]] [[Category:Booting]]
[[Category:Security]] [[Category:Booting]]

Latest revision as of 00:32, 12 December 2025

Silent boot means to almost completely remove all kernel and OpenRC messages on boot from your system. This may make it harder to debug issues when booting your computer, but it is also relatively simple to get back a verbose message boot, with this following wiki page guide.

This wiki page guide will remove all OpenRC messages, except login prompt. This will also remove kernel messages at boot.

Note: This wiki guide is done without any frame buffers. You may use frame buffers to add a gui boot (such as adding a logo) when booting linux.

Disable kernel messages

Grub

Edit /etc/default/grub and add quiet to the GRUB_CMDLINE_LINUX variable:

Contents of /etc/default/grub

GRUB_CMDLINE_LINUX="... quiet ..."

Kernel-hooks

Modify /etc/kernel-hooks.d/secureboot.conf and add quiet to cmdline:

Contents of /etc/kernel-hooks.d/secureboot.conf

cmdline="... quiet ..."

Disable OpenRC Boot messages

Make your /etc/inittab similar to this:

Contents of /etc/inittab

# /etc/inittab ::sysinit:/sbin/openrc sysinit &> /dev/null ::sysinit:/sbin/openrc boot &> /dev/null ::wait:/sbin/openrc default &> /dev/null # Set up one getty tty1::respawn:/sbin/getty 38400 tty1 # Stuff to do before rebooting ::shutdown:/sbin/openrc shutdown &> /dev/null

Remove the "&> /dev/null" on each line to see OpenRC boot messages again.

Logging OpenRC while still keeping a silent boot

Enable this option in /etc/rc.conf

Contents of /etc/rc.conf

... rc_logger="YES" ...

This will produce a file /var/log/rc.log so you can read the OpenRC logs while keeping a clean and silent boot

Clear screen on login prompt

If you do not use a graphical display manager, you might want to clear screen when a login prompt appears. You can achieve it in several ways.

First option is to use getty's INITSTR argument, which allows to send a string before getty's main output, and escape codes to clear screen:

Contents of /etc/inittab

... tty1::respawn:/sbin/getty -I '\033[2J\033[H' 38400 tty1 ...

Alternatively, you can install agetty, which clears screen by default, and modify /etc/inittab to use it:

Contents of /etc/inittab

... tty1::respawn:/sbin/agetty 38400 tty1 ...

See also