diff options
author | Jonathan Bauer | 2018-11-12 12:45:13 +0100 |
---|---|---|
committer | Jonathan Bauer | 2018-11-12 17:30:33 +0100 |
commit | 516f9c1dd65703a552960ca0e720ca5d99fb249d (patch) | |
tree | 1f9b409d9cd8f001936f7a91038a3a863359e178 | |
parent | [dnbd3-rfs] hardcode config path to avoid issues (diff) | |
download | systemd-init-516f9c1dd65703a552960ca0e720ca5d99fb249d.tar.gz systemd-init-516f9c1dd65703a552960ca0e720ca5d99fb249d.tar.xz systemd-init-516f9c1dd65703a552960ca0e720ca5d99fb249d.zip |
[dnbd3-rfs] better detection of 'dracut-mount.service' location
-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" |