Gentoo Archives: gentoo-user

From: Grant <emailgrant@×××××.com>
To: Gentoo mailing list <gentoo-user@l.g.o>
Subject: Re: [gentoo-user] Execute udev rule before net.* scripts
Date: Sun, 24 Aug 2014 16:49:25
Message-Id: CAN0CFw0wnbQ0vyRkx9_NZROEZ_HpsRG=uDoNhkUPKhXJ7c_Gug@mail.gmail.com
In Reply to: Re: [gentoo-user] Execute udev rule before net.* scripts by Samuli Suominen
1 >> I'm trying to define names for my USB network interfaces keyed on the
2 >> interface location instead of the interface MAC address. This udev
3 >> rule renames one of them:
4 >>
5 >> SUBSYSTEM=="net", KERNEL=="enp3s0u1", NAME="net0"
6 >>
7 >> But it doesn't work automatically at boot, I have to execute 'udevadm
8 >> trigger --action=add'. How can I execute that before the net.*
9 >> scripts at boot?
10 >>
11 >> - Grant
12 >>
13 >
14 > I'm not 100% convinced that's the right syntax to use. See,
15 >
16 > https://www.gentoo.org/doc/en/handbook/handbook-amd64.xml?part=4&chap=2#doc_chap4
17 >
18 >
19 > Using your Own Names
20 >
21 > Code Listing 4.2: Setting the lan0 name for the current eth0 interface
22 >
23 > # vim /etc/udev/rules.d/76-net-name-use-custom.rules
24 > # Second one uses ID_NET_NAME_PATH information, and 76- number to be between
25 > # 75-net-*.rules and 80-net-*.rules
26 > SUBSYSTEM=="net", ACTION=="add", ENV{ID_NET_NAME_PATH}=="enp3s0u1", NAME="net0"
27
28
29 Works perfectly! Thank you Samuli!
30
31 - Grant