Skip to contentSkip to conversation

Adding support for systemd and its service files

PATCH In review Sujith H 2 participants 3 messages Aug 13, 2014 – Aug 14, 2014 Kbuild

lore
Share & tools
lore

Sujith H

author
#0 lore raw

PATCH 1/1 Adding support for systemd and its service files

From: Sujith H <[email protected]>

---
 Makefile.am              |  8 +++++++-
 configure.ac             | 23 ++++++++++++++++++++++-
 psplash-quit.service.in  | 11 +++++++++++
 psplash-start.service.in | 11 +++++++++++
 4 files changed, 51 insertions(+), 2 deletions(-)
 create mode 100644 psplash-quit.service.in
 create mode 100644 psplash-start.service.in
Makefile.am +7 -1
index c90ebfa..786b3ce 100644
@@ -11,8 +11,14 @@ psplash_write_SOURCES = psplash-write.c psplash.h
 
 EXTRA_DIST = make-image-header.sh
  
-MAINTAINERCLEANFILES = aclocal.m4 compile config.guess config.sub configure depcomp install-sh ltmain.sh Makefile.in missing
+MAINTAINERCLEANFILES = aclocal.m4 compile config.guess config.sub configure depcomp install-sh ltmain.sh Makefile.in missing psplash-quit.service  psplash-start.service
 
 snapshot:
 	$(MAKE) dist distdir=$(PACKAGE)-snap`date +"%Y%m%d"`
 
+if SYSTEMD
+systemdunitdir = @SYSTEMD_UNITDIR@
+
+systemdunit_DATA = psplash-quit.service  psplash-start.service
+endif
+
configure.ac +22 -1
index 1284833..a44c8d4 100644
@@ -15,6 +15,27 @@ fi
 
 AC_SUBST(GCC_FLAGS)
 
+# Check for pkg-config manually first, as if its not installed the
+# PKG_PROG_PKG_CONFIG macro won't be defined.
+AC_CHECK_PROG(have_pkg_config, pkg-config, yes, no)
+
+if test x"$have_pkg_config" = "xno"; then
+    AC_MSG_ERROR(pkg-config is required to install this program)
+fi
+
+#
+# systemd
+#
+AC_ARG_WITH([systemdunitdir], AC_HELP_STRING([--with-systemdunitdir=DIR],
+        [path to systemd service directory]), [path_systemdunit=${withval}],
+                [path_systemdunit="`$PKG_CONFIG --variable=systemdsystemunitdir systemd`"])
+if (test -n "${path_systemdunit}"); then
+        SYSTEMD_UNITDIR="${path_systemdunit}"
+        AC_SUBST(SYSTEMD_UNITDIR)
+fi
+AM_CONDITIONAL(SYSTEMD, test -n "${path_systemdunit}")
+
 AC_OUTPUT([
-Makefile
+Makefile psplash-quit.service  psplash-start.service
 ])
+
psplash-quit.service.in new file +11 -0
new file mode 100644
index 0000000..14bd499
@@ -0,0 +1,11 @@
+[Unit]
+Description=Terminate Psplash Boot Screen
+After=psplash-start.service
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/psplash-write QUIT
+TimeoutSec=20
+
+[Install]
+WantedBy=multi-user.target
psplash-start.service.in new file +11 -0
new file mode 100644
index 0000000..502b150
@@ -0,0 +1,11 @@
+[Unit]
+Description=Starts Psplash Boot screen
+Wants=systemd-vconsole-setup.service
+After=systemd-vconsole-setup.service systemd-udev-trigger.service systemd-udevd.service
+DefaultDependencies=no
+
+[Service]
+ExecStart=/usr/bin/psplash
+
+[Install]
+WantedBy=sysinit.target
Signature · 1 line
1.8.4
#1 lore raw
Quoted 5 lines · Sujith H

From: Sujith H <[email protected]>

Might want to mention 'psplash' in the commit message in the future when emailing a multi-purpose list like yocto@, so it's clear what exactly it's patching before reading the email :)

Signature · 5 lines
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
author
#2 lore raw
Quoted 5 lines · Christopher Larson
Quoted 2 lines · Sujith H

From: Sujith H <[email protected]>

Quoted 8 lines
Quoted 3 lines

Might want to mention 'psplash' in the commit message in the future when emailing a multi-purpose list like yocto@, so it's clear what exactly it's patching before reading the email :)

Sure Chris. I sent a second email with 'psplash' in the commit message( After seeing that I missed 'psplash' was missing in the commit message). Let me know if you see my second mail with the 'psplash' in the commit message or not?

Quoted 7 lines

--
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics

Signature · 5 lines
സുജിത് ഹരിദാസന്
Bangalore
<Project>Contributor to KDE project
http://fci.wikia.com/wiki/Anti-DRM-Campaign
<Blog> http://sujithh.info