From 516f9c1dd65703a552960ca0e720ca5d99fb249d Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Mon, 12 Nov 2018 12:45:13 +0100 Subject: [dnbd3-rfs] better detection of 'dracut-mount.service' location --- .../dnbd3-rootfs/hooks/copy-dracut-systemd-files-into-newroot.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/builder/modules.d/dnbd3-rootfs/hooks/copy-dracut-systemd-files-into-newroot.sh b/builder/modules.d/dnbd3-rootfs/hooks/copy-dracut-systemd-files-into-newroot.sh index a887d8c9..c722e734 100755 --- a/builder/modules.d/dnbd3-rootfs/hooks/copy-dracut-systemd-files-into-newroot.sh +++ b/builder/modules.d/dnbd3-rootfs/hooks/copy-dracut-systemd-files-into-newroot.sh @@ -29,8 +29,9 @@ exceptions.catch exceptions.try { # Dracut may not be installed on the new root. Thus copy all services over. -systemd_system_unit_path="$(dirname "$(find / -name dracut-mount.service \ - -type f -print -quit)")" +dracut_mount_unit_path="$(systemctl show -p FragmentPath dracut-mount.service \ + | cut -c 14-)" +systemd_system_unit_path="${dracut_mount_unit_path%/*}" new_systemd_system_unit_path="${NEWROOT}/lib/systemd/system" mkdir --parents "$new_systemd_system_unit_path/initrd.target.wants" -- cgit v1.2.3-55-g7522