Switch Metropolis to EROFS-based root filesystem
This gets rid of the old large initramfs and switches to an EROFS-based root
filesystem. It also drops the copy & remount compatibility code. As this filesystem is
properly read-only and not just ephemeral, this also brings various changes to the code
to make systems compatible with that.
Test Plan: Covered by E2E tests, also manually smoke-tested.
X-Origin-Diff: phab/D696
GitOrigin-RevId: 037f2b8253e7cff8435cc79771fad05f53670ff0
diff --git a/metropolis/node/core/main.go b/metropolis/node/core/main.go
index e72c8b5..3cf75ce 100644
--- a/metropolis/node/core/main.go
+++ b/metropolis/node/core/main.go
@@ -92,10 +92,10 @@
// Initial logger. Used until we get to a supervisor.
logger := lt.MustLeveledFor("init")
- // Remount onto a tmpfs and re-exec if needed. Otherwise, keep running.
- err = switchRoot(logger)
+ // Set up basic mounts
+ err = setupMounts(logger)
if err != nil {
- panic(fmt.Errorf("could not remount root: %w", err))
+ panic(fmt.Errorf("could not set up basic mounts: %w", err))
}
// Linux kernel default is 4096 which is far too low. Raise it to 1M which is what gVisor suggests.
@@ -170,7 +170,7 @@
// we should be running.
node := m.Node()
- if err := node.ConfigureLocalHostname(&root.Etc); err != nil {
+ if err := node.ConfigureLocalHostname(&root.Ephemeral); err != nil {
close(trapdoor)
return fmt.Errorf("failed to set local hostname: %w", err)
}