From 075f4affa325c1bf1041ec4e998bdef0ebbbe02508b10c27c7926de2f91092fc Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Mon, 12 May 2014 12:30:16 +0000 Subject: [PATCH] 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 --- 1014-udev-update-net_id-comments.patch | 102 +++++++++++++ ...naming-we-cannot-use-virtio-numbers-.patch | 99 +++++++++++++ systemd-mini.changes | 8 ++ systemd-mini.spec | 11 +- systemd.changes | 8 ++ systemd.spec | 11 +- upstream-net_id-changes.patch | 135 ------------------ 7 files changed, 229 insertions(+), 145 deletions(-) create mode 100644 1014-udev-update-net_id-comments.patch create mode 100644 1015-udev-persistent-naming-we-cannot-use-virtio-numbers-.patch delete mode 100644 upstream-net_id-changes.patch diff --git a/1014-udev-update-net_id-comments.patch b/1014-udev-update-net_id-comments.patch new file mode 100644 index 00000000..6b0b7f5a --- /dev/null +++ b/1014-udev-update-net_id-comments.patch @@ -0,0 +1,102 @@ +From d4b687c96adf207f0878aebf3ce3371f6160687f Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Thu, 27 Mar 2014 15:30:09 +0100 +Subject: [PATCH] udev: update net_id comments + +Signed-off-by: Robert Milasan +--- + 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 -- BCMA bus core number ++ * ccw -- CCW bus group name + * o -- on-board device index number + * s[f][d] -- hotplug slot index number ++ * v -- virtio number + * x -- MAC address + * [P]ps[f][d] + * -- 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 + diff --git a/1015-udev-persistent-naming-we-cannot-use-virtio-numbers-.patch b/1015-udev-persistent-naming-we-cannot-use-virtio-numbers-.patch new file mode 100644 index 00000000..a5e9c58f --- /dev/null +++ b/1015-udev-persistent-naming-we-cannot-use-virtio-numbers-.patch @@ -0,0 +1,99 @@ +From bf81e792f3c0aed54edf004c1c95cc6f6d81d0ee Mon Sep 17 00:00:00 2001 +From: Tom Gundersen +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 +--- + 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 -- CCW bus group name + * o -- on-board device index number + * s[f][d] -- hotplug slot index number +- * v -- virtio number + * x -- MAC address + * [P]ps[f][d] + * -- 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"); diff --git a/systemd-mini.changes b/systemd-mini.changes index 99f35b9d..6dcf6d87 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -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 diff --git a/systemd-mini.spec b/systemd-mini.spec index cfb4be04..9bcf3f55 100644 --- a/systemd-mini.spec +++ b/systemd-mini.spec @@ -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 diff --git a/systemd.changes b/systemd.changes index 99f35b9d..6dcf6d87 100644 --- a/systemd.changes +++ b/systemd.changes @@ -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 diff --git a/systemd.spec b/systemd.spec index d08fdb12..a97b5590 100644 --- a/systemd.spec +++ b/systemd.spec @@ -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 diff --git a/upstream-net_id-changes.patch b/upstream-net_id-changes.patch deleted file mode 100644 index 60bc83b7..00000000 --- a/upstream-net_id-changes.patch +++ /dev/null @@ -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 -- BCMA bus core number -+ * ccw -- CCW bus group name - * o -- on-board device index number - * s[f][d] -- hotplug slot index number - * x -- MAC address -@@ -92,6 +94,7 @@ - #include - #include - #include -+#include - #include - - #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");