diff options
author | Jonathan Bauer | 2021-04-07 15:16:29 +0200 |
---|---|---|
committer | Jonathan Bauer | 2021-04-07 15:16:29 +0200 |
commit | 949849b9ac61976199fe224db6f035956863102a (patch) | |
tree | 1651995404ee7002a80a1a0943b97d4791083b6e | |
parent | [slx-dmsetup] reintroduce linear 1:1 mapping of scratch device (diff) | |
download | systemd-init-949849b9ac61976199fe224db6f035956863102a.tar.gz systemd-init-949849b9ac61976199fe224db6f035956863102a.tar.xz systemd-init-949849b9ac61976199fe224db6f035956863102a.zip |
[dnbd3-rootfs] copy dnbd3-client over to stage4
-rwxr-xr-x | modules.d/dnbd3-rootfs/hooks/copy-dnbd3-files-into-newroot.sh (renamed from modules.d/dnbd3-rootfs/hooks/copy-dnbd3-service-into-newroot.sh) | 11 | ||||
-rwxr-xr-x | modules.d/dnbd3-rootfs/module-setup.sh | 2 |
2 files changed, 11 insertions, 2 deletions
diff --git a/modules.d/dnbd3-rootfs/hooks/copy-dnbd3-service-into-newroot.sh b/modules.d/dnbd3-rootfs/hooks/copy-dnbd3-files-into-newroot.sh index ddfe4992..2ff8664f 100755 --- a/modules.d/dnbd3-rootfs/hooks/copy-dnbd3-service-into-newroot.sh +++ b/modules.d/dnbd3-rootfs/hooks/copy-dnbd3-files-into-newroot.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # -*- coding: utf-8 -*- -type emergency_shell >/dev/null 2>&1 || source /lib/dracut-lib.sh +# copy dnbd3root.service to NEWROOT to ensure it stays known to systemd systemd_system_unit_path="$(dirname \ "$(systemctl show -p FragmentPath dracut-mount.service | cut -c 14-)")" new_systemd_system_unit_path="${NEWROOT}/lib/systemd/system" @@ -10,3 +10,12 @@ cp "${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" + +# copy dnbd3-client binary to NEWROOT to make sure it is compatible with the +# kernel module +dnbd3_client_path="$(type -p dnbd3-client)" +if [ -n "$dnbd3_client_path" ]; then + mkdir -p "${NEWROOT}/${dnbd3_client_path%/*}" + cp "$dnbd3_client_path" "${NEWROOT}/${dnbd3_client_path}" +fi +true diff --git a/modules.d/dnbd3-rootfs/module-setup.sh b/modules.d/dnbd3-rootfs/module-setup.sh index c23eed26..866c086a 100755 --- a/modules.d/dnbd3-rootfs/module-setup.sh +++ b/modules.d/dnbd3-rootfs/module-setup.sh @@ -169,7 +169,7 @@ install() { # Copy systemd services to new root (so they don't get killed after # switch_root) inst_hook pre-pivot 00 \ - "$moddir/hooks/copy-dnbd3-service-into-newroot.sh" + "$moddir/hooks/copy-dnbd3-files-into-newroot.sh" inst_hook pre-pivot 00 \ "$moddir/hooks/copy-dracut-systemd-files-into-newroot.sh" inst_hook pre-shutdown 00 "$moddir/hooks/shutdown-umount.sh" |