Skip to content

Commit

Permalink
sideload-repos-systemd: Use systemd-tmpfiles
Browse files Browse the repository at this point in the history
Instead of using a systemd service to create the directory we need for
sideloading (/run/flatpak/sideload-repos), use a systemd-tmpfiles conf
file. This is more elegant, and the service also had a bug which meant
it would create a "/run/flatpak;" directory instead of the one intended.

Since systemd-tmpfiles-setup.service runs before sysinit.target and path
units are run after sysinit.target, the tmp directory should be in place
when flatpak-sideload-usb-repo.path runs in the systemd user instance.

Endless OS already has a file at /lib/tmpfiles.d/flatpak.conf, so we
can't use that filename.
  • Loading branch information
mwleeds authored and alexlarsson committed Sep 14, 2020
1 parent 238317d commit d73d6c1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 18 deletions.
8 changes: 5 additions & 3 deletions sideload-repos-systemd/Makefile.am.inc
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ systemduserunit_DATA += sideload-repos-systemd/flatpak-sideload-usb-repo.service
path_in_files = sideload-repos-systemd/flatpak-sideload-usb-repo.path.in
systemduserunit_DATA += sideload-repos-systemd/flatpak-sideload-usb-repo.path

systemdsystemunit_DATA += sideload-repos-systemd/flatpak-sideload-repos-dir.service

%.path: %.path.in config.log
$(AM_V_GEN) $(SED) -e "s|\@media_dir\@|$(RUN_MEDIA_DIR)|" $< > $@

tmpfilesdir = $(prefix)/lib/tmpfiles.d
dist_tmpfiles_DATA = sideload-repos-systemd/tmpfiles.d/flatpak-sideload-repos.conf

endif

EXTRA_DIST += sideload-repos-systemd/flatpak-sideload-usb-repo.path.in sideload-repos-systemd/flatpak-sideload-usb-repo.service.in sideload-repos-systemd/flatpak-sideload-repos-dir.service
EXTRA_DIST += sideload-repos-systemd/flatpak-sideload-usb-repo.path.in sideload-repos-systemd/flatpak-sideload-usb-repo.service.in

15 changes: 0 additions & 15 deletions sideload-repos-systemd/flatpak-sideload-repos-dir.service

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
D /run/flatpak/sideload-repos 0777 - - -

0 comments on commit d73d6c1

Please sign in to comment.