Blob Blame History Raw
From 3a04bddeed15c810865aa49a2575bf13e651272d Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Mon, 1 Dec 2014 12:34:54 +0100
Subject: [PATCH] dracut.sh: add $tmpfilesdir to install files to
 /usr/lib/tmpfiles.d

---
 dracut.sh | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/dracut.sh b/dracut.sh
index 4590f79..2357987 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -1226,6 +1226,14 @@ fi
 
 [[ -d "$systemdsystemconfdir" ]] || systemdsystemconfdir=/etc/systemd/system
 
+[[ -d $tmpfilesdir ]] \
+    || tmpfilesdir=$(pkg-config systemd --variable=tmpfilesdir 2>/dev/null)
+
+if ! [[ -d "$tmpfilesdir" ]]; then
+    [[ -f /lib/tmpfiles.d ]] && tmpfilesdir=/lib/tmpfiles.d
+    [[ -f /usr/lib/tmpfiles.d ]] && tmpfilesdir=/usr/lib/tmpfiles.d
+fi
+
 export initdir dracutbasedir \
     dracutmodules force_add_dracutmodules add_dracutmodules omit_dracutmodules \
     mods_to_load \
@@ -1236,7 +1244,8 @@ export initdir dracutbasedir \
     debug host_fs_types host_devs sshkey add_fstab \
     DRACUT_VERSION udevdir prefix filesystems drivers \
     systemdutildir systemdsystemunitdir systemdsystemconfdir \
-    host_modalias host_modules hostonly_cmdline loginstall
+    host_modalias host_modules hostonly_cmdline loginstall \
+    tmpfilesdir
 
 mods_to_load=""
 # check all our modules to see if they should be sourced.