SHA256
1
0
forked from pool/systemd
systemd/1063-udev-path_id-suppress-ID_PATH-for-devices-with-an-un.patch
Stephan Kulow 8d0e9d5913 Accepting request 246497 from Base:System
- Add upstream patches for hwdb
  0001-hwdb-keymaps-for-Samsung-900X3E-900X3F.patch
  0002-Add-hwdb-entry-for-Samsung-Series-7-Ultra.patch
  0003-keymap-Fix-HP-Pavillon-DV7.patch
  0004-hwdb-update-format-description-and-document-reloadin.patch
  0008-hwdb-update.patch

- Port back and add the missed upstream patches from 2014/08/22
  0004-login-set_controller-should-fail-if-prepare_vt-fails.patch
  0006-login-share-VT-signal-handler-between-sessions.patch

- Add upstream patches
  0001-nspawn-fix-truncation-of-machine-names-in-interface-.patch
  0002-switch-root-umount-the-old-root-correctly.patch
  0003-bootchart-it-s-not-OK-to-return-1-from-a-main-progra.patch
  0005-sd-resolve-fix-allocation-if-query-ids-never-reuse-t.patch
  0007-journald-also-increase-the-SendBuffer-of-dev-log-to-.patch
  0008-mount-setup-fix-counting-of-early-mounts-without-SMA.patch
  0009-journald-Fix-off-by-one-error-in-Missed-X-kernel-mes.patch
  0010-machine_kill-Don-t-kill-the-unit-when-killing-the-le.patch
  0011-units-fix-BindsTo-logic-when-applied-relative-to-ser.patch
  0012-util-try-to-be-a-bit-more-NFS-compatible-when-checki.patch
  1063-udev-path_id-suppress-ID_PATH-for-devices-with-an-un.patch

- man pages from section 3 are developer docs, move them to 
 the -devel package.

- Add patch 0001-let-systemctl-completion-ignore-at-names.patch to
  remove error messages for tab completion for systemctl isolate (bnc#892162)

OBS-URL: https://build.opensuse.org/request/show/246497
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=200
2014-08-27 14:53:07 +00:00

97 lines
4.5 KiB
Diff

Based on e98bbfd2074e2b1079b7059341eac25741baf319 Mon Sep 17 00:00:00 2001
From: Kay Sievers <kay@vrfy.org>
Date: Mon, 4 Aug 2014 18:15:34 +0200
Subject: [PATCH] udev: path_id - suppress ID_PATH for devices with an unknown
parent device type
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1321816
---
src/udev/udev-builtin-path_id.c | 38 +++++++++++++++++++++++++++-----------
1 file changed, 27 insertions(+), 11 deletions(-)
--- src/udev/udev-builtin-path_id.c
+++ src/udev/udev-builtin-path_id.c 2014-08-22 14:08:59.250235369 +0000
@@ -524,7 +524,8 @@ static int builtin_path_id(struct udev_d
{
struct udev_device *parent;
char *path = NULL;
- bool some_transport = false;
+ bool supported_transport = false;
+ bool supported_parent = false;
/* S390 ccw bus */
parent = udev_device_get_parent_with_subsystem_devtype(dev, "ccw", NULL);
@@ -545,47 +546,62 @@ static int builtin_path_id(struct udev_d
handle_scsi_tape(parent, &path);
} else if (streq(subsys, "scsi")) {
parent = handle_scsi(parent, &path);
- some_transport = true;
+ supported_transport = true;
} else if (streq(subsys, "cciss")) {
parent = handle_cciss(parent, &path);
- some_transport = true;
+ supported_transport = true;
} else if (streq(subsys, "usb")) {
parent = handle_usb(parent, &path);
- some_transport = true;
+ supported_transport = true;
} else if (streq(subsys, "bcma")) {
parent = handle_bcma(parent, &path);
- some_transport = true;
+ supported_transport = true;
} else if (streq(subsys, "serio")) {
path_prepend(&path, "serio-%s", udev_device_get_sysnum(parent));
parent = skip_subsystem(parent, "serio");
} else if (streq(subsys, "pci")) {
path_prepend(&path, "pci-%s", udev_device_get_sysname(parent));
parent = skip_subsystem(parent, "pci");
+ supported_parent = true;
} else if (streq(subsys, "platform")) {
path_prepend(&path, "platform-%s", udev_device_get_sysname(parent));
parent = skip_subsystem(parent, "platform");
- some_transport = true;
+ supported_transport = true;
+ supported_parent = true;
} else if (streq(subsys, "acpi")) {
path_prepend(&path, "acpi-%s", udev_device_get_sysname(parent));
parent = skip_subsystem(parent, "acpi");
+ supported_parent = true;
} else if (streq(subsys, "xen")) {
path_prepend(&path, "xen-%s", udev_device_get_sysname(parent));
parent = skip_subsystem(parent, "xen");
+ supported_parent = true;
} else if (streq(subsys, "scm")) {
path_prepend(&path, "scm-%s", udev_device_get_sysname(parent));
parent = skip_subsystem(parent, "scm");
- some_transport = true;
+ supported_transport = true;
+ supported_parent = true;
}
parent = udev_device_get_parent(parent);
}
/*
- * Do not return a single-parent-device-only for block
- * devices, they might have entire buses behind it which
- * do not get unique IDs only by using the parent device.
+ * Do return devices with have an unknown type of parent device, they
+ * might produce conflicting IDs below multiple independent parent
+ * devices.
*/
- if (!some_transport && streq(udev_device_get_subsystem(dev), "block")) {
+ if (!supported_parent) {
+ free(path);
+ path = NULL;
+ }
+
+ /*
+ * Do not return a have-only a single-parent block devices, some
+ * have entire hidden buses behind it, and not create predictable
+ * IDs that way.
+ */
+ if (streq(udev_device_get_subsystem(dev), "block") && !supported_transport) {
free(path);
path = NULL;
}