diff --git a/Makefile-dracut.am b/Makefile-dracut.am index 2837e985..d9e0dd4b 100644 --- a/Makefile-dracut.am +++ b/Makefile-dracut.am @@ -23,13 +23,7 @@ dracutmoddir = $(prefix)/lib/dracut/modules.d/98ostree dracutmod_SCRIPTS = src/dracut/module-setup.sh dracutmod_DATA = src/dracut/ostree-prepare-root.service -systemdunitdir = $(prefix)/lib/systemd/system -systemdunit_DATA = src/dracut/ostree-remount.service - -INSTALL_DATA_HOOKS += install-remount-service-data-hook -install-remount-service-data-hook: - mkdir -p $(DESTDIR)$(systemdunitdir)/local-fs.target.wants/ - ln -s ../ostree-remount.service $(DESTDIR)$(systemdunitdir)/local-fs.target.wants/ostree-remount.service +systemdsystemunit_DATA = src/dracut/ostree-remount.service dracutconfdir = $(sysconfdir)/dracut.conf.d dracutconf_DATA = src/dracut/ostree.conf diff --git a/configure.ac b/configure.ac index 675f76ec..cf504870 100644 --- a/configure.ac +++ b/configure.ac @@ -123,6 +123,16 @@ AC_ARG_WITH(dracut, [with_dracut=no]) AM_CONDITIONAL(BUILDOPT_DRACUT, test x$with_dracut = xyes) +AS_IF([test "x$with_dracut" = "xyes"], [ + AC_ARG_WITH([systemdsystemunitdir], + AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]), + [], + [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)]) + AS_IF([test "x$with_systemdsystemunitdir" != "xno"], [ + AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir]) + ]) +]) + AC_CONFIG_FILES([ Makefile embedded-dependencies/Makefile @@ -140,5 +150,8 @@ echo " libsoup (retrieve remote HTTP repositories): $with_soup libarchive (parse tar files directly): $with_libarchive documentation: $enable_documentation - dracut: $with_dracut -" + dracut: $with_dracut" +if test "x$with_dracut" = "xyes" ; then + echo " systemd unit dir: $with_systemdsystemunitdir" +fi +echo "" diff --git a/src/dracut/ostree-remount.service b/src/dracut/ostree-remount.service index 0c813ccb..26b7d390 100644 --- a/src/dracut/ostree-remount.service +++ b/src/dracut/ostree-remount.service @@ -31,3 +31,6 @@ ExecStart=/usr/sbin/ostree-remount StandardInput=null StandardOutput=syslog StandardError=syslog+console + +[Install] +WantedBy=local-fs.target