Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:42.3:Rings:1-MinimalX
plymouth
plymouth-use-device-timeout-instead-of-udev-col...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File plymouth-use-device-timeout-instead-of-udev-coldplug.patch of Package plymouth
diff -Nura plymouth-0.9.2_old/src/libply-splash-core/ply-device-manager.c plymouth-0.9.2/src/libply-splash-core/ply-device-manager.c --- plymouth-0.9.2_old/src/libply-splash-core/ply-device-manager.c 2017-05-11 12:24:23.366679696 +0800 +++ plymouth-0.9.2/src/libply-splash-core/ply-device-manager.c 2017-05-11 12:24:47.443734836 +0800 @@ -41,6 +41,7 @@ #define SUBSYSTEM_DRM "drm" #define SUBSYSTEM_FRAME_BUFFER "graphics" +static void create_seats_from_udev (ply_device_manager_t *manager); static void create_seat_for_terminal_and_renderer_type (ply_device_manager_t *manager, const char *device_path, ply_terminal_t *terminal, @@ -54,15 +55,15 @@ ply_seat_t *local_console_seat; ply_list_t *seats; 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_seat_added_handler_t seat_added_handler; ply_seat_removed_handler_t seat_removed_handler; void *seat_event_handler_data; bool has_serial_consoles; + + uint32_t local_console_managed : 1; + uint32_t local_console_is_text : 1; }; static void @@ -377,15 +378,17 @@ if (strcmp (action, "add") == 0) { const char *subsystem; - bool coldplug_complete = manager->udev_queue_fd_watch == NULL; subsystem = udev_device_get_subsystem (device); - if (strcmp (subsystem, SUBSYSTEM_DRM) == 0 || - coldplug_complete) - create_seat_for_udev_device (manager, device); - else - ply_trace ("ignoring since we only handle subsystem %s devices after coldplug completes", subsystem); + if (strcmp (subsystem, SUBSYSTEM_DRM) == 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_seat_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) { free_seat_for_udev_device (manager, device); } @@ -530,10 +533,15 @@ if (manager == NULL) return; + ply_event_loop_stop_watching_for_timeout (manager->loop, + (ply_event_loop_timeout_handler_t) + create_seats_from_udev, manager); + ply_event_loop_stop_watching_for_exit (manager->loop, (ply_event_loop_exit_handler_t) detach_from_event_loop, manager); + free_seats (manager); ply_list_free (manager->seats); @@ -696,7 +704,7 @@ { bool found_drm_device, found_fb_device; - ply_trace ("Looking for devices from udev"); + ply_trace ("Timeout elapsed, looking for devices from udev"); found_drm_device = create_seats_for_subsystem (manager, SUBSYSTEM_DRM); found_fb_device = create_seats_for_subsystem (manager, SUBSYSTEM_FRAME_BUFFER); @@ -720,63 +728,9 @@ PLY_RENDERER_TYPE_AUTO); } -static void -on_udev_queue_changed (ply_device_manager_t *manager) -{ - if (!udev_queue_get_queue_is_empty (manager->udev_queue)) - return; - - ply_trace ("udev coldplug complete"); - ply_event_loop_stop_watching_fd (manager->loop, manager->udev_queue_fd_watch); - manager->udev_queue_fd_watch = NULL; - udev_queue_unref (manager->udev_queue); - - close (manager->udev_queue_fd); - manager->udev_queue_fd = -1; - - manager->udev_queue = NULL; - - create_seats_from_udev (manager); -} - -static void -watch_for_coldplug_completion (ply_device_manager_t *manager) -{ - int fd; - int result; - - manager->udev_queue = udev_queue_new (manager->udev_context); - - if (udev_queue_get_queue_is_empty (manager->udev_queue)) { - ply_trace ("udev coldplug completed already "); - create_seats_from_udev (manager); - return; - } - - fd = inotify_init1 (IN_CLOEXEC); - result = inotify_add_watch (fd, "/run/udev", IN_MOVED_TO| IN_DELETE); - - if (result < 0) { - ply_trace ("could not watch for udev to show up: %m"); - close (fd); - - create_fallback_seat (manager); - return; - } - - manager->udev_queue_fd = fd; - - manager->udev_queue_fd_watch = ply_event_loop_watch_fd (manager->loop, - fd, - PLY_EVENT_LOOP_FD_STATUS_HAS_DATA, - (ply_event_handler_t) - on_udev_queue_changed, - NULL, - manager); -} - void ply_device_manager_watch_seats (ply_device_manager_t *manager, + double device_timeout, ply_seat_added_handler_t seat_added_handler, ply_seat_removed_handler_t seat_removed_handler, void *data) @@ -801,7 +755,11 @@ } watch_for_udev_events (manager); - watch_for_coldplug_completion (manager); + create_seats_for_subsystem (manager, SUBSYSTEM_DRM); + ply_event_loop_watch_for_timeout (manager->loop, + device_timeout, + (ply_event_loop_timeout_handler_t) + create_seats_from_udev, manager); } bool diff -Nura plymouth-0.9.2_old/src/libply-splash-core/ply-device-manager.h plymouth-0.9.2/src/libply-splash-core/ply-device-manager.h --- plymouth-0.9.2_old/src/libply-splash-core/ply-device-manager.h 2017-05-11 12:24:23.366679696 +0800 +++ plymouth-0.9.2/src/libply-splash-core/ply-device-manager.h 2017-05-11 12:24:47.443734836 +0800 @@ -40,6 +40,7 @@ ply_device_manager_t *ply_device_manager_new (const char *default_tty, ply_device_manager_flags_t flags); void ply_device_manager_watch_seats (ply_device_manager_t *manager, + double device_timeout, ply_seat_added_handler_t seat_added_handler, ply_seat_removed_handler_t seat_removed_handler, void *data); diff -Nura plymouth-0.9.2_old/src/main.c plymouth-0.9.2/src/main.c --- plymouth-0.9.2_old/src/main.c 2017-05-11 12:24:23.371679707 +0800 +++ plymouth-0.9.2/src/main.c 2017-05-11 12:24:47.444734838 +0800 @@ -107,6 +107,7 @@ double start_time; double splash_delay; + double device_timeout; char kernel_command_line[PLY_MAX_COMMAND_LINE_SIZE]; uint32_t kernel_command_line_is_set : 1; @@ -293,7 +294,6 @@ char **theme_path) { ply_key_file_t *key_file = NULL; - const char *delay_string; bool settings_loaded = false; const char *splash_string; @@ -313,6 +313,8 @@ splash_string, splash_string); if (isnan (state->splash_delay)) { + const char *delay_string; + delay_string = ply_key_file_get_value (key_file, "Daemon", "ShowDelay"); if (delay_string != NULL) { @@ -321,6 +323,18 @@ } } + if (isnan (state->device_timeout)) { + const char *timeout_string; + + timeout_string = ply_key_file_get_value (key_file, "Daemon", "DeviceTimeout"); + + if (timeout_string != NULL) { + state->device_timeout = atof (timeout_string); + ply_trace ("Device timeout is set to %lf", state->device_timeout); + } + } + + settings_loaded = true; out: ply_key_file_free (key_file); @@ -1037,6 +1051,7 @@ manager = state->device_manager; ply_device_manager_watch_seats (state->device_manager, + state->device_timeout, (ply_seat_added_handler_t) on_seat_added, (ply_seat_removed_handler_t) @@ -1930,7 +1945,7 @@ check_verbosity (state); check_logging (state); - ply_trace ("source built on %s", __DATE__); + ply_trace ("source built on %s", "2017-01-19 09:38:14.000000000 +0000"); state->keystroke_triggers = ply_list_new (); state->entry_triggers = ply_list_new (); @@ -2198,6 +2213,7 @@ state.progress = ply_progress_new (); state.splash_delay = NAN; + state.device_timeout = NAN; ply_progress_load_cache (state.progress, get_cache_file_for_mode (state.mode)); diff -Nura plymouth-0.9.2_old/src/plymouthd.defaults plymouth-0.9.2/src/plymouthd.defaults --- plymouth-0.9.2_old/src/plymouthd.defaults 2015-02-27 02:32:41.000000000 +0800 +++ plymouth-0.9.2/src/plymouthd.defaults 2017-05-11 12:25:44.958866554 +0800 @@ -3,3 +3,4 @@ [Daemon] Theme=spinner ShowDelay=5 +DeviceTimeout=5
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor