diff options
| -rwxr-xr-x | builder/modules.d/dnbd3-rootfs/hooks/copy-dracut-systemd-files-into-newroot.sh | 5 |
1 files 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" |
