How to migrate from devfs to udev

From ArticleWorld


Although udev has been the de-facto standard for more than one year now, some distributions are still late upgrading. This happens mostly because of some extra hassle involved, especially when trying to get some old, devfs-dependent software to work. Nevertheless, with udev being the most common choice today due to its facilities, you should have very strong reasons not to migrate to it.

It is beyond the scope of this guide to deeply explain why you should migrate. There is a lot of documentation available on the Internet, enough to make you an idea of whether you should do it or not. If you decide to do it, follow the steps below.

Procedure

1. Check the prerequisites in your kernel. You should make sure that you have at least a 2.6.0 kernel. Your kernel needs sysfs support and devfs automount should be disabled. If any of these is not met, you will have to re-compile your kernel. You should also use hotplug.

2. Make sure hotplug is ran at boot time. Most distributions do this, but if yours does not, you will have to consult your distribution's documentation for details on how to enable it.

3. Install the udev packages. Your distribution may offer them even if it does not come with udev installed by default. If not, you should get udev from kernel.org and compile it from sources.

4. Open the file /sbin/rc (or your equivalent rc file in your distribution) and find the line:

try tar -jxpf /lib/udev-state/devices.tar.bz2 -C /dev

Comment it, by adding a '#' character before it.

5. Make sure that the files /dev/console and /dev/null exist. If they are not available, run the following commands as root:

cd /dev
 mknod -m 660 console c 5 1
 mknod -m 660 null c 1 3

Notes

If your X server does not run complaining about not finding any mice, open /etc/X11/xorg.conf in your favorite text editor and find what device does it expect to find the mouse under. Either symlink it to /dev/input/mice, /dev/input/mouse0 or /dev/misc/psaux, whichever you have, or modify it accordingly.