plymouth

  • 了解plymouth.

1.概述

Linux distributions:

  • Bootsplash – the first and original implementation of a Linux kernel bootsplash, superseded by Splashy[2]
  • fbsplash – Gentoo implementation as bootsplash program[3]
  • Plymouth – uses Direct Rendering Manager (DRM) and KMS driver
  • Splashy – a graphical boot process designed to replace the aging Bootsplash program
  • usplash – former bootsplash program used by Ubuntu
  • XSplash – new splash program used by Ubuntu starting from 9.10
  • bootanimation - a simple splash for Android OS just showing some decompressed images.

  Plymouth is an application that runs very early in the boot process (even before the root filesystem is mounted) that provides a graphical boot animation while the boot process happens in the background.

  Plymouth is a bootsplash for Linux supporting animations using Direct Rendering Manager (DRM) and KMS driver. It gets packed into the initrd.

  Besides eye-candy, Plymouth also handles user interaction during boot.

  Plymouth was first included in Fedora 10 “Cambridge” shipped on November 25, 2008 where it replaced Red Hat Graphical Boot (RHGB). Ubuntu includes it in the Ubuntu 10.04 LTS “Lucid Lynx” release shipped on April 29, 2010.

2.Bootup logo

  It is highly advised to disable the Linux bootup logo. On some systems having the bootup logo displayed seems to cause problems.

  KERNEL This example shows the correct way to disable the bootup logo:

Device Drivers --->
   Graphics Support --->
      [ ] Bootup logo  --->

  Be sure to enable kernel modesetting (KMS) for the system’s respective graphics card.

KMS for Intel cards

KERNEL Intel onboard GPUs set to use modesetting:
Device Drivers --->
   Graphics Support --->
      <*> Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)  --->
         <*>   Intel 8xx/9xx/G3x/G4x/HD Graphics
         [*]     Enable modesetting on intel by default

3.Quick Facts

  • Plymouth:
    Uses KMS (Kernel Mode Setting) (where possible) and the framebuffer to set the screen resolution.

  • Comprises 3 components:

    • A daemon (server) process called plymouthd
      The daemon is responsible for the graphical display, animation and logging.
    • A client application called plymouth
      The client sends commands to the daemon
    • A library libply.so to allow applications to be written to talk to the daemon
      (The plymouth command is linked to libply.so for this reason).
  • Supports themes.

  • Runs at system startup and system shutdown:

    • Boot
      plymouthd is generally started in the initramfs
      (see file /usr/share/initramfs-tools/scripts/init-top/plymouth)

    • plymouthd is stopped at the point the Display Manager is starting

    • Shutdown

    • plymouthd is started by Upstart
      (see Upstart job configuration file file /etc/init/plymouth.conf).

  • Writes a log to /var/log/boot.log.

4.Startup

  The plymouthd daemon attempts to read the following files at startup (the first file it finds takes precedence over any other):

  • General configuration
    /etc/plymouth/plymouthd.conf
    /usr/share/plymouth/plymouthd.defaults

4.1.Show delay

  Plymouth has a configuration option to delay the splash screen:

