SHA256
1
0
forked from pool/biosdevname
biosdevname/biosdevname_udevrule_rename_all_network_devices.patch
Thomas Renninger 6810f5382b Accepting request 234294 from home:trenn:branches:Base:System
- Revert biosdevname calling with different parameters introduced
  with the change from the 22th of April as suggested by Dell.
  Modified: biosdevname_udevrule_rename_all_network_devices.patch

OBS-URL: https://build.opensuse.org/request/show/234294
OBS-URL: https://build.opensuse.org/package/show/Base:System/biosdevname?expand=0&rev=29
2014-05-16 12:44:38 +00:00

48 lines
2.1 KiB
Diff

From: Tom Gundersen <tgunders@redhat.com>
Subject: Fix double renaming of network interfaces on systems with systemd
References: bnc#869614
Patch-Mainline: yes
Git-commit: 6f7fbcc352aeae08b5cf2a8e608f92abf98529f8
Git-repo: linux.dell.com/biosdevname.git
Signed-off-by: Thomas Renninger <trenn@suse.de>
On systems with systemd, the network interfaces which are renamed by
biosdevname, could get renamed again by systemd. This happens because,
two ADD events get generated for every network interface and on the
second ADD event, the KERNEL!="eth*" check in 71-biosdevname.rules
matches as the interfaces will have em names. As a result, the NAME
gets unset and the interface will get renamed again by
80-net-name-slot.rules again to systemd naming scheme.
This patch addresses the issue by removing the KERNEL!="eth*" check.
Also, this patch enhances the 71-biosdevname.rules to
1. Check the interface type and run biosdevname if it matches ARPHRD_ETHER
2. Skip running biosdevname if the interface is a virtual device such
as vlan etc.
Index: biosdevname-0.5.0/biosdevname.rules.in
===================================================================
--- biosdevname-0.5.0.orig/biosdevname.rules.in
+++ biosdevname-0.5.0/biosdevname.rules.in
@@ -1,7 +1,8 @@
SUBSYSTEM!="net", GOTO="netdevicename_end"
-KERNEL!="eth*", GOTO="netdevicename_end"
ACTION!="add", GOTO="netdevicename_end"
NAME=="?*", GOTO="netdevicename_end"
+ATTR{type}!="1", GOTO="netdevicename_end"
+ENV{DEVTYPE}=="?*", GOTO="netdevicename_end"
# whitelist all Dell systems
ATTR{[dmi/id]sys_vendor}=="Dell*", ENV{UDEV_BIOSDEVNAME}="1"
@@ -21,6 +22,6 @@ LABEL="netdevicename_start"
# using NAME= instead of setting INTERFACE_NAME, so that persistent
# names aren't generated for these devices, they are "named" on each boot.
-PROGRAM="/sbin/biosdevname --policy physical --smbios 2.6 --nopirq -i %k", NAME="%c", OPTIONS+="string_escape=replace"
+SUBSYSTEMS=="pci", PROGRAM="/sbin/biosdevname --policy physical --smbios 2.6 --nopirq -i %k", NAME="%c", OPTIONS+="string_escape=replace"
LABEL="netdevicename_end"