forked from pool/systemd
.
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=667
This commit is contained in:
parent
0276173e0f
commit
19d06807b6
119
0001-umount-modernizations.patch
Normal file
119
0001-umount-modernizations.patch
Normal file
@ -0,0 +1,119 @@
|
||||
From c3544e8d2c2d870a2aff0944aff4ab7824b9ae6b Mon Sep 17 00:00:00 2001
|
||||
From: Lennart Poettering <lennart@poettering.net>
|
||||
Date: Thu, 5 Jun 2014 21:35:15 +0200
|
||||
Subject: [PATCH] umount: modernizations
|
||||
|
||||
---
|
||||
src/core/umount.c | 65 ++++++++++++++++++++++-------------------------------
|
||||
1 file changed, 27 insertions(+), 38 deletions(-)
|
||||
|
||||
diff --git src/core/umount.c src/core/umount.c
|
||||
index d1258f0..a30f674 100644
|
||||
--- src/core/umount.c
|
||||
+++ src/core/umount.c
|
||||
@@ -61,52 +61,46 @@ static void mount_points_list_free(MountPoint **head) {
|
||||
}
|
||||
|
||||
static int mount_points_list_get(MountPoint **head) {
|
||||
- FILE *proc_self_mountinfo;
|
||||
- char *path, *p;
|
||||
+ _cleanup_fclose_ FILE *proc_self_mountinfo = NULL;
|
||||
unsigned int i;
|
||||
- int r;
|
||||
|
||||
assert(head);
|
||||
|
||||
- if (!(proc_self_mountinfo = fopen("/proc/self/mountinfo", "re")))
|
||||
+ proc_self_mountinfo = fopen("/proc/self/mountinfo", "re");
|
||||
+ if (!proc_self_mountinfo)
|
||||
return -errno;
|
||||
|
||||
for (i = 1;; i++) {
|
||||
- int k;
|
||||
+ _cleanup_free_ char *path = NULL;
|
||||
+ char *p = NULL;
|
||||
MountPoint *m;
|
||||
+ int k;
|
||||
|
||||
- path = p = NULL;
|
||||
-
|
||||
- if ((k = fscanf(proc_self_mountinfo,
|
||||
- "%*s " /* (1) mount id */
|
||||
- "%*s " /* (2) parent id */
|
||||
- "%*s " /* (3) major:minor */
|
||||
- "%*s " /* (4) root */
|
||||
- "%ms " /* (5) mount point */
|
||||
- "%*s" /* (6) mount options */
|
||||
- "%*[^-]" /* (7) optional fields */
|
||||
- "- " /* (8) separator */
|
||||
- "%*s " /* (9) file system type */
|
||||
- "%*s" /* (10) mount source */
|
||||
- "%*s" /* (11) mount options 2 */
|
||||
- "%*[^\n]", /* some rubbish at the end */
|
||||
- &path)) != 1) {
|
||||
+ k = fscanf(proc_self_mountinfo,
|
||||
+ "%*s " /* (1) mount id */
|
||||
+ "%*s " /* (2) parent id */
|
||||
+ "%*s " /* (3) major:minor */
|
||||
+ "%*s " /* (4) root */
|
||||
+ "%ms " /* (5) mount point */
|
||||
+ "%*s" /* (6) mount options */
|
||||
+ "%*[^-]" /* (7) optional fields */
|
||||
+ "- " /* (8) separator */
|
||||
+ "%*s " /* (9) file system type */
|
||||
+ "%*s" /* (10) mount source */
|
||||
+ "%*s" /* (11) mount options 2 */
|
||||
+ "%*[^\n]", /* some rubbish at the end */
|
||||
+ &path);
|
||||
+ if (k != 1) {
|
||||
if (k == EOF)
|
||||
break;
|
||||
|
||||
log_warning("Failed to parse /proc/self/mountinfo:%u.", i);
|
||||
-
|
||||
- free(path);
|
||||
continue;
|
||||
}
|
||||
|
||||
p = cunescape(path);
|
||||
- free(path);
|
||||
-
|
||||
- if (!p) {
|
||||
- r = -ENOMEM;
|
||||
- goto finish;
|
||||
- }
|
||||
+ if (!p)
|
||||
+ return -ENOMEM;
|
||||
|
||||
/* Ignore mount points we can't unmount because they
|
||||
* are API or because we are keeping them open (like
|
||||
@@ -118,22 +112,17 @@ static int mount_points_list_get(MountPoint **head) {
|
||||
continue;
|
||||
}
|
||||
|
||||
- if (!(m = new0(MountPoint, 1))) {
|
||||
+ m = new0(MountPoint, 1);
|
||||
+ if (!m) {
|
||||
free(p);
|
||||
- r = -ENOMEM;
|
||||
- goto finish;
|
||||
+ return -ENOMEM;
|
||||
}
|
||||
|
||||
m->path = p;
|
||||
LIST_PREPEND(mount_point, *head, m);
|
||||
}
|
||||
|
||||
- r = 0;
|
||||
-
|
||||
-finish:
|
||||
- fclose(proc_self_mountinfo);
|
||||
-
|
||||
- return r;
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
static int swap_list_get(MountPoint **head) {
|
||||
--
|
||||
1.7.9.2
|
||||
|
122
0002-namespace-when-setting-up-an-inaccessible-mount-poin.patch
Normal file
122
0002-namespace-when-setting-up-an-inaccessible-mount-poin.patch
Normal file
@ -0,0 +1,122 @@
|
||||
Based on 6d313367d9ef780560e117e886502a99fa220eac Mon Sep 17 00:00:00 2001
|
||||
From: Lennart Poettering <lennart@poettering.net>
|
||||
Date: Thu, 5 Jun 2014 21:35:35 +0200
|
||||
Subject: [PATCH] namespace: when setting up an inaccessible mount point,
|
||||
unmounting everything below
|
||||
|
||||
This has the benefit of not triggering any autofs mount points
|
||||
unnecessarily.
|
||||
|
||||
---
|
||||
src/core/namespace.c | 6 ++++
|
||||
src/shared/util.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
src/shared/util.h | 2 +
|
||||
3 files changed, 76 insertions(+)
|
||||
|
||||
--- src/core/namespace.c
|
||||
+++ src/core/namespace.c 2014-06-11 00:00:00.000000000 +0000
|
||||
@@ -220,6 +220,12 @@ static int apply_mount(
|
||||
return mount_dev(m);
|
||||
|
||||
case INACCESSIBLE:
|
||||
+
|
||||
+ /* First, get rid of everything that is below if there
|
||||
+ * is anything... Then, overmount it with an
|
||||
+ * inaccessible directory. */
|
||||
+ umount_recursive(m->path, 0);
|
||||
+
|
||||
what = "/run/systemd/inaccessible";
|
||||
break;
|
||||
|
||||
--- src/shared/util.c
|
||||
+++ src/shared/util.c 2014-06-11 00:00:00.000000000 +0000
|
||||
@@ -54,6 +54,7 @@
|
||||
#include <grp.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/vfs.h>
|
||||
+#include <sys/mount.h>
|
||||
#include <linux/magic.h>
|
||||
#include <limits.h>
|
||||
#include <langinfo.h>
|
||||
@@ -4635,6 +4636,73 @@ char *strjoin(const char *x, ...) {
|
||||
return r;
|
||||
}
|
||||
|
||||
+int umount_recursive(const char *prefix, int flags) {
|
||||
+ bool again;
|
||||
+ int n = 0, r;
|
||||
+
|
||||
+ /* Try to umount everything recursively below a
|
||||
+ * directory. Also, take care of stacked mounts, and keep
|
||||
+ * unmounting them until they are gone. */
|
||||
+
|
||||
+ do {
|
||||
+ _cleanup_fclose_ FILE *proc_self_mountinfo = NULL;
|
||||
+
|
||||
+ again = false;
|
||||
+ r = 0;
|
||||
+
|
||||
+ proc_self_mountinfo = fopen("/proc/self/mountinfo", "re");
|
||||
+ if (!proc_self_mountinfo)
|
||||
+ return -errno;
|
||||
+
|
||||
+ for (;;) {
|
||||
+ _cleanup_free_ char *path = NULL, *p = NULL;
|
||||
+ int k;
|
||||
+
|
||||
+ k = fscanf(proc_self_mountinfo,
|
||||
+ "%*s " /* (1) mount id */
|
||||
+ "%*s " /* (2) parent id */
|
||||
+ "%*s " /* (3) major:minor */
|
||||
+ "%*s " /* (4) root */
|
||||
+ "%ms " /* (5) mount point */
|
||||
+ "%*s" /* (6) mount options */
|
||||
+ "%*[^-]" /* (7) optional fields */
|
||||
+ "- " /* (8) separator */
|
||||
+ "%*s " /* (9) file system type */
|
||||
+ "%*s" /* (10) mount source */
|
||||
+ "%*s" /* (11) mount options 2 */
|
||||
+ "%*[^\n]", /* some rubbish at the end */
|
||||
+ &path);
|
||||
+
|
||||
+ if (k != 1) {
|
||||
+ if (k == EOF)
|
||||
+ break;
|
||||
+
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ p = cunescape(path);
|
||||
+ if (!p)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ if (!path_startswith(p, prefix))
|
||||
+ continue;
|
||||
+
|
||||
+ if (umount2(p, flags) < 0) {
|
||||
+ r = -errno;
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ again = true;
|
||||
+ n++;
|
||||
+
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ } while (again);
|
||||
+
|
||||
+ return r ? r : n;
|
||||
+}
|
||||
+
|
||||
bool is_main_thread(void) {
|
||||
static thread_local int cached = 0;
|
||||
|
||||
--- src/shared/util.h
|
||||
+++ src/shared/util.h 2014-06-11 10:10:08.000000000 +0000
|
||||
@@ -890,3 +890,5 @@ union file_handle_union {
|
||||
struct file_handle handle;
|
||||
char padding[sizeof(struct file_handle) + MAX_HANDLE_SZ];
|
||||
};
|
||||
+
|
||||
+int umount_recursive(const char *target, int flags);
|
115
0003-core-allow-transient-mount-units.patch
Normal file
115
0003-core-allow-transient-mount-units.patch
Normal file
@ -0,0 +1,115 @@
|
||||
From 0e252f6b375af59eac9bd6d2fe8dd6ee2f51998d Mon Sep 17 00:00:00 2001
|
||||
From: Tom Gundersen <teg@jklm.no>
|
||||
Date: Fri, 6 Jun 2014 15:10:20 +0200
|
||||
Subject: [PATCH] core: allow transient mount units
|
||||
|
||||
For now only What=, Options=, Type= are supported, and Where= is deduced
|
||||
from the unit name.
|
||||
---
|
||||
src/core/dbus-mount.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++-
|
||||
src/core/mount.c | 2 ++
|
||||
2 files changed, 65 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git src/core/dbus-mount.c src/core/dbus-mount.c
|
||||
index e64d3ea..e27019d 100644
|
||||
--- src/core/dbus-mount.c
|
||||
+++ src/core/dbus-mount.c
|
||||
@@ -124,6 +124,47 @@ const sd_bus_vtable bus_mount_vtable[] = {
|
||||
SD_BUS_VTABLE_END
|
||||
};
|
||||
|
||||
+static int bus_mount_set_transient_property(
|
||||
+ Mount *m,
|
||||
+ const char *name,
|
||||
+ sd_bus_message *message,
|
||||
+ UnitSetPropertiesMode mode,
|
||||
+ sd_bus_error *error) {
|
||||
+
|
||||
+ const char *new_property;
|
||||
+ char **property;
|
||||
+ char *p;
|
||||
+ int r;
|
||||
+
|
||||
+ assert(m);
|
||||
+ assert(name);
|
||||
+ assert(message);
|
||||
+
|
||||
+ if (streq(name, "What"))
|
||||
+ property = &m->parameters_fragment.what;
|
||||
+ else if (streq(name, "Options"))
|
||||
+ property = &m->parameters_fragment.options;
|
||||
+ else if (streq(name, "Type"))
|
||||
+ property = &m->parameters_fragment.fstype;
|
||||
+ else
|
||||
+ return 0;
|
||||
+
|
||||
+ r = sd_bus_message_read(message, "s", &new_property);
|
||||
+ if (r < 0)
|
||||
+ return r;
|
||||
+
|
||||
+ if (mode != UNIT_CHECK) {
|
||||
+ p = strdup(new_property);
|
||||
+ if (!p)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ free(*property);
|
||||
+ *property = p;
|
||||
+ }
|
||||
+
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
int bus_mount_set_property(
|
||||
Unit *u,
|
||||
const char *name,
|
||||
@@ -132,12 +173,33 @@ int bus_mount_set_property(
|
||||
sd_bus_error *error) {
|
||||
|
||||
Mount *m = MOUNT(u);
|
||||
+ int r;
|
||||
|
||||
assert(m);
|
||||
assert(name);
|
||||
assert(message);
|
||||
|
||||
- return bus_cgroup_set_property(u, &m->cgroup_context, name, message, mode, error);
|
||||
+ r = bus_cgroup_set_property(u, &m->cgroup_context, name, message, mode, error);
|
||||
+ if (r != 0)
|
||||
+ return r;
|
||||
+
|
||||
+ if (u->transient && u->load_state == UNIT_STUB) {
|
||||
+ /* This is a transient unit, let's load a little more */
|
||||
+
|
||||
+ r = bus_mount_set_transient_property(m, name, message, mode, error);
|
||||
+ if (r != 0)
|
||||
+ return r;
|
||||
+
|
||||
+ r = bus_exec_context_set_transient_property(u, &m->exec_context, name, message, mode, error);
|
||||
+ if (r != 0)
|
||||
+ return r;
|
||||
+
|
||||
+ r = bus_kill_context_set_transient_property(u, &m->kill_context, name, message, mode, error);
|
||||
+ if (r != 0)
|
||||
+ return r;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
int bus_mount_commit_properties(Unit *u) {
|
||||
diff --git src/core/mount.c src/core/mount.c
|
||||
index a979837..14ac0a0 100644
|
||||
--- src/core/mount.c
|
||||
+++ src/core/mount.c
|
||||
@@ -1819,6 +1819,8 @@ const UnitVTable mount_vtable = {
|
||||
|
||||
.get_timeout = mount_get_timeout,
|
||||
|
||||
+ .can_transient = true,
|
||||
+
|
||||
.enumerate = mount_enumerate,
|
||||
.shutdown = mount_shutdown,
|
||||
|
||||
--
|
||||
1.7.9.2
|
||||
|
79
0004-systemd-detect-virt-only-discover-Xen-domU.patch
Normal file
79
0004-systemd-detect-virt-only-discover-Xen-domU.patch
Normal file
@ -0,0 +1,79 @@
|
||||
From 37287585b6ba9a55065c8f94458f6db3c0abe0af Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Blume <Thomas.Blume@suse.com>
|
||||
Date: Fri, 6 Jun 2014 16:36:45 +0200
|
||||
Subject: [PATCH] systemd-detect-virt: only discover Xen domU
|
||||
|
||||
The current vm detection lacks the distinction between Xen dom0 and Xen domU.
|
||||
Both, dom0 and domU are running inside the hypervisor.
|
||||
Therefore systemd-detect-virt and the ConditionVirtualization directive detect
|
||||
dom0 as a virtual machine.
|
||||
|
||||
dom0 is not using virtual devices but is accessing the real hardware.
|
||||
Therefore dom0 should be considered the virtualisation host and not a virtual
|
||||
machine.
|
||||
|
||||
https://bugs.freedesktop.org/show_bug.cgi?id=77271
|
||||
---
|
||||
src/shared/virt.c | 34 +++++++++++++++++++++++++++-------
|
||||
1 file changed, 27 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git src/shared/virt.c src/shared/virt.c
|
||||
index 1e227c5..774915f 100644
|
||||
--- src/shared/virt.c
|
||||
+++ src/shared/virt.c
|
||||
@@ -148,7 +148,7 @@ static int detect_vm_dmi(const char **_id) {
|
||||
|
||||
/* Returns a short identifier for the various VM implementations */
|
||||
int detect_vm(const char **id) {
|
||||
- _cleanup_free_ char *hvtype = NULL, *cpuinfo_contents = NULL;
|
||||
+ _cleanup_free_ char *domcap = NULL, *cpuinfo_contents = NULL;
|
||||
static thread_local int cached_found = -1;
|
||||
static thread_local const char *cached_id = NULL;
|
||||
const char *_id = NULL;
|
||||
@@ -162,17 +162,37 @@ int detect_vm(const char **id) {
|
||||
return cached_found;
|
||||
}
|
||||
|
||||
- /* Try high-level hypervisor sysfs file first:
|
||||
+ /* Try xen capabilities file first, if not found try high-level hypervisor sysfs file:
|
||||
*
|
||||
- * https://bugs.freedesktop.org/show_bug.cgi?id=61491 */
|
||||
- r = read_one_line_file("/sys/hypervisor/type", &hvtype);
|
||||
+ * https://bugs.freedesktop.org/show_bug.cgi?id=77271 */
|
||||
+ r = read_one_line_file("/proc/xen/capabilities", &domcap);
|
||||
if (r >= 0) {
|
||||
- if (streq(hvtype, "xen")) {
|
||||
+ char *cap, *i = domcap;
|
||||
+
|
||||
+ while ((cap = strsep(&i, ",")))
|
||||
+ if (streq(cap, "control_d"))
|
||||
+ break;
|
||||
+
|
||||
+ if (!i) {
|
||||
_id = "xen";
|
||||
r = 1;
|
||||
- goto finish;
|
||||
}
|
||||
- } else if (r != -ENOENT)
|
||||
+
|
||||
+ goto finish;
|
||||
+
|
||||
+ } else if (r == -ENOENT) {
|
||||
+ _cleanup_free_ char *hvtype = NULL;
|
||||
+
|
||||
+ r = read_one_line_file("/sys/hypervisor/type", &hvtype);
|
||||
+ if (r >= 0) {
|
||||
+ if (streq(hvtype, "xen")) {
|
||||
+ _id = "xen";
|
||||
+ r = 1;
|
||||
+ goto finish;
|
||||
+ }
|
||||
+ } else if (r != -ENOENT)
|
||||
+ return r;
|
||||
+ } else
|
||||
return r;
|
||||
|
||||
/* this will set _id to "other" and return 0 for unknown hypervisors */
|
||||
--
|
||||
1.7.9.2
|
||||
|
60
0005-backlight-Do-not-clamp-brightness-for-LEDs.patch
Normal file
60
0005-backlight-Do-not-clamp-brightness-for-LEDs.patch
Normal file
@ -0,0 +1,60 @@
|
||||
From 4cd2b2cf8ca585d15ebc859701b346658262b5bb Mon Sep 17 00:00:00 2001
|
||||
From: Denis Tikhomirov <dvtikhomirov@gmail.com>
|
||||
Date: Thu, 5 Jun 2014 23:59:40 +0400
|
||||
Subject: [PATCH] backlight: Do not clamp brightness for LEDs
|
||||
|
||||
https://bugs.freedesktop.org/show_bug.cgi?id=77092
|
||||
|
||||
On Thu, Jun 05, 2014 at 08:37:20AM +0200, Lennart Poettering wrote:
|
||||
> The patch is line-broken, please send an uncorrupted patch!
|
||||
I am very sorry, I forgot that my client limits line width. I will use
|
||||
mutt now on.
|
||||
> clamp_brightness() clamps the brightness value to the range of the
|
||||
> actual device. This is a recent addition that was added to deal with
|
||||
> driver updates where the resolution is changed. I don't think this part
|
||||
> should be dropped for LED devices. The clamp_brightness() call hence
|
||||
> should be called unconditionally, however, internally it should use a
|
||||
> different min_brightness value if something is an !backlight devices...
|
||||
Thank you for explanation, this sounds very reasonable to me. Please,
|
||||
see updated patch:
|
||||
---
|
||||
src/backlight/backlight.c | 13 ++++++++++---
|
||||
1 file changed, 10 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git src/backlight/backlight.c src/backlight/backlight.c
|
||||
index 691472c..4d94ebf 100644
|
||||
--- src/backlight/backlight.c
|
||||
+++ src/backlight/backlight.c
|
||||
@@ -225,11 +225,13 @@ static unsigned get_max_brightness(struct udev_device *device) {
|
||||
|
||||
/* Some systems turn the backlight all the way off at the lowest levels.
|
||||
* clamp_brightness clamps the saved brightness to at least 1 or 5% of
|
||||
- * max_brightness. This avoids preserving an unreadably dim screen, which
|
||||
- * would otherwise force the user to disable state restoration. */
|
||||
+ * max_brightness in case of 'backlight' subsystem. This avoids preserving
|
||||
+ * an unreadably dim screen, which would otherwise force the user to
|
||||
+ * disable state restoration. */
|
||||
static void clamp_brightness(struct udev_device *device, char **value, unsigned max_brightness) {
|
||||
int r;
|
||||
unsigned brightness, new_brightness, min_brightness;
|
||||
+ const char *subsystem;
|
||||
|
||||
r = safe_atou(*value, &brightness);
|
||||
if (r < 0) {
|
||||
@@ -237,7 +239,12 @@ static void clamp_brightness(struct udev_device *device, char **value, unsigned
|
||||
return;
|
||||
}
|
||||
|
||||
- min_brightness = MAX(1U, max_brightness/20);
|
||||
+ subsystem = udev_device_get_subsystem(device);
|
||||
+ if (streq_ptr(subsystem, "backlight"))
|
||||
+ min_brightness = MAX(1U, max_brightness/20);
|
||||
+ else
|
||||
+ min_brightness = 0;
|
||||
+
|
||||
new_brightness = CLAMP(brightness, min_brightness, max_brightness);
|
||||
if (new_brightness != brightness) {
|
||||
char *old_value = *value;
|
||||
--
|
||||
1.7.9.2
|
||||
|
29
0006-log-honour-the-kernel-s-quiet-cmdline-argument.patch
Normal file
29
0006-log-honour-the-kernel-s-quiet-cmdline-argument.patch
Normal file
@ -0,0 +1,29 @@
|
||||
From e683212f049ac5d3f95fb17300cfa2fd971f78f3 Mon Sep 17 00:00:00 2001
|
||||
From: Ronny Chevalier <chevalier.ronny@gmail.com>
|
||||
Date: Tue, 3 Jun 2014 19:44:03 +0200
|
||||
Subject: [PATCH] log: honour the kernel's quiet cmdline argument
|
||||
|
||||
It was forgotten in b1e90ec515408aec2702522f6f68c4920b56375b
|
||||
|
||||
See https://bugs.freedesktop.org/show_bug.cgi?id=79582
|
||||
---
|
||||
src/shared/log.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git src/shared/log.c src/shared/log.c
|
||||
index 9039db3..6f17705 100644
|
||||
--- src/shared/log.c
|
||||
+++ src/shared/log.c
|
||||
@@ -878,6 +878,9 @@ void log_parse_environment(void) {
|
||||
if (l == 5 && startswith(w, "debug")) {
|
||||
log_set_max_level(LOG_DEBUG);
|
||||
break;
|
||||
+ } else if (l == 5 && startswith(w, "quiet")) {
|
||||
+ log_set_max_level(LOG_WARNING);
|
||||
+ break;
|
||||
}
|
||||
}
|
||||
}
|
||||
--
|
||||
1.7.9.2
|
||||
|
@ -1,35 +0,0 @@
|
||||
diff -Naur systemd-210/src/shared/virt.c systemd-210-mod/src/shared/virt.c
|
||||
--- systemd-210/src/shared/virt.c 2014-02-24 15:38:03.909784909 +0100
|
||||
+++ systemd-210/src/shared/virt.c 2014-04-10 13:48:05.568766957 +0200
|
||||
@@ -149,7 +149,7 @@
|
||||
|
||||
/* Returns a short identifier for the various VM implementations */
|
||||
int detect_vm(const char **id) {
|
||||
- _cleanup_free_ char *hvtype = NULL, *cpuinfo_contents = NULL;
|
||||
+ _cleanup_free_ char *domcap = NULL, *cpuinfo_contents = NULL;
|
||||
static thread_local int cached_found = -1;
|
||||
static thread_local const char *cached_id = NULL;
|
||||
const char *_id = NULL;
|
||||
@@ -166,13 +166,18 @@
|
||||
/* Try high-level hypervisor sysfs file first:
|
||||
*
|
||||
* https://bugs.freedesktop.org/show_bug.cgi?id=61491 */
|
||||
- r = read_one_line_file("/sys/hypervisor/type", &hvtype);
|
||||
+ r = read_one_line_file("/proc/xen/capabilities", &domcap);
|
||||
if (r >= 0) {
|
||||
- if (streq(hvtype, "xen")) {
|
||||
- _id = "xen";
|
||||
+ if (strstr(domcap, "control_d")) {
|
||||
+ r = 0;
|
||||
+ _id = "xen-dom0";
|
||||
+ } else {
|
||||
r = 1;
|
||||
- goto finish;
|
||||
+ _id = "xen-domU";
|
||||
}
|
||||
+
|
||||
+ goto finish;
|
||||
+
|
||||
} else if (r != -ENOENT)
|
||||
return r;
|
||||
|
@ -1,3 +1,21 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Jun 11 13:31:53 UTC 2014 - werner@suse.de
|
||||
|
||||
- Do not override predictable names for openSUSE
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Jun 11 11:03:45 UTC 2014 - werner@suse.de
|
||||
|
||||
- Remove systemd-detect-xendom.patch as it becomes obsolete with
|
||||
upstream patch 0004-systemd-detect-virt-only-discover-Xen-domU.patch
|
||||
- Add upstream patches
|
||||
0001-umount-modernizations.patch
|
||||
0002-namespace-when-setting-up-an-inaccessible-mount-poin.patch
|
||||
0003-core-allow-transient-mount-units.patch
|
||||
0004-systemd-detect-virt-only-discover-Xen-domU.patch
|
||||
0005-backlight-Do-not-clamp-brightness-for-LEDs.patch
|
||||
0006-log-honour-the-kernel-s-quiet-cmdline-argument.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Jun 10 19:58:56 UTC 2014 - rmilasan@suse.com
|
||||
|
||||
|
@ -391,8 +391,8 @@ Patch193: portmap-wants-rpcbind-socket.patch
|
||||
Patch194: 0007-dbus-suppress-duplicate-and-misleading-messages.patch
|
||||
# PATCH-FIX-USTREAM added at 2014/03/14
|
||||
Patch195: 0001-reduce-the-amount-of-messages-logged-to-dev-kmsg-whe.patch
|
||||
# PATCH-FIX-SUSE Detect XEN dom0 as well as domU
|
||||
Patch196: systemd-detect-xendom.patch
|
||||
## # PATCH-FIX-SUSE Detect XEN dom0 as well as domU
|
||||
## Patch196: systemd-detect-xendom.patch
|
||||
# PATCH-FIX-SUSE Avoid that emergency and rescue sulogin are fighting on console
|
||||
Patch197: rescue-emergency-target-conflicts.patch
|
||||
# PATCH-FIX-SUSE Avoid a divide by zero sigtrap
|
||||
@ -541,6 +541,18 @@ Patch269: 0001-hwdb-fix-case-sensitive-match.patch
|
||||
Patch270: 0001-sd-event-restore-correct-timeout-behaviour.patch
|
||||
# PATCH-FIX-UPSTREAM added at 2014/06/06
|
||||
Patch271: 0002-bus-make-use-of-sd_bus_try_close-in-exit-on-idle-ser.patch
|
||||
# PATCH-FIX-UPSTREAM added at 2014/06/11
|
||||
Patch272: 0001-umount-modernizations.patch
|
||||
# PATCH-FIX-UPSTREAM added at 2014/06/11
|
||||
Patch273: 0002-namespace-when-setting-up-an-inaccessible-mount-poin.patch
|
||||
# PATCH-FIX-UPSTREAM added at 2014/06/11
|
||||
Patch274: 0003-core-allow-transient-mount-units.patch
|
||||
# PATCH-FIX-UPSTREAM added at 2014/06/11 - Detect XEN dom0 as well as domU
|
||||
Patch275: 0004-systemd-detect-virt-only-discover-Xen-domU.patch
|
||||
# PATCH-FIX-UPSTREAM added at 2014/06/11
|
||||
Patch276: 0005-backlight-Do-not-clamp-brightness-for-LEDs.patch
|
||||
# PATCH-FIX-UPSTREAM added at 2014/06/11
|
||||
Patch277: 0006-log-honour-the-kernel-s-quiet-cmdline-argument.patch
|
||||
|
||||
# UDEV PATCHES
|
||||
# ============
|
||||
@ -970,7 +982,6 @@ cp %{SOURCE7} m4/
|
||||
%patch193 -p1
|
||||
%patch194 -p0
|
||||
%patch195 -p0
|
||||
%patch196 -p1
|
||||
%patch197 -p1
|
||||
%patch198 -p1
|
||||
%patch199 -p0
|
||||
@ -1045,6 +1056,12 @@ cp %{SOURCE7} m4/
|
||||
%patch269 -p0
|
||||
%patch270 -p0
|
||||
%patch271 -p0
|
||||
%patch272 -p0
|
||||
%patch273 -p0
|
||||
%patch274 -p0
|
||||
%patch275 -p0
|
||||
%patch276 -p0
|
||||
%patch277 -p0
|
||||
|
||||
# udev patches
|
||||
%patch1001 -p1
|
||||
@ -1137,6 +1154,10 @@ export LDFLAGS
|
||||
CFLAGS="$CFLAGS -DNET_IFNAMES=1"
|
||||
%else
|
||||
CFLAGS="$CFLAGS -DNET_IFNAMES=0"
|
||||
for rules in 75-persistent-net-generator 76-net-sriov-names
|
||||
do
|
||||
sed -ri '/^ENV\{net.ifnames\}=="1", GOTO="[^"]*"$/{ s/=="1"/!="0"/ }' src/udev/rule_generator/${rules}.rules
|
||||
done
|
||||
%endif
|
||||
cflags -pipe CFLAGS
|
||||
cflags -Wl,-O2 LDFLAGS
|
||||
|
@ -1,3 +1,21 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Jun 11 13:31:53 UTC 2014 - werner@suse.de
|
||||
|
||||
- Do not override predictable names for openSUSE
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Jun 11 11:03:45 UTC 2014 - werner@suse.de
|
||||
|
||||
- Remove systemd-detect-xendom.patch as it becomes obsolete with
|
||||
upstream patch 0004-systemd-detect-virt-only-discover-Xen-domU.patch
|
||||
- Add upstream patches
|
||||
0001-umount-modernizations.patch
|
||||
0002-namespace-when-setting-up-an-inaccessible-mount-poin.patch
|
||||
0003-core-allow-transient-mount-units.patch
|
||||
0004-systemd-detect-virt-only-discover-Xen-domU.patch
|
||||
0005-backlight-Do-not-clamp-brightness-for-LEDs.patch
|
||||
0006-log-honour-the-kernel-s-quiet-cmdline-argument.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Jun 10 19:58:56 UTC 2014 - rmilasan@suse.com
|
||||
|
||||
|
27
systemd.spec
27
systemd.spec
@ -386,8 +386,8 @@ Patch193: portmap-wants-rpcbind-socket.patch
|
||||
Patch194: 0007-dbus-suppress-duplicate-and-misleading-messages.patch
|
||||
# PATCH-FIX-USTREAM added at 2014/03/14
|
||||
Patch195: 0001-reduce-the-amount-of-messages-logged-to-dev-kmsg-whe.patch
|
||||
# PATCH-FIX-SUSE Detect XEN dom0 as well as domU
|
||||
Patch196: systemd-detect-xendom.patch
|
||||
## # PATCH-FIX-SUSE Detect XEN dom0 as well as domU
|
||||
## Patch196: systemd-detect-xendom.patch
|
||||
# PATCH-FIX-SUSE Avoid that emergency and rescue sulogin are fighting on console
|
||||
Patch197: rescue-emergency-target-conflicts.patch
|
||||
# PATCH-FIX-SUSE Avoid a divide by zero sigtrap
|
||||
@ -536,6 +536,18 @@ Patch269: 0001-hwdb-fix-case-sensitive-match.patch
|
||||
Patch270: 0001-sd-event-restore-correct-timeout-behaviour.patch
|
||||
# PATCH-FIX-UPSTREAM added at 2014/06/06
|
||||
Patch271: 0002-bus-make-use-of-sd_bus_try_close-in-exit-on-idle-ser.patch
|
||||
# PATCH-FIX-UPSTREAM added at 2014/06/11
|
||||
Patch272: 0001-umount-modernizations.patch
|
||||
# PATCH-FIX-UPSTREAM added at 2014/06/11
|
||||
Patch273: 0002-namespace-when-setting-up-an-inaccessible-mount-poin.patch
|
||||
# PATCH-FIX-UPSTREAM added at 2014/06/11
|
||||
Patch274: 0003-core-allow-transient-mount-units.patch
|
||||
# PATCH-FIX-UPSTREAM added at 2014/06/11 - Detect XEN dom0 as well as domU
|
||||
Patch275: 0004-systemd-detect-virt-only-discover-Xen-domU.patch
|
||||
# PATCH-FIX-UPSTREAM added at 2014/06/11
|
||||
Patch276: 0005-backlight-Do-not-clamp-brightness-for-LEDs.patch
|
||||
# PATCH-FIX-UPSTREAM added at 2014/06/11
|
||||
Patch277: 0006-log-honour-the-kernel-s-quiet-cmdline-argument.patch
|
||||
|
||||
# UDEV PATCHES
|
||||
# ============
|
||||
@ -965,7 +977,6 @@ cp %{SOURCE7} m4/
|
||||
%patch193 -p1
|
||||
%patch194 -p0
|
||||
%patch195 -p0
|
||||
%patch196 -p1
|
||||
%patch197 -p1
|
||||
%patch198 -p1
|
||||
%patch199 -p0
|
||||
@ -1040,6 +1051,12 @@ cp %{SOURCE7} m4/
|
||||
%patch269 -p0
|
||||
%patch270 -p0
|
||||
%patch271 -p0
|
||||
%patch272 -p0
|
||||
%patch273 -p0
|
||||
%patch274 -p0
|
||||
%patch275 -p0
|
||||
%patch276 -p0
|
||||
%patch277 -p0
|
||||
|
||||
# udev patches
|
||||
%patch1001 -p1
|
||||
@ -1132,6 +1149,10 @@ export LDFLAGS
|
||||
CFLAGS="$CFLAGS -DNET_IFNAMES=1"
|
||||
%else
|
||||
CFLAGS="$CFLAGS -DNET_IFNAMES=0"
|
||||
for rules in 75-persistent-net-generator 76-net-sriov-names
|
||||
do
|
||||
sed -ri '/^ENV\{net.ifnames\}=="1", GOTO="[^"]*"$/{ s/=="1"/!="0"/ }' src/udev/rule_generator/${rules}.rules
|
||||
done
|
||||
%endif
|
||||
cflags -pipe CFLAGS
|
||||
cflags -Wl,-O2 LDFLAGS
|
||||
|
Loading…
Reference in New Issue
Block a user