forked from pool/systemd
Accepting request 249581 from Base:System
- Add upstream patches as real fixes 0001-activate-fix-fd-leak-in-do_accept.patch 0002-analyze-avoid-a-null-dereference.patch 0003-analyze-fix-mem-leak.patch 0004-backlight-Avoid-error-when-state-restore-is-disabled.patch 0005-bus-avoid-using-m-kdbus-after-freeing-it.patch 0006-bus-unref-buscreds-on-failure.patch 0007-core-fix-a-potential-mem-leak.patch 0008-core-smack-setup-Actually-allow-for-succesfully-load.patch 0009-journal-do-not-leak-mmaps-on-OOM.patch 0010-manager-use-correct-cleanup-function.patch - Intergrate the work of Robert and rename the patch 1068-udev-remove-userspace-firmware-loading-support.patch to 1078-udev-remove-userspace-firmware-loading-support.patch Also add patch 1079-udev-remove-userspace-firmware-loading-support.patch to apply the same change for opensuse 13.2 and above - Add upstream patch 0001-systemctl-allow-to-change-the-default-target-without.patch to allow to override default target without --force (bnc#896664) - Add upstream patches for udev 1068-udev-net_setup_link-export-the-.link-filename-applie.patch 1069-rules-net-setup-link-preserve-ID_NET_LINK_FILE-and-I.patch 1070-rules-net-setup-link-remove-stray-linebreak.patch 1071-udev-import-the-full-db-on-MOVE-events-for-devices-w.patch 1072-udev-netif_rename-don-t-log-to-kmsg.patch 1073-udev-drop-print_kmsg.patch 1074-udev-fix-copy-paste-error-in-log-message.patch OBS-URL: https://build.opensuse.org/request/show/249581 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=206
This commit is contained in:
parent
3ec559f957
commit
6a62c05e32
26
0001-activate-fix-fd-leak-in-do_accept.patch
Normal file
26
0001-activate-fix-fd-leak-in-do_accept.patch
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
From aa44499da15a8fa7026463555a7a27e55e4e24a8 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Philippe De Swert <philippedeswert@gmail.com>
|
||||||
|
Date: Wed, 10 Sep 2014 22:14:41 +0300
|
||||||
|
Subject: [PATCH] activate: fix fd leak in do_accept()
|
||||||
|
|
||||||
|
Found with Coverity.
|
||||||
|
---
|
||||||
|
src/activate/activate.c | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git src/activate/activate.c src/activate/activate.c
|
||||||
|
index 8942773..0a1df37 100644
|
||||||
|
--- src/activate/activate.c
|
||||||
|
+++ src/activate/activate.c
|
||||||
|
@@ -242,7 +242,7 @@ static int launch1(const char* child, char** argv, char **env, int fd) {
|
||||||
|
|
||||||
|
static int do_accept(const char* name, char **argv, char **envp, int fd) {
|
||||||
|
_cleanup_free_ char *local = NULL, *peer = NULL;
|
||||||
|
- int fd2;
|
||||||
|
+ _cleanup_close_ int fd2 = -1;
|
||||||
|
|
||||||
|
fd2 = accept(fd, NULL, NULL);
|
||||||
|
if (fd2 < 0) {
|
||||||
|
--
|
||||||
|
1.7.9.2
|
||||||
|
|
@ -0,0 +1,51 @@
|
|||||||
|
From a1484a216e79da1fa7e2323095fb1b7203fb7a17 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Djalal Harouni <tixxdz@opendz.org>
|
||||||
|
Date: Mon, 14 Apr 2014 01:07:52 +0100
|
||||||
|
Subject: [PATCH] systemctl: allow to change the default target without the
|
||||||
|
--force switch
|
||||||
|
|
||||||
|
Currently "systemctl set-default" will fail to change the default target
|
||||||
|
due to the 'default.target' being a symlink which is always the case.
|
||||||
|
|
||||||
|
To work around this, the user must specify the "--force" switch to be
|
||||||
|
able to overwrite the existing symlink.
|
||||||
|
|
||||||
|
This is clearly a regression that was introduced by commit 718db96199e
|
||||||
|
since it worked before without the "--force" switch and the man pages do
|
||||||
|
not mention that you need to specify it. It is expected that this is a
|
||||||
|
symlink.
|
||||||
|
|
||||||
|
So just explicity set the force flag to make it work again.
|
||||||
|
|
||||||
|
https://bugs.freedesktop.org/show_bug.cgi?id=76623
|
||||||
|
|
||||||
|
Reported-by: <code@progandy.de>
|
||||||
|
---
|
||||||
|
src/systemctl/systemctl.c | 4 ++--
|
||||||
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git src/systemctl/systemctl.c src/systemctl/systemctl.c
|
||||||
|
index ee0938f..1b381f7 100644
|
||||||
|
--- src/systemctl/systemctl.c
|
||||||
|
+++ src/systemctl/systemctl.c
|
||||||
|
@@ -1968,7 +1968,7 @@ static int set_default(sd_bus *bus, char **args) {
|
||||||
|
return log_oom();
|
||||||
|
|
||||||
|
if (!bus || avoid_bus()) {
|
||||||
|
- r = unit_file_set_default(arg_scope, arg_root, unit, arg_force, &changes, &n_changes);
|
||||||
|
+ r = unit_file_set_default(arg_scope, arg_root, unit, true, &changes, &n_changes);
|
||||||
|
if (r < 0) {
|
||||||
|
log_error("Failed to set default target: %s", strerror(-r));
|
||||||
|
return r;
|
||||||
|
@@ -1990,7 +1990,7 @@ static int set_default(sd_bus *bus, char **args) {
|
||||||
|
"SetDefaultTarget",
|
||||||
|
&error,
|
||||||
|
&reply,
|
||||||
|
- "sb", unit, arg_force);
|
||||||
|
+ "sb", unit, true);
|
||||||
|
if (r < 0) {
|
||||||
|
log_error("Failed to set default target: %s", bus_error_message(&error, -r));
|
||||||
|
return r;
|
||||||
|
--
|
||||||
|
1.7.9.2
|
||||||
|
|
30
0002-analyze-avoid-a-null-dereference.patch
Normal file
30
0002-analyze-avoid-a-null-dereference.patch
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
From d725a138c5c311ba06567d6841933aa5b7b6a435 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Thomas Hindoe Paaboel Andersen <phomes@gmail.com>
|
||||||
|
Date: Thu, 11 Sep 2014 23:41:44 +0200
|
||||||
|
Subject: [PATCH] analyze: avoid a null dereference
|
||||||
|
|
||||||
|
If we have an error in the early sd_bus_* calls then unit_times
|
||||||
|
will still be null.
|
||||||
|
|
||||||
|
Found with coverity. Fixes: CID#996464
|
||||||
|
---
|
||||||
|
src/analyze/analyze.c | 3 ++-
|
||||||
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git src/analyze/analyze.c src/analyze/analyze.c
|
||||||
|
index d860a02..1281d6b 100644
|
||||||
|
--- src/analyze/analyze.c
|
||||||
|
+++ src/analyze/analyze.c
|
||||||
|
@@ -277,7 +277,8 @@ static int acquire_time_data(sd_bus *bus, struct unit_times **out) {
|
||||||
|
return c;
|
||||||
|
|
||||||
|
fail:
|
||||||
|
- free_unit_times(unit_times, (unsigned) c);
|
||||||
|
+ if (unit_times)
|
||||||
|
+ free_unit_times(unit_times, (unsigned) c);
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
1.7.9.2
|
||||||
|
|
27
0003-analyze-fix-mem-leak.patch
Normal file
27
0003-analyze-fix-mem-leak.patch
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
From 0ee9613d98cbe1f36ffc98c6bfa51dd2b798fc6d Mon Sep 17 00:00:00 2001
|
||||||
|
From: Thomas Hindoe Paaboel Andersen <phomes@gmail.com>
|
||||||
|
Date: Sat, 13 Sep 2014 12:29:43 +0200
|
||||||
|
Subject: [PATCH] analyze: fix mem leak
|
||||||
|
|
||||||
|
Found with Coverity. Fixes: CID#1237756
|
||||||
|
---
|
||||||
|
src/analyze/analyze.c | 3 ++-
|
||||||
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git src/analyze/analyze.c src/analyze/analyze.c
|
||||||
|
index 1281d6b..82f5cf3 100644
|
||||||
|
--- src/analyze/analyze.c
|
||||||
|
+++ src/analyze/analyze.c
|
||||||
|
@@ -848,7 +848,8 @@ static int list_dependencies(sd_bus *bus, const char *name) {
|
||||||
|
char ts[FORMAT_TIMESPAN_MAX];
|
||||||
|
struct unit_times *times;
|
||||||
|
int r;
|
||||||
|
- const char *path, *id;
|
||||||
|
+ const char *id;
|
||||||
|
+ _cleanup_free_ char *path = NULL;
|
||||||
|
_cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
|
||||||
|
_cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
|
||||||
|
struct boot_times *boot;
|
||||||
|
--
|
||||||
|
1.7.9.2
|
||||||
|
|
@ -0,0 +1,33 @@
|
|||||||
|
From b76388e123e8d73ded1fd53937d816b314948517 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Michael Biebl <biebl@debian.org>
|
||||||
|
Date: Thu, 11 Sep 2014 00:49:36 +0200
|
||||||
|
Subject: [PATCH] backlight: Avoid error when state restore is disabled
|
||||||
|
|
||||||
|
When the state restore is disabled, we would print:
|
||||||
|
"Unknown verb: load" instead of simply skipping loading the
|
||||||
|
state.
|
||||||
|
---
|
||||||
|
src/backlight/backlight.c | 5 ++++-
|
||||||
|
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git src/backlight/backlight.c src/backlight/backlight.c
|
||||||
|
index 4d94ebf..0a2bac6 100644
|
||||||
|
--- src/backlight/backlight.c
|
||||||
|
+++ src/backlight/backlight.c
|
||||||
|
@@ -372,9 +372,12 @@ int main(int argc, char *argv[]) {
|
||||||
|
* device probing should be complete), so that the validity
|
||||||
|
* check at boot time doesn't have to be reliable. */
|
||||||
|
|
||||||
|
- if (streq(argv[1], "load") && shall_restore_state()) {
|
||||||
|
+ if (streq(argv[1], "load")) {
|
||||||
|
_cleanup_free_ char *value = NULL;
|
||||||
|
|
||||||
|
+ if (!shall_restore_state())
|
||||||
|
+ return EXIT_SUCCESS;
|
||||||
|
+
|
||||||
|
if (!validate_device(udev, device))
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
|
||||||
|
--
|
||||||
|
1.7.9.2
|
||||||
|
|
35
0005-bus-avoid-using-m-kdbus-after-freeing-it.patch
Normal file
35
0005-bus-avoid-using-m-kdbus-after-freeing-it.patch
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
Based on fd989a0bc999d79719408ac28b126d9c9016bcb5 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Philippe De Swert <philippedeswert@gmail.com>
|
||||||
|
Date: Wed, 10 Sep 2014 12:20:38 +0300
|
||||||
|
Subject: [PATCH] bus: avoid using m->kdbus after freeing it
|
||||||
|
|
||||||
|
m->kdbus could be freed before it is released. Changing the
|
||||||
|
order fixes the issue.
|
||||||
|
|
||||||
|
Found with Coverity. Fixes: CID#1237798
|
||||||
|
---
|
||||||
|
src/libsystemd/sd-bus/bus-message.c | 6 +++---
|
||||||
|
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
--- src/libsystemd/sd-bus/bus-message.c
|
||||||
|
+++ src/libsystemd/sd-bus/bus-message.c 2014-09-16 10:31:37.538735664 +0000
|
||||||
|
@@ -126,9 +126,6 @@ static void message_free(sd_bus_message
|
||||||
|
|
||||||
|
message_reset_parts(m);
|
||||||
|
|
||||||
|
- if (m->free_kdbus)
|
||||||
|
- free(m->kdbus);
|
||||||
|
-
|
||||||
|
if (m->release_kdbus) {
|
||||||
|
uint64_t off;
|
||||||
|
|
||||||
|
@@ -136,6 +133,9 @@ static void message_free(sd_bus_message
|
||||||
|
ioctl(m->bus->input_fd, KDBUS_CMD_FREE, &off);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ if (m->free_kdbus)
|
||||||
|
+ free(m->kdbus);
|
||||||
|
+
|
||||||
|
if (m->bus)
|
||||||
|
sd_bus_unref(m->bus);
|
||||||
|
|
32
0006-bus-unref-buscreds-on-failure.patch
Normal file
32
0006-bus-unref-buscreds-on-failure.patch
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
From 2b347169b9046ff2d735ef23e62a8c74f5151600 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Philippe De Swert <philippedeswert@gmail.com>
|
||||||
|
Date: Wed, 10 Sep 2014 12:20:42 +0300
|
||||||
|
Subject: [PATCH] bus: unref buscreds on failure
|
||||||
|
|
||||||
|
Actually unref the buscreds when we are not going to return a
|
||||||
|
pointer to them. As when bus_creds_add_more fails we immediately
|
||||||
|
return the error code otherwise and leak the new buscreds.
|
||||||
|
Found with coverity. Fixes: CID#1237761
|
||||||
|
---
|
||||||
|
src/libsystemd/sd-bus/sd-bus.c | 4 +++-
|
||||||
|
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git src/libsystemd/sd-bus/sd-bus.c src/libsystemd/sd-bus/sd-bus.c
|
||||||
|
index 78e91b9..83b3aa1 100644
|
||||||
|
--- src/libsystemd/sd-bus/sd-bus.c
|
||||||
|
+++ src/libsystemd/sd-bus/sd-bus.c
|
||||||
|
@@ -3339,8 +3339,10 @@ _public_ int sd_bus_get_peer_creds(sd_bus *bus, uint64_t mask, sd_bus_creds **re
|
||||||
|
}
|
||||||
|
|
||||||
|
r = bus_creds_add_more(c, mask, pid, 0);
|
||||||
|
- if (r < 0)
|
||||||
|
+ if (r < 0) {
|
||||||
|
+ sd_bus_creds_unref(c);
|
||||||
|
return r;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
*ret = c;
|
||||||
|
return 0;
|
||||||
|
--
|
||||||
|
1.7.9.2
|
||||||
|
|
25
0007-core-fix-a-potential-mem-leak.patch
Normal file
25
0007-core-fix-a-potential-mem-leak.patch
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
Based on 4d5e13a125cf8d77d432225ab69826caa1d1cf59 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Thomas Hindoe Paaboel Andersen <phomes@gmail.com>
|
||||||
|
Date: Sat, 13 Sep 2014 12:35:06 +0200
|
||||||
|
Subject: [PATCH] core: fix a potential mem leak
|
||||||
|
|
||||||
|
Found with Coverity. Fixes: CID#996438
|
||||||
|
---
|
||||||
|
src/core/load-fragment.c | 5 ++++-
|
||||||
|
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
--- src/core/load-fragment.c
|
||||||
|
+++ src/core/load-fragment.c 2014-09-16 10:35:13.354235607 +0000
|
||||||
|
@@ -1294,8 +1294,11 @@ int config_parse_timer(const char *unit,
|
||||||
|
}
|
||||||
|
|
||||||
|
v = new0(TimerValue, 1);
|
||||||
|
- if (!v)
|
||||||
|
+ if (!v) {
|
||||||
|
+ if (c)
|
||||||
|
+ free(c);
|
||||||
|
return log_oom();
|
||||||
|
+ }
|
||||||
|
|
||||||
|
v->base = b;
|
||||||
|
v->clock_id = id;
|
@ -0,0 +1,31 @@
|
|||||||
|
From b9289d4c6e13ec5fb67bfce69c826d93b004da6a Mon Sep 17 00:00:00 2001
|
||||||
|
From: Philippe De Swert <philippedeswert@gmail.com>
|
||||||
|
Date: Fri, 12 Sep 2014 16:49:48 +0300
|
||||||
|
Subject: [PATCH] core: smack-setup: Actually allow for succesfully loading
|
||||||
|
CIPSO policy
|
||||||
|
|
||||||
|
The line under the last switch statement *loaded_policy = true;
|
||||||
|
would never be executed. As all switch cases return 0. Thus the
|
||||||
|
policy would never be marked as loaded.
|
||||||
|
|
||||||
|
Found with Coverity. Fixes: CID#1237785
|
||||||
|
---
|
||||||
|
src/core/smack-setup.c | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git src/core/smack-setup.c src/core/smack-setup.c
|
||||||
|
index 5f6dabf..5d8a26c 100644
|
||||||
|
--- src/core/smack-setup.c
|
||||||
|
+++ src/core/smack-setup.c
|
||||||
|
@@ -158,7 +158,7 @@ int smack_setup(bool *loaded_policy) {
|
||||||
|
return 0;
|
||||||
|
case 0:
|
||||||
|
log_info("Successfully loaded Smack/CIPSO policies.");
|
||||||
|
- return 0;
|
||||||
|
+ break;
|
||||||
|
default:
|
||||||
|
log_warning("Failed to load Smack/CIPSO access rules: %s, ignoring.",
|
||||||
|
strerror(abs(r)));
|
||||||
|
--
|
||||||
|
1.7.9.2
|
||||||
|
|
3363
0009-hwdb-update.patch
Normal file
3363
0009-hwdb-update.patch
Normal file
File diff suppressed because it is too large
Load Diff
50
0009-journal-do-not-leak-mmaps-on-OOM.patch
Normal file
50
0009-journal-do-not-leak-mmaps-on-OOM.patch
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
From b67ddc7bbe31cde7f69f9814204d9bb1d4623c47 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Philippe De Swert <philippedeswert@gmail.com>
|
||||||
|
Date: Wed, 10 Sep 2014 12:20:41 +0300
|
||||||
|
Subject: [PATCH] journal: do not leak mmaps on OOM
|
||||||
|
|
||||||
|
After a section of memory is succesfully allocated, some of the following
|
||||||
|
actions can still fail due to lack of memory. In this case -ENOMEM is
|
||||||
|
returned without actually freeing the already mapped memory.
|
||||||
|
Found with coverity. Fixes: CID#1237762
|
||||||
|
---
|
||||||
|
src/journal/mmap-cache.c | 10 +++++++---
|
||||||
|
1 file changed, 7 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git src/journal/mmap-cache.c src/journal/mmap-cache.c
|
||||||
|
index 7dbbb5e..908562d 100644
|
||||||
|
--- src/journal/mmap-cache.c
|
||||||
|
+++ src/journal/mmap-cache.c
|
||||||
|
@@ -496,15 +496,15 @@ static int add_mmap(
|
||||||
|
|
||||||
|
c = context_add(m, context);
|
||||||
|
if (!c)
|
||||||
|
- return -ENOMEM;
|
||||||
|
+ goto outofmem;
|
||||||
|
|
||||||
|
f = fd_add(m, fd);
|
||||||
|
if (!f)
|
||||||
|
- return -ENOMEM;
|
||||||
|
+ goto outofmem;
|
||||||
|
|
||||||
|
w = window_add(m);
|
||||||
|
if (!w)
|
||||||
|
- return -ENOMEM;
|
||||||
|
+ goto outofmem;
|
||||||
|
|
||||||
|
w->keep_always = keep_always;
|
||||||
|
w->ptr = d;
|
||||||
|
@@ -522,6 +522,10 @@ static int add_mmap(
|
||||||
|
if (ret)
|
||||||
|
*ret = (uint8_t*) w->ptr + (offset - w->offset);
|
||||||
|
return 1;
|
||||||
|
+
|
||||||
|
+outofmem:
|
||||||
|
+ munmap(d, wsize);
|
||||||
|
+ return -ENOMEM;
|
||||||
|
}
|
||||||
|
|
||||||
|
int mmap_cache_get(
|
||||||
|
--
|
||||||
|
1.7.9.2
|
||||||
|
|
30
0010-manager-use-correct-cleanup-function.patch
Normal file
30
0010-manager-use-correct-cleanup-function.patch
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
From 807d0cca2b0daf4cd725298c1b5e062b1126f15b Mon Sep 17 00:00:00 2001
|
||||||
|
From: Thomas Hindoe Paaboel Andersen <phomes@gmail.com>
|
||||||
|
Date: Thu, 11 Sep 2014 21:14:53 +0200
|
||||||
|
Subject: [PATCH] manager: use correct cleanup function
|
||||||
|
|
||||||
|
Close the dir instead of attempt to free it.
|
||||||
|
|
||||||
|
Introduced in 874310b7b68c4c0d36ff07397db30a959bb7dae5
|
||||||
|
|
||||||
|
Found with coverity. Fixes: CID#996368
|
||||||
|
---
|
||||||
|
src/core/manager.c | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git src/core/manager.c src/core/manager.c
|
||||||
|
index 9abdf47..095111e 100644
|
||||||
|
--- src/core/manager.c
|
||||||
|
+++ src/core/manager.c
|
||||||
|
@@ -896,7 +896,7 @@ static int manager_coldplug(Manager *m) {
|
||||||
|
|
||||||
|
static void manager_build_unit_path_cache(Manager *m) {
|
||||||
|
char **i;
|
||||||
|
- _cleanup_free_ DIR *d = NULL;
|
||||||
|
+ _cleanup_closedir_ DIR *d = NULL;
|
||||||
|
int r;
|
||||||
|
|
||||||
|
assert(m);
|
||||||
|
--
|
||||||
|
1.7.9.2
|
||||||
|
|
@ -0,0 +1,53 @@
|
|||||||
|
From 368082520b25722575783f06879fb5fc2e4c219c Mon Sep 17 00:00:00 2001
|
||||||
|
From: Robert Milasan <rmilasan@suse.com>
|
||||||
|
Date: Sat, 13 Sep 2014 15:18:37 +0200
|
||||||
|
Subject: [PATCH] udev: always resolve correctly database names on 'change'
|
||||||
|
event
|
||||||
|
|
||||||
|
Signed-off-by: Robert Milasan <rmilasan@suse.com>
|
||||||
|
---
|
||||||
|
src/libudev/libudev-device.c | 2 +-
|
||||||
|
src/libudev/libudev-private.h | 1 +
|
||||||
|
src/udev/udev-event.c | 1 +
|
||||||
|
3 files changed, 3 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/libudev/libudev-device.c b/src/libudev/libudev-device.c
|
||||||
|
index d61a2ad..2699374 100644
|
||||||
|
--- a/src/libudev/libudev-device.c
|
||||||
|
+++ b/src/libudev/libudev-device.c
|
||||||
|
@@ -161,7 +161,7 @@ _public_ dev_t udev_device_get_devnum(struct udev_device *udev_device)
|
||||||
|
return udev_device->devnum;
|
||||||
|
}
|
||||||
|
|
||||||
|
-static int udev_device_set_devnum(struct udev_device *udev_device, dev_t devnum)
|
||||||
|
+int udev_device_set_devnum(struct udev_device *udev_device, dev_t devnum)
|
||||||
|
{
|
||||||
|
char num[32];
|
||||||
|
|
||||||
|
diff --git a/src/libudev/libudev-private.h b/src/libudev/libudev-private.h
|
||||||
|
index 35ea7ba..05a6410 100644
|
||||||
|
--- a/src/libudev/libudev-private.h
|
||||||
|
+++ b/src/libudev/libudev-private.h
|
||||||
|
@@ -59,6 +59,7 @@ uid_t udev_device_get_devnode_uid(struct udev_device *udev_device);
|
||||||
|
gid_t udev_device_get_devnode_gid(struct udev_device *udev_device);
|
||||||
|
int udev_device_set_subsystem(struct udev_device *udev_device, const char *subsystem);
|
||||||
|
int udev_device_set_syspath(struct udev_device *udev_device, const char *syspath);
|
||||||
|
+int udev_device_set_devnum(struct udev_device *udev_device, dev_t devnum);
|
||||||
|
int udev_device_add_devlink(struct udev_device *udev_device, const char *devlink);
|
||||||
|
void udev_device_cleanup_devlinks_list(struct udev_device *udev_device);
|
||||||
|
struct udev_list_entry *udev_device_add_property(struct udev_device *udev_device, const char *key, const char *value);
|
||||||
|
diff --git a/src/udev/udev-event.c b/src/udev/udev-event.c
|
||||||
|
index e8d6676..2cf0763 100644
|
||||||
|
--- a/src/udev/udev-event.c
|
||||||
|
+++ b/src/udev/udev-event.c
|
||||||
|
@@ -812,6 +812,7 @@ void udev_event_execute_rules(struct udev_event *event,
|
||||||
|
if (event->dev_db != NULL) {
|
||||||
|
udev_device_set_syspath(event->dev_db, udev_device_get_syspath(dev));
|
||||||
|
udev_device_set_subsystem(event->dev_db, udev_device_get_subsystem(dev));
|
||||||
|
+ udev_device_set_devnum(event->dev_db, udev_device_get_devnum(dev));
|
||||||
|
udev_device_read_db(event->dev_db, NULL);
|
||||||
|
udev_device_set_info_loaded(event->dev_db);
|
||||||
|
|
||||||
|
--
|
||||||
|
1.8.4.5
|
||||||
|
|
@ -0,0 +1,26 @@
|
|||||||
|
From ad6e5b348fa88f44d6cbfe7aabda7612a1d0463f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Tom Gundersen <teg@jklm.no>
|
||||||
|
Date: Mon, 8 Sep 2014 14:00:58 +0200
|
||||||
|
Subject: [PATCH] udev: net_setup_link - export the .link filename applied to
|
||||||
|
the link
|
||||||
|
|
||||||
|
---
|
||||||
|
src/udev/udev-builtin-net_setup_link.c | 2 ++
|
||||||
|
1 file changed, 2 insertions(+)
|
||||||
|
|
||||||
|
diff --git src/udev/udev-builtin-net_setup_link.c src/udev/udev-builtin-net_setup_link.c
|
||||||
|
index 6207269..14351de 100644
|
||||||
|
--- src/udev/udev-builtin-net_setup_link.c
|
||||||
|
+++ src/udev/udev-builtin-net_setup_link.c
|
||||||
|
@@ -57,6 +57,8 @@ static int builtin_net_setup_link(struct udev_device *dev, int argc, char **argv
|
||||||
|
return EXIT_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ udev_builtin_add_property(dev, test, "ID_NET_LINK_FILE", link->filename);
|
||||||
|
+
|
||||||
|
if (name)
|
||||||
|
udev_builtin_add_property(dev, test, "ID_NET_NAME", name);
|
||||||
|
|
||||||
|
--
|
||||||
|
1.7.9.2
|
||||||
|
|
@ -0,0 +1,27 @@
|
|||||||
|
From e4d7c49050769877c7f10184bbe2a1e77d0b5333 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Tom Gundersen <teg@jklm.no>
|
||||||
|
Date: Mon, 8 Sep 2014 17:16:24 +0200
|
||||||
|
Subject: [PATCH] rules: net-setup-link - preserve ID_NET_LINK_FILE and
|
||||||
|
ID_NET_NAME after MOVE
|
||||||
|
|
||||||
|
---
|
||||||
|
rules/80-net-setup-link.rules | 3 ++-
|
||||||
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git rules/80-net-setup-link.rules rules/80-net-setup-link.rules
|
||||||
|
index f390fcb..27c43b9 100644
|
||||||
|
--- rules/80-net-setup-link.rules
|
||||||
|
+++ rules/80-net-setup-link.rules
|
||||||
|
@@ -4,7 +4,8 @@ SUBSYSTEM!="net", GOTO="net_setup_link_end"
|
||||||
|
|
||||||
|
IMPORT{builtin}="path_id"
|
||||||
|
|
||||||
|
-ACTION=="move", IMPORT{db}="ID_NET_DRIVER"
|
||||||
|
+ACTION=="move", IMPORT{db}="ID_NET_DRIVER", IMPORT{db}="ID_NET_LINK_FILE",
|
||||||
|
+IMPORT{db}="ID_NET_NAME"
|
||||||
|
|
||||||
|
ACTION!="add", GOTO="net_setup_link_end"
|
||||||
|
|
||||||
|
--
|
||||||
|
1.7.9.2
|
||||||
|
|
27
1070-rules-net-setup-link-remove-stray-linebreak.patch
Normal file
27
1070-rules-net-setup-link-remove-stray-linebreak.patch
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
From 52e231b04635400292179cf51b30d7d9b6323fb2 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Mantas=20Mikul=C4=97nas?= <grawity@gmail.com>
|
||||||
|
Date: Mon, 8 Sep 2014 22:53:39 +0300
|
||||||
|
Subject: [PATCH] rules: net-setup-link - remove stray linebreak
|
||||||
|
|
||||||
|
If not backslash-escaped, it splits the rule in two.
|
||||||
|
---
|
||||||
|
rules/80-net-setup-link.rules | 3 +--
|
||||||
|
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git rules/80-net-setup-link.rules rules/80-net-setup-link.rules
|
||||||
|
index 27c43b9..4207694 100644
|
||||||
|
--- rules/80-net-setup-link.rules
|
||||||
|
+++ rules/80-net-setup-link.rules
|
||||||
|
@@ -4,8 +4,7 @@ SUBSYSTEM!="net", GOTO="net_setup_link_end"
|
||||||
|
|
||||||
|
IMPORT{builtin}="path_id"
|
||||||
|
|
||||||
|
-ACTION=="move", IMPORT{db}="ID_NET_DRIVER", IMPORT{db}="ID_NET_LINK_FILE",
|
||||||
|
-IMPORT{db}="ID_NET_NAME"
|
||||||
|
+ACTION=="move", IMPORT{db}="ID_NET_DRIVER", IMPORT{db}="ID_NET_LINK_FILE", IMPORT{db}="ID_NET_NAME"
|
||||||
|
|
||||||
|
ACTION!="add", GOTO="net_setup_link_end"
|
||||||
|
|
||||||
|
--
|
||||||
|
1.7.9.2
|
||||||
|
|
@ -0,0 +1,54 @@
|
|||||||
|
From b081b27e1433cdc7ac72b25ae8b4db887d79187f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Tom Gundersen <teg@jklm.no>
|
||||||
|
Date: Tue, 9 Sep 2014 12:23:19 +0200
|
||||||
|
Subject: [PATCH] udev: import the full db on MOVE events for devices without
|
||||||
|
dev_t
|
||||||
|
|
||||||
|
---
|
||||||
|
rules/80-net-setup-link.rules | 2 --
|
||||||
|
src/udev/udev-event.c | 16 ++++++++++++++++
|
||||||
|
2 files changed, 16 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git rules/80-net-setup-link.rules rules/80-net-setup-link.rules
|
||||||
|
index 4207694..6e411a9 100644
|
||||||
|
--- rules/80-net-setup-link.rules
|
||||||
|
+++ rules/80-net-setup-link.rules
|
||||||
|
@@ -4,8 +4,6 @@ SUBSYSTEM!="net", GOTO="net_setup_link_end"
|
||||||
|
|
||||||
|
IMPORT{builtin}="path_id"
|
||||||
|
|
||||||
|
-ACTION=="move", IMPORT{db}="ID_NET_DRIVER", IMPORT{db}="ID_NET_LINK_FILE", IMPORT{db}="ID_NET_NAME"
|
||||||
|
-
|
||||||
|
ACTION!="add", GOTO="net_setup_link_end"
|
||||||
|
|
||||||
|
IMPORT{builtin}="net_setup_link"
|
||||||
|
diff --git src/udev/udev-event.c src/udev/udev-event.c
|
||||||
|
index 00cd6d4..18b92ca 100644
|
||||||
|
--- src/udev/udev-event.c
|
||||||
|
+++ src/udev/udev-event.c
|
||||||
|
@@ -805,6 +805,22 @@ void udev_event_execute_rules(struct udev_event *event,
|
||||||
|
udev_watch_end(event->udev, event->dev_db);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ if (major(udev_device_get_devnum(dev)) == 0 &&
|
||||||
|
+ streq(udev_device_get_action(dev), "move")) {
|
||||||
|
+ struct udev_list_entry *entry;
|
||||||
|
+
|
||||||
|
+ for ((entry = udev_device_get_properties_list_entry(event->dev_db)); entry; entry = udev_list_entry_get_next(entry)) {
|
||||||
|
+ const char *key, *value;
|
||||||
|
+ struct udev_list_entry *property;
|
||||||
|
+
|
||||||
|
+ key = udev_list_entry_get_name(entry);
|
||||||
|
+ value = udev_list_entry_get_value(entry);
|
||||||
|
+
|
||||||
|
+ property = udev_device_add_property(event->dev, key, value);
|
||||||
|
+ udev_list_entry_set_num(property, true);
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
udev_rules_apply_to_event(rules, event, timeout_usec, sigmask);
|
||||||
|
|
||||||
|
/* rename a new network interface, if needed */
|
||||||
|
--
|
||||||
|
1.7.9.2
|
||||||
|
|
39
1072-udev-netif_rename-don-t-log-to-kmsg.patch
Normal file
39
1072-udev-netif_rename-don-t-log-to-kmsg.patch
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
Based on 1187f20655de0c37337ea73e1e55823b83cd7c00 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Tom Gundersen <teg@jklm.no>
|
||||||
|
Date: Tue, 9 Sep 2014 22:45:03 +0200
|
||||||
|
Subject: [PATCH] udev: netif_rename - don't log to kmsg
|
||||||
|
|
||||||
|
As of 3.17, the kernel will do this on its own, so just do regular log_debug() logging from udev.
|
||||||
|
---
|
||||||
|
src/udev/udev-event.c | 8 ++++----
|
||||||
|
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
--- src/udev/udev-event.c
|
||||||
|
+++ src/udev/udev-event.c 2014-09-16 08:52:36.154735794 +0000
|
||||||
|
@@ -770,7 +770,7 @@ static int rename_netif(struct udev_even
|
||||||
|
|
||||||
|
r = rtnl_set_link_name(rtnl, udev_device_get_ifindex(dev), name);
|
||||||
|
if (r == 0) {
|
||||||
|
- print_kmsg("renamed network interface %s to %s\n", oldname, name);
|
||||||
|
+ log_debug("renamed network interface %s to %s", oldname, name);
|
||||||
|
return r;
|
||||||
|
} else if (r != -EEXIST) {
|
||||||
|
log_error("error changing net interface name %s to %s: %s",
|
||||||
|
@@ -789,7 +789,7 @@ static int rename_netif(struct udev_even
|
||||||
|
}
|
||||||
|
|
||||||
|
/* log temporary name */
|
||||||
|
- print_kmsg("renamed network interface %s to %s\n", oldname, interim);
|
||||||
|
+ log_debug("renamed network interface %s to %s", oldname, interim);
|
||||||
|
|
||||||
|
loop = 90 * 20;
|
||||||
|
while (loop--) {
|
||||||
|
@@ -798,7 +798,7 @@ static int rename_netif(struct udev_even
|
||||||
|
|
||||||
|
r = rtnl_set_link_name(rtnl, udev_device_get_ifindex(dev), name);
|
||||||
|
if (r == 0) {
|
||||||
|
- print_kmsg("renamed network interface %s to %s\n", interim, name);
|
||||||
|
+ log_debug("renamed network interface %s to %s", interim, name);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
75
1073-udev-drop-print_kmsg.patch
Normal file
75
1073-udev-drop-print_kmsg.patch
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
Based on 9d19a679f23c7a72c326cbbbf44e0c9f423dec5d Mon Sep 17 00:00:00 2001
|
||||||
|
From: Tom Gundersen <teg@jklm.no>
|
||||||
|
Date: Tue, 9 Sep 2014 22:48:07 +0200
|
||||||
|
Subject: [PATCH] udev - drop print_kmsg
|
||||||
|
|
||||||
|
The only remaining user was 'starting version XXX', which is now logged using log_info().
|
||||||
|
---
|
||||||
|
src/libudev/libudev-private.h | 1 -
|
||||||
|
src/libudev/libudev-util.c | 25 -------------------------
|
||||||
|
src/udev/udevd.c | 2 +-
|
||||||
|
3 files changed, 1 insertion(+), 27 deletions(-)
|
||||||
|
|
||||||
|
diff --git src/libudev/libudev-private.h src/libudev/libudev-private.h
|
||||||
|
index ae97557..cd1c1fb 100644
|
||||||
|
--- src/libudev/libudev-private.h
|
||||||
|
+++ src/libudev/libudev-private.h
|
||||||
|
@@ -170,6 +170,5 @@ int util_delete_path(struct udev *udev, const char *path);
|
||||||
|
uid_t util_lookup_user(struct udev *udev, const char *user);
|
||||||
|
gid_t util_lookup_group(struct udev *udev, const char *group);
|
||||||
|
int util_resolve_subsys_kernel(struct udev *udev, const char *string, char *result, size_t maxsize, int read_value);
|
||||||
|
-ssize_t print_kmsg(const char *fmt, ...) _printf_(1, 2);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
--- src/libudev/libudev-util.c
|
||||||
|
+++ src/libudev/libudev-util.c 2014-09-16 08:56:01.862736270 +0000
|
||||||
|
@@ -422,33 +422,3 @@ static int parse_proc_cmdline_word(const
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
-
|
||||||
|
-ssize_t print_kmsg(const char *fmt, ...)
|
||||||
|
-{
|
||||||
|
- _cleanup_close_ int fd = -1;
|
||||||
|
- va_list ap;
|
||||||
|
- char text[1024];
|
||||||
|
- ssize_t len;
|
||||||
|
- ssize_t ret;
|
||||||
|
-
|
||||||
|
- if (parse_proc_cmdline(parse_proc_cmdline_word) == -115) {
|
||||||
|
- fd = open("/dev/null", O_WRONLY|O_NOCTTY|O_CLOEXEC);
|
||||||
|
- } else {
|
||||||
|
- fd = open("/dev/kmsg", O_WRONLY|O_NOCTTY|O_CLOEXEC);
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- if (fd < 0)
|
||||||
|
- return -errno;
|
||||||
|
-
|
||||||
|
- len = snprintf(text, sizeof(text), "<30>systemd-udevd[%u]: ", getpid());
|
||||||
|
-
|
||||||
|
- va_start(ap, fmt);
|
||||||
|
- len += vsnprintf(text + len, sizeof(text) - len, fmt, ap);
|
||||||
|
- va_end(ap);
|
||||||
|
-
|
||||||
|
- ret = write(fd, text, len);
|
||||||
|
- if (ret < 0)
|
||||||
|
- return -errno;
|
||||||
|
-
|
||||||
|
- return ret;
|
||||||
|
-}
|
||||||
|
diff --git src/udev/udevd.c src/udev/udevd.c
|
||||||
|
index be0acc3..b023b6e 100644
|
||||||
|
--- src/udev/udevd.c
|
||||||
|
+++ src/udev/udevd.c
|
||||||
|
@@ -1200,7 +1200,7 @@ int main(int argc, char *argv[]) {
|
||||||
|
sd_notify(1, "READY=1");
|
||||||
|
}
|
||||||
|
|
||||||
|
- print_kmsg("starting version " VERSION "\n");
|
||||||
|
+ log_info("starting version " VERSION "\n");
|
||||||
|
|
||||||
|
if (!debug) {
|
||||||
|
int fd;
|
||||||
|
--
|
||||||
|
1.7.9.2
|
||||||
|
|
25
1074-udev-fix-copy-paste-error-in-log-message.patch
Normal file
25
1074-udev-fix-copy-paste-error-in-log-message.patch
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
From ec3281d3b681b002dfe1a4bea0532a504e37557a Mon Sep 17 00:00:00 2001
|
||||||
|
From: Tom Gundersen <teg@jklm.no>
|
||||||
|
Date: Wed, 10 Sep 2014 07:59:22 +0200
|
||||||
|
Subject: [PATCH] udev: fix copy-paste error in log message
|
||||||
|
|
||||||
|
---
|
||||||
|
src/udev/udev-rules.c | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git src/udev/udev-rules.c src/udev/udev-rules.c
|
||||||
|
index cc56215..6de7511 100644
|
||||||
|
--- src/udev/udev-rules.c
|
||||||
|
+++ src/udev/udev-rules.c
|
||||||
|
@@ -1323,7 +1323,7 @@ static int add_rule(struct udev_rules *rules, char *line,
|
||||||
|
if (cmd < UDEV_BUILTIN_MAX)
|
||||||
|
rule_add_key(&rule_tmp, TK_A_RUN_BUILTIN, op, value, &cmd);
|
||||||
|
else
|
||||||
|
- log_error("IMPORT{builtin}: '%s' unknown %s:%u", value, filename, lineno);
|
||||||
|
+ log_error("RUN{builtin}: '%s' unknown %s:%u", value, filename, lineno);
|
||||||
|
} else if (streq(attr, "program")) {
|
||||||
|
enum udev_builtin_cmd cmd = UDEV_BUILTIN_MAX;
|
||||||
|
|
||||||
|
--
|
||||||
|
1.7.9.2
|
||||||
|
|
28
1075-udev-timeout-increase-timeout.patch
Normal file
28
1075-udev-timeout-increase-timeout.patch
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
From b5338a19864ac3f5632aee48069a669479621dca Mon Sep 17 00:00:00 2001
|
||||||
|
From: Tom Gundersen <teg@jklm.no>
|
||||||
|
Date: Wed, 10 Sep 2014 10:56:26 +0200
|
||||||
|
Subject: [PATCH] udev: timeout - increase timeout
|
||||||
|
|
||||||
|
Some kernel modules still take more than one minute to insmod, we no longer rely on the timeout
|
||||||
|
killing insmod within a given period of time, so just bump this to a much higher value. Its only
|
||||||
|
purpose is to make sure that nothing stays aronud forever.
|
||||||
|
---
|
||||||
|
src/udev/udevd.c | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git src/udev/udevd.c src/udev/udevd.c
|
||||||
|
index b023b6e..a7f8cbd 100644
|
||||||
|
--- src/udev/udevd.c
|
||||||
|
+++ src/udev/udevd.c
|
||||||
|
@@ -74,7 +74,7 @@ static bool reload;
|
||||||
|
static int children;
|
||||||
|
static int children_max;
|
||||||
|
static int exec_delay;
|
||||||
|
-static usec_t event_timeout_usec = 60 * USEC_PER_SEC;
|
||||||
|
+static usec_t event_timeout_usec = 180 * USEC_PER_SEC;
|
||||||
|
static sigset_t sigmask_orig;
|
||||||
|
static UDEV_LIST(event_list);
|
||||||
|
static UDEV_LIST(worker_list);
|
||||||
|
--
|
||||||
|
1.7.9.2
|
||||||
|
|
350
1076-udev-timeout-warn-after-a-third-of-the-timeout-befor.patch
Normal file
350
1076-udev-timeout-warn-after-a-third-of-the-timeout-befor.patch
Normal file
@ -0,0 +1,350 @@
|
|||||||
|
Based on 671174136525ddf208cdbe75d6d6bd159afa961f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Tom Gundersen <teg@jklm.no>
|
||||||
|
Date: Thu, 11 Sep 2014 18:49:04 +0200
|
||||||
|
Subject: [PATCH] udev: timeout - warn after a third of the timeout before
|
||||||
|
killing
|
||||||
|
|
||||||
|
---
|
||||||
|
src/test/test-udev.c | 4 ++--
|
||||||
|
src/udev/udev-event.c | 40 ++++++++++++++++++++++++++++++----------
|
||||||
|
src/udev/udev-rules.c | 8 +++++---
|
||||||
|
src/udev/udev.h | 9 ++++++---
|
||||||
|
src/udev/udevadm-test.c | 2 +-
|
||||||
|
src/udev/udevd.c | 40 +++++++++++++++++++++++++++-------------
|
||||||
|
6 files changed, 71 insertions(+), 32 deletions(-)
|
||||||
|
|
||||||
|
diff --git src/test/test-udev.c src/test/test-udev.c
|
||||||
|
index 566a73a..f085262 100644
|
||||||
|
--- src/test/test-udev.c
|
||||||
|
+++ src/test/test-udev.c
|
||||||
|
@@ -153,8 +153,8 @@ int main(int argc, char *argv[]) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- udev_event_execute_rules(event, USEC_PER_SEC, rules, &sigmask_orig);
|
||||||
|
- udev_event_execute_run(event, USEC_PER_SEC, NULL);
|
||||||
|
+ udev_event_execute_rules(event, 3 * USEC_PER_SEC, USEC_PER_SEC, rules, &sigmask_orig);
|
||||||
|
+ udev_event_execute_run(event, 3 * USEC_PER_SEC, USEC_PER_SEC, NULL);
|
||||||
|
out:
|
||||||
|
if (event != NULL && event->fd_signal >= 0)
|
||||||
|
close(event->fd_signal);
|
||||||
|
diff --git src/udev/udev-event.c src/udev/udev-event.c
|
||||||
|
index a883edc..e8d6676 100644
|
||||||
|
--- src/udev/udev-event.c
|
||||||
|
+++ src/udev/udev-event.c
|
||||||
|
@@ -541,6 +541,7 @@ out:
|
||||||
|
|
||||||
|
static int spawn_wait(struct udev_event *event,
|
||||||
|
usec_t timeout_usec,
|
||||||
|
+ usec_t timeout_warn_usec,
|
||||||
|
const char *cmd, pid_t pid) {
|
||||||
|
struct pollfd pfd[1];
|
||||||
|
int err = 0;
|
||||||
|
@@ -550,6 +551,7 @@ static int spawn_wait(struct udev_event *event,
|
||||||
|
|
||||||
|
while (pid > 0) {
|
||||||
|
int timeout;
|
||||||
|
+ int timeout_warn = 0;
|
||||||
|
int fdcount;
|
||||||
|
|
||||||
|
if (timeout_usec > 0) {
|
||||||
|
@@ -558,13 +560,17 @@ static int spawn_wait(struct udev_event *event,
|
||||||
|
age_usec = now(CLOCK_MONOTONIC) - event->birth_usec;
|
||||||
|
if (age_usec >= timeout_usec)
|
||||||
|
timeout = 1000;
|
||||||
|
- else
|
||||||
|
- timeout = ((timeout_usec - age_usec) / USEC_PER_MSEC) + MSEC_PER_SEC;
|
||||||
|
+ else {
|
||||||
|
+ if (timeout_warn_usec > 0)
|
||||||
|
+ timeout_warn = ((timeout_warn_usec - age_usec) / USEC_PER_MSEC) + MSEC_PER_SEC;
|
||||||
|
+
|
||||||
|
+ timeout = ((timeout_usec - timeout_warn_usec - age_usec) / USEC_PER_MSEC) + MSEC_PER_SEC;
|
||||||
|
+ }
|
||||||
|
} else {
|
||||||
|
timeout = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
- fdcount = poll(pfd, 1, timeout);
|
||||||
|
+ fdcount = poll(pfd, 1, timeout_warn);
|
||||||
|
if (fdcount < 0) {
|
||||||
|
if (errno == EINTR)
|
||||||
|
continue;
|
||||||
|
@@ -573,8 +579,20 @@ static int spawn_wait(struct udev_event *event,
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
if (fdcount == 0) {
|
||||||
|
- log_error("timeout: killing '%s' [%u]", cmd, pid);
|
||||||
|
- kill(pid, SIGKILL);
|
||||||
|
+ log_warning("slow: '%s' [%u]", cmd, pid);
|
||||||
|
+
|
||||||
|
+ fdcount = poll(pfd, 1, timeout);
|
||||||
|
+ if (fdcount < 0) {
|
||||||
|
+ if (errno == EINTR)
|
||||||
|
+ continue;
|
||||||
|
+ err = -errno;
|
||||||
|
+ log_error("failed to poll: %m");
|
||||||
|
+ goto out;
|
||||||
|
+ }
|
||||||
|
+ if (fdcount == 0) {
|
||||||
|
+ log_error("timeout: killing '%s' [%u]", cmd, pid);
|
||||||
|
+ kill(pid, SIGKILL);
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pfd[0].revents & POLLIN) {
|
||||||
|
@@ -654,6 +672,7 @@ out:
|
||||||
|
|
||||||
|
int udev_event_spawn(struct udev_event *event,
|
||||||
|
usec_t timeout_usec,
|
||||||
|
+ usec_t timeout_warn_usec,
|
||||||
|
const char *cmd, char **envp, const sigset_t *sigmask,
|
||||||
|
char *result, size_t ressize) {
|
||||||
|
struct udev *udev = event->udev;
|
||||||
|
@@ -730,7 +749,7 @@ int udev_event_spawn(struct udev_event *event,
|
||||||
|
outpipe[READ_END], errpipe[READ_END],
|
||||||
|
result, ressize);
|
||||||
|
|
||||||
|
- err = spawn_wait(event, timeout_usec, cmd, pid);
|
||||||
|
+ err = spawn_wait(event, timeout_usec, timeout_warn_usec, cmd, pid);
|
||||||
|
}
|
||||||
|
|
||||||
|
out:
|
||||||
|
@@ -769,6 +788,7 @@ static int rename_netif(struct udev_event *event) {
|
||||||
|
|
||||||
|
void udev_event_execute_rules(struct udev_event *event,
|
||||||
|
usec_t timeout_usec,
|
||||||
|
+ usec_t timeout_warn_usec,
|
||||||
|
struct udev_rules *rules, const sigset_t *sigmask) {
|
||||||
|
struct udev_device *dev = event->dev;
|
||||||
|
|
||||||
|
@@ -783,7 +803,7 @@ void udev_event_execute_rules(struct udev_event *event,
|
||||||
|
if (major(udev_device_get_devnum(dev)) != 0)
|
||||||
|
udev_watch_end(event->udev, dev);
|
||||||
|
|
||||||
|
- udev_rules_apply_to_event(rules, event, timeout_usec, sigmask);
|
||||||
|
+ udev_rules_apply_to_event(rules, event, timeout_usec, timeout_warn_usec, sigmask);
|
||||||
|
|
||||||
|
if (major(udev_device_get_devnum(dev)) != 0)
|
||||||
|
udev_node_remove(dev);
|
||||||
|
@@ -816,7 +836,7 @@ void udev_event_execute_rules(struct udev_event *event,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- udev_rules_apply_to_event(rules, event, timeout_usec, sigmask);
|
||||||
|
+ udev_rules_apply_to_event(rules, event, timeout_usec, timeout_warn_usec, sigmask);
|
||||||
|
|
||||||
|
/* rename a new network interface, if needed */
|
||||||
|
if (udev_device_get_ifindex(dev) > 0 && streq(udev_device_get_action(dev), "add") &&
|
||||||
|
@@ -889,7 +909,7 @@ void udev_event_execute_rules(struct udev_event *event,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
-void udev_event_execute_run(struct udev_event *event, usec_t timeout_usec, const sigset_t *sigmask) {
|
||||||
|
+void udev_event_execute_run(struct udev_event *event, usec_t timeout_usec, usec_t timeout_warn_usec, const sigset_t *sigmask) {
|
||||||
|
struct udev_list_entry *list_entry;
|
||||||
|
|
||||||
|
udev_list_entry_foreach(list_entry, udev_list_get_entry(&event->run_list)) {
|
||||||
|
@@ -912,7 +932,7 @@ void udev_event_execute_run(struct udev_event *event, usec_t timeout_usec, const
|
||||||
|
|
||||||
|
udev_event_apply_format(event, cmd, program, sizeof(program));
|
||||||
|
envp = udev_device_get_properties_envp(event->dev);
|
||||||
|
- udev_event_spawn(event, timeout_usec, program, envp, sigmask, NULL, 0);
|
||||||
|
+ udev_event_spawn(event, timeout_usec, timeout_warn_usec, program, envp, sigmask, NULL, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
diff --git src/udev/udev-rules.c src/udev/udev-rules.c
|
||||||
|
index 9514dde..db95442 100644
|
||||||
|
--- src/udev/udev-rules.c
|
||||||
|
+++ src/udev/udev-rules.c
|
||||||
|
@@ -615,6 +615,7 @@ static int import_file_into_properties(struct udev_device *dev, const char *file
|
||||||
|
|
||||||
|
static int import_program_into_properties(struct udev_event *event,
|
||||||
|
usec_t timeout_usec,
|
||||||
|
+ usec_t timeout_warn_usec,
|
||||||
|
const char *program, const sigset_t *sigmask) {
|
||||||
|
struct udev_device *dev = event->dev;
|
||||||
|
char **envp;
|
||||||
|
@@ -623,7 +624,7 @@ static int import_program_into_properties(struct udev_event *event,
|
||||||
|
int err;
|
||||||
|
|
||||||
|
envp = udev_device_get_properties_envp(dev);
|
||||||
|
- err = udev_event_spawn(event, timeout_usec, program, envp, sigmask, result, sizeof(result));
|
||||||
|
+ err = udev_event_spawn(event, timeout_usec, timeout_warn_usec, program, envp, sigmask, result, sizeof(result));
|
||||||
|
if (err < 0)
|
||||||
|
return err;
|
||||||
|
|
||||||
|
@@ -1862,6 +1863,7 @@ enum escape_type {
|
||||||
|
int udev_rules_apply_to_event(struct udev_rules *rules,
|
||||||
|
struct udev_event *event,
|
||||||
|
usec_t timeout_usec,
|
||||||
|
+ usec_t timeout_warn_usec,
|
||||||
|
const sigset_t *sigmask) {
|
||||||
|
struct token *cur;
|
||||||
|
struct token *rule;
|
||||||
|
@@ -2070,7 +2072,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules,
|
||||||
|
rules_str(rules, rule->rule.filename_off),
|
||||||
|
rule->rule.filename_line);
|
||||||
|
|
||||||
|
- if (udev_event_spawn(event, timeout_usec, program, envp, sigmask, result, sizeof(result)) < 0) {
|
||||||
|
+ if (udev_event_spawn(event, timeout_usec, timeout_warn_usec, program, envp, sigmask, result, sizeof(result)) < 0) {
|
||||||
|
if (cur->key.op != OP_NOMATCH)
|
||||||
|
goto nomatch;
|
||||||
|
} else {
|
||||||
|
@@ -2106,7 +2108,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules,
|
||||||
|
rules_str(rules, rule->rule.filename_off),
|
||||||
|
rule->rule.filename_line);
|
||||||
|
|
||||||
|
- if (import_program_into_properties(event, timeout_usec, import, sigmask) != 0)
|
||||||
|
+ if (import_program_into_properties(event, timeout_usec, timeout_warn_usec, import, sigmask) != 0)
|
||||||
|
if (cur->key.op != OP_NOMATCH)
|
||||||
|
goto nomatch;
|
||||||
|
break;
|
||||||
|
diff --git src/udev/udev.h src/udev/udev.h
|
||||||
|
index ed01da3..765ba9e 100644
|
||||||
|
--- src/udev/udev.h
|
||||||
|
+++ src/udev/udev.h
|
||||||
|
@@ -73,7 +73,8 @@ struct udev_rules;
|
||||||
|
struct udev_rules *udev_rules_new(struct udev *udev, int resolve_names);
|
||||||
|
struct udev_rules *udev_rules_unref(struct udev_rules *rules);
|
||||||
|
bool udev_rules_check_timestamp(struct udev_rules *rules);
|
||||||
|
-int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event, usec_t timeout_usec, const sigset_t *sigmask);
|
||||||
|
+int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event, usec_t timeout_usec, usec_t timeout_warn_usec,
|
||||||
|
+ const sigset_t *sigmask);
|
||||||
|
int udev_rules_apply_static_dev_perms(struct udev_rules *rules);
|
||||||
|
|
||||||
|
/* udev-event.c */
|
||||||
|
@@ -84,10 +85,12 @@ int udev_event_apply_subsys_kernel(struct udev_event *event, const char *string,
|
||||||
|
char *result, size_t maxsize, int read_value);
|
||||||
|
int udev_event_spawn(struct udev_event *event,
|
||||||
|
usec_t timeout_usec,
|
||||||
|
+ usec_t timeout_warn_usec,
|
||||||
|
const char *cmd, char **envp, const sigset_t *sigmask,
|
||||||
|
char *result, size_t ressize);
|
||||||
|
-void udev_event_execute_rules(struct udev_event *event, usec_t timeout_usec, struct udev_rules *rules, const sigset_t *sigset);
|
||||||
|
-void udev_event_execute_run(struct udev_event *event, usec_t timeout_usec, const sigset_t *sigset);
|
||||||
|
+void udev_event_execute_rules(struct udev_event *event, usec_t timeout_usec, usec_t timeout_warn_usec,
|
||||||
|
+ struct udev_rules *rules, const sigset_t *sigset);
|
||||||
|
+void udev_event_execute_run(struct udev_event *event, usec_t timeout_usec, usec_t timeout_warn_usec, const sigset_t *sigset);
|
||||||
|
int udev_build_argv(struct udev *udev, char *cmd, int *argc, char *argv[]);
|
||||||
|
|
||||||
|
/* udev-watch.c */
|
||||||
|
diff --git src/udev/udevadm-test.c src/udev/udevadm-test.c
|
||||||
|
index 809adb6..4738b61 100644
|
||||||
|
--- src/udev/udevadm-test.c
|
||||||
|
+++ src/udev/udevadm-test.c
|
||||||
|
@@ -136,7 +136,7 @@ static int adm_test(struct udev *udev, int argc, char *argv[]) {
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
- udev_event_execute_rules(event, 60 * USEC_PER_SEC, rules, &sigmask_orig);
|
||||||
|
+ udev_event_execute_rules(event, 60 * USEC_PER_SEC, 20 * USEC_PER_SEC, rules, &sigmask_orig);
|
||||||
|
|
||||||
|
udev_list_entry_foreach(entry, udev_device_get_properties_list_entry(dev))
|
||||||
|
printf("%s=%s\n", udev_list_entry_get_name(entry), udev_list_entry_get_value(entry));
|
||||||
|
--- src/udev/udevd.c
|
||||||
|
+++ src/udev/udevd.c 2014-09-16 09:01:14.382735997 +0000
|
||||||
|
@@ -75,6 +75,7 @@ static int children;
|
||||||
|
static int children_max;
|
||||||
|
static int exec_delay;
|
||||||
|
static usec_t event_timeout_usec = 180 * USEC_PER_SEC;
|
||||||
|
+static usec_t event_timeout_warn_usec = 180 * USEC_PER_SEC / 3;
|
||||||
|
static sigset_t sigmask_orig;
|
||||||
|
static UDEV_LIST(event_list);
|
||||||
|
static UDEV_LIST(worker_list);
|
||||||
|
@@ -129,6 +130,7 @@ struct worker {
|
||||||
|
enum worker_state state;
|
||||||
|
struct event *event;
|
||||||
|
usec_t event_start_usec;
|
||||||
|
+ bool event_warned;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* passed from worker to main process */
|
||||||
|
@@ -314,9 +316,9 @@ static void worker_new(struct event *eve
|
||||||
|
}
|
||||||
|
|
||||||
|
/* apply rules, create node, symlinks */
|
||||||
|
- udev_event_execute_rules(udev_event, event_timeout_usec, rules, &sigmask_orig);
|
||||||
|
+ udev_event_execute_rules(udev_event, event_timeout_usec, event_timeout_warn_usec, rules, &sigmask_orig);
|
||||||
|
|
||||||
|
- udev_event_execute_run(udev_event, event_timeout_usec, &sigmask_orig);
|
||||||
|
+ udev_event_execute_run(udev_event, event_timeout_usec, event_timeout_warn_usec, &sigmask_orig);
|
||||||
|
|
||||||
|
/* apply/restore inotify watch */
|
||||||
|
if (udev_event->inotify_watch) {
|
||||||
|
@@ -410,6 +412,7 @@ out:
|
||||||
|
worker->pid = pid;
|
||||||
|
worker->state = WORKER_RUNNING;
|
||||||
|
worker->event_start_usec = now(CLOCK_MONOTONIC);
|
||||||
|
+ worker->event_warned = false;
|
||||||
|
worker->event = event;
|
||||||
|
event->state = EVENT_RUNNING;
|
||||||
|
udev_list_node_append(&worker->node, &worker_list);
|
||||||
|
@@ -441,6 +444,7 @@ static void event_run(struct event *even
|
||||||
|
worker->event = event;
|
||||||
|
worker->state = WORKER_RUNNING;
|
||||||
|
worker->event_start_usec = now(CLOCK_MONOTONIC);
|
||||||
|
+ worker->event_warned = false;
|
||||||
|
event->state = EVENT_RUNNING;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
@@ -1016,6 +1020,7 @@ static void kernel_cmdline_options(struc
|
||||||
|
exec_delay = strtoul(opt + 16, NULL, 0);
|
||||||
|
} else if (startswith(opt, "udev.event-timeout=")) {
|
||||||
|
event_timeout_usec = strtoul(opt + 16, NULL, 0) * USEC_PER_SEC;
|
||||||
|
+ event_timeout_warn_usec = (event_timeout_usec / 3) ? : 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
free(s);
|
||||||
|
@@ -1078,6 +1083,7 @@ int main(int argc, char *argv[]) {
|
||||||
|
break;
|
||||||
|
case 't':
|
||||||
|
event_timeout_usec = strtoul(optarg, NULL, 0) * USEC_PER_SEC;
|
||||||
|
+ event_timeout_warn_usec = (event_timeout_usec / 3) ? : 1;
|
||||||
|
break;
|
||||||
|
case 'D':
|
||||||
|
debug = true;
|
||||||
|
@@ -1413,21 +1419,29 @@ int main(int argc, char *argv[]) {
|
||||||
|
/* check for hanging events */
|
||||||
|
udev_list_node_foreach(loop, &worker_list) {
|
||||||
|
struct worker *worker = node_to_worker(loop);
|
||||||
|
+ usec_t ts;
|
||||||
|
|
||||||
|
if (worker->state != WORKER_RUNNING)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
- if ((now(CLOCK_MONOTONIC) - worker->event_start_usec) > event_timeout_usec) {
|
||||||
|
- log_error("worker [%u] %s timeout; kill it", worker->pid, worker->event->devpath);
|
||||||
|
- kill(worker->pid, SIGKILL);
|
||||||
|
- worker->state = WORKER_KILLED;
|
||||||
|
-
|
||||||
|
- /* drop reference taken for state 'running' */
|
||||||
|
- worker_unref(worker);
|
||||||
|
- log_error("seq %llu '%s' killed", udev_device_get_seqnum(worker->event->dev), worker->event->devpath);
|
||||||
|
- worker->event->exitcode = -64;
|
||||||
|
- event_queue_delete(worker->event);
|
||||||
|
- worker->event = NULL;
|
||||||
|
+ ts = now(CLOCK_MONOTONIC);
|
||||||
|
+
|
||||||
|
+ if ((ts - worker->event_start_usec) > event_timeout_warn_usec) {
|
||||||
|
+ if ((ts - worker->event_start_usec) > event_timeout_usec) {
|
||||||
|
+ log_error("worker [%u] %s timeout; kill it", worker->pid, worker->event->devpath);
|
||||||
|
+ kill(worker->pid, SIGKILL);
|
||||||
|
+ worker->state = WORKER_KILLED;
|
||||||
|
+
|
||||||
|
+ /* drop reference taken for state 'running' */
|
||||||
|
+ worker_unref(worker);
|
||||||
|
+ log_error("seq %llu '%s' killed", udev_device_get_seqnum(worker->event->dev), worker->event->devpath);
|
||||||
|
+ worker->event->exitcode = -64;
|
||||||
|
+ event_queue_delete(worker->event);
|
||||||
|
+ worker->event = NULL;
|
||||||
|
+ } else if (!worker->event_warned) {
|
||||||
|
+ log_warning("worker [%u] %s is taking a long time", worker->pid, worker->event->devpath);
|
||||||
|
+ worker->event_warned = true;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
1.7.9.2
|
||||||
|
|
350
1077-udev-timeout-warn-after-a-third-of-the-timeout-befor.patch
Normal file
350
1077-udev-timeout-warn-after-a-third-of-the-timeout-befor.patch
Normal file
@ -0,0 +1,350 @@
|
|||||||
|
Based on 671174136525ddf208cdbe75d6d6bd159afa961f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Tom Gundersen <teg@jklm.no>
|
||||||
|
Date: Thu, 11 Sep 2014 18:49:04 +0200
|
||||||
|
Subject: [PATCH] udev: timeout - warn after a third of the timeout before
|
||||||
|
killing
|
||||||
|
|
||||||
|
---
|
||||||
|
src/test/test-udev.c | 4 ++--
|
||||||
|
src/udev/udev-event.c | 40 ++++++++++++++++++++++++++++++----------
|
||||||
|
src/udev/udev-rules.c | 8 +++++---
|
||||||
|
src/udev/udev.h | 9 ++++++---
|
||||||
|
src/udev/udevadm-test.c | 2 +-
|
||||||
|
src/udev/udevd.c | 40 +++++++++++++++++++++++++++-------------
|
||||||
|
6 files changed, 71 insertions(+), 32 deletions(-)
|
||||||
|
|
||||||
|
diff --git src/test/test-udev.c src/test/test-udev.c
|
||||||
|
index 566a73a..f085262 100644
|
||||||
|
--- src/test/test-udev.c
|
||||||
|
+++ src/test/test-udev.c
|
||||||
|
@@ -153,8 +153,8 @@ int main(int argc, char *argv[]) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- udev_event_execute_rules(event, USEC_PER_SEC, rules, &sigmask_orig);
|
||||||
|
- udev_event_execute_run(event, USEC_PER_SEC, NULL);
|
||||||
|
+ udev_event_execute_rules(event, 3 * USEC_PER_SEC, USEC_PER_SEC, rules, &sigmask_orig);
|
||||||
|
+ udev_event_execute_run(event, 3 * USEC_PER_SEC, USEC_PER_SEC, NULL);
|
||||||
|
out:
|
||||||
|
if (event != NULL && event->fd_signal >= 0)
|
||||||
|
close(event->fd_signal);
|
||||||
|
diff --git src/udev/udev-event.c src/udev/udev-event.c
|
||||||
|
index a883edc..e8d6676 100644
|
||||||
|
--- src/udev/udev-event.c
|
||||||
|
+++ src/udev/udev-event.c
|
||||||
|
@@ -541,6 +541,7 @@ out:
|
||||||
|
|
||||||
|
static int spawn_wait(struct udev_event *event,
|
||||||
|
usec_t timeout_usec,
|
||||||
|
+ usec_t timeout_warn_usec,
|
||||||
|
const char *cmd, pid_t pid) {
|
||||||
|
struct pollfd pfd[1];
|
||||||
|
int err = 0;
|
||||||
|
@@ -550,6 +551,7 @@ static int spawn_wait(struct udev_event *event,
|
||||||
|
|
||||||
|
while (pid > 0) {
|
||||||
|
int timeout;
|
||||||
|
+ int timeout_warn = 0;
|
||||||
|
int fdcount;
|
||||||
|
|
||||||
|
if (timeout_usec > 0) {
|
||||||
|
@@ -558,13 +560,17 @@ static int spawn_wait(struct udev_event *event,
|
||||||
|
age_usec = now(CLOCK_MONOTONIC) - event->birth_usec;
|
||||||
|
if (age_usec >= timeout_usec)
|
||||||
|
timeout = 1000;
|
||||||
|
- else
|
||||||
|
- timeout = ((timeout_usec - age_usec) / USEC_PER_MSEC) + MSEC_PER_SEC;
|
||||||
|
+ else {
|
||||||
|
+ if (timeout_warn_usec > 0)
|
||||||
|
+ timeout_warn = ((timeout_warn_usec - age_usec) / USEC_PER_MSEC) + MSEC_PER_SEC;
|
||||||
|
+
|
||||||
|
+ timeout = ((timeout_usec - timeout_warn_usec - age_usec) / USEC_PER_MSEC) + MSEC_PER_SEC;
|
||||||
|
+ }
|
||||||
|
} else {
|
||||||
|
timeout = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
- fdcount = poll(pfd, 1, timeout);
|
||||||
|
+ fdcount = poll(pfd, 1, timeout_warn);
|
||||||
|
if (fdcount < 0) {
|
||||||
|
if (errno == EINTR)
|
||||||
|
continue;
|
||||||
|
@@ -573,8 +579,20 @@ static int spawn_wait(struct udev_event *event,
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
if (fdcount == 0) {
|
||||||
|
- log_error("timeout: killing '%s' [%u]", cmd, pid);
|
||||||
|
- kill(pid, SIGKILL);
|
||||||
|
+ log_warning("slow: '%s' [%u]", cmd, pid);
|
||||||
|
+
|
||||||
|
+ fdcount = poll(pfd, 1, timeout);
|
||||||
|
+ if (fdcount < 0) {
|
||||||
|
+ if (errno == EINTR)
|
||||||
|
+ continue;
|
||||||
|
+ err = -errno;
|
||||||
|
+ log_error("failed to poll: %m");
|
||||||
|
+ goto out;
|
||||||
|
+ }
|
||||||
|
+ if (fdcount == 0) {
|
||||||
|
+ log_error("timeout: killing '%s' [%u]", cmd, pid);
|
||||||
|
+ kill(pid, SIGKILL);
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pfd[0].revents & POLLIN) {
|
||||||
|
@@ -654,6 +672,7 @@ out:
|
||||||
|
|
||||||
|
int udev_event_spawn(struct udev_event *event,
|
||||||
|
usec_t timeout_usec,
|
||||||
|
+ usec_t timeout_warn_usec,
|
||||||
|
const char *cmd, char **envp, const sigset_t *sigmask,
|
||||||
|
char *result, size_t ressize) {
|
||||||
|
struct udev *udev = event->udev;
|
||||||
|
@@ -730,7 +749,7 @@ int udev_event_spawn(struct udev_event *event,
|
||||||
|
outpipe[READ_END], errpipe[READ_END],
|
||||||
|
result, ressize);
|
||||||
|
|
||||||
|
- err = spawn_wait(event, timeout_usec, cmd, pid);
|
||||||
|
+ err = spawn_wait(event, timeout_usec, timeout_warn_usec, cmd, pid);
|
||||||
|
}
|
||||||
|
|
||||||
|
out:
|
||||||
|
@@ -769,6 +788,7 @@ static int rename_netif(struct udev_event *event) {
|
||||||
|
|
||||||
|
void udev_event_execute_rules(struct udev_event *event,
|
||||||
|
usec_t timeout_usec,
|
||||||
|
+ usec_t timeout_warn_usec,
|
||||||
|
struct udev_rules *rules, const sigset_t *sigmask) {
|
||||||
|
struct udev_device *dev = event->dev;
|
||||||
|
|
||||||
|
@@ -783,7 +803,7 @@ void udev_event_execute_rules(struct udev_event *event,
|
||||||
|
if (major(udev_device_get_devnum(dev)) != 0)
|
||||||
|
udev_watch_end(event->udev, dev);
|
||||||
|
|
||||||
|
- udev_rules_apply_to_event(rules, event, timeout_usec, sigmask);
|
||||||
|
+ udev_rules_apply_to_event(rules, event, timeout_usec, timeout_warn_usec, sigmask);
|
||||||
|
|
||||||
|
if (major(udev_device_get_devnum(dev)) != 0)
|
||||||
|
udev_node_remove(dev);
|
||||||
|
@@ -816,7 +836,7 @@ void udev_event_execute_rules(struct udev_event *event,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- udev_rules_apply_to_event(rules, event, timeout_usec, sigmask);
|
||||||
|
+ udev_rules_apply_to_event(rules, event, timeout_usec, timeout_warn_usec, sigmask);
|
||||||
|
|
||||||
|
/* rename a new network interface, if needed */
|
||||||
|
if (udev_device_get_ifindex(dev) > 0 && streq(udev_device_get_action(dev), "add") &&
|
||||||
|
@@ -889,7 +909,7 @@ void udev_event_execute_rules(struct udev_event *event,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
-void udev_event_execute_run(struct udev_event *event, usec_t timeout_usec, const sigset_t *sigmask) {
|
||||||
|
+void udev_event_execute_run(struct udev_event *event, usec_t timeout_usec, usec_t timeout_warn_usec, const sigset_t *sigmask) {
|
||||||
|
struct udev_list_entry *list_entry;
|
||||||
|
|
||||||
|
udev_list_entry_foreach(list_entry, udev_list_get_entry(&event->run_list)) {
|
||||||
|
@@ -912,7 +932,7 @@ void udev_event_execute_run(struct udev_event *event, usec_t timeout_usec, const
|
||||||
|
|
||||||
|
udev_event_apply_format(event, cmd, program, sizeof(program));
|
||||||
|
envp = udev_device_get_properties_envp(event->dev);
|
||||||
|
- udev_event_spawn(event, timeout_usec, program, envp, sigmask, NULL, 0);
|
||||||
|
+ udev_event_spawn(event, timeout_usec, timeout_warn_usec, program, envp, sigmask, NULL, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
diff --git src/udev/udev-rules.c src/udev/udev-rules.c
|
||||||
|
index 9514dde..db95442 100644
|
||||||
|
--- src/udev/udev-rules.c
|
||||||
|
+++ src/udev/udev-rules.c
|
||||||
|
@@ -615,6 +615,7 @@ static int import_file_into_properties(struct udev_device *dev, const char *file
|
||||||
|
|
||||||
|
static int import_program_into_properties(struct udev_event *event,
|
||||||
|
usec_t timeout_usec,
|
||||||
|
+ usec_t timeout_warn_usec,
|
||||||
|
const char *program, const sigset_t *sigmask) {
|
||||||
|
struct udev_device *dev = event->dev;
|
||||||
|
char **envp;
|
||||||
|
@@ -623,7 +624,7 @@ static int import_program_into_properties(struct udev_event *event,
|
||||||
|
int err;
|
||||||
|
|
||||||
|
envp = udev_device_get_properties_envp(dev);
|
||||||
|
- err = udev_event_spawn(event, timeout_usec, program, envp, sigmask, result, sizeof(result));
|
||||||
|
+ err = udev_event_spawn(event, timeout_usec, timeout_warn_usec, program, envp, sigmask, result, sizeof(result));
|
||||||
|
if (err < 0)
|
||||||
|
return err;
|
||||||
|
|
||||||
|
@@ -1862,6 +1863,7 @@ enum escape_type {
|
||||||
|
int udev_rules_apply_to_event(struct udev_rules *rules,
|
||||||
|
struct udev_event *event,
|
||||||
|
usec_t timeout_usec,
|
||||||
|
+ usec_t timeout_warn_usec,
|
||||||
|
const sigset_t *sigmask) {
|
||||||
|
struct token *cur;
|
||||||
|
struct token *rule;
|
||||||
|
@@ -2070,7 +2072,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules,
|
||||||
|
rules_str(rules, rule->rule.filename_off),
|
||||||
|
rule->rule.filename_line);
|
||||||
|
|
||||||
|
- if (udev_event_spawn(event, timeout_usec, program, envp, sigmask, result, sizeof(result)) < 0) {
|
||||||
|
+ if (udev_event_spawn(event, timeout_usec, timeout_warn_usec, program, envp, sigmask, result, sizeof(result)) < 0) {
|
||||||
|
if (cur->key.op != OP_NOMATCH)
|
||||||
|
goto nomatch;
|
||||||
|
} else {
|
||||||
|
@@ -2106,7 +2108,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules,
|
||||||
|
rules_str(rules, rule->rule.filename_off),
|
||||||
|
rule->rule.filename_line);
|
||||||
|
|
||||||
|
- if (import_program_into_properties(event, timeout_usec, import, sigmask) != 0)
|
||||||
|
+ if (import_program_into_properties(event, timeout_usec, timeout_warn_usec, import, sigmask) != 0)
|
||||||
|
if (cur->key.op != OP_NOMATCH)
|
||||||
|
goto nomatch;
|
||||||
|
break;
|
||||||
|
diff --git src/udev/udev.h src/udev/udev.h
|
||||||
|
index ed01da3..765ba9e 100644
|
||||||
|
--- src/udev/udev.h
|
||||||
|
+++ src/udev/udev.h
|
||||||
|
@@ -73,7 +73,8 @@ struct udev_rules;
|
||||||
|
struct udev_rules *udev_rules_new(struct udev *udev, int resolve_names);
|
||||||
|
struct udev_rules *udev_rules_unref(struct udev_rules *rules);
|
||||||
|
bool udev_rules_check_timestamp(struct udev_rules *rules);
|
||||||
|
-int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event, usec_t timeout_usec, const sigset_t *sigmask);
|
||||||
|
+int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event, usec_t timeout_usec, usec_t timeout_warn_usec,
|
||||||
|
+ const sigset_t *sigmask);
|
||||||
|
int udev_rules_apply_static_dev_perms(struct udev_rules *rules);
|
||||||
|
|
||||||
|
/* udev-event.c */
|
||||||
|
@@ -84,10 +85,12 @@ int udev_event_apply_subsys_kernel(struct udev_event *event, const char *string,
|
||||||
|
char *result, size_t maxsize, int read_value);
|
||||||
|
int udev_event_spawn(struct udev_event *event,
|
||||||
|
usec_t timeout_usec,
|
||||||
|
+ usec_t timeout_warn_usec,
|
||||||
|
const char *cmd, char **envp, const sigset_t *sigmask,
|
||||||
|
char *result, size_t ressize);
|
||||||
|
-void udev_event_execute_rules(struct udev_event *event, usec_t timeout_usec, struct udev_rules *rules, const sigset_t *sigset);
|
||||||
|
-void udev_event_execute_run(struct udev_event *event, usec_t timeout_usec, const sigset_t *sigset);
|
||||||
|
+void udev_event_execute_rules(struct udev_event *event, usec_t timeout_usec, usec_t timeout_warn_usec,
|
||||||
|
+ struct udev_rules *rules, const sigset_t *sigset);
|
||||||
|
+void udev_event_execute_run(struct udev_event *event, usec_t timeout_usec, usec_t timeout_warn_usec, const sigset_t *sigset);
|
||||||
|
int udev_build_argv(struct udev *udev, char *cmd, int *argc, char *argv[]);
|
||||||
|
|
||||||
|
/* udev-watch.c */
|
||||||
|
diff --git src/udev/udevadm-test.c src/udev/udevadm-test.c
|
||||||
|
index 809adb6..4738b61 100644
|
||||||
|
--- src/udev/udevadm-test.c
|
||||||
|
+++ src/udev/udevadm-test.c
|
||||||
|
@@ -136,7 +136,7 @@ static int adm_test(struct udev *udev, int argc, char *argv[]) {
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
- udev_event_execute_rules(event, 60 * USEC_PER_SEC, rules, &sigmask_orig);
|
||||||
|
+ udev_event_execute_rules(event, 60 * USEC_PER_SEC, 20 * USEC_PER_SEC, rules, &sigmask_orig);
|
||||||
|
|
||||||
|
udev_list_entry_foreach(entry, udev_device_get_properties_list_entry(dev))
|
||||||
|
printf("%s=%s\n", udev_list_entry_get_name(entry), udev_list_entry_get_value(entry));
|
||||||
|
--- src/udev/udevd.c
|
||||||
|
+++ src/udev/udevd.c 2014-09-16 09:01:14.382735997 +0000
|
||||||
|
@@ -75,6 +75,7 @@ static int children;
|
||||||
|
static int children_max;
|
||||||
|
static int exec_delay;
|
||||||
|
static usec_t event_timeout_usec = 180 * USEC_PER_SEC;
|
||||||
|
+static usec_t event_timeout_warn_usec = 180 * USEC_PER_SEC / 3;
|
||||||
|
static sigset_t sigmask_orig;
|
||||||
|
static UDEV_LIST(event_list);
|
||||||
|
static UDEV_LIST(worker_list);
|
||||||
|
@@ -129,6 +130,7 @@ struct worker {
|
||||||
|
enum worker_state state;
|
||||||
|
struct event *event;
|
||||||
|
usec_t event_start_usec;
|
||||||
|
+ bool event_warned;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* passed from worker to main process */
|
||||||
|
@@ -314,9 +316,9 @@ static void worker_new(struct event *eve
|
||||||
|
}
|
||||||
|
|
||||||
|
/* apply rules, create node, symlinks */
|
||||||
|
- udev_event_execute_rules(udev_event, event_timeout_usec, rules, &sigmask_orig);
|
||||||
|
+ udev_event_execute_rules(udev_event, event_timeout_usec, event_timeout_warn_usec, rules, &sigmask_orig);
|
||||||
|
|
||||||
|
- udev_event_execute_run(udev_event, event_timeout_usec, &sigmask_orig);
|
||||||
|
+ udev_event_execute_run(udev_event, event_timeout_usec, event_timeout_warn_usec, &sigmask_orig);
|
||||||
|
|
||||||
|
/* apply/restore inotify watch */
|
||||||
|
if (udev_event->inotify_watch) {
|
||||||
|
@@ -410,6 +412,7 @@ out:
|
||||||
|
worker->pid = pid;
|
||||||
|
worker->state = WORKER_RUNNING;
|
||||||
|
worker->event_start_usec = now(CLOCK_MONOTONIC);
|
||||||
|
+ worker->event_warned = false;
|
||||||
|
worker->event = event;
|
||||||
|
event->state = EVENT_RUNNING;
|
||||||
|
udev_list_node_append(&worker->node, &worker_list);
|
||||||
|
@@ -441,6 +444,7 @@ static void event_run(struct event *even
|
||||||
|
worker->event = event;
|
||||||
|
worker->state = WORKER_RUNNING;
|
||||||
|
worker->event_start_usec = now(CLOCK_MONOTONIC);
|
||||||
|
+ worker->event_warned = false;
|
||||||
|
event->state = EVENT_RUNNING;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
@@ -1016,6 +1020,7 @@ static void kernel_cmdline_options(struc
|
||||||
|
exec_delay = strtoul(opt + 16, NULL, 0);
|
||||||
|
} else if (startswith(opt, "udev.event-timeout=")) {
|
||||||
|
event_timeout_usec = strtoul(opt + 16, NULL, 0) * USEC_PER_SEC;
|
||||||
|
+ event_timeout_warn_usec = (event_timeout_usec / 3) ? : 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
free(s);
|
||||||
|
@@ -1078,6 +1083,7 @@ int main(int argc, char *argv[]) {
|
||||||
|
break;
|
||||||
|
case 't':
|
||||||
|
event_timeout_usec = strtoul(optarg, NULL, 0) * USEC_PER_SEC;
|
||||||
|
+ event_timeout_warn_usec = (event_timeout_usec / 3) ? : 1;
|
||||||
|
break;
|
||||||
|
case 'D':
|
||||||
|
debug = true;
|
||||||
|
@@ -1413,21 +1419,29 @@ int main(int argc, char *argv[]) {
|
||||||
|
/* check for hanging events */
|
||||||
|
udev_list_node_foreach(loop, &worker_list) {
|
||||||
|
struct worker *worker = node_to_worker(loop);
|
||||||
|
+ usec_t ts;
|
||||||
|
|
||||||
|
if (worker->state != WORKER_RUNNING)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
- if ((now(CLOCK_MONOTONIC) - worker->event_start_usec) > event_timeout_usec) {
|
||||||
|
- log_error("worker [%u] %s timeout; kill it", worker->pid, worker->event->devpath);
|
||||||
|
- kill(worker->pid, SIGKILL);
|
||||||
|
- worker->state = WORKER_KILLED;
|
||||||
|
-
|
||||||
|
- /* drop reference taken for state 'running' */
|
||||||
|
- worker_unref(worker);
|
||||||
|
- log_error("seq %llu '%s' killed", udev_device_get_seqnum(worker->event->dev), worker->event->devpath);
|
||||||
|
- worker->event->exitcode = -64;
|
||||||
|
- event_queue_delete(worker->event, true);
|
||||||
|
- worker->event = NULL;
|
||||||
|
+ ts = now(CLOCK_MONOTONIC);
|
||||||
|
+
|
||||||
|
+ if ((ts - worker->event_start_usec) > event_timeout_warn_usec) {
|
||||||
|
+ if ((ts - worker->event_start_usec) > event_timeout_usec) {
|
||||||
|
+ log_error("worker [%u] %s timeout; kill it", worker->pid, worker->event->devpath);
|
||||||
|
+ kill(worker->pid, SIGKILL);
|
||||||
|
+ worker->state = WORKER_KILLED;
|
||||||
|
+
|
||||||
|
+ /* drop reference taken for state 'running' */
|
||||||
|
+ worker_unref(worker);
|
||||||
|
+ log_error("seq %llu '%s' killed", udev_device_get_seqnum(worker->event->dev), worker->event->devpath);
|
||||||
|
+ worker->event->exitcode = -64;
|
||||||
|
+ event_queue_delete(worker->event, true);
|
||||||
|
+ worker->event = NULL;
|
||||||
|
+ } else if (!worker->event_warned) {
|
||||||
|
+ log_warning("worker [%u] %s is taking a long time", worker->pid, worker->event->devpath);
|
||||||
|
+ worker->event_warned = true;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
1.7.9.2
|
||||||
|
|
349
1078-udev-remove-userspace-firmware-loading-support.patch
Normal file
349
1078-udev-remove-userspace-firmware-loading-support.patch
Normal file
@ -0,0 +1,349 @@
|
|||||||
|
From be2ea723b1d023b3d385d3b791ee4607cbfb20ca Mon Sep 17 00:00:00 2001
|
||||||
|
From: Kay Sievers <kay@vrfy.org>
|
||||||
|
Date: Sat, 30 Aug 2014 11:34:20 +0200
|
||||||
|
Subject: [PATCH] udev: remove userspace firmware loading support
|
||||||
|
|
||||||
|
---
|
||||||
|
Makefile.am | 12 ---
|
||||||
|
README | 9 +--
|
||||||
|
TODO | 1 -
|
||||||
|
configure.ac | 20 -----
|
||||||
|
src/udev/udev-builtin-firmware.c | 154 ---------------------------------------
|
||||||
|
src/udev/udev-builtin.c | 3 -
|
||||||
|
src/udev/udev.h | 6 --
|
||||||
|
src/udev/udevd.c | 13 ----
|
||||||
|
|
||||||
|
Index: systemd-210/configure.ac
|
||||||
|
===================================================================
|
||||||
|
--- systemd-210.orig/configure.ac
|
||||||
|
+++ systemd-210/configure.ac
|
||||||
|
@@ -902,25 +902,6 @@ if test "x$have_myhostname" != "xno"; th
|
||||||
|
fi
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
-AC_ARG_WITH(firmware-path,
|
||||||
|
- AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]],
|
||||||
|
- [Firmware search path (default="")]),
|
||||||
|
- [], [with_firmware_path=""])
|
||||||
|
-OLD_IFS=$IFS
|
||||||
|
-IFS=:
|
||||||
|
-for i in $with_firmware_path; do
|
||||||
|
- if test "x${FIRMWARE_PATH}" = "x"; then
|
||||||
|
- FIRMWARE_PATH="\\\"${i}/\\\""
|
||||||
|
- else
|
||||||
|
- FIRMWARE_PATH="${FIRMWARE_PATH}, \\\"${i}/\\\""
|
||||||
|
- fi
|
||||||
|
-done
|
||||||
|
-IFS=$OLD_IFS
|
||||||
|
-AC_SUBST(FIRMWARE_PATH)
|
||||||
|
-AS_IF([test "x${FIRMWARE_PATH}" != "x"], [ AC_DEFINE(HAVE_FIRMWARE, 1, [Define if FIRMWARE is available]) ])
|
||||||
|
-AM_CONDITIONAL(ENABLE_FIRMWARE, [test "x${FIRMWARE_PATH}" != "x"])
|
||||||
|
-
|
||||||
|
-# ------------------------------------------------------------------------------
|
||||||
|
AC_ARG_ENABLE([gudev],
|
||||||
|
AS_HELP_STRING([--disable-gudev], [disable Gobject libudev support @<:@default=enabled@:>@]),
|
||||||
|
[], [enable_gudev=yes])
|
||||||
|
@@ -1137,7 +1118,6 @@ AC_MSG_RESULT([
|
||||||
|
Build Python: ${PYTHON}
|
||||||
|
Installation Python: ${PYTHON_BINARY}
|
||||||
|
sphinx binary: ${SPHINX_BUILD}
|
||||||
|
- firmware path: ${FIRMWARE_PATH}
|
||||||
|
PAM modules dir: ${with_pamlibdir}
|
||||||
|
PAM configuration dir: ${with_pamconfdir}
|
||||||
|
D-Bus policy dir: ${with_dbuspolicydir}
|
||||||
|
Index: systemd-210/Makefile.am
|
||||||
|
===================================================================
|
||||||
|
--- systemd-210.orig/Makefile.am
|
||||||
|
+++ systemd-210/Makefile.am
|
||||||
|
@@ -2677,18 +2677,6 @@ libudev_core_la_LIBADD = \
|
||||||
|
$(BLKID_LIBS) \
|
||||||
|
$(KMOD_LIBS)
|
||||||
|
|
||||||
|
-libudev_core_la_CPPFLAGS = \
|
||||||
|
- $(AM_CPPFLAGS) \
|
||||||
|
- -DFIRMWARE_PATH="$(FIRMWARE_PATH)"
|
||||||
|
-
|
||||||
|
-if ENABLE_FIRMWARE
|
||||||
|
-libudev_core_la_SOURCES += \
|
||||||
|
- src/udev/udev-builtin-firmware.c
|
||||||
|
-
|
||||||
|
-dist_udevrules_DATA += \
|
||||||
|
- rules/50-firmware.rules
|
||||||
|
-endif
|
||||||
|
-
|
||||||
|
if HAVE_KMOD
|
||||||
|
libudev_core_la_SOURCES += \
|
||||||
|
src/udev/udev-builtin-kmod.c
|
||||||
|
Index: systemd-210/README
|
||||||
|
===================================================================
|
||||||
|
--- systemd-210.orig/README
|
||||||
|
+++ systemd-210/README
|
||||||
|
@@ -51,14 +51,14 @@ REQUIREMENTS:
|
||||||
|
|
||||||
|
Linux kernel >= 3.8 for Smack support
|
||||||
|
|
||||||
|
- Udev will fail to work with the legacy layout:
|
||||||
|
+ Udev will fail to work with the legacy sysfs layout:
|
||||||
|
CONFIG_SYSFS_DEPRECATED=n
|
||||||
|
|
||||||
|
Legacy hotplug slows down the system and confuses udev:
|
||||||
|
CONFIG_UEVENT_HELPER_PATH=""
|
||||||
|
|
||||||
|
- Userspace firmware loading is deprecated, will go away, and
|
||||||
|
- sometimes causes problems:
|
||||||
|
+ Userspace firmware loading is not supported and should
|
||||||
|
+ be disabled in the kernel
|
||||||
|
CONFIG_FW_LOADER_USER_HELPER=n
|
||||||
|
|
||||||
|
Some udev rules and virtualization detection relies on it:
|
||||||
|
Index: systemd-210/src/udev/udev-builtin.c
|
||||||
|
===================================================================
|
||||||
|
--- systemd-210.orig/src/udev/udev-builtin.c
|
||||||
|
+++ systemd-210/src/udev/udev-builtin.c
|
||||||
|
@@ -34,9 +34,6 @@ static const struct udev_builtin *builti
|
||||||
|
[UDEV_BUILTIN_BLKID] = &udev_builtin_blkid,
|
||||||
|
#endif
|
||||||
|
[UDEV_BUILTIN_BTRFS] = &udev_builtin_btrfs,
|
||||||
|
-#ifdef HAVE_FIRMWARE
|
||||||
|
- [UDEV_BUILTIN_FIRMWARE] = &udev_builtin_firmware,
|
||||||
|
-#endif
|
||||||
|
[UDEV_BUILTIN_HWDB] = &udev_builtin_hwdb,
|
||||||
|
[UDEV_BUILTIN_INPUT_ID] = &udev_builtin_input_id,
|
||||||
|
[UDEV_BUILTIN_KEYBOARD] = &udev_builtin_keyboard,
|
||||||
|
Index: systemd-210/src/udev/udev-builtin-firmware.c
|
||||||
|
===================================================================
|
||||||
|
--- systemd-210.orig/src/udev/udev-builtin-firmware.c
|
||||||
|
+++ /dev/null
|
||||||
|
@@ -1,157 +0,0 @@
|
||||||
|
-/*
|
||||||
|
- * firmware - Kernel firmware loader
|
||||||
|
- *
|
||||||
|
- * Copyright (C) 2009 Piter Punk <piterpunk@slackware.com>
|
||||||
|
- * Copyright (C) 2009-2011 Kay Sievers <kay@vrfy.org>
|
||||||
|
- *
|
||||||
|
- * This program is free software; you can redistribute it and/or
|
||||||
|
- * modify it under the terms of the GNU General Public License as
|
||||||
|
- * published by the Free Software Foundation; either version 2 of the
|
||||||
|
- * License, or (at your option) any later version.
|
||||||
|
- *
|
||||||
|
- * This program is distributed in the hope that it will be useful, but
|
||||||
|
- * WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
- * General Public License for more details:*
|
||||||
|
- */
|
||||||
|
-
|
||||||
|
-#include <unistd.h>
|
||||||
|
-#include <stdlib.h>
|
||||||
|
-#include <string.h>
|
||||||
|
-#include <stdio.h>
|
||||||
|
-#include <getopt.h>
|
||||||
|
-#include <errno.h>
|
||||||
|
-#include <stdbool.h>
|
||||||
|
-#include <sys/utsname.h>
|
||||||
|
-#include <sys/stat.h>
|
||||||
|
-
|
||||||
|
-#include "udev.h"
|
||||||
|
-
|
||||||
|
-static bool set_loading(struct udev *udev, char *loadpath, const char *state)
|
||||||
|
-{
|
||||||
|
- FILE *ldfile;
|
||||||
|
-
|
||||||
|
- ldfile = fopen(loadpath, "we");
|
||||||
|
- if (ldfile == NULL) {
|
||||||
|
- log_error("error: can not open '%s'", loadpath);
|
||||||
|
- return false;
|
||||||
|
- };
|
||||||
|
- fprintf(ldfile, "%s\n", state);
|
||||||
|
- fclose(ldfile);
|
||||||
|
- return true;
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-static bool copy_firmware(struct udev *udev, const char *source, const char *target, size_t size)
|
||||||
|
-{
|
||||||
|
- char *buf;
|
||||||
|
- FILE *fsource = NULL, *ftarget = NULL;
|
||||||
|
- bool ret = false;
|
||||||
|
-
|
||||||
|
- buf = malloc(size);
|
||||||
|
- if (buf == NULL) {
|
||||||
|
- log_error("No memory available to load firmware file");
|
||||||
|
- return false;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- log_debug("writing '%s' (%zi) to '%s'", source, size, target);
|
||||||
|
-
|
||||||
|
- fsource = fopen(source, "re");
|
||||||
|
- if (fsource == NULL)
|
||||||
|
- goto exit;
|
||||||
|
- ftarget = fopen(target, "we");
|
||||||
|
- if (ftarget == NULL)
|
||||||
|
- goto exit;
|
||||||
|
- if (fread(buf, size, 1, fsource) != 1)
|
||||||
|
- goto exit;
|
||||||
|
- if (fwrite(buf, size, 1, ftarget) == 1)
|
||||||
|
- ret = true;
|
||||||
|
-exit:
|
||||||
|
- if (ftarget != NULL)
|
||||||
|
- fclose(ftarget);
|
||||||
|
- if (fsource != NULL)
|
||||||
|
- fclose(fsource);
|
||||||
|
- free(buf);
|
||||||
|
- return ret;
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-static int builtin_firmware(struct udev_device *dev, int argc, char *argv[], bool test)
|
||||||
|
-{
|
||||||
|
- struct udev *udev = udev_device_get_udev(dev);
|
||||||
|
- static const char *searchpath[] = { FIRMWARE_PATH };
|
||||||
|
- char loadpath[UTIL_PATH_SIZE];
|
||||||
|
- char datapath[UTIL_PATH_SIZE];
|
||||||
|
- char fwpath[UTIL_PATH_SIZE];
|
||||||
|
- const char *firmware;
|
||||||
|
- FILE *fwfile = NULL;
|
||||||
|
- struct utsname kernel;
|
||||||
|
- struct stat statbuf;
|
||||||
|
- unsigned int i;
|
||||||
|
- int rc = EXIT_SUCCESS;
|
||||||
|
-
|
||||||
|
- firmware = udev_device_get_property_value(dev, "FIRMWARE");
|
||||||
|
- if (firmware == NULL) {
|
||||||
|
- log_error("firmware parameter missing");
|
||||||
|
- rc = EXIT_FAILURE;
|
||||||
|
- goto exit;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- /* lookup firmware file */
|
||||||
|
- uname(&kernel);
|
||||||
|
- for (i = 0; i < ELEMENTSOF(searchpath); i++) {
|
||||||
|
- strscpyl(fwpath, sizeof(fwpath), searchpath[i], kernel.release, "/", firmware, NULL);
|
||||||
|
- fwfile = fopen(fwpath, "re");
|
||||||
|
- if (fwfile != NULL)
|
||||||
|
- break;
|
||||||
|
-
|
||||||
|
- strscpyl(fwpath, sizeof(fwpath), searchpath[i], firmware, NULL);
|
||||||
|
- fwfile = fopen(fwpath, "re");
|
||||||
|
- if (fwfile != NULL)
|
||||||
|
- break;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- strscpyl(loadpath, sizeof(loadpath), udev_device_get_syspath(dev), "/loading", NULL);
|
||||||
|
-
|
||||||
|
- if (fwfile == NULL) {
|
||||||
|
- log_debug("did not find firmware file '%s'", firmware);
|
||||||
|
- rc = EXIT_FAILURE;
|
||||||
|
- /*
|
||||||
|
- * Do not cancel the request in the initrd, the real root might have
|
||||||
|
- * the firmware file and the 'coldplug' run in the real root will find
|
||||||
|
- * this pending request and fulfill or cancel it.
|
||||||
|
- * */
|
||||||
|
- if (!in_initrd())
|
||||||
|
- set_loading(udev, loadpath, "-1");
|
||||||
|
- goto exit;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- if (stat(fwpath, &statbuf) < 0 || statbuf.st_size == 0) {
|
||||||
|
- if (!in_initrd())
|
||||||
|
- set_loading(udev, loadpath, "-1");
|
||||||
|
- rc = EXIT_FAILURE;
|
||||||
|
- goto exit;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- if (!set_loading(udev, loadpath, "1"))
|
||||||
|
- goto exit;
|
||||||
|
-
|
||||||
|
- strscpyl(datapath, sizeof(datapath), udev_device_get_syspath(dev), "/data", NULL);
|
||||||
|
- if (!copy_firmware(udev, fwpath, datapath, statbuf.st_size)) {
|
||||||
|
- log_error("error sending firmware '%s' to device", firmware);
|
||||||
|
- set_loading(udev, loadpath, "-1");
|
||||||
|
- rc = EXIT_FAILURE;
|
||||||
|
- goto exit;
|
||||||
|
- };
|
||||||
|
-
|
||||||
|
- set_loading(udev, loadpath, "0");
|
||||||
|
-exit:
|
||||||
|
- if (fwfile)
|
||||||
|
- fclose(fwfile);
|
||||||
|
- return rc;
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-const struct udev_builtin udev_builtin_firmware = {
|
||||||
|
- .name = "firmware",
|
||||||
|
- .cmd = builtin_firmware,
|
||||||
|
- .help = "kernel firmware loader",
|
||||||
|
- .run_once = true,
|
||||||
|
-};
|
||||||
|
Index: systemd-210/src/udev/udevd.c
|
||||||
|
===================================================================
|
||||||
|
--- systemd-210.orig/src/udev/udevd.c
|
||||||
|
+++ systemd-210/src/udev/udevd.c
|
||||||
|
@@ -100,9 +100,6 @@ struct event {
|
||||||
|
dev_t devnum;
|
||||||
|
int ifindex;
|
||||||
|
bool is_block;
|
||||||
|
-#ifdef HAVE_FIRMWARE
|
||||||
|
- bool nodelay;
|
||||||
|
-#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
static inline struct event *node_to_event(struct udev_list_node *node)
|
||||||
|
@@ -474,10 +471,6 @@ static int event_queue_insert(struct ude
|
||||||
|
event->devnum = udev_device_get_devnum(dev);
|
||||||
|
event->is_block = streq("block", udev_device_get_subsystem(dev));
|
||||||
|
event->ifindex = udev_device_get_ifindex(dev);
|
||||||
|
-#ifdef HAVE_FIRMWARE
|
||||||
|
- if (streq(udev_device_get_subsystem(dev), "firmware"))
|
||||||
|
- event->nodelay = true;
|
||||||
|
-#endif
|
||||||
|
|
||||||
|
udev_queue_export_device_queued(udev_queue_export, dev);
|
||||||
|
log_debug("seq %llu queued, '%s' '%s'", udev_device_get_seqnum(dev),
|
||||||
|
@@ -557,12 +550,6 @@ static bool is_devpath_busy(struct event
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
-#ifdef HAVE_FIRMWARE
|
||||||
|
- /* allow to bypass the dependency tracking */
|
||||||
|
- if (event->nodelay)
|
||||||
|
- continue;
|
||||||
|
-#endif
|
||||||
|
-
|
||||||
|
/* parent device event found */
|
||||||
|
if (event->devpath[common] == '/') {
|
||||||
|
event->delaying_seqnum = loop_event->seqnum;
|
||||||
|
Index: systemd-210/src/udev/udev.h
|
||||||
|
===================================================================
|
||||||
|
--- systemd-210.orig/src/udev/udev.h
|
||||||
|
+++ systemd-210/src/udev/udev.h
|
||||||
|
@@ -141,9 +141,6 @@ enum udev_builtin_cmd {
|
||||||
|
UDEV_BUILTIN_BLKID,
|
||||||
|
#endif
|
||||||
|
UDEV_BUILTIN_BTRFS,
|
||||||
|
-#ifdef HAVE_FIRMWARE
|
||||||
|
- UDEV_BUILTIN_FIRMWARE,
|
||||||
|
-#endif
|
||||||
|
UDEV_BUILTIN_HWDB,
|
||||||
|
UDEV_BUILTIN_INPUT_ID,
|
||||||
|
UDEV_BUILTIN_KEYBOARD,
|
||||||
|
@@ -172,9 +169,6 @@ struct udev_builtin {
|
||||||
|
extern const struct udev_builtin udev_builtin_blkid;
|
||||||
|
#endif
|
||||||
|
extern const struct udev_builtin udev_builtin_btrfs;
|
||||||
|
-#ifdef HAVE_FIRMWARE
|
||||||
|
-extern const struct udev_builtin udev_builtin_firmware;
|
||||||
|
-#endif
|
||||||
|
extern const struct udev_builtin udev_builtin_hwdb;
|
||||||
|
extern const struct udev_builtin udev_builtin_input_id;
|
||||||
|
extern const struct udev_builtin udev_builtin_keyboard;
|
||||||
|
Index: systemd-210/TODO
|
||||||
|
===================================================================
|
||||||
|
--- systemd-210.orig/TODO
|
||||||
|
+++ systemd-210/TODO
|
||||||
|
@@ -541,7 +541,6 @@ Features:
|
||||||
|
* ExecOnFailure=/usr/bin/foo
|
||||||
|
|
||||||
|
* udev:
|
||||||
|
- - remove src/udev/udev-builtin-firmware.c (CONFIG_FW_LOADER_USER_HELPER=n)
|
||||||
|
- move to LGPL
|
||||||
|
- kill scsi_id
|
||||||
|
- add trigger --subsystem-match=usb/usb_device device
|
||||||
|
|
349
1079-udev-remove-userspace-firmware-loading-support.patch
Normal file
349
1079-udev-remove-userspace-firmware-loading-support.patch
Normal file
@ -0,0 +1,349 @@
|
|||||||
|
From be2ea723b1d023b3d385d3b791ee4607cbfb20ca Mon Sep 17 00:00:00 2001
|
||||||
|
From: Kay Sievers <kay@vrfy.org>
|
||||||
|
Date: Sat, 30 Aug 2014 11:34:20 +0200
|
||||||
|
Subject: [PATCH] udev: remove userspace firmware loading support
|
||||||
|
|
||||||
|
---
|
||||||
|
Makefile.am | 12 ---
|
||||||
|
README | 9 +--
|
||||||
|
TODO | 1 -
|
||||||
|
configure.ac | 20 -----
|
||||||
|
src/udev/udev-builtin-firmware.c | 154 ---------------------------------------
|
||||||
|
src/udev/udev-builtin.c | 3 -
|
||||||
|
src/udev/udev.h | 6 --
|
||||||
|
src/udev/udevd.c | 13 ----
|
||||||
|
|
||||||
|
Index: systemd-210/configure.ac
|
||||||
|
===================================================================
|
||||||
|
--- systemd-210.orig/configure.ac
|
||||||
|
+++ systemd-210/configure.ac
|
||||||
|
@@ -902,25 +902,6 @@ if test "x$have_myhostname" != "xno"; th
|
||||||
|
fi
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
-AC_ARG_WITH(firmware-path,
|
||||||
|
- AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]],
|
||||||
|
- [Firmware search path (default="")]),
|
||||||
|
- [], [with_firmware_path=""])
|
||||||
|
-OLD_IFS=$IFS
|
||||||
|
-IFS=:
|
||||||
|
-for i in $with_firmware_path; do
|
||||||
|
- if test "x${FIRMWARE_PATH}" = "x"; then
|
||||||
|
- FIRMWARE_PATH="\\\"${i}/\\\""
|
||||||
|
- else
|
||||||
|
- FIRMWARE_PATH="${FIRMWARE_PATH}, \\\"${i}/\\\""
|
||||||
|
- fi
|
||||||
|
-done
|
||||||
|
-IFS=$OLD_IFS
|
||||||
|
-AC_SUBST(FIRMWARE_PATH)
|
||||||
|
-AS_IF([test "x${FIRMWARE_PATH}" != "x"], [ AC_DEFINE(HAVE_FIRMWARE, 1, [Define if FIRMWARE is available]) ])
|
||||||
|
-AM_CONDITIONAL(ENABLE_FIRMWARE, [test "x${FIRMWARE_PATH}" != "x"])
|
||||||
|
-
|
||||||
|
-# ------------------------------------------------------------------------------
|
||||||
|
AC_ARG_ENABLE([gudev],
|
||||||
|
AS_HELP_STRING([--disable-gudev], [disable Gobject libudev support @<:@default=enabled@:>@]),
|
||||||
|
[], [enable_gudev=yes])
|
||||||
|
@@ -1137,7 +1118,6 @@ AC_MSG_RESULT([
|
||||||
|
Build Python: ${PYTHON}
|
||||||
|
Installation Python: ${PYTHON_BINARY}
|
||||||
|
sphinx binary: ${SPHINX_BUILD}
|
||||||
|
- firmware path: ${FIRMWARE_PATH}
|
||||||
|
PAM modules dir: ${with_pamlibdir}
|
||||||
|
PAM configuration dir: ${with_pamconfdir}
|
||||||
|
D-Bus policy dir: ${with_dbuspolicydir}
|
||||||
|
Index: systemd-210/Makefile.am
|
||||||
|
===================================================================
|
||||||
|
--- systemd-210.orig/Makefile.am
|
||||||
|
+++ systemd-210/Makefile.am
|
||||||
|
@@ -2677,18 +2677,6 @@ libudev_core_la_LIBADD = \
|
||||||
|
$(BLKID_LIBS) \
|
||||||
|
$(KMOD_LIBS)
|
||||||
|
|
||||||
|
-libudev_core_la_CPPFLAGS = \
|
||||||
|
- $(AM_CPPFLAGS) \
|
||||||
|
- -DFIRMWARE_PATH="$(FIRMWARE_PATH)"
|
||||||
|
-
|
||||||
|
-if ENABLE_FIRMWARE
|
||||||
|
-libudev_core_la_SOURCES += \
|
||||||
|
- src/udev/udev-builtin-firmware.c
|
||||||
|
-
|
||||||
|
-dist_udevrules_DATA += \
|
||||||
|
- rules/50-firmware.rules
|
||||||
|
-endif
|
||||||
|
-
|
||||||
|
if HAVE_KMOD
|
||||||
|
libudev_core_la_SOURCES += \
|
||||||
|
src/udev/udev-builtin-kmod.c
|
||||||
|
Index: systemd-210/README
|
||||||
|
===================================================================
|
||||||
|
--- systemd-210.orig/README
|
||||||
|
+++ systemd-210/README
|
||||||
|
@@ -51,14 +51,14 @@ REQUIREMENTS:
|
||||||
|
|
||||||
|
Linux kernel >= 3.8 for Smack support
|
||||||
|
|
||||||
|
- Udev will fail to work with the legacy layout:
|
||||||
|
+ Udev will fail to work with the legacy sysfs layout:
|
||||||
|
CONFIG_SYSFS_DEPRECATED=n
|
||||||
|
|
||||||
|
Legacy hotplug slows down the system and confuses udev:
|
||||||
|
CONFIG_UEVENT_HELPER_PATH=""
|
||||||
|
|
||||||
|
- Userspace firmware loading is deprecated, will go away, and
|
||||||
|
- sometimes causes problems:
|
||||||
|
+ Userspace firmware loading is not supported and should
|
||||||
|
+ be disabled in the kernel
|
||||||
|
CONFIG_FW_LOADER_USER_HELPER=n
|
||||||
|
|
||||||
|
Some udev rules and virtualization detection relies on it:
|
||||||
|
Index: systemd-210/src/udev/udev-builtin.c
|
||||||
|
===================================================================
|
||||||
|
--- systemd-210.orig/src/udev/udev-builtin.c
|
||||||
|
+++ systemd-210/src/udev/udev-builtin.c
|
||||||
|
@@ -34,9 +34,6 @@ static const struct udev_builtin *builti
|
||||||
|
[UDEV_BUILTIN_BLKID] = &udev_builtin_blkid,
|
||||||
|
#endif
|
||||||
|
[UDEV_BUILTIN_BTRFS] = &udev_builtin_btrfs,
|
||||||
|
-#ifdef HAVE_FIRMWARE
|
||||||
|
- [UDEV_BUILTIN_FIRMWARE] = &udev_builtin_firmware,
|
||||||
|
-#endif
|
||||||
|
[UDEV_BUILTIN_HWDB] = &udev_builtin_hwdb,
|
||||||
|
[UDEV_BUILTIN_INPUT_ID] = &udev_builtin_input_id,
|
||||||
|
[UDEV_BUILTIN_KEYBOARD] = &udev_builtin_keyboard,
|
||||||
|
Index: systemd-210/src/udev/udev-builtin-firmware.c
|
||||||
|
===================================================================
|
||||||
|
--- systemd-210.orig/src/udev/udev-builtin-firmware.c
|
||||||
|
+++ /dev/null
|
||||||
|
@@ -1,157 +0,0 @@
|
||||||
|
-/*
|
||||||
|
- * firmware - Kernel firmware loader
|
||||||
|
- *
|
||||||
|
- * Copyright (C) 2009 Piter Punk <piterpunk@slackware.com>
|
||||||
|
- * Copyright (C) 2009-2011 Kay Sievers <kay@vrfy.org>
|
||||||
|
- *
|
||||||
|
- * This program is free software; you can redistribute it and/or
|
||||||
|
- * modify it under the terms of the GNU General Public License as
|
||||||
|
- * published by the Free Software Foundation; either version 2 of the
|
||||||
|
- * License, or (at your option) any later version.
|
||||||
|
- *
|
||||||
|
- * This program is distributed in the hope that it will be useful, but
|
||||||
|
- * WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
- * General Public License for more details:*
|
||||||
|
- */
|
||||||
|
-
|
||||||
|
-#include <unistd.h>
|
||||||
|
-#include <stdlib.h>
|
||||||
|
-#include <string.h>
|
||||||
|
-#include <stdio.h>
|
||||||
|
-#include <getopt.h>
|
||||||
|
-#include <errno.h>
|
||||||
|
-#include <stdbool.h>
|
||||||
|
-#include <sys/utsname.h>
|
||||||
|
-#include <sys/stat.h>
|
||||||
|
-
|
||||||
|
-#include "udev.h"
|
||||||
|
-
|
||||||
|
-static bool set_loading(struct udev *udev, char *loadpath, const char *state)
|
||||||
|
-{
|
||||||
|
- FILE *ldfile;
|
||||||
|
-
|
||||||
|
- ldfile = fopen(loadpath, "we");
|
||||||
|
- if (ldfile == NULL) {
|
||||||
|
- log_error("error: can not open '%s'", loadpath);
|
||||||
|
- return false;
|
||||||
|
- };
|
||||||
|
- fprintf(ldfile, "%s\n", state);
|
||||||
|
- fclose(ldfile);
|
||||||
|
- return true;
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-static bool copy_firmware(struct udev *udev, const char *source, const char *target, size_t size)
|
||||||
|
-{
|
||||||
|
- char *buf;
|
||||||
|
- FILE *fsource = NULL, *ftarget = NULL;
|
||||||
|
- bool ret = false;
|
||||||
|
-
|
||||||
|
- buf = malloc(size);
|
||||||
|
- if (buf == NULL) {
|
||||||
|
- log_error("No memory available to load firmware file");
|
||||||
|
- return false;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- log_debug("writing '%s' (%zi) to '%s'", source, size, target);
|
||||||
|
-
|
||||||
|
- fsource = fopen(source, "re");
|
||||||
|
- if (fsource == NULL)
|
||||||
|
- goto exit;
|
||||||
|
- ftarget = fopen(target, "we");
|
||||||
|
- if (ftarget == NULL)
|
||||||
|
- goto exit;
|
||||||
|
- if (fread(buf, size, 1, fsource) != 1)
|
||||||
|
- goto exit;
|
||||||
|
- if (fwrite(buf, size, 1, ftarget) == 1)
|
||||||
|
- ret = true;
|
||||||
|
-exit:
|
||||||
|
- if (ftarget != NULL)
|
||||||
|
- fclose(ftarget);
|
||||||
|
- if (fsource != NULL)
|
||||||
|
- fclose(fsource);
|
||||||
|
- free(buf);
|
||||||
|
- return ret;
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-static int builtin_firmware(struct udev_device *dev, int argc, char *argv[], bool test)
|
||||||
|
-{
|
||||||
|
- struct udev *udev = udev_device_get_udev(dev);
|
||||||
|
- static const char *searchpath[] = { FIRMWARE_PATH };
|
||||||
|
- char loadpath[UTIL_PATH_SIZE];
|
||||||
|
- char datapath[UTIL_PATH_SIZE];
|
||||||
|
- char fwpath[UTIL_PATH_SIZE];
|
||||||
|
- const char *firmware;
|
||||||
|
- FILE *fwfile = NULL;
|
||||||
|
- struct utsname kernel;
|
||||||
|
- struct stat statbuf;
|
||||||
|
- unsigned int i;
|
||||||
|
- int rc = EXIT_SUCCESS;
|
||||||
|
-
|
||||||
|
- firmware = udev_device_get_property_value(dev, "FIRMWARE");
|
||||||
|
- if (firmware == NULL) {
|
||||||
|
- log_error("firmware parameter missing");
|
||||||
|
- rc = EXIT_FAILURE;
|
||||||
|
- goto exit;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- /* lookup firmware file */
|
||||||
|
- uname(&kernel);
|
||||||
|
- for (i = 0; i < ELEMENTSOF(searchpath); i++) {
|
||||||
|
- strscpyl(fwpath, sizeof(fwpath), searchpath[i], kernel.release, "/", firmware, NULL);
|
||||||
|
- fwfile = fopen(fwpath, "re");
|
||||||
|
- if (fwfile != NULL)
|
||||||
|
- break;
|
||||||
|
-
|
||||||
|
- strscpyl(fwpath, sizeof(fwpath), searchpath[i], firmware, NULL);
|
||||||
|
- fwfile = fopen(fwpath, "re");
|
||||||
|
- if (fwfile != NULL)
|
||||||
|
- break;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- strscpyl(loadpath, sizeof(loadpath), udev_device_get_syspath(dev), "/loading", NULL);
|
||||||
|
-
|
||||||
|
- if (fwfile == NULL) {
|
||||||
|
- log_debug("did not find firmware file '%s'", firmware);
|
||||||
|
- rc = EXIT_FAILURE;
|
||||||
|
- /*
|
||||||
|
- * Do not cancel the request in the initrd, the real root might have
|
||||||
|
- * the firmware file and the 'coldplug' run in the real root will find
|
||||||
|
- * this pending request and fulfill or cancel it.
|
||||||
|
- * */
|
||||||
|
- if (!in_initrd())
|
||||||
|
- set_loading(udev, loadpath, "-1");
|
||||||
|
- goto exit;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- if (stat(fwpath, &statbuf) < 0 || statbuf.st_size == 0) {
|
||||||
|
- if (!in_initrd())
|
||||||
|
- set_loading(udev, loadpath, "-1");
|
||||||
|
- rc = EXIT_FAILURE;
|
||||||
|
- goto exit;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- if (!set_loading(udev, loadpath, "1"))
|
||||||
|
- goto exit;
|
||||||
|
-
|
||||||
|
- strscpyl(datapath, sizeof(datapath), udev_device_get_syspath(dev), "/data", NULL);
|
||||||
|
- if (!copy_firmware(udev, fwpath, datapath, statbuf.st_size)) {
|
||||||
|
- log_error("error sending firmware '%s' to device", firmware);
|
||||||
|
- set_loading(udev, loadpath, "-1");
|
||||||
|
- rc = EXIT_FAILURE;
|
||||||
|
- goto exit;
|
||||||
|
- };
|
||||||
|
-
|
||||||
|
- set_loading(udev, loadpath, "0");
|
||||||
|
-exit:
|
||||||
|
- if (fwfile)
|
||||||
|
- fclose(fwfile);
|
||||||
|
- return rc;
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-const struct udev_builtin udev_builtin_firmware = {
|
||||||
|
- .name = "firmware",
|
||||||
|
- .cmd = builtin_firmware,
|
||||||
|
- .help = "kernel firmware loader",
|
||||||
|
- .run_once = true,
|
||||||
|
-};
|
||||||
|
Index: systemd-210/src/udev/udevd.c
|
||||||
|
===================================================================
|
||||||
|
--- systemd-210.orig/src/udev/udevd.c
|
||||||
|
+++ systemd-210/src/udev/udevd.c
|
||||||
|
@@ -100,9 +100,6 @@ struct event {
|
||||||
|
dev_t devnum;
|
||||||
|
int ifindex;
|
||||||
|
bool is_block;
|
||||||
|
-#ifdef HAVE_FIRMWARE
|
||||||
|
- bool nodelay;
|
||||||
|
-#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
static inline struct event *node_to_event(struct udev_list_node *node)
|
||||||
|
@@ -474,10 +471,6 @@ static int event_queue_insert(struct ude
|
||||||
|
event->devnum = udev_device_get_devnum(dev);
|
||||||
|
event->is_block = streq("block", udev_device_get_subsystem(dev));
|
||||||
|
event->ifindex = udev_device_get_ifindex(dev);
|
||||||
|
-#ifdef HAVE_FIRMWARE
|
||||||
|
- if (streq(udev_device_get_subsystem(dev), "firmware"))
|
||||||
|
- event->nodelay = true;
|
||||||
|
-#endif
|
||||||
|
|
||||||
|
log_debug("seq %llu queued, '%s' '%s'", udev_device_get_seqnum(dev),
|
||||||
|
udev_device_get_action(dev), udev_device_get_subsystem(dev));
|
||||||
|
@@ -557,12 +550,6 @@ static bool is_devpath_busy(struct event
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
-#ifdef HAVE_FIRMWARE
|
||||||
|
- /* allow to bypass the dependency tracking */
|
||||||
|
- if (event->nodelay)
|
||||||
|
- continue;
|
||||||
|
-#endif
|
||||||
|
-
|
||||||
|
/* parent device event found */
|
||||||
|
if (event->devpath[common] == '/') {
|
||||||
|
event->delaying_seqnum = loop_event->seqnum;
|
||||||
|
Index: systemd-210/src/udev/udev.h
|
||||||
|
===================================================================
|
||||||
|
--- systemd-210.orig/src/udev/udev.h
|
||||||
|
+++ systemd-210/src/udev/udev.h
|
||||||
|
@@ -141,9 +141,6 @@ enum udev_builtin_cmd {
|
||||||
|
UDEV_BUILTIN_BLKID,
|
||||||
|
#endif
|
||||||
|
UDEV_BUILTIN_BTRFS,
|
||||||
|
-#ifdef HAVE_FIRMWARE
|
||||||
|
- UDEV_BUILTIN_FIRMWARE,
|
||||||
|
-#endif
|
||||||
|
UDEV_BUILTIN_HWDB,
|
||||||
|
UDEV_BUILTIN_INPUT_ID,
|
||||||
|
UDEV_BUILTIN_KEYBOARD,
|
||||||
|
@@ -172,9 +169,6 @@ struct udev_builtin {
|
||||||
|
extern const struct udev_builtin udev_builtin_blkid;
|
||||||
|
#endif
|
||||||
|
extern const struct udev_builtin udev_builtin_btrfs;
|
||||||
|
-#ifdef HAVE_FIRMWARE
|
||||||
|
-extern const struct udev_builtin udev_builtin_firmware;
|
||||||
|
-#endif
|
||||||
|
extern const struct udev_builtin udev_builtin_hwdb;
|
||||||
|
extern const struct udev_builtin udev_builtin_input_id;
|
||||||
|
extern const struct udev_builtin udev_builtin_keyboard;
|
||||||
|
Index: systemd-210/TODO
|
||||||
|
===================================================================
|
||||||
|
--- systemd-210.orig/TODO
|
||||||
|
+++ systemd-210/TODO
|
||||||
|
@@ -541,7 +541,6 @@ Features:
|
||||||
|
* ExecOnFailure=/usr/bin/foo
|
||||||
|
|
||||||
|
* udev:
|
||||||
|
- - remove src/udev/udev-builtin-firmware.c (CONFIG_FW_LOADER_USER_HELPER=n)
|
||||||
|
- move to LGPL
|
||||||
|
- kill scsi_id
|
||||||
|
- add trigger --subsystem-match=usb/usb_device device
|
||||||
|
|
@ -1,3 +1,63 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Sep 16 10:45:33 UTC 2014 - werner@suse.de
|
||||||
|
|
||||||
|
- Add upstream patches as real fixes
|
||||||
|
0001-activate-fix-fd-leak-in-do_accept.patch
|
||||||
|
0002-analyze-avoid-a-null-dereference.patch
|
||||||
|
0003-analyze-fix-mem-leak.patch
|
||||||
|
0004-backlight-Avoid-error-when-state-restore-is-disabled.patch
|
||||||
|
0005-bus-avoid-using-m-kdbus-after-freeing-it.patch
|
||||||
|
0006-bus-unref-buscreds-on-failure.patch
|
||||||
|
0007-core-fix-a-potential-mem-leak.patch
|
||||||
|
0008-core-smack-setup-Actually-allow-for-succesfully-load.patch
|
||||||
|
0009-journal-do-not-leak-mmaps-on-OOM.patch
|
||||||
|
0010-manager-use-correct-cleanup-function.patch
|
||||||
|
- Intergrate the work of Robert and rename the patch
|
||||||
|
1068-udev-remove-userspace-firmware-loading-support.patch
|
||||||
|
to 1078-udev-remove-userspace-firmware-loading-support.patch
|
||||||
|
Also add patch
|
||||||
|
1079-udev-remove-userspace-firmware-loading-support.patch
|
||||||
|
to apply the same change for opensuse 13.2 and above
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Sep 16 10:21:02 UTC 2014 - werner@suse.de
|
||||||
|
|
||||||
|
- Add upstream patch
|
||||||
|
0001-systemctl-allow-to-change-the-default-target-without.patch
|
||||||
|
to allow to override default target without --force (bnc#896664)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Sep 16 09:10:52 UTC 2014 - werner@suse.de
|
||||||
|
|
||||||
|
- Add upstream patches for udev
|
||||||
|
1068-udev-net_setup_link-export-the-.link-filename-applie.patch
|
||||||
|
1069-rules-net-setup-link-preserve-ID_NET_LINK_FILE-and-I.patch
|
||||||
|
1070-rules-net-setup-link-remove-stray-linebreak.patch
|
||||||
|
1071-udev-import-the-full-db-on-MOVE-events-for-devices-w.patch
|
||||||
|
1072-udev-netif_rename-don-t-log-to-kmsg.patch
|
||||||
|
1073-udev-drop-print_kmsg.patch
|
||||||
|
1074-udev-fix-copy-paste-error-in-log-message.patch
|
||||||
|
1075-udev-timeout-increase-timeout.patch (bnc#889297)
|
||||||
|
1076-udev-timeout-warn-after-a-third-of-the-timeout-befor.patch (bnc#889297)
|
||||||
|
1077-udev-timeout-warn-after-a-third-of-the-timeout-befor.patch (bnc#889297)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Sep 16 07:55:37 UTC 2014 - rmilasan@suse.com
|
||||||
|
|
||||||
|
- udev: remove userspace firmware loading support (bnc#889297).
|
||||||
|
Add 1068-udev-remove-userspace-firmware-loading-support.patch
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Sat Sep 13 13:35:33 UTC 2014 - rmilasan@suse.com
|
||||||
|
|
||||||
|
- udev: always resolve correctly database names on 'change' event (bnc#864745).
|
||||||
|
Add 1067-udev-always-resolve-correctly-database-names-on-chan.patch
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Sep 9 14:36:20 UTC 2014 - werner@suse.de
|
||||||
|
|
||||||
|
- Add upstream patch 0009-hwdb-update.patch
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Sep 8 14:48:37 UTC 2014 - werner@suse.de
|
Mon Sep 8 14:48:37 UTC 2014 - werner@suse.de
|
||||||
|
|
||||||
|
@ -832,6 +832,30 @@ Patch400: 0001-login-simplify-controller-handling.patch
|
|||||||
Patch401: 0001-initrd-parse-etc.service-ignore-return-code-of-daemo.patch
|
Patch401: 0001-initrd-parse-etc.service-ignore-return-code-of-daemo.patch
|
||||||
# PATCH-FIX-UPSTREAM added at 2014/09/08
|
# PATCH-FIX-UPSTREAM added at 2014/09/08
|
||||||
Patch402: 0008-hwdb-Update-database-of-Bluetooth-company-identifier.patch
|
Patch402: 0008-hwdb-Update-database-of-Bluetooth-company-identifier.patch
|
||||||
|
# PATCH-FIX-UPSTREAM added at 2014/09/09
|
||||||
|
Patch403: 0009-hwdb-update.patch
|
||||||
|
# PATCH-FIX-UPSTREAM bnc896664: Allow to override default target without --force
|
||||||
|
Patch404: 0001-systemctl-allow-to-change-the-default-target-without.patch
|
||||||
|
# PATCH-FIX-UPSTREAM added at 2014/09/16
|
||||||
|
Patch405: 0001-activate-fix-fd-leak-in-do_accept.patch
|
||||||
|
# PATCH-FIX-UPSTREAM added at 2014/09/16
|
||||||
|
Patch406: 0002-analyze-avoid-a-null-dereference.patch
|
||||||
|
# PATCH-FIX-UPSTREAM added at 2014/09/16
|
||||||
|
Patch407: 0003-analyze-fix-mem-leak.patch
|
||||||
|
# PATCH-FIX-UPSTREAM added at 2014/09/16
|
||||||
|
Patch408: 0004-backlight-Avoid-error-when-state-restore-is-disabled.patch
|
||||||
|
# PATCH-FIX-UPSTREAM added at 2014/09/16
|
||||||
|
Patch409: 0005-bus-avoid-using-m-kdbus-after-freeing-it.patch
|
||||||
|
# PATCH-FIX-UPSTREAM added at 2014/09/16
|
||||||
|
Patch410: 0006-bus-unref-buscreds-on-failure.patch
|
||||||
|
# PATCH-FIX-UPSTREAM added at 2014/09/16
|
||||||
|
Patch411: 0007-core-fix-a-potential-mem-leak.patch
|
||||||
|
# PATCH-FIX-UPSTREAM added at 2014/09/16
|
||||||
|
Patch412: 0008-core-smack-setup-Actually-allow-for-succesfully-load.patch
|
||||||
|
# PATCH-FIX-UPSTREAM added at 2014/09/16
|
||||||
|
Patch413: 0009-journal-do-not-leak-mmaps-on-OOM.patch
|
||||||
|
# PATCH-FIX-UPSTREAM added at 2014/09/16
|
||||||
|
Patch414: 0010-manager-use-correct-cleanup-function.patch
|
||||||
|
|
||||||
# UDEV PATCHES
|
# UDEV PATCHES
|
||||||
# ============
|
# ============
|
||||||
@ -971,6 +995,32 @@ Patch1064: 1064-udev-hwdb-do-not-look-at-usb_device-parents.patch
|
|||||||
Patch1065: 1065-udev-bump-event-timeout-to-60-seconds.patch
|
Patch1065: 1065-udev-bump-event-timeout-to-60-seconds.patch
|
||||||
# PATCH-FIX-SUSE 1066-udev-add-compatibility-links-for-truncated-by-id-links.patch (bnc#886852)
|
# PATCH-FIX-SUSE 1066-udev-add-compatibility-links-for-truncated-by-id-links.patch (bnc#886852)
|
||||||
Patch1066: 1066-udev-add-compatibility-links-for-truncated-by-id-links.patch
|
Patch1066: 1066-udev-add-compatibility-links-for-truncated-by-id-links.patch
|
||||||
|
# PATCH-FIX-UPSTREAM 1067-udev-always-resolve-correctly-database-names-on-chan.patch (bnc#864745)
|
||||||
|
Patch1067: 1067-udev-always-resolve-correctly-database-names-on-chan.patch
|
||||||
|
# PATCH-FIX-UPSTREAM 1068-udev-net_setup_link-export-the-.link-filename-applie.patch
|
||||||
|
Patch1068: 1068-udev-net_setup_link-export-the-.link-filename-applie.patch
|
||||||
|
# PATCH-FIX-UPSTREAM 1069-rules-net-setup-link-preserve-ID_NET_LINK_FILE-and-I.patch
|
||||||
|
Patch1069: 1069-rules-net-setup-link-preserve-ID_NET_LINK_FILE-and-I.patch
|
||||||
|
# PATCH-FIX-UPSTREAM 1070-rules-net-setup-link-remove-stray-linebreak.patch
|
||||||
|
Patch1070: 1070-rules-net-setup-link-remove-stray-linebreak.patch
|
||||||
|
# PATCH-FIX-UPSTREAM 1071-udev-import-the-full-db-on-MOVE-events-for-devices-w.patch
|
||||||
|
Patch1071: 1071-udev-import-the-full-db-on-MOVE-events-for-devices-w.patch
|
||||||
|
# PATCH-FIX-UPSTREAM 1072-udev-netif_rename-don-t-log-to-kmsg.patch
|
||||||
|
Patch1072: 1072-udev-netif_rename-don-t-log-to-kmsg.patch
|
||||||
|
# PATCH-FIX-UPSTREAM 1073-udev-drop-print_kmsg.patch
|
||||||
|
Patch1073: 1073-udev-drop-print_kmsg.patch
|
||||||
|
# PATCH-FIX-UPSTREAM 1074-udev-fix-copy-paste-error-in-log-message.patch
|
||||||
|
Patch1074: 1074-udev-fix-copy-paste-error-in-log-message.patch
|
||||||
|
# PATCH-FIX-UPSTREAM 1075-udev-timeout-increase-timeout.patch
|
||||||
|
Patch1075: 1075-udev-timeout-increase-timeout.patch
|
||||||
|
# PATCH-FIX-UPSTREAM 1076-udev-timeout-warn-after-a-third-of-the-timeout-befor.patch
|
||||||
|
Patch1076: 1076-udev-timeout-warn-after-a-third-of-the-timeout-befor.patch
|
||||||
|
# PATCH-FIX-UPSTREAM 1077-udev-timeout-warn-after-a-third-of-the-timeout-befor.patch
|
||||||
|
Patch1077: 1077-udev-timeout-warn-after-a-third-of-the-timeout-befor.patch
|
||||||
|
# PATCH-FIX-UPSTREAM 1078-udev-remove-userspace-firmware-loading-support.patch
|
||||||
|
Patch1078: 1078-udev-remove-userspace-firmware-loading-support.patch
|
||||||
|
# PATCH-FIX-UPSTREAM 1079-udev-remove-userspace-firmware-loading-support.patch
|
||||||
|
Patch1079: 1079-udev-remove-userspace-firmware-loading-support.patch
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Systemd is a system and service manager, compatible with SysV and LSB
|
Systemd is a system and service manager, compatible with SysV and LSB
|
||||||
@ -1534,6 +1584,18 @@ cp %{SOURCE7} m4/
|
|||||||
%patch400 -p0
|
%patch400 -p0
|
||||||
%patch401 -p0
|
%patch401 -p0
|
||||||
%patch402 -p0
|
%patch402 -p0
|
||||||
|
%patch403 -p0
|
||||||
|
%patch404 -p0
|
||||||
|
%patch405 -p0
|
||||||
|
%patch406 -p0
|
||||||
|
%patch407 -p0
|
||||||
|
%patch408 -p0
|
||||||
|
%patch409 -p0
|
||||||
|
%patch410 -p0
|
||||||
|
%patch411 -p0
|
||||||
|
%patch412 -p0
|
||||||
|
%patch413 -p0
|
||||||
|
%patch414 -p0
|
||||||
|
|
||||||
# udev patches
|
# udev patches
|
||||||
%patch1001 -p1
|
%patch1001 -p1
|
||||||
@ -1623,6 +1685,27 @@ cp %{SOURCE7} m4/
|
|||||||
%patch1064 -p0
|
%patch1064 -p0
|
||||||
%patch1065 -p0
|
%patch1065 -p0
|
||||||
%patch1066 -p1
|
%patch1066 -p1
|
||||||
|
%patch1067 -p1
|
||||||
|
%patch1068 -p0
|
||||||
|
%patch1069 -p0
|
||||||
|
%patch1070 -p0
|
||||||
|
%patch1071 -p0
|
||||||
|
%patch1072 -p0
|
||||||
|
%patch1073 -p0
|
||||||
|
%patch1074 -p0
|
||||||
|
%patch1075 -p0
|
||||||
|
%if %{with udevsettle}
|
||||||
|
%patch1076 -p0
|
||||||
|
%else
|
||||||
|
%patch1077 -p0
|
||||||
|
%endif
|
||||||
|
%if 0%{?suse_version} > 1310
|
||||||
|
%if %{with udevsettle}
|
||||||
|
%patch1079 -p1
|
||||||
|
%else
|
||||||
|
%patch1078 -p1
|
||||||
|
%endif
|
||||||
|
%endif
|
||||||
|
|
||||||
# remove patch backups
|
# remove patch backups
|
||||||
find -name '*.orig' -exec rm -f '{}' \+
|
find -name '*.orig' -exec rm -f '{}' \+
|
||||||
|
@ -1,3 +1,63 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Sep 16 10:45:33 UTC 2014 - werner@suse.de
|
||||||
|
|
||||||
|
- Add upstream patches as real fixes
|
||||||
|
0001-activate-fix-fd-leak-in-do_accept.patch
|
||||||
|
0002-analyze-avoid-a-null-dereference.patch
|
||||||
|
0003-analyze-fix-mem-leak.patch
|
||||||
|
0004-backlight-Avoid-error-when-state-restore-is-disabled.patch
|
||||||
|
0005-bus-avoid-using-m-kdbus-after-freeing-it.patch
|
||||||
|
0006-bus-unref-buscreds-on-failure.patch
|
||||||
|
0007-core-fix-a-potential-mem-leak.patch
|
||||||
|
0008-core-smack-setup-Actually-allow-for-succesfully-load.patch
|
||||||
|
0009-journal-do-not-leak-mmaps-on-OOM.patch
|
||||||
|
0010-manager-use-correct-cleanup-function.patch
|
||||||
|
- Intergrate the work of Robert and rename the patch
|
||||||
|
1068-udev-remove-userspace-firmware-loading-support.patch
|
||||||
|
to 1078-udev-remove-userspace-firmware-loading-support.patch
|
||||||
|
Also add patch
|
||||||
|
1079-udev-remove-userspace-firmware-loading-support.patch
|
||||||
|
to apply the same change for opensuse 13.2 and above
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Sep 16 10:21:02 UTC 2014 - werner@suse.de
|
||||||
|
|
||||||
|
- Add upstream patch
|
||||||
|
0001-systemctl-allow-to-change-the-default-target-without.patch
|
||||||
|
to allow to override default target without --force (bnc#896664)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Sep 16 09:10:52 UTC 2014 - werner@suse.de
|
||||||
|
|
||||||
|
- Add upstream patches for udev
|
||||||
|
1068-udev-net_setup_link-export-the-.link-filename-applie.patch
|
||||||
|
1069-rules-net-setup-link-preserve-ID_NET_LINK_FILE-and-I.patch
|
||||||
|
1070-rules-net-setup-link-remove-stray-linebreak.patch
|
||||||
|
1071-udev-import-the-full-db-on-MOVE-events-for-devices-w.patch
|
||||||
|
1072-udev-netif_rename-don-t-log-to-kmsg.patch
|
||||||
|
1073-udev-drop-print_kmsg.patch
|
||||||
|
1074-udev-fix-copy-paste-error-in-log-message.patch
|
||||||
|
1075-udev-timeout-increase-timeout.patch (bnc#889297)
|
||||||
|
1076-udev-timeout-warn-after-a-third-of-the-timeout-befor.patch (bnc#889297)
|
||||||
|
1077-udev-timeout-warn-after-a-third-of-the-timeout-befor.patch (bnc#889297)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Sep 16 07:55:37 UTC 2014 - rmilasan@suse.com
|
||||||
|
|
||||||
|
- udev: remove userspace firmware loading support (bnc#889297).
|
||||||
|
Add 1068-udev-remove-userspace-firmware-loading-support.patch
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Sat Sep 13 13:35:33 UTC 2014 - rmilasan@suse.com
|
||||||
|
|
||||||
|
- udev: always resolve correctly database names on 'change' event (bnc#864745).
|
||||||
|
Add 1067-udev-always-resolve-correctly-database-names-on-chan.patch
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Sep 9 14:36:20 UTC 2014 - werner@suse.de
|
||||||
|
|
||||||
|
- Add upstream patch 0009-hwdb-update.patch
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Sep 8 14:48:37 UTC 2014 - werner@suse.de
|
Mon Sep 8 14:48:37 UTC 2014 - werner@suse.de
|
||||||
|
|
||||||
|
83
systemd.spec
83
systemd.spec
@ -827,6 +827,30 @@ Patch400: 0001-login-simplify-controller-handling.patch
|
|||||||
Patch401: 0001-initrd-parse-etc.service-ignore-return-code-of-daemo.patch
|
Patch401: 0001-initrd-parse-etc.service-ignore-return-code-of-daemo.patch
|
||||||
# PATCH-FIX-UPSTREAM added at 2014/09/08
|
# PATCH-FIX-UPSTREAM added at 2014/09/08
|
||||||
Patch402: 0008-hwdb-Update-database-of-Bluetooth-company-identifier.patch
|
Patch402: 0008-hwdb-Update-database-of-Bluetooth-company-identifier.patch
|
||||||
|
# PATCH-FIX-UPSTREAM added at 2014/09/09
|
||||||
|
Patch403: 0009-hwdb-update.patch
|
||||||
|
# PATCH-FIX-UPSTREAM bnc896664: Allow to override default target without --force
|
||||||
|
Patch404: 0001-systemctl-allow-to-change-the-default-target-without.patch
|
||||||
|
# PATCH-FIX-UPSTREAM added at 2014/09/16
|
||||||
|
Patch405: 0001-activate-fix-fd-leak-in-do_accept.patch
|
||||||
|
# PATCH-FIX-UPSTREAM added at 2014/09/16
|
||||||
|
Patch406: 0002-analyze-avoid-a-null-dereference.patch
|
||||||
|
# PATCH-FIX-UPSTREAM added at 2014/09/16
|
||||||
|
Patch407: 0003-analyze-fix-mem-leak.patch
|
||||||
|
# PATCH-FIX-UPSTREAM added at 2014/09/16
|
||||||
|
Patch408: 0004-backlight-Avoid-error-when-state-restore-is-disabled.patch
|
||||||
|
# PATCH-FIX-UPSTREAM added at 2014/09/16
|
||||||
|
Patch409: 0005-bus-avoid-using-m-kdbus-after-freeing-it.patch
|
||||||
|
# PATCH-FIX-UPSTREAM added at 2014/09/16
|
||||||
|
Patch410: 0006-bus-unref-buscreds-on-failure.patch
|
||||||
|
# PATCH-FIX-UPSTREAM added at 2014/09/16
|
||||||
|
Patch411: 0007-core-fix-a-potential-mem-leak.patch
|
||||||
|
# PATCH-FIX-UPSTREAM added at 2014/09/16
|
||||||
|
Patch412: 0008-core-smack-setup-Actually-allow-for-succesfully-load.patch
|
||||||
|
# PATCH-FIX-UPSTREAM added at 2014/09/16
|
||||||
|
Patch413: 0009-journal-do-not-leak-mmaps-on-OOM.patch
|
||||||
|
# PATCH-FIX-UPSTREAM added at 2014/09/16
|
||||||
|
Patch414: 0010-manager-use-correct-cleanup-function.patch
|
||||||
|
|
||||||
# UDEV PATCHES
|
# UDEV PATCHES
|
||||||
# ============
|
# ============
|
||||||
@ -966,6 +990,32 @@ Patch1064: 1064-udev-hwdb-do-not-look-at-usb_device-parents.patch
|
|||||||
Patch1065: 1065-udev-bump-event-timeout-to-60-seconds.patch
|
Patch1065: 1065-udev-bump-event-timeout-to-60-seconds.patch
|
||||||
# PATCH-FIX-SUSE 1066-udev-add-compatibility-links-for-truncated-by-id-links.patch (bnc#886852)
|
# PATCH-FIX-SUSE 1066-udev-add-compatibility-links-for-truncated-by-id-links.patch (bnc#886852)
|
||||||
Patch1066: 1066-udev-add-compatibility-links-for-truncated-by-id-links.patch
|
Patch1066: 1066-udev-add-compatibility-links-for-truncated-by-id-links.patch
|
||||||
|
# PATCH-FIX-UPSTREAM 1067-udev-always-resolve-correctly-database-names-on-chan.patch (bnc#864745)
|
||||||
|
Patch1067: 1067-udev-always-resolve-correctly-database-names-on-chan.patch
|
||||||
|
# PATCH-FIX-UPSTREAM 1068-udev-net_setup_link-export-the-.link-filename-applie.patch
|
||||||
|
Patch1068: 1068-udev-net_setup_link-export-the-.link-filename-applie.patch
|
||||||
|
# PATCH-FIX-UPSTREAM 1069-rules-net-setup-link-preserve-ID_NET_LINK_FILE-and-I.patch
|
||||||
|
Patch1069: 1069-rules-net-setup-link-preserve-ID_NET_LINK_FILE-and-I.patch
|
||||||
|
# PATCH-FIX-UPSTREAM 1070-rules-net-setup-link-remove-stray-linebreak.patch
|
||||||
|
Patch1070: 1070-rules-net-setup-link-remove-stray-linebreak.patch
|
||||||
|
# PATCH-FIX-UPSTREAM 1071-udev-import-the-full-db-on-MOVE-events-for-devices-w.patch
|
||||||
|
Patch1071: 1071-udev-import-the-full-db-on-MOVE-events-for-devices-w.patch
|
||||||
|
# PATCH-FIX-UPSTREAM 1072-udev-netif_rename-don-t-log-to-kmsg.patch
|
||||||
|
Patch1072: 1072-udev-netif_rename-don-t-log-to-kmsg.patch
|
||||||
|
# PATCH-FIX-UPSTREAM 1073-udev-drop-print_kmsg.patch
|
||||||
|
Patch1073: 1073-udev-drop-print_kmsg.patch
|
||||||
|
# PATCH-FIX-UPSTREAM 1074-udev-fix-copy-paste-error-in-log-message.patch
|
||||||
|
Patch1074: 1074-udev-fix-copy-paste-error-in-log-message.patch
|
||||||
|
# PATCH-FIX-UPSTREAM 1075-udev-timeout-increase-timeout.patch
|
||||||
|
Patch1075: 1075-udev-timeout-increase-timeout.patch
|
||||||
|
# PATCH-FIX-UPSTREAM 1076-udev-timeout-warn-after-a-third-of-the-timeout-befor.patch
|
||||||
|
Patch1076: 1076-udev-timeout-warn-after-a-third-of-the-timeout-befor.patch
|
||||||
|
# PATCH-FIX-UPSTREAM 1077-udev-timeout-warn-after-a-third-of-the-timeout-befor.patch
|
||||||
|
Patch1077: 1077-udev-timeout-warn-after-a-third-of-the-timeout-befor.patch
|
||||||
|
# PATCH-FIX-UPSTREAM 1078-udev-remove-userspace-firmware-loading-support.patch
|
||||||
|
Patch1078: 1078-udev-remove-userspace-firmware-loading-support.patch
|
||||||
|
# PATCH-FIX-UPSTREAM 1079-udev-remove-userspace-firmware-loading-support.patch
|
||||||
|
Patch1079: 1079-udev-remove-userspace-firmware-loading-support.patch
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Systemd is a system and service manager, compatible with SysV and LSB
|
Systemd is a system and service manager, compatible with SysV and LSB
|
||||||
@ -1529,6 +1579,18 @@ cp %{SOURCE7} m4/
|
|||||||
%patch400 -p0
|
%patch400 -p0
|
||||||
%patch401 -p0
|
%patch401 -p0
|
||||||
%patch402 -p0
|
%patch402 -p0
|
||||||
|
%patch403 -p0
|
||||||
|
%patch404 -p0
|
||||||
|
%patch405 -p0
|
||||||
|
%patch406 -p0
|
||||||
|
%patch407 -p0
|
||||||
|
%patch408 -p0
|
||||||
|
%patch409 -p0
|
||||||
|
%patch410 -p0
|
||||||
|
%patch411 -p0
|
||||||
|
%patch412 -p0
|
||||||
|
%patch413 -p0
|
||||||
|
%patch414 -p0
|
||||||
|
|
||||||
# udev patches
|
# udev patches
|
||||||
%patch1001 -p1
|
%patch1001 -p1
|
||||||
@ -1618,6 +1680,27 @@ cp %{SOURCE7} m4/
|
|||||||
%patch1064 -p0
|
%patch1064 -p0
|
||||||
%patch1065 -p0
|
%patch1065 -p0
|
||||||
%patch1066 -p1
|
%patch1066 -p1
|
||||||
|
%patch1067 -p1
|
||||||
|
%patch1068 -p0
|
||||||
|
%patch1069 -p0
|
||||||
|
%patch1070 -p0
|
||||||
|
%patch1071 -p0
|
||||||
|
%patch1072 -p0
|
||||||
|
%patch1073 -p0
|
||||||
|
%patch1074 -p0
|
||||||
|
%patch1075 -p0
|
||||||
|
%if %{with udevsettle}
|
||||||
|
%patch1076 -p0
|
||||||
|
%else
|
||||||
|
%patch1077 -p0
|
||||||
|
%endif
|
||||||
|
%if 0%{?suse_version} > 1310
|
||||||
|
%if %{with udevsettle}
|
||||||
|
%patch1079 -p1
|
||||||
|
%else
|
||||||
|
%patch1078 -p1
|
||||||
|
%endif
|
||||||
|
%endif
|
||||||
|
|
||||||
# remove patch backups
|
# remove patch backups
|
||||||
find -name '*.orig' -exec rm -f '{}' \+
|
find -name '*.orig' -exec rm -f '{}' \+
|
||||||
|
Loading…
Reference in New Issue
Block a user