diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index dfa99959b30..7e7f69a2bbb 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -6,7 +6,8 @@ assert stdenv.gcc.libc or null != null; stdenv.mkDerivation rec { - name = "systemd-200"; + version = "200"; + name = "systemd-${version}"; src = fetchurl { url = "http://www.freedesktop.org/software/systemd/${name}.tar.xz"; @@ -24,7 +25,7 @@ stdenv.mkDerivation rec { ] ++ stdenv.lib.optional stdenv.isArm ./libc-bug-accept4-arm.patch; buildInputs = - [ pkgconfig intltool gperf libcap dbus kmod xz pam acl + [ pkgconfig intltool gperf libcap dbus.libs kmod xz pam acl /* cryptsetup */ libuuid m4 glib libxslt libgcrypt docbook_xsl ]; @@ -116,6 +117,19 @@ 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"; diff --git a/pkgs/os-specific/linux/systemd/fix-tests-1.patch b/pkgs/os-specific/linux/systemd/fix-tests-1.patch new file mode 100644 index 00000000000..14bb0fa2708 --- /dev/null +++ b/pkgs/os-specific/linux/systemd/fix-tests-1.patch @@ -0,0 +1,68 @@ +Signed-off-by: Ramkumar Ramachandra +--- + Ramkumar Ramachandra wrote: + > $ ./test-id128 + > random: a08ea8ed34594d4bbd953dd182ec86f9 + > Assertion 'sd_id128_get_machine(&id) == 0' failed at + > src/test/test-id128.c:41, function main(). Aborting. + > [1] 8017 abort (core dumped) ./test-id128 + + Okay, this test fails because I don't have a /etc/machine-id -- I + thought systemd is supposed to create it? However, from the logic in + src/core/machine-id-setup.c, it looks like although open() is called + with O_CREAT on /etc/machine-id, systemd barfs if the file isn't + present. How about changing this? + + src/core/machine-id-setup.c | 12 +++++------- + src/test/test-id128.c | 6 ++++-- + 2 files changed, 9 insertions(+), 9 deletions(-) + +diff --git a/src/core/machine-id-setup.c b/src/core/machine-id-setup.c +index 7f4c23b..3f21d58 100644 +--- a/src/core/machine-id-setup.c ++++ b/src/core/machine-id-setup.c +@@ -168,12 +168,8 @@ int machine_id_setup(void) { + writable = true; + else { + fd = open("/etc/machine-id", O_RDONLY|O_CLOEXEC|O_NOCTTY); +- if (fd < 0) { +- umask(m); +- log_error("Cannot open /etc/machine-id: %m"); +- return -errno; +- } +- ++ if (fd < 0) ++ goto generate; + writable = false; + } + +@@ -192,7 +188,9 @@ int machine_id_setup(void) { + } + } + +- /* Hmm, so, the id currently stored is not useful, then let's ++generate: ++ /* Hmm, so, either /etc/machine-id doesn't exist, the id ++ * currently stored is not useful, then let's + * generate one */ + + r = generate(id); +diff --git a/src/test/test-id128.c b/src/test/test-id128.c +index bfd743e..60902d0 100644 +--- a/src/test/test-id128.c ++++ b/src/test/test-id128.c +@@ -38,8 +38,10 @@ int main(int argc, char *argv[]) { + assert_se(sd_id128_from_string(t, &id2) == 0); + assert_se(sd_id128_equal(id, id2)); + +- assert_se(sd_id128_get_machine(&id) == 0); +- printf("machine: %s\n", sd_id128_to_string(id, t)); ++ if (sd_id128_get_machine(&id) < 0) ++ printf("machine: run systemd-machine-id-setup first\n"); ++ else ++ printf("machine: %s\n", sd_id128_to_string(id, t)); + + assert_se(sd_id128_get_boot(&id) == 0); + printf("boot: %s\n", sd_id128_to_string(id, t)); +-- +1.7.8.1.362.g5d6df.dirty diff --git a/pkgs/os-specific/linux/systemd/no-global-install.patch b/pkgs/os-specific/linux/systemd/no-global-install.patch new file mode 100644 index 00000000000..6567251d57a --- /dev/null +++ b/pkgs/os-specific/linux/systemd/no-global-install.patch @@ -0,0 +1,26 @@ +diff --git a/Makefile.am b/Makefile.am +index 05bf582..aa16a7c 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -2568,11 +2568,6 @@ endif + # "adm" and "wheel". + libsystemd-journal-install-hook: + libname=libsystemd-journal.so && $(move-to-rootlibdir) +- $(MKDIR_P) $(DESTDIR)/var/log/journal +- -chown 0:0 $(DESTDIR)/var/log/journal +- -chmod 755 $(DESTDIR)/var/log/journal +- -setfacl -nm g:adm:rx,d:g:adm:rx $(DESTDIR)/var/log/journal/ +- -setfacl -nm g:wheel:rx,d:g:wheel:rx $(DESTDIR)/var/log/journal/ + + libsystemd-journal-uninstall-hook: + rm -f $(DESTDIR)$(rootlibdir)/libsystemd-journal.so* +@@ -3676,9 +3671,6 @@ if HAVE_SYSV_COMPAT + sysvinit_DATA = \ + docs/sysvinit/README + +-varlog_DATA = \ +- docs/var-log/README +- + docs/sysvinit/README: docs/sysvinit/README.in + $(SED_PROCESS) +