SHA256
1
0
forked from pool/systemd

Accepting request 233572 from home:rmilasan:branches:Base:System

- Drop upstream-net_id-changes.patch and replace them with the correct
  patches from upstream and their commits:
  add: 1014-udev-update-net_id-comments.patch 
  add: 1015-udev-persistent-naming-we-cannot-use-virtio-numbers-.patch

- Drop upstream-net_id-changes.patch and replace them with the correct
  patches from upstream and their commits:
  add: 1014-udev-update-net_id-comments.patch 
  add: 1015-udev-persistent-naming-we-cannot-use-virtio-numbers-.patch

OBS-URL: https://build.opensuse.org/request/show/233572
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=623
This commit is contained in:
Dr. Werner Fink 2014-05-12 12:30:16 +00:00 committed by Git OBS Bridge
parent 30a790e9da
commit 075f4affa3
7 changed files with 229 additions and 145 deletions

View File

@ -0,0 +1,102 @@
From d4b687c96adf207f0878aebf3ce3371f6160687f Mon Sep 17 00:00:00 2001
From: Kay Sievers <kay@vrfy.org>
Date: Thu, 27 Mar 2014 15:30:09 +0100
Subject: [PATCH] udev: update net_id comments
Signed-off-by: Robert Milasan <rmilasan@suse.com>
---
src/udev/udev-builtin-net_id.c | 31 +++++++++++++++----------------
1 file changed, 15 insertions(+), 16 deletions(-)
diff --git a/src/udev/udev-builtin-net_id.c b/src/udev/udev-builtin-net_id.c
index 4f2b2c1..9ac07de 100644
--- a/src/udev/udev-builtin-net_id.c
+++ b/src/udev/udev-builtin-net_id.c
@@ -33,8 +33,11 @@
* ww -- wwan
*
* Type of names:
+ * b<number> -- BCMA bus core number
+ * ccw<name> -- CCW bus group name
* o<index> -- on-board device index number
* s<slot>[f<function>][d<dev_id>] -- hotplug slot index number
+ * v<number> -- virtio number
* x<MAC> -- MAC address
* [P<domain>]p<bus>s<slot>[f<function>][d<dev_id>]
* -- PCI geographical location
@@ -119,12 +122,9 @@ struct netnames {
const char *pci_onboard_label;
char usb_ports[IFNAMSIZ];
-
char bcma_core[IFNAMSIZ];
-
- char virtio_core[IFNAMSIZ];
-
- char ccw_core[IFNAMSIZ];
+ char virtio[IFNAMSIZ];
+ char ccw_group[IFNAMSIZ];
};
/* retrieve on-board index number and label from firmware */
@@ -353,18 +353,17 @@ static int names_bcma(struct udev_device *dev, struct netnames *names) {
static int names_virtio(struct udev_device *dev, struct netnames *names) {
struct udev_device *virtdev;
- unsigned int core;
+ unsigned int num;
virtdev = udev_device_get_parent_with_subsystem_devtype(dev, "virtio", NULL);
if (!virtdev)
return -ENOENT;
- /* core num */
- if (sscanf(udev_device_get_sysname(virtdev), "virtio%u", &core) != 1)
+ if (sscanf(udev_device_get_sysname(virtdev), "virtio%u", &num) != 1)
return -EINVAL;
- /* suppress the common core == 0 */
- if (core > 0)
- snprintf(names->virtio_core, sizeof(names->virtio_core), "v%u", core);
+ /* suppress the common num == 0 */
+ if (num > 0)
+ snprintf(names->virtio, sizeof(names->virtio), "v%u", num);
names->type = NET_VIRTIO;
return 0;
@@ -402,8 +401,8 @@ static int names_ccw(struct udev_device *dev, struct netnames *names) {
return -EINVAL;
/* Store the CCW bus-ID for use as network device name */
- rc = snprintf(names->ccw_core, sizeof(names->ccw_core), "ccw%s", bus_id);
- if (rc >= 0 && rc < (int)sizeof(names->ccw_core))
+ rc = snprintf(names->ccw_group, sizeof(names->ccw_group), "ccw%s", bus_id);
+ if (rc >= 0 && rc < (int)sizeof(names->ccw_group))
names->type = NET_CCWGROUP;
return 0;
}
@@ -517,7 +516,7 @@ static int builtin_net_id(struct udev_device *dev, int argc, char *argv[], bool
if (err >= 0 && names.type == NET_CCWGROUP) {
char str[IFNAMSIZ];
- if (snprintf(str, sizeof(str), "%s%s", prefix, names.ccw_core) < (int)sizeof(str))
+ if (snprintf(str, sizeof(str), "%s%s", prefix, names.ccw_group) < (int)sizeof(str))
udev_builtin_add_property(dev, test, "ID_NET_NAME_PATH", str);
goto out;
}
@@ -585,11 +584,11 @@ static int builtin_net_id(struct udev_device *dev, int argc, char *argv[], bool
char str[IFNAMSIZ];
if (names.pci_path[0])
- if (snprintf(str, sizeof(str), "%s%s%s", prefix, names.pci_path, names.virtio_core) < (int)sizeof(str))
+ if (snprintf(str, sizeof(str), "%s%s%s", prefix, names.pci_path, names.virtio) < (int)sizeof(str))
udev_builtin_add_property(dev, test, "ID_NET_NAME_PATH", str);
if (names.pci_slot[0])
- if (snprintf(str, sizeof(str), "%s%s%s", prefix, names.pci_slot, names.virtio_core) < (int)sizeof(str))
+ if (snprintf(str, sizeof(str), "%s%s%s", prefix, names.pci_slot, names.virtio) < (int)sizeof(str))
udev_builtin_add_property(dev, test, "ID_NET_NAME_SLOT", str);
goto out;
}
--
1.8.4.5

View File

@ -0,0 +1,99 @@
From bf81e792f3c0aed54edf004c1c95cc6f6d81d0ee Mon Sep 17 00:00:00 2001
From: Tom Gundersen <teg@jklm.no>
Date: Thu, 27 Mar 2014 21:47:14 +0100
Subject: [PATCH] udev: persistent naming - we cannot use virtio numbers as
they are not stable
This reverts commit 8741f2defaf26aafe5ee0fd29954cfdf84ee519c: 'Add virtio-blk support to path_id' and
commit e3d563346c4237af23335cc6904e0662efdf62ad: 'udev: net_id - handle virtio buses'.
Distros may want to take note of this, as it changes behavior.
Signed-off-by: Robert Milasan <rmilasan@suse.com>
---
src/udev/udev-builtin-net_id.c | 36 ------------------------------------
src/udev/udev-builtin-path_id.c | 3 ---
2 files changed, 39 deletions(-)
Index: systemd-210/src/udev/udev-builtin-net_id.c
===================================================================
--- systemd-210.orig/src/udev/udev-builtin-net_id.c
+++ systemd-210/src/udev/udev-builtin-net_id.c
@@ -37,7 +37,6 @@
* ccw<name> -- CCW bus group name
* o<index> -- on-board device index number
* s<slot>[f<function>][d<dev_id>] -- hotplug slot index number
- * v<number> -- virtio number
* x<MAC> -- MAC address
* [P<domain>]p<bus>s<slot>[f<function>][d<dev_id>]
* -- PCI geographical location
@@ -123,7 +122,6 @@ struct netnames {
char usb_ports[IFNAMSIZ];
char bcma_core[IFNAMSIZ];
- char virtio[IFNAMSIZ];
char ccw_group[IFNAMSIZ];
};
@@ -351,24 +349,6 @@ static int names_bcma(struct udev_device
return 0;
}
-static int names_virtio(struct udev_device *dev, struct netnames *names) {
- struct udev_device *virtdev;
- unsigned int num;
-
- virtdev = udev_device_get_parent_with_subsystem_devtype(dev, "virtio", NULL);
- if (!virtdev)
- return -ENOENT;
-
- if (sscanf(udev_device_get_sysname(virtdev), "virtio%u", &num) != 1)
- return -EINVAL;
- /* suppress the common num == 0 */
- if (num > 0)
- snprintf(names->virtio, sizeof(names->virtio), "v%u", num);
-
- names->type = NET_VIRTIO;
- return 0;
-}
-
static int names_ccw(struct udev_device *dev, struct netnames *names) {
struct udev_device *cdev;
const char *bus_id;
@@ -577,22 +557,6 @@ static int builtin_net_id(struct udev_de
udev_builtin_add_property(dev, test, "ID_NET_NAME_SLOT", str);
goto out;
}
-
- /* virtio bus */
- err = names_virtio(dev, &names);
- if (err >= 0 && names.type == NET_VIRTIO) {
- char str[IFNAMSIZ];
-
- if (names.pci_path[0])
- if (snprintf(str, sizeof(str), "%s%s%s", prefix, names.pci_path, names.virtio) < (int)sizeof(str))
- udev_builtin_add_property(dev, test, "ID_NET_NAME_PATH", str);
-
- if (names.pci_slot[0])
- if (snprintf(str, sizeof(str), "%s%s%s", prefix, names.pci_slot, names.virtio) < (int)sizeof(str))
- udev_builtin_add_property(dev, test, "ID_NET_NAME_SLOT", str);
- goto out;
- }
-
out:
return EXIT_SUCCESS;
}
Index: systemd-210/src/udev/udev-builtin-path_id.c
===================================================================
--- systemd-210.orig/src/udev/udev-builtin-path_id.c
+++ systemd-210/src/udev/udev-builtin-path_id.c
@@ -571,9 +571,6 @@ static int builtin_path_id(struct udev_d
} else if (streq(subsys, "xen")) {
path_prepend(&path, "xen-%s", udev_device_get_sysname(parent));
parent = skip_subsystem(parent, "xen");
- } else if (streq(subsys, "virtio")) {
- path_prepend(&path, "virtio-pci-%s", udev_device_get_sysname(parent));
- parent = skip_subsystem(parent, "virtio");
} else if (streq(subsys, "scm")) {
path_prepend(&path, "scm-%s", udev_device_get_sysname(parent));
parent = skip_subsystem(parent, "scm");

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Mon May 12 12:25:13 UTC 2014 - rmilasan@suse.com
- Drop upstream-net_id-changes.patch and replace them with the correct
patches from upstream and their commits:
add: 1014-udev-update-net_id-comments.patch
add: 1015-udev-persistent-naming-we-cannot-use-virtio-numbers-.patch
-------------------------------------------------------------------
Wed May 7 10:42:27 UTC 2014 - werner@suse.de

View File

@ -440,8 +440,10 @@ Patch1011: 1011-64-btrfs.rules-skip-btrfs-check-if-devices-are-not-r.patch
Patch1012: 1012-Skip-persistent-device-link-creation-on-multipath-de.patch
# PATCH-FIX-SUSE Do not use runtime PM for some IBM consoles (bnc#868931)
Patch1013: 1013-no-runtime-PM-for-IBM-consoles.patch
# PATCH-FIX-UPSTREAM Move forward to git Head for net_id
Patch1014: upstream-net_id-changes.patch
# PATCH-FIX-USTREAM 1014-udev-update-net_id-comments.patch
Patch1014: 1014-udev-update-net_id-comments.patch
# PATCH-FIX-USTREAM 1015-udev-persistent-naming-we-cannot-use-virtio-numbers-.patch
Patch1015: 1015-udev-persistent-naming-we-cannot-use-virtio-numbers-.patch
%description
Systemd is a system and service manager, compatible with SysV and LSB
@ -814,9 +816,8 @@ cp %{SOURCE7} m4/
%patch1011 -p1
%patch1012 -p1
%patch1013 -p1
%if 0%{?suse_version} > 1310
%patch1014 -p0
%endif
%patch1014 -p1
%patch1015 -p1
# ensure generate files are removed
rm -f units/emergency.service

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Mon May 12 12:25:13 UTC 2014 - rmilasan@suse.com
- Drop upstream-net_id-changes.patch and replace them with the correct
patches from upstream and their commits:
add: 1014-udev-update-net_id-comments.patch
add: 1015-udev-persistent-naming-we-cannot-use-virtio-numbers-.patch
-------------------------------------------------------------------
Wed May 7 10:42:27 UTC 2014 - werner@suse.de

View File

@ -435,8 +435,10 @@ Patch1011: 1011-64-btrfs.rules-skip-btrfs-check-if-devices-are-not-r.patch
Patch1012: 1012-Skip-persistent-device-link-creation-on-multipath-de.patch
# PATCH-FIX-SUSE Do not use runtime PM for some IBM consoles (bnc#868931)
Patch1013: 1013-no-runtime-PM-for-IBM-consoles.patch
# PATCH-FIX-UPSTREAM Move forward to git Head for net_id
Patch1014: upstream-net_id-changes.patch
# PATCH-FIX-USTREAM 1014-udev-update-net_id-comments.patch
Patch1014: 1014-udev-update-net_id-comments.patch
# PATCH-FIX-USTREAM 1015-udev-persistent-naming-we-cannot-use-virtio-numbers-.patch
Patch1015: 1015-udev-persistent-naming-we-cannot-use-virtio-numbers-.patch
%description
Systemd is a system and service manager, compatible with SysV and LSB
@ -809,9 +811,8 @@ cp %{SOURCE7} m4/
%patch1011 -p1
%patch1012 -p1
%patch1013 -p1
%if 0%{?suse_version} > 1310
%patch1014 -p0
%endif
%patch1014 -p1
%patch1015 -p1
# ensure generate files are removed
rm -f units/emergency.service

View File

@ -1,135 +0,0 @@
This the diff between systemd-210 and 19aa72f74e41045510b4af3f1415b419d42ff20b
But we do not remove the ATA support as in HEAD
---
src/udev/udev-builtin-net_id.c | 54 ++++++----------------------------------
src/udev/udev-builtin-path_id.c | 3 --
2 files changed, 9 insertions(+), 48 deletions(-)
--- src/udev/udev-builtin-net_id.c
+++ src/udev/udev-builtin-net_id.c 2014-04-08 07:16:45.094235605 +0000
@@ -33,6 +33,8 @@
* ww -- wwan
*
* Type of names:
+ * b<number> -- BCMA bus core number
+ * ccw<name> -- CCW bus group name
* o<index> -- on-board device index number
* s<slot>[f<function>][d<dev_id>] -- hotplug slot index number
* x<MAC> -- MAC address
@@ -92,6 +94,7 @@
#include <string.h>
#include <errno.h>
#include <net/if.h>
+#include <net/if_arp.h>
#include <linux/pci_regs.h>
#include "udev.h"
@@ -119,12 +122,8 @@ struct netnames {
const char *pci_onboard_label;
char usb_ports[IFNAMSIZ];
-
char bcma_core[IFNAMSIZ];
-
- char virtio_core[IFNAMSIZ];
-
- char ccw_core[IFNAMSIZ];
+ char ccw_group[IFNAMSIZ];
};
/* retrieve on-board index number and label from firmware */
@@ -351,25 +350,6 @@ static int names_bcma(struct udev_device
return 0;
}
-static int names_virtio(struct udev_device *dev, struct netnames *names) {
- struct udev_device *virtdev;
- unsigned int core;
-
- virtdev = udev_device_get_parent_with_subsystem_devtype(dev, "virtio", NULL);
- if (!virtdev)
- return -ENOENT;
-
- /* core num */
- if (sscanf(udev_device_get_sysname(virtdev), "virtio%u", &core) != 1)
- return -EINVAL;
- /* suppress the common core == 0 */
- if (core > 0)
- snprintf(names->virtio_core, sizeof(names->virtio_core), "v%u", core);
-
- names->type = NET_VIRTIO;
- return 0;
-}
-
static int names_ccw(struct udev_device *dev, struct netnames *names) {
struct udev_device *cdev;
const char *bus_id;
@@ -402,8 +382,8 @@ static int names_ccw(struct udev_device
return -EINVAL;
/* Store the CCW bus-ID for use as network device name */
- rc = snprintf(names->ccw_core, sizeof(names->ccw_core), "ccw%s", bus_id);
- if (rc >= 0 && rc < (int)sizeof(names->ccw_core))
+ rc = snprintf(names->ccw_group, sizeof(names->ccw_group), "ccw%s", bus_id);
+ if (rc >= 0 && rc < (int)sizeof(names->ccw_group))
names->type = NET_CCWGROUP;
return 0;
}
@@ -472,10 +452,10 @@ static int builtin_net_id(struct udev_de
return EXIT_FAILURE;
i = strtoul(s, NULL, 0);
switch (i) {
- case 1: /* ARPHRD_ETHER */
+ case ARPHRD_ETHER:
prefix = "en";
break;
- case 256: /* ARPHRD_SLIP */
+ case ARPHRD_SLIP:
prefix = "sl";
break;
default:
@@ -517,7 +497,7 @@ static int builtin_net_id(struct udev_de
if (err >= 0 && names.type == NET_CCWGROUP) {
char str[IFNAMSIZ];
- if (snprintf(str, sizeof(str), "%s%s", prefix, names.ccw_core) < (int)sizeof(str))
+ if (snprintf(str, sizeof(str), "%s%s", prefix, names.ccw_group) < (int)sizeof(str))
udev_builtin_add_property(dev, test, "ID_NET_NAME_PATH", str);
goto out;
}
@@ -578,22 +558,6 @@ static int builtin_net_id(struct udev_de
udev_builtin_add_property(dev, test, "ID_NET_NAME_SLOT", str);
goto out;
}
-
- /* virtio bus */
- err = names_virtio(dev, &names);
- if (err >= 0 && names.type == NET_VIRTIO) {
- char str[IFNAMSIZ];
-
- if (names.pci_path[0])
- if (snprintf(str, sizeof(str), "%s%s%s", prefix, names.pci_path, names.virtio_core) < (int)sizeof(str))
- udev_builtin_add_property(dev, test, "ID_NET_NAME_PATH", str);
-
- if (names.pci_slot[0])
- if (snprintf(str, sizeof(str), "%s%s%s", prefix, names.pci_slot, names.virtio_core) < (int)sizeof(str))
- udev_builtin_add_property(dev, test, "ID_NET_NAME_SLOT", str);
- goto out;
- }
-
out:
return EXIT_SUCCESS;
}
--- src/udev/udev-builtin-path_id.c
+++ src/udev/udev-builtin-path_id.c 2014-03-28 09:27:20.402735390 +0000
@@ -571,9 +571,6 @@ static int builtin_path_id(struct udev_d
} else if (streq(subsys, "xen")) {
path_prepend(&path, "xen-%s", udev_device_get_sysname(parent));
parent = skip_subsystem(parent, "xen");
- } else if (streq(subsys, "virtio")) {
- path_prepend(&path, "virtio-pci-%s", udev_device_get_sysname(parent));
- parent = skip_subsystem(parent, "virtio");
} else if (streq(subsys, "scm")) {
path_prepend(&path, "scm-%s", udev_device_get_sysname(parent));
parent = skip_subsystem(parent, "scm");