Silent boot

From Alpine Linux
Revision as of 00:32, 12 December 2025 by Discerno (talk | contribs) (Added a section about getty & edited headers according to Help:Style)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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