]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - config/mkinitcpio/udev.rules
Start core42.
[people/pmueller/ipfire-2.x.git] / config / mkinitcpio / udev.rules
1 # Udev rules for Archlinux by Tobias Powalowski <tpowa@archlinux.org>
2 #
3 # This ruleset should provide a DevFS-compatible device tree.
4 #
5 # There are a number of modifiers that are allowed to be used in some
6 # of the different fields. They provide the following subsitutions:
7 #
8 # %n the "kernel number" of the device.
9 # For example, 'sda3' has a "kernel number" of '3'
10 # %k the kernel name for the device.
11 # %M the kernel major number for the device
12 # %m the kernel minor number for the device
13 # %b the bus id for the device
14 # %c the string returned by the PROGRAM
15 # %s{filename} the content of a sysfs attribute.
16 # %% the '%' char itself.
17 #
18 # There are a number of modifiers that are allowed to be used in some of the
19 # fields. See the udev man page for a full description of them.
20 # global stuff
21 #
22
23 #####################################
24 # Early rules - begin
25 #####################################
26 # wait for sysfs
27 ACTION=="add", DEVPATH=="/devices/*", ENV{PHYSDEVBUS}=="?*", WAIT_FOR_SYSFS="bus"
28 ACTION=="add", SUBSYSTEM=="scsi", WAIT_FOR_SYSFS="ioerr_cnt"
29
30 #####################################
31 # Early rules -end
32 #####################################
33
34 #####################################
35 ###### Hotplug rules - begin
36 #####################################
37 # check if the device has already been claimed by a driver
38 ENV{PHYSDEVDRIVER}=="?*", GOTO="hotplug_driver_loaded"
39
40 # Modaliases to load
41 ACTION=="add", ENV{MODALIAS}=="?*", RUN+="/lib/udev/load-modules.sh $env{MODALIAS}"
42 # SCSI addon modules
43 ACTION=="add", SUBSYSTEM=="scsi", SYSFS{type}=="[07]", RUN+="/lib/udev/load-modules.sh sd_mod"
44 ACTION=="add", SUBSYSTEM=="scsi", SYSFS{type}=="14", RUN+="/lib/udev/load-modules.sh sd_mod"
45 ACTION=="add", SUBSYSTEM=="scsi", SYSFS{type}=="[45]", RUN+="/lib/udev/load-modules.sh sr_mod"
46 ACTION=="add", SUBSYSTEM=="scsi", SYSFS{type}=="1", SYSFS{vendor}=="Onstream", SYSFS{model}!="ADR*", RUN+="/lib/udev/load-modules.sh osst"
47 ACTION=="add", SUBSYSTEM=="scsi", SYSFS{type}=="1", SYSFS{vendor}=="Onstream", SYSFS{model}=="ADR*", RUN+="/lib/udev/load-modules.sh st"
48 ACTION=="add", SUBSYSTEM=="scsi", SYSFS{type}=="1", SYSFS{vendor}!="Onstream", RUN+="/lib/udev/load-modules.sh st"
49 ACTION=="add", SUBSYSTEM=="scsi", SYSFS{type}=="[23689]", RUN+="/lib/udev/load-modules.sh sg"
50
51 LABEL="hotplug_driver_loaded"
52
53 # FIRMWARE
54 ACTION=="add", SUBSYSTEM=="firmware", ENV{FIRMWARE}=="?*", RUN+="/lib/udev/firmware.sh"
55 #####################################
56 ##### Hotplug rules - end
57 #####################################
58
59 #####################################
60 ###### CD/DVD symlinks - begin
61 #####################################
62 ACTION=="add", BUS=="ide", KERNEL=="hd[a-z]", IMPORT="/lib/udev/cdrom_id --export $tempnode"
63 ACTION=="add", BUS=="scsi", KERNEL=="sr[0-9]*", IMPORT="/lib/udev/cdrom_id --export $tempnode"
64 ACTION=="add", BUS=="scsi", KERNEL=="scd[a-z]", IMPORT="/lib/udev/cdrom_id --export $tempnode"
65 ENV{ID_CDROM}=="?*", SYMLINK+="cd/cdrom-%b"
66 ENV{ID_CDROM_CD_RW}=="?*", SYMLINK+="cd/cdrw-%b"
67 ENV{ID_CDROM_DVD}=="?*", SYMLINK+="cd/dvd-%b"
68 ENV{ID_CDROM_DVD_R}=="?*", SYMLINK+="cd/dvd-%b"
69 #####################################
70 ###### CD/DVD symlinks - end
71 #####################################