init: remount to tmpfs
runsc needs to be able to pivot_root. According to @lorenz this does not
work from initramfs. This introduces a temporary fix to re-mount and
re-exec into a new root based on tmpfs.
A proper fix would be to use a real filesystem instead of initramfs
(like squashfs), but this will do for now.
We also use this opportunity to use devtmpfs instead of manually
managing /dev. This collides with the storage manager that tries to
create all storage nodes - we just remove that.
Test Plan: shouldn't change behaviour
X-Origin-Diff: phab/D433
GitOrigin-RevId: aa59fec6551bab1b1b9c2fe037dce410e550981b
diff --git a/core/cmd/init/BUILD.bazel b/core/cmd/init/BUILD.bazel
index e8e55dc..0765538 100644
--- a/core/cmd/init/BUILD.bazel
+++ b/core/cmd/init/BUILD.bazel
@@ -2,7 +2,10 @@
go_library(
name = "go_default_library",
- srcs = ["main.go"],
+ srcs = [
+ "main.go",
+ "switchroot.go",
+ ],
importpath = "git.monogon.dev/source/nexantic.git/core/cmd/init",
visibility = ["//visibility:private"],
deps = [