Skip to contentSkip to conversation

add systemd support

PATCH In review Stefan Agner 3 participants 6 messages Jan 21, 2020 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 add systemd support

From: Stefan Agner <[email protected]>

This adds optional systemd support. When enabled, an utility called psplash-systemd is built. This tool will connect to systemd using the system bus to obtain progress information and communicate that to psplash. Once full boot progress is reported by systemd psplash psplash is closed using the quit command.

---
 Makefile.am       |   7 ++
 configure.ac      |   9 +++
 psplash-systemd.c | 179 ++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 195 insertions(+)
 create mode 100644 psplash-systemd.c
Makefile.am +7 -0
index a14152a..2374fe3 100644
@@ -9,6 +9,13 @@ psplash_SOURCES = psplash.c psplash.h psplash-fb.c psplash-fb.h \
 
 psplash_write_SOURCES = psplash-write.c psplash.h
 
+if HAVE_SYSTEMD
+bin_PROGRAMS += psplash-systemd
+psplash_systemd_CPPFLAGS = $(SYSTEMD_CFLAGS)
+psplash_systemd_LDFLAGS= $(SYSTEMD_LIBS)
+psplash_systemd_SOURCES = psplash-systemd.c psplash.h
+endif
+
 EXTRA_DIST = make-image-header.sh
  
 MAINTAINERCLEANFILES = aclocal.m4 compile config.guess config.sub configure depcomp install-sh ltmain.sh Makefile.in missing
configure.ac +9 -0
index 1c4d919..107b182 100644
@@ -12,6 +12,15 @@ if test "x$GCC" = "xyes"; then
         GCC_FLAGS="-g -Wall -Wextra"
 fi
 
