summaryrefslogtreecommitdiff
path: root/src/nspawn
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2014-06-24 13:30:11 +0200
committerKay Sievers <kay@vrfy.org>2014-06-24 15:41:03 +0200
commit3577de7ac39c54821e1d1d946db65e109dfb94b2 (patch)
tree2bfdabbd233a5b1ce3685a033cde65e5d412f01e /src/nspawn
parent96e264415033ef9b07c062850aed4cac316f20b8 (diff)
nspawn: create essential base directories at system bootup
This allows us to bootup a rootfs with a /usr directory only.
Diffstat (limited to 'src/nspawn')
-rw-r--r--src/nspawn/nspawn.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index 212f7223bb..501bccae87 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -89,6 +89,7 @@
#include "gpt.h"
#include "siphash24.h"
#include "copy.h"
+#include "base-filesystem.h"
#ifdef HAVE_SECCOMP
#include "seccomp-util.h"
@@ -3008,6 +3009,12 @@ int main(int argc, char *argv[]) {
srv_device, srv_device_rw) < 0)
goto child_fail;
+ r = base_filesystem_create(arg_directory);
+ if (r < 0) {
+ log_error("creating base filesystem failed: %s", strerror(-r));
+ goto child_fail;
+ }
+
/* Turn directory into bind mount */
if (mount(arg_directory, arg_directory, "bind", MS_BIND|MS_REC, NULL) < 0) {
log_error("Failed to make bind mount: %m");