Annotation of /trunk/udev/udev-persistent-net-generator.rules.magellan
Parent Directory | Revision Log
Revision 1124 -
(hide annotations)
(download)
Mon Sep 13 14:05:04 2010 UTC (14 years ago) by niro
File size: 4855 byte(s)
Mon Sep 13 14:05:04 2010 UTC (14 years ago) by niro
File size: 4855 byte(s)
-merged with upstream udev-162 rules
1 | niro | 121 | # /etc/udev/rules/75-persistent-net-generator.rules: device naming rules for udev |
2 | niro | 1016 | # $Header: /root/magellan-cvs/src/udev/udev-persistent-net-generator.rules.magellan,v 1.6 2010-04-06 23:46:22 niro Exp $ |
3 | niro | 515 | # |
4 | # There are a number of modifiers that are allowed to be used in some | ||
5 | # of the different fields. They provide the following subsitutions: | ||
6 | # %n - the "kernel number" of the device. | ||
7 | # For example, 'sda3' has a "kernel number" of '3' | ||
8 | # %k - the kernel name for the device. | ||
9 | # %M - the kernel major number for the device | ||
10 | # %m - the kernel minor number for the device | ||
11 | # %b - the bus id for the device | ||
12 | # %c - the string returned by the PROGRAM. (Note, this doesn't work within | ||
13 | # the PROGRAM field for the obvious reason.) | ||
14 | # %s{filename} - the content of a sysfs attribute. | ||
15 | # %% - the '%' char itself. | ||
16 | # | ||
17 | # Try not to modify this file, if you wish to change things, create a new rule | ||
18 | # file that can be run before this one. | ||
19 | # | ||
20 | niro | 121 | |
21 | # these rules generate rules for persistent network device naming | ||
22 | niro | 515 | # |
23 | # variables used to communicate: | ||
24 | # MATCHADDR MAC address used for the match | ||
25 | # MATCHID bus_id used for the match | ||
26 | # MATCHDRV driver name used for the match | ||
27 | # MATCHIFTYPE interface type match | ||
28 | # COMMENT comment to add to the generated rule | ||
29 | # INTERFACE_NAME requested name supplied by external tool | ||
30 | # INTERFACE_NEW new interface name returned by rule writer | ||
31 | niro | 121 | |
32 | niro | 294 | ACTION!="add", GOTO="persistent_net_generator_end" |
33 | SUBSYSTEM!="net", GOTO="persistent_net_generator_end" | ||
34 | niro | 121 | |
35 | niro | 294 | # ignore the interface if a name has already been set |
36 | NAME=="?*", GOTO="persistent_net_generator_end" | ||
37 | |||
38 | niro | 515 | # device name whitelist |
39 | niro | 717 | KERNEL!="eth*|ath*|wlan*[0-9]|msh*|ra*|sta*|ctc*|lcs*|hsi*", GOTO="persistent_net_generator_end" |
40 | niro | 515 | |
41 | niro | 294 | # ignore Xen virtual interfaces |
42 | SUBSYSTEMS=="xen", GOTO="persistent_net_generator_end" | ||
43 | |||
44 | niro | 515 | # read MAC address |
45 | ENV{MATCHADDR}="$attr{address}" | ||
46 | |||
47 | # match interface type | ||
48 | ENV{MATCHIFTYPE}="$attr{type}" | ||
49 | |||
50 | niro | 1124 | # ignore KVM virtual interfaces |
51 | ENV{MATCHADDR}=="52:54:00:*", GOTO="persistent_net_generator_end" | ||
52 | # ignore VMWare virtual interfaces | ||
53 | ENV{MATCHADDR}=="00:0c:29:*|00:50:56:*", GOTO="persistent_net_generator_end" | ||
54 | |||
55 | niro | 823 | # These vendors are known to violate the local MAC address assignment scheme |
56 | # Interlan, DEC (UNIBUS or QBUS), Apollo, Cisco, Racal-Datacom | ||
57 | ENV{MATCHADDR}=="02:07:01:*", GOTO="globally_administered_whitelist" | ||
58 | # 3Com | ||
59 | ENV{MATCHADDR}=="02:60:60:*", GOTO="globally_administered_whitelist" | ||
60 | # 3Com IBM PC; Imagen; Valid; Cisco; Apple | ||
61 | ENV{MATCHADDR}=="02:60:8c:*", GOTO="globally_administered_whitelist" | ||
62 | # Intel | ||
63 | ENV{MATCHADDR}=="02:a0:c9:*", GOTO="globally_administered_whitelist" | ||
64 | # Olivetti | ||
65 | ENV{MATCHADDR}=="02:aa:3c:*", GOTO="globally_administered_whitelist" | ||
66 | # CMC Masscomp; Silicon Graphics; Prime EXL | ||
67 | ENV{MATCHADDR}=="02:cf:1f:*", GOTO="globally_administered_whitelist" | ||
68 | # Prominet Corporation Gigabit Ethernet Switch | ||
69 | ENV{MATCHADDR}=="02:e0:3b:*", GOTO="globally_administered_whitelist" | ||
70 | # BTI (Bus-Tech, Inc.) IBM Mainframes | ||
71 | ENV{MATCHADDR}=="02:e6:d3:*", GOTO="globally_administered_whitelist" | ||
72 | # Realtek | ||
73 | ENV{MATCHADDR}=="52:54:00:*", GOTO="globally_administered_whitelist" | ||
74 | # Novell 2000 | ||
75 | ENV{MATCHADDR}=="52:54:4c:*", GOTO="globally_administered_whitelist" | ||
76 | # Realtec | ||
77 | ENV{MATCHADDR}=="52:54:ab:*", GOTO="globally_administered_whitelist" | ||
78 | # Kingston Technologies | ||
79 | ENV{MATCHADDR}=="e2:0c:0f:*", GOTO="globally_administered_whitelist" | ||
80 | |||
81 | niro | 1016 | # match interface dev_id |
82 | ATTR{dev_id}=="?*", ENV{MATCHDEVID}="$attr{dev_id}" | ||
83 | |||
84 | niro | 515 | # do not use "locally administered" MAC address |
85 | ENV{MATCHADDR}=="?[2367abef]:*", ENV{MATCHADDR}="" | ||
86 | |||
87 | # do not use empty address | ||
88 | ENV{MATCHADDR}=="00:00:00:00:00:00", ENV{MATCHADDR}="" | ||
89 | |||
90 | niro | 823 | LABEL="globally_administered_whitelist" |
91 | |||
92 | niro | 515 | # build comment line for generated rule: |
93 | niro | 294 | SUBSYSTEMS=="pci", ENV{COMMENT}="PCI device $attr{vendor}:$attr{device} ($driver)" |
94 | niro | 823 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="?*", ENV{COMMENT}="USB device 0x$attr{idVendor}:0x$attr{idProduct} ($driver)" |
95 | niro | 294 | SUBSYSTEMS=="pcmcia", ENV{COMMENT}="PCMCIA device $attr{card_id}:$attr{manf_id} ($driver)" |
96 | niro | 121 | SUBSYSTEMS=="ieee1394", ENV{COMMENT}="Firewire device $attr{host_id})" |
97 | |||
98 | niro | 717 | # ibmveth likes to use "locally administered" MAC addresses |
99 | DRIVERS=="ibmveth", ENV{MATCHADDR}="$attr{address}", ENV{COMMENT}="ibmveth ($id)" | ||
100 | |||
101 | niro | 515 | # S/390 uses id matches only, do not use MAC address match |
102 | SUBSYSTEMS=="ccwgroup", ENV{COMMENT}="S/390 $driver device at $id", ENV{MATCHID}="$id", ENV{MATCHDRV}="$driver", ENV{MATCHADDR}="" | ||
103 | niro | 294 | |
104 | niro | 515 | # see if we got enough data to create a rule |
105 | ENV{MATCHADDR}=="", ENV{MATCHID}=="", ENV{INTERFACE_NAME}=="", GOTO="persistent_net_generator_end" | ||
106 | niro | 294 | |
107 | niro | 515 | # default comment |
108 | niro | 717 | ENV{COMMENT}=="", ENV{COMMENT}="net device ($attr{driver})" |
109 | niro | 515 | |
110 | # write rule | ||
111 | DRIVERS=="?*", IMPORT{program}="write_net_rules" | ||
112 | |||
113 | # rename interface if needed | ||
114 | niro | 121 | ENV{INTERFACE_NEW}=="?*", NAME="$env{INTERFACE_NEW}" |
115 | |||
116 | LABEL="persistent_net_generator_end" |