shutdown: don't pivot to /run/initramfs if already there
This allows systemd-shutdown to be installed as /run/initramfs/shutdown and take care of the proper teardown of the rootfs.
This commit is contained in:
parent
8050c22151
commit
02eaa78835
|
@ -263,7 +263,7 @@ int main(int argc, char *argv[]) {
|
|||
arguments[2] = NULL;
|
||||
execute_directory(SYSTEM_SHUTDOWN_PATH, NULL, arguments);
|
||||
|
||||
if (!in_container &&
|
||||
if (!in_container && !in_initrd() &&
|
||||
access("/run/initramfs/shutdown", X_OK) == 0) {
|
||||
|
||||
if (prepare_new_root() >= 0 &&
|
||||
|
|
Loading…
Reference in New Issue