[systemd/f17] Backports from upstream v187+
Michal Schmidt
michich at fedoraproject.org
Wed Jul 25 11:23:26 UTC 2012
commit 1854ec0f692f7de03e65a09f87af5bc497747165
Author: Michal Schmidt <mschmidt at redhat.com>
Date: Wed Jul 25 00:19:52 2012 +0200
Backports from upstream v187+
- rework the handling of ntp services in timedated (#821813)
- rename systemd-debug-shell.service to debug-shell.service
- support modules-load= boot parameter
- "systemctl reset-failed" now resets the start rate limit
- systemctl can filter by load state
- parse BindsTo=
- bring back error reporting when stopping unknown units (#732874)
- many bugfixes (#817760, #835848, #767561, #839736, #841822, ...)
...ake-systemd.confirm_spawn-1-actually-work.patch | 506 +++++++++++++++++++
...d-parse-driver-rd.driver-kernel-command-l.patch | 255 ++++++++++
...d-don-t-fail-on-builtin-modules-better-pr.patch | 81 +++
0442-modules-load-fix-return-value.patch | 23 +
...load-use-correct-va_list-logging-function.patch | 38 ++
...nt-split-adding-of-extras-from-mount_load.patch | 164 ++++++
...-only-if-we-there-s-mountinfo-or-fragment.patch | 50 ++
...nt-fs-also-remount-usr-according-to-fstab.patch | 47 ++
...ialize-deserialize-job-counters-across-re.patch | 47 ++
...eplace-systemd-timedated-ntp.target-logic.patch | 521 ++++++++++++++++++++
0449-timedate-fix-ntp-units-comment.patch | 20 +
...e-systemd-debug-shell.service-to-debug-sh.patch | 57 +++
...d-rename-kernel-command-line-option-to-rd.patch | 33 ++
...eplace-ntp-units-file-with-an-ntp-units.d.patch | 141 ++++++
...-iteration-through-journal-if-one-file-is.patch | 31 ++
...ndle-proc-kmsg-reads-returning-0-more-nic.patch | 26 +
0455-timedate-uniq-ify-ntp-units-list.patch | 25 +
0456-load-fragment-a-few-modernizations.patch | 252 ++++++++++
...-make-hashmap_clear-work-on-NULL-hashmaps.patch | 35 ++
...-don-t-complain-if-we-try-to-fix-the-labe.patch | 119 +++++
...-StartLimitRate-in-conjunction-with-Resta.patch | 34 ++
...-that-StartLimitInterval-also-applies-to-.patch | 34 ++
...sh-the-start-counter-in-systemctl-reset-f.patch | 65 +++
0462-man-document-Restart-a-bit-more.patch | 43 ++
...man-pages-to-reflect-the-driver-to-load-m.patch | 49 ++
0464-paranoia-refuse-rm_rf.patch | 47 ++
...nitType-definitions-from-core-unit.c-to-s.patch | 99 ++++
...heck-the-argument-to-t-for-invalid-values.patch | 27 +
...emove-unit_name_is_valid_no_type-and-move.patch | 227 +++++++++
...d-of-UnitVTable.suffix-which-is-now-unuse.patch | 154 ++++++
...nitLoadState-definitions-from-core-unit.c.patch | 132 +++++
...tl-filter-shown-units-by-their-load-state.patch | 103 ++++
0471-mount-fix-for-complex-automounts.patch | 32 ++
...-util-add-extra-safety-check-to-in_initrd.patch | 54 ++
...-interleaving-of-files-with-different-tim.patch | 33 ++
...urnal-fix-bisection-logic-for-first-entry.patch | 37 ++
0475-journal-fix-bad-memory-access.patch | 23 +
0476-journal-fix-seeking-by-realtime-seqnum.patch | 38 ++
...check-fields-we-search-for-more-carefully.patch | 59 +++
...arily-ignore-SIGHUP-while-we-are-issuing-.patch | 54 ++
...hen-shutting-down-in-a-container-don-t-de.patch | 24 +
0480-unit-rename-BindTo-to-BindsTo.patch | 308 ++++++++++++
...gn-byte-buffer-that-gets-cased-to-an-obje.patch | 43 ++
...quire_terminal-fix-uninitialized-variable.patch | 24 +
0483-core-fix-name-of-dbus-call-parameter.patch | 23 +
...n-t-enforce-monotonicity-of-realtime-cloc.patch | 28 +
...-tail-head-timestamps-from-header-for-cut.patch | 49 ++
...ually-set-archived-files-to-archived-stat.patch | 25 +
...e-start-jobs-wait-not-fail-when-an-automa.patch | 57 +++
...-t-print-a-warning-if-we-are-in-autoresta.patch | 32 ++
...n-t-choke-on-journal-files-with-no-cutoff.patch | 35 ++
...ate-busy-files-away-when-we-try-to-write-.patch | 35 ++
...tl-fix-assertion-failure-in-ellipsize_mem.patch | 32 ++
0492-logind-fix-operation-precedence-mix-up.patch | 26 +
...use-color-specification-understood-by-dot.patch | 27 +
...les-avoid-mounting-raid-devices-too-early.patch | 30 ++
...files-continue-searching-if-one-dir-fails.patch | 54 ++
0496-F17-restore-device-units-for-dev-ttyX.patch | 28 +
...urn-error-when-asked-to-stop-unknown-unit.patch | 34 ++
0498-modules-load-fix-kernel-cmdline-parsing.patch | 31 ++
...he-modules-load-cmdline-parameters-to-the.patch | 28 +
systemd.spec | 78 +++-
62 files changed, 4863 insertions(+), 3 deletions(-)
---
diff --git a/0439-core-make-systemd.confirm_spawn-1-actually-work.patch b/0439-core-make-systemd.confirm_spawn-1-actually-work.patch
new file mode 100644
index 0000000..42bd047
--- /dev/null
+++ b/0439-core-make-systemd.confirm_spawn-1-actually-work.patch
@@ -0,0 +1,506 @@
+From 238f097df7bad6d530c59588eff693b26befd52b Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Tue, 26 Jun 2012 12:16:18 +0200
+Subject: [PATCH] core: make systemd.confirm_spawn=1 actually work
+
+This adds a timeout if the TTY cannot be acquired and makes sure we
+always output the question to the console, never to the TTY of the
+respective service.
+(cherry picked from commit af6da548aa14c57da7f17b3a1f2211efdb811d19)
+
+Conflicts:
+ TODO
+ src/core/execute.c
+---
+ src/core/execute.c | 195 ++++++++++-----------
+ src/core/main.c | 2 +-
+ src/core/manager.c | 3 +
+ src/shared/def.h | 1 +
+ src/shared/util.c | 58 ++++--
+ src/shared/util.h | 2 +-
+ .../tty-ask-password-agent.c | 2 +-
+ 7 files changed, 148 insertions(+), 115 deletions(-)
+
+diff --git a/src/core/execute.c b/src/core/execute.c
+index 8f2d646..8a04fe6 100644
+--- a/src/core/execute.c
++++ b/src/core/execute.c
+@@ -291,7 +291,8 @@ static int setup_input(const ExecContext *context, int socket_fd, bool apply_tty
+ tty_path(context),
+ i == EXEC_INPUT_TTY_FAIL,
+ i == EXEC_INPUT_TTY_FORCE,
+- false)) < 0)
++ false,
++ (usec_t) -1)) < 0)
+ return fd;
+
+ if (fd != STDIN_FILENO) {
+@@ -442,47 +443,45 @@ static int chown_terminal(int fd, uid_t uid) {
+ return 0;
+ }
+
+-static int setup_confirm_stdio(const ExecContext *context,
+- int *_saved_stdin,
++static int setup_confirm_stdio(int *_saved_stdin,
+ int *_saved_stdout) {
+ int fd = -1, saved_stdin, saved_stdout = -1, r;
+
+- assert(context);
+ assert(_saved_stdin);
+ assert(_saved_stdout);
+
+- /* This returns positive EXIT_xxx return values instead of
+- * negative errno style values! */
+-
+- if ((saved_stdin = fcntl(STDIN_FILENO, F_DUPFD, 3)) < 0)
+- return EXIT_STDIN;
++ saved_stdin = fcntl(STDIN_FILENO, F_DUPFD, 3);
++ if (saved_stdin < 0)
++ return -errno;
+
+- if ((saved_stdout = fcntl(STDOUT_FILENO, F_DUPFD, 3)) < 0) {
+- r = EXIT_STDOUT;
++ saved_stdout = fcntl(STDOUT_FILENO, F_DUPFD, 3);
++ if (saved_stdout < 0) {
++ r = errno;
+ goto fail;
+ }
+
+- if ((fd = acquire_terminal(
+- tty_path(context),
+- context->std_input == EXEC_INPUT_TTY_FAIL,
+- context->std_input == EXEC_INPUT_TTY_FORCE,
+- false)) < 0) {
+- r = EXIT_STDIN;
++ fd = acquire_terminal(
++ "/dev/console",
++ false,
++ false,
++ false,
++ DEFAULT_CONFIRM_USEC);
++ if (fd < 0) {
++ r = fd;
+ goto fail;
+ }
+
+- if (chown_terminal(fd, getuid()) < 0) {
+- r = EXIT_STDIN;
++ r = chown_terminal(fd, getuid());
++ if (r < 0)
+ goto fail;
+- }
+
+ if (dup2(fd, STDIN_FILENO) < 0) {
+- r = EXIT_STDIN;
++ r = -errno;
+ goto fail;
+ }
+
+ if (dup2(fd, STDOUT_FILENO) < 0) {
+- r = EXIT_STDOUT;
++ r = -errno;
+ goto fail;
+ }
+
+@@ -507,48 +506,70 @@ fail:
+ return r;
+ }
+
+-static int restore_confirm_stdio(const ExecContext *context,
+- int *saved_stdin,
+- int *saved_stdout,
+- bool *keep_stdin,
+- bool *keep_stdout) {
++static int write_confirm_message(const char *format, ...) {
++ int fd;
++ va_list ap;
+
+- assert(context);
+- assert(saved_stdin);
+- assert(*saved_stdin >= 0);
+- assert(saved_stdout);
+- assert(*saved_stdout >= 0);
++ assert(format);
+
+- /* This returns positive EXIT_xxx return values instead of
+- * negative errno style values! */
++ fd = open_terminal("/dev/console", O_WRONLY|O_NOCTTY|O_CLOEXEC);
++ if (fd < 0)
++ return fd;
+
+- if (is_terminal_input(context->std_input)) {
++ va_start(ap, format);
++ vdprintf(fd, format, ap);
++ va_end(ap);
+
+- /* The service wants terminal input. */
++ close_nointr_nofail(fd);
+
+- *keep_stdin = true;
+- *keep_stdout =
+- context->std_output == EXEC_OUTPUT_INHERIT ||
+- context->std_output == EXEC_OUTPUT_TTY;
++ return 0;
++}
+
+- } else {
+- /* If the service doesn't want a controlling terminal,
+- * then we need to get rid entirely of what we have
+- * already. */
++static int restore_confirm_stdio(int *saved_stdin,
++ int *saved_stdout) {
+
+- if (release_terminal() < 0)
+- return EXIT_STDIN;
++ int r = 0;
+
++ assert(saved_stdin);
++ assert(saved_stdout);
++
++ release_terminal();
++
++ if (*saved_stdin >= 0)
+ if (dup2(*saved_stdin, STDIN_FILENO) < 0)
+- return EXIT_STDIN;
++ r = -errno;
+
++ if (*saved_stdout >= 0)
+ if (dup2(*saved_stdout, STDOUT_FILENO) < 0)
+- return EXIT_STDOUT;
++ r = -errno;
+
+- *keep_stdout = *keep_stdin = false;
+- }
++ if (*saved_stdin >= 0)
++ close_nointr_nofail(*saved_stdin);
+
+- return 0;
++ if (*saved_stdout >= 0)
++ close_nointr_nofail(*saved_stdout);
++
++ return r;
++}
++
++static int ask_for_confirmation(char *response, char **argv) {
++ int saved_stdout = -1, saved_stdin = -1, r;
++ char *line;
++
++ r = setup_confirm_stdio(&saved_stdin, &saved_stdout);
++ if (r < 0)
++ return r;
++
++ line = exec_command_line(argv);
++ if (!line)
++ return -ENOMEM;
++
++ r = ask(response, "yns", "Execute %s? [Yes, No, Skip] ", line);
++ free(line);
++
++ restore_confirm_stdio(&saved_stdin, &saved_stdout);
++
++ return r;
+ }
+
+ static int enforce_groups(const ExecContext *context, const char *username, gid_t gid) {
+@@ -949,7 +970,8 @@ int exec_spawn(ExecCommand *command,
+ if (!argv)
+ argv = command->argv;
+
+- if (!(line = exec_command_line(argv))) {
++ line = exec_command_line(argv);
++ if (!line) {
+ r = -ENOMEM;
+ goto fail_parent;
+ }
+@@ -976,8 +998,7 @@ int exec_spawn(ExecCommand *command,
+ gid_t gid = (gid_t) -1;
+ char **our_env = NULL, **pam_env = NULL, **final_env = NULL, **final_argv = NULL;
+ unsigned n_env = 0;
+- int saved_stdout = -1, saved_stdin = -1;
+- bool keep_stdout = false, keep_stdin = false, set_access = false;
++ bool set_access = false;
+
+ /* child */
+
+@@ -1047,44 +1068,24 @@ int exec_spawn(ExecCommand *command,
+
+ exec_context_tty_reset(context);
+
+- /* We skip the confirmation step if we shall not apply the TTY */
+- if (confirm_spawn &&
+- (!is_terminal_input(context->std_input) || apply_tty_stdin)) {
++ if (confirm_spawn) {
+ char response;
+
+- /* Set up terminal for the question */
+- if ((r = setup_confirm_stdio(context,
+- &saved_stdin, &saved_stdout))) {
+- err = -errno;
+- goto fail_child;
+- }
+-
+- /* Now ask the question. */
+- if (!(line = exec_command_line(argv))) {
+- err = -ENOMEM;
+- r = EXIT_MEMORY;
+- goto fail_child;
+- }
+-
+- r = ask(&response, "yns", "Execute %s? [Yes, No, Skip] ", line);
+- free(line);
+-
+- if (r < 0 || response == 'n') {
++ err = ask_for_confirmation(&response, argv);
++ if (err == -ETIMEDOUT)
++ write_confirm_message("Confirmation question timed out, assuming positive response.\n");
++ else if (err < 0)
++ write_confirm_message("Couldn't ask confirmation question, assuming positive response: %s\n", strerror(-err));
++ else if (response == 's') {
++ write_confirm_message("Skipping execution.\n");
+ err = -ECANCELED;
+ r = EXIT_CONFIRM;
+ goto fail_child;
+- } else if (response == 's') {
++ } else if (response == 'n') {
++ write_confirm_message("Failing execution.\n");
+ err = r = 0;
+ goto fail_child;
+ }
+-
+- /* Release terminal for the question */
+- if ((r = restore_confirm_stdio(context,
+- &saved_stdin, &saved_stdout,
+- &keep_stdin, &keep_stdout))) {
+- err = -errno;
+- goto fail_child;
+- }
+ }
+
+ /* If a socket is connected to STDIN/STDOUT/STDERR, we
+@@ -1092,20 +1093,16 @@ int exec_spawn(ExecCommand *command,
+ if (socket_fd >= 0)
+ fd_nonblock(socket_fd, false);
+
+- if (!keep_stdin) {
+- err = setup_input(context, socket_fd, apply_tty_stdin);
+- if (err < 0) {
+- r = EXIT_STDIN;
+- goto fail_child;
+- }
++ err = setup_input(context, socket_fd, apply_tty_stdin);
++ if (err < 0) {
++ r = EXIT_STDIN;
++ goto fail_child;
+ }
+
+- if (!keep_stdout) {
+- err = setup_output(context, socket_fd, path_get_file_name(command->path), apply_tty_stdin);
+- if (err < 0) {
+- r = EXIT_STDOUT;
+- goto fail_child;
+- }
++ err = setup_output(context, socket_fd, path_get_file_name(command->path), apply_tty_stdin);
++ if (err < 0) {
++ r = EXIT_STDOUT;
++ goto fail_child;
+ }
+
+ err = setup_error(context, socket_fd, path_get_file_name(command->path), apply_tty_stdin);
+@@ -1436,12 +1433,6 @@ int exec_spawn(ExecCommand *command,
+ strv_free(files_env);
+ strv_free(final_argv);
+
+- if (saved_stdin >= 0)
+- close_nointr_nofail(saved_stdin);
+-
+- if (saved_stdout >= 0)
+- close_nointr_nofail(saved_stdout);
+-
+ _exit(r);
+ }
+
+diff --git a/src/core/main.c b/src/core/main.c
+index 2e79ca5..ecb17d4 100644
+--- a/src/core/main.c
++++ b/src/core/main.c
+@@ -174,7 +174,7 @@ _noreturn_ static void crash(int sig) {
+ else if (pid == 0) {
+ int fd, r;
+
+- if ((fd = acquire_terminal("/dev/console", false, true, true)) < 0)
++ if ((fd = acquire_terminal("/dev/console", false, true, true, (usec_t) -1)) < 0)
+ log_error("Failed to acquire terminal: %s", strerror(-fd));
+ else if ((r = make_stdio(fd)) < 0)
+ log_error("Failed to duplicate terminal fd: %s", strerror(-r));
+diff --git a/src/core/manager.c b/src/core/manager.c
+index 8af3241..118da72 100644
+--- a/src/core/manager.c
++++ b/src/core/manager.c
+@@ -1986,6 +1986,9 @@ void manager_check_finished(Manager *m) {
+ /* Notify Type=idle units that we are done now */
+ close_pipe(m->idle_pipe);
+
++ /* Turn off confirm spawn now */
++ m->confirm_spawn = false;
++
+ if (dual_timestamp_is_set(&m->finish_timestamp))
+ return;
+
+diff --git a/src/shared/def.h b/src/shared/def.h
+index 20aaa7c..b8e57db 100644
+--- a/src/shared/def.h
++++ b/src/shared/def.h
+@@ -26,6 +26,7 @@
+
+ #define DEFAULT_TIMEOUT_USEC (90*USEC_PER_SEC)
+ #define DEFAULT_RESTART_USEC (100*USEC_PER_MSEC)
++#define DEFAULT_CONFIRM_USEC (30*USEC_PER_SEC)
+
+ #define DEFAULT_EXIT_USEC (5*USEC_PER_MINUTE)
+
+diff --git a/src/shared/util.c b/src/shared/util.c
+index 035f01d..ae5456e 100644
+--- a/src/shared/util.c
++++ b/src/shared/util.c
+@@ -2305,12 +2305,14 @@ int open_terminal(const char *name, int mode) {
+ */
+
+ for (;;) {
+- if ((fd = open(name, mode)) >= 0)
++ fd = open(name, mode);
++ if (fd >= 0)
+ break;
+
+ if (errno != EIO)
+ return -errno;
+
++ /* Max 1s in total */
+ if (c >= 20)
+ return -errno;
+
+@@ -2321,7 +2323,8 @@ int open_terminal(const char *name, int mode) {
+ if (fd < 0)
+ return -errno;
+
+- if ((r = isatty(fd)) < 0) {
++ r = isatty(fd);
++ if (r < 0) {
+ close_nointr_nofail(fd);
+ return -errno;
+ }
+@@ -2373,8 +2376,15 @@ int flush_fd(int fd) {
+ }
+ }
+
+-int acquire_terminal(const char *name, bool fail, bool force, bool ignore_tiocstty_eperm) {
++int acquire_terminal(
++ const char *name,
++ bool fail,
++ bool force,
++ bool ignore_tiocstty_eperm,
++ usec_t timeout) {
++
+ int fd = -1, notify = -1, r, wd = -1;
++ usec_t ts = 0;
+
+ assert(name);
+
+@@ -2391,27 +2401,35 @@ int acquire_terminal(const char *name, bool fail, bool force, bool ignore_tiocst
+ * on the same tty as an untrusted user this should not be a
+ * problem. (Which he probably should not do anyway.) */
+
++ if (timeout != (usec_t) -1)
++ ts = now(CLOCK_MONOTONIC);
++
+ if (!fail && !force) {
+- if ((notify = inotify_init1(IN_CLOEXEC)) < 0) {
++ notify = inotify_init1(IN_CLOEXEC | (timeout != (usec_t) -1 ? IN_NONBLOCK : 0));
++ if (notify < 0) {
+ r = -errno;
+ goto fail;
+ }
+
+- if ((wd = inotify_add_watch(notify, name, IN_CLOSE)) < 0) {
++ wd = inotify_add_watch(notify, name, IN_CLOSE);
++ if (wd < 0) {
+ r = -errno;
+ goto fail;
+ }
+ }
+
+ for (;;) {
+- if (notify >= 0)
+- if ((r = flush_fd(notify)) < 0)
++ if (notify >= 0) {
++ r = flush_fd(notify);
++ if (r < 0)
+ goto fail;
++ }
+
+ /* We pass here O_NOCTTY only so that we can check the return
+ * value TIOCSCTTY and have a reliable way to figure out if we
+ * successfully became the controlling process of the tty */
+- if ((fd = open_terminal(name, O_RDWR|O_NOCTTY|O_CLOEXEC)) < 0)
++ fd = open_terminal(name, O_RDWR|O_NOCTTY|O_CLOEXEC);
++ if (fd < 0)
+ return fd;
+
+ /* First, try to get the tty */
+@@ -2440,9 +2458,29 @@ int acquire_terminal(const char *name, bool fail, bool force, bool ignore_tiocst
+ ssize_t l;
+ struct inotify_event *e;
+
+- if ((l = read(notify, inotify_buffer, sizeof(inotify_buffer))) < 0) {
++ if (timeout != (usec_t) -1) {
++ usec_t n;
++
++ n = now(CLOCK_MONOTONIC);
++ if (ts + timeout < n) {
++ r = -ETIMEDOUT;
++ goto fail;
++ }
++
++ r = fd_wait_for_event(fd, POLLIN, ts + timeout - n);
++ if (r < 0)
++ goto fail;
++
++ if (r == 0) {
++ r = -ETIMEDOUT;
++ goto fail;
++ }
++ }
++
++ l = read(notify, inotify_buffer, sizeof(inotify_buffer));
++ if (l < 0) {
+
+- if (errno == EINTR)
++ if (errno == EINTR || errno == EAGAIN)
+ continue;
+
+ r = -errno;
+diff --git a/src/shared/util.h b/src/shared/util.h
+index 1bc1a75..66022ed 100644
+--- a/src/shared/util.h
++++ b/src/shared/util.h
+@@ -321,7 +321,7 @@ int reset_terminal_fd(int fd, bool switch_to_text);
+ int reset_terminal(const char *name);
+
+ int open_terminal(const char *name, int mode);
+-int acquire_terminal(const char *name, bool fail, bool force, bool ignore_tiocstty_eperm);
++int acquire_terminal(const char *name, bool fail, bool force, bool ignore_tiocstty_eperm, usec_t timeout);
+ int release_terminal(void);
+
+ int flush_fd(int fd);
+diff --git a/src/tty-ask-password-agent/tty-ask-password-agent.c b/src/tty-ask-password-agent/tty-ask-password-agent.c
+index 06f5a5a..77c2429 100644
+--- a/src/tty-ask-password-agent/tty-ask-password-agent.c
++++ b/src/tty-ask-password-agent/tty-ask-password-agent.c
+@@ -368,7 +368,7 @@ static int parse_password(const char *filename, char **wall) {
+ char *password;
+
+ if (arg_console)
+- if ((tty_fd = acquire_terminal("/dev/console", false, false, false)) < 0) {
++ if ((tty_fd = acquire_terminal("/dev/console", false, false, false, (usec_t) -1)) < 0) {
+ r = tty_fd;
+ goto finish;
+ }
diff --git a/0440-modules-load-parse-driver-rd.driver-kernel-command-l.patch b/0440-modules-load-parse-driver-rd.driver-kernel-command-l.patch
new file mode 100644
index 0000000..9997b59
--- /dev/null
+++ b/0440-modules-load-parse-driver-rd.driver-kernel-command-l.patch
@@ -0,0 +1,255 @@
+From 2ab98a6b054f9ef2ce3b359c5e2641bf14e5efe8 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Fri, 22 Jun 2012 11:39:04 +0200
+Subject: [PATCH] modules-load: parse driver=/rd.driver= kernel command line
+ option
+
+This generalizes logic that already has been available in dracut before.
+(cherry picked from commit 03658d4fd66d5d0ccce643cef92185ec38b0e575)
+
+Conflicts:
+ man/kernel-command-line.xml
+---
+ src/modules-load/modules-load.c | 172 +++++++++++++++++++++++++++++++---------
+ 1 file changed, 134 insertions(+), 38 deletions(-)
+
+diff --git a/src/modules-load/modules-load.c b/src/modules-load/modules-load.c
+index a6da47e..4cb3485 100644
+--- a/src/modules-load/modules-load.c
++++ b/src/modules-load/modules-load.c
+@@ -32,6 +32,9 @@
+ #include "util.h"
+ #include "strv.h"
+ #include "conf-files.h"
++#include "virt.h"
++
++static char **arg_proc_cmdline_modules = NULL;
+
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wformat-nonliteral"
+@@ -42,11 +45,120 @@ static void systemd_kmod_log(void *data, int priority, const char *file, int lin
+ }
+ #pragma GCC diagnostic pop
+
++static int add_modules(const char *p) {
++ char **t, **k;
++
++ k = strv_split(p, ",");
++ if (!k) {
++ log_error("Out of memory");
++ return -ENOMEM;
++ }
++
++ t = strv_merge(arg_proc_cmdline_modules, k);
++ strv_free(k);
++ if (!t) {
++ log_error("Out of memory");
++ return -ENOMEM;
++ }
++
++ strv_free(arg_proc_cmdline_modules);
++ arg_proc_cmdline_modules = t;
++
++ return 0;
++}
++
++static int parse_proc_cmdline(void) {
++ char *line, *w, *state;
++ int r;
++ size_t l;
++
++ if (detect_container(NULL) > 0)
++ return 0;
++
++ r = read_one_line_file("/proc/cmdline", &line);
++ if (r < 0) {
++ log_warning("Failed to read /proc/cmdline, ignoring: %s", strerror(-r));
++ return 0;
++ }
++
++ FOREACH_WORD_QUOTED(w, l, line, state) {
++ char *word;
++
++ word = strndup(w, l);
++ if (!word) {
++ r = -ENOMEM;
++ goto finish;
++ }
++
++ if (startswith(word, "driver=")) {
++
++ r = add_modules(word + 7);
++ if (r < 0)
++ goto finish;
++
++ } else if (startswith(word, "rd.driver=")) {
++
++ if (in_initrd()) {
++ r = add_modules(word + 10);
++ if (r < 0)
++ goto finish;
++ }
++
++ }
++
++ free(word);
++ }
++
++ r = 0;
++
++finish:
++ free(line);
++ return r;
++}
++
++static int load_module(struct kmod_ctx *ctx, const char *m) {
++ const int probe_flags = KMOD_PROBE_APPLY_BLACKLIST|KMOD_PROBE_IGNORE_LOADED;
++ struct kmod_list *itr, *modlist = NULL;
++ int r = 0;
++
++ log_debug("load: %s\n", m);
++
++ r = kmod_module_new_from_lookup(ctx, m, &modlist);
++ if (r < 0) {
++ log_error("Failed to lookup alias '%s': %s", m, strerror(-r));
++ return r;
++ }
++
++ kmod_list_foreach(itr, modlist) {
++ struct kmod_module *mod;
++ int err;
++
++ mod = kmod_module_get_module(itr);
++ err = kmod_module_probe_insert_module(mod, probe_flags,
++ NULL, NULL, NULL, NULL);
++
++ if (err == 0)
++ log_info("Inserted module '%s'", kmod_module_get_name(mod));
++ else if (err == KMOD_PROBE_APPLY_BLACKLIST)
++ log_info("Module '%s' is blacklisted", kmod_module_get_name(mod));
++ else {
++ log_error("Failed to insert '%s': %s", kmod_module_get_name(mod),
++ strerror(-err));
++ r = err;
++ }
++
++ kmod_module_unref(mod);
++ }
++
++ kmod_module_unref_list(modlist);
++
++ return r;
++}
++
+ int main(int argc, char *argv[]) {
+- int r = EXIT_FAILURE;
+- char **files, **fn;
++ int r = EXIT_FAILURE, k;
++ char **files, **fn, **i;
+ struct kmod_ctx *ctx;
+- const int probe_flags = KMOD_PROBE_APPLY_BLACKLIST|KMOD_PROBE_IGNORE_LOADED;
+
+ if (argc > 1) {
+ log_error("This program takes no argument.");
+@@ -59,6 +171,9 @@ int main(int argc, char *argv[]) {
+
+ umask(0022);
+
++ if (parse_proc_cmdline() < 0)
++ return EXIT_FAILURE;
++
+ ctx = kmod_new(NULL, NULL);
+ if (!ctx) {
+ log_error("Failed to allocate memory for kmod.");
+@@ -66,10 +181,17 @@ int main(int argc, char *argv[]) {
+ }
+
+ kmod_load_resources(ctx);
+-
+ kmod_set_log_fn(ctx, systemd_kmod_log, NULL);
+
+- if (conf_files_list(&files, ".conf",
++ r = EXIT_SUCCESS;
++
++ STRV_FOREACH(i, arg_proc_cmdline_modules) {
++ k = load_module(ctx, *i);
++ if (k < 0)
++ r = EXIT_FAILURE;
++ }
++
++ k = conf_files_list(&files, ".conf",
+ "/etc/modules-load.d",
+ "/run/modules-load.d",
+ "/usr/local/lib/modules-load.d",
+@@ -77,13 +199,13 @@ int main(int argc, char *argv[]) {
+ #ifdef HAVE_SPLIT_USR
+ "/lib/modules-load.d",
+ #endif
+- NULL) < 0) {
+- log_error("Failed to enumerate modules-load.d files: %s", strerror(-r));
++ NULL);
++ if (k < 0) {
++ log_error("Failed to enumerate modules-load.d files: %s", strerror(-k));
++ r = EXIT_FAILURE;
+ goto finish;
+ }
+
+- r = EXIT_SUCCESS;
+-
+ STRV_FOREACH(fn, files) {
+ FILE *f;
+
+@@ -100,8 +222,6 @@ int main(int argc, char *argv[]) {
+ log_debug("apply: %s\n", *fn);
+ for (;;) {
+ char line[LINE_MAX], *l;
+- struct kmod_list *itr, *modlist = NULL;
+- int err;
+
+ if (!fgets(line, sizeof(line), f))
+ break;
+@@ -110,34 +230,9 @@ int main(int argc, char *argv[]) {
+ if (*l == '#' || *l == 0)
+ continue;
+
+- err = kmod_module_new_from_lookup(ctx, l, &modlist);
+- if (err < 0) {
+- log_error("Failed to lookup alias '%s'", l);
++ k = load_module(ctx, l);
++ if (k < 0)
+ r = EXIT_FAILURE;
+- continue;
+- }
+-
+- kmod_list_foreach(itr, modlist) {
+- struct kmod_module *mod;
+-
+- mod = kmod_module_get_module(itr);
+- err = kmod_module_probe_insert_module(mod, probe_flags,
+- NULL, NULL, NULL, NULL);
+-
+- if (err == 0)
+- log_info("Inserted module '%s'", kmod_module_get_name(mod));
+- else if (err == KMOD_PROBE_APPLY_BLACKLIST)
+- log_info("Module '%s' is blacklisted", kmod_module_get_name(mod));
+- else {
+- log_error("Failed to insert '%s': %s", kmod_module_get_name(mod),
+- strerror(-err));
+- r = EXIT_FAILURE;
+- }
+-
+- kmod_module_unref(mod);
+- }
+-
+- kmod_module_unref_list(modlist);
+ }
+
+ if (ferror(f)) {
+@@ -151,6 +246,7 @@ int main(int argc, char *argv[]) {
+ finish:
+ strv_free(files);
+ kmod_unref(ctx);
++ strv_free(arg_proc_cmdline_modules);
+
+ return r;
+ }
diff --git a/0441-modules-load-don-t-fail-on-builtin-modules-better-pr.patch b/0441-modules-load-don-t-fail-on-builtin-modules-better-pr.patch
new file mode 100644
index 0000000..e3a2d52
--- /dev/null
+++ b/0441-modules-load-don-t-fail-on-builtin-modules-better-pr.patch
@@ -0,0 +1,81 @@
+From 67127f164b25229bbd1ab699dd3d7b7f7295e981 Mon Sep 17 00:00:00 2001
+From: Michal Schmidt <mschmidt at redhat.com>
+Date: Wed, 27 Jun 2012 21:44:49 +0200
+Subject: [PATCH] modules-load: don't fail on builtin modules, better prints
+
+Distinguish between non-existing modules, builtin modules, already
+loaded modules, and modules we load.
+Only the non-existing ones are treated as errors.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=817760
+(cherry picked from commit 27fda47f40453e552ebccf7acb85f915cf34f23a)
+---
+ src/modules-load/modules-load.c | 44 +++++++++++++++++++++++++++++------------
+ 1 file changed, 31 insertions(+), 13 deletions(-)
+
+diff --git a/src/modules-load/modules-load.c b/src/modules-load/modules-load.c
+index 4cb3485..c5692b2 100644
+--- a/src/modules-load/modules-load.c
++++ b/src/modules-load/modules-load.c
+@@ -117,7 +117,7 @@ finish:
+ }
+
+ static int load_module(struct kmod_ctx *ctx, const char *m) {
+- const int probe_flags = KMOD_PROBE_APPLY_BLACKLIST|KMOD_PROBE_IGNORE_LOADED;
++ const int probe_flags = KMOD_PROBE_APPLY_BLACKLIST;
+ struct kmod_list *itr, *modlist = NULL;
+ int r = 0;
+
+@@ -129,22 +129,40 @@ static int load_module(struct kmod_ctx *ctx, const char *m) {
+ return r;
+ }
+
++ if (!modlist) {
++ log_error("Failed to find module '%s'", m);
++ return r;
++ }
++
+ kmod_list_foreach(itr, modlist) {
+ struct kmod_module *mod;
+- int err;
++ int state, err;
+
+ mod = kmod_module_get_module(itr);
+- err = kmod_module_probe_insert_module(mod, probe_flags,
+- NULL, NULL, NULL, NULL);
+-
+- if (err == 0)
+- log_info("Inserted module '%s'", kmod_module_get_name(mod));
+- else if (err == KMOD_PROBE_APPLY_BLACKLIST)
+- log_info("Module '%s' is blacklisted", kmod_module_get_name(mod));
+- else {
+- log_error("Failed to insert '%s': %s", kmod_module_get_name(mod),
+- strerror(-err));
+- r = err;
++ state = kmod_module_get_initstate(mod);
++
++ switch (state) {
++ case KMOD_MODULE_BUILTIN:
++ log_info("Module '%s' is builtin", kmod_module_get_name(mod));
++ break;
++
++ case KMOD_MODULE_LIVE:
++ log_info("Module '%s' is already loaded", kmod_module_get_name(mod));
++ break;
++
++ default:
++ err = kmod_module_probe_insert_module(mod, probe_flags,
++ NULL, NULL, NULL, NULL);
++
++ if (err == 0)
++ log_info("Inserted module '%s'", kmod_module_get_name(mod));
++ else if (err == KMOD_PROBE_APPLY_BLACKLIST)
++ log_info("Module '%s' is blacklisted", kmod_module_get_name(mod));
++ else {
++ log_error("Failed to insert '%s': %s", kmod_module_get_name(mod),
++ strerror(-err));
++ r = err;
++ }
+ }
+
+ kmod_module_unref(mod);
diff --git a/0442-modules-load-fix-return-value.patch b/0442-modules-load-fix-return-value.patch
new file mode 100644
index 0000000..37f4939
--- /dev/null
+++ b/0442-modules-load-fix-return-value.patch
@@ -0,0 +1,23 @@
+From 94c4ab25cc50ec4df0322cfda1fd51e769f4e474 Mon Sep 17 00:00:00 2001
+From: Michal Schmidt <mschmidt at redhat.com>
+Date: Thu, 28 Jun 2012 00:12:47 +0200
+Subject: [PATCH] modules-load: fix return value (cherry picked from commit
+ 8f9c0b4cc17dc0eb24e420f9bd6f8c9534b5dd84)
+
+---
+ src/modules-load/modules-load.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/modules-load/modules-load.c b/src/modules-load/modules-load.c
+index c5692b2..027fe1e 100644
+--- a/src/modules-load/modules-load.c
++++ b/src/modules-load/modules-load.c
+@@ -131,7 +131,7 @@ static int load_module(struct kmod_ctx *ctx, const char *m) {
+
+ if (!modlist) {
+ log_error("Failed to find module '%s'", m);
+- return r;
++ return -ENOENT;
+ }
+
+ kmod_list_foreach(itr, modlist) {
diff --git a/0443-modules-load-use-correct-va_list-logging-function.patch b/0443-modules-load-use-correct-va_list-logging-function.patch
new file mode 100644
index 0000000..3c84353
--- /dev/null
+++ b/0443-modules-load-use-correct-va_list-logging-function.patch
@@ -0,0 +1,38 @@
+From 5462d08fb00a39de0e76cd132e9d0fc4535b06c0 Mon Sep 17 00:00:00 2001
+From: Michal Schmidt <mschmidt at redhat.com>
+Date: Thu, 28 Jun 2012 00:50:46 +0200
+Subject: [PATCH] modules-load: use correct va_list logging function (cherry
+ picked from commit
+ e62abb626806140a4cd9abc928d23c661a7b9a33)
+
+---
+ src/core/kmod-setup.c | 2 +-
+ src/modules-load/modules-load.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/core/kmod-setup.c b/src/core/kmod-setup.c
+index debf871..2fd69c5 100644
+--- a/src/core/kmod-setup.c
++++ b/src/core/kmod-setup.c
+@@ -41,7 +41,7 @@ static const char * const kmod_table[] = {
+ static void systemd_kmod_log(void *data, int priority, const char *file, int line,
+ const char *fn, const char *format, va_list args)
+ {
+- log_meta(priority, file, line, fn, format, args);
++ log_metav(priority, file, line, fn, format, args);
+ }
+ #pragma GCC diagnostic pop
+
+diff --git a/src/modules-load/modules-load.c b/src/modules-load/modules-load.c
+index 027fe1e..057aa6e 100644
+--- a/src/modules-load/modules-load.c
++++ b/src/modules-load/modules-load.c
+@@ -41,7 +41,7 @@ static char **arg_proc_cmdline_modules = NULL;
+ static void systemd_kmod_log(void *data, int priority, const char *file, int line,
+ const char *fn, const char *format, va_list args)
+ {
+- log_meta(priority, file, line, fn, format, args);
++ log_metav(priority, file, line, fn, format, args);
+ }
+ #pragma GCC diagnostic pop
+
diff --git a/0444-mount-split-adding-of-extras-from-mount_load.patch b/0444-mount-split-adding-of-extras-from-mount_load.patch
new file mode 100644
index 0000000..c8c3688
--- /dev/null
+++ b/0444-mount-split-adding-of-extras-from-mount_load.patch
@@ -0,0 +1,164 @@
+From 0011a372f6e7798a4164afdb02eff2d627f67a08 Mon Sep 17 00:00:00 2001
+From: Michal Schmidt <mschmidt at redhat.com>
+Date: Fri, 29 Jun 2012 01:47:24 +0200
+Subject: [PATCH] mount: split adding of extras from mount_load() (cherry
+ picked from commit
+ 1a4ac875003b49132c55a0ef36cd6ae2a15d3ac2)
+
+Conflicts:
+ src/core/mount.c
+---
+ src/core/mount.c | 119 ++++++++++++++++++++++++++++++++++---------------------
+ 1 file changed, 74 insertions(+), 45 deletions(-)
+
+diff --git a/src/core/mount.c b/src/core/mount.c
+index dcb6c5a..439dd84 100644
+--- a/src/core/mount.c
++++ b/src/core/mount.c
+@@ -590,72 +590,101 @@ static int mount_verify(Mount *m) {
+ return 0;
+ }
+
+-static int mount_load(Unit *u) {
+- Mount *m = MOUNT(u);
++static int mount_add_extras(Mount *m) {
++ Unit *u = UNIT(m);
+ int r;
+
+- assert(u);
+- assert(u->load_state == UNIT_STUB);
+-
+- if ((r = unit_load_fragment_and_dropin_optional(u)) < 0)
++ r = unit_add_exec_dependencies(u, &m->exec_context);
++ if (r < 0)
+ return r;
+
+- /* This is a new unit? Then let's add in some extras */
+- if (u->load_state == UNIT_LOADED) {
+- if ((r = unit_add_exec_dependencies(u, &m->exec_context)) < 0)
+- return r;
+-
+- if (UNIT(m)->fragment_path)
+- m->from_fragment = true;
+- else if (m->from_etc_fstab)
+- /* We always add several default dependencies to fstab mounts,
+- * but we do not want the implicit complementing of Wants= with After=
+- * in the target unit that this mount unit will be hooked into. */
+- UNIT(m)->default_dependencies = false;
++ if (UNIT(m)->fragment_path)
++ m->from_fragment = true;
++ else if (m->from_etc_fstab)
++ /* We always add several default dependencies to fstab mounts,
++ * but we do not want the implicit complementing of Wants= with After=
++ * in the target unit that this mount unit will be hooked into. */
++ UNIT(m)->default_dependencies = false;
+
++ if (!m->where) {
++ m->where = unit_name_to_path(u->id);
+ if (!m->where)
+- if (!(m->where = unit_name_to_path(u->id)))
+- return -ENOMEM;
+-
+- path_kill_slashes(m->where);
++ return -ENOMEM;
++ }
+
+- if (!UNIT(m)->description)
+- if ((r = unit_set_description(u, m->where)) < 0)
+- return r;
++ path_kill_slashes(m->where);
+
+- if ((r = mount_add_device_links(m)) < 0)
++ if (!UNIT(m)->description) {
++ r = unit_set_description(u, m->where);
++ if (r < 0)
+ return r;
++ }
+
+- if ((r = mount_add_mount_links(m)) < 0)
+- return r;
++ r = mount_add_device_links(m);
++ if (r < 0)
++ return r;
+
+- if ((r = mount_add_socket_links(m)) < 0)
+- return r;
++ r = mount_add_mount_links(m);
++ if (r < 0)
++ return r;
+
+- if ((r = mount_add_swap_links(m)) < 0)
+- return r;
++ r = mount_add_socket_links(m);
++ if (r < 0)
++ return r;
+
+- if ((r = mount_add_path_links(m)) < 0)
+- return r;
++ r = mount_add_swap_links(m);
++ if (r < 0)
++ return r;
++
++ r = mount_add_path_links(m);
++ if (r < 0)
++ return r;
++
++ r = mount_add_requires_mounts_links(m);
++ if (r < 0)
++ return r;
++
++ r = mount_add_automount_links(m);
++ if (r < 0)
++ return r;
++
++ r = mount_add_fstab_links(m);
++ if (r < 0)
++ return r;
+
+- r = mount_add_requires_mounts_links(m);
++ if (UNIT(m)->default_dependencies || m->from_etc_fstab) {
++ r = mount_add_default_dependencies(m);
+ if (r < 0)
+ return r;
++ }
+
+- if ((r = mount_add_automount_links(m)) < 0)
+- return r;
++ r = unit_add_default_cgroups(u);
++ if (r < 0)
++ return r;
+
+- if ((r = mount_add_fstab_links(m)) < 0)
+- return r;
++ r = mount_fix_timeouts(m);
++ if (r < 0)
++ return r;
+
+- if (UNIT(m)->default_dependencies || m->from_etc_fstab)
+- if ((r = mount_add_default_dependencies(m)) < 0)
+- return r;
++ return 0;
++}
+
+- if ((r = unit_add_default_cgroups(u)) < 0)
+- return r;
++static int mount_load(Unit *u) {
++ Mount *m = MOUNT(u);
++ int r;
++
++ assert(u);
++ assert(u->load_state == UNIT_STUB);
++
++ r = unit_load_fragment_and_dropin_optional(u);
++ if (r < 0)
++ return r;
+
+- mount_fix_timeouts(m);
++ /* This is a new unit? Then let's add in some extras */
++ if (u->load_state == UNIT_LOADED) {
++ r = mount_add_extras(m);
++ if (r < 0)
++ return r;
+ }
+
+ return mount_verify(m);
diff --git a/0445-mount-load-only-if-we-there-s-mountinfo-or-fragment.patch b/0445-mount-load-only-if-we-there-s-mountinfo-or-fragment.patch
new file mode 100644
index 0000000..fa7c46c
--- /dev/null
+++ b/0445-mount-load-only-if-we-there-s-mountinfo-or-fragment.patch
@@ -0,0 +1,50 @@
+From feaaf545187a13c036d2c6ccdc6300509e3a0520 Mon Sep 17 00:00:00 2001
+From: Michal Schmidt <mschmidt at redhat.com>
+Date: Fri, 29 Jun 2012 01:50:31 +0200
+Subject: [PATCH] mount: load only if we there's mountinfo or fragment
+
+Having information from /proc/self/mountinfo is sufficient to consider a
+mount unit loaded.
+
+When there's no mountinfo, the loading of the fragment for the mount
+unit is not optional. No extra dependency links must be added when the
+loading fails.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=835848
+(cherry picked from commit 8eba616fc09b854d13de5dacc5b31b1009c4e8d4)
+---
+ src/core/mount.c | 14 +++++++++++++-
+ 1 file changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/src/core/mount.c b/src/core/mount.c
+index 439dd84..dce7094 100644
+--- a/src/core/mount.c
++++ b/src/core/mount.c
+@@ -676,7 +676,11 @@ static int mount_load(Unit *u) {
+ assert(u);
+ assert(u->load_state == UNIT_STUB);
+
+- r = unit_load_fragment_and_dropin_optional(u);
++ if (m->from_proc_self_mountinfo)
++ r = unit_load_fragment_and_dropin_optional(u);
++ else
++ r = unit_load_fragment_and_dropin(u);
++
+ if (r < 0)
+ return r;
+
+@@ -1511,6 +1515,14 @@ static int mount_add_one(
+ } else {
+ delete = false;
+ free(e);
++
++ if (u->load_state == UNIT_ERROR) {
++ u->load_state = UNIT_LOADED;
++ u->load_error = 0;
++ r = mount_add_extras(MOUNT(u));
++ if (r < 0)
++ goto fail;
++ }
+ }
+
+ if (!(w = strdup(what)) ||
diff --git a/0446-remount-fs-also-remount-usr-according-to-fstab.patch b/0446-remount-fs-also-remount-usr-according-to-fstab.patch
new file mode 100644
index 0000000..dd46a11
--- /dev/null
+++ b/0446-remount-fs-also-remount-usr-according-to-fstab.patch
@@ -0,0 +1,47 @@
+From be24188f2506cb6fc30cd029ab6c89394a36aa26 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Fri, 29 Jun 2012 16:14:01 +0200
+Subject: [PATCH] remount-fs: also remount /usr according to fstab (cherry
+ picked from commit
+ b4efdf97203ddf781c17f77be84cc61516a077d2)
+
+Conflicts:
+ TODO
+ man/systemd-remount-fs.service.xml
+---
+ src/core/dbus-manager.c | 4 +++-
+ src/remount-fs/remount-fs.c | 5 +++--
+ 2 files changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c
+index aaaeec4..62dc2c9 100644
+--- a/src/core/dbus-manager.c
++++ b/src/core/dbus-manager.c
+@@ -114,7 +114,9 @@
+ " </method>\n" \
+ " <method name=\"Subscribe\"/>\n" \
+ " <method name=\"Unsubscribe\"/>\n" \
+- " <method name=\"Dump\"/>\n" \
++ " <method name=\"Dump\">\n" \
++ " <arg name=\"dump\" type=\"s\" direction=\"out\"/>\n" \
++ " </method>\n" \
+ " <method name=\"CreateSnapshot\">\n" \
+ " <arg name=\"name\" type=\"s\" direction=\"in\"/>\n" \
+ " <arg name=\"cleanup\" type=\"b\" direction=\"in\"/>\n" \
+diff --git a/src/remount-fs/remount-fs.c b/src/remount-fs/remount-fs.c
+index 8c7227c..99fe8f6 100644
+--- a/src/remount-fs/remount-fs.c
++++ b/src/remount-fs/remount-fs.c
+@@ -79,9 +79,10 @@ int main(int argc, char *argv[]) {
+ int k;
+ char *s;
+
+- /* Remount the root fs and all API VFS */
++ /* Remount the root fs, /usr and all API VFS */
+ if (!mount_point_is_api(me->mnt_dir) &&
+- !path_equal(me->mnt_dir, "/"))
++ !path_equal(me->mnt_dir, "/") &&
++ !path_equal(me->mnt_dir, "/usr"))
+ continue;
+
+ log_debug("Remounting %s", me->mnt_dir);
diff --git a/0447-manager-serialize-deserialize-job-counters-across-re.patch b/0447-manager-serialize-deserialize-job-counters-across-re.patch
new file mode 100644
index 0000000..45b3b18
--- /dev/null
+++ b/0447-manager-serialize-deserialize-job-counters-across-re.patch
@@ -0,0 +1,47 @@
+From a810771175153f43aaf12873596bda5deddddf57 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Fri, 29 Jun 2012 19:47:38 +0200
+Subject: [PATCH] manager: serialize/deserialize job counters across
+ reexec/reload (cherry picked from commit
+ 33c5fae93976505df343b842727f93910ad510c6)
+
+Conflicts:
+ TODO
+---
+ src/core/manager.c | 16 ++++++++++++++++
+ 1 file changed, 16 insertions(+)
+
+diff --git a/src/core/manager.c b/src/core/manager.c
+index 118da72..2a17794 100644
+--- a/src/core/manager.c
++++ b/src/core/manager.c
+@@ -1737,6 +1737,8 @@ int manager_serialize(Manager *m, FILE *f, FDSet *fds) {
+
+ fprintf(f, "current-job-id=%i\n", m->current_job_id);
+ fprintf(f, "taint-usr=%s\n", yes_no(m->taint_usr));
++ fprintf(f, "n-installed-jobs=%u\n", m->n_installed_jobs);
++ fprintf(f, "n-failed-jobs=%u\n", m->n_failed_jobs);
+
+ dual_timestamp_serialize(f, "initrd-timestamp", &m->initrd_timestamp);
+
+@@ -1812,6 +1814,20 @@ int manager_deserialize(Manager *m, FILE *f, FDSet *fds) {
+ log_debug("Failed to parse current job id value %s", l+15);
+ else
+ m->current_job_id = MAX(m->current_job_id, id);
++ } else if (startswith(l, "n-installed-jobs=")) {
++ uint32_t n;
++
++ if (safe_atou32(l+17, &n) < 0)
++ log_debug("Failed to parse installed jobs counter %s", l+17);
++ else
++ m->n_installed_jobs += n;
++ } else if (startswith(l, "n-failed-jobs=")) {
++ uint32_t n;
++
++ if (safe_atou32(l+14, &n) < 0)
++ log_debug("Failed to parse failed jobs counter %s", l+14);
++ else
++ m->n_failed_jobs += n;
+ } else if (startswith(l, "taint-usr=")) {
+ int b;
+
diff --git a/0448-timedated-replace-systemd-timedated-ntp.target-logic.patch b/0448-timedated-replace-systemd-timedated-ntp.target-logic.patch
new file mode 100644
index 0000000..011ad9e
--- /dev/null
+++ b/0448-timedated-replace-systemd-timedated-ntp.target-logic.patch
@@ -0,0 +1,521 @@
+From 3fdadd7ffeab01c973e99114c14f4423884a4227 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Sun, 1 Jul 2012 17:37:21 +0200
+Subject: [PATCH] timedated: replace systemd-timedated-ntp.target logic with
+ simpler scheme
+
+The previous systemd-timedated-ntp.target was suffering by the problem
+that NTP implementations enabled via the machanism could not be disabled
+the obvious way on the "systemctl disable" command line. Replace
+systemd-timedated-ntp.target by a list of implementations we try in
+turn. The list is encoded in $pkgdatadir/ntp-units.
+(cherry picked from commit ac7019f33f1618f5b69ed44a8623e2596f1e3856)
+
+Conflicts:
+ Makefile.am
+---
+ Makefile.am | 10 +-
+ src/timedate/ntp-units | 4 +
+ src/timedate/timedated.c | 321 ++++++++++++++++++++++++-------------
+ units/systemd-timedated-ntp.target | 18 ---
+ 4 files changed, 220 insertions(+), 133 deletions(-)
+ create mode 100644 src/timedate/ntp-units
+ delete mode 100644 units/systemd-timedated-ntp.target
+
+diff --git a/Makefile.am b/Makefile.am
+index 8e387a1..329a2d9 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -79,6 +79,7 @@ pkgconfiglib_DATA =
+ polkitpolicy_in_files =
+ dist_udevrules_DATA =
+ dist_pkgsysconf_DATA =
++dist_pkgdata_DATA =
+ dist_dbuspolicy_DATA =
+ dbusinterface_DATA =
+ dist_dbussystemservice_DATA =
+@@ -113,6 +114,7 @@ AM_CPPFLAGS = \
+ -DSYSTEM_SHUTDOWN_PATH=\"$(systemshutdowndir)\" \
+ -DSYSTEM_SLEEP_PATH=\"$(systemsleepdir)\" \
+ -DSYSTEMD_KBD_MODEL_MAP=\"$(pkgdatadir)/kbd-model-map\" \
++ -DSYSTEMD_NTP_UNITS=\"$(pkgdatadir)/ntp-units\" \
+ -DX_SERVER=\"$(bindir)/X\" \
+ -DPOLKIT_AGENT_BINARY_PATH=\"$(bindir)/pkttyagent\" \
+ -I $(top_srcdir)/src \
+@@ -291,8 +293,7 @@ dist_systemunit_DATA = \
+ units/quotaon.service \
+ units/systemd-ask-password-wall.path \
+ units/systemd-ask-password-console.path \
+- units/syslog.target \
+- units/systemd-timedated-ntp.target
++ units/syslog.target
+
+ nodist_systemunit_DATA = \
+ units/getty at .service \
+@@ -2005,7 +2006,7 @@ INSTALL_DATA_HOOKS += \
+ EXTRA_DIST += \
+ units/systemd-localed.service.in
+
+-dist_pkgdata_DATA = \
++dist_pkgdata_DATA += \
+ src/locale/kbd-model-map
+
+ dist_noinst_SCRIPT = \
+@@ -2061,6 +2062,9 @@ timedated-install-data-hook:
+ INSTALL_DATA_HOOKS += \
+ timedated-install-data-hook
+
++dist_pkgdata_DATA += \
++ src/timedate/ntp-units
++
+ EXTRA_DIST += \
+ units/systemd-timedated.service.in
+ endif
+diff --git a/src/timedate/ntp-units b/src/timedate/ntp-units
+new file mode 100644
+index 0000000..6fdef44
+--- /dev/null
++++ b/src/timedate/ntp-units
+@@ -0,0 +1,4 @@
++# NTP ervice implementations, in order for preference
++
++chronyd.service
++ntpd.service
+diff --git a/src/timedate/timedated.c b/src/timedate/timedated.c
+index b008f15..8be45d3 100644
+--- a/src/timedate/timedated.c
++++ b/src/timedate/timedated.c
+@@ -303,62 +303,112 @@ static int write_data_local_rtc(void) {
+ return r;
+ }
+
++static char** get_ntp_services(void) {
++ char **r = NULL;
++ FILE *f;
++
++ f = fopen(SYSTEMD_NTP_UNITS, "re");
++ if (!f)
++ return NULL;
++
++ for (;;) {
++ char line[PATH_MAX], *l, **q;
++
++ if (!fgets(line, sizeof(line), f)) {
++
++ if (ferror(f))
++ log_error("Failed to read NTP units file: %m");
++
++ break;
++ }
++
++ l = strstrip(line);
++ if (l[0] == 0 || l[0] == '#')
++ continue;
++
++
++ q = strv_append(r, l);
++ if (!q) {
++ log_error("Out of memory");
++ break;
++ }
++
++ strv_free(r);
++ r = q;
++ }
++
++ fclose(f);
++
++ return r;
++}
++
+ static int read_ntp(DBusConnection *bus) {
+ DBusMessage *m = NULL, *reply = NULL;
+- const char *name = "systemd-timedated-ntp.target", *s;
+ DBusError error;
+ int r;
++ char **i, **l;
+
+ assert(bus);
+
+ dbus_error_init(&error);
+
+- m = dbus_message_new_method_call(
+- "org.freedesktop.systemd1",
+- "/org/freedesktop/systemd1",
+- "org.freedesktop.systemd1.Manager",
+- "GetUnitFileState");
+-
+- if (!m) {
+- log_error("Out of memory");
+- r = -ENOMEM;
+- goto finish;
+- }
++ l = get_ntp_services();
++ STRV_FOREACH(i, l) {
++ const char *s;
++
++ if (m)
++ dbus_message_unref(m);
++ m = dbus_message_new_method_call(
++ "org.freedesktop.systemd1",
++ "/org/freedesktop/systemd1",
++ "org.freedesktop.systemd1.Manager",
++ "GetUnitFileState");
++ if (!m) {
++ log_error("Out of memory");
++ r = -ENOMEM;
++ goto finish;
++ }
+
+- if (!dbus_message_append_args(m,
+- DBUS_TYPE_STRING, &name,
+- DBUS_TYPE_INVALID)) {
+- log_error("Could not append arguments to message.");
+- r = -ENOMEM;
+- goto finish;
+- }
++ if (!dbus_message_append_args(m,
++ DBUS_TYPE_STRING, i,
++ DBUS_TYPE_INVALID)) {
++ log_error("Could not append arguments to message.");
++ r = -ENOMEM;
++ goto finish;
++ }
+
+- reply = dbus_connection_send_with_reply_and_block(bus, m, -1, &error);
+- if (!reply) {
++ if (reply)
++ dbus_message_unref(reply);
++ reply = dbus_connection_send_with_reply_and_block(bus, m, -1, &error);
++ if (!reply) {
++ if (streq(error.name, "org.freedesktop.DBus.Error.FileNotFound")) {
++ /* This implementation does not exist, try next one */
++ dbus_error_free(&error);
++ continue;
++ }
+
+- if (streq(error.name, "org.freedesktop.DBus.Error.FileNotFound")) {
+- /* NTP is not installed. */
+- tz.use_ntp = false;
+- r = 0;
++ log_error("Failed to issue method call: %s", bus_error_message(&error));
++ r = -EIO;
+ goto finish;
+ }
+
+- log_error("Failed to issue method call: %s", bus_error_message(&error));
+- r = -EIO;
+- goto finish;
+- }
++ if (!dbus_message_get_args(reply, &error,
++ DBUS_TYPE_STRING, &s,
++ DBUS_TYPE_INVALID)) {
++ log_error("Failed to parse reply: %s", bus_error_message(&error));
++ r = -EIO;
++ goto finish;
++ }
+
+- if (!dbus_message_get_args(reply, &error,
+- DBUS_TYPE_STRING, &s,
+- DBUS_TYPE_INVALID)) {
+- log_error("Failed to parse reply: %s", bus_error_message(&error));
+- r = -EIO;
++ tz.use_ntp =
++ streq(s, "enabled") ||
++ streq(s, "enabled-runtime");
++ r = 0;
+ goto finish;
+ }
+
+- tz.use_ntp =
+- streq(s, "enabled") ||
+- streq(s, "enabled-runtime");
++ /* NTP is not installed. */
++ tz.use_ntp = 0;
+ r = 0;
+
+ finish:
+@@ -368,6 +418,8 @@ finish:
+ if (reply)
+ dbus_message_unref(reply);
+
++ strv_free(l);
++
+ dbus_error_free(&error);
+
+ return r;
+@@ -375,40 +427,60 @@ finish:
+
+ static int start_ntp(DBusConnection *bus, DBusError *error) {
+ DBusMessage *m = NULL, *reply = NULL;
+- const char *name = "systemd-timedated-ntp.target", *mode = "replace";
++ const char *mode = "replace";
++ char **i, **l;
+ int r;
+
+ assert(bus);
+ assert(error);
+
+- m = dbus_message_new_method_call(
+- "org.freedesktop.systemd1",
+- "/org/freedesktop/systemd1",
+- "org.freedesktop.systemd1.Manager",
+- tz.use_ntp ? "StartUnit" : "StopUnit");
+- if (!m) {
+- log_error("Could not allocate message.");
+- r = -ENOMEM;
+- goto finish;
+- }
++ l = get_ntp_services();
++ STRV_FOREACH(i, l) {
++ if (m)
++ dbus_message_unref(m);
++ m = dbus_message_new_method_call(
++ "org.freedesktop.systemd1",
++ "/org/freedesktop/systemd1",
++ "org.freedesktop.systemd1.Manager",
++ tz.use_ntp ? "StartUnit" : "StopUnit");
++ if (!m) {
++ log_error("Could not allocate message.");
++ r = -ENOMEM;
++ goto finish;
++ }
+
+- if (!dbus_message_append_args(m,
+- DBUS_TYPE_STRING, &name,
+- DBUS_TYPE_STRING, &mode,
+- DBUS_TYPE_INVALID)) {
+- log_error("Could not append arguments to message.");
+- r = -ENOMEM;
+- goto finish;
+- }
++ if (!dbus_message_append_args(m,
++ DBUS_TYPE_STRING, i,
++ DBUS_TYPE_STRING, &mode,
++ DBUS_TYPE_INVALID)) {
++ log_error("Could not append arguments to message.");
++ r = -ENOMEM;
++ goto finish;
++ }
++
++ if (reply)
++ dbus_message_unref(reply);
++ reply = dbus_connection_send_with_reply_and_block(bus, m, -1, error);
++ if (!reply) {
++ if (streq(error->name, "org.freedesktop.DBus.Error.FileNotFound") ||
++ streq(error->name, "org.freedesktop.systemd1.LoadFailed") ||
++ streq(error->name, "org.freedesktop.systemd1.NoSuchUnit")) {
++ /* This implementation does not exist, try next one */
++ dbus_error_free(error);
++ continue;
++ }
++
++ log_error("Failed to issue method call: %s", bus_error_message(error));
++ r = -EIO;
++ goto finish;
++ }
+
+- reply = dbus_connection_send_with_reply_and_block(bus, m, -1, error);
+- if (!reply) {
+- log_error("Failed to issue method call: %s", bus_error_message(error));
+- r = -EIO;
++ r = 0;
+ goto finish;
+ }
+
+- r = 0;
++ /* No implementaiton available... */
++ r = -ENOENT;
+
+ finish:
+ if (m)
+@@ -417,82 +489,105 @@ finish:
+ if (reply)
+ dbus_message_unref(reply);
+
++ strv_free(l);
++
+ return r;
+ }
+
+ static int enable_ntp(DBusConnection *bus, DBusError *error) {
+ DBusMessage *m = NULL, *reply = NULL;
+- const char * const names[] = { "systemd-timedated-ntp.target", NULL };
+ int r;
+ DBusMessageIter iter;
+ dbus_bool_t f = FALSE, t = TRUE;
++ char **i, **l;
+
+ assert(bus);
+ assert(error);
+
+- m = dbus_message_new_method_call(
+- "org.freedesktop.systemd1",
+- "/org/freedesktop/systemd1",
+- "org.freedesktop.systemd1.Manager",
+- tz.use_ntp ? "EnableUnitFiles" : "DisableUnitFiles");
++ l = get_ntp_services();
++ STRV_FOREACH(i, l) {
++ char* k[2];
++
++ if (m)
++ dbus_message_unref(m);
++ m = dbus_message_new_method_call(
++ "org.freedesktop.systemd1",
++ "/org/freedesktop/systemd1",
++ "org.freedesktop.systemd1.Manager",
++ tz.use_ntp ? "EnableUnitFiles" : "DisableUnitFiles");
++ if (!m) {
++ log_error("Could not allocate message.");
++ r = -ENOMEM;
++ goto finish;
++ }
+
+- if (!m) {
+- log_error("Could not allocate message.");
+- r = -ENOMEM;
+- goto finish;
+- }
++ dbus_message_iter_init_append(m, &iter);
+
+- dbus_message_iter_init_append(m, &iter);
++ k[0] = *i;
++ k[1] = NULL;
+
+- r = bus_append_strv_iter(&iter, (char**) names);
+- if (r < 0) {
+- log_error("Failed to append unit files.");
+- goto finish;
+- }
+- /* send runtime bool */
+- if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_BOOLEAN, &f)) {
+- log_error("Failed to append runtime boolean.");
+- r = -ENOMEM;
+- goto finish;
+- }
++ r = bus_append_strv_iter(&iter, k);
++ if (r < 0) {
++ log_error("Failed to append unit files.");
++ goto finish;
++ }
+
+- if (tz.use_ntp) {
+- /* send force bool */
+- if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_BOOLEAN, &t)) {
+- log_error("Failed to append force boolean.");
++ /* send runtime bool */
++ if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_BOOLEAN, &f)) {
++ log_error("Failed to append runtime boolean.");
+ r = -ENOMEM;
+ goto finish;
+ }
+- }
+
+- reply = dbus_connection_send_with_reply_and_block(bus, m, -1, error);
+- if (!reply) {
+- log_error("Failed to issue method call: %s", bus_error_message(error));
+- r = -EIO;
+- goto finish;
+- }
++ if (tz.use_ntp) {
++ /* send force bool */
++ if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_BOOLEAN, &t)) {
++ log_error("Failed to append force boolean.");
++ r = -ENOMEM;
++ goto finish;
++ }
++ }
+
+- dbus_message_unref(m);
+- m = dbus_message_new_method_call(
+- "org.freedesktop.systemd1",
+- "/org/freedesktop/systemd1",
+- "org.freedesktop.systemd1.Manager",
+- "Reload");
+- if (!m) {
+- log_error("Could not allocate message.");
+- r = -ENOMEM;
+- goto finish;
+- }
++ if (reply)
++ dbus_message_unref(reply);
++ reply = dbus_connection_send_with_reply_and_block(bus, m, -1, error);
++ if (!reply) {
++ if (streq(error->name, "org.freedesktop.DBus.Error.FileNotFound")) {
++ /* This implementation does not exist, try next one */
++ dbus_error_free(error);
++ continue;
++ }
+
+- dbus_message_unref(reply);
+- reply = dbus_connection_send_with_reply_and_block(bus, m, -1, error);
+- if (!reply) {
+- log_error("Failed to issue method call: %s", bus_error_message(error));
+- r = -EIO;
++ log_error("Failed to issue method call: %s", bus_error_message(error));
++ r = -EIO;
++ goto finish;
++ }
++
++ dbus_message_unref(m);
++ m = dbus_message_new_method_call(
++ "org.freedesktop.systemd1",
++ "/org/freedesktop/systemd1",
++ "org.freedesktop.systemd1.Manager",
++ "Reload");
++ if (!m) {
++ log_error("Could not allocate message.");
++ r = -ENOMEM;
++ goto finish;
++ }
++
++ dbus_message_unref(reply);
++ reply = dbus_connection_send_with_reply_and_block(bus, m, -1, error);
++ if (!reply) {
++ log_error("Failed to issue method call: %s", bus_error_message(error));
++ r = -EIO;
++ goto finish;
++ }
++
++ r = 0;
+ goto finish;
+ }
+
+- r = 0;
++ r = -ENOENT;
+
+ finish:
+ if (m)
+@@ -501,6 +596,8 @@ finish:
+ if (reply)
+ dbus_message_unref(reply);
+
++ strv_free(l);
++
+ return r;
+ }
+
+diff --git a/units/systemd-timedated-ntp.target b/units/systemd-timedated-ntp.target
+deleted file mode 100644
+index 0837004..0000000
+--- a/units/systemd-timedated-ntp.target
++++ /dev/null
+@@ -1,18 +0,0 @@
+-# This file is part of systemd.
+-#
+-# systemd is free software; you can redistribute it and/or modify it
+-# under the terms of the GNU Lesser General Public License as published by
+-# the Free Software Foundation; either version 2.1 of the License, or
+-# (at your option) any later version.
+-
+-# This target is enabled/disabled via the timedated mechanism when the
+-# user asks for it via the UI. NTP implementations should hook
+-# themselves into this target via .wants/ symlinks, and then add
+-# BindTo= on this target so that they are stopped when it goes away.
+-
+-[Unit]
+-Description=Network Time Protocol
+-Documentation=http://www.freedesktop.org/wiki/Software/systemd/timedated
+-
+-[Install]
+-WantedBy=multi-user.target
diff --git a/0449-timedate-fix-ntp-units-comment.patch b/0449-timedate-fix-ntp-units-comment.patch
new file mode 100644
index 0000000..4e01c2d
--- /dev/null
+++ b/0449-timedate-fix-ntp-units-comment.patch
@@ -0,0 +1,20 @@
+From ab8a1ee403831f40b815802a0062439d6cb90557 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Mon, 2 Jul 2012 11:43:02 +0200
+Subject: [PATCH] timedate: fix ntp-units comment (cherry picked from commit
+ 2b2e9df87641f95cb5e3f0d1b69f6e71e53c6f94)
+
+---
+ src/timedate/ntp-units | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/timedate/ntp-units b/src/timedate/ntp-units
+index 6fdef44..2a46f66 100644
+--- a/src/timedate/ntp-units
++++ b/src/timedate/ntp-units
+@@ -1,4 +1,4 @@
+-# NTP ervice implementations, in order for preference
++# NTP service implementations, in order of preference
+
+ chronyd.service
+ ntpd.service
diff --git a/0450-units-rename-systemd-debug-shell.service-to-debug-sh.patch b/0450-units-rename-systemd-debug-shell.service-to-debug-sh.patch
new file mode 100644
index 0000000..fefe6e9
--- /dev/null
+++ b/0450-units-rename-systemd-debug-shell.service-to-debug-sh.patch
@@ -0,0 +1,57 @@
+From b814268a88e42b29612b1573cc03d7d30ce885ed Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Mon, 2 Jul 2012 14:33:04 +0200
+Subject: [PATCH] units: rename systemd-debug-shell.service to
+ debug-shell.service
+
+The systemd- prefix for services should be reserved only for services
+that invoke our own code rather than generic, external code.
+(cherry picked from commit d1f9edafe7b832c507931640f32069d001916b0e)
+
+Conflicts:
+ Makefile.am
+ NEWS
+ units/.gitignore
+---
+ Makefile.am | 4 ++--
+ po/POTFILES.skip | 2 +-
+ units/{systemd-debug-shell.service.in => debug-shell.service.in} | 0
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+ rename units/{systemd-debug-shell.service.in => debug-shell.service.in} (100%)
+
+diff --git a/Makefile.am b/Makefile.am
+index 329a2d9..46cfe80 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -322,7 +322,7 @@ nodist_systemunit_DATA = \
+ units/rescue.service \
+ units/suspend.service \
+ units/user at .service \
+- units/systemd-debug-shell.service
++ units/debug-shell.service
+
+ dist_userunit_DATA = \
+ units/user/default.target \
+@@ -357,7 +357,7 @@ EXTRA_DIST += \
+ units/fsck at .service.in \
+ units/fsck-root.service.in \
+ units/user at .service.in \
+- units/systemd-debug-shell.service.in \
++ units/debug-shell.service.in \
+ units/hibernate.service.in \
+ units/suspend.service.in \
+ introspect.awk \
+diff --git a/po/POTFILES.skip b/po/POTFILES.skip
+index 40584d4..52a9be8 100644
+--- a/po/POTFILES.skip
++++ b/po/POTFILES.skip
+@@ -17,4 +17,4 @@ src/core/org.freedesktop.systemd1.policy.in.in
+ src/timedate/timedated.c
+ units/systemd-readahead-done.service.in
+ units/user at .service.in
+-units/systemd-debug-shell.service.in
++units/debug-shell.service.in
+diff --git a/units/systemd-debug-shell.service.in b/units/debug-shell.service.in
+similarity index 100%
+rename from units/systemd-debug-shell.service.in
+rename to units/debug-shell.service.in
diff --git a/0451-modules-load-rename-kernel-command-line-option-to-rd.patch b/0451-modules-load-rename-kernel-command-line-option-to-rd.patch
new file mode 100644
index 0000000..ccdaf44
--- /dev/null
+++ b/0451-modules-load-rename-kernel-command-line-option-to-rd.patch
@@ -0,0 +1,33 @@
+From 7414c148f2d2daa8940de53f7975aace596f59b9 Mon Sep 17 00:00:00 2001
+From: Kay Sievers <kay at vrfy.org>
+Date: Mon, 2 Jul 2012 15:05:26 +0200
+Subject: [PATCH] modules load: rename kernel command line option to
+ (rd.)modules-load= (cherry picked from commit
+ 91ac74250149a29122b2291c5393dec4592430d4)
+
+Conflicts:
+ NEWS
+---
+ src/modules-load/modules-load.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/modules-load/modules-load.c b/src/modules-load/modules-load.c
+index 057aa6e..5c91a92 100644
+--- a/src/modules-load/modules-load.c
++++ b/src/modules-load/modules-load.c
+@@ -90,13 +90,13 @@ static int parse_proc_cmdline(void) {
+ goto finish;
+ }
+
+- if (startswith(word, "driver=")) {
++ if (startswith(word, "modules-load=")) {
+
+ r = add_modules(word + 7);
+ if (r < 0)
+ goto finish;
+
+- } else if (startswith(word, "rd.driver=")) {
++ } else if (startswith(word, "rd.modules-load=")) {
+
+ if (in_initrd()) {
+ r = add_modules(word + 10);
diff --git a/0452-timedated-replace-ntp-units-file-with-an-ntp-units.d.patch b/0452-timedated-replace-ntp-units-file-with-an-ntp-units.d.patch
new file mode 100644
index 0000000..c8e1ae2
--- /dev/null
+++ b/0452-timedated-replace-ntp-units-file-with-an-ntp-units.d.patch
@@ -0,0 +1,141 @@
+From 7ec9c50ae6e3329926dcae48c661910043701f5a Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Tue, 3 Jul 2012 02:00:05 +0200
+Subject: [PATCH] timedated: replace ntp-units file with an ntp-units.d
+ drop-in dir
+
+To be considered by timedated for NTP a package simply has to drop in
+/usr/lib/systemd/ntp-units.d/foobar.list and write one or more unit
+names into it. The first one listed is the one that is enabled.
+(cherry picked from commit b32d167503b0d98f6b612fda768f92f3aad0ad0c)
+
+Conflicts:
+ Makefile.am
+---
+ Makefile.am | 4 ----
+ src/timedate/ntp-units | 4 ----
+ src/timedate/timedated.c | 59 ++++++++++++++++++++++++++++++------------------
+ 3 files changed, 37 insertions(+), 30 deletions(-)
+ delete mode 100644 src/timedate/ntp-units
+
+diff --git a/Makefile.am b/Makefile.am
+index 46cfe80..d051b39 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -114,7 +114,6 @@ AM_CPPFLAGS = \
+ -DSYSTEM_SHUTDOWN_PATH=\"$(systemshutdowndir)\" \
+ -DSYSTEM_SLEEP_PATH=\"$(systemsleepdir)\" \
+ -DSYSTEMD_KBD_MODEL_MAP=\"$(pkgdatadir)/kbd-model-map\" \
+- -DSYSTEMD_NTP_UNITS=\"$(pkgdatadir)/ntp-units\" \
+ -DX_SERVER=\"$(bindir)/X\" \
+ -DPOLKIT_AGENT_BINARY_PATH=\"$(bindir)/pkttyagent\" \
+ -I $(top_srcdir)/src \
+@@ -2062,9 +2061,6 @@ timedated-install-data-hook:
+ INSTALL_DATA_HOOKS += \
+ timedated-install-data-hook
+
+-dist_pkgdata_DATA += \
+- src/timedate/ntp-units
+-
+ EXTRA_DIST += \
+ units/systemd-timedated.service.in
+ endif
+diff --git a/src/timedate/ntp-units b/src/timedate/ntp-units
+deleted file mode 100644
+index 2a46f66..0000000
+--- a/src/timedate/ntp-units
++++ /dev/null
+@@ -1,4 +0,0 @@
+-# NTP service implementations, in order of preference
+-
+-chronyd.service
+-ntpd.service
+diff --git a/src/timedate/timedated.c b/src/timedate/timedated.c
+index 8be45d3..1dcf509 100644
+--- a/src/timedate/timedated.c
++++ b/src/timedate/timedated.c
+@@ -31,6 +31,7 @@
+ #include "polkit.h"
+ #include "def.h"
+ #include "hwclock.h"
++#include "conf-files.h"
+
+ #define NULL_ADJTIME_UTC "0.0 0 0\n0\nUTC\n"
+ #define NULL_ADJTIME_LOCAL "0.0 0 0\n0\nLOCAL\n"
+@@ -304,40 +305,54 @@ static int write_data_local_rtc(void) {
+ }
+
+ static char** get_ntp_services(void) {
+- char **r = NULL;
+- FILE *f;
+-
+- f = fopen(SYSTEMD_NTP_UNITS, "re");
+- if (!f)
++ char **r = NULL, **files, **i;
++ int k;
++
++ k = conf_files_list(&files, ".list",
++ "/etc/systemd/ntp-units.d",
++ "/run/systemd/ntp-units.d",
++ "/usr/local/lib/systemd/ntp-units.d",
++ "/usr/lib/systemd/ntp-units.d",
++ NULL);
++ if (k < 0)
+ return NULL;
+
+- for (;;) {
+- char line[PATH_MAX], *l, **q;
++ STRV_FOREACH(i, files) {
++ FILE *f;
+
+- if (!fgets(line, sizeof(line), f)) {
++ f = fopen(*i, "re");
++ if (!f)
++ continue;
+
+- if (ferror(f))
+- log_error("Failed to read NTP units file: %m");
++ for (;;) {
++ char line[PATH_MAX], *l, **q;
+
+- break;
+- }
++ if (!fgets(line, sizeof(line), f)) {
+
+- l = strstrip(line);
+- if (l[0] == 0 || l[0] == '#')
+- continue;
++ if (ferror(f))
++ log_error("Failed to read NTP units file: %m");
+
++ break;
++ }
+
+- q = strv_append(r, l);
+- if (!q) {
+- log_error("Out of memory");
+- break;
++ l = strstrip(line);
++ if (l[0] == 0 || l[0] == '#')
++ continue;
++
++ q = strv_append(r, l);
++ if (!q) {
++ log_error("Out of memory");
++ break;
++ }
++
++ strv_free(r);
++ r = q;
+ }
+
+- strv_free(r);
+- r = q;
++ fclose(f);
+ }
+
+- fclose(f);
++ strv_free(files);
+
+ return r;
+ }
diff --git a/0453-journal-fix-iteration-through-journal-if-one-file-is.patch b/0453-journal-fix-iteration-through-journal-if-one-file-is.patch
new file mode 100644
index 0000000..573e1c8
--- /dev/null
+++ b/0453-journal-fix-iteration-through-journal-if-one-file-is.patch
@@ -0,0 +1,31 @@
+From c6baa21ca17e380ff64a2f62504cb3b6ca8679b5 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Tue, 3 Jul 2012 11:58:16 +0200
+Subject: [PATCH] journal: fix iteration through journal if one file is
+ corrupt (cherry picked from commit
+ e590af2666d2a958d355f9957e77ec967bb16011)
+
+Conflicts:
+ TODO
+---
+ src/journal/sd-journal.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c
+index a91e94c..5f701db 100644
+--- a/src/journal/sd-journal.c
++++ b/src/journal/sd-journal.c
+@@ -670,9 +670,10 @@ static int real_journal_next(sd_journal *j, direction_t direction) {
+ bool found;
+
+ r = next_beyond_location(j, f, direction, &o, &p);
+- if (r < 0)
+- return r;
+- else if (r == 0)
++ if (r < 0) {
++ log_debug("Can't iterate through %s, ignoring: %s", f->path, strerror(-r));
++ continue;
++ } else if (r == 0)
+ continue;
+
+ if (!new_current)
diff --git a/0454-journald-handle-proc-kmsg-reads-returning-0-more-nic.patch b/0454-journald-handle-proc-kmsg-reads-returning-0-more-nic.patch
new file mode 100644
index 0000000..fe82eab
--- /dev/null
+++ b/0454-journald-handle-proc-kmsg-reads-returning-0-more-nic.patch
@@ -0,0 +1,26 @@
+From 7e7df514a0883ee0f1e6dcbf5d4d8c98c050ff9d Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Tue, 3 Jul 2012 12:23:33 +0200
+Subject: [PATCH] journald: handle /proc/kmsg reads returning 0 more nicely
+ (cherry picked from commit
+ 4c2ecfafd746411b07b8de10b91f5fd26fdd9cb3)
+
+---
+ src/journal/journald.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/journal/journald.c b/src/journal/journald.c
+index 3fca09f..6d8b4b7 100644
+--- a/src/journal/journald.c
++++ b/src/journal/journald.c
+@@ -2104,6 +2104,10 @@ static int server_read_proc_kmsg(Server *s) {
+ assert(s->proc_kmsg_fd >= 0);
+
+ l = read(s->proc_kmsg_fd, s->proc_kmsg_buffer + s->proc_kmsg_length, sizeof(s->proc_kmsg_buffer) - 1 - s->proc_kmsg_length);
++ if (l == 0) /* the kernel is stupid and in some race
++ * conditions returns 0 in the middle of the
++ * stream. */
++ return 0;
+ if (l < 0) {
+
+ if (errno == EAGAIN || errno == EINTR)
diff --git a/0455-timedate-uniq-ify-ntp-units-list.patch b/0455-timedate-uniq-ify-ntp-units-list.patch
new file mode 100644
index 0000000..981cfed
--- /dev/null
+++ b/0455-timedate-uniq-ify-ntp-units-list.patch
@@ -0,0 +1,25 @@
+From 4e9e1d80dda7c6a786d576de515327edba5942b9 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Tue, 3 Jul 2012 15:37:04 +0200
+Subject: [PATCH] timedate: uniq'ify ntp units list (cherry picked from commit
+ f6c13ce47ebee287f8b6a965ca5ca022a9f26e2c)
+
+Conflicts:
+ NEWS
+---
+ src/timedate/timedated.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/timedate/timedated.c b/src/timedate/timedated.c
+index 1dcf509..e391e03 100644
+--- a/src/timedate/timedated.c
++++ b/src/timedate/timedated.c
+@@ -354,7 +354,7 @@ static char** get_ntp_services(void) {
+
+ strv_free(files);
+
+- return r;
++ return strv_uniq(r);
+ }
+
+ static int read_ntp(DBusConnection *bus) {
diff --git a/0456-load-fragment-a-few-modernizations.patch b/0456-load-fragment-a-few-modernizations.patch
new file mode 100644
index 0000000..8719aaa
--- /dev/null
+++ b/0456-load-fragment-a-few-modernizations.patch
@@ -0,0 +1,252 @@
+From 6dbfad1789b3f9745fe782e122fffd06aff7d763 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Tue, 3 Jul 2012 16:09:36 +0200
+Subject: [PATCH] load-fragment: a few modernizations (cherry picked from
+ commit 9946996cda11a18b44d82344676e5a0e96339408)
+
+Conflicts:
+ TODO
+---
+ src/core/load-fragment.c | 51 +++++++++++++++++++++++++++++-------------------
+ src/shared/hashmap.c | 15 +++++++++-----
+ src/shared/hashmap.h | 2 ++
+ src/shared/set.c | 4 ++++
+ src/shared/set.h | 2 ++
+ 5 files changed, 49 insertions(+), 25 deletions(-)
+
+diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
+index 94d8a5b..2003e1d 100644
+--- a/src/core/load-fragment.c
++++ b/src/core/load-fragment.c
+@@ -2090,21 +2090,24 @@ static int open_follow(char **filename, FILE **_f, Set *names, char **_final) {
+ }
+
+ /* Try to open the file name, but don't if its a symlink */
+- if ((fd = open(*filename, O_RDONLY|O_CLOEXEC|O_NOCTTY|O_NOFOLLOW)) >= 0)
++ fd = open(*filename, O_RDONLY|O_CLOEXEC|O_NOCTTY|O_NOFOLLOW);
++ if (fd >= 0)
+ break;
+
+ if (errno != ELOOP)
+ return -errno;
+
+ /* Hmm, so this is a symlink. Let's read the name, and follow it manually */
+- if ((r = readlink_and_make_absolute(*filename, &target)) < 0)
++ r = readlink_and_make_absolute(*filename, &target);
++ if (r < 0)
+ return r;
+
+ free(*filename);
+ *filename = target;
+ }
+
+- if (!(f = fdopen(fd, "re"))) {
++ f = fdopen(fd, "re");
++ if (!f) {
+ r = -errno;
+ close_nointr_nofail(fd);
+ return r;
+@@ -2128,7 +2131,8 @@ static int merge_by_names(Unit **u, Set *names, const char *id) {
+
+ /* First try to merge in the other name into our
+ * unit */
+- if ((r = unit_merge_by_name(*u, k)) < 0) {
++ r = unit_merge_by_name(*u, k);
++ if (r < 0) {
+ Unit *other;
+
+ /* Hmm, we couldn't merge the other unit into
+@@ -2138,11 +2142,13 @@ static int merge_by_names(Unit **u, Set *names, const char *id) {
+ other = manager_get_unit((*u)->manager, k);
+ free(k);
+
+- if (other)
+- if ((r = unit_merge(other, *u)) >= 0) {
++ if (other) {
++ r = unit_merge(other, *u);
++ if (r >= 0) {
+ *u = other;
+ return merge_by_names(u, names, NULL);
+ }
++ }
+
+ return r;
+ }
+@@ -2173,12 +2179,14 @@ static int load_from_path(Unit *u, const char *path) {
+
+ if (path_is_absolute(path)) {
+
+- if (!(filename = strdup(path))) {
++ filename = strdup(path);
++ if (!filename) {
+ r = -ENOMEM;
+ goto finish;
+ }
+
+- if ((r = open_follow(&filename, &f, symlink_names, &id)) < 0) {
++ r = open_follow(&filename, &f, symlink_names, &id);
++ if (r < 0) {
+ free(filename);
+ filename = NULL;
+
+@@ -2194,7 +2202,8 @@ static int load_from_path(Unit *u, const char *path) {
+ /* Instead of opening the path right away, we manually
+ * follow all symlinks and add their name to our unit
+ * name set while doing so */
+- if (!(filename = path_make_absolute(path, *p))) {
++ filename = path_make_absolute(path, *p);
++ if (!filename) {
+ r = -ENOMEM;
+ goto finish;
+ }
+@@ -2206,8 +2215,6 @@ static int load_from_path(Unit *u, const char *path) {
+ r = open_follow(&filename, &f, symlink_names, &id);
+
+ if (r < 0) {
+- char *sn;
+-
+ free(filename);
+ filename = NULL;
+
+@@ -2215,9 +2222,7 @@ static int load_from_path(Unit *u, const char *path) {
+ goto finish;
+
+ /* Empty the symlink names for the next run */
+- while ((sn = set_steal_first(symlink_names)))
+- free(sn);
+-
++ set_clear_free(symlink_names);
+ continue;
+ }
+
+@@ -2232,7 +2237,8 @@ static int load_from_path(Unit *u, const char *path) {
+ }
+
+ merged = u;
+- if ((r = merge_by_names(&merged, symlink_names, id)) < 0)
++ r = merge_by_names(&merged, symlink_names, id);
++ if (r < 0)
+ goto finish;
+
+ if (merged != u) {
+@@ -2288,7 +2294,8 @@ int unit_load_fragment(Unit *u) {
+ /* First, try to find the unit under its id. We always look
+ * for unit files in the default directories, to make it easy
+ * to override things by placing things in /etc/systemd/system */
+- if ((r = load_from_path(u, u->id)) < 0)
++ r = load_from_path(u, u->id);
++ if (r < 0)
+ return r;
+
+ /* Try to find an alias we can load this with */
+@@ -2298,7 +2305,8 @@ int unit_load_fragment(Unit *u) {
+ if (t == u->id)
+ continue;
+
+- if ((r = load_from_path(u, t)) < 0)
++ r = load_from_path(u, t);
++ if (r < 0)
+ return r;
+
+ if (u->load_state != UNIT_STUB)
+@@ -2308,7 +2316,8 @@ int unit_load_fragment(Unit *u) {
+ /* And now, try looking for it under the suggested (originally linked) path */
+ if (u->load_state == UNIT_STUB && u->fragment_path) {
+
+- if ((r = load_from_path(u, u->fragment_path)) < 0)
++ r = load_from_path(u, u->fragment_path);
++ if (r < 0)
+ return r;
+
+ if (u->load_state == UNIT_STUB) {
+@@ -2324,7 +2333,8 @@ int unit_load_fragment(Unit *u) {
+ if (u->load_state == UNIT_STUB && u->instance) {
+ char *k;
+
+- if (!(k = unit_name_template(u->id)))
++ k = unit_name_template(u->id);
++ if (!k)
+ return -ENOMEM;
+
+ r = load_from_path(u, k);
+@@ -2339,7 +2349,8 @@ int unit_load_fragment(Unit *u) {
+ if (t == u->id)
+ continue;
+
+- if (!(k = unit_name_template(t)))
++ k = unit_name_template(t);
++ if (!k)
+ return -ENOMEM;
+
+ r = load_from_path(u, k);
+diff --git a/src/shared/hashmap.c b/src/shared/hashmap.c
+index 6928118..c6b6580 100644
+--- a/src/shared/hashmap.c
++++ b/src/shared/hashmap.c
+@@ -277,11 +277,7 @@ void hashmap_free(Hashmap*h) {
+ }
+
+ void hashmap_free_free(Hashmap *h) {
+- void *p;
+-
+- while ((p = hashmap_steal_first(h)))
+- free(p);
+-
++ hashmap_clear_free(h);
+ hashmap_free(h);
+ }
+
+@@ -293,6 +289,15 @@ void hashmap_clear(Hashmap *h) {
+ remove_entry(h, h->iterate_list_head);
+ }
+
++void hashmap_clear_free(Hashmap *h) {
++ void *p;
++
++ assert(h);
++
++ while ((p = hashmap_steal_first(h)))
++ free(p);
++}
++
+ static struct hashmap_entry *hash_scan(Hashmap *h, unsigned hash, const void *key) {
+ struct hashmap_entry *e;
+ assert(h);
+diff --git a/src/shared/hashmap.h b/src/shared/hashmap.h
+index ab4363a..d72e150 100644
+--- a/src/shared/hashmap.h
++++ b/src/shared/hashmap.h
+@@ -71,6 +71,8 @@ void *hashmap_iterate_backwards(Hashmap *h, Iterator *i, const void **key);
+ void *hashmap_iterate_skip(Hashmap *h, const void *key, Iterator *i);
+
+ void hashmap_clear(Hashmap *h);
++void hashmap_clear_free(Hashmap *h);
++
+ void *hashmap_steal_first(Hashmap *h);
+ void *hashmap_steal_first_key(Hashmap *h);
+ void* hashmap_first(Hashmap *h);
+diff --git a/src/shared/set.c b/src/shared/set.c
+index 097b9d3..43c9659 100644
+--- a/src/shared/set.c
++++ b/src/shared/set.c
+@@ -116,3 +116,7 @@ Set* set_copy(Set *s) {
+ void set_clear(Set *s) {
+ hashmap_clear(MAKE_HASHMAP(s));
+ }
++
++void set_clear_free(Set *s) {
++ hashmap_clear_free(MAKE_HASHMAP(s));
++}
+diff --git a/src/shared/set.h b/src/shared/set.h
+index 885780c..706ef55 100644
+--- a/src/shared/set.h
++++ b/src/shared/set.h
+@@ -56,6 +56,8 @@ void *set_iterate_backwards(Set *s, Iterator *i);
+ void *set_iterate_skip(Set *s, void *value, Iterator *i);
+
+ void set_clear(Set *s);
++void set_clear_free(Set *s);
++
+ void *set_steal_first(Set *s);
+ void* set_first(Set *s);
+ void* set_last(Set *s);
diff --git a/0457-hashmap-make-hashmap_clear-work-on-NULL-hashmaps.patch b/0457-hashmap-make-hashmap_clear-work-on-NULL-hashmaps.patch
new file mode 100644
index 0000000..dbd1809
--- /dev/null
+++ b/0457-hashmap-make-hashmap_clear-work-on-NULL-hashmaps.patch
@@ -0,0 +1,35 @@
+From 8dbd5c4b323537f4e463b5dce094329535fa0d4c Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Tue, 3 Jul 2012 16:15:57 +0200
+Subject: [PATCH] hashmap: make hashmap_clear() work on NULL hashmaps (cherry
+ picked from commit
+ 61b1477c8107e9b7143be9acf6bf678fa9d0674d)
+
+---
+ src/shared/hashmap.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/src/shared/hashmap.c b/src/shared/hashmap.c
+index c6b6580..0562211 100644
+--- a/src/shared/hashmap.c
++++ b/src/shared/hashmap.c
+@@ -277,6 +277,9 @@ void hashmap_free(Hashmap*h) {
+ }
+
+ void hashmap_free_free(Hashmap *h) {
++ if (!h)
++ return;
++
+ hashmap_clear_free(h);
+ hashmap_free(h);
+ }
+@@ -292,7 +295,8 @@ void hashmap_clear(Hashmap *h) {
+ void hashmap_clear_free(Hashmap *h) {
+ void *p;
+
+- assert(h);
++ if (!h)
++ return;
+
+ while ((p = hashmap_steal_first(h)))
+ free(p);
diff --git a/0458-mount-setup-don-t-complain-if-we-try-to-fix-the-labe.patch b/0458-mount-setup-don-t-complain-if-we-try-to-fix-the-labe.patch
new file mode 100644
index 0000000..2af4846
--- /dev/null
+++ b/0458-mount-setup-don-t-complain-if-we-try-to-fix-the-labe.patch
@@ -0,0 +1,119 @@
+From 34182f35c1febab018108f82f841d46e409936ee Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Tue, 3 Jul 2012 16:25:50 +0200
+Subject: [PATCH] mount-setup: don't complain if we try to fix the label of a
+ dir beneath a mount but can't due to EROFS (cherry picked
+ from commit c9bc07646100855ff8193e1e62c52b77327e264d)
+
+Conflicts:
+ src/udev/udev-node.c
+---
+ src/core/automount.c | 2 +-
+ src/core/mount-setup.c | 8 ++++----
+ src/shared/label.c | 5 ++++-
+ src/shared/label.h | 2 +-
+ src/tmpfiles/tmpfiles.c | 2 +-
+ 5 files changed, 11 insertions(+), 8 deletions(-)
+
+diff --git a/src/core/automount.c b/src/core/automount.c
+index be4e657..a206960 100644
+--- a/src/core/automount.c
++++ b/src/core/automount.c
+@@ -316,7 +316,7 @@ static int open_dev_autofs(Manager *m) {
+ if (m->dev_autofs_fd >= 0)
+ return m->dev_autofs_fd;
+
+- label_fix("/dev/autofs", false);
++ label_fix("/dev/autofs", false, false);
+
+ if ((m->dev_autofs_fd = open("/dev/autofs", O_CLOEXEC|O_RDONLY)) < 0) {
+ log_error("Failed to open /dev/autofs: %s", strerror(errno));
+diff --git a/src/core/mount-setup.c b/src/core/mount-setup.c
+index 39049de..8c0d7f5 100644
+--- a/src/core/mount-setup.c
++++ b/src/core/mount-setup.c
+@@ -121,7 +121,7 @@ static int mount_one(const MountPoint *p, bool relabel) {
+
+ /* Relabel first, just in case */
+ if (relabel)
+- label_fix(p->where, true);
++ label_fix(p->where, true, true);
+
+ if ((r = path_is_mount_point(p->where, true)) < 0)
+ return r;
+@@ -150,7 +150,7 @@ static int mount_one(const MountPoint *p, bool relabel) {
+
+ /* Relabel again, since we now mounted something fresh here */
+ if (relabel)
+- label_fix(p->where, false);
++ label_fix(p->where, false, false);
+
+ return 1;
+ }
+@@ -347,7 +347,7 @@ static int nftw_cb(
+ if (_unlikely_(ftwbuf->level == 0))
+ return FTW_CONTINUE;
+
+- label_fix(fpath, true);
++ label_fix(fpath, false, false);
+
+ /* /run/initramfs is static data and big, no need to
+ * dynamically relabel its contents at boot... */
+@@ -391,7 +391,7 @@ int mount_setup(bool loaded_policy) {
+
+ /* Explicitly relabel these */
+ NULSTR_FOREACH(j, relabel)
+- label_fix(j, true);
++ label_fix(j, true, false);
+
+ after_relabel = now(CLOCK_MONOTONIC);
+
+diff --git a/src/shared/label.c b/src/shared/label.c
+index 4a828b9..a47df51 100644
+--- a/src/shared/label.c
++++ b/src/shared/label.c
+@@ -99,7 +99,7 @@ int label_init(const char *prefix) {
+ return r;
+ }
+
+-int label_fix(const char *path, bool ignore_enoent) {
++int label_fix(const char *path, bool ignore_enoent, bool ignore_erofs) {
+ int r = 0;
+
+ #ifdef HAVE_SELINUX
+@@ -132,6 +132,9 @@ int label_fix(const char *path, bool ignore_enoent) {
+ if (ignore_enoent && errno == ENOENT)
+ return 0;
+
++ if (ignore_erofs && errno == EROFS)
++ return 0;
++
+ log_full(security_getenforce() == 1 ? LOG_ERR : LOG_DEBUG,
+ "Unable to fix label of %s: %m", path);
+ r = security_getenforce() == 1 ? -errno : 0;
+diff --git a/src/shared/label.h b/src/shared/label.h
+index fcf34d2..b94187e 100644
+--- a/src/shared/label.h
++++ b/src/shared/label.h
+@@ -29,7 +29,7 @@
+ int label_init(const char *prefix);
+ void label_finish(void);
+
+-int label_fix(const char *path, bool ignore_enoent);
++int label_fix(const char *path, bool ignore_enoent, bool ignore_erofs);
+
+ int label_socket_set(const char *label);
+ void label_socket_clear(void);
+diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
+index 23b1ef8..a9a60c7 100644
+--- a/src/tmpfiles/tmpfiles.c
++++ b/src/tmpfiles/tmpfiles.c
+@@ -451,7 +451,7 @@ static int item_set_perms(Item *i, const char *path) {
+ return -errno;
+ }
+
+- return label_fix(path, false);
++ return label_fix(path, false, false);
+ }
+
+ static int recursive_relabel_children(Item *i, const char *path) {
diff --git a/0459-man-explain-StartLimitRate-in-conjunction-with-Resta.patch b/0459-man-explain-StartLimitRate-in-conjunction-with-Resta.patch
new file mode 100644
index 0000000..04078f9
--- /dev/null
+++ b/0459-man-explain-StartLimitRate-in-conjunction-with-Resta.patch
@@ -0,0 +1,34 @@
+From 8ca2fb3d8b15094e267686b4be66fb870eeda83e Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Wed, 4 Jul 2012 00:07:33 +0200
+Subject: [PATCH] man: explain StartLimitRate= in conjunction with Restart= a
+ bit better (cherry picked from commit
+ f1c8f75b38def5b2e21a83b245c5392563fba7ef)
+
+Conflicts:
+ TODO
+---
+ man/systemd.service.xml | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/man/systemd.service.xml b/man/systemd.service.xml
+index dc14113..cca26f4 100644
+--- a/man/systemd.service.xml
++++ b/man/systemd.service.xml
+@@ -787,7 +787,15 @@
+ are allowed (defaults to 5). These
+ configuration options are particularly
+ useful in conjunction with
+- <varname>Restart=</varname>.</para></listitem>
++ <varname>Restart=</varname>. Note that
++ units which are configured for
++ <varname>Restart=</varname> and which
++ reach the start limit are not
++ attempted to be restarted anymore,
++ however they may still be restarted
++ manually at a later point from which
++ point on the restart logic is again
++ activated.</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
diff --git a/0460-man-clarify-that-StartLimitInterval-also-applies-to-.patch b/0460-man-clarify-that-StartLimitInterval-also-applies-to-.patch
new file mode 100644
index 0000000..79709ef
--- /dev/null
+++ b/0460-man-clarify-that-StartLimitInterval-also-applies-to-.patch
@@ -0,0 +1,34 @@
+From 66253cbf5a2a69839172bba080f5a6c90e4fee18 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Wed, 4 Jul 2012 00:12:13 +0200
+Subject: [PATCH] man: clarify that StartLimitInterval= also applies to manual
+ starts (cherry picked from commit
+ 6ffd3337867076067955ec4d5d1a0cde521d9b86)
+
+---
+ man/systemd.service.xml | 12 ++++++++----
+ 1 file changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/man/systemd.service.xml b/man/systemd.service.xml
+index cca26f4..60d8361 100644
+--- a/man/systemd.service.xml
++++ b/man/systemd.service.xml
+@@ -787,10 +787,14 @@
+ are allowed (defaults to 5). These
+ configuration options are particularly
+ useful in conjunction with
+- <varname>Restart=</varname>. Note that
+- units which are configured for
+- <varname>Restart=</varname> and which
+- reach the start limit are not
++ <varname>Restart=</varname>, however
++ apply to all kinds of starts
++ (including manual), not just those
++ triggered by the
++ <varname>Restart=</varname> logic.
++ Note that units which are configured
++ for <varname>Restart=</varname> and
++ which reach the start limit are not
+ attempted to be restarted anymore,
+ however they may still be restarted
+ manually at a later point from which
diff --git a/0461-service-flush-the-start-counter-in-systemctl-reset-f.patch b/0461-service-flush-the-start-counter-in-systemctl-reset-f.patch
new file mode 100644
index 0000000..17cefad
--- /dev/null
+++ b/0461-service-flush-the-start-counter-in-systemctl-reset-f.patch
@@ -0,0 +1,65 @@
+From e98c2da71e9e884a421d3e42a11416a9224c1820 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Wed, 4 Jul 2012 00:23:42 +0200
+Subject: [PATCH] service: flush the start counter in "systemctl reset-failed"
+ (cherry picked from commit
+ 451b34cc1d74960ee0262eef970a6346ec814f31)
+
+---
+ man/systemd.service.xml | 10 +++++++++-
+ src/core/service.c | 2 ++
+ src/shared/ratelimit.h | 7 +++++++
+ 3 files changed, 18 insertions(+), 1 deletion(-)
+
+diff --git a/man/systemd.service.xml b/man/systemd.service.xml
+index 60d8361..0c9b964 100644
+--- a/man/systemd.service.xml
++++ b/man/systemd.service.xml
+@@ -799,7 +799,15 @@
+ however they may still be restarted
+ manually at a later point from which
+ point on the restart logic is again
+- activated.</para></listitem>
++ activated. Note that
++ <command>systemctl
++ reset-failed</command> will cause the
++ restart rate counter for a service to
++ be flushed, which is useful if the
++ administrator wants to manually start
++ a service and the start limit
++ interferes with
++ that.</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+diff --git a/src/core/service.c b/src/core/service.c
+index ef37a5a..534e77e 100644
+--- a/src/core/service.c
++++ b/src/core/service.c
+@@ -3656,6 +3656,8 @@ static void service_reset_failed(Unit *u) {
+
+ s->result = SERVICE_SUCCESS;
+ s->reload_result = SERVICE_SUCCESS;
++
++ RATELIMIT_RESET(s->start_limit);
+ }
+
+ static bool service_need_daemon_reload(Unit *u) {
+diff --git a/src/shared/ratelimit.h b/src/shared/ratelimit.h
+index a6443e7..2c89955 100644
+--- a/src/shared/ratelimit.h
++++ b/src/shared/ratelimit.h
+@@ -48,6 +48,13 @@ typedef struct RateLimit {
+ _r->begin = 0; \
+ } while (false)
+
++#define RATELIMIT_RESET(v) \
++ do { \
++ RateLimit *_r = &(v); \
++ _r->num = 0; \
++ _r->begin = 0; \
++ } while (false)
++
+ bool ratelimit_test(RateLimit *r);
+
+ #endif
diff --git a/0462-man-document-Restart-a-bit-more.patch b/0462-man-document-Restart-a-bit-more.patch
new file mode 100644
index 0000000..0a8ec4b
--- /dev/null
+++ b/0462-man-document-Restart-a-bit-more.patch
@@ -0,0 +1,43 @@
+From b4ca0b30c1bc0d3d02a7b3e6d11cd5eb99b7f20d Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Wed, 4 Jul 2012 00:37:12 +0200
+Subject: [PATCH] man: document Restart= a bit more (cherry picked from commit
+ 5389fedd99dacee6811057c8e49a6cb96ba6a52e)
+
+---
+ man/systemd.service.xml | 18 ++++++++++--------
+ 1 file changed, 10 insertions(+), 8 deletions(-)
+
+diff --git a/man/systemd.service.xml b/man/systemd.service.xml
+index 0c9b964..c615db1 100644
+--- a/man/systemd.service.xml
++++ b/man/systemd.service.xml
+@@ -516,18 +516,20 @@
+ <option>on-failure</option> it will be
+ restarted only when it exited with an
+ exit code not equalling 0, when
+- terminated by a signal, when an
+- operation times out or when the
++ terminated by a signal (including on
++ core dump), when an operation (such as
++ service reload) times out or when the
+ configured watchdog timeout is
+ triggered. If set to
+ <option>on-abort</option> it will be
+ restarted only if it exits due to
+- reception of an uncaught signal. If
+- set to <option>always</option> the
+- service will be restarted regardless
+- whether it exited cleanly or not,
+- got terminated abnormally by a
+- signal or hit a timeout.</para></listitem>
++ reception of an uncaught signal
++ (including on core dump). If set to
++ <option>always</option> the service
++ will be restarted regardless whether
++ it exited cleanly or not, got
++ terminated abnormally by a signal or
++ hit a timeout.</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
diff --git a/0463-man-update-man-pages-to-reflect-the-driver-to-load-m.patch b/0463-man-update-man-pages-to-reflect-the-driver-to-load-m.patch
new file mode 100644
index 0000000..c6d9a22
--- /dev/null
+++ b/0463-man-update-man-pages-to-reflect-the-driver-to-load-m.patch
@@ -0,0 +1,49 @@
+From f343eb4c8d56e0813397f55b07ad63929429de8b Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Wed, 4 Jul 2012 01:12:25 +0200
+Subject: [PATCH] man: update man pages to reflect the driver= to
+ load-modules= rename (cherry picked from commit
+ 627e4bb29fa7223ae8ea97a46a9581627eb24ee6)
+
+Conflicts:
+ man/kernel-command-line.xml
+---
+ man/systemd-modules-load.service.xml | 25 +++++++++++++++++++++++++
+ 1 file changed, 25 insertions(+)
+
+diff --git a/man/systemd-modules-load.service.xml b/man/systemd-modules-load.service.xml
+index 16c6a65..e5f10a7 100644
+--- a/man/systemd-modules-load.service.xml
++++ b/man/systemd-modules-load.service.xml
+@@ -62,6 +62,31 @@
+ <citerefentry><refentrytitle>modules-load.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>
+ for information about the configuration of this
+ service.</para>
++
++ </refsect1>
++
++ <refsect1>
++ <title>Kernel Command Line</title>
++
++ <para><filename>systemd-modules-load.service</filename> understands
++ the following kernel command line parameters:</para>
++
++ <variablelist>
++
++ <varlistentry>
++ <term><varname>modules-load=</varname></term>
++ <term><varname>rd.modules-load=</varname></term>
++
++ <listitem><para>Takes a comma
++ separated list of kernel modules to
++ statically load during early boot. The
++ option prefixed with
++ <literal>rd.</literal> is read by the
++ initial RAM disk
++ only.</para></listitem>
++ </varlistentry>
++
++ </variablelist>
+ </refsect1>
+
+ <refsect1>
diff --git a/0464-paranoia-refuse-rm_rf.patch b/0464-paranoia-refuse-rm_rf.patch
new file mode 100644
index 0000000..d753679
--- /dev/null
+++ b/0464-paranoia-refuse-rm_rf.patch
@@ -0,0 +1,47 @@
+From 1a84d7217adfb41463f746a7e7d3af825fe66a15 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Mon, 9 Jul 2012 17:30:22 +0200
+Subject: [PATCH] paranoia: refuse rm_rf("/") (cherry picked from commit
+ 461b1822321d6be0d7fd8be29bf3b4993ebd1b85)
+
+Conflicts:
+ TODO
+---
+ src/journal/journald.c | 2 +-
+ src/shared/util.c | 3 +++
+ 2 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/journal/journald.c b/src/journal/journald.c
+index 6d8b4b7..3b50cd8 100644
+--- a/src/journal/journald.c
++++ b/src/journal/journald.c
+@@ -2018,7 +2018,6 @@ static int system_journal_open(Server *s) {
+ }
+
+ static int server_flush_to_var(Server *s) {
+- char path[] = "/run/log/journal/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
+ Object *o = NULL;
+ int r;
+ sd_id128_t machine;
+@@ -2091,6 +2090,7 @@ finish:
+ s->runtime_journal = NULL;
+
+ if (r >= 0) {
++ char path[] = "/run/log/journal/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
+ sd_id128_to_string(machine, path + 17);
+ rm_rf(path, false, true, false);
+ }
+diff --git a/src/shared/util.c b/src/shared/util.c
+index ae5456e..1b2fa15 100644
+--- a/src/shared/util.c
++++ b/src/shared/util.c
+@@ -3339,6 +3339,9 @@ int rm_rf(const char *path, bool only_dirs, bool delete_root, bool honour_sticky
+
+ assert(path);
+
++ /* Be paranoid */
++ assert(!streq(path, "/"));
++
+ fd = open(path, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC|O_NOFOLLOW|O_NOATIME);
+ if (fd < 0) {
+
diff --git a/0465-unit-Move-UnitType-definitions-from-core-unit.c-to-s.patch b/0465-unit-Move-UnitType-definitions-from-core-unit.c-to-s.patch
new file mode 100644
index 0000000..5d8c978
--- /dev/null
+++ b/0465-unit-Move-UnitType-definitions-from-core-unit.c-to-s.patch
@@ -0,0 +1,99 @@
+From 1b1e7326a8fbda839223328452ec06569c06d444 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek at in.waw.pl>
+Date: Wed, 6 Jun 2012 16:56:18 +0200
+Subject: [PATCH] unit: Move UnitType definitions from core/unit.c to
+ shared/unit-name.c
+
+This makes it possible to use them from systemctl without linking
+against the core. A string->enum lookup table is added.
+(cherry picked from commit 0a9f8ed00c8f323d5bf24a9a11149a9342c0e1aa)
+---
+ src/core/unit.h | 16 +---------------
+ src/shared/unit-name.c | 15 +++++++++++++++
+ src/shared/unit-name.h | 20 ++++++++++++++++++++
+ 3 files changed, 36 insertions(+), 15 deletions(-)
+
+diff --git a/src/core/unit.h b/src/core/unit.h
+index e198d07..c994107 100644
+--- a/src/core/unit.h
++++ b/src/core/unit.h
+@@ -41,21 +41,7 @@ typedef struct UnitStatusMessageFormats UnitStatusMessageFormats;
+ #include "execute.h"
+ #include "condition.h"
+ #include "install.h"
+-
+-enum UnitType {
+- UNIT_SERVICE = 0,
+- UNIT_SOCKET,
+- UNIT_TARGET,
+- UNIT_DEVICE,
+- UNIT_MOUNT,
+- UNIT_AUTOMOUNT,
+- UNIT_SNAPSHOT,
+- UNIT_TIMER,
+- UNIT_SWAP,
+- UNIT_PATH,
+- _UNIT_TYPE_MAX,
+- _UNIT_TYPE_INVALID = -1
+-};
++#include "unit-name.h"
+
+ enum UnitLoadState {
+ UNIT_STUB,
+diff --git a/src/shared/unit-name.c b/src/shared/unit-name.c
+index cbc9fc5..b962634 100644
+--- a/src/shared/unit-name.c
++++ b/src/shared/unit-name.c
+@@ -33,6 +33,21 @@
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZ" \
+ ":-_.\\"
+
++static const char* const unit_type_table[_UNIT_TYPE_MAX] = {
++ [UNIT_SERVICE] = "service",
++ [UNIT_SOCKET] = "socket",
++ [UNIT_TARGET] = "target",
++ [UNIT_DEVICE] = "device",
++ [UNIT_MOUNT] = "mount",
++ [UNIT_AUTOMOUNT] = "automount",
++ [UNIT_SNAPSHOT] = "snapshot",
++ [UNIT_TIMER] = "timer",
++ [UNIT_SWAP] = "swap",
++ [UNIT_PATH] = "path",
++};
++
++DEFINE_STRING_TABLE_LOOKUP(unit_type, UnitType);
++
+ bool unit_name_is_valid_no_type(const char *n, bool template_ok) {
+ const char *e, *i, *at;
+
+diff --git a/src/shared/unit-name.h b/src/shared/unit-name.h
+index 116da11..6bfba24 100644
+--- a/src/shared/unit-name.h
++++ b/src/shared/unit-name.h
+@@ -26,6 +26,26 @@
+
+ #define UNIT_NAME_MAX 256
+
++typedef enum UnitType UnitType;
++
++enum UnitType {
++ UNIT_SERVICE = 0,
++ UNIT_SOCKET,
++ UNIT_TARGET,
++ UNIT_DEVICE,
++ UNIT_MOUNT,
++ UNIT_AUTOMOUNT,
++ UNIT_SNAPSHOT,
++ UNIT_TIMER,
++ UNIT_SWAP,
++ UNIT_PATH,
++ _UNIT_TYPE_MAX,
++ _UNIT_TYPE_INVALID = -1
++};
++
++const char *unit_type_to_string(UnitType i);
++UnitType unit_type_from_string(const char *s);
++
+ int unit_name_to_instance(const char *n, char **instance);
+ char* unit_name_to_prefix(const char *n);
+ char* unit_name_to_prefix_and_instance(const char *n);
diff --git a/0466-systemctl-check-the-argument-to-t-for-invalid-values.patch b/0466-systemctl-check-the-argument-to-t-for-invalid-values.patch
new file mode 100644
index 0000000..9981fd4
--- /dev/null
+++ b/0466-systemctl-check-the-argument-to-t-for-invalid-values.patch
@@ -0,0 +1,27 @@
+From 33f70281d768c5a42972510512c8c0967d757bb7 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek at in.waw.pl>
+Date: Wed, 6 Jun 2012 16:56:19 +0200
+Subject: [PATCH] systemctl: check the argument to -t for invalid values
+
+Systemctl accepted anything as the argument for -t, and simply said '0
+units found'. It is better to catch this user error early.
+(cherry picked from commit 6d97280899a766ad7b4a6b07cc803709a08b364b)
+---
+ src/systemctl/systemctl.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
+index 2cc016e..bfc65a0 100644
+--- a/src/systemctl/systemctl.c
++++ b/src/systemctl/systemctl.c
+@@ -4579,6 +4579,10 @@ static int systemctl_parse_argv(int argc, char *argv[]) {
+ return 0;
+
+ case 't':
++ if (unit_type_from_string(optarg) < 0) {
++ log_error("Invalid unit type '%s'.", optarg);
++ return -EINVAL;
++ }
+ arg_type = optarg;
+ break;
+
diff --git a/0467-unit-name-remove-unit_name_is_valid_no_type-and-move.patch b/0467-unit-name-remove-unit_name_is_valid_no_type-and-move.patch
new file mode 100644
index 0000000..d1db2d0
--- /dev/null
+++ b/0467-unit-name-remove-unit_name_is_valid_no_type-and-move.patch
@@ -0,0 +1,227 @@
+From 40c5012fb52b8e9fe19da18a4f0ca2282e780fed Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Tue, 10 Jul 2012 17:03:11 +0200
+Subject: [PATCH] unit-name: remove unit_name_is_valid_no_type() and move
+ unit_name_is_valid() to unit-name.h (cherry picked from
+ commit 5f73969991fa765f2826975c0fc5e47438b5e9ea)
+
+---
+ src/core/manager.c | 2 +-
+ src/core/unit.c | 22 ----------------------
+ src/core/unit.h | 3 ---
+ src/shared/install.c | 18 +++++++++---------
+ src/shared/unit-name.c | 19 +++++++++++++++++--
+ src/shared/unit-name.h | 4 +++-
+ 6 files changed, 30 insertions(+), 38 deletions(-)
+
+diff --git a/src/core/manager.c b/src/core/manager.c
+index 2a17794..64c7823 100644
+--- a/src/core/manager.c
++++ b/src/core/manager.c
+@@ -797,7 +797,7 @@ int manager_load_unit_prepare(Manager *m, const char *name, const char *path, DB
+
+ t = unit_name_to_type(name);
+
+- if (t == _UNIT_TYPE_INVALID || !unit_name_is_valid_no_type(name, false)) {
++ if (t == _UNIT_TYPE_INVALID || !unit_name_is_valid(name, false)) {
+ dbus_set_error(e, BUS_ERROR_INVALID_NAME, "Unit name %s is not valid.", name);
+ return -EINVAL;
+ }
+diff --git a/src/core/unit.c b/src/core/unit.c
+index b52ed42..f5ced75 100644
+--- a/src/core/unit.c
++++ b/src/core/unit.c
+@@ -2635,28 +2635,6 @@ bool unit_pending_active(Unit *u) {
+ return false;
+ }
+
+-UnitType unit_name_to_type(const char *n) {
+- UnitType t;
+-
+- assert(n);
+-
+- for (t = 0; t < _UNIT_TYPE_MAX; t++)
+- if (endswith(n, unit_vtable[t]->suffix))
+- return t;
+-
+- return _UNIT_TYPE_INVALID;
+-}
+-
+-bool unit_name_is_valid(const char *n, bool template_ok) {
+- UnitType t;
+-
+- t = unit_name_to_type(n);
+- if (t < 0 || t >= _UNIT_TYPE_MAX)
+- return false;
+-
+- return unit_name_is_valid_no_type(n, template_ok);
+-}
+-
+ int unit_kill(Unit *u, KillWho w, KillMode m, int signo, DBusError *error) {
+ assert(u);
+ assert(w >= 0 && w < _KILL_WHO_MAX);
+diff --git a/src/core/unit.h b/src/core/unit.h
+index c994107..267a03e 100644
+--- a/src/core/unit.h
++++ b/src/core/unit.h
+@@ -538,9 +538,6 @@ int unit_add_default_target_dependency(Unit *u, Unit *target);
+
+ int unit_following_set(Unit *u, Set **s);
+
+-UnitType unit_name_to_type(const char *n);
+-bool unit_name_is_valid(const char *n, bool template_ok);
+-
+ void unit_trigger_on_failure(Unit *u);
+
+ bool unit_condition_test(Unit *u);
+diff --git a/src/shared/install.c b/src/shared/install.c
+index f443578..786846e 100644
+--- a/src/shared/install.c
++++ b/src/shared/install.c
+@@ -607,7 +607,7 @@ int unit_file_mask(
+ STRV_FOREACH(i, files) {
+ char *path;
+
+- if (!unit_name_is_valid_no_type(*i, true)) {
++ if (!unit_name_is_valid(*i, true)) {
+ if (r == 0)
+ r = -EINVAL;
+ continue;
+@@ -683,7 +683,7 @@ int unit_file_unmask(
+ STRV_FOREACH(i, files) {
+ char *path;
+
+- if (!unit_name_is_valid_no_type(*i, true)) {
++ if (!unit_name_is_valid(*i, true)) {
+ if (r == 0)
+ r = -EINVAL;
+ continue;
+@@ -759,7 +759,7 @@ int unit_file_link(
+ fn = path_get_file_name(*i);
+
+ if (!path_is_absolute(*i) ||
+- !unit_name_is_valid_no_type(fn, true)) {
++ !unit_name_is_valid(fn, true)) {
+ if (r == 0)
+ r = -EINVAL;
+ continue;
+@@ -922,7 +922,7 @@ static int install_info_add(
+ if (!name)
+ name = path_get_file_name(path);
+
+- if (!unit_name_is_valid_no_type(name, true))
++ if (!unit_name_is_valid(name, true))
+ return -EINVAL;
+
+ if (hashmap_get(c->have_installed, name) ||
+@@ -1232,7 +1232,7 @@ static int install_info_symlink_wants(
+ STRV_FOREACH(s, i->wanted_by) {
+ char *path;
+
+- if (!unit_name_is_valid_no_type(*s, true)) {
++ if (!unit_name_is_valid(*s, true)) {
+ r = -EINVAL;
+ continue;
+ }
+@@ -1266,7 +1266,7 @@ static int install_info_symlink_requires(
+ STRV_FOREACH(s, i->required_by) {
+ char *path;
+
+- if (!unit_name_is_valid_no_type(*s, true)) {
++ if (!unit_name_is_valid(*s, true)) {
+ r = -EINVAL;
+ continue;
+ }
+@@ -1597,7 +1597,7 @@ UnitFileState unit_file_get_state(
+ if (root_dir && scope != UNIT_FILE_SYSTEM)
+ return -EINVAL;
+
+- if (!unit_name_is_valid_no_type(name, true))
++ if (!unit_name_is_valid(name, true))
+ return -EINVAL;
+
+ r = lookup_paths_init_from_scope(&paths, scope);
+@@ -1792,7 +1792,7 @@ int unit_file_preset(
+
+ STRV_FOREACH(i, files) {
+
+- if (!unit_name_is_valid_no_type(*i, true)) {
++ if (!unit_name_is_valid(*i, true)) {
+ r = -EINVAL;
+ goto finish;
+ }
+@@ -1897,7 +1897,7 @@ int unit_file_get_list(
+ if (ignore_file(de->d_name))
+ continue;
+
+- if (!unit_name_is_valid_no_type(de->d_name, true))
++ if (!unit_name_is_valid(de->d_name, true))
+ continue;
+
+ if (hashmap_get(h, de->d_name))
+diff --git a/src/shared/unit-name.c b/src/shared/unit-name.c
+index b962634..d26340e 100644
+--- a/src/shared/unit-name.c
++++ b/src/shared/unit-name.c
+@@ -48,7 +48,7 @@ static const char* const unit_type_table[_UNIT_TYPE_MAX] = {
+
+ DEFINE_STRING_TABLE_LOOKUP(unit_type, UnitType);
+
+-bool unit_name_is_valid_no_type(const char *n, bool template_ok) {
++bool unit_name_is_valid(const char *n, bool template_ok) {
+ const char *e, *i, *at;
+
+ /* Valid formats:
+@@ -66,6 +66,9 @@ bool unit_name_is_valid_no_type(const char *n, bool template_ok) {
+ if (!e || e == n)
+ return false;
+
++ if (unit_type_from_string(e + 1) < 0)
++ return false;
++
+ for (i = n, at = NULL; i < e; i++) {
+
+ if (*i == '@' && !at)
+@@ -166,7 +169,7 @@ char *unit_name_change_suffix(const char *n, const char *suffix) {
+ size_t a, b;
+
+ assert(n);
+- assert(unit_name_is_valid_no_type(n, true));
++ assert(unit_name_is_valid(n, true));
+ assert(suffix);
+
+ assert_se(e = strrchr(n, '.'));
+@@ -486,3 +489,15 @@ char *unit_dbus_path_from_name(const char *name) {
+
+ return p;
+ }
++
++UnitType unit_name_to_type(const char *n) {
++ const char *e;
++
++ assert(n);
++
++ e = strrchr(n, '.');
++ if (!e)
++ return _UNIT_TYPE_INVALID;
++
++ return unit_type_from_string(e + 1);
++}
+diff --git a/src/shared/unit-name.h b/src/shared/unit-name.h
+index 6bfba24..80efa00 100644
+--- a/src/shared/unit-name.h
++++ b/src/shared/unit-name.h
+@@ -50,10 +50,12 @@ int unit_name_to_instance(const char *n, char **instance);
+ char* unit_name_to_prefix(const char *n);
+ char* unit_name_to_prefix_and_instance(const char *n);
+
+-bool unit_name_is_valid_no_type(const char *n, bool template_ok);
++bool unit_name_is_valid(const char *n, bool template_ok);
+ bool unit_prefix_is_valid(const char *p);
+ bool unit_instance_is_valid(const char *i);
+
++UnitType unit_name_to_type(const char *n);
++
+ char *unit_name_change_suffix(const char *n, const char *suffix);
+
+ char *unit_name_build(const char *prefix, const char *instance, const char *suffix);
diff --git a/0468-unit-get-rid-of-UnitVTable.suffix-which-is-now-unuse.patch b/0468-unit-get-rid-of-UnitVTable.suffix-which-is-now-unuse.patch
new file mode 100644
index 0000000..b5c55ea
--- /dev/null
+++ b/0468-unit-get-rid-of-UnitVTable.suffix-which-is-now-unuse.patch
@@ -0,0 +1,154 @@
+From 6f2bb5037843638fdd08e84769ee312da9d37595 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Tue, 10 Jul 2012 17:04:42 +0200
+Subject: [PATCH] unit: get rid of UnitVTable.suffix, which is now unused
+ (cherry picked from commit
+ bcbe497e5a73d889e8799f8a3680c303afede347)
+
+---
+ src/core/automount.c | 1 -
+ src/core/device.c | 1 -
+ src/core/mount.c | 1 -
+ src/core/path.c | 1 -
+ src/core/service.c | 1 -
+ src/core/snapshot.c | 1 -
+ src/core/socket.c | 1 -
+ src/core/swap.c | 1 -
+ src/core/target.c | 1 -
+ src/core/timer.c | 1 -
+ src/core/unit.h | 2 --
+ 11 files changed, 12 deletions(-)
+
+diff --git a/src/core/automount.c b/src/core/automount.c
+index a206960..27ca887 100644
+--- a/src/core/automount.c
++++ b/src/core/automount.c
+@@ -848,7 +848,6 @@ static const char* const automount_result_table[_AUTOMOUNT_RESULT_MAX] = {
+ DEFINE_STRING_TABLE_LOOKUP(automount_result, AutomountResult);
+
+ const UnitVTable automount_vtable = {
+- .suffix = ".automount",
+ .object_size = sizeof(Automount),
+ .sections =
+ "Unit\0"
+diff --git a/src/core/device.c b/src/core/device.c
+index ff51e36..a56b06b 100644
+--- a/src/core/device.c
++++ b/src/core/device.c
+@@ -585,7 +585,6 @@ static const char* const device_state_table[_DEVICE_STATE_MAX] = {
+ DEFINE_STRING_TABLE_LOOKUP(device_state, DeviceState);
+
+ const UnitVTable device_vtable = {
+- .suffix = ".device",
+ .object_size = sizeof(Device),
+ .sections =
+ "Unit\0"
+diff --git a/src/core/mount.c b/src/core/mount.c
+index dce7094..e1251b2 100644
+--- a/src/core/mount.c
++++ b/src/core/mount.c
+@@ -1953,7 +1953,6 @@ static const char* const mount_result_table[_MOUNT_RESULT_MAX] = {
+ DEFINE_STRING_TABLE_LOOKUP(mount_result, MountResult);
+
+ const UnitVTable mount_vtable = {
+- .suffix = ".mount",
+ .object_size = sizeof(Mount),
+ .sections =
+ "Unit\0"
+diff --git a/src/core/path.c b/src/core/path.c
+index e183a15..2a9b026 100644
+--- a/src/core/path.c
++++ b/src/core/path.c
+@@ -738,7 +738,6 @@ static const char* const path_result_table[_PATH_RESULT_MAX] = {
+ DEFINE_STRING_TABLE_LOOKUP(path_result, PathResult);
+
+ const UnitVTable path_vtable = {
+- .suffix = ".path",
+ .object_size = sizeof(Path),
+ .sections =
+ "Unit\0"
+diff --git a/src/core/service.c b/src/core/service.c
+index 534e77e..fba35c5 100644
+--- a/src/core/service.c
++++ b/src/core/service.c
+@@ -3822,7 +3822,6 @@ static const char* const start_limit_action_table[_SERVICE_START_LIMIT_MAX] = {
+ DEFINE_STRING_TABLE_LOOKUP(start_limit_action, StartLimitAction);
+
+ const UnitVTable service_vtable = {
+- .suffix = ".service",
+ .object_size = sizeof(Service),
+ .sections =
+ "Unit\0"
+diff --git a/src/core/snapshot.c b/src/core/snapshot.c
+index 82ec510..f80fadb 100644
+--- a/src/core/snapshot.c
++++ b/src/core/snapshot.c
+@@ -281,7 +281,6 @@ static const char* const snapshot_state_table[_SNAPSHOT_STATE_MAX] = {
+ DEFINE_STRING_TABLE_LOOKUP(snapshot_state, SnapshotState);
+
+ const UnitVTable snapshot_vtable = {
+- .suffix = ".snapshot",
+ .object_size = sizeof(Snapshot),
+
+ .no_alias = true,
+diff --git a/src/core/socket.c b/src/core/socket.c
+index eab2243..1196e64 100644
+--- a/src/core/socket.c
++++ b/src/core/socket.c
+@@ -2184,7 +2184,6 @@ static const char* const socket_result_table[_SOCKET_RESULT_MAX] = {
+ DEFINE_STRING_TABLE_LOOKUP(socket_result, SocketResult);
+
+ const UnitVTable socket_vtable = {
+- .suffix = ".socket",
+ .object_size = sizeof(Socket),
+ .sections =
+ "Unit\0"
+diff --git a/src/core/swap.c b/src/core/swap.c
+index 7bfe117..e1186fb 100644
+--- a/src/core/swap.c
++++ b/src/core/swap.c
+@@ -1371,7 +1371,6 @@ static const char* const swap_result_table[_SWAP_RESULT_MAX] = {
+ DEFINE_STRING_TABLE_LOOKUP(swap_result, SwapResult);
+
+ const UnitVTable swap_vtable = {
+- .suffix = ".swap",
+ .object_size = sizeof(Swap),
+ .sections =
+ "Unit\0"
+diff --git a/src/core/target.c b/src/core/target.c
+index e285f0e..d4490d7 100644
+--- a/src/core/target.c
++++ b/src/core/target.c
+@@ -198,7 +198,6 @@ static const char* const target_state_table[_TARGET_STATE_MAX] = {
+ DEFINE_STRING_TABLE_LOOKUP(target_state, TargetState);
+
+ const UnitVTable target_vtable = {
+- .suffix = ".target",
+ .object_size = sizeof(Target),
+ .sections =
+ "Unit\0"
+diff --git a/src/core/timer.c b/src/core/timer.c
+index e318fee..56a6949 100644
+--- a/src/core/timer.c
++++ b/src/core/timer.c
+@@ -486,7 +486,6 @@ static const char* const timer_result_table[_TIMER_RESULT_MAX] = {
+ DEFINE_STRING_TABLE_LOOKUP(timer_result, TimerResult);
+
+ const UnitVTable timer_vtable = {
+- .suffix = ".timer",
+ .object_size = sizeof(Timer),
+ .sections =
+ "Unit\0"
+diff --git a/src/core/unit.h b/src/core/unit.h
+index 267a03e..64f4cb9 100644
+--- a/src/core/unit.h
++++ b/src/core/unit.h
+@@ -272,8 +272,6 @@ struct UnitStatusMessageFormats {
+ #include "path.h"
+
+ struct UnitVTable {
+- const char *suffix;
+-
+ /* How much memory does an object of this unit type need */
+ size_t object_size;
+
diff --git a/0469-unit-Move-UnitLoadState-definitions-from-core-unit.c.patch b/0469-unit-Move-UnitLoadState-definitions-from-core-unit.c.patch
new file mode 100644
index 0000000..d9649e8
--- /dev/null
+++ b/0469-unit-Move-UnitLoadState-definitions-from-core-unit.c.patch
@@ -0,0 +1,132 @@
+From 67ae2881a1903c95666410678d8ceb5fa0be0eb0 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek at in.waw.pl>
+Date: Tue, 10 Jul 2012 17:18:09 +0200
+Subject: [PATCH] unit: Move UnitLoadState definitions from core/unit.c to
+ shared/unit-name.c
+
+This makes it possible to use them from systemctl without linking
+against the core.
+(cherry picked from commit f69614f811b133ececad4394e88f9549a017bd4e)
+---
+ src/core/unit.c | 10 ----------
+ src/core/unit.h | 14 --------------
+ src/shared/unit-name.c | 10 ++++++++++
+ src/shared/unit-name.h | 14 ++++++++++++++
+ 4 files changed, 24 insertions(+), 24 deletions(-)
+
+diff --git a/src/core/unit.c b/src/core/unit.c
+index f5ced75..a956172 100644
+--- a/src/core/unit.c
++++ b/src/core/unit.c
+@@ -2734,16 +2734,6 @@ int unit_add_mount_links(Unit *u) {
+ return 0;
+ }
+
+-static const char* const unit_load_state_table[_UNIT_LOAD_STATE_MAX] = {
+- [UNIT_STUB] = "stub",
+- [UNIT_LOADED] = "loaded",
+- [UNIT_ERROR] = "error",
+- [UNIT_MERGED] = "merged",
+- [UNIT_MASKED] = "masked"
+-};
+-
+-DEFINE_STRING_TABLE_LOOKUP(unit_load_state, UnitLoadState);
+-
+ static const char* const unit_active_state_table[_UNIT_ACTIVE_STATE_MAX] = {
+ [UNIT_ACTIVE] = "active",
+ [UNIT_RELOADING] = "reloading",
+diff --git a/src/core/unit.h b/src/core/unit.h
+index 64f4cb9..797751d 100644
+--- a/src/core/unit.h
++++ b/src/core/unit.h
+@@ -28,7 +28,6 @@
+ typedef struct Unit Unit;
+ typedef struct UnitVTable UnitVTable;
+ typedef enum UnitType UnitType;
+-typedef enum UnitLoadState UnitLoadState;
+ typedef enum UnitActiveState UnitActiveState;
+ typedef enum UnitDependency UnitDependency;
+ typedef struct UnitRef UnitRef;
+@@ -43,16 +42,6 @@ typedef struct UnitStatusMessageFormats UnitStatusMessageFormats;
+ #include "install.h"
+ #include "unit-name.h"
+
+-enum UnitLoadState {
+- UNIT_STUB,
+- UNIT_LOADED,
+- UNIT_ERROR,
+- UNIT_MERGED,
+- UNIT_MASKED,
+- _UNIT_LOAD_STATE_MAX,
+- _UNIT_LOAD_STATE_INVALID = -1
+-};
+-
+ enum UnitActiveState {
+ UNIT_ACTIVE,
+ UNIT_RELOADING,
+@@ -550,9 +539,6 @@ void unit_ref_unset(UnitRef *ref);
+ int unit_add_one_mount_link(Unit *u, Mount *m);
+ int unit_add_mount_links(Unit *u);
+
+-const char *unit_load_state_to_string(UnitLoadState i);
+-UnitLoadState unit_load_state_from_string(const char *s);
+-
+ const char *unit_active_state_to_string(UnitActiveState i);
+ UnitActiveState unit_active_state_from_string(const char *s);
+
+diff --git a/src/shared/unit-name.c b/src/shared/unit-name.c
+index d26340e..dd15119 100644
+--- a/src/shared/unit-name.c
++++ b/src/shared/unit-name.c
+@@ -48,6 +48,16 @@ static const char* const unit_type_table[_UNIT_TYPE_MAX] = {
+
+ DEFINE_STRING_TABLE_LOOKUP(unit_type, UnitType);
+
++static const char* const unit_load_state_table[_UNIT_LOAD_STATE_MAX] = {
++ [UNIT_STUB] = "stub",
++ [UNIT_LOADED] = "loaded",
++ [UNIT_ERROR] = "error",
++ [UNIT_MERGED] = "merged",
++ [UNIT_MASKED] = "masked"
++};
++
++DEFINE_STRING_TABLE_LOOKUP(unit_load_state, UnitLoadState);
++
+ bool unit_name_is_valid(const char *n, bool template_ok) {
+ const char *e, *i, *at;
+
+diff --git a/src/shared/unit-name.h b/src/shared/unit-name.h
+index 80efa00..f23d2cd 100644
+--- a/src/shared/unit-name.h
++++ b/src/shared/unit-name.h
+@@ -27,6 +27,7 @@
+ #define UNIT_NAME_MAX 256
+
+ typedef enum UnitType UnitType;
++typedef enum UnitLoadState UnitLoadState;
+
+ enum UnitType {
+ UNIT_SERVICE = 0,
+@@ -43,9 +44,22 @@ enum UnitType {
+ _UNIT_TYPE_INVALID = -1
+ };
+
++enum UnitLoadState {
++ UNIT_STUB,
++ UNIT_LOADED,
++ UNIT_ERROR,
++ UNIT_MERGED,
++ UNIT_MASKED,
++ _UNIT_LOAD_STATE_MAX,
++ _UNIT_LOAD_STATE_INVALID = -1
++};
++
+ const char *unit_type_to_string(UnitType i);
+ UnitType unit_type_from_string(const char *s);
+
++const char *unit_load_state_to_string(UnitLoadState i);
++UnitLoadState unit_load_state_from_string(const char *s);
++
+ int unit_name_to_instance(const char *n, char **instance);
+ char* unit_name_to_prefix(const char *n);
+ char* unit_name_to_prefix_and_instance(const char *n);
diff --git a/0470-systemctl-filter-shown-units-by-their-load-state.patch b/0470-systemctl-filter-shown-units-by-their-load-state.patch
new file mode 100644
index 0000000..fd772f4
--- /dev/null
+++ b/0470-systemctl-filter-shown-units-by-their-load-state.patch
@@ -0,0 +1,103 @@
+From ef0716a041bcccaa3fdb7372b8de78a134bc0164 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek at in.waw.pl>
+Date: Tue, 10 Jul 2012 18:03:03 +0200
+Subject: [PATCH] systemctl: filter shown units by their load state
+
+E.g. systemctl --all -t masked gives the list of masked units.
+
+The -t/--type option is reused. This is possible because unit types
+and unit load states are called differently, so it is possible to
+distinguish what the user meant. Using the same option also means that
+the interface is user for the user: less options to remember.
+(cherry picked from commit c147dc42f8b3383a3ced69aaa75e21df4fe75a96)
+---
+ man/systemctl.xml | 28 ++++++++++++++++++++--------
+ src/systemctl/systemctl.c | 21 ++++++++++++++-------
+ 2 files changed, 34 insertions(+), 15 deletions(-)
+
+diff --git a/man/systemctl.xml b/man/systemctl.xml
+index 7ed8f35..9808f41 100644
+--- a/man/systemctl.xml
++++ b/man/systemctl.xml
+@@ -88,14 +88,26 @@
+ <term><option>--type=</option></term>
+ <term><option>-t</option></term>
+
+- <listitem><para>When listing units,
+- limit display to certain unit
+- types. If not specified units of all
+- types will be shown. The argument
+- should be a unit type name such as
+- <option>service</option>,
+- <option>socket</option> and
+- similar.</para></listitem>
++ <listitem><para>The argument should
++ be a unit type name such as
++ <option>service</option> and
++ <option>socket</option>,
++ or a unit load state such as
++ <option>loaded</option> and
++ <option>masked</option>.
++ </para>
++
++ <para>If the argument is a unit type,
++ when listing units, limit display to
++ certain unit types. If not specified
++ units of all types will be shown.</para>
++
++ <para>If the argument is a unit load state,
++ when listing units, limit display to
++ certain unit types. If not specified
++ units of in all load states will be
++ shown.</para>
++ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
+index bfc65a0..05bf3dd 100644
+--- a/src/systemctl/systemctl.c
++++ b/src/systemctl/systemctl.c
+@@ -65,6 +65,7 @@
+ #include "path-util.h"
+
+ static const char *arg_type = NULL;
++static const char *arg_load_state = NULL;
+ static char **arg_property = NULL;
+ static bool arg_all = false;
+ static const char *arg_job_mode = "replace";
+@@ -337,7 +338,9 @@ static bool output_show_unit(const struct unit_info *u) {
+
+ return (!arg_type || ((dot = strrchr(u->id, '.')) &&
+ streq(dot+1, arg_type))) &&
+- (arg_all || !(streq(u->active_state, "inactive") || u->following[0]) || u->job_id > 0);
++ (!arg_load_state || streq(u->load_state, arg_load_state)) &&
++ (arg_all || !(streq(u->active_state, "inactive")
++ || u->following[0]) || u->job_id > 0);
+ }
+
+ static void output_units_list(const struct unit_info *unit_infos, unsigned c) {
+@@ -4579,13 +4582,17 @@ static int systemctl_parse_argv(int argc, char *argv[]) {
+ return 0;
+
+ case 't':
+- if (unit_type_from_string(optarg) < 0) {
+- log_error("Invalid unit type '%s'.", optarg);
+- return -EINVAL;
++ if (unit_type_from_string(optarg) >= 0) {
++ arg_type = optarg;
++ break;
+ }
+- arg_type = optarg;
+- break;
+-
++ if (unit_load_state_from_string(optarg) >= 0) {
++ arg_load_state = optarg;
++ break;
++ }
++ log_error("Unkown unit type or load state '%s'.",
++ optarg);
++ return -EINVAL;
+ case 'p': {
+ char **l;
+
diff --git a/0471-mount-fix-for-complex-automounts.patch b/0471-mount-fix-for-complex-automounts.patch
new file mode 100644
index 0000000..115fca2
--- /dev/null
+++ b/0471-mount-fix-for-complex-automounts.patch
@@ -0,0 +1,32 @@
+From 11e58cda077eaa8f4b122623fd7eedfd945816ed Mon Sep 17 00:00:00 2001
+From: Malte Starostik <m-starostik at versanet.de>
+Date: Tue, 5 Jun 2012 21:10:28 +0200
+Subject: [PATCH] mount: fix for complex automounts
+
+If accessing an automount point triggers more changes to
+/proc/self/mountinfo than just to add the directly wanted mount, these
+changes can lead to spurious -ENODEV notifications on the automount unit
+causing the request to fail when in fact the mount will be setup right
+afterwards.
+(cherry picked from commit 36fcd77e02cedf300e2f45f2449e7e091ef5a7ab)
+---
+ src/core/mount.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/src/core/mount.c b/src/core/mount.c
+index e1251b2..d939e21 100644
+--- a/src/core/mount.c
++++ b/src/core/mount.c
+@@ -745,8 +745,10 @@ static void mount_set_state(Mount *m, MountState state) {
+ state == MOUNT_REMOUNTING_SIGKILL ||
+ state == MOUNT_UNMOUNTING_SIGTERM ||
+ state == MOUNT_UNMOUNTING_SIGKILL ||
+- state == MOUNT_FAILED)
+- mount_notify_automount(m, -ENODEV);
++ state == MOUNT_FAILED) {
++ if (state != old_state)
++ mount_notify_automount(m, -ENODEV);
++ }
+
+ if (state != old_state)
+ log_debug("%s changed %s -> %s",
diff --git a/0472-util-add-extra-safety-check-to-in_initrd.patch b/0472-util-add-extra-safety-check-to-in_initrd.patch
new file mode 100644
index 0000000..876c682
--- /dev/null
+++ b/0472-util-add-extra-safety-check-to-in_initrd.patch
@@ -0,0 +1,54 @@
+From 32cc12e26a23f62d4151032ccf2d8f516235ccfe Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Tue, 10 Jul 2012 18:46:26 +0200
+Subject: [PATCH] util: add extra safety check to in_initrd()
+
+initrds can only be on tmpfs or ramfs, so check for that
+(cherry picked from commit 825c6fe5eb362437aa46faa52b683a62eede9a13)
+
+Conflicts:
+ TODO
+---
+ src/shared/util.c | 21 +++++++++++++++++++--
+ 1 file changed, 19 insertions(+), 2 deletions(-)
+
+diff --git a/src/shared/util.c b/src/shared/util.c
+index 1b2fa15..62d502b 100644
+--- a/src/shared/util.c
++++ b/src/shared/util.c
+@@ -54,6 +54,8 @@
+ #include <glob.h>
+ #include <grp.h>
+ #include <sys/mman.h>
++#include <sys/vfs.h>
++#include <linux/magic.h>
+
+ #include "macro.h"
+ #include "util.h"
+@@ -5738,9 +5740,24 @@ bool is_valid_documentation_url(const char *url) {
+
+ bool in_initrd(void) {
+ static int saved = -1;
++ struct statfs s;
+
+- if (saved < 0)
+- saved = access("/etc/initrd-release", F_OK) >= 0;
++ if (saved >= 0)
++ return saved;
++
++ /* We make two checks here:
++ *
++ * 1. the flag file /etc/initrd-release must exist
++ * 2. the root file system must be a memory file system
++ *
++ * The second check is extra paranoia, since misdetecting an
++ * initrd can have bad bad consequences due the initrd
++ * emptying when transititioning to the main systemd.
++ */
++
++ saved = access("/etc/initrd-release", F_OK) >= 0 &&
++ statfs("/", &s) >= 0 &&
++ (s.f_type == TMPFS_MAGIC || s.f_type == RAMFS_MAGIC);
+
+ return saved;
+ }
diff --git a/0473-journal-fix-interleaving-of-files-with-different-tim.patch b/0473-journal-fix-interleaving-of-files-with-different-tim.patch
new file mode 100644
index 0000000..53b0700
--- /dev/null
+++ b/0473-journal-fix-interleaving-of-files-with-different-tim.patch
@@ -0,0 +1,33 @@
+From eea885a68a2fcb0c6f9f04df883d2115f194f1b6 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Thu, 12 Jul 2012 17:35:04 +0200
+Subject: [PATCH] journal: fix interleaving of files with different time
+ sources (cherry picked from commit
+ c4aff78b2dffc1405396bff2458e479d0a19d93b)
+
+---
+ src/journal/sd-journal.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c
+index 5f701db..3ce792b 100644
+--- a/src/journal/sd-journal.c
++++ b/src/journal/sd-journal.c
+@@ -239,7 +239,7 @@ static int compare_order(JournalFile *af, Object *ao,
+
+ /* Otherwise compare UTC time */
+ a = le64toh(ao->entry.realtime);
+- b = le64toh(ao->entry.realtime);
++ b = le64toh(bo->entry.realtime);
+
+ if (a < b)
+ return -1;
+@@ -248,7 +248,7 @@ static int compare_order(JournalFile *af, Object *ao,
+
+ /* Finally, compare by contents */
+ a = le64toh(ao->entry.xor_hash);
+- b = le64toh(ao->entry.xor_hash);
++ b = le64toh(bo->entry.xor_hash);
+
+ if (a < b)
+ return -1;
diff --git a/0474-journal-fix-bisection-logic-for-first-entry.patch b/0474-journal-fix-bisection-logic-for-first-entry.patch
new file mode 100644
index 0000000..0686e88
--- /dev/null
+++ b/0474-journal-fix-bisection-logic-for-first-entry.patch
@@ -0,0 +1,37 @@
+From 4b05d08b2711f08d14f575ea74042239691a2aa9 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Thu, 12 Jul 2012 17:36:04 +0200
+Subject: [PATCH] journal: fix bisection logic for first entry (cherry picked
+ from commit a536e2613f278970b1ab11788caf1a9a51e1a103)
+
+---
+ src/journal/journal-file.c | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
+index f2b5bc5..e4d9c65 100644
+--- a/src/journal/journal-file.c
++++ b/src/journal/journal-file.c
+@@ -1275,7 +1275,11 @@ static int generic_array_bisect_plus_one(JournalFile *f,
+ r = test_object(f, extra, needle);
+ if (r < 0)
+ return r;
+- else if (r == TEST_FOUND) {
++
++ if (r == TEST_FOUND)
++ r = direction == DIRECTION_DOWN ? TEST_RIGHT : TEST_LEFT;
++
++ if (r == TEST_RIGHT) {
+ Object *o;
+
+ r = journal_file_move_to_object(f, OBJECT_ENTRY, extra, &o);
+@@ -1292,8 +1296,7 @@ static int generic_array_bisect_plus_one(JournalFile *f,
+ *idx = 0;
+
+ return 1;
+- } else if (r == TEST_RIGHT)
+- return 0;
++ }
+
+ r = generic_array_bisect(f, first, n-1, needle, test_object, direction, ret, offset, idx);
+
diff --git a/0475-journal-fix-bad-memory-access.patch b/0475-journal-fix-bad-memory-access.patch
new file mode 100644
index 0000000..de5e898
--- /dev/null
+++ b/0475-journal-fix-bad-memory-access.patch
@@ -0,0 +1,23 @@
+From 69698109a923fe399c7d54e8e8588652e71dada7 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Thu, 12 Jul 2012 17:36:24 +0200
+Subject: [PATCH] journal: fix bad memory access (cherry picked from commit
+ ecf68b1d3833c2ee3156a813ad42cf155dc4ace4)
+
+---
+ src/journal/journal-file.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
+index e4d9c65..9619f27 100644
+--- a/src/journal/journal-file.c
++++ b/src/journal/journal-file.c
+@@ -1300,7 +1300,7 @@ static int generic_array_bisect_plus_one(JournalFile *f,
+
+ r = generic_array_bisect(f, first, n-1, needle, test_object, direction, ret, offset, idx);
+
+- if (r > 0)
++ if (r > 0 && idx)
+ (*idx) ++;
+
+ return r;
diff --git a/0476-journal-fix-seeking-by-realtime-seqnum.patch b/0476-journal-fix-seeking-by-realtime-seqnum.patch
new file mode 100644
index 0000000..513482b
--- /dev/null
+++ b/0476-journal-fix-seeking-by-realtime-seqnum.patch
@@ -0,0 +1,38 @@
+From 5c1085195b541c1bbfcfc4c454443c3f4f56a7b0 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Thu, 12 Jul 2012 17:36:51 +0200
+Subject: [PATCH] journal: fix seeking by realtime/seqnum (cherry picked from
+ commit 91a31dde6e92c0d4c42abadf970083f6faba87ec)
+
+---
+ src/journal/journal-file.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
+index 9619f27..405059c 100644
+--- a/src/journal/journal-file.c
++++ b/src/journal/journal-file.c
+@@ -1611,8 +1611,10 @@ int journal_file_move_to_entry_by_seqnum_for_data(
+ Object *d;
+ int r;
+
++ assert(f);
++
+ r = journal_file_move_to_object(f, OBJECT_DATA, data_offset, &d);
+- if (r <= 0)
++ if (r < 0)
+ return r;
+
+ return generic_array_bisect_plus_one(f,
+@@ -1635,8 +1637,10 @@ int journal_file_move_to_entry_by_realtime_for_data(
+ Object *d;
+ int r;
+
++ assert(f);
++
+ r = journal_file_move_to_object(f, OBJECT_DATA, data_offset, &d);
+- if (r <= 0)
++ if (r < 0)
+ return r;
+
+ return generic_array_bisect_plus_one(f,
diff --git a/0477-journal-check-fields-we-search-for-more-carefully.patch b/0477-journal-check-fields-we-search-for-more-carefully.patch
new file mode 100644
index 0000000..1c96673
--- /dev/null
+++ b/0477-journal-check-fields-we-search-for-more-carefully.patch
@@ -0,0 +1,59 @@
+From ac26b5ba9da74fe6b92a4d8e53fe8b3479431146 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Fri, 13 Jul 2012 00:10:37 +0200
+Subject: [PATCH] journal: check fields we search for more carefully (cherry
+ picked from commit
+ 362a3f8122e070589a4d61f7752b990090c75432)
+
+---
+ src/journal/sd-journal.c | 30 +++++++++++++++++++++++++++++-
+ 1 file changed, 29 insertions(+), 1 deletion(-)
+
+diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c
+index 3ce792b..cb0ea32 100644
+--- a/src/journal/sd-journal.c
++++ b/src/journal/sd-journal.c
+@@ -1335,6 +1335,34 @@ _public_ int sd_journal_get_monotonic_usec(sd_journal *j, uint64_t *ret, sd_id12
+ return 0;
+ }
+
++static bool field_is_valid(const char *field) {
++ const char *p;
++
++ assert(field);
++
++ if (isempty(field))
++ return false;
++
++ if (startswith(field, "__"))
++ return false;
++
++ for (p = field; *p; p++) {
++
++ if (*p == '_')
++ continue;
++
++ if (*p >= 'A' && *p <= 'Z')
++ continue;
++
++ if (*p >= '0' && *p <= '9')
++ continue;
++
++ return false;
++ }
++
++ return true;
++}
++
+ _public_ int sd_journal_get_data(sd_journal *j, const char *field, const void **data, size_t *size) {
+ JournalFile *f;
+ uint64_t i, n;
+@@ -1351,7 +1379,7 @@ _public_ int sd_journal_get_data(sd_journal *j, const char *field, const void **
+ if (!size)
+ return -EINVAL;
+
+- if (isempty(field) || strchr(field, '='))
++ if (!field_is_valid(field))
+ return -EINVAL;
+
+ f = j->current_file;
diff --git a/0478-util-temporarily-ignore-SIGHUP-while-we-are-issuing-.patch b/0478-util-temporarily-ignore-SIGHUP-while-we-are-issuing-.patch
new file mode 100644
index 0000000..808e108
--- /dev/null
+++ b/0478-util-temporarily-ignore-SIGHUP-while-we-are-issuing-.patch
@@ -0,0 +1,54 @@
+From 7b5cf7052f9b83fe232bb8ed5f466142079e8eb7 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Fri, 13 Jul 2012 13:55:35 +0200
+Subject: [PATCH] util: temporarily ignore SIGHUP while we are issuing
+ TIOCSTTY (cherry picked from commit
+ 32c4bef8826f1231984d735944cb02a01d21177a)
+
+---
+ src/shared/util.c | 18 ++++++++++++++----
+ 1 file changed, 14 insertions(+), 4 deletions(-)
+
+diff --git a/src/shared/util.c b/src/shared/util.c
+index 62d502b..88f5759 100644
+--- a/src/shared/util.c
++++ b/src/shared/util.c
+@@ -2387,6 +2387,7 @@ int acquire_terminal(
+
+ int fd = -1, notify = -1, r, wd = -1;
+ usec_t ts = 0;
++ struct sigaction sa_old, sa_new;
+
+ assert(name);
+
+@@ -2434,17 +2435,26 @@ int acquire_terminal(
+ if (fd < 0)
+ return fd;
+
++ /* Temporarily ignore SIGHUP, so that we don't get SIGHUP'ed
++ * if we already own the tty. */
++ zero(sa_new);
++ sa_new.sa_handler = SIG_IGN;
++ sa_new.sa_flags = SA_RESTART;
++ assert_se(sigaction(SIGHUP, &sa_new, &sa_old) == 0);
++
+ /* First, try to get the tty */
+- r = ioctl(fd, TIOCSCTTY, force);
++ if (ioctl(fd, TIOCSCTTY, force) < 0)
++ r = -errno;
++
++ assert_se(sigaction(SIGHUP, &sa_old, NULL) == 0);
+
+ /* Sometimes it makes sense to ignore TIOCSCTTY
+ * returning EPERM, i.e. when very likely we already
+ * are have this controlling terminal. */
+- if (r < 0 && errno == EPERM && ignore_tiocstty_eperm)
++ if (r < 0 && r == -EPERM && ignore_tiocstty_eperm)
+ r = 0;
+
+- if (r < 0 && (force || fail || errno != EPERM)) {
+- r = -errno;
++ if (r < 0 && (force || fail || r != -EPERM)) {
+ goto fail;
+ }
+
diff --git a/0479-container-when-shutting-down-in-a-container-don-t-de.patch b/0479-container-when-shutting-down-in-a-container-don-t-de.patch
new file mode 100644
index 0000000..67633c4
--- /dev/null
+++ b/0479-container-when-shutting-down-in-a-container-don-t-de.patch
@@ -0,0 +1,24 @@
+From a9d76cf65661b91a58f2d0274bfb8f67e902c396 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Fri, 13 Jul 2012 14:42:25 +0200
+Subject: [PATCH] container: when shutting down in a container don't detach
+ loop devices
+
+We don't do device handling in containers, hence no loop devices either.
+(cherry picked from commit 910212e738e5ecdc0ceebfcc5009d688415eaefc)
+---
+ src/core/shutdown.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/core/shutdown.c b/src/core/shutdown.c
+index 4a2f309..5ba3bc2 100644
+--- a/src/core/shutdown.c
++++ b/src/core/shutdown.c
+@@ -359,6 +359,7 @@ int main(int argc, char *argv[]) {
+ if (in_container) {
+ need_swapoff = false;
+ need_dm_detach = false;
++ need_loop_detach = false;
+ }
+
+ /* Unmount all mountpoints, swaps, and loopback devices */
diff --git a/0480-unit-rename-BindTo-to-BindsTo.patch b/0480-unit-rename-BindTo-to-BindsTo.patch
new file mode 100644
index 0000000..bc1bcde
--- /dev/null
+++ b/0480-unit-rename-BindTo-to-BindsTo.patch
@@ -0,0 +1,308 @@
+From dd979786d9b8d62221b1664f8767ee07adbe0ae4 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Fri, 13 Jul 2012 23:34:40 +0200
+Subject: [PATCH] unit: rename BindTo= to BindsTo=
+
+all other dependencies are in 3rd person. Change BindTo= accordingly to
+BindsTo=.
+
+Of course, the dependency is widely used, hence we parse the old name
+too for compatibility.
+(cherry picked from commit 7f2cddae09fd2579ae24434df577bb5e5a157d86)
+
+Conflicts:
+ TODO
+ units/hibernate.target
+ units/serial-getty at .service.m4
+ units/suspend.target
+---
+ man/systemd.unit.xml | 6 +++---
+ src/core/dbus-unit.c | 6 +++---
+ src/core/dbus-unit.h | 6 +++---
+ src/core/load-fragment-gperf.gperf.m4 | 9 ++++++---
+ src/core/service.c | 2 +-
+ src/core/target.c | 2 +-
+ src/core/transaction.c | 4 ++--
+ src/core/unit.c | 20 ++++++++++----------
+ src/core/unit.h | 8 ++++----
+ src/cryptsetup/cryptsetup-generator.c | 2 +-
+ units/fsck at .service.in | 2 +-
+ 11 files changed, 35 insertions(+), 32 deletions(-)
+
+diff --git a/man/systemd.unit.xml b/man/systemd.unit.xml
+index c4a8f9a..698cbe3 100644
+--- a/man/systemd.unit.xml
++++ b/man/systemd.unit.xml
+@@ -410,7 +410,7 @@
+ </varlistentry>
+
+ <varlistentry>
+- <term><varname>BindTo=</varname></term>
++ <term><varname>BindsTo=</varname></term>
+
+ <listitem><para>Configures requirement
+ dependencies, very similar in style to
+@@ -527,8 +527,8 @@
+ </varlistentry>
+
+ <varlistentry>
+- <term><varname>PropagateReloadTo=</varname></term>
+- <term><varname>PropagateReloadFrom=</varname></term>
++ <term><varname>PropagatesReloadTo=</varname></term>
++ <term><varname>ReloadPropagatedFrom=</varname></term>
+
+ <listitem><para>Lists one or more
+ units where reload requests on the
+diff --git a/src/core/dbus-unit.c b/src/core/dbus-unit.c
+index 23c6fa7..a7c5fa8 100644
+--- a/src/core/dbus-unit.c
++++ b/src/core/dbus-unit.c
+@@ -793,7 +793,7 @@ const BusProperty bus_unit_properties[] = {
+ { "Requisite", bus_unit_append_dependencies, "as", offsetof(Unit, dependencies[UNIT_REQUISITE]), true },
+ { "RequisiteOverridable", bus_unit_append_dependencies, "as", offsetof(Unit, dependencies[UNIT_REQUISITE_OVERRIDABLE]), true },
+ { "Wants", bus_unit_append_dependencies, "as", offsetof(Unit, dependencies[UNIT_WANTS]), true },
+- { "BindTo", bus_unit_append_dependencies, "as", offsetof(Unit, dependencies[UNIT_BIND_TO]), true },
++ { "BindsTo", bus_unit_append_dependencies, "as", offsetof(Unit, dependencies[UNIT_BINDS_TO]), true },
+ { "RequiredBy", bus_unit_append_dependencies, "as", offsetof(Unit, dependencies[UNIT_REQUIRED_BY]), true },
+ { "RequiredByOverridable",bus_unit_append_dependencies, "as", offsetof(Unit, dependencies[UNIT_REQUIRED_BY_OVERRIDABLE]), true },
+ { "WantedBy", bus_unit_append_dependencies, "as", offsetof(Unit, dependencies[UNIT_WANTED_BY]), true },
+@@ -805,8 +805,8 @@ const BusProperty bus_unit_properties[] = {
+ { "OnFailure", bus_unit_append_dependencies, "as", offsetof(Unit, dependencies[UNIT_ON_FAILURE]), true },
+ { "Triggers", bus_unit_append_dependencies, "as", offsetof(Unit, dependencies[UNIT_TRIGGERS]), true },
+ { "TriggeredBy", bus_unit_append_dependencies, "as", offsetof(Unit, dependencies[UNIT_TRIGGERED_BY]), true },
+- { "PropagateReloadTo", bus_unit_append_dependencies, "as", offsetof(Unit, dependencies[UNIT_PROPAGATE_RELOAD_TO]), true },
+- { "PropagateReloadFrom", bus_unit_append_dependencies, "as", offsetof(Unit, dependencies[UNIT_PROPAGATE_RELOAD_FROM]), true },
++ { "PropagatesReloadTo", bus_unit_append_dependencies, "as", offsetof(Unit, dependencies[UNIT_PROPAGATES_RELOAD_TO]), true },
++ { "ReloadPropagatedFrom", bus_unit_append_dependencies, "as", offsetof(Unit, dependencies[UNIT_RELOAD_PROPAGATED_FROM]), true },
+ { "RequiresMountsFor", bus_property_append_strv, "as", offsetof(Unit, requires_mounts_for), true },
+ { "Documentation", bus_property_append_strv, "as", offsetof(Unit, documentation), true },
+ { "Description", bus_unit_append_description, "s", 0 },
+diff --git a/src/core/dbus-unit.h b/src/core/dbus-unit.h
+index 0caecfe..e1ba769 100644
+--- a/src/core/dbus-unit.h
++++ b/src/core/dbus-unit.h
+@@ -71,7 +71,7 @@
+ " <property name=\"Requisite\" type=\"as\" access=\"read\"/>\n" \
+ " <property name=\"RequisiteOverridable\" type=\"as\" access=\"read\"/>\n" \
+ " <property name=\"Wants\" type=\"as\" access=\"read\"/>\n" \
+- " <property name=\"BindTo\" type=\"as\" access=\"read\"/>\n" \
++ " <property name=\"BindsTo\" type=\"as\" access=\"read\"/>\n" \
+ " <property name=\"RequiredBy\" type=\"as\" access=\"read\"/>\n" \
+ " <property name=\"RequiredByOverridable\" type=\"as\" access=\"read\"/>\n" \
+ " <property name=\"WantedBy\" type=\"as\" access=\"read\"/>\n" \
+@@ -83,8 +83,8 @@
+ " <property name=\"OnFailure\" type=\"as\" access=\"read\"/>\n" \
+ " <property name=\"Triggers\" type=\"as\" access=\"read\"/>\n" \
+ " <property name=\"TriggeredBy\" type=\"as\" access=\"read\"/>\n" \
+- " <property name=\"PropagateReloadTo\" type=\"as\" access=\"read\"/>\n" \
+- " <property name=\"PropagateReloadFrom\" type=\"as\" access=\"read\"/>\n" \
++ " <property name=\"PropagatesReloadTo\" type=\"as\" access=\"read\"/>\n" \
++ " <property name=\"ReloadPropagatedFrom\" type=\"as\" access=\"read\"/>\n" \
+ " <property name=\"RequiresMountsFor\" type=\"as\" access=\"read\"/>\n" \
+ " <property name=\"Description\" type=\"s\" access=\"read\"/>\n" \
+ " <property name=\"Documentation\" type=\"as\" access=\"read\"/>\n" \
+diff --git a/src/core/load-fragment-gperf.gperf.m4 b/src/core/load-fragment-gperf.gperf.m4
+index 50fba45..e6d0db3 100644
+--- a/src/core/load-fragment-gperf.gperf.m4
++++ b/src/core/load-fragment-gperf.gperf.m4
+@@ -98,13 +98,16 @@ Unit.RequiresOverridable, config_parse_unit_deps, UNIT_REQUIR
+ Unit.Requisite, config_parse_unit_deps, UNIT_REQUISITE, 0
+ Unit.RequisiteOverridable, config_parse_unit_deps, UNIT_REQUISITE_OVERRIDABLE, 0
+ Unit.Wants, config_parse_unit_deps, UNIT_WANTS, 0
+-Unit.BindTo, config_parse_unit_deps, UNIT_BIND_TO, 0
++Unit.BindsTo, config_parse_unit_deps, UNIT_BINDS_TO, 0
++Unit.BindTo, config_parse_unit_deps, UNIT_BINDS_TO, 0
+ Unit.Conflicts, config_parse_unit_deps, UNIT_CONFLICTS, 0
+ Unit.Before, config_parse_unit_deps, UNIT_BEFORE, 0
+ Unit.After, config_parse_unit_deps, UNIT_AFTER, 0
+ Unit.OnFailure, config_parse_unit_deps, UNIT_ON_FAILURE, 0
+-Unit.PropagateReloadTo, config_parse_unit_deps, UNIT_PROPAGATE_RELOAD_TO, 0
+-Unit.PropagateReloadFrom, config_parse_unit_deps, UNIT_PROPAGATE_RELOAD_FROM, 0
++Unit.PropagatesReloadTo, config_parse_unit_deps, UNIT_PROPAGATES_RELOAD_TO, 0
++Unit.PropagateReloadTo, config_parse_unit_deps, UNIT_PROPAGATES_RELOAD_TO, 0
++Unit.ReloadPropagatedFrom, config_parse_unit_deps, UNIT_RELOAD_PROPAGATED_FROM, 0
++Unit.PropagateReloadFrom, config_parse_unit_deps, UNIT_RELOAD_PROPAGATED_FROM, 0
+ Unit.RequiresMountsFor, config_parse_unit_requires_mounts_for, 0, offsetof(Unit, requires_mounts_for)
+ Unit.StopWhenUnneeded, config_parse_bool, 0, offsetof(Unit, stop_when_unneeded)
+ Unit.RefuseManualStart, config_parse_bool, 0, offsetof(Unit, refuse_manual_start)
+diff --git a/src/core/service.c b/src/core/service.c
+index fba35c5..01623bd 100644
+--- a/src/core/service.c
++++ b/src/core/service.c
+@@ -2465,7 +2465,7 @@ static int service_start(Unit *u) {
+ return 0;
+
+ /* A service that will be restarted must be stopped first to
+- * trigger BindTo and/or OnFailure dependencies. If a user
++ * trigger BindsTo and/or OnFailure dependencies. If a user
+ * does not want to wait for the holdoff time to elapse, the
+ * service should be manually restarted, not started. */
+ if (s->state == SERVICE_AUTO_RESTART) {
+diff --git a/src/core/target.c b/src/core/target.c
+index d4490d7..d1625a1 100644
+--- a/src/core/target.c
++++ b/src/core/target.c
+@@ -59,7 +59,7 @@ static int target_add_default_dependencies(Target *t) {
+ UNIT_REQUISITE,
+ UNIT_REQUISITE_OVERRIDABLE,
+ UNIT_WANTS,
+- UNIT_BIND_TO
++ UNIT_BINDS_TO
+ };
+
+ Iterator i;
+diff --git a/src/core/transaction.c b/src/core/transaction.c
+index 44fdc06..a1cf706 100644
+--- a/src/core/transaction.c
++++ b/src/core/transaction.c
+@@ -893,7 +893,7 @@ int transaction_add_job_and_dependencies(
+ }
+ }
+
+- SET_FOREACH(dep, ret->unit->dependencies[UNIT_BIND_TO], i) {
++ SET_FOREACH(dep, ret->unit->dependencies[UNIT_BINDS_TO], i) {
+ r = transaction_add_job_and_dependencies(tr, JOB_START, dep, ret, true, override, false, false, ignore_order, e);
+ if (r < 0) {
+ if (r != -EBADR)
+@@ -998,7 +998,7 @@ int transaction_add_job_and_dependencies(
+
+ if (type == JOB_RELOAD) {
+
+- SET_FOREACH(dep, ret->unit->dependencies[UNIT_PROPAGATE_RELOAD_TO], i) {
++ SET_FOREACH(dep, ret->unit->dependencies[UNIT_PROPAGATES_RELOAD_TO], i) {
+ r = transaction_add_job_and_dependencies(tr, JOB_RELOAD, dep, ret, false, override, false, false, ignore_order, e);
+ if (r < 0) {
+ log_warning("Cannot add dependency reload job for unit %s, ignoring: %s", dep->id, bus_error(e, r));
+diff --git a/src/core/unit.c b/src/core/unit.c
+index a956172..ca3892c 100644
+--- a/src/core/unit.c
++++ b/src/core/unit.c
+@@ -1140,7 +1140,7 @@ static void retroactively_start_dependencies(Unit *u) {
+ !UNIT_IS_ACTIVE_OR_ACTIVATING(unit_active_state(other)))
+ manager_add_job(u->manager, JOB_START, other, JOB_REPLACE, true, NULL, NULL);
+
+- SET_FOREACH(other, u->dependencies[UNIT_BIND_TO], i)
++ SET_FOREACH(other, u->dependencies[UNIT_BINDS_TO], i)
+ if (!set_get(u->dependencies[UNIT_AFTER], other) &&
+ !UNIT_IS_ACTIVE_OR_ACTIVATING(unit_active_state(other)))
+ manager_add_job(u->manager, JOB_START, other, JOB_REPLACE, true, NULL, NULL);
+@@ -1205,7 +1205,7 @@ static void check_unneeded_dependencies(Unit *u) {
+ SET_FOREACH(other, u->dependencies[UNIT_REQUISITE_OVERRIDABLE], i)
+ if (!UNIT_IS_INACTIVE_OR_DEACTIVATING(unit_active_state(other)))
+ unit_check_unneeded(other);
+- SET_FOREACH(other, u->dependencies[UNIT_BIND_TO], i)
++ SET_FOREACH(other, u->dependencies[UNIT_BINDS_TO], i)
+ if (!UNIT_IS_INACTIVE_OR_DEACTIVATING(unit_active_state(other)))
+ unit_check_unneeded(other);
+ }
+@@ -1591,11 +1591,11 @@ int unit_add_dependency(Unit *u, UnitDependency d, Unit *other, bool add_referen
+ [UNIT_WANTS] = UNIT_WANTED_BY,
+ [UNIT_REQUISITE] = UNIT_REQUIRED_BY,
+ [UNIT_REQUISITE_OVERRIDABLE] = UNIT_REQUIRED_BY_OVERRIDABLE,
+- [UNIT_BIND_TO] = UNIT_BOUND_BY,
++ [UNIT_BINDS_TO] = UNIT_BOUND_BY,
+ [UNIT_REQUIRED_BY] = _UNIT_DEPENDENCY_INVALID,
+ [UNIT_REQUIRED_BY_OVERRIDABLE] = _UNIT_DEPENDENCY_INVALID,
+ [UNIT_WANTED_BY] = _UNIT_DEPENDENCY_INVALID,
+- [UNIT_BOUND_BY] = UNIT_BIND_TO,
++ [UNIT_BOUND_BY] = UNIT_BINDS_TO,
+ [UNIT_CONFLICTS] = UNIT_CONFLICTED_BY,
+ [UNIT_CONFLICTED_BY] = UNIT_CONFLICTS,
+ [UNIT_BEFORE] = UNIT_AFTER,
+@@ -1605,8 +1605,8 @@ int unit_add_dependency(Unit *u, UnitDependency d, Unit *other, bool add_referen
+ [UNIT_REFERENCED_BY] = UNIT_REFERENCES,
+ [UNIT_TRIGGERS] = UNIT_TRIGGERED_BY,
+ [UNIT_TRIGGERED_BY] = UNIT_TRIGGERS,
+- [UNIT_PROPAGATE_RELOAD_TO] = UNIT_PROPAGATE_RELOAD_FROM,
+- [UNIT_PROPAGATE_RELOAD_FROM] = UNIT_PROPAGATE_RELOAD_TO
++ [UNIT_PROPAGATES_RELOAD_TO] = UNIT_RELOAD_PROPAGATED_FROM,
++ [UNIT_RELOAD_PROPAGATED_FROM] = UNIT_PROPAGATES_RELOAD_TO
+ };
+ int r, q = 0, v = 0, w = 0;
+
+@@ -2514,7 +2514,7 @@ int unit_add_node_link(Unit *u, const char *what, bool wants) {
+ if (r < 0)
+ return r;
+
+- if ((r = unit_add_two_dependencies(u, UNIT_AFTER, UNIT_BIND_TO, device, true)) < 0)
++ if ((r = unit_add_two_dependencies(u, UNIT_AFTER, UNIT_BINDS_TO, device, true)) < 0)
+ return r;
+
+ if (wants)
+@@ -2753,7 +2753,7 @@ static const char* const unit_dependency_table[_UNIT_DEPENDENCY_MAX] = {
+ [UNIT_REQUISITE_OVERRIDABLE] = "RequisiteOverridable",
+ [UNIT_REQUIRED_BY] = "RequiredBy",
+ [UNIT_REQUIRED_BY_OVERRIDABLE] = "RequiredByOverridable",
+- [UNIT_BIND_TO] = "BindTo",
++ [UNIT_BINDS_TO] = "BindsTo",
+ [UNIT_WANTED_BY] = "WantedBy",
+ [UNIT_CONFLICTS] = "Conflicts",
+ [UNIT_CONFLICTED_BY] = "ConflictedBy",
+@@ -2765,8 +2765,8 @@ static const char* const unit_dependency_table[_UNIT_DEPENDENCY_MAX] = {
+ [UNIT_ON_FAILURE] = "OnFailure",
+ [UNIT_TRIGGERS] = "Triggers",
+ [UNIT_TRIGGERED_BY] = "TriggeredBy",
+- [UNIT_PROPAGATE_RELOAD_TO] = "PropagateReloadTo",
+- [UNIT_PROPAGATE_RELOAD_FROM] = "PropagateReloadFrom"
++ [UNIT_PROPAGATES_RELOAD_TO] = "PropagatesReloadTo",
++ [UNIT_RELOAD_PROPAGATED_FROM] = "ReloadPropagatedFrom"
+ };
+
+ DEFINE_STRING_TABLE_LOOKUP(unit_dependency, UnitDependency);
+diff --git a/src/core/unit.h b/src/core/unit.h
+index 797751d..ed31c62 100644
+--- a/src/core/unit.h
++++ b/src/core/unit.h
+@@ -76,13 +76,13 @@ enum UnitDependency {
+ UNIT_REQUISITE,
+ UNIT_REQUISITE_OVERRIDABLE,
+ UNIT_WANTS,
+- UNIT_BIND_TO,
++ UNIT_BINDS_TO,
+
+ /* Inverse of the above */
+ UNIT_REQUIRED_BY, /* inverse of 'requires' and 'requisite' is 'required_by' */
+ UNIT_REQUIRED_BY_OVERRIDABLE, /* inverse of 'requires_overridable' and 'requisite_overridable' is 'soft_required_by' */
+ UNIT_WANTED_BY, /* inverse of 'wants' */
+- UNIT_BOUND_BY, /* inverse of 'bind_to' */
++ UNIT_BOUND_BY, /* inverse of 'binds_to' */
+
+ /* Negative dependencies */
+ UNIT_CONFLICTS, /* inverse of 'conflicts' is 'conflicted_by' */
+@@ -100,8 +100,8 @@ enum UnitDependency {
+ UNIT_TRIGGERED_BY,
+
+ /* Propagate reloads */
+- UNIT_PROPAGATE_RELOAD_TO,
+- UNIT_PROPAGATE_RELOAD_FROM,
++ UNIT_PROPAGATES_RELOAD_TO,
++ UNIT_RELOAD_PROPAGATED_FROM,
+
+ /* Reference information for GC logic */
+ UNIT_REFERENCES, /* Inverse of 'references' is 'referenced_by' */
+diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c
+index e3e9a99..4c1d04c 100644
+--- a/src/cryptsetup/cryptsetup-generator.c
++++ b/src/cryptsetup/cryptsetup-generator.c
+@@ -116,7 +116,7 @@ static int create_disk(
+ "Description=Cryptography Setup for %%I\n"
+ "Conflicts=umount.target\n"
+ "DefaultDependencies=no\n"
+- "BindTo=%s dev-mapper-%%i.device\n"
++ "BindsTo=%s dev-mapper-%%i.device\n"
+ "After=systemd-readahead-collect.service systemd-readahead-replay.service %s\n"
+ "Before=umount.target\n",
+ d, d);
+diff --git a/units/fsck at .service.in b/units/fsck at .service.in
+index c06684b..20d1046 100644
+--- a/units/fsck at .service.in
++++ b/units/fsck at .service.in
+@@ -8,7 +8,7 @@
+ [Unit]
+ Description=File System Check on %f
+ DefaultDependencies=no
+-BindTo=%i.device
++BindsTo=%i.device
+ After=systemd-readahead-collect.service systemd-readahead-replay.service %i.device
+ Before=shutdown.target
+
diff --git a/0481-journal-align-byte-buffer-that-gets-cased-to-an-obje.patch b/0481-journal-align-byte-buffer-that-gets-cased-to-an-obje.patch
new file mode 100644
index 0000000..380b1bc
--- /dev/null
+++ b/0481-journal-align-byte-buffer-that-gets-cased-to-an-obje.patch
@@ -0,0 +1,43 @@
+From 448833f14fdd64135cf815e30020f06b46a6e57d Mon Sep 17 00:00:00 2001
+From: Kay Sievers <kay at vrfy.org>
+Date: Sun, 15 Jul 2012 14:58:29 +0200
+Subject: [PATCH] journal: align byte-buffer that gets cased to an object
+
+On Sun, Jul 15, 2012 at 2:00 PM, Koen Kooi <koen at dominion.thruhere.net> wrote:
+> | src/journal/sd-journal.c: In function 'sd_journal_process':
+> | src/journal/sd-journal.c:1891:21: warning: cast increases required alignment of target type [-Wcast-align]
+> | src/journal/sd-journal.c:1900:29: warning: cast increases required alignment of target type [-Wcast-align]
+(cherry picked from commit 19d1e4eeb6501b77ba34a29e6a632fcf775fccd5)
+
+Conflicts:
+ src/journal/sd-journal.c
+---
+ src/journal/sd-journal.c | 2 +-
+ src/shared/macro.h | 1 +
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c
+index cb0ea32..f28542f 100644
+--- a/src/journal/sd-journal.c
++++ b/src/journal/sd-journal.c
+@@ -1618,7 +1618,7 @@ static void process_inotify_event(sd_journal *j, struct inotify_event *e) {
+ }
+
+ _public_ int sd_journal_process(sd_journal *j) {
+- uint8_t buffer[sizeof(struct inotify_event) + FILENAME_MAX];
++ uint8_t buffer[sizeof(struct inotify_event) + FILENAME_MAX] _alignas_(struct inotify_event);
+
+ if (!j)
+ return -EINVAL;
+diff --git a/src/shared/macro.h b/src/shared/macro.h
+index 2c23af4..2572a96 100644
+--- a/src/shared/macro.h
++++ b/src/shared/macro.h
+@@ -45,6 +45,7 @@
+ #define _hidden_ __attribute__ ((visibility("hidden")))
+ #define _weakref_(x) __attribute__((weakref(#x)))
+ #define _introspect_(x) __attribute__((section("introspect." x)))
++#define _alignas_(x) __attribute__((aligned(__alignof(x))))
+
+ #define XSTRINGIFY(x) #x
+ #define STRINGIFY(x) XSTRINGIFY(x)
diff --git a/0482-aquire_terminal-fix-uninitialized-variable.patch b/0482-aquire_terminal-fix-uninitialized-variable.patch
new file mode 100644
index 0000000..df679a3
--- /dev/null
+++ b/0482-aquire_terminal-fix-uninitialized-variable.patch
@@ -0,0 +1,24 @@
+From 47db6a2b8a6a191b6f3a110c56120f01f6ca5f25 Mon Sep 17 00:00:00 2001
+From: Kay Sievers <kay at vrfy.org>
+Date: Sun, 15 Jul 2012 15:34:22 +0200
+Subject: [PATCH] aquire_terminal(): fix uninitialized variable
+
+./src/shared/util.c:2457:45: warning: 'r' may be used uninitialized in this function [-Wmaybe-uninitialized]
+(cherry picked from commit 4a0ff4780d4e5e3927f1cf574e05979ddeef8ae1)
+---
+ src/shared/util.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/shared/util.c b/src/shared/util.c
+index 88f5759..9dc64a0 100644
+--- a/src/shared/util.c
++++ b/src/shared/util.c
+@@ -2385,7 +2385,7 @@ int acquire_terminal(
+ bool ignore_tiocstty_eperm,
+ usec_t timeout) {
+
+- int fd = -1, notify = -1, r, wd = -1;
++ int fd = -1, notify = -1, r = 0, wd = -1;
+ usec_t ts = 0;
+ struct sigaction sa_old, sa_new;
+
diff --git a/0483-core-fix-name-of-dbus-call-parameter.patch b/0483-core-fix-name-of-dbus-call-parameter.patch
new file mode 100644
index 0000000..a2a0046
--- /dev/null
+++ b/0483-core-fix-name-of-dbus-call-parameter.patch
@@ -0,0 +1,23 @@
+From 887583863532db70806b4bf95230ed8799d0f314 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Mon, 16 Jul 2012 19:11:27 +0200
+Subject: [PATCH] core: fix name of dbus call parameter (cherry picked from
+ commit e616d1c6745f6a6df5a49a3957bd06aa8bd4648b)
+
+---
+ src/core/dbus-manager.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c
+index 62dc2c9..d8d2073 100644
+--- a/src/core/dbus-manager.c
++++ b/src/core/dbus-manager.c
+@@ -144,7 +144,7 @@
+ " <arg name=\"set\" type=\"as\" direction=\"in\"/>\n" \
+ " </method>\n" \
+ " <method name=\"ListUnitFiles\">\n" \
+- " <arg name=\"changes\" type=\"a(ss)\" direction=\"out\"/>\n" \
++ " <arg name=\"files\" type=\"a(ss)\" direction=\"out\"/>\n" \
+ " </method>\n" \
+ " <method name=\"GetUnitFileState\">\n" \
+ " <arg name=\"file\" type=\"s\" direction=\"in\"/>\n" \
diff --git a/0484-journald-don-t-enforce-monotonicity-of-realtime-cloc.patch b/0484-journald-don-t-enforce-monotonicity-of-realtime-cloc.patch
new file mode 100644
index 0000000..4ecf737
--- /dev/null
+++ b/0484-journald-don-t-enforce-monotonicity-of-realtime-cloc.patch
@@ -0,0 +1,28 @@
+From bf22cf2cd442c9e445e71bfcb08aa6ece9c88771 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Mon, 16 Jul 2012 19:26:54 +0200
+Subject: [PATCH] journald: don't enforce monotonicity of realtime clocks when
+ copying entries
+
+After all the point of the realtime clock (in contrast to the monotonic
+clock) is that it does not have to be strictly monotonic, hence don't
+enforce this when flushing the journal from /run to /var.
+(cherry picked from commit 74d29da52409ab149738ea76824679d29598e0ac)
+---
+ src/journal/journal-file.c | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
+index 405059c..8319bc3 100644
+--- a/src/journal/journal-file.c
++++ b/src/journal/journal-file.c
+@@ -2157,9 +2157,6 @@ int journal_file_copy_entry(JournalFile *from, JournalFile *to, Object *o, uint6
+ ts.monotonic < le64toh(to->header->tail_entry_monotonic))
+ return -EINVAL;
+
+- if (ts.realtime < le64toh(to->header->tail_entry_realtime))
+- return -EINVAL;
+-
+ n = journal_file_entry_n_items(o);
+ items = alloca(sizeof(EntryItem) * n);
+
diff --git a/0485-journal-use-tail-head-timestamps-from-header-for-cut.patch b/0485-journal-use-tail-head-timestamps-from-header-for-cut.patch
new file mode 100644
index 0000000..ef736e9
--- /dev/null
+++ b/0485-journal-use-tail-head-timestamps-from-header-for-cut.patch
@@ -0,0 +1,49 @@
+From 586624bd6dd1ce1e55d68ceb820754790c8ab975 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Mon, 16 Jul 2012 19:28:05 +0200
+Subject: [PATCH] journal: use tail/head timestamps from header for cutoff
+ logic
+
+We have them, they are faster to use them, so use them...
+(cherry picked from commit 162566a4a12c35e1e86e35ced1748354f7ec935e)
+---
+ src/journal/journal-file.c | 17 ++++++-----------
+ 1 file changed, 6 insertions(+), 11 deletions(-)
+
+diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
+index 8319bc3..f1b1c6f 100644
+--- a/src/journal/journal-file.c
++++ b/src/journal/journal-file.c
+@@ -2291,26 +2291,21 @@ void journal_default_metrics(JournalMetrics *m, int fd) {
+ }
+
+ int journal_file_get_cutoff_realtime_usec(JournalFile *f, usec_t *from, usec_t *to) {
+- Object *o;
+- int r;
+-
+ assert(f);
+ assert(from || to);
+
+ if (from) {
+- r = journal_file_next_entry(f, NULL, 0, DIRECTION_DOWN, &o, NULL);
+- if (r <= 0)
+- return r;
++ if (f->header->head_entry_realtime == 0)
++ return -ENOENT;
+
+- *from = le64toh(o->entry.realtime);
++ *from = le64toh(f->header->head_entry_realtime);
+ }
+
+ if (to) {
+- r = journal_file_next_entry(f, NULL, 0, DIRECTION_UP, &o, NULL);
+- if (r <= 0)
+- return r;
++ if (f->header->tail_entry_realtime == 0)
++ return -ENOENT;
+
+- *to = le64toh(o->entry.realtime);
++ *to = le64toh(f->header->tail_entry_realtime);
+ }
+
+ return 1;
diff --git a/0486-journal-actually-set-archived-files-to-archived-stat.patch b/0486-journal-actually-set-archived-files-to-archived-stat.patch
new file mode 100644
index 0000000..38cd992
--- /dev/null
+++ b/0486-journal-actually-set-archived-files-to-archived-stat.patch
@@ -0,0 +1,25 @@
+From 37dd56156fe6194a4cda6920a323d1cecd1fbdf0 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Tue, 17 Jul 2012 00:55:02 +0200
+Subject: [PATCH] journal: actually set archived files to archived state
+ (cherry picked from commit
+ cd96b3b86abb4a88cac2722bdfb6e5d4413f6831)
+
+---
+ src/journal/journal-file.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
+index f1b1c6f..6dca9f1 100644
+--- a/src/journal/journal-file.c
++++ b/src/journal/journal-file.c
+@@ -68,7 +68,8 @@ void journal_file_close(JournalFile *f) {
+ assert(f);
+
+ if (f->header) {
+- if (f->writable)
++ /* Mark the file offline. Don't override the archived state if it already is set */
++ if (f->writable && f->header->state == STATE_ONLINE)
+ f->header->state = STATE_OFFLINE;
+
+ munmap(f->header, PAGE_ALIGN(sizeof(Header)));
diff --git a/0487-service-make-start-jobs-wait-not-fail-when-an-automa.patch b/0487-service-make-start-jobs-wait-not-fail-when-an-automa.patch
new file mode 100644
index 0000000..992968e
--- /dev/null
+++ b/0487-service-make-start-jobs-wait-not-fail-when-an-automa.patch
@@ -0,0 +1,57 @@
+From a0b1b56577550fd105919d478518b958d42270c8 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Wed, 18 Jul 2012 02:28:08 +0200
+Subject: [PATCH] service: make start jobs wait, not fail, when an automatic
+ restart is queued
+
+When an automatic restart is already queued, then make subsequent start
+jobs wait until the restart can be handled (i.e. after the holdhoff
+time), instead of simply fail.
+(cherry picked from commit a8bb2e6503fa2a4ed608aa958480d27a696f5146)
+
+Conflicts:
+ TODO
+---
+ src/core/service.c | 14 ++++++++++----
+ 1 file changed, 10 insertions(+), 4 deletions(-)
+
+diff --git a/src/core/service.c b/src/core/service.c
+index 01623bd..aa37d89 100644
+--- a/src/core/service.c
++++ b/src/core/service.c
+@@ -2255,10 +2255,12 @@ static void service_enter_restart(Service *s) {
+ assert(s);
+ dbus_error_init(&error);
+
+- if (UNIT(s)->job) {
+- log_info("Job pending for unit, delaying automatic restart.");
++ if (UNIT(s)->job && UNIT(s)->job->type == JOB_STOP) {
++ /* Don't restart things if we are going down anyway */
++ log_info("Stop job pending for unit, delaying automatic restart.");
+
+- if ((r = unit_watch_timer(UNIT(s), s->restart_usec, &s->timer_watch)) < 0)
++ r = unit_watch_timer(UNIT(s), s->restart_usec, &s->timer_watch);
++ if (r < 0)
+ goto fail;
+
+ return;
+@@ -2272,6 +2274,10 @@ static void service_enter_restart(Service *s) {
+ if (r < 0)
+ goto fail;
+
++ /* Note that we stay in the SERVICE_AUTO_RESTART state here,
++ * it will be canceled as part of the service_stop() call that
++ * is executed as part of JOB_RESTART. */
++
+ log_debug("%s scheduled restart job.", UNIT(s)->id);
+ return;
+
+@@ -2470,7 +2476,7 @@ static int service_start(Unit *u) {
+ * service should be manually restarted, not started. */
+ if (s->state == SERVICE_AUTO_RESTART) {
+ log_warning("%s automatic restart is pending, must be stopped before issuing start request.", UNIT(s)->id);
+- return -ECANCELED;
++ return -EAGAIN;
+ }
+
+ assert(s->state == SERVICE_DEAD || s->state == SERVICE_FAILED);
diff --git a/0488-service-don-t-print-a-warning-if-we-are-in-autoresta.patch b/0488-service-don-t-print-a-warning-if-we-are-in-autoresta.patch
new file mode 100644
index 0000000..1edc0b1
--- /dev/null
+++ b/0488-service-don-t-print-a-warning-if-we-are-in-autoresta.patch
@@ -0,0 +1,32 @@
+From fc474f834982fe43cb2c6fd3ac190b5e226e6a82 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Wed, 18 Jul 2012 02:42:43 +0200
+Subject: [PATCH] service: don't print a warning if we are in autorestart
+ state, and can't start a unit just yet (cherry picked from
+ commit d4943dc7559dff51d4d3bb737232b9328d6726e1)
+
+---
+ src/core/service.c | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/src/core/service.c b/src/core/service.c
+index aa37d89..2e38d13 100644
+--- a/src/core/service.c
++++ b/src/core/service.c
+@@ -2473,11 +2473,12 @@ static int service_start(Unit *u) {
+ /* A service that will be restarted must be stopped first to
+ * trigger BindsTo and/or OnFailure dependencies. If a user
+ * does not want to wait for the holdoff time to elapse, the
+- * service should be manually restarted, not started. */
+- if (s->state == SERVICE_AUTO_RESTART) {
+- log_warning("%s automatic restart is pending, must be stopped before issuing start request.", UNIT(s)->id);
++ * service should be manually restarted, not started. We
++ * simply return EAGAIN here, so that any start jobs stay
++ * queued, and assume that the auto restart timer will
++ * eventually trigger the restart. */
++ if (s->state == SERVICE_AUTO_RESTART)
+ return -EAGAIN;
+- }
+
+ assert(s->state == SERVICE_DEAD || s->state == SERVICE_FAILED);
+
diff --git a/0489-journald-don-t-choke-on-journal-files-with-no-cutoff.patch b/0489-journald-don-t-choke-on-journal-files-with-no-cutoff.patch
new file mode 100644
index 0000000..13e339c
--- /dev/null
+++ b/0489-journald-don-t-choke-on-journal-files-with-no-cutoff.patch
@@ -0,0 +1,35 @@
+From 77d1d0d23adcba7af92f3237acec257bd7a5ad13 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Thu, 19 Jul 2012 02:03:22 +0200
+Subject: [PATCH] journald: don't choke on journal files with no cutoff date
+ (cherry picked from commit
+ 9f8d29834ba97052403e50ec9b358c0470fa4ceb)
+
+Conflicts:
+ TODO
+---
+ src/journal/sd-journal.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c
+index f28542f..c67069a 100644
+--- a/src/journal/sd-journal.c
++++ b/src/journal/sd-journal.c
+@@ -1665,6 +1665,8 @@ _public_ int sd_journal_get_cutoff_realtime_usec(sd_journal *j, uint64_t *from,
+ usec_t fr, t;
+
+ r = journal_file_get_cutoff_realtime_usec(f, &fr, &t);
++ if (r == -ENOENT)
++ continue;
+ if (r < 0)
+ return r;
+ if (r == 0)
+@@ -1702,6 +1704,8 @@ _public_ int sd_journal_get_cutoff_monotonic_usec(sd_journal *j, sd_id128_t boot
+ usec_t fr, t;
+
+ r = journal_file_get_cutoff_monotonic_usec(f, boot_id, &fr, &t);
++ if (r == -ENOENT)
++ continue;
+ if (r < 0)
+ return r;
+ if (r == 0)
diff --git a/0490-journal-rotate-busy-files-away-when-we-try-to-write-.patch b/0490-journal-rotate-busy-files-away-when-we-try-to-write-.patch
new file mode 100644
index 0000000..f2f3d90
--- /dev/null
+++ b/0490-journal-rotate-busy-files-away-when-we-try-to-write-.patch
@@ -0,0 +1,35 @@
+From 4c60d7172718ce2ff4887febd677f50c3f8997e9 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Thu, 19 Jul 2012 03:21:04 +0200
+Subject: [PATCH] journal: rotate busy files away when we try to write to them
+ (cherry picked from commit
+ a1a1898f7190a25a579556826379f7486f87459b)
+
+---
+ src/journal/journal-file.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
+index 6dca9f1..8390ea2 100644
+--- a/src/journal/journal-file.c
++++ b/src/journal/journal-file.c
+@@ -1911,7 +1911,9 @@ int journal_file_open_reliably(
+ if (r != -EBADMSG && /* corrupted */
+ r != -ENODATA && /* truncated */
+ r != -EHOSTDOWN && /* other machine */
+- r != -EPROTONOSUPPORT) /* incompatible feature */
++ r != -EPROTONOSUPPORT && /* incompatible feature */
++ r != -EBUSY && /* unclean shutdown */
++ r != -ESHUTDOWN /* already archived */)
+ return r;
+
+ if ((flags & O_ACCMODE) == O_RDONLY)
+@@ -1934,7 +1936,7 @@ int journal_file_open_reliably(
+ if (r < 0)
+ return -errno;
+
+- log_warning("File %s corrupted, renaming and replacing.", fname);
++ log_warning("File %s corrupted or uncleanly shut down, renaming and replacing.", fname);
+
+ return journal_file_open(fname, flags, mode, template, ret);
+ }
diff --git a/0491-journalctl-fix-assertion-failure-in-ellipsize_mem.patch b/0491-journalctl-fix-assertion-failure-in-ellipsize_mem.patch
new file mode 100644
index 0000000..1c6de8f
--- /dev/null
+++ b/0491-journalctl-fix-assertion-failure-in-ellipsize_mem.patch
@@ -0,0 +1,32 @@
+From 6223d199114c40053be2b1efd2dd735c3a22b26c Mon Sep 17 00:00:00 2001
+From: Eelco Dolstra <eelco.dolstra at logicblox.com>
+Date: Thu, 19 Jul 2012 21:12:16 +0000
+Subject: [PATCH] journalctl: fix assertion failure in ellipsize_mem()
+
+When showing the journal through "journalctl --no-pager", if the
+prefix of the log message (i.e. the date and syslog identifier) is
+less than 3 characters shorter than the width of the terminal, you
+get:
+
+Assertion 'new_length >= 3' failed at src/shared/util.c:3859, function ellipsize_mem(). Aborting.
+
+because there is not enough space for the "...". This patch add the
+necessary check.
+(cherry picked from commit b61a4660fcfb76f062c081110fb18424b0bb7b23)
+---
+ src/shared/logs-show.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/shared/logs-show.c b/src/shared/logs-show.c
+index c4731a2..6bc24fa 100644
+--- a/src/shared/logs-show.c
++++ b/src/shared/logs-show.c
+@@ -231,7 +231,7 @@ static int output_short(sd_journal *j, unsigned line, unsigned n_columns, bool s
+ printf(": [%s blob data]\n", format_bytes(bytes, sizeof(bytes), message_len));
+ } else if (message_len + n < n_columns)
+ printf(": %.*s\n", (int) message_len, message);
+- else if (n < n_columns) {
++ else if (n < n_columns && n_columns - n - 2 >= 3) {
+ char *e;
+
+ e = ellipsize_mem(message, message_len, n_columns - n - 2, 90);
diff --git a/0492-logind-fix-operation-precedence-mix-up.patch b/0492-logind-fix-operation-precedence-mix-up.patch
new file mode 100644
index 0000000..2aaa853
--- /dev/null
+++ b/0492-logind-fix-operation-precedence-mix-up.patch
@@ -0,0 +1,26 @@
+From fcc04610a51c425594eab00494215f7714653fdd Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek at in.waw.pl>
+Date: Sun, 22 Jul 2012 15:24:25 +0200
+Subject: [PATCH] logind: fix operation precedence mix-up
+
+Since + has higher precedence than ?:, and u+b is unlikely to be exactly zero,
+the timestamp would usually be set to IDLE_THRESHOLD_USEC. Fix it by
+returning either 'last activity', or 'last activity+IDLE_THRESHOLD_USEC'.
+(cherry picked from commit 17804d7f0a4002d4f0b8f1dc6e25fcca9381c13e)
+---
+ src/login/logind-session.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/login/logind-session.c b/src/login/logind-session.c
+index 1945041..e4a7473 100644
+--- a/src/login/logind-session.c
++++ b/src/login/logind-session.c
+@@ -769,7 +769,7 @@ int session_get_idle_hint(Session *s, dual_timestamp *t) {
+ b = u + IDLE_THRESHOLD_USEC < n;
+
+ if (t)
+- dual_timestamp_from_realtime(t, u + b ? IDLE_THRESHOLD_USEC : 0);
++ dual_timestamp_from_realtime(t, u + b*IDLE_THRESHOLD_USEC);
+
+ return b;
+
diff --git a/0493-systemctl-use-color-specification-understood-by-dot.patch b/0493-systemctl-use-color-specification-understood-by-dot.patch
new file mode 100644
index 0000000..0d7c65f
--- /dev/null
+++ b/0493-systemctl-use-color-specification-understood-by-dot.patch
@@ -0,0 +1,27 @@
+From ae647b0d7727b0bb2c5d38f33439a02ed71b88c3 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek at in.waw.pl>
+Date: Mon, 23 Jul 2012 18:26:31 +0200
+Subject: [PATCH] systemctl: use color specification understood by dot
+
+grey66 is aproximately equal to dark grey. Not understanding dark grey is really
+a bug in dot, but trivial to work around.
+
+Closes https://bugs.freedesktop.org/show_bug.cgi?id=45706
+(cherry picked from commit 81cf1c43c9a24834433bb5c1f0dc6eb3c1c5b44f)
+---
+ src/systemctl/systemctl.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
+index 05bf3dd..465832b 100644
+--- a/src/systemctl/systemctl.c
++++ b/src/systemctl/systemctl.c
+@@ -784,7 +784,7 @@ static int dot_one_property(const char *name, const char *prop, DBusMessageIter
+ "RequiresOverridable", "[color=\"black\"]",
+ "Requisite", "[color=\"darkblue\"]",
+ "RequisiteOverridable", "[color=\"darkblue\"]",
+- "Wants", "[color=\"darkgrey\"]",
++ "Wants", "[color=\"grey66\"]",
+ "Conflicts", "[color=\"red\"]",
+ "ConflictedBy", "[color=\"red\"]",
+ "After", "[color=\"green\"]"
diff --git a/0494-rules-avoid-mounting-raid-devices-too-early.patch b/0494-rules-avoid-mounting-raid-devices-too-early.patch
new file mode 100644
index 0000000..ec50acf
--- /dev/null
+++ b/0494-rules-avoid-mounting-raid-devices-too-early.patch
@@ -0,0 +1,30 @@
+From 99ece7b57d8a928bdf39756a60d9369f2e05d473 Mon Sep 17 00:00:00 2001
+From: Michal Schmidt <mschmidt at redhat.com>
+Date: Tue, 24 Jul 2012 09:47:33 +0200
+Subject: [PATCH] rules: avoid mounting raid devices too early
+
+/dev/md0 appears as soon as the first component of the raid array is
+added by incremental assembly rules. This is too early for systemd to
+attempt to mount the device. The device should be considered plugged
+after the raid array becomes active.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=767561
+(cherry picked from commit a96e4839d5ba1b2cbc75d9a998b5f8ccfbb39544)
+---
+ src/99-systemd.rules.in | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/src/99-systemd.rules.in b/src/99-systemd.rules.in
+index 8cc7523..ff92ebf 100644
+--- a/src/99-systemd.rules.in
++++ b/src/99-systemd.rules.in
+@@ -19,6 +19,9 @@ SUBSYSTEM=="block", KERNEL!="ram*|loop*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=
+
+ SUBSYSTEM=="block", KERNEL!="ram*|loop*", ENV{DM_UUID}=="CRYPT-*", ENV{ID_PART_TABLE_TYPE}=="", ENV{ID_FS_USAGE}=="", ENV{SYSTEMD_READY}="0"
+
++# Ignore raid devices that are not yet assembled and started
++SUBSYSTEM=="block", KERNEL=="md*", ATTR{md/array_state}=="|clear|inactive", ENV{SYSTEMD_READY}="0"
++
+ # We need a hardware independent way to identify network devices. We
+ # use the /sys/subsystem path for this. Current vanilla kernels don't
+ # actually support that hierarchy right now, however upcoming kernels
diff --git a/0495-conf-files-continue-searching-if-one-dir-fails.patch b/0495-conf-files-continue-searching-if-one-dir-fails.patch
new file mode 100644
index 0000000..d8f0dce
--- /dev/null
+++ b/0495-conf-files-continue-searching-if-one-dir-fails.patch
@@ -0,0 +1,54 @@
+From 0585e7484223c4fe85113d0f3e41cde3469b6a6e Mon Sep 17 00:00:00 2001
+From: Michal Schmidt <mschmidt at redhat.com>
+Date: Tue, 24 Jul 2012 23:18:25 +0200
+Subject: [PATCH] conf-files: continue searching if one dir fails
+
+A problem with systemd-tmpfiles has been observed where the service
+failed just because one of the configuration directories could not be
+read due to SELinux policy.
+
+Complain about the failure, but try to go on.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=839736
+(cherry picked from commit 578ac0604e6c10b267f73e114bc2215aa3f6619a)
+---
+ src/shared/conf-files.c | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/src/shared/conf-files.c b/src/shared/conf-files.c
+index 487c9a5..83e4cce 100644
+--- a/src/shared/conf-files.c
++++ b/src/shared/conf-files.c
+@@ -93,7 +93,7 @@ int conf_files_list_strv(char ***strv, const char *suffix, const char **dirs) {
+ Hashmap *fh = NULL;
+ char **files = NULL;
+ const char **p;
+- int r = 0;
++ int r;
+
+ assert(dirs);
+
+@@ -104,11 +104,10 @@ int conf_files_list_strv(char ***strv, const char *suffix, const char **dirs) {
+ }
+
+ STRV_FOREACH(p, dirs) {
+- if (files_add(fh, *p, suffix) < 0) {
+- log_error("Failed to search for files.");
+- r = -EINVAL;
+- goto finish;
+- }
++ r = files_add(fh, *p, suffix);
++ if (r < 0)
++ log_warning("Failed to search for files in %s: %s",
++ *p, strerror(-r));
+ }
+
+ files = hashmap_get_strv(fh);
+@@ -118,6 +117,7 @@ int conf_files_list_strv(char ***strv, const char *suffix, const char **dirs) {
+ goto finish;
+ }
+ qsort(files, hashmap_size(fh), sizeof(char *), base_cmp);
++ r = 0;
+
+ finish:
+ hashmap_free(fh);
diff --git a/0496-F17-restore-device-units-for-dev-ttyX.patch b/0496-F17-restore-device-units-for-dev-ttyX.patch
new file mode 100644
index 0000000..99f1bcb
--- /dev/null
+++ b/0496-F17-restore-device-units-for-dev-ttyX.patch
@@ -0,0 +1,28 @@
+From fa77059d5191170784358468443f9c6355d69527 Mon Sep 17 00:00:00 2001
+From: Michal Schmidt <mschmidt at redhat.com>
+Date: Tue, 24 Jul 2012 18:58:24 +0200
+Subject: [PATCH] F17: restore device units for /dev/ttyX
+
+This re-adds the udev rule that got removed in "getty: VC devices are
+always available, we don't need to wait until they show up" (commit
+88e995fd720a93460e7c3f38ac24512e6d96b3e8)
+
+Anaconda in F17 still needs it.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=841822
+---
+ src/99-systemd.rules.in | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/99-systemd.rules.in b/src/99-systemd.rules.in
+index ff92ebf..ea305b1 100644
+--- a/src/99-systemd.rules.in
++++ b/src/99-systemd.rules.in
+@@ -7,6 +7,7 @@
+
+ ACTION=="remove", GOTO="systemd_end"
+
++SUBSYSTEM=="tty", KERNEL=="tty[0-9]|tty1[0-2]", TAG+="systemd"
+ SUBSYSTEM=="tty", KERNEL=="tty[a-zA-Z]*|hvc*|xvc*|hvsi*", TAG+="systemd"
+
+ KERNEL=="vport*", TAG+="systemd"
diff --git a/0497-systemd-return-error-when-asked-to-stop-unknown-unit.patch b/0497-systemd-return-error-when-asked-to-stop-unknown-unit.patch
new file mode 100644
index 0000000..ce17a69
--- /dev/null
+++ b/0497-systemd-return-error-when-asked-to-stop-unknown-unit.patch
@@ -0,0 +1,34 @@
+From c13f196d31a213748ceb155d0c1c17d7daa15bee Mon Sep 17 00:00:00 2001
+From: Michal Sekletar <msekleta at redhat.com>
+Date: Tue, 19 Jun 2012 10:00:54 +0200
+Subject: [PATCH] systemd: return error when asked to stop unknown unit
+
+Command systemctl stop foo.service, will print error message, when
+foo.service is unknown to systemd, i.e. there is no unit file loaded for
+this service.
+https://bugzilla.redhat.com/show_bug.cgi?id=732874
+(cherry picked from commit 9722ef2565fdddd64deaa99d7665ca0fdafed1a5)
+
+[ Note that we had this in F17 before, but had to revert it because
+ rsyslog and syslog-ng units were not ready for it. They have been
+ fixed for some time, so let's apply this again. -- michich ]
+---
+ src/core/dbus-manager.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c
+index d8d2073..47d753e 100644
+--- a/src/core/dbus-manager.c
++++ b/src/core/dbus-manager.c
+@@ -1596,6 +1596,11 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection,
+ job_type = JOB_RELOAD;
+ }
+
++ if (job_type == JOB_STOP && u->load_state == UNIT_ERROR && unit_active_state(u) == UNIT_INACTIVE) {
++ dbus_set_error(&error, BUS_ERROR_NO_SUCH_UNIT, "Unit %s not loaded.", name);
++ return bus_send_error_reply(connection, message, &error, -EPERM);
++ }
++
+ if ((job_type == JOB_START && u->refuse_manual_start) ||
+ (job_type == JOB_STOP && u->refuse_manual_stop) ||
+ ((job_type == JOB_RESTART || job_type == JOB_TRY_RESTART) &&
diff --git a/0498-modules-load-fix-kernel-cmdline-parsing.patch b/0498-modules-load-fix-kernel-cmdline-parsing.patch
new file mode 100644
index 0000000..fc02bdb
--- /dev/null
+++ b/0498-modules-load-fix-kernel-cmdline-parsing.patch
@@ -0,0 +1,31 @@
+From 878d4be69c4dfea7b7f0472d2ab8e90567a69321 Mon Sep 17 00:00:00 2001
+From: Michal Schmidt <mschmidt at redhat.com>
+Date: Wed, 25 Jul 2012 01:45:16 +0200
+Subject: [PATCH] modules-load: fix kernel cmdline parsing (cherry picked from
+ commit b2fc39a6838f08e6050b681e0c93f95bc6176786)
+
+---
+ src/modules-load/modules-load.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/modules-load/modules-load.c b/src/modules-load/modules-load.c
+index 5c91a92..e228fcf 100644
+--- a/src/modules-load/modules-load.c
++++ b/src/modules-load/modules-load.c
+@@ -92,14 +92,14 @@ static int parse_proc_cmdline(void) {
+
+ if (startswith(word, "modules-load=")) {
+
+- r = add_modules(word + 7);
++ r = add_modules(word + 13);
+ if (r < 0)
+ goto finish;
+
+ } else if (startswith(word, "rd.modules-load=")) {
+
+ if (in_initrd()) {
+- r = add_modules(word + 10);
++ r = add_modules(word + 16);
+ if (r < 0)
+ goto finish;
+ }
diff --git a/0499-units-add-the-modules-load-cmdline-parameters-to-the.patch b/0499-units-add-the-modules-load-cmdline-parameters-to-the.patch
new file mode 100644
index 0000000..50cb8ab
--- /dev/null
+++ b/0499-units-add-the-modules-load-cmdline-parameters-to-the.patch
@@ -0,0 +1,28 @@
+From 6ac88d47f19cf4c22433084c590db41903d17610 Mon Sep 17 00:00:00 2001
+From: Michal Schmidt <mschmidt at redhat.com>
+Date: Wed, 25 Jul 2012 08:48:50 +0200
+Subject: [PATCH] units: add the modules-load cmdline parameters to the unit
+ conditions
+
+For 'modules-load=' and 'rd.modules-load=' to be effective,
+systemd-modules-load.service must be started. It is currently
+conditional on the existence of config files. Add the presence of the
+cmdline parameters to the triggering conditions.
+(cherry picked from commit 22cfbae09d7791c52901c53b240e28c63eee93d4)
+---
+ units/systemd-modules-load.service.in | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/units/systemd-modules-load.service.in b/units/systemd-modules-load.service.in
+index 90d1fe0..248b5d1 100644
+--- a/units/systemd-modules-load.service.in
++++ b/units/systemd-modules-load.service.in
+@@ -18,6 +18,8 @@ ConditionDirectoryNotEmpty=|/usr/lib/modules-load.d
+ ConditionDirectoryNotEmpty=|/usr/local/lib/modules-load.d
+ ConditionDirectoryNotEmpty=|/etc/modules-load.d
+ ConditionDirectoryNotEmpty=|/run/modules-load.d
++ConditionKernelCommandLine=|modules-load
++ConditionKernelCommandLine=|rd.modules-load
+
+ [Service]
+ Type=oneshot
diff --git a/systemd.spec b/systemd.spec
index d88820a..fc04ea4 100644
--- a/systemd.spec
+++ b/systemd.spec
@@ -3,7 +3,7 @@
Name: systemd
Url: http://www.freedesktop.org/wiki/Software/systemd
Version: 44
-Release: 17%{?gitcommit:.git%{gitcommit}}%{?dist}
+Release: 18%{?gitcommit:.git%{gitcommit}}%{?dist}
License: GPLv2+
Group: System Environment/Base
Summary: A System and Service Manager
@@ -498,6 +498,67 @@ Patch0435: 0435-login-wrap-CanTTY-and-CanGraphical-seat-attributes-i.patch
Patch0436: 0436-preset-don-t-look-for-preset-files-in-lib-unless-usr.patch
Patch0437: 0437-service-fix-incorrect-argument.patch
Patch0438: 0438-service-pass-via-FAILED-DEAD-before-going-to-AUTO_RE.patch
+Patch0439: 0439-core-make-systemd.confirm_spawn-1-actually-work.patch
+Patch0440: 0440-modules-load-parse-driver-rd.driver-kernel-command-l.patch
+Patch0441: 0441-modules-load-don-t-fail-on-builtin-modules-better-pr.patch
+Patch0442: 0442-modules-load-fix-return-value.patch
+Patch0443: 0443-modules-load-use-correct-va_list-logging-function.patch
+Patch0444: 0444-mount-split-adding-of-extras-from-mount_load.patch
+Patch0445: 0445-mount-load-only-if-we-there-s-mountinfo-or-fragment.patch
+Patch0446: 0446-remount-fs-also-remount-usr-according-to-fstab.patch
+Patch0447: 0447-manager-serialize-deserialize-job-counters-across-re.patch
+Patch0448: 0448-timedated-replace-systemd-timedated-ntp.target-logic.patch
+Patch0449: 0449-timedate-fix-ntp-units-comment.patch
+Patch0450: 0450-units-rename-systemd-debug-shell.service-to-debug-sh.patch
+Patch0451: 0451-modules-load-rename-kernel-command-line-option-to-rd.patch
+Patch0452: 0452-timedated-replace-ntp-units-file-with-an-ntp-units.d.patch
+Patch0453: 0453-journal-fix-iteration-through-journal-if-one-file-is.patch
+Patch0454: 0454-journald-handle-proc-kmsg-reads-returning-0-more-nic.patch
+Patch0455: 0455-timedate-uniq-ify-ntp-units-list.patch
+Patch0456: 0456-load-fragment-a-few-modernizations.patch
+Patch0457: 0457-hashmap-make-hashmap_clear-work-on-NULL-hashmaps.patch
+Patch0458: 0458-mount-setup-don-t-complain-if-we-try-to-fix-the-labe.patch
+Patch0459: 0459-man-explain-StartLimitRate-in-conjunction-with-Resta.patch
+Patch0460: 0460-man-clarify-that-StartLimitInterval-also-applies-to-.patch
+Patch0461: 0461-service-flush-the-start-counter-in-systemctl-reset-f.patch
+Patch0462: 0462-man-document-Restart-a-bit-more.patch
+Patch0463: 0463-man-update-man-pages-to-reflect-the-driver-to-load-m.patch
+Patch0464: 0464-paranoia-refuse-rm_rf.patch
+Patch0465: 0465-unit-Move-UnitType-definitions-from-core-unit.c-to-s.patch
+Patch0466: 0466-systemctl-check-the-argument-to-t-for-invalid-values.patch
+Patch0467: 0467-unit-name-remove-unit_name_is_valid_no_type-and-move.patch
+Patch0468: 0468-unit-get-rid-of-UnitVTable.suffix-which-is-now-unuse.patch
+Patch0469: 0469-unit-Move-UnitLoadState-definitions-from-core-unit.c.patch
+Patch0470: 0470-systemctl-filter-shown-units-by-their-load-state.patch
+Patch0471: 0471-mount-fix-for-complex-automounts.patch
+Patch0472: 0472-util-add-extra-safety-check-to-in_initrd.patch
+Patch0473: 0473-journal-fix-interleaving-of-files-with-different-tim.patch
+Patch0474: 0474-journal-fix-bisection-logic-for-first-entry.patch
+Patch0475: 0475-journal-fix-bad-memory-access.patch
+Patch0476: 0476-journal-fix-seeking-by-realtime-seqnum.patch
+Patch0477: 0477-journal-check-fields-we-search-for-more-carefully.patch
+Patch0478: 0478-util-temporarily-ignore-SIGHUP-while-we-are-issuing-.patch
+Patch0479: 0479-container-when-shutting-down-in-a-container-don-t-de.patch
+Patch0480: 0480-unit-rename-BindTo-to-BindsTo.patch
+Patch0481: 0481-journal-align-byte-buffer-that-gets-cased-to-an-obje.patch
+Patch0482: 0482-aquire_terminal-fix-uninitialized-variable.patch
+Patch0483: 0483-core-fix-name-of-dbus-call-parameter.patch
+Patch0484: 0484-journald-don-t-enforce-monotonicity-of-realtime-cloc.patch
+Patch0485: 0485-journal-use-tail-head-timestamps-from-header-for-cut.patch
+Patch0486: 0486-journal-actually-set-archived-files-to-archived-stat.patch
+Patch0487: 0487-service-make-start-jobs-wait-not-fail-when-an-automa.patch
+Patch0488: 0488-service-don-t-print-a-warning-if-we-are-in-autoresta.patch
+Patch0489: 0489-journald-don-t-choke-on-journal-files-with-no-cutoff.patch
+Patch0490: 0490-journal-rotate-busy-files-away-when-we-try-to-write-.patch
+Patch0491: 0491-journalctl-fix-assertion-failure-in-ellipsize_mem.patch
+Patch0492: 0492-logind-fix-operation-precedence-mix-up.patch
+Patch0493: 0493-systemctl-use-color-specification-understood-by-dot.patch
+Patch0494: 0494-rules-avoid-mounting-raid-devices-too-early.patch
+Patch0495: 0495-conf-files-continue-searching-if-one-dir-fails.patch
+Patch0496: 0496-F17-restore-device-units-for-dev-ttyX.patch
+Patch0497: 0497-systemd-return-error-when-asked-to-stop-unknown-unit.patch
+Patch0498: 0498-modules-load-fix-kernel-cmdline-parsing.patch
+Patch0499: 0499-units-add-the-modules-load-cmdline-parameters-to-the.patch
# For sysvinit tools
Obsoletes: SysVinit < 2.86-24, sysvinit < 2.86-24
@@ -519,8 +580,8 @@ Obsoletes: systemd < 38-5
# old nfs-server.service forked daemons from ExecStartPre/Post:
Conflicts: nfs-utils < 1:1.2.6
# usage of 'systemctl stop' on a non-existent unit in ExecStartPre:
-#Conflicts: rsyslog < 5.8.10-2
-#Conflicts: syslog-ng < 3.2.5-15
+Conflicts: rsyslog < 5.8.10-2
+Conflicts: syslog-ng < 3.2.5-15
%description
systemd is a system and service manager for Linux, compatible with
@@ -883,6 +944,17 @@ mv /etc/systemd/system/default.target.save /etc/systemd/system/default.target >/
%{_bindir}/systemd-analyze
%changelog
+* Tue Jul 24 2012 Michal Schmidt <mschmidt at redhat.com> - 44-18
+- Backports from upstream:
+- rework the handling of ntp services in timedated (#821813)
+- rename systemd-debug-shell.service to debug-shell.service
+- support modules-load= boot parameter
+- "systemctl reset-failed" now resets the start rate limit
+- systemctl can filter by load state
+- parse BindsTo=
+- bring back error reporting when stopping unknown units (#732874)
+- many bugfixes (#817760, #835848, #767561, #839736, #841822, ...)
+
* Tue Jun 26 2012 Michal Schmidt <mschmidt at redhat.com> - 44-17
- Temporarily revert patch for #732874 until the syslog units are fixed.
- logind improvements (CanTTY, CanGraphical, 'closing' session state).
More information about the scm-commits
mailing list