1. 16 Nov, 2021 2 commits
  2. 18 Oct, 2021 2 commits
  3. 27 Sep, 2021 6 commits
  4. 23 Sep, 2021 2 commits
  5. 22 Sep, 2021 5 commits
  6. 21 Sep, 2021 9 commits
  7. 06 Apr, 2021 5 commits
    • Hans de Goede's avatar
      Merge branch 'rework-shutdown-handling' into 'master' · e5544750
      Hans de Goede authored
      Rework shutdown handling
      
      See merge request !138
      e5544750
    • Ray Strode's avatar
      systemd: Add plymouth-switch-root-initramfs.service to switch back to initramfs on shutdown · 2a7755fe
      Ray Strode authored
      Add a plymouth-switch-root-initramfs.service, which will call
      "plymouth update-root-fs --new-root-dir=/run/initramfs" to switch back
      to the initramfs (when applicable).
      
      Systemd will run this service before plymouthd receives the SIGTERM on
      shutdown, so this will cause the plymouthd-fd-escrow helper to run
      from the initramfs.
      
      This avoids the plymouthd-fd-escrow helper keeping the rootfs busy.
      
      Changes by Hans de Goede:
      - Fix a couple of typos
      - Add Conflicts=dracut-shutdown.service to plymouth-switch-root-initramfs.service
        dracut-shutdown.service restores the initramfs when it is _stopped_
        use Conflicts to make sure its ExecStop has run before we do
      - Add a check for switching back to the initramfs to on_newroot () and dump
        the debug-buffer before the switch (while we still have access to /var/log).
      - Also add plymouth-switch-root-initramfs.service to kexec.target.wants.
        kexec.target.wants uses --mode=shut...
      2a7755fe
    • Ray Strode's avatar
      main: Add a plymouthd-fd-escrow helper · a0c743c7
      Ray Strode authored
      When plymouth receives SIGTERM during shutdown or reboot, we must
      exit cleanly to avoid keeping files open on the rootfs and to avoid
      making drmModeSetCrtc () calls after the kms driver's shutdown method
      has ran.
      
      But at the same time we also want the boot-splash to stay up (in its
      idle form) until the system actually reboots or powers off.
      So we want to avoid the boot-splash getting replaced by e.g.
      the text-console.
      
      Add a plymouthd-fd-escrow helper which will get forked off when we
      receive a SIGTERM in reboot/shutdown mode with pixel-displays active.
      
      This helper will keep the fds for the pixel-displays open, so that
      the boot-splash stays up until the end.
      
      Changes by Hans de Goede:
      - Start the escrow helper from main.c instead of from the drm plugin
      - Rename the helper from plymouthd-drm-escrow to plymouthd-fd-escrow, since it
        will be used to escrow fbdev fd-s too now
      - In the child of the fork, continue with quiting normally (letting the
        bootsplash become id...
      a0c743c7
    • Hans de Goede's avatar
      main: Dump debug log to plymouth-shutdown-debug.log on shutdown/reboot · a4bb4c14
      Hans de Goede authored
      
      
      When working on plymouth I always have "plymouth.debug=stream:/dev/null"
      on the kernel commandline. This enables tracing without logging anything
      to the console and causes the entire trace to be logged to
      /var/log/plymouth-debug.log when plymouth quits.
      
      This is very useful for debugging (non crash) issues with plymouth at boot.
      With the recent "main: Cleanly quit on SIGTERM" change plymouth will now
      also write a trace log to /var/log/plymouth-debug.log on shutdown/reboot,
      but this will be overwritten again on boot by the boot log.
      
      This commit changes the default debug_buffer_path value from:
      /var/log/plymouth-debug.log to /var/log/plymouth-shutdown-debug.log
      when in shutdown or reboot mode so that it does not get overwritten
      by the debug-log written at boot.
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      a4bb4c14
    • Hans de Goede's avatar
      main: Cleanly quit on SIGTERM · eb5227b4
      Hans de Goede authored
      
      
      Now that we are no longer unconditionally opting out of getting terminated,
      we get send a SIGTERM when transitioning from the rootfs back to the initrd
      on poweroff/reboot.
      
      Catch this SIGTERM and then exit cleanly by calling the on_quit handler,
      besides exiting cleanly being the right thing to do, this will also allow the
      boot-splash to go idle, so that it can cleanly finish the end-animation.
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      eb5227b4
  8. 31 Mar, 2021 2 commits
    • Hans de Goede's avatar
      main: Only mark plymouthd as unkillable when running from the initrd · 156ae743
      Hans de Goede authored
      Before this commit plymouthd would always mark itself as "unkillable"
      by setting "argv[0][0] = '@';" as documented here:
      https://www.freedesktop.org/wiki/Software/systemd/RootStorageDaemons/
      
      There are 2 problems with this:
      
      1. This causes filesystems to fail to remount read-only in some case,
      plymouthd may be holding open a deleted file (say an upgraded library).
      If that happens, then the filesystem won't allow the disk to be remounted
      read-only, because when plymouth dies, the filesystem will need to do I/O
      to clean up the removed file from disk.
      
      2. This causes the "gracefully shutdown" of displays which the kernel's
      i915 driver recently introduced in commit fe0f1e3bfdfe ("drm/i915: Shut
      down displays gracefully on reboot") to get undone. Because of being
      "unkillable" plymouthd keeps running and showing the spinner animation
      to the very end, this results in a drmModeSetCrtc () call after the i915
      display driver has turned off the displays. This causes 2 issues:
      
      2.1 This causes the screen to go black for 1-2 seconds and then show the
      plymouth screen again for 1-2 seconds on poweroff/reboot which looks ugly:
      https://bugzilla.redhat.com/show_bug.cgi?id=1941329
      
      2.2 This may cause issues with the attached monitors on reboot, since it
      undoes the gracefull shutdown which the i915 does.
      
      Change the code to only set "argv[0][0] = '@';" when run from the initrd
      at bootup, this solves the 2 mentioned issues and brings the code inline
      with the above specification which says this should only ever be used for
      daemons started from the initrd.
      
      Note this will cause plymouth to get killed on shutdown, leading to the
      last couple of text messages of shutdown being shown on shutdown.
      This will be fixed by the next couple of patches.
      
      Related: !118
      Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1941329
      
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      156ae743
    • Hans de Goede's avatar
      ply-device-manager: Don't deactivate renderers from ply_device_manager_free () · 630ca2e1
      Hans de Goede authored
      
      
      Don't deactivate renderers from ply_device_manager_free (),
      ply_device_manager_free () is only ever called with the renderers still
      active on a "plymouth quit --retain-splash".
      
      Since the splash is being retained in this case the renderers should not be
      deactivated. Normally this does not matter because plymouthd exits almost
      immediately afterwards and the kernels will close the renderers fds on exit.
      
      But with the upcoming plymouthd-drm-escrow binary which keeps the renderers
      fds open, not deactivate renderers; and thus not dropping DRM master rights
      does make a difference.
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      630ca2e1
  9. 29 Mar, 2021 7 commits
    • Hans de Goede's avatar
      Merge branch 'text-n-details-splash-fixes' into 'master' · fbe2b79d
      Hans de Goede authored
      Text and details splash fixes
      
      See merge request !137
      fbe2b79d
    • Hans de Goede's avatar
      details: Clear newly added text-display before replaying log messages · 0e59dde8
      Hans de Goede authored
      
      
      When switching between the "text" splash and the "details" splash the
      "text" splash's hide function clears the console/terminal before
      the "details" splash replays the log messages. So on each switch
      the user sees all the log messages once.
      
      But when switching between a graphical/pixel splash and details,
      the console/terminal is not touched by the graphical splash's hide
      function; and the details splash's hide function deliberately does
      not clear the terminal on hide, so that when booting in detailed
      mode, the log messages stay on the console when plymouth exits.
      
      This means that when switching graphical-splash -> details ->
      graphical-splash -> details, the second time the details splash
      gets shown, the previous set of replayed log messages is still
      on the terminal and all messages are now shown twice.
      (and toggling back and forth a third time makes them all show 3
      times, etc).
      
      Fix this by clearing the terminal on show, before replaying the
      log messages.
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      0e59dde8
    • Hans de Goede's avatar
      text/tribar: Fix ply_boot_splash_hide () not clearing the terminal · c6a8cf9d
      Hans de Goede authored
      In order to clear the console/terminal back to black again when hiding
      the splash, we must restore the original terminal palette, so that
      black actually is black before calling ply_text_display_clear_screen ().
      
      Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1933378
      
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      c6a8cf9d
    • Hans de Goede's avatar
      ply-text-display: Fix bottom pixels of fbcon not getting cleared · 9b9d7e1b
      Hans de Goede authored
      When fbcon is used for the console then there might be some unused
      rows of pixels at the bottom because the screen's height in pixel
      is not fully divideable by the font height. So the remaining few
      rows of pixels at the bottom are unused.
      
      The "text" splash changes the background color of the terminal and
      then does a ply_text_display_clear_screen () to clear the console
      to the new background color.
      
      ply_text_display_clear_screen () was using "ESC [ 2 J" as control-sequence
      to clear the screen. Which means "clear the entire screen" but fbcon
      seems to not always count the unused bottom rows part of the "entire
      screen", leaving them black.
      
      Also send an "ESC [ 3 J" control-sequence when clearing the screen,
      which means "clear the entire screen; and the scrollback-buffer".
      Using this does consistenly result in the unused bottom rows always
      being set to the background color.
      
      This new behavior is esp. important when hiding the splash (e.g.
      when quiting) because under some circumstances (1) the "ESC [ 2 J"
      would clear the unused bottom rows to plymouth's background color
      and then when hiding the splash it would not clear the unused rows,
      leaving the unused rows set to plymouth's background color after
      plymouth has quit.
      
      Note the "ESC [ 2 J" control sequences is also still send because older
      (serial) terminals may not support the "ESC [ 3 J" control sequence.
      
      1) The exact circumstances when this happens are unclear
      
      Related: https://bugzilla.redhat.com/show_bug.cgi?id=1933378
      
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      9b9d7e1b
    • Hans de Goede's avatar
      ply-text-display: Only skip clearing the screen when tracing to a terminal · 9ef171f7
      Hans de Goede authored
      
      
      When the user has chosen to enable tracing to a file, so that the terminal
      output stays the same as when not tracing, ply_text_display_clear_screen ()
      should still clear the screen, as it does when not tracing.
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      9ef171f7
    • Hans de Goede's avatar
      main: Redirect stdio/stderr to null when tracing to a file · 8291d668
      Hans de Goede authored
      
      
      When the user has chosen to enable tracing to a file, so that the terminal
      output stays the same as when not tracing, we should still redirect
      tdio/stderr to /dev/null as we do when not tracing.
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      8291d668
    • Hans de Goede's avatar
      ply-logger: Add a ply_is_tracing_to_terminal () helper · ca869a3f
      Hans de Goede authored
      
      
      Track if we are logging to the terminal (or to a file) and add
      a new ply_is_tracing_to_terminal () helper.
      
      This will be used in follow-up patches to replace some
      ply_is_tracing () checks for things which should only be done
      when tracing to a terminal (and not when tracing to a file).
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      ca869a3f