aff55a98acb3de08ed23d0349e8c7bd7c98637ee
[openwrt/svn-archive/archive.git] / target / linux / generic-2.6 / patches / 000-reinstate-devfs.patch
1 diff -urN linux-2.6.19.old/arch/cris/arch-v10/kernel/debugport.c linux-2.6.19.dev/arch/cris/arch-v10/kernel/debugport.c
2 --- linux-2.6.19.old/arch/cris/arch-v10/kernel/debugport.c 2006-11-29 22:57:37.000000000 +0100
3 +++ linux-2.6.19.dev/arch/cris/arch-v10/kernel/debugport.c 2006-12-14 03:12:59.000000000 +0100
4 @@ -540,7 +540,7 @@
5 dummy_driver.init_termios = tty_std_termios;
6 dummy_driver.init_termios.c_cflag =
7 B115200 | CS8 | CREAD | HUPCL | CLOCAL; /* is normally B9600 default... */
8 - dummy_driver.flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV;
9 + dummy_driver.flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_NO_DEVFS;
10
11 dummy_driver.open = dummy_open;
12 dummy_driver.close = dummy_close;
13 diff -urN linux-2.6.19.old/arch/cris/arch-v32/kernel/debugport.c linux-2.6.19.dev/arch/cris/arch-v32/kernel/debugport.c
14 --- linux-2.6.19.old/arch/cris/arch-v32/kernel/debugport.c 2006-11-29 22:57:37.000000000 +0100
15 +++ linux-2.6.19.dev/arch/cris/arch-v32/kernel/debugport.c 2006-12-14 03:12:59.000000000 +0100
16 @@ -352,7 +352,7 @@
17 dummy_driver.init_termios = tty_std_termios;
18 dummy_driver.init_termios.c_cflag =
19 B115200 | CS8 | CREAD | HUPCL | CLOCAL; /* is normally B9600 default... */
20 - dummy_driver.flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV;
21 + dummy_driver.flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_NO_DEVFS;
22
23 dummy_driver.open = dummy_open;
24 dummy_driver.close = dummy_close;
25 diff -urN linux-2.6.19.old/arch/i386/kernel/microcode.c linux-2.6.19.dev/arch/i386/kernel/microcode.c
26 --- linux-2.6.19.old/arch/i386/kernel/microcode.c 2006-11-29 22:57:37.000000000 +0100
27 +++ linux-2.6.19.dev/arch/i386/kernel/microcode.c 2006-12-14 03:12:59.000000000 +0100
28 @@ -460,6 +460,7 @@
29 static struct miscdevice microcode_dev = {
30 .minor = MICROCODE_MINOR,
31 .name = "microcode",
32 + .devfs_name = "cpu/microcode",
33 .fops = &microcode_fops,
34 };
35
36 diff -urN linux-2.6.19.old/arch/ppc/4xx_io/serial_sicc.c linux-2.6.19.dev/arch/ppc/4xx_io/serial_sicc.c
37 --- linux-2.6.19.old/arch/ppc/4xx_io/serial_sicc.c 2006-11-29 22:57:37.000000000 +0100
38 +++ linux-2.6.19.dev/arch/ppc/4xx_io/serial_sicc.c 2006-12-14 03:12:59.000000000 +0100
39 @@ -1757,7 +1757,7 @@
40 siccnormal_driver->subtype = SERIAL_TYPE_NORMAL;
41 siccnormal_driver->init_termios = tty_std_termios;
42 siccnormal_driver->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL;
43 - siccnormal_driver->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV;
44 + siccnormal_driver->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_NO_DEVFS;
45 tty_set_operations(siccnormal_driver, &sicc_ops);
46
47 if (tty_register_driver(siccnormal_driver))
48 diff -urN linux-2.6.19.old/arch/sparc64/solaris/socksys.c linux-2.6.19.dev/arch/sparc64/solaris/socksys.c
49 --- linux-2.6.19.old/arch/sparc64/solaris/socksys.c 2006-11-29 22:57:37.000000000 +0100
50 +++ linux-2.6.19.dev/arch/sparc64/solaris/socksys.c 2006-12-14 03:12:59.000000000 +0100
51 @@ -26,6 +26,7 @@
52 #include <linux/slab.h>
53 #include <linux/syscalls.h>
54 #include <linux/in.h>
55 +#include <linux/devfs_fs_kernel.h>
56
57 #include <net/sock.h>
58
59 @@ -188,6 +189,8 @@
60 return ret;
61 }
62
63 + devfs_mk_cdev(MKDEV(30, 0), S_IFCHR|S_IRUSR|S_IWUSR, "socksys");
64 +
65 file = fcheck(ret);
66 /* N.B. Is this valid? Suppose the f_ops are in a module ... */
67 socksys_file_ops = *file->f_op;
68 @@ -202,4 +205,5 @@
69 {
70 if (unregister_chrdev(30, "socksys"))
71 printk ("Couldn't unregister socksys character device\n");
72 + devfs_remove ("socksys");
73 }
74 diff -urN linux-2.6.19.old/arch/um/drivers/line.c linux-2.6.19.dev/arch/um/drivers/line.c
75 --- linux-2.6.19.old/arch/um/drivers/line.c 2006-11-29 22:57:37.000000000 +0100
76 +++ linux-2.6.19.dev/arch/um/drivers/line.c 2006-12-14 03:12:59.000000000 +0100
77 @@ -8,6 +8,7 @@
78 #include "linux/list.h"
79 #include "linux/kd.h"
80 #include "linux/interrupt.h"
81 +#include "linux/devfs_fs_kernel.h"
82 #include "asm/uaccess.h"
83 #include "chan_kern.h"
84 #include "irq_user.h"
85 @@ -653,6 +654,7 @@
86
87 driver->driver_name = line_driver->name;
88 driver->name = line_driver->device_name;
89 + driver->devfs_name = line_driver->devfs_name;
90 driver->major = line_driver->major;
91 driver->minor_start = line_driver->minor_start;
92 driver->type = line_driver->type;
93 diff -urN linux-2.6.19.old/arch/um/drivers/ssl.c linux-2.6.19.dev/arch/um/drivers/ssl.c
94 --- linux-2.6.19.old/arch/um/drivers/ssl.c 2006-11-29 22:57:37.000000000 +0100
95 +++ linux-2.6.19.dev/arch/um/drivers/ssl.c 2006-12-14 03:12:59.000000000 +0100
96 @@ -53,6 +53,7 @@
97 static struct line_driver driver = {
98 .name = "UML serial line",
99 .device_name = "ttyS",
100 + .devfs_name = "tts/",
101 .major = TTY_MAJOR,
102 .minor_start = 64,
103 .type = TTY_DRIVER_TYPE_SERIAL,
104 diff -urN linux-2.6.19.old/arch/um/drivers/stdio_console.c linux-2.6.19.dev/arch/um/drivers/stdio_console.c
105 --- linux-2.6.19.old/arch/um/drivers/stdio_console.c 2006-11-29 22:57:37.000000000 +0100
106 +++ linux-2.6.19.dev/arch/um/drivers/stdio_console.c 2006-12-14 03:12:59.000000000 +0100
107 @@ -59,6 +59,7 @@
108 static struct line_driver driver = {
109 .name = "UML console",
110 .device_name = "tty",
111 + .devfs_name = "vc/",
112 .major = TTY_MAJOR,
113 .minor_start = 0,
114 .type = TTY_DRIVER_TYPE_CONSOLE,
115 diff -urN linux-2.6.19.old/arch/um/drivers/ubd_kern.c linux-2.6.19.dev/arch/um/drivers/ubd_kern.c
116 --- linux-2.6.19.old/arch/um/drivers/ubd_kern.c 2006-11-29 22:57:37.000000000 +0100
117 +++ linux-2.6.19.dev/arch/um/drivers/ubd_kern.c 2006-12-14 03:12:59.000000000 +0100
118 @@ -24,6 +24,7 @@
119 #include "linux/blkdev.h"
120 #include "linux/hdreg.h"
121 #include "linux/init.h"
122 +#include "linux/devfs_fs_kernel.h"
123 #include "linux/cdrom.h"
124 #include "linux/proc_fs.h"
125 #include "linux/ctype.h"
126 @@ -645,10 +646,14 @@
127 disk->first_minor = unit << UBD_SHIFT;
128 disk->fops = &ubd_blops;
129 set_capacity(disk, size / 512);
130 - if(major == MAJOR_NR)
131 + if(major == MAJOR_NR){
132 sprintf(disk->disk_name, "ubd%c", 'a' + unit);
133 - else
134 + sprintf(disk->devfs_name, "ubd/disc%d", unit);
135 + }
136 + else {
137 sprintf(disk->disk_name, "ubd_fake%d", unit);
138 + sprintf(disk->devfs_name, "ubd_fake/disc%d", unit);
139 + }
140
141 /* sysfs register (not for ide fake devices) */
142 if (major == MAJOR_NR) {
143 @@ -853,6 +864,7 @@
144 {
145 int i;
146
147 + devfs_mk_dir("ubd");
148 if (register_blkdev(MAJOR_NR, "ubd"))
149 return -1;
150
151 @@ -866,6 +878,7 @@
152 char name[sizeof("ubd_nnn\0")];
153
154 snprintf(name, sizeof(name), "ubd_%d", fake_major);
155 + devfs_mk_dir(name);
156 if (register_blkdev(fake_major, "ubd"))
157 return -1;
158 }
159 diff -urN linux-2.6.19.old/arch/um/include/line.h linux-2.6.19.dev/arch/um/include/line.h
160 --- linux-2.6.19.old/arch/um/include/line.h 2006-11-29 22:57:37.000000000 +0100
161 +++ linux-2.6.19.dev/arch/um/include/line.h 2006-12-14 03:12:59.000000000 +0100
162 @@ -17,6 +17,7 @@
163 struct line_driver {
164 char *name;
165 char *device_name;
166 + char *devfs_name;
167 short major;
168 short minor_start;
169 short type;
170 diff -urN linux-2.6.19.old/Documentation/Changes linux-2.6.19.dev/Documentation/Changes
171 --- linux-2.6.19.old/Documentation/Changes 2006-11-29 22:57:37.000000000 +0100
172 +++ linux-2.6.19.dev/Documentation/Changes 2006-12-14 03:12:59.000000000 +0100
173 @@ -180,8 +180,8 @@
174 --------------------
175
176 A driver has been added to allow updating of Intel IA32 microcode,
177 -accessible as a normal (misc) character device. If you are not using
178 -udev you may need to:
179 +accessible as both a devfs regular file and as a normal (misc)
180 +character device. If you are not using devfs you may need to:
181
182 mkdir /dev/cpu
183 mknod /dev/cpu/microcode c 10 184
184 @@ -200,9 +200,7 @@
185 udev
186 ----
187 udev is a userspace application for populating /dev dynamically with
188 -only entries for devices actually present. udev replaces the basic
189 -functionality of devfs, while allowing persistant device naming for
190 -devices.
191 +only entries for devices actually present. udev replaces devfs.
192
193 FUSE
194 ----
195 @@ -232,13 +230,18 @@
196 enable it to operate over diverse media layers. If you use PPP,
197 upgrade pppd to at least 2.4.0.
198
199 -If you are not using udev, you must have the device file /dev/ppp
200 +If you are not using devfs, you must have the device file /dev/ppp
201 which can be made by:
202
203 mknod /dev/ppp c 108 0
204
205 as root.
206
207 +If you use devfsd and build ppp support as modules, you will need
208 +the following in your /etc/devfsd.conf file:
209 +
210 +LOOKUP PPP MODLOAD
211 +
212 Isdn4k-utils
213 ------------
214
215 diff -urN linux-2.6.19.old/Documentation/DocBook/kernel-api.tmpl linux-2.6.19.dev/Documentation/DocBook/kernel-api.tmpl
216 --- linux-2.6.19.old/Documentation/DocBook/kernel-api.tmpl 2006-11-29 22:57:37.000000000 +0100
217 +++ linux-2.6.19.dev/Documentation/DocBook/kernel-api.tmpl 2006-12-14 03:12:59.000000000 +0100
218 @@ -84,6 +84,9 @@
219 !Ekernel/rcupdate.c
220 </sect1>
221
222 + <chapter id="devfs">
223 + <title>The Device File System</title>
224 +!Efs/devfs/base.c
225 </chapter>
226
227 <chapter id="adt">
228 diff -urN linux-2.6.19.old/Documentation/filesystems/devfs/boot-options linux-2.6.19.dev/Documentation/filesystems/devfs/boot-options
229 --- linux-2.6.19.old/Documentation/filesystems/devfs/boot-options 1970-01-01 01:00:00.000000000 +0100
230 +++ linux-2.6.19.dev/Documentation/filesystems/devfs/boot-options 2006-12-14 03:12:59.000000000 +0100
231 @@ -0,0 +1,65 @@
232 +/* -*- auto-fill -*- */
233 +
234 + Device File System (devfs) Boot Options
235 +
236 + Richard Gooch <rgooch@atnf.csiro.au>
237 +
238 + 18-AUG-2001
239 +
240 +
241 +When CONFIG_DEVFS_DEBUG is enabled, you can pass several boot options
242 +to the kernel to debug devfs. The boot options are prefixed by
243 +"devfs=", and are separated by commas. Spaces are not allowed. The
244 +syntax looks like this:
245 +
246 +devfs=<option1>,<option2>,<option3>
247 +
248 +and so on. For example, if you wanted to turn on debugging for module
249 +load requests and device registration, you would do:
250 +
251 +devfs=dmod,dreg
252 +
253 +You may prefix "no" to any option. This will invert the option.
254 +
255 +
256 +Debugging Options
257 +=================
258 +
259 +These requires CONFIG_DEVFS_DEBUG to be enabled.
260 +Note that all debugging options have 'd' as the first character. By
261 +default all options are off. All debugging output is sent to the
262 +kernel logs. The debugging options do not take effect until the devfs
263 +version message appears (just prior to the root filesystem being
264 +mounted).
265 +
266 +These are the options:
267 +
268 +dmod print module load requests to <request_module>
269 +
270 +dreg print device register requests to <devfs_register>
271 +
272 +dunreg print device unregister requests to <devfs_unregister>
273 +
274 +dchange print device change requests to <devfs_set_flags>
275 +
276 +dilookup print inode lookup requests
277 +
278 +diget print VFS inode allocations
279 +
280 +diunlink print inode unlinks
281 +
282 +dichange print inode changes
283 +
284 +dimknod print calls to mknod(2)
285 +
286 +dall some debugging turned on
287 +
288 +
289 +Other Options
290 +=============
291 +
292 +These control the default behaviour of devfs. The options are:
293 +
294 +mount mount devfs onto /dev at boot time
295 +
296 +only disable non-devfs device nodes for devfs-capable drivers
297 diff -urN linux-2.6.19.old/Documentation/filesystems/devfs/ChangeLog linux-2.6.19.dev/Documentation/filesystems/devfs/ChangeLog
298 --- linux-2.6.19.old/Documentation/filesystems/devfs/ChangeLog 1970-01-01 01:00:00.000000000 +0100
299 +++ linux-2.6.19.dev/Documentation/filesystems/devfs/ChangeLog 2006-12-14 03:12:59.000000000 +0100
300 @@ -0,0 +1,1977 @@
301 +/* -*- auto-fill -*- */
302 +===============================================================================
303 +Changes for patch v1
304 +
305 +- creation of devfs
306 +
307 +- modified miscellaneous character devices to support devfs
308 +===============================================================================
309 +Changes for patch v2
310 +
311 +- bug fix with manual inode creation
312 +===============================================================================
313 +Changes for patch v3
314 +
315 +- bugfixes
316 +
317 +- documentation improvements
318 +
319 +- created a couple of scripts (one to save&restore a devfs and the
320 + other to set up compatibility symlinks)
321 +
322 +- devfs support for SCSI discs. New name format is: sd_hHcCiIlL
323 +===============================================================================
324 +Changes for patch v4
325 +
326 +- bugfix for the directory reading code
327 +
328 +- bugfix for compilation with kerneld
329 +
330 +- devfs support for generic hard discs
331 +
332 +- rationalisation of the various watchdog drivers
333 +===============================================================================
334 +Changes for patch v5
335 +
336 +- support for mounting directly from entries in the devfs (it doesn't
337 + need to be mounted to do this), including the root filesystem.
338 + Mounting of swap partitions also works. Hence, now if you set
339 + CONFIG_DEVFS_ONLY to 'Y' then you won't be able to access your discs
340 + via ordinary device nodes. Naturally, the default is 'N' so that you
341 + can still use your old device nodes. If you want to mount from devfs
342 + entries, make sure you use: append = "root=/dev/sd_..." in your
343 + lilo.conf. It seems LILO looks for the device number (major&minor)
344 + and writes that into the kernel image :-(
345 +
346 +- support for character memory devices (/dev/null, /dev/zero, /dev/full
347 + and so on). Thanks to C. Scott Ananian <cananian@alumni.princeton.edu>
348 +===============================================================================
349 +Changes for patch v6
350 +
351 +- support for subdirectories
352 +
353 +- support for symbolic links (created by devfs_mk_symlink(), no
354 + support yet for creation via symlink(2))
355 +
356 +- SCSI disc naming now cast in stone, with the format:
357 + /dev/sd/c0b1t2u3 controller=0, bus=1, ID=2, LUN=3, whole disc
358 + /dev/sd/c0b1t2u3p4 controller=0, bus=1, ID=2, LUN=3, 4th partition
359 +
360 +- loop devices now appear in devfs
361 +
362 +- tty devices, console, serial ports, etc. now appear in devfs
363 + Thanks to C. Scott Ananian <cananian@alumni.princeton.edu>
364 +
365 +- bugs with mounting devfs-only devices now fixed
366 +===============================================================================
367 +Changes for patch v7
368 +
369 +- SCSI CD-ROMS, tapes and generic devices now appear in devfs
370 +===============================================================================
371 +Changes for patch v8
372 +
373 +- bugfix with no-rewind SCSI tapes
374 +
375 +- RAMDISCs now appear in devfs
376 +
377 +- better cleaning up of devfs entries created by various modules
378 +
379 +- interface change to <devfs_register>
380 +===============================================================================
381 +Changes for patch v9
382 +
383 +- the v8 patch was corrupted somehow, which would affect the patch for
384 + linux/fs/filesystems.c
385 + I've also fixed the v8 patch file on the WWW
386 +
387 +- MetaDevices (/dev/md*) should now appear in devfs
388 +===============================================================================
389 +Changes for patch v10
390 +
391 +- bugfix in meta device support for devfs
392 +
393 +- created this ChangeLog file
394 +
395 +- added devfs support to the floppy driver
396 +
397 +- added support for creating sockets in a devfs
398 +===============================================================================
399 +Changes for patch v11
400 +
401 +- added DEVFS_FL_HIDE_UNREG flag
402 +
403 +- incorporated better patch for ttyname() in libc 5.4.43 from H.J. Lu.
404 +
405 +- interface change to <devfs_mk_symlink>
406 +
407 +- support for creating symlinks with symlink(2)
408 +
409 +- parallel port printer (/dev/lp*) now appears in devfs
410 +===============================================================================
411 +Changes for patch v12
412 +
413 +- added inode check to <devfs_fill_file> function
414 +
415 +- improved devfs support when mounting from devfs
416 +
417 +- added call to <<release>> operation when removing swap areas on
418 + devfs devices
419 +
420 +- increased NR_SUPER to 128 to support large numbers of devfs mounts
421 + (for chroot(2) gaols)
422 +
423 +- fixed bug in SCSI disc support: was generating incorrect minors if
424 + SCSI ID's did not start at 0 and increase by 1
425 +
426 +- support symlink traversal when mounting root
427 +===============================================================================
428 +Changes for patch v13
429 +
430 +- added devfs support to soundcard driver
431 + Thanks to Eric Dumas <dumas@linux.eu.org> and
432 + C. Scott Ananian <cananian@alumni.princeton.edu>
433 +
434 +- added devfs support to the joystick driver
435 +
436 +- loop driver now has it's own subdirectory "/dev/loop/"
437 +
438 +- created <devfs_get_flags> and <devfs_set_flags> functions
439 +
440 +- fix problem with SCSI disc compatibility names (sd{a,b,c,d,e,f})
441 + which assumes ID's start at 0 and increase by 1. Also only create
442 + devfs entries for SCSI disc partitions which actually exist
443 + Show new names in partition check
444 + Thanks to Jakub Jelinek <jj@sunsite.ms.mff.cuni.cz>
445 +===============================================================================
446 +Changes for patch v14
447 +
448 +- bug fix in floppy driver: would not compile without
449 + CONFIG_DEVFS_FS='Y'
450 + Thanks to Jurgen Botz <jbotz@nova.botz.org>
451 +
452 +- bug fix in loop driver
453 + Thanks to C. Scott Ananian <cananian@alumni.princeton.edu>
454 +
455 +- do not create devfs entries for printers not configured
456 + Thanks to C. Scott Ananian <cananian@alumni.princeton.edu>
457 +
458 +- do not create devfs entries for serial ports not present
459 + Thanks to C. Scott Ananian <cananian@alumni.princeton.edu>
460 +
461 +- ensure <tty_register_devfs> is exported from tty_io.c
462 + Thanks to C. Scott Ananian <cananian@alumni.princeton.edu>
463 +
464 +- allow unregistering of devfs symlink entries
465 +
466 +- fixed bug in SCSI disc naming introduced in last patch version
467 +===============================================================================
468 +Changes for patch v15
469 +
470 +- ported to kernel 2.1.81
471 +===============================================================================
472 +Changes for patch v16
473 +
474 +- created <devfs_set_symlink_destination> function
475 +
476 +- moved DEVFS_SUPER_MAGIC into header file
477 +
478 +- added DEVFS_FL_HIDE flag
479 +
480 +- created <devfs_get_maj_min>
481 +
482 +- created <devfs_get_handle_from_inode>
483 +
484 +- fixed bugs in searching by major&minor
485 +
486 +- changed interface to <devfs_unregister>, <devfs_fill_file> and
487 + <devfs_find_handle>
488 +
489 +- fixed inode times when symlink created with symlink(2)
490 +
491 +- change tty driver to do auto-creation of devfs entries
492 + Thanks to C. Scott Ananian <cananian@alumni.princeton.edu>
493 +
494 +- fixed bug in genhd.c: whole disc (non-SCSI) was not registered to
495 + devfs
496 +
497 +- updated libc 5.4.43 patch for ttyname()
498 +===============================================================================
499 +Changes for patch v17
500 +
501 +- added CONFIG_DEVFS_TTY_COMPAT
502 + Thanks to C. Scott Ananian <cananian@alumni.princeton.edu>
503 +
504 +- bugfix in devfs support for drivers/char/lp.c
505 + Thanks to C. Scott Ananian <cananian@alumni.princeton.edu>
506 +
507 +- clean up serial driver so that PCMCIA devices unregister correctly
508 + Thanks to C. Scott Ananian <cananian@alumni.princeton.edu>
509 +
510 +- fixed bug in genhd.c: whole disc (non-SCSI) was not registered to
511 + devfs [was missing in patch v16]
512 +
513 +- updated libc 5.4.43 patch for ttyname() [was missing in patch v16]
514 +
515 +- all SCSI devices now registered in /dev/sg
516 +
517 +- support removal of devfs entries via unlink(2)
518 +===============================================================================
519 +Changes for patch v18
520 +
521 +- added floppy/?u720 floppy entry
522 +
523 +- fixed kerneld support for entries in devfs subdirectories
524 +
525 +- incorporated latest patch for ttyname() in libc 5.4.43 from H.J. Lu.
526 +===============================================================================
527 +Changes for patch v19
528 +
529 +- bug fix when looking up unregistered entries: kerneld was not called
530 +
531 +- fixes for kernel 2.1.86 (now requires 2.1.86)
532 +===============================================================================
533 +Changes for patch v20
534 +
535 +- only create available floppy entries
536 + Thanks to Andrzej Krzysztofowicz <ankry@green.mif.pg.gda.pl>
537 +
538 +- new IDE naming scheme following SCSI format (i.e. /dev/id/c0b0t0u0p1
539 + instead of /dev/hda1)
540 + Thanks to Andrzej Krzysztofowicz <ankry@green.mif.pg.gda.pl>
541 +
542 +- new XT disc naming scheme following SCSI format (i.e. /dev/xd/c0t0p1
543 + instead of /dev/xda1)
544 + Thanks to Andrzej Krzysztofowicz <ankry@green.mif.pg.gda.pl>
545 +
546 +- new non-standard CD-ROM names (i.e. /dev/sbp/c#t#)
547 + Thanks to Andrzej Krzysztofowicz <ankry@green.mif.pg.gda.pl>
548 +
549 +- allow symlink traversal when mounting the root filesystem
550 +
551 +- Create entries for MD devices at MD init
552 + Thanks to Christophe Leroy <christophe.leroy5@capway.com>
553 +===============================================================================
554 +Changes for patch v21
555 +
556 +- ported to kernel 2.1.91
557 +===============================================================================
558 +Changes for patch v22
559 +
560 +- SCSI host number patch ("scsihosts=" kernel option)
561 + Thanks to Andrzej Krzysztofowicz <ankry@green.mif.pg.gda.pl>
562 +===============================================================================
563 +Changes for patch v23
564 +
565 +- Fixed persistence bug with device numbers for manually created
566 + device files
567 +
568 +- Fixed problem with recreating symlinks with different content
569 +
570 +- Added CONFIG_DEVFS_MOUNT (mount devfs on /dev at boot time)
571 +===============================================================================
572 +Changes for patch v24
573 +
574 +- Switched from CONFIG_KERNELD to CONFIG_KMOD: module autoloading
575 + should now work again
576 +
577 +- Hide entries which are manually unlinked
578 +
579 +- Always invalidate devfs dentry cache when registering entries
580 +
581 +- Support removal of devfs directories via rmdir(2)
582 +
583 +- Ensure directories created by <devfs_mk_dir> are visible
584 +
585 +- Default no access for "other" for floppy device
586 +===============================================================================
587 +Changes for patch v25
588 +
589 +- Updates to CREDITS file and minor IDE numbering change
590 + Thanks to Andrzej Krzysztofowicz <ankry@green.mif.pg.gda.pl>
591 +
592 +- Invalidate devfs dentry cache when making directories
593 +
594 +- Invalidate devfs dentry cache when removing entries
595 +
596 +- More informative message if root FS mount fails when devfs
597 + configured
598 +
599 +- Fixed persistence bug with fifos
600 +===============================================================================
601 +Changes for patch v26
602 +
603 +- ported to kernel 2.1.97
604 +
605 +- Changed serial directory from "/dev/serial" to "/dev/tts" and
606 + "/dev/consoles" to "/dev/vc" to be more friendly to new procps
607 +===============================================================================
608 +Changes for patch v27
609 +
610 +- Added support for IDE4 and IDE5
611 + Thanks to Andrzej Krzysztofowicz <ankry@green.mif.pg.gda.pl>
612 +
613 +- Documented "scsihosts=" boot parameter
614 +
615 +- Print process command when debugging kerneld/kmod
616 +
617 +- Added debugging for register/unregister/change operations
618 +
619 +- Added "devfs=" boot options
620 +
621 +- Hide unregistered entries by default
622 +===============================================================================
623 +Changes for patch v28
624 +
625 +- No longer lock/unlock superblock in <devfs_put_super> (cope with
626 + recent VFS interface change)
627 +
628 +- Do not automatically change ownership/protection of /dev/tty
629 +
630 +- Drop negative dentries when they are released
631 +
632 +- Manage dcache more efficiently
633 +===============================================================================
634 +Changes for patch v29
635 +
636 +- Added DEVFS_FL_AUTO_DEVNUM flag
637 +===============================================================================
638 +Changes for patch v30
639 +
640 +- No longer set unnecessary methods
641 +
642 +- Ported to kernel 2.1.99-pre3
643 +===============================================================================
644 +Changes for patch v31
645 +
646 +- Added PID display to <call_kerneld> debugging message
647 +
648 +- Added "diread" and "diwrite" options
649 +
650 +- Ported to kernel 2.1.102
651 +
652 +- Fixed persistence problem with permissions
653 +===============================================================================
654 +Changes for patch v32
655 +
656 +- Fixed devfs support in drivers/block/md.c
657 +===============================================================================
658 +Changes for patch v33
659 +
660 +- Support legacy device nodes
661 +
662 +- Fixed bug where recreated inodes were hidden
663 +
664 +- New IDE naming scheme: everything is under /dev/ide
665 +===============================================================================
666 +Changes for patch v34
667 +
668 +- Improved debugging in <get_vfs_inode>
669 +
670 +- Prevent duplicate calls to <devfs_mk_dir> in SCSI layer
671 +
672 +- No longer free old dentries in <devfs_mk_dir>
673 +
674 +- Free all dentries for a given entry when deleting inodes
675 +===============================================================================
676 +Changes for patch v35
677 +
678 +- Ported to kernel 2.1.105 (sound driver changes)
679 +===============================================================================
680 +Changes for patch v36
681 +
682 +- Fixed sound driver port
683 +===============================================================================
684 +Changes for patch v37
685 +
686 +- Minor documentation tweaks
687 +===============================================================================
688 +Changes for patch v38
689 +
690 +- More documentation tweaks
691 +
692 +- Fix for sound driver port
693 +
694 +- Removed ttyname-patch (grab libc 5.4.44 instead)
695 +
696 +- Ported to kernel 2.1.107-pre2 (loop driver fix)
697 +===============================================================================
698 +Changes for patch v39
699 +
700 +- Ported to kernel 2.1.107 (hd.c hunk broke due to spelling "fixes"). Sigh
701 +
702 +- Removed many #ifdef's, replaced with trickery in include/devfs_fs.h
703 +===============================================================================
704 +Changes for patch v40
705 +
706 +- Fix for sound driver port
707 +
708 +- Limit auto-device numbering to majors 128 to 239
709 +===============================================================================
710 +Changes for patch v41
711 +
712 +- Fixed inode times persistence problem
713 +===============================================================================
714 +Changes for patch v42
715 +
716 +- Ported to kernel 2.1.108 (drivers/scsi/hosts.c hunk broke)
717 +===============================================================================
718 +Changes for patch v43
719 +
720 +- Fixed spelling in <devfs_readlink> debug
721 +
722 +- Fixed bug in <devfs_setup> parsing "dilookup"
723 +
724 +- More #ifdef's removed
725 +
726 +- Supported Sparc keyboard (/dev/kbd)
727 +
728 +- Supported DSP56001 digital signal processor (/dev/dsp56k)
729 +
730 +- Supported Apple Desktop Bus (/dev/adb)
731 +
732 +- Supported Coda network file system (/dev/cfs*)
733 +===============================================================================
734 +Changes for patch v44
735 +
736 +- Fixed devfs inode leak when manually recreating inodes
737 +
738 +- Fixed permission persistence problem when recreating inodes
739 +===============================================================================
740 +Changes for patch v45
741 +
742 +- Ported to kernel 2.1.110
743 +===============================================================================
744 +Changes for patch v46
745 +
746 +- Ported to kernel 2.1.112-pre1
747 +
748 +- Removed harmless "unused variable" compiler warning
749 +
750 +- Fixed modes for manually recreated device nodes
751 +===============================================================================
752 +Changes for patch v47
753 +
754 +- Added NULL devfs inode warning in <devfs_read_inode>
755 +
756 +- Force all inode nlink values to 1
757 +===============================================================================
758 +Changes for patch v48
759 +
760 +- Added "dimknod" option
761 +
762 +- Set inode nlink to 0 when freeing dentries
763 +
764 +- Added support for virtual console capture devices (/dev/vcs*)
765 + Thanks to Dennis Hou <smilax@mindmeld.yi.org>
766 +
767 +- Fixed modes for manually recreated symlinks
768 +===============================================================================
769 +Changes for patch v49
770 +
771 +- Ported to kernel 2.1.113
772 +===============================================================================
773 +Changes for patch v50
774 +
775 +- Fixed bugs in recreated directories and symlinks
776 +===============================================================================
777 +Changes for patch v51
778 +
779 +- Improved robustness of rc.devfs script
780 + Thanks to Roderich Schupp <rsch@experteam.de>
781 +
782 +- Fixed bugs in recreated device nodes
783 +
784 +- Fixed bug in currently unused <devfs_get_handle_from_inode>
785 +
786 +- Defined new <devfs_handle_t> type
787 +
788 +- Improved debugging when getting entries
789 +
790 +- Fixed bug where directories could be emptied
791 +
792 +- Ported to kernel 2.1.115
793 +===============================================================================
794 +Changes for patch v52
795 +
796 +- Replaced dummy .epoch inode with .devfsd character device
797 +
798 +- Modified rc.devfs to take account of above change
799 +
800 +- Removed spurious driver warning messages when CONFIG_DEVFS_FS=n
801 +
802 +- Implemented devfsd protocol revision 0
803 +===============================================================================
804 +Changes for patch v53
805 +
806 +- Ported to kernel 2.1.116 (kmod change broke hunk)
807 +
808 +- Updated Documentation/Configure.help
809 +
810 +- Test and tty pattern patch for rc.devfs script
811 + Thanks to Roderich Schupp <rsch@experteam.de>
812 +
813 +- Added soothing message to warning in <devfs_d_iput>
814 +===============================================================================
815 +Changes for patch v54
816 +
817 +- Ported to kernel 2.1.117
818 +
819 +- Fixed default permissions in sound driver
820 +
821 +- Added support for frame buffer devices (/dev/fb*)
822 +===============================================================================
823 +Changes for patch v55
824 +
825 +- Ported to kernel 2.1.119
826 +
827 +- Use GCC extensions for structure initialisations
828 +
829 +- Implemented async open notification
830 +
831 +- Incremented devfsd protocol revision to 1
832 +===============================================================================
833 +Changes for patch v56
834 +
835 +- Ported to kernel 2.1.120-pre3
836 +
837 +- Moved async open notification to end of <devfs_open>
838 +===============================================================================
839 +Changes for patch v57
840 +
841 +- Ported to kernel 2.1.121
842 +
843 +- Prepended "/dev/" to module load request
844 +
845 +- Renamed <call_kerneld> to <call_kmod>
846 +
847 +- Created sample modules.conf file
848 +===============================================================================
849 +Changes for patch v58
850 +
851 +- Fixed typo "AYSNC" -> "ASYNC"
852 +===============================================================================
853 +Changes for patch v59
854 +
855 +- Added open flag for files
856 +===============================================================================
857 +Changes for patch v60
858 +
859 +- Ported to kernel 2.1.123-pre2
860 +===============================================================================
861 +Changes for patch v61
862 +
863 +- Set i_blocks=0 and i_blksize=1024 in <devfs_read_inode>
864 +===============================================================================
865 +Changes for patch v62
866 +
867 +- Ported to kernel 2.1.123
868 +===============================================================================
869 +Changes for patch v63
870 +
871 +- Ported to kernel 2.1.124-pre2
872 +===============================================================================
873 +Changes for patch v64
874 +
875 +- Fixed Unix98 pty support
876 +
877 +- Increased buffer size in <get_partition_list> to avoid crash and
878 + burn
879 +===============================================================================
880 +Changes for patch v65
881 +
882 +- More Unix98 pty support fixes
883 +
884 +- Added test for empty <<name>> in <devfs_find_handle>
885 +
886 +- Renamed <generate_path> to <devfs_generate_path> and published
887 +
888 +- Created /dev/root symlink
889 + Thanks to Roderich Schupp <rsch@ExperTeam.de>
890 + with further modifications by me
891 +===============================================================================
892 +Changes for patch v66
893 +
894 +- Yet more Unix98 pty support fixes (now tested)
895 +
896 +- Created <devfs_get_fops>
897 +
898 +- Support media change checks when CONFIG_DEVFS_ONLY=y
899 +
900 +- Abolished Unix98-style PTY names for old PTY devices
901 +===============================================================================
902 +Changes for patch v67
903 +
904 +- Added inline declaration for dummy <devfs_generate_path>
905 +
906 +- Removed spurious "unable to register... in devfs" messages when
907 + CONFIG_DEVFS_FS=n
908 +
909 +- Fixed misc. devices when CONFIG_DEVFS_FS=n
910 +
911 +- Limit auto-device numbering to majors 144 to 239
912 +===============================================================================
913 +Changes for patch v68
914 +
915 +- Hide unopened virtual consoles from directory listings
916 +
917 +- Added support for video capture devices
918 +
919 +- Ported to kernel 2.1.125
920 +===============================================================================
921 +Changes for patch v69
922 +
923 +- Fix for CONFIG_VT=n
924 +===============================================================================
925 +Changes for patch v70
926 +
927 +- Added support for non-OSS/Free sound cards
928 +===============================================================================
929 +Changes for patch v71
930 +
931 +- Ported to kernel 2.1.126-pre2
932 +===============================================================================
933 +Changes for patch v72
934 +
935 +- #ifdef's for CONFIG_DEVFS_DISABLE_OLD_NAMES removed
936 +===============================================================================
937 +Changes for patch v73
938 +
939 +- CONFIG_DEVFS_DISABLE_OLD_NAMES replaced with "nocompat" boot option
940 +
941 +- CONFIG_DEVFS_BOOT_OPTIONS removed: boot options always available
942 +===============================================================================
943 +Changes for patch v74
944 +
945 +- Removed CONFIG_DEVFS_MOUNT and "mount" boot option and replaced with
946 + "nomount" boot option
947 +
948 +- Documentation updates
949 +
950 +- Updated sample modules.conf
951 +===============================================================================
952 +Changes for patch v75
953 +
954 +- Updated sample modules.conf
955 +
956 +- Remount devfs after initrd finishes
957 +
958 +- Ported to kernel 2.1.127
959 +
960 +- Added support for ISDN
961 + Thanks to Christophe Leroy <christophe.leroy5@capway.com>
962 +===============================================================================
963 +Changes for patch v76
964 +
965 +- Updated an email address in ChangeLog
966 +
967 +- CONFIG_DEVFS_ONLY replaced with "only" boot option
968 +===============================================================================
969 +Changes for patch v77
970 +
971 +- Added DEVFS_FL_REMOVABLE flag
972 +
973 +- Check for disc change when listing directories with removable media
974 + devices
975 +
976 +- Use DEVFS_FL_REMOVABLE in sd.c
977 +
978 +- Ported to kernel 2.1.128
979 +===============================================================================
980 +Changes for patch v78
981 +
982 +- Only call <scan_dir_for_removable> on first call to <devfs_readdir>
983 +
984 +- Ported to kernel 2.1.129-pre5
985 +
986 +- ISDN support improvements
987 + Thanks to Christophe Leroy <christophe.leroy5@capway.com>
988 +===============================================================================
989 +Changes for patch v79
990 +
991 +- Ported to kernel 2.1.130
992 +
993 +- Renamed miscdevice "apm" to "apm_bios" to be consistent with
994 + devices.txt
995 +===============================================================================
996 +Changes for patch v80
997 +
998 +- Ported to kernel 2.1.131
999 +
1000 +- Updated <devfs_rmdir> for VFS change in 2.1.131
1001 +===============================================================================
1002 +Changes for patch v81
1003 +
1004 +- Fixed permissions on /dev/ptmx
1005 +===============================================================================
1006 +Changes for patch v82
1007 +
1008 +- Ported to kernel 2.1.132-pre4
1009 +
1010 +- Changed initial permissions on /dev/pts/*
1011 +
1012 +- Created <devfs_mk_compat>
1013 +
1014 +- Added "symlinks" boot option
1015 +
1016 +- Changed devfs_register_blkdev() back to register_blkdev() for IDE
1017 +
1018 +- Check for partitions on removable media in <devfs_lookup>
1019 +===============================================================================
1020 +Changes for patch v83
1021 +
1022 +- Fixed support for ramdisc when using string-based root FS name
1023 +
1024 +- Ported to kernel 2.2.0-pre1
1025 +===============================================================================
1026 +Changes for patch v84
1027 +
1028 +- Ported to kernel 2.2.0-pre7
1029 +===============================================================================
1030 +Changes for patch v85
1031 +
1032 +- Compile fixes for driver/sound/sound_common.c (non-module) and
1033 + drivers/isdn/isdn_common.c
1034 + Thanks to Christophe Leroy <christophe.leroy5@capway.com>
1035 +
1036 +- Added support for registering regular files
1037 +
1038 +- Created <devfs_set_file_size>
1039 +
1040 +- Added /dev/cpu/mtrr as an alternative interface to /proc/mtrr
1041 +
1042 +- Update devfs inodes from entries if not changed through FS
1043 +===============================================================================
1044 +Changes for patch v86
1045 +
1046 +- Ported to kernel 2.2.0-pre9
1047 +===============================================================================
1048 +Changes for patch v87
1049 +
1050 +- Fixed bug when mounting non-devfs devices in a devfs
1051 +===============================================================================
1052 +Changes for patch v88
1053 +
1054 +- Fixed <devfs_fill_file> to only initialise temporary inodes
1055 +
1056 +- Trap for NULL fops in <devfs_register>
1057 +
1058 +- Return -ENODEV in <devfs_fill_file> for non-driver inodes
1059 +
1060 +- Fixed bug when unswapping non-devfs devices in a devfs
1061 +===============================================================================
1062 +Changes for patch v89
1063 +
1064 +- Switched to C data types in include/linux/devfs_fs.h
1065 +
1066 +- Switched from PATH_MAX to DEVFS_PATHLEN
1067 +
1068 +- Updated Documentation/filesystems/devfs/modules.conf to take account
1069 + of reverse scanning (!) by modprobe
1070 +
1071 +- Ported to kernel 2.2.0
1072 +===============================================================================
1073 +Changes for patch v90
1074 +
1075 +- CONFIG_DEVFS_DISABLE_OLD_TTY_NAMES replaced with "nottycompat" boot
1076 + option
1077 +
1078 +- CONFIG_DEVFS_TTY_COMPAT removed: existing "symlinks" boot option now
1079 + controls this. This means you must have libc 5.4.44 or later, or a
1080 + recent version of libc 6 if you use the "symlinks" option
1081 +===============================================================================
1082 +Changes for patch v91
1083 +
1084 +- Switch from <devfs_mk_symlink> to <devfs_mk_compat> in
1085 + drivers/char/vc_screen.c to fix problems with Midnight Commander
1086 +===============================================================================
1087 +Changes for patch v92
1088 +
1089 +- Ported to kernel 2.2.2-pre5
1090 +===============================================================================
1091 +Changes for patch v93
1092 +
1093 +- Modified <sd_name> in drivers/scsi/sd.c to cope with devices that
1094 + don't exist (which happens with new RAID autostart code printk()s)
1095 +===============================================================================
1096 +Changes for patch v94
1097 +
1098 +- Fixed bug in joystick driver: only first joystick was registered
1099 +===============================================================================
1100 +Changes for patch v95
1101 +
1102 +- Fixed another bug in joystick driver
1103 +
1104 +- Fixed <devfsd_read> to not overrun event buffer
1105 +===============================================================================
1106 +Changes for patch v96
1107 +
1108 +- Ported to kernel 2.2.5-2
1109 +
1110 +- Created <devfs_auto_unregister>
1111 +
1112 +- Fixed bugs: compatibility entries were not unregistered for:
1113 + loop driver
1114 + floppy driver
1115 + RAMDISC driver
1116 + IDE tape driver
1117 + SCSI CD-ROM driver
1118 + SCSI HDD driver
1119 +===============================================================================
1120 +Changes for patch v97
1121 +
1122 +- Fixed bugs: compatibility entries were not unregistered for:
1123 + ALSA sound driver
1124 + partitions in generic disc driver
1125 +
1126 +- Don't return unregistred entries in <devfs_find_handle>
1127 +
1128 +- Panic in <devfs_unregister> if entry unregistered
1129 +
1130 +- Don't panic in <devfs_auto_unregister> for duplicates
1131 +===============================================================================
1132 +Changes for patch v98
1133 +
1134 +- Don't unregister already unregistered entries in <unregister>
1135 +
1136 +- Register entry in <sd_detect>
1137 +
1138 +- Unregister entry in <sd_detach>
1139 +
1140 +- Changed to <devfs_*register_chrdev> in drivers/char/tty_io.c
1141 +
1142 +- Ported to kernel 2.2.7
1143 +===============================================================================
1144 +Changes for patch v99
1145 +
1146 +- Ported to kernel 2.2.8
1147 +
1148 +- Fixed bug in drivers/scsi/sd.c when >16 SCSI discs
1149 +
1150 +- Disable warning messages when unable to read partition table for
1151 + removable media
1152 +===============================================================================
1153 +Changes for patch v100
1154 +
1155 +- Ported to kernel 2.3.1-pre5
1156 +
1157 +- Added "oops-on-panic" boot option
1158 +
1159 +- Improved debugging in <devfs_register> and <devfs_unregister>
1160 +
1161 +- Register entry in <sr_detect>
1162 +
1163 +- Unregister entry in <sr_detach>
1164 +
1165 +- Register entry in <sg_detect>
1166 +
1167 +- Unregister entry in <sg_detach>
1168 +
1169 +- Added support for ALSA drivers
1170 +===============================================================================
1171 +Changes for patch v101
1172 +
1173 +- Ported to kernel 2.3.2
1174 +===============================================================================
1175 +Changes for patch v102
1176 +
1177 +- Update serial driver to register PCMCIA entries
1178 + Thanks to Roch-Alexandre Nomine-Beguin <roch@samarkand.infini.fr>
1179 +
1180 +- Updated an email address in ChangeLog
1181 +
1182 +- Hide virtual console capture entries from directory listings when
1183 + corresponding console device is not open
1184 +===============================================================================
1185 +Changes for patch v103
1186 +
1187 +- Ported to kernel 2.3.3
1188 +===============================================================================
1189 +Changes for patch v104
1190 +
1191 +- Added documentation for some functions
1192 +
1193 +- Added "doc" target to fs/devfs/Makefile
1194 +
1195 +- Added "v4l" directory for video4linux devices
1196 +
1197 +- Replaced call to <devfs_unregister> in <sd_detach> with call to
1198 + <devfs_register_partitions>
1199 +
1200 +- Moved registration for sr and sg drivers from detect() to attach()
1201 + methods
1202 +
1203 +- Register entries in <st_attach> and unregister in <st_detach>
1204 +
1205 +- Work around IDE driver treating CD-ROM as gendisk
1206 +
1207 +- Use <sed> instead of <tr> in rc.devfs
1208 +
1209 +- Updated ToDo list
1210 +
1211 +- Removed "oops-on-panic" boot option: now always Oops
1212 +===============================================================================
1213 +Changes for patch v105
1214 +
1215 +- Unregister SCSI host from <scsi_host_no_list> in <scsi_unregister>
1216 + Thanks to Zoltán Böszörményi <zboszor@mail.externet.hu>
1217 +
1218 +- Don't save /dev/log in rc.devfs
1219 +
1220 +- Ported to kernel 2.3.4-pre1
1221 +===============================================================================
1222 +Changes for patch v106
1223 +
1224 +- Fixed silly typo in drivers/scsi/st.c
1225 +
1226 +- Improved debugging in <devfs_register>
1227 +===============================================================================
1228 +Changes for patch v107
1229 +
1230 +- Added "diunlink" and "nokmod" boot options
1231 +
1232 +- Removed superfluous warning message in <devfs_d_iput>
1233 +===============================================================================
1234 +Changes for patch v108
1235 +
1236 +- Remove entries when unloading sound module
1237 +===============================================================================
1238 +Changes for patch v109
1239 +
1240 +- Ported to kernel 2.3.6-pre2
1241 +===============================================================================
1242 +Changes for patch v110
1243 +
1244 +- Took account of change to <d_alloc_root>
1245 +===============================================================================
1246 +Changes for patch v111
1247 +
1248 +- Created separate event queue for each mounted devfs
1249 +
1250 +- Removed <devfs_invalidate_dcache>
1251 +
1252 +- Created new ioctl()s for devfsd
1253 +
1254 +- Incremented devfsd protocol revision to 3
1255 +
1256 +- Fixed bug when re-creating directories: contents were lost
1257 +
1258 +- Block access to inodes until devfsd updates permissions
1259 +===============================================================================
1260 +Changes for patch v112
1261 +
1262 +- Modified patch so it applies against 2.3.5 and 2.3.6
1263 +
1264 +- Updated an email address in ChangeLog
1265 +
1266 +- Do not automatically change ownership/protection of /dev/tty<n>
1267 +
1268 +- Updated sample modules.conf
1269 +
1270 +- Switched to sending process uid/gid to devfsd
1271 +
1272 +- Renamed <call_kmod> to <try_modload>
1273 +
1274 +- Added DEVFSD_NOTIFY_LOOKUP event
1275 +
1276 +- Added DEVFSD_NOTIFY_CHANGE event
1277 +
1278 +- Added DEVFSD_NOTIFY_CREATE event
1279 +
1280 +- Incremented devfsd protocol revision to 4
1281 +
1282 +- Moved kernel-specific stuff to include/linux/devfs_fs_kernel.h
1283 +===============================================================================
1284 +Changes for patch v113
1285 +
1286 +- Ported to kernel 2.3.9
1287 +
1288 +- Restricted permissions on some block devices
1289 +===============================================================================
1290 +Changes for patch v114
1291 +
1292 +- Added support for /dev/netlink
1293 + Thanks to Dennis Hou <smilax@mindmeld.yi.org>
1294 +
1295 +- Return EISDIR rather than EINVAL for read(2) on directories
1296 +
1297 +- Ported to kernel 2.3.10
1298 +===============================================================================
1299 +Changes for patch v115
1300 +
1301 +- Added support for all remaining character devices
1302 + Thanks to Dennis Hou <smilax@mindmeld.yi.org>
1303 +
1304 +- Cleaned up netlink support
1305 +===============================================================================
1306 +Changes for patch v116
1307 +
1308 +- Added support for /dev/parport%d
1309 + Thanks to Tim Waugh <tim@cyberelk.demon.co.uk>
1310 +
1311 +- Fixed parallel port ATAPI tape driver
1312 +
1313 +- Fixed Atari SLM laser printer driver
1314 +===============================================================================
1315 +Changes for patch v117
1316 +
1317 +- Added support for COSA card
1318 + Thanks to Dennis Hou <smilax@mindmeld.yi.org>
1319 +
1320 +- Fixed drivers/char/ppdev.c: missing #include <linux/init.h>
1321 +
1322 +- Fixed drivers/char/ftape/zftape/zftape-init.c
1323 + Thanks to Vladimir Popov <mashgrad@usa.net>
1324 +===============================================================================
1325 +Changes for patch v118
1326 +
1327 +- Ported to kernel 2.3.15-pre3
1328 +
1329 +- Fixed bug in loop driver
1330 +
1331 +- Unregister /dev/lp%d entries in drivers/char/lp.c
1332 + Thanks to Maciej W. Rozycki <macro@ds2.pg.gda.pl>
1333 +===============================================================================
1334 +Changes for patch v119
1335 +
1336 +- Ported to kernel 2.3.16
1337 +===============================================================================
1338 +Changes for patch v120
1339 +
1340 +- Fixed bug in drivers/scsi/scsi.c
1341 +
1342 +- Added /dev/ppp
1343 + Thanks to Dennis Hou <smilax@mindmeld.yi.org>
1344 +
1345 +- Ported to kernel 2.3.17
1346 +===============================================================================
1347 +Changes for patch v121
1348 +
1349 +- Fixed bug in drivers/block/loop.c
1350 +
1351 +- Ported to kernel 2.3.18
1352 +===============================================================================
1353 +Changes for patch v122
1354 +
1355 +- Ported to kernel 2.3.19
1356 +===============================================================================
1357 +Changes for patch v123
1358 +
1359 +- Ported to kernel 2.3.20
1360 +===============================================================================
1361 +Changes for patch v124
1362 +
1363 +- Ported to kernel 2.3.21
1364 +===============================================================================
1365 +Changes for patch v125
1366 +
1367 +- Created <devfs_get_info>, <devfs_set_info>,
1368 + <devfs_get_first_child> and <devfs_get_next_sibling>
1369 + Added <<dir>> parameter to <devfs_register>, <devfs_mk_compat>,
1370 + <devfs_mk_dir> and <devfs_find_handle>
1371 + Work sponsored by SGI
1372 +
1373 +- Fixed apparent bug in COSA driver
1374 +
1375 +- Re-instated "scsihosts=" boot option
1376 +===============================================================================
1377 +Changes for patch v126
1378 +
1379 +- Always create /dev/pts if CONFIG_UNIX98_PTYS=y
1380 +
1381 +- Fixed call to <devfs_mk_dir> in drivers/block/ide-disk.c
1382 + Thanks to Dennis Hou <smilax@mindmeld.yi.org>
1383 +
1384 +- Allow multiple unregistrations
1385 +
1386 +- Created /dev/scsi hierarchy
1387 + Work sponsored by SGI
1388 +===============================================================================
1389 +Changes for patch v127
1390 +
1391 +Work sponsored by SGI
1392 +
1393 +- No longer disable devpts if devfs enabled (caveat emptor)
1394 +
1395 +- Added flags array to struct gendisk and removed code from
1396 + drivers/scsi/sd.c
1397 +
1398 +- Created /dev/discs hierarchy
1399 +===============================================================================
1400 +Changes for patch v128
1401 +
1402 +Work sponsored by SGI
1403 +
1404 +- Created /dev/cdroms hierarchy
1405 +===============================================================================
1406 +Changes for patch v129
1407 +
1408 +Work sponsored by SGI
1409 +
1410 +- Removed compatibility entries for sound devices
1411 +
1412 +- Removed compatibility entries for printer devices
1413 +
1414 +- Removed compatibility entries for video4linux devices
1415 +
1416 +- Removed compatibility entries for parallel port devices
1417 +
1418 +- Removed compatibility entries for frame buffer devices
1419 +===============================================================================
1420 +Changes for patch v130
1421 +
1422 +Work sponsored by SGI
1423 +
1424 +- Added major and minor number to devfsd protocol
1425 +
1426 +- Incremented devfsd protocol revision to 5
1427 +
1428 +- Removed compatibility entries for SoundBlaster CD-ROMs
1429 +
1430 +- Removed compatibility entries for netlink devices
1431 +
1432 +- Removed compatibility entries for SCSI generic devices
1433 +
1434 +- Removed compatibility entries for SCSI tape devices
1435 +===============================================================================
1436 +Changes for patch v131
1437 +
1438 +Work sponsored by SGI
1439 +
1440 +- Support info pointer for all devfs entry types
1441 +
1442 +- Added <<info>> parameter to <devfs_mk_dir> and <devfs_mk_symlink>
1443 +
1444 +- Removed /dev/st hierarchy
1445 +
1446 +- Removed /dev/sg hierarchy
1447 +
1448 +- Removed compatibility entries for loop devices
1449 +
1450 +- Removed compatibility entries for IDE tape devices
1451 +
1452 +- Removed compatibility entries for SCSI CD-ROMs
1453 +
1454 +- Removed /dev/sr hierarchy
1455 +===============================================================================
1456 +Changes for patch v132
1457 +
1458 +Work sponsored by SGI
1459 +
1460 +- Removed compatibility entries for floppy devices
1461 +
1462 +- Removed compatibility entries for RAMDISCs
1463 +
1464 +- Removed compatibility entries for meta-devices
1465 +
1466 +- Removed compatibility entries for SCSI discs
1467 +
1468 +- Created <devfs_make_root>
1469 +
1470 +- Removed /dev/sd hierarchy
1471 +
1472 +- Support "../" when searching devfs namespace
1473 +
1474 +- Created /dev/ide/host* hierarchy
1475 +
1476 +- Supported IDE hard discs in /dev/ide/host* hierarchy
1477 +
1478 +- Removed compatibility entries for IDE discs
1479 +
1480 +- Removed /dev/ide/hd hierarchy
1481 +
1482 +- Supported IDE CD-ROMs in /dev/ide/host* hierarchy
1483 +
1484 +- Removed compatibility entries for IDE CD-ROMs
1485 +
1486 +- Removed /dev/ide/cd hierarchy
1487 +===============================================================================
1488 +Changes for patch v133
1489 +
1490 +Work sponsored by SGI
1491 +
1492 +- Created <devfs_get_unregister_slave>
1493 +
1494 +- Fixed bug in fs/partitions/check.c when rescanning
1495 +===============================================================================
1496 +Changes for patch v134
1497 +
1498 +Work sponsored by SGI
1499 +
1500 +- Removed /dev/sd, /dev/sr, /dev/st and /dev/sg directories
1501 +
1502 +- Removed /dev/ide/hd directory
1503 +
1504 +- Exported <devfs_get_parent>
1505 +
1506 +- Created <devfs_register_tape> and /dev/tapes hierarchy
1507 +
1508 +- Removed /dev/ide/mt hierarchy
1509 +
1510 +- Removed /dev/ide/fd hierarchy
1511 +
1512 +- Ported to kernel 2.3.25
1513 +===============================================================================
1514 +Changes for patch v135
1515 +
1516 +Work sponsored by SGI
1517 +
1518 +- Removed compatibility entries for virtual console capture devices
1519 +
1520 +- Removed unused <devfs_set_symlink_destination>
1521 +
1522 +- Removed compatibility entries for serial devices
1523 +
1524 +- Removed compatibility entries for console devices
1525 +
1526 +- Do not hide entries from devfsd or children
1527 +
1528 +- Removed DEVFS_FL_TTY_COMPAT flag
1529 +
1530 +- Removed "nottycompat" boot option
1531 +
1532 +- Removed <devfs_mk_compat>
1533 +===============================================================================
1534 +Changes for patch v136
1535 +
1536 +Work sponsored by SGI
1537 +
1538 +- Moved BSD pty devices to /dev/pty
1539 +
1540 +- Added DEVFS_FL_WAIT flag
1541 +===============================================================================
1542 +Changes for patch v137
1543 +
1544 +Work sponsored by SGI
1545 +
1546 +- Really fixed bug in fs/partitions/check.c when rescanning
1547 +
1548 +- Support new "disc" naming scheme in <get_removable_partition>
1549 +
1550 +- Allow NULL fops in <devfs_register>
1551 +
1552 +- Removed redundant name functions in SCSI disc and IDE drivers
1553 +===============================================================================
1554 +Changes for patch v138
1555 +
1556 +Work sponsored by SGI
1557 +
1558 +- Fixed old bugs in drivers/block/paride/pt.c, drivers/char/tpqic02.c,
1559 + drivers/net/wan/cosa.c and drivers/scsi/scsi.c
1560 + Thanks to Sergey Kubushin <ksi@ksi-linux.com>
1561 +
1562 +- Fall back to major table if NULL fops given to <devfs_register>
1563 +===============================================================================
1564 +Changes for patch v139
1565 +
1566 +Work sponsored by SGI
1567 +
1568 +- Corrected and moved <get_blkfops> and <get_chrfops> declarations
1569 + from arch/alpha/kernel/osf_sys.c to include/linux/fs.h
1570 +
1571 +- Removed name function from struct gendisk
1572 +
1573 +- Updated devfs FAQ
1574 +===============================================================================
1575 +Changes for patch v140
1576 +
1577 +Work sponsored by SGI
1578 +
1579 +- Ported to kernel 2.3.27
1580 +===============================================================================
1581 +Changes for patch v141
1582 +
1583 +Work sponsored by SGI
1584 +
1585 +- Bug fix in arch/m68k/atari/joystick.c
1586 +
1587 +- Moved ISDN and capi devices to /dev/isdn
1588 +===============================================================================
1589 +Changes for patch v142
1590 +
1591 +Work sponsored by SGI
1592 +
1593 +- Bug fix in drivers/block/ide-probe.c (patch confusion)
1594 +===============================================================================
1595 +Changes for patch v143
1596 +
1597 +Work sponsored by SGI
1598 +
1599 +- Bug fix in drivers/block/blkpg.c:partition_name()
1600 +===============================================================================
1601 +Changes for patch v144
1602 +
1603 +Work sponsored by SGI
1604 +
1605 +- Ported to kernel 2.3.29
1606 +
1607 +- Removed calls to <devfs_register> from cdu31a, cm206, mcd and mcdx
1608 + CD-ROM drivers: generic driver handles this now
1609 +
1610 +- Moved joystick devices to /dev/joysticks
1611 +===============================================================================
1612 +Changes for patch v145
1613 +
1614 +Work sponsored by SGI
1615 +
1616 +- Ported to kernel 2.3.30-pre3
1617 +
1618 +- Register whole-disc entry even for invalid partition tables
1619 +
1620 +- Fixed bug in mounting root FS when initrd enabled
1621 +
1622 +- Fixed device entry leak with IDE CD-ROMs
1623 +
1624 +- Fixed compile problem with drivers/isdn/isdn_common.c
1625 +
1626 +- Moved COSA devices to /dev/cosa
1627 +
1628 +- Support fifos when unregistering
1629 +
1630 +- Created <devfs_register_series> and used in many drivers
1631 +
1632 +- Moved Coda devices to /dev/coda
1633 +
1634 +- Moved parallel port IDE tapes to /dev/pt
1635 +
1636 +- Moved parallel port IDE generic devices to /dev/pg
1637 +===============================================================================
1638 +Changes for patch v146
1639 +
1640 +Work sponsored by SGI
1641 +
1642 +- Removed obsolete DEVFS_FL_COMPAT and DEVFS_FL_TOLERANT flags
1643 +
1644 +- Fixed compile problem with fs/coda/psdev.c
1645 +
1646 +- Reinstate change to <devfs_register_blkdev> in
1647 + drivers/block/ide-probe.c now that fs/isofs/inode.c is fixed
1648 +
1649 +- Switched to <devfs_register_blkdev> in drivers/block/floppy.c,
1650 + drivers/scsi/sr.c and drivers/block/md.c
1651 +
1652 +- Moved DAC960 devices to /dev/dac960
1653 +===============================================================================
1654 +Changes for patch v147
1655 +
1656 +Work sponsored by SGI
1657 +
1658 +- Ported to kernel 2.3.32-pre4
1659 +===============================================================================
1660 +Changes for patch v148
1661 +
1662 +Work sponsored by SGI
1663 +
1664 +- Removed kmod support: use devfsd instead
1665 +
1666 +- Moved miscellaneous character devices to /dev/misc
1667 +===============================================================================
1668 +Changes for patch v149
1669 +
1670 +Work sponsored by SGI
1671 +
1672 +- Ensure include/linux/joystick.h is OK for user-space
1673 +
1674 +- Improved debugging in <get_vfs_inode>
1675 +
1676 +- Ensure dentries created by devfsd will be cleaned up
1677 +===============================================================================
1678 +Changes for patch v150
1679 +
1680 +Work sponsored by SGI
1681 +
1682 +- Ported to kernel 2.3.34
1683 +===============================================================================
1684 +Changes for patch v151
1685 +
1686 +Work sponsored by SGI
1687 +
1688 +- Ported to kernel 2.3.35-pre1
1689 +
1690 +- Created <devfs_get_name>
1691 +===============================================================================
1692 +Changes for patch v152
1693 +
1694 +Work sponsored by SGI
1695 +
1696 +- Updated sample modules.conf
1697 +
1698 +- Ported to kernel 2.3.36-pre1
1699 +===============================================================================
1700 +Changes for patch v153
1701 +
1702 +Work sponsored by SGI
1703 +
1704 +- Ported to kernel 2.3.42
1705 +
1706 +- Removed <devfs_fill_file>
1707 +===============================================================================
1708 +Changes for patch v154
1709 +
1710 +Work sponsored by SGI
1711 +
1712 +- Took account of device number changes for /dev/fb*
1713 +===============================================================================
1714 +Changes for patch v155
1715 +
1716 +Work sponsored by SGI
1717 +
1718 +- Ported to kernel 2.3.43-pre8
1719 +
1720 +- Moved /dev/tty0 to /dev/vc/0
1721 +
1722 +- Moved sequence number formatting from <_tty_make_name> to drivers
1723 +===============================================================================
1724 +Changes for patch v156
1725 +
1726 +Work sponsored by SGI
1727 +
1728 +- Fixed breakage in drivers/scsi/sd.c due to recent SCSI changes
1729 +===============================================================================
1730 +Changes for patch v157
1731 +
1732 +Work sponsored by SGI
1733 +
1734 +- Ported to kernel 2.3.45
1735 +===============================================================================
1736 +Changes for patch v158
1737 +
1738 +Work sponsored by SGI
1739 +
1740 +- Ported to kernel 2.3.46-pre2
1741 +===============================================================================
1742 +Changes for patch v159
1743 +
1744 +Work sponsored by SGI
1745 +
1746 +- Fixed drivers/block/md.c
1747 + Thanks to Mike Galbraith <mikeg@weiden.de>
1748 +
1749 +- Documentation fixes
1750 +
1751 +- Moved device registration from <lp_init> to <lp_register>
1752 + Thanks to Tim Waugh <twaugh@redhat.com>
1753 +===============================================================================
1754 +Changes for patch v160
1755 +
1756 +Work sponsored by SGI
1757 +
1758 +- Fixed drivers/char/joystick/joystick.c
1759 + Thanks to Vojtech Pavlik <vojtech@suse.cz>
1760 +
1761 +- Documentation updates
1762 +
1763 +- Fixed arch/i386/kernel/mtrr.c if procfs and devfs not enabled
1764 +
1765 +- Fixed drivers/char/stallion.c
1766 +===============================================================================
1767 +Changes for patch v161
1768 +
1769 +Work sponsored by SGI
1770 +
1771 +- Remove /dev/ide when ide-mod is unloaded
1772 +
1773 +- Fixed bug in drivers/block/ide-probe.c when secondary but no primary
1774 +
1775 +- Added DEVFS_FL_NO_PERSISTENCE flag
1776 +
1777 +- Used new DEVFS_FL_NO_PERSISTENCE flag for Unix98 pty slaves
1778 +
1779 +- Removed unnecessary call to <update_devfs_inode_from_entry> in
1780 + <devfs_readdir>
1781 +
1782 +- Only set auto-ownership for /dev/pty/s*
1783 +===============================================================================
1784 +Changes for patch v162
1785 +
1786 +Work sponsored by SGI
1787 +
1788 +- Set inode->i_size to correct size for symlinks
1789 + Thanks to Jeremy Fitzhardinge <jeremy@goop.org>
1790 +
1791 +- Only give lookup() method to directories to comply with new VFS
1792 + assumptions
1793 +
1794 +- Remove unnecessary tests in symlink methods
1795 +
1796 +- Don't kill existing block ops in <devfs_read_inode>
1797 +
1798 +- Restore auto-ownership for /dev/pty/m*
1799 +===============================================================================
1800 +Changes for patch v163
1801 +
1802 +Work sponsored by SGI
1803 +
1804 +- Don't create missing directories in <devfs_find_handle>
1805 +
1806 +- Removed Documentation/filesystems/devfs/mk-devlinks
1807 +
1808 +- Updated Documentation/filesystems/devfs/README
1809 +===============================================================================
1810 +Changes for patch v164
1811 +
1812 +Work sponsored by SGI
1813 +
1814 +- Fixed CONFIG_DEVFS breakage in drivers/char/serial.c introduced in
1815 + linux-2.3.99-pre6-7
1816 +===============================================================================
1817 +Changes for patch v165
1818 +
1819 +Work sponsored by SGI
1820 +
1821 +- Ported to kernel 2.3.99-pre6
1822 +===============================================================================
1823 +Changes for patch v166
1824 +
1825 +Work sponsored by SGI
1826 +
1827 +- Added CONFIG_DEVFS_MOUNT
1828 +===============================================================================
1829 +Changes for patch v167
1830 +
1831 +Work sponsored by SGI
1832 +
1833 +- Updated Documentation/filesystems/devfs/README
1834 +
1835 +- Updated sample modules.conf
1836 +===============================================================================
1837 +Changes for patch v168
1838 +
1839 +Work sponsored by SGI
1840 +
1841 +- Disabled multi-mount capability (use VFS bindings instead)
1842 +
1843 +- Updated README from master HTML file
1844 +===============================================================================
1845 +Changes for patch v169
1846 +
1847 +Work sponsored by SGI
1848 +
1849 +- Removed multi-mount code
1850 +
1851 +- Removed compatibility macros: VFS has changed too much
1852 +===============================================================================
1853 +Changes for patch v170
1854 +
1855 +Work sponsored by SGI
1856 +
1857 +- Updated README from master HTML file
1858 +
1859 +- Merged devfs inode into devfs entry
1860 +===============================================================================
1861 +Changes for patch v171
1862 +
1863 +Work sponsored by SGI
1864 +
1865 +- Updated sample modules.conf
1866 +
1867 +- Removed dead code in <devfs_register> which used to call
1868 + <free_dentries>
1869 +
1870 +- Ported to kernel 2.4.0-test2-pre3
1871 +===============================================================================
1872 +Changes for patch v172
1873 +
1874 +Work sponsored by SGI
1875 +
1876 +- Changed interface to <devfs_register>
1877 +
1878 +- Changed interface to <devfs_register_series>
1879 +===============================================================================
1880 +Changes for patch v173
1881 +
1882 +Work sponsored by SGI
1883 +
1884 +- Simplified interface to <devfs_mk_symlink>
1885 +
1886 +- Simplified interface to <devfs_mk_dir>
1887 +
1888 +- Simplified interface to <devfs_find_handle>
1889 +===============================================================================
1890 +Changes for patch v174
1891 +
1892 +Work sponsored by SGI
1893 +
1894 +- Updated README from master HTML file
1895 +===============================================================================
1896 +Changes for patch v175
1897 +
1898 +Work sponsored by SGI
1899 +
1900 +- DocBook update for fs/devfs/base.c
1901 + Thanks to Tim Waugh <twaugh@redhat.com>
1902 +
1903 +- Removed stale fs/tunnel.c (was never used or completed)
1904 +===============================================================================
1905 +Changes for patch v176
1906 +
1907 +Work sponsored by SGI
1908 +
1909 +- Updated ToDo list
1910 +
1911 +- Removed sample modules.conf: now distributed with devfsd
1912 +
1913 +- Updated README from master HTML file
1914 +
1915 +- Ported to kernel 2.4.0-test3-pre4 (which had devfs-patch-v174)
1916 +===============================================================================
1917 +Changes for patch v177
1918 +
1919 +- Updated README from master HTML file
1920 +
1921 +- Documentation cleanups
1922 +
1923 +- Ensure <devfs_generate_path> terminates string for root entry
1924 + Thanks to Tim Jansen <tim@tjansen.de>
1925 +
1926 +- Exported <devfs_get_name> to modules
1927 +
1928 +- Make <devfs_mk_symlink> send events to devfsd
1929 +
1930 +- Cleaned up option processing in <devfs_setup>
1931 +
1932 +- Fixed bugs in handling symlinks: could leak or cause Oops
1933 +
1934 +- Cleaned up directory handling by separating fops
1935 + Thanks to Alexander Viro <viro@parcelfarce.linux.theplanet.co.uk>
1936 +===============================================================================
1937 +Changes for patch v178
1938 +
1939 +- Fixed handling of inverted options in <devfs_setup>
1940 +===============================================================================
1941 +Changes for patch v179
1942 +
1943 +- Adjusted <try_modload> to account for <devfs_generate_path> fix
1944 +===============================================================================
1945 +Changes for patch v180
1946 +
1947 +- Fixed !CONFIG_DEVFS_FS stub declaration of <devfs_get_info>
1948 +===============================================================================
1949 +Changes for patch v181
1950 +
1951 +- Answered question posed by Al Viro and removed his comments from <devfs_open>
1952 +
1953 +- Moved setting of registered flag after other fields are changed
1954 +
1955 +- Fixed race between <devfsd_close> and <devfsd_notify_one>
1956 +
1957 +- Global VFS changes added bogus BKL to devfsd_close(): removed
1958 +
1959 +- Widened locking in <devfs_readlink> and <devfs_follow_link>
1960 +
1961 +- Replaced <devfsd_read> stack usage with <devfsd_ioctl> kmalloc
1962 +
1963 +- Simplified locking in <devfsd_ioctl> and fixed memory leak
1964 +===============================================================================
1965 +Changes for patch v182
1966 +
1967 +- Created <devfs_*alloc_major> and <devfs_*alloc_devnum>
1968 +
1969 +- Removed broken devnum allocation and use <devfs_alloc_devnum>
1970 +
1971 +- Fixed old devnum leak by calling new <devfs_dealloc_devnum>
1972 +
1973 +- Created <devfs_*alloc_unique_number>
1974 +
1975 +- Fixed number leak for /dev/cdroms/cdrom%d
1976 +
1977 +- Fixed number leak for /dev/discs/disc%d
1978 +===============================================================================
1979 +Changes for patch v183
1980 +
1981 +- Fixed bug in <devfs_setup> which could hang boot process
1982 +===============================================================================
1983 +Changes for patch v184
1984 +
1985 +- Documentation typo fix for fs/devfs/util.c
1986 +
1987 +- Fixed drivers/char/stallion.c for devfs
1988 +
1989 +- Added DEVFSD_NOTIFY_DELETE event
1990 +
1991 +- Updated README from master HTML file
1992 +
1993 +- Removed #include <asm/segment.h> from fs/devfs/base.c
1994 +===============================================================================
1995 +Changes for patch v185
1996 +
1997 +- Made <block_semaphore> and <char_semaphore> in fs/devfs/util.c
1998 + private
1999 +
2000 +- Fixed inode table races by removing it and using inode->u.generic_ip
2001 + instead
2002 +
2003 +- Moved <devfs_read_inode> into <get_vfs_inode>
2004 +
2005 +- Moved <devfs_write_inode> into <devfs_notify_change>
2006 +===============================================================================
2007 +Changes for patch v186
2008 +
2009 +- Fixed race in <devfs_do_symlink> for uni-processor
2010 +
2011 +- Updated README from master HTML file
2012 +===============================================================================
2013 +Changes for patch v187
2014 +
2015 +- Fixed drivers/char/stallion.c for devfs
2016 +
2017 +- Fixed drivers/char/rocket.c for devfs
2018 +
2019 +- Fixed bug in <devfs_alloc_unique_number>: limited to 128 numbers
2020 +===============================================================================
2021 +Changes for patch v188
2022 +
2023 +- Updated major masks in fs/devfs/util.c up to Linus' "no new majors"
2024 + proclamation. Block: were 126 now 122 free, char: were 26 now 19 free
2025 +
2026 +- Updated README from master HTML file
2027 +
2028 +- Removed remnant of multi-mount support in <devfs_mknod>
2029 +
2030 +- Removed unused DEVFS_FL_SHOW_UNREG flag
2031 +===============================================================================
2032 +Changes for patch v189
2033 +
2034 +- Removed nlink field from struct devfs_inode
2035 +
2036 +- Removed auto-ownership for /dev/pty/* (BSD ptys) and used
2037 + DEVFS_FL_CURRENT_OWNER|DEVFS_FL_NO_PERSISTENCE for /dev/pty/s* (just
2038 + like Unix98 pty slaves) and made /dev/pty/m* rw-rw-rw- access
2039 +===============================================================================
2040 +Changes for patch v190
2041 +
2042 +- Updated README from master HTML file
2043 +
2044 +- Replaced BKL with global rwsem to protect symlink data (quick and
2045 + dirty hack)
2046 +===============================================================================
2047 +Changes for patch v191
2048 +
2049 +- Replaced global rwsem for symlink with per-link refcount
2050 +===============================================================================
2051 +Changes for patch v192
2052 +
2053 +- Removed unnecessary #ifdef CONFIG_DEVFS_FS from arch/i386/kernel/mtrr.c
2054 +
2055 +- Ported to kernel 2.4.10-pre11
2056 +
2057 +- Set inode->i_mapping->a_ops for block nodes in <get_vfs_inode>
2058 +===============================================================================
2059 +Changes for patch v193
2060 +
2061 +- Went back to global rwsem for symlinks (refcount scheme no good)
2062 +===============================================================================
2063 +Changes for patch v194
2064 +
2065 +- Fixed overrun in <devfs_link> by removing function (not needed)
2066 +
2067 +- Updated README from master HTML file
2068 +===============================================================================
2069 +Changes for patch v195
2070 +
2071 +- Fixed buffer underrun in <try_modload>
2072 +
2073 +- Moved down_read() from <search_for_entry_in_dir> to <find_entry>
2074 +===============================================================================
2075 +Changes for patch v196
2076 +
2077 +- Fixed race in <devfsd_ioctl> when setting event mask
2078 + Thanks to Kari Hurtta <hurtta@leija.mh.fmi.fi>
2079 +
2080 +- Avoid deadlock in <devfs_follow_link> by using temporary buffer
2081 +===============================================================================
2082 +Changes for patch v197
2083 +
2084 +- First release of new locking code for devfs core (v1.0)
2085 +
2086 +- Fixed bug in drivers/cdrom/cdrom.c
2087 +===============================================================================
2088 +Changes for patch v198
2089 +
2090 +- Discard temporary buffer, now use "%s" for dentry names
2091 +
2092 +- Don't generate path in <try_modload>: use fake entry instead
2093 +
2094 +- Use "existing" directory in <_devfs_make_parent_for_leaf>
2095 +
2096 +- Use slab cache rather than fixed buffer for devfsd events
2097 +===============================================================================
2098 +Changes for patch v199
2099 +
2100 +- Removed obsolete usage of DEVFS_FL_NO_PERSISTENCE
2101 +
2102 +- Send DEVFSD_NOTIFY_REGISTERED events in <devfs_mk_dir>
2103 +
2104 +- Fixed locking bug in <devfs_d_revalidate_wait> due to typo
2105 +
2106 +- Do not send CREATE, CHANGE, ASYNC_OPEN or DELETE events from devfsd
2107 + or children
2108 +===============================================================================
2109 +Changes for patch v200
2110 +
2111 +- Ported to kernel 2.5.1-pre2
2112 +===============================================================================
2113 +Changes for patch v201
2114 +
2115 +- Fixed bug in <devfsd_read>: was dereferencing freed pointer
2116 +===============================================================================
2117 +Changes for patch v202
2118 +
2119 +- Fixed bug in <devfsd_close>: was dereferencing freed pointer
2120 +
2121 +- Added process group check for devfsd privileges
2122 +===============================================================================
2123 +Changes for patch v203
2124 +
2125 +- Use SLAB_ATOMIC in <devfsd_notify_de> from <devfs_d_delete>
2126 +===============================================================================
2127 +Changes for patch v204
2128 +
2129 +- Removed long obsolete rc.devfs
2130 +
2131 +- Return old entry in <devfs_mk_dir> for 2.4.x kernels
2132 +
2133 +- Updated README from master HTML file
2134 +
2135 +- Increment refcount on module in <check_disc_changed>
2136 +
2137 +- Created <devfs_get_handle> and exported <devfs_put>
2138 +
2139 +- Increment refcount on module in <devfs_get_ops>
2140 +
2141 +- Created <devfs_put_ops> and used where needed to fix races
2142 +
2143 +- Added clarifying comments in response to preliminary EMC code review
2144 +
2145 +- Added poisoning to <devfs_put>
2146 +
2147 +- Improved debugging messages
2148 +
2149 +- Fixed unregister bugs in drivers/md/lvm-fs.c
2150 +===============================================================================
2151 +Changes for patch v205
2152 +
2153 +- Corrected (made useful) debugging message in <unregister>
2154 +
2155 +- Moved <kmem_cache_create> in <mount_devfs_fs> to <init_devfs_fs>
2156 +
2157 +- Fixed drivers/md/lvm-fs.c to create "lvm" entry
2158 +
2159 +- Added magic number to guard against scribbling drivers
2160 +
2161 +- Only return old entry in <devfs_mk_dir> if a directory
2162 +
2163 +- Defined macros for error and debug messages
2164 +
2165 +- Updated README from master HTML file
2166 +===============================================================================
2167 +Changes for patch v206
2168 +
2169 +- Added support for multiple Compaq cpqarray controllers
2170 +
2171 +- Fixed (rare, old) race in <devfs_lookup>
2172 +===============================================================================
2173 +Changes for patch v207
2174 +
2175 +- Fixed deadlock bug in <devfs_d_revalidate_wait>
2176 +
2177 +- Tag VFS deletable in <devfs_mk_symlink> if handle ignored
2178 +
2179 +- Updated README from master HTML file
2180 +===============================================================================
2181 +Changes for patch v208
2182 +
2183 +- Added KERN_* to remaining messages
2184 +
2185 +- Cleaned up declaration of <stat_read>
2186 +
2187 +- Updated README from master HTML file
2188 +===============================================================================
2189 +Changes for patch v209
2190 +
2191 +- Updated README from master HTML file
2192 +
2193 +- Removed silently introduced calls to lock_kernel() and
2194 + unlock_kernel() due to recent VFS locking changes. BKL isn't
2195 + required in devfs
2196 +
2197 +- Changed <devfs_rmdir> to allow later additions if not yet empty
2198 +
2199 +- Added calls to <devfs_register_partitions> in drivers/block/blkpc.c
2200 + <add_partition> and <del_partition>
2201 +
2202 +- Fixed bug in <devfs_alloc_unique_number>: was clearing beyond
2203 + bitfield
2204 +
2205 +- Fixed bitfield data type for <devfs_*alloc_devnum>
2206 +
2207 +- Made major bitfield type and initialiser 64 bit safe
2208 +===============================================================================
2209 +Changes for patch v210
2210 +
2211 +- Updated fs/devfs/util.c to fix shift warning on 64 bit machines
2212 + Thanks to Anton Blanchard <anton@samba.org>
2213 +
2214 +- Updated README from master HTML file
2215 +===============================================================================
2216 +Changes for patch v211
2217 +
2218 +- Do not put miscellaneous character devices in /dev/misc if they
2219 + specify their own directory (i.e. contain a '/' character)
2220 +
2221 +- Copied macro for error messages from fs/devfs/base.c to
2222 + fs/devfs/util.c and made use of this macro
2223 +
2224 +- Removed 2.4.x compatibility code from fs/devfs/base.c
2225 +===============================================================================
2226 +Changes for patch v212
2227 +
2228 +- Added BKL to <devfs_open> because drivers still need it
2229 +===============================================================================
2230 +Changes for patch v213
2231 +
2232 +- Protected <scan_dir_for_removable> and <get_removable_partition>
2233 + from changing directory contents
2234 +===============================================================================
2235 +Changes for patch v214
2236 +
2237 +- Switched to ISO C structure field initialisers
2238 +
2239 +- Switch to set_current_state() and move before add_wait_queue()
2240 +
2241 +- Updated README from master HTML file
2242 +
2243 +- Fixed devfs entry leak in <devfs_readdir> when *readdir fails
2244 +===============================================================================
2245 +Changes for patch v215
2246 +
2247 +- Created <devfs_find_and_unregister>
2248 +
2249 +- Switched many functions from <devfs_find_handle> to
2250 + <devfs_find_and_unregister>
2251 +
2252 +- Switched many functions from <devfs_find_handle> to <devfs_get_handle>
2253 +===============================================================================
2254 +Changes for patch v216
2255 +
2256 +- Switched arch/ia64/sn/io/hcl.c from <devfs_find_handle> to
2257 + <devfs_get_handle>
2258 +
2259 +- Removed deprecated <devfs_find_handle>
2260 +===============================================================================
2261 +Changes for patch v217
2262 +
2263 +- Exported <devfs_find_and_unregister> and <devfs_only> to modules
2264 +
2265 +- Updated README from master HTML file
2266 +
2267 +- Fixed module unload race in <devfs_open>
2268 +===============================================================================
2269 +Changes for patch v218
2270 +
2271 +- Removed DEVFS_FL_AUTO_OWNER flag
2272 +
2273 +- Switched lingering structure field initialiser to ISO C
2274 +
2275 +- Added locking when setting/clearing flags
2276 +
2277 +- Documentation fix in fs/devfs/util.c
2278 diff -urN linux-2.6.19.old/Documentation/filesystems/devfs/README linux-2.6.19.dev/Documentation/filesystems/devfs/README
2279 --- linux-2.6.19.old/Documentation/filesystems/devfs/README 1970-01-01 01:00:00.000000000 +0100
2280 +++ linux-2.6.19.dev/Documentation/filesystems/devfs/README 2006-12-14 03:12:59.000000000 +0100
2281 @@ -0,0 +1,1959 @@
2282 +Devfs (Device File System) FAQ
2283 +
2284 +
2285 +Linux Devfs (Device File System) FAQ
2286 +Richard Gooch
2287 +20-AUG-2002
2288 +
2289 +
2290 +Document languages:
2291 +
2292 +
2293 +
2294 +
2295 +
2296 +
2297 +
2298 +-----------------------------------------------------------------------------
2299 +
2300 +NOTE: the master copy of this document is available online at:
2301 +
2302 +http://www.atnf.csiro.au/~rgooch/linux/docs/devfs.html
2303 +and looks much better than the text version distributed with the
2304 +kernel sources. A mirror site is available at:
2305 +
2306 +http://www.ras.ucalgary.ca/~rgooch/linux/docs/devfs.html
2307 +
2308 +There is also an optional daemon that may be used with devfs. You can
2309 +find out more about it at:
2310 +
2311 +http://www.atnf.csiro.au/~rgooch/linux/
2312 +
2313 +A mailing list is available which you may subscribe to. Send
2314 +email
2315 +to majordomo@oss.sgi.com with the following line in the
2316 +body of the message:
2317 +subscribe devfs
2318 +To unsubscribe, send the message body:
2319 +unsubscribe devfs
2320 +instead. The list is archived at
2321 +
2322 +http://oss.sgi.com/projects/devfs/archive/.
2323 +
2324 +-----------------------------------------------------------------------------
2325 +
2326 +Contents
2327 +
2328 +
2329 +What is it?
2330 +
2331 +Why do it?
2332 +
2333 +Who else does it?
2334 +
2335 +How it works
2336 +
2337 +Operational issues (essential reading)
2338 +
2339 +Instructions for the impatient
2340 +Permissions persistence across reboots
2341 +Dealing with drivers without devfs support
2342 +All the way with Devfs
2343 +Other Issues
2344 +Kernel Naming Scheme
2345 +Devfsd Naming Scheme
2346 +Old Compatibility Names
2347 +SCSI Host Probing Issues
2348 +
2349 +
2350 +
2351 +Device drivers currently ported
2352 +
2353 +Allocation of Device Numbers
2354 +
2355 +Questions and Answers
2356 +
2357 +Making things work
2358 +Alternatives to devfs
2359 +What I don't like about devfs
2360 +How to report bugs
2361 +Strange kernel messages
2362 +Compilation problems with devfsd
2363 +
2364 +
2365 +Other resources
2366 +
2367 +Translations of this document
2368 +
2369 +
2370 +-----------------------------------------------------------------------------
2371 +
2372 +
2373 +What is it?
2374 +
2375 +Devfs is an alternative to "real" character and block special devices
2376 +on your root filesystem. Kernel device drivers can register devices by
2377 +name rather than major and minor numbers. These devices will appear in
2378 +devfs automatically, with whatever default ownership and
2379 +protection the driver specified. A daemon (devfsd) can be used to
2380 +override these defaults. Devfs has been in the kernel since 2.3.46.
2381 +
2382 +NOTE that devfs is entirely optional. If you prefer the old
2383 +disc-based device nodes, then simply leave CONFIG_DEVFS_FS=n (the
2384 +default). In this case, nothing will change. ALSO NOTE that if you do
2385 +enable devfs, the defaults are such that full compatibility is
2386 +maintained with the old devices names.
2387 +
2388 +There are two aspects to devfs: one is the underlying device
2389 +namespace, which is a namespace just like any mounted filesystem. The
2390 +other aspect is the filesystem code which provides a view of the
2391 +device namespace. The reason I make a distinction is because devfs
2392 +can be mounted many times, with each mount showing the same device
2393 +namespace. Changes made are global to all mounted devfs filesystems.
2394 +Also, because the devfs namespace exists without any devfs mounts, you
2395 +can easily mount the root filesystem by referring to an entry in the
2396 +devfs namespace.
2397 +
2398 +
2399 +The cost of devfs is a small increase in kernel code size and memory
2400 +usage. About 7 pages of code (some of that in __init sections) and 72
2401 +bytes for each entry in the namespace. A modest system has only a
2402 +couple of hundred device entries, so this costs a few more
2403 +pages. Compare this with the suggestion to put /dev on a <a
2404 +href="#why-faq-ramdisc">ramdisc.
2405 +
2406 +On a typical machine, the cost is under 0.2 percent. On a modest
2407 +system with 64 MBytes of RAM, the cost is under 0.1 percent. The
2408 +accusations of "bloatware" levelled at devfs are not justified.
2409 +
2410 +-----------------------------------------------------------------------------
2411 +
2412 +
2413 +Why do it?
2414 +
2415 +There are several problems that devfs addresses. Some of these
2416 +problems are more serious than others (depending on your point of
2417 +view), and some can be solved without devfs. However, the totality of
2418 +these problems really calls out for devfs.
2419 +
2420 +The choice is a patchwork of inefficient user space solutions, which
2421 +are complex and likely to be fragile, or to use a simple and efficient
2422 +devfs which is robust.
2423 +
2424 +There have been many counter-proposals to devfs, all seeking to
2425 +provide some of the benefits without actually implementing devfs. So
2426 +far there has been an absence of code and no proposed alternative has
2427 +been able to provide all the features that devfs does. Further,
2428 +alternative proposals require far more complexity in user-space (and
2429 +still deliver less functionality than devfs). Some people have the
2430 +mantra of reducing "kernel bloat", but don't consider the effects on
2431 +user-space.
2432 +
2433 +A good solution limits the total complexity of kernel-space and
2434 +user-space.
2435 +
2436 +
2437 +Major&minor allocation
2438 +
2439 +The existing scheme requires the allocation of major and minor device
2440 +numbers for each and every device. This means that a central
2441 +co-ordinating authority is required to issue these device numbers
2442 +(unless you're developing a "private" device driver), in order to
2443 +preserve uniqueness. Devfs shifts the burden to a namespace. This may
2444 +not seem like a huge benefit, but actually it is. Since driver authors
2445 +will naturally choose a device name which reflects the functionality
2446 +of the device, there is far less potential for namespace conflict.
2447 +Solving this requires a kernel change.
2448 +
2449 +/dev management
2450 +
2451 +Because you currently access devices through device nodes, these must
2452 +be created by the system administrator. For standard devices you can
2453 +usually find a MAKEDEV programme which creates all these (hundreds!)
2454 +of nodes. This means that changes in the kernel must be reflected by
2455 +changes in the MAKEDEV programme, or else the system administrator
2456 +creates device nodes by hand.
2457 +
2458 +The basic problem is that there are two separate databases of
2459 +major and minor numbers. One is in the kernel and one is in /dev (or
2460 +in a MAKEDEV programme, if you want to look at it that way). This is
2461 +duplication of information, which is not good practice.
2462 +Solving this requires a kernel change.
2463 +
2464 +/dev growth
2465 +
2466 +A typical /dev has over 1200 nodes! Most of these devices simply don't
2467 +exist because the hardware is not available. A huge /dev increases the
2468 +time to access devices (I'm just referring to the dentry lookup times
2469 +and the time taken to read inodes off disc: the next subsection shows
2470 +some more horrors).
2471 +
2472 +An example of how big /dev can grow is if we consider SCSI devices:
2473 +
2474 +host 6 bits (say up to 64 hosts on a really big machine)
2475 +channel 4 bits (say up to 16 SCSI buses per host)
2476 +id 4 bits
2477 +lun 3 bits
2478 +partition 6 bits
2479 +TOTAL 23 bits
2480 +
2481 +
2482 +This requires 8 Mega (1024*1024) inodes if we want to store all
2483 +possible device nodes. Even if we scrap everything but id,partition
2484 +and assume a single host adapter with a single SCSI bus and only one
2485 +logical unit per SCSI target (id), that's still 10 bits or 1024
2486 +inodes. Each VFS inode takes around 256 bytes (kernel 2.1.78), so
2487 +that's 256 kBytes of inode storage on disc (assuming real inodes take
2488 +a similar amount of space as VFS inodes). This is actually not so bad,
2489 +because disc is cheap these days. Embedded systems would care about
2490 +256 kBytes of /dev inodes, but you could argue that embedded systems
2491 +would have hand-tuned /dev directories. I've had to do just that on my
2492 +embedded systems, but I would rather just leave it to devfs.
2493 +
2494 +Another issue is the time taken to lookup an inode when first
2495 +referenced. Not only does this take time in scanning through a list in
2496 +memory, but also the seek times to read the inodes off disc.
2497 +This could be solved in user-space using a clever programme which
2498 +scanned the kernel logs and deleted /dev entries which are not
2499 +available and created them when they were available. This programme
2500 +would need to be run every time a new module was loaded, which would
2501 +slow things down a lot.
2502 +
2503 +There is an existing programme called scsidev which will automatically
2504 +create device nodes for SCSI devices. It can do this by scanning files
2505 +in /proc/scsi. Unfortunately, to extend this idea to other device
2506 +nodes would require significant modifications to existing drivers (so
2507 +they too would provide information in /proc). This is a non-trivial
2508 +change (I should know: devfs has had to do something similar). Once
2509 +you go to this much effort, you may as well use devfs itself (which
2510 +also provides this information). Furthermore, such a system would
2511 +likely be implemented in an ad-hoc fashion, as different drivers will
2512 +provide their information in different ways.
2513 +
2514 +Devfs is much cleaner, because it (naturally) has a uniform mechanism
2515 +to provide this information: the device nodes themselves!
2516 +
2517 +
2518 +Node to driver file_operations translation
2519 +
2520 +There is an important difference between the way disc-based character
2521 +and block nodes and devfs entries make the connection between an entry
2522 +in /dev and the actual device driver.
2523 +
2524 +With the current 8 bit major and minor numbers the connection between
2525 +disc-based c&b nodes and per-major drivers is done through a
2526 +fixed-length table of 128 entries. The various filesystem types set
2527 +the inode operations for c&b nodes to {chr,blk}dev_inode_operations,
2528 +so when a device is opened a few quick levels of indirection bring us
2529 +to the driver file_operations.
2530 +
2531 +For miscellaneous character devices a second step is required: there
2532 +is a scan for the driver entry with the same minor number as the file
2533 +that was opened, and the appropriate minor open method is called. This
2534 +scanning is done *every time* you open a device node. Potentially, you
2535 +may be searching through dozens of misc. entries before you find your
2536 +open method. While not an enormous performance overhead, this does
2537 +seem pointless.
2538 +
2539 +Linux *must* move beyond the 8 bit major and minor barrier,
2540 +somehow. If we simply increase each to 16 bits, then the indexing
2541 +scheme used for major driver lookup becomes untenable, because the
2542 +major tables (one each for character and block devices) would need to
2543 +be 64 k entries long (512 kBytes on x86, 1 MByte for 64 bit
2544 +systems). So we would have to use a scheme like that used for
2545 +miscellaneous character devices, which means the search time goes up
2546 +linearly with the average number of major device drivers on your
2547 +system. Not all "devices" are hardware, some are higher-level drivers
2548 +like KGI, so you can get more "devices" without adding hardware
2549 +You can improve this by creating an ordered (balanced:-)
2550 +binary tree, in which case your search time becomes log(N).
2551 +Alternatively, you can use hashing to speed up the search.
2552 +But why do that search at all if you don't have to? Once again, it
2553 +seems pointless.
2554 +
2555 +Note that devfs doesn't use the major&minor system. For devfs
2556 +entries, the connection is done when you lookup the /dev entry. When
2557 +devfs_register() is called, an internal table is appended which has
2558 +the entry name and the file_operations. If the dentry cache doesn't
2559 +have the /dev entry already, this internal table is scanned to get the
2560 +file_operations, and an inode is created. If the dentry cache already
2561 +has the entry, there is *no lookup time* (other than the dentry scan
2562 +itself, but we can't avoid that anyway, and besides Linux dentries
2563 +cream other OS's which don't have them:-). Furthermore, the number of
2564 +node entries in a devfs is only the number of available device
2565 +entries, not the number of *conceivable* entries. Even if you remove
2566 +unnecessary entries in a disc-based /dev, the number of conceivable
2567 +entries remains the same: you just limit yourself in order to save
2568 +space.
2569 +
2570 +Devfs provides a fast connection between a VFS node and the device
2571 +driver, in a scalable way.
2572 +
2573 +/dev as a system administration tool
2574 +
2575 +Right now /dev contains a list of conceivable devices, most of which I
2576 +don't have. Devfs only shows those devices available on my
2577 +system. This means that listing /dev is a handy way of checking what
2578 +devices are available.
2579 +
2580 +Major&minor size
2581 +
2582 +Existing major and minor numbers are limited to 8 bits each. This is
2583 +now a limiting factor for some drivers, particularly the SCSI disc
2584 +driver, which consumes a single major number. Only 16 discs are
2585 +supported, and each disc may have only 15 partitions. Maybe this isn't
2586 +a problem for you, but some of us are building huge Linux systems with
2587 +disc arrays. With devfs an arbitrary pointer can be associated with
2588 +each device entry, which can be used to give an effective 32 bit
2589 +device identifier (i.e. that's like having a 32 bit minor
2590 +number). Since this is private to the kernel, there are no C library
2591 +compatibility issues which you would have with increasing major and
2592 +minor number sizes. See the section on "Allocation of Device Numbers"
2593 +for details on maintaining compatibility with userspace.
2594 +
2595 +Solving this requires a kernel change.
2596 +
2597 +Since writing this, the kernel has been modified so that the SCSI disc
2598 +driver has more major numbers allocated to it and now supports up to
2599 +128 discs. Since these major numbers are non-contiguous (a result of
2600 +unplanned expansion), the implementation is a little more cumbersome
2601 +than originally.
2602 +
2603 +Just like the changes to IPv4 to fix impending limitations in the
2604 +address space, people find ways around the limitations. In the long
2605 +run, however, solutions like IPv6 or devfs can't be put off forever.
2606 +
2607 +Read-only root filesystem
2608 +
2609 +Having your device nodes on the root filesystem means that you can't
2610 +operate properly with a read-only root filesystem. This is because you
2611 +want to change ownerships and protections of tty devices. Existing
2612 +practice prevents you using a CD-ROM as your root filesystem for a
2613 +*real* system. Sure, you can boot off a CD-ROM, but you can't change
2614 +tty ownerships, so it's only good for installing.
2615 +
2616 +Also, you can't use a shared NFS root filesystem for a cluster of
2617 +discless Linux machines (having tty ownerships changed on a common
2618 +/dev is not good). Nor can you embed your root filesystem in a
2619 +ROM-FS.
2620 +
2621 +You can get around this by creating a RAMDISC at boot time, making
2622 +an ext2 filesystem in it, mounting it somewhere and copying the
2623 +contents of /dev into it, then unmounting it and mounting it over
2624 +/dev.
2625 +
2626 +A devfs is a cleaner way of solving this.
2627 +
2628 +Non-Unix root filesystem
2629 +
2630 +Non-Unix filesystems (such as NTFS) can't be used for a root
2631 +filesystem because they variously don't support character and block
2632 +special files or symbolic links. You can't have a separate disc-based
2633 +or RAMDISC-based filesystem mounted on /dev because you need device
2634 +nodes before you can mount these. Devfs can be mounted without any
2635 +device nodes. Devlinks won't work because symlinks aren't supported.
2636 +An alternative solution is to use initrd to mount a RAMDISC initial
2637 +root filesystem (which is populated with a minimal set of device
2638 +nodes), and then construct a new /dev in another RAMDISC, and finally
2639 +switch to your non-Unix root filesystem. This requires clever boot
2640 +scripts and a fragile and conceptually complex boot procedure.
2641 +
2642 +Devfs solves this in a robust and conceptually simple way.
2643 +
2644 +PTY security
2645 +
2646 +Current pseudo-tty (pty) devices are owned by root and read-writable
2647 +by everyone. The user of a pty-pair cannot change
2648 +ownership/protections without being suid-root.
2649 +
2650 +This could be solved with a secure user-space daemon which runs as
2651 +root and does the actual creation of pty-pairs. Such a daemon would
2652 +require modification to *every* programme that wants to use this new
2653 +mechanism. It also slows down creation of pty-pairs.
2654 +
2655 +An alternative is to create a new open_pty() syscall which does much
2656 +the same thing as the user-space daemon. Once again, this requires
2657 +modifications to pty-handling programmes.
2658 +
2659 +The devfs solution allows a device driver to "tag" certain device
2660 +files so that when an unopened device is opened, the ownerships are
2661 +changed to the current euid and egid of the opening process, and the
2662 +protections are changed to the default registered by the driver. When
2663 +the device is closed ownership is set back to root and protections are
2664 +set back to read-write for everybody. No programme need be changed.
2665 +The devpts filesystem provides this auto-ownership feature for Unix98
2666 +ptys. It doesn't support old-style pty devices, nor does it have all
2667 +the other features of devfs.
2668 +
2669 +Intelligent device management
2670 +
2671 +Devfs implements a simple yet powerful protocol for communication with
2672 +a device management daemon (devfsd) which runs in user space. It is
2673 +possible to send a message (either synchronously or asynchronously) to
2674 +devfsd on any event, such as registration/unregistration of device
2675 +entries, opening and closing devices, looking up inodes, scanning
2676 +directories and more. This has many possibilities. Some of these are
2677 +already implemented. See:
2678 +
2679 +
2680 +http://www.atnf.csiro.au/~rgooch/linux/
2681 +
2682 +Device entry registration events can be used by devfsd to change
2683 +permissions of newly-created device nodes. This is one mechanism to
2684 +control device permissions.
2685 +
2686 +Device entry registration/unregistration events can be used to run
2687 +programmes or scripts. This can be used to provide automatic mounting
2688 +of filesystems when a new block device media is inserted into the
2689 +drive.
2690 +
2691 +Asynchronous device open and close events can be used to implement
2692 +clever permissions management. For example, the default permissions on
2693 +/dev/dsp do not allow everybody to read from the device. This is
2694 +sensible, as you don't want some remote user recording what you say at
2695 +your console. However, the console user is also prevented from
2696 +recording. This behaviour is not desirable. With asynchronous device
2697 +open and close events, you can have devfsd run a programme or script
2698 +when console devices are opened to change the ownerships for *other*
2699 +device nodes (such as /dev/dsp). On closure, you can run a different
2700 +script to restore permissions. An advantage of this scheme over
2701 +modifying the C library tty handling is that this works even if your
2702 +programme crashes (how many times have you seen the utmp database with
2703 +lingering entries for non-existent logins?).
2704 +
2705 +Synchronous device open events can be used to perform intelligent
2706 +device access protections. Before the device driver open() method is
2707 +called, the daemon must first validate the open attempt, by running an
2708 +external programme or script. This is far more flexible than access
2709 +control lists, as access can be determined on the basis of other
2710 +system conditions instead of just the UID and GID.
2711 +
2712 +Inode lookup events can be used to authenticate module autoload
2713 +requests. Instead of using kmod directly, the event is sent to
2714 +devfsd which can implement an arbitrary authentication before loading
2715 +the module itself.
2716 +
2717 +Inode lookup events can also be used to construct arbitrary
2718 +namespaces, without having to resort to populating devfs with symlinks
2719 +to devices that don't exist.
2720 +
2721 +Speculative Device Scanning
2722 +
2723 +Consider an application (like cdparanoia) that wants to find all
2724 +CD-ROM devices on the system (SCSI, IDE and other types), whether or
2725 +not their respective modules are loaded. The application must
2726 +speculatively open certain device nodes (such as /dev/sr0 for the SCSI
2727 +CD-ROMs) in order to make sure the module is loaded. This requires
2728 +that all Linux distributions follow the standard device naming scheme
2729 +(last time I looked RedHat did things differently). Devfs solves the
2730 +naming problem.
2731 +
2732 +The same application also wants to see which devices are actually
2733 +available on the system. With the existing system it needs to read the
2734 +/dev directory and speculatively open each /dev/sr* device to
2735 +determine if the device exists or not. With a large /dev this is an
2736 +inefficient operation, especially if there are many /dev/sr* nodes. A
2737 +solution like scsidev could reduce the number of /dev/sr* entries (but
2738 +of course that also requires all that inefficient directory scanning).
2739 +
2740 +With devfs, the application can open the /dev/sr directory
2741 +(which triggers the module autoloading if required), and proceed to
2742 +read /dev/sr. Since only the available devices will have
2743 +entries, there are no inefficencies in directory scanning or device
2744 +openings.
2745 +
2746 +-----------------------------------------------------------------------------
2747 +
2748 +Who else does it?
2749 +
2750 +FreeBSD has a devfs implementation. Solaris and AIX each have a
2751 +pseudo-devfs (something akin to scsidev but for all devices, with some
2752 +unspecified kernel support). BeOS, Plan9 and QNX also have it. SGI's
2753 +IRIX 6.4 and above also have a device filesystem.
2754 +
2755 +While we shouldn't just automatically do something because others do
2756 +it, we should not ignore the work of others either. FreeBSD has a lot
2757 +of competent people working on it, so their opinion should not be
2758 +blithely ignored.
2759 +
2760 +-----------------------------------------------------------------------------
2761 +
2762 +
2763 +How it works
2764 +
2765 +Registering device entries
2766 +
2767 +For every entry (device node) in a devfs-based /dev a driver must call
2768 +devfs_register(). This adds the name of the device entry, the
2769 +file_operations structure pointer and a few other things to an
2770 +internal table. Device entries may be added and removed at any
2771 +time. When a device entry is registered, it automagically appears in
2772 +any mounted devfs'.
2773 +
2774 +Inode lookup
2775 +
2776 +When a lookup operation on an entry is performed and if there is no
2777 +driver information for that entry devfs will attempt to call
2778 +devfsd. If still no driver information can be found then a negative
2779 +dentry is yielded and the next stage operation will be called by the
2780 +VFS (such as create() or mknod() inode methods). If driver information
2781 +can be found, an inode is created (if one does not exist already) and
2782 +all is well.
2783 +
2784 +Manually creating device nodes
2785 +
2786 +The mknod() method allows you to create an ordinary named pipe in the
2787 +devfs, or you can create a character or block special inode if one
2788 +does not already exist. You may wish to create a character or block
2789 +special inode so that you can set permissions and ownership. Later, if
2790 +a device driver registers an entry with the same name, the
2791 +permissions, ownership and times are retained. This is how you can set
2792 +the protections on a device even before the driver is loaded. Once you
2793 +create an inode it appears in the directory listing.
2794 +
2795 +Unregistering device entries
2796 +
2797 +A device driver calls devfs_unregister() to unregister an entry.
2798 +
2799 +Chroot() gaols
2800 +
2801 +2.2.x kernels
2802 +
2803 +The semantics of inode creation are different when devfs is mounted
2804 +with the "explicit" option. Now, when a device entry is registered, it
2805 +will not appear until you use mknod() to create the device. It doesn't
2806 +matter if you mknod() before or after the device is registered with
2807 +devfs_register(). The purpose of this behaviour is to support
2808 +chroot(2) gaols, where you want to mount a minimal devfs inside the
2809 +gaol. Only the devices you specifically want to be available (through
2810 +your mknod() setup) will be accessible.
2811 +
2812 +2.4.x kernels
2813 +
2814 +As of kernel 2.3.99, the VFS has had the ability to rebind parts of
2815 +the global filesystem namespace into another part of the namespace.
2816 +This now works even at the leaf-node level, which means that
2817 +individual files and device nodes may be bound into other parts of the
2818 +namespace. This is like making links, but better, because it works
2819 +across filesystems (unlike hard links) and works through chroot()
2820 +gaols (unlike symbolic links).
2821 +
2822 +Because of these improvements to the VFS, the multi-mount capability
2823 +in devfs is no longer needed. The administrator may create a minimal
2824 +device tree inside a chroot(2) gaol by using VFS bindings. As this
2825 +provides most of the features of the devfs multi-mount capability, I
2826 +removed the multi-mount support code (after issuing an RFC). This
2827 +yielded code size reductions and simplifications.
2828 +
2829 +If you want to construct a minimal chroot() gaol, the following
2830 +command should suffice:
2831 +
2832 +mount --bind /dev/null /gaol/dev/null
2833 +
2834 +
2835 +Repeat for other device nodes you want to expose. Simple!
2836 +
2837 +-----------------------------------------------------------------------------
2838 +
2839 +
2840 +Operational issues
2841 +
2842 +
2843 +Instructions for the impatient
2844 +
2845 +Nobody likes reading documentation. People just want to get in there
2846 +and play. So this section tells you quickly the steps you need to take
2847 +to run with devfs mounted over /dev. Skip these steps and you will end
2848 +up with a nearly unbootable system. Subsequent sections describe the
2849 +issues in more detail, and discuss non-essential configuration
2850 +options.
2851 +
2852 +Devfsd
2853 +OK, if you're reading this, I assume you want to play with
2854 +devfs. First you should ensure that /usr/src/linux contains a
2855 +recent kernel source tree. Then you need to compile devfsd, the device
2856 +management daemon, available at
2857 +
2858 +http://www.atnf.csiro.au/~rgooch/linux/.
2859 +Because the kernel has a naming scheme
2860 +which is quite different from the old naming scheme, you need to
2861 +install devfsd so that software and configuration files that use the
2862 +old naming scheme will not break.
2863 +
2864 +Compile and install devfsd. You will be provided with a default
2865 +configuration file /etc/devfsd.conf which will provide
2866 +compatibility symlinks for the old naming scheme. Don't change this
2867 +config file unless you know what you're doing. Even if you think you
2868 +do know what you're doing, don't change it until you've followed all
2869 +the steps below and booted a devfs-enabled system and verified that it
2870 +works.
2871 +
2872 +Now edit your main system boot script so that devfsd is started at the
2873 +very beginning (before any filesystem
2874 +checks). /etc/rc.d/rc.sysinit is often the main boot script
2875 +on systems with SysV-style boot scripts. On systems with BSD-style
2876 +boot scripts it is often /etc/rc. Also check
2877 +/sbin/rc.
2878 +
2879 +NOTE that the line you put into the boot
2880 +script should be exactly:
2881 +
2882 +/sbin/devfsd /dev
2883 +
2884 +DO NOT use some special daemon-launching
2885 +programme, otherwise the boot script may not wait for devfsd to finish
2886 +initialising.
2887 +
2888 +System Libraries
2889 +There may still be some problems because of broken software making
2890 +assumptions about device names. In particular, some software does not
2891 +handle devices which are symbolic links. If you are running a libc 5
2892 +based system, install libc 5.4.44 (if you have libc 5.4.46, go back to
2893 +libc 5.4.44, which is actually correct). If you are running a glibc
2894 +based system, make sure you have glibc 2.1.3 or later.
2895 +
2896 +/etc/securetty
2897 +PAM (Pluggable Authentication Modules) is supposed to be a flexible
2898 +mechanism for providing better user authentication and access to
2899 +services. Unfortunately, it's also fragile, complex and undocumented
2900 +(check out RedHat 6.1, and probably other distributions as well). PAM
2901 +has problems with symbolic links. Append the following lines to your
2902 +/etc/securetty file:
2903 +
2904 +vc/1
2905 +vc/2
2906 +vc/3
2907 +vc/4
2908 +vc/5
2909 +vc/6
2910 +vc/7
2911 +vc/8
2912 +
2913 +This will not weaken security. If you have a version of util-linux
2914 +earlier than 2.10.h, please upgrade to 2.10.h or later. If you
2915 +absolutely cannot upgrade, then also append the following lines to
2916 +your /etc/securetty file:
2917 +
2918 +1
2919 +2
2920 +3
2921 +4
2922 +5
2923 +6
2924 +7
2925 +8
2926 +
2927 +This may potentially weaken security by allowing root logins over the
2928 +network (a password is still required, though). However, since there
2929 +are problems with dealing with symlinks, I'm suspicious of the level
2930 +of security offered in any case.
2931 +
2932 +XFree86
2933 +While not essential, it's probably a good idea to upgrade to XFree86
2934 +4.0, as patches went in to make it more devfs-friendly. If you don't,
2935 +you'll probably need to apply the following patch to
2936 +/etc/security/console.perms so that ordinary users can run
2937 +startx. Note that not all distributions have this file (e.g. Debian),
2938 +so if it's not present, don't worry about it.
2939 +
2940 +--- /etc/security/console.perms.orig Sat Apr 17 16:26:47 1999
2941 ++++ /etc/security/console.perms Fri Feb 25 23:53:55 2000
2942 +@@ -14,7 +14,7 @@
2943 + # man 5 console.perms
2944 +
2945 + # file classes -- these are regular expressions
2946 +-<console>=tty[0-9][0-9]* :[0-9]\.[0-9] :[0-9]
2947 ++<console>=tty[0-9][0-9]* vc/[0-9][0-9]* :[0-9]\.[0-9] :[0-9]
2948 +
2949 + # device classes -- these are shell-style globs
2950 + <floppy>=/dev/fd[0-1]*
2951 +
2952 +If the patch does not apply, then change the line:
2953 +
2954 +<console>=tty[0-9][0-9]* :[0-9]\.[0-9] :[0-9]
2955 +
2956 +with:
2957 +
2958 +<console>=tty[0-9][0-9]* vc/[0-9][0-9]* :[0-9]\.[0-9] :[0-9]
2959 +
2960 +
2961 +Disable devpts
2962 +I've had a report of devpts mounted on /dev/pts not working
2963 +correctly. Since devfs will also manage /dev/pts, there is no
2964 +need to mount devpts as well. You should either edit your
2965 +/etc/fstab so devpts is not mounted, or disable devpts from
2966 +your kernel configuration.
2967 +
2968 +Unsupported drivers
2969 +Not all drivers have devfs support. If you depend on one of these
2970 +drivers, you will need to create a script or tarfile that you can use
2971 +at boot time to create device nodes as appropriate. There is a
2972 +section which describes this. Another
2973 +section lists the drivers which have
2974 +devfs support.
2975 +
2976 +/dev/mouse
2977 +
2978 +Many disributions configure /dev/mouse to be the mouse device
2979 +for XFree86 and GPM. I actually think this is a bad idea, because it
2980 +adds another level of indirection. When looking at a config file, if
2981 +you see /dev/mouse you're left wondering which mouse
2982 +is being referred to. Hence I recommend putting the actual mouse
2983 +device (for example /dev/psaux) into your
2984 +/etc/X11/XF86Config file (and similarly for the GPM
2985 +configuration file).
2986 +
2987 +Alternatively, use the same technique used for unsupported drivers
2988 +described above.
2989 +
2990 +The Kernel
2991 +Finally, you need to make sure devfs is compiled into your kernel. Set
2992 +CONFIG_EXPERIMENTAL=y, CONFIG_DEVFS_FS=y and CONFIG_DEVFS_MOUNT=y by
2993 +using favourite configuration tool (i.e. make config or
2994 +make xconfig) and then make clean and then recompile your kernel and
2995 +modules. At boot, devfs will be mounted onto /dev.
2996 +
2997 +If you encounter problems booting (for example if you forgot a
2998 +configuration step), you can pass devfs=nomount at the kernel
2999 +boot command line. This will prevent the kernel from mounting devfs at
3000 +boot time onto /dev.
3001 +
3002 +In general, a kernel built with CONFIG_DEVFS_FS=y but without mounting
3003 +devfs onto /dev is completely safe, and requires no
3004 +configuration changes. One exception to take note of is when
3005 +LABEL= directives are used in /etc/fstab. In this
3006 +case you will be unable to boot properly. This is because the
3007 +mount(8) programme uses /proc/partitions as part of
3008 +the volume label search process, and the device names it finds are not
3009 +available, because setting CONFIG_DEVFS_FS=y changes the names in
3010 +/proc/partitions, irrespective of whether devfs is mounted.
3011 +
3012 +Now you've finished all the steps required. You're now ready to boot
3013 +your shiny new kernel. Enjoy.
3014 +
3015 +Changing the configuration
3016 +
3017 +OK, you've now booted a devfs-enabled system, and everything works.
3018 +Now you may feel like changing the configuration (common targets are
3019 +/etc/fstab and /etc/devfsd.conf). Since you have a
3020 +system that works, if you make any changes and it doesn't work, you
3021 +now know that you only have to restore your configuration files to the
3022 +default and it will work again.
3023 +
3024 +
3025 +Permissions persistence across reboots
3026 +
3027 +If you don't use mknod(2) to create a device file, nor use chmod(2) or
3028 +chown(2) to change the ownerships/permissions, the inode ctime will
3029 +remain at 0 (the epoch, 12 am, 1-JAN-1970, GMT). Anything with a ctime
3030 +later than this has had it's ownership/permissions changed. Hence, a
3031 +simple script or programme may be used to tar up all changed inodes,
3032 +prior to shutdown. Although effective, many consider this approach a
3033 +kludge.
3034 +
3035 +A much better approach is to use devfsd to save and restore
3036 +permissions. It may be configured to record changes in permissions and
3037 +will save them in a database (in fact a directory tree), and restore
3038 +these upon boot. This is an efficient method and results in immediate
3039 +saving of current permissions (unlike the tar approach, which saves
3040 +permissions at some unspecified future time).
3041 +
3042 +The default configuration file supplied with devfsd has config entries
3043 +which you may uncomment to enable persistence management.
3044 +
3045 +If you decide to use the tar approach anyway, be aware that tar will
3046 +first unlink(2) an inode before creating a new device node. The
3047 +unlink(2) has the effect of breaking the connection between a devfs
3048 +entry and the device driver. If you use the "devfs=only" boot option,
3049 +you lose access to the device driver, requiring you to reload the
3050 +module. I consider this a bug in tar (there is no real need to
3051 +unlink(2) the inode first).
3052 +
3053 +Alternatively, you can use devfsd to provide more sophisticated
3054 +management of device permissions. You can use devfsd to store
3055 +permissions for whole groups of devices with a single configuration
3056 +entry, rather than the conventional single entry per device entry.
3057 +
3058 +Permissions database stored in mounted-over /dev
3059 +
3060 +If you wish to save and restore your device permissions into the
3061 +disc-based /dev while still mounting devfs onto /dev
3062 +you may do so. This requires a 2.4.x kernel (in fact, 2.3.99 or
3063 +later), which has the VFS binding facility. You need to do the
3064 +following to set this up:
3065 +
3066 +
3067 +
3068 +make sure the kernel does not mount devfs at boot time
3069 +
3070 +
3071 +make sure you have a correct /dev/console entry in your
3072 +root file-system (where your disc-based /dev lives)
3073 +
3074 +create the /dev-state directory
3075 +
3076 +
3077 +add the following lines near the very beginning of your boot
3078 +scripts:
3079 +
3080 +mount --bind /dev /dev-state
3081 +mount -t devfs none /dev
3082 +devfsd /dev
3083 +
3084 +
3085 +
3086 +
3087 +add the following lines to your /etc/devfsd.conf file:
3088 +
3089 +REGISTER ^pt[sy] IGNORE
3090 +CREATE ^pt[sy] IGNORE
3091 +CHANGE ^pt[sy] IGNORE
3092 +DELETE ^pt[sy] IGNORE
3093 +REGISTER .* COPY /dev-state/$devname $devpath
3094 +CREATE .* COPY $devpath /dev-state/$devname
3095 +CHANGE .* COPY $devpath /dev-state/$devname
3096 +DELETE .* CFUNCTION GLOBAL unlink /dev-state/$devname
3097 +RESTORE /dev-state
3098 +
3099 +Note that the sample devfsd.conf file contains these lines,
3100 +as well as other sample configurations you may find useful. See the
3101 +devfsd distribution
3102 +
3103 +
3104 +reboot.
3105 +
3106 +
3107 +
3108 +
3109 +Permissions database stored in normal directory
3110 +
3111 +If you are using an older kernel which doesn't support VFS binding,
3112 +then you won't be able to have the permissions database in a
3113 +mounted-over /dev. However, you can still use a regular
3114 +directory to store the database. The sample /etc/devfsd.conf
3115 +file above may still be used. You will need to create the
3116 +/dev-state directory prior to installing devfsd. If you have
3117 +old permissions in /dev, then just copy (or move) the device
3118 +nodes over to the new directory.
3119 +
3120 +Which method is better?
3121 +
3122 +The best method is to have the permissions database stored in the
3123 +mounted-over /dev. This is because you will not need to copy
3124 +device nodes over to /dev-state, and because it allows you to
3125 +switch between devfs and non-devfs kernels, without requiring you to
3126 +copy permissions between /dev-state (for devfs) and
3127 +/dev (for non-devfs).
3128 +
3129 +
3130 +Dealing with drivers without devfs support
3131 +
3132 +Currently, not all device drivers in the kernel have been modified to
3133 +use devfs. Device drivers which do not yet have devfs support will not
3134 +automagically appear in devfs. The simplest way to create device nodes
3135 +for these drivers is to unpack a tarfile containing the required
3136 +device nodes. You can do this in your boot scripts. All your drivers
3137 +will now work as before.
3138 +
3139 +Hopefully for most people devfs will have enough support so that they
3140 +can mount devfs directly over /dev without losing most functionality
3141 +(i.e. losing access to various devices). As of 22-JAN-1998 (devfs
3142 +patch version 10) I am now running this way. All the devices I have
3143 +are available in devfs, so I don't lose anything.
3144 +
3145 +WARNING: if your configuration requires the old-style device names
3146 +(i.e. /dev/hda1 or /dev/sda1), you must install devfsd and configure
3147 +it to maintain compatibility entries. It is almost certain that you
3148 +will require this. Note that the kernel creates a compatibility entry
3149 +for the root device, so you don't need initrd.
3150 +
3151 +Note that you no longer need to mount devpts if you use Unix98 PTYs,
3152 +as devfs can manage /dev/pts itself. This saves you some RAM, as you
3153 +don't need to compile and install devpts. Note that some versions of
3154 +glibc have a bug with Unix98 pty handling on devfs systems. Contact
3155 +the glibc maintainers for a fix. Glibc 2.1.3 has the fix.
3156 +
3157 +Note also that apart from editing /etc/fstab, other things will need
3158 +to be changed if you *don't* install devfsd. Some software (like the X
3159 +server) hard-wire device names in their source. It really is much
3160 +easier to install devfsd so that compatibility entries are created.
3161 +You can then slowly migrate your system to using the new device names
3162 +(for example, by starting with /etc/fstab), and then limiting the
3163 +compatibility entries that devfsd creates.
3164 +
3165 +IF YOU CONFIGURE TO MOUNT DEVFS AT BOOT, MAKE SURE YOU INSTALL DEVFSD
3166 +BEFORE YOU BOOT A DEVFS-ENABLED KERNEL!
3167 +
3168 +Now that devfs has gone into the 2.3.46 kernel, I'm getting a lot of
3169 +reports back. Many of these are because people are trying to run
3170 +without devfsd, and hence some things break. Please just run devfsd if
3171 +things break. I want to concentrate on real bugs rather than
3172 +misconfiguration problems at the moment. If people are willing to fix
3173 +bugs/false assumptions in other code (i.e. glibc, X server) and submit
3174 +that to the respective maintainers, that would be great.
3175 +
3176 +
3177 +All the way with Devfs
3178 +
3179 +The devfs kernel patch creates a rationalised device tree. As stated
3180 +above, if you want to keep using the old /dev naming scheme,
3181 +you just need to configure devfsd appopriately (see the man
3182 +page). People who prefer the old names can ignore this section. For
3183 +those of us who like the rationalised names and an uncluttered
3184 +/dev, read on.
3185 +
3186 +If you don't run devfsd, or don't enable compatibility entry
3187 +management, then you will have to configure your system to use the new
3188 +names. For example, you will then need to edit your
3189 +/etc/fstab to use the new disc naming scheme. If you want to
3190 +be able to boot non-devfs kernels, you will need compatibility
3191 +symlinks in the underlying disc-based /dev pointing back to
3192 +the old-style names for when you boot a kernel without devfs.
3193 +
3194 +You can selectively decide which devices you want compatibility
3195 +entries for. For example, you may only want compatibility entries for
3196 +BSD pseudo-terminal devices (otherwise you'll have to patch you C
3197 +library or use Unix98 ptys instead). It's just a matter of putting in
3198 +the correct regular expression into /dev/devfsd.conf.
3199 +
3200 +There are other choices of naming schemes that you may prefer. For
3201 +example, I don't use the kernel-supplied
3202 +names, because they are too verbose. A common misconception is
3203 +that the kernel-supplied names are meant to be used directly in
3204 +configuration files. This is not the case. They are designed to
3205 +reflect the layout of the devices attached and to provide easy
3206 +classification.
3207 +
3208 +If you like the kernel-supplied names, that's fine. If you don't then
3209 +you should be using devfsd to construct a namespace more to your
3210 +liking. Devfsd has built-in code to construct a
3211 +namespace that is both logical and easy to
3212 +manage. In essence, it creates a convenient abbreviation of the
3213 +kernel-supplied namespace.
3214 +
3215 +You are of course free to build your own namespace. Devfsd has all the
3216 +infrastructure required to make this easy for you. All you need do is
3217 +write a script. You can even write some C code and devfsd can load the
3218 +shared object as a callable extension.
3219 +
3220 +
3221 +Other Issues
3222 +
3223 +The init programme
3224 +Another thing to take note of is whether your init programme
3225 +creates a Unix socket /dev/telinit. Some versions of init
3226 +create /dev/telinit so that the telinit programme can
3227 +communicate with the init process. If you have such a system you need
3228 +to make sure that devfs is mounted over /dev *before* init
3229 +starts. In other words, you can't leave the mounting of devfs to
3230 +/etc/rc, since this is executed after init. Other
3231 +versions of init require a named pipe /dev/initctl
3232 +which must exist *before* init starts. Once again, you need to
3233 +mount devfs and then create the named pipe *before* init
3234 +starts.
3235 +
3236 +The default behaviour now is not to mount devfs onto /dev at
3237 +boot time for 2.3.x and later kernels. You can correct this with the
3238 +"devfs=mount" boot option. This solves any problems with init,
3239 +and also prevents the dreaded:
3240 +
3241 +Cannot open initial console
3242 +
3243 +message. For 2.2.x kernels where you need to apply the devfs patch,
3244 +the default is to mount.
3245 +
3246 +If you have automatic mounting of devfs onto /dev then you
3247 +may need to create /dev/initctl in your boot scripts. The
3248 +following lines should suffice:
3249 +
3250 +mknod /dev/initctl p
3251 +kill -SIGUSR1 1 # tell init that /dev/initctl now exists
3252 +
3253 +Alternatively, if you don't want the kernel to mount devfs onto
3254 +/dev then you could use the following procedure is a
3255 +guideline for how to get around /dev/initctl problems:
3256 +
3257 +# cd /sbin
3258 +# mv init init.real
3259 +# cat > init
3260 +#! /bin/sh
3261 +mount -n -t devfs none /dev
3262 +mknod /dev/initctl p
3263 +exec /sbin/init.real $*
3264 +[control-D]
3265 +# chmod a+x init
3266 +
3267 +Note that newer versions of init create /dev/initctl
3268 +automatically, so you don't have to worry about this.
3269 +
3270 +Module autoloading
3271 +You will need to configure devfsd to enable module
3272 +autoloading. The following lines should be placed in your
3273 +/etc/devfsd.conf file:
3274 +
3275 +LOOKUP .* MODLOAD
3276 +
3277 +
3278 +As of devfsd-v1.3.10, a generic /etc/modules.devfs
3279 +configuration file is installed, which is used by the MODLOAD
3280 +action. This should be sufficient for most configurations. If you
3281 +require further configuration, edit your /etc/modules.conf
3282 +file. The way module autoloading work with devfs is:
3283 +
3284 +
3285 +a process attempts to lookup a device node (e.g. /dev/fred)
3286 +
3287 +
3288 +if that device node does not exist, the full pathname is passed to
3289 +devfsd as a string
3290 +
3291 +
3292 +devfsd will pass the string to the modprobe programme (provided the
3293 +configuration line shown above is present), and specifies that
3294 +/etc/modules.devfs is the configuration file
3295 +
3296 +
3297 +/etc/modules.devfs includes /etc/modules.conf to
3298 +access local configurations
3299 +
3300 +modprobe will search it's configuration files, looking for an alias
3301 +that translates the pathname into a module name
3302 +
3303 +
3304 +the translated pathname is then used to load the module.
3305 +
3306 +
3307 +If you wanted a lookup of /dev/fred to load the
3308 +mymod module, you would require the following configuration
3309 +line in /etc/modules.conf:
3310 +
3311 +alias /dev/fred mymod
3312 +
3313 +The /etc/modules.devfs configuration file provides many such
3314 +aliases for standard device names. If you look closely at this file,
3315 +you will note that some modules require multiple alias configuration
3316 +lines. This is required to support module autoloading for old and new
3317 +device names.
3318 +
3319 +Mounting root off a devfs device
3320 +If you wish to mount root off a devfs device when you pass the
3321 +"devfs=only" boot option, then you need to pass in the
3322 +"root=<device>" option to the kernel when booting. If you use
3323 +LILO, then you must have this in lilo.conf:
3324 +
3325 +append = "root=<device>"
3326 +
3327 +Surprised? Yep, so was I. It turns out if you have (as most people
3328 +do):
3329 +
3330 +root = <device>
3331 +
3332 +
3333 +then LILO will determine the device number of <device> and will
3334 +write that device number into a special place in the kernel image
3335 +before starting the kernel, and the kernel will use that device number
3336 +to mount the root filesystem. So, using the "append" variety ensures
3337 +that LILO passes the root filesystem device as a string, which devfs
3338 +can then use.
3339 +
3340 +Note that this isn't an issue if you don't pass "devfs=only".
3341 +
3342 +TTY issues
3343 +The ttyname(3) function in some versions of the C library makes
3344 +false assumptions about device entries which are symbolic links. The
3345 +tty(1) programme is one that depends on this function. I've
3346 +written a patch to libc 5.4.43 which fixes this. This has been
3347 +included in libc 5.4.44 and a similar fix is in glibc 2.1.3.
3348 +
3349 +
3350 +Kernel Naming Scheme
3351 +
3352 +The kernel provides a default naming scheme. This scheme is designed
3353 +to make it easy to search for specific devices or device types, and to
3354 +view the available devices. Some device types (such as hard discs),
3355 +have a directory of entries, making it easy to see what devices of
3356 +that class are available. Often, the entries are symbolic links into a
3357 +directory tree that reflects the topology of available devices. The
3358 +topological tree is useful for finding how your devices are arranged.
3359 +
3360 +Below is a list of the naming schemes for the most common drivers. A
3361 +list of reserved device names is
3362 +available for reference. Please send email to
3363 +rgooch@atnf.csiro.au to obtain an allocation. Please be
3364 +patient (the maintainer is busy). An alternative name may be allocated
3365 +instead of the requested name, at the discretion of the maintainer.
3366 +
3367 +Disc Devices
3368 +
3369 +All discs, whether SCSI, IDE or whatever, are placed under the
3370 +/dev/discs hierarchy:
3371 +
3372 + /dev/discs/disc0 first disc
3373 + /dev/discs/disc1 second disc
3374 +
3375 +
3376 +Each of these entries is a symbolic link to the directory for that
3377 +device. The device directory contains:
3378 +
3379 + disc for the whole disc
3380 + part* for individual partitions
3381 +
3382 +
3383 +CD-ROM Devices
3384 +
3385 +All CD-ROMs, whether SCSI, IDE or whatever, are placed under the
3386 +/dev/cdroms hierarchy:
3387 +
3388 + /dev/cdroms/cdrom0 first CD-ROM
3389 + /dev/cdroms/cdrom1 second CD-ROM
3390 +
3391 +
3392 +Each of these entries is a symbolic link to the real device entry for
3393 +that device.
3394 +
3395 +Tape Devices
3396 +
3397 +All tapes, whether SCSI, IDE or whatever, are placed under the
3398 +/dev/tapes hierarchy:
3399 +
3400 + /dev/tapes/tape0 first tape
3401 + /dev/tapes/tape1 second tape
3402 +
3403 +
3404 +Each of these entries is a symbolic link to the directory for that
3405 +device. The device directory contains:
3406 +
3407 + mt for mode 0
3408 + mtl for mode 1
3409 + mtm for mode 2
3410 + mta for mode 3
3411 + mtn for mode 0, no rewind
3412 + mtln for mode 1, no rewind
3413 + mtmn for mode 2, no rewind
3414 + mtan for mode 3, no rewind
3415 +
3416 +
3417 +SCSI Devices
3418 +
3419 +To uniquely identify any SCSI device requires the following
3420 +information:
3421 +
3422 + controller (host adapter)
3423 + bus (SCSI channel)
3424 + target (SCSI ID)
3425 + unit (Logical Unit Number)
3426 +
3427 +
3428 +All SCSI devices are placed under /dev/scsi (assuming devfs
3429 +is mounted on /dev). Hence, a SCSI device with the following
3430 +parameters: c=1,b=2,t=3,u=4 would appear as:
3431 +
3432 + /dev/scsi/host1/bus2/target3/lun4 device directory
3433 +
3434 +
3435 +Inside this directory, a number of device entries may be created,
3436 +depending on which SCSI device-type drivers were installed.
3437 +
3438 +See the section on the disc naming scheme to see what entries the SCSI
3439 +disc driver creates.
3440 +
3441 +See the section on the tape naming scheme to see what entries the SCSI
3442 +tape driver creates.
3443 +
3444 +The SCSI CD-ROM driver creates:
3445 +
3446 + cd
3447 +
3448 +
3449 +The SCSI generic driver creates:
3450 +
3451 + generic
3452 +
3453 +
3454 +IDE Devices
3455 +
3456 +To uniquely identify any IDE device requires the following
3457 +information:
3458 +
3459 + controller
3460 + bus (aka. primary/secondary)
3461 + target (aka. master/slave)
3462 + unit
3463 +
3464 +
3465 +All IDE devices are placed under /dev/ide, and uses a similar
3466 +naming scheme to the SCSI subsystem.
3467 +
3468 +XT Hard Discs
3469 +
3470 +All XT discs are placed under /dev/xd. The first XT disc has
3471 +the directory /dev/xd/disc0.
3472 +
3473 +TTY devices
3474 +
3475 +The tty devices now appear as:
3476 +
3477 + New name Old-name Device Type
3478 + -------- -------- -----------
3479 + /dev/tts/{0,1,...} /dev/ttyS{0,1,...} Serial ports
3480 + /dev/cua/{0,1,...} /dev/cua{0,1,...} Call out devices
3481 + /dev/vc/0 /dev/tty Current virtual console
3482 + /dev/vc/{1,2,...} /dev/tty{1...63} Virtual consoles
3483 + /dev/vcc/{0,1,...} /dev/vcs{1...63} Virtual consoles
3484 + /dev/pty/m{0,1,...} /dev/ptyp?? PTY masters
3485 + /dev/pty/s{0,1,...} /dev/ttyp?? PTY slaves
3486 +
3487 +
3488 +RAMDISCS
3489 +
3490 +The RAMDISCS are placed in their own directory, and are named thus:
3491 +
3492 + /dev/rd/{0,1,2,...}
3493 +
3494 +
3495 +Meta Devices
3496 +
3497 +The meta devices are placed in their own directory, and are named
3498 +thus:
3499 +
3500 + /dev/md/{0,1,2,...}
3501 +
3502 +
3503 +Floppy discs
3504 +
3505 +Floppy discs are placed in the /dev/floppy directory.
3506 +
3507 +Loop devices
3508 +
3509 +Loop devices are placed in the /dev/loop directory.
3510 +
3511 +Sound devices
3512 +
3513 +Sound devices are placed in the /dev/sound directory
3514 +(audio, sequencer, ...).
3515 +
3516 +
3517 +Devfsd Naming Scheme
3518 +
3519 +Devfsd provides a naming scheme which is a convenient abbreviation of
3520 +the kernel-supplied namespace. In some
3521 +cases, the kernel-supplied naming scheme is quite convenient, so
3522 +devfsd does not provide another naming scheme. The convenience names
3523 +that devfsd creates are in fact the same names as the original devfs
3524 +kernel patch created (before Linus mandated the Big Name
3525 +Change). These are referred to as "new compatibility entries".
3526 +
3527 +In order to configure devfsd to create these convenience names, the
3528 +following lines should be placed in your /etc/devfsd.conf:
3529 +
3530 +REGISTER .* MKNEWCOMPAT
3531 +UNREGISTER .* RMNEWCOMPAT
3532 +
3533 +This will cause devfsd to create (and destroy) symbolic links which
3534 +point to the kernel-supplied names.
3535 +
3536 +SCSI Hard Discs
3537 +
3538 +All SCSI discs are placed under /dev/sd (assuming devfs is
3539 +mounted on /dev). Hence, a SCSI disc with the following
3540 +parameters: c=1,b=2,t=3,u=4 would appear as:
3541 +
3542 + /dev/sd/c1b2t3u4 for the whole disc
3543 + /dev/sd/c1b2t3u4p5 for the 5th partition
3544 + /dev/sd/c1b2t3u4p5s6 for the 6th slice in the 5th partition
3545 +
3546 +
3547 +SCSI Tapes
3548 +
3549 +All SCSI tapes are placed under /dev/st. A similar naming
3550 +scheme is used as for SCSI discs. A SCSI tape with the
3551 +parameters:c=1,b=2,t=3,u=4 would appear as:
3552 +
3553 + /dev/st/c1b2t3u4m0 for mode 0
3554 + /dev/st/c1b2t3u4m1 for mode 1
3555 + /dev/st/c1b2t3u4m2 for mode 2
3556 + /dev/st/c1b2t3u4m3 for mode 3
3557 + /dev/st/c1b2t3u4m0n for mode 0, no rewind
3558 + /dev/st/c1b2t3u4m1n for mode 1, no rewind
3559 + /dev/st/c1b2t3u4m2n for mode 2, no rewind
3560 + /dev/st/c1b2t3u4m3n for mode 3, no rewind
3561 +
3562 +
3563 +SCSI CD-ROMs
3564 +
3565 +All SCSI CD-ROMs are placed under /dev/sr. A similar naming
3566 +scheme is used as for SCSI discs. A SCSI CD-ROM with the
3567 +parameters:c=1,b=2,t=3,u=4 would appear as:
3568 +
3569 + /dev/sr/c1b2t3u4
3570 +
3571 +
3572 +SCSI Generic Devices
3573 +
3574 +The generic (aka. raw) interface for all SCSI devices are placed under
3575 +/dev/sg. A similar naming scheme is used as for SCSI discs. A
3576 +SCSI generic device with the parameters:c=1,b=2,t=3,u=4 would appear
3577 +as:
3578 +
3579 + /dev/sg/c1b2t3u4
3580 +
3581 +
3582 +IDE Hard Discs
3583 +
3584 +All IDE discs are placed under /dev/ide/hd, using a similar
3585 +convention to SCSI discs. The following mappings exist between the new
3586 +and the old names:
3587 +
3588 + /dev/hda /dev/ide/hd/c0b0t0u0
3589 + /dev/hdb /dev/ide/hd/c0b0t1u0
3590 + /dev/hdc /dev/ide/hd/c0b1t0u0
3591 + /dev/hdd /dev/ide/hd/c0b1t1u0
3592 +
3593 +
3594 +IDE Tapes
3595 +
3596 +A similar naming scheme is used as for IDE discs. The entries will
3597 +appear in the /dev/ide/mt directory.
3598 +
3599 +IDE CD-ROM
3600 +
3601 +A similar naming scheme is used as for IDE discs. The entries will
3602 +appear in the /dev/ide/cd directory.
3603 +
3604 +IDE Floppies
3605 +
3606 +A similar naming scheme is used as for IDE discs. The entries will
3607 +appear in the /dev/ide/fd directory.
3608 +
3609 +XT Hard Discs
3610 +
3611 +All XT discs are placed under /dev/xd. The first XT disc
3612 +would appear as /dev/xd/c0t0.
3613 +
3614 +
3615 +Old Compatibility Names
3616 +
3617 +The old compatibility names are the legacy device names, such as
3618 +/dev/hda, /dev/sda, /dev/rtc and so on.
3619 +Devfsd can be configured to create compatibility symlinks so that you
3620 +may continue to use the old names in your configuration files and so
3621 +that old applications will continue to function correctly.
3622 +
3623 +In order to configure devfsd to create these legacy names, the
3624 +following lines should be placed in your /etc/devfsd.conf:
3625 +
3626 +REGISTER .* MKOLDCOMPAT
3627 +UNREGISTER .* RMOLDCOMPAT
3628 +
3629 +This will cause devfsd to create (and destroy) symbolic links which
3630 +point to the kernel-supplied names.
3631 +
3632 +
3633 +-----------------------------------------------------------------------------
3634 +
3635 +
3636 +Device drivers currently ported
3637 +
3638 +- All miscellaneous character devices support devfs (this is done
3639 + transparently through misc_register())
3640 +
3641 +- SCSI discs and generic hard discs
3642 +
3643 +- Character memory devices (null, zero, full and so on)
3644 + Thanks to C. Scott Ananian <cananian@alumni.princeton.edu>
3645 +
3646 +- Loop devices (/dev/loop?)
3647 +
3648 +- TTY devices (console, serial ports, terminals and pseudo-terminals)
3649 + Thanks to C. Scott Ananian <cananian@alumni.princeton.edu>
3650 +
3651 +- SCSI tapes (/dev/scsi and /dev/tapes)
3652 +
3653 +- SCSI CD-ROMs (/dev/scsi and /dev/cdroms)
3654 +
3655 +- SCSI generic devices (/dev/scsi)
3656 +
3657 +- RAMDISCS (/dev/ram?)
3658 +
3659 +- Meta Devices (/dev/md*)
3660 +
3661 +- Floppy discs (/dev/floppy)
3662 +
3663 +- Parallel port printers (/dev/printers)
3664 +
3665 +- Sound devices (/dev/sound)
3666 + Thanks to Eric Dumas <dumas@linux.eu.org> and
3667 + C. Scott Ananian <cananian@alumni.princeton.edu>
3668 +
3669 +- Joysticks (/dev/joysticks)
3670 +
3671 +- Sparc keyboard (/dev/kbd)
3672 +
3673 +- DSP56001 digital signal processor (/dev/dsp56k)
3674 +
3675 +- Apple Desktop Bus (/dev/adb)
3676 +
3677 +- Coda network file system (/dev/cfs*)
3678 +
3679 +- Virtual console capture devices (/dev/vcc)
3680 + Thanks to Dennis Hou <smilax@mindmeld.yi.org>
3681 +
3682 +- Frame buffer devices (/dev/fb)
3683 +
3684 +- Video capture devices (/dev/v4l)
3685 +
3686 +
3687 +-----------------------------------------------------------------------------
3688 +
3689 +
3690 +Allocation of Device Numbers
3691 +
3692 +Devfs allows you to write a driver which doesn't need to allocate a
3693 +device number (major&minor numbers) for the internal operation of the
3694 +kernel. However, there are a number of userspace programmes that use
3695 +the device number as a unique handle for a device. An example is the
3696 +find programme, which uses device numbers to determine whether
3697 +an inode is on a different filesystem than another inode. The device
3698 +number used is the one for the block device which a filesystem is
3699 +using. To preserve compatibility with userspace programmes, block
3700 +devices using devfs need to have unique device numbers allocated to
3701 +them. Furthermore, POSIX specifies device numbers, so some kind of
3702 +device number needs to be presented to userspace.
3703 +
3704 +The simplest option (especially when porting drivers to devfs) is to
3705 +keep using the old major and minor numbers. Devfs will take whatever
3706 +values are given for major&minor and pass them onto userspace.
3707 +
3708 +This device number is a 16 bit number, so this leaves plenty of space
3709 +for large numbers of discs and partitions. This scheme can also be
3710 +used for character devices, in particular the tty devices, which are
3711 +currently limited to 256 pseudo-ttys (this limits the total number of
3712 +simultaneous xterms and remote logins). Note that the device number
3713 +is limited to the range 36864-61439 (majors 144-239), in order to
3714 +avoid any possible conflicts with existing official allocations.
3715 +
3716 +Please note that using dynamically allocated block device numbers may
3717 +break the NFS daemons (both user and kernel mode), which expect dev_t
3718 +for a given device to be constant over the lifetime of remote mounts.
3719 +
3720 +A final note on this scheme: since it doesn't increase the size of
3721 +device numbers, there are no compatibility issues with userspace.
3722 +
3723 +-----------------------------------------------------------------------------
3724 +
3725 +
3726 +Questions and Answers
3727 +
3728 +
3729 +Making things work
3730 +Alternatives to devfs
3731 +What I don't like about devfs
3732 +How to report bugs
3733 +Strange kernel messages
3734 +Compilation problems with devfsd
3735 +
3736 +
3737 +
3738 +Making things work
3739 +
3740 +Here are some common questions and answers.
3741 +
3742 +
3743 +
3744 +Devfsd doesn't start
3745 +
3746 +Make sure you have compiled and installed devfsd
3747 +Make sure devfsd is being started from your boot
3748 +scripts
3749 +Make sure you have configured your kernel to enable devfs (see
3750 +below)
3751 +Make sure devfs is mounted (see below)
3752 +
3753 +
3754 +Devfsd is not managing all my permissions
3755 +
3756 +Make sure you are capturing the appropriate events. For example,
3757 +device entries created by the kernel generate REGISTER events,
3758 +but those created by devfsd generate CREATE events.
3759 +
3760 +
3761 +Devfsd is not capturing all REGISTER events
3762 +
3763 +See the previous entry: you may need to capture CREATE events.
3764 +
3765 +
3766 +X will not start
3767 +
3768 +Make sure you followed the steps
3769 +outlined above.
3770 +
3771 +
3772 +Why don't my network devices appear in devfs?
3773 +
3774 +This is not a bug. Network devices have their own, completely separate
3775 +namespace. They are accessed via socket(2) and
3776 +setsockopt(2) calls, and thus require no device nodes. I have
3777 +raised the possibilty of moving network devices into the device
3778 +namespace, but have had no response.
3779 +
3780 +
3781 +How can I test if I have devfs compiled into my kernel?
3782 +
3783 +All filesystems built-in or currently loaded are listed in
3784 +/proc/filesystems. If you see a devfs entry, then
3785 +you know that devfs was compiled into your kernel. If you have
3786 +correctly configured and rebuilt your kernel, then devfs will be
3787 +built-in. If you think you've configured it in, but
3788 +/proc/filesystems doesn't show it, you've made a mistake.
3789 +Common mistakes include:
3790 +
3791 +Using a 2.2.x kernel without applying the devfs patch (if you
3792 +don't know how to patch your kernel, use 2.4.x instead, don't bother
3793 +asking me how to patch)
3794 +Forgetting to set CONFIG_EXPERIMENTAL=y
3795 +Forgetting to set CONFIG_DEVFS_FS=y
3796 +Forgetting to set CONFIG_DEVFS_MOUNT=y (if you want devfs
3797 +to be automatically mounted at boot)
3798 +Editing your .config manually, instead of using make
3799 +config or make xconfig
3800 +Forgetting to run make dep; make clean after changing the
3801 +configuration and before compiling
3802 +Forgetting to compile your kernel and modules
3803 +Forgetting to install your kernel
3804 +Forgetting to install your modules
3805 +
3806 +Please check twice that you've done all these steps before sending in
3807 +a bug report.
3808 +
3809 +
3810 +
3811 +How can I test if devfs is mounted on /dev?
3812 +
3813 +The device filesystem will always create an entry called
3814 +".devfsd", which is used to communicate with the daemon. Even
3815 +if the daemon is not running, this entry will exist. Testing for the
3816 +existence of this entry is the approved method of determining if devfs
3817 +is mounted or not. Note that the type of entry (i.e. regular file,
3818 +character device, named pipe, etc.) may change without notice. Only
3819 +the existence of the entry should be relied upon.
3820 +
3821 +
3822 +When I start devfsd, I see the error:
3823 +Error opening file: ".devfsd" No such file or directory?
3824 +
3825 +This means that devfs is not mounted. Make sure you have devfs mounted.
3826 +
3827 +
3828 +How do I mount devfs?
3829 +
3830 +First make sure you have devfs compiled into your kernel (see
3831 +above). Then you will either need to:
3832 +
3833 +set CONFIG_DEVFS_MOUNT=y in your kernel config
3834 +pass devfs=mount to your boot loader
3835 +mount devfs manually in your boot scripts with:
3836 +mount -t none devfs /dev
3837 +
3838 +
3839 +
3840 +Mount by volume LABEL=<label> doesn't work with
3841 +devfs
3842 +
3843 +Most probably you are not mounting devfs onto /dev. What
3844 +happens is that if your kernel config has CONFIG_DEVFS_FS=y
3845 +then the contents of /proc/partitions will have the devfs
3846 +names (such as scsi/host0/bus0/target0/lun0/part1). The
3847 +contents of /proc/partitions are used by mount(8) when
3848 +mounting by volume label. If devfs is not mounted on /dev,
3849 +then mount(8) will fail to find devices. The solution is to
3850 +make sure that devfs is mounted on /dev. See above for how to
3851 +do that.
3852 +
3853 +
3854 +I have extra or incorrect entries in /dev
3855 +
3856 +You may have stale entries in your dev-state area. Check for a
3857 +RESTORE configuration line in your devfsd configuration
3858 +(typically /etc/devfsd.conf). If you have this line, check
3859 +the contents of the specified directory for stale entries. Remove
3860 +any entries which are incorrect, then reboot.
3861 +
3862 +
3863 +I get "Unable to open initial console" messages at boot
3864 +
3865 +This usually happens when you don't have devfs automounted onto
3866 +/dev at boot time, and there is no valid
3867 +/dev/console entry on your root file-system. Create a valid
3868 +/dev/console device node.
3869 +
3870 +
3871 +
3872 +
3873 +
3874 +Alternatives to devfs
3875 +
3876 +I've attempted to collate all the anti-devfs proposals and explain
3877 +their limitations. Under construction.
3878 +
3879 +
3880 +Why not just pass device create/remove events to a daemon?
3881 +
3882 +Here the suggestion is to develop an API in the kernel so that devices
3883 +can register create and remove events, and a daemon listens for those
3884 +events. The daemon would then populate/depopulate /dev (which
3885 +resides on disc).
3886 +
3887 +This has several limitations:
3888 +
3889 +
3890 +it only works for modules loaded and unloaded (or devices inserted
3891 +and removed) after the kernel has finished booting. Without a database
3892 +of events, there is no way the daemon could fully populate
3893 +/dev
3894 +
3895 +
3896 +if you add a database to this scheme, the question is then how to
3897 +present that database to user-space. If you make it a list of strings
3898 +with embedded event codes which are passed through a pipe to the
3899 +daemon, then this is only of use to the daemon. I would argue that the
3900 +natural way to present this data is via a filesystem (since many of
3901 +the events will be of a hierarchical nature), such as devfs.
3902 +Presenting the data as a filesystem makes it easy for the user to see
3903 +what is available and also makes it easy to write scripts to scan the
3904 +"database"
3905 +
3906 +
3907 +the tight binding between device nodes and drivers is no longer
3908 +possible (requiring the otherwise perfectly avoidable
3909 +table lookups)
3910 +
3911 +
3912 +you cannot catch inode lookup events on /dev which means
3913 +that module autoloading requires device nodes to be created. This is a
3914 +problem, particularly for drivers where only a few inodes are created
3915 +from a potentially large set
3916 +
3917 +
3918 +this technique can't be used when the root FS is mounted
3919 +read-only
3920 +
3921 +
3922 +
3923 +
3924 +Just implement a better scsidev
3925 +
3926 +This suggestion involves taking the scsidev programme and
3927 +extending it to scan for all devices, not just SCSI devices. The
3928 +scsidev programme works by scanning /proc/scsi
3929 +
3930 +Problems:
3931 +
3932 +
3933 +the kernel does not currently provide a list of all devices
3934 +available. Not all drivers register entries in /proc or
3935 +generate kernel messages
3936 +
3937 +
3938 +there is no uniform mechanism to register devices other than the
3939 +devfs API
3940 +
3941 +
3942 +implementing such an API is then the same as the
3943 +proposal above
3944 +
3945 +
3946 +
3947 +
3948 +Put /dev on a ramdisc
3949 +
3950 +This suggestion involves creating a ramdisc and populating it with
3951 +device nodes and then mounting it over /dev.
3952 +
3953 +Problems:
3954 +
3955 +
3956 +
3957 +this doesn't help when mounting the root filesystem, since you
3958 +still need a device node to do that
3959 +
3960 +
3961 +if you want to use this technique for the root device node as
3962 +well, you need to use initrd. This complicates the booting sequence
3963 +and makes it significantly harder to administer and configure. The
3964 +initrd is essentially opaque, robbing the system administrator of easy
3965 +configuration
3966 +
3967 +
3968 +insufficient information is available to correctly populate the
3969 +ramdisc. So we come back to the
3970 +proposal above to "solve" this
3971 +
3972 +
3973 +a ramdisc-based solution would take more kernel memory, since the
3974 +backing store would be (at best) normal VFS inodes and dentries, which
3975 +take 284 bytes and 112 bytes, respectively, for each entry. Compare
3976 +that to 72 bytes for devfs
3977 +
3978 +
3979 +
3980 +
3981 +Do nothing: there's no problem
3982 +
3983 +Sometimes people can be heard to claim that the existing scheme is
3984 +fine. This is what they're ignoring:
3985 +
3986 +
3987 +device number size (8 bits each for major and minor) is a real
3988 +limitation, and must be fixed somehow. Systems with large numbers of
3989 +SCSI devices, for example, will continue to consume the remaining
3990 +unallocated major numbers. USB will also need to push beyond the 8 bit
3991 +minor limitation
3992 +
3993 +
3994 +simply increasing the device number size is insufficient. Apart
3995 +from causing a lot of pain, it doesn't solve the management issues
3996 +of a /dev with thousands or more device nodes
3997 +
3998 +
3999 +ignoring the problem of a huge /dev will not make it go
4000 +away, and dismisses the legitimacy of a large number of people who
4001 +want a dynamic /dev
4002 +
4003 +
4004 +the standard response then becomes: "write a device management
4005 +daemon", which brings us back to the
4006 +proposal above
4007 +
4008 +
4009 +
4010 +
4011 +What I don't like about devfs
4012 +
4013 +Here are some common complaints about devfs, and some suggestions and
4014 +solutions that may make it more palatable for you. I can't please
4015 +everybody, but I do try :-)
4016 +
4017 +I hate the naming scheme
4018 +
4019 +First, remember that no naming scheme will please everybody. You hate
4020 +the scheme, others love it. Who's to say who's right and who's wrong?
4021 +Ultimately, the person who writes the code gets to choose, and what
4022 +exists now is a combination of the choices made by the
4023 +devfs author and the
4024 +kernel maintainer (Linus).
4025 +
4026 +However, not all is lost. If you want to create your own naming
4027 +scheme, it is a simple matter to write a standalone script, hack
4028 +devfsd, or write a script called by devfsd. You can create whatever
4029 +naming scheme you like.
4030 +
4031 +Further, if you want to remove all traces of the devfs naming scheme
4032 +from /dev, you can mount devfs elsewhere (say
4033 +/devfs) and populate /dev with links into
4034 +/devfs. This population can be automated using devfsd if you
4035 +wish.
4036 +
4037 +You can even use the VFS binding facility to make the links, rather
4038 +than using symbolic links. This way, you don't even have to see the
4039 +"destination" of these symbolic links.
4040 +
4041 +Devfs puts policy into the kernel
4042 +
4043 +There's already policy in the kernel. Device numbers are in fact
4044 +policy (why should the kernel dictate what device numbers I use?).
4045 +Face it, some policy has to be in the kernel. The real difference
4046 +between device names as policy and device numbers as policy is that
4047 +no one will use device numbers directly, because device
4048 +numbers are devoid of meaning to humans and are ugly. At least with
4049 +the devfs device names, (even though you can add your own naming
4050 +scheme) some people will use the devfs-supplied names directly. This
4051 +offends some people :-)
4052 +
4053 +Devfs is bloatware
4054 +
4055 +This is not even remotely true. As shown above,
4056 +both code and data size are quite modest.
4057 +
4058 +
4059 +How to report bugs
4060 +
4061 +If you have (or think you have) a bug with devfs, please follow the
4062 +steps below:
4063 +
4064 +
4065 +
4066 +make sure you have enabled debugging output when configuring your
4067 +kernel. You will need to set (at least) the following config options:
4068 +
4069 +CONFIG_DEVFS_DEBUG=y
4070 +CONFIG_DEBUG_KERNEL=y
4071 +CONFIG_DEBUG_SLAB=y
4072 +
4073 +
4074 +
4075 +please make sure you have the latest devfs patches applied. The
4076 +latest kernel version might not have the latest devfs patches applied
4077 +yet (Linus is very busy)
4078 +
4079 +
4080 +save a copy of your complete kernel logs (preferably by
4081 +using the dmesg programme) for later inclusion in your bug
4082 +report. You may need to use the -s switch to increase the
4083 +internal buffer size so you can capture all the boot messages.
4084 +Don't edit or trim the dmesg output
4085 +
4086 +
4087 +
4088 +
4089 +try booting with devfs=dall passed to the kernel boot