Accepting request 333777 from Base:System

- Fix patch tty-ask-password-agent-on-console.patch not to crash
  away but enable it to ask on all devices of /dev/console

- Avoid "file not found /etc/udev/rules.d/70-persistent-net.rules"
  waring occurring in %post

- Add patch let-vconsole-setup-get-properties-only-once-to-copy-them.patch
  to avoid broken virtual console mapping due stressed ioctl API
  for the virtual consoles (boo#904214)

- Fix last change that is use the new name for udev packages in %pretrans. 

- restore usage of LUA in %pretrans.

- Try to generate the systemd users and groups always in same order
  to avoid republish other packages (boo#944660) 

- cleanup specfile by removing commands that were dealing with systemd
  pre-generated files: we're now using systemd tarball generated directly
  from the git repo which doesn't contain any of these files.
- there's no point in using LUA in %pretrans

- Drop 0009-make-xsltproc-use-correct-ROFF-links.patch
This patch was initialy added to workaround bsc#842844. But it
appears that man(1) was fixed (included since 13.2 at least) to
handle manual pages that consist only of a .so directive such as
'.so <page>'.

- Change use-rndaddentropy-ioctl-to-load-random-seed.patch to
  make it work on big endian

OBS-URL: https://build.opensuse.org/request/show/333777
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=223
This commit is contained in:
Dominique Leuenberger 2015-09-27 12:32:31 +00:00 committed by Git OBS Bridge
commit de7b1c2894
86 changed files with 2263 additions and 3415 deletions

View File

@ -1,69 +0,0 @@
Based on deff2d3e18e831d63bf98dd4114e4e35e41966e8 Mon Sep 17 00:00:00 2001
From: Werner Fink <werner@suse.de>
Date: Wed, 10 Jun 2015 10:47:13 +0200
Subject: [PATCH] Let some boolean survive a daemon-reload
Without the boolean bus_name_good services as well as cgroup_realized
for units a unit of Type=dbus and ExecReload sending SIGHUP to $MAINPID
will be terminated if systemd will be daemon reloaded.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=746151
https://bugs.freedesktop.org/show_bug.cgi?id=78311
https://bugzilla.opensuse.org/show_bug.cgi?id=934077
---
src/core/service.c | 9 +++++++++
src/core/unit.c | 11 +++++++++++
2 files changed, 20 insertions(+)
--- systemd-219/src/core/service.c
+++ systemd-219/src/core/service.c 2015-06-11 12:24:36.769519910 +0000
@@ -1920,6 +1920,7 @@ static int service_serialize(Unit *u, FI
unit_serialize_item_format(u, f, "main-pid", PID_FMT, s->main_pid);
unit_serialize_item(u, f, "main-pid-known", yes_no(s->main_pid_known));
+ unit_serialize_item(u, f, "bus-name-good", yes_no(s->bus_name_good));
if (s->status_text)
unit_serialize_item(u, f, "status-text", s->status_text);
@@ -2044,6 +2045,14 @@ static int service_deserialize_item(Unit
log_unit_debug(u->id, "Failed to parse main-pid-known value %s", value);
else
s->main_pid_known = b;
+ } else if (streq(key, "bus-name-good")) {
+ int b;
+
+ b = parse_boolean(value);
+ if (b < 0)
+ log_unit_debug(u->id, "Failed to parse bus-name-good value %s", value);
+ else
+ s->bus_name_good = b;
} else if (streq(key, "status-text")) {
char *t;
--- systemd-219/src/core/unit.c
+++ systemd-219/src/core/unit.c 2015-06-11 12:30:56.805519155 +0000
@@ -2612,6 +2612,7 @@ int unit_serialize(Unit *u, FILE *f, FDS
if (u->cgroup_path)
unit_serialize_item(u, f, "cgroup", u->cgroup_path);
+ unit_serialize_item(u, f, "cgroup-realized", yes_no(u->cgroup_realized));
if (serialize_jobs) {
if (u->job) {
@@ -2803,6 +2804,16 @@ int unit_deserialize(Unit *u, FILE *f, F
assert(hashmap_put(u->manager->cgroup_unit, s, u) == 1);
continue;
+ } else if (streq(l, "cgroup-realized")) {
+ int b;
+
+ b = parse_boolean(v);
+ if (b < 0)
+ log_debug("Failed to parse cgroup-realized bool %s", v);
+ else
+ u->cgroup_realized = b;
+
+ continue;
}
if (unit_can_serialize(u)) {

View File

@ -1,29 +1,183 @@
---
rules/99-systemd.rules.in | 2
src/basic/terminal-util.c | 99 ++++++++++++++++++++++++++++++++++++++++++++--
src/basic/terminal-util.h | 1
src/core/manager.c | 24 ++++++++---
src/shared/util.c | 99 ++++++++++++++++++++++++++++++++++++++++++++--
src/shared/util.h | 1
4 files changed, 116 insertions(+), 10 deletions(-)
Index: systemd/rules/99-systemd.rules.in
Index: systemd-221/rules/99-systemd.rules.in
===================================================================
--- systemd.orig/rules/99-systemd.rules.in
+++ systemd/rules/99-systemd.rules.in
--- systemd-221.orig/rules/99-systemd.rules.in
+++ systemd-221/rules/99-systemd.rules.in
@@ -7,7 +7,7 @@
ACTION=="remove", GOTO="systemd_end"
-SUBSYSTEM=="tty", KERNEL=="tty[a-zA-Z]*|hvc*|xvc*|hvsi*|ttysclp*|sclp_line*|3270/tty[0-9]*", TAG+="systemd"
+SUBSYSTEM=="tty", KERNEL=="tty[a-zA-Z]*|hvc*|xvc*|hvsi*|ttysclp*|sclp_line*|3270/tty*", TAG+="systemd"
KERNEL=="vport*", TAG+="systemd"
Index: systemd/src/core/manager.c
SUBSYSTEM=="block", TAG+="systemd"
Index: systemd-221/src/basic/terminal-util.c
===================================================================
--- systemd.orig/src/core/manager.c
+++ systemd/src/core/manager.c
@@ -113,7 +113,7 @@ static int manager_watch_jobs_in_progres
--- systemd-221.orig/src/basic/terminal-util.c
+++ systemd-221/src/basic/terminal-util.c
@@ -647,6 +647,7 @@ int status_vprintf(const char *status, b
struct iovec iovec[6] = {};
int n = 0;
static bool prev_ephemeral;
+ static int is_ansi_console = -1;
assert(format);
@@ -660,6 +661,41 @@ int status_vprintf(const char *status, b
if (fd < 0)
return fd;
+ if (_unlikely_(is_ansi_console < 0))
+ is_ansi_console = ansi_console(fd);
+
+ if (status && !is_ansi_console) {
+ const char *esc, *ptr;
+ esc = strchr(status, 0x1B);
+ if (esc && (ptr = strpbrk(esc, "SOFDTI*"))) {
+ switch(*ptr) {
+ case 'S':
+ status = " SKIP ";
+ break;
+ case 'O':
+ status = " OK ";
+ break;
+ case 'F':
+ status = "FAILED";
+ break;
+ case 'D':
+ status = "DEPEND";
+ break;
+ case 'T':
+ status = " TIME ";
+ break;
+ case 'I':
+ status = " INFO ";
+ break;
+ case '*':
+ status = " BUSY ";
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
if (ellipse) {
char *e;
size_t emax, sl;
@@ -682,8 +718,12 @@ int status_vprintf(const char *status, b
}
}
- if (prev_ephemeral)
- IOVEC_SET_STRING(iovec[n++], "\r" ANSI_ERASE_TO_END_OF_LINE);
+ if (prev_ephemeral) {
+ if (is_ansi_console)
+ IOVEC_SET_STRING(iovec[n++], "\r" ANSI_ERASE_TO_END_OF_LINE);
+ else
+ IOVEC_SET_STRING(iovec[n++], "\r");
+ }
prev_ephemeral = ephemeral;
if (status) {
@@ -807,10 +847,47 @@ bool tty_is_vc_resolve(const char *tty)
return tty_is_vc(tty);
}
+bool ansi_console(int fd) {
+ static int cached_ansi_console = -1;
+
+ if (_likely_(cached_ansi_console >= 0))
+ return cached_ansi_console;
+
+ cached_ansi_console = isatty(fd) > 0;
+#if defined(__s390__) || defined(__s390x__)
+ if (cached_ansi_console) {
+ const char *e = getenv("TERM");
+ if (e != NULL && (streq(e, "dumb") || strneq(e, "ibm3", 4))) {
+ _cleanup_free_ char *mode = NULL;
+ int r = parse_env_file("/proc/cmdline", WHITESPACE,
+ "conmode", &mode, NULL);
+ if (r < 0 || mode == NULL || !streq(mode, "3270"))
+ cached_ansi_console = 0;
+ }
+ }
+#endif
+ return cached_ansi_console;
+}
+
const char *default_term_for_tty(const char *tty) {
assert(tty);
- return tty_is_vc_resolve(tty) ? "TERM=linux" : "TERM=vt220";
+ if (tty_is_vc_resolve(tty))
+ return "TERM=linux";
+ if (startswith(tty, "/dev/"))
+ tty += 5;
+#if defined (__s390__) || defined (__s390x__)
+ if (streq(tty, "ttyS0")) {
+ _cleanup_free_ char *mode = NULL;
+ int r = parse_env_file("/proc/cmdline", WHITESPACE, "conmode",
+ &mode, NULL);
+ if (r < 0 || mode == NULL || !streq(mode, "3270"))
+ return "TERM=dumb";
+ if (streq(mode, "3270"))
+ return "TERM=ibm327x";
+ }
+#endif
+ return "TERM=vt220";
}
int fd_columns(int fd) {
@@ -890,8 +967,22 @@ void columns_lines_cache_reset(int signu
bool on_tty(void) {
static int cached_on_tty = -1;
- if (_unlikely_(cached_on_tty < 0))
+ if (_unlikely_(cached_on_tty < 0)) {
cached_on_tty = isatty(STDOUT_FILENO) > 0;
+#if defined (__s390__) || defined (__s390x__)
+ if (cached_on_tty) {
+ const char *e = getenv("TERM");
+ if (!e)
+ return cached_on_tty;
+ if (streq(e, "dumb") || strneq(e, "ibm3", 4)) {
+ char *mode = NULL;
+ int r = parse_env_file("/proc/cmdline", WHITESPACE, "conmode", &mode, NULL);
+ if (r < 0 || !mode || !streq(mode, "3270"))
+ cached_on_tty = 0;
+ }
+ }
+#endif
+ }
return cached_on_tty;
}
Index: systemd-221/src/basic/terminal-util.h
===================================================================
--- systemd-221.orig/src/basic/terminal-util.h
+++ systemd-221/src/basic/terminal-util.h
@@ -77,6 +77,7 @@ unsigned lines(void);
void columns_lines_cache_reset(int _unused_ signum);
bool on_tty(void);
+bool ansi_console(int fd);
static inline const char *ansi_highlight(void) {
return on_tty() ? ANSI_HIGHLIGHT_ON : "";
Index: systemd-221/src/core/manager.c
===================================================================
--- systemd-221.orig/src/core/manager.c
+++ systemd-221/src/core/manager.c
@@ -113,7 +113,7 @@ static void manager_watch_jobs_in_progre
#define CYLON_BUFFER_EXTRA (2*(sizeof(ANSI_RED_ON)-1) + sizeof(ANSI_HIGHLIGHT_RED_ON)-1 + 2*(sizeof(ANSI_HIGHLIGHT_OFF)-1))
@ -89,161 +243,3 @@ Index: systemd/src/core/manager.c
m->jobs_in_progress_iteration++;
Index: systemd/src/shared/util.c
===================================================================
--- systemd.orig/src/shared/util.c
+++ systemd/src/shared/util.c
@@ -3212,6 +3212,7 @@ int status_vprintf(const char *status, b
struct iovec iovec[6] = {};
int n = 0;
static bool prev_ephemeral;
+ static int is_ansi_console = -1;
assert(format);
@@ -3225,6 +3226,41 @@ int status_vprintf(const char *status, b
if (fd < 0)
return fd;
+ if (_unlikely_(is_ansi_console < 0))
+ is_ansi_console = ansi_console(fd);
+
+ if (status && !is_ansi_console) {
+ const char *esc, *ptr;
+ esc = strchr(status, 0x1B);
+ if (esc && (ptr = strpbrk(esc, "SOFDTI*"))) {
+ switch(*ptr) {
+ case 'S':
+ status = " SKIP ";
+ break;
+ case 'O':
+ status = " OK ";
+ break;
+ case 'F':
+ status = "FAILED";
+ break;
+ case 'D':
+ status = "DEPEND";
+ break;
+ case 'T':
+ status = " TIME ";
+ break;
+ case 'I':
+ status = " INFO ";
+ break;
+ case '*':
+ status = " BUSY ";
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
if (ellipse) {
char *e;
size_t emax, sl;
@@ -3247,8 +3283,12 @@ int status_vprintf(const char *status, b
}
}
- if (prev_ephemeral)
- IOVEC_SET_STRING(iovec[n++], "\r" ANSI_ERASE_TO_END_OF_LINE);
+ if (prev_ephemeral) {
+ if (is_ansi_console)
+ IOVEC_SET_STRING(iovec[n++], "\r" ANSI_ERASE_TO_END_OF_LINE);
+ else
+ IOVEC_SET_STRING(iovec[n++], "\r");
+ }
prev_ephemeral = ephemeral;
if (status) {
@@ -3504,8 +3544,22 @@ void columns_lines_cache_reset(int signu
bool on_tty(void) {
static int cached_on_tty = -1;
- if (_unlikely_(cached_on_tty < 0))
+ if (_unlikely_(cached_on_tty < 0)) {
cached_on_tty = isatty(STDOUT_FILENO) > 0;
+#if defined (__s390__) || defined (__s390x__)
+ if (cached_on_tty) {
+ const char *e = getenv("TERM");
+ if (!e)
+ return cached_on_tty;
+ if (streq(e, "dumb") || strneq(e, "ibm3", 4)) {
+ char *mode = NULL;
+ int r = parse_env_file("/proc/cmdline", WHITESPACE, "conmode", &mode, NULL);
+ if (r < 0 || !mode || !streq(mode, "3270"))
+ cached_on_tty = 0;
+ }
+ }
+#endif
+ }
return cached_on_tty;
}
@@ -3523,6 +3577,27 @@ int files_same(const char *filea, const
a.st_ino == b.st_ino;
}
+bool ansi_console(int fd) {
+ static int cached_ansi_console = -1;
+
+ if (_unlikely_(cached_ansi_console < 0)) {
+ cached_ansi_console = isatty(fd) > 0;
+#if defined (__s390__) || defined (__s390x__)
+ if (cached_ansi_console) {
+ const char *e = getenv("TERM");
+ if (e && (streq(e, "dumb") || strneq(e, "ibm3", 4))) {
+ char *mode = NULL;
+ int r = parse_env_file("/proc/cmdline", WHITESPACE, "conmode", &mode, NULL);
+ if (r < 0 || !mode || !streq(mode, "3270"))
+ cached_ansi_console = 0;
+ }
+ }
+#endif
+ }
+
+ return cached_ansi_console;
+}
+
int running_in_chroot(void) {
int ret;
@@ -4006,7 +4081,23 @@ bool tty_is_vc_resolve(const char *tty)
const char *default_term_for_tty(const char *tty) {
assert(tty);
- return tty_is_vc_resolve(tty) ? "TERM=linux" : "TERM=vt220";
+ if (tty_is_vc_resolve(tty))
+ return "TERM=linux";
+
+ if (startswith(tty, "/dev/"))
+ tty += 5;
+
+#if defined (__s390__) || defined (__s390x__)
+ if (streq(tty, "ttyS0")) {
+ char *mode = NULL;
+ int r = parse_env_file("/proc/cmdline", WHITESPACE, "conmode", &mode, NULL);
+ if (r < 0 || !mode || !streq(mode, "3270"))
+ return "TERM=dumb";
+ if (streq(mode, "3270"))
+ return "TERM=ibm327x";
+ }
+#endif
+ return "TERM=vt220";
}
bool dirent_is_file(const struct dirent *de) {
Index: systemd/src/shared/util.h
===================================================================
--- systemd.orig/src/shared/util.h
+++ systemd/src/shared/util.h
@@ -475,6 +475,7 @@ unsigned lines(void);
void columns_lines_cache_reset(int _unused_ signum);
bool on_tty(void);
+bool ansi_console(int fd);
static inline const char *ansi_highlight(void) {
return on_tty() ? ANSI_HIGHLIGHT_ON : "";

View File

@ -3,11 +3,11 @@
src/systemctl/systemctl.c | 18 ++++++++++++------
2 files changed, 16 insertions(+), 6 deletions(-)
Index: systemd-218/src/core/shutdown.c
Index: systemd-221/src/core/shutdown.c
===================================================================
--- systemd-218.orig/src/core/shutdown.c
+++ systemd-218/src/core/shutdown.c
@@ -400,6 +400,10 @@ int main(int argc, char *argv[]) {
--- systemd-221.orig/src/core/shutdown.c
+++ systemd-221/src/core/shutdown.c
@@ -396,6 +396,10 @@ int main(int argc, char *argv[]) {
}
reboot(cmd);
@ -18,11 +18,11 @@ Index: systemd-218/src/core/shutdown.c
if (errno == EPERM && in_container) {
/* If we are in a container, and we lacked
* CAP_SYS_BOOT just exit, this will kill our
Index: systemd-218/src/systemctl/systemctl.c
Index: systemd-221/src/systemctl/systemctl.c
===================================================================
--- systemd-218.orig/src/systemctl/systemctl.c
+++ systemd-218/src/systemctl/systemctl.c
@@ -94,6 +94,7 @@ static bool arg_no_pager = false;
--- systemd-221.orig/src/systemctl/systemctl.c
+++ systemd-221/src/systemctl/systemctl.c
@@ -93,6 +93,7 @@ static bool arg_no_pager = false;
static bool arg_no_wtmp = false;
static bool arg_no_wall = false;
static bool arg_no_reload = false;
@ -30,7 +30,7 @@ Index: systemd-218/src/systemctl/systemctl.c
static bool arg_show_types = false;
static bool arg_ignore_inhibitors = false;
static bool arg_dry = false;
@@ -6813,6 +6814,7 @@ static int halt_parse_argv(int argc, cha
@@ -6636,6 +6637,7 @@ static int halt_parse_argv(int argc, cha
{ "reboot", no_argument, NULL, ARG_REBOOT },
{ "force", no_argument, NULL, 'f' },
{ "wtmp-only", no_argument, NULL, 'w' },
@ -38,7 +38,7 @@ Index: systemd-218/src/systemctl/systemctl.c
{ "no-wtmp", no_argument, NULL, 'd' },
{ "no-wall", no_argument, NULL, ARG_NO_WALL },
{}
@@ -6865,10 +6867,13 @@ static int halt_parse_argv(int argc, cha
@@ -6688,10 +6690,13 @@ static int halt_parse_argv(int argc, cha
case 'i':
case 'h':
@ -53,7 +53,7 @@ Index: systemd-218/src/systemctl/systemctl.c
case '?':
return -EINVAL;
@@ -7511,7 +7516,8 @@ static int halt_now(enum action a) {
@@ -7291,7 +7296,8 @@ static int halt_now(enum action a) {
/* The kernel will automaticall flush ATA disks and suchlike
* on reboot(), but the file systems need to be synce'd
* explicitly in advance. */
@ -63,7 +63,7 @@ Index: systemd-218/src/systemctl/systemctl.c
/* Make sure C-A-D is handled by the kernel from this point
* on... */
@@ -7519,14 +7525,14 @@ static int halt_now(enum action a) {
@@ -7299,14 +7305,14 @@ static int halt_now(enum action a) {
switch (a) {

View File

@ -5,17 +5,17 @@ NFS share is added as "After=" dependency to the <nfs-share-mount-point>.mount.
---
Makefile.am | 2
src/basic/util.c | 1
src/core/mount-iface.c | 173 +++++++++++++++++++++++++++++++++++++++++++++++++
src/core/mount-iface.h | 25 +++++++
src/core/mount.c | 35 +++++++++
src/shared/util.c | 1
5 files changed, 234 insertions(+), 2 deletions(-)
Index: systemd-218/Makefile.am
Index: systemd-221/Makefile.am
===================================================================
--- systemd-218.orig/Makefile.am
+++ systemd-218/Makefile.am
@@ -1134,6 +1134,8 @@ libsystemd_core_la_SOURCES = \
--- systemd-221.orig/Makefile.am
+++ systemd-221/Makefile.am
@@ -1164,6 +1164,8 @@ libcore_la_SOURCES = \
src/core/machine-id-setup.h \
src/core/mount-setup.c \
src/core/mount-setup.h \
@ -24,10 +24,22 @@ Index: systemd-218/Makefile.am
src/core/kmod-setup.c \
src/core/kmod-setup.h \
src/core/loopback-setup.h \
Index: systemd-218/src/core/mount-iface.c
Index: systemd-221/src/basic/util.c
===================================================================
--- systemd-221.orig/src/basic/util.c
+++ systemd-221/src/basic/util.c
@@ -1478,6 +1478,7 @@ bool fstype_is_network(const char *fstyp
"ncp\0"
"nfs\0"
"nfs4\0"
+ "afs\0"
"gfs\0"
"gfs2\0"
"glusterfs\0";
Index: systemd-221/src/core/mount-iface.c
===================================================================
--- /dev/null
+++ systemd-218/src/core/mount-iface.c
+++ systemd-221/src/core/mount-iface.c
@@ -0,0 +1,173 @@
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
+
@ -202,10 +214,10 @@ Index: systemd-218/src/core/mount-iface.c
+ freeifaddrs(ifa_list);
+ ifa_list = NULL;
+}
Index: systemd-218/src/core/mount-iface.h
Index: systemd-221/src/core/mount-iface.h
===================================================================
--- /dev/null
+++ systemd-218/src/core/mount-iface.h
+++ systemd-221/src/core/mount-iface.h
@@ -0,0 +1,25 @@
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
+
@ -232,11 +244,11 @@ Index: systemd-218/src/core/mount-iface.h
+
+char *host2iface(const char *ip);
+void freeroutes(void);
Index: systemd-218/src/core/mount.c
Index: systemd-221/src/core/mount.c
===================================================================
--- systemd-218.orig/src/core/mount.c
+++ systemd-218/src/core/mount.c
@@ -38,6 +38,7 @@
--- systemd-221.orig/src/core/mount.c
+++ systemd-221/src/core/mount.c
@@ -35,6 +35,7 @@
#include "mkdir.h"
#include "path-util.h"
#include "mount-setup.h"
@ -244,7 +256,7 @@ Index: systemd-218/src/core/mount.c
#include "unit-name.h"
#include "dbus-mount.h"
#include "special.h"
@@ -1365,8 +1366,9 @@ static int mount_add_one(
@@ -1332,8 +1333,9 @@ static int mount_setup_unit(
_cleanup_free_ char *e = NULL, *w = NULL, *o = NULL, *f = NULL;
bool load_extras = false;
MountParameters *p;
@ -255,17 +267,17 @@ Index: systemd-218/src/core/mount.c
int r;
assert(m);
@@ -1391,6 +1393,8 @@ static int mount_add_one(
if (!e)
return -ENOMEM;
@@ -1358,6 +1360,8 @@ static int mount_setup_unit(
if (r < 0)
return r;
+ isnetwork = fstype_is_network(fstype);
+
u = manager_get_unit(m, e);
if (!u) {
delete = true;
@@ -1419,7 +1423,7 @@ static int mount_add_one(
if (m->running_as == SYSTEMD_SYSTEM) {
@@ -1385,7 +1389,7 @@ static int mount_setup_unit(
if (m->running_as == MANAGER_SYSTEM) {
const char* target;
- target = mount_needs_network(options, fstype) ? SPECIAL_REMOTE_FS_TARGET : SPECIAL_LOCAL_FS_TARGET;
@ -273,7 +285,7 @@ Index: systemd-218/src/core/mount.c
r = unit_add_dependency_by_name(u, UNIT_BEFORE, target, NULL, true);
if (r < 0)
goto fail;
@@ -1505,6 +1509,32 @@ static int mount_add_one(
@@ -1471,6 +1475,32 @@ static int mount_setup_unit(
goto fail;
}
@ -296,7 +308,7 @@ Index: systemd-218/src/core/mount.c
+ else {
+ r = unit_add_dependency_by_name(u, UNIT_AFTER, target, NULL, true);
+ if (r < 0)
+ log_unit_error(u->id, "Failed to add dependency on %s, ignoring: %s",
+ log_unit_error(u, "Failed to add dependency on %s, ignoring: %s",
+ target, strerror(-r));
+ }
+ }
@ -306,7 +318,7 @@ Index: systemd-218/src/core/mount.c
if (changed)
unit_add_to_dbus_queue(u);
@@ -1560,6 +1590,7 @@ static int mount_load_proc_self_mountinf
@@ -1537,6 +1567,7 @@ static int mount_load_proc_self_mountinf
if (r == 0 && k < 0)
r = k;
}
@ -314,15 +326,3 @@ Index: systemd-218/src/core/mount.c
return r;
}
Index: systemd-218/src/shared/util.c
===================================================================
--- systemd-218.orig/src/shared/util.c
+++ systemd-218/src/shared/util.c
@@ -1667,6 +1667,7 @@ bool fstype_is_network(const char *fstyp
"ncp\0"
"nfs\0"
"nfs4\0"
+ "afs\0"
"gfs\0"
"gfs2\0"
"glusterfs\0";

View File

@ -1,6 +1,12 @@
--- systemd-209/src/login/logind-session.c
+++ systemd-209/src/login/logind-session.c 2014-02-28 12:12:14.762736079 +0000
@@ -525,6 +525,12 @@ int session_start(Session *s) {
---
src/login/logind-session.c | 6 ++++++
1 file changed, 6 insertions(+)
Index: systemd-221/src/login/logind-session.c
===================================================================
--- systemd-221.orig/src/login/logind-session.c
+++ systemd-221/src/login/logind-session.c
@@ -548,6 +548,12 @@ int session_start(Session *s) {
if (r < 0)
return r;

View File

@ -1,13 +1,13 @@
---
src/login/logind-action.c | 5 +++++
src/login/logind-dbus.c | 20 ++++++++++++++++----
2 files changed, 21 insertions(+), 4 deletions(-)
src/login/logind-dbus.c | 31 +++++++++++++++++++++++--------
2 files changed, 28 insertions(+), 8 deletions(-)
Index: systemd-218/src/login/logind-action.c
Index: systemd-221/src/login/logind-action.c
===================================================================
--- systemd-218.orig/src/login/logind-action.c
+++ systemd-218/src/login/logind-action.c
@@ -83,6 +83,11 @@ int manager_handle_action(
--- systemd-221.orig/src/login/logind-action.c
+++ systemd-221/src/login/logind-action.c
@@ -85,6 +85,11 @@ int manager_handle_action(
/* If the key handling is inhibited, don't do anything */
if (inhibit_key > 0) {
@ -19,57 +19,83 @@ Index: systemd-218/src/login/logind-action.c
if (manager_is_inhibited(m, inhibit_key, INHIBIT_BLOCK, NULL, true, false, 0, NULL)) {
log_debug("Refusing operation, %s is inhibited.", inhibit_what_to_string(inhibit_key));
return 0;
Index: systemd-218/src/login/logind-dbus.c
Index: systemd-221/src/login/logind-dbus.c
===================================================================
--- systemd-218.orig/src/login/logind-dbus.c
+++ systemd-218/src/login/logind-dbus.c
@@ -1487,9 +1487,11 @@ static int method_do_shutdown_or_sleep(
sd_bus_error *error) {
--- systemd-221.orig/src/login/logind-dbus.c
+++ systemd-221/src/login/logind-dbus.c
@@ -1625,12 +1625,13 @@ static int verify_shutdown_creds(
const char *action,
const char *action_multiple_sessions,
const char *action_ignore_inhibit,
- sd_bus_error *error) {
+ sd_bus_error *error, const char *sleep_verb) {
_cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL;
- bool multiple_sessions, blocked;
+ bool multiple_sessions, blocked, shutdown_through_acpi;
int interactive, r;
uid_t uid;
+ int fd;
- int r;
+ int r, fd;
+ struct stat buf;
assert(m);
assert(message);
@@ -1533,7 +1535,17 @@ static int method_do_shutdown_or_sleep(
@@ -1652,7 +1653,19 @@ static int verify_shutdown_creds(
multiple_sessions = r > 0;
blocked = manager_is_inhibited(m, w, INHIBIT_BLOCK, NULL, false, true, uid, NULL);
- if (multiple_sessions) {
- if (multiple_sessions && action_multiple_sessions) {
+ fd = open ("/run/systemd/acpi-shutdown", O_NOFOLLOW|O_PATH|O_CLOEXEC);
+ if (fd >= 0) {
+ shutdown_through_acpi = ((fstat(fd,&buf) == 0) && (time(NULL) - buf.st_mtime <= 65) && !sleep_verb);
+ shutdown_through_acpi = fstat(fd, &buf) == 0 &&
+ time(NULL) - buf.st_mtime <= 65 &&
+ sleep_verb == NULL;
+ close(fd);
+ unlink ("/run/systemd/acpi-shutdown");
+ }
+ else
+ shutdown_through_acpi = false;
+
+
+ if (multiple_sessions && !shutdown_through_acpi) {
r = bus_verify_polkit_async(message, CAP_SYS_BOOT, action_multiple_sessions, interactive, &m->polkit_registry, error);
+ if (multiple_sessions && action_multiple_sessions &&
+ !shutdown_through_acpi) {
r = bus_verify_polkit_async(message, CAP_SYS_BOOT, action_multiple_sessions, interactive, UID_INVALID, &m->polkit_registry, error);
if (r < 0)
return r;
@@ -1541,7 +1553,7 @@ static int method_do_shutdown_or_sleep(
@@ -1660,7 +1673,7 @@ static int verify_shutdown_creds(
return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
}
- if (blocked) {
+ if (blocked && !shutdown_through_acpi) {
r = bus_verify_polkit_async(message, CAP_SYS_BOOT, action_ignore_inhibit, interactive, &m->polkit_registry, error);
- if (blocked && action_ignore_inhibit) {
+ if (blocked && action_ignore_inhibit && !shutdown_through_acpi) {
r = bus_verify_polkit_async(message, CAP_SYS_BOOT, action_ignore_inhibit, interactive, UID_INVALID, &m->polkit_registry, error);
if (r < 0)
return r;
@@ -1549,7 +1561,7 @@ static int method_do_shutdown_or_sleep(
@@ -1668,7 +1681,8 @@ static int verify_shutdown_creds(
return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
}
- if (!multiple_sessions && !blocked) {
+ if (!multiple_sessions && !blocked && !shutdown_through_acpi) {
r = bus_verify_polkit_async(message, CAP_SYS_BOOT, action, interactive, &m->polkit_registry, error);
- if (!multiple_sessions && !blocked && action) {
+ if (!multiple_sessions && !blocked && action &&
+ !shutdown_through_acpi) {
r = bus_verify_polkit_async(message, CAP_SYS_BOOT, action, interactive, UID_INVALID, &m->polkit_registry, error);
if (r < 0)
return r;
@@ -1716,7 +1730,7 @@ static int method_do_shutdown_or_sleep(
}
r = verify_shutdown_creds(m, message, w, interactive, action, action_multiple_sessions,
- action_ignore_inhibit, error);
+ action_ignore_inhibit, error, sleep_verb);
if (r != 0)
return r;
@@ -1896,7 +1910,8 @@ static int method_schedule_shutdown(sd_b
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Unsupported shutdown type");
r = verify_shutdown_creds(m, message, INHIBIT_SHUTDOWN, false,
- action, action_multiple_sessions, action_ignore_inhibit, error);
+ action, action_multiple_sessions,
+ action_ignore_inhibit, error, "UNUSED");
if (r != 0)
return r;

View File

@ -1,917 +0,0 @@
From 628c89cc68ab96fce2de7ebba5933725d147aecc Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Fri, 27 Feb 2015 21:55:08 +0100
Subject: [PATCH] core: rework device state logic
References: https://bugzilla.redhat.com/show_bug.cgi?id=1196452
This change introduces a new state "tentative" for device units. Device
units are considered "plugged" when udev announced them, "dead" when
they are not available in the kernel, and "tentative" when they are
referenced in /proc/self/mountinfo or /proc/swaps but not (yet)
announced via udev.
This should fix a race when device nodes (like loop devices) are created
and immediately mounted. Previously, systemd might end up seeing the
mount unit before the device, and would thus pull down the mount because
its BindTo dependency on the device would not be fulfilled.
===
[The bug can be triggered by
cp -a /dev/sda1 (pick any source) /dev/xxx; mount /dev/xxx /mnt;
since "xxx" is a device udev does not know about even if it runs
and is race-free in the moment you are trying.
-jengelh]
---
src/core/device.c | 368 +++++++++++++++++++++++++++++++++---------------------
src/core/device.h | 14 ++-
src/core/mount.c | 46 ++++---
src/core/swap.c | 32 +++--
src/core/swap.h | 4 +-
src/core/unit.c | 1 -
6 files changed, 285 insertions(+), 180 deletions(-)
diff --git a/src/core/device.c b/src/core/device.c
index 2d983cc..e41ed41 100644
--- a/src/core/device.c
+++ b/src/core/device.c
@@ -34,7 +34,8 @@
static const UnitActiveState state_translation_table[_DEVICE_STATE_MAX] = {
[DEVICE_DEAD] = UNIT_INACTIVE,
- [DEVICE_PLUGGED] = UNIT_ACTIVE
+ [DEVICE_TENTATIVE] = UNIT_ACTIVATING,
+ [DEVICE_PLUGGED] = UNIT_ACTIVE,
};
static int device_dispatch_io(sd_event_source *source, int fd, uint32_t revents, void *userdata);
@@ -63,6 +64,41 @@ static void device_unset_sysfs(Device *d) {
d->sysfs = NULL;
}
+static int device_set_sysfs(Device *d, const char *sysfs) {
+ Device *first;
+ char *copy;
+ int r;
+
+ assert(d);
+
+ if (streq_ptr(d->sysfs, sysfs))
+ return 0;
+
+ r = hashmap_ensure_allocated(&UNIT(d)->manager->devices_by_sysfs, &string_hash_ops);
+ if (r < 0)
+ return r;
+
+ copy = strdup(sysfs);
+ if (!copy)
+ return -ENOMEM;
+
+ device_unset_sysfs(d);
+
+ first = hashmap_get(UNIT(d)->manager->devices_by_sysfs, sysfs);
+ LIST_PREPEND(same_sysfs, first, d);
+
+ r = hashmap_replace(UNIT(d)->manager->devices_by_sysfs, copy, first);
+ if (r < 0) {
+ LIST_REMOVE(same_sysfs, first, d);
+ free(copy);
+ return r;
+ }
+
+ d->sysfs = copy;
+
+ return 0;
+}
+
static void device_init(Unit *u) {
Device *d = DEVICE(u);
@@ -110,8 +146,13 @@ static int device_coldplug(Unit *u) {
assert(d);
assert(d->state == DEVICE_DEAD);
- if (d->sysfs)
+ if (d->found & DEVICE_FOUND_UDEV)
+ /* If udev says the device is around, it's around */
device_set_state(d, DEVICE_PLUGGED);
+ else if (d->found != DEVICE_NOT_FOUND)
+ /* If a device is found in /proc/self/mountinfo or
+ * /proc/swaps, it's "tentatively" around. */
+ device_set_state(d, DEVICE_TENTATIVE);
return 0;
}
@@ -140,49 +181,9 @@ _pure_ static const char *device_sub_state_to_string(Unit *u) {
return device_state_to_string(DEVICE(u)->state);
}
-static int device_add_escaped_name(Unit *u, const char *dn) {
- _cleanup_free_ char *e = NULL;
- int r;
-
- assert(u);
- assert(dn);
- assert(dn[0] == '/');
-
- e = unit_name_from_path(dn, ".device");
- if (!e)
- return -ENOMEM;
-
- r = unit_add_name(u, e);
- if (r < 0 && r != -EEXIST)
- return r;
-
- return 0;
-}
-
-static int device_find_escape_name(Manager *m, const char *dn, Unit **_u) {
- _cleanup_free_ char *e = NULL;
- Unit *u;
-
- assert(m);
- assert(dn);
- assert(dn[0] == '/');
- assert(_u);
-
- e = unit_name_from_path(dn, ".device");
- if (!e)
- return -ENOMEM;
-
- u = manager_get_unit(m, e);
- if (u) {
- *_u = u;
- return 1;
- }
-
- return 0;
-}
-
-static int device_make_description(Unit *u, struct udev_device *dev, const char *path) {
+static int device_update_description(Unit *u, struct udev_device *dev, const char *path) {
const char *model;
+ int r;
assert(u);
assert(dev);
@@ -207,13 +208,16 @@ static int device_make_description(Unit *u, struct udev_device *dev, const char
j = strjoin(model, " ", label, NULL);
if (j)
- return unit_set_description(u, j);
- }
+ r = unit_set_description(u, j);
+ } else
+ r = unit_set_description(u, model);
+ } else
+ r = unit_set_description(u, path);
- return unit_set_description(u, model);
- }
+ if (r < 0)
+ log_unit_error_errno(u->id, r, "Failed to set device description: %m");
- return unit_set_description(u, path);
+ return r;
}
static int device_add_udev_wants(Unit *u, struct udev_device *dev) {
@@ -240,20 +244,20 @@ static int device_add_udev_wants(Unit *u, struct udev_device *dev) {
n = unit_name_mangle(e, MANGLE_NOGLOB);
if (!n)
- return -ENOMEM;
+ return log_oom();
r = unit_add_dependency_by_name(u, UNIT_WANTS, n, NULL, true);
if (r < 0)
- return r;
+ return log_unit_error_errno(u->id, r, "Failed to add wants dependency: %m");
}
if (!isempty(state))
- log_unit_warning(u->id, "Property %s on %s has trailing garbage, ignoring.",
- property, strna(udev_device_get_syspath(dev)));
+ log_unit_warning(u->id, "Property %s on %s has trailing garbage, ignoring.", property, strna(udev_device_get_syspath(dev)));
return 0;
}
-static int device_update_unit(Manager *m, struct udev_device *dev, const char *path, bool main) {
+static int device_setup_unit(Manager *m, struct udev_device *dev, const char *path, bool main) {
+ _cleanup_free_ char *e = NULL;
const char *sysfs;
Unit *u = NULL;
bool delete;
@@ -267,12 +271,18 @@ static int device_update_unit(Manager *m, struct udev_device *dev, const char *p
if (!sysfs)
return 0;
- r = device_find_escape_name(m, path, &u);
- if (r < 0)
- return r;
+ e = unit_name_from_path(path, ".device");
+ if (!e)
+ return log_oom();
+
+ u = manager_get_unit(m, e);
- if (u && DEVICE(u)->sysfs && !path_equal(DEVICE(u)->sysfs, sysfs))
+ if (u &&
+ DEVICE(u)->sysfs &&
+ !path_equal(DEVICE(u)->sysfs, sysfs)) {
+ log_unit_error(u->id, "Device %s appeared twice with different sysfs paths %s and %s", e, DEVICE(u)->sysfs, sysfs);
return -EEXIST;
+ }
if (!u) {
delete = true;
@@ -281,7 +291,7 @@ static int device_update_unit(Manager *m, struct udev_device *dev, const char *p
if (!u)
return log_oom();
- r = device_add_escaped_name(u, path);
+ r = unit_add_name(u, e);
if (r < 0)
goto fail;
@@ -293,37 +303,16 @@ static int device_update_unit(Manager *m, struct udev_device *dev, const char *p
* actually been seen yet ->sysfs will not be
* initialized. Hence initialize it if necessary. */
- if (!DEVICE(u)->sysfs) {
- Device *first;
-
- DEVICE(u)->sysfs = strdup(sysfs);
- if (!DEVICE(u)->sysfs) {
- r = -ENOMEM;
- goto fail;
- }
-
- r = hashmap_ensure_allocated(&m->devices_by_sysfs, &string_hash_ops);
- if (r < 0)
- goto fail;
-
- first = hashmap_get(m->devices_by_sysfs, sysfs);
- LIST_PREPEND(same_sysfs, first, DEVICE(u));
-
- r = hashmap_replace(m->devices_by_sysfs, DEVICE(u)->sysfs, first);
- if (r < 0)
- goto fail;
- }
-
- device_make_description(u, dev, path);
+ r = device_set_sysfs(DEVICE(u), sysfs);
+ if (r < 0)
+ goto fail;
- if (main) {
- /* The additional systemd udev properties we only
- * interpret for the main object */
+ (void) device_update_description(u, dev, path);
- r = device_add_udev_wants(u, dev);
- if (r < 0)
- goto fail;
- }
+ /* The additional systemd udev properties we only interpret
+ * for the main object */
+ if (main)
+ (void) device_add_udev_wants(u, dev);
/* Note that this won't dispatch the load queue, the caller
* has to do that if needed and appropriate */
@@ -332,7 +321,7 @@ static int device_update_unit(Manager *m, struct udev_device *dev, const char *p
return 0;
fail:
- log_warning_errno(r, "Failed to load device unit: %m");
+ log_unit_warning_errno(u->id, r, "Failed to set up device unit: %m");
if (delete && u)
unit_free(u);
@@ -340,7 +329,7 @@ fail:
return r;
}
-static int device_process_new_device(Manager *m, struct udev_device *dev) {
+static int device_process_new(Manager *m, struct udev_device *dev) {
const char *sysfs, *dn, *alias;
struct udev_list_entry *item = NULL, *first = NULL;
int r;
@@ -352,14 +341,14 @@ static int device_process_new_device(Manager *m, struct udev_device *dev) {
return 0;
/* Add the main unit named after the sysfs path */
- r = device_update_unit(m, dev, sysfs, true);
+ r = device_setup_unit(m, dev, sysfs, true);
if (r < 0)
return r;
/* Add an additional unit for the device node */
dn = udev_device_get_devnode(dev);
if (dn)
- device_update_unit(m, dev, dn, false);
+ (void) device_setup_unit(m, dev, dn, false);
/* Add additional units for all symlinks */
first = udev_device_get_devlinks_list_entry(dev);
@@ -386,7 +375,7 @@ static int device_process_new_device(Manager *m, struct udev_device *dev) {
st.st_rdev != udev_device_get_devnum(dev))
continue;
- device_update_unit(m, dev, p, false);
+ (void) device_setup_unit(m, dev, p, false);
}
/* Add additional units for all explicitly configured
@@ -403,7 +392,7 @@ static int device_process_new_device(Manager *m, struct udev_device *dev) {
e[l] = 0;
if (path_is_absolute(e))
- device_update_unit(m, dev, e, false);
+ (void) device_setup_unit(m, dev, e, false);
else
log_warning("SYSTEMD_ALIAS for %s is not an absolute path, ignoring: %s", sysfs, e);
}
@@ -414,39 +403,62 @@ static int device_process_new_device(Manager *m, struct udev_device *dev) {
return 0;
}
-static void device_set_path_plugged(Manager *m, struct udev_device *dev) {
- const char *sysfs;
+static void device_update_found_one(Device *d, bool add, DeviceFound found, bool now) {
+ DeviceFound n;
+
+ assert(d);
+
+ n = add ? (d->found | found) : (d->found & ~found);
+ if (n == d->found)
+ return;
+
+ d->found = n;
+
+ if (now) {
+ if (d->found & DEVICE_FOUND_UDEV)
+ device_set_state(d, DEVICE_PLUGGED);
+ else if (d->found != DEVICE_NOT_FOUND)
+ device_set_state(d, DEVICE_TENTATIVE);
+ else
+ device_set_state(d, DEVICE_DEAD);
+ }
+}
+
+static int device_update_found_by_sysfs(Manager *m, const char *sysfs, bool add, DeviceFound found, bool now) {
Device *d, *l;
assert(m);
- assert(dev);
+ assert(sysfs);
- sysfs = udev_device_get_syspath(dev);
- if (!sysfs)
- return;
+ if (found == DEVICE_NOT_FOUND)
+ return 0;
l = hashmap_get(m->devices_by_sysfs, sysfs);
LIST_FOREACH(same_sysfs, d, l)
- device_set_state(d, DEVICE_PLUGGED);
+ device_update_found_one(d, add, found, now);
+
+ return 0;
}
-static int device_process_removed_device(Manager *m, struct udev_device *dev) {
- const char *sysfs;
- Device *d;
+static int device_update_found_by_name(Manager *m, const char *path, bool add, DeviceFound found, bool now) {
+ _cleanup_free_ char *e = NULL;
+ Unit *u;
assert(m);
- assert(dev);
+ assert(path);
- sysfs = udev_device_get_syspath(dev);
- if (!sysfs)
- return -ENOMEM;
+ if (found == DEVICE_NOT_FOUND)
+ return 0;
- /* Remove all units of this sysfs path */
- while ((d = hashmap_get(m->devices_by_sysfs, sysfs))) {
- device_unset_sysfs(d);
- device_set_state(d, DEVICE_DEAD);
- }
+ e = unit_name_from_path(path, ".device");
+ if (!e)
+ return log_oom();
+ u = manager_get_unit(m, e);
+ if (!u)
+ return 0;
+
+ device_update_found_one(DEVICE(u), add, found, now);
return 0;
}
@@ -462,22 +474,6 @@ static bool device_is_ready(struct udev_device *dev) {
return parse_boolean(ready) != 0;
}
-static int device_process_new_path(Manager *m, const char *path) {
- _cleanup_udev_device_unref_ struct udev_device *dev = NULL;
-
- assert(m);
- assert(path);
-
- dev = udev_device_new_from_syspath(m->udev, path);
- if (!dev)
- return log_oom();
-
- if (!device_is_ready(dev))
- return 0;
-
- return device_process_new_device(m, dev);
-}
-
static Unit *device_following(Unit *u) {
Device *d = DEVICE(u);
Device *other, *first = NULL;
@@ -604,12 +600,31 @@ static int device_enumerate(Manager *m) {
goto fail;
first = udev_enumerate_get_list_entry(e);
- udev_list_entry_foreach(item, first)
- device_process_new_path(m, udev_list_entry_get_name(item));
+ udev_list_entry_foreach(item, first) {
+ _cleanup_udev_device_unref_ struct udev_device *dev = NULL;
+ const char *sysfs;
+
+ sysfs = udev_list_entry_get_name(item);
+
+ dev = udev_device_new_from_syspath(m->udev, sysfs);
+ if (!dev) {
+ log_oom();
+ continue;
+ }
+
+ if (!device_is_ready(dev))
+ continue;
+
+ (void) device_process_new(m, dev);
+
+ device_update_found_by_sysfs(m, sysfs, true, DEVICE_FOUND_UDEV, false);
+ }
return 0;
fail:
+ log_error_errno(r, "Failed to enumerate devices: %m");
+
device_shutdown(m);
return r;
}
@@ -617,7 +632,7 @@ fail:
static int device_dispatch_io(sd_event_source *source, int fd, uint32_t revents, void *userdata) {
_cleanup_udev_device_unref_ struct udev_device *dev = NULL;
Manager *m = userdata;
- const char *action;
+ const char *action, *sysfs;
int r;
assert(m);
@@ -639,33 +654,47 @@ static int device_dispatch_io(sd_event_source *source, int fd, uint32_t revents,
if (!dev)
return 0;
+ sysfs = udev_device_get_syspath(dev);
+ if (!sysfs) {
+ log_error("Failed to get udev sys path.");
+ return 0;
+ }
+
action = udev_device_get_action(dev);
if (!action) {
log_error("Failed to get udev action string.");
return 0;
}
- if (streq(action, "remove") || !device_is_ready(dev)) {
- r = device_process_removed_device(m, dev);
- if (r < 0)
- log_error_errno(r, "Failed to process device remove event: %m");
-
- r = swap_process_removed_device(m, dev);
+ if (streq(action, "remove")) {
+ r = swap_process_device_remove(m, dev);
if (r < 0)
log_error_errno(r, "Failed to process swap device remove event: %m");
- } else {
- r = device_process_new_device(m, dev);
- if (r < 0)
- log_error_errno(r, "Failed to process device new event: %m");
+ /* If we get notified that a device was removed by
+ * udev, then it's completely gone, hence unset all
+ * found bits */
+ device_update_found_by_sysfs(m, sysfs, false, DEVICE_FOUND_UDEV|DEVICE_FOUND_MOUNT|DEVICE_FOUND_SWAP, true);
- r = swap_process_new_device(m, dev);
+ } else if (device_is_ready(dev)) {
+
+ (void) device_process_new(m, dev);
+
+ r = swap_process_device_new(m, dev);
if (r < 0)
log_error_errno(r, "Failed to process swap device new event: %m");
manager_dispatch_load_queue(m);
- device_set_path_plugged(m, dev);
+ /* The device is found now, set the udev found bit */
+ device_update_found_by_sysfs(m, sysfs, true, DEVICE_FOUND_UDEV, true);
+
+ } else {
+ /* The device is nominally around, but not ready for
+ * us. Hence unset the udev bit, but leave the rest
+ * around. */
+
+ device_update_found_by_sysfs(m, sysfs, false, DEVICE_FOUND_UDEV, true);
}
return 0;
@@ -684,9 +713,58 @@ static bool device_supported(Manager *m) {
return read_only <= 0;
}
+int device_found_node(Manager *m, const char *node, bool add, DeviceFound found, bool now) {
+ _cleanup_udev_device_unref_ struct udev_device *dev = NULL;
+ struct stat st;
+
+ assert(m);
+ assert(node);
+
+ /* This is called whenever we find a device referenced in
+ * /proc/swaps or /proc/self/mounts. Such a device might be
+ * mounted/enabled at a time where udev has not finished
+ * probing it yet, and we thus haven't learned about it
+ * yet. In this case we will set the device unit to
+ * "tentative" state. */
+
+ if (add) {
+ if (!path_startswith(node, "/dev"))
+ return 0;
+
+ if (stat(node, &st) < 0) {
+ if (errno == ENOENT)
+ return 0;
+
+ return log_error_errno(errno, "Failed to stat device node file %s: %m", node);
+ }
+
+ if (!S_ISBLK(st.st_mode) && !S_ISCHR(st.st_mode))
+ return 0;
+
+ dev = udev_device_new_from_devnum(m->udev, S_ISBLK(st.st_mode) ? 'b' : 'c', st.st_rdev);
+ if (!dev) {
+ if (errno == ENOENT)
+ return 0;
+
+ return log_oom();
+ }
+
+ /* If the device is known in the kernel and newly
+ * appeared, then we'll create a device unit for it,
+ * under the name referenced in /proc/swaps or
+ * /proc/self/mountinfo. */
+
+ (void) device_setup_unit(m, dev, node, false);
+ }
+
+ /* Update the device unit's state, should it exist */
+ return device_update_found_by_name(m, node, add, found, now);
+}
+
static const char* const device_state_table[_DEVICE_STATE_MAX] = {
[DEVICE_DEAD] = "dead",
- [DEVICE_PLUGGED] = "plugged"
+ [DEVICE_TENTATIVE] = "tentative",
+ [DEVICE_PLUGGED] = "plugged",
};
DEFINE_STRING_TABLE_LOOKUP(device_state, DeviceState);
diff --git a/src/core/device.h b/src/core/device.h
index 9065085..9f46e08 100644
--- a/src/core/device.h
+++ b/src/core/device.h
@@ -28,20 +28,28 @@ typedef struct Device Device;
* simplifies the state engine greatly */
typedef enum DeviceState {
DEVICE_DEAD,
- DEVICE_PLUGGED,
+ DEVICE_TENTATIVE, /* mounted or swapped, but not (yet) announced by udev */
+ DEVICE_PLUGGED, /* announced by udev */
_DEVICE_STATE_MAX,
_DEVICE_STATE_INVALID = -1
} DeviceState;
+typedef enum DeviceFound {
+ DEVICE_NOT_FOUND = 0,
+ DEVICE_FOUND_UDEV = 1,
+ DEVICE_FOUND_MOUNT = 2,
+ DEVICE_FOUND_SWAP = 4,
+} DeviceFound;
+
struct Device {
Unit meta;
char *sysfs;
+ DeviceFound found;
/* In order to be able to distinguish dependencies on
different device nodes we might end up creating multiple
devices for the same sysfs path. We chain them up here. */
-
LIST_FIELDS(struct Device, same_sysfs);
DeviceState state;
@@ -51,3 +59,5 @@ extern const UnitVTable device_vtable;
const char* device_state_to_string(DeviceState i) _const_;
DeviceState device_state_from_string(const char *s) _pure_;
+
+int device_found_node(Manager *m, const char *node, bool add, DeviceFound found, bool now);
diff --git a/src/core/mount.c b/src/core/mount.c
index 40037e7..8e4a376 100644
--- a/src/core/mount.c
+++ b/src/core/mount.c
@@ -1386,7 +1386,7 @@ static int mount_dispatch_timer(sd_event_source *source, usec_t usec, void *user
return 0;
}
-static int mount_add_one(
+static int mount_setup_unit(
Manager *m,
const char *what,
const char *where,
@@ -1429,7 +1429,7 @@ static int mount_add_one(
u = unit_new(m, sizeof(Mount));
if (!u)
- return -ENOMEM;
+ return log_oom();
r = unit_add_name(u, e);
if (r < 0)
@@ -1542,6 +1542,8 @@ static int mount_add_one(
return 0;
fail:
+ log_warning_errno(r, "Failed to set up mount unit: %m");
+
if (delete && u)
unit_free(u);
@@ -1549,33 +1551,36 @@ fail:
}
static int mount_load_proc_self_mountinfo(Manager *m, bool set_flags) {
- _cleanup_(mnt_free_tablep) struct libmnt_table *tb = NULL;
- _cleanup_(mnt_free_iterp) struct libmnt_iter *itr = NULL;
- struct libmnt_fs *fs;
+ _cleanup_(mnt_free_tablep) struct libmnt_table *t = NULL;
+ _cleanup_(mnt_free_iterp) struct libmnt_iter *i = NULL;
int r = 0;
assert(m);
- tb = mnt_new_table();
- itr = mnt_new_iter(MNT_ITER_FORWARD);
- if (!tb || !itr)
+ t = mnt_new_table();
+ if (!t)
return log_oom();
- r = mnt_table_parse_mtab(tb, NULL);
+ i = mnt_new_iter(MNT_ITER_FORWARD);
+ if (!i)
+ return log_oom();
+
+ r = mnt_table_parse_mtab(t, NULL);
if (r < 0)
- return r;
+ return log_error_errno(r, "Failed to parse /proc/self/mountinfo: %m");
r = 0;
for (;;) {
const char *device, *path, *options, *fstype;
_cleanup_free_ const char *d = NULL, *p = NULL;
+ struct libmnt_fs *fs;
int k;
- k = mnt_table_next_fs(tb, itr, &fs);
+ k = mnt_table_next_fs(t, i, &fs);
if (k == 1)
break;
- else if (k < 0)
- return log_error_errno(k, "Failed to get next entry from /etc/fstab: %m");
+ if (k < 0)
+ return log_error_errno(k, "Failed to get next entry from /proc/self/mountinfo: %m");
device = mnt_fs_get_source(fs);
path = mnt_fs_get_target(fs);
@@ -1583,11 +1588,16 @@ static int mount_load_proc_self_mountinfo(Manager *m, bool set_flags) {
fstype = mnt_fs_get_fstype(fs);
d = cunescape(device);
+ if (!d)
+ return log_oom();
+
p = cunescape(path);
- if (!d || !p)
+ if (!p)
return log_oom();
- k = mount_add_one(m, d, p, options, fstype, set_flags);
+ (void) device_found_node(m, d, true, DEVICE_FOUND_MOUNT, set_flags);
+
+ k = mount_setup_unit(m, d, p, options, fstype, set_flags);
if (r == 0 && k < 0)
r = k;
}
@@ -1731,8 +1741,6 @@ static int mount_dispatch_io(sd_event_source *source, int fd, uint32_t revents,
r = mount_load_proc_self_mountinfo(m, true);
if (r < 0) {
- log_error_errno(r, "Failed to reread /proc/self/mountinfo: %m");
-
/* Reset flags, just in case, for later calls */
LIST_FOREACH(units_by_type, u, m->units_by_type[UNIT_MOUNT]) {
Mount *mount = MOUNT(u);
@@ -1765,6 +1773,10 @@ static int mount_dispatch_io(sd_event_source *source, int fd, uint32_t revents,
break;
}
+ if (mount->parameters_proc_self_mountinfo.what)
+ (void) device_found_node(m, mount->parameters_proc_self_mountinfo.what, false, DEVICE_FOUND_MOUNT, true);
+
+
} else if (mount->just_mounted || mount->just_changed) {
/* New or changed mount entry */
diff --git a/src/core/swap.c b/src/core/swap.c
index f73a8e6..de3a5d8 100644
--- a/src/core/swap.c
+++ b/src/core/swap.c
@@ -331,7 +331,7 @@ static int swap_load(Unit *u) {
return swap_verify(s);
}
-static int swap_add_one(
+static int swap_setup_unit(
Manager *m,
const char *what,
const char *what_proc_swaps,
@@ -356,8 +356,10 @@ static int swap_add_one(
if (u &&
SWAP(u)->from_proc_swaps &&
- !path_equal(SWAP(u)->parameters_proc_swaps.what, what_proc_swaps))
+ !path_equal(SWAP(u)->parameters_proc_swaps.what, what_proc_swaps)) {
+ log_error("Swap %s appeared twice with different device paths %s and %s", e, SWAP(u)->parameters_proc_swaps.what, what_proc_swaps);
return -EEXIST;
+ }
if (!u) {
delete = true;
@@ -372,7 +374,7 @@ static int swap_add_one(
SWAP(u)->what = strdup(what);
if (!SWAP(u)->what) {
- r = log_oom();
+ r = -ENOMEM;
goto fail;
}
@@ -400,7 +402,6 @@ static int swap_add_one(
p->priority = priority;
unit_add_to_dbus_queue(u);
-
return 0;
fail:
@@ -412,7 +413,7 @@ fail:
return r;
}
-static int swap_process_new_swap(Manager *m, const char *device, int prio, bool set_flags) {
+static int swap_process_new(Manager *m, const char *device, int prio, bool set_flags) {
_cleanup_udev_device_unref_ struct udev_device *d = NULL;
struct udev_list_entry *item = NULL, *first = NULL;
const char *dn;
@@ -421,7 +422,7 @@ static int swap_process_new_swap(Manager *m, const char *device, int prio, bool
assert(m);
- r = swap_add_one(m, device, device, prio, set_flags);
+ r = swap_setup_unit(m, device, device, prio, set_flags);
if (r < 0)
return r;
@@ -437,7 +438,7 @@ static int swap_process_new_swap(Manager *m, const char *device, int prio, bool
/* Add the main device node */
dn = udev_device_get_devnode(d);
if (dn && !streq(dn, device))
- swap_add_one(m, dn, device, prio, set_flags);
+ swap_setup_unit(m, dn, device, prio, set_flags);
/* Add additional units for all symlinks */
first = udev_device_get_devlinks_list_entry(d);
@@ -458,7 +459,7 @@ static int swap_process_new_swap(Manager *m, const char *device, int prio, bool
st.st_rdev != udev_device_get_devnum(d))
continue;
- swap_add_one(m, p, device, prio, set_flags);
+ swap_setup_unit(m, p, device, prio, set_flags);
}
return r;
@@ -1084,15 +1085,17 @@ static int swap_load_proc_swaps(Manager *m, bool set_flags) {
if (k == EOF)
break;
- log_warning("Failed to parse /proc/swaps:%u", i);
+ log_warning("Failed to parse /proc/swaps:%u.", i);
continue;
}
d = cunescape(dev);
if (!d)
- return -ENOMEM;
+ return log_oom();
+
+ device_found_node(m, d, true, DEVICE_FOUND_SWAP, set_flags);
- k = swap_process_new_swap(m, d, prio, set_flags);
+ k = swap_process_new(m, d, prio, set_flags);
if (k < 0)
r = k;
}
@@ -1144,6 +1147,9 @@ static int swap_dispatch_io(sd_event_source *source, int fd, uint32_t revents, v
break;
}
+ if (swap->what)
+ device_found_node(m, swap->what, false, DEVICE_FOUND_SWAP, true);
+
} else if (swap->just_activated) {
/* New swap entry */
@@ -1291,7 +1297,7 @@ fail:
return r;
}
-int swap_process_new_device(Manager *m, struct udev_device *dev) {
+int swap_process_device_new(Manager *m, struct udev_device *dev) {
struct udev_list_entry *item = NULL, *first = NULL;
_cleanup_free_ char *e = NULL;
const char *dn;
@@ -1334,7 +1340,7 @@ int swap_process_new_device(Manager *m, struct udev_device *dev) {
return r;
}
-int swap_process_removed_device(Manager *m, struct udev_device *dev) {
+int swap_process_device_remove(Manager *m, struct udev_device *dev) {
const char *dn;
int r = 0;
Swap *s;
diff --git a/src/core/swap.h b/src/core/swap.h
index c36c6f2..5de8c20 100644
--- a/src/core/swap.h
+++ b/src/core/swap.h
@@ -115,8 +115,8 @@ struct Swap {
extern const UnitVTable swap_vtable;
-int swap_process_new_device(Manager *m, struct udev_device *dev);
-int swap_process_removed_device(Manager *m, struct udev_device *dev);
+int swap_process_device_new(Manager *m, struct udev_device *dev);
+int swap_process_device_remove(Manager *m, struct udev_device *dev);
const char* swap_state_to_string(SwapState i) _const_;
SwapState swap_state_from_string(const char *s) _pure_;
diff --git a/src/core/unit.c b/src/core/unit.c
index 63ccd67..7cd7043 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -2834,7 +2834,6 @@ int unit_add_node_link(Unit *u, const char *what, bool wants) {
return -ENOMEM;
r = manager_load_unit(u->manager, e, NULL, NULL, &device);
-
if (r < 0)
return r;
--
2.1.4

View File

@ -1,5 +1,11 @@
--- systemd-210/shell-completion/bash/systemctl.in
+++ systemd-210/shell-completion/bash/systemctl.in 2014-08-20 15:01:04.502736981 +0000
---
shell-completion/bash/systemctl.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: systemd-221/shell-completion/bash/systemctl.in
===================================================================
--- systemd-221.orig/shell-completion/bash/systemctl.in
+++ systemd-221/shell-completion/bash/systemctl.in
@@ -43,7 +43,7 @@ __filter_units_by_property () {
local units=("$@")
local props

View File

@ -8,12 +8,14 @@ is used, the XDG_RUNTIME_DIR will not be clobbered by the new uid.
This belongs to BNC#852015 and also to BNC#855160
---
pam_systemd.c | 19 +++++++++++++++++++
src/login/pam_systemd.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
--- systemd-209/src/login/pam_systemd.c
+++ systemd-209/src/login/pam_systemd.c 2014-02-26 14:31:30.158235525 +0000
@@ -447,6 +447,25 @@ _public_ PAM_EXTERN int pam_sm_open_sess
Index: systemd-221/src/login/pam_systemd.c
===================================================================
--- systemd-221.orig/src/login/pam_systemd.c
+++ systemd-221/src/login/pam_systemd.c
@@ -445,6 +445,25 @@ _public_ PAM_EXTERN int pam_sm_open_sess
r = export_legacy_dbus_address(handle, pw->pw_uid, runtime_path);
if (r != PAM_SUCCESS)
return r;

View File

@ -1,10 +0,0 @@
--- systemd-208/man/custom-man.xsl
+++ systemd-208/man/custom-man.xsl 2013-10-21 09:23:31.030735259 +0000
@@ -61,4 +61,7 @@
<xsl:text>"</xsl:text>
</xsl:template>
+<xsl:param name="man.output.in.separate.dir" select="1"></xsl:param>
+<xsl:param name="man.output.base.dir"></xsl:param>
+
</xsl:stylesheet>

View File

@ -2,9 +2,15 @@
| Belongs to bnc#849071 that is do not install console-shell.service
| in any system target as this will cause automatic poweroff at boot.
|
--- systemd-208/units/console-shell.service.m4.in
+++ systemd-208/units/console-shell.service.m4.in 2013-11-06 09:35:37.958693570 +0000
@@ -26,6 +26,3 @@ StandardError=inherit
---
units/console-shell.service.m4.in | 3 ---
1 file changed, 3 deletions(-)
Index: systemd-221/units/console-shell.service.m4.in
===================================================================
--- systemd-221.orig/units/console-shell.service.m4.in
+++ systemd-221/units/console-shell.service.m4.in
@@ -28,6 +28,3 @@ StandardError=inherit
KillMode=process
IgnoreSIGPIPE=no
SendSIGHUP=yes

View File

@ -13,10 +13,10 @@ No word on compression…
src/journal/journald-server.c | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
Index: systemd/src/journal/journald-server.c
Index: systemd-221/src/journal/journald-server.c
===================================================================
--- systemd.orig/src/journal/journald-server.c
+++ systemd/src/journal/journald-server.c
--- systemd-221.orig/src/journal/journald-server.c
+++ systemd-221/src/journal/journald-server.c
@@ -21,6 +21,7 @@
#include <sys/signalfd.h>
@ -25,7 +25,7 @@ Index: systemd/src/journal/journald-server.c
#include <linux/sockios.h>
#include <sys/statvfs.h>
#include <sys/mman.h>
@@ -917,6 +918,38 @@ finish:
@@ -918,6 +919,38 @@ finish:
dispatch_message_real(s, iovec, n, m, ucred, tv, label, label_len, unit_id, priority, object_pid);
}
@ -64,7 +64,7 @@ Index: systemd/src/journal/journald-server.c
static int system_journal_open(Server *s, bool flush_requested) {
int r;
@@ -946,6 +979,7 @@ static int system_journal_open(Server *s
@@ -947,6 +980,7 @@ static int system_journal_open(Server *s
fn = strjoina("/var/log/journal/", ids);
(void) mkdir(fn, 0755);

View File

@ -12,10 +12,10 @@
shell-completion/bash/udevadm | 6 +++++-
11 files changed, 70 insertions(+), 11 deletions(-)
Index: systemd/shell-completion/bash/coredumpctl
Index: systemd-221/shell-completion/bash/coredumpctl
===================================================================
--- systemd.orig/shell-completion/bash/coredumpctl
+++ systemd/shell-completion/bash/coredumpctl
--- systemd-221.orig/shell-completion/bash/coredumpctl
+++ systemd-221/shell-completion/bash/coredumpctl
@@ -44,6 +44,10 @@ _coredumpctl() {
[DUMP]='dump gdb'
)
@ -33,10 +33,10 @@ Index: systemd/shell-completion/bash/coredumpctl
-complete -F _coredumpctl coredumpctl
+complete -o default -o bashdefault -F _coredumpctl coredumpctl
Index: systemd/shell-completion/bash/hostnamectl
Index: systemd-221/shell-completion/bash/hostnamectl
===================================================================
--- systemd.orig/shell-completion/bash/hostnamectl
+++ systemd/shell-completion/bash/hostnamectl
--- systemd-221.orig/shell-completion/bash/hostnamectl
+++ systemd-221/shell-completion/bash/hostnamectl
@@ -30,6 +30,10 @@ _hostnamectl() {
local OPTS='-h --help --version --transient --static --pretty
--no-ask-password -H --host --machine'
@ -54,10 +54,10 @@ Index: systemd/shell-completion/bash/hostnamectl
-complete -F _hostnamectl hostnamectl
+complete -o default -o bashdefault -F _hostnamectl hostnamectl
Index: systemd/shell-completion/bash/journalctl
Index: systemd-221/shell-completion/bash/journalctl
===================================================================
--- systemd.orig/shell-completion/bash/journalctl
+++ systemd/shell-completion/bash/journalctl
--- systemd-221.orig/shell-completion/bash/journalctl
+++ systemd-221/shell-completion/bash/journalctl
@@ -55,6 +55,10 @@ _journalctl() {
--root --machine'
)
@ -75,10 +75,10 @@ Index: systemd/shell-completion/bash/journalctl
-complete -F _journalctl journalctl
+complete -o default -o bashdefault -F _journalctl journalctl
Index: systemd/shell-completion/bash/kernel-install
Index: systemd-221/shell-completion/bash/kernel-install
===================================================================
--- systemd.orig/shell-completion/bash/kernel-install
+++ systemd/shell-completion/bash/kernel-install
--- systemd-221.orig/shell-completion/bash/kernel-install
+++ systemd-221/shell-completion/bash/kernel-install
@@ -18,11 +18,22 @@
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
@ -108,10 +108,10 @@ Index: systemd/shell-completion/bash/kernel-install
-complete -F _kernel_install kernel-install
+complete -o default -o bashdefault -F _kernel_install kernel-install
Index: systemd/shell-completion/bash/localectl
Index: systemd-221/shell-completion/bash/localectl
===================================================================
--- systemd.orig/shell-completion/bash/localectl
+++ systemd/shell-completion/bash/localectl
--- systemd-221.orig/shell-completion/bash/localectl
+++ systemd-221/shell-completion/bash/localectl
@@ -36,6 +36,10 @@ _localectl() {
local OPTS='-h --help --version --no-convert --no-pager --no-ask-password
-H --host --machine'
@ -129,10 +129,10 @@ Index: systemd/shell-completion/bash/localectl
-complete -F _localectl localectl
+complete -o default -o bashdefault -F _localectl localectl
Index: systemd/shell-completion/bash/loginctl
Index: systemd-221/shell-completion/bash/loginctl
===================================================================
--- systemd.orig/shell-completion/bash/loginctl
+++ systemd/shell-completion/bash/loginctl
--- systemd-221.orig/shell-completion/bash/loginctl
+++ systemd-221/shell-completion/bash/loginctl
@@ -38,6 +38,10 @@ _loginctl () {
[ARG]='--host -H --kill-who --property -p --signal -s --machine'
)
@ -150,12 +150,12 @@ Index: systemd/shell-completion/bash/loginctl
-complete -F _loginctl loginctl
+complete -o default -o bashdefault -F _loginctl loginctl
Index: systemd/shell-completion/bash/systemctl.in
Index: systemd-221/shell-completion/bash/systemctl.in
===================================================================
--- systemd.orig/shell-completion/bash/systemctl.in
+++ systemd/shell-completion/bash/systemctl.in
--- systemd-221.orig/shell-completion/bash/systemctl.in
+++ systemd-221/shell-completion/bash/systemctl.in
@@ -96,6 +96,10 @@ _systemctl () {
[ARG]='--host -H --kill-who --property -p --signal -s --type -t --state --root'
[ARG]='--host -H --kill-who --property -p --signal -s --type -t --state --job-mode --root'
)
+ if __contains_word ">" ${COMP_WORDS[*]:0:COMP_CWORD}; then
@ -165,16 +165,16 @@ Index: systemd/shell-completion/bash/systemctl.in
if __contains_word "--user" ${COMP_WORDS[*]}; then
mode=--user
else
@@ -264,4 +268,4 @@ _systemctl () {
@@ -268,4 +272,4 @@ _systemctl () {
return 0
}
-complete -F _systemctl systemctl
+complete -o default -o bashdefault -F _systemctl systemctl
Index: systemd/shell-completion/bash/systemd-analyze
Index: systemd-221/shell-completion/bash/systemd-analyze
===================================================================
--- systemd.orig/shell-completion/bash/systemd-analyze
+++ systemd/shell-completion/bash/systemd-analyze
--- systemd-221.orig/shell-completion/bash/systemd-analyze
+++ systemd-221/shell-completion/bash/systemd-analyze
@@ -47,6 +47,10 @@ _systemd_analyze() {
[VERIFY]='verify'
)
@ -192,10 +192,10 @@ Index: systemd/shell-completion/bash/systemd-analyze
-complete -F _systemd_analyze systemd-analyze
+complete -o default -o bashdefault -F _systemd_analyze systemd-analyze
Index: systemd/shell-completion/bash/systemd-run
Index: systemd-221/shell-completion/bash/systemd-run
===================================================================
--- systemd.orig/shell-completion/bash/systemd-run
+++ systemd/shell-completion/bash/systemd-run
--- systemd-221.orig/shell-completion/bash/systemd-run
+++ systemd-221/shell-completion/bash/systemd-run
@@ -17,6 +17,13 @@
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
@ -228,10 +228,10 @@ Index: systemd/shell-completion/bash/systemd-run
-complete -F _systemd_run systemd-run
+complete -o default -o bashdefault -F _systemd_run systemd-run
Index: systemd/shell-completion/bash/timedatectl
Index: systemd-221/shell-completion/bash/timedatectl
===================================================================
--- systemd.orig/shell-completion/bash/timedatectl
+++ systemd/shell-completion/bash/timedatectl
--- systemd-221.orig/shell-completion/bash/timedatectl
+++ systemd-221/shell-completion/bash/timedatectl
@@ -30,6 +30,10 @@ _timedatectl() {
local OPTS='-h --help --version --adjust-system-clock --no-pager
--no-ask-password -H --host --machine'
@ -249,10 +249,10 @@ Index: systemd/shell-completion/bash/timedatectl
-complete -F _timedatectl timedatectl
+complete -o default -o bashdefault -F _timedatectl timedatectl
Index: systemd/shell-completion/bash/udevadm
Index: systemd-221/shell-completion/bash/udevadm
===================================================================
--- systemd.orig/shell-completion/bash/udevadm
+++ systemd/shell-completion/bash/udevadm
--- systemd-221.orig/shell-completion/bash/udevadm
+++ systemd-221/shell-completion/bash/udevadm
@@ -36,6 +36,10 @@ _udevadm() {
local verbs=(info trigger settle control monitor hwdb test-builtin test)

View File

@ -25,11 +25,11 @@ Signed-off-by: Hannes Reinecke <hare@suse.de>
src/udev/udev-builtin-path_id.c | 53 ++++++++++++++++++++++++++++++----------
1 file changed, 41 insertions(+), 12 deletions(-)
Index: systemd-218/src/udev/udev-builtin-path_id.c
Index: systemd-221/src/udev/udev-builtin-path_id.c
===================================================================
--- systemd-218.orig/src/udev/udev-builtin-path_id.c
+++ systemd-218/src/udev/udev-builtin-path_id.c
@@ -426,6 +426,46 @@ static struct udev_device *handle_scsi_h
--- systemd-221.orig/src/udev/udev-builtin-path_id.c
+++ systemd-221/src/udev/udev-builtin-path_id.c
@@ -447,6 +447,46 @@ static struct udev_device *handle_scsi_h
return parent;
}
@ -76,7 +76,7 @@ Index: systemd-218/src/udev/udev-builtin-path_id.c
static struct udev_device *handle_scsi(struct udev_device *parent, char **path, bool *supported_parent) {
const char *devtype;
const char *name;
@@ -465,19 +505,8 @@ static struct udev_device *handle_scsi(s
@@ -486,19 +526,8 @@ static struct udev_device *handle_scsi(s
goto out;
}

View File

@ -4,12 +4,14 @@ Subject: rules create by id scsi links for ATA devices
Re-enable creation of by-id scsi links for ATA devices. (bnc#769002)
---
rules/60-persistent-storage.rules | 4 ++++
rules/60-persistent-storage.rules | 4 ++++
1 file changed, 4 insertions(+)
--- systemd-206.orig/rules/60-persistent-storage.rules
+++ systemd-206/rules/60-persistent-storage.rules
@@ -42,6 +42,10 @@ KERNEL=="cciss*", ENV{DEVTYPE}=="disk",
Index: systemd-221/rules/60-persistent-storage.rules
===================================================================
--- systemd-221.orig/rules/60-persistent-storage.rules
+++ systemd-221/rules/60-persistent-storage.rules
@@ -36,6 +36,10 @@ KERNEL=="cciss*", ENV{DEVTYPE}=="disk",
KERNEL=="sd*|sr*|cciss*", ENV{DEVTYPE}=="disk", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
KERNEL=="sd*|cciss*", ENV{DEVTYPE}=="partition", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"
@ -17,6 +19,6 @@ Re-enable creation of by-id scsi links for ATA devices. (bnc#769002)
+KERNEL=="sd*[!0-9]", ENV{ID_BUS}=="ata", PROGRAM="scsi_id --whitelisted --replace-whitespace -p0x80 -d $devnode", RESULT=="?*", ENV{ID_SCSI_COMPAT}="$result", SYMLINK+="disk/by-id/scsi-$env{ID_SCSI_COMPAT}"
+KERNEL=="sd*[0-9]", ENV{ID_SCSI_COMPAT}=="?*", SYMLINK+="disk/by-id/scsi-$env{ID_SCSI_COMPAT}-part%n"
+
# firewire
# FireWire
KERNEL=="sd*[!0-9]|sr*", ATTRS{ieee1394_id}=="?*", SYMLINK+="disk/by-id/ieee1394-$attr{ieee1394_id}"
KERNEL=="sd*[0-9]", ATTRS{ieee1394_id}=="?*", SYMLINK+="disk/by-id/ieee1394-$attr{ieee1394_id}-part%n"

View File

@ -7,16 +7,16 @@ udevd race for netlink events (bnc#774646)
src/udev/udevd.c | 2 ++
1 file changed, 2 insertions(+)
Index: systemd-218/src/udev/udevd.c
Index: systemd-221/src/udev/udevd.c
===================================================================
--- systemd-218.orig/src/udev/udevd.c
+++ systemd-218/src/udev/udevd.c
@@ -1468,6 +1468,8 @@ int main(int argc, char *argv[]) {
dev = udev_monitor_receive_device(monitor);
if (dev != NULL) {
udev_device_set_usec_initialized(dev, now(CLOCK_MONOTONIC));
+ if (rules == NULL)
+ rules = udev_rules_new(udev, arg_resolve_names);
if (event_queue_insert(dev) < 0)
udev_device_unref(dev);
}
--- systemd-221.orig/src/udev/udevd.c
+++ systemd-221/src/udev/udevd.c
@@ -917,6 +917,8 @@ static int on_uevent(sd_event_source *s,
dev = udev_monitor_receive_device(manager->monitor);
if (dev) {
udev_device_ensure_usec_initialized(dev, NULL);
+ if (manager->rules == NULL)
+ manager->rules = udev_rules_new(manager->udev, arg_resolve_names);
r = event_queue_insert(manager, dev);
if (r < 0)
udev_device_unref(dev);

View File

@ -7,10 +7,10 @@ cdrom_id: created links for the default cd/dvd drive (bnc#783054).
rules/60-cdrom_id.rules | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
Index: systemd/rules/60-cdrom_id.rules
Index: systemd-221/rules/60-cdrom_id.rules
===================================================================
--- systemd.orig/rules/60-cdrom_id.rules
+++ systemd/rules/60-cdrom_id.rules
--- systemd-221.orig/rules/60-cdrom_id.rules
+++ systemd-221/rules/60-cdrom_id.rules
@@ -20,6 +20,9 @@ IMPORT{program}="cdrom_id --lock-media $
# stale mounts after ejecting
ENV{DISK_MEDIA_CHANGE}=="?*", ENV{ID_CDROM_MEDIA}!="?*", ENV{SYSTEMD_READY}="0"

View File

@ -13,11 +13,11 @@ Port the patch of Robert to systemd v210 and test it out.
1 file changed, 37 insertions(+), 4 deletions(-)
Index: systemd-218/src/udev/udev-event.c
Index: systemd-221/src/udev/udev-event.c
===================================================================
--- systemd-218.orig/src/udev/udev-event.c
+++ systemd-218/src/udev/udev-event.c
@@ -767,20 +767,53 @@ out:
--- systemd-221.orig/src/udev/udev-event.c
+++ systemd-221/src/udev/udev-event.c
@@ -796,20 +796,53 @@ out:
static int rename_netif(struct udev_event *event) {
struct udev_device *dev = event->dev;
char name[IFNAMSIZ];
@ -50,7 +50,7 @@ Index: systemd-218/src/udev/udev-event.c
+ oldname, interim, strerror(-r));
+ return r;
+ }
+
+
+ /* log temporary name */
+ log_info("renamed network interface %s to %s\n", oldname, interim);
+

View File

@ -1,5 +1,27 @@
--- systemd-210/rules/80-hotplug-cpu-mem.rules
+++ systemd-210/rules/80-hotplug-cpu-mem.rules 2014-05-21 15:47:01.885605543 +0000
---
Makefile.am | 4 ++++
rules/80-hotplug-cpu-mem.rules | 12 ++++++++++++
2 files changed, 16 insertions(+)
Index: systemd-221/Makefile.am
===================================================================
--- systemd-221.orig/Makefile.am
+++ systemd-221/Makefile.am
@@ -3841,6 +3841,10 @@ dist_udevrules_DATA += \
rules/73-seat-numlock.rules
# ------------------------------------------------------------------------------
+dist_udevrules_DATA += \
+ rules/80-hotplug-cpu-mem.rules
+
+# ------------------------------------------------------------------------------
mtd_probe_SOURCES = \
src/udev/mtd_probe/mtd_probe.c \
src/udev/mtd_probe/mtd_probe.h \
Index: systemd-221/rules/80-hotplug-cpu-mem.rules
===================================================================
--- /dev/null
+++ systemd-221/rules/80-hotplug-cpu-mem.rules
@@ -0,0 +1,12 @@
+# do not edit this file, it will be overwritten on update
+
@ -13,16 +35,3 @@
+
+#
+TAG=="tmpfs", RUN+="/usr/lib/udev/remount-tmpfs"
--- systemd-210/Makefile.am
+++ systemd-210/Makefile.am
@@ -2480,6 +2480,10 @@ dist_udevrules_DATA += \
rules/73-seat-numlock.rules
# ------------------------------------------------------------------------------
+dist_udevrules_DATA += \
+ rules/80-hotplug-cpu-mem.rules
+
+# ------------------------------------------------------------------------------
if ENABLE_GUDEV
if ENABLE_GTK_DOC
SUBDIRS += \

View File

@ -7,13 +7,13 @@ If any devices are marked with 'SYSTEMD_READY=0' then
we shouldn't run any btrfs check on them.
---
rules/64-btrfs.rules | 1 +
rules/64-btrfs.rules | 1 +
1 file changed, 1 insertion(+)
diff --git a/rules/64-btrfs.rules b/rules/64-btrfs.rules
index fe01001..57631bc 100644
--- a/rules/64-btrfs.rules
+++ b/rules/64-btrfs.rules
Index: systemd-221/rules/64-btrfs.rules
===================================================================
--- systemd-221.orig/rules/64-btrfs.rules
+++ systemd-221/rules/64-btrfs.rules
@@ -3,6 +3,7 @@
SUBSYSTEM!="block", GOTO="btrfs_end"
ACTION=="remove", GOTO="btrfs_end"
@ -22,6 +22,3 @@ index fe01001..57631bc 100644
# let the kernel know about this btrfs filesystem, and check if it is complete
IMPORT{builtin}="btrfs ready $devnode"
--
1.8.1.4

View File

@ -10,15 +10,15 @@ persistent symlinks to that device.
Otherwise systemd will get confused about which device to use.
---
rules/60-persistent-storage.rules | 7 +++++--
rules/60-persistent-storage.rules | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/rules/60-persistent-storage.rules b/rules/60-persistent-storage.rules
index 1208bd3..fd5bedd 100644
--- a/rules/60-persistent-storage.rules
+++ b/rules/60-persistent-storage.rules
@@ -39,8 +39,8 @@ KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="usb", IMPORT{builtin
# scsi devices
Index: systemd-221/rules/60-persistent-storage.rules
===================================================================
--- systemd-221.orig/rules/60-persistent-storage.rules
+++ systemd-221/rules/60-persistent-storage.rules
@@ -33,8 +33,8 @@ KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!
# SCSI devices
KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", IMPORT{program}="scsi_id --export --whitelisted -d $devnode", ENV{ID_BUS}="scsi"
KERNEL=="cciss*", ENV{DEVTYPE}=="disk", ENV{ID_SERIAL}!="?*", IMPORT{program}="scsi_id --export --whitelisted -d $devnode", ENV{ID_BUS}="cciss"
-KERNEL=="sd*|sr*|cciss*", ENV{DEVTYPE}=="disk", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
@ -28,7 +28,7 @@ index 1208bd3..fd5bedd 100644
# scsi compat links for ATA devices
KERNEL=="sd*[!0-9]", ENV{ID_BUS}=="ata", PROGRAM="scsi_id --whitelisted --replace-whitespace -p0x80 -d $devnode", RESULT=="?*", ENV{ID_SCSI_COMPAT}="$result", SYMLINK+="disk/by-id/scsi-$env{ID_SCSI_COMPAT}"
@@ -70,6 +70,9 @@ KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!="?*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DAT
@@ -66,6 +66,9 @@ KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!=
KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!="?*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="", \
IMPORT{builtin}="blkid --noraid"
@ -38,6 +38,3 @@ index 1208bd3..fd5bedd 100644
# probe filesystem metadata of disks
KERNEL!="sr*", IMPORT{builtin}="blkid"
--
1.8.1.4

View File

@ -1,11 +0,0 @@
--- systemd-210/rules/42-usb-hid-pm.rules.old 2014-04-23 10:54:31.694485615 +0200
+++ systemd-210/rules/42-usb-hid-pm.rules 2014-04-23 10:55:21.969423056 +0200
@@ -22,8 +22,6 @@ ACTION=="add", SUBSYSTEM=="usb", ATTR{id
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="413c", ATTR{idProduct}=="0000", TEST=="power/control", ATTR{power/control}="auto"
# IBM remote access
-ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="04b3", ATTR{idProduct}=="4001", TEST=="power/control", ATTR{power/control}="auto"
-ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="04b3", ATTR{idProduct}=="4002", TEST=="power/control", ATTR{power/control}="auto"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="04b3", ATTR{idProduct}=="4012", TEST=="power/control", ATTR{power/control}="auto"
# Raritan Computer, Inc KVM.

View File

@ -12,21 +12,18 @@ References: bnc#881942
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
rules/99-systemd.rules.in | 1 +
rules/99-systemd.rules.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/rules/99-systemd.rules.in b/rules/99-systemd.rules.in
index db72373..11ee262 100644
--- a/rules/99-systemd.rules.in
+++ b/rules/99-systemd.rules.in
@@ -11,6 +11,7 @@ SUBSYSTEM=="tty", KERNEL=="tty[a-zA-Z]*|hvc*|xvc*|hvsi*|ttysclp*|sclp_line*|3270
Index: systemd-221/rules/99-systemd.rules.in
===================================================================
--- systemd-221.orig/rules/99-systemd.rules.in
+++ systemd-221/rules/99-systemd.rules.in
@@ -10,6 +10,7 @@ ACTION=="remove", GOTO="systemd_end"
SUBSYSTEM=="tty", KERNEL=="tty[a-zA-Z]*|hvc*|xvc*|hvsi*|ttysclp*|sclp_line*|3270/tty*", TAG+="systemd"
KERNEL=="vport*", TAG+="systemd"
+SUBSYSTEM=="block", KERNEL!="ram*", ENV{SYSTEMD_READY}=="0", GOTO="systemd_end"
SUBSYSTEM=="block", KERNEL!="ram*", TAG+="systemd"
SUBSYSTEM=="block", KERNEL!="ram*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", ENV{SYSTEMD_READY}="0"
+SUBSYSTEM=="block", ENV{SYSTEMD_READY}=="0", GOTO="systemd_end"
SUBSYSTEM=="block", TAG+="systemd"
SUBSYSTEM=="block", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", ENV{SYSTEMD_READY}="0"
--
1.8.4.5

View File

@ -1,8 +1,14 @@
Exclude cd/dvd as well (bnc#882714)
--- systemd-210/src/udev/udevd.c
+++ systemd-210/src/udev/udevd.c 2014-06-18 12:53:34.454235577 +0000
@@ -744,7 +744,8 @@ static int synthesize_change(struct udev
---
src/udev/udevd.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Index: systemd-221/src/udev/udevd.c
===================================================================
--- systemd-221.orig/src/udev/udevd.c
+++ systemd-221/src/udev/udevd.c
@@ -1022,7 +1022,8 @@ static int synthesize_change(struct udev
if (streq_ptr("block", udev_device_get_subsystem(dev)) &&
streq_ptr("disk", udev_device_get_devtype(dev)) &&

View File

@ -29,8 +29,10 @@ Signed-off-by: Jeff Mahoney <jeffm@suse.com>
rules/64-btrfs.rules | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/rules/64-btrfs.rules
+++ b/rules/64-btrfs.rules
Index: systemd-221/rules/64-btrfs.rules
===================================================================
--- systemd-221.orig/rules/64-btrfs.rules
+++ systemd-221/rules/64-btrfs.rules
@@ -6,7 +6,8 @@ ENV{ID_FS_TYPE}!="btrfs", GOTO="btrfs_en
ENV{SYSTEMD_READY}=="0", GOTO="btrfs_end"

View File

@ -1,11 +1,15 @@
Index: systemd-210/rules/50-udev-default.rules
---
rules/50-udev-default.rules | 2 ++
1 file changed, 2 insertions(+)
Index: systemd-221/rules/50-udev-default.rules
===================================================================
--- systemd-210.orig/rules/50-udev-default.rules
+++ systemd-210/rules/50-udev-default.rules
@@ -66,4 +66,6 @@ KERNEL=="tun", MODE="0666", OPTIONS+="st
--- systemd-221.orig/rules/50-udev-default.rules
+++ systemd-221/rules/50-udev-default.rules
@@ -74,4 +74,6 @@ KERNEL=="tun", MODE="0666", OPTIONS+="st
KERNEL=="fuse", MODE="0666", OPTIONS+="static_node=fuse"
+KERNEL=="genwqe*", MODE="0666"
+
LABEL="default_permissions_end"
LABEL="default_end"

View File

@ -18,11 +18,11 @@ Signed-off-by: Jeff Mahoney <jeffm@suse.com>
src/udev/scsi_id/scsi_serial.c | 19 +++++++++++++------
4 files changed, 32 insertions(+), 7 deletions(-)
Index: systemd/rules/60-persistent-storage.rules
Index: systemd-221/rules/60-persistent-storage.rules
===================================================================
--- systemd.orig/rules/60-persistent-storage.rules
+++ systemd/rules/60-persistent-storage.rules
@@ -46,6 +46,10 @@ KERNEL=="sd*|cciss*", ENV{DEVTYPE}=="par
--- systemd-221.orig/rules/60-persistent-storage.rules
+++ systemd-221/rules/60-persistent-storage.rules
@@ -40,6 +40,10 @@ KERNEL=="sd*|cciss*", ENV{DEVTYPE}=="par
KERNEL=="sd*[!0-9]", ENV{ID_BUS}=="ata", PROGRAM="scsi_id --whitelisted --replace-whitespace -p0x80 -d $devnode", RESULT=="?*", ENV{ID_SCSI_COMPAT}="$result", SYMLINK+="disk/by-id/scsi-$env{ID_SCSI_COMPAT}"
KERNEL=="sd*[0-9]", ENV{ID_SCSI_COMPAT}=="?*", SYMLINK+="disk/by-id/scsi-$env{ID_SCSI_COMPAT}-part%n"
@ -30,13 +30,13 @@ Index: systemd/rules/60-persistent-storage.rules
+KERNEL=="sd*[!0-9]", ENV{ID_BUS}=="ata", PROGRAM="scsi_id --truncated-serial --whitelisted --replace-whitespace -p0x80 -d$tempnode", RESULT=="?*", ENV{ID_SCSI_COMPAT_TRUNCATED}="$result", SYMLINK+="disk/by-id/scsi-$env{ID_SCSI_COMPAT_TRUNCATED}"
+KERNEL=="sd*[0-9]", ENV{ID_SCSI_COMPAT_TRUNCATED}=="?*", SYMLINK+="disk/by-id/scsi-$env{ID_SCSI_COMPAT_TRUNCATED}-part%n"
+
# firewire
# FireWire
KERNEL=="sd*[!0-9]|sr*", ATTRS{ieee1394_id}=="?*", SYMLINK+="disk/by-id/ieee1394-$attr{ieee1394_id}"
KERNEL=="sd*[0-9]", ATTRS{ieee1394_id}=="?*", SYMLINK+="disk/by-id/ieee1394-$attr{ieee1394_id}-part%n"
Index: systemd/src/udev/scsi_id/scsi_id.c
Index: systemd-221/src/udev/scsi_id/scsi_id.c
===================================================================
--- systemd.orig/src/udev/scsi_id/scsi_id.c
+++ systemd/src/udev/scsi_id/scsi_id.c
--- systemd-221.orig/src/udev/scsi_id/scsi_id.c
+++ systemd-221/src/udev/scsi_id/scsi_id.c
@@ -43,6 +43,7 @@ static const struct option options[] = {
{ "replace-whitespace", no_argument, NULL, 'u' },
{ "sg-version", required_argument, NULL, 's' },
@ -94,11 +94,11 @@ Index: systemd/src/udev/scsi_id/scsi_id.c
util_replace_chars(serial_str, NULL);
printf("%s\n", serial_str);
goto out;
Index: systemd/src/udev/scsi_id/scsi_id.h
Index: systemd-221/src/udev/scsi_id/scsi_id.h
===================================================================
--- systemd.orig/src/udev/scsi_id/scsi_id.h
+++ systemd/src/udev/scsi_id/scsi_id.h
@@ -43,6 +43,7 @@ struct scsi_id_device {
--- systemd-221.orig/src/udev/scsi_id/scsi_id.h
+++ systemd-221/src/udev/scsi_id/scsi_id.h
@@ -45,6 +45,7 @@ struct scsi_id_device {
char kernel[64];
char serial[MAX_SERIAL_LEN];
char serial_short[MAX_SERIAL_LEN];
@ -106,11 +106,11 @@ Index: systemd/src/udev/scsi_id/scsi_id.h
int use_sg;
/* Always from page 0x80 e.g. 'B3G1P8500RWT' - may not be unique */
Index: systemd/src/udev/scsi_id/scsi_serial.c
Index: systemd-221/src/udev/scsi_id/scsi_serial.c
===================================================================
--- systemd.orig/src/udev/scsi_id/scsi_serial.c
+++ systemd/src/udev/scsi_id/scsi_serial.c
@@ -96,7 +96,8 @@ static const char hex_str[]="0123456789a
--- systemd-221.orig/src/udev/scsi_id/scsi_serial.c
+++ systemd-221/src/udev/scsi_id/scsi_serial.c
@@ -97,7 +97,8 @@ static const char hex_str[]="0123456789a
static int do_scsi_page80_inquiry(struct udev *udev,
struct scsi_id_device *dev_scsi, int fd,
@ -120,7 +120,7 @@ Index: systemd/src/udev/scsi_id/scsi_serial.c
static int sg_err_category_new(struct udev *udev,
int scsi_status, int msg_status, int
@@ -619,7 +620,7 @@ static int do_scsi_page83_inquiry(struct
@@ -620,7 +621,7 @@ static int do_scsi_page83_inquiry(struct
unsigned char page_83[SCSI_INQ_BUFF_LEN];
/* also pick up the page 80 serial number */
@ -129,7 +129,7 @@ Index: systemd/src/udev/scsi_id/scsi_serial.c
memzero(page_83, SCSI_INQ_BUFF_LEN);
retval = scsi_inquiry(udev, dev_scsi, fd, 1, PAGE_83, page_83,
@@ -764,7 +765,8 @@ static int do_scsi_page83_prespc3_inquir
@@ -765,7 +766,8 @@ static int do_scsi_page83_prespc3_inquir
/* Get unit serial number VPD page */
static int do_scsi_page80_inquiry(struct udev *udev,
struct scsi_id_device *dev_scsi, int fd,
@ -139,7 +139,7 @@ Index: systemd/src/udev/scsi_id/scsi_serial.c
{
int retval;
int ser_ind;
@@ -798,9 +800,14 @@ static int do_scsi_page80_inquiry(struct
@@ -799,9 +801,14 @@ static int do_scsi_page80_inquiry(struct
ser_ind = prepend_vendor_model(udev, dev_scsi, &serial[1]);
if (ser_ind < 0)
return 1;
@ -155,7 +155,7 @@ Index: systemd/src/udev/scsi_id/scsi_serial.c
}
if (serial_short != NULL) {
memcpy(serial_short, &buf[4], len);
@@ -876,7 +883,7 @@ int scsi_get_serial(struct udev *udev,
@@ -877,7 +884,7 @@ int scsi_get_serial(struct udev *udev,
return 1;
if (page_code == PAGE_80) {
@ -164,7 +164,7 @@ Index: systemd/src/udev/scsi_id/scsi_serial.c
retval = 1;
goto completed;
} else {
@@ -950,7 +957,7 @@ int scsi_get_serial(struct udev *udev,
@@ -951,7 +958,7 @@ int scsi_get_serial(struct udev *udev,
for (ind = 4; ind <= page0[3] + 3; ind++)
if (page0[ind] == PAGE_80)
if (!do_scsi_page80_inquiry(udev, dev_scsi, fd,

View File

@ -3,22 +3,22 @@
rules/60-ssd-scheduler.rules | 11 +++++++++++
2 files changed, 12 insertions(+)
Index: systemd/Makefile.am
Index: systemd-221/Makefile.am
===================================================================
--- systemd.orig/Makefile.am
+++ systemd/Makefile.am
@@ -3576,6 +3576,7 @@ dist_udevrules_DATA += \
--- systemd-221.orig/Makefile.am
+++ systemd-221/Makefile.am
@@ -3501,6 +3501,7 @@ dist_udevrules_DATA += \
rules/60-persistent-input.rules \
rules/60-persistent-alsa.rules \
rules/60-persistent-storage.rules \
+ rules/60-ssd-scheduler.rules \
rules/60-serial.rules \
rules/64-btrfs.rules \
rules/70-mouse.rules \
rules/70-touchpad.rules \
Index: systemd/rules/60-ssd-scheduler.rules
Index: systemd-221/rules/60-ssd-scheduler.rules
===================================================================
--- /dev/null
+++ systemd/rules/60-ssd-scheduler.rules
+++ systemd-221/rules/60-ssd-scheduler.rules
@@ -0,0 +1,11 @@
+# do not edit this file, it will be overwritten on update
+

View File

@ -5,12 +5,10 @@
units/systemd-udev-root-symlink.service.in | 10 ++
4 files changed, 96 insertions(+)
Index: systemd/Makefile.am
===================================================================
--- systemd.orig/Makefile.am
+++ systemd/Makefile.am
@@ -3862,6 +3862,25 @@ EXTRA_DIST += \
--- systemd-222.orig/Makefile.am
+++ systemd-222/Makefile.am
@@ -3759,6 +3759,25 @@ EXTRA_DIST += \
test/mocks/fsck
# ------------------------------------------------------------------------------
+rootsymlink_generator_SOURCES = \
@ -35,10 +33,8 @@ Index: systemd/Makefile.am
ata_id_SOURCES = \
src/udev/ata_id/ata_id.c
Index: systemd/src/udev/rootsymlink_generator/rootsymlink_generator.c
===================================================================
--- /dev/null
+++ systemd/src/udev/rootsymlink_generator/rootsymlink_generator.c
+++ systemd-222/src/udev/rootsymlink_generator/rootsymlink_generator.c
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2014-2015 Robert Milasan <rmilasan@suse.com>
@ -97,10 +93,8 @@ Index: systemd/src/udev/rootsymlink_generator/rootsymlink_generator.c
+ return errno;
+ return 0;
+}
Index: systemd/units/systemd-udev-root-symlink.service
===================================================================
--- /dev/null
+++ systemd/units/systemd-udev-root-symlink.service
+++ systemd-222/units/systemd-udev-root-symlink.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Rule generator for /dev/root symlink
@ -112,10 +106,8 @@ Index: systemd/units/systemd-udev-root-symlink.service
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/lib/udev/rootsymlink-generator
Index: systemd/units/systemd-udev-root-symlink.service.in
===================================================================
--- /dev/null
+++ systemd/units/systemd-udev-root-symlink.service.in
+++ systemd-222/units/systemd-udev-root-symlink.service.in
@@ -0,0 +1,10 @@
+[Unit]
+Description=Rule generator for /dev/root symlink

View File

@ -2,25 +2,25 @@
src/udev/udevd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: systemd-218/src/udev/udevd.c
Index: systemd-221/src/udev/udevd.c
===================================================================
--- systemd-218.orig/src/udev/udevd.c
+++ systemd-218/src/udev/udevd.c
@@ -446,7 +446,7 @@ static void event_run(struct event *even
--- systemd-221.orig/src/udev/udevd.c
+++ systemd-221/src/udev/udevd.c
@@ -569,7 +569,7 @@ static void event_run(Manager *manager,
if (children >= arg_children_max) {
if (hashmap_size(manager->workers) >= arg_children_max) {
if (arg_children_max > 1)
- log_debug("maximum number (%i) of children reached", children);
+ log_error("maximum number (%i) of children reached", children);
- log_debug("maximum number (%i) of children reached", hashmap_size(manager->workers));
+ log_error("maximum number (%i) of children reached", hashmap_size(manager->workers));
return;
}
@@ -1265,7 +1265,7 @@ int main(int argc, char *argv[]) {
@@ -1641,7 +1641,7 @@ int main(int argc, char *argv[]) {
arg_children_max = 8;
if (sched_getaffinity(0, sizeof (cpu_set), &cpu_set) == 0) {
- arg_children_max += CPU_COUNT(&cpu_set) * 2;
- arg_children_max += CPU_COUNT(&cpu_set) * 2;
+ arg_children_max += CPU_COUNT(&cpu_set) * 64;
}
}
log_debug("set children_max to %u", arg_children_max);
log_debug("set children_max to %u", arg_children_max);

View File

@ -1,8 +1,12 @@
Index: systemd-219/units/systemd-networkd.service.in
---
units/systemd-networkd.service.m4.in | 1 +
1 file changed, 1 insertion(+)
Index: systemd-221/units/systemd-networkd.service.m4.in
===================================================================
--- systemd-219.orig/units/systemd-networkd.service.in
+++ systemd-219/units/systemd-networkd.service.in
@@ -29,4 +29,5 @@ WatchdogSec=1min
--- systemd-221.orig/units/systemd-networkd.service.m4.in
+++ systemd-221/units/systemd-networkd.service.m4.in
@@ -34,4 +34,5 @@ WatchdogSec=1min
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,19 @@
---
src/login/pam_systemd.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--- src/login/pam_systemd.c
+++ src/login/pam_systemd.c 2015-07-29 08:52:20.762018565 +0000
@@ -507,7 +507,11 @@ _public_ PAM_EXTERN int pam_sm_open_sess
r = pam_set_data(handle, "systemd.session-fd", INT_TO_PTR(session_fd+1), NULL);
if (r != PAM_SUCCESS) {
pam_syslog(handle, LOG_ERR, "Failed to install session fd.");
- safe_close(session_fd);
+ if (session_fd >= 0) {
+ PROTECT_ERRNO;
+ if (_unlikely_(!(close_nointr(session_fd) != -EBADF)))
+ pam_syslog(handle, LOG_ERR, "Unexpected error code on closing session fd: %m");
+ }
return r;
}
}

View File

@ -8,10 +8,10 @@ disable /var/lock/{subsys,lockdev} and change default permissions on
tmpfiles.d/legacy.conf | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
Index: systemd-218/tmpfiles.d/legacy.conf
Index: systemd-221/tmpfiles.d/legacy.conf
===================================================================
--- systemd-218.orig/tmpfiles.d/legacy.conf
+++ systemd-218/tmpfiles.d/legacy.conf
--- systemd-221.orig/tmpfiles.d/legacy.conf
+++ systemd-221/tmpfiles.d/legacy.conf
@@ -10,13 +10,14 @@
# These files are considered legacy and are unnecessary on legacy-free
# systems.
@ -36,5 +36,5 @@ Index: systemd-218/tmpfiles.d/legacy.conf
-d /run/lock/lockdev 0775 root lock -
+#d /run/lock/lockdev 0775 root lock -
# /forcefsck, /fastboot and /forcequotecheck are deprecated in favor of the
# /forcefsck, /fastboot and /forcequotacheck are deprecated in favor of the
# kernel command line options 'fsck.mode=force', 'fsck.mode=skip' and

View File

@ -1,97 +0,0 @@
From: Frederic Crozat <fcrozat@suse.com>
Date: Tue, 19 Feb 2013 11:20:31 +0100
Subject: Forward suspend / hibernate calls to pm-utils
forward suspend/hibernation calls to pm-utils, if installed (bnc#790157)
---
src/sleep/sleep.c | 27 ++++++++++++++++++++++-----
1 file changed, 22 insertions(+), 5 deletions(-)
Index: systemd/src/sleep/sleep.c
===================================================================
--- systemd.orig/src/sleep/sleep.c
+++ systemd/src/sleep/sleep.c
@@ -24,6 +24,7 @@
#include <errno.h>
#include <string.h>
#include <getopt.h>
+#include <stdlib.h>
#include "sd-id128.h"
#include "sd-messages.h"
@@ -36,6 +37,8 @@
#include "def.h"
static char* arg_verb = NULL;
+static bool delegate_to_pmutils = false;
+static const char *pmtools;
static int write_mode(char **modes) {
int r = 0;
@@ -53,10 +56,6 @@ static int write_mode(char **modes) {
if (r == 0)
r = k;
}
-
- if (r < 0)
- log_error_errno(r, "Failed to write mode to /sys/power/disk: %m");
-
return r;
}
@@ -97,6 +96,8 @@ static int execute(char **modes, char **
int r;
_cleanup_fclose_ FILE *f = NULL;
+ if (!delegate_to_pmutils) {
+
/* This file is opened first, so that if we hit an error,
* we can abort before modifying any state. */
f = fopen("/sys/power/state", "we");
@@ -107,6 +108,7 @@ static int execute(char **modes, char **
r = write_mode(modes);
if (r < 0)
return r;
+ }
execute_directories(dirs, DEFAULT_TIMEOUT_USEC, arguments);
@@ -115,8 +117,10 @@ static int execute(char **modes, char **
LOG_MESSAGE("Suspending system..."),
"SLEEP=%s", arg_verb,
NULL);
-
+ if (!delegate_to_pmutils)
r = write_state(&f, states);
+ else
+ r = -system(pmtools);
if (r < 0)
return r;
@@ -156,6 +160,7 @@ static int parse_argv(int argc, char *ar
};
int c;
+ struct stat buf;
assert(argc >= 0);
assert(argv);
@@ -193,6 +198,18 @@ static int parse_argv(int argc, char *ar
return -EINVAL;
}
+ if (streq(arg_verb, "suspend")) {
+ pmtools = "/usr/sbin/pm-suspend";
+ }
+ else if (streq(arg_verb, "hibernate") || streq(arg_verb, "hybrid-sleep")) {
+ if (streq(arg_verb, "hibernate"))
+ pmtools = "/usr/sbin/pm-hibernate";
+ else
+ pmtools = "/usr/sbin/pm-suspend-hybrid";
+ }
+
+ delegate_to_pmutils = (stat(pmtools, &buf) >= 0 && S_ISREG(buf.st_mode) && (buf.st_mode & 0111));
+
return 1 /* work to do */;
}

View File

@ -15,4 +15,3 @@ Type=idle
ExecStart=/etc/init.d/after.local
TimeoutSec=0
RemainAfterExit=yes
SysVStartPriority=99

View File

@ -4,13 +4,15 @@ Subject: allow multiple sulogin to be started
allows multiple sulogin instance (bnc#793182).
---
units/getty@.service.m4 | 1 +
units/rescue.target | 1 +
units/serial-getty@.service.m4 | 1 +
units/getty@.service.m4 | 1 +
units/rescue.target | 1 +
units/serial-getty@.service.m4 | 1 +
3 files changed, 3 insertions(+)
--- systemd-206.orig/units/getty@.service.m4
+++ systemd-206/units/getty@.service.m4
Index: systemd-221/units/getty@.service.m4
===================================================================
--- systemd-221.orig/units/getty@.service.m4
+++ systemd-221/units/getty@.service.m4
@@ -9,6 +9,7 @@
Description=Getty on %I
Documentation=man:agetty(8) man:systemd-getty-generator(8)
@ -19,8 +21,10 @@ allows multiple sulogin instance (bnc#793182).
After=systemd-user-sessions.service plymouth-quit-wait.service
m4_ifdef(`HAVE_SYSV_COMPAT',
After=rc-local.service
--- systemd-206.orig/units/rescue.target
+++ systemd-206/units/rescue.target
Index: systemd-221/units/rescue.target
===================================================================
--- systemd-221.orig/units/rescue.target
+++ systemd-221/units/rescue.target
@@ -10,6 +10,7 @@ Description=Rescue Mode
Documentation=man:systemd.special(7)
Requires=sysinit.target rescue.service
@ -29,8 +33,10 @@ allows multiple sulogin instance (bnc#793182).
AllowIsolate=yes
[Install]
--- systemd-206.orig/units/serial-getty@.service.m4
+++ systemd-206/units/serial-getty@.service.m4
Index: systemd-221/units/serial-getty@.service.m4
===================================================================
--- systemd-221.orig/units/serial-getty@.service.m4
+++ systemd-221/units/serial-getty@.service.m4
@@ -10,6 +10,7 @@ Description=Serial Getty on %I
Documentation=man:agetty(8) man:systemd-getty-generator(8)
Documentation=http://0pointer.de/blog/projects/serial-console.html

View File

@ -4,14 +4,14 @@ Subject: apply ACL for nvidia device nodes
set ACL on nvidia devices (bnc#808319).
---
logind-acl.c | 12 ++++++++++++
src/login/logind-acl.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
Index: systemd-210/src/login/logind-acl.c
Index: systemd-221/src/login/logind-acl.c
===================================================================
--- systemd-210.orig/src/login/logind-acl.c
+++ systemd-210/src/login/logind-acl.c
@@ -283,5 +283,17 @@ int devnode_acl_all(struct udev *udev,
--- systemd-221.orig/src/login/logind-acl.c
+++ systemd-221/src/login/logind-acl.c
@@ -285,5 +285,17 @@ int devnode_acl_all(struct udev *udev,
r = k;
}

View File

@ -5,13 +5,13 @@ Subject: [PATCH] apply ACL for nvidia-uvm device node
set ACL on nvidia-uvm device (bnc#879767).
---
src/login/logind-acl.c | 2 ++
src/login/logind-acl.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/login/logind-acl.c b/src/login/logind-acl.c
index 54bc16b..a40af21 100644
--- a/src/login/logind-acl.c
+++ b/src/login/logind-acl.c
Index: systemd-221/src/login/logind-acl.c
===================================================================
--- systemd-221.orig/src/login/logind-acl.c
+++ systemd-221/src/login/logind-acl.c
@@ -295,6 +295,8 @@ int devnode_acl_all(struct udev *udev,
if (devnode_acl(devname, flush, del, old_uid, add, new_uid) < 0)
break;
@ -21,6 +21,3 @@ index 54bc16b..a40af21 100644
}
return r;
--
1.8.4.5

View File

@ -1,8 +1,28 @@
Nasty bug reported on bnc#867663
--- systemd-210/src/core/manager.c
+++ systemd-210/src/core/manager.c 2014-04-17 13:29:07.366236714 +0000
@@ -1780,7 +1780,8 @@ static int manager_dispatch_jobs_in_prog
---
src/basic/def.h | 2 +-
src/core/manager.c | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
Index: systemd-221/src/basic/def.h
===================================================================
--- systemd-221.orig/src/basic/def.h
+++ systemd-221/src/basic/def.h
@@ -37,7 +37,7 @@
#define SYSTEMD_CGROUP_CONTROLLER "systemd"
-#define SIGNALS_CRASH_HANDLER SIGSEGV,SIGILL,SIGFPE,SIGBUS,SIGQUIT,SIGABRT
+#define SIGNALS_CRASH_HANDLER SIGSEGV,SIGILL,SIGFPE,SIGBUS,SIGQUIT,SIGABRT,SIGTRAP,SIGSYS
#define SIGNALS_IGNORE SIGPIPE
#define DIGITS "0123456789"
Index: systemd-221/src/core/manager.c
===================================================================
--- systemd-221.orig/src/core/manager.c
+++ systemd-221/src/core/manager.c
@@ -1991,7 +1991,8 @@ static int manager_dispatch_jobs_in_prog
assert(m);
assert(source);
@ -12,14 +32,3 @@ Nasty bug reported on bnc#867663
next = now(CLOCK_MONOTONIC) + JOBS_IN_PROGRESS_PERIOD_USEC;
r = sd_event_source_set_time(source, next);
--- systemd-210/src/shared/def.h
+++ systemd-210/src/shared/def.h 2014-04-17 13:47:10.946234983 +0000
@@ -37,7 +37,7 @@
#define SYSTEMD_CGROUP_CONTROLLER "name=systemd"
-#define SIGNALS_CRASH_HANDLER SIGSEGV,SIGILL,SIGFPE,SIGBUS,SIGQUIT,SIGABRT
+#define SIGNALS_CRASH_HANDLER SIGSEGV,SIGILL,SIGFPE,SIGBUS,SIGQUIT,SIGABRT,SIGTRAP,SIGSYS
#define SIGNALS_IGNORE SIGPIPE
#define DIGITS "0123456789"

View File

@ -7,8 +7,14 @@ later by a shutdown may fail with (journalctl -b -1):
which then caused the subsequent fault that umounting the users
home directories done by automount are busy.
--- systemd-210/units/user/systemd-exit.service.in
+++ systemd-210/units/user/systemd-exit.service.in 2014-03-25 16:59:20.406235916 +0000
---
units/user/systemd-exit.service.in | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
Index: systemd-221/units/user/systemd-exit.service.in
===================================================================
--- systemd-221.orig/units/user/systemd-exit.service.in
+++ systemd-221/units/user/systemd-exit.service.in
@@ -10,8 +10,9 @@ Description=Exit the Session
Documentation=man:systemd.special(7)
DefaultDependencies=no

View File

@ -2,9 +2,7 @@ systemd
supplements "packageand(systemd:pam-<targettype>)"
-/lib/systemd/system/
post "<prefix>%{_sbindir}/pam-config -a --systemd || :"
# postun "if [ "$1" == "0" ]; then"
# postun "<prefix>%{_sbindir}/pam-config -d --systemd || :"
# postun "fi"
libgudev-1_0-0
libsystemd0
libudev1
nss-myhostname
nss-mymachines

View File

@ -1,6 +1,11 @@
diff -Naur systemd-210/units/rc-local.service.in systemd-210-mod/units/rc-local.service.in
--- systemd-210/units/rc-local.service.in 2013-08-13 22:02:52.788756123 +0200
+++ systemd-210-mod/units/rc-local.service.in 2014-03-25 08:34:40.317587764 +0100
---
units/rc-local.service.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: systemd-221/units/rc-local.service.in
===================================================================
--- systemd-221.orig/units/rc-local.service.in
+++ systemd-221/units/rc-local.service.in
@@ -10,7 +10,7 @@
[Unit]
Description=@RC_LOCAL_SCRIPT_PATH_START@ Compatibility

View File

@ -9,8 +9,10 @@ ensure passphrase is handled before starting getty on tty1.
units/systemd-ask-password-wall.service.in | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- systemd-206_git201308300826.orig/units/systemd-ask-password-wall.service.in
+++ systemd-206_git201308300826/units/systemd-ask-password-wall.service.in
Index: systemd-221/units/systemd-ask-password-wall.service.in
===================================================================
--- systemd-221.orig/units/systemd-ask-password-wall.service.in
+++ systemd-221/units/systemd-ask-password-wall.service.in
@@ -8,7 +8,8 @@
[Unit]
Description=Forward Password Requests to Wall

View File

@ -4,30 +4,28 @@ Subject: ensure shortname is set as hostname (bnc#820213)
strip hostname so the domain part isn't set as part of the hostname
---
src/core/hostname-setup.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
src/core/hostname-setup.c | 4 ++++
1 file changed, 4 insertions(+)
Index: systemd-218/src/core/hostname-setup.c
Index: systemd-221/src/core/hostname-setup.c
===================================================================
--- systemd-218.orig/src/core/hostname-setup.c
+++ systemd-218/src/core/hostname-setup.c
@@ -32,7 +32,7 @@
#include "fileio.h"
static int read_and_strip_hostname(const char *path, char **hn) {
- char *s;
+ char *s, *domain;
--- systemd-221.orig/src/core/hostname-setup.c
+++ systemd-221/src/core/hostname-setup.c
@@ -34,6 +34,7 @@ int hostname_setup(void) {
int r;
_cleanup_free_ char *b = NULL;
const char *hn;
+ char *domain;
bool enoent = false;
assert(path);
@@ -49,6 +49,10 @@ static int read_and_strip_hostname(const
return -ENOENT;
}
r = read_hostname_config("/etc/hostname", &b);
@@ -46,6 +47,9 @@ int hostname_setup(void) {
hn = NULL;
} else
hn = b;
+ /* strip any leftover of a domain name */
+ if ((domain = strchr(s, '.')) != NULL)
+ if ((domain = strchr(hn, '.')) != NULL)
+ *domain = '\0';
+
*hn = s;
return 0;
}
if (isempty(hn)) {
/* Don't override the hostname if it is already set

View File

@ -3,14 +3,14 @@ Date: Thu, 23 Aug 2012 11:08:25 +0200
Subject: fix support for boot prefixed initscript (bnc#746506)
---
src/systemctl/systemctl.c | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
src/systemctl/systemctl.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
Index: systemd-218/src/systemctl/systemctl.c
Index: systemd-221/src/systemctl/systemctl.c
===================================================================
--- systemd-218.orig/src/systemctl/systemctl.c
+++ systemd-218/src/systemctl/systemctl.c
@@ -5202,8 +5202,26 @@ static int enable_sysv_units(const char
--- systemd-221.orig/src/systemctl/systemctl.c
+++ systemd-221/src/systemctl/systemctl.c
@@ -5165,8 +5165,24 @@ static int enable_sysv_units(const char
p[strlen(p) - strlen(".service")] = 0;
found_sysv = access(p, F_OK) >= 0;
@ -27,14 +27,12 @@ Index: systemd-218/src/systemctl/systemctl.c
+ return -ENOMEM;
+ p[strlen(p) - sizeof(".service") + 1] = 0;
+ found_sysv = access(p, F_OK) >= 0;
+
+ if (!found_sysv) {
+ if (!found_sysv)
+ continue;
+ }
+#else
continue;
+#endif
+ }
log_info("%s is not a native service, redirecting to /sbin/chkconfig.", name);
if (found_native)
log_info("Synchronizing state of %s with SysV init with %s...", name, argv[0]);

View File

@ -1,36 +1,41 @@
From: Frederic Crozat <fcrozat@suse.com>
Date: Fri, 19 Aug 2011 15:29:49 +0000
Original-From: Frederic Crozat <fcrozat@suse.com>
Original-Date: Fri, 19 Aug 2011 15:29:49 +0000
Subject: handle disable_caplock and compose_table and kbd_rate
References: https://bugzilla.opensuse.org/746595
Last-Editor: Jan Engelhardt <jengelh@inai.de>
Date: Fri Jun 19 21:36:27 CEST 2015
(bnc#746595)
---
src/vconsole/vconsole-setup.c | 151 +++++++++++++++++++++++++++++++++++++++++-
1 file changed, 148 insertions(+), 3 deletions(-)
src/vconsole/vconsole-setup.c | 151 ++++++++++++++++++++++++++++++++++++++++--
1 file changed, 147 insertions(+), 4 deletions(-)
Index: systemd-218/src/vconsole/vconsole-setup.c
Index: systemd-221/src/vconsole/vconsole-setup.c
===================================================================
--- systemd-218.orig/src/vconsole/vconsole-setup.c
+++ systemd-218/src/vconsole/vconsole-setup.c
@@ -40,6 +40,7 @@
#include "macro.h"
--- systemd-221.orig/src/vconsole/vconsole-setup.c
+++ systemd-221/src/vconsole/vconsole-setup.c
@@ -35,6 +35,8 @@
#include "log.h"
#include "virt.h"
#include "fileio.h"
+#include "macro.h"
+#include "strv.h"
static bool is_vconsole(int fd) {
unsigned char data[1];
@@ -101,8 +102,8 @@ static int enable_utf8(int fd) {
#include "process-util.h"
#include "terminal-util.h"
#include "signal-util.h"
@@ -99,8 +101,10 @@ static int enable_utf8(int fd) {
return r;
}
-static int keymap_load(const char *vc, const char *map, const char *map_toggle, bool utf8, pid_t *_pid) {
-static int keyboard_load_and_wait(const char *vc, const char *map, const char *map_toggle, bool utf8) {
- const char *args[8];
+static int keymap_load(const char *vc, const char *map, const char *map_toggle, bool utf8, bool disable_capslock, pid_t *_pid) {
+static int keyboard_load_and_wait(const char *vc, const char *map,
+ const char *map_toggle, bool utf8, bool disable_capslock)
+{
+ const char *args[9];
int i = 0;
int i = 0, r;
pid_t pid;
@@ -121,6 +122,8 @@ static int keymap_load(const char *vc, c
@@ -117,6 +121,8 @@ static int keyboard_load_and_wait(const
args[i++] = map;
if (map_toggle)
args[i++] = map_toggle;
@ -39,23 +44,23 @@ Index: systemd-218/src/vconsole/vconsole-setup.c
args[i++] = NULL;
pid = fork();
@@ -236,11 +239,113 @@ static void font_copy_to_all_vcs(int fd)
@@ -246,11 +252,117 @@ static void font_copy_to_all_vcs(int fd)
}
}
+#ifdef HAVE_SYSV_COMPAT
+static int load_compose_table(const char *vc, const char *compose_table, pid_t *_pid) {
+static int compose_load_and_wait(const char *vc, const char *compose_table)
+{
+ const char *args[1024];
+ int i = 0, j = 0;
+ unsigned int i = 0, j = 0;
+ int ret;
+ pid_t pid;
+ char **strv_compose_table = NULL;
+ char *to_free[1024];
+
+ if (isempty(compose_table)) {
+ /* An empty map means no compose table*/
+ *_pid = 0;
+ return 0;
+ }
+ if (isempty(compose_table))
+ /* An empty map means no compose table */
+ return 1;
+
+ args[i++] = KBD_LOADKEYS;
+ args[i++] = "-q";
@ -69,50 +74,51 @@ Index: systemd-218/src/vconsole/vconsole-setup.c
+ char **name;
+ char *arg;
+
+ STRV_FOREACH (name, strv_compose_table) {
+ if (streq(*name,"-c") || streq(*name,"clear")) {
+ STRV_FOREACH(name, strv_compose_table) {
+ if (streq(*name, "-c") || streq(*name, "clear")) {
+ compose_clear = true;
+ continue;
+ }
+ if (!compose_loaded) {
+ if (compose_clear)
+ args[i++] = "-c";
+ }
+ asprintf(&arg, "compose.%s",*name);
+ if (!compose_loaded && compose_clear)
+ args[i++] = "-c";
+ asprintf(&arg, "compose.%s", *name);
+ compose_loaded = true;
+ args[i++] = to_free[j++] = arg;
+
+ if (i >= ELEMENTSOF(args) - 1)
+ break;
+ }
+ strv_free(strv_compose_table);
+ }
+ args[i++] = NULL;
+
+ if ((pid = fork()) < 0) {
+ log_error("Failed to fork: %m");
+ return -errno;
+ } else if (pid == 0) {
+ pid = fork();
+ if (pid < 0)
+ return log_error_errno(errno, "Failed to fork: %m");
+ if (pid == 0) {
+ reset_all_signal_handlers();
+ reset_signal_mask();
+ execv(args[0], (char **) args);
+ _exit(EXIT_FAILURE);
+ }
+
+ *_pid = pid;
+
+ for (i=0 ; i < j ; i++)
+ free (to_free[i]);
+
+ return 0;
+ ret = wait_for_terminate_and_warn(args[0], pid, true);
+ for (i = 0; i < j; ++i)
+ free(to_free[i]);
+ if (ret < 0)
+ return ret;
+ return ret == 0;
+}
+#endif
+
+static int set_kbd_rate(const char *vc, const char *kbd_rate, const char *kbd_delay, pid_t *_pid) {
+static int kbdrate_set_and_wait(const char *vc, const char *kbd_rate,
+ const char *kbd_delay)
+{
+ const char *args[7];
+ int i = 0;
+ int i = 0, ret;
+ pid_t pid;
+
+ if (isempty(kbd_rate) && isempty(kbd_delay)) {
+ *_pid = 0;
+ return 0;
+ }
+ if (isempty(kbd_rate) && isempty(kbd_delay))
+ return 1;
+
+ args[i++] = "/bin/kbdrate";
+ if (!isempty(kbd_rate)) {
@ -126,16 +132,19 @@ Index: systemd-218/src/vconsole/vconsole-setup.c
+ args[i++] = "-s";
+ args[i++] = NULL;
+
+ if ((pid = fork()) < 0) {
+ log_error("Failed to fork: %m");
+ return -errno;
+ } else if (pid == 0) {
+ pid = fork();
+ if (pid < 0)
+ return log_error_errno(errno, "Failed to fork: %m");
+ if (pid == 0) {
+ reset_all_signal_handlers();
+ reset_signal_mask();
+ execv(args[0], (char **) args);
+ _exit(EXIT_FAILURE);
+ }
+
+ *_pid = pid;
+ return 0;
+ ret = wait_for_terminate_and_warn(args[0], pid, true);
+ if (ret < 0)
+ return ret;
+ return ret == 0;
+}
+
int main(int argc, char **argv) {
@ -147,13 +156,13 @@ Index: systemd-218/src/vconsole/vconsole-setup.c
+ _cleanup_free_ char
+ *vc_kbd_delay = NULL, *vc_kbd_rate = NULL,
+ *vc_kbd_disable_caps_lock = NULL, *vc_compose_table = NULL;
+ pid_t kbd_rate_pid = 0, compose_table_pid = 0;
+#endif
+ bool disable_capslock = false;
+ bool comp_ok, rate_ok;
_cleanup_close_ int fd = -1;
bool utf8;
pid_t font_pid = 0, keymap_pid = 0;
@@ -273,6 +378,28 @@ int main(int argc, char **argv) {
bool utf8, font_copy = false, font_ok, keyboard_ok;
int r = EXIT_FAILURE;
@@ -281,6 +393,31 @@ int main(int argc, char **argv) {
utf8 = is_locale_utf8();
@ -166,7 +175,8 @@ Index: systemd-218/src/vconsole/vconsole-setup.c
+ "COMPOSETABLE", &vc_compose_table,
+ NULL);
+ if (r < 0 && r != -ENOENT)
+ log_warning("Failed to read /etc/sysconfig/keyboard: %s", strerror(-r));
+ log_warning("Failed to read /etc/sysconfig/keyboard: %s",
+ strerror(-r));
+
+ r = parse_env_file("/etc/sysconfig/console", NEWLINE,
+ "CONSOLE_FONT", &vc_font,
@ -174,45 +184,33 @@ Index: systemd-218/src/vconsole/vconsole-setup.c
+ "CONSOLE_UNICODEMAP", &vc_font_unimap,
+ NULL);
+ if (r < 0 && r != -ENOENT)
+ log_warning("Failed to read /etc/sysconfig/console: %s", strerror(-r));
+ log_warning("Failed to read /etc/sysconfig/console: %s",
+ strerror(-r));
+
+ disable_capslock = vc_kbd_disable_caps_lock && strcasecmp(vc_kbd_disable_caps_lock, "YES") == 0;
+#endif
+ disable_capslock = vc_kbd_disable_caps_lock &&
+ strcasecmp(vc_kbd_disable_caps_lock, "YES") == 0;
+#endif /* HAVE_SYSV_COMPAT */
+
r = parse_env_file("/etc/vconsole.conf", NEWLINE,
"KEYMAP", &vc_keymap,
"KEYMAP_TOGGLE", &vc_keymap_toggle,
@@ -312,14 +439,32 @@ int main(int argc, char **argv) {
if (font_pid > 0)
wait_for_terminate_and_warn(KBD_SETFONT, font_pid, true);
@@ -312,11 +449,17 @@ int main(int argc, char **argv) {
(void) disable_utf8(fd);
- r = keymap_load(vc, vc_keymap, vc_keymap_toggle, utf8, &keymap_pid);
+ r = keymap_load(vc, vc_keymap, vc_keymap_toggle, utf8, disable_capslock, &keymap_pid);
if (r < 0) {
log_error_errno(r, "Failed to start " KBD_LOADKEYS ": %m");
return EXIT_FAILURE;
}
font_ok = font_load_and_wait(vc, vc_font, vc_font_map, vc_font_unimap) > 0;
- keyboard_ok = keyboard_load_and_wait(vc, vc_keymap, vc_keymap_toggle, utf8) > 0;
+ keyboard_ok = keyboard_load_and_wait(vc, vc_keymap, vc_keymap_toggle,
+ utf8, disable_capslock) > 0;
+#ifdef HAVE_SYSV_COMPAT
+ r = load_compose_table(vc, vc_compose_table, &compose_table_pid);
+ if (r < 0) {
+ log_error_errno(r, "Failed to start " KBD_LOADKEYS " loading the compose table: %m");
+ return EXIT_FAILURE;
+ }
+ r = set_kbd_rate(vc, vc_kbd_rate, vc_kbd_delay, &kbd_rate_pid);
+ if (r < 0) {
+ log_error_errno(r, "Failed to start kbdrate: %m");
+ return EXIT_FAILURE;
+ }
+ comp_ok = compose_load_and_wait(vc, vc_compose_table);
+ rate_ok = kbdrate_set_and_wait(vc, vc_kbd_rate, vc_kbd_delay);
+#endif
if (keymap_pid > 0)
wait_for_terminate_and_warn(KBD_LOADKEYS, keymap_pid, true);
+#ifdef HAVE_SYSV_COMPAT
+ if (compose_table_pid > 0)
+ wait_for_terminate_and_warn(KBD_LOADKEYS, compose_table_pid, true);
+ if (kbd_rate_pid > 0)
+ wait_for_terminate_and_warn("/usr/bin/kbdrate", kbd_rate_pid, true);
+#endif
/* Only copy the font when we executed setfont successfully */
if (font_copy && font_ok)
(void) font_copy_to_all_vcs(fd);
/* Only copy the font when we started setfont successfully */
if (font_copy && font_pid > 0)
- return font_ok && keyboard_ok ? EXIT_SUCCESS : EXIT_FAILURE;
+ return font_ok && keyboard_ok && comp_ok && rate_ok ?
+ EXIT_SUCCESS : EXIT_FAILURE;
}

View File

@ -14,12 +14,10 @@ Cristian Rodríguez <crrodriguez@opensuse.org>
units/systemd-vconsole-setup.service.in | 2 -
5 files changed, 94 insertions(+), 3 deletions(-)
Index: systemd-218/Makefile.am
===================================================================
--- systemd-218.orig/Makefile.am
+++ systemd-218/Makefile.am
@@ -3715,6 +3715,19 @@ dist_udevrules_DATA += \
rules/61-accelerometer.rules
--- systemd-222.orig/Makefile.am
+++ systemd-222/Makefile.am
@@ -3805,6 +3805,19 @@ dist_udevrules_DATA += \
rules/60-persistent-v4l.rules
# ------------------------------------------------------------------------------
+numlock_on_SOURCES = \
@ -35,13 +33,11 @@ Index: systemd-218/Makefile.am
+ rules/73-seat-numlock.rules
+
+# ------------------------------------------------------------------------------
if ENABLE_GUDEV
if ENABLE_GTK_DOC
SUBDIRS += \
Index: systemd-218/rules/73-seat-numlock.rules
===================================================================
mtd_probe_SOURCES = \
src/udev/mtd_probe/mtd_probe.c \
src/udev/mtd_probe/mtd_probe.h \
--- /dev/null
+++ systemd-218/rules/73-seat-numlock.rules
+++ systemd-222/rules/73-seat-numlock.rules
@@ -0,0 +1,8 @@
+# This file is part of SUSE customization of systemd.
+#
@ -51,10 +47,8 @@ Index: systemd-218/rules/73-seat-numlock.rules
+# (at your option) any later version.
+
+SUBSYSTEM=="tty", ACTION=="add", KERNEL=="tty[0-9]|tty1[0-2]", TEST=="/run/numlock-on", RUN+="numlock-on $env{DEVNAME}"
Index: systemd-218/src/login/numlock-on.c
===================================================================
--- /dev/null
+++ systemd-218/src/login/numlock-on.c
+++ systemd-222/src/login/numlock-on.c
@@ -0,0 +1,34 @@
+/*
+ * numlock-on.c: Turn numlock-on
@ -90,13 +84,11 @@ Index: systemd-218/src/login/numlock-on.c
+
+ exit(0);
+}
Index: systemd-218/src/vconsole/vconsole-setup.c
===================================================================
--- systemd-218.orig/src/vconsole/vconsole-setup.c
+++ systemd-218/src/vconsole/vconsole-setup.c
@@ -42,6 +42,10 @@
#include "fileio.h"
#include "strv.h"
--- systemd-222.orig/src/vconsole/vconsole-setup.c
+++ systemd-222/src/vconsole/vconsole-setup.c
@@ -41,6 +41,10 @@
#include "terminal-util.h"
#include "signal-util.h"
+#define BIOS_DATA_AREA 0x400
+#define BDA_KEYBOARD_STATUS_FLAGS_4 0x97
@ -105,21 +97,20 @@ Index: systemd-218/src/vconsole/vconsole-setup.c
static bool is_vconsole(int fd) {
unsigned char data[1];
@@ -342,10 +346,11 @@ int main(int argc, char **argv) {
@@ -359,9 +363,10 @@ int main(int argc, char **argv) {
#ifdef HAVE_SYSV_COMPAT
_cleanup_free_ char
*vc_kbd_delay = NULL, *vc_kbd_rate = NULL,
- *vc_kbd_disable_caps_lock = NULL, *vc_compose_table = NULL;
+ *vc_kbd_disable_caps_lock = NULL, *vc_compose_table = NULL,
+ *vc_kbd_numlock = NULL;
pid_t kbd_rate_pid = 0, compose_table_pid = 0;
#endif
- bool disable_capslock = false;
+ bool disable_capslock = false, numlock = false;
bool comp_ok, rate_ok;
_cleanup_close_ int fd = -1;
bool utf8;
pid_t font_pid = 0, keymap_pid = 0;
@@ -384,6 +389,7 @@ int main(int argc, char **argv) {
bool utf8, font_copy = false, font_ok, keyboard_ok;
@@ -399,6 +404,7 @@ int main(int argc, char **argv) {
"KBD_DELAY", &vc_kbd_delay,
"KBD_RATE", &vc_kbd_rate,
"KBD_DISABLE_CAPS_LOCK", &vc_kbd_disable_caps_lock,
@ -127,54 +118,52 @@ Index: systemd-218/src/vconsole/vconsole-setup.c
"COMPOSETABLE", &vc_compose_table,
NULL);
if (r < 0 && r != -ENOENT)
@@ -398,6 +404,32 @@ int main(int argc, char **argv) {
log_warning("Failed to read /etc/sysconfig/console: %s", strerror(-r));
@@ -416,6 +422,32 @@ int main(int argc, char **argv) {
disable_capslock = vc_kbd_disable_caps_lock && strcasecmp(vc_kbd_disable_caps_lock, "YES") == 0;
disable_capslock = vc_kbd_disable_caps_lock &&
strcasecmp(vc_kbd_disable_caps_lock, "YES") == 0;
+ numlock = vc_kbd_numlock && strcaseeq(vc_kbd_numlock, "yes");
+#if defined(__i386__) || defined(__x86_64__)
+ if (vc_kbd_numlock && strcaseeq(vc_kbd_numlock, "bios")) {
+ int _cleanup_close_ fdmem;
+ char c;
+ if (vc_kbd_numlock && strcaseeq(vc_kbd_numlock, "bios")) {
+ int _cleanup_close_ fdmem;
+ char c;
+
+ fdmem = open ("/dev/mem", O_RDONLY);
+ if (fdmem < 0) {
+ log_error("Failed to open /dev/mem: %m");
+ return EXIT_FAILURE;
+ }
+ fdmem = open ("/dev/mem", O_RDONLY);
+ if (fdmem < 0) {
+ log_error("Failed to open /dev/mem: %m");
+ return EXIT_FAILURE;
+ }
+
+ if (lseek(fdmem, BIOS_DATA_AREA + BDA_KEYBOARD_STATUS_FLAGS_4, SEEK_SET) == (off_t) -1) {
+ log_error("Failed to seek /dev/mem: %m");
+ return EXIT_FAILURE;
+ }
+ if (lseek(fdmem, BIOS_DATA_AREA + BDA_KEYBOARD_STATUS_FLAGS_4, SEEK_SET) == (off_t) -1) {
+ log_error("Failed to seek /dev/mem: %m");
+ return EXIT_FAILURE;
+ }
+
+ if (read (fdmem, &c, sizeof(char)) == -1) {
+ log_error("Failed to read /dev/mem: %m");
+ return EXIT_FAILURE;
+ }
+ if (read(fdmem, &c, sizeof(char)) == -1) {
+ log_error("Failed to read /dev/mem: %m");
+ return EXIT_FAILURE;
+ }
+
+ if (c & BDA_KSF4_NUMLOCK_MASK)
+ numlock = true;
+ } else
+#endif
+ numlock = vc_kbd_numlock && strcaseeq(vc_kbd_numlock, "yes");
#endif
+ if (c & BDA_KSF4_NUMLOCK_MASK)
+ numlock = true;
+ }
+#endif /* x86 */
#endif /* HAVE_SYSV_COMPAT */
r = parse_env_file("/etc/vconsole.conf", NEWLINE,
@@ -444,6 +476,10 @@ int main(int argc, char **argv) {
log_error_errno(r, "Failed to start " KBD_LOADKEYS ": %m");
return EXIT_FAILURE;
}
@@ -451,6 +483,10 @@ int main(int argc, char **argv) {
font_ok = font_load_and_wait(vc, vc_font, vc_font_map, vc_font_unimap) > 0;
keyboard_ok = keyboard_load_and_wait(vc, vc_keymap, vc_keymap_toggle,
utf8, disable_capslock) > 0;
+ if (numlock)
+ touch("/run/numlock-on");
+ else
+ unlink("/run/numlock-on");
#ifdef HAVE_SYSV_COMPAT
r = load_compose_table(vc, vc_compose_table, &compose_table_pid);
if (r < 0) {
Index: systemd-218/units/systemd-vconsole-setup.service.in
===================================================================
--- systemd-218.orig/units/systemd-vconsole-setup.service.in
+++ systemd-218/units/systemd-vconsole-setup.service.in
comp_ok = compose_load_and_wait(vc, vc_compose_table);
rate_ok = kbdrate_set_and_wait(vc, vc_kbd_rate, vc_kbd_delay);
--- systemd-222.orig/units/systemd-vconsole-setup.service.in
+++ systemd-222/units/systemd-vconsole-setup.service.in
@@ -10,7 +10,7 @@ Description=Setup Virtual Console
Documentation=man:systemd-vconsole-setup.service(8) man:vconsole.conf(5)
DefaultDependencies=no

View File

@ -7,11 +7,11 @@ handle ROOT_USES_LANG=ctype (bnc#792182).
src/core/locale-setup.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
Index: systemd-218/src/core/locale-setup.c
Index: systemd-221/src/core/locale-setup.c
===================================================================
--- systemd-218.orig/src/core/locale-setup.c
+++ systemd-218/src/core/locale-setup.c
@@ -36,6 +36,11 @@ int locale_setup(char ***environment) {
--- systemd-221.orig/src/core/locale-setup.c
+++ systemd-221/src/core/locale-setup.c
@@ -34,6 +34,11 @@ int locale_setup(char ***environment) {
char **add;
char *variables[_VARIABLE_LC_MAX] = {};
int r = 0, i;
@ -23,7 +23,7 @@ Index: systemd-218/src/core/locale-setup.c
if (detect_container(NULL) <= 0) {
r = parse_env_file("/proc/cmdline", WHITESPACE,
@@ -82,6 +87,27 @@ int locale_setup(char ***environment) {
@@ -80,6 +85,27 @@ int locale_setup(char ***environment) {
if (r < 0 && r != -ENOENT)
log_warning_errno(r, "Failed to read /etc/locale.conf: %m");
}

13
hostname-NULL.patch Normal file
View File

@ -0,0 +1,13 @@
Index: systemd-222/src/core/hostname-setup.c
===================================================================
--- systemd-222.orig/src/core/hostname-setup.c
+++ systemd-222/src/core/hostname-setup.c
@@ -44,7 +44,7 @@ int hostname_setup(void) {
else
log_warning_errno(r, "Failed to read configured hostname: %m");
- hn = NULL;
+ hn = strdup("nohostname.set.site");
} else
hn = b;
/* strip any leftover of a domain name */

View File

@ -8,14 +8,16 @@ systemd unit drop-in files to add dependencies
---
Makefile.am | 9
src/insserv-generator/Makefile | 28 ++
src/insserv-generator/insserv-generator.c | 312 ++++++++++++++++++++++++++++++
3 files changed, 349 insertions(+)
src/insserv-generator/insserv-generator.c | 316 ++++++++++++++++++++++++++++++
3 files changed, 352 insertions(+), 1 deletion(-)
create mode 100644 src/insserv-generator/Makefile
create mode 100644 src/insserv-generator/insserv-generator.c
--- systemd-219.orig/Makefile.am
+++ systemd-219/Makefile.am
@@ -621,7 +621,8 @@ nodist_systemunit_DATA += \
Index: systemd-224/Makefile.am
===================================================================
--- systemd-224.orig/Makefile.am
+++ systemd-224/Makefile.am
@@ -617,7 +617,8 @@ nodist_systemunit_DATA += \
systemgenerator_PROGRAMS += \
systemd-sysv-generator \
@ -25,23 +27,23 @@ systemd unit drop-in files to add dependencies
endif
EXTRA_DIST += \
@@ -2565,6 +2566,14 @@ systemd_rc_local_generator_LDADD = \
libsystemd-label.la \
libsystemd-shared.la
@@ -2556,6 +2557,12 @@ $(systemd_boot): $(systemd_boot_solib)
endif
endif
+#-------------------------------------------------------------------------------
+systemd_insserv_generator_SOURCES = \
+ src/insserv-generator/insserv-generator.c
+
+systemd_insserv_generator_LDADD = \
+ libsystemd-label.la \
+ libsystemd-shared.la
+systemd_insserv_generator_LDADD = libbasic.la
+
# ------------------------------------------------------------------------------
systemd_remount_fs_SOURCES = \
src/remount-fs/remount-fs.c \
stub_headers = \
src/boot/efi/util.h \
Index: systemd-224/src/insserv-generator/Makefile
===================================================================
--- /dev/null
+++ systemd-219/src/insserv-generator/Makefile
+++ systemd-224/src/insserv-generator/Makefile
@@ -0,0 +1,28 @@
+# This file is part of systemd.
+#
@ -71,9 +73,11 @@ systemd unit drop-in files to add dependencies
+ $(MAKE) -C .. clean
+
+.PHONY: all clean
Index: systemd-224/src/insserv-generator/insserv-generator.c
===================================================================
--- /dev/null
+++ systemd-219/src/insserv-generator/insserv-generator.c
@@ -0,0 +1,312 @@
+++ systemd-224/src/insserv-generator/insserv-generator.c
@@ -0,0 +1,316 @@
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
+
+/***
@ -153,6 +157,7 @@ systemd unit drop-in files to add dependencies
+ unsigned i;
+ char *r;
+ const char *n;
+ int ret;
+
+ assert(name);
+ assert(_r);
@ -182,7 +187,9 @@ systemd unit drop-in files to add dependencies
+ return -EINVAL;
+
+ /* Facilities starting with $ are most likely targets */
+ r = unit_name_build(n, NULL, ".target");
+ ret = unit_name_build(n, NULL, ".target", &r);
+ if (ret < 0)
+ return ret;
+ } else if (filename && streq(name, filename))
+ /* Names equaling the file name of the services are redundant */
+ return 0;
@ -246,7 +253,8 @@ systemd unit drop-in files to add dependencies
+ r = write_string_file(unit,
+ "# Automatically generated by systemd-insserv-generator\n\n"
+ "[Unit]\n"
+ "Wants=remote-fs-pre.target\n");
+ "Wants=remote-fs-pre.target\n",
+ WRITE_STRING_FILE_CREATE);
+ if (r)
+ return r;
+ free (facility);

View File

@ -16,11 +16,11 @@ What is the rationale for MAP_STACK?
src/journal/mmap-cache.c | 16 +++++++++++++++-
4 files changed, 33 insertions(+), 5 deletions(-)
Index: systemd/src/journal/catalog.c
Index: systemd-221/src/journal/catalog.c
===================================================================
--- systemd.orig/src/journal/catalog.c
+++ systemd/src/journal/catalog.c
@@ -470,6 +470,10 @@ finish:
--- systemd-221.orig/src/journal/catalog.c
+++ systemd-221/src/journal/catalog.c
@@ -469,6 +469,10 @@ finish:
static int open_mmap(const char *database, int *_fd, struct stat *_st, void **_p) {
const CatalogHeader *h;
@ -31,7 +31,7 @@ Index: systemd/src/journal/catalog.c
int fd;
void *p;
struct stat st;
@@ -492,12 +496,18 @@ static int open_mmap(const char *databas
@@ -491,12 +495,18 @@ static int open_mmap(const char *databas
return -EINVAL;
}
@ -51,10 +51,10 @@ Index: systemd/src/journal/catalog.c
h = p;
if (memcmp(h->signature, CATALOG_SIGNATURE, sizeof(h->signature)) != 0 ||
le64toh(h->header_size) < sizeof(CatalogHeader) ||
Index: systemd/src/journal/journal-authenticate.c
Index: systemd-221/src/journal/journal-authenticate.c
===================================================================
--- systemd.orig/src/journal/journal-authenticate.c
+++ systemd/src/journal/journal-authenticate.c
--- systemd-221.orig/src/journal/journal-authenticate.c
+++ systemd-221/src/journal/journal-authenticate.c
@@ -355,7 +355,8 @@ int journal_file_fss_load(JournalFile *f
goto finish;
}
@ -76,10 +76,10 @@ Index: systemd/src/journal/journal-authenticate.c
if (f->fss_file == MAP_FAILED) {
f->fss_file = NULL;
r = -errno;
Index: systemd/src/journal/journald-kmsg.c
Index: systemd-221/src/journal/journald-kmsg.c
===================================================================
--- systemd.orig/src/journal/journald-kmsg.c
+++ systemd/src/journal/journald-kmsg.c
--- systemd-221.orig/src/journal/journald-kmsg.c
+++ systemd-221/src/journal/journald-kmsg.c
@@ -454,7 +454,8 @@ int server_open_kernel_seqnum(Server *s)
return 0;
}
@ -90,11 +90,11 @@ Index: systemd/src/journal/journald-kmsg.c
if (p == MAP_FAILED) {
log_error_errno(errno, "Failed to map sequential number file, ignoring: %m");
return 0;
Index: systemd/src/journal/mmap-cache.c
Index: systemd-221/src/journal/mmap-cache.c
===================================================================
--- systemd.orig/src/journal/mmap-cache.c
+++ systemd/src/journal/mmap-cache.c
@@ -467,11 +467,14 @@ static int add_mmap(
--- systemd-221.orig/src/journal/mmap-cache.c
+++ systemd-221/src/journal/mmap-cache.c
@@ -466,11 +466,14 @@ static int add_mmap(
struct stat *st,
void **ret) {
@ -109,7 +109,7 @@ Index: systemd/src/journal/mmap-cache.c
int r;
assert(m);
@@ -510,7 +513,8 @@ static int add_mmap(
@@ -509,7 +512,8 @@ static int add_mmap(
}
for (;;) {
@ -119,7 +119,7 @@ Index: systemd/src/journal/mmap-cache.c
if (d != MAP_FAILED)
break;
if (errno != ENOMEM)
@@ -523,6 +527,16 @@ static int add_mmap(
@@ -522,6 +526,16 @@ static int add_mmap(
return -ENOMEM;
}

View File

@ -5,10 +5,10 @@ Date: Tue Jan 20 11:33:59 UTC 2015
src/locale/kbd-model-map | 13 +++++++++++++
1 file changed, 13 insertions(+)
Index: systemd/src/locale/kbd-model-map
Index: systemd-221/src/locale/kbd-model-map
===================================================================
--- systemd.orig/src/locale/kbd-model-map
+++ systemd/src/locale/kbd-model-map
--- systemd-221.orig/src/locale/kbd-model-map
+++ systemd-221/src/locale/kbd-model-map
@@ -66,3 +66,16 @@ lt.baltic lt pc105 - terminate:ctrl_a
lt.l4 lt pc105 - terminate:ctrl_alt_bksp
lt lt pc105 - terminate:ctrl_alt_bksp

View File

@ -1,35 +1,19 @@
---
Makefile.am | 4 ++++
configure.ac | 4 ----
2 files changed, 4 insertions(+), 4 deletions(-)
1 file changed, 4 deletions(-)
Index: systemd/Makefile.am
Index: systemd-224/configure.ac
===================================================================
--- systemd.orig/Makefile.am
+++ systemd/Makefile.am
@@ -4789,6 +4789,10 @@ systemd_cryptsetup_CFLAGS = \
$(AM_CFLAGS) \
$(LIBCRYPTSETUP_CFLAGS)
+systemd_cryptsetup_LDFLAGS = \
+ $(AM_LDFLAGS) \
+ -Wl,-rpath-link=$(top_srcdir)/.libs
+
systemd_cryptsetup_LDADD = \
libsystemd-label.la \
libudev-internal.la \
Index: systemd/configure.ac
===================================================================
--- systemd.orig/configure.ac
+++ systemd/configure.ac
@@ -206,10 +206,6 @@ AS_CASE([$CC], [*clang*],
--- systemd-224.orig/configure.ac
+++ systemd-224/configure.ac
@@ -199,10 +199,6 @@ AS_CASE([$CC], [*clang*],
-Wno-gnu-variable-sized-type-not-at-end \
])])
-AS_CASE([$CFLAGS], [*-O[[12345\ ]]*],
-AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
- [CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
- -flto -ffat-lto-objects])],
- -flto])],
- [AC_MSG_RESULT([skipping -flto, optimization not enabled])])
AC_SUBST([OUR_CFLAGS], "$with_cflags $sanitizer_cflags")
AS_CASE([$CFLAGS], [*-O[[12345\ ]]*],
AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],

View File

@ -0,0 +1,84 @@
From: Werner Fink <werner@suse.de>
Date: Wed Sep 23 12:37:23 UTC 2015
Subject: Do not bother vistual console to much with GIO/PIO
This avoids broken virtual console mapping due stressed ioctl API
for the virtual consoles (boo#904214)
---
src/vconsole/vconsole-setup.c | 39 +++++++++++++++++++++++++--------------
1 file changed, 25 insertions(+), 14 deletions(-)
--- src/vconsole/vconsole-setup.c
+++ src/vconsole/vconsole-setup.c 2015-09-23 12:34:33.854018750 +0000
@@ -202,8 +202,13 @@ static void font_copy_to_all_vcs(int fd)
unsigned short map16[E_TABSZ];
struct unimapdesc unimapd;
struct unipair unipairs[USHRT_MAX];
+ struct console_font_op cfo = {};
int i, r;
+ bool hasmap8;
+ bool hasmap16;
+ bool hasunimap;
+
/* get active, and 16 bit mask of used VT numbers */
r = ioctl(fd, VT_GETSTATE, &vcs);
if (r < 0) {
@@ -211,10 +216,22 @@ static void font_copy_to_all_vcs(int fd)
return;
}
+ /* copy font from active VT, where the font was uploaded to */
+ cfo.op = KD_FONT_OP_COPY;
+ cfo.height = vcs.v_active-1; /* tty1 == index 0 */
+
+ hasmap8 = (ioctl(fd, GIO_SCRNMAP, map8) >= 0);
+ hasmap16 = (ioctl(fd, GIO_UNISCRNMAP, map16) >= 0);
+
+ /* unimapd is a ushort count and a pointer to an
+ * array of struct unipair { ushort, ushort } */
+ unimapd.entries = unipairs;
+ unimapd.entry_ct = USHRT_MAX;
+ hasunimap = (ioctl(fd, GIO_UNIMAP, &unimapd) >= 0);
+
for (i = 1; i <= 15; i++) {
char vcname[strlen("/dev/vcs") + DECIMAL_STR_MAX(int)];
_cleanup_close_ int vcfd = -1;
- struct console_font_op cfo = {};
if (i == vcs.v_active)
continue;
@@ -229,25 +246,19 @@ static void font_copy_to_all_vcs(int fd)
if (vcfd < 0)
continue;
- /* copy font from active VT, where the font was uploaded to */
- cfo.op = KD_FONT_OP_COPY;
- cfo.height = vcs.v_active-1; /* tty1 == index 0 */
+ /* copy font from active VT to vcs */
(void) ioctl(vcfd, KDFONTOP, &cfo);
- /* copy map of 8bit chars */
- if (ioctl(fd, GIO_SCRNMAP, map8) >= 0)
+ /* copy map of 8bit chars to vcs */
+ if (hasmap8)
(void) ioctl(vcfd, PIO_SCRNMAP, map8);
- /* copy map of 8bit chars -> 16bit Unicode values */
- if (ioctl(fd, GIO_UNISCRNMAP, map16) >= 0)
+ /* copy map of 8bit chars -> 16bit Unicode values to vcs */
+ if (hasmap16)
(void) ioctl(vcfd, PIO_UNISCRNMAP, map16);
- /* copy unicode translation table */
- /* unimapd is a ushort count and a pointer to an
- array of struct unipair { ushort, ushort } */
- unimapd.entries = unipairs;
- unimapd.entry_ct = USHRT_MAX;
- if (ioctl(fd, GIO_UNIMAP, &unimapd) >= 0) {
+ /* copy unicode translation table to vcs */
+ if (hasunimap) {
struct unimapinit adv = { 0, 0, 0 };
(void) ioctl(vcfd, PIO_UNIMAPCLR, &adv);

View File

@ -11,10 +11,10 @@ Reference: bnc#852232
units/emergency.service.in | 1 +
1 file changed, 1 insertion(+)
Index: systemd-218/units/emergency.service.in
Index: systemd-221/units/emergency.service.in
===================================================================
--- systemd-218.orig/units/emergency.service.in
+++ systemd-218/units/emergency.service.in
--- systemd-221.orig/units/emergency.service.in
+++ systemd-221/units/emergency.service.in
@@ -11,6 +11,7 @@ Documentation=man:sulogin(8)
DefaultDependencies=no
Conflicts=shutdown.target

View File

@ -2,11 +2,11 @@
src/fstab-generator/fstab-generator.c | 45 +++++++++++++++++++++++++++++++++-
1 file changed, 44 insertions(+), 1 deletion(-)
Index: systemd/src/fstab-generator/fstab-generator.c
Index: systemd-221/src/fstab-generator/fstab-generator.c
===================================================================
--- systemd.orig/src/fstab-generator/fstab-generator.c
+++ systemd/src/fstab-generator/fstab-generator.c
@@ -48,6 +48,49 @@ static char *arg_usr_what = NULL;
--- systemd-221.orig/src/fstab-generator/fstab-generator.c
+++ systemd-221/src/fstab-generator/fstab-generator.c
@@ -47,6 +47,49 @@ static char *arg_usr_what = NULL;
static char *arg_usr_fstype = NULL;
static char *arg_usr_options = NULL;
@ -56,7 +56,7 @@ Index: systemd/src/fstab-generator/fstab-generator.c
static int add_swap(
const char *what,
struct mntent *me,
@@ -118,7 +161,7 @@ static int add_swap(
@@ -108,7 +151,7 @@ static int add_swap(
if (r < 0)
return r;

View File

@ -1,13 +1,13 @@
---
units/console-shell.service.m4.in | 2 ++
units/emergency.service.in | 3 ++-
units/emergency.service.in | 2 +-
units/rescue.service.in | 3 ++-
3 files changed, 6 insertions(+), 2 deletions(-)
3 files changed, 5 insertions(+), 2 deletions(-)
Index: systemd/units/console-shell.service.m4.in
Index: systemd-224/units/console-shell.service.m4.in
===================================================================
--- systemd.orig/units/console-shell.service.m4.in
+++ systemd/units/console-shell.service.m4.in
--- systemd-224.orig/units/console-shell.service.m4.in
+++ systemd-224/units/console-shell.service.m4.in
@@ -17,6 +17,8 @@ Before=getty.target
[Service]
Environment=HOME=/root
@ -17,24 +17,23 @@ Index: systemd/units/console-shell.service.m4.in
ExecStart=-@SULOGIN@
ExecStopPost=-@SYSTEMCTL@ poweroff
Type=idle
Index: systemd/units/emergency.service.in
Index: systemd-224/units/emergency.service.in
===================================================================
--- systemd.orig/units/emergency.service.in
+++ systemd/units/emergency.service.in
@@ -17,7 +17,8 @@ Before=shutdown.target
--- systemd-224.orig/units/emergency.service.in
+++ systemd-224/units/emergency.service.in
@@ -17,7 +17,7 @@ Before=shutdown.target
[Service]
Environment=HOME=/root
WorkingDirectory=/root
-ExecStartPre=-/bin/plymouth quit
+ExecStartPre=-/usr/bin/plymouth quit
+ExecStartPre=-/usr/bin/plymouth --wait
-ExecStartPre=-/bin/plymouth --wait quit
+ExecStartPre=-/usr/bin/plymouth --wait quit
ExecStartPre=-/bin/echo -e 'Welcome to emergency mode! After logging in, type "journalctl -xb" to view\\nsystem logs, "systemctl reboot" to reboot, "systemctl default" or ^D to\\ntry again to boot into default mode.'
ExecStart=-/bin/sh -c "@SULOGIN@; @SYSTEMCTL@ --fail --no-block default"
ExecStart=-/bin/sh -c "@SULOGIN@; @SYSTEMCTL@ --job-mode=fail --no-block default"
Type=idle
Index: systemd/units/rescue.service.in
Index: systemd-224/units/rescue.service.in
===================================================================
--- systemd.orig/units/rescue.service.in
+++ systemd/units/rescue.service.in
--- systemd-224.orig/units/rescue.service.in
+++ systemd-224/units/rescue.service.in
@@ -16,7 +16,8 @@ Before=shutdown.target
[Service]
Environment=HOME=/root
@ -43,5 +42,5 @@ Index: systemd/units/rescue.service.in
+ExecStartPre=-/usr/bin/plymouth quit
+ExecStartPre=-/usr/bin/plymouth --wait
ExecStartPre=-/bin/echo -e 'Welcome to emergency mode! After logging in, type "journalctl -xb" to view\\nsystem logs, "systemctl reboot" to reboot, "systemctl default" or ^D to\\nboot into default mode.'
ExecStart=-/bin/sh -c "@SULOGIN@; @SYSTEMCTL@ --fail --no-block default"
ExecStart=-/bin/sh -c "@SULOGIN@; @SYSTEMCTL@ --job-mode=fail --no-block default"
Type=idle

View File

@ -1,5 +1,11 @@
--- systemd-210/units/rpcbind.target
+++ systemd-210/units/rpcbind.target 2014-04-08 07:21:55.438235838 +0000
---
units/rpcbind.target | 1 +
1 file changed, 1 insertion(+)
Index: systemd-221/units/rpcbind.target
===================================================================
--- systemd-221.orig/units/rpcbind.target
+++ systemd-221/units/rpcbind.target
@@ -12,3 +12,4 @@
Description=RPC Port Mapper
Documentation=man:systemd.special(7)

View File

@ -5,8 +5,8 @@
ORIG_SPEC=systemd
EDIT_WARNING="##### WARNING: please do not edit this auto generated spec file. Use the ${ORIG_SPEC}.spec! #####\n"
sed "s/^%define bootstrap.*$/${EDIT_WARNING}%define bootstrap 1/;
s/^%define udevpkgname.*$/${EDIT_WARNING}%define udevpkgname udev-mini/;
sed "s/^%define bootstrap .*$/${EDIT_WARNING}%define bootstrap 1/;
s/^%define mini .*$/${EDIT_WARNING}%define mini -mini/;
s/^\(Name:.*\)$/\1-mini/;
s/^BuildRoot.*/&\n\nProvides: %{real} = %{version}-%{release}\n/
" < ${ORIG_SPEC}.spec > ${ORIG_SPEC}-mini.spec

View File

@ -1,13 +1,22 @@
--- systemd-210/units/emergency.target
+++ systemd-210/units/emergency.target 2014-04-15 11:11:18.618235831 +0000
---
units/emergency.target | 1 +
units/rescue.target | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
Index: systemd-221/units/emergency.target
===================================================================
--- systemd-221.orig/units/emergency.target
+++ systemd-221/units/emergency.target
@@ -10,4 +10,5 @@ Description=Emergency Mode
Documentation=man:systemd.special(7)
Requires=emergency.service
After=emergency.service
+Conflicts=getty.target rescue.target
AllowIsolate=yes
--- systemd-210/units/rescue.target
+++ systemd-210/units/rescue.target 2014-04-15 11:14:40.606808928 +0000
Index: systemd-221/units/rescue.target
===================================================================
--- systemd-221.orig/units/rescue.target
+++ systemd-221/units/rescue.target
@@ -10,7 +10,8 @@ Description=Rescue Mode
Documentation=man:systemd.special(7)
Requires=sysinit.target rescue.service

View File

@ -2,11 +2,11 @@
src/fstab-generator/fstab-generator.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
Index: systemd-218/src/fstab-generator/fstab-generator.c
Index: systemd-221/src/fstab-generator/fstab-generator.c
===================================================================
--- systemd-218.orig/src/fstab-generator/fstab-generator.c
+++ systemd-218/src/fstab-generator/fstab-generator.c
@@ -238,8 +238,11 @@ static int add_mount(
--- systemd-221.orig/src/fstab-generator/fstab-generator.c
+++ systemd-221/src/fstab-generator/fstab-generator.c
@@ -289,8 +289,11 @@ static int add_mount(
"Documentation=man:fstab(5) man:systemd-fstab-generator(8)\n",
source);
@ -18,5 +18,5 @@ Index: systemd-218/src/fstab-generator/fstab-generator.c
+ fprintf(f, "Before=%s\n", post);
+ }
if (passno != 0) {
r = generator_write_fsck_deps(f, arg_dest, what, where, fstype);
if (!automount && opts) {
r = write_requires_after(f, opts);

View File

@ -10,11 +10,11 @@ Subject: restore /var/run and /var/lock bind mount if they aren't symlink
create mode 100644 units/var-lock.mount
create mode 100644 units/var-run.mount
Index: systemd-218/Makefile.am
Index: systemd-221/Makefile.am
===================================================================
--- systemd-218.orig/Makefile.am
+++ systemd-218/Makefile.am
@@ -516,6 +516,12 @@ endif
--- systemd-221.orig/Makefile.am
+++ systemd-221/Makefile.am
@@ -526,6 +526,12 @@ dist_systemunit_DATA += \
dist_systemunit_DATA_busnames += \
units/busnames.target
@ -27,9 +27,9 @@ Index: systemd-218/Makefile.am
nodist_systemunit_DATA = \
units/getty@.service \
units/serial-getty@.service \
@@ -6086,6 +6092,9 @@ RUNLEVEL4_TARGET_WANTS += \
@@ -6123,6 +6129,9 @@ GRAPHICAL_TARGET_WANTS += \
systemd-update-utmp-runlevel.service
RUNLEVEL5_TARGET_WANTS += \
RESCUE_TARGET_WANTS += \
systemd-update-utmp-runlevel.service
+LOCAL_FS_TARGET_WANTS += \
+ var-run.mount \
@ -37,10 +37,10 @@ Index: systemd-218/Makefile.am
endif
SYSINIT_TARGET_WANTS += \
Index: systemd-218/units/var-lock.mount
Index: systemd-221/units/var-lock.mount
===================================================================
--- /dev/null
+++ systemd-218/units/var-lock.mount
+++ systemd-221/units/var-lock.mount
@@ -0,0 +1,19 @@
+# This file is part of systemd.
+#
@ -61,10 +61,10 @@ Index: systemd-218/units/var-lock.mount
+Where=/var/lock
+Type=bind
+Options=bind
Index: systemd-218/units/var-run.mount
Index: systemd-221/units/var-run.mount
===================================================================
--- /dev/null
+++ systemd-218/units/var-run.mount
+++ systemd-221/units/var-run.mount
@@ -0,0 +1,19 @@
+# This file is part of systemd.
+#

View File

@ -1,16 +1,18 @@
Use and set default logging console for both journald and kernel messages
---
src/journal/journald-console.c | 96 +++++++++++++++++++++++++++++++++++++++++
src/journal/journald-console.h | 4 +
src/journal/journald-server.c | 5 ++
3 files changed, 105 insertions(+)
src/journal/journald-console.c | 100 +++++++++++++++++++++++++++++++++++++++++
src/journal/journald-console.h | 3 +
src/journal/journald-server.c | 6 ++
3 files changed, 109 insertions(+)
--- systemd-219.orig/src/journal/journald-console.c
+++ systemd-219/src/journal/journald-console.c
@@ -23,6 +23,14 @@
Index: systemd-221/src/journal/journald-console.c
===================================================================
--- systemd-221.orig/src/journal/journald-console.c
+++ systemd-221/src/journal/journald-console.c
@@ -22,6 +22,14 @@
#include <time.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/socket.h>
+#ifdef HAVE_SYSV_COMPAT
+# include <linux/tiocl.h>
@ -23,11 +25,11 @@ Use and set default logging console for both journald and kernel messages
#include "fileio.h"
#include "journald-server.h"
@@ -43,6 +51,76 @@ static bool prefix_timestamp(void) {
@@ -45,6 +53,76 @@ static bool prefix_timestamp(void) {
return cached_printk_time;
}
+void defaul_tty_path(Server *s)
+void default_tty_path(Server *s)
+{
+#ifdef HAVE_SYSV_COMPAT
+ static const char list[] = "/dev/tty10\0" "/dev/console\0";
@ -100,7 +102,7 @@ Use and set default logging console for both journald and kernel messages
void server_forward_console(
Server *s,
int priority,
@@ -64,6 +142,12 @@ void server_forward_console(
@@ -66,6 +144,12 @@ void server_forward_console(
if (LOG_PRI(priority) > s->max_level_console)
return;
@ -113,7 +115,7 @@ Use and set default logging console for both journald and kernel messages
/* First: timestamp */
if (prefix_timestamp()) {
assert_se(clock_gettime(CLOCK_MONOTONIC, &ts) == 0);
@@ -100,7 +184,23 @@ void server_forward_console(
@@ -102,7 +186,23 @@ void server_forward_console(
fd = open_terminal(tty, O_WRONLY|O_NOCTTY|O_CLOEXEC);
if (fd < 0) {
log_debug_errno(errno, "Failed to open %s for logging: %m", tty);
@ -137,22 +139,34 @@ Use and set default logging console for both journald and kernel messages
}
if (writev(fd, iovec, n) < 0)
--- systemd-219.orig/src/journal/journald-console.h
+++ systemd-219/src/journal/journald-console.h
Index: systemd-221/src/journal/journald-console.h
===================================================================
--- systemd-221.orig/src/journal/journald-console.h
+++ systemd-221/src/journal/journald-console.h
@@ -24,3 +24,6 @@
#include "journald-server.h"
void server_forward_console(Server *s, int priority, const char *identifier, const char *message, const struct ucred *ucred);
+
+void klogconsole(Server *s);
+void defaul_tty_path(Server *s);
--- systemd-219.orig/src/journal/journald-server.c
+++ systemd-219/src/journal/journald-server.c
@@ -1520,6 +1520,11 @@ int server_init(Server *s) {
+void default_tty_path(Server *s);
Index: systemd-221/src/journal/journald-server.c
===================================================================
--- systemd-221.orig/src/journal/journald-server.c
+++ systemd-221/src/journal/journald-server.c
@@ -52,6 +52,7 @@
#include "journal-internal.h"
#include "journal-vacuum.h"
#include "journal-authenticate.h"
+#include "journald-console.h"
#include "journald-rate-limit.h"
#include "journald-kmsg.h"
#include "journald-syslog.h"
@@ -1514,6 +1515,11 @@ int server_init(Server *s) {
server_parse_config_file(s);
server_parse_proc_cmdline(s);
+ defaul_tty_path(s);
+ default_tty_path(s);
+
+ if (s->tty_path)
+ klogconsole(s);

View File

@ -2,12 +2,12 @@
Makefile.am | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
Index: systemd-218/Makefile.am
Index: systemd-221/Makefile.am
===================================================================
--- systemd-218.orig/Makefile.am
+++ systemd-218/Makefile.am
@@ -4209,11 +4209,11 @@ noinst_LTLIBRARIES += \
libsystemd-journal-core.la
--- systemd-221.orig/Makefile.am
+++ systemd-221/Makefile.am
@@ -4129,11 +4129,11 @@ noinst_LTLIBRARIES += \
libjournal-core.la
journal-install-hook:
- -$(MKDIR_P) $(DESTDIR)/var/log/journal

View File

@ -7,12 +7,12 @@ This reverts commit 3cdebc217c42c8529086f2965319b6a48eaaeabe.
[Implementation note: currently, the unit is generated, but not
activated even if symlinks exist in boot.d. Hmmm... -jengelh@inai.de]
---
src/sysv-generator/sysv-generator.c | 26 +++++++++++++++++++++-----
1 file changed, 21 insertions(+), 5 deletions(-)
src/sysv-generator/sysv-generator.c | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
--- systemd-219.orig/src/sysv-generator/sysv-generator.c
+++ systemd-219/src/sysv-generator/sysv-generator.c
@@ -42,7 +42,8 @@
--- systemd-222.orig/src/sysv-generator/sysv-generator.c
+++ systemd-222/src/sysv-generator/sysv-generator.c
@@ -39,7 +39,8 @@
typedef enum RunlevelType {
RUNLEVEL_UP,
@ -22,7 +22,7 @@ activated even if symlinks exist in boot.d. Hmmm... -jengelh@inai.de]
} RunlevelType;
static const struct {
@@ -50,6 +51,9 @@ static const struct {
@@ -47,6 +48,9 @@ static const struct {
const char *target;
const RunlevelType type;
} rcnd_table[] = {
@ -30,9 +30,9 @@ activated even if symlinks exist in boot.d. Hmmm... -jengelh@inai.de]
+ { "boot.d", SPECIAL_SYSINIT_TARGET, RUNLEVEL_SYSINIT },
+
/* Standard SysV runlevels for start-up */
{ "rc1.d", SPECIAL_RESCUE_TARGET, RUNLEVEL_UP },
{ "rc2.d", SPECIAL_RUNLEVEL2_TARGET, RUNLEVEL_UP },
@@ -65,7 +69,7 @@ static const struct {
{ "rc1.d", SPECIAL_RESCUE_TARGET, RUNLEVEL_UP },
{ "rc2.d", SPECIAL_MULTI_USER_TARGET, RUNLEVEL_UP },
@@ -62,10 +66,10 @@ static const struct {
directories in this order, and we want to make sure that
sysv_start_priority is known when we first load the
unit. And that value we only know from S links. Hence
@ -40,28 +40,23 @@ activated even if symlinks exist in boot.d. Hmmm... -jengelh@inai.de]
+ UP/SYSINIT must be read before DOWN */
};
typedef struct SysvStub {
@@ -83,7 +87,7 @@ typedef struct SysvStub {
bool reload;
} SysvStub;
-const char *arg_dest = "/tmp";
+static const char *arg_dest = "/tmp";
static int add_symlink(const char *service, const char *where) {
_cleanup_free_ char *from = NULL, *to = NULL;
@@ -235,6 +239,10 @@ static bool usage_contains_reload(const
static char *sysv_translate_name(const char *name) {
char *r;
typedef struct SysvStub {
char *name;
@@ -243,6 +247,10 @@ static char *sysv_translate_name(const c
_cleanup_free_ char *c = NULL;
char *res;
+ if (startswith(name, "boot."))
+ /* Drop SuSE-style boot. prefix */
+ name += 5;
+
r = new(char, strlen(name) + strlen(".service") + 1);
if (!r)
c = strdup(name);
if (!c)
return NULL;
@@ -864,10 +872,10 @@ static int set_dependencies_from_rcnd(Lo
@@ -859,10 +867,10 @@ static int set_dependencies_from_rcnd(co
if (de->d_name[0] == 'S') {
@ -74,7 +69,7 @@ activated even if symlinks exist in boot.d. Hmmm... -jengelh@inai.de]
r = set_ensure_allocated(&runlevel_services[i], NULL);
if (r < 0)
@@ -878,7 +886,8 @@ static int set_dependencies_from_rcnd(Lo
@@ -873,7 +881,8 @@ static int set_dependencies_from_rcnd(co
goto finish;
} else if (de->d_name[0] == 'K' &&

View File

@ -1,51 +0,0 @@
From 752a4370ecb5643a432ad73b1e22c80cd304948f Mon Sep 17 00:00:00 2001
From: Frederic Crozat <fcrozat@suse.com>
Date: Fri, 17 May 2013 13:31:46 +0200
Subject: [PATCH] sysctl: handle /boot/sysctl.conf-<kernel_release>
Add support for kernel release sysctl.conf files (for per-flavor
configuration), needed by openSUSE (bnc#809420).
---
src/sysctl/sysctl.c | 8 ++++++++
units/systemd-sysctl.service.in | 2 ++
2 files changed, 10 insertions(+)
Index: systemd-218/src/sysctl/sysctl.c
===================================================================
--- systemd-218.orig/src/sysctl/sysctl.c
+++ systemd-218/src/sysctl/sysctl.c
@@ -26,6 +26,7 @@
#include <stdio.h>
#include <limits.h>
#include <getopt.h>
+#include <sys/utsname.h>
#include "log.h"
#include "strv.h"
@@ -310,6 +311,13 @@ int main(int argc, char *argv[]) {
} else {
_cleanup_strv_free_ char **files = NULL;
char **f;
+ char kernel_sysctl[PATH_MAX];
+ struct utsname uts;
+
+ assert_se(uname(&uts) >= 0);
+
+ snprintf(kernel_sysctl, sizeof(kernel_sysctl), "/boot/sysctl.conf-%s", uts.release);
+ r = parse_file(sysctl_options, kernel_sysctl, true);
r = conf_files_list_nulstr(&files, ".conf", NULL, conf_file_dirs);
if (r < 0) {
Index: systemd-218/units/systemd-sysctl.service.in
===================================================================
--- systemd-218.orig/units/systemd-sysctl.service.in
+++ systemd-218/units/systemd-sysctl.service.in
@@ -13,6 +13,8 @@ Conflicts=shutdown.target
After=systemd-modules-load.service
Before=sysinit.target shutdown.target
ConditionPathIsReadWrite=/proc/sys/
+ConditionPathExistsGlob=|/boot/sysctl.conf-%v
+RequiresMountsFor=/boot
[Service]
Type=oneshot

View File

@ -6,11 +6,11 @@ This solves the bug bnc#868439
man/systemctl.xml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Index: systemd/man/systemctl.xml
Index: systemd-221/man/systemctl.xml
===================================================================
--- systemd.orig/man/systemctl.xml
+++ systemd/man/systemctl.xml
@@ -445,7 +445,7 @@ along with systemd; If not, see <http://
--- systemd-221.orig/man/systemctl.xml
+++ systemd-221/man/systemctl.xml
@@ -439,7 +439,7 @@
<term><option>--force</option></term>
<listitem>
@ -19,7 +19,7 @@ Index: systemd/man/systemctl.xml
any existing conflicting symlinks.</para>
<para>When used with <command>halt</command>,
@@ -1215,6 +1215,8 @@ kobject-uevent 1 systemd-udevd-kernel.so
@@ -1237,6 +1237,8 @@ kobject-uevent 1 systemd-udevd-kernel.so
<para>Return the default target to boot into. This returns
the target unit name <filename>default.target</filename>
is aliased (symlinked) to.</para>

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5c57113454e37c040d0cb481bd960ae7cf3a3fe0a231ff4945259bc74503f2d9
size 3938228

View File

@ -1,13 +1,13 @@
---
man/tmpfiles.d.xml | 3 +++
src/tmpfiles/tmpfiles.c | 48 ++++++++++++++++++++++++++++++++++++++++--------
2 files changed, 43 insertions(+), 8 deletions(-)
src/tmpfiles/tmpfiles.c | 47 ++++++++++++++++++++++++++++++++++++++++-------
2 files changed, 43 insertions(+), 7 deletions(-)
Index: systemd/man/tmpfiles.d.xml
Index: systemd-221/man/tmpfiles.d.xml
===================================================================
--- systemd.orig/man/tmpfiles.d.xml
+++ systemd/man/tmpfiles.d.xml
@@ -489,6 +489,9 @@
--- systemd-221.orig/man/tmpfiles.d.xml
+++ systemd-221/man/tmpfiles.d.xml
@@ -528,6 +528,9 @@
<varname>f</varname>, <varname>F</varname>, and
<varname>w</varname> may be used to specify a short string that
is written to the file, suffixed by a newline. For
@ -15,13 +15,21 @@ Index: systemd/man/tmpfiles.d.xml
+ usernames. If given, only paths belonging to these users will be excluded
+ during directory cleanup. Ignored for all other lines. For
<varname>C</varname>, specifies the source file or
directory. For <varname>t</varname> determines extended
attributes to be set. For <varname>a</varname> determines
Index: systemd/src/tmpfiles/tmpfiles.c
directory. For <varname>t</varname>, <varname>T</varname>
determines extended attributes to be set. For
Index: systemd-221/src/tmpfiles/tmpfiles.c
===================================================================
--- systemd.orig/src/tmpfiles/tmpfiles.c
+++ systemd/src/tmpfiles/tmpfiles.c
@@ -345,6 +345,7 @@ static int dir_cleanup(
--- systemd-221.orig/src/tmpfiles/tmpfiles.c
+++ systemd-221/src/tmpfiles/tmpfiles.c
@@ -37,6 +37,7 @@
#include <sys/stat.h>
#include <sys/xattr.h>
#include <linux/fs.h>
+#include <pwd.h>
#include "log.h"
#include "util.h"
@@ -358,6 +359,7 @@ static int dir_cleanup(
struct timespec times[2];
bool deleted = false;
int r = 0;
@ -29,24 +37,23 @@ Index: systemd/src/tmpfiles/tmpfiles.c
while ((dent = readdir(d))) {
struct stat s;
@@ -395,14 +396,45 @@ static int dir_cleanup(
@@ -408,14 +410,45 @@ static int dir_cleanup(
}
/* Is there an item configured for this path? */
- if (hashmap_get(items, sub_path)) {
- if (ordered_hashmap_get(items, sub_path)) {
- log_debug("Ignoring \"%s\": a separate entry exists.", sub_path);
- continue;
- }
+ bool found_glob = false;
+ found = ordered_hashmap_get(items, sub_path);
+ if (!found) {
+ found_glob = true;
+ found = find_glob(globs, sub_path);
}
-
- if (find_glob(globs, sub_path)) {
- log_debug("Ignoring \"%s\": a separate glob exists.", sub_path);
- continue;
+ bool found_glob = false;
+ found = hashmap_get(items, sub_path);
+ if (!found) {
+ found_glob = true;
+ found = find_glob(globs, sub_path);
+ }
+ if (found) {
+ struct passwd *pw;
+ char *userfound = NULL, *args;

View File

@ -1,135 +0,0 @@
From f78f265f405a61387c6c12a879ac0d6b6dc958db Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Fri, 24 Apr 2015 16:04:50 +0200
Subject: core: always coldplug units that are triggered by other units before
those
Let's make sure that we don't enqueue triggering jobs for units before
those units are actually fully loaded.
http://lists.freedesktop.org/archives/systemd-devel/2015-April/031176.html
https://bugs.freedesktop.org/show_bug.cgi?id=88401
diff --git a/src/core/unit.c b/src/core/unit.c
index 70a2b57..2b356e2 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -2876,13 +2876,32 @@ int unit_add_node_link(Unit *u, const char *what, bool wants) {
}
int unit_coldplug(Unit *u) {
+ Unit *other;
+ Iterator i;
int r;
assert(u);
- if (UNIT_VTABLE(u)->coldplug)
- if ((r = UNIT_VTABLE(u)->coldplug(u)) < 0)
+ /* Make sure we don't enter a loop, when coldplugging
+ * recursively. */
+ if (u->coldplugged)
+ return 0;
+
+ u->coldplugged = true;
+
+ /* Make sure everything that we might pull in through
+ * triggering is coldplugged before us */
+ SET_FOREACH(other, u->dependencies[UNIT_TRIGGERS], i) {
+ r = unit_coldplug(other);
+ if (r < 0)
return r;
+ }
+
+ if (UNIT_VTABLE(u)->coldplug) {
+ r = UNIT_VTABLE(u)->coldplug(u);
+ if (r < 0)
+ return r;
+ }
if (u->job) {
r = job_coldplug(u->job);
diff --git a/src/core/unit.h b/src/core/unit.h
index be306a0..1a44271 100644
--- a/src/core/unit.h
+++ b/src/core/unit.h
@@ -104,6 +104,7 @@ struct Unit {
char *fragment_path; /* if loaded from a config file this is the primary path to it */
char *source_path; /* if converted, the source file */
char **dropin_paths;
+
usec_t fragment_mtime;
usec_t source_mtime;
usec_t dropin_mtime;
@@ -233,6 +234,9 @@ struct Unit {
bool cgroup_realized:1;
bool cgroup_members_mask_valid:1;
bool cgroup_subtree_mask_valid:1;
+
+ /* Did we already invoke unit_coldplug() for this unit? */
+ bool coldplugged;
};
struct UnitStatusMessageFormats {
--
cgit v0.10.2
From 4370633083dd9453da183c468cf89cc17254ac39 Mon Sep 17 00:00:00 2001
From: Ivan Shapovalov <intelfx100@gmail.com>
Date: Mon, 27 Apr 2015 21:19:02 +0300
Subject: core: coldplug all units which participate in jobs during
coldplugging
This is yet another attempt to fix coldplugging order (more especially,
the problem which happens when one creates a job during coldplugging and
it references a not-yet-coldplugged unit).
Now we forcibly coldplug all units which participate in jobs. This
is a superset of previously implemented handling of the UNIT_TRIGGERS
dependencies, so that handling is removed.
http://lists.freedesktop.org/archives/systemd-devel/2015-April/031212.html
https://bugs.freedesktop.org/show_bug.cgi?id=88401 (once again)
diff --git a/src/core/transaction.c b/src/core/transaction.c
index 5974b1e..7b19e2f 100644
--- a/src/core/transaction.c
+++ b/src/core/transaction.c
@@ -848,6 +848,13 @@ int transaction_add_job_and_dependencies(
assert(type < _JOB_TYPE_MAX_IN_TRANSACTION);
assert(unit);
+ /* Before adding jobs for this unit, let's ensure that its state has been loaded
+ * This matters when jobs are spawned as part of coldplugging itself (see e. g. path_coldplug()).
+ * This way, we "recursively" coldplug units, ensuring that we do not look at state of
+ * not-yet-coldplugged units. */
+ if (unit->manager->n_reloading > 0)
+ unit_coldplug(unit);
+
/* log_debug("Pulling in %s/%s from %s/%s", */
/* unit->id, job_type_to_string(type), */
/* by ? by->unit->id : "NA", */
diff --git a/src/core/unit.c b/src/core/unit.c
index 496db6c..b7ab084 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -2893,14 +2893,6 @@ int unit_coldplug(Unit *u) {
u->coldplugged = true;
- /* Make sure everything that we might pull in through
- * triggering is coldplugged before us */
- SET_FOREACH(other, u->dependencies[UNIT_TRIGGERS], i) {
- r = unit_coldplug(other);
- if (r < 0)
- return r;
- }
-
if (UNIT_VTABLE(u)->coldplug) {
r = UNIT_VTABLE(u)->coldplug(u);
if (r < 0)
--
cgit v0.10.2

View File

@ -1,13 +1,26 @@
---
src/basic/def.h | 2 +-
src/libsystemd/sd-bus/sd-bus.c | 4 ++--
src/shared/def.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
Index: systemd/src/libsystemd/sd-bus/sd-bus.c
Index: systemd-221/src/basic/def.h
===================================================================
--- systemd.orig/src/libsystemd/sd-bus/sd-bus.c
+++ systemd/src/libsystemd/sd-bus/sd-bus.c
@@ -809,8 +809,8 @@ static int parse_container_unix_address(
--- systemd-221.orig/src/basic/def.h
+++ systemd-221/src/basic/def.h
@@ -61,7 +61,7 @@
"/usr/lib/kbd/keymaps/\0"
#endif
-#define UNIX_SYSTEM_BUS_ADDRESS "unix:path=/var/run/dbus/system_bus_socket"
+#define UNIX_SYSTEM_BUS_ADDRESS "unix:path=/run/dbus/system_bus_socket"
#define KERNEL_SYSTEM_BUS_ADDRESS "kernel:path=/sys/fs/kdbus/0-system/bus"
#define DEFAULT_SYSTEM_BUS_ADDRESS KERNEL_SYSTEM_BUS_ADDRESS ";" UNIX_SYSTEM_BUS_ADDRESS
#define UNIX_USER_BUS_ADDRESS_FMT "unix:path=%s/bus"
Index: systemd-221/src/libsystemd/sd-bus/sd-bus.c
===================================================================
--- systemd-221.orig/src/libsystemd/sd-bus/sd-bus.c
+++ systemd-221/src/libsystemd/sd-bus/sd-bus.c
@@ -837,8 +837,8 @@ static int parse_container_unix_address(
b->nspid = 0;
b->sockaddr.un.sun_family = AF_UNIX;
@ -18,16 +31,3 @@ Index: systemd/src/libsystemd/sd-bus/sd-bus.c
return 0;
}
Index: systemd/src/shared/def.h
===================================================================
--- systemd.orig/src/shared/def.h
+++ systemd/src/shared/def.h
@@ -61,7 +61,7 @@
"/usr/lib/kbd/keymaps/\0"
#endif
-#define UNIX_SYSTEM_BUS_ADDRESS "unix:path=/var/run/dbus/system_bus_socket"
+#define UNIX_SYSTEM_BUS_ADDRESS "unix:path=/run/dbus/system_bus_socket"
#define KERNEL_SYSTEM_BUS_ADDRESS "kernel:path=/sys/fs/kdbus/0-system/bus"
#ifdef ENABLE_KDBUS

View File

@ -1,6 +1,12 @@
--- a/Makefile.am
+++ b/Makefile.am
@@ -4560,12 +4560,6 @@ lib_LTLIBRARIES += \
---
Makefile.am | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
Index: systemd-221/Makefile.am
===================================================================
--- systemd-221.orig/Makefile.am
+++ systemd-221/Makefile.am
@@ -5876,12 +5876,6 @@ lib_LTLIBRARIES += \
libsystemd-id128.la \
libsystemd-daemon.la
@ -13,7 +19,7 @@
# move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
compat-lib-install-hook:
libname=libsystemd-login.so && $(move-to-rootlibdir)
@@ -4583,6 +4577,12 @@ INSTALL_EXEC_HOOKS += compat-lib-install
@@ -5899,6 +5893,12 @@ INSTALL_EXEC_HOOKS += compat-lib-install
UNINSTALL_EXEC_HOOKS += compat-lib-uninstall-hook
endif
@ -24,5 +30,5 @@
+ src/compat-libs/libsystemd-daemon.pc
+
EXTRA_DIST += \
src/compat-libs/linkwarning.h \
src/compat-libs/libsystemd-journal.pc.in \
src/compat-libs/libsystemd-login.pc.in \

View File

@ -1,7 +1,270 @@
-------------------------------------------------------------------
Thu Sep 24 12:47:29 UTC 2015 - dimstar@opensuse.org
Fri Sep 25 14:20:41 UTC 2015 - werner@suse.de
- Add systemd-bfo88401.patch: do not restart services on coldplug.
- Fix patch tty-ask-password-agent-on-console.patch not to crash
away but enable it to ask on all devices of /dev/console
-------------------------------------------------------------------
Wed Sep 23 14:19:32 UTC 2015 - jengelh@inai.de
- Avoid "file not found /etc/udev/rules.d/70-persistent-net.rules"
waring occurring in %post
-------------------------------------------------------------------
Wed Sep 23 12:41:19 UTC 2015 - werner@suse.de
- Add patch let-vconsole-setup-get-properties-only-once-to-copy-them.patch
to avoid broken virtual console mapping due stressed ioctl API
for the virtual consoles (boo#904214)
-------------------------------------------------------------------
Mon Sep 7 12:21:06 UTC 2015 - werner@suse.de
- Fix last change that is use the new name for udev packages in %pretrans.
-------------------------------------------------------------------
Mon Sep 7 11:50:21 UTC 2015 - fbui@suse.com
- restore usage of LUA in %pretrans.
-------------------------------------------------------------------
Mon Sep 7 08:09:05 UTC 2015 - werner@suse.de
- Try to generate the systemd users and groups always in same order
to avoid republish other packages (boo#944660)
-------------------------------------------------------------------
Fri Aug 21 07:49:33 UTC 2015 - fbui@suse.com
- cleanup specfile by removing commands that were dealing with systemd
pre-generated files: we're now using systemd tarball generated directly
from the git repo which doesn't contain any of these files.
- there's no point in using LUA in %pretrans
-------------------------------------------------------------------
Wed Aug 19 09:34:41 UTC 2015 - fbui@suse.com
- Drop 0009-make-xsltproc-use-correct-ROFF-links.patch
This patch was initialy added to workaround bsc#842844. But it
appears that man(1) was fixed (included since 13.2 at least) to
handle manual pages that consist only of a .so directive such as
'.so <page>'.
-------------------------------------------------------------------
Thu Aug 13 11:46:12 UTC 2015 - werner@suse.de
- Change use-rndaddentropy-ioctl-to-load-random-seed.patch to
make it work on big endian
-------------------------------------------------------------------
Tue Aug 11 09:48:26 UTC 2015 - jengelh@inai.de
- Use Obsolete/Provides strategy from
windows:mingw:mingw64/mingw64-cross-gcc to do the bootstrap
cycle and kick out -mini afterwards.
-------------------------------------------------------------------
Tue Aug 11 05:15:09 UTC 2015 - jengelh@inai.de
- Update to new upstream release 224
* systemd-networkd gained a number of new configuration options
for DHCP, tunnels and bridges
* systemd-efi-boot-generator functionality was merged into
systemd-gpt-auto-generator.
-------------------------------------------------------------------
Mon Aug 10 13:16:54 UTC 2015 - sndirsch@suse.com
- /usr/share/systemd/kbd-model-map: added entries for
xkeyboard-config converted keymaps; mappings, which already
exist in original systemd mapping table are being ignored
though, i.e. not overwritten; needs kbd in buildrequires
(FATE#318426)
-------------------------------------------------------------------
Wed Jul 29 18:10:53 UTC 2015 - meissner@suse.com
- hostname-NULL.patch: Work around a crash on XEN hosts
in OBS. /etc/hostname is not present and systemd then does
strchr(hostname,soemthing) with hostname NULL.
-------------------------------------------------------------------
Wed Jul 29 09:02:21 UTC 2015 - werner@suse.de
- Add Correct_assert_on_unexpected_error_code.patch to work around
a problem of an assert on ENODEV for closing fd on an input
event device (boo#939571)
-------------------------------------------------------------------
Mon Jul 13 15:31:46 UTC 2015 - jengelh@inai.de
- Remove udev-generate-rules.sh, apparently not used by anything in
the systemd nor udev-persistent-ifnames package.
-------------------------------------------------------------------
Wed Jul 8 20:44:57 UTC 2015 - crrodriguez@opensuse.org
- Systemd v222, bugfix release.
- Drop upstream patches
0006-pam_systemd-Properly-check-kdbus-availability.patch
0023-core-fix-reversed-dependency-check-in-unit_check_unn.patch
0031-install-fix-bad-memory-access.patch
1032-ata_id-unbotch-format-specifier.patch
- Drop SUSE patch 1013-no-runtime-PM-for-IBM-consoles.patch
udev does no longer enable USB HID power management at all.
- The udev accelerometer helper was removed, obsoleted by
iio-sensor-proxy package.
- networkd gained a new configuration option IPv6PrivacyExtensions.
- udev does not longer support the WAIT_FOR_SYSFS= key in udev
rules. There are no known issues with current sysfs,
and udev does not need or should be used to work around such bugs.
-------------------------------------------------------------------
Tue Jul 7 08:54:38 UTC 2015 - jengelh@inai.de
- Avoid restarting logind [bnc#934901]
- Do not suppress errors in any case, even if they are ignored
-------------------------------------------------------------------
Sun Jul 5 15:52:33 UTC 2015 - hrvoje.senjan@gmail.com
- Fix devel package requires (both mini and real required real libsystemd0)
-------------------------------------------------------------------
Fri Jul 3 11:17:01 UTC 2015 - werner@suse.de
- Rework patch tty-ask-password-agent-on-console.patch to fit the
requisition of https://bugs.freedesktop.org/show_bug.cgi?id=82004
-------------------------------------------------------------------
Wed Jul 1 09:42:44 UTC 2015 - jengelh@inai.de
- Rework "-mini" package logic to not conflict with itself and
then add libsystemd0 to mini.
-------------------------------------------------------------------
Wed Jul 1 03:43:51 UTC 2015 - crrodriguez@opensuse.org
- remove SysVStartPriority= from after-local.service,
unsupported since v218.
Note that this option was only parsed and that's it. the logic
to give "start priority" was never implemented.
-------------------------------------------------------------------
Wed Jul 1 03:20:20 UTC 2015 - crrodriguez@opensuse.org
- change the default fallback ntp servers to the opensuse
pool.ntp.org vendor zone.
- We still need to run systemd-sysctl.service after local-fs.target
otherwise it works only when /boot is in the root filesystem but
not when it is a separate partition.
-------------------------------------------------------------------
Fri Jun 26 17:14:46 CEST 2015 - sbrabec@suse.com
- Obsolete pm-utils and suspend (boo#925873).
- Remove pm-utils support
(remove Forward-suspend-hibernate-calls-to-pm-utils.patch).
-------------------------------------------------------------------
Thu Jun 25 17:27:06 UTC 2015 - crrodriguez@opensuse.org
- remove patch sysctl-handle-boot-sysctl.conf-kernel_release.patch
from the filelist.
-------------------------------------------------------------------
Thu Jun 25 05:56:55 UTC 2015 - crrodriguez@opensuse.org
- libpcre, glib2 and libusb are not used by systemd, remove
from buildrequires.
-------------------------------------------------------------------
Thu Jun 25 05:19:54 UTC 2015 - crrodriguez@opensuse.org
- 1032-ata_id-unbotch-format-specifier.patch: fix udev ata_id
output.
- 0023-core-fix-reversed-dependency-check-in-unit_check_unn.patch
fix StopWhenUnneeded=true in combination with a Requisite=
dependency.
- 0031-install-fix-bad-memory-access.patch: Fix Bad memory access
- 0006-pam_systemd-Properly-check-kdbus-availability.patch: if
kdbus is enabled (i.e boot with kdbus=1) DBUS_SESSION_BUS_ADDRESS
must not be exported.
- spec: add a min_kernel_version macro to ensure the package
conflicts with kernel versions in which systemd cannot run.
-------------------------------------------------------------------
Wed Jun 24 20:06:27 UTC 2015 - crrodriguez@opensuse.org
- sysctl-handle-boot-sysctl.conf-kernel_release.patch dropped,
replaced by a tmpfiles.d snippet "current-kernel-sysctl.conf"
(feature implemented in v220 just for our usecase)
-------------------------------------------------------------------
Wed Jun 24 19:45:17 UTC 2015 - crrodriguez@opensuse.org
- fix build when resolved is enabled
- remove fsck -l test in spec file, systemd requires util-linux
2.26 or later where this feature is already available.
-------------------------------------------------------------------
Wed Jun 24 17:43:22 UTC 2015 - hrvoje.senjan@gmail.com
- Fix bootstrap build by guarding filelists (man pages don't get
built in bootstrap mode)
- Drop commented sections from baselibs.conf, allows format_spec_file
to have a successful run
-------------------------------------------------------------------
Wed Jun 24 14:17:04 UTC 2015 - mpluskal@suse.com
- Install 50-coredump.conf as coredumpctl is now installed by
default and does not use journal anymore as default storage
-------------------------------------------------------------------
Fri Jun 19 20:51:14 UTC 2015 - jengelh@inai.de
- Update to new upstream release 221
* From 220:
* libgudev was moved into a package of its own
* Runlevels 2, 3 and 4 are no longer distinct, they all map to
multi-user.target.
* The EFI System Partition mounted to /boot will be unmounted
2 minutes after boot.
* systemd does not support direct live-upgrades (via `systemctl
daemon-reexec`) from versions older than v44 anymore.
* systemd-nspawn may now be called as part of a shell pipeline.
* systemd-shutdownd has been removed. This service was
previously responsible for implementing scheduled shutdowns
as exposed in /usr/bin/shutdown's time parameter. This
functionality has now been moved into systemd-logind and is
accessible via a bus interface.
* udev will no longer call blkid and create symlinks for all
block devices, but merely those from a whitelist
(cf. 60-persistent-storage.rules).
* /usr/lib/os-release gained a new optional field VARIANT=
* Details at
http://lists.freedesktop.org/archives/systemd-devel/2015-May/032147.html
* From 221:
* New sd-bus and sd-event APIs in libsystemd
* If there is both a systemd unit and a SysV init script for the
same service name, and `systemctl enable` or other operation is
run, both will now be enabled (or execute the related operation
on both), not just the unit.
- Split libsystemd0 to support systemd-less nspawn containers
- Redo manpage file lists without %exclude, tends to hide
unpackaged files.
- hwdb belongs to udev
- Resolve memory leak and add missing _cleanup_free_ to
0001-On_s390_con3270_disable_ANSI_colour_esc.patch
- Remove systemd-powerd-initctl-support.patch
(no longer builds because shutdownd is gone)
- Remove quilt-patches/0001-core-rework-device-state-logic.patch,
0001-Let-some-boolean-survive-a-daemon-reload.patch
(merged upstream),
0001-Let-some-boolean-survive-a-daemon-reload.patch
(obsolete)
-------------------------------------------------------------------
Thu Jun 11 14:48:03 UTC 2015 - werner@suse.de

View File

@ -18,10 +18,11 @@
##### WARNING: please do not edit this auto generated spec file. Use the systemd.spec! #####
%define bootstrap 1
%define real systemd
##### WARNING: please do not edit this auto generated spec file. Use the systemd.spec! #####
%define udevpkgname udev-mini
%define udev_major 1
%define mini -mini
%define real systemd
%define min_kernel_version 3.7
%bcond_without bash_completion
%bcond_without networkd
%bcond_without sysvcompat
@ -46,7 +47,7 @@
Name: systemd-mini
Url: http://www.freedesktop.org/wiki/Software/systemd
Version: 219
Version: 224
Release: 0
Summary: A System and Session Manager
License: LGPL-2.1+
@ -61,8 +62,8 @@ BuildRequires: autoconf
BuildRequires: automake
BuildRequires: fdupes
BuildRequires: gperf
BuildRequires: gtk-doc
BuildRequires: intltool
BuildRequires: kbd
BuildRequires: libacl-devel
BuildRequires: libcap-devel
BuildRequires: libsepol-devel
@ -71,12 +72,11 @@ BuildRequires: pam-devel
BuildRequires: systemd-rpm-macros
BuildRequires: xz
BuildRequires: config(suse-module-tools)
BuildRequires: pkgconfig(blkid) >= 2.24
BuildRequires: pkgconfig(blkid) >= 2.26
BuildRequires: pkgconfig(libkmod) >= 15
BuildRequires: pkgconfig(liblzma)
BuildRequires: pkgconfig(libpci) >= 3
BuildRequires: pkgconfig(libpcre)
BuildRequires: pkgconfig(mount) >= 2.20
BuildRequires: pkgconfig(mount) >= 2.26
%ifarch %ix86 x86_64 x32 %arm ppc64le s390x
BuildRequires: pkgconfig(libseccomp)
%endif
@ -85,28 +85,23 @@ BuildRequires: pkgconfig(libsepol)
Conflicts: sysvinit
%if 0%{?bootstrap}
#!BuildIgnore: dbus-1
Requires: this-is-only-for-build-envs
Conflicts: systemd
Conflicts: kiwi
Provides: systemd = %version-%release
Conflicts: otherproviders(systemd)
%else
BuildRequires: docbook-xsl-stylesheets
BuildRequires: gobject-introspection-devel
BuildRequires: gtk-doc
BuildRequires: libgcrypt-devel
BuildRequires: libusb-devel
BuildRequires: libxslt-tools
%if %{with python}
BuildRequires: python
%endif
BuildRequires: libapparmor-devel
BuildRequires: pkgconfig(glib-2.0) >= 2.22.0
BuildRequires: pkgconfig(libcryptsetup) >= 1.6.0
BuildRequires: pkgconfig(libmicrohttpd)
BuildRequires: pkgconfig(libqrencode)
BuildRequires: pkgconfig(usbutils) >= 0.82
# the buildignore is important for bootstrapping
#!BuildIgnore: udev
Requires: %{udevpkgname} >= 172
Requires: udev >= 172
Recommends: %{name}-bash-completion
Requires: dbus-1 >= 1.4.0
Requires: kbd
@ -117,7 +112,7 @@ BuildRequires: pam-config >= 0.79-5
Requires: pwdutils
Requires: systemd-presets-branding
Requires: sysvinit-tools
Requires: util-linux >= 2.25
Requires: util-linux >= 2.26
Requires(post): coreutils
Requires(post): findutils
Requires(post): pam-config >= 0.79-5
@ -129,11 +124,14 @@ Requires(post): /usr/bin/getent
Requires(post): /usr/bin/setfacl
Conflicts: filesystem < 11.5
Conflicts: mkinitrd < 2.7.0
Conflicts: kernel < %{min_kernel_version}
Obsoletes: systemd-analyze < 201
Provides: systemd-analyze = %{version}
Obsoletes: pm-utils <= 1.4.1
Obsoletes: suspend <= 1.0
#Git-Clone: git://anongit.freedesktop.org/systemd/systemd
Source: http://freedesktop.org/software/systemd/systemd-%version.tar.xz
#Git-Clone: git://github.com/systemd/systemd
Source: https://github.com/systemd/systemd/archive/v%version.tar.gz
%if ! 0%{?bootstrap}
Source1: systemd-rpmlintrc
%else
@ -146,7 +144,6 @@ Source9: nss-myhostname-config
Source10: macros.systemd.upstream
Source11: after-local.service
Source1063: udev-generate-persistent-rule.sh
Source1065: systemd-remount-tmpfs
# handle SUSE specific kbd settings
@ -170,8 +167,6 @@ Patch28: apply-ACL-for-nvidia-uvm-device-node.patch
Patch37: suse-sysv-bootd-support.diff
# PATCH-FIX-OPENSUSE systemd-tmp-safe-defaults.patch FATE#314974 max@suse.de -- Return to SUSE's "safe defaults" policy on deleting files from tmp direcorie.
Patch39: systemd-tmp-safe-defaults.patch
# PATCH-FIX-OPENSUSE sysctl-handle-boot-sysctl.conf-kernel_release.patch bnc#809420 fcrozat@suse.com -- handle /boot/sysctl.conf-<kernel_release> file
Patch40: sysctl-handle-boot-sysctl.conf-kernel_release.patch
# PATCH-FIX-OPENSUSE ensure-shortname-is-set-as-hostname-bnc-820213.patch bnc#820213 fcrozat@suse.com -- Do not set anything beyond first dot as hostname
Patch41: ensure-shortname-is-set-as-hostname-bnc-820213.patch
Patch42: systemd-pam_config.patch
@ -180,8 +175,6 @@ Patch42: systemd-pam_config.patch
# Never add any patches to this package without the upstream commit id
# in the patch. Any patches added here without a very good reason to make
# an exception will be silently removed with the next version update.
# PATCH-FIX-OPENSUSE forward to pm-utils -- until boo#904828 is addressed
Patch25: Forward-suspend-hibernate-calls-to-pm-utils.patch
# PATCH-FIX-UPSTREAM rules-add-lid-switch-of-ARM-based-Chromebook-as-a-power-sw.patch rjschwei@suse.com -- add lid switch of ARM based Chromebook as a power switch to logind
Patch38: rules-add-lid-switch-of-ARM-based-Chromebook-as-a-power-sw.patch
# PATCH-FIX-OPENSUSE make-emergency.service-conflict-with-syslog.socket.patch (bnc#852232)
@ -194,8 +187,6 @@ Patch90: 0001-On_s390_con3270_disable_ANSI_colour_esc.patch
Patch91: plymouth-quit-and-wait-for-emergency-service.patch
# PATCH-FIX-SUSE 0001-avoid-abort-due-timeout-at-user-service.patch werner@suse.com
Patch120: 0001-avoid-abort-due-timeout-at-user-service.patch
# PATCH-FIX-OPENSUSE 0009-make-xsltproc-use-correct-ROFF-links.patch -- Make ROFF links working again in manual pages (bnc#842844)
Patch177: 0009-make-xsltproc-use-correct-ROFF-links.patch
# PATCH-FIX-OPENSUSE 0010-do-not-install-sulogin-unit-with-poweroff.patch -- Avoid installing console-shell.service (bnc#849071)
Patch178: 0010-do-not-install-sulogin-unit-with-poweroff.patch
# PATCH-FIX-SUSE 0001-pam_systemd_do_override_XDG_RUNTIME_DIR_of_the_original_user.patch
@ -206,8 +197,6 @@ Patch180: 0014-journald-with-journaling-FS.patch
Patch182: 0019-make-completion-smart-to-be-able-to-redirect.patch
# PATCH-FIX-SUSE 0001-add-network-device-after-NFS-mount-units.patch werner@suse.com
Patch183: 0001-add-network-device-after-NFS-mount-units.patch
# PATCH-FIX-SUSE systemd-powerd-initctl-support.patch
Patch185: systemd-powerd-initctl-support.patch
# PATCH-FIX-SUSE systemctl-set-default-target.patch
Patch186: systemctl-set-default-target.patch
# PATCH-FIX-SUSE boot-local-start.patch (bnc #869142)
@ -253,10 +242,10 @@ Patch490: watch_resolv.conf_for_become_changed.patch
Patch520: systemd-add-user-keep.patch
# PATCH-FIX-SUSE systemd-add-user-keep.patch (bnc#903009)
Patch521: kbd-model-map.patch
Patch522: 0001-core-rework-device-state-logic.patch
# PATCH-FIX-SUSE/PATCH-FIX-UPSTREAM
Patch523: 0001-Let-some-boolean-survive-a-daemon-reload.patch
Patch524: systemd-bfo88401.patch
# PATCH-WORKAROUND-SUSE (boo#939571)
Patch522: Correct_assert_on_unexpected_error_code.patch
# PATCH-FIX-SUSE Do not stress the kernel's vc ioctls (boo#904214)
Patch523: let-vconsole-setup-get-properties-only-once-to-copy-them.patch
# UDEV PATCHES
# ============
@ -282,8 +271,6 @@ Patch1007: 1007-physical-hotplug-cpu-and-memory.patch
Patch1011: 1011-64-btrfs.rules-skip-btrfs-check-if-devices-are-not-r.patch
# PATCH-FIX-SUSE skip persistent device link creation on mp device (bnc#872929)
Patch1012: 1012-Skip-persistent-device-link-creation-on-multipath-de.patch
# PATCH-FIX-SUSE Do not use runtime PM for some IBM consoles (bnc#868931)
Patch1013: 1013-no-runtime-PM-for-IBM-consoles.patch
# PATCH-FIX-SUSE 1035-99-systemd.rules-Ignore-devices-with-SYSTEMD_READY-0.patch
Patch1035: 1035-99-systemd.rules-Ignore-devices-with-SYSTEMD_READY-0.patch
# PATCH-FIX-SUSE See bnc#882714 comment #51
@ -302,6 +289,8 @@ Patch1096: 1096-new-udev-root-symlink-generator.patch
Patch1097: 1097-udevd-increase-maximum-number-of-children.patch
# PATCH-FIX-OPENSUSE 1098-systemd-networkd-alias-network-service.patch
Patch1098: 1098-systemd-networkd-alias-network-service.patch
# PATCH-FIX-OPENSUSE hostname-NULL.patch - fix crash on xen build hosts in OBS Marcus Meissner
Patch1099: hostname-NULL.patch
%description
Systemd is a system and service manager, compatible with SysV and LSB
@ -331,10 +320,14 @@ Some systemd commands offer bash completion, but it's an optional dependency.
Summary: Development headers for systemd
License: LGPL-2.1+
Group: Development/Libraries/C and C++
Requires: %{name} = %{version}
Requires: libsystemd0%{?mini} = %version
Requires: systemd-rpm-macros
%if 0%{?bootstrap}
Conflicts: systemd-devel
Provides: systemd-devel = %version-%release
Conflicts: otherproviders(systemd-devel)
%else
Obsoletes: systemd-mini-devel
Provides: systemd-mini-devel
%endif
%description devel
@ -352,7 +345,39 @@ Provides: sysvinit:/sbin/init
%description sysvinit
Drop-in replacement of System V init tools.
%package -n %{udevpkgname}
%package -n libsystemd0%{?mini}
Summary: Component library for systemd
License: LGPL-2.1+
Group: System/Libraries
%if 0%{?bootstrap}
Conflicts: libsystemd0
%else
Obsoletes: libsystemd0-mini
Provides: libsystemd0-mini
%endif
%description -n libsystemd0%{?mini}
This library provides several of the systemd C APIs:
* sd-bus implements an alternative D-Bus client library that is
relatively easy to use, very efficient and supports both classic
D-Bus as well as kdbus as transport backend.
* sd-daemon(3): for system services (daemons) to report their status
to systemd and to make easy use of socket-based activation logic
* sd-event is a generic event loop abstraction that is built around
Linux epoll, but adds features such as event prioritization or
efficient timer handling.
* sd-id128(3): generation and processing of 128-bit IDs
* sd-journal(3): API to submit and query journal log entries
* sd-login(3): APIs to introspect and monitor seat, login session and
user status information on the local system.
%package -n udev%{?mini}
Summary: A rule-based device node and kernel event manager
License: GPL-2.0
Group: System/Kernel
@ -364,7 +389,7 @@ PreReq: /usr/bin/sg_inq
Requires(pre): /usr/bin/stat
Requires(pre): /usr/sbin/groupadd
Requires(pre): /usr/bin/getent
Requires(post): lib%{udevpkgname}%{udev_major}
Requires(post): libudev%{?mini}1
Requires(post): sed
Requires(post): /usr/bin/systemctl
%if %{defined regenerate_initrd_post}
@ -385,14 +410,14 @@ Conflicts: util-linux < 2.16
Conflicts: ConsoleKit < 0.4.1
Requires: filesystem
%if 0%{?bootstrap}
Provides: udev = %{version}
Conflicts: libudev%{udev_major}
Conflicts: udev
# avoid kiwi picking it for bootstrap
Requires: this-is-only-for-build-envs
Provides: udev = %version-%release
Conflicts: otherproviders(udev)
%else
Obsoletes: udev-mini
Provides: udev-mini
%endif
%description -n %{udevpkgname}
%description -n udev%{?mini}
Udev creates and removes device nodes in /dev for devices discovered or
removed from the system. It receives events via kernel netlink messages
and dispatches them according to rules in /lib/udev/rules.d/. Matching
@ -401,70 +426,40 @@ call tools to initialize a device, or load needed kernel modules.
%package -n lib%{udevpkgname}%{udev_major}
%package -n libudev%{?mini}1
# This really should have been libudev1%{?mini}, but requires changes to prjconf :-/
Summary: Dynamic library to access udev device information
License: LGPL-2.1+
Group: System/Libraries
Requires: %{udevpkgname} >= %{version}-%{release}
%if 0%{?bootstrap}
Conflicts: libudev%{udev_major}
Conflicts: kiwi
# avoid kiwi picking it for bootstrap
Requires: this-is-only-for-build-envs
Conflicts: libudev1
%else
Obsoletes: libudev1-mini
Provides: libudev1-mini
%endif
%description -n lib%{udevpkgname}%{udev_major}
%description -n libudev%{?mini}1
This package contains the dynamic library libudev, which provides
access to udev device information
%package -n lib%{udevpkgname}-devel
%package -n libudev%{?mini}-devel
Summary: Development files for libudev
License: LGPL-2.1+
Group: Development/Libraries/Other
Requires: lib%{udevpkgname}%{udev_major} = %{version}-%{release}
Group: Development/Libraries/C and C++
Requires: libudev%{?mini}1 = %version-%release
%if 0%{?bootstrap}
Provides: libudev-devel = %{version}
Conflicts: libudev%{udev_major} = %{version}
Conflicts: libudev-devel
Provides: libudev-devel = %version-%release
Conflicts: otherproviders(libudev-devel)
%else
Obsoletes: libudev-mini-devel
Provides: libudev-mini-devel
%endif
%description -n lib%{udevpkgname}-devel
%description -n libudev%{?mini}-devel
This package contains the development files for the library libudev, a
dynamic library, which provides access to udev device information.
%if ! 0%{?bootstrap}
%package -n libgudev-1_0-0
Summary: GObject library, to access udev device information
License: LGPL-2.1+
Group: System/Libraries
Requires: lib%{udevpkgname}%{udev_major} = %{version}-%{release}
%description -n libgudev-1_0-0
This package contains the GObject library libgudev, which provides
access to udev device information.
%package -n typelib-1_0-GUdev-1_0
Summary: GObject library, to access udev device information -- Introspection bindings
License: LGPL-2.1+
Group: System/Libraries
%description -n typelib-1_0-GUdev-1_0
This package provides the GObject Introspection bindings for libgudev, which
provides access to udev device information.
%package -n libgudev-1_0-devel
Summary: Devel package for libgudev
License: LGPL-2.1+
Group: Development/Libraries/Other
Requires: glib2-devel
Requires: libgudev-1_0-0 = %{version}-%{release}
Requires: libudev-devel = %{version}-%{release}
Requires: typelib-1_0-GUdev-1_0 = %{version}-%{release}
%description -n libgudev-1_0-devel
This is the devel package for the GObject library libgudev, which
provides GObject access to udev device information.
%package logger
Summary: Journal only logging
License: LGPL-2.1+
@ -560,14 +555,12 @@ cp %{SOURCE7} m4/
%patch17 -p1
%patch20 -p1
%patch21 -p1
%patch25 -p1
# check if this is still needed, or can be derived from fbdev uaccess rule
# http://lists.freedesktop.org/archives/systemd-devel/2012-November/007561.html
%patch27 -p1
%patch28 -p1
%patch37 -p1
%patch39 -p1
%patch40 -p1
%patch41 -p1
%patch42 -p1
%patch84 -p1
@ -575,13 +568,11 @@ cp %{SOURCE7} m4/
%patch90 -p1
%patch91 -p1
%patch120 -p1
%patch177 -p1
%patch178 -p1
%patch179 -p1
%patch180 -p1
%patch182 -p1
%patch183 -p1
%patch185 -p1
%patch186 -p1
%patch188 -p1
%patch189 -p1
@ -608,9 +599,8 @@ cp %{SOURCE7} m4/
%patch490 -p1
%patch520 -p1
%patch521 -p1
%patch522 -p1
%patch523 -p1
%patch524 -p1
%patch522 -p0
%patch523 -p0
# udev patches
%patch1001 -p1
@ -621,7 +611,6 @@ cp %{SOURCE7} m4/
%patch1007 -p1
%patch1011 -p1
%patch1012 -p1
%patch1013 -p1
%patch1035 -p1
%if %{with blkrrpart}
%patch1037 -p1
@ -633,24 +622,7 @@ cp %{SOURCE7} m4/
%patch1096 -p1
%patch1097 -p1
%patch1098 -p1
# remove patch backups
find -name '*.orig' -exec rm -f '{}' \+
# ensure generate files are removed
rm -f units/emergency.service
# disable "-l" option for fsck if it does not support new locking scheme
# compare with commit c343be283b7152554bac0c02493a4e1759c163f7
PATH=${PATH}:/sbin:/usr/sbin
PATH_FSCK=$(type -p fsck)
if grep -q /run/fsck/%%s\\.lock $PATH_FSCK
then
echo Found new $PATH_FSCK that is allow private locking
else
echo Found old $PATH_FSCK that is disable flock for this one
sed -ri 's@^([[:blank:]]+)(cmdline\[i\+\+\][[:blank:]]+=[[:blank:]]+"-l")(;)@\1/* \2 */\3@' src/fsck/fsck.c
fi
%patch1099 -p1
#
# In combination with Patch352 set-and-use-default-logconsole.patch
@ -692,9 +664,8 @@ cflags ()
esac
set +o noclobber
}
autoreconf -fi
# prevent pre-generated and distributed files from re-building
find . -name "*.[1-8]" -exec touch '{}' '+';
sh autogen.sh
export V=e
export CFLAGS="%{optflags}"
export LDFLAGS
@ -708,6 +679,7 @@ cflags -Wl,-O2 LDFLAGS
cflags -Wl,--hash-size=8599 LDFLAGS
# keep split-usr until all packages have moved their systemd rules to /usr
%configure \
--with-ntp-servers="0.opensuse.pool.ntp.org 1.opensuse.pool.ntp.org 2.opensuse.pool.ntp.org 3.opensuse.pool.ntp.org" \
--docdir=%{_docdir}/systemd \
--with-pamlibdir=/%{_lib}/security \
--with-dbuspolicydir=%{_sysconfdir}/dbus-1/system.d \
@ -715,7 +687,6 @@ cflags -Wl,--hash-size=8599 LDFLAGS
--with-dbussystemservicedir=%{_datadir}/dbus-1/system-services \
--with-dbusinterfacedir=%{_datadir}/dbus-1/interfaces \
%if 0%{?bootstrap}
--disable-gudev \
--disable-myhostname \
--disable-manpages \
--disable-machined \
@ -724,7 +695,6 @@ cflags -Wl,--hash-size=8599 LDFLAGS
%if %{with python}
--with-python \
%endif
--enable-gtk-doc \
--with-nss-my-hostname-warning \
%endif
--enable-selinux \
@ -755,9 +725,6 @@ make %{?_smp_mflags} update-man-list man
%endif
%install
%if !0%{?bootstrap}
cp man/man[0-9]/*.[0-9] man/
%endif
make install DESTDIR="%buildroot"
# move to %{_lib}
@ -780,7 +747,6 @@ install -D -m 755 %{S:9} %{buildroot}%{_sbindir}/nss-myhostname-config
%endif
ln -s systemd-udevd.service %{buildroot}/%{_prefix}/lib/systemd/system/udev.service
install -m755 -D %{S:1063} %{buildroot}/%{_prefix}/lib/udev/udev-generate-persistent-rule
install -m755 -D %{S:1065} %{buildroot}/%{_prefix}/lib/udev/remount-tmpfs
mkdir -p %{buildroot}/%{_prefix}/lib/systemd/system/basic.target.wants
rm -rf %{buildroot}%{_sysconfdir}/rpm
@ -812,12 +778,6 @@ cat << EOF > %{buildroot}%{_libexecdir}/modules-load.d/sg.conf
sg
EOF
# To avoid making life hard for Factory developers, don't package the
# kernel.core_pattern setting until systemd-coredump is a part of an actual
# systemd release and it's made clear how to get the core dumps out of the
# journal.
rm -f %{buildroot}%{_prefix}/lib/sysctl.d/50-coredump.conf
# do not ship sysctl defaults in systemd package, will be part of
# aaa_base (in procps for now)
rm -f %{buildroot}%{_prefix}/lib/sysctl.d/50-default.conf
@ -867,6 +827,20 @@ cat << EOF > %{buildroot}%{_prefix}/lib/systemd/system/getty@tty1.service.d/nocl
TTYVTDisallocate=no
EOF
#ensure we get the running kernel sysctl settings.
cat << EOF > %{buildroot}%{_prefix}/lib/tmpfiles.d/current-kernel-sysctl.conf
d! /run/sysctl.d
L! /run/sysctl.d/00-kernel-%v.conf - - - - /boot/sysctl.conf-%v
EOF
mkdir -p %{buildroot}/%{_prefix}/lib/systemd/system/systemd-sysctl.service.d
cat << EOF > %{buildroot}/%{_prefix}/lib/systemd/system/systemd-sysctl.service.d/after.conf
[Unit]
After=local-fs.target
EOF
# ensure after.local wrapper is called
install -m 644 %{S:11} %{buildroot}/%{_prefix}/lib/systemd/system/
ln -s ../after-local.service %{buildroot}/%{_prefix}/lib/systemd/system/multi-user.target.wants/
@ -920,10 +894,31 @@ do
ln -sf ../systemd-update-utmp-runlevel.service %{buildroot}%{_prefix}/lib/systemd/system/${runlevel}.target.wants/
done
# add entries for xkeyboard-config converted keymaps; mappings,
# which already exist in original systemd mapping table are being
# ignored though, i.e. not overwritten
cat /usr/share/systemd/kbd-model-map.xkb-generated \
>> %{buildroot}//usr/share/systemd/kbd-model-map
%find_lang systemd
%pre
getent group systemd-journal >/dev/null || groupadd -r systemd-journal || :
for name in journal timesync network resolve bus-proxy
do
getent group systemd-$name >/dev/null && continue
groupadd -r systemd-$name || :
done
for name in timesync network resolve bus-proxy
do
getent passwd systemd-$name >/dev/null && continue
case "$name" in
timesync) descr="Systemd Time Synchronization" ;;
network) descr="Systemd Network Management" ;;
resolve) descr="Systemd Resolver" ;;
bus-proxy) descr="Systemd Bus Proxy" ;;
esac
useradd -r -l -g systemd-$name systemd-$name -s /usr/sbin/nologin -d / -c "$descr" || :
done
exit 0
%post
@ -932,16 +927,16 @@ exit 0
%endif
/sbin/ldconfig
[ -e %{_localstatedir}/lib/random-seed ] && mv %{_localstatedir}/lib/random-seed %{_localstatedir}/lib/systemd/ > /dev/null || :
/usr/bin/systemd-machine-id-setup >/dev/null 2>&1 || :
/usr/lib/systemd/systemd-random-seed save >/dev/null 2>&1 || :
/usr/bin/systemctl daemon-reexec >/dev/null 2>&1 || :
/usr/bin/journalctl --update-catalog >/dev/null 2>&1 || :
/usr/bin/systemd-machine-id-setup || :
/usr/lib/systemd/systemd-random-seed save || :
/usr/bin/systemctl daemon-reexec || :
/usr/bin/journalctl --update-catalog || :
# Make sure new journal files
chgrp systemd-journal %{_localstatedir}/log/journal/ > /dev/null 2>&1 || :
chmod g+s %{_localstatedir}/log/journal/ > /dev/null 2>&1 || :
chgrp systemd-journal %{_localstatedir}/log/journal/ || :
chmod g+s %{_localstatedir}/log/journal/ || :
if read ID < /etc/machine-id > /dev/null 2>&1 ; then
chgrp systemd-journal %{_localstatedir}/log/journal/$ID > /dev/null 2>&1 || :
chmod g+s %{_localstatedir}/log/journal/$ID > /dev/null 2>&1 || :
chgrp systemd-journal "%{_localstatedir}/log/journal/$ID" || :
chmod g+s "%{_localstatedir}/log/journal/$ID" || :
fi
%if %{with systemgrps}
getent group wheel && setfacl -Rnm g:wheel:rx,d:g:wheel:rx %{_localstatedir}/log/journal/ > /dev/null 2>&1 || :
@ -964,7 +959,7 @@ if [ "$1" -eq 1 ]; then
getty@tty1.service \
systemd-readahead-collect.service \
systemd-readahead-replay.service \
remote-fs.target >/dev/null 2>&1 || :
remote-fs.target || :
fi
# since v207 /etc/sysctl.conf is no longer parsed, however
@ -982,8 +977,9 @@ done
%postun
/sbin/ldconfig
if [ $1 -ge 1 ]; then
/usr/bin/systemctl daemon-reload >/dev/null 2>&1 || :
/usr/bin/systemctl try-restart systemd-logind.service >/dev/null 2>&1 || :
/usr/bin/systemctl daemon-reload || :
#Avoid restarting logind [bnc#934901] until fixed upstream
#/usr/bin/systemctl try-restart systemd-logind.service || :
fi
%if ! 0%{?bootstrap}
if [ $1 -eq 0 ]; then
@ -995,16 +991,17 @@ fi
if [ $1 -eq 0 ]; then
/usr/bin/systemctl disable \
getty@.service \
remote-fs.target >/dev/null 2>&1 || :
remote-fs.target || :
rm -f /etc/systemd/system/default.target 2>&1 || :
fi
%pretrans -n %{udevpkgname} -p <lua>
# pretrans section must always use lua
%pretrans -n udev%{?mini} -p <lua>
if posix.stat("/lib/udev") and not posix.stat("/usr/lib/udev") then
posix.symlink("/lib/udev", "/usr/lib/udev")
end
%pre -n %{udevpkgname}
%pre -n udev%{?mini}
if test -L /usr/lib/udev -a /lib/udev -ef /usr/lib/udev ; then
rm /usr/lib/udev
mv /lib/udev /usr/lib
@ -1013,31 +1010,33 @@ elif [ ! -e /lib/udev ]; then
ln -s /usr/lib/udev /lib/udev
fi
# Create "tape" group which is referenced by 50-udev-default.rules and 60-persistent-storage-tape.rules
getent group tape >/dev/null || groupadd -r tape 2> /dev/null || :
getent group tape >/dev/null || groupadd -r tape || :
# kill daemon if we are not in a chroot
if test -f /proc/1/exe -a -d /proc/1/root ; then
if test "$(stat -Lc '%%D-%%i' /)" = "$(stat -Lc '%%D-%%i' /proc/1/root)"; then
systemctl stop systemd-udevd-control.socket systemd-udevd-kernel.socket systemd-udevd.service udev.service udev-control.socket udev-kernel.socket >/dev/null 2>&1 || :
udevadm control --exit 2>&1 || :
systemctl stop systemd-udevd-control.socket systemd-udevd-kernel.socket systemd-udevd.service udev.service udev-control.socket udev-kernel.socket || :
udevadm control --exit || :
fi
fi
%post -n %{udevpkgname}
/usr/bin/udevadm hwdb --update >/dev/null 2>&1 || :
# add KERNEL name match to existing persistent net rules
sed -ri '/KERNEL/ ! { s/NAME="(eth|wlan|ath)([0-9]+)"/KERNEL=="\1*", NAME="\1\2"/}' \
/etc/udev/rules.d/70-persistent-net.rules >/dev/null 2>&1 || :
%post -n udev%{?mini}
/usr/bin/udevadm hwdb --update || :
if [ -f /etc/udev/rules.d/70-persistent-net.rules ]; then
# add KERNEL name match to existing persistent net rules
sed -ri '/KERNEL/ ! { s/NAME="(eth|wlan|ath)([0-9]+)"/KERNEL=="\1*", NAME="\1\2"/}' \
/etc/udev/rules.d/70-persistent-net.rules || :
fi
# cleanup old stuff
rm -f /etc/sysconfig/udev
rm -f /etc/udev/rules.d/20-cdrom.rules
rm -f /etc/udev/rules.d/55-cdrom.rules
rm -f /etc/udev/rules.d/65-cdrom.rules
systemctl daemon-reload >/dev/null 2>&1 || :
systemctl daemon-reload || :
# start daemon if we are not in a chroot
if test -f /proc/1/exe -a -d /proc/1/root; then
if test "$(stat -Lc '%%D-%%i' /)" = "$(stat -Lc '%%D-%%i' /proc/1/root)"; then
if ! systemctl start systemd-udevd.service >/dev/null 2>&1; then
/usr/lib/systemd/systemd-udevd --daemon >/dev/null 2>&1 || :
if ! systemctl start systemd-udevd.service; then
/usr/lib/systemd/systemd-udevd --daemon || :
fi
fi
fi
@ -1057,9 +1056,9 @@ if [ "${YAST_IS_RUNNING}" != "instsys" ]; then
fi
fi
%postun -n %{udevpkgname}
%postun -n udev%{?mini}
%insserv_cleanup
systemctl daemon-reload >/dev/null 2>&1 || :
systemctl daemon-reload || :
if [ "${YAST_IS_RUNNING}" != "instsys" ]; then
if [ -e %{_localstatedir}/lib/no_initrd_recreation_by_suspend ]; then
@ -1077,20 +1076,17 @@ if [ "${YAST_IS_RUNNING}" != "instsys" ]; then
fi
%if %{defined regenerate_initrd_post}
%posttrans -n %{udevpkgname}
%posttrans -n udev%{?mini}
%regenerate_initrd_posttrans
%endif
%post -n lib%{udevpkgname}%{udev_major} -p /sbin/ldconfig
%postun -n lib%{udevpkgname}%{udev_major} -p /sbin/ldconfig
%post -n libsystemd0%{?mini} -p /sbin/ldconfig
%postun -n libsystemd0%{?mini} -p /sbin/ldconfig
%post -n libudev%{?mini}1 -p /sbin/ldconfig
%postun -n libudev%{?mini}1 -p /sbin/ldconfig
%if ! 0%{?bootstrap}
%post -n libgudev-1_0-0 -p /sbin/ldconfig
%postun -n libgudev-1_0-0 -p /sbin/ldconfig
%if %{with permission}
%verifyscript logger
%verify_permissions -e %{_localstatedir}/log/journal/
@ -1110,7 +1106,7 @@ getent group adm && setfacl -Rnm g:adm:rx,d:g:adm:rx %{_localstatedir}/log
%endif
if [ "$1" -eq 1 ]; then
# tell journal to start logging on disk if directory didn't exist before
systemctl --no-block restart systemd-journal-flush.service >/dev/null 2>&1 || :
systemctl --no-block restart systemd-journal-flush.service || :
fi
%preun -n nss-myhostname
@ -1126,7 +1122,7 @@ fi
%postun -n nss-mymachines -p /sbin/ldconfig
%pre journal-gateway
getent passwd systemd-journal-gateway >/dev/null || useradd -r -l -g systemd-journal-gateway -d %{_localstatedir}/log/journal/ -s /usr/sbin/nologin -c "Journal Gateway" systemd-journal-gateway >/dev/null 2>&1 || :
getent passwd systemd-journal-gateway >/dev/null || useradd -r -l -g systemd-journal-gateway -d %{_localstatedir}/log/journal/ -s /usr/sbin/nologin -c "Systemd Journal Gateway" systemd-journal-gateway || :
getent group systemd-journal-gateway >/dev/null || groupadd -r systemd-journal-gateway || :
%service_add_pre systemd-journal-gatewayd.socket systemd-journal-gatewayd.service
exit 0
@ -1166,7 +1162,6 @@ exit 0
%{_bindir}/systemd-path
%{_bindir}/systemd-sysusers
%{_bindir}/systemd-notify
%{_bindir}/systemd-hwdb
%{_bindir}/systemd-run
%{_bindir}/systemd-journalctl
%{_bindir}/journalctl
@ -1182,13 +1177,6 @@ exit 0
%{_bindir}/systemd-detect-virt
%{_bindir}/timedatectl
%{_sbindir}/systemd-sysv-convert
%{_libdir}/libsystemd.so.*
%if %{with compat_libs}
%{_libdir}/libsystemd-daemon.so.*
%{_libdir}/libsystemd-login.so.*
%{_libdir}/libsystemd-id128.so.*
%{_libdir}/libsystemd-journal.so.*
%endif
%{_bindir}/systemd-cgls
%{_bindir}/systemd-cgtop
%{_bindir}/systemd-cat
@ -1219,6 +1207,7 @@ exit 0
%{_prefix}/lib/systemd/system/*.path
%{_prefix}/lib/systemd/user/*.target
%{_prefix}/lib/systemd/user/*.service
%{_prefix}/lib/systemd/user/*.socket
%exclude %{_prefix}/lib/systemd/systemd-udevd
%if ! 0%{?bootstrap}
%exclude %{_prefix}/lib/systemd/systemd-journal-gatewayd
@ -1233,6 +1222,7 @@ exit 0
%dir %{_prefix}/lib/systemd/user-preset
%dir %{_prefix}/lib/systemd/system-generators
%dir %{_prefix}/lib/systemd/user-generators
%{_prefix}/lib/systemd/user-generators/systemd-dbus1-generator
%dir %{_prefix}/lib/systemd/ntp-units.d/
%dir %{_prefix}/lib/systemd/system-shutdown/
%dir %{_prefix}/lib/systemd/system-sleep/
@ -1240,12 +1230,14 @@ exit 0
%dir %{_prefix}/lib/systemd/system/dbus.target.wants
%dir %{_prefix}/lib/systemd/system/getty@tty1.service.d
%{_prefix}/lib/systemd/system/getty@tty1.service.d/noclear.conf
%dir %{_prefix}/lib/systemd/system/systemd-sysctl.service.d
%{_prefix}/lib/systemd/system/systemd-sysctl.service.d/after.conf
%if ! 0%{?bootstrap}
%{_prefix}/lib/systemd/system-generators/systemd-cryptsetup-generator
%endif
%{_prefix}/lib/systemd/system-generators/systemd-dbus1-generator
%if 0%{has_efi}
%{_bindir}/bootctl
%{_prefix}/lib/systemd/system-generators/systemd-efi-boot-generator
%endif
%{_prefix}/lib/systemd/system-generators/systemd-debug-generator
%{_prefix}/lib/systemd/system-generators/systemd-hibernate-resume-generator
@ -1276,6 +1268,7 @@ exit 0
%dir %{_libexecdir}/sysctl.d
%dir %{_sysconfdir}/sysctl.d
%{_prefix}/lib/sysctl.d/50-coredump.conf
%dir %{_sysconfdir}/systemd
%dir %{_sysconfdir}/systemd/system
@ -1309,6 +1302,7 @@ exit 0
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/org.freedesktop.hostname1.conf
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/org.freedesktop.timedate1.conf
%{_sysconfdir}/X11/xinit/
# Some files which may created by us
%dir %{_sysconfdir}/X11/xorg.conf.d
%ghost %config(noreplace) %{_sysconfdir}/X11/xorg.conf.d/00-keyboard.conf
@ -1324,15 +1318,23 @@ exit 0
%{_datadir}/factory/
%{_datadir}/dbus-1/services/org.freedesktop.systemd1.service
%if %{with networkd}
%{_prefix}/lib/systemd/system/org.freedesktop.network1.busname
%{_datadir}/dbus-1/system-services/org.freedesktop.network1.service
%endif
%{_prefix}/lib/systemd/system/org.freedesktop.systemd1.busname
%{_datadir}/dbus-1/system-services/org.freedesktop.systemd1.service
%{_prefix}/lib/systemd/system/org.freedesktop.locale1.busname
%{_datadir}/dbus-1/system-services/org.freedesktop.locale1.service
%{_prefix}/lib/systemd/system/org.freedesktop.login1.busname
%{_datadir}/dbus-1/system-services/org.freedesktop.login1.service
%{_prefix}/lib/systemd/system/org.freedesktop.hostname1.busname
%{_datadir}/dbus-1/system-services/org.freedesktop.hostname1.service
%if !0%{?bootstrap}
%{_prefix}/lib/systemd/system/org.freedesktop.machine1.busname
%{_datadir}/dbus-1/system-services/org.freedesktop.machine1.service
%endif
%{_prefix}/lib/systemd/system/org.freedesktop.timedate1.busname
%{_datadir}/dbus-1/system-services/org.freedesktop.timedate1.service
%dir %{_datadir}/polkit-1
%dir %{_datadir}/polkit-1/actions
@ -1350,20 +1352,20 @@ exit 0
%{_datadir}/systemd
%if ! 0%{?bootstrap}
# Packaged in sysvinit subpackage
%exclude %{_mandir}/man1/init.1*
%exclude %{_mandir}/man8/halt.8*
%exclude %{_mandir}/man8/reboot.8*
%exclude %{_mandir}/man8/shutdown.8*
%exclude %{_mandir}/man8/poweroff.8*
%exclude %{_mandir}/man8/telinit.8*
%exclude %{_mandir}/man8/runlevel.8*
%exclude %{_mandir}/man*/*udev*.[0-9]*
%exclude %{_mandir}/man8/systemd-journal-gatewayd.*
%{_mandir}/man1/*.1*
%{_mandir}/man5/*.5*
%{_mandir}/man7/*.7*
%{_mandir}/man8/*.8*
%_mandir/man1/[a-rt-z]*ctl.1*
%_mandir/man1/systemc*.1*
%_mandir/man1/systemd*.1*
%_mandir/man5/[a-tv-z]*
%_mandir/man5/user*
%_mandir/man7/[bdfks]*
%_mandir/man8/kern*
%_mandir/man8/pam_*
%_mandir/man8/systemd-[a-gik-tv]*
%_mandir/man8/systemd-h[aioy]*
%_mandir/man8/systemd-journal-remote.*
%_mandir/man8/systemd-journal-upload.*
%_mandir/man8/systemd-journald*
%_mandir/man8/systemd-u[ps]*
%endif
%{_docdir}/systemd
%{_prefix}/lib/udev/rules.d/70-uaccess.rules
@ -1393,6 +1395,7 @@ exit 0
%{_sysconfdir}/systemd/resolved.conf
%{_libdir}/libnss_resolve.so.2
%{_datadir}/dbus-1/system-services/org.freedesktop.resolve1.service
%{_prefix}/lib/systemd/system/org.freedesktop.resolve1.busname
%endif
%if ! 0%{?bootstrap}
@ -1410,21 +1413,16 @@ exit 0
%{_libdir}/libsystemd-login.so
%{_libdir}/libsystemd-id128.so
%{_libdir}/libsystemd-journal.so
%dir %{_includedir}/systemd
%{_includedir}/systemd/sd-login.h
%{_includedir}/systemd/sd-daemon.h
%{_includedir}/systemd/sd-id128.h
%{_includedir}/systemd/sd-journal.h
%{_includedir}/systemd/sd-messages.h
%{_includedir}/systemd/_sd-common.h
%{_libdir}/pkgconfig/systemd.pc
%{_includedir}/systemd/
%{_datadir}/pkgconfig/systemd.pc
%{_libdir}/pkgconfig/libsystemd.pc
%{_libdir}/pkgconfig/libsystemd-daemon.pc
%{_libdir}/pkgconfig/libsystemd-login.pc
%{_libdir}/pkgconfig/libsystemd-id128.pc
%{_libdir}/pkgconfig/libsystemd-journal.pc
%if ! 0%{?bootstrap}
%{_mandir}/man3/*.3*
%_mandir/man3/SD*.3*
%_mandir/man3/sd*.3*
%endif
%files sysvinit
@ -1446,7 +1444,7 @@ exit 0
%{_mandir}/man8/runlevel.8*
%endif
%files -n %{udevpkgname}
%files -n udev%{?mini}
%defattr(-,root,root)
/sbin/udevd
/sbin/udevadm
@ -1456,15 +1454,14 @@ exit 0
%if 0%{?suse_version} <= 1310
%{_prefix}/lib/firmware
%endif
%{_bindir}/systemd-hwdb
%dir %{_prefix}/lib/udev/
%{_prefix}/lib/udev/accelerometer
%{_prefix}/lib/udev/ata_id
%{_prefix}/lib/udev/cdrom_id
%{_prefix}/lib/udev/collect
%{_prefix}/lib/udev/mtd_probe
%{_prefix}/lib/udev/scsi_id
%{_prefix}/lib/udev/v4l_id
%{_prefix}/lib/udev/udev-generate-persistent-rule
%{_prefix}/lib/udev/remount-tmpfs
%{_prefix}/lib/udev/rootsymlink-generator
%dir %{_prefix}/lib/udev/rules.d/
@ -1474,14 +1471,18 @@ exit 0
%exclude %{_prefix}/lib/udev/rules.d/73-seat-numlock.rules
%exclude %{_prefix}/lib/udev/rules.d/99-systemd.rules
%{_prefix}/lib/udev/rules.d/*.rules
%dir %{_prefix}/lib/udev/hwdb.d
%{_prefix}/lib/udev/hwdb.d/*
%{_prefix}/lib/udev/hwdb.d/
%dir %{_sysconfdir}/udev/
%dir %{_sysconfdir}/udev/rules.d/
%ghost %{_sysconfdir}/udev/hwdb.bin
%config(noreplace) %{_sysconfdir}/udev/udev.conf
%if ! 0%{?bootstrap}
%{_mandir}/man?/*udev*.[0-9]*
%_mandir/man5/udev*
%_mandir/man7/hwdb*
%_mandir/man7/udev*
%_mandir/man8/systemd-hwdb*
%_mandir/man8/systemd-udev*
%_mandir/man8/udev*
%endif
%dir %{_prefix}/lib/systemd/system
%{_prefix}/lib/systemd/systemd-udevd
@ -1498,44 +1499,30 @@ exit 0
%{_datadir}/pkgconfig/udev.pc
%endif
%files -n lib%{udevpkgname}%{udev_major}
%files -n libsystemd0%{?mini}
%defattr(-,root,root)
%_libdir/libsystemd.so.*
%if %{with compat_libs}
%_libdir/libsystemd-daemon.so.*
%_libdir/libsystemd-login.so.*
%_libdir/libsystemd-id128.so.*
%_libdir/libsystemd-journal.so.*
%endif
%files -n libudev%{?mini}1
%defattr(-,root,root)
%{_libdir}/libudev.so.*
%files -n lib%{udevpkgname}-devel
%files -n libudev%{?mini}-devel
%defattr(-,root,root)
%{_includedir}/libudev.h
%{_libdir}/libudev.so
%{_libdir}/pkgconfig/libudev.pc
%if ! 0%{?bootstrap}
%dir %{_datadir}/gtk-doc
%dir %{_datadir}/gtk-doc/html
%dir %{_datadir}/gtk-doc/html/libudev
%{_datadir}/gtk-doc/html/libudev/*
%{_mandir}/man3/*udev*.3*
%endif
%if ! 0%{?bootstrap}
%files -n libgudev-1_0-0
%defattr(-,root,root)
%{_libdir}/libgudev-1.0.so.*
%files -n typelib-1_0-GUdev-1_0
%defattr(-,root,root)
%{_libdir}/girepository-1.0/GUdev-1.0.typelib
%files -n libgudev-1_0-devel
%defattr(-,root,root)
%dir %{_includedir}/gudev-1.0
%dir %{_includedir}/gudev-1.0/gudev
%{_includedir}/gudev-1.0/gudev/*.h
%{_libdir}/libgudev-1.0.so
%{_libdir}/pkgconfig/gudev-1.0.pc
%dir %{_datadir}/gtk-doc
%dir %{_datadir}/gtk-doc/html
%dir %{_datadir}/gtk-doc/html/gudev
%{_datadir}/gtk-doc/html/gudev/*
%{_datadir}/gir-1.0/GUdev-1.0.gir
%files logger
%defattr(-,root,root)
%dir %attr(2755,root,systemd-journal) %{_localstatedir}/log/journal/
@ -1546,6 +1533,10 @@ exit 0
%files -n nss-myhostname
%defattr(-, root, root)
%{_sbindir}/nss-myhostname-config
%if !0%{?bootstrap}
%{_mandir}/man8/libnss_myhostname.*
%{_mandir}/man8/nss-myhostname.*
%endif
/%{_lib}/*nss_myhostname*
%files journal-gateway
@ -1558,6 +1549,10 @@ exit 0
%files -n nss-mymachines
%defattr(-,root,root)
%_libdir/libnss_mymachines.so*
%if !0%{?bootstrap}
%_mandir/man8/libnss_mymachines.*
%_mandir/man8/nss-mymachines.*
%endif
%endif
%changelog

View File

@ -2,10 +2,10 @@
src/login/systemd-user | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: systemd-218/src/login/systemd-user
Index: systemd-221/src/login/systemd-user
===================================================================
--- systemd-218.orig/src/login/systemd-user
+++ systemd-218/src/login/systemd-user
--- systemd-221.orig/src/login/systemd-user
+++ systemd-221/src/login/systemd-user
@@ -2,5 +2,5 @@
#
# Used by systemd --user instances.

View File

@ -1,121 +0,0 @@
From 7b8b1ca177a532a6673e5795af867b3631622391 Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Fri, 7 Mar 2014 14:04:58 +0100
Subject: [PATCH] systemd: powerd initctl support
Old versions of powerd will be using the initctl fifo to signal
state changes. To maintain backward compability systemd should
be interpreting these messages, too.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
src/initctl/initctl.c | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 70 insertions(+), 1 deletion(-)
--- systemd-219.orig/src/initctl/initctl.c
+++ systemd-219/src/initctl/initctl.c
@@ -32,8 +32,11 @@
#include <sys/un.h>
#include <fcntl.h>
#include <ctype.h>
+#include <sys/reboot.h>
+#include <linux/reboot.h>
#include "sd-daemon.h"
+#include "sd-shutdown.h"
#include "sd-bus.h"
#include "util.h"
@@ -44,6 +47,7 @@
#include "bus-util.h"
#include "bus-error.h"
#include "def.h"
+#include "socket-util.h"
#define SERVER_FD_MAX 16
#define TIMEOUT_MSEC ((int) (DEFAULT_EXIT_USEC/USEC_PER_MSEC))
@@ -141,7 +145,54 @@ static void change_runlevel(Server *s, i
}
}
+static int send_shutdownd(unsigned delay, char mode, const char *message) {
+#ifdef HAVE_SYSV_COMPAT
+ usec_t t = now(CLOCK_REALTIME) + delay * USEC_PER_MINUTE;
+ struct sd_shutdown_command c = {
+ .usec = t,
+ .mode = mode,
+ .dry_run = false,
+ .warn_wall = true,
+ };
+
+ union sockaddr_union sockaddr = {
+ .un.sun_family = AF_UNIX,
+ .un.sun_path = "/run/systemd/shutdownd",
+ };
+
+ struct iovec iovec[2] = {{
+ .iov_base = (char*) &c,
+ .iov_len = offsetof(struct sd_shutdown_command, wall_message),
+ }};
+
+ struct msghdr msghdr = {
+ .msg_name = &sockaddr,
+ .msg_namelen = offsetof(struct sockaddr_un, sun_path)
+ + sizeof("/run/systemd/shutdownd") - 1,
+ .msg_iov = iovec,
+ .msg_iovlen = 1,
+ };
+
+ _cleanup_close_ int fd;
+
+ fd = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0);
+ if (fd < 0)
+ return -errno;
+
+ if (!isempty(message)) {
+ iovec[1].iov_base = (char*) message;
+ iovec[1].iov_len = strlen(message);
+ msghdr.msg_iovlen++;
+ }
+
+ if (sendmsg(fd, &msghdr, MSG_NOSIGNAL) < 0)
+ return -errno;
+#endif
+ return 0;
+}
+
static void request_process(Server *s, const struct init_request *req) {
+ int r;
assert(s);
assert(req);
@@ -184,9 +235,28 @@ static void request_process(Server *s, c
return;
case INIT_CMD_POWERFAIL:
+ r = send_shutdownd(2, SD_SHUTDOWN_POWEROFF,
+ "THE POWER IS FAILED! SYSTEM GOING DOWN! PLEASE LOG OFF NOW!");
+ if (r < 0) {
+ log_warning("Failed to talk to shutdownd, shutdown cancelled: %s", strerror(-r));
+ }
+ return;
case INIT_CMD_POWERFAILNOW:
+ r = send_shutdownd(0, SD_SHUTDOWN_POWEROFF,
+ "THE POWER IS FAILED! LOW BATTERY - EMERGENCY SYSTEM SHUTDOWN!");
+ if (r < 0) {
+ log_warning("Failed to talk to shutdownd, proceeding with immediate shutdown: %s", strerror(-r));
+ reboot(RB_ENABLE_CAD);
+ reboot(RB_POWER_OFF);
+ }
+ return;
+
case INIT_CMD_POWEROK:
- log_warning("Received UPS/power initctl request. This is not implemented in systemd. Upgrade your UPS daemon!");
+ r = send_shutdownd(0, SD_SHUTDOWN_NONE,
+ "THE POWER IS BACK");
+ if (r < 0) {
+ log_warning("Failed to talk to shutdownd, proceeding with shutdown: %s", strerror(-r));
+ }
return;
case INIT_CMD_CHANGECONS:

View File

@ -8,10 +8,10 @@ SUSE policy is to not clean /tmp by default.
tmpfiles.d/tmp.conf | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
Index: systemd/tmpfiles.d/tmp.conf
Index: systemd-221/tmpfiles.d/tmp.conf
===================================================================
--- systemd.orig/tmpfiles.d/tmp.conf
+++ systemd/tmpfiles.d/tmp.conf
--- systemd-221.orig/tmpfiles.d/tmp.conf
+++ systemd-221/tmpfiles.d/tmp.conf
@@ -8,8 +8,9 @@
# See tmpfiles.d(5) for details

View File

@ -1,7 +1,270 @@
-------------------------------------------------------------------
Thu Sep 24 12:47:29 UTC 2015 - dimstar@opensuse.org
Fri Sep 25 14:20:41 UTC 2015 - werner@suse.de
- Add systemd-bfo88401.patch: do not restart services on coldplug.
- Fix patch tty-ask-password-agent-on-console.patch not to crash
away but enable it to ask on all devices of /dev/console
-------------------------------------------------------------------
Wed Sep 23 14:19:32 UTC 2015 - jengelh@inai.de
- Avoid "file not found /etc/udev/rules.d/70-persistent-net.rules"
waring occurring in %post
-------------------------------------------------------------------
Wed Sep 23 12:41:19 UTC 2015 - werner@suse.de
- Add patch let-vconsole-setup-get-properties-only-once-to-copy-them.patch
to avoid broken virtual console mapping due stressed ioctl API
for the virtual consoles (boo#904214)
-------------------------------------------------------------------
Mon Sep 7 12:21:06 UTC 2015 - werner@suse.de
- Fix last change that is use the new name for udev packages in %pretrans.
-------------------------------------------------------------------
Mon Sep 7 11:50:21 UTC 2015 - fbui@suse.com
- restore usage of LUA in %pretrans.
-------------------------------------------------------------------
Mon Sep 7 08:09:05 UTC 2015 - werner@suse.de
- Try to generate the systemd users and groups always in same order
to avoid republish other packages (boo#944660)
-------------------------------------------------------------------
Fri Aug 21 07:49:33 UTC 2015 - fbui@suse.com
- cleanup specfile by removing commands that were dealing with systemd
pre-generated files: we're now using systemd tarball generated directly
from the git repo which doesn't contain any of these files.
- there's no point in using LUA in %pretrans
-------------------------------------------------------------------
Wed Aug 19 09:34:41 UTC 2015 - fbui@suse.com
- Drop 0009-make-xsltproc-use-correct-ROFF-links.patch
This patch was initialy added to workaround bsc#842844. But it
appears that man(1) was fixed (included since 13.2 at least) to
handle manual pages that consist only of a .so directive such as
'.so <page>'.
-------------------------------------------------------------------
Thu Aug 13 11:46:12 UTC 2015 - werner@suse.de
- Change use-rndaddentropy-ioctl-to-load-random-seed.patch to
make it work on big endian
-------------------------------------------------------------------
Tue Aug 11 09:48:26 UTC 2015 - jengelh@inai.de
- Use Obsolete/Provides strategy from
windows:mingw:mingw64/mingw64-cross-gcc to do the bootstrap
cycle and kick out -mini afterwards.
-------------------------------------------------------------------
Tue Aug 11 05:15:09 UTC 2015 - jengelh@inai.de
- Update to new upstream release 224
* systemd-networkd gained a number of new configuration options
for DHCP, tunnels and bridges
* systemd-efi-boot-generator functionality was merged into
systemd-gpt-auto-generator.
-------------------------------------------------------------------
Mon Aug 10 13:16:54 UTC 2015 - sndirsch@suse.com
- /usr/share/systemd/kbd-model-map: added entries for
xkeyboard-config converted keymaps; mappings, which already
exist in original systemd mapping table are being ignored
though, i.e. not overwritten; needs kbd in buildrequires
(FATE#318426)
-------------------------------------------------------------------
Wed Jul 29 18:10:53 UTC 2015 - meissner@suse.com
- hostname-NULL.patch: Work around a crash on XEN hosts
in OBS. /etc/hostname is not present and systemd then does
strchr(hostname,soemthing) with hostname NULL.
-------------------------------------------------------------------
Wed Jul 29 09:02:21 UTC 2015 - werner@suse.de
- Add Correct_assert_on_unexpected_error_code.patch to work around
a problem of an assert on ENODEV for closing fd on an input
event device (boo#939571)
-------------------------------------------------------------------
Mon Jul 13 15:31:46 UTC 2015 - jengelh@inai.de
- Remove udev-generate-rules.sh, apparently not used by anything in
the systemd nor udev-persistent-ifnames package.
-------------------------------------------------------------------
Wed Jul 8 20:44:57 UTC 2015 - crrodriguez@opensuse.org
- Systemd v222, bugfix release.
- Drop upstream patches
0006-pam_systemd-Properly-check-kdbus-availability.patch
0023-core-fix-reversed-dependency-check-in-unit_check_unn.patch
0031-install-fix-bad-memory-access.patch
1032-ata_id-unbotch-format-specifier.patch
- Drop SUSE patch 1013-no-runtime-PM-for-IBM-consoles.patch
udev does no longer enable USB HID power management at all.
- The udev accelerometer helper was removed, obsoleted by
iio-sensor-proxy package.
- networkd gained a new configuration option IPv6PrivacyExtensions.
- udev does not longer support the WAIT_FOR_SYSFS= key in udev
rules. There are no known issues with current sysfs,
and udev does not need or should be used to work around such bugs.
-------------------------------------------------------------------
Tue Jul 7 08:54:38 UTC 2015 - jengelh@inai.de
- Avoid restarting logind [bnc#934901]
- Do not suppress errors in any case, even if they are ignored
-------------------------------------------------------------------
Sun Jul 5 15:52:33 UTC 2015 - hrvoje.senjan@gmail.com
- Fix devel package requires (both mini and real required real libsystemd0)
-------------------------------------------------------------------
Fri Jul 3 11:17:01 UTC 2015 - werner@suse.de
- Rework patch tty-ask-password-agent-on-console.patch to fit the
requisition of https://bugs.freedesktop.org/show_bug.cgi?id=82004
-------------------------------------------------------------------
Wed Jul 1 09:42:44 UTC 2015 - jengelh@inai.de
- Rework "-mini" package logic to not conflict with itself and
then add libsystemd0 to mini.
-------------------------------------------------------------------
Wed Jul 1 03:43:51 UTC 2015 - crrodriguez@opensuse.org
- remove SysVStartPriority= from after-local.service,
unsupported since v218.
Note that this option was only parsed and that's it. the logic
to give "start priority" was never implemented.
-------------------------------------------------------------------
Wed Jul 1 03:20:20 UTC 2015 - crrodriguez@opensuse.org
- change the default fallback ntp servers to the opensuse
pool.ntp.org vendor zone.
- We still need to run systemd-sysctl.service after local-fs.target
otherwise it works only when /boot is in the root filesystem but
not when it is a separate partition.
-------------------------------------------------------------------
Fri Jun 26 17:14:46 CEST 2015 - sbrabec@suse.com
- Obsolete pm-utils and suspend (boo#925873).
- Remove pm-utils support
(remove Forward-suspend-hibernate-calls-to-pm-utils.patch).
-------------------------------------------------------------------
Thu Jun 25 17:27:06 UTC 2015 - crrodriguez@opensuse.org
- remove patch sysctl-handle-boot-sysctl.conf-kernel_release.patch
from the filelist.
-------------------------------------------------------------------
Thu Jun 25 05:56:55 UTC 2015 - crrodriguez@opensuse.org
- libpcre, glib2 and libusb are not used by systemd, remove
from buildrequires.
-------------------------------------------------------------------
Thu Jun 25 05:19:54 UTC 2015 - crrodriguez@opensuse.org
- 1032-ata_id-unbotch-format-specifier.patch: fix udev ata_id
output.
- 0023-core-fix-reversed-dependency-check-in-unit_check_unn.patch
fix StopWhenUnneeded=true in combination with a Requisite=
dependency.
- 0031-install-fix-bad-memory-access.patch: Fix Bad memory access
- 0006-pam_systemd-Properly-check-kdbus-availability.patch: if
kdbus is enabled (i.e boot with kdbus=1) DBUS_SESSION_BUS_ADDRESS
must not be exported.
- spec: add a min_kernel_version macro to ensure the package
conflicts with kernel versions in which systemd cannot run.
-------------------------------------------------------------------
Wed Jun 24 20:06:27 UTC 2015 - crrodriguez@opensuse.org
- sysctl-handle-boot-sysctl.conf-kernel_release.patch dropped,
replaced by a tmpfiles.d snippet "current-kernel-sysctl.conf"
(feature implemented in v220 just for our usecase)
-------------------------------------------------------------------
Wed Jun 24 19:45:17 UTC 2015 - crrodriguez@opensuse.org
- fix build when resolved is enabled
- remove fsck -l test in spec file, systemd requires util-linux
2.26 or later where this feature is already available.
-------------------------------------------------------------------
Wed Jun 24 17:43:22 UTC 2015 - hrvoje.senjan@gmail.com
- Fix bootstrap build by guarding filelists (man pages don't get
built in bootstrap mode)
- Drop commented sections from baselibs.conf, allows format_spec_file
to have a successful run
-------------------------------------------------------------------
Wed Jun 24 14:17:04 UTC 2015 - mpluskal@suse.com
- Install 50-coredump.conf as coredumpctl is now installed by
default and does not use journal anymore as default storage
-------------------------------------------------------------------
Fri Jun 19 20:51:14 UTC 2015 - jengelh@inai.de
- Update to new upstream release 221
* From 220:
* libgudev was moved into a package of its own
* Runlevels 2, 3 and 4 are no longer distinct, they all map to
multi-user.target.
* The EFI System Partition mounted to /boot will be unmounted
2 minutes after boot.
* systemd does not support direct live-upgrades (via `systemctl
daemon-reexec`) from versions older than v44 anymore.
* systemd-nspawn may now be called as part of a shell pipeline.
* systemd-shutdownd has been removed. This service was
previously responsible for implementing scheduled shutdowns
as exposed in /usr/bin/shutdown's time parameter. This
functionality has now been moved into systemd-logind and is
accessible via a bus interface.
* udev will no longer call blkid and create symlinks for all
block devices, but merely those from a whitelist
(cf. 60-persistent-storage.rules).
* /usr/lib/os-release gained a new optional field VARIANT=
* Details at
http://lists.freedesktop.org/archives/systemd-devel/2015-May/032147.html
* From 221:
* New sd-bus and sd-event APIs in libsystemd
* If there is both a systemd unit and a SysV init script for the
same service name, and `systemctl enable` or other operation is
run, both will now be enabled (or execute the related operation
on both), not just the unit.
- Split libsystemd0 to support systemd-less nspawn containers
- Redo manpage file lists without %exclude, tends to hide
unpackaged files.
- hwdb belongs to udev
- Resolve memory leak and add missing _cleanup_free_ to
0001-On_s390_con3270_disable_ANSI_colour_esc.patch
- Remove systemd-powerd-initctl-support.patch
(no longer builds because shutdownd is gone)
- Remove quilt-patches/0001-core-rework-device-state-logic.patch,
0001-Let-some-boolean-survive-a-daemon-reload.patch
(merged upstream),
0001-Let-some-boolean-survive-a-daemon-reload.patch
(obsolete)
-------------------------------------------------------------------
Thu Jun 11 14:48:03 UTC 2015 - werner@suse.de

View File

@ -17,9 +17,10 @@
%define bootstrap 0
%define mini %nil
%define real systemd
%define udevpkgname udev
%define udev_major 1
%define min_kernel_version 3.7
%bcond_without bash_completion
%bcond_without networkd
%bcond_without sysvcompat
@ -44,7 +45,7 @@
Name: systemd
Url: http://www.freedesktop.org/wiki/Software/systemd
Version: 219
Version: 224
Release: 0
Summary: A System and Session Manager
License: LGPL-2.1+
@ -56,8 +57,8 @@ BuildRequires: autoconf
BuildRequires: automake
BuildRequires: fdupes
BuildRequires: gperf
BuildRequires: gtk-doc
BuildRequires: intltool
BuildRequires: kbd
BuildRequires: libacl-devel
BuildRequires: libcap-devel
BuildRequires: libsepol-devel
@ -66,12 +67,11 @@ BuildRequires: pam-devel
BuildRequires: systemd-rpm-macros
BuildRequires: xz
BuildRequires: config(suse-module-tools)
BuildRequires: pkgconfig(blkid) >= 2.24
BuildRequires: pkgconfig(blkid) >= 2.26
BuildRequires: pkgconfig(libkmod) >= 15
BuildRequires: pkgconfig(liblzma)
BuildRequires: pkgconfig(libpci) >= 3
BuildRequires: pkgconfig(libpcre)
BuildRequires: pkgconfig(mount) >= 2.20
BuildRequires: pkgconfig(mount) >= 2.26
%ifarch %ix86 x86_64 x32 %arm ppc64le s390x
BuildRequires: pkgconfig(libseccomp)
%endif
@ -80,28 +80,23 @@ BuildRequires: pkgconfig(libsepol)
Conflicts: sysvinit
%if 0%{?bootstrap}
#!BuildIgnore: dbus-1
Requires: this-is-only-for-build-envs
Conflicts: systemd
Conflicts: kiwi
Provides: systemd = %version-%release
Conflicts: otherproviders(systemd)
%else
BuildRequires: docbook-xsl-stylesheets
BuildRequires: gobject-introspection-devel
BuildRequires: gtk-doc
BuildRequires: libgcrypt-devel
BuildRequires: libusb-devel
BuildRequires: libxslt-tools
%if %{with python}
BuildRequires: python
%endif
BuildRequires: libapparmor-devel
BuildRequires: pkgconfig(glib-2.0) >= 2.22.0
BuildRequires: pkgconfig(libcryptsetup) >= 1.6.0
BuildRequires: pkgconfig(libmicrohttpd)
BuildRequires: pkgconfig(libqrencode)
BuildRequires: pkgconfig(usbutils) >= 0.82
# the buildignore is important for bootstrapping
#!BuildIgnore: udev
Requires: %{udevpkgname} >= 172
Requires: udev >= 172
Recommends: %{name}-bash-completion
Requires: dbus-1 >= 1.4.0
Requires: kbd
@ -112,7 +107,7 @@ BuildRequires: pam-config >= 0.79-5
Requires: pwdutils
Requires: systemd-presets-branding
Requires: sysvinit-tools
Requires: util-linux >= 2.25
Requires: util-linux >= 2.26
Requires(post): coreutils
Requires(post): findutils
Requires(post): pam-config >= 0.79-5
@ -124,11 +119,14 @@ Requires(post): /usr/bin/getent
Requires(post): /usr/bin/setfacl
Conflicts: filesystem < 11.5
Conflicts: mkinitrd < 2.7.0
Conflicts: kernel < %{min_kernel_version}
Obsoletes: systemd-analyze < 201
Provides: systemd-analyze = %{version}
Obsoletes: pm-utils <= 1.4.1
Obsoletes: suspend <= 1.0
#Git-Clone: git://anongit.freedesktop.org/systemd/systemd
Source: http://freedesktop.org/software/systemd/systemd-%version.tar.xz
#Git-Clone: git://github.com/systemd/systemd
Source: https://github.com/systemd/systemd/archive/v%version.tar.gz
%if ! 0%{?bootstrap}
Source1: systemd-rpmlintrc
%else
@ -141,7 +139,6 @@ Source9: nss-myhostname-config
Source10: macros.systemd.upstream
Source11: after-local.service
Source1063: udev-generate-persistent-rule.sh
Source1065: systemd-remount-tmpfs
# handle SUSE specific kbd settings
@ -165,8 +162,6 @@ Patch28: apply-ACL-for-nvidia-uvm-device-node.patch
Patch37: suse-sysv-bootd-support.diff
# PATCH-FIX-OPENSUSE systemd-tmp-safe-defaults.patch FATE#314974 max@suse.de -- Return to SUSE's "safe defaults" policy on deleting files from tmp direcorie.
Patch39: systemd-tmp-safe-defaults.patch
# PATCH-FIX-OPENSUSE sysctl-handle-boot-sysctl.conf-kernel_release.patch bnc#809420 fcrozat@suse.com -- handle /boot/sysctl.conf-<kernel_release> file
Patch40: sysctl-handle-boot-sysctl.conf-kernel_release.patch
# PATCH-FIX-OPENSUSE ensure-shortname-is-set-as-hostname-bnc-820213.patch bnc#820213 fcrozat@suse.com -- Do not set anything beyond first dot as hostname
Patch41: ensure-shortname-is-set-as-hostname-bnc-820213.patch
Patch42: systemd-pam_config.patch
@ -175,8 +170,6 @@ Patch42: systemd-pam_config.patch
# Never add any patches to this package without the upstream commit id
# in the patch. Any patches added here without a very good reason to make
# an exception will be silently removed with the next version update.
# PATCH-FIX-OPENSUSE forward to pm-utils -- until boo#904828 is addressed
Patch25: Forward-suspend-hibernate-calls-to-pm-utils.patch
# PATCH-FIX-UPSTREAM rules-add-lid-switch-of-ARM-based-Chromebook-as-a-power-sw.patch rjschwei@suse.com -- add lid switch of ARM based Chromebook as a power switch to logind
Patch38: rules-add-lid-switch-of-ARM-based-Chromebook-as-a-power-sw.patch
# PATCH-FIX-OPENSUSE make-emergency.service-conflict-with-syslog.socket.patch (bnc#852232)
@ -189,8 +182,6 @@ Patch90: 0001-On_s390_con3270_disable_ANSI_colour_esc.patch
Patch91: plymouth-quit-and-wait-for-emergency-service.patch
# PATCH-FIX-SUSE 0001-avoid-abort-due-timeout-at-user-service.patch werner@suse.com
Patch120: 0001-avoid-abort-due-timeout-at-user-service.patch
# PATCH-FIX-OPENSUSE 0009-make-xsltproc-use-correct-ROFF-links.patch -- Make ROFF links working again in manual pages (bnc#842844)
Patch177: 0009-make-xsltproc-use-correct-ROFF-links.patch
# PATCH-FIX-OPENSUSE 0010-do-not-install-sulogin-unit-with-poweroff.patch -- Avoid installing console-shell.service (bnc#849071)
Patch178: 0010-do-not-install-sulogin-unit-with-poweroff.patch
# PATCH-FIX-SUSE 0001-pam_systemd_do_override_XDG_RUNTIME_DIR_of_the_original_user.patch
@ -201,8 +192,6 @@ Patch180: 0014-journald-with-journaling-FS.patch
Patch182: 0019-make-completion-smart-to-be-able-to-redirect.patch
# PATCH-FIX-SUSE 0001-add-network-device-after-NFS-mount-units.patch werner@suse.com
Patch183: 0001-add-network-device-after-NFS-mount-units.patch
# PATCH-FIX-SUSE systemd-powerd-initctl-support.patch
Patch185: systemd-powerd-initctl-support.patch
# PATCH-FIX-SUSE systemctl-set-default-target.patch
Patch186: systemctl-set-default-target.patch
# PATCH-FIX-SUSE boot-local-start.patch (bnc #869142)
@ -248,10 +237,10 @@ Patch490: watch_resolv.conf_for_become_changed.patch
Patch520: systemd-add-user-keep.patch
# PATCH-FIX-SUSE systemd-add-user-keep.patch (bnc#903009)
Patch521: kbd-model-map.patch
Patch522: 0001-core-rework-device-state-logic.patch
# PATCH-FIX-SUSE/PATCH-FIX-UPSTREAM
Patch523: 0001-Let-some-boolean-survive-a-daemon-reload.patch
Patch524: systemd-bfo88401.patch
# PATCH-WORKAROUND-SUSE (boo#939571)
Patch522: Correct_assert_on_unexpected_error_code.patch
# PATCH-FIX-SUSE Do not stress the kernel's vc ioctls (boo#904214)
Patch523: let-vconsole-setup-get-properties-only-once-to-copy-them.patch
# UDEV PATCHES
# ============
@ -277,8 +266,6 @@ Patch1007: 1007-physical-hotplug-cpu-and-memory.patch
Patch1011: 1011-64-btrfs.rules-skip-btrfs-check-if-devices-are-not-r.patch
# PATCH-FIX-SUSE skip persistent device link creation on mp device (bnc#872929)
Patch1012: 1012-Skip-persistent-device-link-creation-on-multipath-de.patch
# PATCH-FIX-SUSE Do not use runtime PM for some IBM consoles (bnc#868931)
Patch1013: 1013-no-runtime-PM-for-IBM-consoles.patch
# PATCH-FIX-SUSE 1035-99-systemd.rules-Ignore-devices-with-SYSTEMD_READY-0.patch
Patch1035: 1035-99-systemd.rules-Ignore-devices-with-SYSTEMD_READY-0.patch
# PATCH-FIX-SUSE See bnc#882714 comment #51
@ -297,6 +284,8 @@ Patch1096: 1096-new-udev-root-symlink-generator.patch
Patch1097: 1097-udevd-increase-maximum-number-of-children.patch
# PATCH-FIX-OPENSUSE 1098-systemd-networkd-alias-network-service.patch
Patch1098: 1098-systemd-networkd-alias-network-service.patch
# PATCH-FIX-OPENSUSE hostname-NULL.patch - fix crash on xen build hosts in OBS Marcus Meissner
Patch1099: hostname-NULL.patch
%description
Systemd is a system and service manager, compatible with SysV and LSB
@ -326,10 +315,14 @@ Some systemd commands offer bash completion, but it's an optional dependency.
Summary: Development headers for systemd
License: LGPL-2.1+
Group: Development/Libraries/C and C++
Requires: %{name} = %{version}
Requires: libsystemd0%{?mini} = %version
Requires: systemd-rpm-macros
%if 0%{?bootstrap}
Conflicts: systemd-devel
Provides: systemd-devel = %version-%release
Conflicts: otherproviders(systemd-devel)
%else
Obsoletes: systemd-mini-devel
Provides: systemd-mini-devel
%endif
%description devel
@ -347,7 +340,39 @@ Provides: sysvinit:/sbin/init
%description sysvinit
Drop-in replacement of System V init tools.
%package -n %{udevpkgname}
%package -n libsystemd0%{?mini}
Summary: Component library for systemd
License: LGPL-2.1+
Group: System/Libraries
%if 0%{?bootstrap}
Conflicts: libsystemd0
%else
Obsoletes: libsystemd0-mini
Provides: libsystemd0-mini
%endif
%description -n libsystemd0%{?mini}
This library provides several of the systemd C APIs:
* sd-bus implements an alternative D-Bus client library that is
relatively easy to use, very efficient and supports both classic
D-Bus as well as kdbus as transport backend.
* sd-daemon(3): for system services (daemons) to report their status
to systemd and to make easy use of socket-based activation logic
* sd-event is a generic event loop abstraction that is built around
Linux epoll, but adds features such as event prioritization or
efficient timer handling.
* sd-id128(3): generation and processing of 128-bit IDs
* sd-journal(3): API to submit and query journal log entries
* sd-login(3): APIs to introspect and monitor seat, login session and
user status information on the local system.
%package -n udev%{?mini}
Summary: A rule-based device node and kernel event manager
License: GPL-2.0
Group: System/Kernel
@ -359,7 +384,7 @@ PreReq: /usr/bin/sg_inq
Requires(pre): /usr/bin/stat
Requires(pre): /usr/sbin/groupadd
Requires(pre): /usr/bin/getent
Requires(post): lib%{udevpkgname}%{udev_major}
Requires(post): libudev%{?mini}1
Requires(post): sed
Requires(post): /usr/bin/systemctl
%if %{defined regenerate_initrd_post}
@ -380,14 +405,14 @@ Conflicts: util-linux < 2.16
Conflicts: ConsoleKit < 0.4.1
Requires: filesystem
%if 0%{?bootstrap}
Provides: udev = %{version}
Conflicts: libudev%{udev_major}
Conflicts: udev
# avoid kiwi picking it for bootstrap
Requires: this-is-only-for-build-envs
Provides: udev = %version-%release
Conflicts: otherproviders(udev)
%else
Obsoletes: udev-mini
Provides: udev-mini
%endif
%description -n %{udevpkgname}
%description -n udev%{?mini}
Udev creates and removes device nodes in /dev for devices discovered or
removed from the system. It receives events via kernel netlink messages
and dispatches them according to rules in /lib/udev/rules.d/. Matching
@ -396,70 +421,40 @@ call tools to initialize a device, or load needed kernel modules.
%package -n lib%{udevpkgname}%{udev_major}
%package -n libudev%{?mini}1
# This really should have been libudev1%{?mini}, but requires changes to prjconf :-/
Summary: Dynamic library to access udev device information
License: LGPL-2.1+
Group: System/Libraries
Requires: %{udevpkgname} >= %{version}-%{release}
%if 0%{?bootstrap}
Conflicts: libudev%{udev_major}
Conflicts: kiwi
# avoid kiwi picking it for bootstrap
Requires: this-is-only-for-build-envs
Conflicts: libudev1
%else
Obsoletes: libudev1-mini
Provides: libudev1-mini
%endif
%description -n lib%{udevpkgname}%{udev_major}
%description -n libudev%{?mini}1
This package contains the dynamic library libudev, which provides
access to udev device information
%package -n lib%{udevpkgname}-devel
%package -n libudev%{?mini}-devel
Summary: Development files for libudev
License: LGPL-2.1+
Group: Development/Libraries/Other
Requires: lib%{udevpkgname}%{udev_major} = %{version}-%{release}
Group: Development/Libraries/C and C++
Requires: libudev%{?mini}1 = %version-%release
%if 0%{?bootstrap}
Provides: libudev-devel = %{version}
Conflicts: libudev%{udev_major} = %{version}
Conflicts: libudev-devel
Provides: libudev-devel = %version-%release
Conflicts: otherproviders(libudev-devel)
%else
Obsoletes: libudev-mini-devel
Provides: libudev-mini-devel
%endif
%description -n lib%{udevpkgname}-devel
%description -n libudev%{?mini}-devel
This package contains the development files for the library libudev, a
dynamic library, which provides access to udev device information.
%if ! 0%{?bootstrap}
%package -n libgudev-1_0-0
Summary: GObject library, to access udev device information
License: LGPL-2.1+
Group: System/Libraries
Requires: lib%{udevpkgname}%{udev_major} = %{version}-%{release}
%description -n libgudev-1_0-0
This package contains the GObject library libgudev, which provides
access to udev device information.
%package -n typelib-1_0-GUdev-1_0
Summary: GObject library, to access udev device information -- Introspection bindings
License: LGPL-2.1+
Group: System/Libraries
%description -n typelib-1_0-GUdev-1_0
This package provides the GObject Introspection bindings for libgudev, which
provides access to udev device information.
%package -n libgudev-1_0-devel
Summary: Devel package for libgudev
License: LGPL-2.1+
Group: Development/Libraries/Other
Requires: glib2-devel
Requires: libgudev-1_0-0 = %{version}-%{release}
Requires: libudev-devel = %{version}-%{release}
Requires: typelib-1_0-GUdev-1_0 = %{version}-%{release}
%description -n libgudev-1_0-devel
This is the devel package for the GObject library libgudev, which
provides GObject access to udev device information.
%package logger
Summary: Journal only logging
License: LGPL-2.1+
@ -555,14 +550,12 @@ cp %{SOURCE7} m4/
%patch17 -p1
%patch20 -p1
%patch21 -p1
%patch25 -p1
# check if this is still needed, or can be derived from fbdev uaccess rule
# http://lists.freedesktop.org/archives/systemd-devel/2012-November/007561.html
%patch27 -p1
%patch28 -p1
%patch37 -p1
%patch39 -p1
%patch40 -p1
%patch41 -p1
%patch42 -p1
%patch84 -p1
@ -570,13 +563,11 @@ cp %{SOURCE7} m4/
%patch90 -p1
%patch91 -p1
%patch120 -p1
%patch177 -p1
%patch178 -p1
%patch179 -p1
%patch180 -p1
%patch182 -p1
%patch183 -p1
%patch185 -p1
%patch186 -p1
%patch188 -p1
%patch189 -p1
@ -603,9 +594,8 @@ cp %{SOURCE7} m4/
%patch490 -p1
%patch520 -p1
%patch521 -p1
%patch522 -p1
%patch523 -p1
%patch524 -p1
%patch522 -p0
%patch523 -p0
# udev patches
%patch1001 -p1
@ -616,7 +606,6 @@ cp %{SOURCE7} m4/
%patch1007 -p1
%patch1011 -p1
%patch1012 -p1
%patch1013 -p1
%patch1035 -p1
%if %{with blkrrpart}
%patch1037 -p1
@ -628,24 +617,7 @@ cp %{SOURCE7} m4/
%patch1096 -p1
%patch1097 -p1
%patch1098 -p1
# remove patch backups
find -name '*.orig' -exec rm -f '{}' \+
# ensure generate files are removed
rm -f units/emergency.service
# disable "-l" option for fsck if it does not support new locking scheme
# compare with commit c343be283b7152554bac0c02493a4e1759c163f7
PATH=${PATH}:/sbin:/usr/sbin
PATH_FSCK=$(type -p fsck)
if grep -q /run/fsck/%%s\\.lock $PATH_FSCK
then
echo Found new $PATH_FSCK that is allow private locking
else
echo Found old $PATH_FSCK that is disable flock for this one
sed -ri 's@^([[:blank:]]+)(cmdline\[i\+\+\][[:blank:]]+=[[:blank:]]+"-l")(;)@\1/* \2 */\3@' src/fsck/fsck.c
fi
%patch1099 -p1
#
# In combination with Patch352 set-and-use-default-logconsole.patch
@ -687,9 +659,8 @@ cflags ()
esac
set +o noclobber
}
autoreconf -fi
# prevent pre-generated and distributed files from re-building
find . -name "*.[1-8]" -exec touch '{}' '+';
sh autogen.sh
export V=e
export CFLAGS="%{optflags}"
export LDFLAGS
@ -703,6 +674,7 @@ cflags -Wl,-O2 LDFLAGS
cflags -Wl,--hash-size=8599 LDFLAGS
# keep split-usr until all packages have moved their systemd rules to /usr
%configure \
--with-ntp-servers="0.opensuse.pool.ntp.org 1.opensuse.pool.ntp.org 2.opensuse.pool.ntp.org 3.opensuse.pool.ntp.org" \
--docdir=%{_docdir}/systemd \
--with-pamlibdir=/%{_lib}/security \
--with-dbuspolicydir=%{_sysconfdir}/dbus-1/system.d \
@ -710,7 +682,6 @@ cflags -Wl,--hash-size=8599 LDFLAGS
--with-dbussystemservicedir=%{_datadir}/dbus-1/system-services \
--with-dbusinterfacedir=%{_datadir}/dbus-1/interfaces \
%if 0%{?bootstrap}
--disable-gudev \
--disable-myhostname \
--disable-manpages \
--disable-machined \
@ -719,7 +690,6 @@ cflags -Wl,--hash-size=8599 LDFLAGS
%if %{with python}
--with-python \
%endif
--enable-gtk-doc \
--with-nss-my-hostname-warning \
%endif
--enable-selinux \
@ -750,9 +720,6 @@ make %{?_smp_mflags} update-man-list man
%endif
%install
%if !0%{?bootstrap}
cp man/man[0-9]/*.[0-9] man/
%endif
make install DESTDIR="%buildroot"
# move to %{_lib}
@ -775,7 +742,6 @@ install -D -m 755 %{S:9} %{buildroot}%{_sbindir}/nss-myhostname-config
%endif
ln -s systemd-udevd.service %{buildroot}/%{_prefix}/lib/systemd/system/udev.service
install -m755 -D %{S:1063} %{buildroot}/%{_prefix}/lib/udev/udev-generate-persistent-rule
install -m755 -D %{S:1065} %{buildroot}/%{_prefix}/lib/udev/remount-tmpfs
mkdir -p %{buildroot}/%{_prefix}/lib/systemd/system/basic.target.wants
rm -rf %{buildroot}%{_sysconfdir}/rpm
@ -807,12 +773,6 @@ cat << EOF > %{buildroot}%{_libexecdir}/modules-load.d/sg.conf
sg
EOF
# To avoid making life hard for Factory developers, don't package the
# kernel.core_pattern setting until systemd-coredump is a part of an actual
# systemd release and it's made clear how to get the core dumps out of the
# journal.
rm -f %{buildroot}%{_prefix}/lib/sysctl.d/50-coredump.conf
# do not ship sysctl defaults in systemd package, will be part of
# aaa_base (in procps for now)
rm -f %{buildroot}%{_prefix}/lib/sysctl.d/50-default.conf
@ -862,6 +822,20 @@ cat << EOF > %{buildroot}%{_prefix}/lib/systemd/system/getty@tty1.service.d/nocl
TTYVTDisallocate=no
EOF
#ensure we get the running kernel sysctl settings.
cat << EOF > %{buildroot}%{_prefix}/lib/tmpfiles.d/current-kernel-sysctl.conf
d! /run/sysctl.d
L! /run/sysctl.d/00-kernel-%v.conf - - - - /boot/sysctl.conf-%v
EOF
mkdir -p %{buildroot}/%{_prefix}/lib/systemd/system/systemd-sysctl.service.d
cat << EOF > %{buildroot}/%{_prefix}/lib/systemd/system/systemd-sysctl.service.d/after.conf
[Unit]
After=local-fs.target
EOF
# ensure after.local wrapper is called
install -m 644 %{S:11} %{buildroot}/%{_prefix}/lib/systemd/system/
ln -s ../after-local.service %{buildroot}/%{_prefix}/lib/systemd/system/multi-user.target.wants/
@ -915,10 +889,31 @@ do
ln -sf ../systemd-update-utmp-runlevel.service %{buildroot}%{_prefix}/lib/systemd/system/${runlevel}.target.wants/
done
# add entries for xkeyboard-config converted keymaps; mappings,
# which already exist in original systemd mapping table are being
# ignored though, i.e. not overwritten
cat /usr/share/systemd/kbd-model-map.xkb-generated \
>> %{buildroot}//usr/share/systemd/kbd-model-map
%find_lang systemd
%pre
getent group systemd-journal >/dev/null || groupadd -r systemd-journal || :
for name in journal timesync network resolve bus-proxy
do
getent group systemd-$name >/dev/null && continue
groupadd -r systemd-$name || :
done
for name in timesync network resolve bus-proxy
do
getent passwd systemd-$name >/dev/null && continue
case "$name" in
timesync) descr="Systemd Time Synchronization" ;;
network) descr="Systemd Network Management" ;;
resolve) descr="Systemd Resolver" ;;
bus-proxy) descr="Systemd Bus Proxy" ;;
esac
useradd -r -l -g systemd-$name systemd-$name -s /usr/sbin/nologin -d / -c "$descr" || :
done
exit 0
%post
@ -927,16 +922,16 @@ exit 0
%endif
/sbin/ldconfig
[ -e %{_localstatedir}/lib/random-seed ] && mv %{_localstatedir}/lib/random-seed %{_localstatedir}/lib/systemd/ > /dev/null || :
/usr/bin/systemd-machine-id-setup >/dev/null 2>&1 || :
/usr/lib/systemd/systemd-random-seed save >/dev/null 2>&1 || :
/usr/bin/systemctl daemon-reexec >/dev/null 2>&1 || :
/usr/bin/journalctl --update-catalog >/dev/null 2>&1 || :
/usr/bin/systemd-machine-id-setup || :
/usr/lib/systemd/systemd-random-seed save || :
/usr/bin/systemctl daemon-reexec || :
/usr/bin/journalctl --update-catalog || :
# Make sure new journal files
chgrp systemd-journal %{_localstatedir}/log/journal/ > /dev/null 2>&1 || :
chmod g+s %{_localstatedir}/log/journal/ > /dev/null 2>&1 || :
chgrp systemd-journal %{_localstatedir}/log/journal/ || :
chmod g+s %{_localstatedir}/log/journal/ || :
if read ID < /etc/machine-id > /dev/null 2>&1 ; then
chgrp systemd-journal %{_localstatedir}/log/journal/$ID > /dev/null 2>&1 || :
chmod g+s %{_localstatedir}/log/journal/$ID > /dev/null 2>&1 || :
chgrp systemd-journal "%{_localstatedir}/log/journal/$ID" || :
chmod g+s "%{_localstatedir}/log/journal/$ID" || :
fi
%if %{with systemgrps}
getent group wheel && setfacl -Rnm g:wheel:rx,d:g:wheel:rx %{_localstatedir}/log/journal/ > /dev/null 2>&1 || :
@ -959,7 +954,7 @@ if [ "$1" -eq 1 ]; then
getty@tty1.service \
systemd-readahead-collect.service \
systemd-readahead-replay.service \
remote-fs.target >/dev/null 2>&1 || :
remote-fs.target || :
fi
# since v207 /etc/sysctl.conf is no longer parsed, however
@ -977,8 +972,9 @@ done
%postun
/sbin/ldconfig
if [ $1 -ge 1 ]; then
/usr/bin/systemctl daemon-reload >/dev/null 2>&1 || :
/usr/bin/systemctl try-restart systemd-logind.service >/dev/null 2>&1 || :
/usr/bin/systemctl daemon-reload || :
#Avoid restarting logind [bnc#934901] until fixed upstream
#/usr/bin/systemctl try-restart systemd-logind.service || :
fi
%if ! 0%{?bootstrap}
if [ $1 -eq 0 ]; then
@ -990,16 +986,17 @@ fi
if [ $1 -eq 0 ]; then
/usr/bin/systemctl disable \
getty@.service \
remote-fs.target >/dev/null 2>&1 || :
remote-fs.target || :
rm -f /etc/systemd/system/default.target 2>&1 || :
fi
%pretrans -n %{udevpkgname} -p <lua>
# pretrans section must always use lua
%pretrans -n udev%{?mini} -p <lua>
if posix.stat("/lib/udev") and not posix.stat("/usr/lib/udev") then
posix.symlink("/lib/udev", "/usr/lib/udev")
end
%pre -n %{udevpkgname}
%pre -n udev%{?mini}
if test -L /usr/lib/udev -a /lib/udev -ef /usr/lib/udev ; then
rm /usr/lib/udev
mv /lib/udev /usr/lib
@ -1008,31 +1005,33 @@ elif [ ! -e /lib/udev ]; then
ln -s /usr/lib/udev /lib/udev
fi
# Create "tape" group which is referenced by 50-udev-default.rules and 60-persistent-storage-tape.rules
getent group tape >/dev/null || groupadd -r tape 2> /dev/null || :
getent group tape >/dev/null || groupadd -r tape || :
# kill daemon if we are not in a chroot
if test -f /proc/1/exe -a -d /proc/1/root ; then
if test "$(stat -Lc '%%D-%%i' /)" = "$(stat -Lc '%%D-%%i' /proc/1/root)"; then
systemctl stop systemd-udevd-control.socket systemd-udevd-kernel.socket systemd-udevd.service udev.service udev-control.socket udev-kernel.socket >/dev/null 2>&1 || :
udevadm control --exit 2>&1 || :
systemctl stop systemd-udevd-control.socket systemd-udevd-kernel.socket systemd-udevd.service udev.service udev-control.socket udev-kernel.socket || :
udevadm control --exit || :
fi
fi
%post -n %{udevpkgname}
/usr/bin/udevadm hwdb --update >/dev/null 2>&1 || :
# add KERNEL name match to existing persistent net rules
sed -ri '/KERNEL/ ! { s/NAME="(eth|wlan|ath)([0-9]+)"/KERNEL=="\1*", NAME="\1\2"/}' \
/etc/udev/rules.d/70-persistent-net.rules >/dev/null 2>&1 || :
%post -n udev%{?mini}
/usr/bin/udevadm hwdb --update || :
if [ -f /etc/udev/rules.d/70-persistent-net.rules ]; then
# add KERNEL name match to existing persistent net rules
sed -ri '/KERNEL/ ! { s/NAME="(eth|wlan|ath)([0-9]+)"/KERNEL=="\1*", NAME="\1\2"/}' \
/etc/udev/rules.d/70-persistent-net.rules || :
fi
# cleanup old stuff
rm -f /etc/sysconfig/udev
rm -f /etc/udev/rules.d/20-cdrom.rules
rm -f /etc/udev/rules.d/55-cdrom.rules
rm -f /etc/udev/rules.d/65-cdrom.rules
systemctl daemon-reload >/dev/null 2>&1 || :
systemctl daemon-reload || :
# start daemon if we are not in a chroot
if test -f /proc/1/exe -a -d /proc/1/root; then
if test "$(stat -Lc '%%D-%%i' /)" = "$(stat -Lc '%%D-%%i' /proc/1/root)"; then
if ! systemctl start systemd-udevd.service >/dev/null 2>&1; then
/usr/lib/systemd/systemd-udevd --daemon >/dev/null 2>&1 || :
if ! systemctl start systemd-udevd.service; then
/usr/lib/systemd/systemd-udevd --daemon || :
fi
fi
fi
@ -1052,9 +1051,9 @@ if [ "${YAST_IS_RUNNING}" != "instsys" ]; then
fi
fi
%postun -n %{udevpkgname}
%postun -n udev%{?mini}
%insserv_cleanup
systemctl daemon-reload >/dev/null 2>&1 || :
systemctl daemon-reload || :
if [ "${YAST_IS_RUNNING}" != "instsys" ]; then
if [ -e %{_localstatedir}/lib/no_initrd_recreation_by_suspend ]; then
@ -1072,20 +1071,17 @@ if [ "${YAST_IS_RUNNING}" != "instsys" ]; then
fi
%if %{defined regenerate_initrd_post}
%posttrans -n %{udevpkgname}
%posttrans -n udev%{?mini}
%regenerate_initrd_posttrans
%endif
%post -n lib%{udevpkgname}%{udev_major} -p /sbin/ldconfig
%postun -n lib%{udevpkgname}%{udev_major} -p /sbin/ldconfig
%post -n libsystemd0%{?mini} -p /sbin/ldconfig
%postun -n libsystemd0%{?mini} -p /sbin/ldconfig
%post -n libudev%{?mini}1 -p /sbin/ldconfig
%postun -n libudev%{?mini}1 -p /sbin/ldconfig
%if ! 0%{?bootstrap}
%post -n libgudev-1_0-0 -p /sbin/ldconfig
%postun -n libgudev-1_0-0 -p /sbin/ldconfig
%if %{with permission}
%verifyscript logger
%verify_permissions -e %{_localstatedir}/log/journal/
@ -1105,7 +1101,7 @@ getent group adm && setfacl -Rnm g:adm:rx,d:g:adm:rx %{_localstatedir}/log
%endif
if [ "$1" -eq 1 ]; then
# tell journal to start logging on disk if directory didn't exist before
systemctl --no-block restart systemd-journal-flush.service >/dev/null 2>&1 || :
systemctl --no-block restart systemd-journal-flush.service || :
fi
%preun -n nss-myhostname
@ -1121,7 +1117,7 @@ fi
%postun -n nss-mymachines -p /sbin/ldconfig
%pre journal-gateway
getent passwd systemd-journal-gateway >/dev/null || useradd -r -l -g systemd-journal-gateway -d %{_localstatedir}/log/journal/ -s /usr/sbin/nologin -c "Journal Gateway" systemd-journal-gateway >/dev/null 2>&1 || :
getent passwd systemd-journal-gateway >/dev/null || useradd -r -l -g systemd-journal-gateway -d %{_localstatedir}/log/journal/ -s /usr/sbin/nologin -c "Systemd Journal Gateway" systemd-journal-gateway || :
getent group systemd-journal-gateway >/dev/null || groupadd -r systemd-journal-gateway || :
%service_add_pre systemd-journal-gatewayd.socket systemd-journal-gatewayd.service
exit 0
@ -1161,7 +1157,6 @@ exit 0
%{_bindir}/systemd-path
%{_bindir}/systemd-sysusers
%{_bindir}/systemd-notify
%{_bindir}/systemd-hwdb
%{_bindir}/systemd-run
%{_bindir}/systemd-journalctl
%{_bindir}/journalctl
@ -1177,13 +1172,6 @@ exit 0
%{_bindir}/systemd-detect-virt
%{_bindir}/timedatectl
%{_sbindir}/systemd-sysv-convert
%{_libdir}/libsystemd.so.*
%if %{with compat_libs}
%{_libdir}/libsystemd-daemon.so.*
%{_libdir}/libsystemd-login.so.*
%{_libdir}/libsystemd-id128.so.*
%{_libdir}/libsystemd-journal.so.*
%endif
%{_bindir}/systemd-cgls
%{_bindir}/systemd-cgtop
%{_bindir}/systemd-cat
@ -1214,6 +1202,7 @@ exit 0
%{_prefix}/lib/systemd/system/*.path
%{_prefix}/lib/systemd/user/*.target
%{_prefix}/lib/systemd/user/*.service
%{_prefix}/lib/systemd/user/*.socket
%exclude %{_prefix}/lib/systemd/systemd-udevd
%if ! 0%{?bootstrap}
%exclude %{_prefix}/lib/systemd/systemd-journal-gatewayd
@ -1228,6 +1217,7 @@ exit 0
%dir %{_prefix}/lib/systemd/user-preset
%dir %{_prefix}/lib/systemd/system-generators
%dir %{_prefix}/lib/systemd/user-generators
%{_prefix}/lib/systemd/user-generators/systemd-dbus1-generator
%dir %{_prefix}/lib/systemd/ntp-units.d/
%dir %{_prefix}/lib/systemd/system-shutdown/
%dir %{_prefix}/lib/systemd/system-sleep/
@ -1235,12 +1225,14 @@ exit 0
%dir %{_prefix}/lib/systemd/system/dbus.target.wants
%dir %{_prefix}/lib/systemd/system/getty@tty1.service.d
%{_prefix}/lib/systemd/system/getty@tty1.service.d/noclear.conf
%dir %{_prefix}/lib/systemd/system/systemd-sysctl.service.d
%{_prefix}/lib/systemd/system/systemd-sysctl.service.d/after.conf
%if ! 0%{?bootstrap}
%{_prefix}/lib/systemd/system-generators/systemd-cryptsetup-generator
%endif
%{_prefix}/lib/systemd/system-generators/systemd-dbus1-generator
%if 0%{has_efi}
%{_bindir}/bootctl
%{_prefix}/lib/systemd/system-generators/systemd-efi-boot-generator
%endif
%{_prefix}/lib/systemd/system-generators/systemd-debug-generator
%{_prefix}/lib/systemd/system-generators/systemd-hibernate-resume-generator
@ -1271,6 +1263,7 @@ exit 0
%dir %{_libexecdir}/sysctl.d
%dir %{_sysconfdir}/sysctl.d
%{_prefix}/lib/sysctl.d/50-coredump.conf
%dir %{_sysconfdir}/systemd
%dir %{_sysconfdir}/systemd/system
@ -1304,6 +1297,7 @@ exit 0
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/org.freedesktop.hostname1.conf
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/org.freedesktop.timedate1.conf
%{_sysconfdir}/X11/xinit/
# Some files which may created by us
%dir %{_sysconfdir}/X11/xorg.conf.d
%ghost %config(noreplace) %{_sysconfdir}/X11/xorg.conf.d/00-keyboard.conf
@ -1319,15 +1313,23 @@ exit 0
%{_datadir}/factory/
%{_datadir}/dbus-1/services/org.freedesktop.systemd1.service
%if %{with networkd}
%{_prefix}/lib/systemd/system/org.freedesktop.network1.busname
%{_datadir}/dbus-1/system-services/org.freedesktop.network1.service
%endif
%{_prefix}/lib/systemd/system/org.freedesktop.systemd1.busname
%{_datadir}/dbus-1/system-services/org.freedesktop.systemd1.service
%{_prefix}/lib/systemd/system/org.freedesktop.locale1.busname
%{_datadir}/dbus-1/system-services/org.freedesktop.locale1.service
%{_prefix}/lib/systemd/system/org.freedesktop.login1.busname
%{_datadir}/dbus-1/system-services/org.freedesktop.login1.service
%{_prefix}/lib/systemd/system/org.freedesktop.hostname1.busname
%{_datadir}/dbus-1/system-services/org.freedesktop.hostname1.service
%if !0%{?bootstrap}
%{_prefix}/lib/systemd/system/org.freedesktop.machine1.busname
%{_datadir}/dbus-1/system-services/org.freedesktop.machine1.service
%endif
%{_prefix}/lib/systemd/system/org.freedesktop.timedate1.busname
%{_datadir}/dbus-1/system-services/org.freedesktop.timedate1.service
%dir %{_datadir}/polkit-1
%dir %{_datadir}/polkit-1/actions
@ -1345,20 +1347,20 @@ exit 0
%{_datadir}/systemd
%if ! 0%{?bootstrap}
# Packaged in sysvinit subpackage
%exclude %{_mandir}/man1/init.1*
%exclude %{_mandir}/man8/halt.8*
%exclude %{_mandir}/man8/reboot.8*
%exclude %{_mandir}/man8/shutdown.8*
%exclude %{_mandir}/man8/poweroff.8*
%exclude %{_mandir}/man8/telinit.8*
%exclude %{_mandir}/man8/runlevel.8*
%exclude %{_mandir}/man*/*udev*.[0-9]*
%exclude %{_mandir}/man8/systemd-journal-gatewayd.*
%{_mandir}/man1/*.1*
%{_mandir}/man5/*.5*
%{_mandir}/man7/*.7*
%{_mandir}/man8/*.8*
%_mandir/man1/[a-rt-z]*ctl.1*
%_mandir/man1/systemc*.1*
%_mandir/man1/systemd*.1*
%_mandir/man5/[a-tv-z]*
%_mandir/man5/user*
%_mandir/man7/[bdfks]*
%_mandir/man8/kern*
%_mandir/man8/pam_*
%_mandir/man8/systemd-[a-gik-tv]*
%_mandir/man8/systemd-h[aioy]*
%_mandir/man8/systemd-journal-remote.*
%_mandir/man8/systemd-journal-upload.*
%_mandir/man8/systemd-journald*
%_mandir/man8/systemd-u[ps]*
%endif
%{_docdir}/systemd
%{_prefix}/lib/udev/rules.d/70-uaccess.rules
@ -1388,6 +1390,7 @@ exit 0
%{_sysconfdir}/systemd/resolved.conf
%{_libdir}/libnss_resolve.so.2
%{_datadir}/dbus-1/system-services/org.freedesktop.resolve1.service
%{_prefix}/lib/systemd/system/org.freedesktop.resolve1.busname
%endif
%if ! 0%{?bootstrap}
@ -1405,21 +1408,16 @@ exit 0
%{_libdir}/libsystemd-login.so
%{_libdir}/libsystemd-id128.so
%{_libdir}/libsystemd-journal.so
%dir %{_includedir}/systemd
%{_includedir}/systemd/sd-login.h
%{_includedir}/systemd/sd-daemon.h
%{_includedir}/systemd/sd-id128.h
%{_includedir}/systemd/sd-journal.h
%{_includedir}/systemd/sd-messages.h
%{_includedir}/systemd/_sd-common.h
%{_libdir}/pkgconfig/systemd.pc
%{_includedir}/systemd/
%{_datadir}/pkgconfig/systemd.pc
%{_libdir}/pkgconfig/libsystemd.pc
%{_libdir}/pkgconfig/libsystemd-daemon.pc
%{_libdir}/pkgconfig/libsystemd-login.pc
%{_libdir}/pkgconfig/libsystemd-id128.pc
%{_libdir}/pkgconfig/libsystemd-journal.pc
%if ! 0%{?bootstrap}
%{_mandir}/man3/*.3*
%_mandir/man3/SD*.3*
%_mandir/man3/sd*.3*
%endif
%files sysvinit
@ -1441,7 +1439,7 @@ exit 0
%{_mandir}/man8/runlevel.8*
%endif
%files -n %{udevpkgname}
%files -n udev%{?mini}
%defattr(-,root,root)
/sbin/udevd
/sbin/udevadm
@ -1451,15 +1449,14 @@ exit 0
%if 0%{?suse_version} <= 1310
%{_prefix}/lib/firmware
%endif
%{_bindir}/systemd-hwdb
%dir %{_prefix}/lib/udev/
%{_prefix}/lib/udev/accelerometer
%{_prefix}/lib/udev/ata_id
%{_prefix}/lib/udev/cdrom_id
%{_prefix}/lib/udev/collect
%{_prefix}/lib/udev/mtd_probe
%{_prefix}/lib/udev/scsi_id
%{_prefix}/lib/udev/v4l_id
%{_prefix}/lib/udev/udev-generate-persistent-rule
%{_prefix}/lib/udev/remount-tmpfs
%{_prefix}/lib/udev/rootsymlink-generator
%dir %{_prefix}/lib/udev/rules.d/
@ -1469,14 +1466,18 @@ exit 0
%exclude %{_prefix}/lib/udev/rules.d/73-seat-numlock.rules
%exclude %{_prefix}/lib/udev/rules.d/99-systemd.rules
%{_prefix}/lib/udev/rules.d/*.rules
%dir %{_prefix}/lib/udev/hwdb.d
%{_prefix}/lib/udev/hwdb.d/*
%{_prefix}/lib/udev/hwdb.d/
%dir %{_sysconfdir}/udev/
%dir %{_sysconfdir}/udev/rules.d/
%ghost %{_sysconfdir}/udev/hwdb.bin
%config(noreplace) %{_sysconfdir}/udev/udev.conf
%if ! 0%{?bootstrap}
%{_mandir}/man?/*udev*.[0-9]*
%_mandir/man5/udev*
%_mandir/man7/hwdb*
%_mandir/man7/udev*
%_mandir/man8/systemd-hwdb*
%_mandir/man8/systemd-udev*
%_mandir/man8/udev*
%endif
%dir %{_prefix}/lib/systemd/system
%{_prefix}/lib/systemd/systemd-udevd
@ -1493,44 +1494,30 @@ exit 0
%{_datadir}/pkgconfig/udev.pc
%endif
%files -n lib%{udevpkgname}%{udev_major}
%files -n libsystemd0%{?mini}
%defattr(-,root,root)
%_libdir/libsystemd.so.*
%if %{with compat_libs}
%_libdir/libsystemd-daemon.so.*
%_libdir/libsystemd-login.so.*
%_libdir/libsystemd-id128.so.*
%_libdir/libsystemd-journal.so.*
%endif
%files -n libudev%{?mini}1
%defattr(-,root,root)
%{_libdir}/libudev.so.*
%files -n lib%{udevpkgname}-devel
%files -n libudev%{?mini}-devel
%defattr(-,root,root)
%{_includedir}/libudev.h
%{_libdir}/libudev.so
%{_libdir}/pkgconfig/libudev.pc
%if ! 0%{?bootstrap}
%dir %{_datadir}/gtk-doc
%dir %{_datadir}/gtk-doc/html
%dir %{_datadir}/gtk-doc/html/libudev
%{_datadir}/gtk-doc/html/libudev/*
%{_mandir}/man3/*udev*.3*
%endif
%if ! 0%{?bootstrap}
%files -n libgudev-1_0-0
%defattr(-,root,root)
%{_libdir}/libgudev-1.0.so.*
%files -n typelib-1_0-GUdev-1_0
%defattr(-,root,root)
%{_libdir}/girepository-1.0/GUdev-1.0.typelib
%files -n libgudev-1_0-devel
%defattr(-,root,root)
%dir %{_includedir}/gudev-1.0
%dir %{_includedir}/gudev-1.0/gudev
%{_includedir}/gudev-1.0/gudev/*.h
%{_libdir}/libgudev-1.0.so
%{_libdir}/pkgconfig/gudev-1.0.pc
%dir %{_datadir}/gtk-doc
%dir %{_datadir}/gtk-doc/html
%dir %{_datadir}/gtk-doc/html/gudev
%{_datadir}/gtk-doc/html/gudev/*
%{_datadir}/gir-1.0/GUdev-1.0.gir
%files logger
%defattr(-,root,root)
%dir %attr(2755,root,systemd-journal) %{_localstatedir}/log/journal/
@ -1541,6 +1528,10 @@ exit 0
%files -n nss-myhostname
%defattr(-, root, root)
%{_sbindir}/nss-myhostname-config
%if !0%{?bootstrap}
%{_mandir}/man8/libnss_myhostname.*
%{_mandir}/man8/nss-myhostname.*
%endif
/%{_lib}/*nss_myhostname*
%files journal-gateway
@ -1553,6 +1544,10 @@ exit 0
%files -n nss-mymachines
%defattr(-,root,root)
%_libdir/libnss_mymachines.so*
%if !0%{?bootstrap}
%_mandir/man8/libnss_mymachines.*
%_mandir/man8/nss-mymachines.*
%endif
%endif
%changelog

View File

@ -5,9 +5,11 @@ Provide /run/lock/subsys directory to be able to provide the
tmpfiles.d/legacy.conf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- systemd-210/tmpfiles.d/legacy.conf
+++ systemd-210/tmpfiles.d/legacy.conf 2014-07-30 12:36:36.862735670 +0000
@@ -16,7 +16,7 @@ d /run/lock 0775 root lock -
Index: systemd-221/tmpfiles.d/legacy.conf
===================================================================
--- systemd-221.orig/tmpfiles.d/legacy.conf
+++ systemd-221/tmpfiles.d/legacy.conf
@@ -17,7 +17,7 @@ L /var/lock - - - - ../run/lock
# /run/lock/subsys is used for serializing SysV service execution, and
# hence without use on SysV-less systems.

View File

@ -1,11 +1,22 @@
---
src/tty-ask-password-agent/tty-ask-password-agent.c | 171 +++++++++++++++++++-
1 file changed, 166 insertions(+), 5 deletions(-)
From 633a5904c1c4e363a7147f47e2d9fdb1925f7b9f Mon Sep 17 00:00:00 2001
From: Werner Fink <werner@suse.de>
Date: Fri, 25 Sep 2015 14:28:58 +0200
Subject: [PATCH] Ask for passphrases not only on the first console of
/dev/console
Index: systemd/src/tty-ask-password-agent/tty-ask-password-agent.c
===================================================================
--- systemd.orig/src/tty-ask-password-agent/tty-ask-password-agent.c
+++ systemd/src/tty-ask-password-agent/tty-ask-password-agent.c
but also on all other consoles. This does help on e.g. mainframes
where often a serial console together with other consoles are
used. Even rack based servers attachted to both a serial console
as well as having a virtual console do sometimes miss a connected
monitor.
---
src/tty-ask-password-agent/tty-ask-password-agent.c | 191 ++++++++++++++++++++-
1 file changed, 186 insertions(+), 5 deletions(-)
diff --git src/tty-ask-password-agent/tty-ask-password-agent.c src/tty-ask-password-agent/tty-ask-password-agent.c
index 82cbf95..928a5e8 100644
--- a/src/tty-ask-password-agent/tty-ask-password-agent.c
+++ b/src/tty-ask-password-agent/tty-ask-password-agent.c
@@ -31,6 +31,10 @@
#include <getopt.h>
#include <sys/signalfd.h>
@ -17,26 +28,22 @@ Index: systemd/src/tty-ask-password-agent/tty-ask-password-agent.c
#include "util.h"
#include "mkdir.h"
@@ -42,6 +46,9 @@
#include "strv.h"
#include "build.h"
#include "def.h"
@@ -45,6 +49,8 @@
#include "process-util.h"
#include "terminal-util.h"
#include "signal-util.h"
+#include "fileio.h"
+#include "macro.h"
+#include "list.h"
static enum {
ACTION_LIST,
@@ -50,6 +57,22 @@ static enum {
@@ -53,6 +59,19 @@ static enum {
ACTION_WALL
} arg_action = ACTION_QUERY;
+struct console {
+ LIST_FIELDS(struct console, handle);
+ const char *tty;
+ pid_t pid;
+ int id;
+ char dev[];
+ char *tty;
+};
+
+static volatile unsigned long *usemask;
@ -50,22 +57,33 @@ Index: systemd/src/tty-ask-password-agent/tty-ask-password-agent.c
static bool arg_plymouth = false;
static bool arg_console = false;
@@ -208,6 +231,58 @@ static int ask_password_plymouth(
@@ -210,6 +229,69 @@ static int ask_password_plymouth(
return 0;
}
+static void free_consoles(struct console *con, const unsigned int num) {
+ unsigned int n;
+ if (!con || !num)
+ return;
+ for (n = 0; n < num; n++)
+ free(con[n].tty);
+ free(con);
+}
+
+static const char *current_dev = "/dev/console";
+static LIST_HEAD(struct console, consoles);
+static int collect_consoles(void) {
+static struct console* collect_consoles(unsigned int * num) {
+ _cleanup_free_ char *active = NULL;
+ const char *word, *state;
+ struct console *con;
+ size_t len;
+ int ret, id = 0;
+ struct console *con = NULL;
+ size_t con_len = 0, len;
+ int ret;
+
+ assert(num);
+ assert(*num == 0);
+
+ ret = read_one_line_file("/sys/class/tty/console/active", &active);
+ if (ret < 0)
+ return ret;
+ return con;
+ FOREACH_WORD(word, len, active, state) {
+ _cleanup_free_ char *tty = NULL;
+
@ -74,42 +92,42 @@ Index: systemd/src/tty-ask-password-agent/tty-ask-password-agent.c
+ word = tty;
+ len = strlen(tty);
+ }
+ con = malloc0(sizeof(*con) + strlen("/dev/") + len + 1);
+ con = greedy_realloc((void**)&con, &con_len, 1+(*num), sizeof(struct console));
+ if (con == NULL) {
+ log_oom();
+ continue;
+ return NULL;
+ }
+ sprintf(con->dev, "/dev/%.*s", (int)len, word);
+ con->tty = con->dev;
+ con->id = id++;
+ LIST_PREPEND(handle, consoles, con);
+ if (asprintf(&con[*num].tty, "/dev/%.*s", (int)len, word) < 0) {
+ free_consoles(con, *num);
+ log_oom();
+ *num = 0;
+ return NULL;
+ }
+ con[*num].pid = 0;
+ (*num)++;
+ }
+ if (consoles == NULL) {
+ con = malloc0(sizeof(*con));
+ if (con == NULL) {
+ con = greedy_realloc((void**)&con, &con_len, 1, sizeof(struct console));
+ if (con == NULL) {
+ log_oom();
+ return -ENOMEM;
+ return NULL;
+ }
+ con->tty = current_dev;
+ con->id = id++;
+ LIST_PREPEND(handle, consoles, con);
+ con[0].tty = strdup(current_dev);
+ if (con[0].tty == NULL) {
+ free_consoles(con, 1);
+ log_oom();
+ return NULL;
+ }
+ con[0].pid = 0;
+ (*num)++;
+ }
+ return 0;
+}
+
+static void free_consoles(void) {
+ struct console *c;
+ LIST_FOREACH(handle, c, consoles) {
+ LIST_REMOVE(handle, consoles, c);
+ free(c);
+ }
+ LIST_HEAD_INIT(consoles);
+ return con;
+}
+
static int parse_password(const char *filename, char **wall) {
_cleanup_free_ char *socket_name = NULL, *message = NULL, *packet = NULL;
uint64_t not_after = 0;
@@ -308,7 +383,7 @@ static int parse_password(const char *fi
@@ -310,7 +392,7 @@ static int parse_password(const char *filename, char **wall) {
_cleanup_free_ char *password = NULL;
if (arg_console) {
@ -118,28 +136,39 @@ Index: systemd/src/tty-ask-password-agent/tty-ask-password-agent.c
if (tty_fd < 0)
return tty_fd;
}
@@ -612,9 +687,85 @@ static int parse_argv(int argc, char *ar
@@ -614,8 +696,90 @@ static int parse_argv(int argc, char *argv[]) {
return 1;
}
+static int zzz(void)
+static unsigned int wfa_child(const struct console * con, const unsigned int id)
+{
+ struct console *con;
+ setsid();
+ release_terminal();
+ *usemask |= 1 << id; /* shared memory area */
+ current_dev = con[id].tty;
+ return id;
+}
+
+static unsigned int wait_for_answer(void)
+{
+ struct console *consoles;
+ struct sigaction sig = {
+ .sa_handler = chld_handler,
+ .sa_flags = SA_NOCLDSTOP | SA_RESTART,
+ };
+ struct sigaction oldsig;
+ sigset_t set, oldset;
+ unsigned int num = 0, id;
+ int status = 0, ret;
+ pid_t job;
+
+ collect_consoles();
+ if (!consoles->handle_next) {
+ consoles->pid = 0;
+ con = consoles;
+ goto nofork;
+ consoles = collect_consoles(&num);
+ if (!consoles) {
+ log_error("Failed to query password: %m");
+ exit(EXIT_FAILURE);
+ }
+ if (num < 2)
+ return wfa_child(consoles, 0);
+
+ assert_se(sigemptyset(&set) == 0);
+ assert_se(sigaddset(&set, SIGHUP) == 0);
@ -150,25 +179,21 @@ Index: systemd/src/tty-ask-password-agent/tty-ask-password-agent.c
+ sig.sa_handler = SIG_DFL;
+ assert_se(sigaction(SIGHUP, &sig, NULL) == 0);
+
+ LIST_FOREACH(handle, con, consoles) {
+ switch ((con->pid = fork())) {
+ case 0:
+ for (id = 0; id < num; id++) {
+ consoles[id].pid = fork();
+
+ if (consoles[id].pid < 0) {
+ log_error("Failed to query password: %m");
+ exit(EXIT_FAILURE);
+ }
+
+ if (consoles[id].pid == 0) {
+ if (prctl(PR_SET_PDEATHSIG, SIGHUP) < 0)
+ _exit(EXIT_FAILURE);
+ zero(sig);
+ assert_se(sigprocmask(SIG_UNBLOCK, &oldset, NULL) == 0);
+ assert_se(sigaction(SIGCHLD, &oldsig, NULL) == 0);
+ nofork:
+ setsid();
+ release_terminal();
+ *usemask |= 1 << con->id;
+ current_dev = con->tty;
+ return con->id; /* child */
+ case -1:
+ log_error("Failed to query password: %s", strerror(errno));
+ exit(EXIT_FAILURE);
+ default:
+ break;
+ return wfa_child(consoles, id);
+ }
+ }
+
@ -179,21 +204,21 @@ Index: systemd/src/tty-ask-password-agent/tty-ask-password-agent.c
+ break;
+ continue;
+ }
+ LIST_FOREACH(handle, con, consoles) {
+ if (con->pid == job || kill(con->pid, 0) < 0) {
+ *usemask &= ~(1 << con->id);
+ for (id = 0; id < num; id++) {
+ if (consoles[id].pid == job || kill(consoles[id].pid, 0) < 0) {
+ *usemask &= ~(1 << id); /* shared memory area */
+ continue;
+ }
+ if (*usemask & (1 << con->id))
+ if (*usemask & (1 << id)) /* shared memory area */
+ continue;
+ kill(con->pid, SIGHUP);
+ kill(consoles[id].pid, SIGHUP);
+ usleep(50000);
+ kill(con->pid, SIGKILL);
+ kill(consoles[id].pid, SIGKILL);
+ }
+ if (WIFEXITED(status) && ret == 0)
+ ret = WEXITSTATUS(status);
+ }
+ free_consoles();
+ free_consoles(consoles, num);
+ exit(ret != 0 ? EXIT_FAILURE : EXIT_SUCCESS); /* parent */
+}
+
@ -201,14 +226,20 @@ Index: systemd/src/tty-ask-password-agent/tty-ask-password-agent.c
- int r;
+ int r, id = 0;
+ LIST_HEAD_INIT(consoles);
log_set_target(LOG_TARGET_AUTO);
log_parse_environment();
log_open();
@@ -625,11 +776,19 @@ int main(int argc, char *argv[]) {
@@ -627,11 +791,27 @@ int main(int argc, char *argv[]) {
if (r <= 0)
goto finish;
+ /*
+ * Use this shared memory area to be able to synchronize the
+ * workers asking for password with the main process.
+ * This allows to continue if one of the consoles had been
+ * used as afterwards the remaining asking processes will
+ * be terminated. The wait_for_terminate() does not help
+ * for this use case.
+ */
+ usemask = mmap(NULL, sizeof(*usemask), PROT_READ | PROT_WRITE,
+ MAP_ANONYMOUS | MAP_SHARED, -1, 0);
+ assert_se(usemask != NULL);
@ -216,9 +247,9 @@ Index: systemd/src/tty-ask-password-agent/tty-ask-password-agent.c
if (arg_console) {
- setsid();
- release_terminal();
+ if (!arg_plymouth && arg_action != ACTION_WALL &&
+ arg_action != ACTION_LIST) {
+ id = zzz();
+ if (!arg_plymouth &&
+ !IN_SET(arg_action, ACTION_WALL, ACTION_LIST)) {
+ id = wait_for_answer();
+ } else {
+ setsid();
+ release_terminal();
@ -228,12 +259,14 @@ Index: systemd/src/tty-ask-password-agent/tty-ask-password-agent.c
if (IN_SET(arg_action, ACTION_WATCH, ACTION_WALL))
r = watch_passwords();
else
@@ -638,6 +797,8 @@ int main(int argc, char *argv[]) {
@@ -640,6 +820,7 @@ int main(int argc, char *argv[]) {
if (r < 0)
log_error_errno(r, "Error: %m");
+ free_consoles();
+ *usemask &= ~(1 << id);
+ *usemask &= ~(1 << id); /* shared memory area */
finish:
return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
}
--
2.2.0

View File

@ -1,498 +0,0 @@
#!/bin/bash
#
# Copyright (C) 2014 Robert Milasan <rmilasan@suse.com>
#
# 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.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# This script run manually by user, will generate a persistent rule for
# a given network interface to rename it to new interface name.
#
_prj="$(basename $0 2>/dev/null)"
prj="${_prj%.*}"
ver="0.2"
log_info()
{
local msg="$1"
echo "$prj: $msg"
}
log_error()
{
local msg="$1"
echo "$prj: $msg" >&2
}
usage()
{
cat << EOF
$prj: udev persistent rule generator script
Usage: $prj [OPTION] ...
-h Show this help
-l List available interfaces
-m Generate the persistent rule based on interface MAC address
default option, if nothing is specified
-p Generate the persistent rule based on interface PCI slot
-v Be more verbose
-V Output the version number
-c [INTERFACE] Current interface name (ex: ip link)
only needed for retrieving information
-n [INTERFACE] New interface name (ex: net0)
-o [FILE] Where to write the new generate rule (default: /dev/stdout)
prefered location is /etc/udev/rules.d/70-persistent-net.rules
Example:
$prj -v -c enp0s4 -n lan0
or
$prj -m -c enp0s4 -n net0 -o /etc/udev/rules.d/70-persistent-net.rules
or
$prj -p -c wlp3s0 -n wlan0 -o /etc/udev/rules.d/50-mynet.rules
EOF
}
display_note()
{
cat << EOF
NOTE: Using the generate persistent rule might mean you will need to do extra work to ensure
that it will work accordingly. This mean, regenerating the initramfs/initrd image and/or using
'net.ifnames=0' option at boot time.
In openSUSE/SUSE, the user will need to regenerate the initramfs/initrd image, but usually there
is no need for 'net.ifnames=0' option if the persistent rule is available in initramfs/initrd image.
EOF
}
get_pci()
{
local path="$1"
local pci=""
if [ -L "$path/device" ]; then
local pci_link="$(readlink -f $path/device 2>/dev/null)"
pci="$(basename $pci_link 2>/dev/null)"
fi
echo $pci
}
get_pci_id()
{
local path="$1"
local pci_id=""
if [ -r "$path/device/uevent" ]; then
local _pci_id="$(cat $path/device/uevent|grep ^PCI_ID 2>/dev/null)"
pci_id="${_pci_id#*=}"
fi
echo $pci_id
}
get_macaddr()
{
local path="$1"
local macaddr=""
if [ -r "$path/address" ]; then
macaddr="$(cat $path/address 2>/dev/null)"
fi
echo $macaddr
}
get_type()
{
local path="$1"
local dev_type=""
if [ -r "$path/type" ]; then
dev_type="$(cat $path/type 2>/dev/null)"
fi
echo $dev_type
}
get_dev_id()
{
local path="$1"
local dev_id=""
if [ -r "$path/dev_id" ]; then
dev_id="$(cat $path/dev_id 2>/dev/null)"
fi
echo $dev_id
}
get_devtype()
{
local path="$1"
local devtype=""
if [ -r "$path/uevent" ]; then
local _devtype="$(cat $path/uevent|grep ^DEVTYPE 2>/dev/null)"
devtype="${_devtype#*=}"
fi
echo $devtype
}
get_subsystem()
{
local path="$1"
local subsystem=""
if [ -L "$path/subsystem" ]; then
local subsystem_link="$(readlink -f $path/subsystem 2>/dev/null)"
subsystem="$(basename $subsystem_link 2>/dev/null)"
fi
echo $subsystem
}
get_parent_subsystem()
{
local path="$1"
local subsystem=""
if [ -L "$path/device/subsystem" ]; then
local subsystem_link="$(readlink -f $path/device/subsystem 2>/dev/null)"
subsystem="$(basename $subsystem_link 2>/dev/null)"
fi
echo $subsystem
}
get_driver()
{
local path="$1"
local driver=""
if [ -L "$path/device/driver" ]; then
local driver_link="$(readlink -f $path/device/driver 2>/dev/null)"
driver="$(basename $driver_link 2>/dev/null)"
fi
echo $driver
}
valid_mac()
{
local macaddr="$1"
local valid_macaddr=""
if [ -n "$macaddr" ]; then
valid_macaddr="$(echo $macaddr | sed -n '/^\([0-9a-z][0-9a-z]:\)\{5\}[0-9a-z][0-9a-z]$/p')"
fi
echo $valid_macaddr
}
valid_dev_type()
{
local dev_type="$1"
case "$dev_type" in
[0-32])
echo "$dev_type" ;;
*)
echo "invalid" ;;
esac
}
generate_comment()
{
local pci_id="$1"
local driver="$2"
local output="$3"
local device_type="$4"
local _type=""
if [ -z "$pci_id" ]; then
log_error "\$pci_id empty."
exit 1
elif [ -z "$driver" ]; then
log_error "\$driver empty."
exit 1
elif [ -z "$output" ]; then
log_error "\$output empty."
exit 1
else
if [ "$device_type" == "pci" ]; then
_type="PCI"
elif [ "$device_type" == "usb" ]; then
_type="USB"
else
_type="Unknown"
fi
echo "# $_type device $pci_id ($driver)" >> $output
fi
}
generate_rule()
{
local _subsystem="$1"
local _mac="$2"
local _pci="$3"
local _dev_id="$4"
local _dev_type="$5"
local _kernel="$6"
local _interface="$7"
local output="$8"
if [ -z "$_subsystem" ]; then
log_error "\$_subsystem empty."
exit 1
elif [ -z "$_dev_id" ]; then
log_error "\$_dev_id empty."
exit 1
elif [ -z "$_dev_type" ]; then
log_error "\$_dev_type empty."
exit 1
elif [ -z "$_kernel" ]; then
log_error "\$_kernel empty."
exit 1
elif [ -z "$_interface" ]; then
log_error "\$_interface empty."
exit 1
elif [ -z "$output" ]; then
output="/dev/stdout"
fi
if [ "$_mac" != "none" ]; then
echo "SUBSYSTEM==\"$_subsystem\", ACTION==\"add\", DRIVERS==\"?*\", ATTR{address}==\"$_mac\", \
ATTR{dev_id}==\"$_dev_id\", ATTR{type}==\"$_dev_type\", KERNEL==\"$_kernel\", NAME=\"$_interface\"" >> ${output}
elif [ "$_pci" != "none" ]; then
echo "SUBSYSTEM==\"$_subsystem\", ACTION==\"add\", DRIVERS==\"?*\", KERNELS==\"$_pci\", \
ATTR{dev_id}==\"$_dev_id\", ATTR{type}==\"$_dev_type\", KERNEL==\"$_kernel\", NAME=\"$_interface\"" >> ${output}
else
log_error "MAC address or PCI slot information missing."
exit 1
fi
}
list_adapters()
{
declare -a netdev
local count=0
local _netdev=""
local _dev=""
for _dev in $SYSPATH/*; do
if [ -L "$_dev/device" ]; then
local _dev_type="$(cat $_dev/type 2>/dev/null)"
if [ "$(valid_dev_type $_dev_type)" == "invalid" ]; then
continue;
fi
_dev="$(basename $_dev 2>/dev/null)"
netdev[$count]="$_dev"
count=$((count + 1))
fi
done
echo "Found $count network interfaces:"
for _netdev in "${netdev[@]}"; do
_macaddr="$(get_macaddr $SYSPATH/$_netdev)"
_pcislot="$(get_pci $SYSPATH/$_netdev)"
echo "I: INTERFACE: $_netdev"
echo "I: MACADDR: $_macaddr"
echo "I: PCI: $_pcislot"
done
}
if [ $# -eq 0 ]; then
usage
log_error "missing option(s)."
exit 1
fi
SYSPATH="/sys/class/net"
use_mac=0
use_pci=0
use_verbose=0
while getopts "hlmpvVc:n:o:" opt; do
case "$opt" in
h)
usage; exit 0;;
l)
list_adapters; exit 0;;
m)
use_mac=1 ;;
p)
use_pci=1 ;;
v)
use_verbose=1 ;;
V)
echo "$prj $ver"; exit 0;;
c)
ifcur="$OPTARG" ;;
n)
ifnew="$OPTARG" ;;
o)
output="$OPTARG" ;;
\?)
exit 1 ;;
esac
done
if [[ "$use_mac" -eq 0 ]] && [[ "$use_pci" -eq 0 ]]; then
use_mac=1
fi
if [[ "$use_mac" -eq 1 ]] && [[ "$use_pci" -eq 1 ]]; then
log_error "generating a persistent rule can be done only using one of the option, -m or -p, not both."
exit 1
fi
outfile="$output"
if [ -z "$output" ]; then
outfile="/dev/stdout"
else
dir="$(dirname $outfile 2>/dev/null)"
tmpfile="$dir/.tmp_file"
if [ -d "$dir" ]; then
touch "$tmpfile" >/dev/null 2>&1
if [ $? -ne 0 ]; then
log_error "no write access for $outfile. make sure you have write permissions to $dir."
exit 1
fi
rm -f "$tmpfile" >/dev/null 2>&1
else
log_error "$dir not a directory."
exit 1
fi
fi
interface="$ifcur"
if [ -z "$interface" ]; then
log_error "current interface must be specified."
exit 1
elif [ "$interface" == "lo" ]; then
log_error "loopback interface is not a valid interface."
exit 1
fi
[ "$use_verbose" -eq 1 ] && echo "I: INTERFACE=$interface"
new_interface="$ifnew"
if [ -z "$new_interface" ]; then
log_error "new interface must be specified."
exit 1
elif [ "$new_interface" == "lo" ]; then
log_error "new interface cant be named loopback interface."
exit
fi
[ "$use_verbose" -eq 1 ] && echo "I: INTERFACE_NEW=$new_interface"
path="$SYSPATH/$interface"
if [ ! -d "$path" ]; then
log_error "devpath $path not a directory."
exit 1
fi
[ "$use_verbose" -eq 1 ] && echo "I: DEVPATH=$path"
devtype="$(get_devtype $path)"
if [ -n "$devtype" ]; then
[ "$use_verbose" -eq 1 ] && echo "I: DEVTYPE=$devtype"
fi
parent_subsystem="$(get_parent_subsystem $path)"
if [ -z "$parent_subsystem" ]; then
log_error "unable to retrieve parent subsystem for interface $interface."
exit 1
fi
[ "$use_verbose" -eq 1 ] && echo "I: PARENT_SUBSYSTEM=$parent_subsystem"
subsystem="$(get_subsystem $path)"
if [ -z "$subsystem" ]; then
log_error "unable to retrieve subsystem for interface $interface."
exit 1
fi
[ "$use_verbose" -eq 1 ] && echo "I: SUBSYSTEM=$subsystem"
pci_id="$(get_pci_id $path)"
if [ -z "$pci_id" ]; then
pci_id="0x:0x"
fi
[ "$use_verbose" -eq 1 ] && echo "I: PCI_ID=$pci_id"
driver="$(get_driver $path)"
if [ -z "$driver" ]; then
log_error "unable to retrieve driver for interface $interface."
exit 1
fi
[ "$use_verbose" -eq 1 ] && echo "I: DRIVER=$driver"
if [ "$use_mac" -eq 1 ]; then
macaddr="$(get_macaddr $path)"
if [ -z "$macaddr" ]; then
log_error "unable to retrieve MAC address for interface $interface."
exit 1
fi
if [ "$(valid_mac $macaddr)" != "$macaddr" ]; then
log_error "$macaddr invalid MAC address."
exit 1
fi
[ "$use_verbose" -eq 1 ] && echo "I: MACADDR=$macaddr"
fi
if [ "$use_pci" -eq 1 ]; then
pci="$(get_pci $path)"
if [ -z "$pci" ]; then
log_error "unable to retrieve PCI slot for interface $interface."
exit 1
fi
[ "$use_verbose" -eq 1 ] && echo "I: KERNELS=$pci"
fi
dev_id="$(get_dev_id $path)"
if [ -z "$dev_id" ]; then
log_error "unable to retrieve dev_id for interface $interface."
exit 1
fi
[ "$use_verbose" -eq 1 ] && echo "I: DEV_ID=$dev_id"
dev_type="$(get_type $path)"
if [ -z "$dev_type" ]; then
log_error "unable to retrieve dev_type for interface $interface."
exit 1
elif [ "$(valid_dev_type $dev_type)" == "invalid" ]; then
log_info "$interface not a supported device."
exit 1
fi
[ "$use_verbose" -eq 1 ] && echo "I: TYPE=$dev_type"
kernel="eth*"
if [ -n "$devtype" ]; then
if [ "$devtype" == "wlan" ]; then
kernel="wlan*"
fi
fi
if [ -n "$output" ]; then
echo "Persistent rule written to "$outfile""
generate_comment "$pci_id" "$driver" "$outfile" "$parent_subsystem"
fi
if [ "$use_mac" -eq 1 ]; then
generate_rule "$subsystem" "$macaddr" "none" "$dev_id" "$dev_type" "$kernel" "$new_interface"
if [ -n "$output" ]; then
generate_rule "$subsystem" "$macaddr" "none" "$dev_id" "$dev_type" "$kernel" "$new_interface" "$outfile"
fi
elif [ "$use_pci" -eq 1 ]; then
generate_rule "$subsystem" "none" "$pci" "$dev_id" "$dev_type" "$kernel" "$new_interface"
if [ -n "$output" ]; then
generate_rule "$subsystem" "none" "$pci" "$dev_id" "$dev_type" "$kernel" "$new_interface" "$outfile"
fi
fi
if [ -n "$output" ]; then
display_note
fi
exit 0

View File

@ -5,11 +5,13 @@ write back the bytes and increase the entropy bit counter.
Related to bnc#892096
---
systemd-219/src/random-seed/random-seed.c | 71 +++++++++++++++++++++++++-----
src/random-seed/random-seed.c | 71 ++++++++++++++++++++++++++++++++++++------
1 file changed, 61 insertions(+), 10 deletions(-)
--- systemd-219/src/random-seed/random-seed.c
+++ systemd-219/src/random-seed/random-seed.c 2015-04-21 09:39:03.057518051 +0000
Index: systemd-221/src/random-seed/random-seed.c
===================================================================
--- systemd-221.orig/src/random-seed/random-seed.c
+++ systemd-221/src/random-seed/random-seed.c
@@ -22,7 +22,9 @@
#include <unistd.h>
#include <fcntl.h>
@ -42,7 +44,7 @@ Related to bnc#892096
r = log_oom();
goto finish;
}
+ entropy->buf_size = buf_size;
+ entropy->buf_size = (typeof(entropy->buf_size)) buf_size;
r = mkdir_parents_label(RANDOM_SEED, 0755);
if (r < 0) {
@ -52,7 +54,7 @@ Related to bnc#892096
+ entropy_fd = open(RANDOM_SEED_DIR "entropy_count", O_RDONLY|O_CLOEXEC|O_NOCTTY, 0600);
+ if (entropy_fd < 0) {
+ entropy->entropy_count = 0;
+ entropy->entropy_count = 0;
+ if (errno != ENOENT) {
+ log_error("Failed to open " RANDOM_SEED "/entropy_count: %m");
+ r = -errno;
@ -70,23 +72,23 @@ Related to bnc#892096
seed_fd = open(RANDOM_SEED, O_RDWR|O_CLOEXEC|O_NOCTTY|O_CREAT, 0600);
if (seed_fd < 0) {
seed_fd = open(RANDOM_SEED, O_RDONLY|O_CLOEXEC|O_NOCTTY);
@@ -104,7 +124,7 @@ int main(int argc, char *argv[]) {
@@ -103,7 +123,7 @@ int main(int argc, char *argv[]) {
}
}
- k = loop_read(seed_fd, buf, buf_size, false);
+ k = loop_read(seed_fd, entropy->buf, entropy->buf_size, false);
if (k <= 0) {
if (r != 0)
@@ -115,13 +135,29 @@ int main(int argc, char *argv[]) {
} else {
lseek(seed_fd, 0, SEEK_SET);
+ k = loop_read(seed_fd, entropy->buf, (size_t) entropy->buf_size, false);
if (k < 0)
r = log_error_errno(k, "Failed to read seed from " RANDOM_SEED ": %m");
else if (k == 0)
@@ -111,13 +131,29 @@ int main(int argc, char *argv[]) {
else {
(void) lseek(seed_fd, 0, SEEK_SET);
- r = loop_write(random_fd, buf, (size_t) k, false);
- if (r < 0)
- log_error_errno(r, "Failed to write seed to /dev/urandom: %m");
+ if (entropy->entropy_count && ((size_t)k) == entropy->buf_size) {
+ if (entropy->entropy_count && (size_t)k == (size_t)entropy->buf_size) {
+ r = ioctl(random_fd, RNDADDENTROPY, entropy);
+ if (r < 0) {
+ log_error_errno(errno, "Failed to write seed to /dev/urandom: %m");
@ -111,8 +113,8 @@ Related to bnc#892096
+
seed_fd = open(RANDOM_SEED, O_WRONLY|O_CLOEXEC|O_NOCTTY|O_CREAT, 0600);
if (seed_fd < 0) {
log_error_errno(errno, "Failed to open " RANDOM_SEED ": %m");
@@ -136,6 +172,21 @@ int main(int argc, char *argv[]) {
r = log_error_errno(errno, "Failed to open " RANDOM_SEED ": %m");
@@ -130,6 +166,21 @@ int main(int argc, char *argv[]) {
goto finish;
}
@ -132,20 +134,23 @@ Related to bnc#892096
+ }
+
} else {
log_error("Unknown verb %s.", argv[1]);
log_error("Unknown verb '%s'.", argv[1]);
r = -EINVAL;
@@ -149,12 +200,12 @@ int main(int argc, char *argv[]) {
fchmod(seed_fd, 0600);
fchown(seed_fd, 0, 0);
@@ -144,7 +195,7 @@ int main(int argc, char *argv[]) {
(void) fchmod(seed_fd, 0600);
(void) fchown(seed_fd, 0, 0);
- k = loop_read(random_fd, buf, buf_size, false);
+ k = loop_read(random_fd, entropy->buf, entropy->buf_size, false);
if (k <= 0) {
log_error("Failed to read new seed from /dev/urandom: %s", r < 0 ? strerror(-r) : "EOF");
r = k == 0 ? -EIO : (int) k;
} else {
- r = loop_write(seed_fd, buf, (size_t) k, false);
+ r = loop_write(seed_fd, entropy->buf, (size_t) k, false);
if (r < 0)
log_error_errno(r, "Failed to write new random seed file: %m");
+ k = loop_read(random_fd, entropy->buf, (size_t) entropy->buf_size, false);
if (k < 0) {
r = log_error_errno(k, "Failed to read new seed from /dev/urandom: %m");
goto finish;
@@ -155,7 +206,7 @@ int main(int argc, char *argv[]) {
goto finish;
}
- r = loop_write(seed_fd, buf, (size_t) k, false);
+ r = loop_write(seed_fd, entropy->buf, (size_t) k, false);
if (r < 0)
log_error_errno(r, "Failed to write new random seed file: %m");
}

3
v224.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0d7ac1532a57639fbc828f8a5051a090883c6ad2908618a7a13ab386db831bfc
size 3868075

View File

@ -14,10 +14,10 @@ track progress: https://bugzilla.redhat.com/show_bug.cgi?id=1141137
units/getty@.service.m4 | 1 +
units/serial-getty@.service.m4 | 1 +
2 files changed, 2 insertions(+)
Index: systemd-218/units/getty@.service.m4
Index: systemd-221/units/getty@.service.m4
===================================================================
--- systemd-218.orig/units/getty@.service.m4
+++ systemd-218/units/getty@.service.m4
--- systemd-221.orig/units/getty@.service.m4
+++ systemd-221/units/getty@.service.m4
@@ -29,6 +29,7 @@ ConditionPathExists=/dev/tty0
[Service]
# the VT is cleared by TTYVTDisallocate
@ -26,10 +26,10 @@ Index: systemd-218/units/getty@.service.m4
Type=idle
Restart=always
RestartSec=0
Index: systemd-218/units/serial-getty@.service.m4
Index: systemd-221/units/serial-getty@.service.m4
===================================================================
--- systemd-218.orig/units/serial-getty@.service.m4
+++ systemd-218/units/serial-getty@.service.m4
--- systemd-221.orig/units/serial-getty@.service.m4
+++ systemd-221/units/serial-getty@.service.m4
@@ -24,6 +24,7 @@ IgnoreOnIsolate=yes
[Service]

View File

@ -3,19 +3,19 @@
src/core/manager.h | 5 ++
2 files changed, 98 insertions(+)
Index: systemd-218/src/core/manager.c
Index: systemd-221/src/core/manager.c
===================================================================
--- systemd-218.orig/src/core/manager.c
+++ systemd-218/src/core/manager.c
@@ -37,6 +37,7 @@
#include <sys/stat.h>
--- systemd-221.orig/src/core/manager.c
+++ systemd-221/src/core/manager.c
@@ -32,6 +32,7 @@
#include <fcntl.h>
#include <dirent.h>
#include <sys/timerfd.h>
+#include <resolv.h>
#ifdef HAVE_AUDIT
#include <libaudit.h>
@@ -302,6 +303,91 @@ static int manager_check_ask_password(Ma
@@ -308,6 +309,91 @@ static int manager_check_ask_password(Ma
return m->have_ask_password;
}
@ -107,7 +107,7 @@ Index: systemd-218/src/core/manager.c
static int manager_watch_idle_pipe(Manager *m) {
int r;
@@ -557,6 +643,7 @@ int manager_new(SystemdRunningAs running
@@ -585,6 +671,7 @@ int manager_new(ManagerRunningAs running
m->pin_cgroupfs_fd = m->notify_fd = m->signal_fd = m->time_change_fd = m->dev_autofs_fd = m->private_listen_fd = m->kdbus_fd = m->utab_inotify_fd = -1;
m->current_job_id = 1; /* start as id #1, so that we can leave #0 around as "null-like" value */
@ -115,7 +115,7 @@ Index: systemd-218/src/core/manager.c
m->ask_password_inotify_fd = -1;
m->have_ask_password = -EINVAL; /* we don't know */
@@ -618,6 +705,10 @@ int manager_new(SystemdRunningAs running
@@ -651,6 +738,10 @@ int manager_new(ManagerRunningAs running
if (r < 0)
goto fail;
@ -126,7 +126,7 @@ Index: systemd-218/src/core/manager.c
m->udev = udev_new();
if (!m->udev) {
r = -ENOMEM;
@@ -896,6 +987,8 @@ Manager* manager_free(Manager *m) {
@@ -929,6 +1020,8 @@ Manager* manager_free(Manager *m) {
if (!m)
return NULL;
@ -135,11 +135,11 @@ Index: systemd-218/src/core/manager.c
manager_clear_jobs_and_units(m);
for (c = 0; c < _UNIT_TYPE_MAX; c++)
Index: systemd-218/src/core/manager.h
Index: systemd-221/src/core/manager.h
===================================================================
--- systemd-218.orig/src/core/manager.h
+++ systemd-218/src/core/manager.h
@@ -185,6 +185,11 @@ struct Manager {
--- systemd-221.orig/src/core/manager.h
+++ systemd-221/src/core/manager.h
@@ -181,6 +181,11 @@ struct Manager {
int utab_inotify_fd;
sd_event_source *mount_utab_event_source;