sys-boot/plymouth: обновлены патчи для 0.9.5

mhiretskiy
parent 1aaac0d9a0
commit 3937e51421

@ -0,0 +1,188 @@
# Calculate format=diff merge(sys-boot/plymouth)<0.9.5
commit 4ec46d8b9a1fdd4eb791013bae98e4ca34b412de
Author: Mir Calculate <support@calculate.ru>
Date: Wed Feb 13 15:35:50 2019 +0300
Изменён порядок инициализации framebuffer для plymouth
Добавлена переменная конфигурационного файла
FBDeviceTimeout, по истечении которого plymouth будет ожидать не только DRM
устройства, но и framebuffer. По истечении DeviceTimeout plymouth будет
запущен для text mode.
diff --git a/src/libply-splash-core/ply-device-manager.c b/src/libply-splash-core/ply-device-manager.c
index 55248ac..4350324 100644
--- a/src/libply-splash-core/ply-device-manager.c
+++ b/src/libply-splash-core/ply-device-manager.c
@@ -39,12 +39,14 @@
#include "ply-hashtable.h"
#include "ply-list.h"
#include "ply-utils.h"
+#include <math.h>
#define SUBSYSTEM_DRM "drm"
#define SUBSYSTEM_FRAME_BUFFER "graphics"
#ifdef HAVE_UDEV
static void create_devices_from_udev (ply_device_manager_t *manager);
+static void create_fb_devices_from_udev (ply_device_manager_t *manager);
#endif
static bool create_devices_for_terminal_and_renderer_type (ply_device_manager_t *manager,
@@ -81,6 +83,7 @@ struct _ply_device_manager
uint32_t paused : 1;
uint32_t device_timeout_elapsed : 1;
+ uint32_t fb_device_timeout_elapsed : 1;
};
static void
@@ -361,7 +364,12 @@ on_udev_event (ply_device_manager_t *manager)
ply_trace ("ignoring since we're already using text splash for local console");
else
create_devices_for_udev_device (manager, device);
- } else {
+ } else if (manager->fb_device_timeout_elapsed && strcmp (subsystem, SUBSYSTEM_FRAME_BUFFER) == 0){
+ if (manager->local_console_managed && manager->local_console_is_text)
+ ply_trace ("ignoring since we're already using text splash for local console");
+ else
+ create_devices_for_udev_device (manager, device);
+ } else {
ply_trace ("ignoring since we only handle subsystem %s devices after timeout", subsystem);
}
} else if (strcmp (action, "remove") == 0) {
@@ -539,6 +547,9 @@ ply_device_manager_free (ply_device_manager_t *manager)
ply_event_loop_stop_watching_for_timeout (manager->loop,
(ply_event_loop_timeout_handler_t)
create_devices_from_udev, manager);
+ ply_event_loop_stop_watching_for_timeout (manager->loop,
+ (ply_event_loop_timeout_handler_t)
+ create_fb_devices_from_udev, manager);
if (manager->udev_monitor != NULL)
udev_monitor_unref (manager->udev_monitor);
@@ -838,6 +849,24 @@ create_devices_from_udev (ply_device_manager_t *manager)
ply_trace ("Creating non-graphical devices, since there's no suitable graphics hardware");
create_non_graphical_devices (manager);
}
+
+static void
+create_fb_devices_from_udev (ply_device_manager_t *manager)
+{
+ bool found_drm_device, found_fb_device;
+
+ manager->fb_device_timeout_elapsed = true;
+
+ if (manager->paused) {
+ ply_trace ("create_fb_devices_from_udev timeout elapsed while paused, deferring execution");
+ return;
+ }
+
+ ply_trace ("Timeout elapsed, looking for framebuffer devices from udev");
+
+ found_drm_device = create_devices_for_subsystem (manager, SUBSYSTEM_DRM);
+ found_fb_device = create_devices_for_subsystem (manager, SUBSYSTEM_FRAME_BUFFER);
+}
#endif
static void
@@ -851,6 +880,7 @@ create_fallback_devices (ply_device_manager_t *manager)
void
ply_device_manager_watch_devices (ply_device_manager_t *manager,
+ double fb_device_timeout,
double device_timeout,
ply_keyboard_added_handler_t keyboard_added_handler,
ply_keyboard_removed_handler_t keyboard_removed_handler,
@@ -870,6 +900,9 @@ ply_device_manager_watch_devices (ply_device_manager_t *manager,
manager->text_display_removed_handler = text_display_removed_handler;
manager->event_handler_data = data;
+ if (isnan (fb_device_timeout))
+ fb_device_timeout = 5;
+
/* Try to create devices for each serial device right away, if possible
*/
done_with_initial_devices_setup = create_devices_from_terminals (manager);
@@ -892,6 +925,10 @@ ply_device_manager_watch_devices (ply_device_manager_t *manager,
#ifdef HAVE_UDEV
watch_for_udev_events (manager);
create_devices_for_subsystem (manager, SUBSYSTEM_DRM);
+ ply_event_loop_watch_for_timeout (manager->loop,
+ fb_device_timeout,
+ (ply_event_loop_timeout_handler_t)
+ create_fb_devices_from_udev, manager);
ply_event_loop_watch_for_timeout (manager->loop,
device_timeout,
(ply_event_loop_timeout_handler_t)
@@ -1035,6 +1072,10 @@ ply_device_manager_unpause (ply_device_manager_t *manager)
ply_trace ("ply_device_manager_unpause() called, resuming watching for udev events");
manager->paused = false;
#ifdef HAVE_UDEV
+ if (manager->fb_device_timeout_elapsed) {
+ ply_trace ("ply_device_manager_unpause(): timeout elapsed while paused, looking for framebuffer udev devices");
+ create_fb_devices_from_udev (manager);
+ }
if (manager->device_timeout_elapsed) {
ply_trace ("ply_device_manager_unpause(): timeout elapsed while paused, looking for udev devices");
create_devices_from_udev (manager);
diff --git a/src/libply-splash-core/ply-device-manager.h b/src/libply-splash-core/ply-device-manager.h
index 389b636..37198a2 100644
--- a/src/libply-splash-core/ply-device-manager.h
+++ b/src/libply-splash-core/ply-device-manager.h
@@ -47,6 +47,7 @@ typedef void (* ply_text_display_removed_handler_t) (void *, ply_text_display_t
ply_device_manager_t *ply_device_manager_new (const char *default_tty,
ply_device_manager_flags_t flags);
void ply_device_manager_watch_devices (ply_device_manager_t *manager,
+ double fb_device_timeout,
double device_timeout,
ply_keyboard_added_handler_t keyboard_added_handler,
ply_keyboard_removed_handler_t keyboard_removed_handler,
diff --git a/src/main.c b/src/main.c
index ddc1883..f8f980c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -103,6 +103,7 @@ typedef struct
double start_time;
double splash_delay;
double device_timeout;
+ double fb_device_timeout;
uint32_t no_boot_log : 1;
uint32_t showing_details : 1;
@@ -340,6 +341,19 @@ load_settings (state_t *state,
}
}
+ if (isnan (state->fb_device_timeout)) {
+ char *timeout_string;
+
+ timeout_string = ply_key_file_get_value (key_file, "Daemon", "FBDeviceTimeout");
+
+ if (timeout_string != NULL) {
+ state->fb_device_timeout = atof (timeout_string);
+ ply_trace ("Framebuffer device timeout is set to %lf", state->fb_device_timeout);
+
+ free (timeout_string);
+ }
+ }
+
scale_string = ply_key_file_get_value (key_file, "Daemon", "DeviceScale");
if (scale_string != NULL) {
@@ -1100,6 +1114,7 @@ load_devices (state_t *state,
state->local_console_terminal = ply_device_manager_get_default_terminal (state->device_manager);
ply_device_manager_watch_devices (state->device_manager,
+ state->fb_device_timeout,
state->device_timeout,
(ply_keyboard_added_handler_t)
on_keyboard_added,
@@ -2269,6 +2284,7 @@ main (int argc,
state.progress = ply_progress_new ();
state.splash_delay = NAN;
state.device_timeout = NAN;
+ state.fb_device_timeout = NAN;
ply_progress_load_cache (state.progress,
get_cache_file_for_mode (state.mode));

@ -1,17 +1,6 @@
# Calculate format=diff # Calculate format=diff merge(sys-boot/plymouth)>=0.9.5
commit 4ec46d8b9a1fdd4eb791013bae98e4ca34b412de
Author: Mir Calculate <support@calculate.ru>
Date: Wed Feb 13 15:35:50 2019 +0300
Изменён порядок инициализации framebuffer для plymouth
Добавлена переменная конфигурационного файла
FBDeviceTimeout, по истечении которого plymouth будет ожидать не только DRM
устройства, но и framebuffer. По истечении DeviceTimeout plymouth будет
запущен для text mode.
diff --git a/src/libply-splash-core/ply-device-manager.c b/src/libply-splash-core/ply-device-manager.c diff --git a/src/libply-splash-core/ply-device-manager.c b/src/libply-splash-core/ply-device-manager.c
index 55248ac..4350324 100644 index f65d731..954a241 100644
--- a/src/libply-splash-core/ply-device-manager.c --- a/src/libply-splash-core/ply-device-manager.c
+++ b/src/libply-splash-core/ply-device-manager.c +++ b/src/libply-splash-core/ply-device-manager.c
@@ -39,12 +39,14 @@ @@ -39,12 +39,14 @@
@ -29,29 +18,29 @@ index 55248ac..4350324 100644
#endif #endif
static bool 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,
@@ -81,6 +83,7 @@ struct _ply_device_manager @@ -84,6 +86,7 @@ struct _ply_device_manager
uint32_t paused : 1; uint32_t paused : 1;
uint32_t device_timeout_elapsed : 1; uint32_t device_timeout_elapsed : 1;
+ uint32_t fb_device_timeout_elapsed : 1; + uint32_t fb_device_timeout_elapsed : 1;
uint32_t found_drm_device : 1;
uint32_t found_fb_device : 1;
}; };
@@ -442,7 +445,12 @@ on_udev_event (ply_device_manager_t *manager)
static void
@@ -361,7 +364,12 @@ on_udev_event (ply_device_manager_t *manager)
ply_trace ("ignoring since we're already using text splash for local console"); ply_trace ("ignoring since we're already using text splash for local console");
else else
create_devices_for_udev_device (manager, device); on_drm_udev_add_or_change (manager, action, device);
- } else { - } else {
+ } else if (manager->fb_device_timeout_elapsed && strcmp (subsystem, SUBSYSTEM_FRAME_BUFFER) == 0){ + } else if (manager->fb_device_timeout_elapsed && strcmp (subsystem, SUBSYSTEM_FRAME_BUFFER) == 0){
+ if (manager->local_console_managed && manager->local_console_is_text) + if (manager->local_console_managed && manager->local_console_is_text)
+ ply_trace ("ignoring since we're already using text splash for local console"); + ply_trace ("ignoring since we're already using text splash for local console");
+ else + else
+ create_devices_for_udev_device (manager, device); + on_drm_udev_add_or_change (manager, action, device);
+ } else { + } else {
ply_trace ("ignoring since we only handle subsystem %s devices after timeout", subsystem); ply_trace ("ignoring since we only handle subsystem %s devices after timeout", subsystem);
} }
} else if (strcmp (action, "remove") == 0) { } else if (strcmp (action, "remove") == 0) {
@@ -539,6 +547,9 @@ ply_device_manager_free (ply_device_manager_t *manager) @@ -620,6 +628,9 @@ ply_device_manager_free (ply_device_manager_t *manager)
ply_event_loop_stop_watching_for_timeout (manager->loop, ply_event_loop_stop_watching_for_timeout (manager->loop,
(ply_event_loop_timeout_handler_t) (ply_event_loop_timeout_handler_t)
create_devices_from_udev, manager); create_devices_from_udev, manager);
@ -61,7 +50,7 @@ index 55248ac..4350324 100644
if (manager->udev_monitor != NULL) if (manager->udev_monitor != NULL)
udev_monitor_unref (manager->udev_monitor); udev_monitor_unref (manager->udev_monitor);
@@ -838,6 +849,24 @@ create_devices_from_udev (ply_device_manager_t *manager) @@ -917,6 +928,22 @@ create_devices_from_udev (ply_device_manager_t *manager)
ply_trace ("Creating non-graphical devices, since there's no suitable graphics hardware"); ply_trace ("Creating non-graphical devices, since there's no suitable graphics hardware");
create_non_graphical_devices (manager); create_non_graphical_devices (manager);
} }
@ -69,8 +58,6 @@ index 55248ac..4350324 100644
+static void +static void
+create_fb_devices_from_udev (ply_device_manager_t *manager) +create_fb_devices_from_udev (ply_device_manager_t *manager)
+{ +{
+ bool found_drm_device, found_fb_device;
+
+ manager->fb_device_timeout_elapsed = true; + manager->fb_device_timeout_elapsed = true;
+ +
+ if (manager->paused) { + if (manager->paused) {
@ -80,31 +67,31 @@ index 55248ac..4350324 100644
+ +
+ ply_trace ("Timeout elapsed, looking for framebuffer devices from udev"); + ply_trace ("Timeout elapsed, looking for framebuffer devices from udev");
+ +
+ found_drm_device = create_devices_for_subsystem (manager, SUBSYSTEM_DRM); + create_devices_for_subsystem (manager, SUBSYSTEM_DRM);
+ found_fb_device = create_devices_for_subsystem (manager, SUBSYSTEM_FRAME_BUFFER); + create_devices_for_subsystem (manager, SUBSYSTEM_FRAME_BUFFER);
+} +}
#endif #endif
static void static void
@@ -851,6 +880,7 @@ create_fallback_devices (ply_device_manager_t *manager) @@ -930,6 +957,7 @@ create_fallback_devices (ply_device_manager_t *manager)
void void
ply_device_manager_watch_devices (ply_device_manager_t *manager, ply_device_manager_watch_devices (ply_device_manager_t *manager,
+ double fb_device_timeout, + double fb_device_timeout,
double device_timeout, double device_timeout,
ply_keyboard_added_handler_t keyboard_added_handler, ply_keyboard_added_handler_t keyboard_added_handler,
ply_keyboard_removed_handler_t keyboard_removed_handler, ply_keyboard_removed_handler_t keyboard_removed_handler,
@@ -870,6 +900,9 @@ ply_device_manager_watch_devices (ply_device_manager_t *manager, @@ -949,6 +977,9 @@ ply_device_manager_watch_devices (ply_device_manager_t *manager,
manager->text_display_removed_handler = text_display_removed_handler; manager->text_display_removed_handler = text_display_removed_handler;
manager->event_handler_data = data; manager->event_handler_data = data;
+ if (isnan (fb_device_timeout)) + if (isnan (fb_device_timeout))
+ fb_device_timeout = 5; + fb_device_timeout = 5;
+ +
/* Try to create devices for each serial device right away, if possible /* Try to create devices for each serial device right away, if possible
*/ */
done_with_initial_devices_setup = create_devices_from_terminals (manager); done_with_initial_devices_setup = create_devices_from_terminals (manager);
@@ -892,6 +925,10 @@ ply_device_manager_watch_devices (ply_device_manager_t *manager, @@ -971,6 +1002,10 @@ ply_device_manager_watch_devices (ply_device_manager_t *manager,
#ifdef HAVE_UDEV #ifdef HAVE_UDEV
watch_for_udev_events (manager); watch_for_udev_events (manager);
create_devices_for_subsystem (manager, SUBSYSTEM_DRM); create_devices_for_subsystem (manager, SUBSYSTEM_DRM);
@ -115,12 +102,12 @@ index 55248ac..4350324 100644
ply_event_loop_watch_for_timeout (manager->loop, ply_event_loop_watch_for_timeout (manager->loop,
device_timeout, device_timeout,
(ply_event_loop_timeout_handler_t) (ply_event_loop_timeout_handler_t)
@@ -1035,6 +1072,10 @@ ply_device_manager_unpause (ply_device_manager_t *manager) @@ -1114,6 +1149,10 @@ ply_device_manager_unpause (ply_device_manager_t *manager)
ply_trace ("ply_device_manager_unpause() called, resuming watching for udev events"); ply_trace ("ply_device_manager_unpause() called, resuming watching for udev events");
manager->paused = false; manager->paused = false;
#ifdef HAVE_UDEV #ifdef HAVE_UDEV
+ if (manager->fb_device_timeout_elapsed) { + if (manager->fb_device_timeout_elapsed) {
+ ply_trace ("ply_device_manager_unpause(): timeout elapsed while paused, looking for framebuffer udev devices"); + ply_trace ("ply_device_manager_unpause(): timeout elapsed while paused, looking for udev devices");
+ create_fb_devices_from_udev (manager); + create_fb_devices_from_udev (manager);
+ } + }
if (manager->device_timeout_elapsed) { if (manager->device_timeout_elapsed) {
@ -139,10 +126,10 @@ index 389b636..37198a2 100644
ply_keyboard_added_handler_t keyboard_added_handler, ply_keyboard_added_handler_t keyboard_added_handler,
ply_keyboard_removed_handler_t keyboard_removed_handler, ply_keyboard_removed_handler_t keyboard_removed_handler,
diff --git a/src/main.c b/src/main.c diff --git a/src/main.c b/src/main.c
index ddc1883..f8f980c 100644 index 850c3b0..13c9272 100644
--- a/src/main.c --- a/src/main.c
+++ b/src/main.c +++ b/src/main.c
@@ -103,6 +103,7 @@ typedef struct @@ -97,6 +97,7 @@ typedef struct
double start_time; double start_time;
double splash_delay; double splash_delay;
double device_timeout; double device_timeout;
@ -150,7 +137,7 @@ index ddc1883..f8f980c 100644
uint32_t no_boot_log : 1; uint32_t no_boot_log : 1;
uint32_t showing_details : 1; uint32_t showing_details : 1;
@@ -340,6 +341,19 @@ load_settings (state_t *state, @@ -317,6 +318,19 @@ load_settings (state_t *state,
} }
} }
@ -170,7 +157,7 @@ index ddc1883..f8f980c 100644
scale_string = ply_key_file_get_value (key_file, "Daemon", "DeviceScale"); scale_string = ply_key_file_get_value (key_file, "Daemon", "DeviceScale");
if (scale_string != NULL) { if (scale_string != NULL) {
@@ -1100,6 +1114,7 @@ load_devices (state_t *state, @@ -1096,6 +1110,7 @@ load_devices (state_t *state,
state->local_console_terminal = ply_device_manager_get_default_terminal (state->device_manager); state->local_console_terminal = ply_device_manager_get_default_terminal (state->device_manager);
ply_device_manager_watch_devices (state->device_manager, ply_device_manager_watch_devices (state->device_manager,
@ -178,7 +165,7 @@ index ddc1883..f8f980c 100644
state->device_timeout, state->device_timeout,
(ply_keyboard_added_handler_t) (ply_keyboard_added_handler_t)
on_keyboard_added, on_keyboard_added,
@@ -2269,6 +2284,7 @@ main (int argc, @@ -2244,6 +2259,7 @@ main (int argc,
state.progress = ply_progress_new (); state.progress = ply_progress_new ();
state.splash_delay = NAN; state.splash_delay = NAN;
state.device_timeout = NAN; state.device_timeout = NAN;

@ -0,0 +1,23 @@
# Calculate format=diff merge(sys-boot/plymouth)<0.9.5
commit c0e512de2352611112c5476e0032514e2b2d713c
Author: Mir Calculate <support@calculate.ru>
Date: Tue Feb 19 12:17:41 2019 +0300
Добавлена возможность указать запуск splash только для shutdown
diff --git a/src/main.c b/src/main.c
index f8f980c..c702c10 100644
--- a/src/main.c
+++ b/src/main.c
@@ -916,6 +916,11 @@ plymouth_should_show_default_splash (state_t *state)
return true;
}
+ if (ply_kernel_command_line_has_argument ("splash=shutdown") && state->mode == PLY_MODE_SHUTDOWN) {
+ ply_trace ("using default splash because kernel command line has option \"splash=shutdown\"");
+ return true;
+ }
+
if (ply_kernel_command_line_has_argument ("splash=silent")) {
ply_trace ("using default splash because kernel command line has option \"splash=silent\"");
return true;

@ -1,4 +1,4 @@
# Calculate format=diff # Calculate format=diff pkg(sys-boot/plymouth)>=0.9.5
commit c0e512de2352611112c5476e0032514e2b2d713c commit c0e512de2352611112c5476e0032514e2b2d713c
Author: Mir Calculate <support@calculate.ru> Author: Mir Calculate <support@calculate.ru>
Date: Tue Feb 19 12:17:41 2019 +0300 Date: Tue Feb 19 12:17:41 2019 +0300
@ -13,7 +13,7 @@ index f8f980c..c702c10 100644
return true; return true;
} }
+ if (ply_kernel_command_line_has_argument ("splash=shutdown") && state->mode == PLY_MODE_SHUTDOWN) { + if (ply_kernel_command_line_has_argument ("splash=shutdown") && state->mode == PLY_BOOT_SPLASH_MODE_SHUTDOWN) {
+ ply_trace ("using default splash because kernel command line has option \"splash=shutdown\""); + ply_trace ("using default splash because kernel command line has option \"splash=shutdown\"");
+ return true; + return true;
+ } + }

Loading…
Cancel
Save