mirror of
https://github.com/flatcar/scripts.git
synced 2025-10-02 19:11:20 +02:00
clean(sys-apps/systemd) remove unused systemd patches
These are no longer used by any ebuild, so drop them to clean things up
This commit is contained in:
parent
2cc64031dc
commit
5cff6f999b
@ -1,84 +0,0 @@
|
||||
From a7ca0f06aaa0e0ae3b5eada2cdece8c9766bff1a Mon Sep 17 00:00:00 2001
|
||||
From: Lennart Poettering <lennart@poettering.net>
|
||||
Date: Fri, 26 Jul 2013 17:32:19 +0200
|
||||
Subject: [PATCH 1/5] logind: update state file after generating the session
|
||||
fifo, not before
|
||||
|
||||
https://bugs.freedesktop.org/show_bug.cgi?id=67273
|
||||
---
|
||||
src/login/logind-dbus.c | 7 ++++++-
|
||||
src/login/logind-session-dbus.c | 4 ++++
|
||||
src/machine/machined-dbus.c | 3 ++-
|
||||
3 files changed, 12 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
|
||||
index 39af637..b5e975a 100644
|
||||
--- a/src/login/logind-dbus.c
|
||||
+++ b/src/login/logind-dbus.c
|
||||
@@ -643,6 +643,10 @@ static int bus_manager_create_session(Manager *m, DBusMessage *message) {
|
||||
|
||||
session->create_message = dbus_message_ref(message);
|
||||
|
||||
+ /* Now, let's wait until the slice unit and stuff got
|
||||
+ * created. We send the reply back from
|
||||
+ * session_send_create_reply().*/
|
||||
+
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
@@ -2356,7 +2360,6 @@ DBusHandlerResult bus_message_filter(
|
||||
if (streq_ptr(path, s->scope_job)) {
|
||||
free(s->scope_job);
|
||||
s->scope_job = NULL;
|
||||
- session_save(s);
|
||||
|
||||
if (s->started) {
|
||||
if (streq(result, "done"))
|
||||
@@ -2366,6 +2369,8 @@ DBusHandlerResult bus_message_filter(
|
||||
session_send_create_reply(s, &error);
|
||||
}
|
||||
}
|
||||
+
|
||||
+ session_save(s);
|
||||
}
|
||||
|
||||
session_add_to_gc_queue(s);
|
||||
diff --git a/src/login/logind-session-dbus.c b/src/login/logind-session-dbus.c
|
||||
index 62b9ffd..210f756 100644
|
||||
--- a/src/login/logind-session-dbus.c
|
||||
+++ b/src/login/logind-session-dbus.c
|
||||
@@ -535,6 +535,10 @@ int session_send_create_reply(Session *s, DBusError *error) {
|
||||
if (!s->create_message)
|
||||
return 0;
|
||||
|
||||
+ /* This is called after the session scope was successfully
|
||||
+ * created, and finishes where bus_manager_create_session()
|
||||
+ * left off. */
|
||||
+
|
||||
if (error) {
|
||||
DBusError buffer;
|
||||
|
||||
diff --git a/src/machine/machined-dbus.c b/src/machine/machined-dbus.c
|
||||
index 1e8bc60..6c4d50b 100644
|
||||
--- a/src/machine/machined-dbus.c
|
||||
+++ b/src/machine/machined-dbus.c
|
||||
@@ -543,7 +543,6 @@ DBusHandlerResult bus_message_filter(
|
||||
if (streq_ptr(path, mm->scope_job)) {
|
||||
free(mm->scope_job);
|
||||
mm->scope_job = NULL;
|
||||
- machine_save(mm);
|
||||
|
||||
if (mm->started) {
|
||||
if (streq(result, "done"))
|
||||
@@ -553,6 +552,8 @@ DBusHandlerResult bus_message_filter(
|
||||
machine_send_create_reply(mm, &error);
|
||||
}
|
||||
}
|
||||
+
|
||||
+ machine_save(mm);
|
||||
}
|
||||
|
||||
machine_add_to_gc_queue(mm);
|
||||
--
|
||||
1.8.3.2
|
||||
|
@ -1,25 +0,0 @@
|
||||
From 64fa15a7ca9c276d28413567c74a1d360fbdc975 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
|
||||
Date: Wed, 31 Jul 2013 23:12:17 +0200
|
||||
Subject: [PATCH 2/5] Add /usr/share/keymaps to localectl supported locations.
|
||||
|
||||
This is the standard upstream location where kbd installs keymaps.
|
||||
---
|
||||
src/locale/localectl.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/locale/localectl.c b/src/locale/localectl.c
|
||||
index cd7356a..8259c0a 100644
|
||||
--- a/src/locale/localectl.c
|
||||
+++ b/src/locale/localectl.c
|
||||
@@ -538,6 +538,7 @@ static int list_vconsole_keymaps(DBusConnection *bus, char **args, unsigned n) {
|
||||
if (!keymaps)
|
||||
return log_oom();
|
||||
|
||||
+ nftw("/usr/share/keymaps/", nftw_cb, 20, FTW_MOUNT|FTW_PHYS);
|
||||
nftw("/usr/share/kbd/keymaps/", nftw_cb, 20, FTW_MOUNT|FTW_PHYS);
|
||||
nftw("/usr/lib/kbd/keymaps/", nftw_cb, 20, FTW_MOUNT|FTW_PHYS);
|
||||
nftw("/lib/kbd/keymaps/", nftw_cb, 20, FTW_MOUNT|FTW_PHYS);
|
||||
--
|
||||
1.8.3.2
|
||||
|
@ -1,90 +0,0 @@
|
||||
From 9c26db4da7a474b024fcdc97ea490280d86777e1 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Reisner <dreisner@archlinux.org>
|
||||
Date: Wed, 24 Jul 2013 11:10:05 -0400
|
||||
Subject: [PATCH 3/5] tmpfiles: support passing --prefix multiple times
|
||||
|
||||
---
|
||||
man/systemd-tmpfiles.xml | 3 ++-
|
||||
src/tmpfiles/tmpfiles.c | 24 +++++++++++++++++++++---
|
||||
2 files changed, 23 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/man/systemd-tmpfiles.xml b/man/systemd-tmpfiles.xml
|
||||
index 405a9f1..b0f2d9c 100644
|
||||
--- a/man/systemd-tmpfiles.xml
|
||||
+++ b/man/systemd-tmpfiles.xml
|
||||
@@ -121,7 +121,8 @@
|
||||
<term><option>--prefix=PATH</option></term>
|
||||
<listitem><para>Only apply rules that
|
||||
apply to paths with the specified
|
||||
- prefix.</para></listitem>
|
||||
+ prefix. This option can be specified
|
||||
+ multiple times.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
|
||||
diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
|
||||
index eae993e..cb15133 100644
|
||||
--- a/src/tmpfiles/tmpfiles.c
|
||||
+++ b/src/tmpfiles/tmpfiles.c
|
||||
@@ -105,7 +105,7 @@ static bool arg_create = false;
|
||||
static bool arg_clean = false;
|
||||
static bool arg_remove = false;
|
||||
|
||||
-static const char *arg_prefix = NULL;
|
||||
+static char **include_prefixes = NULL;
|
||||
|
||||
static const char conf_file_dirs[] =
|
||||
"/etc/tmpfiles.d\0"
|
||||
@@ -1018,6 +1018,21 @@ static bool item_equal(Item *a, Item *b) {
|
||||
return true;
|
||||
}
|
||||
|
||||
+static bool should_include_path(const char *path) {
|
||||
+ char **prefix;
|
||||
+
|
||||
+ /* no explicit paths specified for inclusion, so everything is valid */
|
||||
+ if (strv_length(include_prefixes) == 0)
|
||||
+ return true;
|
||||
+
|
||||
+ STRV_FOREACH(prefix, include_prefixes) {
|
||||
+ if (path_startswith(path, *prefix))
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
static int parse_line(const char *fname, unsigned line, const char *buffer) {
|
||||
_cleanup_item_free_ Item *i = NULL;
|
||||
Item *existing;
|
||||
@@ -1119,7 +1134,7 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) {
|
||||
|
||||
path_kill_slashes(i->path);
|
||||
|
||||
- if (arg_prefix && !path_startswith(i->path, arg_prefix))
|
||||
+ if (!should_include_path(i->path))
|
||||
return 0;
|
||||
|
||||
if (user && !streq(user, "-")) {
|
||||
@@ -1258,7 +1273,8 @@ static int parse_argv(int argc, char *argv[]) {
|
||||
break;
|
||||
|
||||
case ARG_PREFIX:
|
||||
- arg_prefix = optarg;
|
||||
+ if (strv_extend(&include_prefixes, optarg) < 0)
|
||||
+ return log_oom();
|
||||
break;
|
||||
|
||||
case '?':
|
||||
@@ -1423,6 +1439,8 @@ finish:
|
||||
hashmap_free(items);
|
||||
hashmap_free(globs);
|
||||
|
||||
+ strv_free(include_prefixes);
|
||||
+
|
||||
set_free_free(unix_sockets);
|
||||
|
||||
label_finish();
|
||||
--
|
||||
1.8.3.2
|
||||
|
@ -1,138 +0,0 @@
|
||||
From 059e02a48e58da81591ebd34e87f928269d77929 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Reisner <dreisner@archlinux.org>
|
||||
Date: Wed, 24 Jul 2013 11:19:24 -0400
|
||||
Subject: [PATCH 4/5] tmpfiles: introduce --exclude-prefix
|
||||
|
||||
The opposite of --prefix, allows specifying path prefixes which should
|
||||
be skipped when processing rules.
|
||||
---
|
||||
man/systemd-tmpfiles.xml | 7 +++++
|
||||
shell-completion/systemd-zsh-completion.zsh | 1 +
|
||||
src/tmpfiles/tmpfiles.c | 44 ++++++++++++++++++-----------
|
||||
3 files changed, 36 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/man/systemd-tmpfiles.xml b/man/systemd-tmpfiles.xml
|
||||
index b0f2d9c..403592d 100644
|
||||
--- a/man/systemd-tmpfiles.xml
|
||||
+++ b/man/systemd-tmpfiles.xml
|
||||
@@ -124,6 +124,13 @@
|
||||
prefix. This option can be specified
|
||||
multiple times.</para></listitem>
|
||||
</varlistentry>
|
||||
+ <varlistentry>
|
||||
+ <term><option>--exclude-prefix=PATH</option></term>
|
||||
+ <listitem><para>Ignore rules that
|
||||
+ apply to paths with the specified
|
||||
+ prefix. This option can be specified
|
||||
+ multiple times.</para></listitem>
|
||||
+ </varlistentry>
|
||||
|
||||
|
||||
<varlistentry>
|
||||
diff --git a/shell-completion/systemd-zsh-completion.zsh b/shell-completion/systemd-zsh-completion.zsh
|
||||
index c85e00e..7aebbcd 100644
|
||||
--- a/shell-completion/systemd-zsh-completion.zsh
|
||||
+++ b/shell-completion/systemd-zsh-completion.zsh
|
||||
@@ -249,6 +249,7 @@ _ctls()
|
||||
'--clean[Clean up all files and directories with an age parameter configured.]' \
|
||||
'--remove[All files and directories marked with r, R in the configuration files are removed.]' \
|
||||
'--prefix=[Only apply rules that apply to paths with the specified prefix.]' \
|
||||
+ '--exclude-prefix=[Ignore rules that apply to paths with the specified prefix.]' \
|
||||
'--help[Prints a short help text and exits.]' \
|
||||
'*::files:_files'
|
||||
;;
|
||||
diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
|
||||
index cb15133..5eca82a 100644
|
||||
--- a/src/tmpfiles/tmpfiles.c
|
||||
+++ b/src/tmpfiles/tmpfiles.c
|
||||
@@ -106,6 +106,7 @@ static bool arg_clean = false;
|
||||
static bool arg_remove = false;
|
||||
|
||||
static char **include_prefixes = NULL;
|
||||
+static char **exclude_prefixes = NULL;
|
||||
|
||||
static const char conf_file_dirs[] =
|
||||
"/etc/tmpfiles.d\0"
|
||||
@@ -1021,16 +1022,19 @@ static bool item_equal(Item *a, Item *b) {
|
||||
static bool should_include_path(const char *path) {
|
||||
char **prefix;
|
||||
|
||||
- /* no explicit paths specified for inclusion, so everything is valid */
|
||||
- if (strv_length(include_prefixes) == 0)
|
||||
- return true;
|
||||
+ STRV_FOREACH(prefix, exclude_prefixes) {
|
||||
+ if (path_startswith(path, *prefix))
|
||||
+ return false;
|
||||
+ }
|
||||
|
||||
STRV_FOREACH(prefix, include_prefixes) {
|
||||
if (path_startswith(path, *prefix))
|
||||
return true;
|
||||
}
|
||||
|
||||
- return false;
|
||||
+ /* no matches, so we should include this path only if we
|
||||
+ * have no whitelist at all */
|
||||
+ return strv_length(include_prefixes) == 0;
|
||||
}
|
||||
|
||||
static int parse_line(const char *fname, unsigned line, const char *buffer) {
|
||||
@@ -1219,11 +1223,12 @@ static int help(void) {
|
||||
|
||||
printf("%s [OPTIONS...] [CONFIGURATION FILE...]\n\n"
|
||||
"Creates, deletes and cleans up volatile and temporary files and directories.\n\n"
|
||||
- " -h --help Show this help\n"
|
||||
- " --create Create marked files/directories\n"
|
||||
- " --clean Clean up marked directories\n"
|
||||
- " --remove Remove marked files/directories\n"
|
||||
- " --prefix=PATH Only apply rules that apply to paths with the specified prefix\n",
|
||||
+ " -h --help Show this help\n"
|
||||
+ " --create Create marked files/directories\n"
|
||||
+ " --clean Clean up marked directories\n"
|
||||
+ " --remove Remove marked files/directories\n"
|
||||
+ " --prefix=PATH Only apply rules that apply to paths with the specified prefix\n"
|
||||
+ " --exclude-prefix=PATH Ignore rules that apply to paths with the specified prefix\n",
|
||||
program_invocation_short_name);
|
||||
|
||||
return 0;
|
||||
@@ -1235,16 +1240,18 @@ static int parse_argv(int argc, char *argv[]) {
|
||||
ARG_CREATE,
|
||||
ARG_CLEAN,
|
||||
ARG_REMOVE,
|
||||
- ARG_PREFIX
|
||||
+ ARG_PREFIX,
|
||||
+ ARG_EXCLUDE_PREFIX,
|
||||
};
|
||||
|
||||
static const struct option options[] = {
|
||||
- { "help", no_argument, NULL, 'h' },
|
||||
- { "create", no_argument, NULL, ARG_CREATE },
|
||||
- { "clean", no_argument, NULL, ARG_CLEAN },
|
||||
- { "remove", no_argument, NULL, ARG_REMOVE },
|
||||
- { "prefix", required_argument, NULL, ARG_PREFIX },
|
||||
- { NULL, 0, NULL, 0 }
|
||||
+ { "help", no_argument, NULL, 'h' },
|
||||
+ { "create", no_argument, NULL, ARG_CREATE },
|
||||
+ { "clean", no_argument, NULL, ARG_CLEAN },
|
||||
+ { "remove", no_argument, NULL, ARG_REMOVE },
|
||||
+ { "prefix", required_argument, NULL, ARG_PREFIX },
|
||||
+ { "exclude-prefix", required_argument, NULL, ARG_EXCLUDE_PREFIX },
|
||||
+ { NULL, 0, NULL, 0 }
|
||||
};
|
||||
|
||||
int c;
|
||||
@@ -1277,6 +1284,11 @@ static int parse_argv(int argc, char *argv[]) {
|
||||
return log_oom();
|
||||
break;
|
||||
|
||||
+ case ARG_EXCLUDE_PREFIX:
|
||||
+ if (strv_extend(&exclude_prefixes, optarg) < 0)
|
||||
+ return log_oom();
|
||||
+ break;
|
||||
+
|
||||
case '?':
|
||||
return -EINVAL;
|
||||
|
||||
--
|
||||
1.8.3.2
|
||||
|
@ -1,23 +0,0 @@
|
||||
From a7b85011f13bf2a90cfcfad1f3d2ca2deebaa2f1 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Reisner <dreisner@archlinux.org>
|
||||
Date: Wed, 24 Jul 2013 11:58:35 -0400
|
||||
Subject: [PATCH 5/5] tmpfiles-setup: exclude /dev prefixes files
|
||||
|
||||
Fixes Arch Linux bug: https://bugs.archlinux.org/task/36259
|
||||
---
|
||||
units/systemd-tmpfiles-setup.service.in | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/units/systemd-tmpfiles-setup.service.in b/units/systemd-tmpfiles-setup.service.in
|
||||
index 67c7d4a..6f98063 100644
|
||||
--- a/units/systemd-tmpfiles-setup.service.in
|
||||
+++ b/units/systemd-tmpfiles-setup.service.in
|
||||
@@ -21,4 +21,4 @@ ConditionDirectoryNotEmpty=|/run/tmpfiles.d
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
-ExecStart=@rootbindir@/systemd-tmpfiles --create --remove
|
||||
+ExecStart=@rootbindir@/systemd-tmpfiles --create --remove --exclude-prefix=/dev
|
||||
--
|
||||
1.8.3.2
|
||||
|
@ -1,43 +0,0 @@
|
||||
From ac4c8d6da8b5ebc35f02c9c6cb7595be7b134a05 Mon Sep 17 00:00:00 2001
|
||||
From: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
|
||||
Date: Thu, 12 Sep 2013 01:50:16 +0000
|
||||
Subject: Allow tabs in environment files
|
||||
|
||||
bash allows them, and so should we.
|
||||
|
||||
string_has_cc is changed to allow tabs, and if they are not wanted,
|
||||
they must be now checked for explicitly. There are two other callers,
|
||||
apart from the env file loaders, and one already checked anyway, and
|
||||
the other is changed to check.
|
||||
|
||||
https://bugs.freedesktop.org/show_bug.cgi?id=68592
|
||||
https://bugs.gentoo.org/show_bug.cgi?id=481554
|
||||
---
|
||||
diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c
|
||||
index 0437e33..6a43aeb 100644
|
||||
--- a/src/hostname/hostnamed.c
|
||||
+++ b/src/hostname/hostnamed.c
|
||||
@@ -553,7 +553,8 @@ static DBusHandlerResult hostname_message_handler(
|
||||
* safe than sorry */
|
||||
if (k == PROP_ICON_NAME && !filename_is_safe(name))
|
||||
return bus_send_error_reply(connection, message, NULL, -EINVAL);
|
||||
- if (k == PROP_PRETTY_HOSTNAME && string_has_cc(name))
|
||||
+ if (k == PROP_PRETTY_HOSTNAME &&
|
||||
+ (string_has_cc(name) || chars_intersect(name, "\t")))
|
||||
return bus_send_error_reply(connection, message, NULL, -EINVAL);
|
||||
if (k == PROP_CHASSIS && !valid_chassis(name))
|
||||
return bus_send_error_reply(connection, message, NULL, -EINVAL);
|
||||
diff --git a/src/shared/util.c b/src/shared/util.c
|
||||
index 1dde8af..ad463e8 100644
|
||||
--- a/src/shared/util.c
|
||||
+++ b/src/shared/util.c
|
||||
@@ -5311,6 +5311,10 @@ bool string_is_safe(const char *p) {
|
||||
return true;
|
||||
}
|
||||
|
||||
+/**
|
||||
+ * Check if a string contains control characters.
|
||||
+ * Spaces and tabs are not considered control characters.
|
||||
+ */
|
||||
bool string_has_cc(const char *p) {
|
||||
const char *t;
|
@ -1,22 +0,0 @@
|
||||
From da2620a5f878ad5c8d8d51992528cb3e637c7d1f Mon Sep 17 00:00:00 2001
|
||||
From: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
|
||||
Date: Thu, 12 Sep 2013 14:03:16 +0000
|
||||
Subject: Actually allow tabs in environment files
|
||||
|
||||
Fixup for ac4c8d6da8b5e.
|
||||
---
|
||||
diff --git a/src/shared/util.c b/src/shared/util.c
|
||||
index ad463e8..9a075fa 100644
|
||||
--- a/src/shared/util.c
|
||||
+++ b/src/shared/util.c
|
||||
@@ -5321,7 +5321,7 @@ bool string_has_cc(const char *p) {
|
||||
assert(p);
|
||||
|
||||
for (t = p; *t; t++)
|
||||
- if (*t > 0 && *t < ' ')
|
||||
+ if (*t > 0 && *t < ' ' && *t != '\t')
|
||||
return true;
|
||||
|
||||
return false;
|
||||
--
|
||||
cgit v0.9.0.2-2-gbebe
|
Loading…
x
Reference in New Issue
Block a user