summaryrefslogtreecommitdiff
path: root/sysconf/69-vyatta-net.rules
blob: 9e874381f067f68cfc88414a3809c6de492bb909 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# These rules use vyatta_net_name to persistently name network interfaces
# per "hwid" association with the interface block of the vyatta config file.

# note that this is actually invoked twice: once during early rcS (udev)
# and the second time during rl-system (rescan). pre-mendocino, ACTION is
# "add" on both invocations, so the original rule looks for "add".
#
# however, in mendocino, the squeeze udev performs the second invocation with
# ACTION "change", so the original rule does not get applied on the second
# invocation, and therefore config.boot is not updated by rl-system.
#
# to emulate the previous behavior, invoke vyatta_net_name for both "add" and
# "change" for now. however, the two-pass approach should be revisited to
# determine if it is still necessary.

ACTION!="add", ACTION!="change",	GOTO="vyatta_net_end"
SUBSYSTEM!="net",			GOTO="vyatta_net_end"

# ignore the interface if a name has already been set
NAME=="?*",				GOTO="vyatta_net_end"

# Do name change for ethernet devices only
KERNEL=="eth*", PROGRAM="vyatta_net_name %k $attr{address}", NAME="%c"

LABEL="vyatta_net_end"