]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
systemd: store switch-root.conf in /run/initramfs
authorHarald Hoyer <harald@redhat.com>
Wed, 16 May 2012 09:24:42 +0000 (11:24 +0200)
committerHarald Hoyer <harald@redhat.com>
Wed, 16 May 2012 09:24:42 +0000 (11:24 +0200)
Store switch-root.conf in /run/initramfs/switch-root.conf, so that the
service does not fail in ExecPost after switching to the real root.

modules.d/98systemd/dracut-pre-pivot.sh
modules.d/98systemd/switch-root.service

index 272b293a40a2fff0be942a6b608ce754f3c93153..a8e9fc13d043efdd67940b1905b08eb28d0e58a8 100755 (executable)
@@ -27,12 +27,12 @@ for i in "$(getarg real_init=)" "$(getarg init=)"; do
     __p=$(readlink -f "${NEWROOT}/${i}")
     if [ -x "$__p" ]; then
         INIT="$i"
-        echo "NEWINIT=\"$INIT\"" > /etc/switch-root.conf
+        echo "NEWINIT=\"$INIT\"" > /run/initramfs/switch-root.conf
         break
     fi
 done
 
-echo "NEWROOT=\"$NEWROOT\"" >> /etc/switch-root.conf
+echo "NEWROOT=\"$NEWROOT\"" >> /run/initramfs/switch-root.conf
 
 udevadm control --stop-exec-queue
 systemctl stop systemd-udev.service
index 0c41eb0c9bf3d5f2c784a8f64baa5dbf21175d09..2abfc909a244a0dcb2176029b88ebaac2c72d0c9 100644 (file)
@@ -11,6 +11,6 @@ DefaultDependencies=no
 
 [Service]
 Type=oneshot
-EnvironmentFile=/etc/switch-root.conf
+EnvironmentFile=/run/initramfs/switch-root.conf
 ExecStart=/usr/bin/systemctl --force switch-root ${NEWROOT} ${NEWINIT}
 ExecStopPost=-/usr/bin/systemctl isolate default.target