/etc/plymouth/plymouthd.conf
[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 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.

5.To customize its boot animation, Plymouth has support to define a set of splash themes.

“Plymouth supports various “splash” themes which are analogous to screensavers, but happen at boot time. There are several sample themes shipped with plymouth, but most distributions that use plymouth ship something customized for their distribution.”

  You can list the available themes on your system by executing:

$ sudo plymouth-set-default-theme --list
And can change the default theme with:
$ sudo plymouth-set-default-theme <theme>
where <theme> is your selected theme (i.e: spinner)
After changing the default theme the initial ram filsystems has to be regenerated to add this information:
$ sudo update-initramfs -u

6.Plymouth sample splash themes

  The list of samples themes includes 2 text based themes and 7 graphical ones:

Text: “Text mode theme with tricolor progress bar”
Details: “Verbose fallback theme”
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”
Script: “Script example plugin”
Solar: “Space theme with violent flaring blue star”
Spinfinity: “Simple theme that shows a rotating infinity sign in the center of the screen”
Spinner: “Simple theme with a loading spinner”
  • /usr/share/plymouth/themes/text/text.plymouth
  • /usr/share/plymouth/themes/details/details.plymouth

Specifying which Plymouth theme to use on boot

  There are two ways to specify which theme will be used by Plymouth:

1.Adding plymouth.theme=${THEME} as a parameter to the kernel command line
2.Specifying Theme=${THEME} in the /etc/plymouth/plymouthd.conf Plymouth configuration file.

Debug

1.查找plymouth

~$ lsinitramfs /boot/initrd.img-4.19.0-6-amd64  | grep plymouth
etc/plymouth
etc/plymouth/plymouthd.conf
scripts/init-bottom/plymouth
scripts/init-premount/plymouth
scripts/panic/plymouth
usr/bin/plymouth
usr/lib/x86_64-linux-gnu/plymouth
usr/lib/x86_64-linux-gnu/plymouth/details.so
usr/lib/x86_64-linux-gnu/plymouth/renderers
usr/lib/x86_64-linux-gnu/plymouth/renderers/drm.so
usr/lib/x86_64-linux-gnu/plymouth/renderers/frame-buffer.so
usr/lib/x86_64-linux-gnu/plymouth/script.so
usr/lib/x86_64-linux-gnu/plymouth/text.so
usr/sbin/plymouthd
usr/share/plymouth
usr/share/plymouth/debian-logo.png
usr/share/plymouth/plymouthd.defaults
usr/share/plymouth/themes
usr/share/plymouth/themes/deepin-ssd-logo
usr/share/plymouth/themes/deepin-ssd-logo/boot.png
usr/share/plymouth/themes/deepin-ssd-logo/box.png
usr/share/plymouth/themes/deepin-ssd-logo/bullet.png
usr/share/plymouth/themes/deepin-ssd-logo/deepin-ssd-logo.grub
usr/share/plymouth/themes/deepin-ssd-logo/deepin-ssd-logo.plymouth
usr/share/plymouth/themes/deepin-ssd-logo/deepin-ssd-logo.script
usr/share/plymouth/themes/deepin-ssd-logo/entry.png
usr/share/plymouth/themes/deepin-ssd-logo/lock.png
usr/share/plymouth/themes/deepin-ssd-logo/logo.png
usr/share/plymouth/themes/details
usr/share/plymouth/themes/details/details.plymouth
usr/share/plymouth/themes/text
usr/share/plymouth/themes/text/text.plymouth

2.And if you want more debug log, you can add plymouth:debug to the kernel command line.

Edit the file /etc/default/grub and search for LINUX_DEFAULT line:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash vt.handoff=7 kaslr"
and change it to this:
GRUB_CMDLINE_LINUX_DEFAULT="plymouth:debug splash vt.handoff=7 kaslr"

Note:/var/log/plymouth-debug.log

3.Testing your theme without reboot and adding debug info

  The splash that will be displayed by Plymouth can be tested on X by installing the plymouth-x11 package:

$ sudo apt-get install plymouth-x11
$ sudo plymouthd plymouth.splash=${
     THEME}"; sudo plymouth show-splash; sleep 5; sudo killall plymouthd

4.脚本

  • /etc/init.d/plymouth
  • /etc/init.d/plymouth-log

refer to

  • https://launchpad.net/plymouth
  • https://www.freedesktop.org/wiki/Software/Plymouth/
  • https://en.wikipedia.org/wiki/Bootsplash
  • https://wiki.gentoo.org/wiki/Plymouth
  • https://wiki.ubuntu.com/Plymouth
  • https://www.apertis.org/guides/video-animation-on-boot/

你可能感兴趣的:(操作系统,plymouth)