forked from pool/systemd
Accepting request 139993 from Base:System
- udev is GPL-2.0, the rest remains LGPL-2.1+ (bnc#787824) OBS-URL: https://build.opensuse.org/request/show/139993 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=111
This commit is contained in:
parent
50622b1768
commit
6dd417b710
@ -8,8 +8,8 @@ splash screen to verbose when a password is asked...
|
||||
---
|
||||
diff --git a/src/ask-password-api.c b/src/ask-password-api.c
|
||||
index da967ab..b89bcea 100644
|
||||
--- a/src/ask-password-api.c
|
||||
+++ b/src/ask-password-api.c
|
||||
--- a/src/shared/ask-password-api.c
|
||||
+++ b/src/shared/ask-password-api.c
|
||||
@@ -62,6 +62,9 @@ int ask_password_tty(
|
||||
bool reset_tty = false;
|
||||
bool silent_mode = false;
|
||||
|
130
0001-Reinstate-TIMEOUT-handling.patch
Normal file
130
0001-Reinstate-TIMEOUT-handling.patch
Normal file
@ -0,0 +1,130 @@
|
||||
Without treating events with timeouts specially some drivers would
|
||||
cause a 30 seconds stall on boot: .
|
||||
|
||||
I also received reports of some drivers not working at all, even
|
||||
after the timeout.
|
||||
|
||||
We will remove this patch when more drivers have been fixed in
|
||||
the kernel (3.4?).
|
||||
|
||||
This reverts 43d5c5f03645c4b842659f9b5bd0ae465e885e92 and
|
||||
57c6f8ae5f52a6e8ffc66a54966346f733dded39.
|
||||
---
|
||||
|
||||
Note: this is mostly a FYI, and whether or not it makes sense
|
||||
to apply this upstream depends on how big problems other report
|
||||
regarding this issue.
|
||||
|
||||
src/libudev-device.c | 19 +++++++++++++++++++
|
||||
src/libudev-private.h | 1 +
|
||||
src/udevd.c | 13 ++++++++++---
|
||||
4 files changed, 32 insertions(+), 3 deletions(-)
|
||||
|
||||
Index: systemd-190/src/libudev/libudev-device.c
|
||||
===================================================================
|
||||
--- systemd-190.orig/src/libudev/libudev-device.c
|
||||
+++ systemd-190/src/libudev/libudev-device.c
|
||||
@@ -68,6 +68,7 @@ struct udev_device {
|
||||
struct udev_list tags_list;
|
||||
unsigned long long int seqnum;
|
||||
unsigned long long int usec_initialized;
|
||||
+ int timeout;
|
||||
int devlink_priority;
|
||||
int refcount;
|
||||
dev_t devnum;
|
||||
@@ -162,6 +163,21 @@ static int udev_device_set_devnum(struct
|
||||
return 0;
|
||||
}
|
||||
|
||||
+int udev_device_get_timeout(struct udev_device *udev_device)
|
||||
+{
|
||||
+ return udev_device->timeout;
|
||||
+}
|
||||
+
|
||||
+static int udev_device_set_timeout(struct udev_device *udev_device, int timeout)
|
||||
+{
|
||||
+ char num[32];
|
||||
+
|
||||
+ udev_device->timeout = timeout;
|
||||
+ snprintf(num, sizeof(num), "%u", timeout);
|
||||
+ udev_device_add_property(udev_device, "TIMEOUT", num);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
const char *udev_device_get_devpath_old(struct udev_device *udev_device)
|
||||
{
|
||||
return udev_device->devpath_old;
|
||||
@@ -418,6 +434,8 @@ void udev_device_add_property_from_strin
|
||||
udev_device_set_devpath_old(udev_device, &property[12]);
|
||||
} else if (startswith(property, "SEQNUM=")) {
|
||||
udev_device_set_seqnum(udev_device, strtoull(&property[7], NULL, 10));
|
||||
+ } else if (startswith(property, "TIMEOUT=")) {
|
||||
+ udev_device_set_timeout(udev_device, strtoull(&property[8], NULL, 10));
|
||||
} else if (startswith(property, "IFINDEX=")) {
|
||||
udev_device_set_ifindex(udev_device, strtoull(&property[8], NULL, 10));
|
||||
} else if (startswith(property, "DEVMODE=")) {
|
||||
@@ -605,6 +623,7 @@ struct udev_device *udev_device_new(stru
|
||||
udev_list_init(udev, &udev_device->sysattr_value_list, true);
|
||||
udev_list_init(udev, &udev_device->sysattr_list, false);
|
||||
udev_list_init(udev, &udev_device->tags_list, true);
|
||||
+ udev_device->timeout = -1;
|
||||
udev_device->watch_handle = -1;
|
||||
/* copy global properties */
|
||||
udev_list_entry_foreach(list_entry, udev_get_properties_list_entry(udev))
|
||||
Index: systemd-190/src/libudev/libudev-private.h
|
||||
===================================================================
|
||||
--- systemd-190.orig/src/libudev/libudev-private.h
|
||||
+++ systemd-190/src/libudev/libudev-private.h
|
||||
@@ -65,6 +65,7 @@ const char *udev_device_get_id_filename(
|
||||
void udev_device_set_is_initialized(struct udev_device *udev_device);
|
||||
int udev_device_add_tag(struct udev_device *udev_device, const char *tag);
|
||||
void udev_device_cleanup_tags_list(struct udev_device *udev_device);
|
||||
+int udev_device_get_timeout(struct udev_device *udev_device);
|
||||
unsigned long long udev_device_get_usec_initialized(struct udev_device *udev_device);
|
||||
void udev_device_set_usec_initialized(struct udev_device *udev_device, unsigned long long usec_initialized);
|
||||
int udev_device_get_devlink_priority(struct udev_device *udev_device);
|
||||
Index: systemd-190/src/udev/udevd.c
|
||||
===================================================================
|
||||
--- systemd-190.orig/src/udev/udevd.c
|
||||
+++ systemd-190/src/udev/udevd.c
|
||||
@@ -387,7 +387,7 @@ out:
|
||||
}
|
||||
}
|
||||
|
||||
-static void event_run(struct event *event)
|
||||
+static void event_run(struct event *event, bool force)
|
||||
{
|
||||
struct udev_list_node *loop;
|
||||
|
||||
@@ -413,7 +413,7 @@ static void event_run(struct event *even
|
||||
return;
|
||||
}
|
||||
|
||||
- if (children >= children_max) {
|
||||
+ if (!force && children >= children_max) {
|
||||
if (children_max > 1)
|
||||
log_debug("maximum number (%i) of children reached\n", children);
|
||||
return;
|
||||
@@ -447,6 +447,13 @@ static int event_queue_insert(struct ude
|
||||
|
||||
event->state = EVENT_QUEUED;
|
||||
udev_list_node_append(&event->node, &event_list);
|
||||
+
|
||||
+ /* run all events with a timeout set immediately */
|
||||
+ if (udev_device_get_timeout(dev) > 0) {
|
||||
+ event_run(event, true);
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -552,7 +559,7 @@ static void event_queue_start(struct ude
|
||||
if (is_devpath_busy(event))
|
||||
continue;
|
||||
|
||||
- event_run(event);
|
||||
+ event_run(event, false);
|
||||
}
|
||||
}
|
||||
|
@ -1,368 +0,0 @@
|
||||
From 7644bc8665f39a6428049e81e8c04e4d755e55a1 Mon Sep 17 00:00:00 2001
|
||||
From: Frederic Crozat <fcrozat@suse.com>
|
||||
Date: Fri, 16 Mar 2012 11:59:04 +0100
|
||||
Subject: [PATCH] add sparse support to detect endianness bug
|
||||
|
||||
le16/32/64_t type should be used when storing little-endian value
|
||||
|
||||
header to integrate with sparse from Josh Triplett <josh@joshtriplett.org>
|
||||
---
|
||||
src/journal/journal-def.h | 74 +++++++++++++++++-----------------
|
||||
src/journal/journal-file.c | 15 ++++---
|
||||
src/journal/journal-internal.h | 2 +-
|
||||
src/journal/journald.c | 5 +-
|
||||
src/journal/sd-journal.c | 10 +++--
|
||||
src/journal/sparse-endian.h | 87 ++++++++++++++++++++++++++++++++++++++++
|
||||
6 files changed, 142 insertions(+), 51 deletions(-)
|
||||
create mode 100644 src/journal/sparse-endian.h
|
||||
|
||||
diff --git a/src/journal/journal-def.h b/src/journal/journal-def.h
|
||||
index 964e0c2..9cb8051 100644
|
||||
--- a/src/journal/journal-def.h
|
||||
+++ b/src/journal/journal-def.h
|
||||
@@ -22,7 +22,7 @@
|
||||
along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
||||
***/
|
||||
|
||||
-#include <inttypes.h>
|
||||
+#include "sparse-endian.h"
|
||||
|
||||
#include <systemd/sd-id128.h>
|
||||
|
||||
@@ -60,48 +60,48 @@ _packed_ struct ObjectHeader {
|
||||
uint8_t type;
|
||||
uint8_t flags;
|
||||
uint8_t reserved[6];
|
||||
- uint64_t size;
|
||||
+ le64_t size;
|
||||
uint8_t payload[];
|
||||
};
|
||||
|
||||
_packed_ struct DataObject {
|
||||
ObjectHeader object;
|
||||
- uint64_t hash;
|
||||
- uint64_t next_hash_offset;
|
||||
- uint64_t next_field_offset;
|
||||
- uint64_t entry_offset; /* the first array entry we store inline */
|
||||
- uint64_t entry_array_offset;
|
||||
- uint64_t n_entries;
|
||||
+ le64_t hash;
|
||||
+ le64_t next_hash_offset;
|
||||
+ le64_t next_field_offset;
|
||||
+ le64_t entry_offset; /* the first array entry we store inline */
|
||||
+ le64_t entry_array_offset;
|
||||
+ le64_t n_entries;
|
||||
uint8_t payload[];
|
||||
};
|
||||
|
||||
_packed_ struct FieldObject {
|
||||
ObjectHeader object;
|
||||
- uint64_t hash;
|
||||
- uint64_t next_hash_offset;
|
||||
- uint64_t head_data_offset;
|
||||
- uint64_t tail_data_offset;
|
||||
+ le64_t hash;
|
||||
+ le64_t next_hash_offset;
|
||||
+ le64_t head_data_offset;
|
||||
+ le64_t tail_data_offset;
|
||||
uint8_t payload[];
|
||||
};
|
||||
|
||||
_packed_ struct EntryItem {
|
||||
- uint64_t object_offset;
|
||||
- uint64_t hash;
|
||||
+ le64_t object_offset;
|
||||
+ le64_t hash;
|
||||
};
|
||||
|
||||
_packed_ struct EntryObject {
|
||||
ObjectHeader object;
|
||||
- uint64_t seqnum;
|
||||
- uint64_t realtime;
|
||||
- uint64_t monotonic;
|
||||
+ le64_t seqnum;
|
||||
+ le64_t realtime;
|
||||
+ le64_t monotonic;
|
||||
sd_id128_t boot_id;
|
||||
- uint64_t xor_hash;
|
||||
+ le64_t xor_hash;
|
||||
EntryItem items[];
|
||||
};
|
||||
|
||||
_packed_ struct HashItem {
|
||||
- uint64_t head_hash_offset;
|
||||
- uint64_t tail_hash_offset;
|
||||
+ le64_t head_hash_offset;
|
||||
+ le64_t tail_hash_offset;
|
||||
};
|
||||
|
||||
_packed_ struct HashTableObject {
|
||||
@@ -111,8 +111,8 @@ _packed_ struct HashTableObject {
|
||||
|
||||
_packed_ struct EntryArrayObject {
|
||||
ObjectHeader object;
|
||||
- uint64_t next_entry_array_offset;
|
||||
- uint64_t items[];
|
||||
+ le64_t next_entry_array_offset;
|
||||
+ le64_t items[];
|
||||
};
|
||||
|
||||
union Object {
|
||||
@@ -145,21 +145,21 @@ _packed_ struct Header {
|
||||
sd_id128_t machine_id;
|
||||
sd_id128_t boot_id;
|
||||
sd_id128_t seqnum_id;
|
||||
- uint64_t arena_offset;
|
||||
- uint64_t arena_size;
|
||||
- uint64_t data_hash_table_offset; /* for looking up data objects */
|
||||
- uint64_t data_hash_table_size;
|
||||
- uint64_t field_hash_table_offset; /* for looking up field objects */
|
||||
- uint64_t field_hash_table_size;
|
||||
- uint64_t tail_object_offset;
|
||||
- uint64_t n_objects;
|
||||
- uint64_t n_entries;
|
||||
- uint64_t seqnum;
|
||||
- uint64_t first_seqnum;
|
||||
- uint64_t entry_array_offset;
|
||||
- uint64_t head_entry_realtime;
|
||||
- uint64_t tail_entry_realtime;
|
||||
- uint64_t tail_entry_monotonic;
|
||||
+ le64_t arena_offset;
|
||||
+ le64_t arena_size;
|
||||
+ le64_t data_hash_table_offset; /* for looking up data objects */
|
||||
+ le64_t data_hash_table_size;
|
||||
+ le64_t field_hash_table_offset; /* for looking up field objects */
|
||||
+ le64_t field_hash_table_size;
|
||||
+ le64_t tail_object_offset;
|
||||
+ le64_t n_objects;
|
||||
+ le64_t n_entries;
|
||||
+ le64_t seqnum;
|
||||
+ le64_t first_seqnum;
|
||||
+ le64_t entry_array_offset;
|
||||
+ le64_t head_entry_realtime;
|
||||
+ le64_t tail_entry_realtime;
|
||||
+ le64_t tail_entry_monotonic;
|
||||
};
|
||||
|
||||
#endif
|
||||
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
|
||||
index 474dd5c..e803cec 100644
|
||||
--- a/src/journal/journal-file.c
|
||||
+++ b/src/journal/journal-file.c
|
||||
@@ -793,8 +793,8 @@ static uint64_t journal_file_entry_array_n_items(Object *o) {
|
||||
}
|
||||
|
||||
static int link_entry_into_array(JournalFile *f,
|
||||
- uint64_t *first,
|
||||
- uint64_t *idx,
|
||||
+ le64_t *first,
|
||||
+ le64_t *idx,
|
||||
uint64_t p) {
|
||||
int r;
|
||||
uint64_t n = 0, ap = 0, q, i, a, hidx;
|
||||
@@ -857,9 +857,9 @@ static int link_entry_into_array(JournalFile *f,
|
||||
}
|
||||
|
||||
static int link_entry_into_array_plus_one(JournalFile *f,
|
||||
- uint64_t *extra,
|
||||
- uint64_t *first,
|
||||
- uint64_t *idx,
|
||||
+ le64_t *extra,
|
||||
+ le64_t *first,
|
||||
+ le64_t *idx,
|
||||
uint64_t p) {
|
||||
|
||||
int r;
|
||||
@@ -873,7 +873,7 @@ static int link_entry_into_array_plus_one(JournalFile *f,
|
||||
if (*idx == 0)
|
||||
*extra = htole64(p);
|
||||
else {
|
||||
- uint64_t i;
|
||||
+ le64_t i;
|
||||
|
||||
i = htole64(le64toh(*idx) - 1);
|
||||
r = link_entry_into_array(f, first, &i, p);
|
||||
@@ -2141,7 +2141,8 @@ int journal_file_copy_entry(JournalFile *from, JournalFile *to, Object *o, uint6
|
||||
items = alloca(sizeof(EntryItem) * n);
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
- uint64_t le_hash, l, h;
|
||||
+ uint64_t l, h;
|
||||
+ le64_t le_hash;
|
||||
size_t t;
|
||||
void *data;
|
||||
Object *u;
|
||||
diff --git a/src/journal/journal-internal.h b/src/journal/journal-internal.h
|
||||
index e5914bf..17f1d31 100644
|
||||
--- a/src/journal/journal-internal.h
|
||||
+++ b/src/journal/journal-internal.h
|
||||
@@ -35,7 +35,7 @@ typedef struct Match Match;
|
||||
struct Match {
|
||||
char *data;
|
||||
size_t size;
|
||||
- uint64_t le_hash;
|
||||
+ le64_t le_hash;
|
||||
|
||||
LIST_FIELDS(Match, matches);
|
||||
};
|
||||
diff --git a/src/journal/journald.c b/src/journal/journald.c
|
||||
index baad3ab..ebb4275 100644
|
||||
--- a/src/journal/journald.c
|
||||
+++ b/src/journal/journald.c
|
||||
@@ -1251,6 +1251,7 @@ static void process_native_message(
|
||||
p = e + 1;
|
||||
continue;
|
||||
} else {
|
||||
+ le64_t l_le;
|
||||
uint64_t l;
|
||||
char *k;
|
||||
|
||||
@@ -1259,8 +1260,8 @@ static void process_native_message(
|
||||
break;
|
||||
}
|
||||
|
||||
- memcpy(&l, e + 1, sizeof(uint64_t));
|
||||
- l = le64toh(l);
|
||||
+ memcpy(&l_le, e + 1, sizeof(uint64_t));
|
||||
+ l = le64toh(l_le);
|
||||
|
||||
if (remaining < e - p + 1 + sizeof(uint64_t) + l + 1 ||
|
||||
e[1+sizeof(uint64_t)+l] != '\n') {
|
||||
diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c
|
||||
index 86ac267..e9cd26e 100644
|
||||
--- a/src/journal/sd-journal.c
|
||||
+++ b/src/journal/sd-journal.c
|
||||
@@ -108,7 +108,7 @@ static int same_field(const void *_a, size_t s, const void *_b, size_t t) {
|
||||
|
||||
_public_ int sd_journal_add_match(sd_journal *j, const void *data, size_t size) {
|
||||
Match *m, *after = NULL;
|
||||
- uint64_t le_hash;
|
||||
+ le64_t le_hash;
|
||||
|
||||
if (!j)
|
||||
return -EINVAL;
|
||||
@@ -356,7 +356,7 @@ static int find_location(sd_journal *j, JournalFile *f, direction_t direction, O
|
||||
Object *c, *d;
|
||||
uint64_t cp, dp;
|
||||
|
||||
- r = journal_file_find_data_object_with_hash(f, m->data, m->size, m->le_hash, &d, &dp);
|
||||
+ r = journal_file_find_data_object_with_hash(f, m->data, m->size, le64toh(m->le_hash), &d, &dp);
|
||||
if (r <= 0)
|
||||
return r;
|
||||
|
||||
@@ -1349,7 +1349,8 @@ _public_ int sd_journal_get_data(sd_journal *j, const char *field, const void **
|
||||
|
||||
n = journal_file_entry_n_items(o);
|
||||
for (i = 0; i < n; i++) {
|
||||
- uint64_t p, l, le_hash;
|
||||
+ uint64_t p, l;
|
||||
+ le64_t le_hash;
|
||||
size_t t;
|
||||
|
||||
p = le64toh(o->entry.items[i].object_offset);
|
||||
@@ -1410,7 +1411,8 @@ _public_ int sd_journal_get_data(sd_journal *j, const char *field, const void **
|
||||
|
||||
_public_ int sd_journal_enumerate_data(sd_journal *j, const void **data, size_t *size) {
|
||||
JournalFile *f;
|
||||
- uint64_t p, l, n, le_hash;
|
||||
+ uint64_t p, l, n;
|
||||
+ le64_t le_hash;
|
||||
int r;
|
||||
Object *o;
|
||||
size_t t;
|
||||
diff --git a/src/journal/sparse-endian.h b/src/journal/sparse-endian.h
|
||||
new file mode 100644
|
||||
index 0000000..eb4dbf3
|
||||
--- /dev/null
|
||||
+++ b/src/journal/sparse-endian.h
|
||||
@@ -0,0 +1,87 @@
|
||||
+/* Copyright (c) 2012 Josh Triplett <josh@joshtriplett.org>
|
||||
+ *
|
||||
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
+ * of this software and associated documentation files (the "Software"), to
|
||||
+ * deal in the Software without restriction, including without limitation the
|
||||
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
+ * sell copies of the Software, and to permit persons to whom the Software is
|
||||
+ * furnished to do so, subject to the following conditions:
|
||||
+ *
|
||||
+ * The above copyright notice and this permission notice shall be included in
|
||||
+ * all copies or substantial portions of the Software.
|
||||
+ *
|
||||
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
+ * IN THE SOFTWARE.
|
||||
+ */
|
||||
+#ifndef SPARSE_ENDIAN_H
|
||||
+#define SPARSE_ENDIAN_H
|
||||
+
|
||||
+#include <endian.h>
|
||||
+#include <stdint.h>
|
||||
+
|
||||
+#ifdef __CHECKER__
|
||||
+#define __bitwise __attribute__((bitwise))
|
||||
+#define __force __attribute__((force))
|
||||
+#else
|
||||
+#define __bitwise
|
||||
+#define __force
|
||||
+#endif
|
||||
+
|
||||
+typedef uint16_t __bitwise le16_t;
|
||||
+typedef uint16_t __bitwise be16_t;
|
||||
+typedef uint32_t __bitwise le32_t;
|
||||
+typedef uint32_t __bitwise be32_t;
|
||||
+typedef uint64_t __bitwise le64_t;
|
||||
+typedef uint64_t __bitwise be64_t;
|
||||
+
|
||||
+#undef htobe16
|
||||
+#undef htole16
|
||||
+#undef be16toh
|
||||
+#undef le16toh
|
||||
+#undef htobe32
|
||||
+#undef htole32
|
||||
+#undef be32toh
|
||||
+#undef le32toh
|
||||
+#undef htobe64
|
||||
+#undef htole64
|
||||
+#undef be64toh
|
||||
+#undef le64toh
|
||||
+
|
||||
+#if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
+#define bswap_16_on_le(x) __bswap_16(x)
|
||||
+#define bswap_32_on_le(x) __bswap_32(x)
|
||||
+#define bswap_64_on_le(x) __bswap_64(x)
|
||||
+#define bswap_16_on_be(x) (x)
|
||||
+#define bswap_32_on_be(x) (x)
|
||||
+#define bswap_64_on_be(x) (x)
|
||||
+#elif __BYTE_ORDER == __BIG_ENDIAN
|
||||
+#define bswap_16_on_le(x) (x)
|
||||
+#define bswap_32_on_le(x) (x)
|
||||
+#define bswap_64_on_le(x) (x)
|
||||
+#define bswap_16_on_be(x) __bswap_16(x)
|
||||
+#define bswap_32_on_be(x) __bswap_32(x)
|
||||
+#define bswap_64_on_be(x) __bswap_64(x)
|
||||
+#endif
|
||||
+
|
||||
+static inline le16_t htole16(uint16_t value) { return (le16_t __force) bswap_16_on_be(value); }
|
||||
+static inline le32_t htole32(uint32_t value) { return (le32_t __force) bswap_32_on_be(value); }
|
||||
+static inline le64_t htole64(uint64_t value) { return (le64_t __force) bswap_64_on_be(value); }
|
||||
+
|
||||
+static inline be16_t htobe16(uint16_t value) { return (be16_t __force) bswap_16_on_le(value); }
|
||||
+static inline be32_t htobe32(uint32_t value) { return (be32_t __force) bswap_32_on_le(value); }
|
||||
+static inline be64_t htobe64(uint64_t value) { return (be64_t __force) bswap_64_on_le(value); }
|
||||
+
|
||||
+static inline uint16_t le16toh(le16_t value) { return bswap_16_on_be((uint16_t __force)value); }
|
||||
+static inline uint32_t le32toh(le32_t value) { return bswap_32_on_be((uint32_t __force)value); }
|
||||
+static inline uint64_t le64toh(le64_t value) { return bswap_64_on_be((uint64_t __force)value); }
|
||||
+
|
||||
+static inline uint16_t be16toh(be16_t value) { return bswap_16_on_le((uint16_t __force)value); }
|
||||
+static inline uint32_t be32toh(be32_t value) { return bswap_32_on_le((uint32_t __force)value); }
|
||||
+static inline uint64_t be64toh(be64_t value) { return bswap_64_on_le((uint64_t __force)value); }
|
||||
+
|
||||
+#endif /* SPARSE_ENDIAN_H */
|
||||
--
|
||||
1.7.7
|
||||
|
@ -7,10 +7,10 @@ Subject: [PATCH] handle disable_caplock and compose_table and kbd_rate
|
||||
src/vconsole-setup.c | 124 ++++++++++++++++++++++++++++++++++++++++++++++++-
|
||||
1 files changed, 121 insertions(+), 3 deletions(-)
|
||||
|
||||
Index: systemd-37/src/vconsole-setup.c
|
||||
Index: systemd-189/src/vconsole/vconsole-setup.c
|
||||
===================================================================
|
||||
--- systemd-37.orig/src/vconsole/vconsole-setup.c
|
||||
+++ systemd-37/src/vconsole/vconsole-setup.c
|
||||
--- systemd-189.orig/src/vconsole/vconsole-setup.c
|
||||
+++ systemd-189/src/vconsole/vconsole-setup.c
|
||||
@@ -40,6 +40,7 @@
|
||||
#include "log.h"
|
||||
#include "macro.h"
|
||||
@ -19,7 +19,7 @@ Index: systemd-37/src/vconsole-setup.c
|
||||
|
||||
static bool is_vconsole(int fd) {
|
||||
unsigned char data[1];
|
||||
@@ -79,8 +80,8 @@
|
||||
@@ -99,8 +100,8 @@ static int enable_utf8(int fd) {
|
||||
return r;
|
||||
}
|
||||
|
||||
@ -30,7 +30,7 @@ Index: systemd-37/src/vconsole-setup.c
|
||||
int i = 0;
|
||||
pid_t pid;
|
||||
|
||||
@@ -99,6 +100,8 @@
|
||||
@@ -119,6 +120,8 @@ static int load_keymap(const char *vc, c
|
||||
args[i++] = map;
|
||||
if (map_toggle)
|
||||
args[i++] = map_toggle;
|
||||
@ -38,8 +38,8 @@ Index: systemd-37/src/vconsole-setup.c
|
||||
+ args[i++] = "disable.capslock";
|
||||
args[i++] = NULL;
|
||||
|
||||
if ((pid = fork()) < 0) {
|
||||
@@ -150,6 +153,101 @@
|
||||
pid = fork();
|
||||
@@ -172,6 +175,101 @@ static int load_font(const char *vc, con
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -141,7 +141,7 @@ Index: systemd-37/src/vconsole-setup.c
|
||||
int main(int argc, char **argv) {
|
||||
const char *vc;
|
||||
char *vc_keymap = NULL;
|
||||
@@ -163,8 +261,16 @@
|
||||
@@ -185,8 +283,16 @@ int main(int argc, char **argv) {
|
||||
#if defined(TARGET_MANDRIVA) || defined(TARGET_MAGEIA)
|
||||
char *vc_keytable = NULL;
|
||||
#endif
|
||||
@ -158,29 +158,26 @@ Index: systemd-37/src/vconsole-setup.c
|
||||
int r = EXIT_FAILURE;
|
||||
pid_t font_pid = 0, keymap_pid = 0;
|
||||
|
||||
@@ -265,6 +371,10 @@
|
||||
#elif defined(TARGET_SUSE)
|
||||
if ((r = parse_env_file("/etc/sysconfig/keyboard", NEWLINE,
|
||||
"KEYTABLE", &vc_keymap,
|
||||
+ "KBD_DELAY", &vc_kbd_delay,
|
||||
+ "KBD_RATE", &vc_kbd_rate,
|
||||
+ "KBD_DISABLE_CAPS_LOCK", &vc_kbd_disable_caps_lock,
|
||||
+ "COMPOSETABLE", &vc_compose_table,
|
||||
NULL)) < 0) {
|
||||
|
||||
if (r != -ENOENT)
|
||||
@@ -280,6 +390,7 @@
|
||||
if (r != -ENOENT)
|
||||
log_warning("Failed to read /etc/sysconfig/console: %s", strerror(-r));
|
||||
@@ -281,10 +387,15 @@ int main(int argc, char **argv) {
|
||||
free(vc_keymap);
|
||||
vc_keymap = t;
|
||||
}
|
||||
+ disable_capslock = vc_kbd_disable_caps_lock && strcasecmp(vc_kbd_disable_caps_lock, "YES") == 0;
|
||||
|
||||
#elif defined(TARGET_ARCH)
|
||||
if ((r = parse_env_file("/etc/rc.conf", NEWLINE,
|
||||
@@ -436,7 +547,11 @@
|
||||
if (!utf8)
|
||||
#elif defined(TARGET_SUSE)
|
||||
r = parse_env_file("/etc/sysconfig/keyboard", NEWLINE,
|
||||
"KEYTABLE", &vc_keymap,
|
||||
+ "KBD_DELAY", &vc_kbd_delay,
|
||||
+ "KBD_RATE", &vc_kbd_rate,
|
||||
+ "KBD_DISABLE_CAPS_LOCK", &vc_kbd_disable_caps_lock,
|
||||
+ "COMPOSETABLE", &vc_compose_table,
|
||||
NULL);
|
||||
if (r < 0 && r != -ENOENT)
|
||||
log_warning("Failed to read /etc/sysconfig/keyboard: %s", strerror(-r));
|
||||
@@ -443,7 +554,11 @@ int main(int argc, char **argv) {
|
||||
disable_utf8(fd);
|
||||
|
||||
|
||||
- if (load_keymap(vc, vc_keymap, vc_keymap_toggle, utf8, &keymap_pid) >= 0 &&
|
||||
+ if (load_keymap(vc, vc_keymap, vc_keymap_toggle, utf8, disable_capslock, &keymap_pid) >= 0 &&
|
||||
+#ifdef TARGET_SUSE
|
||||
@ -190,7 +187,7 @@ Index: systemd-37/src/vconsole-setup.c
|
||||
load_font(vc, vc_font, vc_font_map, vc_font_unimap, &font_pid) >= 0)
|
||||
r = EXIT_SUCCESS;
|
||||
|
||||
@@ -444,6 +559,14 @@
|
||||
@@ -451,6 +566,14 @@ finish:
|
||||
if (keymap_pid > 0)
|
||||
wait_for_terminate_and_warn(KBD_LOADKEYS, keymap_pid);
|
||||
|
||||
@ -205,7 +202,7 @@ Index: systemd-37/src/vconsole-setup.c
|
||||
if (font_pid > 0)
|
||||
wait_for_terminate_and_warn(KBD_SETFONT, font_pid);
|
||||
|
||||
@@ -451,6 +574,12 @@
|
||||
@@ -458,6 +581,12 @@ finish:
|
||||
free(vc_font);
|
||||
free(vc_font_map);
|
||||
free(vc_font_unimap);
|
||||
@ -218,4 +215,3 @@ Index: systemd-37/src/vconsole-setup.c
|
||||
|
||||
if (fd >= 0)
|
||||
close_nointr_nofail(fd);
|
||||
Only in new/src/vconsole: vconsole-setup.c.orig
|
||||
|
@ -9,8 +9,8 @@ Subject: [PATCH] service: Fix dependencies added when parsing insserv.conf
|
||||
|
||||
Index: systemd-41/src/service.c
|
||||
===================================================================
|
||||
--- systemd-41.orig/src/service.c
|
||||
+++ systemd-41/src/service.c
|
||||
--- systemd-41.orig/src/core/service.c
|
||||
+++ systemd-41/src/core/service.c
|
||||
@@ -3210,23 +3210,30 @@ static void sysv_facility_in_insserv_con
|
||||
Unit *u;
|
||||
if (sysv_translate_facility(parsed[0], NULL, &facility) < 0)
|
||||
|
@ -14,8 +14,8 @@ Fixes https://bugzilla.novell.com/show_bug.cgi?id=721426
|
||||
|
||||
Index: systemd-37/src/service.c
|
||||
===================================================================
|
||||
--- systemd-37.orig/src/service.c
|
||||
+++ systemd-37/src/service.c
|
||||
--- systemd-37.orig/src/core/service.c
|
||||
+++ systemd-37/src/core/service.c
|
||||
@@ -2014,8 +2014,13 @@ static void service_enter_running(Servic
|
||||
cgroup_ok = cgroup_good(s);
|
||||
|
||||
|
@ -1,59 +0,0 @@
|
||||
From 5ebff5337594d690b322078c512eb222d34aaa82 Mon Sep 17 00:00:00 2001
|
||||
From: Michal Schmidt <mschmidt@redhat.com>
|
||||
Date: Fri, 2 Mar 2012 10:39:10 +0100
|
||||
Subject: [PATCH] util: never follow symlinks in rm_rf_children()
|
||||
|
||||
The function checks if the entry is a directory before recursing, but
|
||||
there is a window between the check and the open, during which the
|
||||
directory could be replaced with a symlink.
|
||||
|
||||
CVE-2012-1174
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=803358
|
||||
---
|
||||
src/util.c | 3 ++-
|
||||
1 files changed, 2 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/src/util.c b/src/util.c
|
||||
index 20cbc2b..dfc1dc6 100644
|
||||
--- a/src/util.c
|
||||
+++ b/src/util.c
|
||||
@@ -3593,7 +3593,8 @@ static int rm_rf_children(int fd, bool only_dirs, bool honour_sticky) {
|
||||
if (is_dir) {
|
||||
int subdir_fd;
|
||||
|
||||
- if ((subdir_fd = openat(fd, de->d_name, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC)) < 0) {
|
||||
+ subdir_fd = openat(fd, de->d_name, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC|O_NOFOLLOW);
|
||||
+ if (subdir_fd < 0) {
|
||||
if (ret == 0 && errno != ENOENT)
|
||||
ret = -errno;
|
||||
continue;
|
||||
--
|
||||
1.7.7
|
||||
|
||||
From c9d8629baa09f853fbcc44972c9748e70562270c Mon Sep 17 00:00:00 2001
|
||||
From: Lennart Poettering <lennart@poettering.net>
|
||||
Date: Thu, 22 Mar 2012 01:43:36 +0100
|
||||
Subject: [PATCH] logind: extend comment about X11 socket symlink
|
||||
|
||||
---
|
||||
src/login/logind-session.c | 4 ++++
|
||||
1 files changed, 4 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/src/login/logind-session.c b/src/login/logind-session.c
|
||||
index af9c12d..4e0af86 100644
|
||||
--- a/src/login/logind-session.c
|
||||
+++ b/src/login/logind-session.c
|
||||
@@ -391,6 +391,10 @@ static int session_link_x11_socket(Session *s) {
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
+ /* Note that this cannot be in a subdir to avoid
|
||||
+ * vulnerabilities since we are privileged but the runtime
|
||||
+ * path is owned by the user */
|
||||
+
|
||||
t = strappend(s->user->runtime_path, "/X11-display");
|
||||
if (!t) {
|
||||
log_error("Out of memory");
|
||||
--
|
||||
1.7.7
|
||||
|
108
0013-re-enable-by_path-links-for-ata-devices.patch
Normal file
108
0013-re-enable-by_path-links-for-ata-devices.patch
Normal file
@ -0,0 +1,108 @@
|
||||
Index: udev-182/src/udev-builtin-path_id.c
|
||||
===================================================================
|
||||
--- udev-182.orig/src/udev/udev-builtin-path_id.c
|
||||
+++ udev-182/src/udev/udev-builtin-path_id.c
|
||||
@@ -286,6 +286,85 @@ out:
|
||||
return hostdev;
|
||||
}
|
||||
|
||||
+static struct udev_device *handle_ata(struct udev_device *parent, char **path)
|
||||
+{
|
||||
+ struct udev_device *hostdev;
|
||||
+ int host, bus, target, lun;
|
||||
+ const char *name;
|
||||
+ char *base;
|
||||
+ char *pos;
|
||||
+ DIR *dir;
|
||||
+ struct dirent *dent;
|
||||
+ int basenum, len;
|
||||
+
|
||||
+ hostdev = udev_device_get_parent_with_subsystem_devtype(parent, "scsi", "scsi_host");
|
||||
+ if (hostdev == NULL)
|
||||
+ return NULL;
|
||||
+
|
||||
+ name = udev_device_get_sysname(parent);
|
||||
+ if (sscanf(name, "%d:%d:%d:%d", &host, &bus, &target, &lun) != 4)
|
||||
+ return NULL;
|
||||
+
|
||||
+ /* rebase ata offset to get the local relative number */
|
||||
+ basenum = -1;
|
||||
+ base = strdup(udev_device_get_syspath(hostdev));
|
||||
+ if (base == NULL)
|
||||
+ return NULL;
|
||||
+ pos = strrchr(base, '/');
|
||||
+ if (pos == NULL) {
|
||||
+ parent = NULL;
|
||||
+ goto out;
|
||||
+ }
|
||||
+ pos[0] = '\0';
|
||||
+ len = strlen(base) - 5;
|
||||
+ if (len <= 0) {
|
||||
+ parent = NULL;
|
||||
+ goto out;
|
||||
+ }
|
||||
+ base[len] = '\0';
|
||||
+ dir = opendir(base);
|
||||
+ if (dir == NULL) {
|
||||
+ parent = NULL;
|
||||
+ goto out;
|
||||
+ }
|
||||
+ for (dent = readdir(dir); dent != NULL; dent = readdir(dir)) {
|
||||
+ char *rest;
|
||||
+ int i;
|
||||
+
|
||||
+ if (dent->d_name[0] == '.')
|
||||
+ continue;
|
||||
+ if (dent->d_type != DT_DIR && dent->d_type != DT_LNK)
|
||||
+ continue;
|
||||
+ if (strncmp(dent->d_name, "ata", 3) != 0)
|
||||
+ continue;
|
||||
+ i = strtoul(&dent->d_name[3], &rest, 10);
|
||||
+
|
||||
+ /* ata devices start with 1, so decrease by 1 if i is bigger then 0 */
|
||||
+ if (i > 0)
|
||||
+ i--;
|
||||
+ if (rest[0] != '\0')
|
||||
+ continue;
|
||||
+ /*
|
||||
+ * find the smallest number; the host really needs to export its
|
||||
+ * own instance number per parent device; relying on the global host
|
||||
+ * enumeration and plainly rebasing the numbers sounds unreliable
|
||||
+ */
|
||||
+ if (basenum == -1 || i < basenum)
|
||||
+ basenum = i;
|
||||
+ }
|
||||
+ closedir(dir);
|
||||
+ if (basenum == -1) {
|
||||
+ parent = NULL;
|
||||
+ goto out;
|
||||
+ }
|
||||
+ host -= basenum;
|
||||
+
|
||||
+ path_prepend(path, "scsi-%u:%u:%u:%u", host, bus, target, lun);
|
||||
+out:
|
||||
+ free(base);
|
||||
+ return hostdev;
|
||||
+}
|
||||
+
|
||||
static struct udev_device *handle_scsi(struct udev_device *parent, char **path)
|
||||
{
|
||||
const char *devtype;
|
||||
@@ -322,16 +401,8 @@ static struct udev_device *handle_scsi(s
|
||||
goto out;
|
||||
}
|
||||
|
||||
- /*
|
||||
- * We do not support the ATA transport class, it creates duplicated link
|
||||
- * names as the fake SCSI host adapters are all separated, they are all
|
||||
- * re-based as host == 0. ATA should just stop faking two duplicated
|
||||
- * hierarchies for a single topology and leave the SCSI stuff alone;
|
||||
- * until that happens, there are no by-path/ links for ATA devices behind
|
||||
- * an ATA transport class.
|
||||
- */
|
||||
if (strstr(name, "/ata") != NULL) {
|
||||
- parent = NULL;
|
||||
+ parent = handle_ata(parent, path);
|
||||
goto out;
|
||||
}
|
||||
|
15
0014-rules-create-by-id-scsi-links-for-ATA-devices.patch
Normal file
15
0014-rules-create-by-id-scsi-links-for-ATA-devices.patch
Normal file
@ -0,0 +1,15 @@
|
||||
Index: udev-182/rules/60-persistent-storage.rules
|
||||
===================================================================
|
||||
--- udev-182.orig/rules/60-persistent-storage.rules
|
||||
+++ udev-182/rules/60-persistent-storage.rules
|
||||
@@ -44,6 +44,10 @@ KERNEL=="cciss*", ENV{DEVTYPE}=="disk",
|
||||
KERNEL=="sd*|sr*|cciss*", ENV{DEVTYPE}=="disk", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
|
||||
KERNEL=="sd*|cciss*", ENV{DEVTYPE}=="partition", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"
|
||||
|
||||
+# scsi compat links for ATA devices
|
||||
+KERNEL=="sd*[!0-9]", ENV{ID_BUS}=="ata", PROGRAM="scsi_id --whitelisted --replace-whitespace -p0x80 -d $devnode", RESULT=="?*", ENV{ID_SCSI_COMPAT}="$result", SYMLINK+="disk/by-id/scsi-$env{ID_SCSI_COMPAT}"
|
||||
+KERNEL=="sd*[0-9]", ENV{ID_SCSI_COMPAT}=="?*", SYMLINK+="disk/by-id/scsi-$env{ID_SCSI_COMPAT}-part%n"
|
||||
+
|
||||
# firewire
|
||||
KERNEL=="sd*[!0-9]|sr*", ATTRS{ieee1394_id}=="?*", SYMLINK+="disk/by-id/ieee1394-$attr{ieee1394_id}"
|
||||
KERNEL=="sd*[0-9]", ATTRS{ieee1394_id}=="?*", SYMLINK+="disk/by-id/ieee1394-$attr{ieee1394_id}-part%n"
|
13
0026-udev-netlink-null-rules.patch
Normal file
13
0026-udev-netlink-null-rules.patch
Normal file
@ -0,0 +1,13 @@
|
||||
Index: udev-182/src/udevd.c
|
||||
===================================================================
|
||||
--- udev-182.orig/src/udev/udevd.c
|
||||
+++ udev-182/src/udev/udevd.c
|
||||
@@ -1683,6 +1683,8 @@ int main(int argc, char *argv[])
|
||||
dev = udev_monitor_receive_device(monitor);
|
||||
if (dev != NULL) {
|
||||
udev_device_set_usec_initialized(dev, now_usec());
|
||||
+ if (rules == NULL)
|
||||
+ rules = udev_rules_new(udev, resolve_names);
|
||||
if (event_queue_insert(dev) < 0)
|
||||
udev_device_unref(dev);
|
||||
}
|
12
0027-udev-fix-sg-autoload-regression.patch
Normal file
12
0027-udev-fix-sg-autoload-regression.patch
Normal file
@ -0,0 +1,12 @@
|
||||
Index: systemd-190/rules/80-drivers.rules
|
||||
===================================================================
|
||||
--- systemd-190.orig/rules/80-drivers.rules
|
||||
+++ systemd-190/rules/80-drivers.rules
|
||||
@@ -7,6 +7,7 @@ SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}==
|
||||
SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}=="MS", IMPORT{builtin}="kmod load tifm_ms"
|
||||
SUBSYSTEM=="memstick", IMPORT{builtin}="kmod load ms_block mspro_block"
|
||||
SUBSYSTEM=="i2o", IMPORT{builtin}="kmod load i2o_block"
|
||||
+SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST!="[module/sg]", IMPORT{builtin}="kmod load sg"
|
||||
SUBSYSTEM=="module", KERNEL=="parport_pc", RUN{builtin}="kmod load ppdev"
|
||||
|
||||
LABEL="drivers_end"
|
@ -1,109 +0,0 @@
|
||||
|
||||
Rather than ordering systemd-random-seed-load.service after local-fs.target,
|
||||
start it by path-activation.
|
||||
|
||||
We need write access to the seed, so we order the path unit after
|
||||
remount-rootfs.service (in case /var is on the root fs).
|
||||
|
||||
A better solution might be to introduce PathIsWritable=, but that is not
|
||||
necessary in order to solve the problem, and I don't know of any other
|
||||
usecases for it.
|
||||
|
||||
Cc: Frederic Crozat <fcrozat@suse.com>
|
||||
Cc: Michal Schmidt <mschmidt@redhat.com>
|
||||
---
|
||||
|
||||
This is my second attempt at solving this problem. The first one had
|
||||
some issues as pointed out by Frederic and Michael.
|
||||
|
||||
Makefile.am | 7 +++++--
|
||||
TODO | 2 --
|
||||
units/.gitignore | 1 +
|
||||
units/systemd-random-seed-load.path.in | 18 ++++++++++++++++++
|
||||
units/systemd-random-seed-load.service.in | 3 +--
|
||||
5 files changed, 25 insertions(+), 6 deletions(-)
|
||||
create mode 100644 units/systemd-random-seed-load.path.in
|
||||
|
||||
diff -urB systemd-38/Makefile.am new/Makefile.am
|
||||
--- systemd-38/Makefile.am 2012-01-11 04:01:36.734404653 +0100
|
||||
+++ new/Makefile.am 2012-01-18 09:53:12.763115731 +0100
|
||||
@@ -1530,11 +1530,14 @@
|
||||
|
||||
nodist_systemunit_DATA += \
|
||||
units/systemd-random-seed-save.service \
|
||||
- units/systemd-random-seed-load.service
|
||||
+ units/systemd-random-seed-load.service \
|
||||
+ units/systemd-random-seed-load.path
|
||||
+
|
||||
|
||||
EXTRA_DIST += \
|
||||
units/systemd-random-seed-save.service.in \
|
||||
- units/systemd-random-seed-load.service.in
|
||||
+ units/systemd-random-seed-load.service.in \
|
||||
+ units/systemd-random-seed-load.path.in
|
||||
|
||||
systemd_random_seed_SOURCES = \
|
||||
src/random-seed.c
|
||||
@@ -1550,8 +1553,8 @@
|
||||
rm -f systemd-random-seed-save.service && \
|
||||
$(LN_S) ../systemd-random-seed-save.service systemd-random-seed-save.service )
|
||||
( cd $(DESTDIR)$(systemunitdir)/sysinit.target.wants && \
|
||||
- rm -f systemd-random-seed-load.service && \
|
||||
- $(LN_S) ../systemd-random-seed-load.service systemd-random-seed-load.service )
|
||||
+ rm -f systemd-random-seed-load.path && \
|
||||
+ $(LN_S) ../systemd-random-seed-load.path systemd-random-seed-load.path )
|
||||
|
||||
INSTALL_DATA_HOOKS += \
|
||||
randomseed-install-data-hook
|
||||
@@ -2052,6 +2055,7 @@
|
||||
-e 's,@exec_prefix\@,$(exec_prefix),g' \
|
||||
-e 's,@libdir\@,$(libdir),g' \
|
||||
-e 's,@includedir\@,$(includedir),g' \
|
||||
+ -e 's,@localstatedir\@,$(localstatedir),g' \
|
||||
< $< > $@ || rm $@
|
||||
|
||||
units/%: units/%.in Makefile
|
||||
diff --git a/units/systemd-random-seed-load.path.in b/units/systemd-random-seed-load.path.in
|
||||
new file mode 100644
|
||||
index 0000000..614c1d4
|
||||
--- /dev/null
|
||||
+++ b/units/systemd-random-seed-load.path.in
|
||||
@@ -0,0 +1,18 @@
|
||||
+# This file is part of systemd.
|
||||
+#
|
||||
+# systemd is free software; you can redistribute it and/or modify it
|
||||
+# under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 2 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+
|
||||
+[Unit]
|
||||
+Description=Random Seed
|
||||
+DefaultDependencies=no
|
||||
+Conflicts=shutdown.target
|
||||
+Before=basic.target shutdown.target
|
||||
+# in case the seed is on the rootfs, we must
|
||||
+# wait for the rootfs to be remonuted rw
|
||||
+After=remount-rootfs.service
|
||||
+
|
||||
+[Path]
|
||||
+PathExists=@localstatedir@/lib/random-seed
|
||||
diff --git a/units/systemd-random-seed-load.service.in b/units/systemd-random-seed-load.service.in
|
||||
index a2b6a55..2bcf1aa 100644
|
||||
--- a/units/systemd-random-seed-load.service.in
|
||||
+++ b/units/systemd-random-seed-load.service.in
|
||||
@@ -8,9 +8,8 @@
|
||||
[Unit]
|
||||
Description=Load Random Seed
|
||||
DefaultDependencies=no
|
||||
-Wants=local-fs.target
|
||||
Conflicts=shutdown.target
|
||||
-After=systemd-readahead-collect.service systemd-readahead-replay.service local-fs.target
|
||||
+After=systemd-readahead-collect.service systemd-readahead-replay.service systemd-random-seed-load.path
|
||||
Before=sysinit.target shutdown.target
|
||||
|
||||
[Service]
|
||||
--
|
||||
1.7.8
|
||||
|
||||
|
||||
|
@ -1,3 +1,6 @@
|
||||
systemd
|
||||
supplements "packageand(systemd:pam-<targettype>)"
|
||||
-/lib/systemd/system/
|
||||
libudev0
|
||||
libgudev-1_0-0
|
||||
|
||||
|
81
boot.udev
Normal file
81
boot.udev
Normal file
@ -0,0 +1,81 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
### BEGIN INIT INFO
|
||||
# Provides: boot.udev
|
||||
# Required-Start:
|
||||
# Required-Stop:
|
||||
# Should-Start:
|
||||
# Should-Stop:
|
||||
# Default-Start: B
|
||||
# Default-Stop:
|
||||
# Short-Description: manage /dev and kernel device-events
|
||||
# Description: udevd daemon to manage /dev and kernel device events
|
||||
### END INIT INFO
|
||||
|
||||
. /etc/rc.status
|
||||
|
||||
PATH="/sbin:/bin"
|
||||
udev_timeout=180
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
# create /dev/root symlink with dynamic rule
|
||||
if [ -x /lib/udev/write_dev_root_rule ]; then
|
||||
/lib/udev/write_dev_root_rule
|
||||
fi
|
||||
|
||||
# start udevd
|
||||
echo -n "Starting udevd: "
|
||||
/sbin/udevd --daemon
|
||||
if [ $? -ne 0 ]; then
|
||||
rc_status -v
|
||||
rc_exit
|
||||
fi
|
||||
rc_status -v
|
||||
|
||||
# trigger events for all devices
|
||||
echo -n "Loading drivers, configuring devices: "
|
||||
/sbin/udevadm trigger --type=subsystems --action=add
|
||||
/sbin/udevadm trigger --type=devices --action=add
|
||||
|
||||
# wait for events to finish
|
||||
/sbin/udevadm settle --timeout=$udev_timeout
|
||||
rc_status -v
|
||||
;;
|
||||
stop)
|
||||
echo -n "Stopping udevd: "
|
||||
killproc /sbin/udevd
|
||||
rc_status -v
|
||||
;;
|
||||
restart)
|
||||
echo -n "Restarting udevd: "
|
||||
killproc /sbin/udevd
|
||||
/sbin/udevd --daemon
|
||||
rc_status -v
|
||||
;;
|
||||
status)
|
||||
echo -n "Checking for udevd: "
|
||||
checkproc /sbin/udevd
|
||||
rc_status -v
|
||||
;;
|
||||
reload)
|
||||
echo -n "Reloading udev rules: "
|
||||
/sbin/udevadm control --reload-rules
|
||||
rc_status -v
|
||||
;;
|
||||
force-reload)
|
||||
echo -n "Restarting udev and reconfiguring all devices: "
|
||||
killproc /sbin/udevd
|
||||
rm -rf /dev/.udev /dev/disk
|
||||
root_symlink_rule
|
||||
/sbin/udevd --daemon
|
||||
/sbin/udevadm trigger --action=add
|
||||
/sbin/udevadm settle --timeout=$udev_timeout
|
||||
rc_status -v
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|status|reload|force-reload}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
rc_exit
|
@ -1,37 +0,0 @@
|
||||
From 1505a61772a6e697f2aabdbb0e827a88b0d7ee6b Mon Sep 17 00:00:00 2001
|
||||
From: Lennart Poettering <lennart@poettering.net>
|
||||
Date: Sun, 22 Apr 2012 02:45:39 +0200
|
||||
Subject: [PATCH] default to v102 everywhere, instead of vt100, to synchronize
|
||||
with agetty
|
||||
|
||||
---
|
||||
src/util.c | 2 +-
|
||||
units/serial-getty@.service.m4 | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
Index: systemd-44/src/util.c
|
||||
===================================================================
|
||||
--- systemd-44.orig/src/util.c
|
||||
+++ systemd-44/src/util.c
|
||||
@@ -4425,7 +4425,7 @@ bool tty_is_vc_resolve(const char *tty)
|
||||
const char *default_term_for_tty(const char *tty) {
|
||||
assert(tty);
|
||||
|
||||
- return tty_is_vc_resolve(tty) ? "TERM=linux" : "TERM=vt100";
|
||||
+ return tty_is_vc_resolve(tty) ? "TERM=linux" : "TERM=vt102";
|
||||
}
|
||||
|
||||
bool dirent_is_file(const struct dirent *de) {
|
||||
Index: systemd-44/units/serial-getty@.service.m4
|
||||
===================================================================
|
||||
--- systemd-44.orig/units/serial-getty@.service.m4
|
||||
+++ systemd-44/units/serial-getty@.service.m4
|
||||
@@ -35,7 +35,7 @@ Before=getty.target
|
||||
IgnoreOnIsolate=yes
|
||||
|
||||
[Service]
|
||||
-Environment=TERM=vt100
|
||||
+Environment=TERM=vt102
|
||||
ExecStart=-/sbin/agetty -s %I 115200,38400,9600
|
||||
Restart=always
|
||||
RestartSec=0
|
@ -1,8 +1,8 @@
|
||||
Index: systemd-37/src/cryptsetup/cryptsetup-generator.c
|
||||
Index: systemd-190/src/cryptsetup/cryptsetup-generator.c
|
||||
===================================================================
|
||||
--- systemd-37.orig/src/cryptsetup/cryptsetup-generator.c
|
||||
+++ systemd-37/src/cryptsetup/cryptsetup-generator.c
|
||||
@@ -138,7 +138,7 @@ static int create_disk(
|
||||
--- systemd-190.orig/src/cryptsetup/cryptsetup-generator.c
|
||||
+++ systemd-190/src/cryptsetup/cryptsetup-generator.c
|
||||
@@ -136,7 +136,7 @@ static int create_disk(
|
||||
const char *password,
|
||||
const char *options) {
|
||||
|
||||
@ -11,62 +11,64 @@ Index: systemd-37/src/cryptsetup/cryptsetup-generator.c
|
||||
int r;
|
||||
FILE *f = NULL;
|
||||
bool noauto, nofail;
|
||||
@@ -167,10 +167,50 @@ static int create_disk(
|
||||
@@ -168,11 +168,51 @@ static int create_disk(
|
||||
goto fail;
|
||||
}
|
||||
|
||||
- if (!(d = unit_name_from_path(u, ".device"))) {
|
||||
- d = unit_name_from_path(u, ".device");
|
||||
- if (!d) {
|
||||
- r = -ENOMEM;
|
||||
- log_error("Failed to allocate device name.");
|
||||
- goto fail;
|
||||
+ if (!startswith(device,"/dev/")) {
|
||||
+ d = unit_name_from_path_instance("cryptsetup", name, ".path");
|
||||
+ if (!d) {
|
||||
+ r = -ENOMEM;
|
||||
+ log_error("Failed to allocate path name.");
|
||||
+ goto fail;
|
||||
+ }
|
||||
+
|
||||
+ if (!(d = unit_name_build_escape("cryptsetup", name, ".path"))) {
|
||||
+ r = -ENOMEM;
|
||||
+ log_error("Failed to allocate path name.");
|
||||
+ goto fail;
|
||||
+ }
|
||||
+ if (asprintf(&path_file, "%s/%s", arg_dest, d) < 0) {
|
||||
+ r = -ENOMEM;
|
||||
+ log_error("Failed to allocate unit file name.");
|
||||
+ goto fail;
|
||||
+ }
|
||||
+
|
||||
+ if (asprintf(&path_file, "%s/%s", arg_dest, d) < 0) {
|
||||
+ r = -ENOMEM;
|
||||
+ log_error("Failed to allocate unit file name.");
|
||||
+ goto fail;
|
||||
+ }
|
||||
+ f = fopen(path_file, "wxe");
|
||||
+ if (!f) {
|
||||
+ r = -errno;
|
||||
+ log_error("Failed to create unit file: %m");
|
||||
+ goto fail;
|
||||
+ }
|
||||
+
|
||||
+ if (!(f = fopen(path_file, "wxe"))) {
|
||||
+ r = -errno;
|
||||
+ log_error("Failed to create unit file: %m");
|
||||
+ goto fail;
|
||||
+ }
|
||||
+ fprintf(f,
|
||||
+ "[Unit]\n"
|
||||
+ "Description=Cryptography Setup for %s\n"
|
||||
+ "DefaultDependencies=no\n"
|
||||
+ "[Path]\n"
|
||||
+ "PathExists=%s\n",
|
||||
+ device, device);
|
||||
+
|
||||
+ fprintf(f,
|
||||
+ "[Unit]\n"
|
||||
+ "Description=Cryptography Setup for %s\n"
|
||||
+ "DefaultDependencies=no\n"
|
||||
+ "[Path]\n"
|
||||
+ "PathExists=%s\n",
|
||||
+ device, device);
|
||||
+ fflush(f);
|
||||
+
|
||||
+ fflush(f);
|
||||
+ if (ferror(f)) {
|
||||
+ r = -errno;
|
||||
+ log_error("Failed to write file: %m");
|
||||
+ goto fail;
|
||||
+ }
|
||||
+
|
||||
+ if (ferror(f)) {
|
||||
+ r = -errno;
|
||||
+ log_error("Failed to write file: %m");
|
||||
+ goto fail;
|
||||
+ }
|
||||
+
|
||||
+ f = NULL;
|
||||
+ f = NULL;
|
||||
+ } else {
|
||||
+
|
||||
+ if (!(d = unit_name_from_path(u, ".device"))) {
|
||||
+ r = -ENOMEM;
|
||||
+ log_error("Failed to allocate device name.");
|
||||
+ goto fail;
|
||||
+ }
|
||||
+ d = unit_name_from_path(u, ".device");
|
||||
+ if (!d) {
|
||||
+ r = -ENOMEM;
|
||||
+ log_error("Failed to allocate device name.");
|
||||
+ goto fail;
|
||||
+ }
|
||||
}
|
||||
|
||||
if (!(f = fopen(p, "wxe"))) {
|
||||
@@ -300,6 +340,7 @@ fail:
|
||||
f = fopen(p, "wxe");
|
||||
@@ -298,6 +338,7 @@ fail:
|
||||
free(n);
|
||||
free(d);
|
||||
free(e);
|
||||
|
@ -8,26 +8,26 @@ Subject: [PATCH] delay fsck / cryptsetup after md / dmraid / lvm are started
|
||||
units/fsck@.service.in | 2 +-
|
||||
2 files changed, 2 insertions(+), 1 deletions(-)
|
||||
|
||||
Index: systemd-37/src/cryptsetup/cryptsetup-generator.c
|
||||
Index: systemd-189/src/cryptsetup/cryptsetup-generator.c
|
||||
===================================================================
|
||||
--- systemd-37.orig/src/cryptsetup/cryptsetup-generator.c
|
||||
+++ systemd-37/src/cryptsetup/cryptsetup-generator.c
|
||||
@@ -112,6 +112,7 @@ static int create_disk(
|
||||
--- systemd-189.orig/src/cryptsetup/cryptsetup-generator.c
|
||||
+++ systemd-189/src/cryptsetup/cryptsetup-generator.c
|
||||
@@ -192,6 +192,7 @@ static int create_disk(
|
||||
"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"
|
||||
+ "After=md.service dmraid.service lvm.service\n"
|
||||
"Before=umount.target\n",
|
||||
d, d);
|
||||
|
||||
Index: systemd-37/units/fsck@.service.in
|
||||
Index: systemd-189/units/systemd-fsck@.service.in
|
||||
===================================================================
|
||||
--- systemd-37.orig/units/fsck@.service.in
|
||||
+++ systemd-37/units/fsck@.service.in
|
||||
@@ -9,7 +9,7 @@
|
||||
Description=File System Check on %f
|
||||
--- systemd-189.orig/units/systemd-fsck@.service.in
|
||||
+++ systemd-189/units/systemd-fsck@.service.in
|
||||
@@ -10,7 +10,7 @@ Description=File System Check on %f
|
||||
Documentation=man:systemd-fsck@.service(8)
|
||||
DefaultDependencies=no
|
||||
BindTo=%i.device
|
||||
BindsTo=%i.device
|
||||
-After=systemd-readahead-collect.service systemd-readahead-replay.service %i.device
|
||||
+After=systemd-readahead-collect.service systemd-readahead-replay.service %i.device lvm.service md.service dmraid.service
|
||||
Before=shutdown.target
|
||||
|
@ -1,9 +1,9 @@
|
||||
Index: systemd-37/units/local-fs-pre.target
|
||||
Index: systemd-189/units/local-fs-pre.target
|
||||
===================================================================
|
||||
--- systemd-37.orig/units/local-fs-pre.target
|
||||
+++ systemd-37/units/local-fs-pre.target
|
||||
@@ -9,3 +9,4 @@
|
||||
|
||||
--- systemd-189.orig/units/local-fs-pre.target
|
||||
+++ systemd-189/units/local-fs-pre.target
|
||||
@@ -8,3 +8,4 @@
|
||||
[Unit]
|
||||
Description=Local File Systems (Pre)
|
||||
Documentation=man:systemd.special(7)
|
||||
+After=md.service lvm.service dmraid.service
|
||||
|
@ -1,48 +0,0 @@
|
||||
Index: systemd-44/src/timedate/timedated.c
|
||||
===================================================================
|
||||
--- systemd-44.orig/src/timedate/timedated.c
|
||||
+++ systemd-44/src/timedate/timedated.c
|
||||
@@ -203,24 +203,18 @@ static int read_data(void) {
|
||||
|
||||
free(t);
|
||||
|
||||
- r = read_one_line_file("/etc/timezone", &tz.zone);
|
||||
- if (r < 0) {
|
||||
- if (r != -ENOENT)
|
||||
- log_warning("Failed to read /etc/timezone: %s", strerror(-r));
|
||||
-
|
||||
#if defined(TARGET_FEDORA) || defined(TARGET_SUSE)
|
||||
- r = parse_env_file("/etc/sysconfig/clock", NEWLINE,
|
||||
+ r = parse_env_file("/etc/sysconfig/clock", NEWLINE,
|
||||
#ifdef TARGET_FEDORA
|
||||
- "ZONE", &tz.zone,
|
||||
+ "ZONE", &tz.zone,
|
||||
#else /* TARGET_SUSE */
|
||||
- "TIMEZONE", &tz.zone,
|
||||
+ "TIMEZONE", &tz.zone,
|
||||
#endif
|
||||
- NULL);
|
||||
+ NULL);
|
||||
|
||||
- if (r < 0 && r != -ENOENT)
|
||||
- log_warning("Failed to read /etc/sysconfig/clock: %s", strerror(-r));
|
||||
+ if (r < 0 && r != -ENOENT)
|
||||
+ log_warning("Failed to read /etc/sysconfig/clock: %s", strerror(-r));
|
||||
#endif
|
||||
- }
|
||||
|
||||
have_timezone:
|
||||
if (isempty(tz.zone)) {
|
||||
@@ -263,12 +257,6 @@ static int write_data_timezone(void) {
|
||||
if (r < 0)
|
||||
return -errno;
|
||||
|
||||
- if (stat("/etc/timezone", &st) == 0 && S_ISREG(st.st_mode)) {
|
||||
- r = write_one_line_file_atomic("/etc/timezone", tz.zone);
|
||||
- if (r < 0)
|
||||
- return r;
|
||||
- }
|
||||
-
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,11 +1,11 @@
|
||||
Index: systemd-44/src/fsck.c
|
||||
Index: systemd-189/src/fsck/fsck.c
|
||||
===================================================================
|
||||
--- systemd-44.orig/src/fsck.c
|
||||
+++ systemd-44/src/fsck.c
|
||||
@@ -127,7 +127,7 @@ static int parse_proc_cmdline(void) {
|
||||
--- systemd-189.orig/src/fsck/fsck.c
|
||||
+++ systemd-189/src/fsck/fsck.c
|
||||
@@ -128,7 +128,7 @@ static int parse_proc_cmdline(void) {
|
||||
arg_skip = true;
|
||||
else if (startswith(w, "fsck.mode"))
|
||||
log_warning("Invalid fsck.mode= parameter. Ignoring.");
|
||||
else if (startswith(w, "fsck"))
|
||||
log_warning("Invalid fsck parameter. Ignoring.");
|
||||
-#if defined(TARGET_FEDORA) || defined(TARGET_MANDRIVA) || defined(TARGET_MAGEIA)
|
||||
+#if defined(TARGET_FEDORA) || defined(TARGET_MANDRIVA) || defined(TARGET_MAGEIA) || defined(TARGET_SUSE)
|
||||
else if (strneq(w, "fastboot", l))
|
||||
|
@ -1,29 +0,0 @@
|
||||
From 6070fe66ac2f317e7e85e5685f0916d1e2b73a28 Mon Sep 17 00:00:00 2001
|
||||
From: Colin Guthrie <colin@mageia.org>
|
||||
Date: Mon, 2 Apr 2012 11:08:20 +0100
|
||||
Subject: [PATCH] analyze: Cosmetic exit when the bootup is not yet complete
|
||||
when plotting.
|
||||
|
||||
This is just a nicer message than a python traceback.
|
||||
---
|
||||
src/systemd-analyze | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/src/systemd-analyze b/src/systemd-analyze
|
||||
index 8148bfb..a49fbb7 100755
|
||||
--- a/src/systemd-analyze
|
||||
+++ b/src/systemd-analyze
|
||||
@@ -31,6 +31,10 @@ def acquire_start_time():
|
||||
startup_time = int(properties.Get('org.freedesktop.systemd1.Manager', 'StartupTimestampMonotonic'))
|
||||
finish_time = int(properties.Get('org.freedesktop.systemd1.Manager', 'FinishTimestampMonotonic'))
|
||||
|
||||
+ if finish_time == 0:
|
||||
+ sys.stderr.write("Bootup is not yet finished. Please try again later.\n")
|
||||
+ sys.exit(1)
|
||||
+
|
||||
assert initrd_time <= startup_time
|
||||
assert startup_time <= finish_time
|
||||
|
||||
--
|
||||
1.7.10.4
|
||||
|
@ -1,41 +0,0 @@
|
||||
From de49f6dd99aca059da24c9afc672782f1768abd2 Mon Sep 17 00:00:00 2001
|
||||
From: Kay Sievers <kay@vrfy.org>
|
||||
Date: Wed, 11 Apr 2012 21:33:12 +0200
|
||||
Subject: [PATCH] tmpfiles: open directories with O_NOATIME to preserve
|
||||
timestamp
|
||||
|
||||
Before:
|
||||
# stat /tmp/pulse-Du5ectm60QYM | grep 'Access: 20'
|
||||
Access: 2012-04-11 21:32:48.444920237 +0200
|
||||
# systemd-tmpfiles --clean
|
||||
# stat /tmp/pulse-Du5ectm60QYM | grep 'Access: 20'
|
||||
Access: 2012-04-11 21:36:27.628925459 +0200
|
||||
|
||||
After:
|
||||
# stat /tmp/pulse-Du5ectm60QYM | grep 'Access: 20'
|
||||
Access: 2012-04-11 21:32:48.444920237 +0200
|
||||
# ./systemd-tmpfiles --clean
|
||||
# stat /tmp/pulse-Du5ectm60QYM | grep 'Access: 20'
|
||||
Access: 2012-04-11 21:32:48.444920237 +0200
|
||||
|
||||
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=810257
|
||||
---
|
||||
src/tmpfiles.c | 2 +-
|
||||
1 files changed, 1 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/src/tmpfiles.c b/src/tmpfiles.c
|
||||
index 21bf44d..09eefcf 100644
|
||||
--- a/src/tmpfiles.c
|
||||
+++ b/src/tmpfiles.c
|
||||
@@ -250,7 +250,7 @@ static int dir_cleanup(
|
||||
DIR *sub_dir;
|
||||
int q;
|
||||
|
||||
- sub_dir = xopendirat(dirfd(d), dent->d_name, O_NOFOLLOW);
|
||||
+ sub_dir = xopendirat(dirfd(d), dent->d_name, O_NOFOLLOW|O_NOATIME);
|
||||
if (sub_dir == NULL) {
|
||||
if (errno != ENOENT) {
|
||||
log_error("opendir(%s/%s) failed: %m", p, dent->d_name);
|
||||
--
|
||||
1.7.7
|
||||
|
@ -7,11 +7,11 @@ Subject: [PATCH] fix support for boot prefixed initscript (bnc#746506)
|
||||
src/systemctl.c | 20 ++++++++++++++++++++
|
||||
1 file changed, 20 insertions(+)
|
||||
|
||||
diff --git a/src/systemctl.c b/src/systemctl.c
|
||||
index e94e024..1a98599 100644
|
||||
--- a/src/systemctl.c
|
||||
+++ b/src/systemctl.c
|
||||
@@ -3669,7 +3669,27 @@ static int enable_sysv_units(char **args) {
|
||||
Index: systemd-195/src/systemctl/systemctl.c
|
||||
===================================================================
|
||||
--- systemd-195.orig/src/systemctl/systemctl.c
|
||||
+++ systemd-195/src/systemctl/systemctl.c
|
||||
@@ -3453,7 +3453,27 @@ static int enable_sysv_units(char **args
|
||||
|
||||
if (!found_sysv) {
|
||||
free(p);
|
||||
@ -39,6 +39,3 @@ index e94e024..1a98599 100644
|
||||
}
|
||||
|
||||
/* Mark this entry, so that we don't try enabling it as native unit */
|
||||
--
|
||||
1.7.10.4
|
||||
|
||||
|
@ -1,51 +0,0 @@
|
||||
From 4771148bb92ace55eaa6759a53d04a0f2de9b0d2 Mon Sep 17 00:00:00 2001
|
||||
From: Lennart Poettering <lennart@poettering.net>
|
||||
Date: Wed, 11 Apr 2012 21:58:33 +0200
|
||||
Subject: [PATCH] units: exclude gettys from isolate requests
|
||||
|
||||
gettys are nowadays mostly autospawned and hence usually subject to
|
||||
being shut down on isolate requests, since they are no dependency of any
|
||||
other unit. This is a bad idea if the user isolates between
|
||||
multi-user.graphical and graphical.target, hence exclude them from the
|
||||
isolation.
|
||||
|
||||
This has the effect that gettys no longer cleaned up when
|
||||
emergency.target is isolated, which might actualy be considered a
|
||||
feature, even though it is a change from previous behaviour...
|
||||
|
||||
Note that the one getty that really matters (the one on tty1) is still
|
||||
removed when isolating to emergency.target since it conflicts with
|
||||
emergency.service.
|
||||
---
|
||||
TODO | 4 ++--
|
||||
units/getty@.service.m4 | 1 +
|
||||
units/serial-getty@.service.m4 | 1 +
|
||||
3 files changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/units/getty@.service.m4 b/units/getty@.service.m4
|
||||
index a02838d..6b931fb 100644
|
||||
--- a/units/getty@.service.m4
|
||||
+++ b/units/getty@.service.m4
|
||||
@@ -32,6 +32,7 @@ After=rc-local.service
|
||||
# sure that this is synchronized before getty.target, even though
|
||||
# getty.target didn't actually pull it in.
|
||||
Before=getty.target
|
||||
+IgnoreOnIsolate=yes
|
||||
|
||||
[Service]
|
||||
Environment=TERM=linux
|
||||
diff --git a/units/serial-getty@.service.m4 b/units/serial-getty@.service.m4
|
||||
index fc8b57b..d1d14d3 100644
|
||||
--- a/units/serial-getty@.service.m4
|
||||
+++ b/units/serial-getty@.service.m4
|
||||
@@ -32,6 +32,7 @@ After=rc-local.service
|
||||
# sure that this is synchronized before getty.target, even though
|
||||
# getty.target didn't actually pull it in.
|
||||
Before=getty.target
|
||||
+IgnoreOnIsolate=yes
|
||||
|
||||
[Service]
|
||||
Environment=TERM=vt100
|
||||
--
|
||||
1.7.7
|
||||
|
@ -1,36 +0,0 @@
|
||||
Index: systemd-37/src/mount.c
|
||||
===================================================================
|
||||
--- systemd-37.orig/src/mount.c
|
||||
+++ systemd-37/src/mount.c
|
||||
@@ -1485,7 +1485,7 @@ fail:
|
||||
return r;
|
||||
}
|
||||
|
||||
-static int mount_find_pri(char *options) {
|
||||
+static int mount_find_pri(char *options, int *ret) {
|
||||
char *end, *pri;
|
||||
unsigned long r;
|
||||
|
||||
@@ -1503,7 +1503,8 @@ static int mount_find_pri(char *options)
|
||||
if (end == pri || (*end != ',' && *end != 0))
|
||||
return -EINVAL;
|
||||
|
||||
- return (int) r;
|
||||
+ *ret = (int) r;
|
||||
+ return 1;
|
||||
}
|
||||
|
||||
static int mount_load_etc_fstab(Manager *m) {
|
||||
@@ -1539,9 +1540,10 @@ static int mount_load_etc_fstab(Manager
|
||||
path_kill_slashes(where);
|
||||
|
||||
if (streq(me->mnt_type, "swap")) {
|
||||
- int pri;
|
||||
+ int r, pri = -1;
|
||||
|
||||
- if ((pri = mount_find_pri(me->mnt_opts)) < 0)
|
||||
+ r = mount_find_pri(me->mnt_opts,&pri);
|
||||
+ if (r < 0)
|
||||
k = pri;
|
||||
else
|
||||
k = swap_add_one(m,
|
@ -1,40 +0,0 @@
|
||||
From d55248d6a6f69f3b6c86cfc0d11aff8831590a4f Mon Sep 17 00:00:00 2001
|
||||
From: Lennart Poettering <lennart@poettering.net>
|
||||
Date: Thu, 12 Apr 2012 17:29:42 +0200
|
||||
Subject: [PATCH] getty: VC devices are always available, we don't need to
|
||||
wait until they show up
|
||||
|
||||
---
|
||||
src/99-systemd.rules.in | 1 -
|
||||
units/getty@.service.m4 | 3 +--
|
||||
2 files changed, 1 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/99-systemd.rules.in b/src/99-systemd.rules.in
|
||||
index d306f71..8cc7523 100644
|
||||
--- a/src/99-systemd.rules.in
|
||||
+++ b/src/99-systemd.rules.in
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
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/units/getty@.service.m4 b/units/getty@.service.m4
|
||||
index a02838d..c397a4d 100644
|
||||
--- a/units/getty@.service.m4
|
||||
+++ b/units/getty@.service.m4
|
||||
@@ -7,8 +7,7 @@
|
||||
|
||||
[Unit]
|
||||
Description=Getty on %I
|
||||
-BindTo=dev-%i.device
|
||||
-After=dev-%i.device systemd-user-sessions.service plymouth-quit-wait.service
|
||||
+After=systemd-user-sessions.service plymouth-quit-wait.service
|
||||
m4_ifdef(`TARGET_FEDORA',
|
||||
After=rc-local.service
|
||||
)m4_dnl
|
||||
--
|
||||
1.7.7
|
||||
|
@ -1,99 +0,0 @@
|
||||
From 0753f9b016f144a6ebe11cd8a2c377e5a0345443 Mon Sep 17 00:00:00 2001
|
||||
From: Lennart Poettering <lennart@poettering.net>
|
||||
Date: Tue, 22 May 2012 16:46:11 +0200
|
||||
Subject: [PATCH] logind: fix write out of user state file
|
||||
|
||||
---
|
||||
src/login/logind-user.c | 65 ++++++++++++++++++++++++++++++----------------
|
||||
1 files changed, 42 insertions(+), 23 deletions(-)
|
||||
|
||||
diff --git a/src/login/logind-user.c b/src/login/logind-user.c
|
||||
index 717f0e2..b7f579c 100644
|
||||
--- a/src/login/logind-user.c
|
||||
+++ b/src/login/logind-user.c
|
||||
@@ -136,40 +136,59 @@ int user_save(User *u) {
|
||||
|
||||
if (u->sessions) {
|
||||
Session *i;
|
||||
+ bool first;
|
||||
|
||||
fputs("SESSIONS=", f);
|
||||
+ first = true;
|
||||
LIST_FOREACH(sessions_by_user, i, u->sessions) {
|
||||
- fprintf(f,
|
||||
- "%s%c",
|
||||
- i->id,
|
||||
- i->sessions_by_user_next ? ' ' : '\n');
|
||||
+ if (first)
|
||||
+ first = false;
|
||||
+ else
|
||||
+ fputc(' ', f);
|
||||
+
|
||||
+ fputs(i->id, f);
|
||||
}
|
||||
|
||||
- fputs("SEATS=", f);
|
||||
+ fputs("\nSEATS=", f);
|
||||
+ first = true;
|
||||
LIST_FOREACH(sessions_by_user, i, u->sessions) {
|
||||
- if (i->seat)
|
||||
- fprintf(f,
|
||||
- "%s%c",
|
||||
- i->seat->id,
|
||||
- i->sessions_by_user_next ? ' ' : '\n');
|
||||
+ if (!i->seat)
|
||||
+ continue;
|
||||
+
|
||||
+ if (first)
|
||||
+ first = false;
|
||||
+ else
|
||||
+ fputc(' ', f);
|
||||
+
|
||||
+ fputs(i->seat->id, f);
|
||||
}
|
||||
|
||||
- fputs("ACTIVE_SESSIONS=", f);
|
||||
- LIST_FOREACH(sessions_by_user, i, u->sessions)
|
||||
- if (session_is_active(i))
|
||||
- fprintf(f,
|
||||
- "%lu%c",
|
||||
- (unsigned long) i->user->uid,
|
||||
- i->sessions_by_user_next ? ' ' : '\n');
|
||||
+ fputs("\nACTIVE_SESSIONS=", f);
|
||||
+ first = true;
|
||||
+ LIST_FOREACH(sessions_by_user, i, u->sessions) {
|
||||
+ if (!session_is_active(i))
|
||||
+ continue;
|
||||
+
|
||||
+ if (first)
|
||||
+ first = false;
|
||||
+ else
|
||||
+ fputc(' ', f);
|
||||
+
|
||||
+ fputs(i->id, f);
|
||||
+ }
|
||||
|
||||
- fputs("ACTIVE_SEATS=", f);
|
||||
+ fputs("\nACTIVE_SEATS=", f);
|
||||
+ first = true;
|
||||
LIST_FOREACH(sessions_by_user, i, u->sessions) {
|
||||
- if (session_is_active(i) && i->seat)
|
||||
- fprintf(f,
|
||||
- "%s%c",
|
||||
- i->seat->id,
|
||||
- i->sessions_by_user_next ? ' ' : '\n');
|
||||
+ if (!session_is_active(i) || !i->seat)
|
||||
+ continue;
|
||||
+
|
||||
+ if (first)
|
||||
+ first = false;
|
||||
+ else
|
||||
+ fputs(i->seat->id, f);
|
||||
}
|
||||
+ fputc('\n', f);
|
||||
}
|
||||
|
||||
fflush(f);
|
||||
--
|
||||
1.7.7
|
||||
|
73
fixppc.patch
73
fixppc.patch
@ -1,73 +0,0 @@
|
||||
From 7264278fbbdc1dc6c30fedc902d1337594aa6ff6 Mon Sep 17 00:00:00 2001
|
||||
From: Lennart Poettering <lennart@poettering.net>
|
||||
Date: Wed, 21 Mar 2012 23:47:44 +0100
|
||||
Subject: [PATCH] journal: PAGE_SIZE is not known on ppc and other archs
|
||||
|
||||
Let's use NAME_MAX, as suggested by Dan Walsh
|
||||
---
|
||||
src/journal/journald.c | 15 ++++++++++++---
|
||||
1 files changed, 12 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/journal/journald.c b/src/journal/journald.c
|
||||
index d27cb60..87390bd 100644
|
||||
--- a/src/journal/journald.c
|
||||
+++ b/src/journal/journald.c
|
||||
@@ -29,7 +29,6 @@
|
||||
#include <sys/ioctl.h>
|
||||
#include <linux/sockios.h>
|
||||
#include <sys/statvfs.h>
|
||||
-#include <sys/user.h>
|
||||
|
||||
#include <systemd/sd-journal.h>
|
||||
#include <systemd/sd-login.h>
|
||||
@@ -2149,10 +2148,20 @@ static int process_event(Server *s, struct epoll_event *ev) {
|
||||
size_t label_len = 0;
|
||||
union {
|
||||
struct cmsghdr cmsghdr;
|
||||
+
|
||||
+ /* We use NAME_MAX space for the
|
||||
+ * SELinux label here. The kernel
|
||||
+ * currently enforces no limit, but
|
||||
+ * according to suggestions from the
|
||||
+ * SELinux people this will change and
|
||||
+ * it will probably be identical to
|
||||
+ * NAME_MAX. For now we use that, but
|
||||
+ * this should be updated one day when
|
||||
+ * the final limit is known.*/
|
||||
uint8_t buf[CMSG_SPACE(sizeof(struct ucred)) +
|
||||
CMSG_SPACE(sizeof(struct timeval)) +
|
||||
- CMSG_SPACE(sizeof(int)) +
|
||||
- CMSG_SPACE(PAGE_SIZE)]; /* selinux label */
|
||||
+ CMSG_SPACE(sizeof(int)) + /* fd */
|
||||
+ CMSG_SPACE(NAME_MAX)]; /* selinux label */
|
||||
} control;
|
||||
ssize_t n;
|
||||
int v;
|
||||
--
|
||||
1.7.7
|
||||
|
||||
From dd1e3d5a396284d1afdb2828991a543eb80c8040 Mon Sep 17 00:00:00 2001
|
||||
From: Frederic Crozat <fcrozat@suse.com>
|
||||
Date: Thu, 22 Mar 2012 09:39:54 +0100
|
||||
Subject: [PATCH] journal: char is unsigned on ppc, use int8_t instead.
|
||||
|
||||
---
|
||||
src/journal/cat.c | 2 +-
|
||||
1 files changed, 1 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/src/journal/cat.c b/src/journal/cat.c
|
||||
index 31d76f3..8a51fb7 100644
|
||||
--- a/src/journal/cat.c
|
||||
+++ b/src/journal/cat.c
|
||||
@@ -33,7 +33,7 @@
|
||||
#include "build.h"
|
||||
|
||||
static char *arg_identifier = NULL;
|
||||
-static char arg_priority = LOG_INFO;
|
||||
+static int8_t arg_priority = LOG_INFO;
|
||||
static bool arg_level_prefix = true;
|
||||
|
||||
static int help(void) {
|
||||
--
|
||||
1.7.7
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,186 +0,0 @@
|
||||
From 911efc97f9bfe2ad4f4d021f5e76d05c8d5d81ac Mon Sep 17 00:00:00 2001
|
||||
From: Lennart Poettering <lennart@poettering.net>
|
||||
Date: Thu, 12 Apr 2012 12:57:41 +0200
|
||||
Subject: [PATCH 1/4] journald: add missing flag to open()
|
||||
|
||||
---
|
||||
src/journal/journald.c | 2 +-
|
||||
1 files changed, 1 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/src/journal/journald.c b/src/journal/journald.c
|
||||
index baad3ab..c8b400a 100644
|
||||
--- a/src/journal/journald.c
|
||||
+++ b/src/journal/journald.c
|
||||
@@ -2461,7 +2461,7 @@ static int open_proc_kmsg(Server *s) {
|
||||
return 0;
|
||||
|
||||
|
||||
- s->proc_kmsg_fd = open("/proc/kmsg", O_CLOEXEC|O_NONBLOCK|O_NOCTTY);
|
||||
+ s->proc_kmsg_fd = open("/proc/kmsg", O_RDONLY|O_CLOEXEC|O_NONBLOCK|O_NOCTTY);
|
||||
if (s->proc_kmsg_fd < 0) {
|
||||
log_warning("Failed to open /proc/kmsg, ignoring: %m");
|
||||
return 0;
|
||||
--
|
||||
1.7.7
|
||||
|
||||
|
||||
From 94b8299358fd743137857bc0f28ab62bcf6eec92 Mon Sep 17 00:00:00 2001
|
||||
From: Lennart Poettering <lennart@poettering.net>
|
||||
Date: Fri, 13 Apr 2012 13:58:50 +0200
|
||||
Subject: [PATCH 2/4] fix a couple of things found with the llvm static
|
||||
analyzer
|
||||
|
||||
---
|
||||
src/journal/journal-file.c | 2 +-
|
||||
src/journal/journald.c | 2 +-
|
||||
src/logs-show.c | 2 +-
|
||||
src/manager.c | 2 +-
|
||||
4 files changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
|
||||
index 474dd5c..5255c3b 100644
|
||||
--- a/src/journal/journal-file.c
|
||||
+++ b/src/journal/journal-file.c
|
||||
@@ -1974,7 +1974,7 @@ int journal_directory_vacuum(const char *directory, uint64_t max_use, uint64_t m
|
||||
size_t q;
|
||||
struct stat st;
|
||||
char *p;
|
||||
- unsigned long long seqnum, realtime;
|
||||
+ unsigned long long seqnum = 0, realtime;
|
||||
sd_id128_t seqnum_id;
|
||||
bool have_seqnum;
|
||||
|
||||
diff --git a/src/journal/journald.c b/src/journal/journald.c
|
||||
index c8b400a..1118b7e 100644
|
||||
--- a/src/journal/journald.c
|
||||
+++ b/src/journal/journald.c
|
||||
@@ -1140,7 +1140,7 @@ static void process_native_message(
|
||||
char *identifier = NULL, *message = NULL;
|
||||
|
||||
assert(s);
|
||||
- assert(buffer || n == 0);
|
||||
+ assert(buffer || buffer_size == 0);
|
||||
|
||||
p = buffer;
|
||||
remaining = buffer_size;
|
||||
diff --git a/src/logs-show.c b/src/logs-show.c
|
||||
index f71c6b0..eb9a902 100644
|
||||
--- a/src/logs-show.c
|
||||
+++ b/src/logs-show.c
|
||||
@@ -541,7 +541,7 @@ int show_journal_by_unit(
|
||||
bool follow) {
|
||||
|
||||
char *m = NULL;
|
||||
- sd_journal *j;
|
||||
+ sd_journal *j = NULL;
|
||||
int r;
|
||||
int fd;
|
||||
unsigned line = 0;
|
||||
diff --git a/src/manager.c b/src/manager.c
|
||||
index 74bd740..3e592b6 100644
|
||||
--- a/src/manager.c
|
||||
+++ b/src/manager.c
|
||||
@@ -2979,7 +2979,7 @@ bool manager_unit_pending_inactive(Manager *m, const char *name) {
|
||||
|
||||
void manager_check_finished(Manager *m) {
|
||||
char userspace[FORMAT_TIMESPAN_MAX], initrd[FORMAT_TIMESPAN_MAX], kernel[FORMAT_TIMESPAN_MAX], sum[FORMAT_TIMESPAN_MAX];
|
||||
- usec_t kernel_usec = 0, initrd_usec = 0, userspace_usec = 0, total_usec = 0;
|
||||
+ usec_t kernel_usec, initrd_usec, userspace_usec, total_usec;
|
||||
|
||||
assert(m);
|
||||
|
||||
--
|
||||
1.7.7
|
||||
|
||||
|
||||
From f83fa045b967478a80ca55477dfe6a5be5f0b4a8 Mon Sep 17 00:00:00 2001
|
||||
From: Sjoerd Simons <sjoerd@luon.net>
|
||||
Date: Sat, 14 Apr 2012 14:11:08 +0200
|
||||
Subject: [PATCH 3/4] journal: crash when filesystem is low on space
|
||||
|
||||
When space is getting too low on a file system rotating the journal file
|
||||
will fail after the rotation, as opening the new logfile will fail.
|
||||
|
||||
Recognize this when logging the error and don't try to dereference a
|
||||
NULL JournalFile pointer.
|
||||
---
|
||||
src/journal/journald.c | 16 +++++++++++++---
|
||||
1 files changed, 13 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/journal/journald.c b/src/journal/journald.c
|
||||
index 1118b7e..9180656 100644
|
||||
--- a/src/journal/journald.c
|
||||
+++ b/src/journal/journald.c
|
||||
@@ -330,7 +330,10 @@ static void server_rotate(Server *s) {
|
||||
if (s->runtime_journal) {
|
||||
r = journal_file_rotate(&s->runtime_journal);
|
||||
if (r < 0)
|
||||
- log_error("Failed to rotate %s: %s", s->runtime_journal->path, strerror(-r));
|
||||
+ if (s->runtime_journal)
|
||||
+ log_error("Failed to rotate %s: %s", s->runtime_journal->path, strerror(-r));
|
||||
+ else
|
||||
+ log_error("Failed to create new runtime journal: %s", strerror(-r));
|
||||
else
|
||||
server_fix_perms(s, s->runtime_journal, 0);
|
||||
}
|
||||
@@ -338,7 +341,11 @@ static void server_rotate(Server *s) {
|
||||
if (s->system_journal) {
|
||||
r = journal_file_rotate(&s->system_journal);
|
||||
if (r < 0)
|
||||
- log_error("Failed to rotate %s: %s", s->system_journal->path, strerror(-r));
|
||||
+ if (s->system_journal)
|
||||
+ log_error("Failed to rotate %s: %s", s->system_journal->path, strerror(-r));
|
||||
+ else
|
||||
+ log_error("Failed to create new system journal: %s", strerror(-r));
|
||||
+
|
||||
else
|
||||
server_fix_perms(s, s->system_journal, 0);
|
||||
}
|
||||
@@ -346,7 +353,10 @@ static void server_rotate(Server *s) {
|
||||
HASHMAP_FOREACH_KEY(f, k, s->user_journals, i) {
|
||||
r = journal_file_rotate(&f);
|
||||
if (r < 0)
|
||||
- log_error("Failed to rotate %s: %s", f->path, strerror(-r));
|
||||
+ if (f->path)
|
||||
+ log_error("Failed to rotate %s: %s", f->path, strerror(-r));
|
||||
+ else
|
||||
+ log_error("Failed to create user journal: %s", strerror(-r));
|
||||
else {
|
||||
hashmap_replace(s->user_journals, k, f);
|
||||
server_fix_perms(s, s->system_journal, PTR_TO_UINT32(k));
|
||||
--
|
||||
1.7.7
|
||||
|
||||
|
||||
From d80e2f5c26aae25c0773042bcd1599d3c583bf6a Mon Sep 17 00:00:00 2001
|
||||
From: Michal Schmidt <mschmidt@redhat.com>
|
||||
Date: Tue, 12 Jun 2012 16:45:09 +0200
|
||||
Subject: [PATCH 4/4] journal-file: fix mmap leak
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=831132
|
||||
---
|
||||
src/journal/journal-file.c | 7 +++++--
|
||||
1 files changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
|
||||
index 5255c3b..e242fa2 100644
|
||||
--- a/src/journal/journal-file.c
|
||||
+++ b/src/journal/journal-file.c
|
||||
@@ -67,9 +67,12 @@ void journal_file_close(JournalFile *f) {
|
||||
|
||||
assert(f);
|
||||
|
||||
- if (f->header && f->writable)
|
||||
- f->header->state = STATE_OFFLINE;
|
||||
+ if (f->header) {
|
||||
+ if (f->writable)
|
||||
+ f->header->state = STATE_OFFLINE;
|
||||
|
||||
+ munmap(f->header, PAGE_ALIGN(sizeof(Header)));
|
||||
+ }
|
||||
|
||||
for (t = 0; t < _WINDOW_MAX; t++)
|
||||
if (f->windows[t].ptr)
|
||||
--
|
||||
1.7.7
|
||||
|
@ -1,448 +0,0 @@
|
||||
From 1682c4bf5b993b956b0367aedc9f0638055540f4 Mon Sep 17 00:00:00 2001
|
||||
From: Eelco Dolstra <eelco.dolstra@logicblox.com>
|
||||
Date: Thu, 19 Jul 2012 21:12:16 +0000
|
||||
Subject: [PATCH 1/3] 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.
|
||||
---
|
||||
src/logs-show.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/logs-show.c b/src/logs-show.c
|
||||
index eb9a902..72367f2 100644
|
||||
--- a/src/logs-show.c
|
||||
+++ b/src/logs-show.c
|
||||
@@ -230,7 +230,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);
|
||||
--
|
||||
1.7.10.4
|
||||
|
||||
|
||||
From ee385756e10862a8bcc0e5c7a3776135af84c750 Mon Sep 17 00:00:00 2001
|
||||
From: Zbigniew Jedrzejewski-Szmek <zbyszek@in.waw.pl>
|
||||
Date: Fri, 20 Jul 2012 09:06:26 +0200
|
||||
Subject: [PATCH 2/3] journalctl: fix ellipsization with PAGER=cat
|
||||
|
||||
There are other reasons for not opening the pager then the --no-pager
|
||||
or --follow options (described below). If the pager is not used,
|
||||
messages must be ellipsized.
|
||||
|
||||
On Fri, Jul 20, 2012 at 05:42:44AM +0000, Shawn Landen wrote:
|
||||
> "Pager to use when --no-pager is not given; overrides $PAGER.
|
||||
> Setting this to an empty string or the value cat is equivalent to passing --no-pager."
|
||||
|
||||
Conflicts:
|
||||
src/journal/journalctl.c
|
||||
---
|
||||
src/journal/journalctl.c | 5 +----
|
||||
src/pager.c | 17 ++++++++++-------
|
||||
src/pager.h | 4 +++-
|
||||
3 files changed, 14 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
|
||||
index f90b2dd..3a3b043 100644
|
||||
--- a/src/journal/journalctl.c
|
||||
+++ b/src/journal/journalctl.c
|
||||
@@ -259,10 +259,7 @@ int main(int argc, char *argv[]) {
|
||||
goto finish;
|
||||
}
|
||||
|
||||
- if (!arg_no_pager && !arg_follow) {
|
||||
- columns();
|
||||
- pager_open();
|
||||
- }
|
||||
+ have_pager = !arg_no_pager && !arg_follow && pager_open();
|
||||
|
||||
if (arg_output == OUTPUT_JSON) {
|
||||
fputc('[', stdout);
|
||||
diff --git a/src/pager.c b/src/pager.c
|
||||
index 3fc8182..8065841 100644
|
||||
--- a/src/pager.c
|
||||
+++ b/src/pager.c
|
||||
@@ -44,20 +44,20 @@ _noreturn_ static void pager_fallback(void) {
|
||||
_exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
-void pager_open(void) {
|
||||
+bool pager_open(void) {
|
||||
int fd[2];
|
||||
const char *pager;
|
||||
pid_t parent_pid;
|
||||
|
||||
if (pager_pid > 0)
|
||||
- return;
|
||||
+ return false;
|
||||
|
||||
if ((pager = getenv("SYSTEMD_PAGER")) || (pager = getenv("PAGER")))
|
||||
if (!*pager || streq(pager, "cat"))
|
||||
- return;
|
||||
+ return false;
|
||||
|
||||
if (isatty(STDOUT_FILENO) <= 0)
|
||||
- return;
|
||||
+ return false;
|
||||
|
||||
/* Determine and cache number of columns before we spawn the
|
||||
* pager so that we get the value from the actual tty */
|
||||
@@ -65,7 +65,7 @@ void pager_open(void) {
|
||||
|
||||
if (pipe(fd) < 0) {
|
||||
log_error("Failed to create pager pipe: %m");
|
||||
- return;
|
||||
+ return false;
|
||||
}
|
||||
|
||||
parent_pid = getpid();
|
||||
@@ -74,7 +74,7 @@ void pager_open(void) {
|
||||
if (pager_pid < 0) {
|
||||
log_error("Failed to fork pager: %m");
|
||||
close_pipe(fd);
|
||||
- return;
|
||||
+ return false;
|
||||
}
|
||||
|
||||
/* In the child start the pager */
|
||||
@@ -115,10 +115,13 @@ void pager_open(void) {
|
||||
}
|
||||
|
||||
/* Return in the parent */
|
||||
- if (dup2(fd[1], STDOUT_FILENO) < 0)
|
||||
+ if (dup2(fd[1], STDOUT_FILENO) < 0) {
|
||||
log_error("Failed to duplicate pager pipe: %m");
|
||||
+ return false;
|
||||
+ }
|
||||
|
||||
close_pipe(fd);
|
||||
+ return true;
|
||||
}
|
||||
|
||||
void pager_close(void) {
|
||||
diff --git a/src/pager.h b/src/pager.h
|
||||
index b5b4998..bd1a983 100644
|
||||
--- a/src/pager.h
|
||||
+++ b/src/pager.h
|
||||
@@ -22,7 +22,9 @@
|
||||
along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
||||
***/
|
||||
|
||||
-void pager_open(void);
|
||||
+#include <stdbool.h>
|
||||
+
|
||||
+bool pager_open(void);
|
||||
void pager_close(void);
|
||||
|
||||
#endif
|
||||
--
|
||||
1.7.10.4
|
||||
|
||||
|
||||
From ae88e07aec6280e90582703f7950468604182a4b Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
||||
Date: Tue, 17 Jul 2012 07:35:08 +0200
|
||||
Subject: [PATCH 3/3] journalctl: do not ellipsize when using pager
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
If a pager is used, ellipsization is redundant — the pager does
|
||||
that better by hiding the part that cannot be shown. Pager's advantage
|
||||
is that the user can press → to view the hidden part of a message,
|
||||
and then ← to return.
|
||||
|
||||
cherry-picked from 92a1fd9e95954a557d6fe27b56f5ef1b89fc2f5e and 25277cd7fbd77e4c8b20572570aa77c7da9abcc2
|
||||
---
|
||||
src/journal/journalctl.c | 7 ++++-
|
||||
src/logs-show.c | 66 ++++++++++++++++++++++++++++------------------
|
||||
src/logs-show.h | 14 +++++++---
|
||||
src/systemctl.c | 8 +++++-
|
||||
4 files changed, 64 insertions(+), 31 deletions(-)
|
||||
|
||||
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
|
||||
index 3a3b043..197af71 100644
|
||||
--- a/src/journal/journalctl.c
|
||||
+++ b/src/journal/journalctl.c
|
||||
@@ -198,6 +198,7 @@ int main(int argc, char *argv[]) {
|
||||
sd_journal *j = NULL;
|
||||
unsigned line = 0;
|
||||
bool need_seek = false;
|
||||
+ bool have_pager;
|
||||
|
||||
log_parse_environment();
|
||||
log_open();
|
||||
@@ -268,6 +269,10 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
for (;;) {
|
||||
for (;;) {
|
||||
+ int flags =
|
||||
+ arg_show_all * OUTPUT_SHOW_ALL |
|
||||
+ have_pager * OUTPUT_FULL_WIDTH;
|
||||
+
|
||||
if (need_seek) {
|
||||
r = sd_journal_next(j);
|
||||
if (r < 0) {
|
||||
@@ -281,7 +286,7 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
line ++;
|
||||
|
||||
- r = output_journal(j, arg_output, line, 0, arg_show_all);
|
||||
+ r = output_journal(j, arg_output, line, 0, flags);
|
||||
if (r < 0)
|
||||
goto finish;
|
||||
|
||||
diff --git a/src/logs-show.c b/src/logs-show.c
|
||||
index 72367f2..06ba569 100644
|
||||
--- a/src/logs-show.c
|
||||
+++ b/src/logs-show.c
|
||||
@@ -86,7 +86,8 @@ static bool shall_print(bool show_all, char *p, size_t l) {
|
||||
return true;
|
||||
}
|
||||
|
||||
-static int output_short(sd_journal *j, unsigned line, unsigned n_columns, bool show_all, bool monotonic_mode) {
|
||||
+static int output_short(sd_journal *j, unsigned line, unsigned n_columns,
|
||||
+ OutputFlags flags) {
|
||||
int r;
|
||||
const void *data;
|
||||
size_t length;
|
||||
@@ -150,7 +151,7 @@ static int output_short(sd_journal *j, unsigned line, unsigned n_columns, bool s
|
||||
goto finish;
|
||||
}
|
||||
|
||||
- if (monotonic_mode) {
|
||||
+ if (flags & OUTPUT_MONOTONIC_MODE) {
|
||||
uint64_t t;
|
||||
sd_id128_t boot_id;
|
||||
|
||||
@@ -202,33 +203,39 @@ static int output_short(sd_journal *j, unsigned line, unsigned n_columns, bool s
|
||||
n += strlen(buf);
|
||||
}
|
||||
|
||||
- if (hostname && shall_print(show_all, hostname, hostname_len)) {
|
||||
+ if (hostname && shall_print(flags & OUTPUT_SHOW_ALL,
|
||||
+ hostname, hostname_len)) {
|
||||
printf(" %.*s", (int) hostname_len, hostname);
|
||||
n += hostname_len + 1;
|
||||
}
|
||||
|
||||
- if (identifier && shall_print(show_all, identifier, identifier_len)) {
|
||||
+ if (identifier && shall_print(flags & OUTPUT_SHOW_ALL,
|
||||
+ identifier, identifier_len)) {
|
||||
printf(" %.*s", (int) identifier_len, identifier);
|
||||
n += identifier_len + 1;
|
||||
- } else if (comm && shall_print(show_all, comm, comm_len)) {
|
||||
+ } else if (comm && shall_print(flags & OUTPUT_SHOW_ALL,
|
||||
+ comm, comm_len)) {
|
||||
printf(" %.*s", (int) comm_len, comm);
|
||||
n += comm_len + 1;
|
||||
- }
|
||||
+ } else
|
||||
+ putchar(' ');
|
||||
|
||||
- if (pid && shall_print(show_all, pid, pid_len)) {
|
||||
+ if (pid && shall_print(flags & OUTPUT_SHOW_ALL, pid, pid_len)) {
|
||||
printf("[%.*s]", (int) pid_len, pid);
|
||||
n += pid_len + 2;
|
||||
- } else if (fake_pid && shall_print(show_all, fake_pid, fake_pid_len)) {
|
||||
+ } else if (fake_pid && shall_print(flags & OUTPUT_SHOW_ALL,
|
||||
+ fake_pid, fake_pid_len)) {
|
||||
printf("[%.*s]", (int) fake_pid_len, fake_pid);
|
||||
n += fake_pid_len + 2;
|
||||
}
|
||||
|
||||
- if (show_all)
|
||||
+ if (flags & OUTPUT_SHOW_ALL)
|
||||
printf(": %.*s\n", (int) message_len, message);
|
||||
else if (contains_unprintable(message, message_len)) {
|
||||
char bytes[FORMAT_BYTES_MAX];
|
||||
printf(": [%s blob data]\n", format_bytes(bytes, sizeof(bytes), message_len));
|
||||
- } else if (message_len + n < n_columns)
|
||||
+ } else if ((flags & OUTPUT_FULL_WIDTH) ||
|
||||
+ (message_len + n + 1 < n_columns))
|
||||
printf(": %.*s\n", (int) message_len, message);
|
||||
else if (n < n_columns && n_columns - n - 2 >= 3) {
|
||||
char *e;
|
||||
@@ -259,15 +266,18 @@ finish:
|
||||
return r;
|
||||
}
|
||||
|
||||
-static int output_short_realtime(sd_journal *j, unsigned line, unsigned n_columns, bool show_all) {
|
||||
- return output_short(j, line, n_columns, show_all, false);
|
||||
+static int output_short_realtime(sd_journal *j, unsigned line,
|
||||
+ unsigned n_columns, OutputFlags flags) {
|
||||
+ return output_short(j, line, n_columns, flags & ~OUTPUT_MONOTONIC_MODE);
|
||||
}
|
||||
|
||||
-static int output_short_monotonic(sd_journal *j, unsigned line, unsigned n_columns, bool show_all) {
|
||||
- return output_short(j, line, n_columns, show_all, true);
|
||||
+static int output_short_monotonic(sd_journal *j, unsigned line,
|
||||
+ unsigned n_columns, OutputFlags flags) {
|
||||
+ return output_short(j, line, n_columns, flags | OUTPUT_MONOTONIC_MODE);
|
||||
}
|
||||
|
||||
-static int output_verbose(sd_journal *j, unsigned line, unsigned n_columns, bool show_all) {
|
||||
+static int output_verbose(sd_journal *j, unsigned line,
|
||||
+ unsigned n_columns, OutputFlags flags) {
|
||||
const void *data;
|
||||
size_t length;
|
||||
char *cursor;
|
||||
@@ -296,7 +306,7 @@ static int output_verbose(sd_journal *j, unsigned line, unsigned n_columns, bool
|
||||
free(cursor);
|
||||
|
||||
SD_JOURNAL_FOREACH_DATA(j, data, length) {
|
||||
- if (!show_all && (length > PRINT_THRESHOLD ||
|
||||
+ if (!(flags & OUTPUT_SHOW_ALL) && (length > PRINT_THRESHOLD ||
|
||||
contains_unprintable(data, length))) {
|
||||
const char *c;
|
||||
char bytes[FORMAT_BYTES_MAX];
|
||||
@@ -318,7 +328,8 @@ static int output_verbose(sd_journal *j, unsigned line, unsigned n_columns, bool
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int output_export(sd_journal *j, unsigned line, unsigned n_columns, bool show_all) {
|
||||
+static int output_export(sd_journal *j, unsigned line,
|
||||
+ unsigned n_columns, OutputFlags flags) {
|
||||
sd_id128_t boot_id;
|
||||
char sid[33];
|
||||
int r;
|
||||
@@ -424,7 +435,8 @@ static void json_escape(const char* p, size_t l) {
|
||||
}
|
||||
}
|
||||
|
||||
-static int output_json(sd_journal *j, unsigned line, unsigned n_columns, bool show_all) {
|
||||
+static int output_json(sd_journal *j, unsigned line,
|
||||
+ unsigned n_columns, OutputFlags flags) {
|
||||
uint64_t realtime, monotonic;
|
||||
char *cursor;
|
||||
const void *data;
|
||||
@@ -491,7 +503,8 @@ static int output_json(sd_journal *j, unsigned line, unsigned n_columns, bool sh
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int output_cat(sd_journal *j, unsigned line, unsigned n_columns, bool show_all) {
|
||||
+static int output_cat(sd_journal *j, unsigned line,
|
||||
+ unsigned n_columns, OutputFlags flags) {
|
||||
const void *data;
|
||||
size_t l;
|
||||
int r;
|
||||
@@ -512,7 +525,8 @@ static int output_cat(sd_journal *j, unsigned line, unsigned n_columns, bool sho
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int (*output_funcs[_OUTPUT_MODE_MAX])(sd_journal*j, unsigned line, unsigned n_columns, bool show_all) = {
|
||||
+static int (*output_funcs[_OUTPUT_MODE_MAX])(sd_journal*j, unsigned line,
|
||||
+ unsigned n_columns, OutputFlags flags) = {
|
||||
[OUTPUT_SHORT] = output_short_realtime,
|
||||
[OUTPUT_SHORT_MONOTONIC] = output_short_monotonic,
|
||||
[OUTPUT_VERBOSE] = output_verbose,
|
||||
@@ -521,14 +535,15 @@ static int (*output_funcs[_OUTPUT_MODE_MAX])(sd_journal*j, unsigned line, unsign
|
||||
[OUTPUT_CAT] = output_cat
|
||||
};
|
||||
|
||||
-int output_journal(sd_journal *j, OutputMode mode, unsigned line, unsigned n_columns, bool show_all) {
|
||||
+int output_journal(sd_journal *j, OutputMode mode, unsigned line,
|
||||
+ unsigned n_columns, OutputFlags flags) {
|
||||
assert(mode >= 0);
|
||||
assert(mode < _OUTPUT_MODE_MAX);
|
||||
|
||||
if (n_columns <= 0)
|
||||
n_columns = columns();
|
||||
|
||||
- return output_funcs[mode](j, line, n_columns, show_all);
|
||||
+ return output_funcs[mode](j, line, n_columns, flags);
|
||||
}
|
||||
|
||||
int show_journal_by_unit(
|
||||
@@ -537,8 +552,7 @@ int show_journal_by_unit(
|
||||
unsigned n_columns,
|
||||
usec_t not_before,
|
||||
unsigned how_many,
|
||||
- bool show_all,
|
||||
- bool follow) {
|
||||
+ OutputFlags flags) {
|
||||
|
||||
char *m = NULL;
|
||||
sd_journal *j = NULL;
|
||||
@@ -621,12 +635,12 @@ int show_journal_by_unit(
|
||||
|
||||
line ++;
|
||||
|
||||
- r = output_journal(j, mode, line, n_columns, show_all);
|
||||
+ r = output_journal(j, mode, line, n_columns, flags);
|
||||
if (r < 0)
|
||||
goto finish;
|
||||
}
|
||||
|
||||
- if (!follow)
|
||||
+ if (!(flags & OUTPUT_FOLLOW))
|
||||
break;
|
||||
|
||||
r = fd_wait_for_event(fd, POLLIN, (usec_t) -1);
|
||||
diff --git a/src/logs-show.h b/src/logs-show.h
|
||||
index db9c7e3..e8c6b03 100644
|
||||
--- a/src/logs-show.h
|
||||
+++ b/src/logs-show.h
|
||||
@@ -39,7 +39,16 @@ typedef enum OutputMode {
|
||||
_OUTPUT_MODE_INVALID = -1
|
||||
} OutputMode;
|
||||
|
||||
-int output_journal(sd_journal *j, OutputMode mode, unsigned line, unsigned n_columns, bool show_all);
|
||||
+typedef enum OutputFlags {
|
||||
+ OUTPUT_SHOW_ALL = 1 << 0,
|
||||
+ OUTPUT_MONOTONIC_MODE = 1 << 1,
|
||||
+ OUTPUT_FOLLOW = 1 << 2,
|
||||
+ OUTPUT_WARN_CUTOFF = 1 << 3,
|
||||
+ OUTPUT_FULL_WIDTH = 1 << 4,
|
||||
+} OutputFlags;
|
||||
+
|
||||
+int output_journal(sd_journal *j, OutputMode mode, unsigned line,
|
||||
+ unsigned n_columns, OutputFlags flags);
|
||||
|
||||
int show_journal_by_unit(
|
||||
const char *unit,
|
||||
@@ -47,8 +56,7 @@ int show_journal_by_unit(
|
||||
unsigned n_columns,
|
||||
usec_t not_before,
|
||||
unsigned how_many,
|
||||
- bool show_all,
|
||||
- bool follow);
|
||||
+ OutputFlags flags);
|
||||
|
||||
const char* output_mode_to_string(OutputMode m);
|
||||
OutputMode output_mode_from_string(const char *s);
|
||||
diff --git a/src/systemctl.c b/src/systemctl.c
|
||||
index f51085f..e94e024 100644
|
||||
--- a/src/systemctl.c
|
||||
+++ b/src/systemctl.c
|
||||
@@ -2374,8 +2374,14 @@ static void print_status_info(UnitStatusInfo *i) {
|
||||
}
|
||||
|
||||
if (i->id && arg_transport != TRANSPORT_SSH) {
|
||||
+ int flags =
|
||||
+ arg_lines * OUTPUT_SHOW_ALL |
|
||||
+ arg_follow * OUTPUT_FOLLOW;
|
||||
+
|
||||
printf("\n");
|
||||
- show_journal_by_unit(i->id, arg_output, 0, i->inactive_exit_timestamp_monotonic, arg_lines, arg_all, arg_follow);
|
||||
+ show_journal_by_unit(i->id, arg_output, 0,
|
||||
+ i->inactive_exit_timestamp_monotonic,
|
||||
+ arg_lines, flags);
|
||||
}
|
||||
|
||||
if (i->need_daemon_reload)
|
||||
--
|
||||
1.7.10.4
|
||||
|
@ -1,156 +0,0 @@
|
||||
From 75c8e3cffd7da8eede614cf61384957af2c82a29 Mon Sep 17 00:00:00 2001
|
||||
From: Lennart Poettering <lennart@poettering.net>
|
||||
Date: Thu, 22 Mar 2012 02:06:40 +0100
|
||||
Subject: [PATCH] logind: close FIFO before ending sessions cleanly
|
||||
|
||||
For clean session endings ask logind explicitly to get rid of the FIFO
|
||||
before closing it so that the FIFO logic doesn't result in su/sudo to be
|
||||
terminated immediately.
|
||||
---
|
||||
src/login/logind-dbus.c | 30 ++++++++++++++++++++
|
||||
src/login/pam-module.c | 71 +++++++++++++++++++++++++++++++++++++++++++++--
|
||||
2 files changed, 98 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
|
||||
index d8f4d89..ea6b89f 100644
|
||||
--- a/src/login/logind-dbus.c
|
||||
+++ b/src/login/logind-dbus.c
|
||||
@@ -80,6 +80,9 @@
|
||||
" <arg name=\"seat\" type=\"s\" direction=\"out\"/>\n" \
|
||||
" <arg name=\"vtnr\" type=\"u\" direction=\"out\"/>\n" \
|
||||
" </method>\n" \
|
||||
+ " <method name=\"ReleaseSession\">\n" \
|
||||
+ " <arg name=\"id\" type=\"s\" direction=\"in\"/>\n" \
|
||||
+ " </method>\n" \
|
||||
" <method name=\"ActivateSession\">\n" \
|
||||
" <arg name=\"id\" type=\"s\" direction=\"in\"/>\n" \
|
||||
" </method>\n" \
|
||||
@@ -1075,6 +1078,33 @@ static DBusHandlerResult manager_message_handler(
|
||||
if (r < 0)
|
||||
return bus_send_error_reply(connection, message, &error, r);
|
||||
|
||||
+ } else if (dbus_message_is_method_call(message, "org.freedesktop.login1.Manager", "ReleaseSession")) {
|
||||
+ const char *name;
|
||||
+ Session *session;
|
||||
+
|
||||
+ if (!dbus_message_get_args(
|
||||
+ message,
|
||||
+ &error,
|
||||
+ DBUS_TYPE_STRING, &name,
|
||||
+ DBUS_TYPE_INVALID))
|
||||
+ return bus_send_error_reply(connection, message, &error, -EINVAL);
|
||||
+
|
||||
+ session = hashmap_get(m->sessions, name);
|
||||
+ if (!session)
|
||||
+ return bus_send_error_reply(connection, message, &error, -ENOENT);
|
||||
+
|
||||
+ /* We use the FIFO to detect stray sessions where the
|
||||
+ process invoking PAM dies abnormally. We need to make
|
||||
+ sure that that process is not killed if at the clean
|
||||
+ end of the session it closes the FIFO. Hence, with
|
||||
+ this call explicitly turn off the FIFO logic, so that
|
||||
+ the PAM code can finish clean up on its own */
|
||||
+ session_remove_fifo(session);
|
||||
+
|
||||
+ reply = dbus_message_new_method_return(message);
|
||||
+ if (!reply)
|
||||
+ goto oom;
|
||||
+
|
||||
} else if (dbus_message_is_method_call(message, "org.freedesktop.login1.Manager", "ActivateSession")) {
|
||||
const char *name;
|
||||
Session *session;
|
||||
diff --git a/src/login/pam-module.c b/src/login/pam-module.c
|
||||
index 8544413..4106d2b 100644
|
||||
--- a/src/login/pam-module.c
|
||||
+++ b/src/login/pam-module.c
|
||||
@@ -414,7 +414,6 @@ _public_ PAM_EXTERN int pam_sm_open_session(
|
||||
"/org/freedesktop/login1",
|
||||
"org.freedesktop.login1.Manager",
|
||||
"CreateSession");
|
||||
-
|
||||
if (!m) {
|
||||
pam_syslog(handle, LOG_ERR, "Could not allocate create session message.");
|
||||
r = PAM_BUF_ERR;
|
||||
@@ -620,11 +619,77 @@ _public_ PAM_EXTERN int pam_sm_close_session(
|
||||
int argc, const char **argv) {
|
||||
|
||||
const void *p = NULL;
|
||||
+ const char *id;
|
||||
+ DBusConnection *bus = NULL;
|
||||
+ DBusMessage *m = NULL, *reply = NULL;
|
||||
+ DBusError error;
|
||||
+ int r;
|
||||
|
||||
- pam_get_data(handle, "systemd.session-fd", &p);
|
||||
+ assert(handle);
|
||||
+
|
||||
+ dbus_error_init(&error);
|
||||
+
|
||||
+ id = pam_getenv(handle, "XDG_SESSION_ID");
|
||||
+ if (id) {
|
||||
+
|
||||
+ /* Before we go and close the FIFO we need to tell
|
||||
+ * logind that this is a clean session shutdown, so
|
||||
+ * that it doesn't just go and slaughter us
|
||||
+ * immediately after closing the fd */
|
||||
+
|
||||
+ bus = dbus_bus_get_private(DBUS_BUS_SYSTEM, &error);
|
||||
+ if (!bus) {
|
||||
+ pam_syslog(handle, LOG_ERR, "Failed to connect to system bus: %s", bus_error_message(&error));
|
||||
+ r = PAM_SESSION_ERR;
|
||||
+ goto finish;
|
||||
+ }
|
||||
+
|
||||
+ m = dbus_message_new_method_call(
|
||||
+ "org.freedesktop.login1",
|
||||
+ "/org/freedesktop/login1",
|
||||
+ "org.freedesktop.login1.Manager",
|
||||
+ "ReleaseSession");
|
||||
+ if (!m) {
|
||||
+ pam_syslog(handle, LOG_ERR, "Could not allocate release session message.");
|
||||
+ r = PAM_BUF_ERR;
|
||||
+ goto finish;
|
||||
+ }
|
||||
+
|
||||
+ if (!dbus_message_append_args(m,
|
||||
+ DBUS_TYPE_STRING, &id,
|
||||
+ DBUS_TYPE_INVALID)) {
|
||||
+ pam_syslog(handle, LOG_ERR, "Could not attach parameters to message.");
|
||||
+ r = PAM_BUF_ERR;
|
||||
+ goto finish;
|
||||
+ }
|
||||
|
||||
+ reply = dbus_connection_send_with_reply_and_block(bus, m, -1, &error);
|
||||
+ if (!reply) {
|
||||
+ pam_syslog(handle, LOG_ERR, "Failed to release session: %s", bus_error_message(&error));
|
||||
+ r = PAM_SESSION_ERR;
|
||||
+ goto finish;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ r = PAM_SUCCESS;
|
||||
+
|
||||
+finish:
|
||||
+ pam_get_data(handle, "systemd.session-fd", &p);
|
||||
if (p)
|
||||
close_nointr(PTR_TO_INT(p) - 1);
|
||||
|
||||
- return PAM_SUCCESS;
|
||||
+ dbus_error_free(&error);
|
||||
+
|
||||
+ if (bus) {
|
||||
+ dbus_connection_close(bus);
|
||||
+ dbus_connection_unref(bus);
|
||||
+ }
|
||||
+
|
||||
+ if (m)
|
||||
+ dbus_message_unref(m);
|
||||
+
|
||||
+ if (reply)
|
||||
+ dbus_message_unref(reply);
|
||||
+
|
||||
+ return r;
|
||||
}
|
||||
--
|
||||
1.7.7
|
||||
|
@ -20,14 +20,14 @@
|
||||
#
|
||||
###
|
||||
|
||||
# This is for /bin/systemctl
|
||||
# This is for systemctl
|
||||
%systemd_requires \
|
||||
Requires(pre): systemd \
|
||||
Requires(post): systemd \
|
||||
Requires(preun): systemd \
|
||||
Requires(postun): systemd \
|
||||
|
||||
%_unitdir /lib/systemd/system
|
||||
%_unitdir /usr/lib/systemd/system
|
||||
|
||||
%service_add_pre() \
|
||||
test -n "$FIRST_ARG" || FIRST_ARG=$1 \
|
||||
@ -62,11 +62,11 @@ for service in %{?*} ; do \
|
||||
touch "/var/lib/systemd/migrated/$sysv_service" || : \
|
||||
fi \
|
||||
done \
|
||||
/bin/systemctl daemon-reload >/dev/null 2>&1 || : \
|
||||
/usr/bin/systemctl daemon-reload >/dev/null 2>&1 || : \
|
||||
if [ -n "$services_to_migrate" ]; then \
|
||||
/usr/sbin/systemd-sysv-convert --apply $services_to_migrate >/dev/null 2>&1 || : \
|
||||
elif [ $FIRST_ARG -eq 1 ]; then \
|
||||
/bin/systemctl preset %{?*} >/dev/null 2>&1 || : \
|
||||
/usr/bin/systemctl preset %{?*} >/dev/null 2>&1 || : \
|
||||
fi \
|
||||
%{nil}
|
||||
|
||||
@ -75,8 +75,8 @@ fi \
|
||||
test -n "$FIRST_ARG" || FIRST_ARG=$1 \
|
||||
if [ $FIRST_ARG -eq 0 ]; then \
|
||||
# Package removal, not upgrade \
|
||||
/bin/systemctl --no-reload disable %{?*} > /dev/null 2>&1 || : \
|
||||
/bin/systemctl stop %{?*} > /dev/null 2>&1 || : \
|
||||
/usr/bin/systemctl --no-reload disable %{?*} > /dev/null 2>&1 || : \
|
||||
/usr/bin/systemctl stop %{?*} > /dev/null 2>&1 || : \
|
||||
fi \
|
||||
%{nil}
|
||||
|
||||
@ -85,13 +85,13 @@ fi \
|
||||
test -n "$FIRST_ARG" || FIRST_ARG=$1 \
|
||||
if [ $FIRST_ARG -ge 1 ]; then \
|
||||
# Package upgrade, not uninstall \
|
||||
/bin/systemctl try-restart %{?*} >/dev/null 2>&1 || : \
|
||||
/usr/bin/systemctl try-restart %{?*} >/dev/null 2>&1 || : \
|
||||
else # package uninstall \
|
||||
for service in %{?*} ; do \
|
||||
sysv_service=${service%.*} \
|
||||
rm -f "/var/lib/systemd/migrated/$sysv_service" 2> /dev/null || : \
|
||||
done \
|
||||
/bin/systemctl daemon-reload >/dev/null 2>&1 || : \
|
||||
/usr/bin/systemctl daemon-reload >/dev/null 2>&1 || : \
|
||||
fi \
|
||||
%{nil}
|
||||
|
||||
|
@ -7,24 +7,25 @@ Subject: [PATCH] module-load: handle SUSE /etc/sysconfig/kernel module list
|
||||
src/modules-load.c | 42 ++++++++++++++++++++++++++++++++++++++++++
|
||||
1 files changed, 42 insertions(+), 0 deletions(-)
|
||||
|
||||
Index: systemd-44/src/modules-load.c
|
||||
Index: systemd-191/src/modules-load/modules-load.c
|
||||
===================================================================
|
||||
--- systemd-44.orig/src/modules-load.c
|
||||
+++ systemd-44/src/modules-load.c
|
||||
@@ -44,6 +44,9 @@ static void systemd_kmod_log(void *data,
|
||||
int main(int argc, char *argv[]) {
|
||||
int r = EXIT_FAILURE;
|
||||
char **files, **fn;
|
||||
--- systemd-191.orig/src/modules-load/modules-load.c
|
||||
+++ systemd-191/src/modules-load/modules-load.c
|
||||
@@ -173,6 +173,9 @@ int main(int argc, char *argv[]) {
|
||||
int r = EXIT_FAILURE, k;
|
||||
char **files = NULL, **fn, **i;
|
||||
struct kmod_ctx *ctx;
|
||||
+#if defined(TARGET_SUSE)
|
||||
+ char *modules_on_boot = NULL;
|
||||
+#endif
|
||||
struct kmod_ctx *ctx;
|
||||
const int probe_flags = KMOD_PROBE_APPLY_BLACKLIST|KMOD_PROBE_IGNORE_LOADED;
|
||||
|
||||
@@ -141,9 +144,59 @@ int main(int argc, char *argv[]) {
|
||||
if (argc > 1) {
|
||||
log_error("This program takes no argument.");
|
||||
@@ -256,9 +259,34 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
fclose(f);
|
||||
}
|
||||
-
|
||||
+#if defined(TARGET_SUSE)
|
||||
+ log_debug("apply: /etc/sysconfig/kernel MODULES_LOADED_ON_BOOT");
|
||||
+ if ((r = parse_env_file("/etc/sysconfig/kernel", NEWLINE,
|
||||
@ -37,37 +38,12 @@ Index: systemd-44/src/modules-load.c
|
||||
+ if (modules_on_boot) {
|
||||
+ char **modules = strv_split(modules_on_boot,WHITESPACE);
|
||||
+ char **module;
|
||||
+ struct kmod_list *itr, *modlist = NULL;
|
||||
+ int err;
|
||||
+
|
||||
+ if (modules) {
|
||||
+ STRV_FOREACH(module, modules) {
|
||||
+ err = kmod_module_new_from_lookup(ctx, *module, &modlist);
|
||||
+ if (err < 0) {
|
||||
+ log_error("Failed to lookup alias '%s'", *module);
|
||||
+ k = load_module(ctx, *module);
|
||||
+ if (k < 0)
|
||||
+ r = EXIT_FAILURE;
|
||||
+ continue;
|
||||
+ }
|
||||
+ kmod_list_foreach(itr, modlist) {
|
||||
+ struct kmod_module *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);
|
||||
+ modlist = NULL;
|
||||
+ }
|
||||
+ }
|
||||
+ strv_free(modules);
|
||||
@ -79,16 +55,16 @@ Index: systemd-44/src/modules-load.c
|
||||
+ free(modules_on_boot);
|
||||
+#endif
|
||||
kmod_unref(ctx);
|
||||
strv_free(arg_proc_cmdline_modules);
|
||||
|
||||
return r;
|
||||
Index: systemd-44/units/systemd-modules-load.service.in
|
||||
Index: systemd-191/units/systemd-modules-load.service.in
|
||||
===================================================================
|
||||
--- systemd-44.orig/units/systemd-modules-load.service.in
|
||||
+++ systemd-44/units/systemd-modules-load.service.in
|
||||
@@ -11,6 +11,7 @@ DefaultDependencies=no
|
||||
Conflicts=shutdown.target
|
||||
--- systemd-191.orig/units/systemd-modules-load.service.in
|
||||
+++ systemd-191/units/systemd-modules-load.service.in
|
||||
@@ -13,6 +13,7 @@ Conflicts=shutdown.target
|
||||
After=systemd-readahead-collect.service systemd-readahead-replay.service
|
||||
Before=sysinit.target shutdown.target
|
||||
ConditionCapability=CAP_SYS_MODULE
|
||||
+ConditionPathExists=|/etc/sysconfig/kernel
|
||||
ConditionDirectoryNotEmpty=|/lib/modules-load.d
|
||||
ConditionDirectoryNotEmpty=|/usr/lib/modules-load.d
|
||||
|
@ -1,8 +1,8 @@
|
||||
Index: systemd-44/src/service.c
|
||||
Index: systemd-189/src/core/service.c
|
||||
===================================================================
|
||||
--- systemd-44.orig/src/service.c
|
||||
+++ systemd-44/src/service.c
|
||||
@@ -122,6 +122,7 @@ static void service_init(Unit *u) {
|
||||
--- systemd-189.orig/src/core/service.c
|
||||
+++ systemd-189/src/core/service.c
|
||||
@@ -145,6 +145,7 @@ static void service_init(Unit *u) {
|
||||
#ifdef HAVE_SYSV_COMPAT
|
||||
s->sysv_start_priority = -1;
|
||||
s->sysv_start_priority_from_rcnd = -1;
|
||||
@ -10,7 +10,7 @@ Index: systemd-44/src/service.c
|
||||
#endif
|
||||
s->socket_fd = -1;
|
||||
s->guess_main_pid = true;
|
||||
@@ -840,6 +841,34 @@ static int service_load_sysv_path(Servic
|
||||
@@ -877,6 +878,34 @@ static int service_load_sysv_path(Servic
|
||||
free(short_description);
|
||||
short_description = d;
|
||||
|
||||
@ -45,7 +45,7 @@ Index: systemd-44/src/service.c
|
||||
} else if (state == LSB_DESCRIPTION) {
|
||||
|
||||
if (startswith(l, "#\t") || startswith(l, "# ")) {
|
||||
@@ -894,7 +923,8 @@ static int service_load_sysv_path(Servic
|
||||
@@ -935,7 +964,8 @@ static int service_load_sysv_path(Servic
|
||||
|
||||
/* Special setting for all SysV services */
|
||||
s->type = SERVICE_FORKING;
|
||||
@ -55,7 +55,7 @@ Index: systemd-44/src/service.c
|
||||
s->guess_main_pid = false;
|
||||
s->restart = SERVICE_RESTART_NO;
|
||||
s->exec_context.ignore_sigpipe = false;
|
||||
@@ -2036,7 +2066,7 @@ static void service_enter_running(Servic
|
||||
@@ -2107,7 +2137,7 @@ static void service_enter_running(Servic
|
||||
if ((main_pid_ok > 0 || (main_pid_ok < 0 && cgroup_ok != 0)) &&
|
||||
(s->bus_name_good || s->type != SERVICE_DBUS)) {
|
||||
#ifdef HAVE_SYSV_COMPAT
|
||||
@ -64,12 +64,12 @@ Index: systemd-44/src/service.c
|
||||
s->remain_after_exit = false;
|
||||
#endif
|
||||
service_set_state(s, SERVICE_RUNNING);
|
||||
Index: systemd-44/src/service.h
|
||||
Index: systemd-189/src/core/service.h
|
||||
===================================================================
|
||||
--- systemd-44.orig/src/service.h
|
||||
+++ systemd-44/src/service.h
|
||||
@@ -166,6 +166,7 @@ struct Service {
|
||||
#ifdef HAVE_SYSV_COMPAT
|
||||
--- systemd-189.orig/src/core/service.h
|
||||
+++ systemd-189/src/core/service.h
|
||||
@@ -176,6 +176,7 @@ struct Service {
|
||||
bool is_sysv:1;
|
||||
bool sysv_has_lsb:1;
|
||||
bool sysv_enabled:1;
|
||||
+ bool sysv_remain_after_exit_heuristic:1;
|
||||
|
@ -1,6 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
VERSION=`sed -e '/^Version:/!d' -e 's/Version: *//' systemd.spec`
|
||||
RELEASE=`sed -e '/^Release:/!d' -e 's/Release: *//' systemd.spec`
|
||||
sed -i -e "s,^\(Version:[ tab]*\).*,\1$VERSION," -e "s,^\(Release:[ tab]*\).*,\1$RELEASE," systemd-gtk.spec
|
||||
cp systemd.changes systemd-gtk.changes
|
||||
# This script is based on libcdio_spec-prepare.sh (thanks to sbrabec@suse.cz)
|
||||
# create a -mini spec for systemd for bootstrapping
|
||||
|
||||
ORIG_SPEC=systemd
|
||||
EDIT_WARNING="##### WARNING: please do not edit this auto generated spec file. Use the ${ORIG_SPEC}.spec! #####\n"
|
||||
sed "s/^%define bootstrap.*$/${EDIT_WARNING}%define bootstrap 1/;
|
||||
s/^%define udevpkgname.*$/${EDIT_WARNING}%define udevpkgname udev-mini/;
|
||||
s/^\(Name:.*\)$/\1-mini/;
|
||||
s/^BuildRoot.*/&\n\nProvides: %{real} = %{version}-%{release}\n/
|
||||
" < ${ORIG_SPEC}.spec > ${ORIG_SPEC}-mini.spec
|
||||
cp ${ORIG_SPEC}.changes ${ORIG_SPEC}-mini.changes
|
||||
cp ${ORIG_SPEC}-rpmlintrc ${ORIG_SPEC}-mini-rpmlintrc
|
||||
|
||||
osc service localrun format_spec_file
|
||||
|
@ -7,10 +7,10 @@ Subject: [PATCH] force lvm restart after cryptsetup target is reached
|
||||
src/cryptsetup-generator.c | 80 ++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 files changed, 80 insertions(+), 0 deletions(-)
|
||||
|
||||
Index: systemd-37/src/cryptsetup/cryptsetup-generator.c
|
||||
Index: systemd-194/src/cryptsetup/cryptsetup-generator.c
|
||||
===================================================================
|
||||
--- systemd-37.orig/src/cryptsetup/cryptsetup-generator.c
|
||||
+++ systemd-37/src/cryptsetup/cryptsetup-generator.c
|
||||
--- systemd-194.orig/src/cryptsetup/cryptsetup-generator.c
|
||||
+++ systemd-194/src/cryptsetup/cryptsetup-generator.c
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
@ -19,7 +19,7 @@ Index: systemd-37/src/cryptsetup/cryptsetup-generator.c
|
||||
|
||||
#include "log.h"
|
||||
#include "util.h"
|
||||
@@ -58,6 +59,71 @@ static bool has_option(const char *hayst
|
||||
@@ -64,6 +65,71 @@ static bool has_option(const char *hayst
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -54,7 +54,7 @@ Index: systemd-37/src/cryptsetup/cryptsetup-generator.c
|
||||
+ "RemainAfterExit=true\n"
|
||||
+ "Type=oneshot\n"
|
||||
+ "TimeoutSec=0\n"
|
||||
+ "ExecStart=/bin/systemctl restart lvm.service\n");
|
||||
+ "ExecStart=/usr/bin/systemctl restart lvm.service\n");
|
||||
+
|
||||
+ fflush(f);
|
||||
+
|
||||
@ -91,13 +91,13 @@ Index: systemd-37/src/cryptsetup/cryptsetup-generator.c
|
||||
static int create_disk(
|
||||
const char *name,
|
||||
const char *device,
|
||||
@@ -291,6 +357,9 @@ int main(int argc, char *argv[]) {
|
||||
@@ -439,6 +505,9 @@ int main(int argc, char *argv[]) {
|
||||
free(options);
|
||||
}
|
||||
|
||||
+ if (create_storage_after_cryptsetup () < 0)
|
||||
+ if ((r == EXIT_SUCCESS) && (create_storage_after_cryptsetup () < 0))
|
||||
+ r = EXIT_FAILURE;
|
||||
+
|
||||
finish:
|
||||
return r;
|
||||
}
|
||||
if (f)
|
||||
fclose(f);
|
||||
|
@ -8,25 +8,21 @@ Subject: [PATCH] timedate: add support for openSUSE version of
|
||||
src/timedate/timedated.c | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/timedate/timedated.c b/src/timedate/timedated.c
|
||||
index 6a7d980..fbebc1d 100644
|
||||
--- a/src/timedate/timedated.c
|
||||
+++ b/src/timedate/timedated.c
|
||||
@@ -180,9 +180,13 @@ static int read_data(void) {
|
||||
if (r != -ENOENT)
|
||||
log_warning("Failed to read /etc/timezone: %s", strerror(-r));
|
||||
|
||||
-#ifdef TARGET_FEDORA
|
||||
+#if defined(TARGET_FEDORA) || defined(TARGET_SUSE)
|
||||
r = parse_env_file("/etc/sysconfig/clock", NEWLINE,
|
||||
+#ifdef TARGET_FEDORA
|
||||
"ZONE", &tz.zone,
|
||||
+#else /* TARGET_SUSE */
|
||||
+ "TIMEZONE", &tz.zone,
|
||||
Index: systemd-190/src/timedate/timedated.c
|
||||
===================================================================
|
||||
--- systemd-190.orig/src/timedate/timedated.c
|
||||
+++ systemd-190/src/timedate/timedated.c
|
||||
@@ -175,6 +175,13 @@ static int read_data(void) {
|
||||
goto have_timezone;
|
||||
}
|
||||
}
|
||||
+#ifdef TARGET_SUSE
|
||||
+ r = parse_env_file("/etc/sysconfig/clock", NEWLINE,
|
||||
+ "TIMEZONE", &tz.zone,
|
||||
+ NULL);
|
||||
+ if (r < 0 && r != -ENOENT)
|
||||
+ log_warning("Failed to read /etc/sysconfig/clock: %s", strerror(-r));
|
||||
+#endif
|
||||
NULL);
|
||||
|
||||
if (r < 0 && r != -ENOENT)
|
||||
--
|
||||
1.7.10.4
|
||||
|
||||
#ifdef HAVE_DEBIAN
|
||||
r = read_one_line_file("/etc/timezone", &tz.zone);
|
||||
|
@ -1,7 +1,7 @@
|
||||
Index: systemd-36/src/systemctl.c
|
||||
===================================================================
|
||||
--- systemd-36.orig/src/systemctl.c
|
||||
+++ systemd-36/src/systemctl.c
|
||||
--- systemd-36.orig/src/systemctl/systemctl.c
|
||||
+++ systemd-36/src/systemctl/systemctl.c
|
||||
@@ -4672,10 +4672,13 @@ static int parse_argv(int argc, char *ar
|
||||
/* Hmm, so some other init system is
|
||||
* running, we need to forward this
|
||||
|
@ -1,12 +1,12 @@
|
||||
Index: systemd-37/units/systemd-sysctl.service.in
|
||||
Index: systemd-189/units/systemd-sysctl.service.in
|
||||
===================================================================
|
||||
--- systemd-37.orig/units/systemd-sysctl.service.in
|
||||
+++ systemd-37/units/systemd-sysctl.service.in
|
||||
@@ -10,6 +10,7 @@ Description=Apply Kernel Variables
|
||||
--- systemd-189.orig/units/systemd-sysctl.service.in
|
||||
+++ systemd-189/units/systemd-sysctl.service.in
|
||||
@@ -11,6 +11,7 @@ Documentation=man:systemd-sysctl.service
|
||||
DefaultDependencies=no
|
||||
Conflicts=shutdown.target
|
||||
After=systemd-readahead-collect.service systemd-readahead-replay.service
|
||||
+After=systemd-modules-load.service
|
||||
Before=sysinit.target shutdown.target
|
||||
ConditionPathIsReadWrite=/proc/sys/
|
||||
ConditionPathExists=|/etc/sysctl.conf
|
||||
ConditionDirectoryNotEmpty=|/lib/sysctl.d
|
||||
|
3
systemd-195.tar.xz
Normal file
3
systemd-195.tar.xz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e9041a8b84ed971d08df2b96f1b7dbb1d49b788e275c7cc39912f656bd826303
|
||||
size 1441308
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:7a5aac4b4b8b3a82bf59292f10e43d8f2c2d7039f34e95714f81d8edcb42233c
|
||||
size 885636
|
@ -1,94 +0,0 @@
|
||||
#
|
||||
# spec file for package systemd-gtk
|
||||
#
|
||||
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
|
||||
Name: systemd-gtk
|
||||
Url: http://www.freedesktop.org/wiki/Software/systemd
|
||||
Version: 44
|
||||
Release: 0
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
BuildRequires: audit-devel
|
||||
BuildRequires: gperf
|
||||
BuildRequires: intltool
|
||||
BuildRequires: libacl-devel
|
||||
BuildRequires: libcap-devel
|
||||
BuildRequires: libtool
|
||||
BuildRequires: pam-devel
|
||||
BuildRequires: pkg-config
|
||||
BuildRequires: tcpd-devel
|
||||
BuildRequires: udev
|
||||
BuildRequires: xz
|
||||
BuildRequires: pkgconfig(dbus-1) >= 1.5.2
|
||||
BuildRequires: pkgconfig(gee-1.0)
|
||||
BuildRequires: pkgconfig(gio-unix-2.0)
|
||||
BuildRequires: pkgconfig(glib-2.0) > 2.26
|
||||
BuildRequires: pkgconfig(gtk+-2.0)
|
||||
BuildRequires: pkgconfig(libcryptsetup)
|
||||
BuildRequires: pkgconfig(libkmod) >= 5
|
||||
BuildRequires: pkgconfig(liblzma)
|
||||
BuildRequires: pkgconfig(libnotify)
|
||||
BuildRequires: pkgconfig(libselinux)
|
||||
BuildRequires: pkgconfig(libsepol)
|
||||
BuildRequires: pkgconfig(udev) >= 172
|
||||
Summary: Graphical front-end for systemd
|
||||
License: GPL-2.0+
|
||||
Group: System/Base
|
||||
Requires: systemd = %{version}
|
||||
Source0: http://www.freedesktop.org/software/systemd/systemd-%{version}.tar.xz
|
||||
Source1: systemd-rpmlintrc
|
||||
Patch0: fixppc.patch
|
||||
|
||||
# Upstream First - Policy:
|
||||
# Never add any patches to this package without the upstream commit id
|
||||
# in the patch. Any patches added here without a very good reason to make
|
||||
# an exception will be silently removed with the next version update.
|
||||
|
||||
%description
|
||||
Graphical front-end for systemd system and service manager.
|
||||
|
||||
%prep
|
||||
%setup -q -n systemd-%{version}
|
||||
%patch0 -p1
|
||||
|
||||
%build
|
||||
autoreconf -fiv
|
||||
# prevent pre-generated and distributed files from re-building
|
||||
find . -name "*.[1-8]" -exec touch '{}' \;
|
||||
touch src/systemadm.c
|
||||
export V=1
|
||||
%configure \
|
||||
--with-distro=suse \
|
||||
--docdir=%{_docdir}/systemd \
|
||||
--with-rootprefix= \
|
||||
CFLAGS="%{optflags}"
|
||||
make %{?_smp_mflags}
|
||||
|
||||
%install
|
||||
%makeinstall
|
||||
# remove everything but systemadm and password agent
|
||||
find %{buildroot} -not -type d -not -name 'systemadm*' -not -name systemd-gnome-ask-password-agent -delete
|
||||
|
||||
%clean
|
||||
rm -rf %{buildroot}
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%{_bindir}/systemadm
|
||||
%{_bindir}/systemd-gnome-ask-password-agent
|
||||
%{_mandir}/man1/systemadm.1*
|
||||
|
||||
%changelog
|
17
systemd-mini-rpmlintrc
Normal file
17
systemd-mini-rpmlintrc
Normal file
@ -0,0 +1,17 @@
|
||||
addFilter(".*dangling-symlink /sbin/(halt|init|poweroff|telinit|shutdown|runlevel|reboot).*")
|
||||
addFilter(".*dangling-symlink .* /dev/null.*")
|
||||
addFilter(".*files-duplicate .*/reboot.8.*")
|
||||
addFilter(".*files-duplicate .*/sd_is_socket.3.*")
|
||||
addFilter("non-conffile-in-etc /etc/bash_completion.d/systemd-bash-completion.sh")
|
||||
addFilter("non-conffile-in-etc /etc/rpm/macros.systemd")
|
||||
addFilter(".*dbus-policy-allow-receive")
|
||||
addFilter(".*dangling-symlink /lib/udev/devices/std(in|out|err).*")
|
||||
addFilter(".*dangling-symlink /lib/udev/devices/core.*")
|
||||
addFilter(".*dangling-symlink /lib/udev/devices/fd.*")
|
||||
addFilter(".*incoherent-init-script-name boot.udev.*")
|
||||
addFilter(".init-script-without-%stop_on_removal-preun /etc/init.d/boot.udev")
|
||||
addFilter(".init-script-without-%restart_on_update-postun /etc/init.d/boot.udev")
|
||||
addFilter(".*devel-file-in-non-devel-package.*udev.pc.*")
|
||||
addFilter(".*libgudev-.*shlib-fixed-dependency.*")
|
||||
addFilter(".*suse-filelist-forbidden-systemd-userdirs.*")
|
||||
addFilter("libudev-mini.*shlib-policy-name-error.*")
|
@ -1,3 +1,309 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Nov 2 14:07:15 UTC 2012 - coolo@suse.com
|
||||
|
||||
- udev is GPL-2.0, the rest remains LGPL-2.1+ (bnc#787824)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Oct 29 13:01:20 UTC 2012 - fcrozat@suse.com
|
||||
|
||||
- Add var-run-lock.patch: make sure /var/run and /var/lock are
|
||||
handled as bind mount if they aren't symlinks.
|
||||
- Update storage-after-cryptsetup.patch with new systemctl path.
|
||||
- Migrate broken symlinks in /etc/systemd/system due to new systemd
|
||||
location.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Oct 26 13:37:52 UTC 2012 - fcrozat@suse.com
|
||||
|
||||
- Update to release 195:
|
||||
+ journalctl agained --since and --until, as well as filtering
|
||||
for units with --unit=/-u.
|
||||
+ allow ExecReload properly for Type=oneshot (needed for
|
||||
iptables.service, rpc-nfsd.service).
|
||||
+ journal daemon supports time-based rotation and vaccuming.
|
||||
+ journalctl -F allow to list all values of a certain field in
|
||||
journal database.
|
||||
+ new commandline clients for timedated, locald and hostnamed
|
||||
+ new tool systemd-coredumpctl to list and extract coredumps from
|
||||
journal.
|
||||
+ improve gatewayd: follow mode, filtering, support for
|
||||
HTML5/JSON Server-Sent-Events.
|
||||
+ reload support in SysV initscripts is now detected when file is
|
||||
parted.
|
||||
+ "systemctl status --follow" as been removed, use "journalctl -fu
|
||||
instead"
|
||||
+ journald.conf RuntimeMinSize and PersistentMinSize settings
|
||||
have been removed.
|
||||
- Add compatibility symlink for systemd-ask-password and systemctl
|
||||
in /bin.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Oct 18 12:27:07 UTC 2012 - fcrozat@suse.com
|
||||
|
||||
- Create and own more systemd drop-in directories.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Oct 16 13:18:13 UTC 2012 - fcrozat@suse.com
|
||||
|
||||
- Improve mini packages for bootstrapping.
|
||||
- do not mount /tmp as tmpfs by default.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Oct 16 07:40:23 UTC 2012 - fcrozat@suse.com
|
||||
|
||||
- Fix install script when there is no inittab
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Oct 15 14:48:47 UTC 2012 - fcrozat@suse.com
|
||||
|
||||
- Create a systemd-mini specfile to prevent cycle in bootstrapping
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Oct 4 11:23:42 UTC 2012 - fcrozat@suse.com
|
||||
|
||||
- udev and its subpackages are now generated by systemd source
|
||||
package.
|
||||
- migrate udev and systemd to /usr
|
||||
- Update to version 194:
|
||||
+ if /etc/vconsole.conf is non-existent or empty and if
|
||||
/etc/sysconfig/console:CONSOLE_FONT (resp
|
||||
/etc/sysconfig/keyboard:KEYTABLE) set, console font (resp
|
||||
keymap) is not modified.
|
||||
- Changes from version 44 to 193:
|
||||
+ journalctl gained --cursor= to show entries starting from a
|
||||
specified location in journal.
|
||||
+ Size limit enforced to 4K for fields exported with "-o json" in
|
||||
journalctl. Use --all to disable this behavior.
|
||||
+ Optional journal gateway daemon
|
||||
(systemd-journal-gatewayd.service) to access journal via HTTP
|
||||
and JSON. Use "wget http://localhost:19531/entries" to get
|
||||
/var/log/messages compatible format and
|
||||
'curl -H"Accept: application/json"
|
||||
http://localhost:19531/entries' for JSON formatted content.
|
||||
HTML5 static page is also available as explained on
|
||||
http://0pointer.de/public/journal-gatewayd
|
||||
+ do not mount cpuset controler, doesn't work well by default
|
||||
ATM.
|
||||
+ improved nspawn behaviour with /etc/localtime
|
||||
+ journald logs its maximize size on disk
|
||||
+ multi-seat X wrapper (partially merged in upstream X server).
|
||||
+ HandleSleepKey has been splitted into HandleSuspendKey and
|
||||
HandleHibernateKey.
|
||||
+ systemd and logind now handle system sleep states, in
|
||||
particular suspending and hibernating.
|
||||
+ new cgroups are mounted by default (cpu, cpuacct,
|
||||
net_cls, net_pri)
|
||||
+ sync at shutdown is now handled by kernel
|
||||
+ imported journalctl output (colors, filtering, pager, bash
|
||||
completion).
|
||||
+ suffix ".service" may now be ommited on most systemctl command
|
||||
involving service unit names.
|
||||
+ much improved nspawn containers support.
|
||||
+ new conditions added : ConditionFileNotEmpty, ConditionHost,
|
||||
ConditionPathIsReadWrite
|
||||
+ tmpfiles "w" supports file globbing
|
||||
+ logind handles lid switch, power and sleep keys all the time,
|
||||
unless systemd-inhibit
|
||||
--what=handle-power-key:handle-sleep-key:handle-lid-switch is
|
||||
run by Desktop Environments.
|
||||
+ support for reading structured kernel message is used by
|
||||
default (need kernel >= 3.5). /proc/kmsg is now used only by
|
||||
classic syslog daemons.
|
||||
+ Forward Secure Sealing is now support for Journal files.
|
||||
+ RestartPrevenExitStatus and SuccessExitStatus allow configure
|
||||
of exit status (exit code or signal).
|
||||
+ handles keyfile-size and keyfile-offset in /etc/crypttab.
|
||||
+ TimeoutSec settings has been splitted into TimeoutStartSec and
|
||||
TimeoutStopSec.
|
||||
+ add SystemCallFilters option to add blacklist/whitelist to
|
||||
system calls, using SECCOMP mode 2 of kernel >= 3.5.
|
||||
+ systemctl udevadm info now takes a /dev or /sys path as argument:
|
||||
- udevadm info /dev/sda
|
||||
+ XDG_RUNTIME_DIR now uses numeric UIDs instead of usernames.
|
||||
+ systemd-loginctl and systemd-journalctl have been renamed
|
||||
to loginctl and journalctl to match systemctl.
|
||||
+ udev: RUN+="socket:..." and udev_monitor_new_from_socket() is
|
||||
no longer supported. udev_monitor_new_from_netlink() needs to
|
||||
be used to subscribe to events.
|
||||
+ udev: when udevd is started by systemd, processes which are left
|
||||
behind by forking them off of udev rules, are unconditionally
|
||||
cleaned up and killed now after the event handling has finished.
|
||||
Services or daemons must be started as systemd services.
|
||||
Services can be pulled-in by udev to get started, but they can
|
||||
no longer be directly forked by udev rules.
|
||||
+ For almost all files, license is now LGPL2.1+ (from previous
|
||||
GPL2.0+). Exception are some minor stuff in udev (will be
|
||||
changed to LGPL2.1 eventually) and MIT license sd-daemon.[ch]
|
||||
library.
|
||||
+ var-run.mount and var-lock.mount are no longer provided
|
||||
(should be converted to symlinks).
|
||||
+ A new service type Type=idle to avoid ugly interleaving of
|
||||
getty output and boot status messages.
|
||||
+ systemd-delta has been added, a tool to explore differences
|
||||
between user/admin configuration and vendor defaults.
|
||||
+ /tmp mouted as tmpfs by default.
|
||||
+ /media is now longer mounted as tmpfs
|
||||
+ GTK tool has been split off to systemd-ui package.
|
||||
+ much improved documentation.
|
||||
- Merge BuildRequires from udev package:
|
||||
gobject-introspection-devel, gtk-doc, libsepol-devel,
|
||||
libusb-devel, pkgconfig(blkid), pkgconfig-glib-2.0),
|
||||
pjgconfig(libcryptsetup), pkgconfig(libpci),
|
||||
pkgconfig(libqrencode), pkgconfig(libselinux),
|
||||
pkgconfig(usbutils).
|
||||
- Add pkgconfig(libqrencode) and pkgconfig(libmicrohttpd)
|
||||
- Merge sources from udev package: boot.udev, write_dev_root.rules,
|
||||
udev-root-symlink.systemd.
|
||||
- Merge patches from udev package: numbered started from 1000):
|
||||
0001-Reinstate-TIMEOUT-handling.patch,
|
||||
0013-re-enable-by_path-links-for-ata-devices.patch,
|
||||
0014-rules-create-by-id-scsi-links-for-ATA-devices.patch,
|
||||
0026-udev-netlink-null-rules.patch,
|
||||
0027-udev-fix-sg-autoload-regression.patch.
|
||||
- Remove following patches, merged upstream:
|
||||
0001-util-never-follow-symlinks-in-rm_rf_children.patch,
|
||||
fixppc.patch, logind-logout.patch, fix-getty-isolate.patch,
|
||||
fix-swap-priority.patch, improve-restart-behaviour.patch,
|
||||
fix-dir-noatime-tmpfiles.patch, journal-bugfixes.patch,
|
||||
ulimit-support.patch, change-terminal.patch,
|
||||
fix-tty-startup.patch, fix-write-user-state-file.patch,
|
||||
fix-analyze-exception.patch, use_localtime.patch,
|
||||
journalctl-pager-improvement.patch,
|
||||
avoid-random-seed-cycle.patch,
|
||||
0001-add-sparse-support-to-detect-endianness-bug.patch,
|
||||
drop-timezone.patch.
|
||||
- Rebase the following patches:
|
||||
0001-Add-bootsplash-handling-for-password-dialogs.patch,
|
||||
0001-handle-disable_caplock-and-compose_table-and-kbd_rat.patch,
|
||||
0001-service-Fix-dependencies-added-when-parsing-insserv..patch,
|
||||
0001-service-flags-sysv-service-with-detected-pid-as-Rema.patch,
|
||||
crypt-loop-file.patch,
|
||||
delay-fsck-cryptsetup-after-md-lvm-dmraid.patch,
|
||||
dm-lvm-after-local-fs-pre-target.patch, fastboot-forcefsck.patch,
|
||||
fix-enable-disable-boot-initscript.patch, modules_on_boot.patch,
|
||||
new-lsb-headers.patch, storage-after-cryptsetup.patch,
|
||||
support-suse-clock-sysconfig.patch, support-sysvinit.patch,
|
||||
sysctl-modules.patch, systemd-numlock-suse.patch, tty1.patch.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Aug 23 11:11:25 CEST 2012 - fcrozat@suse.com
|
||||
|
||||
- Add use_localtime.patch: use /etc/localtime instead of
|
||||
/etc/timezone (bnc#773491)
|
||||
- Add support-suse-clock-sysconfig.patch: read SUSE
|
||||
/etc/sysconfig/clock file.
|
||||
- Add drop-timezone.patch: drop support for /etc/timezone, never
|
||||
supported on openSUSE.
|
||||
- Add journalctl-pager-improvement.patch: better handle output when
|
||||
using pager.
|
||||
- Add fix-enable-disable-boot-initscript.patch: support boot.*
|
||||
initscripts for systemctl enable /disable (bnc#746506).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Jul 30 11:37:17 UTC 2012 - fcrozat@suse.com
|
||||
|
||||
- Ensure systemd macros never fails (if systemd isn't install)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Jul 23 08:28:15 UTC 2012 - fcrozat@suse.com
|
||||
|
||||
- Add fix-analyze-exception.patch: prevent exception if running
|
||||
systemd-analyze before boot is complete (bnc#772506)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Jul 20 19:24:08 CEST 2012 - sbrabec@suse.cz
|
||||
|
||||
- Fix NumLock detection/set race condition (bnc#746595#c47).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Jul 18 13:14:37 UTC 2012 - fcrozat@suse.com
|
||||
|
||||
- Move systemd-analyse to a subpackage, to remove any python
|
||||
dependencies from systemd main package (bnc#772039).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Jul 10 16:48:20 UTC 2012 - fcrozat@suse.com
|
||||
|
||||
- Add fastboot-forcefsck.patch: ensure fastboot and forcefsck on
|
||||
kernel commandline are handled.
|
||||
- Add fix-write-user-state-file.patch: write logind state file
|
||||
correctly.
|
||||
- Disable logind-logout.patch: cause too many issues (bnc#769531).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Jul 9 11:01:20 UTC 2012 - fcrozat@suse.com
|
||||
|
||||
- Add fix-tty-startup.patch: don't limit tty VT to 12 (bnc#770182).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Jul 3 20:07:47 CEST 2012 - sbrabec@suse.cz
|
||||
|
||||
- Fix SUSE specific sysconfig numlock logic for 12.2 (bnc#746595).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Jul 3 17:58:39 CEST 2012 - fcrozat@suse.com
|
||||
|
||||
- Add fix-dir-noatime-tmpfiles.patch: do not modify directory
|
||||
atime, which was preventing removing empty directories
|
||||
(bnc#751253, rh#810257).
|
||||
- Add improve-restart-behaviour.patch: prevent deadlock during
|
||||
try-restart (bnc#743218).
|
||||
- Add journal-bugfixes.patch: don't crash when rotating journal
|
||||
(bnc#768953) and prevent memleak at rotation time too.
|
||||
- Add ulimit-support.patch: add support for system wide ulimit
|
||||
(bnc#744818).
|
||||
- Add change-terminal.patch: use vt102 instead of vt100 as terminal
|
||||
for non-vc tty.
|
||||
- Package various .wants directories, which were no longer packaged
|
||||
due to plymouth units being removed from systemd package.
|
||||
- Fix buildrequires for manpages build.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Jul 2 15:44:28 UTC 2012 - fcrozat@suse.com
|
||||
|
||||
- Do not ship plymouth units, they are shipped by plymouth package
|
||||
now (bnc#769397).
|
||||
- Fix module loading (bnc#769462)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Jun 7 13:14:40 UTC 2012 - fcrozat@suse.com
|
||||
|
||||
- Add fix-swap-priority: fix default swap priority (bnc#731601).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri May 25 11:08:27 UTC 2012 - fcrozat@suse.com
|
||||
|
||||
- Re-enable logind-logout.patch, fix in xdm-np PAM file is the real
|
||||
fix.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu May 24 11:45:54 UTC 2012 - fcrozat@suse.com
|
||||
|
||||
- Update new-lsb-headers.patch to handle entries written after
|
||||
description tag (bnc#727771, bnc#747931).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu May 3 11:40:20 UTC 2012 - fcrozat@suse.com
|
||||
|
||||
- Disable logind-logout.patch: it crashes sudo session (if called
|
||||
after su -l) (bnc#746704).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Apr 24 15:46:54 UTC 2012 - fcrozat@suse.com
|
||||
|
||||
- Add fix-getty-isolate.patch: don't quit getty when changing
|
||||
runlevel (bnc#746594)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Apr 20 17:16:37 CEST 2012 - sbrabec@suse.cz
|
||||
|
||||
- Implemented SUSE specific sysconfig numlock logic (bnc#746595).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Apr 19 10:07:47 UTC 2012 - fcrozat@suse.com
|
||||
|
||||
- Add dbus-1 as BuildRequires to fix build.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Apr 3 09:37:09 UTC 2012 - dvaleev@suse.com
|
||||
|
834
systemd-mini.spec
Normal file
834
systemd-mini.spec
Normal file
@ -0,0 +1,834 @@
|
||||
#
|
||||
# spec file for package systemd-mini
|
||||
#
|
||||
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
|
||||
##### WARNING: please do not edit this auto generated spec file. Use the systemd.spec! #####
|
||||
%define bootstrap 1
|
||||
%define real systemd
|
||||
##### WARNING: please do not edit this auto generated spec file. Use the systemd.spec! #####
|
||||
%define udevpkgname udev-mini
|
||||
%define udev_major 1
|
||||
|
||||
Name: systemd-mini
|
||||
Url: http://www.freedesktop.org/wiki/Software/systemd
|
||||
Version: 195
|
||||
Release: 0
|
||||
Summary: A System and Session Manager
|
||||
License: LGPL-2.1+
|
||||
Group: System/Base
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
|
||||
Provides: %{real} = %{version}-%{release}
|
||||
|
||||
BuildRequires: audit-devel
|
||||
BuildRequires: dbus-1
|
||||
%if ! 0%{?bootstrap}
|
||||
BuildRequires: docbook-xsl-stylesheets
|
||||
%endif
|
||||
BuildRequires: fdupes
|
||||
%if ! 0%{?bootstrap}
|
||||
BuildRequires: gobject-introspection-devel
|
||||
%endif
|
||||
BuildRequires: gperf
|
||||
%if ! 0%{?bootstrap}
|
||||
BuildRequires: gtk-doc
|
||||
%endif
|
||||
BuildRequires: intltool
|
||||
BuildRequires: libacl-devel
|
||||
BuildRequires: libcap-devel
|
||||
BuildRequires: libsepol-devel
|
||||
BuildRequires: libtool
|
||||
BuildRequires: libusb-devel
|
||||
%if ! 0%{?bootstrap}
|
||||
BuildRequires: libxslt-tools
|
||||
%endif
|
||||
BuildRequires: pam-devel
|
||||
BuildRequires: tcpd-devel
|
||||
BuildRequires: xz
|
||||
BuildRequires: pkgconfig(blkid) >= 2.20
|
||||
BuildRequires: pkgconfig(dbus-1) >= 1.3.2
|
||||
%if ! 0%{?bootstrap}
|
||||
BuildRequires: pkgconfig(glib-2.0) >= 2.22.0
|
||||
BuildRequires: pkgconfig(libcryptsetup) >= 1.4.2
|
||||
%endif
|
||||
BuildRequires: pkgconfig(libkmod) >= 5
|
||||
BuildRequires: pkgconfig(liblzma)
|
||||
%if ! 0%{?bootstrap}
|
||||
BuildRequires: pkgconfig(libmicrohttpd)
|
||||
%endif
|
||||
BuildRequires: pkgconfig(libpci) >= 3
|
||||
%if ! 0%{?bootstrap}
|
||||
BuildRequires: pkgconfig(libqrencode)
|
||||
%endif
|
||||
BuildRequires: pkgconfig(libselinux) >= 2.1.9
|
||||
BuildRequires: pkgconfig(libsepol)
|
||||
BuildRequires: pkgconfig(usbutils) >= 0.82
|
||||
%if 0%{?bootstrap}
|
||||
Requires: this-is-only-for-build-envs
|
||||
%else
|
||||
# the buildignore is important for bootstrapping
|
||||
#!BuildIgnore: udev
|
||||
Requires: %{udevpkgname} >= 172
|
||||
Requires: dbus-1 >= 1.4.0
|
||||
Requires: kbd
|
||||
Requires: pam-config >= 0.79-5
|
||||
Requires: systemd-presets-branding
|
||||
Requires: util-linux >= 2.21
|
||||
Requires(post): coreutils
|
||||
Requires(post): findutils
|
||||
%endif
|
||||
Conflicts: filesystem < 11.5
|
||||
Conflicts: mkinitrd < 2.7.0
|
||||
Source0: http://www.freedesktop.org/software/systemd/systemd-%{version}.tar.xz
|
||||
Source1: systemd-rpmlintrc
|
||||
Source2: localfs.service
|
||||
Source3: systemd-sysv-convert
|
||||
Source4: macros.systemd
|
||||
Source5: systemd-insserv_conf
|
||||
Source6: baselibs.conf
|
||||
|
||||
Source1060: boot.udev
|
||||
Source1061: write_dev_root_rule
|
||||
Source1062: udev-root-symlink.systemd
|
||||
|
||||
Patch1: 0001-Add-bootsplash-handling-for-password-dialogs.patch
|
||||
# handle SUSE specific kbd settings
|
||||
Patch6: 0001-handle-disable_caplock-and-compose_table-and-kbd_rat.patch
|
||||
Patch7: systemd-numlock-suse.patch
|
||||
# don't start getty on tty1 until all password request are done
|
||||
Patch8: tty1.patch
|
||||
Patch10: 0001-service-Fix-dependencies-added-when-parsing-insserv..patch
|
||||
Patch13: 0001-service-flags-sysv-service-with-detected-pid-as-Rema.patch
|
||||
Patch15: support-sysvinit.patch
|
||||
Patch16: modules_on_boot.patch
|
||||
Patch22: new-lsb-headers.patch
|
||||
Patch23: storage-after-cryptsetup.patch
|
||||
Patch24: delay-fsck-cryptsetup-after-md-lvm-dmraid.patch
|
||||
Patch31: lock-opensuse.patch
|
||||
Patch33: crypt-loop-file.patch
|
||||
Patch36: sysctl-modules.patch
|
||||
Patch38: dm-lvm-after-local-fs-pre-target.patch
|
||||
Patch53: fastboot-forcefsck.patch
|
||||
Patch56: support-suse-clock-sysconfig.patch
|
||||
Patch59: fix-enable-disable-boot-initscript.patch
|
||||
Patch60: var-run-lock.patch
|
||||
|
||||
# Upstream First - Policy:
|
||||
# Never add any patches to this package without the upstream commit id
|
||||
# in the patch. Any patches added here without a very good reason to make
|
||||
# an exception will be silently removed with the next version update.
|
||||
|
||||
# udev patches
|
||||
# PATCH-FIX-OPENSUSE 0001-Reinstate-TIMEOUT-handling.patch
|
||||
Patch1001: 0001-Reinstate-TIMEOUT-handling.patch
|
||||
# PATCH-FIX-OPENSUSE 0013-re-enable-by_path-links-for-ata-devices.patch
|
||||
Patch1013: 0013-re-enable-by_path-links-for-ata-devices.patch
|
||||
# PATCH-FIX-OPENSUSE 0014-rules-create-by-id-scsi-links-for-ATA-devices.patch
|
||||
Patch1014: 0014-rules-create-by-id-scsi-links-for-ATA-devices.patch
|
||||
|
||||
# PATCH-FIX-OPENSUSE 0026-udev-netlink-null-rules.patch
|
||||
Patch1026: 0026-udev-netlink-null-rules.patch
|
||||
# PATCH-FIX-OPENSUSE 0027-udev-fix-sg-autoload-regression.patch
|
||||
Patch1027: 0027-udev-fix-sg-autoload-regression.patch
|
||||
|
||||
# systemd patches
|
||||
|
||||
%description
|
||||
Systemd is a system and service manager, compatible with SysV and LSB
|
||||
init scripts for Linux. systemd provides aggressive parallelization
|
||||
capabilities, uses socket and D-Bus activation for starting services,
|
||||
offers on-demand starting of daemons, keeps track of processes using
|
||||
Linux cgroups, supports snapshotting and restoring of the system state,
|
||||
maintains mount and automount points and implements an elaborate
|
||||
transactional dependency-based service control logic. It can work as a
|
||||
drop-in replacement for sysvinit.
|
||||
|
||||
|
||||
|
||||
%package devel
|
||||
Summary: Development headers for systemd
|
||||
License: LGPL-2.1+
|
||||
Group: Development/Libraries/C and C++
|
||||
Requires: %{name} = %{version}
|
||||
|
||||
%description devel
|
||||
Development headers and auxiliary files for developing applications for systemd.
|
||||
|
||||
%package sysvinit
|
||||
Summary: System V init tools
|
||||
License: LGPL-2.1+
|
||||
Group: System/Base
|
||||
Requires: %{name} = %{version}
|
||||
Provides: sbin_init
|
||||
Conflicts: otherproviders(sbin_init)
|
||||
Provides: sysvinit:/sbin/init
|
||||
|
||||
%description sysvinit
|
||||
Drop-in replacement of System V init tools.
|
||||
|
||||
%package analyze
|
||||
Summary: Tool for processing systemd profiling information
|
||||
License: LGPL-2.1+
|
||||
Group: System/Base
|
||||
Requires: %{name} = %{version}
|
||||
Requires: dbus-1-python
|
||||
Requires: python-cairo
|
||||
# for the systemd-analyze split:
|
||||
Conflicts: systemd < 44-10
|
||||
|
||||
%description analyze
|
||||
'systemd-analyze blame' lists which systemd unit needed how much time to finish
|
||||
initialization at boot.
|
||||
'systemd-analyze plot' renders an SVG visualizing the parallel start of units
|
||||
at boot.
|
||||
|
||||
%package -n %{udevpkgname}
|
||||
Summary: A rule-based device node and kernel event manager
|
||||
License: GPL-2.0
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html
|
||||
PreReq: /bin/pidof /bin/rm /usr/bin/stat %insserv_prereq %fillup_prereq /usr/sbin/groupadd /usr/bin/getent /sbin/mkinitrd
|
||||
Conflicts: systemd < 39
|
||||
Conflicts: aaa_base < 11.5
|
||||
Conflicts: filesystem < 11.5
|
||||
Conflicts: mkinitrd < 2.7.0
|
||||
Conflicts: util-linux < 2.16
|
||||
Conflicts: ConsoleKit < 0.4.1
|
||||
Requires: filesystem
|
||||
%if 0%{?bootstrap}
|
||||
Provides: udev = %{version}
|
||||
%endif
|
||||
|
||||
%description -n %{udevpkgname}
|
||||
Udev creates and removes device nodes in /dev for devices discovered or
|
||||
removed from the system. It receives events via kernel netlink messages
|
||||
and dispatches them according to rules in /lib/udev/rules.d/. Matching
|
||||
rules may name a device node, create additional symlinks to the node,
|
||||
call tools to initialize a device, or load needed kernel modules.
|
||||
|
||||
|
||||
|
||||
%package -n lib%{udevpkgname}%{udev_major}
|
||||
Summary: Dynamic library to access udev device information
|
||||
License: LGPL-2.1+
|
||||
Group: System/Libraries
|
||||
Requires: %{udevpkgname} >= %{version}-%{release}
|
||||
|
||||
%description -n lib%{udevpkgname}%{udev_major}
|
||||
This package contains the dynamic library libudev, which provides
|
||||
access to udev device information
|
||||
|
||||
%package -n lib%{udevpkgname}-devel
|
||||
Summary: Development files for libudev
|
||||
License: LGPL-2.1+
|
||||
Group: Development/Libraries/Other
|
||||
Requires: lib%{udevpkgname}%{udev_major} = %{version}-%{release}
|
||||
%if 0%{?bootstrap}
|
||||
Provides: libudev-devel = %{version}
|
||||
%endif
|
||||
|
||||
%description -n lib%{udevpkgname}-devel
|
||||
This package contains the development files for the library libudev, a
|
||||
dynamic library, which provides access to udev device information.
|
||||
|
||||
%if ! 0%{?bootstrap}
|
||||
%package -n libgudev-1_0-0
|
||||
Summary: GObject library, to access udev device information
|
||||
License: LGPL-2.1+
|
||||
Group: System/Libraries
|
||||
Requires: lib%{udevpkgname}%{udev_major} = %{version}-%{release}
|
||||
|
||||
%description -n libgudev-1_0-0
|
||||
This package contains the GObject library libgudev, which provides
|
||||
access to udev device information.
|
||||
|
||||
%package -n typelib-1_0-GUdev-1_0
|
||||
Summary: GObject library, to access udev device information -- Introspection bindings
|
||||
License: LGPL-2.1+
|
||||
Group: System/Libraries
|
||||
|
||||
%description -n typelib-1_0-GUdev-1_0
|
||||
This package provides the GObject Introspection bindings for libgudev, which
|
||||
provides access to udev device information.
|
||||
|
||||
%package -n libgudev-1_0-devel
|
||||
Summary: Devel package for libgudev
|
||||
License: LGPL-2.1+
|
||||
Group: Development/Libraries/Other
|
||||
Requires: glib2-devel
|
||||
Requires: libgudev-1_0-0 = %{version}-%{release}
|
||||
Requires: libudev-devel = %{version}-%{release}
|
||||
Requires: typelib-1_0-GUdev-1_0 = %{version}-%{release}
|
||||
|
||||
%description -n libgudev-1_0-devel
|
||||
This is the devel package for the GObject library libgudev, which
|
||||
provides GObject access to udev device information.
|
||||
%endif
|
||||
|
||||
%prep
|
||||
%setup -q -n systemd-%{version}
|
||||
|
||||
#udev
|
||||
%patch1001 -p1
|
||||
%patch1013 -p1
|
||||
%patch1014 -p1
|
||||
%patch1026 -p1
|
||||
%patch1027 -p1
|
||||
|
||||
%patch1 -p1
|
||||
%patch6 -p1
|
||||
# don't apply when bootstrapping to not modify configure.in
|
||||
%if ! 0%{?bootstrap}
|
||||
%patch7 -p1
|
||||
%endif
|
||||
%patch8 -p1
|
||||
%patch10 -p1
|
||||
%patch13 -p1
|
||||
%patch15 -p1
|
||||
%patch16 -p1
|
||||
%patch22 -p1
|
||||
%patch23 -p1
|
||||
%patch24 -p1
|
||||
%patch31 -p1
|
||||
%patch33 -p1
|
||||
%patch36 -p1
|
||||
%patch38 -p1
|
||||
%patch53 -p1
|
||||
%patch56 -p1
|
||||
%patch59 -p1
|
||||
%patch60 -p1
|
||||
|
||||
%build
|
||||
%if ! 0%{?bootstrap}
|
||||
autoreconf -fiv
|
||||
%endif
|
||||
# prevent pre-generated and distributed files from re-building
|
||||
find . -name "*.[1-8]" -exec touch '{}' \;
|
||||
export V=1
|
||||
# keep split-usr until all packages have moved their systemd rules to /usr
|
||||
%configure \
|
||||
--with-distro=suse \
|
||||
--docdir=%{_docdir}/systemd \
|
||||
--with-pamlibdir=/%{_lib}/security \
|
||||
%if 0%{?bootstrap}
|
||||
--disable-gudev \
|
||||
%else
|
||||
--enable-manpages \
|
||||
--enable-gtk-doc \
|
||||
%endif
|
||||
--enable-selinux \
|
||||
--enable-split-usr \
|
||||
--disable-static \
|
||||
CFLAGS="%{optflags}"
|
||||
make %{?_smp_mflags}
|
||||
|
||||
%install
|
||||
%makeinstall
|
||||
|
||||
mkdir -p $RPM_BUILD_ROOT/{sbin,lib,bin}
|
||||
ln -sf %{_bindir}/udevadm $RPM_BUILD_ROOT/sbin/udevadm
|
||||
ln -sf %{_bindir}/systemd-ask-password $RPM_BUILD_ROOT/bin/systemd-ask-password
|
||||
ln -sf %{_bindir}/systemctl $RPM_BUILD_ROOT/bin/systemctl
|
||||
ln -sf %{_prefix}/lib/systemd/systemd-udevd $RPM_BUILD_ROOT/sbin/udevd
|
||||
mkdir -p $RPM_BUILD_ROOT/%{_prefix}/usr/lib/firmware/updates
|
||||
ln -sf /lib/firmware $RPM_BUILD_ROOT/usr/lib/firmware
|
||||
|
||||
install -m755 -D %{S:1060} $RPM_BUILD_ROOT/etc/init.d/boot.udev
|
||||
install -m755 -D %{S:1061} $RPM_BUILD_ROOT/%{_prefix}/lib/udev/write_dev_root_rule
|
||||
install -m644 -D %{S:1062} $RPM_BUILD_ROOT/%{_prefix}/lib/systemd/system/udev-root-symlink.service
|
||||
mkdir -p $RPM_BUILD_ROOT/lib/systemd/system/basic.target.wants
|
||||
ln -sf ../udev-root-symlink.service $RPM_BUILD_ROOT/%{_prefix}/lib/systemd/system/basic.target.wants
|
||||
|
||||
#fix manpages
|
||||
%if ! 0%{?bootstrap}
|
||||
sed -i -e 's,^\(\.so \)\(.*\.\)\([0-9]\),\1man\3/\2\3,g' %{buildroot}/%{_mandir}/*/*
|
||||
%endif
|
||||
|
||||
#workaround for 716939
|
||||
chmod 644 %{buildroot}%{_bindir}/systemd-analyze
|
||||
mkdir -p %{buildroot}%{_sysconfdir}/rpm
|
||||
install -m644 %{S:4} %{buildroot}%{_sysconfdir}/rpm
|
||||
find %{buildroot} -type f -name '*.la' -exec rm -f {} ';'
|
||||
mkdir -p %{buildroot}/{sbin,var/lib/systemd/sysv-convert,var/lib/systemd/migrated} %{buildroot}/usr/lib/systemd/{system-generators,user-generators,system-preset,user-preset,system/halt.target.wants,system/kexec.target.wants,system/poweroff.target.wants,system/reboot.target.wants}
|
||||
|
||||
install -m755 %{S:3} -D %{buildroot}%{_sbindir}/systemd-sysv-convert
|
||||
# do not install, code has been fixed, might be useful in the future
|
||||
#install -m755 %{S:5} %{buildroot}/lib/systemd/system-generators
|
||||
ln -s ../usr/lib/systemd/systemd %{buildroot}/bin/systemd
|
||||
ln -s ../usr/lib/systemd/systemd %{buildroot}/sbin/init
|
||||
ln -s ../usr/bin/systemctl %{buildroot}/sbin/reboot
|
||||
ln -s ../usr/bin/systemctl %{buildroot}/sbin/halt
|
||||
ln -s ../usr/bin/systemctl %{buildroot}/sbin/shutdown
|
||||
ln -s ../usr/bin/systemctl %{buildroot}/sbin/poweroff
|
||||
ln -s ../usr/bin/systemctl %{buildroot}/sbin/telinit
|
||||
ln -s ../usr/bin/systemctl %{buildroot}/sbin/runlevel
|
||||
rm -rf %{buildroot}/etc/systemd/system/*.target.wants
|
||||
rm -f %{buildroot}/etc/systemd/system/default.target
|
||||
# aliases for /etc/init.d/*
|
||||
ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/cgroup.service
|
||||
ln -s systemd-tmpfiles-setup.service %{buildroot}/%{_prefix}/lib/systemd/system/cleanup.service
|
||||
ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/clock.service
|
||||
ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/crypto.service
|
||||
ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/crypto-early.service
|
||||
ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/device-mapper.service
|
||||
ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/earlysyslog.service
|
||||
ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/kbd.service
|
||||
ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/ldconfig.service
|
||||
ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/loadmodules.service
|
||||
install -m644 %{S:2} %{buildroot}/%{_prefix}/lib/systemd/system/localfs.service
|
||||
# need to be implemented in systemd directly
|
||||
#ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/localnet.service
|
||||
ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/proc.service
|
||||
ln -s systemd-fsck-root.service %{buildroot}/%{_prefix}/lib/systemd/system/rootfsck.service
|
||||
ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/single.service
|
||||
ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/swap.service
|
||||
ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/startpreload.service
|
||||
ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/stoppreload.service
|
||||
ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/earlyxdm.service
|
||||
ln -s systemd-sysctl.service %{buildroot}/%{_prefix}/lib/systemd/system/sysctl.service
|
||||
ln -s systemd-random-seed-load.service %{buildroot}/%{_prefix}/lib/systemd/system/random.service
|
||||
# don't mount /tmp as tmpfs for now
|
||||
rm %{buildroot}/%{_prefix}/lib/systemd/system/local-fs.target.wants/tmp.mount
|
||||
|
||||
# To avoid making life hard for Factory developers, don't package the
|
||||
# kernel.core_pattern setting until systemd-coredump is a part of an actual
|
||||
# systemd release and it's made clear how to get the core dumps out of the
|
||||
# journal.
|
||||
rm -f %{buildroot}%{_libdir}/../lib/sysctl.d/coredump.conf
|
||||
|
||||
# remove README files for now
|
||||
rm -f %{buildroot}/var/log/README %{buildroot}/etc/init.d/README
|
||||
|
||||
# legacy links
|
||||
ln -s loginctl %{buildroot}%{_bindir}/systemd-loginctl
|
||||
ln -s journalctl %{buildroot}%{_bindir}/systemd-journalctl
|
||||
ln -s /usr/lib/udev %{buildroot}/lib/udev
|
||||
|
||||
# Create the /var/log/journal directory to change the volatile journal to a persistent one
|
||||
mkdir -p %{buildroot}/var/log/journal
|
||||
|
||||
# Make sure the NTP units dir exists
|
||||
mkdir -p %{buildroot}%{_prefix}/lib/systemd/ntp-units.d/
|
||||
|
||||
# Make sure the shutdown/sleep drop-in dirs exist
|
||||
mkdir -p %{buildroot}%{_prefix}/lib/systemd/system-shutdown/
|
||||
mkdir -p %{buildroot}%{_prefix}/lib/systemd/system-sleep/
|
||||
|
||||
# Make sure these directories are properly owned
|
||||
mkdir -p %{buildroot}%{_prefix}/lib/systemd/system/default.target.wants
|
||||
mkdir -p %{buildroot}%{_prefix}/lib/systemd/system/dbus.target.wants
|
||||
mkdir -p %{buildroot}%{_prefix}/lib/systemd/system/syslog.target.wants
|
||||
|
||||
%fdupes -s %{buildroot}%{_mandir}
|
||||
|
||||
%post
|
||||
/usr/sbin/pam-config -a --systemd >/dev/null 2>&1 || :
|
||||
/sbin/ldconfig
|
||||
/usr/bin/systemd-machine-id-setup >/dev/null 2>&1 || :
|
||||
/usr/bin/systemctl daemon-reexec >/dev/null 2>&1 || :
|
||||
|
||||
# Try to read default runlevel from the old inittab if it exists
|
||||
if [ ! -e /etc/systemd/system/default.target -a -e /etc/inittab ]; then
|
||||
runlevel=$(awk -F ':' '$3 == "initdefault" && $1 !~ "^#" { print $2 }' /etc/inittab 2> /dev/null)
|
||||
if [ -n "$runlevel" ] ; then
|
||||
/bin/ln -sf /usr/lib/systemd/system/runlevel$runlevel.target /etc/systemd/system/default.target 2>&1 || :
|
||||
fi
|
||||
fi
|
||||
# Create default config in /etc at first install.
|
||||
# Later package updates should not overwrite these settings.
|
||||
if [ "$1" -eq 1 ]; then
|
||||
# Enable these services by default.
|
||||
/usr/bin/systemctl enable \
|
||||
getty@.service \
|
||||
systemd-readahead-collect.service \
|
||||
systemd-readahead-replay.service \
|
||||
remote-fs.target >/dev/null 2>&1 || :
|
||||
else
|
||||
# migrate any symlink which may refer to the old path
|
||||
for f in $(find /etc/systemd/system -type l -xtype l); do
|
||||
new_target="/usr$(readlink $f)"
|
||||
[ -f "$new_target" ] && ln -s -f $new_target $f || :
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
%postun
|
||||
/sbin/ldconfig
|
||||
if [ $1 -ge 1 ]; then
|
||||
/usr/bin/systemctl try-restart systemd-logind.service >/dev/null 2>&1 || :
|
||||
fi
|
||||
if [ $1 -eq 0 ]; then
|
||||
/usr/sbin/pam-config -d --systemd >/dev/null 2>&1 || :
|
||||
fi
|
||||
|
||||
%preun
|
||||
if [ $1 -eq 0 ]; then
|
||||
/usr/bin/systemctl disable \
|
||||
getty@.service \
|
||||
systemd-readahead-collect.service \
|
||||
systemd-readahead-replay.service \
|
||||
remote-fs.target >/dev/null 2>&1 || :
|
||||
rm -f /etc/systemd/system/default.target 2>&1 || :
|
||||
fi
|
||||
|
||||
%pretrans -n %{udevpkgname} -p <lua>
|
||||
if posix.stat("/lib/udev") and not posix.stat("/usr/lib/udev") then
|
||||
posix.symlink("/lib/udev", "/usr/lib/udev")
|
||||
end
|
||||
|
||||
%pre -n %{udevpkgname}
|
||||
if test -L /usr/lib/udev -a /lib/udev -ef /usr/lib/udev ; then
|
||||
rm /usr/lib/udev
|
||||
mv /lib/udev /usr/lib
|
||||
ln -s /usr/lib/udev /lib/udev
|
||||
fi
|
||||
|
||||
%post -n %{udevpkgname}
|
||||
%{fillup_and_insserv -Y boot.udev}
|
||||
# add KERNEL name match to existing persistent net rules
|
||||
sed -ri '/KERNEL/ ! { s/NAME="(eth|wlan|ath)([0-9]+)"/KERNEL=="\1*", NAME="\1\2"/}' \
|
||||
/etc/udev/rules.d/70-persistent-net.rules >/dev/null 2>&1 || :
|
||||
# cleanup old stuff
|
||||
rm -f /etc/sysconfig/udev
|
||||
rm -f /etc/udev/rules.d/20-cdrom.rules
|
||||
rm -f /etc/udev/rules.d/55-cdrom.rules
|
||||
rm -f /etc/udev/rules.d/65-cdrom.rules
|
||||
/usr/bin/systemctl daemon-reload >/dev/null 2>&1 || :
|
||||
# start daemon if we are not in a chroot
|
||||
if test -f /proc/1/exe -a -d /proc/1/root; then
|
||||
if test "$(stat -Lc '%%D-%%i' /)" = "$(stat -Lc '%%D-%%i' /proc/1/root)"; then
|
||||
/usr/bin/systemctl start systemd-udevd.service >/dev/null 2>&1 || :
|
||||
/usr/lib/systemd/systemd-udevd --daemon >/dev/null 2>&1 || :
|
||||
fi
|
||||
fi
|
||||
|
||||
[ -x /sbin/mkinitrd_setup ] && /sbin/mkinitrd_setup
|
||||
if [ -e /var/lib/no_initrd_recreation_by_suspend ]; then
|
||||
echo "Skipping recreation of existing initial ramdisks, due"
|
||||
echo "to presence of /var/lib/no_initrd_recreation_by_suspend"
|
||||
elif [ -x /sbin/mkinitrd ]; then
|
||||
/sbin/mkinitrd
|
||||
fi
|
||||
|
||||
%postun -n %{udevpkgname}
|
||||
%insserv_cleanup
|
||||
/usr/bin/systemctl daemon-reload >/dev/null 2>&1 || :
|
||||
|
||||
[ -x /sbin/mkinitrd_setup ] && /sbin/mkinitrd_setup
|
||||
if [ -e /var/lib/no_initrd_recreation_by_suspend ]; then
|
||||
echo "Skipping recreation of existing initial ramdisks, due"
|
||||
echo "to presence of /var/lib/no_initrd_recreation_by_suspend"
|
||||
elif [ -x /sbin/mkinitrd ]; then
|
||||
/sbin/mkinitrd
|
||||
fi
|
||||
|
||||
%post -n lib%{udevpkgname}%{udev_major} -p /sbin/ldconfig
|
||||
|
||||
%postun -n lib%{udevpkgname}%{udev_major} -p /sbin/ldconfig
|
||||
|
||||
%if ! 0%{?bootstrap}
|
||||
|
||||
%post -n libgudev-1_0-0 -p /sbin/ldconfig
|
||||
|
||||
%postun -n libgudev-1_0-0 -p /sbin/ldconfig
|
||||
%endif
|
||||
|
||||
%clean
|
||||
rm -rf %{buildroot}
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
/bin/systemd
|
||||
/bin/systemd-ask-password
|
||||
/bin/systemctl
|
||||
%{_bindir}/hostnamectl
|
||||
%{_bindir}/localectl
|
||||
%{_bindir}/systemctl
|
||||
%{_bindir}/systemd-coredumpctl
|
||||
%{_bindir}/systemd-delta
|
||||
%{_bindir}/systemd-notify
|
||||
%{_bindir}/systemd-journalctl
|
||||
%{_bindir}/journalctl
|
||||
%{_bindir}/systemd-ask-password
|
||||
%{_bindir}/loginctl
|
||||
%{_bindir}/systemd-loginctl
|
||||
%{_bindir}/systemd-inhibit
|
||||
%{_bindir}/systemd-tty-ask-password-agent
|
||||
%{_bindir}/systemd-tmpfiles
|
||||
%{_bindir}/systemd-machine-id-setup
|
||||
%{_bindir}/systemd-nspawn
|
||||
%{_bindir}/systemd-stdio-bridge
|
||||
%{_bindir}/systemd-detect-virt
|
||||
%{_bindir}/timedatectl
|
||||
%{_sbindir}/systemd-sysv-convert
|
||||
%{_libdir}/libsystemd-daemon.so.*
|
||||
%{_libdir}/libsystemd-login.so.*
|
||||
%{_libdir}/libsystemd-id128.so.*
|
||||
%{_libdir}/libsystemd-journal.so.*
|
||||
%{_bindir}/systemd-cgls
|
||||
%{_bindir}/systemd-cgtop
|
||||
%{_bindir}/systemd-cat
|
||||
%dir %{_prefix}/lib/systemd
|
||||
%dir %{_prefix}/lib/systemd/user
|
||||
%dir %{_prefix}/lib/systemd/system
|
||||
%exclude %{_prefix}/lib/systemd/system/systemd-udev*.*
|
||||
%exclude %{_prefix}/lib/systemd/system/udev-root-symlink.service
|
||||
%exclude %{_prefix}/lib/systemd/system/*.target.wants/systemd-udev*.*
|
||||
%exclude %{_prefix}/lib/systemd/system/basic.target.wants/udev-root-symlink.service
|
||||
%{_prefix}/lib/systemd/system/*.automount
|
||||
%{_prefix}/lib/systemd/system/*.service
|
||||
%{_prefix}/lib/systemd/system/*.target
|
||||
%{_prefix}/lib/systemd/system/*.mount
|
||||
%{_prefix}/lib/systemd/system/*.timer
|
||||
%{_prefix}/lib/systemd/system/*.socket
|
||||
%{_prefix}/lib/systemd/system/*.wants
|
||||
%{_prefix}/lib/systemd/system/*.path
|
||||
%{_prefix}/lib/systemd/user/*.target
|
||||
%{_prefix}/lib/systemd/user/*.service
|
||||
%exclude %{_prefix}/lib/systemd/systemd-udevd
|
||||
%{_prefix}/lib/systemd/systemd-*
|
||||
%{_prefix}/lib/systemd/systemd
|
||||
%dir %{_prefix}/lib/systemd/system-shutdown
|
||||
%dir %{_prefix}/lib/systemd/system-preset
|
||||
%dir %{_prefix}/lib/systemd/user-preset
|
||||
%dir %{_prefix}/lib/systemd/system-generators
|
||||
%dir %{_prefix}/lib/systemd/user-generators
|
||||
%dir %{_prefix}/lib/systemd/ntp-units.d/
|
||||
%dir %{_prefix}/lib/systemd/system-shutdown/
|
||||
%dir %{_prefix}/lib/systemd/system-sleep/
|
||||
%dir %{_prefix}/lib/systemd/system/default.target.wants
|
||||
%dir %{_prefix}/lib/systemd/system/dbus.target.wants
|
||||
%dir %{_prefix}/lib/systemd/system/syslog.target.wants
|
||||
%if ! 0%{?bootstrap}
|
||||
%{_prefix}/lib/systemd/system-generators/systemd-cryptsetup-generator
|
||||
%endif
|
||||
%{_prefix}/lib/systemd/system-generators/systemd-getty-generator
|
||||
%{_prefix}/lib/systemd/system-generators/systemd-rc-local-generator
|
||||
%{_prefix}/lib/systemd/system-generators/systemd-fstab-generator
|
||||
%{_prefix}/lib/systemd/system-generators/systemd-system-update-generator
|
||||
/%{_lib}/security/pam_systemd.so
|
||||
|
||||
%dir %{_libexecdir}/modules-load.d
|
||||
%dir %{_sysconfdir}/modules-load.d
|
||||
|
||||
%dir %{_libexecdir}/tmpfiles.d
|
||||
%dir %{_sysconfdir}/tmpfiles.d
|
||||
%{_libexecdir}/tmpfiles.d/*.conf
|
||||
|
||||
%dir %{_libexecdir}/binfmt.d
|
||||
%dir %{_sysconfdir}/binfmt.d
|
||||
|
||||
%dir %{_libexecdir}/sysctl.d
|
||||
%dir %{_sysconfdir}/sysctl.d
|
||||
|
||||
%dir %{_sysconfdir}/systemd
|
||||
%dir %{_sysconfdir}/systemd/system
|
||||
%dir %{_sysconfdir}/systemd/user
|
||||
%dir %{_sysconfdir}/xdg/systemd
|
||||
%dir %{_sysconfdir}/xdg/systemd/user
|
||||
%config(noreplace) %{_sysconfdir}/systemd/system.conf
|
||||
%config(noreplace) %{_sysconfdir}/systemd/logind.conf
|
||||
%config(noreplace) %{_sysconfdir}/systemd/journald.conf
|
||||
%config(noreplace) %{_sysconfdir}/systemd/user.conf
|
||||
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/org.freedesktop.locale1.conf
|
||||
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/org.freedesktop.login1.conf
|
||||
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/org.freedesktop.systemd1.conf
|
||||
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/org.freedesktop.hostname1.conf
|
||||
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/org.freedesktop.timedate1.conf
|
||||
|
||||
%{_datadir}/dbus-1/interfaces/org.freedesktop.hostname1.xml
|
||||
%{_datadir}/dbus-1/interfaces/org.freedesktop.locale1.xml
|
||||
%{_datadir}/dbus-1/interfaces/org.freedesktop.systemd1.*.xml
|
||||
%{_datadir}/dbus-1/interfaces/org.freedesktop.timedate1.xml
|
||||
%{_datadir}/dbus-1/services/org.freedesktop.systemd1.service
|
||||
%{_datadir}/dbus-1/system-services/org.freedesktop.systemd1.service
|
||||
%{_datadir}/dbus-1/system-services/org.freedesktop.locale1.service
|
||||
%{_datadir}/dbus-1/system-services/org.freedesktop.login1.service
|
||||
%{_datadir}/dbus-1/system-services/org.freedesktop.hostname1.service
|
||||
%{_datadir}/dbus-1/system-services/org.freedesktop.timedate1.service
|
||||
%dir %{_datadir}/polkit-1
|
||||
%dir %{_datadir}/polkit-1/actions
|
||||
%{_datadir}/polkit-1/actions/org.freedesktop.systemd1.policy
|
||||
%{_datadir}/polkit-1/actions/org.freedesktop.hostname1.policy
|
||||
%{_datadir}/polkit-1/actions/org.freedesktop.locale1.policy
|
||||
%{_datadir}/polkit-1/actions/org.freedesktop.timedate1.policy
|
||||
%{_datadir}/polkit-1/actions/org.freedesktop.login1.policy
|
||||
%{_datadir}/systemd
|
||||
|
||||
%if ! 0%{?bootstrap}
|
||||
# Packaged in sysvinit subpackage
|
||||
%exclude %{_mandir}/man1/init.1*
|
||||
%exclude %{_mandir}/man8/halt.8*
|
||||
%exclude %{_mandir}/man8/reboot.8*
|
||||
%exclude %{_mandir}/man8/shutdown.8*
|
||||
%exclude %{_mandir}/man8/poweroff.8*
|
||||
%exclude %{_mandir}/man8/telinit.8*
|
||||
%exclude %{_mandir}/man8/runlevel.8*
|
||||
%exclude %{_mandir}/man*/*udev*.[0-9]*
|
||||
%{_mandir}/man1/*.1*
|
||||
%{_mandir}/man3/*.3*
|
||||
%{_mandir}/man5/*.5*
|
||||
%{_mandir}/man7/*.7*
|
||||
%{_mandir}/man8/*.8*
|
||||
%endif
|
||||
%{_docdir}/systemd
|
||||
%{_prefix}/lib/udev/rules.d/70-uaccess.rules
|
||||
%{_prefix}/lib/udev/rules.d/71-seat.rules
|
||||
%{_prefix}/lib/udev/rules.d/73-seat-late.rules
|
||||
%if ! 0%{?bootstrap}
|
||||
%{_prefix}/lib/udev/rules.d/73-seat-numlock.rules
|
||||
%endif
|
||||
%{_prefix}/lib/udev/rules.d/99-systemd.rules
|
||||
%if ! 0%{?bootstrap}
|
||||
%{_prefix}/lib/udev/numlock-on
|
||||
%endif
|
||||
%dir %{_sysconfdir}/bash_completion.d
|
||||
%{_sysconfdir}/bash_completion.d/systemd-bash-completion.sh
|
||||
%{_sysconfdir}/rpm/macros.systemd
|
||||
%dir /var/lib/systemd
|
||||
%dir /var/lib/systemd/sysv-convert
|
||||
%dir /var/lib/systemd/migrated
|
||||
%dir /var/log/journal
|
||||
|
||||
%files devel
|
||||
%defattr(-,root,root,-)
|
||||
%{_libdir}/libsystemd-daemon.so
|
||||
%{_libdir}/libsystemd-login.so
|
||||
%{_libdir}/libsystemd-id128.so
|
||||
%{_libdir}/libsystemd-journal.so
|
||||
%dir %{_includedir}/systemd
|
||||
%{_includedir}/systemd/sd-login.h
|
||||
%{_includedir}/systemd/sd-daemon.h
|
||||
%{_includedir}/systemd/sd-id128.h
|
||||
%{_includedir}/systemd/sd-journal.h
|
||||
%{_includedir}/systemd/sd-messages.h
|
||||
%{_includedir}/systemd/sd-shutdown.h
|
||||
%{_datadir}/pkgconfig/systemd.pc
|
||||
%{_libdir}/pkgconfig/libsystemd-daemon.pc
|
||||
%{_libdir}/pkgconfig/libsystemd-login.pc
|
||||
%{_libdir}/pkgconfig/libsystemd-id128.pc
|
||||
%{_libdir}/pkgconfig/libsystemd-journal.pc
|
||||
|
||||
%files sysvinit
|
||||
%defattr(-,root,root,-)
|
||||
/sbin/init
|
||||
/sbin/reboot
|
||||
/sbin/halt
|
||||
/sbin/shutdown
|
||||
/sbin/poweroff
|
||||
/sbin/telinit
|
||||
/sbin/runlevel
|
||||
%if ! 0%{?bootstrap}
|
||||
%{_mandir}/man1/init.1*
|
||||
%{_mandir}/man8/halt.8*
|
||||
%{_mandir}/man8/reboot.8*
|
||||
%{_mandir}/man8/shutdown.8*
|
||||
%{_mandir}/man8/poweroff.8*
|
||||
%{_mandir}/man8/telinit.8*
|
||||
%{_mandir}/man8/runlevel.8*
|
||||
%endif
|
||||
|
||||
%files analyze
|
||||
%attr(0755,root,root) /usr/bin/systemd-analyze
|
||||
|
||||
%files -n %{udevpkgname}
|
||||
%defattr(-,root,root)
|
||||
/sbin/udevd
|
||||
/sbin/udevadm
|
||||
# keep for compatibility
|
||||
%ghost /lib/udev
|
||||
%{_bindir}/udevadm
|
||||
%{_prefix}/lib/firmware
|
||||
%dir %{_prefix}/lib/udev/
|
||||
%{_prefix}/lib/udev/accelerometer
|
||||
%{_prefix}/lib/udev/ata_id
|
||||
%{_prefix}/lib/udev/cdrom_id
|
||||
%{_prefix}/lib/udev/collect
|
||||
%{_prefix}/lib/udev/findkeyboards
|
||||
%{_prefix}/lib/udev/keymap
|
||||
%{_prefix}/lib/udev/mtd_probe
|
||||
%{_prefix}/lib/udev/scsi_id
|
||||
%{_prefix}/lib/udev/v4l_id
|
||||
%{_prefix}/lib/udev/write_dev_root_rule
|
||||
%dir %{_prefix}/lib/udev/keymaps
|
||||
%{_prefix}/lib/udev/keymaps/*
|
||||
%{_prefix}/lib/udev/keyboard-force-release.sh
|
||||
%dir %{_prefix}/lib/udev/rules.d/
|
||||
%exclude %{_prefix}/lib/udev/rules.d/70-uaccess.rules
|
||||
%exclude %{_prefix}/lib/udev/rules.d/71-seat.rules
|
||||
%exclude %{_prefix}/lib/udev/rules.d/73-seat-late.rules
|
||||
%exclude %{_prefix}/lib/udev/rules.d/73-seat-numlock.rules
|
||||
%exclude %{_prefix}/lib/udev/rules.d/99-systemd.rules
|
||||
%{_prefix}/lib/udev/rules.d/*.rules
|
||||
%{_sysconfdir}/init.d/boot.udev
|
||||
%dir %{_sysconfdir}/udev/
|
||||
%dir %{_sysconfdir}/udev/rules.d/
|
||||
%config(noreplace) %{_sysconfdir}/udev/udev.conf
|
||||
%if ! 0%{?bootstrap}
|
||||
%{_mandir}/man?/*udev*.[0-9]*
|
||||
%endif
|
||||
%dir %{_prefix}/lib/systemd/system
|
||||
%{_prefix}/lib/systemd/systemd-udevd
|
||||
%{_prefix}/lib/systemd/system/udev-root-symlink.service
|
||||
%{_prefix}/lib/systemd/system/*udev*.service
|
||||
%{_prefix}/lib/systemd/system/systemd-udevd*.socket
|
||||
%dir %{_prefix}/lib/systemd/system/sysinit.target.wants
|
||||
%{_prefix}/lib/systemd/system/sysinit.target.wants/systemd-udev*.service
|
||||
%dir %{_prefix}/lib/systemd/system/sockets.target.wants
|
||||
%{_prefix}/lib/systemd/system/sockets.target.wants/systemd-udev*.socket
|
||||
|
||||
%files -n lib%{udevpkgname}%{udev_major}
|
||||
%defattr(-,root,root)
|
||||
%{_libdir}/libudev.so.*
|
||||
|
||||
%files -n lib%{udevpkgname}-devel
|
||||
%defattr(-,root,root)
|
||||
%{_includedir}/libudev.h
|
||||
%{_libdir}/libudev.so
|
||||
%{_datadir}/pkgconfig/udev.pc
|
||||
%{_libdir}/pkgconfig/libudev.pc
|
||||
%if ! 0%{?bootstrap}
|
||||
%dir %{_datadir}/gtk-doc
|
||||
%dir %{_datadir}/gtk-doc/html
|
||||
%dir %{_datadir}/gtk-doc/html/libudev
|
||||
%{_datadir}/gtk-doc/html/libudev/*
|
||||
%endif
|
||||
|
||||
%if ! 0%{?bootstrap}
|
||||
%files -n libgudev-1_0-0
|
||||
%defattr(-,root,root)
|
||||
%{_libdir}/libgudev-1.0.so.*
|
||||
|
||||
%files -n typelib-1_0-GUdev-1_0
|
||||
%defattr(-,root,root)
|
||||
%{_libdir}/girepository-1.0/GUdev-1.0.typelib
|
||||
|
||||
%files -n libgudev-1_0-devel
|
||||
%defattr(-,root,root)
|
||||
%dir %{_includedir}/gudev-1.0
|
||||
%dir %{_includedir}/gudev-1.0/gudev
|
||||
%{_includedir}/gudev-1.0/gudev/*.h
|
||||
%{_libdir}/libgudev-1.0.so
|
||||
%{_libdir}/pkgconfig/gudev-1.0.pc
|
||||
%dir %{_datadir}/gtk-doc
|
||||
%dir %{_datadir}/gtk-doc/html
|
||||
%dir %{_datadir}/gtk-doc/html/gudev
|
||||
%{_datadir}/gtk-doc/html/gudev/*
|
||||
%{_datadir}/gir-1.0/GUdev-1.0.gir
|
||||
%endif
|
||||
|
||||
%changelog
|
@ -1,8 +1,8 @@
|
||||
Index: systemd-44/src/vconsole/vconsole-setup.c
|
||||
Index: systemd-190/src/vconsole/vconsole-setup.c
|
||||
===================================================================
|
||||
--- systemd-44.orig/src/vconsole/vconsole-setup.c
|
||||
+++ systemd-44/src/vconsole/vconsole-setup.c
|
||||
@@ -265,12 +265,14 @@ int main(int argc, char **argv) {
|
||||
--- systemd-190.orig/src/vconsole/vconsole-setup.c
|
||||
+++ systemd-190/src/vconsole/vconsole-setup.c
|
||||
@@ -287,12 +287,14 @@ int main(int argc, char **argv) {
|
||||
char *vc_kbd_delay = NULL;
|
||||
char *vc_kbd_rate = NULL;
|
||||
char *vc_kbd_disable_caps_lock = NULL;
|
||||
@ -17,16 +17,8 @@ Index: systemd-44/src/vconsole/vconsole-setup.c
|
||||
int r = EXIT_FAILURE;
|
||||
pid_t font_pid = 0, keymap_pid = 0;
|
||||
|
||||
@@ -374,6 +376,7 @@ int main(int argc, char **argv) {
|
||||
"KBD_DELAY", &vc_kbd_delay,
|
||||
"KBD_RATE", &vc_kbd_rate,
|
||||
"KBD_DISABLE_CAPS_LOCK", &vc_kbd_disable_caps_lock,
|
||||
+ "KBD_NUMLOCK", &vc_kbd_numlock,
|
||||
"COMPOSETABLE", &vc_compose_table,
|
||||
NULL)) < 0) {
|
||||
|
||||
@@ -391,6 +394,37 @@ int main(int argc, char **argv) {
|
||||
log_warning("Failed to read /etc/sysconfig/console: %s", strerror(-r));
|
||||
@@ -388,6 +390,37 @@ int main(int argc, char **argv) {
|
||||
vc_keymap = t;
|
||||
}
|
||||
disable_capslock = vc_kbd_disable_caps_lock && strcasecmp(vc_kbd_disable_caps_lock, "YES") == 0;
|
||||
+ if (vc_kbd_numlock && strcasecmp(vc_kbd_numlock, "BIOS") == 0) {
|
||||
@ -61,9 +53,17 @@ Index: systemd-44/src/vconsole/vconsole-setup.c
|
||||
+ } else
|
||||
+ numlock = vc_kbd_numlock && strcasecmp(vc_kbd_numlock, "YES") == 0;
|
||||
|
||||
#elif defined(TARGET_ARCH)
|
||||
if ((r = parse_env_file("/etc/rc.conf", NEWLINE,
|
||||
@@ -558,6 +592,10 @@ int main(int argc, char **argv) {
|
||||
#elif defined(TARGET_SUSE)
|
||||
r = parse_env_file("/etc/sysconfig/keyboard", NEWLINE,
|
||||
@@ -395,6 +428,7 @@ int main(int argc, char **argv) {
|
||||
"KBD_DELAY", &vc_kbd_delay,
|
||||
"KBD_RATE", &vc_kbd_rate,
|
||||
"KBD_DISABLE_CAPS_LOCK", &vc_kbd_disable_caps_lock,
|
||||
+ "KBD_NUMLOCK", &vc_kbd_numlock,
|
||||
"COMPOSETABLE", &vc_compose_table,
|
||||
NULL);
|
||||
if (r < 0 && r != -ENOENT)
|
||||
@@ -565,6 +599,10 @@ int main(int argc, char **argv) {
|
||||
finish:
|
||||
if (keymap_pid > 0)
|
||||
wait_for_terminate_and_warn(KBD_LOADKEYS, keymap_pid);
|
||||
@ -74,56 +74,35 @@ Index: systemd-44/src/vconsole/vconsole-setup.c
|
||||
|
||||
#ifdef TARGET_SUSE
|
||||
if (compose_table_pid > 0)
|
||||
Index: systemd-44/Makefile.am
|
||||
Index: systemd-190/Makefile.am
|
||||
===================================================================
|
||||
--- systemd-44.orig/Makefile.am
|
||||
+++ systemd-44/Makefile.am
|
||||
@@ -42,6 +42,7 @@ dbussessionservicedir=@dbussessionservic
|
||||
dbussystemservicedir=@dbussystemservicedir@
|
||||
dbusinterfacedir=@dbusinterfacedir@
|
||||
udevrulesdir=@udevrulesdir@
|
||||
+udevhelperdir=@udevhelperdir@
|
||||
pamlibdir=@pamlibdir@
|
||||
pkgconfigdatadir=$(datadir)/pkgconfig
|
||||
pkgconfiglibdir=$(libdir)/pkgconfig
|
||||
@@ -202,6 +203,9 @@ rootlibexec_PROGRAMS = \
|
||||
systemgenerator_PROGRAMS = \
|
||||
systemd-getty-generator
|
||||
|
||||
+udevhelper_PROGRAMS = \
|
||||
+ numlock-on
|
||||
+
|
||||
noinst_PROGRAMS = \
|
||||
test-engine \
|
||||
test-job-type \
|
||||
@@ -2033,6 +2037,12 @@ systemd_uaccess_LDADD = \
|
||||
$(UDEV_LIBS) \
|
||||
$(ACL_LIBS)
|
||||
--- systemd-190.orig/Makefile.am
|
||||
+++ systemd-190/Makefile.am
|
||||
@@ -1989,6 +1989,19 @@ dist_udevrules_DATA += \
|
||||
rules/61-accelerometer.rules
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
+numlock_on_SOURCES = \
|
||||
+ src/login/numlock-on.c
|
||||
+
|
||||
+numlock_on_CFLAGS = \
|
||||
+ $(AM_CFLAGS)
|
||||
+
|
||||
rootlibexec_PROGRAMS += \
|
||||
systemd-uaccess
|
||||
|
||||
@@ -2040,7 +2050,8 @@ dist_udevrules_DATA += \
|
||||
src/login/70-uaccess.rules
|
||||
|
||||
dist_udevrules_DATA += \
|
||||
- src/login/71-seat.rules
|
||||
+ src/login/71-seat.rules \
|
||||
+ src/login/73-seat-numlock.rules
|
||||
|
||||
nodist_udevrules_DATA += \
|
||||
src/login/73-seat-late.rules
|
||||
Index: systemd-44/configure.ac
|
||||
+udevlibexec_PROGRAMS += \
|
||||
+ numlock-on
|
||||
+
|
||||
+dist_udevrules_DATA += \
|
||||
+ rules/73-seat-numlock.rules
|
||||
+
|
||||
+# ------------------------------------------------------------------------------
|
||||
if ENABLE_GUDEV
|
||||
if ENABLE_GTK_DOC
|
||||
SUBDIRS += \
|
||||
Index: systemd-190/configure.ac
|
||||
===================================================================
|
||||
--- systemd-44.orig/configure.ac
|
||||
+++ systemd-44/configure.ac
|
||||
@@ -410,6 +410,13 @@ fi
|
||||
--- systemd-190.orig/configure.ac
|
||||
+++ systemd-190/configure.ac
|
||||
@@ -598,6 +598,13 @@ fi
|
||||
with_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]' `
|
||||
AC_DEFINE_UNQUOTED(DISTRIBUTION, ["${with_distro}"], [Target Distribution])
|
||||
|
||||
@ -137,38 +116,10 @@ Index: systemd-44/configure.ac
|
||||
# Location of the init scripts as mandated by LSB
|
||||
SYSTEM_SYSVINIT_PATH=/etc/init.d
|
||||
SYSTEM_SYSVRCND_PATH=/etc/rc.d
|
||||
@@ -579,6 +586,11 @@ AC_ARG_WITH([udevrulesdir],
|
||||
[],
|
||||
[with_udevrulesdir=`pkg-config --variable=udevdir udev`/rules.d])
|
||||
|
||||
+AC_ARG_WITH([udevhelperdir],
|
||||
+ AS_HELP_STRING([--with-udevhelperdir=DIR], [Directory for udev helpers]),
|
||||
+ [],
|
||||
+ [with_udevhelperdir=`pkg-config --variable=udevdir udev`])
|
||||
+
|
||||
AC_ARG_WITH([rootprefix],
|
||||
AS_HELP_STRING([--with-rootprefix=DIR], [rootfs directory prefix for config files and kernel modules]),
|
||||
[], [with_rootprefix=${ac_default_prefix}])
|
||||
@@ -611,6 +623,7 @@ AC_SUBST([dbussessionservicedir], [$with
|
||||
AC_SUBST([dbussystemservicedir], [$with_dbussystemservicedir])
|
||||
AC_SUBST([dbusinterfacedir], [$with_dbusinterfacedir])
|
||||
AC_SUBST([udevrulesdir], [$with_udevrulesdir])
|
||||
+AC_SUBST([udevhelperdir], [$with_udevhelperdir])
|
||||
AC_SUBST([pamlibdir], [$with_pamlibdir])
|
||||
AC_SUBST([rootprefix], [$with_rootprefix])
|
||||
AC_SUBST([rootlibdir], [$with_rootlibdir])
|
||||
@@ -650,6 +663,7 @@ AC_MSG_RESULT([
|
||||
rootlib dir: ${with_rootlibdir}
|
||||
PAM modules dir: ${with_pamlibdir}
|
||||
udev rules dir: ${with_udevrulesdir}
|
||||
+ udev hepler dir: ${with_udevhelperdir}
|
||||
D-Bus policy dir: ${with_dbuspolicydir}
|
||||
D-Bus session dir: ${with_dbussessionservicedir}
|
||||
D-Bus system dir: ${with_dbussystemservicedir}
|
||||
Index: systemd-44/src/login/73-seat-numlock.rules
|
||||
Index: systemd-190/rules/73-seat-numlock.rules
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ systemd-44/src/login/73-seat-numlock.rules
|
||||
+++ systemd-190/rules/73-seat-numlock.rules
|
||||
@@ -0,0 +1,8 @@
|
||||
+# This file is part of systemd.
|
||||
+#
|
||||
@ -178,10 +129,10 @@ Index: systemd-44/src/login/73-seat-numlock.rules
|
||||
+# (at your option) any later version.
|
||||
+
|
||||
+SUBSYSTEM=="tty", ACTION=="add", KERNEL=="tty[0-9]|tty1[0-2]", TEST=="/run/numlock-on", RUN+="numlock-on $env{DEVNAME}"
|
||||
Index: systemd-44/src/login/numlock-on.c
|
||||
Index: systemd-190/src/login/numlock-on.c
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ systemd-44/src/login/numlock-on.c
|
||||
+++ systemd-190/src/login/numlock-on.c
|
||||
@@ -0,0 +1,36 @@
|
||||
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
|
||||
+
|
||||
@ -219,16 +170,16 @@ Index: systemd-44/src/login/numlock-on.c
|
||||
+ return EX_IOERR;
|
||||
+ return execv(args[0], args);
|
||||
+}
|
||||
Index: systemd-44/units/systemd-vconsole-setup.service.in
|
||||
Index: systemd-190/units/systemd-vconsole-setup.service.in
|
||||
===================================================================
|
||||
--- systemd-44.orig/units/systemd-vconsole-setup.service.in
|
||||
+++ systemd-44/units/systemd-vconsole-setup.service.in
|
||||
@@ -10,7 +10,7 @@ Description=Setup Virtual Console
|
||||
--- systemd-190.orig/units/systemd-vconsole-setup.service.in
|
||||
+++ systemd-190/units/systemd-vconsole-setup.service.in
|
||||
@@ -11,7 +11,7 @@ Documentation=man:systemd-vconsole-setup
|
||||
DefaultDependencies=no
|
||||
Conflicts=shutdown.target
|
||||
After=systemd-readahead-collect.service systemd-readahead-replay.service
|
||||
-Before=sysinit.target shutdown.target
|
||||
+Before=sysinit.target shutdown.target udev-trigger.service
|
||||
ConditionPathExists=/dev/tty0
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
|
@ -2,9 +2,16 @@ addFilter(".*dangling-symlink /sbin/(halt|init|poweroff|telinit|shutdown|runleve
|
||||
addFilter(".*dangling-symlink .* /dev/null.*")
|
||||
addFilter(".*files-duplicate .*/reboot.8.*")
|
||||
addFilter(".*files-duplicate .*/sd_is_socket.3.*")
|
||||
addFilter("non-conffile-in-etc /etc/bash_completion.d/systemctl-bash-completion.sh")
|
||||
addFilter("non-conffile-in-etc /etc/bash_completion.d/systemd-bash-completion.sh")
|
||||
addFilter("non-conffile-in-etc /etc/rpm/macros.systemd")
|
||||
addFilter(".*dbus-policy-allow-receive")
|
||||
# Do not enable for submission into openSUSE:Factory,
|
||||
# just for testing while polkit-default-privs is not checked in
|
||||
# setBadness('polkit-unauthorized-privilege', 1)
|
||||
|
||||
addFilter(".*dangling-symlink /lib/udev/devices/std(in|out|err).*")
|
||||
addFilter(".*dangling-symlink /lib/udev/devices/core.*")
|
||||
addFilter(".*dangling-symlink /lib/udev/devices/fd.*")
|
||||
addFilter(".*incoherent-init-script-name boot.udev.*")
|
||||
addFilter(".init-script-without-%stop_on_removal-preun /etc/init.d/boot.udev")
|
||||
addFilter(".init-script-without-%restart_on_update-postun /etc/init.d/boot.udev")
|
||||
addFilter(".*devel-file-in-non-devel-package.*udev.pc.*")
|
||||
addFilter(".*libgudev-.*shlib-fixed-dependency.*")
|
||||
addFilter(".*suse-filelist-forbidden-systemd-userdirs.*")
|
||||
addFilter("libudev-mini.*shlib-policy-name-error.*")
|
||||
|
187
systemd.changes
187
systemd.changes
@ -1,3 +1,190 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Nov 2 14:07:15 UTC 2012 - coolo@suse.com
|
||||
|
||||
- udev is GPL-2.0, the rest remains LGPL-2.1+ (bnc#787824)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Oct 29 13:01:20 UTC 2012 - fcrozat@suse.com
|
||||
|
||||
- Add var-run-lock.patch: make sure /var/run and /var/lock are
|
||||
handled as bind mount if they aren't symlinks.
|
||||
- Update storage-after-cryptsetup.patch with new systemctl path.
|
||||
- Migrate broken symlinks in /etc/systemd/system due to new systemd
|
||||
location.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Oct 26 13:37:52 UTC 2012 - fcrozat@suse.com
|
||||
|
||||
- Update to release 195:
|
||||
+ journalctl agained --since and --until, as well as filtering
|
||||
for units with --unit=/-u.
|
||||
+ allow ExecReload properly for Type=oneshot (needed for
|
||||
iptables.service, rpc-nfsd.service).
|
||||
+ journal daemon supports time-based rotation and vaccuming.
|
||||
+ journalctl -F allow to list all values of a certain field in
|
||||
journal database.
|
||||
+ new commandline clients for timedated, locald and hostnamed
|
||||
+ new tool systemd-coredumpctl to list and extract coredumps from
|
||||
journal.
|
||||
+ improve gatewayd: follow mode, filtering, support for
|
||||
HTML5/JSON Server-Sent-Events.
|
||||
+ reload support in SysV initscripts is now detected when file is
|
||||
parted.
|
||||
+ "systemctl status --follow" as been removed, use "journalctl -fu
|
||||
instead"
|
||||
+ journald.conf RuntimeMinSize and PersistentMinSize settings
|
||||
have been removed.
|
||||
- Add compatibility symlink for systemd-ask-password and systemctl
|
||||
in /bin.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Oct 18 12:27:07 UTC 2012 - fcrozat@suse.com
|
||||
|
||||
- Create and own more systemd drop-in directories.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Oct 16 13:18:13 UTC 2012 - fcrozat@suse.com
|
||||
|
||||
- Improve mini packages for bootstrapping.
|
||||
- do not mount /tmp as tmpfs by default.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Oct 16 07:40:23 UTC 2012 - fcrozat@suse.com
|
||||
|
||||
- Fix install script when there is no inittab
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Oct 15 14:48:47 UTC 2012 - fcrozat@suse.com
|
||||
|
||||
- Create a systemd-mini specfile to prevent cycle in bootstrapping
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Oct 4 11:23:42 UTC 2012 - fcrozat@suse.com
|
||||
|
||||
- udev and its subpackages are now generated by systemd source
|
||||
package.
|
||||
- migrate udev and systemd to /usr
|
||||
- Update to version 194:
|
||||
+ if /etc/vconsole.conf is non-existent or empty and if
|
||||
/etc/sysconfig/console:CONSOLE_FONT (resp
|
||||
/etc/sysconfig/keyboard:KEYTABLE) set, console font (resp
|
||||
keymap) is not modified.
|
||||
- Changes from version 44 to 193:
|
||||
+ journalctl gained --cursor= to show entries starting from a
|
||||
specified location in journal.
|
||||
+ Size limit enforced to 4K for fields exported with "-o json" in
|
||||
journalctl. Use --all to disable this behavior.
|
||||
+ Optional journal gateway daemon
|
||||
(systemd-journal-gatewayd.service) to access journal via HTTP
|
||||
and JSON. Use "wget http://localhost:19531/entries" to get
|
||||
/var/log/messages compatible format and
|
||||
'curl -H"Accept: application/json"
|
||||
http://localhost:19531/entries' for JSON formatted content.
|
||||
HTML5 static page is also available as explained on
|
||||
http://0pointer.de/public/journal-gatewayd
|
||||
+ do not mount cpuset controler, doesn't work well by default
|
||||
ATM.
|
||||
+ improved nspawn behaviour with /etc/localtime
|
||||
+ journald logs its maximize size on disk
|
||||
+ multi-seat X wrapper (partially merged in upstream X server).
|
||||
+ HandleSleepKey has been splitted into HandleSuspendKey and
|
||||
HandleHibernateKey.
|
||||
+ systemd and logind now handle system sleep states, in
|
||||
particular suspending and hibernating.
|
||||
+ new cgroups are mounted by default (cpu, cpuacct,
|
||||
net_cls, net_pri)
|
||||
+ sync at shutdown is now handled by kernel
|
||||
+ imported journalctl output (colors, filtering, pager, bash
|
||||
completion).
|
||||
+ suffix ".service" may now be ommited on most systemctl command
|
||||
involving service unit names.
|
||||
+ much improved nspawn containers support.
|
||||
+ new conditions added : ConditionFileNotEmpty, ConditionHost,
|
||||
ConditionPathIsReadWrite
|
||||
+ tmpfiles "w" supports file globbing
|
||||
+ logind handles lid switch, power and sleep keys all the time,
|
||||
unless systemd-inhibit
|
||||
--what=handle-power-key:handle-sleep-key:handle-lid-switch is
|
||||
run by Desktop Environments.
|
||||
+ support for reading structured kernel message is used by
|
||||
default (need kernel >= 3.5). /proc/kmsg is now used only by
|
||||
classic syslog daemons.
|
||||
+ Forward Secure Sealing is now support for Journal files.
|
||||
+ RestartPrevenExitStatus and SuccessExitStatus allow configure
|
||||
of exit status (exit code or signal).
|
||||
+ handles keyfile-size and keyfile-offset in /etc/crypttab.
|
||||
+ TimeoutSec settings has been splitted into TimeoutStartSec and
|
||||
TimeoutStopSec.
|
||||
+ add SystemCallFilters option to add blacklist/whitelist to
|
||||
system calls, using SECCOMP mode 2 of kernel >= 3.5.
|
||||
+ systemctl udevadm info now takes a /dev or /sys path as argument:
|
||||
- udevadm info /dev/sda
|
||||
+ XDG_RUNTIME_DIR now uses numeric UIDs instead of usernames.
|
||||
+ systemd-loginctl and systemd-journalctl have been renamed
|
||||
to loginctl and journalctl to match systemctl.
|
||||
+ udev: RUN+="socket:..." and udev_monitor_new_from_socket() is
|
||||
no longer supported. udev_monitor_new_from_netlink() needs to
|
||||
be used to subscribe to events.
|
||||
+ udev: when udevd is started by systemd, processes which are left
|
||||
behind by forking them off of udev rules, are unconditionally
|
||||
cleaned up and killed now after the event handling has finished.
|
||||
Services or daemons must be started as systemd services.
|
||||
Services can be pulled-in by udev to get started, but they can
|
||||
no longer be directly forked by udev rules.
|
||||
+ For almost all files, license is now LGPL2.1+ (from previous
|
||||
GPL2.0+). Exception are some minor stuff in udev (will be
|
||||
changed to LGPL2.1 eventually) and MIT license sd-daemon.[ch]
|
||||
library.
|
||||
+ var-run.mount and var-lock.mount are no longer provided
|
||||
(should be converted to symlinks).
|
||||
+ A new service type Type=idle to avoid ugly interleaving of
|
||||
getty output and boot status messages.
|
||||
+ systemd-delta has been added, a tool to explore differences
|
||||
between user/admin configuration and vendor defaults.
|
||||
+ /tmp mouted as tmpfs by default.
|
||||
+ /media is now longer mounted as tmpfs
|
||||
+ GTK tool has been split off to systemd-ui package.
|
||||
+ much improved documentation.
|
||||
- Merge BuildRequires from udev package:
|
||||
gobject-introspection-devel, gtk-doc, libsepol-devel,
|
||||
libusb-devel, pkgconfig(blkid), pkgconfig-glib-2.0),
|
||||
pjgconfig(libcryptsetup), pkgconfig(libpci),
|
||||
pkgconfig(libqrencode), pkgconfig(libselinux),
|
||||
pkgconfig(usbutils).
|
||||
- Add pkgconfig(libqrencode) and pkgconfig(libmicrohttpd)
|
||||
- Merge sources from udev package: boot.udev, write_dev_root.rules,
|
||||
udev-root-symlink.systemd.
|
||||
- Merge patches from udev package: numbered started from 1000):
|
||||
0001-Reinstate-TIMEOUT-handling.patch,
|
||||
0013-re-enable-by_path-links-for-ata-devices.patch,
|
||||
0014-rules-create-by-id-scsi-links-for-ATA-devices.patch,
|
||||
0026-udev-netlink-null-rules.patch,
|
||||
0027-udev-fix-sg-autoload-regression.patch.
|
||||
- Remove following patches, merged upstream:
|
||||
0001-util-never-follow-symlinks-in-rm_rf_children.patch,
|
||||
fixppc.patch, logind-logout.patch, fix-getty-isolate.patch,
|
||||
fix-swap-priority.patch, improve-restart-behaviour.patch,
|
||||
fix-dir-noatime-tmpfiles.patch, journal-bugfixes.patch,
|
||||
ulimit-support.patch, change-terminal.patch,
|
||||
fix-tty-startup.patch, fix-write-user-state-file.patch,
|
||||
fix-analyze-exception.patch, use_localtime.patch,
|
||||
journalctl-pager-improvement.patch,
|
||||
avoid-random-seed-cycle.patch,
|
||||
0001-add-sparse-support-to-detect-endianness-bug.patch,
|
||||
drop-timezone.patch.
|
||||
- Rebase the following patches:
|
||||
0001-Add-bootsplash-handling-for-password-dialogs.patch,
|
||||
0001-handle-disable_caplock-and-compose_table-and-kbd_rat.patch,
|
||||
0001-service-Fix-dependencies-added-when-parsing-insserv..patch,
|
||||
0001-service-flags-sysv-service-with-detected-pid-as-Rema.patch,
|
||||
crypt-loop-file.patch,
|
||||
delay-fsck-cryptsetup-after-md-lvm-dmraid.patch,
|
||||
dm-lvm-after-local-fs-pre-target.patch, fastboot-forcefsck.patch,
|
||||
fix-enable-disable-boot-initscript.patch, modules_on_boot.patch,
|
||||
new-lsb-headers.patch, storage-after-cryptsetup.patch,
|
||||
support-suse-clock-sysconfig.patch, support-sysvinit.patch,
|
||||
sysctl-modules.patch, systemd-numlock-suse.patch, tty1.patch.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Aug 23 11:11:25 CEST 2012 - fcrozat@suse.com
|
||||
|
||||
|
645
systemd.spec
645
systemd.spec
@ -16,51 +16,90 @@
|
||||
#
|
||||
|
||||
|
||||
%define bootstrap 0
|
||||
%define real systemd
|
||||
%define udevpkgname udev
|
||||
%define udev_major 1
|
||||
|
||||
Name: systemd
|
||||
Url: http://www.freedesktop.org/wiki/Software/systemd
|
||||
Version: 44
|
||||
Version: 195
|
||||
Release: 0
|
||||
Summary: A System and Session Manager
|
||||
License: GPL-2.0+
|
||||
License: LGPL-2.1+
|
||||
Group: System/Base
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
BuildRequires: audit-devel
|
||||
BuildRequires: dbus-1
|
||||
%if ! 0%{?bootstrap}
|
||||
BuildRequires: docbook-xsl-stylesheets
|
||||
%endif
|
||||
BuildRequires: fdupes
|
||||
%if ! 0%{?bootstrap}
|
||||
BuildRequires: gobject-introspection-devel
|
||||
%endif
|
||||
BuildRequires: gperf
|
||||
%if ! 0%{?bootstrap}
|
||||
BuildRequires: gtk-doc
|
||||
%endif
|
||||
BuildRequires: intltool
|
||||
BuildRequires: libacl-devel
|
||||
BuildRequires: libcap-devel
|
||||
BuildRequires: libsepol-devel
|
||||
BuildRequires: libtool
|
||||
BuildRequires: libusb-devel
|
||||
%if ! 0%{?bootstrap}
|
||||
BuildRequires: libxslt-tools
|
||||
%endif
|
||||
BuildRequires: pam-devel
|
||||
BuildRequires: pkg-config
|
||||
BuildRequires: tcpd-devel
|
||||
BuildRequires: udev
|
||||
BuildRequires: xz
|
||||
BuildRequires: pkgconfig(blkid) >= 2.20
|
||||
BuildRequires: pkgconfig(dbus-1) >= 1.3.2
|
||||
BuildRequires: pkgconfig(libcryptsetup)
|
||||
%if ! 0%{?bootstrap}
|
||||
BuildRequires: pkgconfig(glib-2.0) >= 2.22.0
|
||||
BuildRequires: pkgconfig(libcryptsetup) >= 1.4.2
|
||||
%endif
|
||||
BuildRequires: pkgconfig(libkmod) >= 5
|
||||
BuildRequires: pkgconfig(liblzma)
|
||||
BuildRequires: pkgconfig(libselinux)
|
||||
%if ! 0%{?bootstrap}
|
||||
BuildRequires: pkgconfig(libmicrohttpd)
|
||||
%endif
|
||||
BuildRequires: pkgconfig(libpci) >= 3
|
||||
%if ! 0%{?bootstrap}
|
||||
BuildRequires: pkgconfig(libqrencode)
|
||||
%endif
|
||||
BuildRequires: pkgconfig(libselinux) >= 2.1.9
|
||||
BuildRequires: pkgconfig(libsepol)
|
||||
BuildRequires: pkgconfig(udev) >= 172
|
||||
BuildRequires: pkgconfig(usbutils) >= 0.82
|
||||
%if 0%{?bootstrap}
|
||||
Requires: this-is-only-for-build-envs
|
||||
%else
|
||||
# the buildignore is important for bootstrapping
|
||||
#!BuildIgnore: udev
|
||||
Requires: %{udevpkgname} >= 172
|
||||
Requires: dbus-1 >= 1.4.0
|
||||
Requires: kbd
|
||||
Requires: pam-config >= 0.79-5
|
||||
Requires: systemd-presets-branding
|
||||
Requires: udev >= 172
|
||||
Requires: util-linux >= 2.21
|
||||
Requires(post): coreutils
|
||||
Requires(post): findutils
|
||||
%endif
|
||||
Conflicts: filesystem < 11.5
|
||||
Conflicts: mkinitrd < 2.7.0
|
||||
Source0: http://www.freedesktop.org/software/systemd/%{name}-%{version}.tar.xz
|
||||
Source0: http://www.freedesktop.org/software/systemd/systemd-%{version}.tar.xz
|
||||
Source1: systemd-rpmlintrc
|
||||
Source2: localfs.service
|
||||
Source3: systemd-sysv-convert
|
||||
Source4: macros.systemd
|
||||
Source5: systemd-insserv_conf
|
||||
Source6: baselibs.conf
|
||||
|
||||
Source1060: boot.udev
|
||||
Source1061: write_dev_root_rule
|
||||
Source1062: udev-root-symlink.systemd
|
||||
|
||||
Patch1: 0001-Add-bootsplash-handling-for-password-dialogs.patch
|
||||
# handle SUSE specific kbd settings
|
||||
Patch6: 0001-handle-disable_caplock-and-compose_table-and-kbd_rat.patch
|
||||
@ -71,7 +110,6 @@ Patch10: 0001-service-Fix-dependencies-added-when-parsing-insserv..patch
|
||||
Patch13: 0001-service-flags-sysv-service-with-detected-pid-as-Rema.patch
|
||||
Patch15: support-sysvinit.patch
|
||||
Patch16: modules_on_boot.patch
|
||||
Patch19: avoid-random-seed-cycle.patch
|
||||
Patch22: new-lsb-headers.patch
|
||||
Patch23: storage-after-cryptsetup.patch
|
||||
Patch24: delay-fsck-cryptsetup-after-md-lvm-dmraid.patch
|
||||
@ -79,31 +117,30 @@ Patch31: lock-opensuse.patch
|
||||
Patch33: crypt-loop-file.patch
|
||||
Patch36: sysctl-modules.patch
|
||||
Patch38: dm-lvm-after-local-fs-pre-target.patch
|
||||
Patch41: 0001-add-sparse-support-to-detect-endianness-bug.patch
|
||||
Patch53: fastboot-forcefsck.patch
|
||||
Patch56: support-suse-clock-sysconfig.patch
|
||||
Patch57: drop-timezone.patch
|
||||
Patch59: fix-enable-disable-boot-initscript.patch
|
||||
Patch60: var-run-lock.patch
|
||||
|
||||
# Upstream First - Policy:
|
||||
# Never add any patches to this package without the upstream commit id
|
||||
# in the patch. Any patches added here without a very good reason to make
|
||||
# an exception will be silently removed with the next version update.
|
||||
Patch40: 0001-util-never-follow-symlinks-in-rm_rf_children.patch
|
||||
Patch42: fixppc.patch
|
||||
Patch43: logind-logout.patch
|
||||
Patch44: fix-getty-isolate.patch
|
||||
Patch45: fix-swap-priority.patch
|
||||
Patch46: improve-restart-behaviour.patch
|
||||
Patch47: fix-dir-noatime-tmpfiles.patch
|
||||
Patch48: journal-bugfixes.patch
|
||||
Patch49: ulimit-support.patch
|
||||
Patch50: change-terminal.patch
|
||||
Patch51: fix-tty-startup.patch
|
||||
Patch52: fix-write-user-state-file.patch
|
||||
Patch54: fix-analyze-exception.patch
|
||||
Patch55: use_localtime.patch
|
||||
Patch58: journalctl-pager-improvement.patch
|
||||
|
||||
# udev patches
|
||||
# PATCH-FIX-OPENSUSE 0001-Reinstate-TIMEOUT-handling.patch
|
||||
Patch1001: 0001-Reinstate-TIMEOUT-handling.patch
|
||||
# PATCH-FIX-OPENSUSE 0013-re-enable-by_path-links-for-ata-devices.patch
|
||||
Patch1013: 0013-re-enable-by_path-links-for-ata-devices.patch
|
||||
# PATCH-FIX-OPENSUSE 0014-rules-create-by-id-scsi-links-for-ATA-devices.patch
|
||||
Patch1014: 0014-rules-create-by-id-scsi-links-for-ATA-devices.patch
|
||||
|
||||
# PATCH-FIX-OPENSUSE 0026-udev-netlink-null-rules.patch
|
||||
Patch1026: 0026-udev-netlink-null-rules.patch
|
||||
# PATCH-FIX-OPENSUSE 0027-udev-fix-sg-autoload-regression.patch
|
||||
Patch1027: 0027-udev-fix-sg-autoload-regression.patch
|
||||
|
||||
# systemd patches
|
||||
|
||||
%description
|
||||
Systemd is a system and service manager, compatible with SysV and LSB
|
||||
@ -115,17 +152,20 @@ maintains mount and automount points and implements an elaborate
|
||||
transactional dependency-based service control logic. It can work as a
|
||||
drop-in replacement for sysvinit.
|
||||
|
||||
|
||||
|
||||
%package devel
|
||||
Summary: Development headers for systemd
|
||||
License: LGPL-2.1+
|
||||
Group: Development/Libraries/C and C++
|
||||
Requires: %{name} = %{version}
|
||||
Requires: pkg-config
|
||||
|
||||
%description devel
|
||||
Development headers and auxiliary files for developing applications for systemd.
|
||||
|
||||
%package sysvinit
|
||||
Summary: System V init tools
|
||||
License: LGPL-2.1+
|
||||
Group: System/Base
|
||||
Requires: %{name} = %{version}
|
||||
Provides: sbin_init
|
||||
@ -137,6 +177,7 @@ Drop-in replacement of System V init tools.
|
||||
|
||||
%package analyze
|
||||
Summary: Tool for processing systemd profiling information
|
||||
License: LGPL-2.1+
|
||||
Group: System/Base
|
||||
Requires: %{name} = %{version}
|
||||
Requires: dbus-1-python
|
||||
@ -150,17 +191,110 @@ initialization at boot.
|
||||
'systemd-analyze plot' renders an SVG visualizing the parallel start of units
|
||||
at boot.
|
||||
|
||||
%package -n %{udevpkgname}
|
||||
Summary: A rule-based device node and kernel event manager
|
||||
License: GPL-2.0
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html
|
||||
PreReq: /bin/pidof /bin/rm /usr/bin/stat %insserv_prereq %fillup_prereq /usr/sbin/groupadd /usr/bin/getent /sbin/mkinitrd
|
||||
Conflicts: systemd < 39
|
||||
Conflicts: aaa_base < 11.5
|
||||
Conflicts: filesystem < 11.5
|
||||
Conflicts: mkinitrd < 2.7.0
|
||||
Conflicts: util-linux < 2.16
|
||||
Conflicts: ConsoleKit < 0.4.1
|
||||
Requires: filesystem
|
||||
%if 0%{?bootstrap}
|
||||
Provides: udev = %{version}
|
||||
%endif
|
||||
|
||||
%description -n %{udevpkgname}
|
||||
Udev creates and removes device nodes in /dev for devices discovered or
|
||||
removed from the system. It receives events via kernel netlink messages
|
||||
and dispatches them according to rules in /lib/udev/rules.d/. Matching
|
||||
rules may name a device node, create additional symlinks to the node,
|
||||
call tools to initialize a device, or load needed kernel modules.
|
||||
|
||||
|
||||
|
||||
%package -n lib%{udevpkgname}%{udev_major}
|
||||
Summary: Dynamic library to access udev device information
|
||||
License: LGPL-2.1+
|
||||
Group: System/Libraries
|
||||
Requires: %{udevpkgname} >= %{version}-%{release}
|
||||
|
||||
%description -n lib%{udevpkgname}%{udev_major}
|
||||
This package contains the dynamic library libudev, which provides
|
||||
access to udev device information
|
||||
|
||||
%package -n lib%{udevpkgname}-devel
|
||||
Summary: Development files for libudev
|
||||
License: LGPL-2.1+
|
||||
Group: Development/Libraries/Other
|
||||
Requires: lib%{udevpkgname}%{udev_major} = %{version}-%{release}
|
||||
%if 0%{?bootstrap}
|
||||
Provides: libudev-devel = %{version}
|
||||
%endif
|
||||
|
||||
%description -n lib%{udevpkgname}-devel
|
||||
This package contains the development files for the library libudev, a
|
||||
dynamic library, which provides access to udev device information.
|
||||
|
||||
%if ! 0%{?bootstrap}
|
||||
%package -n libgudev-1_0-0
|
||||
Summary: GObject library, to access udev device information
|
||||
License: LGPL-2.1+
|
||||
Group: System/Libraries
|
||||
Requires: lib%{udevpkgname}%{udev_major} = %{version}-%{release}
|
||||
|
||||
%description -n libgudev-1_0-0
|
||||
This package contains the GObject library libgudev, which provides
|
||||
access to udev device information.
|
||||
|
||||
%package -n typelib-1_0-GUdev-1_0
|
||||
Summary: GObject library, to access udev device information -- Introspection bindings
|
||||
License: LGPL-2.1+
|
||||
Group: System/Libraries
|
||||
|
||||
%description -n typelib-1_0-GUdev-1_0
|
||||
This package provides the GObject Introspection bindings for libgudev, which
|
||||
provides access to udev device information.
|
||||
|
||||
%package -n libgudev-1_0-devel
|
||||
Summary: Devel package for libgudev
|
||||
License: LGPL-2.1+
|
||||
Group: Development/Libraries/Other
|
||||
Requires: glib2-devel
|
||||
Requires: libgudev-1_0-0 = %{version}-%{release}
|
||||
Requires: libudev-devel = %{version}-%{release}
|
||||
Requires: typelib-1_0-GUdev-1_0 = %{version}-%{release}
|
||||
|
||||
%description -n libgudev-1_0-devel
|
||||
This is the devel package for the GObject library libgudev, which
|
||||
provides GObject access to udev device information.
|
||||
%endif
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%setup -q -n systemd-%{version}
|
||||
|
||||
#udev
|
||||
%patch1001 -p1
|
||||
%patch1013 -p1
|
||||
%patch1014 -p1
|
||||
%patch1026 -p1
|
||||
%patch1027 -p1
|
||||
|
||||
%patch1 -p1
|
||||
%patch6 -p1
|
||||
# don't apply when bootstrapping to not modify configure.in
|
||||
%if ! 0%{?bootstrap}
|
||||
%patch7 -p1
|
||||
%endif
|
||||
%patch8 -p1
|
||||
%patch10 -p1
|
||||
%patch13 -p1
|
||||
%patch15 -p1
|
||||
%patch16 -p1
|
||||
%patch19 -p1
|
||||
%patch22 -p1
|
||||
%patch23 -p1
|
||||
%patch24 -p1
|
||||
@ -168,99 +302,102 @@ at boot.
|
||||
%patch33 -p1
|
||||
%patch36 -p1
|
||||
%patch38 -p1
|
||||
%patch40 -p1
|
||||
%patch41 -p1
|
||||
%patch42 -p1
|
||||
# this one causes too many trouble for now, disabling (bnc#769531)
|
||||
#patch43 -p1
|
||||
%patch44 -p1
|
||||
%patch45 -p1
|
||||
%patch46 -p1
|
||||
%patch47 -p1
|
||||
%patch48 -p1
|
||||
%patch49 -p1
|
||||
%patch50 -p1
|
||||
%patch51 -p1
|
||||
%patch52 -p1
|
||||
%patch53 -p1
|
||||
%patch54 -p1
|
||||
%patch55 -p1
|
||||
%patch56 -p1
|
||||
%patch57 -p1
|
||||
%patch58 -p1
|
||||
%patch59 -p1
|
||||
|
||||
#needed by patch49
|
||||
rm man/systemd.conf.5
|
||||
%patch60 -p1
|
||||
|
||||
%build
|
||||
%if ! 0%{?bootstrap}
|
||||
autoreconf -fiv
|
||||
%endif
|
||||
# prevent pre-generated and distributed files from re-building
|
||||
find . -name "*.[1-8]" -exec touch '{}' \;
|
||||
touch src/systemadm.c
|
||||
export V=1
|
||||
# disable plymouth at configure time, units are shipped in plymouth package now
|
||||
# keep split-usr until all packages have moved their systemd rules to /usr
|
||||
%configure \
|
||||
--with-distro=suse \
|
||||
--docdir=%{_docdir}/systemd \
|
||||
--with-rootprefix= \
|
||||
--with-pamlibdir=/%{_lib}/security \
|
||||
--enable-split-usr \
|
||||
--disable-gtk \
|
||||
%if 0%{?bootstrap}
|
||||
--disable-gudev \
|
||||
%else
|
||||
--enable-manpages \
|
||||
--disable-plymouth \
|
||||
--enable-gtk-doc \
|
||||
%endif
|
||||
--enable-selinux \
|
||||
--enable-split-usr \
|
||||
--disable-static \
|
||||
CFLAGS="%{optflags}"
|
||||
make %{?_smp_mflags}
|
||||
|
||||
%install
|
||||
%makeinstall
|
||||
|
||||
mkdir -p $RPM_BUILD_ROOT/{sbin,lib,bin}
|
||||
ln -sf %{_bindir}/udevadm $RPM_BUILD_ROOT/sbin/udevadm
|
||||
ln -sf %{_bindir}/systemd-ask-password $RPM_BUILD_ROOT/bin/systemd-ask-password
|
||||
ln -sf %{_bindir}/systemctl $RPM_BUILD_ROOT/bin/systemctl
|
||||
ln -sf %{_prefix}/lib/systemd/systemd-udevd $RPM_BUILD_ROOT/sbin/udevd
|
||||
mkdir -p $RPM_BUILD_ROOT/%{_prefix}/usr/lib/firmware/updates
|
||||
ln -sf /lib/firmware $RPM_BUILD_ROOT/usr/lib/firmware
|
||||
|
||||
install -m755 -D %{S:1060} $RPM_BUILD_ROOT/etc/init.d/boot.udev
|
||||
install -m755 -D %{S:1061} $RPM_BUILD_ROOT/%{_prefix}/lib/udev/write_dev_root_rule
|
||||
install -m644 -D %{S:1062} $RPM_BUILD_ROOT/%{_prefix}/lib/systemd/system/udev-root-symlink.service
|
||||
mkdir -p $RPM_BUILD_ROOT/lib/systemd/system/basic.target.wants
|
||||
ln -sf ../udev-root-symlink.service $RPM_BUILD_ROOT/%{_prefix}/lib/systemd/system/basic.target.wants
|
||||
|
||||
#fix manpages
|
||||
%if ! 0%{?bootstrap}
|
||||
sed -i -e 's,^\(\.so \)\(.*\.\)\([0-9]\),\1man\3/\2\3,g' %{buildroot}/%{_mandir}/*/*
|
||||
%endif
|
||||
|
||||
#workaround for 716939
|
||||
chmod 644 %{buildroot}%{_bindir}/systemd-analyze
|
||||
mkdir -p %{buildroot}%{_sysconfdir}/rpm
|
||||
install -m644 %{S:4} %{buildroot}%{_sysconfdir}/rpm
|
||||
find %{buildroot} -type f -name '*.la' -exec rm -f {} ';'
|
||||
mkdir -p %{buildroot}/{sbin,var/lib/systemd/sysv-convert,var/lib/systemd/migrated} %{buildroot}/lib/systemd/{system.preset,user.preset,system/halt.target.wants,system/kexec.target.wants,system/poweroff.target.wants,system/reboot.target.wants}
|
||||
mkdir -p %{buildroot}/{sbin,var/lib/systemd/sysv-convert,var/lib/systemd/migrated} %{buildroot}/usr/lib/systemd/{system-generators,user-generators,system-preset,user-preset,system/halt.target.wants,system/kexec.target.wants,system/poweroff.target.wants,system/reboot.target.wants}
|
||||
|
||||
install -m755 %{S:3} -D %{buildroot}%{_sbindir}/systemd-sysv-convert
|
||||
# do not install, code has been fixed, might be useful in the future
|
||||
#install -m755 %{S:5} %{buildroot}/lib/systemd/system-generators
|
||||
ln -s ../lib/systemd/systemd %{buildroot}/bin/systemd
|
||||
ln -s ../lib/systemd/systemd %{buildroot}/sbin/init
|
||||
ln -s ../bin/systemctl %{buildroot}/sbin/reboot
|
||||
ln -s ../bin/systemctl %{buildroot}/sbin/halt
|
||||
ln -s ../bin/systemctl %{buildroot}/sbin/shutdown
|
||||
ln -s ../bin/systemctl %{buildroot}/sbin/poweroff
|
||||
ln -s ../bin/systemctl %{buildroot}/sbin/telinit
|
||||
ln -s ../bin/systemctl %{buildroot}/sbin/runlevel
|
||||
ln -s ../usr/lib/systemd/systemd %{buildroot}/bin/systemd
|
||||
ln -s ../usr/lib/systemd/systemd %{buildroot}/sbin/init
|
||||
ln -s ../usr/bin/systemctl %{buildroot}/sbin/reboot
|
||||
ln -s ../usr/bin/systemctl %{buildroot}/sbin/halt
|
||||
ln -s ../usr/bin/systemctl %{buildroot}/sbin/shutdown
|
||||
ln -s ../usr/bin/systemctl %{buildroot}/sbin/poweroff
|
||||
ln -s ../usr/bin/systemctl %{buildroot}/sbin/telinit
|
||||
ln -s ../usr/bin/systemctl %{buildroot}/sbin/runlevel
|
||||
rm -rf %{buildroot}/etc/systemd/system/*.target.wants
|
||||
rm -f %{buildroot}/etc/systemd/system/default.target
|
||||
# aliases for /etc/init.d/*
|
||||
ln -s /dev/null %{buildroot}/lib/systemd/system/cgroup.service
|
||||
ln -s systemd-tmpfiles-setup.service %{buildroot}/lib/systemd/system/cleanup.service
|
||||
ln -s /dev/null %{buildroot}/lib/systemd/system/clock.service
|
||||
ln -s /dev/null %{buildroot}/lib/systemd/system/crypto.service
|
||||
ln -s /dev/null %{buildroot}/lib/systemd/system/crypto-early.service
|
||||
ln -s /dev/null %{buildroot}/lib/systemd/system/device-mapper.service
|
||||
ln -s /dev/null %{buildroot}/lib/systemd/system/earlysyslog.service
|
||||
ln -s /dev/null %{buildroot}/lib/systemd/system/kbd.service
|
||||
ln -s /dev/null %{buildroot}/lib/systemd/system/ldconfig.service
|
||||
ln -s /dev/null %{buildroot}/lib/systemd/system/loadmodules.service
|
||||
install -m644 %{S:2} %{buildroot}/lib/systemd/system/localfs.service
|
||||
ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/cgroup.service
|
||||
ln -s systemd-tmpfiles-setup.service %{buildroot}/%{_prefix}/lib/systemd/system/cleanup.service
|
||||
ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/clock.service
|
||||
ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/crypto.service
|
||||
ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/crypto-early.service
|
||||
ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/device-mapper.service
|
||||
ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/earlysyslog.service
|
||||
ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/kbd.service
|
||||
ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/ldconfig.service
|
||||
ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/loadmodules.service
|
||||
install -m644 %{S:2} %{buildroot}/%{_prefix}/lib/systemd/system/localfs.service
|
||||
# need to be implemented in systemd directly
|
||||
#ln -s /dev/null %{buildroot}/lib/systemd/system/localnet.service
|
||||
ln -s /dev/null %{buildroot}/lib/systemd/system/proc.service
|
||||
ln -s fsck-root.service %{buildroot}/lib/systemd/system/rootfsck.service
|
||||
ln -s /dev/null %{buildroot}/lib/systemd/system/single.service
|
||||
ln -s /dev/null %{buildroot}/lib/systemd/system/swap.service
|
||||
ln -s /dev/null %{buildroot}/lib/systemd/system/startpreload.service
|
||||
ln -s /dev/null %{buildroot}/lib/systemd/system/stoppreload.service
|
||||
ln -s /dev/null %{buildroot}/lib/systemd/system/earlyxdm.service
|
||||
ln -s systemd-sysctl.service %{buildroot}/lib/systemd/system/sysctl.service
|
||||
ln -s systemd-random-seed-load.service %{buildroot}/lib/systemd/system/random.service
|
||||
#ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/localnet.service
|
||||
ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/proc.service
|
||||
ln -s systemd-fsck-root.service %{buildroot}/%{_prefix}/lib/systemd/system/rootfsck.service
|
||||
ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/single.service
|
||||
ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/swap.service
|
||||
ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/startpreload.service
|
||||
ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/stoppreload.service
|
||||
ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/earlyxdm.service
|
||||
ln -s systemd-sysctl.service %{buildroot}/%{_prefix}/lib/systemd/system/sysctl.service
|
||||
ln -s systemd-random-seed-load.service %{buildroot}/%{_prefix}/lib/systemd/system/random.service
|
||||
# don't mount /tmp as tmpfs for now
|
||||
rm %{buildroot}/%{_prefix}/lib/systemd/system/local-fs.target.wants/tmp.mount
|
||||
|
||||
# To avoid making life hard for Factory developers, don't package the
|
||||
# kernel.core_pattern setting until systemd-coredump is a part of an actual
|
||||
@ -268,42 +405,66 @@ ln -s systemd-random-seed-load.service %{buildroot}/lib/systemd/system/random.se
|
||||
# journal.
|
||||
rm -f %{buildroot}%{_libdir}/../lib/sysctl.d/coredump.conf
|
||||
|
||||
# Let rsyslog read from /proc/kmsg for now
|
||||
sed -i -e 's/\#ImportKernel=yes/ImportKernel=no/' %{buildroot}%{_sysconfdir}/systemd/systemd-journald.conf
|
||||
# remove README files for now
|
||||
rm -f %{buildroot}/var/log/README %{buildroot}/etc/init.d/README
|
||||
|
||||
# legacy links
|
||||
ln -s loginctl %{buildroot}%{_bindir}/systemd-loginctl
|
||||
ln -s journalctl %{buildroot}%{_bindir}/systemd-journalctl
|
||||
ln -s /usr/lib/udev %{buildroot}/lib/udev
|
||||
|
||||
# Create the /var/log/journal directory to change the volatile journal to a persistent one
|
||||
mkdir -p %{buildroot}/var/log/journal
|
||||
|
||||
%fdupes $RPM_BUILD_ROOT
|
||||
# Make sure the NTP units dir exists
|
||||
mkdir -p %{buildroot}%{_prefix}/lib/systemd/ntp-units.d/
|
||||
|
||||
# Make sure the shutdown/sleep drop-in dirs exist
|
||||
mkdir -p %{buildroot}%{_prefix}/lib/systemd/system-shutdown/
|
||||
mkdir -p %{buildroot}%{_prefix}/lib/systemd/system-sleep/
|
||||
|
||||
# Make sure these directories are properly owned
|
||||
mkdir -p %{buildroot}%{_prefix}/lib/systemd/system/default.target.wants
|
||||
mkdir -p %{buildroot}%{_prefix}/lib/systemd/system/dbus.target.wants
|
||||
mkdir -p %{buildroot}%{_prefix}/lib/systemd/system/syslog.target.wants
|
||||
|
||||
%fdupes -s %{buildroot}%{_mandir}
|
||||
|
||||
%post
|
||||
/usr/sbin/pam-config -a --systemd >/dev/null 2>&1 || :
|
||||
/sbin/ldconfig
|
||||
/bin/systemd-machine-id-setup >/dev/null 2>&1 || :
|
||||
/bin/systemctl daemon-reexec >/dev/null 2>&1 || :
|
||||
/usr/bin/systemd-machine-id-setup >/dev/null 2>&1 || :
|
||||
/usr/bin/systemctl daemon-reexec >/dev/null 2>&1 || :
|
||||
|
||||
# Try to read default runlevel from the old inittab if it exists
|
||||
if [ ! -e /etc/systemd/system/default.target ]; then
|
||||
if [ ! -e /etc/systemd/system/default.target -a -e /etc/inittab ]; then
|
||||
runlevel=$(awk -F ':' '$3 == "initdefault" && $1 !~ "^#" { print $2 }' /etc/inittab 2> /dev/null)
|
||||
if [ -n "$runlevel" ] ; then
|
||||
/bin/ln -sf /lib/systemd/system/runlevel$runlevel.target /etc/systemd/system/default.target 2>&1 || :
|
||||
/bin/ln -sf /usr/lib/systemd/system/runlevel$runlevel.target /etc/systemd/system/default.target 2>&1 || :
|
||||
fi
|
||||
fi
|
||||
# Create default config in /etc at first install.
|
||||
# Later package updates should not overwrite these settings.
|
||||
if [ "$1" -eq 1 ]; then
|
||||
# Enable these services by default.
|
||||
/bin/systemctl enable \
|
||||
/usr/bin/systemctl enable \
|
||||
getty@.service \
|
||||
systemd-readahead-collect.service \
|
||||
systemd-readahead-replay.service \
|
||||
remote-fs.target >/dev/null 2>&1 || :
|
||||
else
|
||||
# migrate any symlink which may refer to the old path
|
||||
for f in $(find /etc/systemd/system -type l -xtype l); do
|
||||
new_target="/usr$(readlink $f)"
|
||||
[ -f "$new_target" ] && ln -s -f $new_target $f || :
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
%postun
|
||||
/sbin/ldconfig
|
||||
if [ $1 -ge 1 ]; then
|
||||
/bin/systemctl try-restart systemd-logind.service >/dev/null 2>&1 || :
|
||||
/usr/bin/systemctl try-restart systemd-logind.service >/dev/null 2>&1 || :
|
||||
fi
|
||||
if [ $1 -eq 0 ]; then
|
||||
/usr/sbin/pam-config -d --systemd >/dev/null 2>&1 || :
|
||||
@ -311,7 +472,7 @@ fi
|
||||
|
||||
%preun
|
||||
if [ $1 -eq 0 ]; then
|
||||
/bin/systemctl disable \
|
||||
/usr/bin/systemctl disable \
|
||||
getty@.service \
|
||||
systemd-readahead-collect.service \
|
||||
systemd-readahead-replay.service \
|
||||
@ -319,22 +480,95 @@ if [ $1 -eq 0 ]; then
|
||||
rm -f /etc/systemd/system/default.target 2>&1 || :
|
||||
fi
|
||||
|
||||
%pretrans -n %{udevpkgname} -p <lua>
|
||||
if posix.stat("/lib/udev") and not posix.stat("/usr/lib/udev") then
|
||||
posix.symlink("/lib/udev", "/usr/lib/udev")
|
||||
end
|
||||
|
||||
%pre -n %{udevpkgname}
|
||||
if test -L /usr/lib/udev -a /lib/udev -ef /usr/lib/udev ; then
|
||||
rm /usr/lib/udev
|
||||
mv /lib/udev /usr/lib
|
||||
ln -s /usr/lib/udev /lib/udev
|
||||
fi
|
||||
|
||||
%post -n %{udevpkgname}
|
||||
%{fillup_and_insserv -Y boot.udev}
|
||||
# add KERNEL name match to existing persistent net rules
|
||||
sed -ri '/KERNEL/ ! { s/NAME="(eth|wlan|ath)([0-9]+)"/KERNEL=="\1*", NAME="\1\2"/}' \
|
||||
/etc/udev/rules.d/70-persistent-net.rules >/dev/null 2>&1 || :
|
||||
# cleanup old stuff
|
||||
rm -f /etc/sysconfig/udev
|
||||
rm -f /etc/udev/rules.d/20-cdrom.rules
|
||||
rm -f /etc/udev/rules.d/55-cdrom.rules
|
||||
rm -f /etc/udev/rules.d/65-cdrom.rules
|
||||
/usr/bin/systemctl daemon-reload >/dev/null 2>&1 || :
|
||||
# start daemon if we are not in a chroot
|
||||
if test -f /proc/1/exe -a -d /proc/1/root; then
|
||||
if test "$(stat -Lc '%%D-%%i' /)" = "$(stat -Lc '%%D-%%i' /proc/1/root)"; then
|
||||
/usr/bin/systemctl start systemd-udevd.service >/dev/null 2>&1 || :
|
||||
/usr/lib/systemd/systemd-udevd --daemon >/dev/null 2>&1 || :
|
||||
fi
|
||||
fi
|
||||
|
||||
[ -x /sbin/mkinitrd_setup ] && /sbin/mkinitrd_setup
|
||||
if [ -e /var/lib/no_initrd_recreation_by_suspend ]; then
|
||||
echo "Skipping recreation of existing initial ramdisks, due"
|
||||
echo "to presence of /var/lib/no_initrd_recreation_by_suspend"
|
||||
elif [ -x /sbin/mkinitrd ]; then
|
||||
/sbin/mkinitrd
|
||||
fi
|
||||
|
||||
%postun -n %{udevpkgname}
|
||||
%insserv_cleanup
|
||||
/usr/bin/systemctl daemon-reload >/dev/null 2>&1 || :
|
||||
|
||||
[ -x /sbin/mkinitrd_setup ] && /sbin/mkinitrd_setup
|
||||
if [ -e /var/lib/no_initrd_recreation_by_suspend ]; then
|
||||
echo "Skipping recreation of existing initial ramdisks, due"
|
||||
echo "to presence of /var/lib/no_initrd_recreation_by_suspend"
|
||||
elif [ -x /sbin/mkinitrd ]; then
|
||||
/sbin/mkinitrd
|
||||
fi
|
||||
|
||||
%post -n lib%{udevpkgname}%{udev_major} -p /sbin/ldconfig
|
||||
|
||||
%postun -n lib%{udevpkgname}%{udev_major} -p /sbin/ldconfig
|
||||
|
||||
%if ! 0%{?bootstrap}
|
||||
|
||||
%post -n libgudev-1_0-0 -p /sbin/ldconfig
|
||||
|
||||
%postun -n libgudev-1_0-0 -p /sbin/ldconfig
|
||||
%endif
|
||||
|
||||
%clean
|
||||
rm -rf %{buildroot}
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
/bin/systemd
|
||||
/bin/systemctl
|
||||
/bin/systemd-notify
|
||||
/bin/systemd-journalctl
|
||||
/bin/systemd-ask-password
|
||||
/bin/systemd-loginctl
|
||||
/bin/systemd-tty-ask-password-agent
|
||||
/bin/systemd-tmpfiles
|
||||
/bin/systemd-machine-id-setup
|
||||
/usr/bin/systemd-nspawn
|
||||
/usr/bin/systemd-stdio-bridge
|
||||
/bin/systemctl
|
||||
%{_bindir}/hostnamectl
|
||||
%{_bindir}/localectl
|
||||
%{_bindir}/systemctl
|
||||
%{_bindir}/systemd-coredumpctl
|
||||
%{_bindir}/systemd-delta
|
||||
%{_bindir}/systemd-notify
|
||||
%{_bindir}/systemd-journalctl
|
||||
%{_bindir}/journalctl
|
||||
%{_bindir}/systemd-ask-password
|
||||
%{_bindir}/loginctl
|
||||
%{_bindir}/systemd-loginctl
|
||||
%{_bindir}/systemd-inhibit
|
||||
%{_bindir}/systemd-tty-ask-password-agent
|
||||
%{_bindir}/systemd-tmpfiles
|
||||
%{_bindir}/systemd-machine-id-setup
|
||||
%{_bindir}/systemd-nspawn
|
||||
%{_bindir}/systemd-stdio-bridge
|
||||
%{_bindir}/systemd-detect-virt
|
||||
%{_bindir}/timedatectl
|
||||
%{_sbindir}/systemd-sysv-convert
|
||||
%{_libdir}/libsystemd-daemon.so.*
|
||||
%{_libdir}/libsystemd-login.so.*
|
||||
@ -343,35 +577,74 @@ rm -rf %{buildroot}
|
||||
%{_bindir}/systemd-cgls
|
||||
%{_bindir}/systemd-cgtop
|
||||
%{_bindir}/systemd-cat
|
||||
/lib/systemd/systemd-*
|
||||
%dir /lib/systemd/system-shutdown
|
||||
%dir /lib/systemd/system.preset
|
||||
%dir /lib/systemd/user.preset
|
||||
%dir %{_prefix}/lib/systemd
|
||||
%dir %{_prefix}/lib/systemd/user
|
||||
%dir %{_prefix}/lib/systemd/system
|
||||
%exclude %{_prefix}/lib/systemd/system/systemd-udev*.*
|
||||
%exclude %{_prefix}/lib/systemd/system/udev-root-symlink.service
|
||||
%exclude %{_prefix}/lib/systemd/system/*.target.wants/systemd-udev*.*
|
||||
%exclude %{_prefix}/lib/systemd/system/basic.target.wants/udev-root-symlink.service
|
||||
%{_prefix}/lib/systemd/system/*.automount
|
||||
%{_prefix}/lib/systemd/system/*.service
|
||||
%{_prefix}/lib/systemd/system/*.target
|
||||
%{_prefix}/lib/systemd/system/*.mount
|
||||
%{_prefix}/lib/systemd/system/*.timer
|
||||
%{_prefix}/lib/systemd/system/*.socket
|
||||
%{_prefix}/lib/systemd/system/*.wants
|
||||
%{_prefix}/lib/systemd/system/*.path
|
||||
%{_prefix}/lib/systemd/user/*.target
|
||||
%{_prefix}/lib/systemd/user/*.service
|
||||
%exclude %{_prefix}/lib/systemd/systemd-udevd
|
||||
%{_prefix}/lib/systemd/systemd-*
|
||||
%{_prefix}/lib/systemd/systemd
|
||||
%dir %{_prefix}/lib/systemd/system-shutdown
|
||||
%dir %{_prefix}/lib/systemd/system-preset
|
||||
%dir %{_prefix}/lib/systemd/user-preset
|
||||
%dir %{_prefix}/lib/systemd/system-generators
|
||||
%dir %{_prefix}/lib/systemd/user-generators
|
||||
%dir %{_prefix}/lib/systemd/ntp-units.d/
|
||||
%dir %{_prefix}/lib/systemd/system-shutdown/
|
||||
%dir %{_prefix}/lib/systemd/system-sleep/
|
||||
%dir %{_prefix}/lib/systemd/system/default.target.wants
|
||||
%dir %{_prefix}/lib/systemd/system/dbus.target.wants
|
||||
%dir %{_prefix}/lib/systemd/system/syslog.target.wants
|
||||
%if ! 0%{?bootstrap}
|
||||
%{_prefix}/lib/systemd/system-generators/systemd-cryptsetup-generator
|
||||
%endif
|
||||
%{_prefix}/lib/systemd/system-generators/systemd-getty-generator
|
||||
%{_prefix}/lib/systemd/system-generators/systemd-rc-local-generator
|
||||
%{_prefix}/lib/systemd/system-generators/systemd-fstab-generator
|
||||
%{_prefix}/lib/systemd/system-generators/systemd-system-update-generator
|
||||
/%{_lib}/security/pam_systemd.so
|
||||
|
||||
%dir %{_libexecdir}/modules-load.d
|
||||
%dir %{_sysconfdir}/modules-load.d
|
||||
|
||||
%dir %{_libexecdir}/tmpfiles.d
|
||||
%dir %{_sysconfdir}/tmpfiles.d
|
||||
%{_libexecdir}/tmpfiles.d/*.conf
|
||||
|
||||
%dir %{_libexecdir}/binfmt.d
|
||||
%dir %{_sysconfdir}/binfmt.d
|
||||
|
||||
%dir %{_libexecdir}/sysctl.d
|
||||
%dir %{_sysconfdir}/sysctl.d
|
||||
|
||||
%dir %{_sysconfdir}/systemd
|
||||
%dir %{_sysconfdir}/systemd/system
|
||||
%dir %{_sysconfdir}/systemd/user
|
||||
%dir %{_sysconfdir}/xdg/systemd
|
||||
%dir %{_sysconfdir}/xdg/systemd/user
|
||||
|
||||
%dir /usr/lib/modules-load.d
|
||||
%dir %{_sysconfdir}/modules-load.d
|
||||
%dir /usr/lib/tmpfiles.d
|
||||
%dir %{_sysconfdir}/tmpfiles.d
|
||||
%dir /usr/lib/binfmt.d
|
||||
%dir %{_sysconfdir}/binfmt.d
|
||||
%dir /usr/lib/sysctl.d
|
||||
%dir %{_sysconfdir}/sysctl.d
|
||||
/usr/lib/tmpfiles.d/*.conf
|
||||
%config(noreplace) %{_sysconfdir}/systemd/system.conf
|
||||
%config(noreplace) %{_sysconfdir}/systemd/systemd-logind.conf
|
||||
%config(noreplace) %{_sysconfdir}/systemd/systemd-journald.conf
|
||||
%config(noreplace) %{_sysconfdir}/systemd/logind.conf
|
||||
%config(noreplace) %{_sysconfdir}/systemd/journald.conf
|
||||
%config(noreplace) %{_sysconfdir}/systemd/user.conf
|
||||
%config(noreplace) %{_sysconfdir}/systemd/system.conf
|
||||
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/org.freedesktop.locale1.conf
|
||||
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/org.freedesktop.login1.conf
|
||||
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/org.freedesktop.systemd1.conf
|
||||
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/org.freedesktop.hostname1.conf
|
||||
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/org.freedesktop.timedate1.conf
|
||||
|
||||
%{_datadir}/dbus-1/interfaces/org.freedesktop.hostname1.xml
|
||||
%{_datadir}/dbus-1/interfaces/org.freedesktop.locale1.xml
|
||||
%{_datadir}/dbus-1/interfaces/org.freedesktop.systemd1.*.xml
|
||||
@ -382,12 +655,16 @@ rm -rf %{buildroot}
|
||||
%{_datadir}/dbus-1/system-services/org.freedesktop.login1.service
|
||||
%{_datadir}/dbus-1/system-services/org.freedesktop.hostname1.service
|
||||
%{_datadir}/dbus-1/system-services/org.freedesktop.timedate1.service
|
||||
%{_datadir}/polkit-1
|
||||
%{_datadir}/polkit-1/actions
|
||||
%dir %{_datadir}/polkit-1
|
||||
%dir %{_datadir}/polkit-1/actions
|
||||
%{_datadir}/polkit-1/actions/org.freedesktop.systemd1.policy
|
||||
%{_datadir}/polkit-1/actions/org.freedesktop.hostname1.policy
|
||||
%{_datadir}/polkit-1/actions/org.freedesktop.locale1.policy
|
||||
%{_datadir}/polkit-1/actions/org.freedesktop.timedate1.policy
|
||||
%{_datadir}/polkit-1/actions/org.freedesktop.login1.policy
|
||||
%{_datadir}/systemd
|
||||
# Packaged in gtk subpackage
|
||||
%exclude %{_mandir}/man1/systemadm.1*
|
||||
|
||||
%if ! 0%{?bootstrap}
|
||||
# Packaged in sysvinit subpackage
|
||||
%exclude %{_mandir}/man1/init.1*
|
||||
%exclude %{_mandir}/man8/halt.8*
|
||||
@ -396,24 +673,27 @@ rm -rf %{buildroot}
|
||||
%exclude %{_mandir}/man8/poweroff.8*
|
||||
%exclude %{_mandir}/man8/telinit.8*
|
||||
%exclude %{_mandir}/man8/runlevel.8*
|
||||
%exclude %{_mandir}/man*/*udev*.[0-9]*
|
||||
%{_mandir}/man1/*.1*
|
||||
%{_mandir}/man3/*.3*
|
||||
%{_mandir}/man5/*.5*
|
||||
%{_mandir}/man7/*.7*
|
||||
%{_mandir}/man8/*.8*
|
||||
%endif
|
||||
%{_docdir}/systemd
|
||||
/lib/udev/rules.d/*.rules
|
||||
/lib/udev/numlock-on
|
||||
%dir /lib/systemd
|
||||
/lib/systemd/system
|
||||
/lib/systemd/system-generators
|
||||
/lib/systemd/systemd
|
||||
%dir /usr/lib/systemd
|
||||
/usr/lib/systemd/user
|
||||
%dir %{_sysconfdir}/systemd
|
||||
%{_prefix}/lib/udev/rules.d/70-uaccess.rules
|
||||
%{_prefix}/lib/udev/rules.d/71-seat.rules
|
||||
%{_prefix}/lib/udev/rules.d/73-seat-late.rules
|
||||
%if ! 0%{?bootstrap}
|
||||
%{_prefix}/lib/udev/rules.d/73-seat-numlock.rules
|
||||
%endif
|
||||
%{_prefix}/lib/udev/rules.d/99-systemd.rules
|
||||
%if ! 0%{?bootstrap}
|
||||
%{_prefix}/lib/udev/numlock-on
|
||||
%endif
|
||||
%dir %{_sysconfdir}/bash_completion.d
|
||||
/etc/bash_completion.d/systemd-bash-completion.sh
|
||||
/etc/rpm/macros.systemd
|
||||
%{_sysconfdir}/bash_completion.d/systemd-bash-completion.sh
|
||||
%{_sysconfdir}/rpm/macros.systemd
|
||||
%dir /var/lib/systemd
|
||||
%dir /var/lib/systemd/sysv-convert
|
||||
%dir /var/lib/systemd/migrated
|
||||
@ -431,6 +711,7 @@ rm -rf %{buildroot}
|
||||
%{_includedir}/systemd/sd-id128.h
|
||||
%{_includedir}/systemd/sd-journal.h
|
||||
%{_includedir}/systemd/sd-messages.h
|
||||
%{_includedir}/systemd/sd-shutdown.h
|
||||
%{_datadir}/pkgconfig/systemd.pc
|
||||
%{_libdir}/pkgconfig/libsystemd-daemon.pc
|
||||
%{_libdir}/pkgconfig/libsystemd-login.pc
|
||||
@ -446,6 +727,7 @@ rm -rf %{buildroot}
|
||||
/sbin/poweroff
|
||||
/sbin/telinit
|
||||
/sbin/runlevel
|
||||
%if ! 0%{?bootstrap}
|
||||
%{_mandir}/man1/init.1*
|
||||
%{_mandir}/man8/halt.8*
|
||||
%{_mandir}/man8/reboot.8*
|
||||
@ -453,8 +735,95 @@ rm -rf %{buildroot}
|
||||
%{_mandir}/man8/poweroff.8*
|
||||
%{_mandir}/man8/telinit.8*
|
||||
%{_mandir}/man8/runlevel.8*
|
||||
%endif
|
||||
|
||||
%files analyze
|
||||
%attr(0755,root,root) /usr/bin/systemd-analyze
|
||||
|
||||
%files -n %{udevpkgname}
|
||||
%defattr(-,root,root)
|
||||
/sbin/udevd
|
||||
/sbin/udevadm
|
||||
# keep for compatibility
|
||||
%ghost /lib/udev
|
||||
%{_bindir}/udevadm
|
||||
%{_prefix}/lib/firmware
|
||||
%dir %{_prefix}/lib/udev/
|
||||
%{_prefix}/lib/udev/accelerometer
|
||||
%{_prefix}/lib/udev/ata_id
|
||||
%{_prefix}/lib/udev/cdrom_id
|
||||
%{_prefix}/lib/udev/collect
|
||||
%{_prefix}/lib/udev/findkeyboards
|
||||
%{_prefix}/lib/udev/keymap
|
||||
%{_prefix}/lib/udev/mtd_probe
|
||||
%{_prefix}/lib/udev/scsi_id
|
||||
%{_prefix}/lib/udev/v4l_id
|
||||
%{_prefix}/lib/udev/write_dev_root_rule
|
||||
%dir %{_prefix}/lib/udev/keymaps
|
||||
%{_prefix}/lib/udev/keymaps/*
|
||||
%{_prefix}/lib/udev/keyboard-force-release.sh
|
||||
%dir %{_prefix}/lib/udev/rules.d/
|
||||
%exclude %{_prefix}/lib/udev/rules.d/70-uaccess.rules
|
||||
%exclude %{_prefix}/lib/udev/rules.d/71-seat.rules
|
||||
%exclude %{_prefix}/lib/udev/rules.d/73-seat-late.rules
|
||||
%exclude %{_prefix}/lib/udev/rules.d/73-seat-numlock.rules
|
||||
%exclude %{_prefix}/lib/udev/rules.d/99-systemd.rules
|
||||
%{_prefix}/lib/udev/rules.d/*.rules
|
||||
%{_sysconfdir}/init.d/boot.udev
|
||||
%dir %{_sysconfdir}/udev/
|
||||
%dir %{_sysconfdir}/udev/rules.d/
|
||||
%config(noreplace) %{_sysconfdir}/udev/udev.conf
|
||||
%if ! 0%{?bootstrap}
|
||||
%{_mandir}/man?/*udev*.[0-9]*
|
||||
%endif
|
||||
%dir %{_prefix}/lib/systemd/system
|
||||
%{_prefix}/lib/systemd/systemd-udevd
|
||||
%{_prefix}/lib/systemd/system/udev-root-symlink.service
|
||||
%{_prefix}/lib/systemd/system/*udev*.service
|
||||
%{_prefix}/lib/systemd/system/systemd-udevd*.socket
|
||||
%dir %{_prefix}/lib/systemd/system/sysinit.target.wants
|
||||
%{_prefix}/lib/systemd/system/sysinit.target.wants/systemd-udev*.service
|
||||
%dir %{_prefix}/lib/systemd/system/sockets.target.wants
|
||||
%{_prefix}/lib/systemd/system/sockets.target.wants/systemd-udev*.socket
|
||||
|
||||
%files -n lib%{udevpkgname}%{udev_major}
|
||||
%defattr(-,root,root)
|
||||
%{_libdir}/libudev.so.*
|
||||
|
||||
%files -n lib%{udevpkgname}-devel
|
||||
%defattr(-,root,root)
|
||||
%{_includedir}/libudev.h
|
||||
%{_libdir}/libudev.so
|
||||
%{_datadir}/pkgconfig/udev.pc
|
||||
%{_libdir}/pkgconfig/libudev.pc
|
||||
%if ! 0%{?bootstrap}
|
||||
%dir %{_datadir}/gtk-doc
|
||||
%dir %{_datadir}/gtk-doc/html
|
||||
%dir %{_datadir}/gtk-doc/html/libudev
|
||||
%{_datadir}/gtk-doc/html/libudev/*
|
||||
%endif
|
||||
|
||||
%if ! 0%{?bootstrap}
|
||||
%files -n libgudev-1_0-0
|
||||
%defattr(-,root,root)
|
||||
%{_libdir}/libgudev-1.0.so.*
|
||||
|
||||
%files -n typelib-1_0-GUdev-1_0
|
||||
%defattr(-,root,root)
|
||||
%{_libdir}/girepository-1.0/GUdev-1.0.typelib
|
||||
|
||||
%files -n libgudev-1_0-devel
|
||||
%defattr(-,root,root)
|
||||
%dir %{_includedir}/gudev-1.0
|
||||
%dir %{_includedir}/gudev-1.0/gudev
|
||||
%{_includedir}/gudev-1.0/gudev/*.h
|
||||
%{_libdir}/libgudev-1.0.so
|
||||
%{_libdir}/pkgconfig/gudev-1.0.pc
|
||||
%dir %{_datadir}/gtk-doc
|
||||
%dir %{_datadir}/gtk-doc/html
|
||||
%dir %{_datadir}/gtk-doc/html/gudev
|
||||
%{_datadir}/gtk-doc/html/gudev/*
|
||||
%{_datadir}/gir-1.0/GUdev-1.0.gir
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
|
12
tty1.patch
12
tty1.patch
@ -1,13 +1,13 @@
|
||||
Index: systemd-29/units/systemd-ask-password-wall.service.in
|
||||
Index: systemd-189/units/systemd-ask-password-wall.service.in
|
||||
===================================================================
|
||||
--- systemd-29.orig/units/systemd-ask-password-wall.service.in
|
||||
+++ systemd-29/units/systemd-ask-password-wall.service.in
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
--- systemd-189.orig/units/systemd-ask-password-wall.service.in
|
||||
+++ systemd-189/units/systemd-ask-password-wall.service.in
|
||||
@@ -8,7 +8,7 @@
|
||||
[Unit]
|
||||
Description=Forward Password Requests to Wall
|
||||
Documentation=man:systemd-ask-password-console.service(8)
|
||||
-After=systemd-user-sessions.service
|
||||
+After=systemd-user-sessions.service getty@tty1.service
|
||||
|
||||
[Service]
|
||||
ExecStartPre=-@rootbindir@/systemctl stop systemd-ask-password-console.path systemd-ask-password-console.service
|
||||
ExecStartPre=-@SYSTEMCTL@ stop systemd-ask-password-console.path systemd-ask-password-console.service systemd-ask-password-plymouth.path systemd-ask-password-plymouth.service
|
||||
|
9
udev-root-symlink.systemd
Normal file
9
udev-root-symlink.systemd
Normal file
@ -0,0 +1,9 @@
|
||||
[Unit]
|
||||
Description=create /dev/root symlink with dynamic rule
|
||||
Before=udev.service
|
||||
DefaultDependencies=no
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
ExecStart=/lib/udev/write_dev_root_rule
|
@ -1,253 +0,0 @@
|
||||
From 03854532d39613723dc8b85c424737ecf2e46f74 Mon Sep 17 00:00:00 2001
|
||||
From: Lennart Poettering <lennart@poettering.net>
|
||||
Date: Mon, 16 Apr 2012 18:54:45 +0200
|
||||
Subject: [PATCH 1/3] util: introduce memdup()
|
||||
|
||||
---
|
||||
src/util.h | 2 ++
|
||||
1 files changed, 2 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/src/util.h b/src/util.h
|
||||
index b1af6db..06c9933 100644
|
||||
--- a/src/util.h
|
||||
+++ b/src/util.h
|
||||
@@ -99,6 +99,8 @@ bool streq_ptr(const char *a, const char *b);
|
||||
|
||||
#define new0(t, n) ((t*) calloc((n), sizeof(t)))
|
||||
|
||||
+#define newdup(t, p, n) ((t*) memdup(p, sizeof(t)*(n))
|
||||
+
|
||||
#define malloc0(n) (calloc((n), 1))
|
||||
|
||||
static inline const char* yes_no(bool b) {
|
||||
--
|
||||
1.7.7
|
||||
|
||||
|
||||
From f60b5d436f502152415b08758737f200113ce4bc Mon Sep 17 00:00:00 2001
|
||||
From: Frederic Crozat <fcrozat@suse.com>
|
||||
Date: Mon, 21 May 2012 16:53:18 +0200
|
||||
Subject: [PATCH 2/3] util: fix typo in newdup
|
||||
|
||||
Conflicts:
|
||||
|
||||
src/util.h
|
||||
---
|
||||
src/util.h | 2 +-
|
||||
1 files changed, 1 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/src/util.h b/src/util.h
|
||||
index 06c9933..41b4c9f 100644
|
||||
--- a/src/util.h
|
||||
+++ b/src/util.h
|
||||
@@ -99,7 +99,7 @@ bool streq_ptr(const char *a, const char *b);
|
||||
|
||||
#define new0(t, n) ((t*) calloc((n), sizeof(t)))
|
||||
|
||||
-#define newdup(t, p, n) ((t*) memdup(p, sizeof(t)*(n))
|
||||
+#define newdup(t, p, n) ((t*) memdup(p, sizeof(t)*(n)))
|
||||
|
||||
#define malloc0(n) (calloc((n), 1))
|
||||
|
||||
--
|
||||
1.7.7
|
||||
|
||||
|
||||
From 8e7fa2b3e68b691c522cf2b60ed920452c146c2e Mon Sep 17 00:00:00 2001
|
||||
From: Frederic Crozat <fcrozat@suse.com>
|
||||
Date: Wed, 27 Jun 2012 14:12:44 +0200
|
||||
Subject: [PATCH 3/3] main: allow system wide limits for services
|
||||
|
||||
---
|
||||
man/systemd.conf.xml | 27 +++++++++++++++++++++++++++
|
||||
src/main.c | 22 ++++++++++++++++++++++
|
||||
src/manager.c | 22 ++++++++++++++++++++++
|
||||
src/manager.h | 3 +++
|
||||
src/service.c | 4 ++++
|
||||
5 files changed, 78 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/man/systemd.conf.xml b/man/systemd.conf.xml
|
||||
index ba144da..ee461e3 100644
|
||||
--- a/man/systemd.conf.xml
|
||||
+++ b/man/systemd.conf.xml
|
||||
@@ -149,6 +149,33 @@
|
||||
controllers in separate
|
||||
hierarchies.</para></listitem>
|
||||
</varlistentry>
|
||||
+
|
||||
+ <varlistentry>
|
||||
+ <term><varname>DefaultLimitCPU=</varname></term>
|
||||
+ <term><varname>DefaultLimitFSIZE=</varname></term>
|
||||
+ <term><varname>DefaultLimitDATA=</varname></term>
|
||||
+ <term><varname>DefaultLimitSTACK=</varname></term>
|
||||
+ <term><varname>DefaultLimitCORE=</varname></term>
|
||||
+ <term><varname>DefaultLimitRSS=</varname></term>
|
||||
+ <term><varname>DefaultLimitNOFILE=</varname></term>
|
||||
+ <term><varname>DefaultLimitAS=</varname></term>
|
||||
+ <term><varname>DefaultLimitNPROC=</varname></term>
|
||||
+ <term><varname>DefaultLimitMEMLOCK=</varname></term>
|
||||
+ <term><varname>DefaultLimitLOCKS=</varname></term>
|
||||
+ <term><varname>DefaultLimitSIGPENDING=</varname></term>
|
||||
+ <term><varname>DefaultLimitMSGQUEUE=</varname></term>
|
||||
+ <term><varname>DefaultLimitNICE=</varname></term>
|
||||
+ <term><varname>DefaultLimitRTPRIO=</varname></term>
|
||||
+ <term><varname>DefaultLimitRTTIME=</varname></term>
|
||||
+ <listitem><para>These settings control
|
||||
+ various default resource limits for units. See
|
||||
+ <citerefentry><refentrytitle>setrlimit</refentrytitle><manvolnum>2</manvolnum></citerefentry>
|
||||
+ for details. Use the string
|
||||
+ <varname>infinity</varname> to
|
||||
+ configure no limit on a specific
|
||||
+ resource. They can be overriden in units files
|
||||
+ using corresponding LimitXXXX parameter.</para></listitem>
|
||||
+ </varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
diff --git a/src/main.c b/src/main.c
|
||||
index ed317b4..3f5f3d7 100644
|
||||
--- a/src/main.c
|
||||
+++ b/src/main.c
|
||||
@@ -79,6 +79,7 @@ static char **arg_default_controllers = NULL;
|
||||
static char ***arg_join_controllers = NULL;
|
||||
static ExecOutput arg_default_std_output = EXEC_OUTPUT_JOURNAL;
|
||||
static ExecOutput arg_default_std_error = EXEC_OUTPUT_INHERIT;
|
||||
+static struct rlimit *arg_default_rlimit[RLIMIT_NLIMITS] = {};
|
||||
|
||||
static FILE* serialization = NULL;
|
||||
|
||||
@@ -659,6 +660,22 @@ static int parse_config_file(void) {
|
||||
{ "Manager", "DefaultStandardOutput", config_parse_output, 0, &arg_default_std_output },
|
||||
{ "Manager", "DefaultStandardError", config_parse_output, 0, &arg_default_std_error },
|
||||
{ "Manager", "JoinControllers", config_parse_join_controllers, 0, &arg_join_controllers },
|
||||
+ { "Manager", "DefaultLimitCPU", config_parse_limit, 0, &arg_default_rlimit[RLIMIT_CPU]},
|
||||
+ { "Manager", "DefaultLimitFSIZE", config_parse_limit, 0, &arg_default_rlimit[RLIMIT_FSIZE]},
|
||||
+ { "Manager", "DefaultLimitDATA", config_parse_limit, 0, &arg_default_rlimit[RLIMIT_DATA]},
|
||||
+ { "Manager", "DefaultLimitSTACK", config_parse_limit, 0, &arg_default_rlimit[RLIMIT_STACK]},
|
||||
+ { "Manager", "DefaultLimitCORE", config_parse_limit, 0, &arg_default_rlimit[RLIMIT_CORE]},
|
||||
+ { "Manager", "DefaultLimitRSS", config_parse_limit, 0, &arg_default_rlimit[RLIMIT_RSS]},
|
||||
+ { "Manager", "DefaultLimitNOFILE", config_parse_limit, 0, &arg_default_rlimit[RLIMIT_NOFILE]},
|
||||
+ { "Manager", "DefaultLimitAS", config_parse_limit, 0, &arg_default_rlimit[RLIMIT_AS]},
|
||||
+ { "Manager", "DefaultLimitNPROC", config_parse_limit, 0, &arg_default_rlimit[RLIMIT_NPROC]},
|
||||
+ { "Manager", "DefaultLimitMEMLOCK", config_parse_limit, 0, &arg_default_rlimit[RLIMIT_MEMLOCK]},
|
||||
+ { "Manager", "DefaultLimitLOCKS", config_parse_limit, 0, &arg_default_rlimit[RLIMIT_LOCKS]},
|
||||
+ { "Manager", "DefaultLimitSIGPENDING",config_parse_limit, 0, &arg_default_rlimit[RLIMIT_SIGPENDING]},
|
||||
+ { "Manager", "DefaultLimitMSGQUEUE", config_parse_limit, 0, &arg_default_rlimit[RLIMIT_MSGQUEUE]},
|
||||
+ { "Manager", "DefaultLimitNICE", config_parse_limit, 0, &arg_default_rlimit[RLIMIT_NICE]},
|
||||
+ { "Manager", "DefaultLimitRTPRIO", config_parse_limit, 0, &arg_default_rlimit[RLIMIT_RTPRIO]},
|
||||
+ { "Manager", "DefaultLimitRTTIME", config_parse_limit, 0, &arg_default_rlimit[RLIMIT_RTTIME]},
|
||||
{ NULL, NULL, NULL, 0, NULL }
|
||||
};
|
||||
|
||||
@@ -1401,6 +1418,8 @@ int main(int argc, char *argv[]) {
|
||||
m->default_std_output = arg_default_std_output;
|
||||
m->default_std_error = arg_default_std_error;
|
||||
|
||||
+ manager_set_default_rlimits(m, arg_default_rlimit);
|
||||
+
|
||||
if (dual_timestamp_is_set(&initrd_timestamp))
|
||||
m->initrd_timestamp = initrd_timestamp;
|
||||
|
||||
@@ -1539,6 +1558,9 @@ finish:
|
||||
if (m)
|
||||
manager_free(m);
|
||||
|
||||
+ for (j = 0; j < RLIMIT_NLIMITS; j++)
|
||||
+ free (arg_default_rlimit[j]);
|
||||
+
|
||||
free(arg_default_unit);
|
||||
strv_free(arg_default_controllers);
|
||||
free_join_controllers();
|
||||
diff --git a/src/manager.c b/src/manager.c
|
||||
index 3e592b6..c6cd06c 100644
|
||||
--- a/src/manager.c
|
||||
+++ b/src/manager.c
|
||||
@@ -456,6 +456,7 @@ static void manager_clear_jobs_and_units(Manager *m) {
|
||||
|
||||
void manager_free(Manager *m) {
|
||||
UnitType c;
|
||||
+ int i;
|
||||
|
||||
assert(m);
|
||||
|
||||
@@ -501,6 +502,9 @@ void manager_free(Manager *m) {
|
||||
hashmap_free(m->cgroup_bondings);
|
||||
set_free_free(m->unit_path_cache);
|
||||
|
||||
+ for (i = 0; i < RLIMIT_NLIMITS; i++)
|
||||
+ free(m->rlimit[i]);
|
||||
+
|
||||
free(m);
|
||||
}
|
||||
|
||||
@@ -3137,6 +3141,24 @@ int manager_set_default_controllers(Manager *m, char **controllers) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
+int manager_set_default_rlimits(Manager *m, struct rlimit **default_rlimit) {
|
||||
+ int i;
|
||||
+
|
||||
+ assert(m);
|
||||
+
|
||||
+ for (i = 0; i < RLIMIT_NLIMITS; i++) {
|
||||
+ if (default_rlimit[i]) {
|
||||
+ m->rlimit[i] = newdup(struct rlimit, default_rlimit[i], 1);
|
||||
+
|
||||
+ if (!m->rlimit[i])
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
void manager_recheck_journal(Manager *m) {
|
||||
Unit *u;
|
||||
|
||||
diff --git a/src/manager.h b/src/manager.h
|
||||
index a9d08f0..5f5de8e 100644
|
||||
--- a/src/manager.h
|
||||
+++ b/src/manager.h
|
||||
@@ -225,6 +225,8 @@ struct Manager {
|
||||
|
||||
ExecOutput default_std_output, default_std_error;
|
||||
|
||||
+ struct rlimit *rlimit[RLIMIT_NLIMITS];
|
||||
+
|
||||
/* non-zero if we are reloading or reexecuting, */
|
||||
int n_reloading;
|
||||
|
||||
@@ -263,6 +265,7 @@ unsigned manager_dispatch_run_queue(Manager *m);
|
||||
unsigned manager_dispatch_dbus_queue(Manager *m);
|
||||
|
||||
int manager_set_default_controllers(Manager *m, char **controllers);
|
||||
+int manager_set_default_rlimits(Manager *m, struct rlimit **default_rlimit);
|
||||
|
||||
int manager_loop(Manager *m);
|
||||
|
||||
diff --git a/src/service.c b/src/service.c
|
||||
index 8b5c0b0..892392d 100644
|
||||
--- a/src/service.c
|
||||
+++ b/src/service.c
|
||||
@@ -109,6 +109,7 @@ static const UnitActiveState state_translation_table[_SERVICE_STATE_MAX] = {
|
||||
|
||||
static void service_init(Unit *u) {
|
||||
Service *s = SERVICE(u);
|
||||
+ int i;
|
||||
|
||||
assert(u);
|
||||
assert(u->load_state == UNIT_STUB);
|
||||
@@ -127,6 +128,9 @@ static void service_init(Unit *u) {
|
||||
s->guess_main_pid = true;
|
||||
|
||||
exec_context_init(&s->exec_context);
|
||||
+ for (i = 0; i < RLIMIT_NLIMITS; i++)
|
||||
+ if (UNIT(s)->manager->rlimit[i])
|
||||
+ s->exec_context.rlimit[i] = newdup(struct rlimit, UNIT(s)->manager->rlimit[i], 1);
|
||||
|
||||
RATELIMIT_INIT(s->start_limit, 10*USEC_PER_SEC, 5);
|
||||
|
||||
--
|
||||
1.7.7
|
||||
|
@ -1,397 +0,0 @@
|
||||
unlike symlink_or_copy_atomic(), this function creates a symlink even if the
|
||||
oldname and newname (from and to) are on differn't devices. (stat.st_dev)
|
||||
---
|
||||
src/shared/util.c | 19 +++++++++++++++++--
|
||||
src/shared/util.h | 1 +
|
||||
2 files changed, 18 insertions(+), 2 deletions(-)
|
||||
|
||||
Index: systemd-44/src/util.c
|
||||
===================================================================
|
||||
--- systemd-44.orig/src/util.c
|
||||
+++ systemd-44/src/util.c
|
||||
@@ -5352,7 +5352,7 @@ finish:
|
||||
return r;
|
||||
}
|
||||
|
||||
-int symlink_or_copy_atomic(const char *from, const char *to) {
|
||||
+static int symlink_atomic_raw(const char *from, const char *to, bool allow_copy) {
|
||||
char *t, *x;
|
||||
const char *fn;
|
||||
size_t k;
|
||||
@@ -5381,7 +5381,14 @@ int symlink_or_copy_atomic(const char *f
|
||||
|
||||
*x = 0;
|
||||
|
||||
- r = symlink_or_copy(from, t);
|
||||
+ if (allow_copy)
|
||||
+ r = symlink_or_copy(from, t);
|
||||
+ else {
|
||||
+ r = symlink(from, t);
|
||||
+ if (r < 0)
|
||||
+ r = -errno;
|
||||
+ }
|
||||
+
|
||||
if (r < 0) {
|
||||
unlink(t);
|
||||
free(t);
|
||||
@@ -5482,6 +5489,14 @@ int audit_loginuid_from_pid(pid_t pid, u
|
||||
return 0;
|
||||
}
|
||||
|
||||
+int symlink_or_copy_atomic(const char *from, const char *to) {
|
||||
+ return symlink_atomic_raw(from, to, true);
|
||||
+}
|
||||
+
|
||||
+int symlink_atomic(const char *from, const char *to) {
|
||||
+ return symlink_atomic_raw(from, to, false);
|
||||
+}
|
||||
+
|
||||
bool display_is_local(const char *display) {
|
||||
assert(display);
|
||||
|
||||
Index: systemd-44/src/util.h
|
||||
===================================================================
|
||||
--- systemd-44.orig/src/util.h
|
||||
+++ systemd-44/src/util.h
|
||||
@@ -448,6 +448,7 @@ int vt_disallocate(const char *name);
|
||||
int copy_file(const char *from, const char *to);
|
||||
int symlink_or_copy(const char *from, const char *to);
|
||||
int symlink_or_copy_atomic(const char *from, const char *to);
|
||||
+int symlink_atomic(const char *from, const char *to);
|
||||
|
||||
int fchmod_umask(int fd, mode_t mode);
|
||||
|
||||
Index: systemd-44/Makefile.am
|
||||
===================================================================
|
||||
--- systemd-44.orig/Makefile.am
|
||||
+++ systemd-44/Makefile.am
|
||||
@@ -690,7 +690,7 @@ MANPAGES = \
|
||||
man/systemd.conf.5 \
|
||||
man/tmpfiles.d.5 \
|
||||
man/hostname.5 \
|
||||
- man/timezone.5 \
|
||||
+ man/localtime.5 \
|
||||
man/machine-id.5 \
|
||||
man/locale.conf.5 \
|
||||
man/os-release.5 \
|
||||
Index: systemd-44/man/timezone.xml
|
||||
===================================================================
|
||||
--- systemd-44.orig/man/timezone.xml
|
||||
+++ /dev/null
|
||||
@@ -1,90 +0,0 @@
|
||||
-<?xml version='1.0'?> <!--*-nxml-*-->
|
||||
-<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?>
|
||||
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
- "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
||||
-
|
||||
-<!--
|
||||
- This file is part of systemd.
|
||||
-
|
||||
- Copyright 2010 Lennart Poettering
|
||||
-
|
||||
- systemd is free software; you can redistribute it and/or modify it
|
||||
- under the terms of the GNU General Public License as published by
|
||||
- the Free Software Foundation; either version 2 of the License, or
|
||||
- (at your option) any later version.
|
||||
-
|
||||
- systemd is distributed in the hope that it will be useful, but
|
||||
- WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
- General Public License for more details.
|
||||
-
|
||||
- You should have received a copy of the GNU General Public License
|
||||
- along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
||||
--->
|
||||
-
|
||||
-<refentry id="timezone">
|
||||
- <refentryinfo>
|
||||
- <title>/etc/timezone</title>
|
||||
- <productname>systemd</productname>
|
||||
-
|
||||
- <authorgroup>
|
||||
- <author>
|
||||
- <contrib>Developer</contrib>
|
||||
- <firstname>Lennart</firstname>
|
||||
- <surname>Poettering</surname>
|
||||
- <email>lennart@poettering.net</email>
|
||||
- </author>
|
||||
- </authorgroup>
|
||||
- </refentryinfo>
|
||||
-
|
||||
- <refmeta>
|
||||
- <refentrytitle>timezone</refentrytitle>
|
||||
- <manvolnum>5</manvolnum>
|
||||
- </refmeta>
|
||||
-
|
||||
- <refnamediv>
|
||||
- <refname>timezone</refname>
|
||||
- <refpurpose>Local time zone configuration file</refpurpose>
|
||||
- </refnamediv>
|
||||
-
|
||||
- <refsynopsisdiv>
|
||||
- <para><filename>/etc/timezone</filename></para>
|
||||
- </refsynopsisdiv>
|
||||
-
|
||||
- <refsect1>
|
||||
- <title>Description</title>
|
||||
-
|
||||
- <para>The <filename>/etc/timezone</filename> file
|
||||
- configures the system-wide time zone of the local
|
||||
- system that is used by applications for presentation
|
||||
- to the user. It should contain a single
|
||||
- newline-terminated line consisting of a time zone
|
||||
- identifier such as
|
||||
- <literal>Europe/Berlin</literal>. The file
|
||||
- <filename>/etc/localtime</filename> corresponds with
|
||||
- <filename>/etc/timezone</filename> and contains the
|
||||
- binary time zone data for the time zone. These files
|
||||
- should always be changed simultaneously and kept in
|
||||
- sync.</para>
|
||||
-
|
||||
- <para>The time zone may be overridden for individual
|
||||
- programs by using the TZ environment variable. See
|
||||
- <citerefentry><refentrytitle>environ</refentrytitle><manvolnum>7</manvolnum></citerefentry>.</para>
|
||||
- </refsect1>
|
||||
-
|
||||
- <refsect1>
|
||||
- <title>History</title>
|
||||
-
|
||||
- <para>The simple configuration file format of
|
||||
- <filename>/etc/timezone</filename> originates from
|
||||
- Debian GNU/Linux.</para>
|
||||
- </refsect1>
|
||||
-
|
||||
- <refsect1>
|
||||
- <title>See Also</title>
|
||||
- <para>
|
||||
- <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
|
||||
- </para>
|
||||
- </refsect1>
|
||||
-
|
||||
-</refentry>
|
||||
Index: systemd-44/man/localtime.xml
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ systemd-44/man/localtime.xml
|
||||
@@ -0,0 +1,93 @@
|
||||
+<?xml version='1.0'?> <!--*-nxml-*-->
|
||||
+<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?>
|
||||
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
+ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
||||
+
|
||||
+<!--
|
||||
+ This file is part of systemd.
|
||||
+
|
||||
+ Copyright 2010 Lennart Poettering
|
||||
+ Copyright 2012 Shawn Landden
|
||||
+
|
||||
+ systemd is free software; you can redistribute it and/or modify it
|
||||
+ under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 2 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ systemd is distributed in the hope that it will be useful, but
|
||||
+ WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
||||
+-->
|
||||
+
|
||||
+<refentry id="localtime">
|
||||
+ <refentryinfo>
|
||||
+ <title>/etc/localtime</title>
|
||||
+ <productname>systemd</productname>
|
||||
+
|
||||
+ <authorgroup>
|
||||
+ <author>
|
||||
+ <contrib>Developer</contrib>
|
||||
+ <firstname>Lennart</firstname>
|
||||
+ <surname>Poettering</surname>
|
||||
+ <email>lennart@poettering.net</email>
|
||||
+ </author>
|
||||
+ <author>
|
||||
+ <contrib>Developer</contrib>
|
||||
+ <firstname>Shawn</firstname>
|
||||
+ <surname>Landden</surname>
|
||||
+ <email>shawnlandden@gmail.com</email>
|
||||
+ </author>
|
||||
+ </authorgroup>
|
||||
+ </refentryinfo>
|
||||
+
|
||||
+ <refmeta>
|
||||
+ <refentrytitle>localtime</refentrytitle>
|
||||
+ <manvolnum>5</manvolnum>
|
||||
+ </refmeta>
|
||||
+
|
||||
+ <refnamediv>
|
||||
+ <refname>localtime</refname>
|
||||
+ <refpurpose>Local time zone configuration file</refpurpose>
|
||||
+ </refnamediv>
|
||||
+
|
||||
+ <refsynopsisdiv>
|
||||
+ <para><filename>/etc/localtime</filename> -> <filename>/usr/share/zoneinfo/…</filename></para>
|
||||
+ </refsynopsisdiv>
|
||||
+
|
||||
+ <refsect1>
|
||||
+ <title>Description</title>
|
||||
+
|
||||
+ <para>The <filename>/etc/localtime</filename> file
|
||||
+ configures the system-wide time zone of the local
|
||||
+ system that is used by applications for presentation
|
||||
+ to the user. It should be an absolute symbolic link
|
||||
+ with a destination of <filename>/usr/share/zoneinfo/</filename>,
|
||||
+ fallowed by a time zone identifier such as
|
||||
+ <literal>Europe/Berlin</literal> or <literal>Etc/UTC</literal>.
|
||||
+ The resulting link should point to the corresponding binary
|
||||
+ <citerefentry><refentrytitle>tzfile</refentrytitle><manvolnum>5</manvolnum></citerefentry>
|
||||
+ time zone data for the configured time zone.</para>
|
||||
+
|
||||
+ <para>As the time zone identifier is extracted from the name of
|
||||
+ the target of <filename>/etc/localtime</filename> this file may
|
||||
+ not be a normal file or hardlink.</para>
|
||||
+
|
||||
+ <para>The time zone may be overridden for individual
|
||||
+ programs by using the TZ environment variable. See
|
||||
+ <citerefentry><refentrytitle>environ</refentrytitle><manvolnum>7</manvolnum></citerefentry>.</para>
|
||||
+ </refsect1>
|
||||
+
|
||||
+ <refsect1>
|
||||
+ <title>See Also</title>
|
||||
+ <para>
|
||||
+ <citerefentry><refentrytitle>tzset</refentrytitle><manvolnum>3</manvolnum></citerefentry>
|
||||
+ <citerefentry><refentrytitle>localtime</refentrytitle><manvolnum>3</manvolnum></citerefentry>
|
||||
+ <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
|
||||
+ </para>
|
||||
+ </refsect1>
|
||||
+
|
||||
+</refentry>
|
||||
Index: systemd-44/src/timedate/timedated.c
|
||||
===================================================================
|
||||
--- systemd-44.orig/src/timedate/timedated.c
|
||||
+++ systemd-44/src/timedate/timedated.c
|
||||
@@ -72,6 +72,9 @@
|
||||
BUS_GENERIC_INTERFACES_LIST \
|
||||
"org.freedesktop.timedate1\0"
|
||||
|
||||
+/* Must start and end with '/' */
|
||||
+#define ZONEINFO_PATH "/usr/share/zoneinfo/"
|
||||
+
|
||||
const char timedate_interface[] _introspect_("timedate1") = INTERFACE;
|
||||
|
||||
typedef struct TZ {
|
||||
@@ -125,7 +128,7 @@ static bool valid_timezone(const char *n
|
||||
if (slash)
|
||||
return false;
|
||||
|
||||
- t = strappend("/usr/share/zoneinfo/", name);
|
||||
+ t = strappend(ZONEINFO_PATH, name);
|
||||
if (!t)
|
||||
return false;
|
||||
|
||||
@@ -149,17 +152,17 @@ static void verify_timezone(void) {
|
||||
if (!tz.zone)
|
||||
return;
|
||||
|
||||
- p = strappend("/usr/share/zoneinfo/", tz.zone);
|
||||
+ p = strappend(ZONEINFO_PATH, tz.zone);
|
||||
if (!p) {
|
||||
log_error("Out of memory");
|
||||
return;
|
||||
}
|
||||
|
||||
- j = read_full_file("/etc/localtime", &a, &l);
|
||||
k = read_full_file(p, &b, &q);
|
||||
-
|
||||
free(p);
|
||||
|
||||
+ j = read_full_file("/etc/localtime", &a, &l);
|
||||
+
|
||||
if (j < 0 || k < 0 || l != q || memcmp(a, b, l)) {
|
||||
log_warning("/etc/localtime and /etc/timezone out of sync.");
|
||||
free(tz.zone);
|
||||
@@ -172,9 +175,36 @@ static void verify_timezone(void) {
|
||||
|
||||
static int read_data(void) {
|
||||
int r;
|
||||
+ char *t = NULL;
|
||||
|
||||
free_data();
|
||||
|
||||
+ r = readlink_malloc("/etc/localtime", &t);
|
||||
+ if (r < 0) {
|
||||
+ if (r == -EINVAL)
|
||||
+ log_warning("/etc/localtime should be a symbolic link to a timezone data file in " ZONEINFO_PATH);
|
||||
+ else
|
||||
+ log_warning("Failed to get target of %s: %s", "/etc/localtime", strerror(-r));
|
||||
+ } else {
|
||||
+ /* we only support the trivial relative link of (/etc/)..$ABSOLUTE */
|
||||
+ int rel_link_offset = startswith(t, "..") ? strlen("..") : 0;
|
||||
+
|
||||
+ if (!startswith(t + rel_link_offset, ZONEINFO_PATH))
|
||||
+ log_warning("/etc/localtime should be a symbolic link to a timezone data file in " ZONEINFO_PATH);
|
||||
+ else {
|
||||
+ tz.zone = strdup(t + rel_link_offset + strlen(ZONEINFO_PATH));
|
||||
+ free(t);
|
||||
+ if (!tz.zone) {
|
||||
+ log_error("Out of memory");
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ goto have_timezone;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ free(t);
|
||||
+
|
||||
r = read_one_line_file("/etc/timezone", &tz.zone);
|
||||
if (r < 0) {
|
||||
if (r != -ENOENT)
|
||||
@@ -190,6 +220,7 @@ static int read_data(void) {
|
||||
#endif
|
||||
}
|
||||
|
||||
+have_timezone:
|
||||
if (isempty(tz.zone)) {
|
||||
free(tz.zone);
|
||||
tz.zone = NULL;
|
||||
@@ -205,6 +236,7 @@ static int read_data(void) {
|
||||
static int write_data_timezone(void) {
|
||||
int r = 0;
|
||||
char *p;
|
||||
+ struct stat st;
|
||||
|
||||
if (!tz.zone) {
|
||||
if (unlink("/etc/timezone") < 0 && errno != ENOENT)
|
||||
@@ -216,21 +248,24 @@ static int write_data_timezone(void) {
|
||||
return r;
|
||||
}
|
||||
|
||||
- p = strappend("/usr/share/zoneinfo/", tz.zone);
|
||||
+ p = strappend(ZONEINFO_PATH, tz.zone);
|
||||
if (!p) {
|
||||
log_error("Out of memory");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
- r = symlink_or_copy_atomic(p, "/etc/localtime");
|
||||
+ r = symlink_atomic(p, "/etc/localtime");
|
||||
+
|
||||
free(p);
|
||||
|
||||
if (r < 0)
|
||||
- return r;
|
||||
+ return -errno;
|
||||
|
||||
- r = write_one_line_file_atomic("/etc/timezone", tz.zone);
|
||||
- if (r < 0)
|
||||
- return r;
|
||||
+ if (stat("/etc/timezone", &st) == 0 && S_ISREG(st.st_mode)) {
|
||||
+ r = write_one_line_file_atomic("/etc/timezone", tz.zone);
|
||||
+ if (r < 0)
|
||||
+ return r;
|
||||
+ }
|
||||
|
||||
return 0;
|
||||
}
|
97
var-run-lock.patch
Normal file
97
var-run-lock.patch
Normal file
@ -0,0 +1,97 @@
|
||||
Index: systemd-195/Makefile.am
|
||||
===================================================================
|
||||
--- systemd-195.orig/Makefile.am
|
||||
+++ systemd-195/Makefile.am
|
||||
@@ -294,6 +294,7 @@ dist_systemunit_DATA = \
|
||||
units/sys-kernel-config.mount \
|
||||
units/sys-kernel-debug.mount \
|
||||
units/sys-fs-fuse-connections.mount \
|
||||
+ units/var-run.mount \
|
||||
units/tmp.mount \
|
||||
units/printer.target \
|
||||
units/sound.target \
|
||||
@@ -308,6 +309,11 @@ dist_systemunit_DATA = \
|
||||
units/systemd-udevd-kernel.socket \
|
||||
units/system-update.target
|
||||
|
||||
+if HAVE_SYSV_COMPAT
|
||||
+dist_systemunit_DATA += \
|
||||
+ units/var-lock.mount
|
||||
+endif
|
||||
+
|
||||
nodist_systemunit_DATA = \
|
||||
units/getty@.service \
|
||||
units/serial-getty@.service \
|
||||
@@ -3864,9 +3870,11 @@ systemd-install-data-hook:
|
||||
( cd $(DESTDIR)$(systemunitdir)/local-fs.target.wants && \
|
||||
rm -f systemd-remount-fs.service \
|
||||
systemd-fsck-root.service \
|
||||
+ var-run.mount \
|
||||
tmp.mount && \
|
||||
$(LN_S) ../systemd-remount-fs.service systemd-remount-fs.service && \
|
||||
$(LN_S) ../systemd-fsck-root.service systemd-fsck-root.service && \
|
||||
+ $(LN_S) ../var-run.mount var-run.mount && \
|
||||
$(LN_S) ../tmp.mount tmp.mount )
|
||||
( cd $(DESTDIR)$(userunitdir) && \
|
||||
rm -f shutdown.target sockets.target bluetooth.target printer.target sound.target && \
|
||||
@@ -3954,6 +3962,12 @@ if TARGET_MAGEIA
|
||||
rm -f display-manager.service )
|
||||
endif
|
||||
|
||||
+if HAVE_SYSV_COMPAT
|
||||
+ ( cd $(DESTDIR)$(systemunitdir)/local-fs.target.wants && \
|
||||
+ rm -f var-lock.mount && \
|
||||
+ $(LN_S) ../var-lock.mount var-lock.mount )
|
||||
+endif
|
||||
+
|
||||
install-exec-hook: $(INSTALL_EXEC_HOOKS)
|
||||
|
||||
uninstall-hook: $(UNINSTALL_EXEC_HOOKS)
|
||||
Index: systemd-195/units/var-lock.mount
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ systemd-195/units/var-lock.mount
|
||||
@@ -0,0 +1,19 @@
|
||||
+# This file is part of systemd.
|
||||
+#
|
||||
+# systemd is free software; you can redistribute it and/or modify it
|
||||
+# under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 2 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+
|
||||
+[Unit]
|
||||
+Description=Lock Directory
|
||||
+Before=local-fs.target
|
||||
+# skip mounting if the directory does not exist or is a symlink
|
||||
+ConditionPathIsDirectory=/var/lock
|
||||
+ConditionPathIsSymbolicLink=!/var/lock
|
||||
+
|
||||
+[Mount]
|
||||
+What=/run/lock
|
||||
+Where=/var/lock
|
||||
+Type=bind
|
||||
+Options=bind
|
||||
Index: systemd-195/units/var-run.mount
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ systemd-195/units/var-run.mount
|
||||
@@ -0,0 +1,19 @@
|
||||
+# This file is part of systemd.
|
||||
+#
|
||||
+# systemd is free software; you can redistribute it and/or modify it
|
||||
+# under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 2 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+
|
||||
+[Unit]
|
||||
+Description=Runtime Directory
|
||||
+Before=local-fs.target
|
||||
+# skip mounting if the directory does not exist or is a symlink
|
||||
+ConditionPathIsDirectory=/var/run
|
||||
+ConditionPathIsSymbolicLink=!/var/run
|
||||
+
|
||||
+[Mount]
|
||||
+What=/run
|
||||
+Where=/var/run
|
||||
+Type=bind
|
||||
+Options=bind
|
13
write_dev_root_rule
Normal file
13
write_dev_root_rule
Normal file
@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
eval $(/sbin/udevadm info --export --export-prefix=ROOT_ --device-id-of-file=/)
|
||||
|
||||
[ "$ROOT_MAJOR" -gt 0 ] || return
|
||||
mkdir -m 0755 -p /run/udev/rules.d >/dev/null 2>&1
|
||||
ln -sf /run/udev /dev/.udev 2>/dev/null || :
|
||||
|
||||
echo "ACTION==\"add|change\", SUBSYSTEM==\"block\", \
|
||||
ENV{MAJOR}==\"$ROOT_MAJOR\", ENV{MINOR}==\"$ROOT_MINOR\", \
|
||||
SYMLINK+=\"root\"" > /run/udev/rules.d/10-root-symlink.rules
|
||||
|
||||
exit 0
|
Loading…
Reference in New Issue
Block a user