Accepting request 142568 from Base:System

- Fix creation of /dev/root link. 

- Add remount-ro-before-unmount.patch: always remount read-only
  before unmounting in final shutdown loop.
- Add switch-root-try-pivot-root.patch: try pivot_root before
  overmounting /

- links more manpages for migrated tools (from Christopher
  Yeleighton).
- disable boot.localnet service, ypbind service will do the right
  thing now (bnc#716746)
- add xdm-display-manager.patch: pull xdm.service instead of
  display-manager.service (needed until xdm initscript is migrated
  to native systemd service).
- Add fix-permissions-btmp.patch: ensure btmp is owned only by root
  (bnc#777405).
- Have the udev package create a tape group, as referenced by
  50-udev-default.rules and 60-persistent-storage-tape.rules
  (DimStar).
- Add fix-bad-memory-access.patch: fix crash in journal rotation.
- Add fix-dbus-crash.patch: fix D-Bus caused crash.
- Add sync-on-shutdown.patch: ensure sync is done when initiating
  shutdown.
- Add mount-efivars.patch: mount efivars if booting on UEFI.

- Ship a empty systemd-journald initscript in systemd-logger to
  stop insserv to complain about missing syslog dependency.
- Update
  0001-service-Fix-dependencies-added-when-parsing-insserv..patch
  with bug fixes from Debian.

OBS-URL: https://build.opensuse.org/request/show/142568
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=115
This commit is contained in:
Stephan Kulow 2012-11-26 18:58:02 +00:00 committed by Git OBS Bridge
commit a5f5e28ea2
18 changed files with 1222 additions and 79 deletions

View File

@ -1,17 +1,35 @@
From 6620bceb7233a830be3635a4f7a7dc75c13a9c8e Mon Sep 17 00:00:00 2001 Index: systemd-195/src/core/service.c
From: Frederic Crozat <fcrozat@suse.com>
Date: Fri, 30 Sep 2011 14:12:45 +0200
Subject: [PATCH] service: Fix dependencies added when parsing insserv.conf
---
src/service.c | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
Index: systemd-41/src/service.c
=================================================================== ===================================================================
--- systemd-41.orig/src/core/service.c --- systemd-195.orig/src/core/service.c
+++ systemd-41/src/core/service.c +++ systemd-195/src/core/service.c
@@ -3210,23 +3210,30 @@ static void sysv_facility_in_insserv_con @@ -3391,12 +3391,13 @@ static void service_notify_message(Unit
#ifdef HAVE_SYSV_COMPAT
-#ifdef TARGET_SUSE
-static void sysv_facility_in_insserv_conf(Manager *mgr) {
- FILE *f=NULL;
+#if defined(TARGET_SUSE) || defined(TARGET_DEBIAN)
+static void sysv_parse_insserv_conf(Manager *mgr, const char* filename) {
+ FILE *f = NULL;
int r;
- if (!(f = fopen("/etc/insserv.conf", "re"))) {
+ if (!(f = fopen(filename, "re"))) {
+ log_error("Failed to open file %s", filename);
r = errno == ENOENT ? 0 : -errno;
goto finish;
}
@@ -3410,7 +3411,7 @@ static void sysv_facility_in_insserv_con
break;
r = -errno;
- log_error("Failed to read configuration file '/etc/insserv.conf': %s", strerror(-r));
+ log_error("Failed to read configuration file '%s': %s", filename, strerror(-r));
goto finish;
}
@@ -3425,23 +3426,30 @@ static void sysv_facility_in_insserv_con
Unit *u; Unit *u;
if (sysv_translate_facility(parsed[0], NULL, &facility) < 0) if (sysv_translate_facility(parsed[0], NULL, &facility) < 0)
continue; continue;
@ -29,12 +47,12 @@ Index: systemd-41/src/service.c
STRV_FOREACH (j, parsed+1) { STRV_FOREACH (j, parsed+1) {
- if (*j[0]=='+') { - if (*j[0]=='+') {
- e = UNIT_WANTS; - e = UNIT_WANTS;
+ if (*j[0]=='+') + if (*j[0] == '+')
name = *j+1; name = *j+1;
- } - }
- else { - else {
- e = UNIT_REQUIRES; - e = UNIT_REQUIRES;
+ else + else
name = *j; name = *j;
- } - }
+ if (streq(name, "boot.localfs") || + if (streq(name, "boot.localfs") ||
@ -44,9 +62,54 @@ Index: systemd-41/src/service.c
continue; continue;
- r = unit_add_two_dependencies_by_name(u, UNIT_BEFORE, e, dep, NULL, true); - r = unit_add_two_dependencies_by_name(u, UNIT_BEFORE, e, dep, NULL, true);
+ r = unit_add_dependency_by_name_inverse(u, UNIT_BEFORE, dep, NULL, true); + r = unit_add_two_dependencies_by_name_inverse(u, UNIT_WANTS, UNIT_BEFORE, dep, NULL, true);
+ if (*j[0]!='+') + if (*j[0] != '+')
+ r = unit_add_dependency_by_name(u, UNIT_REQUIRES, dep, NULL, true); + r = unit_add_dependency_by_name(u, UNIT_REQUIRES, dep, NULL, true);
free(dep); free(dep);
} }
} }
@@ -3454,6 +3462,35 @@ finish:
fclose(f);
}
+
+static void sysv_facility_in_insserv_conf(Manager *mgr) {
+ DIR *d =NULL;
+ struct dirent *de;
+
+#ifdef TARGET_DEBIAN
+ if (!(d = opendir("/etc/insserv.conf.d/")))
+ if (errno != ENOENT) {
+ log_warning("opendir() failed on /etc/insserv.conf.d/ %s", strerror(errno));
+ goto finish;
+ }
+
+ while ((de = readdir(d))) {
+ char *path = NULL;
+ if (ignore_file(de->d_name))
+ continue;
+
+ path = join("/etc/insserv.conf.d/", de->d_name, NULL);
+ sysv_parse_insserv_conf(mgr, path);
+ free(path);
+ }
+finish:
+ if (d)
+ closedir(d);
+#endif
+
+ sysv_parse_insserv_conf(mgr, "/etc/insserv.conf");
+}
+
#endif
static int service_enumerate(Manager *m) {
@@ -3604,7 +3641,7 @@ static int service_enumerate(Manager *m)
r = 0;
-#ifdef TARGET_SUSE
+#if defined(TARGET_SUSE) || defined(TARGET_DEBIAN)
sysv_facility_in_insserv_conf (m);
#endif

View File

@ -0,0 +1,23 @@
From 7d73c1343be02a59b17de0cd34375deeb815d89c Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Tue, 20 Nov 2012 00:19:27 +0100
Subject: [PATCH] journald: fix bad memory access
https://bugzilla.redhat.com/show_bug.cgi?id=875653
---
src/journal/journald-server.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: systemd-195/src/journal/journald.c
===================================================================
--- systemd-195.orig/src/journal/journald.c
+++ systemd-195/src/journal/journald.c
@@ -342,7 +342,7 @@ static void server_rotate(Server *s) {
HASHMAP_FOREACH_KEY(f, k, s->user_journals, i) {
r = journal_file_rotate(&f, s->compress, s->seal);
if (r < 0)
- if (f->path)
+ if (f)
log_error("Failed to rotate %s: %s", f->path, strerror(-r));
else
log_error("Failed to create user journal: %s", strerror(-r));

32
fix-build-glibc217.patch Normal file
View File

@ -0,0 +1,32 @@
From e17187091d463ad008c0b74eb04de5078b2abb96 Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt@redhat.com>
Date: Wed, 14 Nov 2012 14:44:05 +0100
Subject: [PATCH] configure.ac: fix FTBFS with new glibc
glibc moved clock_* functions from librt to the core libc. As a result,
clock_gettime is no more a suitable symbol to use when finding librt.
Look for mq_open instead.
Reference:
http://www.sourceware.org/git/gitweb.cgi?p=glibc.git&h=6e6249d0b461b952d0f544792372663feb6d792a
Fixes a FTBFS in Fedora Rawhide.
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index c4638d1..71ea6ad 100644
--- a/configure.ac
+++ b/configure.ac
@@ -171,7 +171,7 @@ CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
-Wl,-z,now])
AC_SUBST([OUR_LDFLAGS], $with_ldflags)
-AC_SEARCH_LIBS([clock_gettime], [rt], [], [AC_MSG_ERROR([*** POSIX RT library not found])])
+AC_SEARCH_LIBS([mq_open], [rt], [], [AC_MSG_ERROR([*** POSIX RT library not found])])
AC_SEARCH_LIBS([dlsym], [dl], [], [AC_MSG_ERROR([*** Dynamic linking loader library not found])])
save_LIBS="$LIBS"
--
1.7.10.4

32
fix-dbus-crash.patch Normal file
View File

@ -0,0 +1,32 @@
From 645a9e5a2bbb06464a3fba1a3501e9d79e5bbad8 Mon Sep 17 00:00:00 2001
From: Eelco Dolstra <eelco.dolstra@logicblox.com>
Date: Wed, 31 Oct 2012 11:53:56 +0100
Subject: [PATCH] dbus-manager: fix a fatal dbus abort in
bus_manager_message_handler()
If ListUnitFiles fails, or an OOM occurs, then dbus_message_unref()
will be called twice on "reply", causing systemd to crash. So remove
the call to dbus_message_unref(); it is unnecessary because of
the cleanup attribute on "reply".
[zj: modified to leave one dbus_message_unref() alone, per Colin
Walters' comment.]
---
src/core/dbus-manager.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c
index 2010241..3cf3e90 100644
--- a/src/core/dbus-manager.c
+++ b/src/core/dbus-manager.c
@@ -1436,7 +1436,6 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection,
r = unit_file_get_list(m->running_as == SYSTEMD_SYSTEM ? UNIT_FILE_SYSTEM : UNIT_FILE_USER, NULL, h);
if (r < 0) {
unit_file_list_free(h);
- dbus_message_unref(reply);
return bus_send_error_reply(connection, message, NULL, r);
}
--
1.7.10.4

View File

@ -0,0 +1,13 @@
Index: systemd-44/tmpfiles.d/systemd.conf
===================================================================
--- systemd-44.orig/tmpfiles.d/systemd.conf
+++ systemd-44/tmpfiles.d/systemd.conf
@@ -11,7 +11,7 @@ d /run/user 0755 root root 10d
F /run/utmp 0664 root utmp -
f /var/log/wtmp 0664 root utmp -
-f /var/log/btmp 0600 root utmp -
+f /var/log/btmp 0600 root root -
d /var/cache/man - - - 30d

123
libgcrypt.m4 Normal file
View File

@ -0,0 +1,123 @@
dnl Autoconf macros for libgcrypt
dnl Copyright (C) 2002, 2004 Free Software Foundation, Inc.
dnl
dnl This file is free software; as a special exception the author gives
dnl unlimited permission to copy and/or distribute it, with or without
dnl modifications, as long as this notice is preserved.
dnl
dnl This file is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
dnl implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
dnl AM_PATH_LIBGCRYPT([MINIMUM-VERSION,
dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
dnl Test for libgcrypt and define LIBGCRYPT_CFLAGS and LIBGCRYPT_LIBS.
dnl MINIMUN-VERSION is a string with the version number optionalliy prefixed
dnl with the API version to also check the API compatibility. Example:
dnl a MINIMUN-VERSION of 1:1.2.5 won't pass the test unless the installed
dnl version of libgcrypt is at least 1.2.5 *and* the API number is 1. Using
dnl this features allows to prevent build against newer versions of libgcrypt
dnl with a changed API.
dnl
AC_DEFUN([AM_PATH_LIBGCRYPT],
[ AC_ARG_WITH(libgcrypt-prefix,
AC_HELP_STRING([--with-libgcrypt-prefix=PFX],
[prefix where LIBGCRYPT is installed (optional)]),
libgcrypt_config_prefix="$withval", libgcrypt_config_prefix="")
if test x$libgcrypt_config_prefix != x ; then
if test x${LIBGCRYPT_CONFIG+set} != xset ; then
LIBGCRYPT_CONFIG=$libgcrypt_config_prefix/bin/libgcrypt-config
fi
fi
AC_PATH_TOOL(LIBGCRYPT_CONFIG, libgcrypt-config, no)
tmp=ifelse([$1], ,1:1.2.0,$1)
if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
req_libgcrypt_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'`
min_libgcrypt_version=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\2/'`
else
req_libgcrypt_api=0
min_libgcrypt_version="$tmp"
fi
AC_MSG_CHECKING(for LIBGCRYPT - version >= $min_libgcrypt_version)
ok=no
if test "$LIBGCRYPT_CONFIG" != "no" ; then
req_major=`echo $min_libgcrypt_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
req_minor=`echo $min_libgcrypt_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
req_micro=`echo $min_libgcrypt_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
libgcrypt_config_version=`$LIBGCRYPT_CONFIG --version`
major=`echo $libgcrypt_config_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
minor=`echo $libgcrypt_config_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
micro=`echo $libgcrypt_config_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
if test "$major" -gt "$req_major"; then
ok=yes
else
if test "$major" -eq "$req_major"; then
if test "$minor" -gt "$req_minor"; then
ok=yes
else
if test "$minor" -eq "$req_minor"; then
if test "$micro" -ge "$req_micro"; then
ok=yes
fi
fi
fi
fi
fi
fi
if test $ok = yes; then
AC_MSG_RESULT([yes ($libgcrypt_config_version)])
else
AC_MSG_RESULT(no)
fi
if test $ok = yes; then
# If we have a recent libgcrypt, we should also check that the
# API is compatible
if test "$req_libgcrypt_api" -gt 0 ; then
tmp=`$LIBGCRYPT_CONFIG --api-version 2>/dev/null || echo 0`
if test "$tmp" -gt 0 ; then
AC_MSG_CHECKING([LIBGCRYPT API version])
if test "$req_libgcrypt_api" -eq "$tmp" ; then
AC_MSG_RESULT([okay])
else
ok=no
AC_MSG_RESULT([does not match. want=$req_libgcrypt_api got=$tmp])
fi
fi
fi
fi
if test $ok = yes; then
LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags`
LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs`
ifelse([$2], , :, [$2])
if test x"$host" != x ; then
libgcrypt_config_host=`$LIBGCRYPT_CONFIG --host 2>/dev/null || echo none`
if test x"$libgcrypt_config_host" != xnone ; then
if test x"$libgcrypt_config_host" != x"$host" ; then
AC_MSG_WARN([[
***
*** The config script $LIBGCRYPT_CONFIG was
*** built for $libgcrypt_config_host and thus may not match the
*** used host $host.
*** You may want to use the configure option --with-libgcrypt-prefix
*** to specify a matching config script.
***]])
fi
fi
fi
else
LIBGCRYPT_CFLAGS=""
LIBGCRYPT_LIBS=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(LIBGCRYPT_CFLAGS)
AC_SUBST(LIBGCRYPT_LIBS)
])

336
mount-efivars.patch Normal file
View File

@ -0,0 +1,336 @@
From f271dd97622b656c1c013d181ea615c671cc2438 Mon Sep 17 00:00:00 2001
From: "Lee, Chun-Yi" <joeyli.kernel@gmail.com>
Date: Sat, 27 Oct 2012 11:23:22 +0800
Subject: [PATCH] systemd: mount the EFI variable filesystem
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Add efivarfs to the mount_table in mount-setup.c, so the EFI variable
filesystem will be mounted when systemd executed.
The EFI variable filesystem will merge in v3.7 or v3.8 linux kernel.
Cc: Kay Sievers <kay@vrfy.org>
Cc: Lennart Poettering <lennart@poettering.net>
Cc: Mantas Mikulėnas <grawity@gmail.com>
Cc: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Cc: Matt Fleming <matt.fleming@intel.com>
Cc: Jeremy Kerr <jeremy.kerr@canonical.com>
Cc: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
---
src/core/kmod-setup.c | 7 ++++---
src/core/mount-setup.c | 1 +
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/core/kmod-setup.c b/src/core/kmod-setup.c
index cc2a2d9..ce8a8e7 100644
--- a/src/core/kmod-setup.c
+++ b/src/core/kmod-setup.c
@@ -31,9 +31,10 @@
#include "kmod-setup.h"
static const char * const kmod_table[] = {
- "autofs4", "/sys/class/misc/autofs",
- "ipv6", "/sys/module/ipv6",
- "unix", "/proc/net/unix"
+ "autofs4", "/sys/class/misc/autofs",
+ "ipv6", "/sys/module/ipv6",
+ "efivarfs", "/sys/firmware/efi/efivars",
+ "unix", "/proc/net/unix"
};
#pragma GCC diagnostic push
diff --git a/src/core/mount-setup.c b/src/core/mount-setup.c
index 0fd112f..9894c7f 100644
--- a/src/core/mount-setup.c
+++ b/src/core/mount-setup.c
@@ -66,6 +66,7 @@ static const MountPoint mount_table[] = {
{ "sysfs", "/sys", "sysfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV, true, true },
{ "devtmpfs", "/dev", "devtmpfs", "mode=755", MS_NOSUID|MS_STRICTATIME, true, true },
{ "securityfs", "/sys/kernel/security", "securityfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV, false, false },
+ { "efivarfs", "/sys/firmware/efi/efivars", "efivarfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV, false, false },
{ "tmpfs", "/dev/shm", "tmpfs", "mode=1777", MS_NOSUID|MS_NODEV|MS_STRICTATIME, true, true },
{ "devpts", "/dev/pts", "devpts", "mode=620,gid=" STRINGIFY(TTY_GID), MS_NOSUID|MS_NOEXEC, false, true },
{ "tmpfs", "/run", "tmpfs", "mode=755", MS_NOSUID|MS_NODEV|MS_STRICTATIME, true, true },
--
1.7.10.4
From c1e5704657315b436c0409e8172c1fcb76adccad Mon Sep 17 00:00:00 2001
From: Kay Sievers <kay@vrfy.org>
Date: Sun, 4 Nov 2012 16:06:27 +0100
Subject: [PATCH] shared: add is_efiboot()
---
src/shared/util.c | 4 ++++
src/shared/util.h | 2 ++
2 files changed, 6 insertions(+)
diff --git a/src/shared/util.c b/src/shared/util.c
index 2a8afae..9983695 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -77,6 +77,10 @@ char **saved_argv = NULL;
static volatile unsigned cached_columns = 0;
static volatile unsigned cached_lines = 0;
+bool is_efiboot(void) {
+ return access("/sys/firmware/efi", F_OK) >= 0;
+}
+
size_t page_size(void) {
static __thread size_t pgsz = 0;
long r;
diff --git a/src/shared/util.h b/src/shared/util.h
index e387b12..99972cc 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
@@ -90,6 +90,8 @@ union dirent_storage {
#define ANSI_HIGHLIGHT_YELLOW_ON "\x1B[1;33m"
#define ANSI_HIGHLIGHT_OFF "\x1B[0m"
+bool is_efiboot(void);
+
usec_t now(clockid_t clock);
dual_timestamp* dual_timestamp_get(dual_timestamp *ts);
--
1.7.10.4
From 1022373284b7562431fb0a6dba45db8af089a0e3 Mon Sep 17 00:00:00 2001
From: Kay Sievers <kay@vrfy.org>
Date: Sun, 4 Nov 2012 16:54:19 +0100
Subject: [PATCH] kmod-setup: add conditional module loading callback
---
src/core/kmod-setup.c | 32 ++++++++++++++++++++------------
1 file changed, 20 insertions(+), 12 deletions(-)
diff --git a/src/core/kmod-setup.c b/src/core/kmod-setup.c
index ce8a8e7..383a6b2 100644
--- a/src/core/kmod-setup.c
+++ b/src/core/kmod-setup.c
@@ -30,11 +30,17 @@
#include "kmod-setup.h"
-static const char * const kmod_table[] = {
- "autofs4", "/sys/class/misc/autofs",
- "ipv6", "/sys/module/ipv6",
- "efivarfs", "/sys/firmware/efi/efivars",
- "unix", "/proc/net/unix"
+typedef struct Kmodule {
+ const char *name;
+ const char *directory;
+ bool (*condition_fn)(void);
+} KModule;
+
+static const KModule kmod_table[] = {
+ { "autofs4", "/sys/class/misc/autofs", NULL } ,
+ { "ipv6", "/sys/module/ipv6", NULL },
+ { "efivarfs", "/sys/firmware/efi/efivars", NULL },
+ { "unix", "/proc/net/unix", NULL } ,
};
#pragma GCC diagnostic push
@@ -42,7 +48,8 @@ static const char * const kmod_table[] = {
static void systemd_kmod_log(void *data, int priority, const char *file, int line,
const char *fn, const char *format, va_list args)
{
- log_metav(priority, file, line, fn, format, args);
+ /* library logging is enabled at debug only */
+ log_metav(LOG_DEBUG, file, line, fn, format, args);
}
#pragma GCC diagnostic pop
@@ -53,13 +60,15 @@ int kmod_setup(void) {
int err;
for (i = 0; i < ELEMENTSOF(kmod_table); i += 2) {
+ if (kmod_table[i].condition_fn && !kmod_table[i].condition_fn())
+ continue;
- if (access(kmod_table[i+1], F_OK) >= 0)
+ if (access(kmod_table[i].directory, F_OK) >= 0)
continue;
log_debug("Your kernel apparently lacks built-in %s support. Might be a good idea to compile it in. "
"We'll now try to work around this by loading the module...",
- kmod_table[i]);
+ kmod_table[i].name);
if (!ctx) {
ctx = kmod_new(NULL, NULL);
@@ -69,13 +78,12 @@ int kmod_setup(void) {
}
kmod_set_log_fn(ctx, systemd_kmod_log, NULL);
-
kmod_load_resources(ctx);
}
- err = kmod_module_new_from_name(ctx, kmod_table[i], &mod);
+ err = kmod_module_new_from_name(ctx, kmod_table[i].name, &mod);
if (err < 0) {
- log_error("Failed to load module '%s'", kmod_table[i]);
+ log_error("Failed to lookup module '%s'", kmod_table[i].name);
continue;
}
@@ -85,7 +93,7 @@ int kmod_setup(void) {
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'", kmod_module_get_name(mod));
+ log_error("Failed to insert module '%s'", kmod_module_get_name(mod));
kmod_module_unref(mod);
}
--
1.7.10.4
From 3dfb265083347cb5700dc38f7cc0f479f378e6e9 Mon Sep 17 00:00:00 2001
From: Kay Sievers <kay@vrfy.org>
Date: Sun, 4 Nov 2012 16:55:23 +0100
Subject: [PATCH] kmod-setup: mounting efivarfs, *after* we tried to mount it,
is pointless
The mount() system call, which we issue before loading modules, will trigger
a modprobe by the kernel and block until it returns. Trying to load it again
later, will have exactly the same result as the first time.
---
src/core/kmod-setup.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/core/kmod-setup.c b/src/core/kmod-setup.c
index 383a6b2..20ab232 100644
--- a/src/core/kmod-setup.c
+++ b/src/core/kmod-setup.c
@@ -39,7 +39,6 @@ typedef struct Kmodule {
static const KModule kmod_table[] = {
{ "autofs4", "/sys/class/misc/autofs", NULL } ,
{ "ipv6", "/sys/module/ipv6", NULL },
- { "efivarfs", "/sys/firmware/efi/efivars", NULL },
{ "unix", "/proc/net/unix", NULL } ,
};
--
1.7.10.4
From 6aa220e019f9dffd96590b06b68f937985204109 Mon Sep 17 00:00:00 2001
From: Kay Sievers <kay@vrfy.org>
Date: Sun, 4 Nov 2012 17:03:48 +0100
Subject: [PATCH] mount-setup: try mounting 'efivarfs' only if the system
bootet with EFI
---
TODO | 3 ---
src/core/mount-setup.c | 50 ++++++++++++++++++++++++++++++++----------------
2 files changed, 34 insertions(+), 19 deletions(-)
diff --git a/src/core/mount-setup.c b/src/core/mount-setup.c
index 9894c7f..98614d0 100644
--- a/src/core/mount-setup.c
+++ b/src/core/mount-setup.c
@@ -46,14 +46,20 @@
#define TTY_GID 5
#endif
+typedef enum MountMode {
+ MNT_NONE = 0,
+ MNT_FATAL = 1 << 0,
+ MNT_IN_CONTAINER = 1 << 1,
+} MountMode;
+
typedef struct MountPoint {
const char *what;
const char *where;
const char *type;
const char *options;
unsigned long flags;
- bool fatal;
- bool in_container;
+ bool (*condition_fn)(void);
+ MountMode mode;
} MountPoint;
/* The first three entries we might need before SELinux is up. The
@@ -62,16 +68,26 @@ typedef struct MountPoint {
#define N_EARLY_MOUNT 4
static const MountPoint mount_table[] = {
- { "proc", "/proc", "proc", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV, true, true },
- { "sysfs", "/sys", "sysfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV, true, true },
- { "devtmpfs", "/dev", "devtmpfs", "mode=755", MS_NOSUID|MS_STRICTATIME, true, true },
- { "securityfs", "/sys/kernel/security", "securityfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV, false, false },
- { "efivarfs", "/sys/firmware/efi/efivars", "efivarfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV, false, false },
- { "tmpfs", "/dev/shm", "tmpfs", "mode=1777", MS_NOSUID|MS_NODEV|MS_STRICTATIME, true, true },
- { "devpts", "/dev/pts", "devpts", "mode=620,gid=" STRINGIFY(TTY_GID), MS_NOSUID|MS_NOEXEC, false, true },
- { "tmpfs", "/run", "tmpfs", "mode=755", MS_NOSUID|MS_NODEV|MS_STRICTATIME, true, true },
- { "tmpfs", "/sys/fs/cgroup", "tmpfs", "mode=755", MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_STRICTATIME, false, true },
- { "cgroup", "/sys/fs/cgroup/systemd", "cgroup", "none,name=systemd", MS_NOSUID|MS_NOEXEC|MS_NODEV, false, true },
+ { "proc", "/proc", "proc", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV,
+ NULL, MNT_FATAL|MNT_IN_CONTAINER },
+ { "sysfs", "/sys", "sysfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV,
+ NULL, MNT_FATAL|MNT_IN_CONTAINER },
+ { "devtmpfs", "/dev", "devtmpfs", "mode=755", MS_NOSUID|MS_STRICTATIME,
+ NULL, MNT_FATAL|MNT_IN_CONTAINER },
+ { "securityfs", "/sys/kernel/security", "securityfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV,
+ NULL, MNT_NONE },
+ { "efivarfs", "/sys/firmware/efi/efivars", "efivarfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV,
+ is_efiboot, MNT_NONE },
+ { "tmpfs", "/dev/shm", "tmpfs", "mode=1777", MS_NOSUID|MS_NODEV|MS_STRICTATIME,
+ NULL, MNT_FATAL|MNT_IN_CONTAINER },
+ { "devpts", "/dev/pts", "devpts", "mode=620,gid=" STRINGIFY(TTY_GID), MS_NOSUID|MS_NOEXEC,
+ NULL, MNT_IN_CONTAINER },
+ { "tmpfs", "/run", "tmpfs", "mode=755", MS_NOSUID|MS_NODEV|MS_STRICTATIME,
+ NULL, MNT_FATAL|MNT_IN_CONTAINER },
+ { "tmpfs", "/sys/fs/cgroup", "tmpfs", "mode=755", MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_STRICTATIME,
+ NULL, MNT_IN_CONTAINER },
+ { "cgroup", "/sys/fs/cgroup/systemd", "cgroup", "none,name=systemd", MS_NOSUID|MS_NOEXEC|MS_NODEV,
+ NULL, MNT_IN_CONTAINER },
};
/* These are API file systems that might be mounted by other software,
@@ -119,6 +135,9 @@ static int mount_one(const MountPoint *p, bool relabel) {
assert(p);
+ if (p->condition_fn && !p->condition_fn())
+ return 0;
+
/* Relabel first, just in case */
if (relabel)
label_fix(p->where, true, true);
@@ -131,7 +150,7 @@ static int mount_one(const MountPoint *p, bool relabel) {
return 0;
/* Skip securityfs in a container */
- if (!p->in_container && detect_container(NULL) > 0)
+ if (!(p->mode & MNT_IN_CONTAINER) && detect_container(NULL) > 0)
return 0;
/* The access mode here doesn't really matter too much, since
@@ -149,8 +168,8 @@ static int mount_one(const MountPoint *p, bool relabel) {
p->type,
p->flags,
p->options) < 0) {
- log_full(p->fatal ? LOG_ERR : LOG_DEBUG, "Failed to mount %s: %s", p->where, strerror(errno));
- return p->fatal ? -errno : 0;
+ log_full((p->mode & MNT_FATAL) ? LOG_ERR : LOG_DEBUG, "Failed to mount %s: %s", p->where, strerror(errno));
+ return (p->mode & MNT_FATAL) ? -errno : 0;
}
/* Relabel again, since we now mounted something fresh here */
@@ -289,7 +308,6 @@ int mount_cgroup_controllers(char ***join_controllers) {
p.type = "cgroup";
p.options = options;
p.flags = MS_NOSUID|MS_NOEXEC|MS_NODEV;
- p.fatal = false;
r = mount_one(&p, true);
free(controller);
--
1.7.10.4

View File

@ -0,0 +1,95 @@
From 93bd157722c76b47d80742f290373c1ce2865070 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Fri, 16 Nov 2012 18:36:28 +0100
Subject: [PATCH] umount: always remount read-only before unmounting in final
shutdown loop
---
src/core/umount.c | 57 +++++++++++++++++++++++++----------------------------
1 file changed, 27 insertions(+), 30 deletions(-)
diff --git a/src/core/umount.c b/src/core/umount.c
index 83c9de3..e794057 100644
--- a/src/core/umount.c
+++ b/src/core/umount.c
@@ -407,6 +407,33 @@ static int mount_points_list_umount(MountPoint **head, bool *changed, bool log_e
assert(head);
LIST_FOREACH_SAFE(mount_point, m, n, *head) {
+
+ /* If we are in a container, don't attempt to
+ read-only mount anything as that brings no real
+ benefits, but might confuse the host, as we remount
+ the superblock here, not the bind mound. */
+ if (detect_container(NULL) <= 0) {
+ /* We always try to remount directories
+ * read-only first, before we go on and umount
+ * them.
+ *
+ * Mount points can be stacked. If a mount
+ * point is stacked below / or /usr, we
+ * cannnot umount or remount it directly,
+ * since there is no way to refer to the
+ * underlying mount. There's nothing we can do
+ * about it for the general case, but we can
+ * do something about it if it is aliased
+ * somehwere else via a bind mount. If we
+ * explicitly remount the super block of that
+ * alias read-only we hence should be
+ * relatively safe regarding keeping the fs we
+ * can otherwise not see dirty. */
+ mount(NULL, m->path, NULL, MS_REMOUNT|MS_RDONLY, NULL);
+ }
+
+ /* Skip / and /usr since we cannot unmount that
+ * anyway, since we are running from it */
if (path_equal(m->path, "/")
#ifndef HAVE_SPLIT_USR
|| path_equal(m->path, "/usr")
@@ -432,29 +459,6 @@ static int mount_points_list_umount(MountPoint **head, bool *changed, bool log_e
return n_failed;
}
-static int mount_points_list_remount_read_only(MountPoint **head, bool *changed) {
- MountPoint *m, *n;
- int n_failed = 0;
-
- assert(head);
-
- LIST_FOREACH_SAFE(mount_point, m, n, *head) {
-
- /* Trying to remount read-only */
- if (mount(NULL, m->path, NULL, MS_REMOUNT|MS_RDONLY, NULL) == 0) {
- if (changed)
- *changed = true;
-
- mount_point_free(head, m);
- } else {
- log_warning("Could not remount as read-only %s: %m", m->path);
- n_failed++;
- }
- }
-
- return n_failed;
-}
-
static int swap_points_list_off(MountPoint **head, bool *changed) {
MountPoint *m, *n;
int n_failed = 0;
@@ -571,13 +575,6 @@ int umount_all(bool *changed) {
if (r <= 0)
goto end;
- /* If we are in a container, don't attempt to read-only mount
- anything as that brings no real benefits, but might confuse
- the host, as we remount the superblock here, not the bind
- mound. */
- if (detect_container(NULL) <= 0)
- r = mount_points_list_remount_read_only(&mp_list_head, changed);
-
end:
mount_points_list_free(&mp_list_head);
--
1.7.10.4

View File

@ -0,0 +1,81 @@
From 891a4918ef75fa81e22691156c050d061bd53dd3 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Fri, 16 Nov 2012 18:15:30 +0100
Subject: [PATCH] switch-root: try pivot_root() before overmounting /
We should always try to umount the old root dir if possible, instead of
overmounting it -- if that's possible.
The initial ("first") kernel rootfs can never be umounted, hence
for the usual nitrd case we never bothered using pivot_root() and
hence with fully unmounting it. However, fedup now tranisitions twice
during boot, and in that case it is highly desirable that the "second"
root dir is entirely unmounted when we switch to the "third". This patch
makes that possible.
The pivot_root() needs a directory in the "third" root dir, to move the
"second" root dir to. We use /mnt for that, under the assumption that
this directory is likely to exist, and is not itself a mount point.
---
src/core/switch-root.c | 27 ++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
diff --git a/src/core/switch-root.c b/src/core/switch-root.c
index 150332a..ce0e41d 100644
--- a/src/core/switch-root.c
+++ b/src/core/switch-root.c
@@ -30,6 +30,7 @@
#include "util.h"
#include "path-util.h"
#include "switch-root.h"
+#include "missing.h"
int switch_root(const char *new_root) {
@@ -44,10 +45,21 @@ int switch_root(const char *new_root) {
struct stat new_root_stat;
bool old_root_remove;
const char *i;
+ _cleanup_free_ char *temporary_old_root = NULL;
if (path_equal(new_root, "/"))
return 0;
+ /* When using pivot_root() we assume that /mnt exists as place
+ * we can temporarily move the old root to. As we immediately
+ * unmount it from there it doesn't matter much which
+ * directory we choose for this, but it should be more likely
+ * than not that /mnt exists and is suitable as mount point
+ * and is on the same fs as the old root dir */
+ temporary_old_root = strappend(new_root, "/mnt");
+ if (!temporary_old_root)
+ return -ENOMEM;
+
old_root_remove = in_initrd();
if (stat(new_root, &new_root_stat) < 0) {
@@ -103,7 +115,20 @@ int switch_root(const char *new_root) {
log_warning("Failed to open root directory: %m");
}
- if (mount(new_root, "/", NULL, MS_MOVE, NULL) < 0) {
+ /* We first try a pivot_root() so that we can umount the old
+ * root dir. In many cases (i.e. where rootfs is /), that's
+ * not possible however, and hence we simply overmount root */
+ if (pivot_root(new_root, temporary_old_root) >= 0) {
+
+ /* Immediately get rid of the old root. Since we are
+ * running off it we need to do this lazily. */
+ if (umount2(temporary_old_root, MNT_DETACH) < 0) {
+ r = -errno;
+ log_error("Failed to umount old root dir %s: %m", temporary_old_root);
+ goto fail;
+ }
+
+ } else if (mount(new_root, "/", NULL, MS_MOVE, NULL) < 0) {
r = -errno;
log_error("Failed to mount moving %s to /: %m", new_root);
goto fail;
--
1.7.10.4

49
sync-on-shutdown.patch Normal file
View File

@ -0,0 +1,49 @@
From 0049f05a8bb82c3e084bacc5945596761d706c55 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Fri, 16 Nov 2012 01:30:29 +0100
Subject: [PATCH] shutdown: readd explicit sync() when shutting down
As it turns out reboot() doesn't actually imply a file system sync, but
only a disk sync. Accordingly, readd explicit sync() invocations
immediately before we invoke reboot().
This is much less dramatic than it might sounds as we umount all
disks/read-only remount them anyway before going down.
---
src/core/service.c | 1 +
src/core/shutdown.c | 7 +++++++
2 files changed, 8 insertions(+)
diff --git a/src/core/service.c b/src/core/service.c
index cf08485..df72aba 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -2485,6 +2485,7 @@ static int service_start_limit_test(Service *s) {
case SERVICE_START_LIMIT_REBOOT_IMMEDIATE:
log_warning("%s start request repeated too quickly, rebooting immediately.", UNIT(s)->id);
+ sync();
reboot(RB_AUTOBOOT);
break;
diff --git a/src/core/shutdown.c b/src/core/shutdown.c
index cc8c57b..b59aef1 100644
--- a/src/core/shutdown.c
+++ b/src/core/shutdown.c
@@ -273,6 +273,13 @@ int main(int argc, char *argv[]) {
}
}
+ /* The kernel will automaticall flush ATA disks and suchlike
+ * on reboot(), but the file systems need to be synce'd
+ * explicitly in advance. So let's do this here, but not
+ * needlessly slow down containers. */
+ if (!in_container)
+ sync();
+
if (cmd == LINUX_REBOOT_CMD_KEXEC) {
if (!in_container) {
--
1.7.10.4

33
systemd-journald.init Normal file
View File

@ -0,0 +1,33 @@
#! /bin/sh
#
# Copyright (c) 2001-2002 SuSE Linux AG, Nuernberg, Germany.
# All rights reserved.
#
# /etc/init.d/systemd-journald
#
### BEGIN INIT INFO
# Provides: syslog
# Required-Start: $null
# Required-Stop: $null
# Default-Start: 2 3 5
# Default-Stop:
# Short-Description: compat wrapper for journald
# Description: compat wrapper for journald
### END INIT INFO
. /etc/rc.status
rc_reset
case "$1" in
start|stop|restart)
rc_failed 3
rc_status -v
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac
rc_exit

View File

@ -1,3 +1,65 @@
-------------------------------------------------------------------
Thu Nov 22 14:22:00 UTC 2012 - rmilasan@suse.com
- Fix creation of /dev/root link.
-------------------------------------------------------------------
Tue Nov 20 18:25:49 CET 2012 - fcrozat@suse.com
- Add remount-ro-before-unmount.patch: always remount read-only
before unmounting in final shutdown loop.
- Add switch-root-try-pivot-root.patch: try pivot_root before
overmounting /
-------------------------------------------------------------------
Tue Nov 20 09:36:43 UTC 2012 - fcrozat@suse.com
- links more manpages for migrated tools (from Christopher
Yeleighton).
- disable boot.localnet service, ypbind service will do the right
thing now (bnc#716746)
- add xdm-display-manager.patch: pull xdm.service instead of
display-manager.service (needed until xdm initscript is migrated
to native systemd service).
- Add fix-permissions-btmp.patch: ensure btmp is owned only by root
(bnc#777405).
- Have the udev package create a tape group, as referenced by
50-udev-default.rules and 60-persistent-storage-tape.rules
(DimStar).
- Add fix-bad-memory-access.patch: fix crash in journal rotation.
- Add fix-dbus-crash.patch: fix D-Bus caused crash.
- Add sync-on-shutdown.patch: ensure sync is done when initiating
shutdown.
- Add mount-efivars.patch: mount efivars if booting on UEFI.
-------------------------------------------------------------------
Thu Nov 15 14:31:28 UTC 2012 - fcrozat@suse.com
- Ship a empty systemd-journald initscript in systemd-logger to
stop insserv to complain about missing syslog dependency.
- Update
0001-service-Fix-dependencies-added-when-parsing-insserv..patch
with bug fixes from Debian.
-------------------------------------------------------------------
Wed Nov 14 17:36:05 UTC 2012 - fcrozat@suse.com
- /var/log/journal is now only provided by systemd-logger (journal
won't be persistent for people using another syslog
implementation).
- install README in /var/log (in systemd-logger) and /etc/init.d
- create adm group when installing systemd.
- fix path in udev-root-symlink.systemd.
- Enforce Requires(post) dependency on libudev in main systemd
package (help upgrade).
- Ensure configuration is reloaded when upgrading and save random
seed when installing.
- Create /lib/udev symlink, if we do a fresh install.
- Add fix-build-glibc217.patch: fix build with latest glibc.
- Add libgcrypt.m4: copy of autoconf macro from libgcrypt, only
used to bootstrap systemd-mini.
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Nov 6 14:40:37 UTC 2012 - coolo@suse.com Tue Nov 6 14:40:37 UTC 2012 - coolo@suse.com

View File

@ -86,6 +86,7 @@ Requires: %{udevpkgname} >= 172
Requires: dbus-1 >= 1.4.0 Requires: dbus-1 >= 1.4.0
Requires: kbd Requires: kbd
Requires: pam-config >= 0.79-5 Requires: pam-config >= 0.79-5
Requires: pwdutils
Requires: systemd-presets-branding Requires: systemd-presets-branding
Requires: util-linux >= 2.21 Requires: util-linux >= 2.21
Requires(post): coreutils Requires(post): coreutils
@ -100,6 +101,8 @@ Source3: systemd-sysv-convert
Source4: macros.systemd Source4: macros.systemd
Source5: systemd-insserv_conf Source5: systemd-insserv_conf
Source6: baselibs.conf Source6: baselibs.conf
Source7: libgcrypt.m4
Source8: systemd-journald.init
Source1060: boot.udev Source1060: boot.udev
Source1061: write_dev_root_rule Source1061: write_dev_root_rule
@ -126,6 +129,8 @@ Patch53: fastboot-forcefsck.patch
Patch56: support-suse-clock-sysconfig.patch Patch56: support-suse-clock-sysconfig.patch
Patch59: fix-enable-disable-boot-initscript.patch Patch59: fix-enable-disable-boot-initscript.patch
Patch60: var-run-lock.patch Patch60: var-run-lock.patch
Patch63: xdm-display-manager.patch
Patch64: fix-permissions-btmp.patch
# Upstream First - Policy: # Upstream First - Policy:
# Never add any patches to this package without the upstream commit id # Never add any patches to this package without the upstream commit id
@ -133,6 +138,20 @@ Patch60: var-run-lock.patch
# an exception will be silently removed with the next version update. # an exception will be silently removed with the next version update.
# PATCH-FIX-UPSTREAM fix-logind-pty-seat.patch fcrozat@suse.com -- fix logind complaining when doing su/sudo in X terminal # PATCH-FIX-UPSTREAM fix-logind-pty-seat.patch fcrozat@suse.com -- fix logind complaining when doing su/sudo in X terminal
Patch61: fix-logind-pty-seat.patch Patch61: fix-logind-pty-seat.patch
# PATCH-FIX-UPSTREAM fix-build-glibc217.patch fcrozat@suse.com -- fix build with latest glibc
Patch62: fix-build-glibc217.patch
# PATCH-FIX-UPSTREAM fix-bad-memory-access.patch fcrozat@suse.com -- fix bad memory access
Patch65: fix-bad-memory-access.patch
# PATCH-FIX-UPSTREAM fix-dbus-crash.patch fcrozat@suse.com -- fix D-Bus caused crash
Patch66: fix-dbus-crash.patch
# PATCH-FIX-UPSTREAM sync-on-shutdown.patch fcrozat@suse.com -- Sync on shutdown
Patch67: sync-on-shutdown.patch
# PATCH-FIX-UPSTREAM mount-efivars.patch fcrozat@suse.com -- mount efivars if booting under UEFI
Patch68: mount-efivars.patch
# PATCH-FIX-UPSTREAM switch-root-try-pivot-root.patch fcrozat@suse.com -- try pivot_root before overmounting /
Patch69: switch-root-try-pivot-root.patch
# PATCH-FIX-UPSTREAM remount-ro-before-unmount.patch fcrozat@suse.com -- remount ro before unmounting in final shutdown loop
Patch70: remount-ro-before-unmount.patch
# udev patches # udev patches
# PATCH-FIX-OPENSUSE 0001-Reinstate-TIMEOUT-handling.patch # PATCH-FIX-OPENSUSE 0001-Reinstate-TIMEOUT-handling.patch
@ -147,8 +166,6 @@ Patch1026: 0026-udev-netlink-null-rules.patch
# PATCH-FIX-OPENSUSE 0027-udev-fix-sg-autoload-regression.patch # PATCH-FIX-OPENSUSE 0027-udev-fix-sg-autoload-regression.patch
Patch1027: 0027-udev-fix-sg-autoload-regression.patch Patch1027: 0027-udev-fix-sg-autoload-regression.patch
# systemd patches
%description %description
Systemd is a system and service manager, compatible with SysV and LSB Systemd is a system and service manager, compatible with SysV and LSB
init scripts for Linux. systemd provides aggressive parallelization init scripts for Linux. systemd provides aggressive parallelization
@ -204,6 +221,7 @@ License: GPL-2.0
Group: System/Kernel Group: System/Kernel
Url: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html 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 PreReq: /bin/pidof /bin/rm /usr/bin/stat %insserv_prereq %fillup_prereq /usr/sbin/groupadd /usr/bin/getent /sbin/mkinitrd
Requires(post): lib%{udevpkgname}%{udev_major}
Conflicts: systemd < 39 Conflicts: systemd < 39
Conflicts: aaa_base < 11.5 Conflicts: aaa_base < 11.5
Conflicts: filesystem < 11.5 Conflicts: filesystem < 11.5
@ -296,6 +314,11 @@ This package marks the installation to not use syslog but only the journal.
%prep %prep
%setup -q -n systemd-%{version} %setup -q -n systemd-%{version}
# only needed for bootstrap
%if 0%{?bootstrap}
cp %{SOURCE7} m4/
%endif
#udev #udev
%patch1001 -p1 %patch1001 -p1
%patch1013 -p1 %patch1013 -p1
@ -303,6 +326,7 @@ This package marks the installation to not use syslog but only the journal.
%patch1026 -p1 %patch1026 -p1
%patch1027 -p1 %patch1027 -p1
#systemd
%patch1 -p1 %patch1 -p1
%patch6 -p1 %patch6 -p1
# don't apply when bootstrapping to not modify configure.in # don't apply when bootstrapping to not modify configure.in
@ -326,11 +350,18 @@ This package marks the installation to not use syslog but only the journal.
%patch59 -p1 %patch59 -p1
%patch60 -p1 %patch60 -p1
%patch61 -p1 %patch61 -p1
%patch62 -p1
%patch63 -p1
%patch64 -p1
%patch65 -p1
%patch66 -p1
%patch67 -p1
%patch68 -p1
%patch69 -p1
%patch70 -p1
%build %build
%if ! 0%{?bootstrap}
autoreconf -fiv autoreconf -fiv
%endif
# prevent pre-generated and distributed files from re-building # prevent pre-generated and distributed files from re-building
find . -name "*.[1-8]" -exec touch '{}' \; find . -name "*.[1-8]" -exec touch '{}' \;
export V=1 export V=1
@ -359,21 +390,24 @@ 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}/systemd-ask-password $RPM_BUILD_ROOT/bin/systemd-ask-password
ln -sf %{_bindir}/systemctl $RPM_BUILD_ROOT/bin/systemctl ln -sf %{_bindir}/systemctl $RPM_BUILD_ROOT/bin/systemctl
ln -sf %{_prefix}/lib/systemd/systemd-udevd $RPM_BUILD_ROOT/sbin/udevd ln -sf %{_prefix}/lib/systemd/systemd-udevd $RPM_BUILD_ROOT/sbin/udevd
%if ! 0%{?bootstrap}
ln -sf systemd-udevd.8 $RPM_BUILD_ROOT/%{_mandir}/man8/udevd.8
%endif
mkdir -p $RPM_BUILD_ROOT/%{_prefix}/usr/lib/firmware/updates mkdir -p $RPM_BUILD_ROOT/%{_prefix}/usr/lib/firmware/updates
ln -sf /lib/firmware $RPM_BUILD_ROOT/usr/lib/firmware ln -sf /lib/firmware $RPM_BUILD_ROOT/usr/lib/firmware
%if ! 0%{?bootstrap}
install -m755 -D %{S:8} $RPM_BUILD_ROOT/etc/init.d/systemd-journald
%endif
install -m755 -D %{S:1060} $RPM_BUILD_ROOT/etc/init.d/boot.udev install -m755 -D %{S:1060} $RPM_BUILD_ROOT/etc/init.d/boot.udev
ln -s systemd-udevd.service $RPM_BUILD_ROOT/%{_prefix}/lib/systemd/system/udev.service ln -s systemd-udevd.service $RPM_BUILD_ROOT/%{_prefix}/lib/systemd/system/udev.service
sed -ie "s|@@PREFIX@@|%{_bindir}|g" %{S:1061}
install -m755 -D %{S:1061} $RPM_BUILD_ROOT/%{_prefix}/lib/udev/write_dev_root_rule install -m755 -D %{S:1061} $RPM_BUILD_ROOT/%{_prefix}/lib/udev/write_dev_root_rule
sed -ie "s|@@PREFIX@@|%{_prefix}/lib/udev|g" %{S:1062}
install -m644 -D %{S:1062} $RPM_BUILD_ROOT/%{_prefix}/lib/systemd/system/udev-root-symlink.service 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 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 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 #workaround for 716939
chmod 644 %{buildroot}%{_bindir}/systemd-analyze chmod 644 %{buildroot}%{_bindir}/systemd-analyze
mkdir -p %{buildroot}%{_sysconfdir}/rpm mkdir -p %{buildroot}%{_sysconfdir}/rpm
@ -383,7 +417,7 @@ mkdir -p %{buildroot}/{sbin,var/lib/systemd/sysv-convert,var/lib/systemd/migrate
install -m755 %{S:3} -D %{buildroot}%{_sbindir}/systemd-sysv-convert install -m755 %{S:3} -D %{buildroot}%{_sbindir}/systemd-sysv-convert
# do not install, code has been fixed, might be useful in the future # do not install, code has been fixed, might be useful in the future
#install -m755 %{S:5} %{buildroot}/lib/systemd/system-generators #install -m755 %{S:5} %{buildroot}/usr/lib/systemd/system-generators
ln -s ../usr/lib/systemd/systemd %{buildroot}/bin/systemd ln -s ../usr/lib/systemd/systemd %{buildroot}/bin/systemd
ln -s ../usr/lib/systemd/systemd %{buildroot}/sbin/init ln -s ../usr/lib/systemd/systemd %{buildroot}/sbin/init
ln -s ../usr/bin/systemctl %{buildroot}/sbin/reboot ln -s ../usr/bin/systemctl %{buildroot}/sbin/reboot
@ -406,8 +440,7 @@ 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/ldconfig.service
ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/loadmodules.service ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/loadmodules.service
install -m644 %{S:2} %{buildroot}/%{_prefix}/lib/systemd/system/localfs.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/localnet.service
ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/proc.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 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/single.service
@ -426,12 +459,19 @@ rm %{buildroot}/%{_prefix}/lib/systemd/system/local-fs.target.wants/tmp.mount
# journal. # journal.
rm -f %{buildroot}%{_libdir}/../lib/sysctl.d/coredump.conf rm -f %{buildroot}%{_libdir}/../lib/sysctl.d/coredump.conf
# remove README files for now # remove README file for now
rm -f %{buildroot}/var/log/README %{buildroot}/etc/init.d/README rm -f %{buildroot}/etc/init.d/README
%if 0%{?bootstrap}
rm -f %{buildroot}/var/log/README
%endif
# legacy links # legacy links
ln -s loginctl %{buildroot}%{_bindir}/systemd-loginctl for f in loginctl journalctl ; do
ln -s journalctl %{buildroot}%{_bindir}/systemd-journalctl ln -s $f %{buildroot}%{_bindir}/systemd-$f
%if ! 0%{?bootstrap}
ln -s $f.1 %{buildroot}%{_mandir}/man1/systemd-$f.1
%endif
done
ln -s /usr/lib/udev %{buildroot}/lib/udev ln -s /usr/lib/udev %{buildroot}/lib/udev
# Create the /var/log/journal directory to change the volatile journal to a persistent one # Create the /var/log/journal directory to change the volatile journal to a persistent one
@ -451,10 +491,15 @@ mkdir -p %{buildroot}%{_prefix}/lib/systemd/system/syslog.target.wants
%fdupes -s %{buildroot}%{_mandir} %fdupes -s %{buildroot}%{_mandir}
%pre
getent group adm >/dev/null || groupadd -r adm
exit 0
%post %post
/usr/sbin/pam-config -a --systemd >/dev/null 2>&1 || : /usr/sbin/pam-config -a --systemd >/dev/null 2>&1 || :
/sbin/ldconfig /sbin/ldconfig
/usr/bin/systemd-machine-id-setup >/dev/null 2>&1 || : /usr/bin/systemd-machine-id-setup >/dev/null 2>&1 || :
/usr/lib/systemd/systemd-random-seed save >/dev/null 2>&1 || :
/usr/bin/systemctl daemon-reexec >/dev/null 2>&1 || : /usr/bin/systemctl daemon-reexec >/dev/null 2>&1 || :
# Try to read default runlevel from the old inittab if it exists # Try to read default runlevel from the old inittab if it exists
@ -485,6 +530,7 @@ fi
%postun %postun
/sbin/ldconfig /sbin/ldconfig
if [ $1 -ge 1 ]; then if [ $1 -ge 1 ]; then
/usr/bin/systemctl daemon-reload >/dev/null 2>&1 || :
/usr/bin/systemctl try-restart systemd-logind.service >/dev/null 2>&1 || : /usr/bin/systemctl try-restart systemd-logind.service >/dev/null 2>&1 || :
fi fi
if [ $1 -eq 0 ]; then if [ $1 -eq 0 ]; then
@ -511,7 +557,11 @@ if test -L /usr/lib/udev -a /lib/udev -ef /usr/lib/udev ; then
rm /usr/lib/udev rm /usr/lib/udev
mv /lib/udev /usr/lib mv /lib/udev /usr/lib
ln -s /usr/lib/udev /lib/udev ln -s /usr/lib/udev /lib/udev
elif [ ! -e /lib/udev ]; then
ln -s /usr/lib/udev /lib/udev
fi fi
# Create "tape" group which is referenced by 50-udev-default.rules and 60-persistent-storage-tape.rules
/usr/sbin/groupadd -r tape 2> /dev/null || :
# kill daemon if we are not in a chroot # kill daemon if we are not in a chroot
if test -f /proc/1/exe -a -d /proc/1/root ; then if test -f /proc/1/exe -a -d /proc/1/root ; then
if test "$(stat -Lc '%%D-%%i' /)" = "$(stat -Lc '%%D-%%i' /proc/1/root)"; then if test "$(stat -Lc '%%D-%%i' /)" = "$(stat -Lc '%%D-%%i' /proc/1/root)"; then
@ -540,24 +590,28 @@ if test -f /proc/1/exe -a -d /proc/1/root; then
fi fi
fi fi
[ -x /sbin/mkinitrd_setup ] && /sbin/mkinitrd_setup if [ "${YAST_IS_RUNNING}" != "instsys" ]; then
if [ -e /var/lib/no_initrd_recreation_by_suspend ]; then if [ -e /var/lib/no_initrd_recreation_by_suspend ]; then
echo "Skipping recreation of existing initial ramdisks, due" echo "Skipping recreation of existing initial ramdisks, due"
echo "to presence of /var/lib/no_initrd_recreation_by_suspend" echo "to presence of /var/lib/no_initrd_recreation_by_suspend"
elif [ -x /sbin/mkinitrd ]; then elif [ -x /sbin/mkinitrd ]; then
/sbin/mkinitrd [ -x /sbin/mkinitrd_setup ] && /sbin/mkinitrd_setup
/sbin/mkinitrd || :
fi
fi fi
%postun -n %{udevpkgname} %postun -n %{udevpkgname}
%insserv_cleanup %insserv_cleanup
systemctl daemon-reload >/dev/null 2>&1 || : systemctl daemon-reload >/dev/null 2>&1 || :
[ -x /sbin/mkinitrd_setup ] && /sbin/mkinitrd_setup if [ "${YAST_IS_RUNNING}" != "instsys" ]; then
if [ -e /var/lib/no_initrd_recreation_by_suspend ]; then if [ -e /var/lib/no_initrd_recreation_by_suspend ]; then
echo "Skipping recreation of existing initial ramdisks, due" echo "Skipping recreation of existing initial ramdisks, due"
echo "to presence of /var/lib/no_initrd_recreation_by_suspend" echo "to presence of /var/lib/no_initrd_recreation_by_suspend"
elif [ -x /sbin/mkinitrd ]; then elif [ -x /sbin/mkinitrd ]; then
/sbin/mkinitrd [ -x /sbin/mkinitrd_setup ] && /sbin/mkinitrd_setup
/sbin/mkinitrd || :
fi
fi fi
%post -n lib%{udevpkgname}%{udev_major} -p /sbin/ldconfig %post -n lib%{udevpkgname}%{udev_major} -p /sbin/ldconfig
@ -572,7 +626,7 @@ fi
%endif %endif
%clean %clean
rm -rf %{buildroot} # rm -rf %{buildroot}
%files %files
%defattr(-,root,root) %defattr(-,root,root)
@ -704,6 +758,10 @@ rm -rf %{buildroot}
%exclude %{_mandir}/man8/telinit.8* %exclude %{_mandir}/man8/telinit.8*
%exclude %{_mandir}/man8/runlevel.8* %exclude %{_mandir}/man8/runlevel.8*
%exclude %{_mandir}/man*/*udev*.[0-9]* %exclude %{_mandir}/man*/*udev*.[0-9]*
# Packaged in analyze subpackage
%exclude %{_mandir}/man1/systemd-analyze.1*
%{_mandir}/man1/*.1* %{_mandir}/man1/*.1*
%{_mandir}/man3/*.3* %{_mandir}/man3/*.3*
%{_mandir}/man5/*.5* %{_mandir}/man5/*.5*
@ -727,7 +785,6 @@ rm -rf %{buildroot}
%dir /var/lib/systemd %dir /var/lib/systemd
%dir /var/lib/systemd/sysv-convert %dir /var/lib/systemd/sysv-convert
%dir /var/lib/systemd/migrated %dir /var/lib/systemd/migrated
%dir /var/log/journal
%files devel %files devel
%defattr(-,root,root,-) %defattr(-,root,root,-)
@ -768,7 +825,11 @@ rm -rf %{buildroot}
%endif %endif
%files analyze %files analyze
%defattr(-,root,root)
%attr(0755,root,root) /usr/bin/systemd-analyze %attr(0755,root,root) /usr/bin/systemd-analyze
%if ! 0%{?bootstrap}
%{_mandir}/man1/systemd-analyze.1*
%endif
%files -n %{udevpkgname} %files -n %{udevpkgname}
%defattr(-,root,root) %defattr(-,root,root)
@ -858,6 +919,8 @@ rm -rf %{buildroot}
%files logger %files logger
%defattr(-,root,root) %defattr(-,root,root)
%dir /var/log/journal %dir /var/log/journal
/var/log/README
/etc/init.d/systemd-journald
%endif %endif

View File

@ -1,3 +1,65 @@
-------------------------------------------------------------------
Thu Nov 22 14:22:00 UTC 2012 - rmilasan@suse.com
- Fix creation of /dev/root link.
-------------------------------------------------------------------
Tue Nov 20 18:25:49 CET 2012 - fcrozat@suse.com
- Add remount-ro-before-unmount.patch: always remount read-only
before unmounting in final shutdown loop.
- Add switch-root-try-pivot-root.patch: try pivot_root before
overmounting /
-------------------------------------------------------------------
Tue Nov 20 09:36:43 UTC 2012 - fcrozat@suse.com
- links more manpages for migrated tools (from Christopher
Yeleighton).
- disable boot.localnet service, ypbind service will do the right
thing now (bnc#716746)
- add xdm-display-manager.patch: pull xdm.service instead of
display-manager.service (needed until xdm initscript is migrated
to native systemd service).
- Add fix-permissions-btmp.patch: ensure btmp is owned only by root
(bnc#777405).
- Have the udev package create a tape group, as referenced by
50-udev-default.rules and 60-persistent-storage-tape.rules
(DimStar).
- Add fix-bad-memory-access.patch: fix crash in journal rotation.
- Add fix-dbus-crash.patch: fix D-Bus caused crash.
- Add sync-on-shutdown.patch: ensure sync is done when initiating
shutdown.
- Add mount-efivars.patch: mount efivars if booting on UEFI.
-------------------------------------------------------------------
Thu Nov 15 14:31:28 UTC 2012 - fcrozat@suse.com
- Ship a empty systemd-journald initscript in systemd-logger to
stop insserv to complain about missing syslog dependency.
- Update
0001-service-Fix-dependencies-added-when-parsing-insserv..patch
with bug fixes from Debian.
-------------------------------------------------------------------
Wed Nov 14 17:36:05 UTC 2012 - fcrozat@suse.com
- /var/log/journal is now only provided by systemd-logger (journal
won't be persistent for people using another syslog
implementation).
- install README in /var/log (in systemd-logger) and /etc/init.d
- create adm group when installing systemd.
- fix path in udev-root-symlink.systemd.
- Enforce Requires(post) dependency on libudev in main systemd
package (help upgrade).
- Ensure configuration is reloaded when upgrading and save random
seed when installing.
- Create /lib/udev symlink, if we do a fresh install.
- Add fix-build-glibc217.patch: fix build with latest glibc.
- Add libgcrypt.m4: copy of autoconf macro from libgcrypt, only
used to bootstrap systemd-mini.
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Nov 6 14:40:37 UTC 2012 - coolo@suse.com Tue Nov 6 14:40:37 UTC 2012 - coolo@suse.com

View File

@ -81,6 +81,7 @@ Requires: %{udevpkgname} >= 172
Requires: dbus-1 >= 1.4.0 Requires: dbus-1 >= 1.4.0
Requires: kbd Requires: kbd
Requires: pam-config >= 0.79-5 Requires: pam-config >= 0.79-5
Requires: pwdutils
Requires: systemd-presets-branding Requires: systemd-presets-branding
Requires: util-linux >= 2.21 Requires: util-linux >= 2.21
Requires(post): coreutils Requires(post): coreutils
@ -95,6 +96,8 @@ Source3: systemd-sysv-convert
Source4: macros.systemd Source4: macros.systemd
Source5: systemd-insserv_conf Source5: systemd-insserv_conf
Source6: baselibs.conf Source6: baselibs.conf
Source7: libgcrypt.m4
Source8: systemd-journald.init
Source1060: boot.udev Source1060: boot.udev
Source1061: write_dev_root_rule Source1061: write_dev_root_rule
@ -121,6 +124,8 @@ Patch53: fastboot-forcefsck.patch
Patch56: support-suse-clock-sysconfig.patch Patch56: support-suse-clock-sysconfig.patch
Patch59: fix-enable-disable-boot-initscript.patch Patch59: fix-enable-disable-boot-initscript.patch
Patch60: var-run-lock.patch Patch60: var-run-lock.patch
Patch63: xdm-display-manager.patch
Patch64: fix-permissions-btmp.patch
# Upstream First - Policy: # Upstream First - Policy:
# Never add any patches to this package without the upstream commit id # Never add any patches to this package without the upstream commit id
@ -128,6 +133,20 @@ Patch60: var-run-lock.patch
# an exception will be silently removed with the next version update. # an exception will be silently removed with the next version update.
# PATCH-FIX-UPSTREAM fix-logind-pty-seat.patch fcrozat@suse.com -- fix logind complaining when doing su/sudo in X terminal # PATCH-FIX-UPSTREAM fix-logind-pty-seat.patch fcrozat@suse.com -- fix logind complaining when doing su/sudo in X terminal
Patch61: fix-logind-pty-seat.patch Patch61: fix-logind-pty-seat.patch
# PATCH-FIX-UPSTREAM fix-build-glibc217.patch fcrozat@suse.com -- fix build with latest glibc
Patch62: fix-build-glibc217.patch
# PATCH-FIX-UPSTREAM fix-bad-memory-access.patch fcrozat@suse.com -- fix bad memory access
Patch65: fix-bad-memory-access.patch
# PATCH-FIX-UPSTREAM fix-dbus-crash.patch fcrozat@suse.com -- fix D-Bus caused crash
Patch66: fix-dbus-crash.patch
# PATCH-FIX-UPSTREAM sync-on-shutdown.patch fcrozat@suse.com -- Sync on shutdown
Patch67: sync-on-shutdown.patch
# PATCH-FIX-UPSTREAM mount-efivars.patch fcrozat@suse.com -- mount efivars if booting under UEFI
Patch68: mount-efivars.patch
# PATCH-FIX-UPSTREAM switch-root-try-pivot-root.patch fcrozat@suse.com -- try pivot_root before overmounting /
Patch69: switch-root-try-pivot-root.patch
# PATCH-FIX-UPSTREAM remount-ro-before-unmount.patch fcrozat@suse.com -- remount ro before unmounting in final shutdown loop
Patch70: remount-ro-before-unmount.patch
# udev patches # udev patches
# PATCH-FIX-OPENSUSE 0001-Reinstate-TIMEOUT-handling.patch # PATCH-FIX-OPENSUSE 0001-Reinstate-TIMEOUT-handling.patch
@ -142,8 +161,6 @@ Patch1026: 0026-udev-netlink-null-rules.patch
# PATCH-FIX-OPENSUSE 0027-udev-fix-sg-autoload-regression.patch # PATCH-FIX-OPENSUSE 0027-udev-fix-sg-autoload-regression.patch
Patch1027: 0027-udev-fix-sg-autoload-regression.patch Patch1027: 0027-udev-fix-sg-autoload-regression.patch
# systemd patches
%description %description
Systemd is a system and service manager, compatible with SysV and LSB Systemd is a system and service manager, compatible with SysV and LSB
init scripts for Linux. systemd provides aggressive parallelization init scripts for Linux. systemd provides aggressive parallelization
@ -199,6 +216,7 @@ License: GPL-2.0
Group: System/Kernel Group: System/Kernel
Url: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html 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 PreReq: /bin/pidof /bin/rm /usr/bin/stat %insserv_prereq %fillup_prereq /usr/sbin/groupadd /usr/bin/getent /sbin/mkinitrd
Requires(post): lib%{udevpkgname}%{udev_major}
Conflicts: systemd < 39 Conflicts: systemd < 39
Conflicts: aaa_base < 11.5 Conflicts: aaa_base < 11.5
Conflicts: filesystem < 11.5 Conflicts: filesystem < 11.5
@ -291,6 +309,11 @@ This package marks the installation to not use syslog but only the journal.
%prep %prep
%setup -q -n systemd-%{version} %setup -q -n systemd-%{version}
# only needed for bootstrap
%if 0%{?bootstrap}
cp %{SOURCE7} m4/
%endif
#udev #udev
%patch1001 -p1 %patch1001 -p1
%patch1013 -p1 %patch1013 -p1
@ -298,6 +321,7 @@ This package marks the installation to not use syslog but only the journal.
%patch1026 -p1 %patch1026 -p1
%patch1027 -p1 %patch1027 -p1
#systemd
%patch1 -p1 %patch1 -p1
%patch6 -p1 %patch6 -p1
# don't apply when bootstrapping to not modify configure.in # don't apply when bootstrapping to not modify configure.in
@ -321,11 +345,18 @@ This package marks the installation to not use syslog but only the journal.
%patch59 -p1 %patch59 -p1
%patch60 -p1 %patch60 -p1
%patch61 -p1 %patch61 -p1
%patch62 -p1
%patch63 -p1
%patch64 -p1
%patch65 -p1
%patch66 -p1
%patch67 -p1
%patch68 -p1
%patch69 -p1
%patch70 -p1
%build %build
%if ! 0%{?bootstrap}
autoreconf -fiv autoreconf -fiv
%endif
# prevent pre-generated and distributed files from re-building # prevent pre-generated and distributed files from re-building
find . -name "*.[1-8]" -exec touch '{}' \; find . -name "*.[1-8]" -exec touch '{}' \;
export V=1 export V=1
@ -354,21 +385,24 @@ 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}/systemd-ask-password $RPM_BUILD_ROOT/bin/systemd-ask-password
ln -sf %{_bindir}/systemctl $RPM_BUILD_ROOT/bin/systemctl ln -sf %{_bindir}/systemctl $RPM_BUILD_ROOT/bin/systemctl
ln -sf %{_prefix}/lib/systemd/systemd-udevd $RPM_BUILD_ROOT/sbin/udevd ln -sf %{_prefix}/lib/systemd/systemd-udevd $RPM_BUILD_ROOT/sbin/udevd
%if ! 0%{?bootstrap}
ln -sf systemd-udevd.8 $RPM_BUILD_ROOT/%{_mandir}/man8/udevd.8
%endif
mkdir -p $RPM_BUILD_ROOT/%{_prefix}/usr/lib/firmware/updates mkdir -p $RPM_BUILD_ROOT/%{_prefix}/usr/lib/firmware/updates
ln -sf /lib/firmware $RPM_BUILD_ROOT/usr/lib/firmware ln -sf /lib/firmware $RPM_BUILD_ROOT/usr/lib/firmware
%if ! 0%{?bootstrap}
install -m755 -D %{S:8} $RPM_BUILD_ROOT/etc/init.d/systemd-journald
%endif
install -m755 -D %{S:1060} $RPM_BUILD_ROOT/etc/init.d/boot.udev install -m755 -D %{S:1060} $RPM_BUILD_ROOT/etc/init.d/boot.udev
ln -s systemd-udevd.service $RPM_BUILD_ROOT/%{_prefix}/lib/systemd/system/udev.service ln -s systemd-udevd.service $RPM_BUILD_ROOT/%{_prefix}/lib/systemd/system/udev.service
sed -ie "s|@@PREFIX@@|%{_bindir}|g" %{S:1061}
install -m755 -D %{S:1061} $RPM_BUILD_ROOT/%{_prefix}/lib/udev/write_dev_root_rule install -m755 -D %{S:1061} $RPM_BUILD_ROOT/%{_prefix}/lib/udev/write_dev_root_rule
sed -ie "s|@@PREFIX@@|%{_prefix}/lib/udev|g" %{S:1062}
install -m644 -D %{S:1062} $RPM_BUILD_ROOT/%{_prefix}/lib/systemd/system/udev-root-symlink.service 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 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 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 #workaround for 716939
chmod 644 %{buildroot}%{_bindir}/systemd-analyze chmod 644 %{buildroot}%{_bindir}/systemd-analyze
mkdir -p %{buildroot}%{_sysconfdir}/rpm mkdir -p %{buildroot}%{_sysconfdir}/rpm
@ -378,7 +412,7 @@ mkdir -p %{buildroot}/{sbin,var/lib/systemd/sysv-convert,var/lib/systemd/migrate
install -m755 %{S:3} -D %{buildroot}%{_sbindir}/systemd-sysv-convert install -m755 %{S:3} -D %{buildroot}%{_sbindir}/systemd-sysv-convert
# do not install, code has been fixed, might be useful in the future # do not install, code has been fixed, might be useful in the future
#install -m755 %{S:5} %{buildroot}/lib/systemd/system-generators #install -m755 %{S:5} %{buildroot}/usr/lib/systemd/system-generators
ln -s ../usr/lib/systemd/systemd %{buildroot}/bin/systemd ln -s ../usr/lib/systemd/systemd %{buildroot}/bin/systemd
ln -s ../usr/lib/systemd/systemd %{buildroot}/sbin/init ln -s ../usr/lib/systemd/systemd %{buildroot}/sbin/init
ln -s ../usr/bin/systemctl %{buildroot}/sbin/reboot ln -s ../usr/bin/systemctl %{buildroot}/sbin/reboot
@ -401,8 +435,7 @@ 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/ldconfig.service
ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/loadmodules.service ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/loadmodules.service
install -m644 %{S:2} %{buildroot}/%{_prefix}/lib/systemd/system/localfs.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/localnet.service
ln -s /dev/null %{buildroot}/%{_prefix}/lib/systemd/system/proc.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 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/single.service
@ -421,12 +454,19 @@ rm %{buildroot}/%{_prefix}/lib/systemd/system/local-fs.target.wants/tmp.mount
# journal. # journal.
rm -f %{buildroot}%{_libdir}/../lib/sysctl.d/coredump.conf rm -f %{buildroot}%{_libdir}/../lib/sysctl.d/coredump.conf
# remove README files for now # remove README file for now
rm -f %{buildroot}/var/log/README %{buildroot}/etc/init.d/README rm -f %{buildroot}/etc/init.d/README
%if 0%{?bootstrap}
rm -f %{buildroot}/var/log/README
%endif
# legacy links # legacy links
ln -s loginctl %{buildroot}%{_bindir}/systemd-loginctl for f in loginctl journalctl ; do
ln -s journalctl %{buildroot}%{_bindir}/systemd-journalctl ln -s $f %{buildroot}%{_bindir}/systemd-$f
%if ! 0%{?bootstrap}
ln -s $f.1 %{buildroot}%{_mandir}/man1/systemd-$f.1
%endif
done
ln -s /usr/lib/udev %{buildroot}/lib/udev ln -s /usr/lib/udev %{buildroot}/lib/udev
# Create the /var/log/journal directory to change the volatile journal to a persistent one # Create the /var/log/journal directory to change the volatile journal to a persistent one
@ -446,10 +486,15 @@ mkdir -p %{buildroot}%{_prefix}/lib/systemd/system/syslog.target.wants
%fdupes -s %{buildroot}%{_mandir} %fdupes -s %{buildroot}%{_mandir}
%pre
getent group adm >/dev/null || groupadd -r adm
exit 0
%post %post
/usr/sbin/pam-config -a --systemd >/dev/null 2>&1 || : /usr/sbin/pam-config -a --systemd >/dev/null 2>&1 || :
/sbin/ldconfig /sbin/ldconfig
/usr/bin/systemd-machine-id-setup >/dev/null 2>&1 || : /usr/bin/systemd-machine-id-setup >/dev/null 2>&1 || :
/usr/lib/systemd/systemd-random-seed save >/dev/null 2>&1 || :
/usr/bin/systemctl daemon-reexec >/dev/null 2>&1 || : /usr/bin/systemctl daemon-reexec >/dev/null 2>&1 || :
# Try to read default runlevel from the old inittab if it exists # Try to read default runlevel from the old inittab if it exists
@ -480,6 +525,7 @@ fi
%postun %postun
/sbin/ldconfig /sbin/ldconfig
if [ $1 -ge 1 ]; then if [ $1 -ge 1 ]; then
/usr/bin/systemctl daemon-reload >/dev/null 2>&1 || :
/usr/bin/systemctl try-restart systemd-logind.service >/dev/null 2>&1 || : /usr/bin/systemctl try-restart systemd-logind.service >/dev/null 2>&1 || :
fi fi
if [ $1 -eq 0 ]; then if [ $1 -eq 0 ]; then
@ -506,7 +552,11 @@ if test -L /usr/lib/udev -a /lib/udev -ef /usr/lib/udev ; then
rm /usr/lib/udev rm /usr/lib/udev
mv /lib/udev /usr/lib mv /lib/udev /usr/lib
ln -s /usr/lib/udev /lib/udev ln -s /usr/lib/udev /lib/udev
elif [ ! -e /lib/udev ]; then
ln -s /usr/lib/udev /lib/udev
fi fi
# Create "tape" group which is referenced by 50-udev-default.rules and 60-persistent-storage-tape.rules
/usr/sbin/groupadd -r tape 2> /dev/null || :
# kill daemon if we are not in a chroot # kill daemon if we are not in a chroot
if test -f /proc/1/exe -a -d /proc/1/root ; then if test -f /proc/1/exe -a -d /proc/1/root ; then
if test "$(stat -Lc '%%D-%%i' /)" = "$(stat -Lc '%%D-%%i' /proc/1/root)"; then if test "$(stat -Lc '%%D-%%i' /)" = "$(stat -Lc '%%D-%%i' /proc/1/root)"; then
@ -535,24 +585,28 @@ if test -f /proc/1/exe -a -d /proc/1/root; then
fi fi
fi fi
[ -x /sbin/mkinitrd_setup ] && /sbin/mkinitrd_setup if [ "${YAST_IS_RUNNING}" != "instsys" ]; then
if [ -e /var/lib/no_initrd_recreation_by_suspend ]; then if [ -e /var/lib/no_initrd_recreation_by_suspend ]; then
echo "Skipping recreation of existing initial ramdisks, due" echo "Skipping recreation of existing initial ramdisks, due"
echo "to presence of /var/lib/no_initrd_recreation_by_suspend" echo "to presence of /var/lib/no_initrd_recreation_by_suspend"
elif [ -x /sbin/mkinitrd ]; then elif [ -x /sbin/mkinitrd ]; then
/sbin/mkinitrd [ -x /sbin/mkinitrd_setup ] && /sbin/mkinitrd_setup
/sbin/mkinitrd || :
fi
fi fi
%postun -n %{udevpkgname} %postun -n %{udevpkgname}
%insserv_cleanup %insserv_cleanup
systemctl daemon-reload >/dev/null 2>&1 || : systemctl daemon-reload >/dev/null 2>&1 || :
[ -x /sbin/mkinitrd_setup ] && /sbin/mkinitrd_setup if [ "${YAST_IS_RUNNING}" != "instsys" ]; then
if [ -e /var/lib/no_initrd_recreation_by_suspend ]; then if [ -e /var/lib/no_initrd_recreation_by_suspend ]; then
echo "Skipping recreation of existing initial ramdisks, due" echo "Skipping recreation of existing initial ramdisks, due"
echo "to presence of /var/lib/no_initrd_recreation_by_suspend" echo "to presence of /var/lib/no_initrd_recreation_by_suspend"
elif [ -x /sbin/mkinitrd ]; then elif [ -x /sbin/mkinitrd ]; then
/sbin/mkinitrd [ -x /sbin/mkinitrd_setup ] && /sbin/mkinitrd_setup
/sbin/mkinitrd || :
fi
fi fi
%post -n lib%{udevpkgname}%{udev_major} -p /sbin/ldconfig %post -n lib%{udevpkgname}%{udev_major} -p /sbin/ldconfig
@ -567,7 +621,7 @@ fi
%endif %endif
%clean %clean
rm -rf %{buildroot} # rm -rf %{buildroot}
%files %files
%defattr(-,root,root) %defattr(-,root,root)
@ -699,6 +753,10 @@ rm -rf %{buildroot}
%exclude %{_mandir}/man8/telinit.8* %exclude %{_mandir}/man8/telinit.8*
%exclude %{_mandir}/man8/runlevel.8* %exclude %{_mandir}/man8/runlevel.8*
%exclude %{_mandir}/man*/*udev*.[0-9]* %exclude %{_mandir}/man*/*udev*.[0-9]*
# Packaged in analyze subpackage
%exclude %{_mandir}/man1/systemd-analyze.1*
%{_mandir}/man1/*.1* %{_mandir}/man1/*.1*
%{_mandir}/man3/*.3* %{_mandir}/man3/*.3*
%{_mandir}/man5/*.5* %{_mandir}/man5/*.5*
@ -722,7 +780,6 @@ rm -rf %{buildroot}
%dir /var/lib/systemd %dir /var/lib/systemd
%dir /var/lib/systemd/sysv-convert %dir /var/lib/systemd/sysv-convert
%dir /var/lib/systemd/migrated %dir /var/lib/systemd/migrated
%dir /var/log/journal
%files devel %files devel
%defattr(-,root,root,-) %defattr(-,root,root,-)
@ -763,7 +820,11 @@ rm -rf %{buildroot}
%endif %endif
%files analyze %files analyze
%defattr(-,root,root)
%attr(0755,root,root) /usr/bin/systemd-analyze %attr(0755,root,root) /usr/bin/systemd-analyze
%if ! 0%{?bootstrap}
%{_mandir}/man1/systemd-analyze.1*
%endif
%files -n %{udevpkgname} %files -n %{udevpkgname}
%defattr(-,root,root) %defattr(-,root,root)
@ -853,6 +914,8 @@ rm -rf %{buildroot}
%files logger %files logger
%defattr(-,root,root) %defattr(-,root,root)
%dir /var/log/journal %dir /var/log/journal
/var/log/README
/etc/init.d/systemd-journald
%endif %endif

View File

@ -6,4 +6,4 @@ DefaultDependencies=no
[Service] [Service]
Type=oneshot Type=oneshot
RemainAfterExit=yes RemainAfterExit=yes
ExecStart=/lib/udev/write_dev_root_rule ExecStart=@@PREFIX@@/write_dev_root_rule

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
eval $(/sbin/udevadm info --export --export-prefix=ROOT_ --device-id-of-file=/) eval $(@@PREFIX@@/udevadm info --export --export-prefix=ROOT_ --device-id-of-file=/)
[ "$ROOT_MAJOR" -gt 0 ] || return [ "$ROOT_MAJOR" -gt 0 ] || return
mkdir -m 0755 -p /run/udev/rules.d >/dev/null 2>&1 mkdir -m 0755 -p /run/udev/rules.d >/dev/null 2>&1

13
xdm-display-manager.patch Normal file
View File

@ -0,0 +1,13 @@
Index: systemd-195/units/graphical.target
===================================================================
--- systemd-195.orig/units/graphical.target
+++ systemd-195/units/graphical.target
@@ -11,7 +11,7 @@ Documentation=man:systemd.special(7)
Requires=multi-user.target
After=multi-user.target
Conflicts=rescue.target
-Wants=display-manager.service
+Wants=xdm.service
AllowIsolate=yes
[Install]