Accepting request 452722 from home:favogt:ply-hell
- Remove patch which causes breakage with systemd-vconsole-setup (bsc#1020327): * 0001-let-it-become-a-real-daemon.patch - Add upstream patch to fix crash on boot: * 0001-device-manager-handle-NULL-renderer-better.patch - Replace removal of framebuffer driver and plymouth-ignore-cirrusdrm.patch with single patch: * only_use_fb_for_cirrus_bochs.patch OBS-URL: https://build.opensuse.org/request/show/452722 OBS-URL: https://build.opensuse.org/package/show/Base:System/plymouth?expand=0&rev=177
This commit is contained in:
parent
c6966c589b
commit
3695444e7c
47
0001-device-manager-handle-NULL-renderer-better.patch
Normal file
47
0001-device-manager-handle-NULL-renderer-better.patch
Normal file
@ -0,0 +1,47 @@
|
||||
From fdda9af2c305ecf57407856b1d061c076ae8fe4a Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Wed, 18 Jan 2017 10:07:00 -0500
|
||||
Subject: [PATCH] device-manager: handle NULL renderer better
|
||||
|
||||
Right now we'll pass a NULL device name and crash if the renderer
|
||||
fails to open.
|
||||
|
||||
This commit fixes that.
|
||||
---
|
||||
src/libply-splash-core/ply-device-manager.c | 18 ++++++++++--------
|
||||
1 file changed, 10 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/src/libply-splash-core/ply-device-manager.c b/src/libply-splash-core/ply-device-manager.c
|
||||
index 4004e11..b4c33d4 100644
|
||||
--- a/src/libply-splash-core/ply-device-manager.c
|
||||
+++ b/src/libply-splash-core/ply-device-manager.c
|
||||
@@ -689,16 +689,18 @@ create_devices_for_terminal_and_renderer_type (ply_device_manager_t *manager,
|
||||
return;
|
||||
}
|
||||
|
||||
- old_renderer = ply_hashtable_lookup (manager->renderers,
|
||||
- (void *) ply_renderer_get_device_name (renderer));
|
||||
+ if (renderer != NULL) {
|
||||
+ old_renderer = ply_hashtable_lookup (manager->renderers,
|
||||
+ (void *) ply_renderer_get_device_name (renderer));
|
||||
|
||||
- if (old_renderer != NULL) {
|
||||
- ply_trace ("ignoring device %s since it's alerady managed",
|
||||
- ply_renderer_get_device_name (renderer));
|
||||
- ply_renderer_free (renderer);
|
||||
+ if (old_renderer != NULL) {
|
||||
+ ply_trace ("ignoring device %s since it's alerady managed",
|
||||
+ ply_renderer_get_device_name (renderer));
|
||||
+ ply_renderer_free (renderer);
|
||||
|
||||
- renderer = NULL;
|
||||
- return;
|
||||
+ renderer = NULL;
|
||||
+ return;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.11.0
|
||||
|
@ -1,191 +0,0 @@
|
||||
Related to bnc#892526 -- let plymouthd become a real daemon that
|
||||
is it should use its own session with the help of the system call
|
||||
setsid(2). Also avoid an EBUSY on ioctl TIOCCONS if a former
|
||||
plymouthd had failed. And a crash or termination may restore not
|
||||
only the current virtual console but also any serial console as
|
||||
well restore the system console.
|
||||
|
||||
---
|
||||
plymouth-0.9.0/src/libply-splash-core/ply-device-manager.c | 9 ++
|
||||
plymouth-0.9.0/src/libply-splash-core/ply-device-manager.h | 1
|
||||
plymouth-0.9.0/src/libply/ply-terminal-session.c | 7 ++
|
||||
plymouth-0.9.0/src/libply/ply-utils.c | 2
|
||||
plymouth-0.9.0/src/main.c | 42 +++++++------
|
||||
5 files changed, 43 insertions(+), 18 deletions(-)
|
||||
|
||||
Index: plymouth-0.9.2+git20160823.e4b7e49/src/libply-splash-core/ply-device-manager.c
|
||||
===================================================================
|
||||
--- plymouth-0.9.2+git20160823.e4b7e49.orig/src/libply-splash-core/ply-device-manager.c
|
||||
+++ plymouth-0.9.2+git20160823.e4b7e49/src/libply-splash-core/ply-device-manager.c
|
||||
@@ -949,3 +949,12 @@ ply_device_manager_deactivate_keyboards
|
||||
|
||||
manager->keyboards_activated = false;
|
||||
}
|
||||
+
|
||||
+void
|
||||
+ply_close_all_terminals (ply_device_manager_t *manager)
|
||||
+{
|
||||
+ ply_hashtable_foreach (manager->terminals,
|
||||
+ (ply_hashtable_foreach_func_t *)
|
||||
+ ply_terminal_close,
|
||||
+ manager);
|
||||
+}
|
||||
Index: plymouth-0.9.2+git20160823.e4b7e49/src/libply-splash-core/ply-device-manager.h
|
||||
===================================================================
|
||||
--- plymouth-0.9.2+git20160823.e4b7e49.orig/src/libply-splash-core/ply-device-manager.h
|
||||
+++ plymouth-0.9.2+git20160823.e4b7e49/src/libply-splash-core/ply-device-manager.h
|
||||
@@ -65,6 +65,7 @@ void ply_device_manager_deactivate_keybo
|
||||
void ply_device_manager_activate_renderers (ply_device_manager_t *manager);
|
||||
void ply_device_manager_deactivate_renderers (ply_device_manager_t *manager);
|
||||
ply_terminal_t *ply_device_manager_get_default_terminal (ply_device_manager_t *manager);
|
||||
+void ply_close_all_terminals (ply_device_manager_t *manager);
|
||||
|
||||
#endif
|
||||
|
||||
Index: plymouth-0.9.2+git20160823.e4b7e49/src/libply/ply-utils.c
|
||||
===================================================================
|
||||
--- plymouth-0.9.2+git20160823.e4b7e49.orig/src/libply/ply-utils.c
|
||||
+++ plymouth-0.9.2+git20160823.e4b7e49/src/libply/ply-utils.c
|
||||
@@ -77,6 +77,7 @@
|
||||
|
||||
static int errno_stack[PLY_ERRNO_STACK_SIZE];
|
||||
static int errno_stack_position = 0;
|
||||
+static bool inChild = false;
|
||||
|
||||
static int overridden_device_scale = 0;
|
||||
|
||||
@@ -796,6 +797,7 @@ ply_create_daemon (void)
|
||||
if (!ply_read (receiver_fd, &byte, sizeof(uint8_t))) {
|
||||
int read_error = errno;
|
||||
int status;
|
||||
+ inChild = true;
|
||||
|
||||
if (waitpid (pid, &status, WNOHANG) <= 0)
|
||||
ply_error ("failed to read status from child immediately after starting to daemonize: %s", strerror (read_error));
|
||||
@@ -836,6 +838,9 @@ ply_detach_daemon (ply_daemon_handle_t *
|
||||
close (sender_fd);
|
||||
free (handle);
|
||||
|
||||
+ if (inChild)
|
||||
+ setsid();
|
||||
+
|
||||
return true;
|
||||
}
|
||||
|
||||
Index: plymouth-0.9.2+git20160823.e4b7e49/src/libply/ply-terminal-session.c
|
||||
===================================================================
|
||||
--- plymouth-0.9.2+git20160823.e4b7e49.orig/src/libply/ply-terminal-session.c
|
||||
+++ plymouth-0.9.2+git20160823.e4b7e49/src/libply/ply-terminal-session.c
|
||||
@@ -187,6 +187,12 @@ ply_terminal_session_redirect_console (p
|
||||
|
||||
assert (terminal_name != NULL);
|
||||
|
||||
+ fd = open ("/dev/console", O_RDWR | O_NOCTTY);
|
||||
+ if (fd >= 0) {
|
||||
+ ioctl (fd, TIOCCONS); /* Undo any current map if any */
|
||||
+ close (fd);
|
||||
+ }
|
||||
+
|
||||
fd = open (terminal_name, O_RDWR | O_NOCTTY);
|
||||
|
||||
if (fd < 0)
|
||||
Index: plymouth-0.9.2+git20160823.e4b7e49/src/main.c
|
||||
===================================================================
|
||||
--- plymouth-0.9.2+git20160823.e4b7e49.orig/src/main.c
|
||||
+++ plymouth-0.9.2+git20160823.e4b7e49/src/main.c
|
||||
@@ -1101,6 +1101,7 @@ on_text_display_removed (state_t
|
||||
ply_boot_splash_remove_text_display (state->boot_splash, display);
|
||||
}
|
||||
|
||||
+static ply_device_manager_t *manager;
|
||||
static void
|
||||
load_devices (state_t *state,
|
||||
ply_device_manager_flags_t flags)
|
||||
@@ -1108,6 +1109,8 @@ load_devices (state_t
|
||||
state->device_manager = ply_device_manager_new (state->default_tty, flags);
|
||||
state->local_console_terminal = ply_device_manager_get_default_terminal (state->device_manager);
|
||||
|
||||
+ manager = state->device_manager;
|
||||
+
|
||||
ply_device_manager_watch_devices (state->device_manager,
|
||||
state->device_timeout,
|
||||
(ply_keyboard_added_handler_t)
|
||||
@@ -1146,6 +1149,7 @@ quit_splash (state_t *state)
|
||||
ply_trace ("Not retaining splash, so deallocating VT");
|
||||
ply_terminal_deactivate_vt (state->local_console_terminal);
|
||||
ply_terminal_close (state->local_console_terminal);
|
||||
+ ply_close_all_terminals (state->device_manager);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2091,28 +2095,20 @@ dump_debug_buffer_to_file (void)
|
||||
#include <termios.h>
|
||||
#include <unistd.h>
|
||||
static void
|
||||
-on_crash (int signum)
|
||||
+dosigaction (int signum)
|
||||
{
|
||||
- struct termios term_attributes;
|
||||
int fd;
|
||||
- static const char *show_cursor_sequence = "\033[?25h";
|
||||
-
|
||||
- fd = open ("/dev/tty1", O_RDWR | O_NOCTTY);
|
||||
- if (fd < 0) fd = open ("/dev/hvc0", O_RDWR | O_NOCTTY);
|
||||
-
|
||||
- ioctl (fd, KDSETMODE, KD_TEXT);
|
||||
-
|
||||
- write (fd, show_cursor_sequence, sizeof (show_cursor_sequence) - 1);
|
||||
-
|
||||
- tcgetattr (fd, &term_attributes);
|
||||
|
||||
- term_attributes.c_iflag |= BRKINT | IGNPAR | ICRNL | IXON;
|
||||
- term_attributes.c_oflag |= OPOST;
|
||||
- term_attributes.c_lflag |= ECHO | ICANON | ISIG | IEXTEN;
|
||||
-
|
||||
- tcsetattr (fd, TCSAFLUSH, &term_attributes);
|
||||
+ if (manager) {
|
||||
+ ply_device_manager_deactivate_keyboards (manager);
|
||||
+ ply_close_all_terminals (manager);
|
||||
+ }
|
||||
|
||||
- close (fd);
|
||||
+ fd = open ("/dev/console", O_RDWR | O_NOCTTY);
|
||||
+ if (fd >= 0) {
|
||||
+ ioctl (fd, TIOCCONS); /* Undo any current map if any */
|
||||
+ close (fd);
|
||||
+ }
|
||||
|
||||
if (debug_buffer != NULL) {
|
||||
dump_debug_buffer_to_file ();
|
||||
@@ -2125,7 +2121,6 @@ on_crash (int signum)
|
||||
pid_file = NULL;
|
||||
}
|
||||
|
||||
- signal (signum, SIG_DFL);
|
||||
raise (signum);
|
||||
}
|
||||
|
||||
@@ -2159,6 +2154,7 @@ main (int argc,
|
||||
char *kernel_command_line = NULL;
|
||||
char *tty = NULL;
|
||||
ply_device_manager_flags_t device_manager_flags = PLY_DEVICE_MANAGER_FLAGS_NONE;
|
||||
+ struct sigaction sa;
|
||||
|
||||
state.start_time = ply_get_timestamp ();
|
||||
state.command_parser = ply_command_parser_new ("plymouthd", "Splash server");
|
||||
@@ -2261,8 +2257,13 @@ main (int argc,
|
||||
if (debug)
|
||||
debug_buffer = ply_buffer_new ();
|
||||
|
||||
- signal (SIGABRT, on_crash);
|
||||
- signal (SIGSEGV, on_crash);
|
||||
+ sigemptyset(&sa.sa_mask);
|
||||
+ sa.sa_flags = SA_RESETHAND;
|
||||
+ sa.sa_handler = dosigaction;
|
||||
+ sigaction (SIGHUP, &sa, NULL);
|
||||
+ sigaction (SIGTERM, &sa, NULL);
|
||||
+ sigaction (SIGABRT, &sa, NULL);
|
||||
+ sigaction (SIGSEGV, &sa, NULL);
|
||||
|
||||
/* before do anything we need to make sure we have a working
|
||||
* environment.
|
47
only_use_fb_for_cirrus_bochs.patch
Normal file
47
only_use_fb_for_cirrus_bochs.patch
Normal file
@ -0,0 +1,47 @@
|
||||
From: Fabian Vogt <fvogt@suse.com>
|
||||
Subject: force fb for cirrus and bochs, force drm otherwise
|
||||
References: bsc#888590, bsc#980750
|
||||
|
||||
DRM does not work well with cirrus and bochs (no display) but the framebuffer driver
|
||||
prevents DRM drivers from loading.
|
||||
As we need to support cirrus for libvirt and bochs for QEMU, we cannot just remove support for frame-buffer.
|
||||
|
||||
Index: plymouth-0.9.2+git20161215.18dd755/src/libply-splash-core/ply-device-manager.c
|
||||
===================================================================
|
||||
--- plymouth-0.9.2+git20161215.18dd755.orig/src/libply-splash-core/ply-device-manager.c
|
||||
+++ plymouth-0.9.2+git20161215.18dd755/src/libply-splash-core/ply-device-manager.c
|
||||
@@ -227,13 +227,33 @@ create_devices_for_udev_device (ply_devi
|
||||
subsystem = udev_device_get_subsystem (device);
|
||||
ply_trace ("device subsystem is %s", subsystem);
|
||||
|
||||
+ const char *card_vendor = udev_device_get_sysattr_value (device, "device/vendor");
|
||||
+ const char *card_device = udev_device_get_sysattr_value (device, "device/device");
|
||||
+ bool use_fb = false;
|
||||
+ if (card_vendor) {
|
||||
+ /* Cirrus */
|
||||
+ if (strcmp ("0x1013", card_vendor) == 0)
|
||||
+ use_fb = true;
|
||||
+ /* "Technical Corp", also used by bochs */
|
||||
+ else if (strcmp ("0x1234", card_vendor) == 0)
|
||||
+ use_fb = strcmp("0x1111", card_device) == 0;
|
||||
+ }
|
||||
+
|
||||
if (subsystem != NULL && strcmp (subsystem, SUBSYSTEM_DRM) == 0) {
|
||||
ply_trace ("found DRM device %s", device_path);
|
||||
renderer_type = PLY_RENDERER_TYPE_DRM;
|
||||
+ if (use_fb) {
|
||||
+ ply_trace ("forcing use of framebuffer for cirrusdrmfb");
|
||||
+ renderer_type = PLY_RENDERER_TYPE_NONE;
|
||||
+ }
|
||||
} 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))
|
||||
+ if (use_fb) {
|
||||
renderer_type = PLY_RENDERER_TYPE_FRAME_BUFFER;
|
||||
+ }
|
||||
+ else if (!fb_device_has_drm_device (manager, device)) {
|
||||
+ ply_trace ("avoiding use of framebuffer to not block DRM drivers from working");
|
||||
+ }
|
||||
else
|
||||
ply_trace ("ignoring, since there's a DRM device associated with it");
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
Index: plymouth-0.9.2/src/libply-splash-core/ply-device-manager.c
|
||||
===================================================================
|
||||
--- plymouth-0.9.2.orig/src/libply-splash-core/ply-device-manager.c
|
||||
+++ plymouth-0.9.2/src/libply-splash-core/ply-device-manager.c
|
||||
@@ -157,6 +157,10 @@ fb_device_has_drm_device (ply_device_man
|
||||
const char *id_path;
|
||||
bool has_drm_device = false;
|
||||
|
||||
+ const char *card_name = udev_device_get_sysattr_value (fb_device, "name");
|
||||
+ if (card_name && strcmp ("cirrusdrmfb", card_name) == 0)
|
||||
+ return false;
|
||||
+
|
||||
/* We want to see if the framebuffer is associated with a DRM-capable
|
||||
* graphics card, if it is, we'll use the DRM device */
|
||||
card_matches = udev_enumerate_new (manager->udev_context);
|
@ -1,3 +1,14 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Jan 25 14:38:09 UTC 2017 - fvogt@suse.com
|
||||
|
||||
- Remove patch which causes breakage with systemd-vconsole-setup (bsc#1020327):
|
||||
* 0001-let-it-become-a-real-daemon.patch
|
||||
- Add upstream patch to fix crash on boot:
|
||||
* 0001-device-manager-handle-NULL-renderer-better.patch
|
||||
- Replace removal of framebuffer driver and plymouth-ignore-cirrusdrm.patch
|
||||
with single patch:
|
||||
* only_use_fb_for_cirrus_bochs.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Jan 09 17:01:44 UTC 2017 - zaitor@opensuse.org
|
||||
|
||||
|
@ -41,11 +41,12 @@ Patch10: 0001-Some-greenish-openSUSE-colors.patch
|
||||
Patch16: plymouth-correct-runtime-dir.patch
|
||||
# PATCH-FIX-UPSTREAM plymouth-manpages.patch idoenmez@suse.de -- Fix man page installation
|
||||
Patch17: plymouth-manpages.patch
|
||||
# PATCH-FIX-UPSTREAM 0001-device-manager-handle-NULL-renderer-better.patch rstrode@redhat.com -- device-manager: handle NULL renderer better
|
||||
Patch18: 0001-device-manager-handle-NULL-renderer-better.patch
|
||||
# PATCH-FIX-OPENSUSE use-mkinitrd.patch fcrozat@suse.com -- call mkinitrd -B for now
|
||||
Patch20: use-mkinitrd.patch
|
||||
# PATCH-FIX-UPSTREAM plymouth-ignore-cirrusdrm.patch fcrozat@suse.com -- ignore cirrusdrm, use fb instead
|
||||
Patch26: plymouth-ignore-cirrusdrm.patch
|
||||
Patch29: 0001-let-it-become-a-real-daemon.patch
|
||||
# PATCH-FIX-OPENSUSE only_use_fb_for_cirrus_bochs.patch fvogt@suse.com -- force fb for cirrus and bochs, force drm otherwise
|
||||
Patch26: only_use_fb_for_cirrus_bochs.patch
|
||||
# PATCH-FIX-UPSTREAM 0001-Add-label-ft-plugin.patch fvogt@suse.com -- add ability to output text in initrd
|
||||
Patch30: 0001-Add-label-ft-plugin.patch
|
||||
Patch31: 0002-Install-label-ft-plugin-into-initrd-if-available.patch
|
||||
@ -66,6 +67,7 @@ BuildRequires: pkgconfig(cairo)
|
||||
BuildRequires: pkgconfig(freetype2)
|
||||
BuildRequires: pkgconfig(gtk+-3.0) >= 3.14.0
|
||||
BuildRequires: pkgconfig(libdrm)
|
||||
BuildRequires: pkgconfig(libsystemd) >= 186
|
||||
BuildRequires: pkgconfig(libudev)
|
||||
BuildRequires: pkgconfig(pango) >= 1.21.0
|
||||
BuildRequires: pkgconfig(systemd) >= 186
|
||||
@ -344,9 +346,9 @@ plugin.
|
||||
%patch10 -p1
|
||||
%patch16 -p1
|
||||
%patch17 -p1
|
||||
%patch18 -p1
|
||||
%patch20 -p1
|
||||
%patch26 -p1
|
||||
%patch29 -p1
|
||||
%patch30 -p1
|
||||
%patch31 -p1
|
||||
%patch32 -p1
|
||||
@ -404,9 +406,6 @@ cp $RPM_SOURCE_DIR/boot-duration %{buildroot}%{_datadir}/plymouth/default-boot-d
|
||||
cp $RPM_SOURCE_DIR/boot-duration %{buildroot}%{_localstatedir}/lib/plymouth
|
||||
cp %{buildroot}/%{_datadir}/plymouth/plymouthd.defaults %{buildroot}/%{_sysconfdir}/plymouth/plymouthd.conf
|
||||
|
||||
# Remove framebuffer support, bsc#980750
|
||||
rm %{buildroot}%{_libdir}/plymouth/renderers/frame-buffer.so
|
||||
|
||||
%post
|
||||
%{?regenerate_initrd_post}
|
||||
if [ ! -e /.buildenv ]; then
|
||||
@ -517,6 +516,7 @@ fi
|
||||
%{_libdir}/plymouth/details.so
|
||||
%{_libdir}/plymouth/text.so
|
||||
%{_libdir}/plymouth/renderers/drm*
|
||||
%{_libdir}/plymouth/renderers/frame-buffer*
|
||||
%{_datadir}/plymouth/default-boot-duration
|
||||
%{_datadir}/plymouth/themes/details/details.plymouth
|
||||
%{_datadir}/plymouth/themes/text/text.plymouth
|
||||
|
Loading…
Reference in New Issue
Block a user