diff --git a/SOURCES/fix-escape-key-for-media-check.patch b/SOURCES/fix-escape-key-for-media-check.patch new file mode 100644 index 0000000..19e1841 --- /dev/null +++ b/SOURCES/fix-escape-key-for-media-check.patch @@ -0,0 +1,96 @@ +From 014f62a8701e7c69436bfbf37a0f1b73968a23e8 Mon Sep 17 00:00:00 2001 +From: Ray Strode +Date: Fri, 1 Jul 2016 16:39:59 -0400 +Subject: [PATCH] main: fix escape key for media check + +Right now, if a show-splash request comes in, then +we don't actually operate on it until splash delay +seconds later (~5 by default). + +The problem is, if a hide-splash request comes in, in the mean +while, we don't cancel the queued show-splash request. + +This commit fixes that. +--- + src/main.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/src/main.c b/src/main.c +index 7c4ea3c..8a201f8 100644 +--- a/src/main.c ++++ b/src/main.c +@@ -1153,62 +1153,70 @@ hide_splash (state_t *state) + state->is_shown = false; + + cancel_pending_delayed_show (state); + + if (state->boot_splash == NULL) + return; + + ply_boot_splash_hide (state->boot_splash); + + if (state->local_console_terminal != NULL) + ply_terminal_set_mode (state->local_console_terminal, PLY_TERMINAL_MODE_TEXT); + } + + static void + dump_details_and_quit_splash (state_t *state) + { + state->showing_details = false; + toggle_between_splash_and_details (state); + + ply_device_manager_deactivate_renderers (state->device_manager); + hide_splash (state); + quit_splash (state); + } + + static void + on_hide_splash (state_t *state) + { + if (state->is_inactive) + return; + ++ /* If the splash is NULL then we haven't shown it yet, ++ * but we still need to call hide splash so it won't show ++ * spontaneously after the splash delay later. ++ */ + if (state->boot_splash == NULL) +- return; ++ { ++ ply_trace ("cancelling pending show splash operation (if any)"); ++ hide_splash (state); ++ return; ++ } + + ply_trace ("hiding boot splash"); + dump_details_and_quit_splash (state); + } + + #ifdef PLY_ENABLE_DEPRECATED_GDM_TRANSITION + static void + tell_gdm_to_transition (void) + { + int fd; + + fd = creat ("/var/spool/gdm/force-display-on-active-vt", 0644); + close (fd); + } + #endif + + static void + quit_program (state_t *state) + { + ply_trace ("cleaning up devices"); + ply_device_manager_free (state->device_manager); + + ply_trace ("exiting event loop"); + ply_event_loop_exit (state->loop, 0); + + if (pid_file != NULL) + { + unlink (pid_file); + free (pid_file); + pid_file = NULL; +-- +2.7.4 + diff --git a/SOURCES/fix-progress-bar-colors.patch b/SOURCES/fix-progress-bar-colors.patch new file mode 100644 index 0000000..7bd89d0 --- /dev/null +++ b/SOURCES/fix-progress-bar-colors.patch @@ -0,0 +1,88 @@ +From 167e74e56df055f419c960657eb66d73802a54f1 Mon Sep 17 00:00:00 2001 +From: Ray Strode +Date: Mon, 20 Jun 2016 11:06:49 -0400 +Subject: [PATCH] drm: don't pick up drm master implicitly + +If a client opens the drm device, they're given drm master +implicitly. We already explicitly take DRM master when we need it, +so that featuer is unneeded. + +Furthermore, it's actively harmful, since fbdev won't let you change +the color palette of the terminal if drm master is held. + +This commit makes sure to drop master as soon as we get it from +open(). +--- + src/plugins/renderers/drm/plugin.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/plugins/renderers/drm/plugin.c b/src/plugins/renderers/drm/plugin.c +index 6677279..ebfe864 100644 +--- a/src/plugins/renderers/drm/plugin.c ++++ b/src/plugins/renderers/drm/plugin.c +@@ -462,60 +462,62 @@ load_driver (ply_renderer_backend_t *backend) + int device_fd; + + ply_trace ("Opening '%s'", backend->device_name); + device_fd = open (backend->device_name, O_RDWR); + + if (device_fd < 0) + { + ply_trace ("open failed: %m"); + return false; + } + + backend->driver_interface = ply_renderer_generic_driver_get_interface (device_fd); + backend->driver_supports_mapping_console = false; + + if (backend->driver_interface == NULL) + { + close (device_fd); + return false; + } + + backend->driver = backend->driver_interface->create_driver (device_fd); + + if (backend->driver == NULL) + { + close (device_fd); + return false; + } + + backend->device_fd = device_fd; + ++ drmDropMaster (device_fd); ++ + return true; + } + + static void + unload_driver (ply_renderer_backend_t *backend) + { + if (backend->driver == NULL) + return; + + ply_trace ("unloading driver"); + assert (backend->driver_interface != NULL); + + backend->driver_interface->destroy_driver (backend->driver); + backend->driver = NULL; + + backend->driver_interface = NULL; + + if (backend->device_fd >= 0) + { + drmClose (backend->device_fd); + backend->device_fd = -1; + } + } + + static bool + open_device (ply_renderer_backend_t *backend) + { + assert (backend != NULL); + assert (backend->device_name != NULL); + +-- +2.7.4 + diff --git a/SOURCES/fix-text-splash-os-string.patch b/SOURCES/fix-text-splash-os-string.patch index d250024..a096d6d 100644 --- a/SOURCES/fix-text-splash-os-string.patch +++ b/SOURCES/fix-text-splash-os-string.patch @@ -1,110 +1,77 @@ -From 08f3708e7fe45227deff7424622b7c7a25428a8e Mon Sep 17 00:00:00 2001 +From ae62b6013c3fd562659e59b517237d64bb0a12c6 Mon Sep 17 00:00:00 2001 From: Ray Strode -Date: Fri, 17 Jan 2014 12:37:23 -0500 -Subject: [PATCH] text-progress-bar: prefer REDHAT_BUGZILLA_PRODUCT over - PRETTY_NAME +Date: Wed, 25 May 2016 14:57:43 -0400 +Subject: [PATCH] text-progress-bar: munge os-release output -The latter is currently filled with incorrect information on install -images and it's apparently hard to fix. +RHEL uses the same /etc/os-release file in the installer for all +variants. This means we need to trim the variant out from the +string, since it's not accurate. + +dracut adds its own mark to the os-release file in the initramfs, +we need to trim that out, too. --- - src/libply-splash-core/ply-text-progress-bar.c | 53 +++++++++++++++----------- - 1 file changed, 31 insertions(+), 22 deletions(-) + src/libply-splash-core/ply-text-progress-bar.c | 24 ++++++++++++++++++++++++ + 1 file changed, 24 insertions(+) diff --git a/src/libply-splash-core/ply-text-progress-bar.c b/src/libply-splash-core/ply-text-progress-bar.c -index 8c4e759..8ca8816 100644 +index 8c4e759..a5a6aff 100644 --- a/src/libply-splash-core/ply-text-progress-bar.c +++ b/src/libply-splash-core/ply-text-progress-bar.c -@@ -92,89 +92,98 @@ ply_text_progress_bar_free (ply_text_progress_bar_t *progress_bar) - if (progress_bar == NULL) - return; - - free (progress_bar); - } - - static void - get_os_string (void) - { - int fd; - char *buf, *pos, *pos2; - struct stat sbuf; - - buf = NULL; - - fd = open (RELEASE_FILE, O_RDONLY|O_CLOEXEC); - if (fd == -1) - goto out; - - if (fstat (fd, &sbuf) == -1) { - close (fd); - goto out; - } - - buf = calloc (sbuf.st_size + 1, sizeof(char)); - read (fd, buf, sbuf.st_size); - close (fd); - - if (strcmp (RELEASE_FILE, "/etc/os-release") == 0) +@@ -121,60 +121,84 @@ get_os_string (void) { -- char key[] = "PRETTY_NAME="; -+ const char *keys[] = { "REDHAT_BUGZILLA_PRODUCT=", "PRETTY_NAME=", "NAME=", NULL }; -+ int i; + char key[] = "PRETTY_NAME="; + + for (pos = strstr (buf, key); + pos != NULL; + pos = strstr (pos, key)) + { + if (pos == buf || pos[-1] == '\n') + break; + } -- for (pos = strstr (buf, key); -- pos != NULL; -- pos = strstr (pos, key)) -+ for (i = 0; keys[i] != NULL; i++) + if (pos != NULL) { -- if (pos == buf || pos[-1] == '\n') -- break; -- } -- -- if (pos != NULL) -- { -- pos += strlen (key); -- pos2 = strstr (pos, "\n"); -+ const char *key; + pos += strlen (key); + pos2 = strstr (pos, "\n"); -- if (pos2 != NULL) -- *pos2 = '\0'; -- else -- pos2 = pos + strlen(pos) - 1; -+ key = keys[i]; + if (pos2 != NULL) + *pos2 = '\0'; + else + pos2 = pos + strlen(pos) - 1; -- if ((*pos == '\"' && pos2[-1] == '\"') || -- (*pos == '\'' && pos2[-1] == '\'')) -+ for (pos = strstr (buf, key); -+ pos != NULL; -+ pos = strstr (pos, key)) + if ((*pos == '\"' && pos2[-1] == '\"') || + (*pos == '\'' && pos2[-1] == '\'')) { -- pos++; -- pos2--; -+ if (pos == buf || pos[-1] == '\n') -+ break; -+ } + pos++; + pos2--; -- *pos2 = '\0'; + *pos2 = '\0'; + } + asprintf (&os_string, " %s", pos); ++ ++ /* For RHEL, overwrite variant because it's not reliable, see ++ * bug 911553 ++ */ ++ pos = strstr (os_string, "Red Hat Enterprise Linux "); ++ + if (pos != NULL) + { -+ pos += strlen (key); -+ pos2 = strstr (pos, "\n"); ++ pos += strlen ("Red Hat Enterprise Linux "); + -+ if (pos2 != NULL) -+ *pos2 = '\0'; -+ else -+ pos2 = pos + strlen(pos) - 1; ++ pos2 = strstr (pos, " "); + -+ if ((*pos == '\"' && pos2[-1] == '\"') || -+ (*pos == '\'' && pos2[-1] == '\'')) ++ if (pos2 != NULL) + { -+ pos++; -+ pos2--; -+ -+ *pos2 = '\0'; ++ pos2++; ++ memmove (pos, pos2, strlen (pos2)); + } -+ asprintf (&os_string, " %s", pos); -+ goto out; - } -- asprintf (&os_string, " %s", pos); ++ } ++ ++ /* Trim out code names and dracut gook ++ */ ++ pos = strstr (os_string, " ("); ++ if (pos != NULL) ++ *pos = '\0'; } goto out; } @@ -136,5 +103,5 @@ index 8c4e759..8ca8816 100644 ply_text_progress_bar_draw (ply_text_progress_bar_t *progress_bar) { -- -1.8.3.1 +2.8.1 diff --git a/SPECS/plymouth.spec b/SPECS/plymouth.spec index 8986cf0..083302d 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.24.20140113%{?dist} +Release: 0.26.20140113%{?dist} License: GPLv2+ Group: System Environment/Base Source0: http://freedesktop.org/software/plymouth/releases/%{name}-%{version}.tar.bz2 @@ -53,6 +53,8 @@ Patch12: ship-label-plugin-in-initrd.patch Patch13: fix-coldplug-detection.patch Patch14: ensure-output-gets-terminal.patch Patch15: activate-new-renderers.patch +Patch16: fix-progress-bar-colors.patch +Patch17: fix-escape-key-for-media-check.patch Patch99: colors.patch %description @@ -231,7 +233,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 @@ -285,6 +287,8 @@ Plymouth. It features a small spinner on a dark background. %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 %patch99 -p1 -b .colors # Change the default theme @@ -549,8 +553,17 @@ fi %defattr(-, root, root) %changelog -* Thu Nov 19 2015 CentOS Sources - 0.8.9-0.24.20140113.el7.centos -- Roll in Branding Change in the SPEC +* Fri Jul 01 2016 Ray Strode - 0.8.9-0.26.20140113 +- Fix color of text progress bar + Related: #1167735 +- Fix escape key during media check of live image + Resolves: #1167735 + +* Wed May 25 2016 Ray Strode - 0.8.9-0.25.20140113 +- Read OS string from PRETTY_NAME instead of REDHAT_BUGZILLA_PRODUCT + again, this time munging it to get rid of parts we want to hide. + Related: #911553 + Resolves: #1306543 * Fri Oct 23 2015 Ray Strode 0.8.9-0.24.20140113 - Fix text plugins in the same way we fixed pixel plugins