Move frame-buffer back to subpackage, patch bugs

More fun related to #1518464. This should fix everything really
hard! We backport a patch that should actually fix #1518464 if
frame-buffer is present but drm is not...but we also backport a
patch that fixes boot with 'rhgb' when neither renderer is
present, and move frame-buffer back to the subpackage, as we
think that's the 'most correct' package layout assuming no bugs.
This commit is contained in:
Adam Williamson 2018-06-07 11:13:11 -07:00
parent e1402920e9
commit 61f6bb5711
3 changed files with 244 additions and 3 deletions

View File

@ -0,0 +1,113 @@
From bdfcf889f8cda47190d98fa8a3e401a1db38074c Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Tue, 7 Nov 2017 13:49:30 -0500
Subject: [PATCH] device-manager: fall back to text mode if graphical devices
fail
Right now we assume if we find a /dev/dri/card0 that it will work.
That may not be true. The proprietary nvidia driver, for instance,
provides /dev/dri/card0 but disables modesetting by default.
This commit makes sure we fall back to text mode if /dev/dri/card0
is insufficient for our needs.
https://bugs.freedesktop.org/show_bug.cgi?id=103612
---
src/libply-splash-core/ply-device-manager.c | 26 ++++++++++++---------
1 file changed, 15 insertions(+), 11 deletions(-)
diff --git a/src/libply-splash-core/ply-device-manager.c b/src/libply-splash-core/ply-device-manager.c
index b4c33d4..cf56f4e 100644
--- a/src/libply-splash-core/ply-device-manager.c
+++ b/src/libply-splash-core/ply-device-manager.c
@@ -47,7 +47,7 @@
static void create_devices_from_udev (ply_device_manager_t *manager);
#endif
-static void 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,
const char *device_path,
ply_terminal_t *terminal,
ply_renderer_type_t renderer_type);
@@ -212,11 +212,12 @@ fb_device_has_drm_device (ply_device_manager_t *manager,
return has_drm_device;
}
-static void
+static bool
create_devices_for_udev_device (ply_device_manager_t *manager,
struct udev_device *device)
{
const char *device_path;
+ bool created = false;
device_path = udev_device_get_devnode (device);
@@ -245,12 +246,14 @@ create_devices_for_udev_device (ply_device_manager_t *manager,
terminal = manager->local_console_terminal;
}
- create_devices_for_terminal_and_renderer_type (manager,
- device_path,
- terminal,
- renderer_type);
+ created = create_devices_for_terminal_and_renderer_type (manager,
+ device_path,
+ terminal,
+ renderer_type);
}
}
+
+ return created;
}
static void
@@ -310,8 +313,7 @@ create_devices_for_subsystem (ply_device_manager_t *manager,
node = udev_device_get_devnode (device);
if (node != NULL) {
ply_trace ("found node %s", node);
- found_device = true;
- create_devices_for_udev_device (manager, device);
+ found_device = create_devices_for_udev_device (manager, device);
}
} else {
ply_trace ("device doesn't have a devices tag");
@@ -656,7 +658,7 @@ create_text_displays_for_terminal (ply_device_manager_t *manager,
manager->text_display_added_handler (manager->event_handler_data, display);
}
-static void
+static bool
create_devices_for_terminal_and_renderer_type (ply_device_manager_t *manager,
const char *device_path,
ply_terminal_t *terminal,
@@ -670,7 +672,7 @@ create_devices_for_terminal_and_renderer_type (ply_device_manager_t *manager,
if (renderer != NULL) {
ply_trace ("ignoring device %s since it's already managed", device_path);
- return;
+ return true;
}
ply_trace ("creating devices for %s (renderer type: %u) (terminal: %s)",
@@ -686,7 +688,7 @@ create_devices_for_terminal_and_renderer_type (ply_device_manager_t *manager,
renderer = NULL;
if (renderer_type != PLY_RENDERER_TYPE_AUTO)
- return;
+ return false;
}
if (renderer != NULL) {
@@ -743,6 +745,8 @@ create_devices_for_terminal_and_renderer_type (ply_device_manager_t *manager,
ply_trace ("activating keyboards");
ply_keyboard_watch_for_input (keyboard);
}
+
+ return true;
}
static void
--
2.17.1

View File

@ -0,0 +1,117 @@
From 014c2158898067176738ec36c9c90cc266a7e35b Mon Sep 17 00:00:00 2001
From: Adam Williamson <awilliam@redhat.com>
Date: Wed, 6 Jun 2018 17:06:14 -0700
Subject: [PATCH] device-manager: skip graphical renderer setup when details
forced
If neither "rhgb" nor "splash" is on the kernel cmdline, then
plymouth forces the "details" splash. This splash is merely
a passthrough plugin, where it makes boot looks like plymouth
isn't even running.
In this case, the code sets PLY_DEVICE_MANAGER_FLAGS_IGNORE_UDEV.
The idea is to not bother waiting for udev events notifying
plymouth when graphics devices show up, since it doesn't need
to use the grpahics devices directly anyway.
Unfortunately, it does still erroneously try to setup graphical
renderers in this case, including the /dev/fb renderer.
Before commit e4f86e3c, these graphical renderers failed because
they were given the wrong device name, but since that fix, they're
suceeding. We definitely don't want the /dev/fb renderer to
load if we're ignoring udev on efi systems, since during very
early boot /dev/fb is backed by efifb, something we never want to
use. efifb is supposed to get replaced during the boot process
by other fb implementations like say radeondrmfb, virtiodrmfb or
bochsdrmfb, and some of those implementations can't handle the
transition if /dev/fb is open at switchover time.
This commit adds a new flag to tell the device manager to
not bother trying to setup graphical renderers when details are
forced.
http://bugzilla.redhat.com/1518464
---
src/libply-splash-core/ply-device-manager.c | 20 ++++++++++++++++----
src/libply-splash-core/ply-device-manager.h | 3 ++-
src/main.c | 4 +++-
3 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/src/libply-splash-core/ply-device-manager.c b/src/libply-splash-core/ply-device-manager.c
index fbf4723..b637fb8 100644
--- a/src/libply-splash-core/ply-device-manager.c
+++ b/src/libply-splash-core/ply-device-manager.c
@@ -786,6 +786,15 @@ create_devices_from_terminals (ply_device_manager_t *manager)
return false;
}
+static void
+create_non_graphical_devices (ply_device_manager_t *manager)
+{
+ create_devices_for_terminal_and_renderer_type (manager,
+ NULL,
+ manager->local_console_terminal,
+ PLY_RENDERER_TYPE_NONE);
+}
+
#ifdef HAVE_UDEV
static void
create_devices_from_udev (ply_device_manager_t *manager)
@@ -801,10 +810,7 @@ create_devices_from_udev (ply_device_manager_t *manager)
return;
ply_trace ("Creating non-graphical devices, since there's no suitable graphics hardware");
- create_devices_for_terminal_and_renderer_type (manager,
- NULL,
- manager->local_console_terminal,
- PLY_RENDERER_TYPE_NONE);
+ create_non_graphical_devices (manager);
}
#endif
@@ -845,6 +851,12 @@ ply_device_manager_watch_devices (ply_device_manager_t *manager,
if (done_with_initial_devices_setup)
return;
+ if ((manager->flags & PLY_DEVICE_MANAGER_FLAGS_SKIP_RENDERERS)) {
+ ply_trace ("Creating non-graphical devices, since renderers are being explicitly skipped");
+ create_non_graphical_devices (manager);
+ return;
+ }
+
if ((manager->flags & PLY_DEVICE_MANAGER_FLAGS_IGNORE_UDEV)) {
ply_trace ("udev support disabled, creating fallback devices");
create_fallback_devices (manager);
diff --git a/src/libply-splash-core/ply-device-manager.h b/src/libply-splash-core/ply-device-manager.h
index 058f6e8..ad05897 100644
--- a/src/libply-splash-core/ply-device-manager.h
+++ b/src/libply-splash-core/ply-device-manager.h
@@ -31,7 +31,8 @@ typedef enum
{
PLY_DEVICE_MANAGER_FLAGS_NONE = 0,
PLY_DEVICE_MANAGER_FLAGS_IGNORE_SERIAL_CONSOLES = 1 << 0,
- PLY_DEVICE_MANAGER_FLAGS_IGNORE_UDEV = 1 << 1
+ PLY_DEVICE_MANAGER_FLAGS_IGNORE_UDEV = 1 << 1,
+ PLY_DEVICE_MANAGER_FLAGS_SKIP_RENDERERS = 1 << 2
} ply_device_manager_flags_t;
typedef struct _ply_device_manager ply_device_manager_t;
diff --git a/src/main.c b/src/main.c
index f1e0fa7..841fe6b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2358,7 +2358,9 @@ main (int argc,
device_manager_flags |= PLY_DEVICE_MANAGER_FLAGS_IGNORE_UDEV;
if (!plymouth_should_show_default_splash (&state)) {
- /* don't bother listening for udev events if we're forcing details */
+ /* don't bother listening for udev events or setting up a graphical renderer
+ * if we're forcing details */
+ device_manager_flags |= PLY_DEVICE_MANAGER_FLAGS_SKIP_RENDERERS;
device_manager_flags |= PLY_DEVICE_MANAGER_FLAGS_IGNORE_UDEV;
/* don't ever delay showing the detailed splash */
--
2.17.1

View File

@ -16,7 +16,7 @@
Summary: Graphical Boot Animation and Logger Summary: Graphical Boot Animation and Logger
Name: plymouth Name: plymouth
Version: 0.9.3 Version: 0.9.3
Release: 8%{?snapshot_rel}%{?dist} Release: 9%{?snapshot_rel}%{?dist}
License: GPLv2+ License: GPLv2+
URL: http://www.freedesktop.org/wiki/Software/Plymouth URL: http://www.freedesktop.org/wiki/Software/Plymouth
Group: System Environment/Base Group: System Environment/Base
@ -37,6 +37,12 @@ Patch5: 0005-drm-Reset-primary-plane-rotation-to-DRM_MODE_ROTATE_.patch
Patch6: 0006-pixel-buffer-switch-device-rotation-to-an-enum.patch Patch6: 0006-pixel-buffer-switch-device-rotation-to-an-enum.patch
Patch7: 0007-terminal-add-include-for-sysmacros.h.patch Patch7: 0007-terminal-add-include-for-sysmacros.h.patch
# Patch from upstream for #1518464
Patch8: 0001-device-manager-skip-graphical-renderer-setup-when-de.patch
# Patch from upstream fixes boot with rhgb but no renderers available
Patch9: 0001-device-manager-fall-back-to-text-mode-if-graphical-d.patch
BuildRequires: pkgconfig(libdrm) BuildRequires: pkgconfig(libdrm)
BuildRequires: pkgconfig(libudev) BuildRequires: pkgconfig(libudev)
BuildRequires: kernel-headers BuildRequires: kernel-headers
@ -357,8 +363,6 @@ fi
%{plymouthclient_execdir}/plymouth %{plymouthclient_execdir}/plymouth
%{_bindir}/plymouth %{_bindir}/plymouth
%{_libdir}/plymouth/details.so %{_libdir}/plymouth/details.so
%{_libdir}/plymouth/renderers/frame-buffer*
%{_libdir}/plymouth/renderers/drm*
%{_libdir}/plymouth/text.so %{_libdir}/plymouth/text.so
%{_libdir}/plymouth/tribar.so %{_libdir}/plymouth/tribar.so
%{_datadir}/plymouth/default-boot-duration %{_datadir}/plymouth/default-boot-duration
@ -392,6 +396,8 @@ fi
%files graphics-libs %files graphics-libs
%{_libdir}/libply-splash-graphics.so.* %{_libdir}/libply-splash-graphics.so.*
%{_libdir}/plymouth/renderers/drm*
%{_libdir}/plymouth/renderers/frame-buffer*
%files scripts %files scripts
%{_sbindir}/plymouth-set-default-theme %{_sbindir}/plymouth-set-default-theme
@ -458,6 +464,11 @@ fi
%files system-theme %files system-theme
%changelog %changelog
* Wed Jun 06 2018 Adam Williamson <awilliam@redhat.com> - 0.9.3-9
- Backport patch to avoid loading renderers on non-rhgb boot
- Backport patch to handle 'rhgb' but no renderers available
- Move frame-buffer rendererer back to graphics-libs subpackage
* Mon Jun 04 2018 Adam Williamson <awilliam@redhat.com> - 0.9.3-8 * Mon Jun 04 2018 Adam Williamson <awilliam@redhat.com> - 0.9.3-8
- Move frame-buffer and drm renderers back to main package - Move frame-buffer and drm renderers back to main package
Having both in subpackage breaks minimal installs with rhgb Having both in subpackage breaks minimal installs with rhgb