mirror of
https://github.com/dracutdevs/dracut.git
synced 2024-10-27 17:55:47 +03:00
systemd: store switch-root.conf in /run/initramfs
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.
This commit is contained in:
parent
41153ca4f2
commit
38111b9622
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user