summaryrefslogtreecommitdiff
path: root/extras
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@suse.de>2006-09-09 14:45:45 +0200
committerKay Sievers <kay.sievers@suse.de>2006-09-09 14:45:45 +0200
commit8091f6a90ccca1dd86271aec3441b01c2af4fbd5 (patch)
treed6fac4c98871911efeeebe8467b2a17de81ebedc /extras
parentc7c00276f6f26ff7f38e99d887137bc1f172a978 (diff)
rule_generator: improve net rule comment generation
Diffstat (limited to 'extras')
-rw-r--r--extras/rule_generator/75-persistent-net-generator.rules17
1 files changed, 10 insertions, 7 deletions
diff --git a/extras/rule_generator/75-persistent-net-generator.rules b/extras/rule_generator/75-persistent-net-generator.rules
index fdebb919bc..21eb0c6649 100644
--- a/extras/rule_generator/75-persistent-net-generator.rules
+++ b/extras/rule_generator/75-persistent-net-generator.rules
@@ -1,16 +1,19 @@
# these rules generate rules for persistent network device naming
-ACTION=="add", SUBSYSTEM=="net", NAME!="?*", DRIVERS=="?*", GOTO="persistent_net_generator_do"
-GOTO="persistent_net_generator_end"
+ACTION=="add", SUBSYSTEM=="net", KERNEL=="eth*|ath*|wlan*|ra*|sta*" \
+ NAME!="?*", DRIVERS=="?*", GOTO="persistent_net_generator_do"
+GOTO="persistent_net_generator_end"
LABEL="persistent_net_generator_do"
-# export device description to comment the generated rule
-SUBSYSTEMS=="pci", ENV{COMMENT}="PCI Device: $attr{vendor}:$attr{device} ($attr{driver})"
-SUBSYSTEMS=="usb", ENV{COMMENT}="USB Device: 0x$attr{idVendor}:0x$attr{idProduct} ($attr{driver})"
-SUBSYSTEMS=="ieee1394", ENV{COMMENT}="Firewire Device: $attr{host_id} ($attr{driver})"
+
+# build device description string to add a comment the generated rule
+SUBSYSTEMS=="pci", ENV{COMMENT}="PCI device $attr{vendor}:$attr{device} ($attr{driver})"
+SUBSYSTEMS=="usb", ENV{COMMENT}="USB device 0x$attr{idVendor}:0x$attr{idProduct} ($attr{driver})"
+SUBSYSTEMS=="ieee1394", ENV{COMMENT}="Firewire device $attr{host_id})"
SUBSYSTEMS=="xen", ENV{COMMENT}="Xen virtual device"
+ENV{COMMENT}=="", ENV{COMMENT}="$env{SUBSYSTEM} device ($attr{driver})"
-KERNEL=="eth*|ath*|wlan*|ra*|sta*", IMPORT{program}="write_net_rules $attr{address}"
+IMPORT{program}="write_net_rules $attr{address}"
ENV{INTERFACE_NEW}=="?*", NAME="$env{INTERFACE_NEW}"
LABEL="persistent_net_generator_end"