Plymouth: Difference between revisions

From ArchWiki
(Partially undo revision 802343 by BigGeorge2415 (talk): Duplicates Kernel parameters#GRUB)
 
(131 intermediate revisions by 44 users not shown)
Line 1: Line 1:
[[Category:Bootsplash]]
[[Category:Bootsplash]]
[[cs:Plymouth]]
[[de:Plymouth]]
[[es:Plymouth]]
[[es:Plymouth]]
[[fa:Plymouth]]
[[it:Plymouth]]
[[ja:Plymouth]]
[[ja:Plymouth]]
[[pt:Plymouth]]
[[pt:Plymouth]]
Line 12: Line 10:
{{Related articles end}}
{{Related articles end}}


[http://www.freedesktop.org/wiki/Software/Plymouth Plymouth] is a project from Fedora and now listed among the [https://www.freedesktop.org/wiki/Software/#graphicsdriverswindowsystemsandsupportinglibraries freedesktop.org's official resources] providing a flicker-free graphical boot process. It relies on [[kernel mode setting]] (KMS) to set the native resolution of the display as early as possible, then provides an eye-candy splash screen leading all the way up to the login manager.
[https://www.freedesktop.org/wiki/Software/Plymouth Plymouth] is a project from Fedora and now listed among the [https://www.freedesktop.org/wiki/Software/#graphicsdriverswindowsystemsandsupportinglibraries freedesktop.org's official resources] providing a flicker-free graphical boot process. It relies on [[kernel mode setting]] (KMS) to set the native resolution of the display as early as possible, then provides an eye-candy splash screen leading all the way up to the login manager.


== Preparation ==
== Preparation ==


''Plymouth'' primarily uses [[KMS]] (Kernel Mode Setting) to display graphics. In EFI/UEFI systems, ''plymouth'' can utilize the EFI framebuffer. If you cannot use KMS, e.g. because you are using a proprietary driver, or if you do not want to use the EFI framebuffer, consider using [[Uvesafb]] as it works with widescreen resolutions.
''Plymouth'' primarily uses KMS to display graphics, but on UEFI systems it can utilize the EFI framebuffer.


If you have neither KMS nor a framebuffer, ''Plymouth'' will fall back to text-mode.
If you cannot use KMS, e.g. because you are using a proprietary driver, or if you do not want to use the EFI framebuffer, consider using [[Uvesafb]] as it works with widescreen resolutions. If you have neither KMS nor a framebuffer, ''Plymouth'' will fall back to text-mode.


== Installation ==
== Installation ==


Plymouth is available from the [[AUR]]: the stable package is {{AUR|plymouth}} and the development version is {{AUR|plymouth-git}}.
Plymouth is available with the stable package {{Pkg|plymouth}}. For the development version, use {{AUR|plymouth-git}}.


If you also use [[GDM]], you should install the {{AUR|gdm-plymouth}}, which compiles gdm with plymouth support.
By default, Plymouth logs the boot messages into {{ic|/var/log/boot.log}}, and does not show the graphical splash screen.


=== The plymouth hook ===
* If you want to see the splash screen, append {{ic|splash}} to the [[kernel parameters]].
* If you want [[silent boot]], append {{ic|quiet}} too.
* If you want to disable the logging, append {{ic|plymouth.nolog}}.


Add {{ic|plymouth}} to the {{ic|HOOKS}} array in [[mkinitcpio.conf]]. It '''must''' be added '''after''' {{ic|base}} and {{ic|udev}} for it to work:
To start Plymouth on early boot, you must configure your [[initramfs]] generator to create images including Plymouth.


{{hc|/etc/mkinitcpio.conf|2=
=== mkinitcpio ===
HOOKS=(base udev plymouth ...)
}}


{{Warning|
Add {{ic|plymouth}} to the {{ic|HOOKS}} array in [[mkinitcpio.conf]].
* If you use [[System Encryption with LUKS for dm-crypt|hard drive encryption]] with the {{ic|encrypt}} hook, you '''must''' replace the {{ic|encrypt}} hook with {{ic|plymouth-encrypt}} and add it after the {{ic|plymouth}} hook in order to get to the TTY password prompts.
* Using {{ic|PARTUUID}} or {{ic|PARTLABEL}} in {{ic|1=cryptdevice=}} parameter does '''not''' work with {{ic|plymouth-encrypt}} hook.
* For a [[Installing Arch Linux on ZFS#Native encryption|ZFS encrypted root]], you '''must''' install {{AUR|plymouth-zfs}} and replace the {{ic|zfs}} hook with {{ic|plymouth-zfs}}
}}
 
After adding the {{ic|plymouth-encrypt}} hook, if input goes to the background in plaintext instead of into the password prompt you need to add your (kernel) graphics driver to your initramfs. For example, if using intel:


{{hc|/etc/mkinitcpio.conf|2=
{{hc|/etc/mkinitcpio.conf|2=
MODULES=(i915 ...)
HOOKS=(... plymouth ...)
}}
}}


This might also be a step needed for some themes to work.
If you are using the {{ic|systemd}} hook, it must be before {{ic|plymouth}}.
 
Furthermore make sure you place {{ic|plymouth}} before the {{ic|crypt}} hook if your system is encrypted with dm-crypt.


=== Alternative plymouth hook (systemd) ===
=== dracut ===


If your [[mkinitcpio.conf]] includes the {{ic|systemd}} hook, then replace {{ic|plymouth}} with {{ic|sd-plymouth}}. Additionally, if using hard drive encryption, use {{ic|sd-encrypt}} instead of {{ic|encrypt}} or {{ic|plymouth-encrypt}}:
After installing Plymouth, [[dracut]] will automatically detect it and add it to your initramfs images. If autodetection fails, you can force dracut to include Plymouth by adding the following line to your dracut configuration:


{{hc|/etc/mkinitcpio.conf|2=
{{hc|/etc/dracut.conf.d/myflags.conf|2=
HOOKS=(base systemd sd-plymouth ... sd-encrypt ...)
add_dracutmodules+=" plymouth "
}}
}}
=== The kernel command line ===
You now need to append the {{ic|1=quiet splash loglevel=3 rd.udev.log_priority=3 vt.global_cursor_default=0}} [[kernel parameters]]. See [[Silent boot]] for other parameters to limit the output to the console.
[[Regenerate the initramfs]].


== Configuration ==
== Configuration ==


=== Smooth transition ===
Plymouth can be configured in file {{ic|/etc/plymouth/plymouthd.conf}}. You can see the default values in {{ic|/usr/share/plymouth/plymouthd.defaults}}.
 
To enable ''smooth transition'' (if supported) you have to:
 
# [[Disable]] your [[display manager]] unit, e.g. {{ic|gdm.service}}
# [[Enable]] the respective DM-plymouth unit (GDM, LXDM, SLiM, LightDM, SDDM units provided), e.g. {{ic|gdm-plymouth.service}}
 
=== Show delay ===
 
Plymouth has a configuration option to delay the splash screen:
 
{{hc|/etc/plymouth/plymouthd.conf|2=
[Daemon]
Theme=spinner
ShowDelay=5
}}
 
On systems that boot quickly, you may only see a flicker of your splash theme before your DM or login prompt is ready. You can set {{ic|ShowDelay}} to an interval (in seconds) longer than your boot time to prevent this flicker and only show a blank screen.
The default is 5 seconds, but you may wish to change this to a lower value to see your splash earlier during boot.
 
=== Change background image ===
 
Certain themes (such as spinner) can have their background image changed. On spinner, by default it is a grey noise pattern. To change it, replace {{ic|/usr/share/plymouth/themes/''theme''/background-tile.png}} with your desired image. You may want to copy and create a new theme when doing this, to prevent it from being overridden by updates to Plymouth. Do not forget to regenerate the theme once changed, see the next section for how.


=== Changing the theme ===
=== Changing the theme ===
Line 92: Line 58:
Plymouth comes with a selection of themes:
Plymouth comes with a selection of themes:


# '''BGRT''': A variation of Spinner that keeps the OEM logo if available (BGRT stands for Boot Graphics Resource Table)
# '''Fade-in''': "Simple theme that fades in and out with shimmering stars"
# '''Fade-in''': "Simple theme that fades in and out with shimmering stars"
# '''Glow''': "Corporate theme with pie chart boot progress followed by a glowing emerging logo"
# '''Glow''': "Corporate theme with pie chart boot progress followed by a glowing emerging logo"
Line 98: Line 65:
# '''Spinner''': "Simple theme with a loading spinner"   
# '''Spinner''': "Simple theme with a loading spinner"   
# '''Spinfinity''': "Simple theme that shows a rotating infinity sign in the center of the screen"
# '''Spinfinity''': "Simple theme that shows a rotating infinity sign in the center of the screen"
# '''Tribar''': "Text mode theme with tricolor progress bar"
# ''('''Text''': "Text mode theme with tricolor progress bar")''
# ''('''Text''': "Text mode theme with tricolor progress bar")''
# ''('''Details''': "Verbose fallback theme")''
# ''('''Details''': "Verbose fallback theme")''


Development version of Plymouth ({{AUR|plymouth-git}}) also comes with the '''BGRT''' (Boot Graphics Resource Table) theme, which is a variation of Spinner that keeps the OEM logo if available.
By default, the '''fade-in''' theme is selected. The theme can be changed editing the configuration file, for example:
 
{{hc|/etc/plymouth/plymouthd.conf|2=
[Daemon]
Theme=bgrt
}}
 
or by this command:


In addition you can install other themes from [[AUR]], just have a look at the "Required by"-Array on {{AUR|plymouth}}.
# plymouth-set-default-theme -R ''theme''
 
Every time a theme is changed, the {{ic|initrd}} must be rebuilt. The {{ic|-R}} option ensures that it is rebuilt (otherwise [[regenerate the initramfs]] manually).
 
=== Install new themes ===
 
You can install other themes from [[AUR]]. [https://aur.archlinux.org/packages?K=plymouth-theme-], alternatively
{{Pkg|plymouth-kcm}} provides integration into KDE Plasma's settings and offers themes not available on the [[AUR]].


All currently installed themes can be listed by using this command:
All currently installed themes can be listed by using this command:
Line 112: Line 94:


{{hc|$ ls /usr/share/plymouth/themes|
{{hc|$ ls /usr/share/plymouth/themes|
details  glow    solar      spinner  tribar
bgrt  details  fade-in glow script solar spinfinity spinner text tribar
fade-in  script  spinfinity  text
}}
}}


By default, the '''spinner''' theme is selected. The theme can be changed by editing {{ic|/etc/plymouth/plymouthd.conf}}, for example:
=== Show delay ===
 
Plymouth has a configuration option to delay the splash screen:


{{hc|/etc/plymouth/plymouthd.conf|2=
{{hc|/etc/plymouth/plymouthd.conf|2=
[Daemon]
[Daemon]
Theme=spinner
ShowDelay=5
ShowDelay=5
}}
}}


Themes can be previewed without rebuilding, press {{ic|Ctrl+Alt+F6}} to switch to a text terminal, log in as root and type:
On systems that boot quickly, you may only see a flicker of your splash theme before your DM or login prompt is ready. You can set {{ic|ShowDelay}} to an interval (in seconds) longer than your boot time to prevent this flicker and only show a blank screen. The default is 0 seconds, so you should not need to change this to a different value to see your splash earlier during boot.
 
=== HiDPI ===
 
Edit the configuration file:
{{hc|/etc/plymouth/plymouthd.conf|2=
[Daemon]
DeviceScale=''an-integer-scaling-factor''
}}
and rebuild the initrd.
 
== Tips and tricks ==
 
=== Show boot messages ===
 
During boot you can switch to boot messages by pressing the {{ic|Esc}} key.
 
=== Smooth transition ===
 
[[GDM]] supports ''smooth transition'' out of the box.
 
For other display managers you can get a nearly smooth transition with the following [[drop-in snippet]] for {{ic|display-manager.service}}:
 
{{hc|/etc/systemd/system/display-manager.service.d/plymouth.conf|2=
[Unit]
Conflicts=plymouth-quit.service
After=plymouth-quit.service rc-local.service plymouth-start.service systemd-user-sessions.service
OnFailure=plymouth-quit.service
 
[Service]
ExecStartPre=-/usr/bin/plymouth deactivate
ExecStartPost=-/usr/bin/sleep 30
ExecStartPost=-/usr/bin/plymouth quit --retain-splash
}}
 
=== Preview themes ===
 
Themes can be previewed without rebuilding initrd, press {{ic|Ctrl+Alt+F6}} to switch to a text terminal, log in as root and type:


  # plymouthd
  # plymouthd
Line 133: Line 152:
  # plymouth --quit
  # plymouth --quit


Every time a theme is changed, the {{ic|initrd}} must be rebuilt. The {{ic|-R}} option ensures that it is rebuilt (otherwise manually run {{ic|mkinitcpio -P}}):
You can run these commands as root in a running X.Org session too, but the Plymouth window may cover your terminal window and lock itself on top. Have virtual desktops handy.
 
=== Change background image ===
 
You can add a background image for two-step-based themes (such as spinner and bgrt). Just place your desired image into {{ic|/usr/share/plymouth/themes/spinner/background-tile.png}}. Do not forget to regenerate the initrd once the theme changed.
 
=== Missing BGRT image ===
 
In case you are using the BGRT theme but the UEFI does not provide a vendor logo, you can place a fallback image into {{ic|/usr/share/plymouth/themes/spinner/bgrt-fallback.png}} to show it instead.
 
Alternatively, set the following to keep the firmware background: {{hc|/etc/plymouth/plymouthd.conf|2=
UseFirmwareBackground=true
}}  
 
=== Slow down boot to show the full animation ===
 
On systems with a very fast boot time, it might be necessary to add a delay to {{ic|plymouth-quit.service}} with a [[drop-in snippet]] containing {{ic|1=ExecStartPre=/usr/bin/sleep 5}} if showing the whole animation is desired. See [https://old.reddit.com/r/archlinux/comments/u5fjbi/how_do_i_make_my_boot_time_slower/ this reddit post].
 
Alternatively, it is possible to use a new systemd service starting at the same time as plymouth and waiting the whole duration needed for the animation. This method will ensure that inconsistencies in the boot time will not be perceived, as it is not time added '''after''' the animation but a delay running ''''during''' the animation.
 
{{hc|/etc/systemd/system/plymouth-wait-for-animation.service|2=
[Unit]
Description=Waits for Plymouth animation to finish
Before=plymouth-quit.service display-manager.service
 
[Service]
Type=oneshot
ExecStart=/usr/bin/sleep ''duration_of_your_animation''


  # plymouth-set-default-theme -R ''theme''
[Install]
WantedBy=plymouth-start.service
}}
 
Then [[enable]] the service.
 
{{Note|None of the previous methods will work if you are starting Plymouth from initramfs.}}
 
== Troubleshooting ==
 
=== Disable with kernel parameters ===
If you experience problems during boot, you can temporary disable Plymouth with the following [[kernel parameters]]:
 
  plymouth.enable=0 disablehooks=plymouth


== Tips and tricks ==
=== Debugging ===


==== Show kernel messages ====
To write debug output into {{ic|/var/log/plymouth-debug.log}}, add the following kernel parameter:


During boot you can switch to kernel messages by pressing the {{ic|Home}} or {{ic|Esc}} keys.
plymouth.debug


=== Adding Arch Logo to spinner and BGRT themes ===
=== Password prompt does not update ===


To add the Arch Logo to the ''spinner'' and ''BGRT'' themes copy the Arch logo to the spinner theme directory with the name {{ic|watermark.png}}:
When using {{ic|systemd}} instead of {{ic|udev}} hooks in [[Mkinitcpio]], the password prompt may not update on themes that handle it via Plymouth scripting.


# cp /usr/share/plymouth/arch-logo.png /usr/share/plymouth/themes/spinner/watermark.png
You can try switching to development version {{AUR|plymouth-git}} or using substitutes from [[Mkinitcpio#Common hooks]].


=== Replacing the Arch Logo and creating custom themes ===
=== Display is not centered ===


The following themes use the Arch Linux logo supplied by Plymouth in {{ic|/usr/share/plymouth/arch-logo.png}}: fade-in, script, solar, spinfinity. If you want to use another logo, you can take one of them or one of the plymouth themes in [[AUR]], edit the file {{ic|*.plymouth}} (and maybe {{ic|*.script}}, too) and replace this image with one of your choice. You should create a package from your newly created theme, because changes in {{ic|/usr/share/plymouth}} may not be persistent across package upgrades.
Certain themes may have trouble centering the display when there is more than one monitor enabled during boot.


After installing and selecting your theme, you should rebuild the initrd image to use the new splash.
You can use [[Kernel mode setting#Forcing modes]] to disable specific monitors.


== See also ==
== See also ==


* [[Fedora:Features/BetterStartup|Original Spec]]
* [[Fedora:Features/BetterStartup|Original specification]]
* [https://bbs.archlinux.org/viewtopic.php?id=81406 Related forum thread]
* [https://bbs.archlinux.org/viewtopic.php?id=81406 Related forum thread]

Latest revision as of 17:36, 5 March 2024

Plymouth is a project from Fedora and now listed among the freedesktop.org's official resources providing a flicker-free graphical boot process. It relies on kernel mode setting (KMS) to set the native resolution of the display as early as possible, then provides an eye-candy splash screen leading all the way up to the login manager.

Preparation

Plymouth primarily uses KMS to display graphics, but on UEFI systems it can utilize the EFI framebuffer.

If you cannot use KMS, e.g. because you are using a proprietary driver, or if you do not want to use the EFI framebuffer, consider using Uvesafb as it works with widescreen resolutions. If you have neither KMS nor a framebuffer, Plymouth will fall back to text-mode.

Installation

Plymouth is available with the stable package plymouth. For the development version, use plymouth-gitAUR.

By default, Plymouth logs the boot messages into /var/log/boot.log, and does not show the graphical splash screen.

  • If you want to see the splash screen, append splash to the kernel parameters.
  • If you want silent boot, append quiet too.
  • If you want to disable the logging, append plymouth.nolog.

To start Plymouth on early boot, you must configure your initramfs generator to create images including Plymouth.

mkinitcpio

Add plymouth to the HOOKS array in mkinitcpio.conf.

/etc/mkinitcpio.conf
HOOKS=(... plymouth ...)

If you are using the systemd hook, it must be before plymouth.

Furthermore make sure you place plymouth before the crypt hook if your system is encrypted with dm-crypt.

dracut

After installing Plymouth, dracut will automatically detect it and add it to your initramfs images. If autodetection fails, you can force dracut to include Plymouth by adding the following line to your dracut configuration:

/etc/dracut.conf.d/myflags.conf
add_dracutmodules+=" plymouth "

Configuration

Plymouth can be configured in file /etc/plymouth/plymouthd.conf. You can see the default values in /usr/share/plymouth/plymouthd.defaults.

Changing the theme

Plymouth comes with a selection of themes:

  1. BGRT: A variation of Spinner that keeps the OEM logo if available (BGRT stands for Boot Graphics Resource Table)
  2. Fade-in: "Simple theme that fades in and out with shimmering stars"
  3. Glow: "Corporate theme with pie chart boot progress followed by a glowing emerging logo"
  4. Script: "Script example plugin" (Despite the description seems to be a quite nice Arch logo theme)
  5. Solar: "Space theme with violent flaring blue star"
  6. Spinner: "Simple theme with a loading spinner"
  7. Spinfinity: "Simple theme that shows a rotating infinity sign in the center of the screen"
  8. Tribar: "Text mode theme with tricolor progress bar"
  9. (Text: "Text mode theme with tricolor progress bar")
  10. (Details: "Verbose fallback theme")

By default, the fade-in theme is selected. The theme can be changed editing the configuration file, for example:

/etc/plymouth/plymouthd.conf
[Daemon]
Theme=bgrt

or by this command:

# plymouth-set-default-theme -R theme

Every time a theme is changed, the initrd must be rebuilt. The -R option ensures that it is rebuilt (otherwise regenerate the initramfs manually).

Install new themes

You can install other themes from AUR. [1], alternatively plymouth-kcm provides integration into KDE Plasma's settings and offers themes not available on the AUR.

All currently installed themes can be listed by using this command:

$ plymouth-set-default-theme -l

or:

$ ls /usr/share/plymouth/themes
bgrt  details  fade-in  glow  script  solar  spinfinity  spinner  text  tribar

Show delay

Plymouth has a configuration option to delay the splash screen:

/etc/plymouth/plymouthd.conf
[Daemon]
ShowDelay=5

On systems that boot quickly, you may only see a flicker of your splash theme before your DM or login prompt is ready. You can set ShowDelay to an interval (in seconds) longer than your boot time to prevent this flicker and only show a blank screen. The default is 0 seconds, so you should not need to change this to a different value to see your splash earlier during boot.

HiDPI

Edit the configuration file:

/etc/plymouth/plymouthd.conf
[Daemon]
DeviceScale=an-integer-scaling-factor

and rebuild the initrd.

Tips and tricks

Show boot messages

During boot you can switch to boot messages by pressing the Esc key.

Smooth transition

GDM supports smooth transition out of the box.

For other display managers you can get a nearly smooth transition with the following drop-in snippet for display-manager.service:

/etc/systemd/system/display-manager.service.d/plymouth.conf
[Unit]
Conflicts=plymouth-quit.service
After=plymouth-quit.service rc-local.service plymouth-start.service systemd-user-sessions.service
OnFailure=plymouth-quit.service

[Service]
ExecStartPre=-/usr/bin/plymouth deactivate
ExecStartPost=-/usr/bin/sleep 30
ExecStartPost=-/usr/bin/plymouth quit --retain-splash

Preview themes

Themes can be previewed without rebuilding initrd, press Ctrl+Alt+F6 to switch to a text terminal, log in as root and type:

# plymouthd
# plymouth --show-splash

To quit the preview, press Ctrl+Alt+F6 again and type:

# plymouth --quit

You can run these commands as root in a running X.Org session too, but the Plymouth window may cover your terminal window and lock itself on top. Have virtual desktops handy.

Change background image

You can add a background image for two-step-based themes (such as spinner and bgrt). Just place your desired image into /usr/share/plymouth/themes/spinner/background-tile.png. Do not forget to regenerate the initrd once the theme changed.

Missing BGRT image

In case you are using the BGRT theme but the UEFI does not provide a vendor logo, you can place a fallback image into /usr/share/plymouth/themes/spinner/bgrt-fallback.png to show it instead.

Alternatively, set the following to keep the firmware background:

/etc/plymouth/plymouthd.conf
UseFirmwareBackground=true

Slow down boot to show the full animation

On systems with a very fast boot time, it might be necessary to add a delay to plymouth-quit.service with a drop-in snippet containing ExecStartPre=/usr/bin/sleep 5 if showing the whole animation is desired. See this reddit post.

Alternatively, it is possible to use a new systemd service starting at the same time as plymouth and waiting the whole duration needed for the animation. This method will ensure that inconsistencies in the boot time will not be perceived, as it is not time added after the animation but a delay running 'during the animation.

/etc/systemd/system/plymouth-wait-for-animation.service
[Unit]
Description=Waits for Plymouth animation to finish
Before=plymouth-quit.service display-manager.service

[Service]
Type=oneshot
ExecStart=/usr/bin/sleep duration_of_your_animation

[Install]
WantedBy=plymouth-start.service

Then enable the service.

Note: None of the previous methods will work if you are starting Plymouth from initramfs.

Troubleshooting

Disable with kernel parameters

If you experience problems during boot, you can temporary disable Plymouth with the following kernel parameters:

plymouth.enable=0 disablehooks=plymouth

Debugging

To write debug output into /var/log/plymouth-debug.log, add the following kernel parameter:

plymouth.debug

Password prompt does not update

When using systemd instead of udev hooks in Mkinitcpio, the password prompt may not update on themes that handle it via Plymouth scripting.

You can try switching to development version plymouth-gitAUR or using substitutes from Mkinitcpio#Common hooks.

Display is not centered

Certain themes may have trouble centering the display when there is more than one monitor enabled during boot.

You can use Kernel mode setting#Forcing modes to disable specific monitors.

See also