From a3175ef9f9b289716be8504956ea5c13309617c0 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Apr 10 2018 05:47:36 +0000 Subject: import plymouth-0.8.9-0.31.20140113.el7 --- diff --git a/SOURCES/0001-device-manager-fall-back-to-text-mode-if-graphical-d.patch b/SOURCES/0001-device-manager-fall-back-to-text-mode-if-graphical-d.patch new file mode 100644 index 0000000..74e076a --- /dev/null +++ b/SOURCES/0001-device-manager-fall-back-to-text-mode-if-graphical-d.patch @@ -0,0 +1,411 @@ +From 6cffa8daaca920f1d57da40d93ff112f5f096ae9 Mon Sep 17 00:00:00 2001 +From: Ray Strode +Date: Tue, 7 Nov 2017 13:49:30 -0500 +Subject: [PATCH] device-manager: fall back to text mode if graphical devices + fail + +Right now we assume if we find a /dev/dri/card0 that it will work. +That may not be true. The proprietary nvidia driver, for instance, +provides /dev/dri/card0 but disables modesetting by default. + +This commit makes sure we fall back to text mode if /dev/dri/card0 +is insufficient for our needs. +--- + src/libply-splash-core/ply-device-manager.c | 25 ++++++++++++++----------- + 1 file changed, 14 insertions(+), 11 deletions(-) + +diff --git a/src/libply-splash-core/ply-device-manager.c b/src/libply-splash-core/ply-device-manager.c +index 14d7616..3a2db06 100644 +--- a/src/libply-splash-core/ply-device-manager.c ++++ b/src/libply-splash-core/ply-device-manager.c +@@ -14,61 +14,61 @@ + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + #include "config.h" + #include "ply-device-manager.h" + + #include + #include + #include + #include + #include + #include + #include + #include + #include + + #include + + #include "ply-logger.h" + #include "ply-event-loop.h" + #include "ply-hashtable.h" + #include "ply-list.h" + #include "ply-utils.h" + + #define SUBSYSTEM_DRM "drm" + #define SUBSYSTEM_FRAME_BUFFER "graphics" + +-static void create_devices_for_terminal_and_renderer_type (ply_device_manager_t *manager, ++static bool create_devices_for_terminal_and_renderer_type (ply_device_manager_t *manager, + const char *device_path, + ply_terminal_t *terminal, + ply_renderer_type_t renderer_type); + struct _ply_device_manager + { + ply_device_manager_flags_t flags; + ply_event_loop_t *loop; + ply_hashtable_t *terminals; + ply_hashtable_t *renderers; + ply_terminal_t *local_console_terminal; + ply_list_t *keyboards; + ply_list_t *text_displays; + ply_list_t *pixel_displays; + struct udev *udev_context; + struct udev_queue *udev_queue; + int udev_queue_fd; + ply_fd_watch_t *udev_queue_fd_watch; + struct udev_monitor *udev_monitor; + + ply_keyboard_added_handler_t keyboard_added_handler; + ply_keyboard_removed_handler_t keyboard_removed_handler; + ply_pixel_display_added_handler_t pixel_display_added_handler; + ply_pixel_display_removed_handler_t pixel_display_removed_handler; + ply_text_display_added_handler_t text_display_added_handler; + ply_text_display_removed_handler_t text_display_removed_handler; + void *event_handler_data; + + uint32_t local_console_managed : 1; + uint32_t local_console_is_text : 1; + uint32_t serial_consoles_detected : 1; +@@ -134,110 +134,112 @@ fb_device_has_drm_device (ply_device_manager_t *manager, + + /* there should only ever be at most one match so we don't iterate through + * the list, but just look at the first entry */ + card_entry = udev_enumerate_get_list_entry (card_matches); + + if (card_entry != NULL) + { + struct udev_device *card_device = NULL; + const char *card_node; + const char *card_path; + + card_path = udev_list_entry_get_name (card_entry); + card_device = udev_device_new_from_syspath (manager->udev_context, card_path); + card_node = udev_device_get_devnode (card_device); + if (card_node != NULL && drm_device_in_use (manager, card_node)) + has_drm_device = true; + else + ply_trace ("no card node!"); + + udev_device_unref (card_device); + } + else + { + ply_trace ("no card entry!"); + } + + udev_enumerate_unref (card_matches); + return has_drm_device; + } + +-static void ++static bool + create_devices_for_udev_device (ply_device_manager_t *manager, + struct udev_device *device) + { + const char *device_path; ++ bool created = false; + + device_path = udev_device_get_devnode (device); + + if (device_path != NULL) + { + const char *subsystem; + + ply_renderer_type_t renderer_type = PLY_RENDERER_TYPE_NONE; + + subsystem = udev_device_get_subsystem (device); + ply_trace ("device subsystem is %s", subsystem); + + if (subsystem != NULL && strcmp (subsystem, SUBSYSTEM_DRM) == 0) + { + ply_trace ("found DRM device %s", device_path); + renderer_type = PLY_RENDERER_TYPE_DRM; + } + else if (strcmp (subsystem, SUBSYSTEM_FRAME_BUFFER) == 0) + { + ply_trace ("found frame buffer device %s", device_path); + if (!fb_device_has_drm_device (manager, device)) + { + renderer_type = PLY_RENDERER_TYPE_FRAME_BUFFER; + } + else + { + ply_trace ("ignoring, since there's a DRM device associated with it"); + } + } + + if (renderer_type != PLY_RENDERER_TYPE_NONE) + { + ply_terminal_t *terminal = NULL; + + if (!manager->local_console_managed) + { + terminal = manager->local_console_terminal; + } + +- create_devices_for_terminal_and_renderer_type (manager, +- device_path, +- terminal, +- renderer_type); ++ created = create_devices_for_terminal_and_renderer_type (manager, ++ device_path, ++ terminal, ++ renderer_type); + } + } ++ return created; + } + + static void + free_displays_for_renderer (ply_device_manager_t *manager, + ply_renderer_t *renderer) + { + ply_list_node_t *node; + + node = ply_list_get_first_node (manager->pixel_displays); + while (node != NULL) + { + ply_list_node_t *next_node; + ply_pixel_display_t *display; + ply_renderer_t *display_renderer; + + display = ply_list_node_get_data (node); + next_node = ply_list_get_next_node (manager->pixel_displays, node); + display_renderer = ply_pixel_display_get_renderer (display); + + if (display_renderer == renderer) + { + if (manager->pixel_display_removed_handler != NULL) + manager->pixel_display_removed_handler (manager->event_handler_data, display); + + ply_pixel_display_free (display); + ply_list_remove_node (manager->pixel_displays, node); + } + + node = next_node; + } +@@ -300,62 +302,61 @@ create_devices_for_subsystem (ply_device_manager_t *manager, + const char *path; + + path = udev_list_entry_get_name (entry); + + if (path == NULL) + { + ply_trace ("path was null!"); + continue; + } + + ply_trace ("found device %s", path); + + device = udev_device_new_from_syspath (manager->udev_context, path); + + /* if device isn't fully initialized, we'll get an add event later + */ + if (udev_device_get_is_initialized (device)) + { + ply_trace ("device is initialized"); + + /* We only care about devices assigned to a (any) seat. Floating + * devices should be ignored. + */ + if (udev_device_has_tag (device, "seat")) + { + const char *node; + node = udev_device_get_devnode (device); + if (node != NULL) + { + ply_trace ("found node %s", node); +- found_device = true; +- create_devices_for_udev_device (manager, device); ++ found_device = create_devices_for_udev_device (manager, device); + } + } + else + { + ply_trace ("device doesn't have a seat tag"); + } + } + else + { + ply_trace ("it's not initialized"); + } + + udev_device_unref (device); + } + + udev_enumerate_unref (matches); + + return found_device; + } + + static void + on_udev_event (ply_device_manager_t *manager) + { + struct udev_device *device; + const char *action; + + device = udev_monitor_receive_device (manager->udev_monitor); + if (device == NULL) + return; + +@@ -655,137 +656,139 @@ create_pixel_displays_for_renderer (ply_device_manager_t *manager, + node = next_node; + } + } + + static void + create_text_displays_for_terminal (ply_device_manager_t *manager, + ply_terminal_t *terminal) + { + ply_text_display_t *display; + + if (!ply_terminal_is_open (terminal)) + { + if (!ply_terminal_open (terminal)) + { + ply_trace ("could not add terminal %s: %m", + ply_terminal_get_name (terminal)); + return; + } + } + + ply_trace ("adding text display for terminal %s", + ply_terminal_get_name (terminal)); + + display = ply_text_display_new (terminal); + ply_list_append_data (manager->text_displays, display); + + if (manager->text_display_added_handler != NULL) + manager->text_display_added_handler (manager->event_handler_data, display); + } + +-static void ++static bool + create_devices_for_terminal_and_renderer_type (ply_device_manager_t *manager, + const char *device_path, + ply_terminal_t *terminal, + ply_renderer_type_t renderer_type) + { + ply_renderer_t *renderer = NULL; + ply_keyboard_t *keyboard = NULL; + + renderer = ply_hashtable_lookup (manager->renderers, (void *) device_path); + + if (renderer != NULL) + { + ply_trace ("ignoring device %s since it's already managed", + device_path); +- return; ++ return true; + } + + ply_trace ("creating devices for %s (renderer type: %u) (terminal: %s)", + device_path? : "", renderer_type, terminal? ply_terminal_get_name (terminal): "none"); + + if (renderer_type != PLY_RENDERER_TYPE_NONE) + { + renderer = ply_renderer_new (renderer_type, device_path, terminal); + + if (!ply_renderer_open (renderer)) + { + ply_trace ("could not open renderer for %s", device_path); + ply_renderer_free (renderer); + renderer = NULL; + if (renderer_type != PLY_RENDERER_TYPE_AUTO) +- return; ++ return false; + } + } + + if (renderer != NULL) + { + keyboard = ply_keyboard_new_for_renderer (renderer); + ply_list_append_data (manager->keyboards, keyboard); + + if (manager->keyboard_added_handler != NULL) + manager->keyboard_added_handler (manager->event_handler_data, keyboard); + + ply_hashtable_insert (manager->renderers, strdup (device_path), renderer); + create_pixel_displays_for_renderer (manager, renderer); + + if (manager->renderers_activated) + { + ply_trace ("activating renderer"); + ply_renderer_activate (renderer); + } + } + else if (terminal != NULL) + { + keyboard = ply_keyboard_new_for_terminal (terminal); + ply_list_append_data (manager->keyboards, keyboard); + + if (manager->keyboard_added_handler != NULL) + manager->keyboard_added_handler (manager->event_handler_data, keyboard); + } + + if (terminal != NULL) + { + create_text_displays_for_terminal (manager, terminal); + + if (terminal == manager->local_console_terminal) + { + manager->local_console_is_text = renderer == NULL; + manager->local_console_managed = true; + } + } + + if (keyboard != NULL && manager->keyboards_activated) + { + ply_trace ("activating keyboards"); + ply_keyboard_watch_for_input (keyboard); + } ++ ++ return true; + } + + static void + create_devices_for_terminal (const char *device_path, + ply_terminal_t *terminal, + ply_device_manager_t *manager) + { + create_devices_for_terminal_and_renderer_type (manager, + device_path, + terminal, + PLY_RENDERER_TYPE_NONE); + } + static bool + create_devices_from_terminals (ply_device_manager_t *manager) + { + bool has_serial_consoles; + + ply_trace ("checking for consoles"); + + if (manager->flags & PLY_DEVICE_MANAGER_FLAGS_IGNORE_SERIAL_CONSOLES) + { + has_serial_consoles = false; + ply_trace ("ignoring all consoles but default console because explicitly told to."); + } + else + { + has_serial_consoles = add_consoles_from_file (manager, "/sys/class/tty/console/active"); + } + + if (has_serial_consoles) +-- +2.14.3 + diff --git a/SOURCES/bootlog b/SOURCES/bootlog index a3f3207..9be1a64 100644 --- a/SOURCES/bootlog +++ b/SOURCES/bootlog @@ -4,4 +4,5 @@ daily copytruncate rotate 7 + notifempty } diff --git a/SPECS/plymouth.spec b/SPECS/plymouth.spec index b25886f..1089558 100644 --- a/SPECS/plymouth.spec +++ b/SPECS/plymouth.spec @@ -7,7 +7,7 @@ Summary: Graphical Boot Animation and Logger Name: plymouth Version: 0.8.9 -Release: 0.28.20140113%{?dist} +Release: 0.31.20140113%{?dist} License: GPLv2+ Group: System Environment/Base Source0: http://freedesktop.org/software/plymouth/releases/%{name}-%{version}.tar.bz2 @@ -26,6 +26,7 @@ Requires: initscripts >= 8.83-1 Conflicts: filesystem < 3 Conflicts: systemd < 185-3 +BuildRequires: git BuildRequires: pkgconfig(libdrm) BuildRequires: kernel-headers BuildRequires: pkgconfig(libudev) @@ -58,6 +59,7 @@ Patch16: fix-progress-bar-colors.patch Patch17: fix-escape-key-for-media-check.patch Patch18: 0001-Revert-Recreate-boot-log-at-each-boot-instead-of-app.patch Patch19: 0001-Revert-Make-boot.log-world-readable-by-default.patch +Patch20: 0001-device-manager-fall-back-to-text-mode-if-graphical-d.patch Patch99: colors.patch %description @@ -236,7 +238,7 @@ Provides: plymouth(system-theme) = %{version}-%{release} %description theme-charge This package contains the "charge" boot splash theme for -Plymouth. It is the default theme for CentOS Linux. +Plymouth. It is the default theme for Red Hat Enterprise Linux. %package plugin-script Summary: Plymouth "script" plugin @@ -273,28 +275,7 @@ This package contains the "spinner" boot splash theme for Plymouth. It features a small spinner on a dark background. %prep -%setup -q -%patch0 -p1 -b .dont-block-show-splash -%patch1 -p1 -b .always-add-text-splash -%patch2 -p1 -b .fix-text-splash-os-string -%patch3 -p1 -b .fix-details -%patch4 -p1 -b .fix-startup-race -%patch5 -p1 -b .fix-hide-splash -%patch6 -p1 -b .ignore-early-fb-devices -%patch7 -p1 -b .fix-ask-password-race -%patch8 -p1 -b .serial-console-fixes -%patch9 -p1 -b .fix-init-bin-sh -%patch10 -p1 -b .resize-proc-cmdline-buffer -%patch11 -p1 -b .cursor-fix -%patch12 -p1 -b .ship-label-plugin-in-initrd -%patch13 -p1 -b .fix-coldplug-detection -%patch14 -p1 -b .ensure-output-gets-terminal -%patch15 -p1 -b .activate-new-renderers -%patch16 -p1 -b .fix-progress-bar-colors -%patch17 -p1 -b .fix-escape-key-for-media-check -%patch18 -p1 -b .dont-truncate-boot.log -%patch19 -p1 -b .dont-change-boot.log-file-mode -%patch99 -p1 -b .colors +%autosetup -S git # Change the default theme sed -i -e 's/fade-in/charge/g' src/plymouthd.defaults @@ -359,9 +340,6 @@ rm -rf $RPM_BUILD_ROOT %post [ -f %{_localstatedir}/lib/plymouth/boot-duration ] || cp -f %{_datadir}/plymouth/default-boot-duration %{_localstatedir}/lib/plymouth/boot-duration -%posttrans -%{_libexecdir}/plymouth/plymouth-generate-initrd - %postun if [ $1 -eq 0 ]; then rm -f %{_libdir}/plymouth/default.so @@ -374,51 +352,10 @@ fi %post graphics-libs -p /sbin/ldconfig %postun graphics-libs -p /sbin/ldconfig -%postun theme-spinfinity -export LIB=%{_lib} -if [ $1 -eq 0 ]; then - if [ "$(%{_sbindir}/plymouth-set-default-theme)" == "spinfinity" ]; then - %{_sbindir}/plymouth-set-default-theme text - %{_libexecdir}/plymouth/plymouth-generate-initrd - fi -fi - -%postun theme-fade-in -export LIB=%{_lib} -if [ $1 -eq 0 ]; then - if [ "$(%{_sbindir}/plymouth-set-default-theme)" == "fade-in" ]; then - %{_sbindir}/plymouth-set-default-theme --reset - %{_libexecdir}/plymouth/plymouth-generate-initrd - fi -fi - -%postun theme-spinner -export LIB=%{_lib} -if [ $1 -eq 0 ]; then - if [ "$(%{_sbindir}/plymouth-set-default-theme)" == "spinner" ]; then - %{_sbindir}/plymouth-set-default-theme --reset - %{_libexecdir}/plymouth/plymouth-generate-initrd - fi -fi - -%postun theme-solar -export LIB=%{_lib} -if [ $1 -eq 0 ]; then - if [ "$(%{_sbindir}/plymouth-set-default-theme)" == "solar" ]; then - %{_sbindir}/plymouth-set-default-theme --reset - %{_libexecdir}/plymouth/plymouth-generate-initrd - fi -fi - %post theme-charge export LIB=%{_lib} if [ $1 -eq 1 ]; then %{_sbindir}/plymouth-set-default-theme charge -else - if [ "$(%{_sbindir}/plymouth-set-default-theme)" == "solar" ]; then - %{_sbindir}/plymouth-set-default-theme charge - %{_libexecdir}/plymouth/plymouth-generate-initrd - fi fi %postun theme-charge @@ -426,7 +363,6 @@ export LIB=%{_lib} if [ $1 -eq 0 ]; then if [ "$(%{_sbindir}/plymouth-set-default-theme)" == "charge" ]; then %{_sbindir}/plymouth-set-default-theme --reset - %{_libexecdir}/plymouth/plymouth-generate-initrd fi fi @@ -441,7 +377,7 @@ fi %dir %{_localstatedir}/lib/plymouth %dir %{_libdir}/plymouth/renderers %dir %{_sysconfdir}/plymouth -%config(noreplace) %{_sysconfdir}/plymouth/plymouthd.conf +%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/plymouth/plymouthd.conf %config(noreplace) %{_sysconfdir}/logrotate.d/bootlog %{plymouthdaemon_execdir}/plymouthd %{plymouthclient_execdir}/plymouth @@ -562,8 +498,20 @@ fi %defattr(-, root, root) %changelog -* Mon Jul 31 2017 CentOS Sources - 0.8.9-0.28.20140113.el7.centos -- Roll in Branding Change in the SPEC +* Mon Jan 08 2018 Ray Strode - 0.8.9-0.31.20140113 +- Change how we do scripts one more time + Resolves: #1530727 + Related: #1266085 + +* Tue Nov 07 2017 Ray Strode - 0.8.9-0.30.20140113 +- Update logrotate script to not rotate if empty + Resolves: #1507197 + +* Tue Nov 07 2017 Ray Strode - 0.8.9-0.29.20140113 +- Fall back to text mode if /dev/dri/card0 can't modeset + Resolves: #1431141 +- Remove unnecessary post scripts that rpm -V output + Resolves: #1266085 * Thu May 11 2017 Ray Strode - 0.8.9-0.28.20140113 - Don't change file mode of boot.log. Instead, remember what mode