1 | <?xml version='1.0' encoding="UTF-8"?> |
1 | <?xml version='1.0' encoding="UTF-8"?> |
2 | <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/devfs-guide.xml,v 1.9 2005/06/20 08:09:11 fox2mike Exp $ --> |
2 | <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/devfs-guide.xml,v 1.10 2005/06/20 09:41:16 neysx Exp $ --> |
3 | |
3 | |
4 | <!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> |
4 | <!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> |
5 | |
5 | |
6 | <guide link="/doc/en/devfs-guide.xml"> |
6 | <guide link="/doc/en/devfs-guide.xml"> |
7 | <title>Device File System Guide</title> |
7 | <title>Device File System Guide</title> |
… | |
… | |
15 | <abstract> |
15 | <abstract> |
16 | In this document you'll find information on what devfs is really about |
16 | In this document you'll find information on what devfs is really about |
17 | and how to work with it. |
17 | and how to work with it. |
18 | </abstract> |
18 | </abstract> |
19 | |
19 | |
|
|
20 | <!-- The content of this document is licensed under the CC-BY-SA license --> |
|
|
21 | <!-- See http://creativecommons.org/licenses/by-sa/2.5 --> |
20 | <license/> |
22 | <license/> |
21 | |
23 | |
22 | <version>0.4</version> |
24 | <version>0.4</version> |
23 | <date>2005-06-20</date> |
25 | <date>2005-06-20</date> |
24 | |
26 | |
… | |
… | |
26 | <title>What is devfs?</title> |
28 | <title>What is devfs?</title> |
27 | <section> |
29 | <section> |
28 | <title>The (good?) old days</title> |
30 | <title>The (good?) old days</title> |
29 | <body> |
31 | <body> |
30 | |
32 | |
|
|
33 | <warn> |
31 | <warn>devfs is <e>obsolete</e> and will eventually be removed from the stable |
34 | devfs is <e>obsolete</e> and will eventually be removed from the stable 2.6 |
32 | 2.6 tree. Users on 2.6 kernels are hereby advised to switch to udev. For further |
35 | tree. Users on 2.6 kernels are hereby advised to switch to udev. For further |
33 | information on udev, please refer to the <uri |
36 | information on udev, please refer to the <uri |
34 | link="/doc/en/udev-guide.xml">Gentoo udev Guide</uri>. |
37 | link="/doc/en/udev-guide.xml">Gentoo udev Guide</uri>. |
35 | </warn> |
38 | </warn> |
36 | |
39 | |
37 | <p> |
40 | <p> |
… | |
… | |
56 | <p> |
59 | <p> |
57 | If you take a look at a certain device file, you might find something |
60 | If you take a look at a certain device file, you might find something |
58 | like this: |
61 | like this: |
59 | </p> |
62 | </p> |
60 | |
63 | |
61 | <pre caption = "Checking the information of a device file"> |
64 | <pre caption="Checking the information of a device file"> |
62 | # <i>ls -l /dev/hda</i> |
65 | # <i>ls -l /dev/hda</i> |
63 | brw-rw---- 1 root disk 3, 0 Jul 5 2000 /dev/hda |
66 | brw-rw---- 1 root disk 3, 0 Jul 5 2000 /dev/hda |
64 | </pre> |
67 | </pre> |
65 | |
68 | |
66 | <p> |
69 | <p> |
… | |
… | |
217 | <p> |
220 | <p> |
218 | To give you an idea on the directories, this is a listing of the |
221 | To give you an idea on the directories, this is a listing of the |
219 | directories which I have on my laptop: |
222 | directories which I have on my laptop: |
220 | </p> |
223 | </p> |
221 | |
224 | |
222 | <pre caption = "Directories in /dev"> |
225 | <pre caption="Directories in /dev"> |
223 | cdroms/ cpu/ discs/ floppy/ |
226 | cdroms/ cpu/ discs/ floppy/ |
224 | ide/ input/ loop/ misc/ |
227 | ide/ input/ loop/ misc/ |
225 | netlink/ printers/ pts/ pty/ |
228 | netlink/ printers/ pts/ pty/ |
226 | scsi/ sg/ shm/ sound/ |
229 | scsi/ sg/ shm/ sound/ |
227 | sr/ usb/ vc/ vcc/ |
230 | sr/ usb/ vc/ vcc/ |
… | |
… | |
238 | use of the previous, old scheme. To make sure no system is broken, |
241 | use of the previous, old scheme. To make sure no system is broken, |
239 | <c>devfsd</c> is created. This daemon creates symlinks with the old |
242 | <c>devfsd</c> is created. This daemon creates symlinks with the old |
240 | names, pointing to the new device files. |
243 | names, pointing to the new device files. |
241 | </p> |
244 | </p> |
242 | |
245 | |
243 | <pre caption = "Created symlinks"> |
246 | <pre caption="Created symlinks"> |
244 | $ <i>ls -l /dev/hda4</i> |
247 | $ <i>ls -l /dev/hda4</i> |
245 | lr-xr-xr-x 1 root root 33 Aug 25 12:08 /dev/hda4 -> ide/host0/bus0/target0/lun0/part4 |
248 | lr-xr-xr-x 1 root root 33 Aug 25 12:08 /dev/hda4 -> ide/host0/bus0/target0/lun0/part4 |
246 | </pre> |
249 | </pre> |
247 | |
250 | |
248 | <p> |
251 | <p> |
… | |
… | |
279 | |
282 | |
280 | <p> |
283 | <p> |
281 | To send a signal, simply use <c>kill</c> or <c>killall</c>: |
284 | To send a signal, simply use <c>kill</c> or <c>killall</c>: |
282 | </p> |
285 | </p> |
283 | |
286 | |
284 | <pre caption = "Sending the SIGHUP signal to devfsd"> |
287 | <pre caption="Sending the SIGHUP signal to devfsd"> |
285 | # <i>kill -s SIGHUP `pidof devfsd`</i> |
288 | # <i>kill -s SIGHUP `pidof devfsd`</i> |
286 | <comment>or</comment> |
289 | <comment>or</comment> |
287 | # <i>killall -s SIGHUP devfsd</i> |
290 | # <i>killall -s SIGHUP devfsd</i> |
288 | </pre> |
291 | </pre> |
289 | |
292 | |
… | |
… | |
301 | If you want the compatibility symlinks that clutter up <path>/dev</path> |
304 | If you want the compatibility symlinks that clutter up <path>/dev</path> |
302 | removed from your Gentoo system (Gentoo activates it per default), edit |
305 | removed from your Gentoo system (Gentoo activates it per default), edit |
303 | <path>/etc/devfsd.conf</path> and remove the following two lines: |
306 | <path>/etc/devfsd.conf</path> and remove the following two lines: |
304 | </p> |
307 | </p> |
305 | |
308 | |
306 | <pre caption = "/etc/devfsd.conf for backwards compatibility"> |
309 | <pre caption="/etc/devfsd.conf for backwards compatibility"> |
307 | <comment># Comment the following two lines out to remove the symlinks</comment> |
310 | <comment># Comment the following two lines out to remove the symlinks</comment> |
308 | REGISTER .* MKOLDCOMPAT |
311 | REGISTER .* MKOLDCOMPAT |
309 | UNREGISTER .* RMOLDCOMPAT |
312 | UNREGISTER .* RMOLDCOMPAT |
310 | </pre> |
313 | </pre> |
311 | |
314 | |
… | |
… | |
323 | When you load a module, devfs will automatically create the device |
326 | When you load a module, devfs will automatically create the device |
324 | files. If you don't want this behaviour, remove the following line from |
327 | files. If you don't want this behaviour, remove the following line from |
325 | <path>/etc/devfsd.conf</path>: |
328 | <path>/etc/devfsd.conf</path>: |
326 | </p> |
329 | </p> |
327 | |
330 | |
328 | <pre caption = "/etc/devfsd.conf, autoload functionality"> |
331 | <pre caption="/etc/devfsd.conf, autoload functionality"> |
329 | LOOKUP .* MODLOAD |
332 | LOOKUP .* MODLOAD |
330 | </pre> |
333 | </pre> |
331 | |
334 | |
332 | </body> |
335 | </body> |
333 | </section> |
336 | </section> |
… | |
… | |
348 | <p> |
351 | <p> |
349 | If you want to set permissions using <path>/etc/devfsd.conf</path>, |
352 | If you want to set permissions using <path>/etc/devfsd.conf</path>, |
350 | then use the syntax used in the following example: |
353 | then use the syntax used in the following example: |
351 | </p> |
354 | </p> |
352 | |
355 | |
353 | <pre caption = "Permissions in /etc/devfsd.conf"> |
356 | <pre caption="Permissions in /etc/devfsd.conf"> |
354 | REGISTER ^cdroms/.* PERMISSIONS root.cdrom 0660 |
357 | REGISTER ^cdroms/.* PERMISSIONS root.cdrom 0660 |
355 | </pre> |
358 | </pre> |
356 | |
359 | |
357 | <p> |
360 | <p> |
358 | The second field is the device group, starting from <path>/dev</path>. |
361 | The second field is the device group, starting from <path>/dev</path>. |
… | |
… | |
377 | will save the information so that it will persist across reboots. This |
380 | will save the information so that it will persist across reboots. This |
378 | is because the <path>/etc/devfsd.conf</path> file contains the |
381 | is because the <path>/etc/devfsd.conf</path> file contains the |
379 | following lines: |
382 | following lines: |
380 | </p> |
383 | </p> |
381 | |
384 | |
382 | <pre caption = "/etc/devfsd.conf for saving permissions"> |
385 | <pre caption="/etc/devfsd.conf for saving permissions"> |
383 | REGISTER ^pt[sy]/.* IGNORE |
386 | REGISTER ^pt[sy]/.* IGNORE |
384 | CHANGE ^pt[sy]/.* IGNORE |
387 | CHANGE ^pt[sy]/.* IGNORE |
385 | CREATE ^pt[sy]/.* IGNORE |
388 | CREATE ^pt[sy]/.* IGNORE |
386 | DELETE ^pt[sy] IGNORE |
389 | DELETE ^pt[sy] IGNORE |
387 | REGISTER ^log IGNORE |
390 | REGISTER ^log IGNORE |
… | |
… | |
408 | devfs is not mounted automatically (meaning you'll have to recompile |
411 | devfs is not mounted automatically (meaning you'll have to recompile |
409 | your kernel) and that <path>/dev/console</path> exists. Then, somewhere |
412 | your kernel) and that <path>/dev/console</path> exists. Then, somewhere |
410 | at the beginning of the bootscripts of your system, you place: |
413 | at the beginning of the bootscripts of your system, you place: |
411 | </p> |
414 | </p> |
412 | |
415 | |
413 | <pre caption = "Mounting /lib/dev-state on top of /dev"> |
416 | <pre caption="Mounting /lib/dev-state on top of /dev"> |
414 | mount --bind /dev /lib/dev-state |
417 | mount --bind /dev /lib/dev-state |
415 | mount -t devfs none /dev |
418 | mount -t devfs none /dev |
416 | devfsd /dev |
419 | devfsd /dev |
417 | </pre> |
420 | </pre> |
418 | |
421 | |