systemd: Update to 212

Note that systemd no longer depends on dbus, so we're rid of the
cyclic dependency problem between systemd and dbus.

This commit incorporates from wkennington's systemd branch
(203dcff45002a63f6be75c65f1017021318cc839,
1f842558a95947261ece66f707bfa24faf5a9d88).
This commit is contained in:
Eelco Dolstra
2014-04-16 00:59:26 +02:00
parent e8eea659a0
commit ee9c068b0c
7 changed files with 126 additions and 817 deletions
+23 -28
View File
@@ -1,7 +1,7 @@
{ stdenv, fetchurl, pkgconfig, intltool, gperf, libcap, dbus, kmod
, xz, pam, acl, cryptsetup, libuuid, m4, utillinux
, glib, kbd, libxslt, coreutils, libgcrypt, sysvtools, docbook_xsl
, kexectools, libmicrohttpd
, kexectools, libmicrohttpd, linuxHeaders
, python ? null, pythonSupport ? false
}:
@@ -10,26 +10,24 @@ assert stdenv.isLinux;
assert pythonSupport -> python != null;
stdenv.mkDerivation rec {
version = "203";
version = "212";
name = "systemd-${version}";
src = fetchurl {
url = "http://www.freedesktop.org/software/systemd/${name}.tar.xz";
sha256 = "07gvn3rpski8sh1nz16npjf2bvj0spsjdwc5px9685g2pi6kxcb1";
sha256 = "1hpjcc42svrs06q3isjm3m5aphgkpfdylmvpnif71zh46ys0cab5";
};
patches =
[ # These are all changes between upstream and
# https://github.com/edolstra/systemd/tree/nixos-v203.
# https://github.com/edolstra/systemd/tree/nixos-v212.
./fixes.patch
./fix_console_in_containers.patch
]
++ stdenv.lib.optional stdenv.isArm ./libc-bug-accept4-arm.patch;
];
buildInputs =
[ pkgconfig intltool gperf libcap dbus.libs kmod xz pam acl
[ pkgconfig intltool gperf libcap kmod xz pam acl
/* cryptsetup */ libuuid m4 glib libxslt libgcrypt docbook_xsl
libmicrohttpd
libmicrohttpd linuxHeaders
] ++ stdenv.lib.optional pythonSupport python;
configureFlags =
@@ -45,15 +43,18 @@ stdenv.mkDerivation rec {
"--with-dbussessionservicedir=$(out)/share/dbus-1/services"
"--with-firmware-path=/root/test-firmware:/run/current-system/firmware"
"--with-tty-gid=3" # tty in NixOS has gid 3
"--disable-networkd" # enable/use eventually
"--enable-compat-libs" # get rid of this eventually
];
preConfigure =
''
# FIXME: patch this in systemd properly (and send upstream).
# FIXME: use sulogin from util-linux once updated.
for i in src/remount-fs/remount-fs.c src/core/mount.c src/core/swap.c src/fsck/fsck.c units/emergency.service.in units/rescue.service.m4.in src/journal/cat.c src/core/shutdown.c; do
for i in src/remount-fs/remount-fs.c src/core/mount.c src/core/swap.c src/fsck/fsck.c units/emergency.service.in units/rescue.service.m4.in src/journal/cat.c src/core/shutdown.c src/nspawn/nspawn.c; do
test -e $i
substituteInPlace $i \
--replace /usr/bin/getent ${stdenv.glibc}/bin/getent \
--replace /bin/mount ${utillinux}/bin/mount \
--replace /bin/umount ${utillinux}/bin/umount \
--replace /sbin/swapon ${utillinux}/sbin/swapon \
@@ -69,6 +70,10 @@ stdenv.mkDerivation rec {
--replace /usr/lib/systemd/catalog/ $out/lib/systemd/catalog/
'';
# This is needed because systemd uses the gold linker, which doesn't
# yet have the wrapper script to add rpath flags automatically.
NIX_LDFLAGS = "-rpath ${pam}/lib -rpath ${libcap}/lib -rpath ${acl}/lib";
PYTHON_BINARY = "${coreutils}/bin/env python"; # don't want a build time dependency on Python
NIX_CFLAGS_COMPILE =
@@ -77,10 +82,6 @@ stdenv.mkDerivation rec {
"-UPOLKIT_AGENT_BINARY_PATH" "-DPOLKIT_AGENT_BINARY_PATH=\"/run/current-system/sw/bin/pkttyagent\""
"-fno-stack-protector"
# Work around our kernel headers being too old. FIXME: remove
# this after the next stdenv update.
"-DFS_NOCOW_FL=0x00800000"
# Set the release_agent on /sys/fs/cgroup/systemd to the
# currently running systemd (/run/current-system/systemd) so
# that we don't use an obsolete/garbage-collected release agent.
@@ -94,7 +95,12 @@ stdenv.mkDerivation rec {
# /var is mounted.
makeFlags = "hwdb_bin=/var/lib/udev/hwdb.bin";
installFlags = "localstatedir=$(TMPDIR)/var sysconfdir=$(out)/etc sysvinitdir=$(TMPDIR)/etc/init.d";
installFlags =
[ "localstatedir=$(TMPDIR)/var"
"sysconfdir=$(out)/etc"
"sysvinitdir=$(TMPDIR)/etc/init.d"
"pamconfdir=$(out)/etc/pam.d"
];
# Get rid of configuration-specific data.
postInstall =
@@ -103,6 +109,8 @@ stdenv.mkDerivation rec {
mv $out/lib/{modules-load.d,binfmt.d,sysctl.d,tmpfiles.d} $out/example
mv $out/lib/systemd/{system,user} $out/example/systemd
rm -rf $out/etc/systemd/system
# Install SysV compatibility commands.
mkdir -p $out/sbin
ln -s $out/lib/systemd/systemd $out/sbin/telinit
@@ -128,19 +136,6 @@ stdenv.mkDerivation rec {
# runtime; otherwise we can't and we need to reboot.
passthru.interfaceVersion = 2;
passthru.headers = stdenv.mkDerivation {
name = "systemd-headers-${version}";
inherit src;
phases = [ "unpackPhase" "installPhase" ];
# some are needed by dbus.libs, which is needed for systemd :-)
installPhase = ''
mkdir -p "$out/include/systemd"
mv src/systemd/*.h "$out/include/systemd"
'';
};
meta = {
homepage = "http://www.freedesktop.org/wiki/Software/systemd";
description = "A system and service manager for Linux";