summary refs log tree commit diff
path: root/pkgs/os-specific/linux/systemd/default.nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-04-16 00:59:26 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-04-16 00:59:26 +0200
commitee9c068b0cd82422ad95c20446d66b5d98869f8b (patch)
tree46f79a1c4abb9ee9d5d333ab62d522c8cb53a19b /pkgs/os-specific/linux/systemd/default.nix
parente8eea659a09d7688145188537716dc751554ece4 (diff)
downloadnixpkgs-ee9c068b0cd82422ad95c20446d66b5d98869f8b.tar
nixpkgs-ee9c068b0cd82422ad95c20446d66b5d98869f8b.tar.gz
nixpkgs-ee9c068b0cd82422ad95c20446d66b5d98869f8b.tar.bz2
nixpkgs-ee9c068b0cd82422ad95c20446d66b5d98869f8b.tar.lz
nixpkgs-ee9c068b0cd82422ad95c20446d66b5d98869f8b.tar.xz
nixpkgs-ee9c068b0cd82422ad95c20446d66b5d98869f8b.tar.zst
nixpkgs-ee9c068b0cd82422ad95c20446d66b5d98869f8b.zip
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).
Diffstat (limited to 'pkgs/os-specific/linux/systemd/default.nix')
-rw-r--r--pkgs/os-specific/linux/systemd/default.nix51
1 files changed, 23 insertions, 28 deletions
diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix
index 0afaf7b0370..e48c875d6f9 100644
--- a/pkgs/os-specific/linux/systemd/default.nix
+++ b/pkgs/os-specific/linux/systemd/default.nix
@@ -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";