From: Ray Strode Date: Thu, 26 Apr 2018 14:15:14 +0000 (-0400) Subject: wip! plymouth: stub out drm escrow program X-Git-Tag: 0.9.4~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12b03bf60e9ba7e3a4e400aca0b7c2fdefbb762f;p=thirdparty%2Fplymouth.git wip! plymouth: stub out drm escrow program 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. --- diff --git a/configure.ac b/configure.ac index c32697fa..a1175491 100644 --- a/configure.ac +++ b/configure.ac @@ -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 index 00000000..21f53ef2 --- /dev/null +++ b/src/drm-escrow/Makefile.am @@ -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 index 00000000..22cb9213 --- /dev/null +++ b/src/drm-escrow/plymouth-drm-escrow.c @@ -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 + */ +#include "config.h" +#include +#include +#include + +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: */