From 7735872d7600ab3a0a48ecc4d34342a88ecc96453f9e35884e0c771ab2f5ad42 Mon Sep 17 00:00:00 2001 From: Thomas Renninger Date: Thu, 22 Jan 2015 14:13:09 +0000 Subject: [PATCH] - Update to version 0.6.1 - Do not disable rule via perl script in .spec file, better use a patch - Modify configure.ac via sed to make use of %{_udevruledir} from .spec file - Remove already integrated patches in latest source code: Delete biosdevname_v0.5.0_to_git_c140ce659a204d67e4cc.patch Delete biosdevname_udevrule_rename_all_network_devices.patch Delete fix_several_PCI_root_ports_in_one_bus.patch Modify udev-rule-path.patch Modify whitelist-dell OBS-URL: https://build.opensuse.org/package/show/Base:System/biosdevname?expand=0&rev=37 --- biosdevname-0.5.0.tar.bz2 | 3 -- biosdevname-0.6.1.tar.bz2 | 3 ++ biosdevname.changes | 13 ++++++++ biosdevname.spec | 26 ++++++---------- ignore-broken-BIOSes | 13 ++++---- udev-rule-path.patch | 62 +++++++++++++++++++++++++++++++-------- whitelist-dell | 23 +++++++++++---- 7 files changed, 100 insertions(+), 43 deletions(-) delete mode 100644 biosdevname-0.5.0.tar.bz2 create mode 100644 biosdevname-0.6.1.tar.bz2 diff --git a/biosdevname-0.5.0.tar.bz2 b/biosdevname-0.5.0.tar.bz2 deleted file mode 100644 index dd2952b..0000000 --- a/biosdevname-0.5.0.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2619f42fbfa049930346af6c7f149d2475d93d7cedc4dfab27f18a7b34b0cc69 -size 84045 diff --git a/biosdevname-0.6.1.tar.bz2 b/biosdevname-0.6.1.tar.bz2 new file mode 100644 index 0000000..b762c74 --- /dev/null +++ b/biosdevname-0.6.1.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a295b8d876bb0d75be1b575c414197c629ef132c00b386e2226a7b6324f0bf51 +size 160908 diff --git a/biosdevname.changes b/biosdevname.changes index d730efe..be7172b 100644 --- a/biosdevname.changes +++ b/biosdevname.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Thu Jan 22 13:02:08 UTC 2015 - trenn@suse.de + +- Update to version 0.6.1 +- Do not disable rule via perl script in .spec file, better use a patch +- Modify configure.ac via sed to make use of %{_udevruledir} from .spec file +- Remove already integrated patches in latest source code: + Delete biosdevname_v0.5.0_to_git_c140ce659a204d67e4cc.patch + Delete biosdevname_udevrule_rename_all_network_devices.patch + Delete fix_several_PCI_root_ports_in_one_bus.patch + Modify udev-rule-path.patch + Modify whitelist-dell + ------------------------------------------------------------------- Tue Aug 12 16:03:10 UTC 2014 - trenn@suse.de diff --git a/biosdevname.spec b/biosdevname.spec index c226afa..0924757 100644 --- a/biosdevname.spec +++ b/biosdevname.spec @@ -1,7 +1,7 @@ # # spec file for package biosdevname # -# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,9 +16,8 @@ # - Name: biosdevname -Version: 0.5.0 +Version: 0.6.1 Release: 0 Summary: Udev helper for naming devices per BIOS names License: GPL-2.0 @@ -30,16 +29,14 @@ Url: http://linux.dell.com/files/biosdevname/ # on LKML. ExclusiveArch: %{ix86} x86_64 Source0: %{name}-%{version}.tar.bz2 -Patch1: biosdevname_v0.5.0_to_git_c140ce659a204d67e4cc.patch -Patch2: ignore-broken-BIOSes -Patch3: whitelist-dell -Patch4: udev-rule-path.patch -Patch5: biosdevname_udevrule_rename_all_network_devices.patch -Patch6: fix_several_PCI_root_ports_in_one_bus.patch +Patch1: ignore-broken-BIOSes +Patch2: whitelist-dell +Patch3: udev-rule-path.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: automake BuildRequires: pciutils-devel BuildRequires: pkgconfig +BuildRequires: sed BuildRequires: zlib-devel # to figure out how to name/location of the rules file BuildRequires: libudev-devel @@ -65,28 +62,23 @@ You can enable/disable usage of biosdevname with boot option %patch1 -p1 %patch2 -p1 %patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 %build -# this is a udev rule, so it needs to live in / rather than /usr -./autogen.sh --no-configure +sed -i -e 's#@@BIOSDEVNAME_RULEDEST@@#'%{_udevrulesdir}'/71-biosdevname.rules#' configure.ac +autoreconf %configure --disable-rpath --prefix=/ --bindir=/bin --sbindir=/sbin make %{?_smp_mflags} %install make install DESTDIR=$RPM_BUILD_ROOT rm %{buildroot}/sbin/%{name}S || : -# remain disabled by default -perl -pi -e 's,^# GOTO,GOTO,g;' \ - $RPM_BUILD_ROOT/%{_udevrulesdir}/*-biosdevname.rules %files %defattr(-,root,root,-) %doc COPYING README /sbin/%{name} %{_udevrulesdir}/*%{name}.rules + %{_mandir}/man1/* %post diff --git a/ignore-broken-BIOSes b/ignore-broken-BIOSes index 8a39775..c9de2d1 100644 --- a/ignore-broken-BIOSes +++ b/ignore-broken-BIOSes @@ -1,10 +1,13 @@ ---- biosdevname-0.3.8/biosdevname.rules.in.orig 2011-03-09 00:58:08.000000000 +0100 -+++ biosdevname-0.3.8/biosdevname.rules.in 2011-08-01 15:13:10.000000000 +0200 -@@ -18,6 +18,6 @@ LABEL="netdevicename_start" +Index: biosdevname-0.6.1/biosdevname.rules.in +=================================================================== +--- biosdevname-0.6.1.orig/biosdevname.rules.in 2015-01-21 16:00:20.790396992 +0100 ++++ biosdevname-0.6.1/biosdevname.rules.in 2015-01-21 16:01:54.926398489 +0100 +@@ -19,6 +19,7 @@ # 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 -i %k", NAME="%c", OPTIONS+="string_escape=replace" -+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" ++SUBSYSTEMS=="pci", PROGRAM="/sbin/biosdevname --policy physical --smbios 2.6 ++ --nopirq -i %k", NAME="%c", OPTIONS+="string_escape=replace" LABEL="netdevicename_end" diff --git a/udev-rule-path.patch b/udev-rule-path.patch index 5257189..105fb5b 100644 --- a/udev-rule-path.patch +++ b/udev-rule-path.patch @@ -1,16 +1,52 @@ -Index: biosdevname-0.5.0/configure.ac +Index: biosdevname-0.6.1/configure.ac =================================================================== ---- biosdevname-0.5.0.orig/configure.ac -+++ biosdevname-0.5.0/configure.ac -@@ -70,7 +70,10 @@ AC_CHECK_FUNCS([dup2 gettimeofday memset - # handles default udev rules as of udev 114 or thereabouts - RULEDEST=/lib/udev/rules.d/71-biosdevname.rules +--- biosdevname-0.6.1.orig/configure.ac 2014-12-01 16:05:47.000000000 +0100 ++++ biosdevname-0.6.1/configure.ac 2015-01-22 13:24:22.231621837 +0100 +@@ -66,20 +66,9 @@ + AC_FUNC_VPRINTF + AC_CHECK_FUNCS([dup2 gettimeofday memset munmap select socket strcasecmp strchr strdup strerror strncasecmp strpbrk strrchr strstr strtol strtoul]) +-# this is ugly, but accounts for SLES 10, Red Hat/Fedora, and Ubuntu +-# handles default udev rules as of udev 114 or thereabouts +-RULEDEST=/lib/udev/rules.d/71-biosdevname.rules +- -if [[ -e /etc/udev/rules.d/60-net.rules ]]; then -+if [[ -e /usr/lib/udev/rules.d/95-udev-late.rules ]]; then -+ # openSUSE 12.3+ -+ RULEDEST=/usr/lib/udev/rules.d/71-biosdevname.rules -+elif [[ -e /etc/udev/rules.d/60-net.rules ]]; then - # RHEL 5 / Fedora - RULEDEST=/etc/udev/rules.d/60-biosdevname.rules - elif [[ -e /etc/udev/rules.d/31-network.rules ]]; then +- # RHEL 5 / Fedora +- RULEDEST=/etc/udev/rules.d/60-biosdevname.rules +-elif [[ -e /etc/udev/rules.d/31-network.rules ]]; then +- # SLES 10 +- RULEDEST=/etc/udev/rules.d/31-biosdevname.rules +-elif [[ -e /etc/udev/rules.d/25-iftab.rules ]]; then +- # older Ubuntu +- RULEDEST=/etc/udev/rules.d/25-biosdevname.rules +-fi ++# Only way to make this robust: Replace for each distro with the correct path ++# /lib/udev/rules.d/71-biosdevname.rules ++RULEDEST=@@BIOSDEVNAME_RULEDEST@@ + RULEDIR=$(dirname $RULEDEST) + AC_SUBST(RULEDEST, $RULEDEST) + AC_SUBST(RULEDIR, $RULEDIR) +Index: biosdevname-0.6.1/configure +=================================================================== +--- biosdevname-0.6.1.orig/configure 2014-12-01 16:06:21.000000000 +0100 ++++ biosdevname-0.6.1/configure 2015-01-22 13:48:51.915645203 +0100 +@@ -7305,18 +7305,7 @@ + + # this is ugly, but accounts for SLES 10, Red Hat/Fedora, and Ubuntu + # handles default udev rules as of udev 114 or thereabouts +-RULEDEST=/lib/udev/rules.d/71-biosdevname.rules +- +-if [ -e /etc/udev/rules.d/60-net.rules ]; then +- # RHEL 5 / Fedora +- RULEDEST=/etc/udev/rules.d/60-biosdevname.rules +-elif [ -e /etc/udev/rules.d/31-network.rules ]; then +- # SLES 10 +- RULEDEST=/etc/udev/rules.d/31-biosdevname.rules +-elif [ -e /etc/udev/rules.d/25-iftab.rules ]; then +- # older Ubuntu +- RULEDEST=/etc/udev/rules.d/25-biosdevname.rules +-fi ++RULEDEST=@@BIOSDEVNAME_RULEDEST@@ + RULEDIR=$(dirname $RULEDEST) + RULEDEST=$RULEDEST + diff --git a/whitelist-dell b/whitelist-dell index 5ce9f24..6de6931 100644 --- a/whitelist-dell +++ b/whitelist-dell @@ -1,8 +1,10 @@ ---- biosdevname-0.3.8/biosdevname.rules.in.orig 2011-08-03 18:06:57.000000000 +0200 -+++ biosdevname-0.3.8/biosdevname.rules.in 2011-08-03 18:07:59.000000000 +0200 -@@ -3,6 +3,9 @@ - ACTION!="add", GOTO="netdevicename_end" - NAME=="?*", GOTO="netdevicename_end" +Index: biosdevname-0.6.1/biosdevname.rules.in +=================================================================== +--- biosdevname-0.6.1.orig/biosdevname.rules.in 2015-01-22 13:18:19.275616067 +0100 ++++ biosdevname-0.6.1/biosdevname.rules.in 2015-01-22 13:59:10.967655045 +0100 +@@ -4,6 +4,9 @@ + 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" @@ -10,3 +12,14 @@ # kernel command line "biosdevname={0|1}" can turn off/on biosdevname IMPORT{cmdline}="biosdevname" ENV{biosdevname}=="?*", ENV{UDEV_BIOSDEVNAME}="$env{biosdevname}" +@@ -12,8 +15,8 @@ + ENV{UDEV_BIOSDEVNAME}=="0", GOTO="netdevicename_end" + ENV{UDEV_BIOSDEVNAME}=="1", GOTO="netdevicename_start" + +-# uncomment the next line for biosdevname to be off by default +-# GOTO="netdevicename_end" ++# comment the next line for biosdevname to be on by default ++GOTO="netdevicename_end" + + LABEL="netdevicename_start" +