diff options
| -rwxr-xr-x | builder/dnbd3-rootfs/hooks/copy-dracut-systemd-files-into-newroot.sh | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/builder/dnbd3-rootfs/hooks/copy-dracut-systemd-files-into-newroot.sh b/builder/dnbd3-rootfs/hooks/copy-dracut-systemd-files-into-newroot.sh index 16d85835..f0e54d4c 100755 --- a/builder/dnbd3-rootfs/hooks/copy-dracut-systemd-files-into-newroot.sh +++ b/builder/dnbd3-rootfs/hooks/copy-dracut-systemd-files-into-newroot.sh @@ -42,9 +42,11 @@ for file in \ do cp "${systemd_system_unit_path}/${file}" \ "${new_systemd_system_unit_path}/${file}" - # ln returns an error if the link already exists - ln --symbolic "../${file}" \ - "${new_systemd_system_unit_path}/initrd.target.wants/${file}" + # "ln" returns an error if the link already exists. + source_path="../${file}" + target_path="${new_systemd_system_unit_path}/initrd.target.wants/${file}" + ln --symbolic "$source_path" "$targetPath" &>/dev/null || \ + logging.warn "Failed to link \"$source_path\" to \"$target_path\"." done } exceptions.catch |
