Fix psplash-systemd failures

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>
This commit is contained in:
Scott Murray
2020-03-02 12:40:39 -05:00
committed by Richard Purdie
parent 4cf1330020
commit 0a902f7cd8
2 changed files with 9 additions and 0 deletions

View File

@@ -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)

View File

@@ -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);