nixpkgs/pkgs/os-specific/linux/systemd/default.nix

309 lines
13 KiB
Nix
Raw Normal View History

{ stdenv, lib, fetchFromGitHub, fetchpatch, pkgconfig, intltool, gperf, libcap
, curl, kmod, gnupg, gnutar, xz, pam, acl, libuuid, m4, utillinux, libffi
, glib, kbd, libxslt, coreutils, libgcrypt, libgpgerror, libidn2, libapparmor
, audit, lz4, bzip2, libmicrohttpd, pcre2
, linuxHeaders ? stdenv.cc.libc.linuxHeaders
, iptables, gnu-efi, bashInteractive
, gettext, docbook_xsl, docbook_xml_dtd_42, docbook_xml_dtd_45
, ninja, meson, python3Packages, glibcLocales
, patchelf
, substituteAll
, getent
, buildPackages
, perl
, withSelinux ? false, libselinux
, withLibseccomp ? lib.any (lib.meta.platformMatch stdenv.hostPlatform) libseccomp.meta.platforms, libseccomp
, withKexectools ? lib.any (lib.meta.platformMatch stdenv.hostPlatform) kexectools.meta.platforms, kexectools
}:
let gnupg-minimal = gnupg.override {
enableMinimal = true;
guiSupport = false;
pcsclite = null;
sqlite = null;
pinentry = null;
adns = null;
gnutls = null;
libusb1 = null;
openldap = null;
readline = null;
zlib = null;
bzip2 = null;
};
in stdenv.mkDerivation {
systemd: 245.5 -> 245.6 changes: - aa0cb635f1 (tag: v245.6) network: L2TP fix crash - 9774347b57 Fix typo. - 2cac801f0f stat-util: trivial empty_or_null() tweaks - b054e69bf9 Check ambient set against bounding set prior to applying ambient set - bed695375a udev: when the BSD lock on a block device is taken, don't complain - 66fcfdfde7 core: add forgotten return in error path - 05dd19fad3 shared/efi-loader: remove check that uses absolute tick value - 753a71ad1d gpt: include homed GPT partition type in well-known partition table - 3668722049 units: don't set PrivateNetwork= in systemd-homed.service - 2bca2d77d3 resolved-dns-query: remove dns_query_candidate_is_routable - a3f6020432 sd-network: fix inverted error message - a7a9fe3c93 network: allow empty assignment to PreferredLifetime= - 8df6fc1241 Update resolvectl zsh completion - c1a83277d0 shared: treat generator units as vendor units - 1f382d818d tree-wide: fix bad errno checks - 667c207683 bus-message: immediately reject messages with invalid type - 116a8eadb6 bus-message: fix negative offset with ~empty message - 4d5779d886 load-fragment: fix a typo - c8b6de003a NEWS: retroactively document Family= - cf6b8e6ec5 man: fix dir name in sysctl.d(5) - 6d009b7a25 journalctl,elsewhere: make sure --file=foo fails with sane error msg if foo is not readable - cf786ef164 makefs: log about OOM condition - 0b1839822f blockdev: propagate one more unexpected error - d78ce949d0 repart: don't insist on coming up on partition label ourselves - 9e1363fcc6 journal: fix dropping first record during upload to remote journal - 50cb4e418d meson: initialize time-epoch to reproducible builds compatible value - 76abe079b7 limit-util: quieten a very common debug message that is misleading - b3e484a3b1 shared: fix integer overflow in calendarspec - 0c29eea969 repart: suppress complaints about lack of BLKRRPART when operating on regular file - 3db52f5ed8 repart: explain when we exit early and don't do a thing - d99cba3aaa mount: introduce mount_is_nofail() helper - 7bc4bcea15 mount: default startup dependencies and default network ones are orthogonal - 7fe617fa53 mount: introduce mount_add_default_ordering_dependencies() - e1c091b6d4 automount: fix handling of default dependencies for automount units - ae05a137c9 mount: let pid1 alone handle the default dependencies for mount units - f1fb197176 mount: mount unit activated by automount unit should be only ordered against the automount unit - c9bcc69703 generator: don't generate device dependencies for extrinsic mounts - ebac09ea0a fstab-util: introduce fstab_is_extrinsic() - a20e4ea0ed device: drop refuse_after - 2799fffac1 man: drop some left-over mentions of StandardOutput=syslog - 144aff9c3b sd-netlink: remove unused RTNL_WQUEUE_MAX define - 34ca8df8e1 test: Add return 0 to main() function (even it is not strictly necessary) - 6e03f328a9 network: 'cur' variable cannot be null, so simplify code - 8d0c97f6ca tree-wide: Initialize _cleanup_ variables if needed - 4f174e49ae netlink: Fix assert condition on n_containers - 3905ce532c journald: Increase stdout buffer size sooner, when almost full - 5a37eb7c61 core: don't bind varlink socket if running in test mode - 33fff72ce6 pam_systemd: also print debug lines when ending a session - ba9af79ccb pam_systemd_home: use correct macro for converting ptr to fd - 6199235489 Fix misuse of PAM_PROMPT_ECHO_OFF in systemd-homed - c180a2c452 shared/ethtool-util: hush gcc warnings about array bounds - 1addba4aac core: fix compilation with gcc -O3 - 9c46b97161 random-util: use ERRNO_IS_NOT_SUPPORTED() macro - d85f9093d2 tmpfiles: clarify that "!" lines are filtered before collisions are checked - 2fac966a5c man: mention the exclamation mark and minus sign literally, to make things searchable - 4f61be3373 man: clarify that exit status name mappings are unaffected by SuccessExitStatus= - b747d74a41 seccomp-util: add new syscalls from kernel 5.6 to syscall filter table - c30d8caf8b tree-wide: Replace assert() by assert_se() when there is side effect - b6e8e3be7e networkctl: use uint64_t for link speed throughout - be66ce6089 tree-wide: use CMSG_SPACE() (and not CMSG_LEN()) to allocate control buffers - 1cb197798a man: suffix pam options with "=" where arg is required too - a5fe01d3da test: Use assert_se() where variables are only checked by assert - 6960efd198 tree-wide: Fix, replace assert() by assert_se() when there is side effect - 93c1b03074 tree-wide: Mark as _unused_ variables that are only used in assert() - c7679d7a9f tree-wide: Workaround -Wnonnull GCC bug - 073b257fd7 man: bring example PAM snippet of pam_systemd and pam_systemd_home back in sync - 855291a81c man: highlight relevant lines in pam_systemd_home.so example PAM snippet - f89ad7c0fd login: include pam_systemd_home.so in the default PAM snippet we ship for user@.service - 9357f9466f test: Skip test-boot-timestamps on permission denied - cad4ebe14e sysusers: be extra careful when locking accounts - 551e6f233a shared/install: print name of offending file in error - c6a2e51232 systemctl: fix --root support in querying presets - 6f1eedbfdd systemctl: fix hint when 'systemctl help' is given - 925521df7c shared/unit-file: fix resolution of absoulute symlinks with --root - 756ba362e8 man: mention that ProtectSystem= also takes care of /efi - 4f77cf43b5 man: systemd.service: systemd-analyze exit-codes -> exit-status - 7c6ea7a053 man: expand on the star…end/repetition time expressions - e06b940792 calendarspec: be more graceful with two kinds of calendar expressions - f3dd0b476d calendarspec: minor simplification - 3581c16d56 shutdown: fix spacing in shutdown error message - 9556255349 nspawn: mount custom paths before writing to /etc - 37447b7e78 repart: fix partition maximum size segfault - 7f231ba503 link: Add units and fix typo in (Rx|Tx)BufferSize= manpage. Clean up the implementation slightly - e75d2cdb0b main: bump RLIMIT_MEMLOCK by physical RAM size - e16b9a1e31 nspawn: be more careful with creating/chowning directories to overmount - 765d184a69 homectl: say "home area" in more places - c11bff4fa7 userdbctl: make --help fit in 80 columns - 0e56c2ef3f shell-completion/zsh: update systemd-analyze completions - 2bb580f994 zsh: fix disable/enable completion - 607a19a309 cgroup-util: check for SYSFS_MAGIC when detecting cgroup format - ddb3c38efc stat-util: no need to open a file to check fs type - bd8842304c sysusers,tmpfiles: always mention error when failing to replace specifiers - bdea9b65d2 sysusers: add accidentally forgotten 'return' - 17b059774d man: document binfmt's new --unregister switch - 560380d8ec binfmt: also unregister binfmt entries from unit - 80835d9c51 binfmt: modernize code a bit - a1745741b8 shutdown: unregister all binfmt_misc entries before entering shutdown loop - b637445950 shared: add common helper for unregistering all binfmt entries - 0215625e99 home: fix strv NUL termination - 038988baa1 networkd: don't do lldp rx nor tx on bond devices - 9512d576d9 sd-bus: Fix typo in sd_bus_message_append_array docs - 63cef71dd0 shared: add NULL callback check in one more place - 6b91ca22a2 core: fix unused variable warning when !HAVE_SECCOMP - f7c1c79c57 udev: prepare memory for extra NUL termination for NULSTR - 69e0ef0d99 tree-wide: use recvmsg_safe() at various places - cd0a84d4e9 socket-util: add recvmsg_safe() wrapper that handles MSG_CTRUNC - 2bb48c704b sd-bus: work around ubsan warning - c147bba1fb shared: Don't try calling NULL callback in bus_wait_for_units_clear - f907491463 run: don't wait for start job to complete when running interactively anyway - d3d1550a5d man: Fix typo "multiplied with" -> "multiplied by" - ae5a9f27c5 core: make sure we don't get confused when setting TERM for a tty fd - a07d3eaf76 man: document that VirtualEthernetExtra= has nothing to do with Bridge= - 35fe81078e core: add debug log when a job in the activation queue is not runnable - a0cd882be8 core: add log_get_max_level check optimization in log_unit_full - 2a6ad1093c util: return the correct correct wd from inotify helpers - 9ec244c5c1 core: minor error code handling fixes - a799283c91 man: document how to get the boot menu with zero time-out - 7263e86c8d resolved: return org.freedesktop.resolve1.DnsError.NXDOMAIN on LLMNR resolution failure - 6eab4c2b3e man: use manpages.ubuntu.com for resolvconf(8) link - 75ccec5cde man: add a note that resolvconf updates /etc/resolv.conf in specific circumstances - 3e3a31743a resolvectl: fix indentation of hexdump'ed packets - 6576058fab journald: add configuration option for enabling/disabling audit during journald startup - 52c5909f15 man/systemd-service: clarify env variable expansion - ac08df59c0 resolved: fix typo in an unused function and add comment
2020-06-14 13:18:30 +01:00
version = "245.6";
pname = "systemd";
# When updating, use https://github.com/systemd/systemd-stable tree, not the development one!
# Also fresh patches should be cherry-picked from that tree to our current one.
src = fetchFromGitHub {
owner = "systemd";
repo = "systemd-stable";
systemd: 245.5 -> 245.6 changes: - aa0cb635f1 (tag: v245.6) network: L2TP fix crash - 9774347b57 Fix typo. - 2cac801f0f stat-util: trivial empty_or_null() tweaks - b054e69bf9 Check ambient set against bounding set prior to applying ambient set - bed695375a udev: when the BSD lock on a block device is taken, don't complain - 66fcfdfde7 core: add forgotten return in error path - 05dd19fad3 shared/efi-loader: remove check that uses absolute tick value - 753a71ad1d gpt: include homed GPT partition type in well-known partition table - 3668722049 units: don't set PrivateNetwork= in systemd-homed.service - 2bca2d77d3 resolved-dns-query: remove dns_query_candidate_is_routable - a3f6020432 sd-network: fix inverted error message - a7a9fe3c93 network: allow empty assignment to PreferredLifetime= - 8df6fc1241 Update resolvectl zsh completion - c1a83277d0 shared: treat generator units as vendor units - 1f382d818d tree-wide: fix bad errno checks - 667c207683 bus-message: immediately reject messages with invalid type - 116a8eadb6 bus-message: fix negative offset with ~empty message - 4d5779d886 load-fragment: fix a typo - c8b6de003a NEWS: retroactively document Family= - cf6b8e6ec5 man: fix dir name in sysctl.d(5) - 6d009b7a25 journalctl,elsewhere: make sure --file=foo fails with sane error msg if foo is not readable - cf786ef164 makefs: log about OOM condition - 0b1839822f blockdev: propagate one more unexpected error - d78ce949d0 repart: don't insist on coming up on partition label ourselves - 9e1363fcc6 journal: fix dropping first record during upload to remote journal - 50cb4e418d meson: initialize time-epoch to reproducible builds compatible value - 76abe079b7 limit-util: quieten a very common debug message that is misleading - b3e484a3b1 shared: fix integer overflow in calendarspec - 0c29eea969 repart: suppress complaints about lack of BLKRRPART when operating on regular file - 3db52f5ed8 repart: explain when we exit early and don't do a thing - d99cba3aaa mount: introduce mount_is_nofail() helper - 7bc4bcea15 mount: default startup dependencies and default network ones are orthogonal - 7fe617fa53 mount: introduce mount_add_default_ordering_dependencies() - e1c091b6d4 automount: fix handling of default dependencies for automount units - ae05a137c9 mount: let pid1 alone handle the default dependencies for mount units - f1fb197176 mount: mount unit activated by automount unit should be only ordered against the automount unit - c9bcc69703 generator: don't generate device dependencies for extrinsic mounts - ebac09ea0a fstab-util: introduce fstab_is_extrinsic() - a20e4ea0ed device: drop refuse_after - 2799fffac1 man: drop some left-over mentions of StandardOutput=syslog - 144aff9c3b sd-netlink: remove unused RTNL_WQUEUE_MAX define - 34ca8df8e1 test: Add return 0 to main() function (even it is not strictly necessary) - 6e03f328a9 network: 'cur' variable cannot be null, so simplify code - 8d0c97f6ca tree-wide: Initialize _cleanup_ variables if needed - 4f174e49ae netlink: Fix assert condition on n_containers - 3905ce532c journald: Increase stdout buffer size sooner, when almost full - 5a37eb7c61 core: don't bind varlink socket if running in test mode - 33fff72ce6 pam_systemd: also print debug lines when ending a session - ba9af79ccb pam_systemd_home: use correct macro for converting ptr to fd - 6199235489 Fix misuse of PAM_PROMPT_ECHO_OFF in systemd-homed - c180a2c452 shared/ethtool-util: hush gcc warnings about array bounds - 1addba4aac core: fix compilation with gcc -O3 - 9c46b97161 random-util: use ERRNO_IS_NOT_SUPPORTED() macro - d85f9093d2 tmpfiles: clarify that "!" lines are filtered before collisions are checked - 2fac966a5c man: mention the exclamation mark and minus sign literally, to make things searchable - 4f61be3373 man: clarify that exit status name mappings are unaffected by SuccessExitStatus= - b747d74a41 seccomp-util: add new syscalls from kernel 5.6 to syscall filter table - c30d8caf8b tree-wide: Replace assert() by assert_se() when there is side effect - b6e8e3be7e networkctl: use uint64_t for link speed throughout - be66ce6089 tree-wide: use CMSG_SPACE() (and not CMSG_LEN()) to allocate control buffers - 1cb197798a man: suffix pam options with "=" where arg is required too - a5fe01d3da test: Use assert_se() where variables are only checked by assert - 6960efd198 tree-wide: Fix, replace assert() by assert_se() when there is side effect - 93c1b03074 tree-wide: Mark as _unused_ variables that are only used in assert() - c7679d7a9f tree-wide: Workaround -Wnonnull GCC bug - 073b257fd7 man: bring example PAM snippet of pam_systemd and pam_systemd_home back in sync - 855291a81c man: highlight relevant lines in pam_systemd_home.so example PAM snippet - f89ad7c0fd login: include pam_systemd_home.so in the default PAM snippet we ship for user@.service - 9357f9466f test: Skip test-boot-timestamps on permission denied - cad4ebe14e sysusers: be extra careful when locking accounts - 551e6f233a shared/install: print name of offending file in error - c6a2e51232 systemctl: fix --root support in querying presets - 6f1eedbfdd systemctl: fix hint when 'systemctl help' is given - 925521df7c shared/unit-file: fix resolution of absoulute symlinks with --root - 756ba362e8 man: mention that ProtectSystem= also takes care of /efi - 4f77cf43b5 man: systemd.service: systemd-analyze exit-codes -> exit-status - 7c6ea7a053 man: expand on the star…end/repetition time expressions - e06b940792 calendarspec: be more graceful with two kinds of calendar expressions - f3dd0b476d calendarspec: minor simplification - 3581c16d56 shutdown: fix spacing in shutdown error message - 9556255349 nspawn: mount custom paths before writing to /etc - 37447b7e78 repart: fix partition maximum size segfault - 7f231ba503 link: Add units and fix typo in (Rx|Tx)BufferSize= manpage. Clean up the implementation slightly - e75d2cdb0b main: bump RLIMIT_MEMLOCK by physical RAM size - e16b9a1e31 nspawn: be more careful with creating/chowning directories to overmount - 765d184a69 homectl: say "home area" in more places - c11bff4fa7 userdbctl: make --help fit in 80 columns - 0e56c2ef3f shell-completion/zsh: update systemd-analyze completions - 2bb580f994 zsh: fix disable/enable completion - 607a19a309 cgroup-util: check for SYSFS_MAGIC when detecting cgroup format - ddb3c38efc stat-util: no need to open a file to check fs type - bd8842304c sysusers,tmpfiles: always mention error when failing to replace specifiers - bdea9b65d2 sysusers: add accidentally forgotten 'return' - 17b059774d man: document binfmt's new --unregister switch - 560380d8ec binfmt: also unregister binfmt entries from unit - 80835d9c51 binfmt: modernize code a bit - a1745741b8 shutdown: unregister all binfmt_misc entries before entering shutdown loop - b637445950 shared: add common helper for unregistering all binfmt entries - 0215625e99 home: fix strv NUL termination - 038988baa1 networkd: don't do lldp rx nor tx on bond devices - 9512d576d9 sd-bus: Fix typo in sd_bus_message_append_array docs - 63cef71dd0 shared: add NULL callback check in one more place - 6b91ca22a2 core: fix unused variable warning when !HAVE_SECCOMP - f7c1c79c57 udev: prepare memory for extra NUL termination for NULSTR - 69e0ef0d99 tree-wide: use recvmsg_safe() at various places - cd0a84d4e9 socket-util: add recvmsg_safe() wrapper that handles MSG_CTRUNC - 2bb48c704b sd-bus: work around ubsan warning - c147bba1fb shared: Don't try calling NULL callback in bus_wait_for_units_clear - f907491463 run: don't wait for start job to complete when running interactively anyway - d3d1550a5d man: Fix typo "multiplied with" -> "multiplied by" - ae5a9f27c5 core: make sure we don't get confused when setting TERM for a tty fd - a07d3eaf76 man: document that VirtualEthernetExtra= has nothing to do with Bridge= - 35fe81078e core: add debug log when a job in the activation queue is not runnable - a0cd882be8 core: add log_get_max_level check optimization in log_unit_full - 2a6ad1093c util: return the correct correct wd from inotify helpers - 9ec244c5c1 core: minor error code handling fixes - a799283c91 man: document how to get the boot menu with zero time-out - 7263e86c8d resolved: return org.freedesktop.resolve1.DnsError.NXDOMAIN on LLMNR resolution failure - 6eab4c2b3e man: use manpages.ubuntu.com for resolvconf(8) link - 75ccec5cde man: add a note that resolvconf updates /etc/resolv.conf in specific circumstances - 3e3a31743a resolvectl: fix indentation of hexdump'ed packets - 6576058fab journald: add configuration option for enabling/disabling audit during journald startup - 52c5909f15 man/systemd-service: clarify env variable expansion - ac08df59c0 resolved: fix typo in an unused function and add comment
2020-06-14 13:18:30 +01:00
rev = "aa0cb635f1f6a4d9b50ed2cca7782f3f751be933";
sha256 = "191f0r1g946bsqxky00z78wygsxi9pld11y2q4374bshnpsff2ll";
};
patches = [
./0001-Start-device-units-for-uninitialised-encrypted-devic.patch
./0002-Don-t-try-to-unmount-nix-or-nix-store.patch
./0003-Fix-NixOS-containers.patch
./0004-Look-for-fsck-in-the-right-place.patch
./0005-Add-some-NixOS-specific-unit-directories.patch
./0006-Get-rid-of-a-useless-message-in-user-sessions.patch
./0007-hostnamed-localed-timedated-disable-methods-that-cha.patch
./0008-Fix-hwdb-paths.patch
./0009-Change-usr-share-zoneinfo-to-etc-zoneinfo.patch
./0010-localectl-use-etc-X11-xkb-for-list-x11.patch
./0011-build-don-t-create-statedir-and-don-t-touch-prefixdi.patch
./0012-Install-default-configuration-into-out-share-factory.patch
./0013-inherit-systemd-environment-when-calling-generators.patch
./0014-add-rootprefix-to-lookup-dir-paths.patch
./0015-systemd-shutdown-execute-scripts-in-etc-systemd-syst.patch
./0016-systemd-sleep-execute-scripts-in-etc-systemd-system-.patch
./0017-kmod-static-nodes.service-Update-ConditionFileNotEmp.patch
./0018-path-util.h-add-placeholder-for-DEFAULT_PATH_NORMAL.patch
];
postPatch = ''
substituteInPlace src/basic/path-util.h --replace "@defaultPathNormal@" "${placeholder "out"}/bin/"
substituteInPlace src/boot/efi/meson.build \
--replace \
"find_program('ld'" \
"find_program('${stdenv.cc.bintools.targetPrefix}ld'" \
--replace \
"find_program('objcopy'" \
"find_program('${stdenv.cc.bintools.targetPrefix}objcopy'"
'';
outputs = [ "out" "lib" "man" "dev" ];
nativeBuildInputs =
[ pkgconfig intltool gperf libxslt gettext docbook_xsl docbook_xml_dtd_42 docbook_xml_dtd_45
ninja meson
coreutils # meson calls date, stat etc.
glibcLocales
patchelf getent m4
perl # to patch the libsystemd.so and remove dependencies on aarch64
2019-02-22 08:23:48 +00:00
(buildPackages.python3Packages.python.withPackages ( ps: with ps; [ python3Packages.lxml ]))
];
buildInputs =
[ linuxHeaders libcap curl.dev kmod xz pam acl
/* cryptsetup */ libuuid glib libgcrypt libgpgerror libidn2
libmicrohttpd pcre2 ] ++
stdenv.lib.optional withKexectools kexectools ++
stdenv.lib.optional withLibseccomp libseccomp ++
[ libffi audit lz4 bzip2 libapparmor
iptables gnu-efi
] ++ stdenv.lib.optional withSelinux libselinux;
#dontAddPrefix = true;
mesonFlags = [
"-Ddbuspolicydir=${placeholder "out"}/share/dbus-1/system.d"
2019-02-22 08:23:48 +00:00
"-Ddbussessionservicedir=${placeholder "out"}/share/dbus-1/services"
"-Ddbussystemservicedir=${placeholder "out"}/share/dbus-1/system-services"
"-Dpamconfdir=${placeholder "out"}/etc/pam.d"
"-Drootprefix=${placeholder "out"}"
"-Drootlibdir=${placeholder "lib"}/lib"
"-Dpkgconfiglibdir=${placeholder "dev"}/lib/pkgconfig"
"-Dpkgconfigdatadir=${placeholder "dev"}/share/pkgconfig"
"-Dloadkeys-path=${kbd}/bin/loadkeys"
"-Dsetfont-path=${kbd}/bin/setfont"
"-Dtty-gid=3" # tty in NixOS has gid 3
"-Ddebug-shell=${bashInteractive}/bin/bash"
# while we do not run tests we should also not build them. Removes about 600 targets
"-Dtests=false"
"-Dimportd=true"
"-Dlz4=true"
"-Dhomed=false"
"-Dhostnamed=true"
"-Dnetworkd=true"
"-Dportabled=false"
"-Dsysusers=false"
"-Dtimedated=true"
"-Dtimesyncd=true"
"-Dfirstboot=false"
"-Dlocaled=true"
"-Dresolve=true"
"-Dsplit-usr=false"
"-Dlibcurl=true"
"-Dlibidn=false"
"-Dlibidn2=true"
"-Dquotacheck=false"
"-Dldconfig=false"
"-Dsmack=true"
2019-02-22 08:23:48 +00:00
"-Db_pie=true"
/*
As of now, systemd doesn't allow runtime configuration of these values. So
the settings in /etc/login.defs have no effect on it. Many people think this
should be supported however, see
- https://github.com/systemd/systemd/issues/3855
- https://github.com/systemd/systemd/issues/4850
- https://github.com/systemd/systemd/issues/9769
- https://github.com/systemd/systemd/issues/9843
- https://github.com/systemd/systemd/issues/10184
*/
"-Dsystem-uid-max=999"
"-Dsystem-gid-max=999"
# "-Dtime-epoch=1"
(if !stdenv.hostPlatform.isEfi then "-Dgnu-efi=false" else "-Dgnu-efi=true")
"-Defi-libdir=${toString gnu-efi}/lib"
"-Defi-includedir=${toString gnu-efi}/include/efi"
"-Defi-ldsdir=${toString gnu-efi}/lib"
"-Dsysvinit-path="
"-Dsysvrcnd-path="
"-Dkill-path=${coreutils}/bin/kill"
"-Dkmod-path=${kmod}/bin/kmod"
"-Dsulogin-path=${utillinux}/bin/sulogin"
"-Dmount-path=${utillinux}/bin/mount"
"-Dumount-path=${utillinux}/bin/umount"
2019-09-04 00:35:49 +01:00
"-Dcreate-log-dirs=false"
# Upstream uses cgroupsv2 by default. To support docker and other
# container managers we still need v1.
"-Ddefault-hierarchy=hybrid"
# Upstream defaulted to disable manpages since they optimize for the much
# more frequent development builds
"-Dman=true"
];
preConfigure = ''
mesonFlagsArray+=(-Dntp-servers="0.nixos.pool.ntp.org 1.nixos.pool.ntp.org 2.nixos.pool.ntp.org 3.nixos.pool.ntp.org")
export LC_ALL="en_US.UTF-8";
# FIXME: patch this in systemd properly (and send upstream).
# already fixed in f00929ad622c978f8ad83590a15a765b4beecac9: (u)mount
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.in src/journal/cat.c src/shutdown/shutdown.c src/nspawn/nspawn.c src/shared/generator.c units/systemd-logind.service.in units/systemd-nspawn@.service.in; do
test -e $i
substituteInPlace $i \
--replace /usr/bin/getent ${getent}/bin/getent \
--replace /sbin/swapon ${lib.getBin utillinux}/sbin/swapon \
--replace /sbin/swapoff ${lib.getBin utillinux}/sbin/swapoff \
--replace /sbin/fsck ${lib.getBin utillinux}/sbin/fsck \
--replace /bin/echo ${coreutils}/bin/echo \
--replace /bin/cat ${coreutils}/bin/cat \
--replace /sbin/sulogin ${lib.getBin utillinux}/sbin/sulogin \
--replace /sbin/modprobe ${lib.getBin kmod}/sbin/modprobe \
--replace /usr/lib/systemd/systemd-fsck $out/lib/systemd/systemd-fsck \
--replace /bin/plymouth /run/current-system/sw/bin/plymouth # To avoid dependency
done
2019-02-22 08:23:48 +00:00
for dir in tools src/resolve test src/test; do
patchShebangs $dir
done
# absolute paths to gpg & tar
substituteInPlace src/import/pull-common.c \
--replace '"gpg"' '"${gnupg-minimal}/bin/gpg"'
for file in src/import/{{export,import,pull}-tar,import-common}.c; do
substituteInPlace $file \
--replace '"tar"' '"${gnutar}/bin/tar"'
done
substituteInPlace src/journal/catalog.c \
--replace /usr/lib/systemd/catalog/ $out/lib/systemd/catalog/
'';
# These defines are overridden by CFLAGS and would trigger annoying
# warning messages
postConfigure = ''
substituteInPlace config.h \
--replace "POLKIT_AGENT_BINARY_PATH" "_POLKIT_AGENT_BINARY_PATH" \
--replace "SYSTEMD_BINARY_PATH" "_SYSTEMD_BINARY_PATH" \
--replace "SYSTEMD_CGROUP_AGENT_PATH" "_SYSTEMD_CGROUP_AGENT_PATH"
'';
2019-10-29 23:53:51 +00:00
NIX_CFLAGS_COMPILE = toString [
# Can't say ${polkit.bin}/bin/pkttyagent here because that would
# lead to a cyclic dependency.
"-UPOLKIT_AGENT_BINARY_PATH" "-DPOLKIT_AGENT_BINARY_PATH=\"/run/current-system/sw/bin/pkttyagent\""
2019-10-29 23:53:51 +00:00
# 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.
"-USYSTEMD_CGROUP_AGENT_PATH" "-DSYSTEMD_CGROUP_AGENT_PATH=\"/run/current-system/systemd/lib/systemd/systemd-cgroups-agent\""
2019-10-29 23:53:51 +00:00
"-USYSTEMD_BINARY_PATH" "-DSYSTEMD_BINARY_PATH=\"/run/current-system/systemd/lib/systemd/systemd\""
];
doCheck = false; # fails a bunch of tests
# trigger the test -n "$DESTDIR" || mutate in upstreams build system
preInstall = ''
export DESTDIR=/
'';
postInstall = ''
# sysinit.target: Don't depend on
# systemd-tmpfiles-setup.service. This interferes with NixOps's
# send-keys feature (since sshd.service depends indirectly on
# sysinit.target).
mv $out/lib/systemd/system/sysinit.target.wants/systemd-tmpfiles-setup-dev.service $out/lib/systemd/system/multi-user.target.wants/
mkdir -p $out/example/systemd
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
# Fix reference to /bin/false in the D-Bus services.
for i in $out/share/dbus-1/system-services/*.service; do
substituteInPlace $i --replace /bin/false ${coreutils}/bin/false
done
rm -rf $out/etc/rpm
# "kernel-install" shouldn't be used on NixOS.
find $out -name "*kernel-install*" -exec rm {} \;
# Keep only libudev and libsystemd in the lib output.
mkdir -p $out/lib
mv $lib/lib/security $lib/lib/libnss* $out/lib/
''; # */
enableParallelBuilding = true;
# On aarch64 we "leak" a reference to $out/lib/systemd/catalog in the lib
# output. The result of that is a dependency cycle between $out and $lib.
# Thus nix (rightfully) marks the build as failed. That reference originates
# from an array of strings (catalog_file_dirs) in systemd
# (src/src/journal/catalog.{c,h}). The only consumer (as of v242) of the
# symbol is the main function of journalctl. Still libsystemd.so contains
# the VALUE but not the symbol. Systemd seems to be properly using function
# & data sections together with the linker flags to garbage collect unused
# sections (-Wl,--gc-sections). For unknown reasons those flags do not
# eliminate the unused string constants, in this case on aarch64-linux. The
# hacky way is to just remove the reference after we finished compiling.
# Since it can not be used (there is no symbol to actually refer to it) there
# should not be any harm. It is a bit odd and I really do not like starting
# these kind of hacks but there doesn't seem to be a straight forward way at
# this point in time.
# The reference will be replaced by the same reference the usual nukeRefs
# tooling uses. The standard tooling can not / should not be uesd since it
# is a bit too excessive and could potentially do us some (more) harm.
postFixup = ''
nukedRef=$(echo $out | sed -e "s,$NIX_STORE/[^-]*-\(.*\),$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-\1,")
cat $lib/lib/libsystemd.so | perl -pe "s|$out/lib/systemd/catalog|$nukedRef/lib/systemd/catalog|" > $lib/lib/libsystemd.so.tmp
mv $lib/lib/libsystemd.so.tmp $(readlink -f $lib/lib/libsystemd.so)
'';
# The interface version prevents NixOS from switching to an
# incompatible systemd at runtime. (Switching across reboots is
# fine, of course.) It should be increased whenever systemd changes
# in a backwards-incompatible way. If the interface version of two
# systemd builds is the same, then we can switch between them at
# runtime; otherwise we can't and we need to reboot.
passthru.interfaceVersion = 2;
2018-08-17 23:32:36 +01:00
meta = with stdenv.lib; {
systemd: 243.4 -> 243.7 This bumps to the latest state of the systemd 242 stable, published at https://github.com/systemd/systemd-stable/tree/v243-stable. Should cover CVE-2020-1712. Git Log: f8dd0f2f15 (tag: v243.7, systemd-stable/v243-stable) Revert "Support Plugable UD-PRO8 dock" 1a5428c2ab hibernate-resume-generator: wait "infinitely" for the resume device eb3148c468 (tag: v243.6) hwdb: update to v245-rc1 f14fa558ae Fix typo in function name fb21e13e8e polkit: when authorizing via PK let's re-resolve callback/userdata instead of caching it 2e504c92d1 sd-bus: introduce API for re-enqueuing incoming messages 4d80c8f158 polkit: use structured initialization 54791aff01 polkit: on async pk requests, re-validate action/details 81532beddc polkit: reuse some common bus message appending code 4441844d58 bus-polkit: rename return error parameter to ret_error 31a1d569db shared: split out polkit stuff from bus-util.c → bus-polkit.c 560eb5babf test: adapt to the new capsh format 275b266bde meson: update efi path detection to gnu-efi-3.0.11 9239154545 presets: "disable" all passive targets by default a827c41851 shared/sysctl-util: normalize repeated slashes or dots to a single value fb1bfd6804 dhcp6: do not use T1 and T2 longer than one provided by the lease ca43a515c6 network: fix implicit type conversion warning by GCC-10 421eca7edf bootspec: parse random-seed-mode line in loader.conf 34e21fc6de sd-boot: fix typo df7b3a05c9 test: Synchronize journal before reading from it 9326efee71 sd-bus: fix introspection bug in signal parameter names 7bbdc56aaf efi: fix build. 486f8ca365 generator: order growfs for the root fs after systemd-remount-fs 56d442e29d loginctl: use /org/freedesktop/login1/session/auto when "lock-session" is called without argument 6ed1152282 Documentation update for x-systemd.{before,after} dba3efa34a man: fix typo in systemd.netdev Xfrm example 6f9a8621d8 timesyncd: log louder when we refuse a server due to root distance 0637255d3b resolved: drop DNSSEC root key that is not valid anymore 9a135baa40 journal: don't use startswith() on something that is not a NUL-terminated string 1ff3972a0f test: add test for https://github.com/systemd/systemd/issues/14560 cac79b606b core: make sure StandardInput=file: doesn't get dup'ed to stdout/stderr by default 906ba9a67d pkgconf: add full generator paths 01b93e2c68 tree-wide: we forgot to destroy some bus errors 5c9455657e mount: make checks on perpetual mount units more lax 28c58beca1 core: never allow perpetual units to be masked d3b044b3e7 typo: "May modify to" -> "May modify" fd378d3d3c sysctl: downgrade message when we have no permission db4fbf5c61 Clarify journald.conf MaxLevelStore documentation c8365f71c0 logind: refuse overriding idle hint on tty sessions cd91f567b6 cgroup: update only siblings that got realized once c672dcd212 mount: mark an existing "mounting" unit from /proc/self/mountinfo as "just_mounted" a592a40564 journalctl: Correctly handle combination of --reverse and --lines (fixes #1596) 0aa144ab1d journalctl: Correctly handle --show-cursor in combination with --until or --since and --reverse 3b803a5e66 core: fix re-realization of cgroup siblings 7549dd40fc core: propagate service state to socket in more load states af6df343b2 man: describe "symlink" and "systemctl link" explicitly in UNIT FILE LOAD PATH a3c1ce25a7 core: be more restrictive on the dependency types we allow to be created transiently 2b9ec8384c udev: don't import parent ID_FS_ data on partitions ecd95c507c man: fix option name 0d4f06156b Support Plugable UD-PRO8 dock 7fba869abd gpt-auto: don't assume XBOOTLDR is vfat 494c281b67 man: fix documentation of IBM VIO device naming 7271fb056a man: slightly extend documentation on difference between ID_NET_NAME_ONBOARD and ID_NET_LABEL_ONBOARD 852ae28e68 boot: fix osrel parser 2613200370 udev: do not use exact match of file permission 46477397c1 network: lower the log-level of harmless message 7163b1fe86 hwdb: ignore keys added in kernel 5.5 92f90837dc systemctl: skip non-existent units in the 'cat' verb a67227cc99 systemd.exec: document the file system for EnvironmentFile paths cfb4c0aca5 systemd-analyze: fixed typo in documentation 017fddd998 test-condition: fix group check condition 9d5e3cb774 umount: show correct error message 252f1a5277 Revert "Drop dbus activation stub service" 20bbfac95e man: add section about user manager units c93ef60212 man: add remote-*.targets to the bootup sequence 55e0f99689 time-util: also use 32bit hack on EOVERFLOW 7afe2ecb02 [man] note which UID ranges will get user journals a43b67a4c9 [man] fix URL dedb26a8d6 analyze: badness if neither of RootImage and RootDirectory exists 714c93862a initrd: make udev cleanup service confict trigger and settle too 8932407ae1 man: we support growing xfs too these days 19af11dc07 time-util: deal with systems where userspace has 64bit time_t but kernel does not c90229d81d [import] fix stdin/stdout pipe behavior in import/export tar/raw 39910328da cryptsetup-generator: unconfuse writing of the device timeout fc5e6c87a4 shared/install: log syntax error for invalid DefaultInstance= 409c94a407 shared/install: provide a nicer error message for invalid WantedBy=/Required= values 70e8c1978a seccomp: real syscall numbers are >= 0 a0a1977d9a seccomp: more comprehensive protection against libseccomp's __NR_xyz namespace invasion 7f936c60d5 network: set ipv6 mtu after link-up or device mtu change b59d88cc62 man: fix typo in net-naming-scheme man page c5e5ac0958 man: fix typos (#14304) 9a2f26564d ipv4ll: do not reset conflict counter on restart bc9e1ebfdd Fix typo (duplicate "or") c6cb71b7e7 network: if /sys is rw, then udev should be around 67dcdfd956 nspawn: do not fail if udev is not running a7938a1bc6 Create parent directories when creating systemd-private subdirs 53aa44f873 network: do not return error but return UINT64_MAX if speed meter is disabled 65abf12674 core: swap priority can be negative b1cf452ff5 systemctl: enhance message about kexec missing kernel 07a0e5b425 man: use mkswap@ instead of makeswap@ 57dc017c6b journald: don't ask for the machine ID if we don't need it ac392a57c0 journalctl: pager_close() calls fflush(stdout) anyway as first thing ee7dfadc82 journald: remove unused field 471073f1b5 journalctl: return EOPNOTSUPP if pcre is not enabled 002ededb61 man: drop reference to machined, add one for journald instead fd3bd4be3b pid1: make TimeoutAbortSec settable for transient units eb2ef4d664 pid1: fix setting of DefaultTimeoutAbortSec 1d75e29b23 shared/ask-password-api: modify keyctl break value a16b1ee7e5 cryptsetup: reduce the chance that we will be OOM killed 4836fb010a core: write out correct field name when creating transient service units 3e2c547f6d udevd: don't use monitor after manager_exit() d42f7d45a8 Revert "udevd: fix crash when workers time out after exit is signal caught" c9a287eee8 man/systemd.link: Add missing verb *be* a67a3ae04b man: document all pager variables for systemctl and systemd 3a8fce3f38 core.timer: fix "systemd-analyze dump" and docs syntax inconsistencies wrt OnTimezoneChange= fdffd284b6 core/service: downgrade "scheduling restart" message to debug 733e7f19d3 travis: add missing closing quote sign 0d7b7817fc systemd-tmpfiles: don't install timer when service isn't installed either 0e7f83cd2b pam_systemd: prolong method call timeout when allocating session
2020-02-18 20:46:40 +00:00
homepage = "https://www.freedesktop.org/wiki/Software/systemd/";
description = "A system and service manager for Linux";
2018-08-17 23:32:36 +01:00
license = licenses.lgpl21Plus;
platforms = platforms.linux;
priority = 10;
2020-04-16 05:03:47 +01:00
maintainers = with maintainers; [ andir eelco flokli ];
};
}