summaryrefslogtreecommitdiff
path: root/init/do_mounts.c
diff options
context:
space:
mode:
authorChristian Brauner <brauner@kernel.org>2026-01-14 11:22:54 +0100
committerChristian Brauner <brauner@kernel.org>2026-01-14 11:23:39 +0100
commit313c47f4fe4d07eb2969f429a66ad331fe2b3b6f (patch)
treeca0c488cde000bca75e0b8a60647d2fd8b5601f2 /init/do_mounts.c
parent7416634fd6f18762edf60ed8524bc241eceae1f3 (diff)
fs: use nullfs unconditionally as the real rootfs
Remove the "nullfs_rootfs" boot parameter and simply always use nullfs. The mutable rootfs will be mounted on top of it. Systems that don't use pivot_root() to pivot away from the real rootfs will have an additional mount stick around but that shouldn't be a problem at all. If it is we'll rever this commit. This also simplifies the boot process and removes the need for the traditional switch_root workarounds. Suggested-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'init/do_mounts.c')
-rw-r--r--init/do_mounts.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/init/do_mounts.c b/init/do_mounts.c
index 675397c8a7a4..df6847bcf1f2 100644
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -493,21 +493,15 @@ void __init prepare_namespace(void)
out:
devtmpfs_mount();
- if (nullfs_rootfs) {
- if (init_pivot_root(".", ".")) {
- pr_err("VFS: Failed to pivot into new rootfs\n");
- return;
- }
- if (init_umount(".", MNT_DETACH)) {
- pr_err("VFS: Failed to unmount old rootfs\n");
- return;
- }
- pr_info("VFS: Pivoted into new rootfs\n");
+ if (init_pivot_root(".", ".")) {
+ pr_err("VFS: Failed to pivot into new rootfs\n");
return;
}
-
- init_mount(".", "/", NULL, MS_MOVE, NULL);
- init_chroot(".");
+ if (init_umount(".", MNT_DETACH)) {
+ pr_err("VFS: Failed to unmount old rootfs\n");
+ return;
+ }
+ pr_info("VFS: Pivoted into new rootfs\n");
}
static bool is_tmpfs;