From 9c65c125a919756844fdec0a44d3a80b14ef36ae Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 21 Feb 2013 12:18:21 +0100 Subject: [PATCH] systemd: change path of switch-root.conf we do not have to clean it up for /etc/switch-root.conf --- modules.d/98systemd/dracut-pre-pivot.sh | 4 ++-- modules.d/98systemd/initrd-switch-root.service | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/modules.d/98systemd/dracut-pre-pivot.sh b/modules.d/98systemd/dracut-pre-pivot.sh index f27d2204..0c259b1b 100755 --- a/modules.d/98systemd/dracut-pre-pivot.sh +++ b/modules.d/98systemd/dracut-pre-pivot.sh @@ -29,12 +29,12 @@ for i in "$(getarg real_init=)" "$(getarg init=)"; do __p=$(readlink -f "${NEWROOT}/${i}") if [ -x "$__p" ]; then INIT="$i" - echo "NEWINIT=\"$INIT\"" > /run/initramfs/switch-root.conf + echo "NEWINIT=\"$INIT\"" > /etc/switch-root.conf break fi done -echo "NEWROOT=\"$NEWROOT\"" >> /run/initramfs/switch-root.conf +echo "NEWROOT=\"$NEWROOT\"" >> /etc/switch-root.conf getarg rd.break -d rdbreak && emergency_shell -n switch_root "Break before switch_root" diff --git a/modules.d/98systemd/initrd-switch-root.service b/modules.d/98systemd/initrd-switch-root.service index bd9fb317..e263980a 100644 --- a/modules.d/98systemd/initrd-switch-root.service +++ b/modules.d/98systemd/initrd-switch-root.service @@ -16,10 +16,9 @@ AllowIsolate=yes [Service] Type=oneshot -EnvironmentFile=/run/initramfs/switch-root.conf +EnvironmentFile=/etc/switch-root.conf # we have to use "--force" here, otherwise systemd would umount /run ExecStart=-/usr/bin/systemctl --no-block --force switch-root ${NEWROOT} ${NEWINIT} -ExecStopPost=-/bin/rm -f /run/initramfs/switch-root.conf StandardInput=null StandardOutput=null StandardError=null