Gentoo Archives: gentoo-user

From: Marc Joliet <marcec@×××.de>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] udev-197 and /etc/udev/rules.d/
Date: Tue, 22 Jan 2013 17:52:20
Message-Id: 20130122185159.1cbd90a0@marcec.hunte.us
In Reply to: Re: [gentoo-user] udev-197 and /etc/udev/rules.d/ by Neil Bothwick
1 Am Tue, 22 Jan 2013 14:23:57 +0000
2 schrieb Neil Bothwick <neil@××××××××××.uk>:
3
4 > On Mon, 21 Jan 2013 21:56:00 -0600, »Q« wrote:
5 >
6 > > Here's /etc/udev/rules.d/12-opticaldrive.rules, just one line:
7 > >
8 > > KERNEL=="sr0", SUBSYSTEM=="block", NAME="opticaldrive", SYMLINK+="%k",
9 > > SYMLINK+="cdrom", SYMLINK+="cdrw", SYMLINK+="dvd", SYMLINK+="dvdrom",
10 > > SYMLINK+="dvdrw"
11 >
12 > ISTR a change in udev that prevented renaming devices. Put it all as
13 > symlinks instead of renaming and trying to symlink back to %k. It seems
14 > that all the replies with working examples do it this way too.
15
16 I was interested enough to look this up. I looked through the git log of
17 my /etc/udev/rules.d/ and found that in early October 2012 I committed a change
18 to that effect, so something did change at some point.
19
20 However, I can't find any reference to that in the udev changelog. In fact, it
21 actually looks like it's a kernel change and that udev is really just "obeying"
22 the kernel [0] [1].
23
24 But I did find out that this is in fact documented in the udev(7) man page:
25
26 NAME
27 The name to use for a network interface. The name of a device node cannot
28 be changed by udev, only additional symlinks can be created.
29
30 So currently you can only change network interface names, and nothing else.
31
32 [0] I haven't searched extensively, but found a related Email from Greg K-H
33 (search for "rename") that points out that device node renaming has
34 problematic/fragile behaviour:
35 http://lkml.indiana.edu/hypermail/linux/kernel/1010.1/00427.html.
36
37 [1] https://www.kernel.org/doc/htmldocs/device-drivers/API-device-rename.html
38 (documentation generated from linux-3.0-rc7). Relevant quote: "Device nodes are
39 not renamed at all, there isn't even support for that in the kernel now."
40
41 HTH
42 --
43 Marc Joliet
44 --
45 "People who think they know everything really annoy those of us who know we
46 don't" - Bjarne Stroustrup

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
[gentoo-user] Re: udev-197 and /etc/udev/rules.d/ "»Q«" <boxcars@×××.net>