]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
wip! plymouth: stub out drm escrow program
authorRay Strode <rstrode@redhat.com>
Thu, 26 Apr 2018 14:15:14 +0000 (10:15 -0400)
committerRay Strode <rstrode@redhat.com>
Thu, 26 Apr 2018 14:15:14 +0000 (10:15 -0400)
Right now plymouthd forces itself to stay alive for the duration of
shutdown, so the splash screen can stay up until the power is killed.

This causes unclean mounts in some situations following system updates.

Rather than keep plymouthd around, all we really need to do is keep
the drm fd around.  That can be down with a separate program executed
just in time from the initramfs.

As a first step toward acheiving that goal, this commit creates a
simple new program "plymouth-drm-escrow" that doesn't do anything
at all but try to stay alive.

A future commit will change plymouthd to run plymouth-drm-escrow,
and pass it the drm fd.

configure.ac
src/drm-escrow/Makefile.am [new file with mode: 0644]
src/drm-escrow/plymouth-drm-escrow.c [new file with mode: 0644]

index c32697fa58b01d90831ab8058a3b10751d847162..a1175491cbd7c1470924f31d2f849982bc5c608a 100644 (file)
@@ -310,6 +310,7 @@ AC_CONFIG_FILES([Makefile
            src/Makefile
            src/client/ply-boot-client.pc
            src/client/Makefile
+           src/drm-escrow/Makefile
            src/upstart-bridge/Makefile
            themes/Makefile
            themes/spinfinity/Makefile
diff --git a/src/drm-escrow/Makefile.am b/src/drm-escrow/Makefile.am
new file mode 100644 (file)
index 0000000..21f53ef
--- /dev/null
@@ -0,0 +1,17 @@
+AM_CPPFLAGS = -I$(top_srcdir)                                                 \
+           -I$(top_srcdir)/src                                                \
+           -I$(top_srcdir)/src/libply                                         \
+           -I$(srcdir)
+
+plymouth_drm_escrowdir = $(plymouthclientdir)
+
+plymouth_drm_escrow_PROGRAMS = plymouth-drm-escrow
+
+plymouth_drm_escrow_CFLAGS = $(PLYMOUTH_CFLAGS) -DPLYMOUTH_PLUGIN_PATH=\"$(PLYMOUTH_PLUGIN_PATH)\"
+plymouth_drm_escrow_LDADD = $(PLYMOUTH_LIBS) ../libply/libply.la
+plymouth_drm_escrow_SOURCES = $(srcdir)/plymouth-drm-escrow.c
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = ply-boot-client.pc
+
+MAINTAINERCLEANFILES = Makefile.in
diff --git a/src/drm-escrow/plymouth-drm-escrow.c b/src/drm-escrow/plymouth-drm-escrow.c
new file mode 100644 (file)
index 0000000..22cb921
--- /dev/null
@@ -0,0 +1,45 @@
+/* plymouth-drm-escrow.c - hold on to drm fd at shutdown to stop flicker
+ *
+ * Copyright (C) 2018 Red Hat, Inc
+ *
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2 of the License,
+ * or (at your option) any later version.
+ *
+ * This file is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this; see the file COPYING.  If not, write to the Free
+ * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * Written by: Ray Strode <rstrode@redhat.com>
+ */
+#include "config.h"
+#include <stdbool.h>
+#include <sysexits.h>
+#include <unistd.h>
+
+int
+main (int    argc,
+      char **argv)
+{
+        /* Make the first byte in argv be '@' so that we can survive systemd's killing
+         * spree when going from initrd to /, and so we stay alive all the way until
+         * the power is killed at shutdown.
+         * http://www.freedesktop.org/wiki/Software/systemd/RootStorageDaemons
+         */
+        argv[0][0] = '@';
+
+        /* We don't actually do anything.  The drm fd was passed to us on some fd,
+         * and we just need to keep it open until by staying alive until we're killed
+         */
+        while (true) pause ();
+
+        return EX_SOFTWARE;
+}
+/* vim: set ts=4 sw=4 expandtab autoindent cindent cino={.5s,(0: */