diff --git a/biosdevname.changes b/biosdevname.changes index a32a500..2157ee2 100644 --- a/biosdevname.changes +++ b/biosdevname.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Tue Apr 22 13:41:21 UTC 2014 - trenn@suse.de + +- Take mainline patch to fix (bnc#869614) + Modified: biosdevname_udevrule_rename_all_network_devices.patch +- Remove %config from etc rule to please obs checker +- Remove mkinitrd setup script + ------------------------------------------------------------------- Thu Apr 10 17:14:24 UTC 2014 - trenn@suse.de diff --git a/biosdevname.spec b/biosdevname.spec index 809a0b5..97d918c 100644 --- a/biosdevname.spec +++ b/biosdevname.spec @@ -30,7 +30,6 @@ Url: http://linux.dell.com/files/biosdevname/ # on LKML. ExclusiveArch: %{ix86} x86_64 Source0: %{name}-%{version}.tar.bz2 -Source1: setup-biosdevname.sh Patch1: biosdevname_v0.5.0_to_git_c140ce659a204d67e4cc.patch Patch2: ignore-broken-BIOSes Patch3: whitelist-dell @@ -43,8 +42,7 @@ BuildRequires: pkgconfig BuildRequires: zlib-devel # to figure out how to name/location of the rules file BuildRequires: libudev-devel -# because of mkinitrd_setup in %post and %postun -PreReq: mkinitrd +BuildRequires: suse-module-tools # for ownership of /lib/udev/rules.d Requires: udev @@ -73,15 +71,10 @@ You can enable/disable usage of biosdevname with boot option ./autogen.sh --no-configure %configure --disable-rpath --prefix=/ --bindir=/bin --sbindir=/sbin make %{?_smp_mflags} -cp %{S:1} . %install make install DESTDIR=$RPM_BUILD_ROOT rm %{buildroot}/sbin/%{name}S || : -mkdir -p $RPM_BUILD_ROOT/lib/mkinitrd/scripts -install -m 0755 setup-biosdevname.sh \ - $RPM_BUILD_ROOT/lib/mkinitrd/scripts/setup-biosdevname.sh - # remain disabled by default perl -pi -e 's,^# GOTO,GOTO,g;' \ $RPM_BUILD_ROOT/%{_udevrulesdir}/*-biosdevname.rules @@ -90,9 +83,8 @@ perl -pi -e 's,^# GOTO,GOTO,g;' \ %defattr(-,root,root,-) %doc COPYING README /sbin/%{name} -%config(noreplace) %{_udevrulesdir}/*%{name}.rules +%{_udevrulesdir}/*%{name}.rules %{_mandir}/man1/* -/lib/mkinitrd/scripts/setup-biosdevname.sh %post /sbin/ldconfig diff --git a/biosdevname_udevrule_rename_all_network_devices.patch b/biosdevname_udevrule_rename_all_network_devices.patch index 0d360b1..4158580 100644 --- a/biosdevname_udevrule_rename_all_network_devices.patch +++ b/biosdevname_udevrule_rename_all_network_devices.patch @@ -1,17 +1,47 @@ -biosdevname: Rename all network devices, not only eth* ones - -There are other rules which might have renamed the device already. -bnc#869614 +From: Tom Gundersen +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 +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,5 +1,4 @@ +@@ -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 -i %k", NAME="%c", OPTIONS+="string_escape=replace" + + LABEL="netdevicename_end" diff --git a/setup-biosdevname.sh b/setup-biosdevname.sh deleted file mode 100644 index 5f6c89e..0000000 --- a/setup-biosdevname.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301, USA. -# -#%stage: crypto -#%provides: biosdevname - -# -# the binary location must match location used in udev rule -cp_bin /sbin/biosdevname "${tmp_mnt}/sbin/biosdevname" - -mkdir -p "${tmp_mnt}/etc/udev/rules.d" -for i in \ - /usr/lib/udev/rules.d/*-biosdevname.rules \ - /lib/udev/rules.d/*-biosdevname.rules -do - if test -f "$i" - then - cp --remove-destination "$i" "${tmp_mnt}/etc/udev/rules.d" - fi -done - - -# vim: set sw=4 ts=4 et: