A System and Service Manager
CentOS Sources
2017-09-05 83b94d10951d79445f7975bff835a88261c11a4e
import systemd-219-42.el7_4.1
4 files added
1 files modified
161 ■■■■■ changed files
SOURCES/0499-Revert-udev-net_id-add-support-for-phys_port_name-at.patch 95 ●●●●● patch | view | raw | blame | history
SOURCES/76-phys-port-name.conf 2 ●●●●● patch | view | raw | blame | history
SOURCES/76-phys-port-name.rules 8 ●●●●● patch | view | raw | blame | history
SOURCES/phys-port-name-gen 37 ●●●●● patch | view | raw | blame | history
SPECS/systemd.spec 19 ●●●●● patch | view | raw | blame | history
SOURCES/0499-Revert-udev-net_id-add-support-for-phys_port_name-at.patch
New file
@@ -0,0 +1,95 @@
From 6cbd97527f6d33a140072131785547e898ee4c7a Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Tue, 15 Aug 2017 12:30:03 +0200
Subject: [PATCH] Revert "udev: net_id: add support for phys_port_name
 attribute (#4506)"
This reverts commit 192545bc67fed763ac54761ca067b9c2f93ecdd1.
This caused change of the names for sfc driver.
Resolves: #1477285
---
 src/udev/udev-builtin-net_id.c | 24 ++++++------------------
 1 file changed, 6 insertions(+), 18 deletions(-)
diff --git a/src/udev/udev-builtin-net_id.c b/src/udev/udev-builtin-net_id.c
index 7c15435..19e1f26 100644
--- a/src/udev/udev-builtin-net_id.c
+++ b/src/udev/udev-builtin-net_id.c
@@ -38,7 +38,7 @@
  *   o<index>[d<dev_port>]                 -- on-board device index number
  *   s<slot>[f<function>][d<dev_port>]     -- hotplug slot index number
  *   x<MAC>                                -- MAC address
- *   [P<domain>]p<bus>s<slot>[f<function>][n<phys_port_name>|d<dev_id>/<dev_port>]
+ *   [P<domain>]p<bus>s<slot>[f<function>][d<dev_id>/<dev_port>]
  *                                         -- PCI geographical location
  *   [P<domain>]p<bus>s<slot>[f<function>][u<port>][..][c<config>][i<interface>]
  *                                         -- USB port number chain
@@ -134,7 +134,7 @@ static int dev_pci_onboard(struct udev_device *dev, struct netnames *names) {
         unsigned dev_port = 0;
         size_t l;
         char *s;
-        const char *attr, *port_name;
+        const char *attr;
         int idx;
         /* ACPI _DSM  -- device specific method for naming a PCI or PCI Express device */
@@ -161,15 +161,10 @@ static int dev_pci_onboard(struct udev_device *dev, struct netnames *names) {
         if (attr)
                 dev_port = strtol(attr, NULL, 10);
-        /* kernel provided front panel port name for multiple port PCI device */
-        port_name = udev_device_get_sysattr_value(dev, "phys_port_name");
-
         s = names->pci_onboard;
         l = sizeof(names->pci_onboard);
         l = strpcpyf(&s, l, "o%d", idx);
-        if (port_name)
-                l = strpcpyf(&s, l, "n%s", port_name);
-        else if (dev_port > 0)
+        if (dev_port > 0)
                 l = strpcpyf(&s, l, "d%d", dev_port);
         if (l == 0)
                 names->pci_onboard[0] = '\0';
@@ -204,7 +199,7 @@ static int dev_pci_slot(struct udev_device *dev, struct netnames *names) {
         unsigned domain, bus, slot, func, dev_id = 0;
         size_t l;
         char *s;
-        const char *attr, *port_name;
+        const char *attr;
         struct udev_device *pci = NULL;
         char slots[256], str[256];
         _cleanup_closedir_ DIR *dir = NULL;
@@ -225,9 +220,6 @@ static int dev_pci_slot(struct udev_device *dev, struct netnames *names) {
                 }
         }
-        /* kernel provided front panel port name for multiple port PCI device */
-        port_name = udev_device_get_sysattr_value(dev, "phys_port_name");
-
         /* compose a name based on the raw kernel's PCI bus, slot numbers */
         s = names->pci_path;
         l = sizeof(names->pci_path);
@@ -236,9 +228,7 @@ static int dev_pci_slot(struct udev_device *dev, struct netnames *names) {
         l = strpcpyf(&s, l, "p%us%u", bus, slot);
         if (func > 0 || is_pci_multifunction(names->pcidev))
                 l = strpcpyf(&s, l, "f%d", func);
-        if (port_name)
-                l = strpcpyf(&s, l, "n%s", port_name);
-        else if (dev_id > 0)
+        if (dev_id > 0)
                 l = strpcpyf(&s, l, "d%d", dev_id);
         if (l == 0)
                 names->pci_path[0] = '\0';
@@ -288,9 +278,7 @@ static int dev_pci_slot(struct udev_device *dev, struct netnames *names) {
                 l = strpcpyf(&s, l, "s%d", hotplug_slot);
                 if (func > 0 || is_pci_multifunction(names->pcidev))
                         l = strpcpyf(&s, l, "f%d", func);
-                if (port_name)
-                        l = strpcpyf(&s, l, "n%s", port_name);
-                else if (dev_id > 0)
+                if (dev_id > 0)
                         l = strpcpyf(&s, l, "d%d", dev_id);
                 if (l == 0)
                         names->pci_slot[0] = '\0';
SOURCES/76-phys-port-name.conf
New file
@@ -0,0 +1,2 @@
install_items+=" /usr/lib/udev/phys-port-name-gen "
install_items+=" /usr/lib/udev/rules.d/76-phys-port-name.rules "
SOURCES/76-phys-port-name.rules
New file
@@ -0,0 +1,8 @@
# do not edit this file, it will be overwritten on update
ACTION!="add", GOTO="phys_port_name_end"
SUBSYSTEM!="net", GOTO="phys_port_name_end"
DRIVERS=="mlxsw*", ATTR{phys_port_name}=="?*", IMPORT{program}="/usr/lib/udev/phys-port-name-gen %k"
DRIVERS=="rocker", ATTR{phys_port_name}=="?*", IMPORT{program}="/usr/lib/udev/phys-port-name-gen %k"
LABEL="phys_port_name_end"
SOURCES/phys-port-name-gen
New file
@@ -0,0 +1,37 @@
#!/bin/bash
SYSPATH="/sys/class/net/$1"
DEV_ID=$(<"${SYSPATH}/dev_id")
DEV_PORT=$(<"${SYSPATH}/dev_port")
PHYS_PORT_NAME=$(<"${SYSPATH}/phys_port_name")
#if PHYS_PORT_NAME is empty we are safe
[ -z "${PHYS_PORT_NAME}" ] && exit 0
# On-board index based names
if [ -n "${ID_NET_NAME_ONBOARD}" ]; then
    ID_NET_NAME_ONBOARD="${ID_NET_NAME_ONBOARD%d${DEV_PORT}}n${PHYS_PORT_NAME}"
fi
if [ -n "${DEV_ID}" ]; then
    DEV_ID=$(printf "%u" "${DEV_ID}")
    if [ "${DEV_ID}" -eq "0" ] && [ -n "${DEV_PORT}" ]; then
        # dev_port is decimal string, but we have a bug in net_id and we convert it to integer using base 16
        DEV_ID=$(printf "%u" "0x${DEV_PORT}")
    fi
fi
# PCI hot plug slot number based names
if [ -n "${ID_NET_NAME_SLOT}" ]; then
    ID_NET_NAME_SLOT="${ID_NET_NAME_SLOT%d${DEV_ID}}n${PHYS_PORT_NAME}"
fi
# PCI path based names
if [ -n "${ID_NET_NAME_PATH}" ]; then
    ID_NET_NAME_PATH="${ID_NET_NAME_PATH%d${DEV_ID}}n${PHYS_PORT_NAME}"
fi
[ -n "${ID_NET_NAME_ONBOARD}" ] && echo "ID_NET_NAME_ONBOARD=${ID_NET_NAME_ONBOARD}"
[ -n "${ID_NET_NAME_SLOT}" ] && echo "ID_NET_NAME_SLOT=${ID_NET_NAME_SLOT}"
[ -n "${ID_NET_NAME_PATH}" ] && echo "ID_NET_NAME_PATH=${ID_NET_NAME_PATH}"
SPECS/systemd.spec
@@ -7,7 +7,7 @@
Name:           systemd
Url:            http://www.freedesktop.org/wiki/Software/systemd
Version:        219
Release:        42%{?dist}
Release:        42%{?dist}.1
# For a breakdown of the licensing, see README
License:        LGPLv2+ and MIT and GPLv2+
Summary:        A System and Service Manager
@@ -34,6 +34,9 @@
Source11:       org.freedesktop.machine1.policy
Source12:       org.freedesktop.systemd1.policy
Source13:       org.freedesktop.timedate1.policy
Source14:       phys-port-name-gen
Source15:       76-phys-port-name.rules
Source16:       76-phys-port-name.conf
# RHEL-specific
Patch0001: 0001-kernel-install-add-fedora-specific-callouts-to-new-k.patch
@@ -534,6 +537,7 @@
Patch0496: 0496-sd_pid_notify_with_fds-fix-computing-msg_controllen.patch
Patch0497: 0497-rules-move-cpu-hotplug-rule-to-separate-file.patch
Patch0498: 0498-Revert-rules-move-cpu-hotplug-rule-to-separate-file.patch
Patch0499: 0499-Revert-udev-net_id-add-support-for-phys_port_name-at.patch
%global num_patches %{lua: c=0; for i,p in ipairs(patches) do c=c+1; end; print(c);}
@@ -871,6 +875,14 @@
# Delete LICENSE files from _docdir (we'll get them in as %%license)
rm -rf %{buildroot}%{_docdir}/LICENSE*
# Install script and udev rule for adding phys_port_name for mlxsw and rocker drivers
# And put them in dracut
mkdir -p %{buildroot}%{_prefix}/lib/udev/rules.d
install -m 0755 %{SOURCE14} %{buildroot}%{_prefix}/lib/udev/
install -m 0644 %{SOURCE15} %{buildroot}%{_prefix}/lib/udev/rules.d/
mkdir -p %{buildroot}%{_prefix}/lib/dracut/dracut.conf.d
install -m 0644 %{SOURCE16} %{buildroot}%{_prefix}/lib/dracut/dracut.conf.d/
%find_lang %{name}
@@ -1385,6 +1397,7 @@
%config(noreplace) %{_sysconfdir}/rc.d/rc.local
%{_sysconfdir}/rc.local
%{_datadir}/systemd/language-fallback-map
%{_prefix}/lib/dracut/dracut.conf.d/76-phys-port-name.conf
# Make sure we don't remove runlevel targets from F14 alpha installs,
# but make sure we don't create then anew.
@@ -1493,6 +1506,10 @@
%{_mandir}/man8/systemd-resolved.*
%changelog
* Tue Aug 15 2017 Lukas Nykryn <lnykryn@redhat.com> - 219-42.1
- Revert "udev: net_id: add support for phys_port_name attribute (#4506)" (#1477285)
- reintroduce naming based on phys_port_name for mlxsw and rocker via udev rule
* Tue Jun 27 2017 Lukas Nykryn <lnykryn@redhat.com> - 219-42
- Revert "rules: move cpu hotplug rule to separate file" (#1465108)