summaryrefslogtreecommitdiff
path: root/modules.d/98systemd/dracut-pre-pivot.sh
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2013-03-06 16:19:29 +0100
committerHarald Hoyer <harald@redhat.com>2013-03-06 17:21:47 +0100
commitdbfaae0e34507d2d1f3c186ffe26af3e8028b9f8 (patch)
tree500c6135cee89c6246104ea3f34c03c9e4dd95af /modules.d/98systemd/dracut-pre-pivot.sh
parent8d85429a4468df322b1507209cded7f70f7da4dd (diff)
downloaddracut-dbfaae0e34507d2d1f3c186ffe26af3e8028b9f8.tar.gz
dracut-dbfaae0e34507d2d1f3c186ffe26af3e8028b9f8.tar.bz2
dracut-dbfaae0e34507d2d1f3c186ffe26af3e8028b9f8.zip
systemd: changes for new initrd services
Requires systemd >= 198
Diffstat (limited to 'modules.d/98systemd/dracut-pre-pivot.sh')
-rwxr-xr-xmodules.d/98systemd/dracut-pre-pivot.sh18
1 files changed, 2 insertions, 16 deletions
diff --git a/modules.d/98systemd/dracut-pre-pivot.sh b/modules.d/98systemd/dracut-pre-pivot.sh
index 0c259b1b..5d47ce21 100755
--- a/modules.d/98systemd/dracut-pre-pivot.sh
+++ b/modules.d/98systemd/dracut-pre-pivot.sh
@@ -20,25 +20,11 @@ source_hook pre-pivot
getarg 'rd.break=cleanup' 'rdbreak=cleanup' && emergency_shell -n cleanup "Break cleanup"
source_hook cleanup
-# By the time we get here, the root filesystem should be mounted.
-# Try to find init.
-
-for i in "$(getarg real_init=)" "$(getarg init=)"; do
- [ -n "$i" ] || continue
-
- __p=$(readlink -f "${NEWROOT}/${i}")
- if [ -x "$__p" ]; then
- INIT="$i"
- echo "NEWINIT=\"$INIT\"" > /etc/switch-root.conf
- break
- fi
-done
-
-echo "NEWROOT=\"$NEWROOT\"" >> /etc/switch-root.conf
-
getarg rd.break -d rdbreak && emergency_shell -n switch_root "Break before switch_root"
# remove helper symlink
[ -h /dev/root ] && rm -f /dev/root
+service="${0##*/}"
+cp "/etc/systemd/system/${service%.sh}.service" /run/systemd/system/
exit 0