Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 827937 - sys-fs/udev: rename rules.d file for legacy renaming to new filename
Summary: sys-fs/udev: rename rules.d file for legacy renaming to new filename
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal critical
Assignee: Gentoo systemd Team
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2021-12-01 11:37 UTC by kavol
Modified: 2021-12-02 01:44 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kavol 2021-12-01 11:37:34 UTC
to prevent eudev from renaming your network interface to some nonsense, the recommended method is to touch /etc/udev/rules.d/80-net-name-slot.rules

with udev, the file name changes to /etc/udev/rules.d/80-net-setup-link.rules

it would be very nice to rename the file on update

or at least mention it in the news item before people are left with network machines unaccessible (yes, I have one 60 km away from me without anyone competent to fix it in reach ...:-( )

Reproducible: Always
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-12-01 11:43:03 UTC
I think we recommend using the kernel config option but if the new filename works, I don't see a problem with moving it in pkg_postinst.

I'm sorry for the inconvenience.
Comment 2 kavol 2021-12-01 12:17:01 UTC
(In reply to Sam James from comment #1)
> I think we recommend using the kernel config option

according to
https://wiki.gentoo.org/wiki/Udev#Optional:_Keep_classic_network_interface_naming

the kernel option is mentioned as "Alternatively ..."

> but if the new filename works,

yes, confirmed on another (fortunately local) machine

> I don't see a problem with moving it in pkg_postinst.

thanks in advance ... if someone affected still hasn't updated by now
Comment 3 Mike Gilbert gentoo-dev 2021-12-01 18:41:16 UTC
I could add a warning to the ebuild.

I don't really want to do a rename without user interaction because that would cause a change in behavior for people who have already switched, but maybe forgot to remove the old rules file.

Also, I updated the wiki with the instructions provided by systemd.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-12-01 18:54:09 UTC
(In reply to Mike Gilbert from comment #3)
> I could add a warning to the ebuild.

Yes please!

> 
> I don't really want to do a rename without user interaction because that
> would cause a change in behavior for people who have already switched, but
> maybe forgot to remove the old rules file.
> 

That's a reasonable point. OK, I understand.

> Also, I updated the wiki with the instructions provided by systemd.

Thanks.
Comment 5 Mike Gilbert gentoo-dev 2021-12-01 19:49:58 UTC
So it turns out that we already emit a warning when switching from eudev to udev:

> if [[ ${HAD_EUDEV} -eq 1 ]] ; then
>     ewarn
>     ewarn "${P} defaults to predictable interface renaming, as described in the URL below:"
>     ewarn "https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames"
>     ewarn
>     ewarn "If you wish to disable this, please see the above documentation, or set"
>     ewarn "net.ifnames=0 on the kernel command line."
> fi

I suppose it would be safe to rename the file under the same conditions (eudev -> udev).
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-12-01 19:55:00 UTC
(In reply to Mike Gilbert from comment #5)
> So it turns out that we already emit a warning when switching from eudev to
> udev:
> 
> > if [[ ${HAD_EUDEV} -eq 1 ]] ; then
> >     ewarn
> >     ewarn "${P} defaults to predictable interface renaming, as described in the URL below:"
> >     ewarn "https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames"
> >     ewarn
> >     ewarn "If you wish to disable this, please see the above documentation, or set"
> >     ewarn "net.ifnames=0 on the kernel command line."
> > fi
> 
> I suppose it would be safe to rename the file under the same conditions
> (eudev -> udev).

I'd totally forgotten about this (although I think it was part of why I suggested it initially). Yeah, let's do that.
Comment 7 Larry the Git Cow gentoo-dev 2021-12-01 20:09:50 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=511de3842159b3f3d74489e7f4acfbdb5b083971

commit 511de3842159b3f3d74489e7f4acfbdb5b083971
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2021-12-01 19:58:29 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2021-12-01 20:09:45 +0000

    sys-fs/udev: rename 80-net-name-slot.rules when migrating from eudev
    
    Closes: https://bugs.gentoo.org/827937
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 sys-fs/udev/udev-249.6-r1.ebuild | 6 ++++++
 sys-fs/udev/udev-249.6.ebuild    | 6 ++++++
 sys-fs/udev/udev-9999.ebuild     | 6 ++++++
 3 files changed, 18 insertions(+)
Comment 8 Larry the Git Cow gentoo-dev 2021-12-02 01:37:19 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/data/gentoo-news.git/commit/?id=eba63773624dd2dbdceefdf8ab2c88aab22dab40

commit eba63773624dd2dbdceefdf8ab2c88aab22dab40
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2021-12-02 01:36:34 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-12-02 01:36:34 +0000

    2021-08-24-eudev-retirement: mention options for disabling "predictable naming"
    
    Bug: https://bugs.gentoo.org/827937
    Signed-off-by: Sam James <sam@gentoo.org>

 .../2021-08-24-eudev-retirement.en.txt                     | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
Comment 9 Larry the Git Cow gentoo-dev 2021-12-02 01:44:24 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3532dcec7655597f7f6de85a5835e8363a876879

commit 3532dcec7655597f7f6de85a5835e8363a876879
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2021-12-02 01:43:59 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-12-02 01:44:16 +0000

    sys-fs/udev: link to wiki for classic interface names too
    
    Bug: https://bugs.gentoo.org/827937
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-fs/udev/udev-249-r3.ebuild   | 1 +
 sys-fs/udev/udev-249.6-r1.ebuild | 1 +
 sys-fs/udev/udev-249.6.ebuild    | 1 +
 sys-fs/udev/udev-9999.ebuild     | 1 +
 4 files changed, 4 insertions(+)