Re: [patch 00/13] devtmpfs patches

From: Eric W. Biederman
Date: Mon May 11 2009 - 12:40:49 EST


Kay Sievers <kay.sievers@xxxxxxxx> writes:

> Maybe you should just give it a try, apply the patch, and bring it up
> on a box with init=/bin/sh, look at /dev, load some modules and look
> at /dev again - and see the beauty. I'm pretty sure, when you've seen
> it for real, you never want to go back to static nodes or whatever
> other bad hacks to bootstrap /dev.

After it sunk in what you had said I had to go look at your patch.
You do magically and backwards incompatibly mount on top of /dev.

That part does not work, and who knows what static /dev setup you break.

The goal for kernel compile options is that they do not affect the
kernels behavior. The behavior in devmtmpfs clearly does not match
that rule. The kernel acts very different with it compiled in
and with it not compiled in. So that section of the code deserves.

Nacked-by: "Eric W. Biederman" <ebiederm@xxxxxxxxxxxx>

+/* After the root filesystem is mounted by the kernel at /root, or the
+ * initramfs in extracted at /root, this tmpfs will be mounted at /root/dev.
+ */
+int devtmpfs_mount(const char *mountpoint)
+{
+ struct path path;
+ int err;
+
+ if (!dev_mnt)
+ return 0;
+
+ err = kern_path(mountpoint, LOOKUP_FOLLOW, &path);
+ if (err)
+ return err;
+ err = do_add_mount(dev_mnt, &path, 0, NULL);
+ if (err)
+ printk(KERN_INFO "devtmpfs: error mounting %i\n", err);
+ else
+ printk(KERN_INFO "devtmpfs: mounted\n");
+ path_put(&path);
+ return err;
+}
+

--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -414,7 +414,7 @@ void __init prepare_namespace(void)

mount_root();
out:
+ devtmpfs_mount("dev");
sys_mount(".", "/", NULL, MS_MOVE, NULL);
sys_chroot(".");
}
-
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/