Difference between revisions of "Silent boot"

From ArchWiki
Jump to: navigation, search
(linux 3 is here + stock Arch kernel doesn't have any boot logo)
(Syslinux+Systemd)
(16 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{expansion}}
+
[[Category:Boot process]]
{{out of date}}
+
This page is for those who prefer to limit the verbosity of their system to a strict minimum, either for aesthetics or other reasons. Following this guide will remove all text from the bootup process.
This page is for those who prefer to limit the verbosity of their system to a strict minimum, either for aesthetics other reasons. Following this guide will remove all text from the bootup process.
+
  
==Grub configs==
+
==Syslinux+Systemd==
  
To avoid the verbose text, you can add this line to the grub kernel command "quiet console=tty12". It will send the outpout of the boot process to the "tty 12", while remaining on the "tty 1".
+
Your /boot/syslinux/syslinux.cfg should look something like:
  
Example configuration for /boot/grub/menu.lst
+
    $ grep APPEND /boot/syslinux/syslinux.cfg | head -n1
 +
    APPEND root=/dev/sda1 ro 5 init=/usr/lib/systemd/systemd quiet vga=current
  
# (0) Arch Linux
+
vga=current is the magic ''kernel argument'' not to do something crazy like [https://bugs.archlinux.org/task/32309 flash grey].
title  Arch Linux
+
root  (hd0,5)
+
kernel /vmlinuz26 root=/dev/disk/by-uuid/b2f2fc9a-6305-4770-aed2-fccb3ec51d5c ro quiet console=tty12
+
initrd /kernel26.img
+
  
This configuration will only leave the Arch logo on the screen for the whole boot process. If you would like to also remove the logo, simply add "logo.nologo" to the kernel command, like this:
+
Configure your systemd getty service like so:
  
# (0) Arch Linux
+
    x220:~$ grep ExecStart /usr/lib/systemd/system/getty@.service
title  Arch Linux
+
    ExecStart=-/sbin/agetty --skip-login --noissue --autologin YOUR_USERNAME %I 38400
root  (hd0,5)
+
kernel /vmlinuz26 root=/dev/disk/by-uuid/b2f2fc9a-6305-4770-aed2-fccb3ec51d5c ro quiet console=tty12 logo.nologo
+
initrd /kernel26.img
+
  
==/etc/inittab==
+
To remove lastlog message you need to comment out ''lastlog'' in /etc/pam.d/login:
  
The file /etc/inittab is responsible for the prompts you get in your ttys. The boot process taking place in tty 1, i want to remove the prompt in that tty so that no text is displayed whatsoever. So i am gonna deactivate tty1 completely. Simply comment the line responsible for it in the /etc/initab file. The line to comment is this one: 
+
    #session                optional        pam_lastlog.so
  
c1:2345:respawn:/sbin/agetty -8 38400 tty1 linux
+
To hide any kernel messages from the console use [http://unix.stackexchange.com/a/45525/27433 this tip]:
  
This is what my inittab file looks like with that line commented:
+
    $ grep ^kernel.printk /etc/sysctl.conf
 +
    kernel.printk = 3 3 3 3
  
#
+
To hide startx messages, you could redirect its output to /dev/null, like so:
# /etc/inittab
+
#
+
+
#  Runlevels:
+
#    0    Halt
+
#    1(S)      Single-user
+
#    2    Not used
+
#    3    Multi-user
+
#    4    Not used
+
#    5    X11
+
#    6    Reboot
+
+
## Only one of the following two lines can be uncommented!
+
# Boot to console
+
#id:3:initdefault:
+
# Boot to X11
+
id:5:initdefault:
+
+
rc::sysinit:/etc/rc.sysinit
+
rs:S1:wait:/etc/rc.single
+
rm:2345:wait:/etc/rc.multi
+
rh:06:wait:/etc/rc.shutdown
+
su:S:wait:/sbin/sulogin -p
+
+
# -8 options fixes umlauts problem on login
+
#c1:2345:respawn:/sbin/agetty -8 38400 tty1 linux
+
c2:2345:respawn:/sbin/agetty -8 38400 tty2 linux
+
c3:2345:respawn:/sbin/agetty -8 38400 tty3 linux
+
c4:2345:respawn:/sbin/agetty -8 38400 tty4 linux
+
c5:2345:respawn:/sbin/agetty -8 38400 tty5 linux
+
c6:2345:respawn:/sbin/agetty -8 38400 tty6 linux
+
+
# Hypervisor Virtual Console for Xen and KVM
+
#h0:2345:respawn:/sbin/agetty -8 38400 hvc0 linux
+
+
ca::ctrlaltdel:/sbin/shutdown -t3 -r now
+
+
# Example lines for starting a login manager
+
#x:5:respawn:/usr/bin/xdm -nodaemon
+
#x:5:respawn:/usr/sbin/gdm -nodaemon
+
#x:5:respawn:/usr/bin/kdm -nodaemon
+
#x:5:respawn:/usr/bin/slim >& /dev/null
+
x:5:once:/bin/su yourusername -l -c "/bin/bash --login -c /usr/bin/startx >/dev/null 2>&1"
+
  
==Patching grub==
+
    [[ $(fgconsole 2>/dev/null) == 1 ]] && exec startx -- vt1 &> /dev/null
  
(coming soon)
+
Outstanding Issues:
 
+
* [https://github.com/karelzak/util-linux/issues/21 agetty's automatic login is noisy]
==Other==
+
* [https://bugs.freedesktop.org/show_bug.cgi?id=57216 Systemd shutdowns are not quiet]

Revision as of 01:54, 20 November 2012

This page is for those who prefer to limit the verbosity of their system to a strict minimum, either for aesthetics or other reasons. Following this guide will remove all text from the bootup process.

Syslinux+Systemd

Your /boot/syslinux/syslinux.cfg should look something like:

   $ grep APPEND /boot/syslinux/syslinux.cfg | head -n1
   APPEND root=/dev/sda1 ro 5 init=/usr/lib/systemd/systemd quiet vga=current

vga=current is the magic kernel argument not to do something crazy like flash grey.

Configure your systemd getty service like so:

   x220:~$ grep ExecStart /usr/lib/systemd/system/getty@.service
   ExecStart=-/sbin/agetty --skip-login --noissue --autologin YOUR_USERNAME %I 38400

To remove lastlog message you need to comment out lastlog in /etc/pam.d/login:

    #session                optional        pam_lastlog.so

To hide any kernel messages from the console use this tip:

   $ grep ^kernel.printk /etc/sysctl.conf 
   kernel.printk = 3 3 3 3

To hide startx messages, you could redirect its output to /dev/null, like so:

   [[ $(fgconsole 2>/dev/null) == 1 ]] && exec startx -- vt1 &> /dev/null

Outstanding Issues: