From b1da00fc335a2c9d8600a064771c68899001371a Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Mar 05 2015 13:31:08 +0000 Subject: import plymouth-0.8.9-0.13.20140113.el7 --- diff --git a/SOURCES/fix-init-bin-sh.patch b/SOURCES/fix-init-bin-sh.patch new file mode 100644 index 0000000..0b31cab --- /dev/null +++ b/SOURCES/fix-init-bin-sh.patch @@ -0,0 +1,231 @@ +From be52bd06949cb2a386fda147d24155581708ef1a Mon Sep 17 00:00:00 2001 +From: Ray Strode +Date: Fri, 10 Oct 2014 13:30:56 -0400 +Subject: [PATCH] main: show splash when init=/bin/sh + +but quit after switch root. The keeps luks +working. +--- + src/main.c | 23 ++++++++++++++++++++--- + 1 file changed, 20 insertions(+), 3 deletions(-) + +diff --git a/src/main.c b/src/main.c +index fb91bf2..4101550 100644 +--- a/src/main.c ++++ b/src/main.c +@@ -135,60 +135,64 @@ static ply_boot_splash_t *load_theme (state_t *state, + static ply_boot_splash_t *show_theme (state_t *state, + const char *theme_path); + + static void attach_splash_to_seats (state_t *state, + ply_boot_splash_t *splash); + static bool attach_to_running_session (state_t *state); + static void detach_from_running_session (state_t *state); + static void on_escape_pressed (state_t *state); + static void dump_details_and_quit_splash (state_t *state); + static void update_display (state_t *state); + + static void on_error_message (ply_buffer_t *debug_buffer, + const void *bytes, + size_t number_of_bytes); + static ply_buffer_t *debug_buffer; + static char *debug_buffer_path = NULL; + static char *pid_file = NULL; + static void toggle_between_splash_and_details (state_t *state); + #ifdef PLY_ENABLE_SYSTEMD_INTEGRATION + static void tell_systemd_to_print_details (state_t *state); + static void tell_systemd_to_stop_printing_details (state_t *state); + #endif + static const char * get_cache_file_for_mode (ply_mode_t mode); + static void on_escape_pressed (state_t *state); + static void on_enter (state_t *state, + const char *line); + static void on_keyboard_input (state_t *state, + const char *keyboard_input, + size_t character_size); + static void on_backspace (state_t *state); ++static void on_quit (state_t *state, ++ bool retain_splash, ++ ply_trigger_t *quit_trigger); ++static bool sh_is_init (state_t *state); + + static void + on_session_output (state_t *state, + const char *output, + size_t size) + { + ply_buffer_append_bytes (state->boot_buffer, output, size); + if (state->boot_splash != NULL) + ply_boot_splash_update_output (state->boot_splash, + output, size); + } + + static void + on_session_hangup (state_t *state) + { + ply_trace ("got hang up on terminal session fd"); + } + + static void + on_update (state_t *state, + const char *status) + { + ply_trace ("updating status to '%s'", status); + ply_progress_status_update (state->progress, + status); + if (state->boot_splash != NULL) + ply_boot_splash_update_status (state->boot_splash, + status); + } + +@@ -626,60 +630,67 @@ on_ignore_keystroke (state_t *state, + { + ply_keystroke_watch_t* keystroke_trigger = ply_list_node_get_data (node); + if ((!keystroke_trigger->keys && !keys) || + (keystroke_trigger->keys && keys && strcmp(keystroke_trigger->keys, keys)==0)) + { + ply_trigger_pull (keystroke_trigger->trigger, NULL); + ply_list_remove_node (state->keystroke_triggers, node); + return; + } + } + } + + static void + on_progress_pause (state_t *state) + { + ply_trace ("pausing progress"); + ply_progress_pause (state->progress); + } + + static void + on_progress_unpause (state_t *state) + { + ply_trace ("unpausing progress"); + ply_progress_unpause (state->progress); + } + + static void + on_newroot (state_t *state, + const char *root_dir) + { ++ if (sh_is_init (state)) ++ { ++ ply_trace ("new root mounted at \"%s\", exiting since init= a shell", root_dir); ++ on_quit (state, false, ply_trigger_new (NULL)); ++ return; ++ } ++ + ply_trace ("new root mounted at \"%s\", switching to it", root_dir); + chdir(root_dir); + chroot("."); + chdir("/"); + ply_progress_load_cache (state->progress, get_cache_file_for_mode (state->mode)); + if (state->boot_splash != NULL) + ply_boot_splash_root_mounted (state->boot_splash); + } + + static const char * + get_cache_file_for_mode (ply_mode_t mode) + { + const char *filename; + + switch ((int)mode) + { + case PLY_MODE_BOOT: + filename = BOOT_DURATION_FILE; + break; + case PLY_MODE_SHUTDOWN: + filename = SHUTDOWN_DURATION_FILE; + break; + case PLY_MODE_UPDATES: + filename = NULL; + break; + default: + ply_error ("Unhandled case in %s line %d\n", __FILE__, __LINE__); + abort (); + break; + } +@@ -781,70 +792,76 @@ prepare_logging (state_t *state) + if (state->number_of_errors > 0) + spool_error (state); + } + } + + static void + on_system_initialized (state_t *state) + { + ply_trace ("system now initialized, opening log"); + state->system_initialized = true; + + prepare_logging (state); + } + + static void + on_error (state_t *state) + { + ply_trace ("encountered error during boot up"); + + if (state->system_initialized && state->number_of_errors == 0) + spool_error (state); + else + ply_trace ("not spooling because number of errors %d", state->number_of_errors); + + state->number_of_errors++; + } + + static bool + plymouth_should_ignore_show_splash_calls (state_t *state) + { +- const char *init_string; +- size_t length; +- + ply_trace ("checking if plymouth should be running"); + if (state->mode != PLY_MODE_BOOT || command_line_has_argument (state->kernel_command_line, "plymouth.force-splash")) + return false; + + if (command_line_has_argument (state->kernel_command_line, "plymouth.ignore-show-splash")) + return true; + ++ return false; ++} ++ ++static bool ++sh_is_init (state_t *state) ++{ ++ const char *init_string; ++ size_t length; ++ + init_string = command_line_get_string_after_prefix (state->kernel_command_line, "init="); + + if (init_string) + { + length = strcspn (init_string, " \n"); + if (length > 2 && ply_string_has_prefix (init_string + length - 2, "sh")) + return true; + } + + return false; + } + + static bool + plymouth_should_show_default_splash (state_t *state) + { + ply_trace ("checking if plymouth should show default splash"); + + const char const *strings[] = { + "single", "1", "s", "S", "-S", NULL + }; + int i; + + if (state->should_force_details) + return false; + + for (i = 0; strings[i] != NULL; i++) + { + if (command_line_has_argument (state->kernel_command_line, strings[i])) + { + ply_trace ("no default splash because kernel command line has option \"%s\"", strings[i]); +-- +1.8.3.1 + diff --git a/SOURCES/resize-proc-cmdline-buffer.patch b/SOURCES/resize-proc-cmdline-buffer.patch new file mode 100644 index 0000000..2301b2d --- /dev/null +++ b/SOURCES/resize-proc-cmdline-buffer.patch @@ -0,0 +1,153 @@ +From 6e15c8b20b2ff852fcc638948eb88ea5dfa4a916 Mon Sep 17 00:00:00 2001 +From: Ray Strode +Date: Fri, 10 Oct 2014 16:11:01 -0400 +Subject: [PATCH] main: fix incorrectly sized buffer for /proc/cmdline + +We assume /proc/cmdline will be no more than 512 bytes (including NUL). +It can actually be 4096 bytes (excluding NUL). + +This commit makes sure we allocate enough space for it and its NUL. +--- + src/main.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/src/main.c b/src/main.c +index 4101550..d5f4f4d 100644 +--- a/src/main.c ++++ b/src/main.c +@@ -30,61 +30,61 @@ + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + + #include + #include + + #include "ply-buffer.h" + #include "ply-command-parser.h" + #include "ply-boot-server.h" + #include "ply-boot-splash.h" + #include "ply-device-manager.h" + #include "ply-event-loop.h" + #include "ply-hashtable.h" + #include "ply-list.h" + #include "ply-logger.h" + #include "ply-renderer.h" + #include "ply-terminal-session.h" + #include "ply-trigger.h" + #include "ply-utils.h" + #include "ply-progress.h" + + #ifndef PLY_MAX_COMMAND_LINE_SIZE +-#define PLY_MAX_COMMAND_LINE_SIZE 512 ++#define PLY_MAX_COMMAND_LINE_SIZE 4097 + #endif + + #define BOOT_DURATION_FILE PLYMOUTH_TIME_DIRECTORY "/boot-duration" + #define SHUTDOWN_DURATION_FILE PLYMOUTH_TIME_DIRECTORY "/shutdown-duration" + + typedef enum { + PLY_MODE_BOOT, + PLY_MODE_SHUTDOWN, + PLY_MODE_UPDATES + } ply_mode_t; + + typedef struct + { + const char *keys; + ply_trigger_t *trigger; + } ply_keystroke_watch_t; + + typedef struct + { + enum {PLY_ENTRY_TRIGGER_TYPE_PASSWORD, + PLY_ENTRY_TRIGGER_TYPE_QUESTION} + type; + const char *prompt; + ply_trigger_t *trigger; + } ply_entry_trigger_t; + + typedef struct + { + ply_event_loop_t *loop; + ply_boot_server_t *boot_server; +@@ -1782,68 +1782,67 @@ detach_from_running_session (state_t *state) + + if (!state->is_attached) + return; + + ply_trace ("detaching from terminal session"); + ply_terminal_session_detach (state->session); + state->is_redirected = false; + state->is_attached = false; + } + + static bool + get_kernel_command_line (state_t *state) + { + int fd; + const char *remaining_command_line; + char *key; + + if (state->kernel_command_line_is_set) + return true; + + ply_trace ("opening /proc/cmdline"); + fd = open ("/proc/cmdline", O_RDONLY); + + if (fd < 0) + { + ply_trace ("couldn't open it: %m"); + return false; + } + + ply_trace ("reading kernel command line"); +- if (read (fd, state->kernel_command_line, sizeof (state->kernel_command_line)) < 0) ++ if (read (fd, state->kernel_command_line, sizeof (state->kernel_command_line) - 1) < 0) + { + ply_trace ("couldn't read it: %m"); + close (fd); + return false; + } + +- + /* we now use plymouth.argument for kernel commandline arguments. + * It used to be plymouth:argument. This bit just rewrites all : to be . + */ + remaining_command_line = state->kernel_command_line; + while ((key = strstr (remaining_command_line, "plymouth:")) != NULL) + { + char *colon; + + colon = key + strlen ("plymouth"); + *colon = '.'; + + remaining_command_line = colon + 1; + } + ply_trace ("Kernel command line is: '%s'", state->kernel_command_line); + + close (fd); + + state->kernel_command_line_is_set = true; + return true; + } + + static void + check_verbosity (state_t *state) + { + const char *stream; + const char *path; + + ply_trace ("checking if tracing should be enabled"); + + stream = command_line_get_string_after_prefix (state->kernel_command_line, +-- +1.8.3.1 + diff --git a/SPECS/plymouth.spec b/SPECS/plymouth.spec index cf7625f..89ed679 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.10.20140113%{?dist} +Release: 0.13.20140113%{?dist} License: GPLv2+ Group: System Environment/Base Source0: http://freedesktop.org/software/plymouth/releases/%{name}-%{version}.tar.bz2 @@ -18,6 +18,7 @@ Source3: plymouth-update-initrd URL: http://www.freedesktop.org/wiki/Software/Plymouth BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +Requires: plymouth-core-libs = %{version}-%{release} Requires: system-logos Requires(post): plymouth-scripts Requires: initscripts >= 8.83-1 @@ -45,6 +46,8 @@ Patch5: fix-hide-splash.patch Patch6: ignore-early-fb-devices.patch Patch7: fix-ask-password-race.patch Patch8: serial-console-fixes.patch +Patch9: fix-init-bin-sh.patch +Patch10: resize-proc-cmdline-buffer.patch Patch99: colors.patch %description @@ -90,6 +93,8 @@ used by graphical Plymouth splashes. Summary: Libraries and headers for writing Plymouth splash plugins Group: Development/Libraries Requires: %{name} = %{version}-%{release} +Requires: %{name}-core-libs = %{version}-%{release} +Requires: %{name}-graphics-libs = %{version}-%{release} Requires: pkgconfig BuildRequires: pkgconfig(gtk+-2.0) @@ -110,7 +115,8 @@ the system. Summary: Plymouth label plugin Group: System Environment/Base Requires: %{name} = %{version}-%{release} -Requires: %{name}-libs = %{version}-%{release} +Requires: %{name}-core-libs = %{version}-%{release} +Requires: %{name}-graphics-libs = %{version}-%{release} BuildRequires: pango-devel >= 1.21.0 BuildRequires: cairo-devel @@ -123,7 +129,8 @@ graphical boot splashes using pango and cairo. Summary: Plymouth "Fade-Throbber" plugin Group: System Environment/Base Requires: %{name} = %{version}-%{release} -Requires: %{name}-libs = %{version}-%{release} +Requires: %{name}-core-libs = %{version}-%{release} +Requires: %{name}-graphics-libs = %{version}-%{release} %description plugin-fade-throbber This package contains the "Fade-In" boot splash plugin for @@ -147,7 +154,8 @@ while stars twinkle around the logo during system boot up. Summary: Plymouth "Throbgress" plugin Group: System Environment/Base Requires: %{name} = %{version}-%{release} -Requires: %{name}-libs = %{version}-%{release} +Requires: %{name}-core-libs = %{version}-%{release} +Requires: %{name}-graphics-libs = %{version}-%{release} Requires: plymouth-plugin-label %description plugin-throbgress @@ -173,7 +181,8 @@ spins in the shape of an infinity sign. Summary: Plymouth "space-flares" plugin Group: System Environment/Base Requires: %{name} = %{version}-%{release} -Requires: %{name}-libs = %{version}-%{release} +Requires: %{name}-core-libs = %{version}-%{release} +Requires: %{name}-graphics-libs = %{version}-%{release} Requires: plymouth-plugin-label %description plugin-space-flares @@ -198,7 +207,8 @@ Plymouth. It features a blue flamed sun with animated solar flares. Summary: Plymouth "two-step" plugin Group: System Environment/Base Requires: %{name} = %{version}-%{release} -Requires: %{name}-libs = %{version}-%{release} +Requires: %{name}-core-libs = %{version}-%{release} +Requires: %{name}-graphics-libs = %{version}-%{release} Requires: plymouth-plugin-label %description plugin-two-step @@ -216,13 +226,14 @@ 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 Group: System Environment/Base Requires: %{name} = %{version}-%{release} -Requires: %{name}-libs = %{version}-%{release} +Requires: %{name}-core-libs = %{version}-%{release} +Requires: %{name}-graphics-libs = %{version}-%{release} %description plugin-script This package contains the "script" boot splash plugin for @@ -262,6 +273,8 @@ Plymouth. It features a small spinner on a dark background. %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 %patch99 -p1 -b .colors # Change the default theme @@ -526,8 +539,17 @@ fi %defattr(-, root, root) %changelog -* Fri Jun 27 2014 Johnny Hughes 0.8.9-0.10.20140113.el7.centos -- Roll in Branding Change in the SPEC +* Fri Oct 10 2014 Ray Strode 0.8.9-0.13.20140113 +- Resize /proc/cmdline buffer to quash coverity message + Related: #1085094 + +* Fri Oct 10 2014 Ray Strode 0.8.9-0.12.20140113 +- Fix init=/bin/sh with encrypted root fs + Resolves: #1098332 + +* Wed Oct 08 2014 Ray Strode 0.8.9-0.11.20140113 +- Add requires to appease rpmdiff + Resolves: #1085094 * Thu Mar 06 2014 Ray Strode 0.8.9-0.10.20140113 - more serial console fixes