1ff636
From 36bc4ca74d03fcff5808a7efb107886749472819 Mon Sep 17 00:00:00 2001
1ff636
From: Mike Gilbert <floppym@gentoo.org>
1ff636
Date: Sun, 24 May 2015 16:33:35 -0400
1ff636
Subject: [PATCH] shared: generator - correct path to systemd-fsck
1ff636
1ff636
In generated systemd-fsck-root.service. This would break if rootprefix
1ff636
is not /usr/lib/systemd.
1ff636
1ff636
[tomegun: flesh out commit message]
1ff636
1ff636
(cherry picked from commit 77eb82f9f0f60535ab5f585834ed6e66cf39b184)
1ff636
1ff636
Cherry-picked from: 77eb82f
1ff636
Resolves: #1222517
1ff636
---
1ff636
 Makefile.am            | 1 +
1ff636
 src/shared/generator.c | 2 +-
1ff636
 2 files changed, 2 insertions(+), 1 deletion(-)
1ff636
1ff636
diff --git a/Makefile.am b/Makefile.am
1ff636
index d3fb398..a81d3c1 100644
1ff636
--- a/Makefile.am
1ff636
+++ b/Makefile.am
1ff636
@@ -177,6 +177,7 @@ AM_CPPFLAGS = \
1ff636
 	-DCATALOG_DATABASE=\"$(catalogstatedir)/database\" \
1ff636
 	-DSYSTEMD_CGROUP_AGENT_PATH=\"$(rootlibexecdir)/systemd-cgroups-agent\" \
1ff636
 	-DSYSTEMD_BINARY_PATH=\"$(rootlibexecdir)/systemd\" \
1ff636
+	-DSYSTEMD_FSCK_PATH=\"$(rootlibexecdir)/systemd-fsck\" \
1ff636
 	-DSYSTEMD_SHUTDOWN_BINARY_PATH=\"$(rootlibexecdir)/systemd-shutdown\" \
1ff636
 	-DSYSTEMD_SLEEP_BINARY_PATH=\"$(rootlibexecdir)/systemd-sleep\" \
1ff636
 	-DSYSTEMCTL_BINARY_PATH=\"$(rootbindir)/systemctl\" \
1ff636
diff --git a/src/shared/generator.c b/src/shared/generator.c
1ff636
index 148a0b0..3af84a3 100644
1ff636
--- a/src/shared/generator.c
1ff636
+++ b/src/shared/generator.c
1ff636
@@ -61,7 +61,7 @@ static int write_fsck_sysroot_service(const char *dir, const char *what) {
1ff636
                 "[Service]\n"
1ff636
                 "Type=oneshot\n"
1ff636
                 "RemainAfterExit=yes\n"
1ff636
-                "ExecStart=/usr/lib/systemd/systemd-fsck %2$s\n"
1ff636
+                "ExecStart=" SYSTEMD_FSCK_PATH " %2$s\n"
1ff636
                 "TimeoutSec=0\n",
1ff636
                 program_invocation_short_name,
1ff636
                 what,