Search
j0ke.net Open Build Service
>
Projects
>
home:jg
:
playground
>
dracut
> 0322-network-rename-interfaces-properly.patch
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File 0322-network-rename-interfaces-properly.patch of Package dracut
From 754beeddf274e152cba45e2d8284aeaeaccd4d31 Mon Sep 17 00:00:00 2001 From: Harald Hoyer <harald@redhat.com> Date: Wed, 14 Aug 2013 12:17:21 +0200 Subject: [PATCH] network: rename interfaces properly https://bugzilla.redhat.com/show_bug.cgi?id=910605 --- modules.d/40network/ifname-genrules.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/modules.d/40network/ifname-genrules.sh b/modules.d/40network/ifname-genrules.sh index 5186e91..5663ce4 100755 --- a/modules.d/40network/ifname-genrules.sh +++ b/modules.d/40network/ifname-genrules.sh @@ -6,14 +6,23 @@ if ! getarg ifname= >/dev/null ; then fi { + + echo 'SUBSYSTEM!="net", GOTO="ifname_end"' + echo 'ACTION!="add", GOTO="ifname_end"' + echo 'DRIVERS!="?*", GOTO="ifname_end"' + echo 'ATTR{type}!="1", GOTO="ifname_end"' + for p in $(getargs ifname=); do parse_ifname_opts $p - printf 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="%s", ATTR{type}=="1", NAME="%s"\n' "$ifname_mac" "$ifname_if" + printf 'ATTR{address}=="%s", NAME="%s", GOTO="ifname_end"\n' "$ifname_mac" "$ifname_if" done # Rename non named interfaces out of the way for named ones. for p in $(getargs ifname=); do parse_ifname_opts $p - printf 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="?*", ATTR{type}=="1", NAME!="?*", KERNEL=="%s", NAME="%%k-renamed"\n' "$ifname_if" + printf 'ATTR{address}!="%s", KERNEL=="%s", NAME="rename$attr{ifindex}", GOTO="ifname_end"\n' "$ifname_mac" "$ifname_if" done + + echo 'LABEL="ifname_end"' + } > /etc/udev/rules.d/50-ifname.rules -- 1.8.3.1