aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2020-03-02 12:40:39 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-03-02 17:37:58 +0000
commit0a902f7cd875ccf018456451be369f05fa55f962 (patch)
treeb5f82684df2195f447639e09761d7a2dbf30c3ea
parent4cf1330020c63756dccdf4e4f270ada6ceb36beb (diff)
downloadpsplash-0a902f7cd875ccf018456451be369f05fa55f962.tar.gz
psplash-0a902f7cd875ccf018456451be369f05fa55f962.tar.bz2
psplash-0a902f7cd875ccf018456451be369f05fa55f962.zip
Fix psplash-systemd failuresHEADmaster
To avoid racing on FIFO creation between psplash and psplash-systemd, enhance the systemd support by adding a call to sd_notify in psplash after the FIFO is created. That will alow setting the psplash-start systemd unit type to "notify" to avoid the race. Signed-off-by: Scott Murray <scott.murray@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--Makefile.am2
-rw-r--r--psplash.c7
2 files changed, 9 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 5f3fc42..310e126 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -11,6 +11,8 @@ BUILT_SOURCES = psplash-poky-img.h psplash-bar-img.h
psplash_write_SOURCES = psplash-write.c psplash.h
if HAVE_SYSTEMD
+psplash_CPPFLAGS = $(SYSTEMD_CFLAGS) -DHAVE_SYSTEMD
+psplash_LDFLAGS= $(SYSTEMD_LIBS)
bin_PROGRAMS += psplash-systemd
psplash_systemd_CPPFLAGS = $(SYSTEMD_CFLAGS)
psplash_systemd_LDFLAGS= $(SYSTEMD_LIBS)
diff --git a/psplash.c b/psplash.c
index e5dff16..1a56629 100644
--- a/psplash.c
+++ b/psplash.c
@@ -15,6 +15,9 @@
#include "psplash-colors.h"
#include "psplash-poky-img.h"
#include "psplash-bar-img.h"
+#ifdef HAVE_SYSTEMD
+#include <systemd/sd-daemon.h>
+#endif
#include FONT_HEADER
#define SPLIT_LINE_POS(fb) \
@@ -285,6 +288,10 @@ main (int argc, char** argv)
goto fb_fail;
}
+#ifdef HAVE_SYSTEMD
+ sd_notify(0, "READY=1");
+#endif
+
/* Clear the background with #ecece1 */
psplash_fb_draw_rect (fb, 0, 0, fb->width, fb->height,
PSPLASH_BACKGROUND_COLOR);