diff options
Diffstat (limited to 'modules.d/dnbd3-rootfs/hooks/copy-dnbd3-service-into-newroot.sh')
-rwxr-xr-x | modules.d/dnbd3-rootfs/hooks/copy-dnbd3-service-into-newroot.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/modules.d/dnbd3-rootfs/hooks/copy-dnbd3-service-into-newroot.sh b/modules.d/dnbd3-rootfs/hooks/copy-dnbd3-service-into-newroot.sh new file mode 100755 index 00000000..ddfe4992 --- /dev/null +++ b/modules.d/dnbd3-rootfs/hooks/copy-dnbd3-service-into-newroot.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +# -*- coding: utf-8 -*- +type emergency_shell >/dev/null 2>&1 || source /lib/dracut-lib.sh + +systemd_system_unit_path="$(dirname \ + "$(systemctl show -p FragmentPath dracut-mount.service | cut -c 14-)")" +new_systemd_system_unit_path="${NEWROOT}/lib/systemd/system" +cp "${systemd_system_unit_path}/dnbd3root.service" \ + "${new_systemd_system_unit_path}/dnbd3root.service" +mkdir --parents "${new_systemd_system_unit_path}/sysinit.target.wants" +ln --symbolic '../dnbd3root.service' \ + "${new_systemd_system_unit_path}/sysinit.target.wants/dnbd3root.service" |