forked from pool/systemd
9fc3254595
- Update of patch 0001-detect-s390-virt.patch (bnc#880438) - Shut up stupid check scripts crying for not mentioned systemd-mini-rpmlintrc - Add upstream patchs 0001-core-use-correct-format-string-for-UIDs.patch 0002-core-transaction-fix-cycle-break-attempts-outside-tr.patch 0003-fsck-consider-a-fsck-implementation-linked-to-bin-tr.patch - Add upstream patch 0001-units-order-network-online.target-after-network.targ.patch to make sure that etwork-online.target follows network.target - rules: re-enable dev_id conditionally in persistent rules (bnc#884403 and bnc#882714). Add 1040-re-enable-dev_id-conditionally-in-persistent-rules.patch - Add upstream patches 0001-vconsole-also-copy-character-maps-not-just-fonts-fro.patch 0002-core-make-sure-Environment-fields-passed-in-for-tran.patch 0003-core-You-can-not-put-the-cached-result-of-use_smack-.patch 0004-cryptsetup-don-t-add-unit-dependency-on-dev-null-dev.patch 0005-man-fix-path-in-crypttab-5.patch - Add upstream patch 1039-udevadm-settle-fixed-return-code-for-empty-queue.patch it fixes udevadm settle exit code which may had roken dracut scripts (bnc#884271 comment#18) - Temporary disable patch 1022 (bnc#884271 and bnc#882714). OBS-URL: https://build.opensuse.org/request/show/238853 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=190
85 lines
3.1 KiB
Diff
85 lines
3.1 KiB
Diff
From f3a740a5dae792fb6b2d411022ce8c29ced1c3f1 Mon Sep 17 00:00:00 2001
|
|
From: Kay Sievers <kay@vrfy.org>
|
|
Date: Wed, 4 Jun 2014 12:16:28 +0200
|
|
Subject: [PATCH] udev: synthesize "change' events for partitions when tools
|
|
change the disk
|
|
|
|
This should make sure that fdisk-like programs will automatically
|
|
cause an update of all partitions, just like mkfs-like programs cause
|
|
an update of the partition.
|
|
|
|
Signed-off-by: Robert Milasan <rmilasan@suse.com>
|
|
---
|
|
src/udev/udevd.c | 44 ++++++++++++++++++++++++++++++++++++++++++--
|
|
1 file changed, 42 insertions(+), 2 deletions(-)
|
|
|
|
Index: systemd-210/src/udev/udevd.c
|
|
===================================================================
|
|
--- systemd-210.orig/src/udev/udevd.c
|
|
+++ systemd-210/src/udev/udevd.c
|
|
@@ -46,6 +46,7 @@
|
|
#include <sys/utsname.h>
|
|
|
|
#include "udev.h"
|
|
+#include "udev-util.h"
|
|
#include "sd-daemon.h"
|
|
#include "cgroup-util.h"
|
|
#include "dev-setup.h"
|
|
@@ -736,15 +737,54 @@ out:
|
|
return udev_ctrl_connection_unref(ctrl_conn);
|
|
}
|
|
|
|
-static void synthesize_change(struct udev_device *dev) {
|
|
+static int synthesize_change(struct udev_device *dev) {
|
|
char filename[UTIL_PATH_SIZE];
|
|
+ int r;
|
|
|
|
log_debug("device %s closed, synthesising 'change'", udev_device_get_devnode(dev));
|
|
strscpyl(filename, sizeof(filename), udev_device_get_syspath(dev), "/uevent", NULL);
|
|
write_string_file(filename, "change");
|
|
+
|
|
+ /* for disks devices, re-trigger all partitions too */
|
|
+ if (streq_ptr("block", udev_device_get_subsystem(dev)) &&
|
|
+ streq_ptr("disk", udev_device_get_devtype(dev))) {
|
|
+ struct udev *udev = udev_device_get_udev(dev);
|
|
+ _cleanup_udev_enumerate_unref_ struct udev_enumerate *e = NULL;
|
|
+ struct udev_list_entry *item;
|
|
+
|
|
+ e = udev_enumerate_new(udev);
|
|
+ if (!e)
|
|
+ return -ENOMEM;
|
|
+
|
|
+ r = udev_enumerate_add_match_parent(e, dev);
|
|
+ if (r < 0)
|
|
+ return r;
|
|
+
|
|
+ r = udev_enumerate_add_match_subsystem(e, "block");
|
|
+ if (r < 0)
|
|
+ return r;
|
|
+
|
|
+ r = udev_enumerate_scan_devices(e);
|
|
+ udev_list_entry_foreach(item, udev_enumerate_get_list_entry(e)) {
|
|
+ _cleanup_udev_device_unref_ struct udev_device *d = NULL;
|
|
+
|
|
+ d = udev_device_new_from_syspath(udev, udev_list_entry_get_name(item));
|
|
+ if (!d)
|
|
+ continue;
|
|
+
|
|
+ if (!streq_ptr("partition", udev_device_get_devtype(d)))
|
|
+ continue;
|
|
+
|
|
+ log_debug("device %s closed, synthesising partition '%s' 'change'",
|
|
+ udev_device_get_devnode(dev), udev_device_get_devnode(d));
|
|
+ strscpyl(filename, sizeof(filename), udev_device_get_syspath(d), "/uevent", NULL);
|
|
+ write_string_file(filename, "change");
|
|
+ }
|
|
+ }
|
|
+
|
|
+ return 0;
|
|
}
|
|
|
|
-/* read inotify messages */
|
|
static int handle_inotify(struct udev *udev)
|
|
{
|
|
int nbytes, pos;
|