diff options
| author | jandob | 2016-02-29 17:08:56 +0100 |
|---|---|---|
| committer | jandob | 2016-02-29 17:08:56 +0100 |
| commit | 2e45215a6f2bbc4293cfde594d593501f4d2b6f5 (patch) | |
| tree | b98aa92cba7ee35e17d63cc0851ad9025fbd4fa7 /builder/dnbd3-rootfs | |
| parent | expect systemd installation under /lib instead of /usr/lib (diff) | |
| download | systemd-init-2e45215a6f2bbc4293cfde594d593501f4d2b6f5.tar.gz systemd-init-2e45215a6f2bbc4293cfde594d593501f4d2b6f5.tar.xz systemd-init-2e45215a6f2bbc4293cfde594d593501f4d2b6f5.zip | |
fix systemd paths in new root
Diffstat (limited to 'builder/dnbd3-rootfs')
| -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. |