+AC_ARG_WITH([systemd], AS_HELP_STRING([--with-systemd], [Build with systemd
+	     support]))
+
+AS_IF([test "x$with_systemd" = "xyes"], [
+   PKG_CHECK_MODULES(SYSTEMD, libsystemd >= 221)
+])
+
+AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemd" = "xyes"])
+
 AC_SUBST(GCC_FLAGS)
 
 AC_OUTPUT([
psplash-systemd.c new file +179 -0

179 lines not on this page · raw message

Signature · 1 line
2.24.1
#1 lore raw
Quoted 10 lines · Stefan Agner

From: Stefan Agner <[email protected]>

This adds optional systemd support. When enabled, an utility called psplash-systemd is built. This tool will connect to systemd using the system bus to obtain progress information and communicate that to psplash. Once full boot progress is reported by systemd psplash psplash is closed using the quit command.

Looks like your email client or mail server has made a mess of this one - it's "Content-Type: multipart/mixed" with quoted-printable encoding for the text.

Could you try re-sending with git send-email? I'd like to test this one out myself as I've been using psplash with systemd via a bodge copied from AGL for a while now - that doesn't show proper progress though it just spins the bar around.

Thanks,
Paul

#2 lore raw
Quoted 10 lines · Paul Barker
Quoted 9 lines · Stefan Agner

From: Stefan Agner <[email protected]>

This adds optional systemd support. When enabled, an utility called psplash-systemd is built. This tool will connect to systemd using the system bus to obtain progress information and communicate that to psplash. Once full boot progress is reported by systemd psplash psplash is closed using the quit command.

Quoted 5 lines
Quoted 1 line

Looks like your email client or mail server has made a mess of this one - it's "Content-Type: multipart/mixed" with quoted-printable encoding for the text.

Hm, I did send it using git send-email:

$ git send-email [email protected]
[email protected] [email protected]
v2-0001-add-systemd-support.patch 

When I look at the email delivered to my inbox it has no "Content-Type", not sure if that is a problem? I use my setup since quite a while successfully on mailing lists...

Quoted 5 lines

Could you try re-sending with git send-email? I'd like to test this one out myself as I've been using psplash with systemd via a bodge copied from AGL for a while now - that doesn't show proper progress though it just spins the bar around.

Interested to see how it works on your side. Progress works quite nicely, the only downside is that systemd's progress information is not really linear, so usually the progress bar makes progress quite quickly and starts to slow down towards the end... It is not ideal, but better than nothing IMHO :-)

I will send a psplash recipe update once this gets merged, but something like this should help if you want to give it a try already:

FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

inherit systemd

SRC_URI += " \
    file://0001-add-systemd-support.patch \
    ${SPLASH_PATCH} \

"

SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}','',d)}" SYSTEMD_SERVICE_${PN} += "${@bb.utils.contains('DISTRO_FEATURES','systemd','psplash-start.service','',d)}"

PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"

PACKAGECONFIG[systemd] = "--with-systemd,--without-systemd,systemd"

do_install_append () {
        install -d ${D}${systemd_unitdir}/system
}

And a unit file like this:

[Unit]
Description=Starts Psplash Boot screen
DefaultDependencies=no

[Service]
ExecStart=/usr/bin/psplash-systemd

[Install]
WantedBy=sysinit.target

--
Stefan

#3 lore raw
Quoted 18 lines · Stefan Agner
Quoted 10 lines · Paul Barker
Quoted 9 lines · Stefan Agner

From: Stefan Agner <[email protected]>

This adds optional systemd support. When enabled, an utility called psplash-systemd is built. This tool will connect to systemd using the system bus to obtain progress information and communicate that to psplash. Once full boot progress is reported by systemd psplash psplash is closed using the quit command.

Quoted 5 lines
Quoted 1 line

Looks like your email client or mail server has made a mess of this one - it's "Content-Type: multipart/mixed" with quoted-printable encoding for the text.

Quoted 8 lines

Hm, I did send it using git send-email:

$ git send-email [email protected]
[email protected] [email protected]
v2-0001-add-systemd-support.patch

When I look at the email delivered to my inbox it has no "Content-Type", not sure if that is a problem? I use my setup since quite a while successfully on mailing lists...

Very strange. Something has changed it, I don't see an `X-Mailer:
git-send-email` header.

Looking at it on groups.io
(https://lists.yoctoproject.org/g/yocto/message/48061) I can see line wrapping and the additional "=" sequences quoted-printable adds in.

Quoted 44 lines
Quoted 6 lines

Could you try re-sending with git send-email? I'd like to test this one out myself as I've been using psplash with systemd via a bodge copied from AGL for a while now - that doesn't show proper progress though it just spins the bar around.

Interested to see how it works on your side. Progress works quite nicely, the only downside is that systemd's progress information is not really linear, so usually the progress bar makes progress quite quickly and starts to slow down towards the end... It is not ideal, but better than nothing IMHO :-)

I will send a psplash recipe update once this gets merged, but something like this should help if you want to give it a try already:

FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

inherit systemd

SRC_URI += " \
    file://0001-add-systemd-support.patch \
    ${SPLASH_PATCH} \

"

SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}','',d)}" SYSTEMD_SERVICE_${PN} += "${@bb.utils.contains('DISTRO_FEATURES','systemd','psplash-start.service','',d)}"

PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"

PACKAGECONFIG[systemd] = "--with-systemd,--without-systemd,systemd"

do_install_append () {
        install -d ${D}${systemd_unitdir}/system
}

And a unit file like this:

[Unit]
Description=Starts Psplash Boot screen
DefaultDependencies=no

Quoted 5 lines

[Service]
ExecStart=/usr/bin/psplash-systemd

[Install]
WantedBy=sysinit.target

Thanks for that, I'll let you know when I've had chance to give it a try.

Thanks,
Paul

#4 lore raw
Quoted 24 lines · Paul Barker
Quoted 23 lines · Stefan Agner
Quoted 10 lines · Paul Barker
Quoted 9 lines · Stefan Agner

From: Stefan Agner <[email protected]>

This adds optional systemd support. When enabled, an utility called psplash-systemd is built. This tool will connect to systemd using the system bus to obtain progress information and communicate that to psplash. Once full boot progress is reported by systemd psplash psplash is closed using the quit command.

Quoted 5 lines
Quoted 1 line

Looks like your email client or mail server has made a mess of this one - it's "Content-Type: multipart/mixed" with quoted-printable encoding for the text.

Hm, I did send it using git send-email:

$ git send-email [email protected]
[email protected] [email protected]
v2-0001-add-systemd-support.patch
Quoted 6 lines
Quoted 3 lines

When I look at the email delivered to my inbox it has no "Content-Type", not sure if that is a problem? I use my setup since quite a while successfully on mailing lists...

Very strange. Something has changed it, I don't see an `X-Mailer:
git-send-email` header.

That one is there in the message in my inbox:
X-Mailer: git-send-email 2.24.1

So maybe also groups.io is playing games here?

Quoted 4 lines

Looking at it on groups.io
(https://lists.yoctoproject.org/g/yocto/message/48061) I can see line wrapping and the additional "=" sequences quoted-printable adds in.

This indeed looks strange.

So did you notice only on groups.io or also on your end?

I went a bit back and realized that my patch email used to get those two headers:
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

But since sometime in November those seem not to be added anymore. I use a fairly standard Postfix setup, but I do remember doing some maintenance work back in November time frame, so maybe something broke. Thanks for pointing out, I will have to investigate further why that is.

--
Stefan

Quoted 55 lines
Quoted 45 lines
Quoted 7 lines

Could you try re-sending with git send-email? I'd like to test this one out myself as I've been using psplash with systemd via a bodge copied from AGL for a while now - that doesn't show proper progress though it just spins the bar around.

Interested to see how it works on your side. Progress works quite nicely, the only downside is that systemd's progress information is not really linear, so usually the progress bar makes progress quite quickly and starts to slow down towards the end... It is not ideal, but better than nothing IMHO :-)

I will send a psplash recipe update once this gets merged, but something like this should help if you want to give it a try already:

FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

inherit systemd

SRC_URI += " \
    file://0001-add-systemd-support.patch \
    ${SPLASH_PATCH} \

"

SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}','',d)}" SYSTEMD_SERVICE_${PN} += "${@bb.utils.contains('DISTRO_FEATURES','systemd','psplash-start.service','',d)}"

PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"

PACKAGECONFIG[systemd] = "--with-systemd,--without-systemd,systemd"

do_install_append () {
        install -d ${D}${systemd_unitdir}/system
}

And a unit file like this:

[Unit]
Description=Starts Psplash Boot screen
DefaultDependencies=no

Quoted 5 lines

[Service]
ExecStart=/usr/bin/psplash-systemd

[Install]
WantedBy=sysinit.target

Thanks for that, I'll let you know when I've had chance to give it a try.

Thanks,
Paul

#5 lore raw
In reply to Stefan Agner
Quoted 8 lines · Stefan Agner

From: Stefan Agner <[email protected]>

This adds optional systemd support. When enabled, an utility called psplash-systemd is built. This tool will connect to systemd using the system bus to obtain progress information and communicate that to psplash. Once full boot progress is reported by systemd psplash psplash is closed using the quit command.

Quoted 8 lines
---
 Makefile.am       |   7 ++
 configure.ac      |   9 +++
 psplash-systemd.c | 179
++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 195 insertions(+)
 create mode 100644 psplash-systemd.c

Thanks. I've merged this and some other patches which were outstanding and tweaked the license headers.

Hopefully we can update the recipe in OE-Core to use all this now...

Cheers,

Richard