mirror of
https://github.com/systemd/systemd.git
synced 2024-11-05 23:51:28 +03:00
9b23e594bf
This should be called by triggering events not by looping with the script itself. It also keeps a second blacklist outside of the rules which we do not want to maintain.
24 lines
1.2 KiB
Plaintext
24 lines
1.2 KiB
Plaintext
# these rules generate rules for persistent network device naming
|
|
|
|
ACTION=="add", SUBSYSTEM=="net", KERNEL=="eth*|ath*|wlan*|ra*|sta*|ctc*|lcs*|hsi*" \
|
|
NAME!="?*", DRIVERS=="?*", GOTO="persistent_net_generator_do"
|
|
|
|
GOTO="persistent_net_generator_end"
|
|
LABEL="persistent_net_generator_do"
|
|
|
|
# build device description string to add a comment the generated rule
|
|
SUBSYSTEMS=="pci", ENV{COMMENT}="PCI device $attr{vendor}:$attr{device} ($driver)"
|
|
SUBSYSTEMS=="usb", ENV{COMMENT}="USB device 0x$attr{idVendor}:0x$attr{idProduct} ($driver)"
|
|
SUBSYSTEMS=="pcmcia", ENV{COMMENT}="PCMCIA device $attr{card_id}:$attr{manf_id} ($driver)"
|
|
SUBSYSTEMS=="ccwgroup", ENV{COMMENT}="S/390 $driver device at $id", ENV{NETDEV}="$id", ENV{NETDRV}="$driver"
|
|
SUBSYSTEMS=="ieee1394", ENV{COMMENT}="Firewire device $attr{host_id})"
|
|
SUBSYSTEMS=="xen", ENV{COMMENT}="Xen virtual device"
|
|
ENV{COMMENT}=="", ENV{COMMENT}="$env{SUBSYSTEM} device ($driver)"
|
|
|
|
ENV{NETDEV}=="?*", IMPORT{program}="write_net_rules --driver $env{NETDRV} --id $env{NETDEV}"
|
|
ENV{NETDEV}!="?*", IMPORT{program}="write_net_rules $attr{address}"
|
|
ENV{INTERFACE_NEW}=="?*", NAME="$env{INTERFACE_NEW}"
|
|
|
|
LABEL="persistent_net_generator_end"
|
|
|