|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
From 8051be0e4a82590a76e2d76662a57ca624ddc89c Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
From: Lennart Poettering <lennart@poettering.net>
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
Date: Thu, 6 Nov 2014 20:00:01 +0100
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
Subject: [PATCH] switch-root: explain why we don't care about
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
base_filesystem_create() failing
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
(cherry picked from commit 64e18fd626838c3500e28b4dbf86ed62206fff47)
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
src/shared/switch-root.c | 5 +++++
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
1 file changed, 5 insertions(+)
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
diff --git a/src/shared/switch-root.c b/src/shared/switch-root.c
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
index 1a558b897b..3adb8463c5 100644
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
--- a/src/shared/switch-root.c
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
+++ b/src/shared/switch-root.c
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
@@ -102,6 +102,11 @@ int switch_root(const char *new_root, const char *oldroot, bool detach_oldroot,
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
}
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
}
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
+ /* Do not fail, if base_filesystem_create() fails. Not all
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
+ * switch roots are like base_filesystem_create() wants them
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
+ * to look like. They might even boot, if they are RO and
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
+ * don't have the FS layout. Just ignore the error and
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
+ * switch_root() nevertheless. */
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
(void) base_filesystem_create(new_root);
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
|
|
Zbigniew Jędrzejewski-Szmek |
ea1976 |
if (chdir(new_root) < 0) {
|