chiark / gitweb /
[PATCH] add HOWTO detailing how to use udev to manage /dev
[elogind.git] / HOWTO-udev_for_dev
1 HOWTO use udev to manage /dev
2
3   This document describes one way to get udev working on a Fedora-development
4   machine to manage /dev.  This procedure may be used to get udev to manage
5   /dev on other distros, if you modify some of the steps.
6   
7   This will only work if you use a 2.6 based kernel, preferably the most
8   recent one.  This does not prevent your machine from using a 2.4
9   kernel, if you boot into one, udev will not run and your old /dev will
10   be present with no changes needed.
11
12
13 NOTE NOTE NOTE NOTE NOTE NOTE NOTE
14   This is completely unsupported.  Attempting to do this may cause your
15   machine to be unable to boot properly.  USE AT YOUR OWN RISK.  Always
16   have a rescue disk or CD handy to allow you to fix up any errors that
17   may occur.
18 NOTE NOTE NOTE NOTE NOTE NOTE NOTE
19
20
21  - Build and install udev as specified in the README that comes with
22    udev.  I recommend using the following build options to get the
23    smallest possible binaries:
24         make USE_KLIBC=true USE_LOG=false DEBUG=false
25
26  - disable udev from the boot process by running:
27         chkconfig udev off
28    or
29         chkconfig --del udev
30    as root.
31
32  - place the start_udev script somewhere that is accessible by your
33    initscripts.  I placed it into /etc/rc.d with the following command:
34         copy extras/start_udev /etc/rc.d/
35         
36  - modify the rc.sysinit script to call the start_udev script as one of
37    the first things that it does, but after /proc and /sys are mounted.
38    I did this with the latest Fedora startup scripts with the patch at
39    the end of this file.
40
41  - reboot into a 2.6 kernel and watch udev create all of the initial
42    device nodes in /dev
43
44
45 If anyone has any problems with this, please let me, and the
46 linux-hotplug-devel@lists.sourceforge.net mailing list know.
47
48 A big thanks go out to the Gentoo developers for showing me that this is
49 possible to do.
50
51 Greg Kroah-Hartman
52 <greg@kroah.com>
53
54
55 ----------------------------------
56 Patch to modify rc.sysinit to call udev at the beginning of the boot
57 process:
58
59
60 --- /etc/rc.sysinit.orig        2004-02-17 11:45:17.000000000 -0800
61 +++ /etc/rc.sysinit     2004-02-17 13:28:33.000000000 -0800
62 @@ -32,6 +32,9 @@
63  
64  . /etc/init.d/functions
65  
66 +# start udev to populate /dev
67 +/etc/rc.d/start_udev
68 +
69  if [ "$HOSTTYPE" != "s390" -a "$HOSTTYPE" != "s390x" ]; then
70    last=0
71    for i in `LC_ALL=C grep '^[0-9].*respawn:/sbin/mingetty' /etc/inittab | sed 's/^.* tty\([0-9][0-9]*\).*/\1/g'`; do
72
73