diff options
| -rw-r--r-- | builder/dnbd3-rootfs/hooks/copy-dnbd3-service-into-newroot.sh | 17 | ||||
| -rw-r--r-- | builder/dnbd3-rootfs/hooks/copy-dracut-systemd-files-into-newroot.sh | 8 |
2 files changed, 14 insertions, 11 deletions
diff --git a/builder/dnbd3-rootfs/hooks/copy-dnbd3-service-into-newroot.sh b/builder/dnbd3-rootfs/hooks/copy-dnbd3-service-into-newroot.sh index 6fa6510d..1fb8429a 100644 --- a/builder/dnbd3-rootfs/hooks/copy-dnbd3-service-into-newroot.sh +++ b/builder/dnbd3-rootfs/hooks/copy-dnbd3-service-into-newroot.sh @@ -1,9 +1,10 @@ -#mkdir --parents "${NEWROOT}/run/systemd/system-generators/" -#cp "/usr/lib/systemd/system-generators/dnbd3-generator" "${NEWROOT}/run/systemd/system-generators/" -systemddir="/lib/systemd" -newsystemddir="${NEWROOT}/lib/systemd" -mkdir -p ${newsystemddir}/system/sysinit.target.wants -cp ${systemddir}/system/dnbd3root.service \ - ${newsystemddir}/system/dnbd3root.service +#!/usr/bin/env bash +systemdsystemunitdir="$( + dirname "$(find / -name dracut-mount.service -type f -print -quit)")" +newsystemdsystemunitdir="${NEWROOT}lib/systemd" + +cp "${systemdsystemunitdir}/dnbd3root.service" \ + "${newsystemdsystemunitdir}/dnbd3root.service" +mkdir -p "${newsystemdsystemunitdir}/sysinit.target.wants" ln -s ../dnbd3root.service \ - ${newsystemddir}/system/sysinit.target.wants/dnbd3root.service + "${newsystemdsystemunitdir}/sysinit.target.wants/dnbd3root.service" 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 fa78efb1..27ec97f9 100644 --- a/builder/dnbd3-rootfs/hooks/copy-dracut-systemd-files-into-newroot.sh +++ b/builder/dnbd3-rootfs/hooks/copy-dracut-systemd-files-into-newroot.sh @@ -2,7 +2,9 @@ # Dracut may not be installed on the new root. Thus copy all services over. systemdsystemunitdir="$( dirname "$(find / -name dracut-mount.service -type f -print -quit)")" -mkdir --parents "${NEWROOT}/${systemdsystemunitdir}" +newsystemdsystemunitdir="${NEWROOT}lib/systemd" + +mkdir --parents "$newsystemdsystemunitdir" for file in \ dracut-cmdline.service \ dracut-initqueue.service \ @@ -12,9 +14,9 @@ for file in \ dracut-pre-trigger.service \ dracut-pre-udev.service; do cp "${systemdsystemunitdir}/$file" \ - "${NEWROOT}lib/systemd/system/$file" + "${newsystemdsystemunitdir}/$file" ln -s ../"$file" \ - "${NEWROOT}lib/systemd/system/initrd.target.wants/$file" + "${newsystemdsystemunitdir}/initrd.target.wants/$file" done # Needed to be able to go back to dracut at system shutdown. |
