Skip to content

Makefile: fix the systemdsystemunitdir lookup - #28

Merged
otavio merged 1 commit into
OSSystems:masterfrom
lucianogdittgen:fix/systemdsystemunitdir
Nov 12, 2026
Merged

otavio merged 1 commit into
OSSystems:masterfrom
lucianogdittgen:fix/systemdsystemunitdir

Conversation

@lucianogdittgen

Copy link
Copy Markdown
Contributor

Since aa43445 (#23), make install-service SYSTEMD=1 installs the units to the wrong place:

systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd);

In Make, $( starts a variable reference, not a shell command, so pkg-config never runs. The value becomes ;, the emptiness check passes, and the units land at "$(DESTDIR);/easysplash-start.service".

This change:

  • runs pkg-config through $(shell $(PKG_CONFIG) ...), using ?= so packagers (e.g. the Yocto recipe) can still pass systemdsystemunitdir= explicitly
  • fixes the abort path: a tab-indented $(error ...) outside a rule is parsed as a recipe line ("recipe commences before first target"), and the call had an extra )

Tested with make -n install-service:

Case Before After
SYSTEMD=1, pkg-config finds systemd.pc $(DESTDIR);/…service $(DESTDIR)/usr/lib/systemd/system/…service
SYSTEMD=1 systemdsystemunitdir=/lib/systemd/system given dir given dir
SYSTEMD=1, no systemd.pc $(DESTDIR);/…service Could not find systemd.pc file. Aborting.
SYSTEMD=0 unchanged unchanged

Found while upgrading the meta-ossystems-base recipe to 84f31ef; the recipe works around it by passing systemdsystemunitdir=${systemd_system_unitdir}.

Commit aa43445 ("install systemd services based on pkg-config system
variables") assigns

  systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd);

but in Make '$(' starts a variable reference, not a shell command, so
pkg-config never runs. The value ends up as ';', the emptiness check
passes, and the units are installed as "$(DESTDIR);/easysplash-*.service".

Run pkg-config through $(shell ...), and use ?= so a packager can still
set the directory explicitly. Also fix the abort path: a tab-indented
$(error ...) outside a rule is parsed as a recipe line ("recipe
commences before first target"), and the call had an extra ')'.

Tested with make -n install-service:
- SYSTEMD=1 with pkg-config: units go to systemd.pc's systemdsystemunitdir
- SYSTEMD=1 systemdsystemunitdir=...: the given directory is used
- SYSTEMD=1 without systemd.pc: "Could not find systemd.pc file. Aborting."
- SYSTEMD=0: unchanged

Signed-off-by: Luciano Dittgen <luciano.dittgen@ossystems.com.br>
@otavio
otavio merged commit 7829a12 into OSSystems:master Nov 12, 2026
0 of 4 checks passed
lucianogdittgen added a commit to lucianogdittgen/meta-ossystems-base that referenced this pull request Nov 12, 2026
Brings the systemd unit fixes (easysplash.enable=0 boot parameter,
RemainAfterExit, no start in containers) and the cargo dependency
upgrade (gstreamer-rs 0.20); crates regenerated with update_crates.
Upstream's Makefile no longer finds the unit dir (OSSystems/EasySplash#28),
so pass systemdsystemunitdir. Tested: bitbake easysplash and both
animations on qemuarm; buildhistory shows only the expected deltas.

Signed-off-by: Luciano Dittgen <luciano.dittgen@ossystems.com.br>
lucianogdittgen added a commit to lucianogdittgen/meta-ossystems-base that referenced this pull request Nov 12, 2026
Brings the systemd unit fixes (easysplash.enable=0 boot parameter,
RemainAfterExit, no start in containers), the cargo dependency
upgrade (gstreamer-rs 0.20; crates regenerated with update_crates) and
the Makefile fix for the systemdsystemunitdir lookup
(OSSystems/EasySplash#28). The recipe still passes systemdsystemunitdir
explicitly so the unit directory does not come from pkg-config. Tested:
bitbake easysplash and both animations on qemuarm; buildhistory shows
only the expected deltas.

Signed-off-by: Luciano Dittgen <luciano.dittgen@ossystems.com.br>
lucianogdittgen added a commit to lucianogdittgen/meta-ossystems-base that referenced this pull request Nov 13, 2026
Brings the systemd unit fixes (easysplash.enable=0 boot parameter,
RemainAfterExit, no start in containers), the cargo dependency
upgrade (gstreamer-rs 0.20; crates regenerated with update_crates) and
the Makefile fix for the systemdsystemunitdir lookup
(OSSystems/EasySplash#28). The recipe still passes systemdsystemunitdir
explicitly so the unit directory does not come from pkg-config. Tested:
bitbake easysplash and both animations on qemuarm; buildhistory shows
only the expected deltas.

Signed-off-by: Luciano Dittgen <luciano.dittgen@ossystems.com.br>
(cherry picked from commit 7f36037)
lucianogdittgen added a commit to lucianogdittgen/meta-ossystems-base that referenced this pull request Nov 13, 2026
Brings the systemd unit fixes (easysplash.enable=0 boot parameter,
RemainAfterExit, no start in containers), the cargo dependency
upgrade (gstreamer-rs 0.20; crates regenerated with update_crates) and
the Makefile fix for the systemdsystemunitdir lookup
(OSSystems/EasySplash#28). The recipe still passes systemdsystemunitdir
explicitly so the unit directory does not come from pkg-config. Tested:
bitbake easysplash and both animations on qemuarm; buildhistory shows
only the expected deltas.

Signed-off-by: Luciano Dittgen <luciano.dittgen@ossystems.com.br>
(cherry picked from commit 7f36037)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants