From 3b33cd3cc3e5a5237ec7c3a204099ee07a142c31db8e7d4313786d69c50e3530 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Fri, 3 May 2024 11:19:13 +0200 Subject: [PATCH] Sync from SUSE:SLFO:Main biosdevname revision 5e81d6d2da6cbb7b6179b5c022f5535a --- .gitattributes | 23 ++ _service | 16 ++ _servicedata | 4 + biosdevname-0.7.3.7.g495ab76.obscpio | 3 + biosdevname-dom0.patch | 54 +++++ biosdevname-pic.patch | 28 +++ biosdevname.changes | 338 +++++++++++++++++++++++++++ biosdevname.obsinfo | 5 + biosdevname.spec | 99 ++++++++ ignore-broken-BIOSes | 10 + udev-rule-path.patch | 28 +++ whitelist-dell | 25 ++ 12 files changed, 633 insertions(+) create mode 100644 .gitattributes create mode 100644 _service create mode 100644 _servicedata create mode 100644 biosdevname-0.7.3.7.g495ab76.obscpio create mode 100644 biosdevname-dom0.patch create mode 100644 biosdevname-pic.patch create mode 100644 biosdevname.changes create mode 100644 biosdevname.obsinfo create mode 100644 biosdevname.spec create mode 100644 ignore-broken-BIOSes create mode 100644 udev-rule-path.patch create mode 100644 whitelist-dell diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/_service b/_service new file mode 100644 index 0000000..922c8a1 --- /dev/null +++ b/_service @@ -0,0 +1,16 @@ + + + git + https://github.com/dell/biosdevname.git + master + v(.*) + @PARENT_TAG@.@TAG_OFFSET@.g%h + enable + + + + + *.tar + xz + + diff --git a/_servicedata b/_servicedata new file mode 100644 index 0000000..8eea092 --- /dev/null +++ b/_servicedata @@ -0,0 +1,4 @@ + + + https://github.com/dell/biosdevname.git + 495ab76e0d5f0eba83f9c86baf779a244ea1b60d \ No newline at end of file diff --git a/biosdevname-0.7.3.7.g495ab76.obscpio b/biosdevname-0.7.3.7.g495ab76.obscpio new file mode 100644 index 0000000..2060623 --- /dev/null +++ b/biosdevname-0.7.3.7.g495ab76.obscpio @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:914b1282c801e293b3477c970d3417a6c2a5f23aea988d75d4c2994471b06bb4 +size 368651 diff --git a/biosdevname-dom0.patch b/biosdevname-dom0.patch new file mode 100644 index 0000000..d6c9a36 --- /dev/null +++ b/biosdevname-dom0.patch @@ -0,0 +1,54 @@ +--- + src/bios_dev_name.c | 31 +++++++++++++++++++++++++++++++ + 1 file changed, 31 insertions(+) + +Index: biosdevname-0.7.3/src/bios_dev_name.c +=================================================================== +--- biosdevname-0.7.3.orig/src/bios_dev_name.c ++++ biosdevname-0.7.3/src/bios_dev_name.c +@@ -133,6 +133,33 @@ cpuid (u_int32_t eax, u_int32_t ecx) + } + + /* ++ Starting with xen-4.7 cpuid will return with the hypervisor bit set ++ on AMD systems. This breaks biosdevname and network interface names. ++ Instead of relying on cpuid check for dom0 in xenfs. ++*/ ++static int ++running_in_dom0(void) ++{ ++ size_t len = 0; ++#ifdef __x86_64__ ++ char buf[16]; ++ FILE *f = fopen("/proc/xen/capabilities", "r"); ++ ++ if (!f) ++ return 0; ++ memset(buf, 0, sizeof(buf)); ++ len = fread(&buf, 1, sizeof(buf) - 1, f); ++ fclose(f); ++ while(len && --len && len < sizeof(buf)) { ++ if (buf[len] == '\n') ++ buf[len] = '\0'; ++ } ++ len = strcmp("control_d", buf) == 0; ++#endif ++ return len; ++} ++ ++/* + Algorithm suggested by: + http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1009458 + */ +@@ -144,7 +171,11 @@ running_in_virtual_machine (void) + + ecx = cpuid (eax, ecx); + if (ecx & 0x80000000U) ++ { ++ if (running_in_dom0()) ++ return 0; + return 1; ++ } + return 0; + } + diff --git a/biosdevname-pic.patch b/biosdevname-pic.patch new file mode 100644 index 0000000..6adc15d --- /dev/null +++ b/biosdevname-pic.patch @@ -0,0 +1,28 @@ +Index: biosdevname-0.7.1/src/bios_dev_name.c +=================================================================== +--- biosdevname-0.7.1.orig/src/bios_dev_name.c ++++ biosdevname-0.7.1/src/bios_dev_name.c +@@ -114,10 +114,21 @@ static u_int32_t + cpuid (u_int32_t eax, u_int32_t ecx) + { + asm volatile ( +- "xor %%ebx, %%ebx; cpuid" ++#ifdef __x86_64__ ++ "push %%rbx\n" ++#else ++ "push %%ebx\n" ++#endif ++ "xor %%ebx, %%ebx\n" /* not useful? ebx is overwritten by call? */ ++ "cpuid\n" ++#ifdef __x86_64__ ++ "pop %%rbx\n" ++#else ++ "pop %%ebx\n" ++#endif + : "=a" (eax), "=c" (ecx) + : "a" (eax) +- : "%ebx", "%edx"); ++ : "%edx"); + return ecx; + } + diff --git a/biosdevname.changes b/biosdevname.changes new file mode 100644 index 0000000..024d9d9 --- /dev/null +++ b/biosdevname.changes @@ -0,0 +1,338 @@ +------------------------------------------------------------------- +Fri Jul 9 07:38:43 UTC 2021 - Thomas Renninger + +- Enhance _service file +- Update to version 0.7.3: + * Add SMBIOS 3.x support + * Read DMI entries from /sys/firmware/dmi/tables/DMI + * Add buffer read helper using read explicitly + * man: fix all_ethN indentation + * Netronome biosdevname support (#8) + * Prevent infinite recursion in dmidecode.c::smbios_setslot by (#7) + * Add support for ExaNIC network cards (#5) + +This are now all mainline and got reverted: +D biosdevname-Add-buffer-read-helper-using-read-explicitly.patch +D biosdevname-Add-SMBIOS-3.x-support.patch +D biosdevname-Read-DMI-entries-from-sys-firmware-dmi-tables-DMI.patch +D dmidecode-prevent-infinite-recursion.patch + +------------------------------------------------------------------- +Tue Jun 8 09:39:44 UTC 2021 - Ludwig Nussel + +- install to /usr (boo#1029961) + +------------------------------------------------------------------- +Fri Sep 18 08:37:25 UTC 2020 - Sebastian Parschauer + +- Amend the package description + +------------------------------------------------------------------- +Thu Aug 13 16:41:27 UTC 2020 - Michal Suchanek + +- Add support for SMBIOS 3. + * biosdevname-Add-SMBIOS-3.x-support.patch +- Fix URL in specfile. It should be readable to developers. + +------------------------------------------------------------------- +Thu Aug 13 11:35:43 UTC 2020 - Michal Suchanek + +- Read DMI info rom sysfs (bsc#1174491). + * biosdevname-Add-buffer-read-helper-using-read-explicitly.patch + * biosdevname-Read-DMI-entries-from-sys-firmware-dmi-tables-DMI.patch + +------------------------------------------------------------------- +Wed Jan 22 10:57:56 UTC 2020 - Dominique Leuenberger + +- BuildRequire pkgconfig(libudev) instead of libudev-devel: allow + OBS to shortcut through the -mini flavors. + +------------------------------------------------------------------- +Wed May 23 11:32:02 UTC 2018 - josef.moellers@suse.com + +- Prevent infinite recursion in dmidecode.c::smbios_setslot by + checking that subordinate bus has a number greater than the + current bus. + [bsc#1093625, dmidecode-prevent-infinite-recursion.patch] + +------------------------------------------------------------------- +Tue Mar 27 11:52:38 CEST 2018 - kukuk@suse.de + +- Use %license instead of %doc [bsc#1082318] + +------------------------------------------------------------------- +Fri Sep 22 12:27:58 UTC 2017 - josef.moellers@suse.com + +- Update to version 0.7.3 + * Shipping and future Dell EMC systems support consistent network + device naming feature. + [fate#332490] + +------------------------------------------------------------------- +Fri Jun 9 16:27:56 UTC 2017 - fschnizlein@suse.com + +- Update to latest HEAD to 02811d5165c2eeecf8797fe9b5088d6e78bd25db + * Changed source to github + * Ignore naming of non-Ethernet network interfaces + * Prevent reading of VPD-DCM strings for SRIOV-vfs + - removed patch v0.7.2_to_HEAD_66eab208.patch + +------------------------------------------------------------------- +Thu Jan 19 17:44:56 UTC 2017 - felix.gerling@suse.com + +- Update to HEAD 66eab208d3c2abe947ba0a793094ee856e8fb3ee + * Fix use-after-free of fd + +------------------------------------------------------------------- +Tue Aug 16 14:18:06 UTC 2016 - olaf@aepfle.de + +- Detect dom0 via xenfs instead of cpuid to compensate for ABI + change in xen-4.7 on AMD systems. (bnc#974257) + biosdevname-dom0.patch + +------------------------------------------------------------------- +Fri Mar 4 13:34:44 UTC 2016 - trenn@suse.de + +- Update to latest 0.7.2 version (fate#319998) + +------------------------------------------------------------------- +Sun Jan 17 10:14:18 UTC 2016 - mpluskal@suse.com + +- Update to 0.7.1 + * no upstream changelog provided + +------------------------------------------------------------------- +Thu Dec 10 16:00:47 CET 2015 - tiwai@suse.de + +- Fix missing dependency on coreutils for initrd macros (boo#958562) +- Call missing initrd macro at postun (boo#958562) + +------------------------------------------------------------------- +Mon Jul 13 07:08:26 UTC 2015 - werner@suse.de + +- Add missed build require on pkgconfig udev + +------------------------------------------------------------------- +Wed Jun 3 07:29:09 UTC 2015 - mpluskal@suse.com + +- Update to 0.6.2 + * no upstream changelog provided + +------------------------------------------------------------------- +Fri Apr 10 12:38:21 UTC 2015 - zaitor@opensuse.org + +- Fix fault in ignore-broken-BIOSes patch (boo#920054). + +------------------------------------------------------------------- +Fri Apr 3 08:56:16 UTC 2015 - mpluskal@suse.com + +- Use url for source +- Cleanup spec file with spec-cleaner + +------------------------------------------------------------------- +Sat Feb 21 22:49:47 UTC 2015 - meissner@suse.com + +- biosdevname-pic.patch: make cpuid() not expose %ebx out of + assembler, so we can build it with -fPIE. + +------------------------------------------------------------------- +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 + (biosdevname_udevrule_rename_all_network_devices.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 + +- Add mainline commit: 51b8cdb0b60df3baa + With this patch, the info can be showed correctly if there are two or more + PCI root ports in the same Bus ID/Device ID (bnc#890562) + Add: fix_several_PCI_root_ports_in_one_bus.patch + +------------------------------------------------------------------- +Fri Jun 13 17:01:24 UTC 2014 - trenn@suse.de + +- Fix missing %posttrans section + +------------------------------------------------------------------- +Fri Jun 13 11:13:27 UTC 2014 - trenn@suse.de + +- For some reason /usr/lib/udev/rules.d/99-systemd.rules seem not to exist + anymore. This is used to determine which udev rules.d to use. + Use 95-udev-late.rules instead. + Modified: udev-rule-path.patch + +------------------------------------------------------------------- +Fri May 16 11:11:22 UTC 2014 - trenn@suse.de + +- 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 + +------------------------------------------------------------------- +Thu May 8 09:10:30 UTC 2014 - trenn@suse.de + +- Provide Supplements: modalias(dmi:*svnDell*) + so that the package gets autoinstalled on all Dell platforms + bnc#876733 + +------------------------------------------------------------------- +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 + +- Remove eth* check, devices might have been renamed already bnc#869614 + Add biosdevname_udevrule_rename_all_network_devices.patch +- Remove old mkinitrd stuff and replace it with dracut rpm macros to ensure + the initrd is rebuild if biosdevname got installed or updated. + +------------------------------------------------------------------- +Tue Mar 25 13:42:43 UTC 2014 - trenn@suse.de + +- update to latest git repo patches (c140ce659a204d67e4) including a fix + requested by Dell for Enterprise procducts (bnc#836342) +- Pass --no-configure to autogen.sh avoid double calling of ./configure + +------------------------------------------------------------------- +Mon Jan 20 16:34:53 UTC 2014 - juwolf@suse.com + +- Updated to version 0.5.0 + * Add version number to biosdevname + * Save off Secondary PCI bus for PCI tree traversal + * Change scan of SMBIOS slot <-> PCI mapping +- Drop: biosdevname-0.4.1.tar.gz +- Add: biosdevname-0.5.0.tar.bz2 +- Add biosdevname_git_v050_to_head.patch: Latest fixes from v0.5.0 to HEAD + +------------------------------------------------------------------- +Fri Jul 12 19:33:10 CEST 2013 - ohering@suse.de + +- Update mkinitrd helper to look for rules in /lib and /usr/lib (bnc#820216) + +------------------------------------------------------------------- +Mon Apr 22 12:08:57 UTC 2013 - idonmez@suse.com + +- Use correct directory for udev rules + +------------------------------------------------------------------- +Mon Dec 3 13:51:01 UTC 2012 - p.drouand@gmail.com + +- Update to 0.4.1 version: + * Use addslot() to track both embedded and physical index per slot + * Add fixes to ignore NPAR parsing on some cards +- Removed patchs: more-cmdline-args, verify-network-VPD, bug-706505 + fixed on upstream releases bnc#706505 +------------------------------------------------------------------- +Wed May 30 16:37:11 UTC 2012 - sweet_f_a@gmx.de + +- remove useless automake dependecy + +------------------------------------------------------------------- +Wed Dec 21 09:04:06 UTC 2011 - aj@suse.de + +- Fix download URL. + +------------------------------------------------------------------- +Wed Nov 30 09:43:41 UTC 2011 - coolo@suse.com + +- add automake as buildrequire to avoid implicit dependency + +------------------------------------------------------------------- +Fri Sep 23 12:02:44 UTC 2011 - duwe@suse.com + +- fix bnc#706505 + +------------------------------------------------------------------- +Sat Sep 17 19:47:58 UTC 2011 - jengelh@medozas.de + +- Remove redundant tags/sections from specfile + +------------------------------------------------------------------- +Wed Sep 7 14:50:24 UTC 2011 - duwe@suse.com + +- Verify length of VPD on network device (bnc#711172) + +------------------------------------------------------------------- +Wed Aug 3 16:11:21 UTC 2011 - duwe@novell.com + +- Enable on all Dell machines (bnc#705109) + +------------------------------------------------------------------- +Mon Aug 1 13:17:24 UTC 2011 - duwe@novell.com + +- pull patch to restrict SMBIOS version and to disable PIRQ usage + from upstream. +- use the above to fix bnc#705162 + +------------------------------------------------------------------- +Tue Jul 19 10:45:45 UTC 2011 - duwe@novell.com + +- version 0.3.8 contains unconditional asm inline, making it + x86-only (bnc#706622) + +------------------------------------------------------------------- +Thu Jul 7 18:38:07 UTC 2011 - duwe@novell.com + +- fix bnc#704182 + +------------------------------------------------------------------- +Thu Jun 16 13:54:58 CEST 2011 - duwe@suse.de + +- update to 0.3.8, disable rule by default (FATE#312154) +- remove now obsolete patches biosdevname-delete-unused-function.diff, + biosdevname-policy-all_names.diff and + biosdevname-0.2.4-wronglinking.patch. + +------------------------------------------------------------------- +Sat Apr 30 15:55:06 UTC 2011 - crrodriguez@opensuse.org + +- fix build with gcc 4.6, wrong linker options + +------------------------------------------------------------------- +Mon Nov 24 17:46:38 CET 2008 - bwalle@suse.de + +- Change to --policy=all_names (bnc#441079). + +------------------------------------------------------------------- +Thu Oct 09 18:11:29 CEST 2008 - bwalle@suse.de + +- Delete unused function onboard_device_type() (bnc#433795). + +------------------------------------------------------------------- +Thu Jul 31 13:48:47 CEST 2008 - bwalle@suse.de + +- integrate biosdevname to initrd (bnc#403269, FATE#301528) + +------------------------------------------------------------------- +Sat Sep 22 17:37:00 CEST 2007 - bwalle@suse.de + +- update to 0.2.4 + o coordinate udev rules usage with udev maintainer + o fix crashes in pcmcia search, in_ethernet(), and incorrect + command line parsing. + +------------------------------------------------------------------- +Mon Sep 3 16:28:27 CEST 2007 - bwalle@suse.de + +- fix crash on startup + +------------------------------------------------------------------- +Mon Sep 3 00:00:00 CEST 2007 - bwalle@suse.de + +- initial package for SUSE (209107, FATE 301528) + +------------------------------------------------------------------- diff --git a/biosdevname.obsinfo b/biosdevname.obsinfo new file mode 100644 index 0000000..7f70699 --- /dev/null +++ b/biosdevname.obsinfo @@ -0,0 +1,5 @@ +name: biosdevname +version: 0.7.3.7.g495ab76 +mtime: 1599238290 +commit: 495ab76e0d5f0eba83f9c86baf779a244ea1b60d + diff --git a/biosdevname.spec b/biosdevname.spec new file mode 100644 index 0000000..fc13470 --- /dev/null +++ b/biosdevname.spec @@ -0,0 +1,99 @@ +# +# spec file for package biosdevname +# +# Copyright (c) 2021 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%define _udevrulesdir %(pkg-config --variable=udevdir udev)/rules.d +Name: biosdevname +Version: 0.7.3.7.g495ab76 +Release: 0 +Summary: Udev helper for naming devices per BIOS names +License: GPL-2.0-only +Group: System/Base +URL: https://github.com/dell/biosdevname +Source0: %{name}-%{version}.tar.xz +Patch1: ignore-broken-BIOSes +Patch2: whitelist-dell +Patch3: udev-rule-path.patch +Patch4: biosdevname-pic.patch +Patch5: biosdevname-dom0.patch +BuildRequires: automake +BuildRequires: pciutils-devel +BuildRequires: pkg-config +BuildRequires: sed +BuildRequires: suse-module-tools +BuildRequires: zlib-devel +# to figure out how to name/location of the rules file +BuildRequires: pkgconfig(libudev) +BuildRequires: pkgconfig(udev) +Requires(post): coreutils +Requires(postun):coreutils +# for ownership of /usr/lib/udev/rules.d +Requires: udev +BuildRequires: pkgconfig(udev) +Supplements: modalias(dmi:*svnDell*) +BuildRoot: %{_tmppath}/%{name}-%{version}-build +# SMBIOS and PCI IRQ Routing Tables only exist on these arches. It's +# also likely that other arches don't expect the PCI bus to be sorted +# breadth-first, or of so, there haven't been any comments about that +# on LKML. +ExclusiveArch: %ix86 x86_64 + +%description +biosdevname in its simplest form takes a kernel name as an +argument, and returns the BIOS-given name it "should" be. This is +necessary on systems where the BIOS name for a given device (e.g. the +label on the chassis is "Gb1") doesn't map directly and obviously to +the kernel name (e.g. eth0). + +You can enable/disable usage of biosdevname with boot option +"biosdevname=[0|1]" + +%prep +%setup -q +%autopatch -p1 + +%build +sed -i -e 's#@@BIOSDEVNAME_RULEDEST@@#'%{_udevrulesdir}'/71-biosdevname.rules#' configure.ac +autoreconf -fi +%configure \ + --disable-rpath +make %{?_smp_mflags} + +%install +make DESTDIR=%{buildroot} install %{?_smp_mflags} + +%files +%defattr(-,root,root,-) +%license COPYING +%doc README +%{_sbindir}/%{name} +%{_udevrulesdir}/71-biosdevname.rules + +%{_mandir}/man1/* + +%post +/sbin/ldconfig +%{?regenerate_initrd_post} + +%postun +/sbin/ldconfig +%{?regenerate_initrd_post} + +%posttrans +%{?regenerate_initrd_posttrans} + +%changelog diff --git a/ignore-broken-BIOSes b/ignore-broken-BIOSes new file mode 100644 index 0000000..add3312 --- /dev/null +++ b/ignore-broken-BIOSes @@ -0,0 +1,10 @@ +--- biosdevname-0.6.1-orig/biosdevname.rules.in 2014-11-03 19:07:11.000000000 +0100 ++++ biosdevname-0.6.1/biosdevname.rules.in 2015-04-10 14:44:37.937236074 +0200 +@@ -19,6 +19,6 @@ + + # using NAME= instead of setting INTERFACE_NAME, so that persistent + # names aren't generated for these devices, they are "named" on each boot. +-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 new file mode 100644 index 0000000..fea7ef4 --- /dev/null +++ b/udev-rule-path.patch @@ -0,0 +1,28 @@ +Index: biosdevname-0.7.1/configure.ac +=================================================================== +--- biosdevname-0.7.1.orig/configure.ac ++++ biosdevname-0.7.1/configure.ac +@@ -66,20 +66,9 @@ AC_FUNC_STAT + 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 +- # 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) diff --git a/whitelist-dell b/whitelist-dell new file mode 100644 index 0000000..6de6931 --- /dev/null +++ b/whitelist-dell @@ -0,0 +1,25 @@ +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" ++ + # 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" +