From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kay Sievers Subject: devtmpfs: kernel maintained /dev and initramfs Date: Fri, 15 May 2009 15:20:36 +0200 Message-ID: <1242393636.3108.37.camel@poy> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: Sender: initramfs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii" To: initramfs Just for your information, as it *might* make things a bit simpler in the future. I'm currently working on a kernel-maintained tmpfs-based /dev filesystem: http://git.kernel.org/?p=linux/kernel/git/kay/patches.git;a=blob;f=driver-core-devtmpfs-driver-core-maintained-dev-tmpfs.patch;hb=HEAD It would de-couple the rather complex userspace logic from a minimal working /dev, and lets current udev work on top of the kernel provided nodes, instead of being a hard requirement to have anything useful in /dev. It is intended to make things more robust and lets init=/bin/sh work with a fully populated and working /dev. The kernel will provide us a device node for every kernel device currently registered, udev would apply the policy like mode, ownership, and possibly create a different node, or delete the kernel-created one if told to do. It makes the initramfs logic much simpler and does not need a full coldplug run to bootstrap /dev. If kernel device names are used, udev does not even need to be started, and we can go straight ahead. A simple and minimal example initramfs "init", to show what's needed is below. Cheers, Kay #!/bin/sh # minimal initramfs with persistent device name support # requires devtmpfs support provided by the kernel shell() { echo "initramfs: dropping to shell" exec >/dev/console 2>&1 /dev/kmsg 2>&1 /dev/null 2>&1 fi # move filesystems over to the mounted root mount --move /dev /root/dev mount --move /proc /root/proc mount --move /sys /root/sys # move into root cd /root init=$(getarg init=) test -z "$init" && init=/sbin/init echo "initramfs: switching to root filesystem $root and start $init" exec run-init -c /dev/console /root $init -- To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html