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

523 lines
18 KiB
Nix
Raw Normal View History

2020-10-27 22:28:29 +00:00
{ stdenv
, lib
, fetchFromGitHub
2020-11-01 14:35:11 +00:00
, fetchpatch
, buildPackages
2020-10-27 22:28:29 +00:00
, ninja
, meson
, m4
, pkgconfig
, coreutils
, gperf
, getent
, patchelf
, glibcLocales
, glib
, substituteAll
, gettext
, python3Packages
# Mandatory dependencies
, libcap
2020-11-24 15:29:28 +00:00
, util-linux
, kbd
, kmod
2020-10-27 22:28:29 +00:00
# Optional dependencies
, pam
, cryptsetup
, lvm2
, audit
, acl
, lz4
, libgcrypt
, libgpgerror
, libidn2
, curl
, gnutar
, gnupg
, zlib
, xz
, libuuid
, libapparmor
, intltool
, bzip2
, pcre2
, e2fsprogs
, linuxHeaders ? stdenv.cc.libc.linuxHeaders
, gnu-efi
, iptables
2020-10-27 22:28:29 +00:00
, 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
, bashInteractive
, libmicrohttpd
2020-10-27 23:29:07 +00:00
, withAnalyze ? true
2020-10-28 00:26:24 +00:00
, withApparmor ? true
, withCompression ? true # adds bzip2, lz4 and xz
, withCoredump ? true
, withCryptsetup ? true
2020-10-27 23:54:08 +00:00
, withDocumentation ? true
, withEfi ? stdenv.hostPlatform.isEfi
, withHomed ? false
, withHostnamed ? true
, withHwdb ? true
, withImportd ? true
, withLocaled ? true
, withLogind ? true
2020-10-28 00:08:29 +00:00
, withMachined ? true
, withNetworkd ? true
2020-10-28 00:05:14 +00:00
, withNss ? true
2020-11-01 14:35:11 +00:00
, withOomd ? false
2020-10-28 00:36:02 +00:00
, withPCRE2 ? true
2020-10-27 23:48:51 +00:00
, withPolkit ? true
, withPortabled ? false
, withRemote ? true
, withResolved ? true
2020-10-27 23:51:39 +00:00
, withShellCompletions ? true
, withTimedated ? true
, withTimesyncd ? true
2020-10-28 00:00:44 +00:00
, withUserDb ? true
, libfido2
2020-11-01 14:35:11 +00:00
, p11-kit
2020-10-27 22:28:29 +00:00
# name argument
, pname ? "systemd"
2020-10-27 22:28:29 +00:00
, libxslt
, docbook_xsl
, docbook_xml_dtd_42
, docbook_xml_dtd_45
}:
assert withResolved -> (libgcrypt != null && libgpgerror != null);
assert withImportd ->
2020-10-27 22:28:29 +00:00
(curl.dev != null && zlib != null && xz != null && libgcrypt != null
&& gnutar != null && gnupg != null && withCompression);
assert withEfi -> (gnu-efi != null);
assert withRemote -> lib.getDev curl != null;
assert withCoredump -> withCompression;
assert withHomed -> withCryptsetup;
assert withCryptsetup ->
2020-10-27 22:28:29 +00:00
(cryptsetup != null);
let
wantCurl = withRemote || withImportd;
systemd: 247.1 -> 247.2 Contains the following fixes: - 937118a5b2 journalctl: don't skip the entries that have the same seqnum - e017ac6a26 sd-bus: use SOCK_CLOEXEC on one more socket - db31432861 resolved: create stub-resolv.conf symlink with correct security label - f2ec15e2e5 efi: Only use arm flags if supported - cd43eee770 core: detect_container() may return negative errno - 04be042a1f meson: Fix reallocarray check - 5e906f483b network: do not assume address ready callback is always set to static addresses - 2ad7a2a96a network: drop assertions to check link state in netlink callback handlers - f375c8cbb5 network: do not reconfigure interface when the link gains carrier but udev not initialized it yet - 5d4909decf veritysetup: also place udev socket dep - 57ddb74245 cryptsetup: Fix crypto device missing issue after bootup - d3c224d441 network: fix SIGABRT related to unreachable route with DHCP6 - c91648cc83 network: revert previous changes to address_compare_func() - d8b5d8c8c3 udev: Fix sound.target dependency - 669107ae68 meson: specify correct libqrencode version in meson dep - c07dc6cedc udev: link_update() should fail if the entry in symlink dir couldn't have been created - 367006c806 man: document that automount units are privileged - 5129808141 logind: fix closing of button input devices - 37f06c91ef Update logind-button.c - 9e9fda0a2d async: add trivial cleanup wrapper for asynchronous_close() - 4a2ca1ca4a Silence cgroups v1 read-only filesystem warning - ed1f8f4ba2 manager: Fix HW watchdog when systemd starts before driver loaded - 383a747164 cgroup: Also set blkio.bfq.weight - 48d41091ac nss-resolve: varlink_call() set error_id only when r >= 0 - 56daba2deb missing: Define several syscall numbers for Alpha arch - f2a4b96276 Don't assume /run/systemd exists when creating unit-root - 553530fdc7 mkosi: Add findutils to Fedora config - e42990dfe3 mkosi: Add rpm to Fedora BuildPackages as it's needed by pkg-config - 6bacd1d971 mkosi: Replace iptables-dev with libiptc-dev in debian config - f1fc515c21 dissect: don't declare unused variables on archs that have no GPT discovery - 30d0c3f58c resolved: synthesize NODATA instead of NXDOMAIN if gateway exists, but of other protocol - 538ebbd7f3 local-addresses: make returning accumulated list optional - 228a22bb63 resolved: improve log message when we use TCP a bit - aa31dd9128 network: ignore broadcast address for /31 or /32 addresses - 85607cc094 network: fix verification for broadcast address - dc6ad6482a network: do not set broadcast if prefixlen is 31 or 32 - 39ee319c75 stub: don't ever respond to datagrams coming in on non-localhost addreses, on the stub - cbea0e5a83 resolved: never allow _gateway lookups to go to the network - c4df66816b resolved: lower SERVFAIL cache timeout from 30s to 10s - b5e39c20d9 dns-domain: try IDN2003 rules if IDN2008 doesn't work - 2c354cedd2 virt: Properly detect nested UML inside another hypervisor - 10f2cfb715 resolved: properly check per-link NTA list - a8437c07e4 meson: use '_' as separator in fuzz test names - 81ef7623c8 man: mention that --key= is about *secret* keys - 4ef70ecefc meson: check that cxx variable is set before using it
2020-12-16 22:06:19 +00:00
version = "247.2";
2020-10-27 22:28:29 +00:00
in
stdenv.mkDerivation {
inherit version pname;
# We use systemd/systemd-stable for src, and ship NixOS-specific patches inside nixpkgs directly
# This has proven to be less error-prone than the previous systemd fork.
src = fetchFromGitHub {
owner = "systemd";
2020-12-13 15:35:01 +00:00
repo = "systemd-stable";
rev = "v${version}";
systemd: 247.1 -> 247.2 Contains the following fixes: - 937118a5b2 journalctl: don't skip the entries that have the same seqnum - e017ac6a26 sd-bus: use SOCK_CLOEXEC on one more socket - db31432861 resolved: create stub-resolv.conf symlink with correct security label - f2ec15e2e5 efi: Only use arm flags if supported - cd43eee770 core: detect_container() may return negative errno - 04be042a1f meson: Fix reallocarray check - 5e906f483b network: do not assume address ready callback is always set to static addresses - 2ad7a2a96a network: drop assertions to check link state in netlink callback handlers - f375c8cbb5 network: do not reconfigure interface when the link gains carrier but udev not initialized it yet - 5d4909decf veritysetup: also place udev socket dep - 57ddb74245 cryptsetup: Fix crypto device missing issue after bootup - d3c224d441 network: fix SIGABRT related to unreachable route with DHCP6 - c91648cc83 network: revert previous changes to address_compare_func() - d8b5d8c8c3 udev: Fix sound.target dependency - 669107ae68 meson: specify correct libqrencode version in meson dep - c07dc6cedc udev: link_update() should fail if the entry in symlink dir couldn't have been created - 367006c806 man: document that automount units are privileged - 5129808141 logind: fix closing of button input devices - 37f06c91ef Update logind-button.c - 9e9fda0a2d async: add trivial cleanup wrapper for asynchronous_close() - 4a2ca1ca4a Silence cgroups v1 read-only filesystem warning - ed1f8f4ba2 manager: Fix HW watchdog when systemd starts before driver loaded - 383a747164 cgroup: Also set blkio.bfq.weight - 48d41091ac nss-resolve: varlink_call() set error_id only when r >= 0 - 56daba2deb missing: Define several syscall numbers for Alpha arch - f2a4b96276 Don't assume /run/systemd exists when creating unit-root - 553530fdc7 mkosi: Add findutils to Fedora config - e42990dfe3 mkosi: Add rpm to Fedora BuildPackages as it's needed by pkg-config - 6bacd1d971 mkosi: Replace iptables-dev with libiptc-dev in debian config - f1fc515c21 dissect: don't declare unused variables on archs that have no GPT discovery - 30d0c3f58c resolved: synthesize NODATA instead of NXDOMAIN if gateway exists, but of other protocol - 538ebbd7f3 local-addresses: make returning accumulated list optional - 228a22bb63 resolved: improve log message when we use TCP a bit - aa31dd9128 network: ignore broadcast address for /31 or /32 addresses - 85607cc094 network: fix verification for broadcast address - dc6ad6482a network: do not set broadcast if prefixlen is 31 or 32 - 39ee319c75 stub: don't ever respond to datagrams coming in on non-localhost addreses, on the stub - cbea0e5a83 resolved: never allow _gateway lookups to go to the network - c4df66816b resolved: lower SERVFAIL cache timeout from 30s to 10s - b5e39c20d9 dns-domain: try IDN2003 rules if IDN2008 doesn't work - 2c354cedd2 virt: Properly detect nested UML inside another hypervisor - 10f2cfb715 resolved: properly check per-link NTA list - a8437c07e4 meson: use '_' as separator in fuzz test names - 81ef7623c8 man: mention that --key= is about *secret* keys - 4ef70ecefc meson: check that cxx variable is set before using it
2020-12-16 22:06:19 +00:00
sha256 = "091pwrvxz3gcf80shlp28d6l4gvjzc6pb61v4mwxmk9d71qaq7ry";
};
# If these need to be regenerated, `git am path/to/00*.patch` them into a
# systemd worktree, rebase to the more recent systemd version, and export the
# patches again via `git format-patch v${version}`.
2020-11-01 14:35:11 +00:00
# Use `find . -name "*.patch" | sort` to get an up-to-date listing of all patches
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
2020-11-01 14:35:11 +00:00
./0012-inherit-systemd-environment-when-calling-generators.patch
./0013-add-rootprefix-to-lookup-dir-paths.patch
./0014-systemd-shutdown-execute-scripts-in-etc-systemd-syst.patch
./0015-systemd-sleep-execute-scripts-in-etc-systemd-system-.patch
./0016-kmod-static-nodes.service-Update-ConditionFileNotEmp.patch
./0017-path-util.h-add-placeholder-for-DEFAULT_PATH_NORMAL.patch
./0018-logind-seat-debus-show-CanMultiSession-again.patch
./0019-Revert-pkg-config-prefix-is-not-really-configurable-.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'"
'' + (let
# The folllowing dlopen patches ensure that all the features that are
# implemented via dlopen(3) are available (or explicitly deactivated) by
# pointing dlopen to the absolute store path instead of relying on the
# linkers runtime lookup code.
#
# All of the dlopen calls have to be handled. When new ones are introduced
# by upstream (or one of our patches) they must be explicitly declared,
# otherwise the build will fail.
#
# As of systemd version 247 we've seen a few errors like `libpcre2.… not
# found` when using e.g. --grep with journalctl. Those errors should
# become less unexpected now.
#
# There are generally two classes of dlopen(3) calls. Those that we want to
# support and those that should be deactivated / unsupported. This change
# enforces that we handle all dlopen calls explicitly. Meaning: There is
# not a single dlopen call in the source code tree that we did not
# explicitly handle.
#
# In order to do this we introduced a list of attributes that maps from
# shared object name to the package that contains them. The package can be
# null meaning the reference should be nuked and the shared object will
# never be loadable during runtime (because it points at an invalid store
# path location).
#
# To get a list of dynamically loaded libraries issue something like
# `grep -ri 'dlopen("lib' $src` and update the below list.
dlopenLibs = [
# We did never provide support for libxkbcommon & qrencode
{ name = "libxkbcommon.so.0"; pkg = null; }
{ name = "libqrencode.so.4"; pkg = null; }
# We did not provide libpwquality before so it is safe to disable it for
# now.
{ name = "libpwquality.so.1"; pkg = null; }
# Only include cryptsetup if it is enabled. We might not be able to
# provide it during "bootstrap" in e.g. the minimal systemd build as
# cryptsetup has udev (aka systemd) in it's dependencies.
{ name = "libcryptsetup.so.12"; pkg = if withCryptsetup then cryptsetup else null; }
# We are using libidn2 so we only provide that and ignore the others.
# Systemd does this decision during configure time and uses ifdef's to
# enable specific branches. We can safely ignore (nuke) the libidn "v1"
# libraries.
{ name = "libidn2.so.0"; pkg = libidn2; }
{ name = "libidn.so.12"; pkg = null; }
{ name = "libidn.so.11"; pkg = null; }
# journalctl --grep requires libpcre so lets provide it
{ name = "libpcre2-8.so.0"; pkg = pcre2; }
];
patchDlOpen = dl: let
library = "${lib.makeLibraryPath [dl.pkg]}/${dl.name}";
in if dl.pkg == null then ''
# remove the dependency on the library by replacing it with an invalid path
for file in $(grep -lr 'dlopen("${dl.name}"' src); do
echo "patching dlopen(\"${dl.name}\", ) in $file to an invalid store path ("/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-not-implemented/${dl.name}")"
substituteInPlace "$file" --replace 'dlopen("${dl.name}"' 'dlopen("/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-not-implemented/${dl.name}"'
done
'' else ''
# ensure that the library we provide actually exists
if ! [ -e ${library} ]; then
echo 'The shared library `${library}` does not exist but was given as subtitute for `${dl.name}`'
exit 1
fi
# make the path to the dependency explicit
for file in $(grep -lr 'dlopen("${dl.name}"' src); do
echo "patching dlopen(\"${dl.name}\", ) in $file to ${library}"
substituteInPlace "$file" --replace 'dlopen("${dl.name}"' 'dlopen("${library}"'
done
'';
in # patch all the dlopen calls to contain absolute paths to the libraries
lib.concatMapStringsSep "\n" patchDlOpen dlopenLibs)
# finally ensure that there are no left-over dlopen calls that we didn't handle
+ ''
if grep -qr 'dlopen("[^/]' src; then
echo "Found unhandled dlopen calls: "
grep -r 'dlopen("[^/]' src
exit 1
fi
'';
outputs = [ "out" "man" "dev" ];
nativeBuildInputs =
2020-10-27 22:28:29 +00:00
[
pkgconfig
gperf
ninja
meson
coreutils # meson calls date, stat etc.
glibcLocales
2020-10-27 22:28:29 +00:00
patchelf
getent
m4
2019-02-22 08:23:48 +00:00
intltool
gettext
2020-10-27 22:28:29 +00:00
libxslt
docbook_xsl
docbook_xml_dtd_42
docbook_xml_dtd_45
(buildPackages.python3Packages.python.withPackages (ps: with ps; [ python3Packages.lxml ]))
];
2020-10-27 22:28:29 +00:00
buildInputs =
2020-10-27 22:28:29 +00:00
[
acl
audit
glib
kmod
libcap
libgcrypt
libidn2
libuuid
linuxHeaders
pam
]
2020-10-28 00:36:02 +00:00
++ lib.optional withApparmor libapparmor
++ lib.optional wantCurl (lib.getDev curl)
++ lib.optionals withCompression [ bzip2 lz4 xz ]
++ lib.optional withCryptsetup (lib.getDev cryptsetup.dev)
++ lib.optional withEfi gnu-efi
++ lib.optional withKexectools kexectools
++ lib.optional withLibseccomp libseccomp
++ lib.optional withNetworkd iptables
++ lib.optional withPCRE2 pcre2
++ lib.optional withResolved libgpgerror
++ lib.optional withSelinux libselinux
++ lib.optional withRemote libmicrohttpd
++ lib.optionals withHomed [ p11-kit libfido2 ]
;
#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"}"
"-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"
"-Dglib=${lib.boolToString (glib != null)}"
# while we do not run tests we should also not build them. Removes about 600 targets
"-Dtests=false"
2020-10-27 23:29:07 +00:00
"-Danalyze=${lib.boolToString withAnalyze}"
2020-10-27 23:29:34 +00:00
"-Dgcrypt=${lib.boolToString (libgcrypt != null)}"
"-Dimportd=${lib.boolToString withImportd}"
"-Dlz4=${lib.boolToString withCompression}"
"-Dhomed=${stdenv.lib.boolToString withHomed}"
"-Dlogind=${lib.boolToString withLogind}"
"-Dlocaled=${lib.boolToString withLocaled}"
"-Dhostnamed=${lib.boolToString withHostnamed}"
2020-10-28 00:08:29 +00:00
"-Dmachined=${lib.boolToString withMachined}"
"-Dnetworkd=${lib.boolToString withNetworkd}"
2020-11-01 14:35:11 +00:00
"-Doomd=${lib.boolToString withOomd}"
2020-10-27 23:48:51 +00:00
"-Dpolkit=${lib.boolToString withPolkit}"
"-Dcryptsetup=${lib.boolToString withCryptsetup}"
"-Dportabled=${lib.boolToString withPortabled}"
"-Dhwdb=${lib.boolToString withHwdb}"
"-Dremote=${lib.boolToString withRemote}"
"-Dsysusers=false"
"-Dtimedated=${lib.boolToString withTimedated}"
"-Dtimesyncd=${lib.boolToString withTimesyncd}"
2020-10-28 00:00:44 +00:00
"-Duserdb=${lib.boolToString withUserDb}"
"-Dcoredump=${lib.boolToString withCoredump}"
"-Dfirstboot=false"
"-Dresolve=${lib.boolToString withResolved}"
"-Dsplit-usr=false"
"-Dlibcurl=${lib.boolToString wantCurl}"
"-Dlibidn=false"
"-Dlibidn2=true"
"-Dquotacheck=false"
"-Dldconfig=false"
"-Dsmack=true"
2019-02-22 08:23:48 +00:00
"-Db_pie=true"
2020-11-01 14:35:11 +00:00
"-Dinstall-sysconfdir=false"
/*
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"
"-Dsysvinit-path="
"-Dsysvrcnd-path="
"-Dkill-path=${coreutils}/bin/kill"
"-Dkmod-path=${kmod}/bin/kmod"
2020-11-24 15:29:28 +00:00
"-Dsulogin-path=${util-linux}/bin/sulogin"
"-Dmount-path=${util-linux}/bin/mount"
"-Dumount-path=${util-linux}/bin/umount"
2019-09-03 23:35:49 +00:00
"-Dcreate-log-dirs=false"
# Use cgroupsv2. This is already the upstream default, but better be explicit.
"-Ddefault-hierarchy=unified"
2019-09-03 23:35:49 +00:00
# Upstream defaulted to disable manpages since they optimize for the much
# more frequent development builds
"-Dman=true"
"-Defi=${lib.boolToString withEfi}"
"-Dgnu-efi=${lib.boolToString withEfi}"
] ++ lib.optionals withEfi [
"-Defi-libdir=${toString gnu-efi}/lib"
"-Defi-includedir=${toString gnu-efi}/include/efi"
"-Defi-ldsdir=${toString gnu-efi}/lib"
2020-10-27 23:51:39 +00:00
] ++ lib.optionals (withShellCompletions == false) [
"-Dbashcompletiondir=no"
"-Dzshcompletiondir=no"
2020-10-28 00:05:14 +00:00
] ++ lib.optionals (!withNss) [
"-Dnss-myhostname=false"
"-Dnss-mymachines=false"
"-Dnss-resolve=false"
"-Dnss-systemd=false"
];
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/core/mount.c \
src/core/swap.c \
src/cryptsetup/cryptsetup-generator.c \
src/journal/cat.c \
src/nspawn/nspawn.c \
src/remount-fs/remount-fs.c \
src/shared/generator.c \
src/shutdown/shutdown.c \
units/emergency.service.in \
units/rescue.service.in \
units/systemd-logind.service.in \
units/systemd-nspawn@.service.in; \
do
test -e $i
substituteInPlace $i \
--replace /usr/bin/getent ${getent}/bin/getent \
2020-11-24 15:29:28 +00:00
--replace /sbin/mkswap ${lib.getBin util-linux}/sbin/mkswap \
--replace /sbin/swapon ${lib.getBin util-linux}/sbin/swapon \
--replace /sbin/swapoff ${lib.getBin util-linux}/sbin/swapoff \
--replace /bin/echo ${coreutils}/bin/echo \
--replace /bin/cat ${coreutils}/bin/cat \
2020-11-24 15:29:28 +00:00
--replace /sbin/sulogin ${lib.getBin util-linux}/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
2020-11-01 14:35:11 +00:00
for dir in tools src/resolve test src/test src/shared; do
2019-02-22 08:23:48 +00:00
patchShebangs $dir
done
# absolute paths to gpg & tar
substituteInPlace src/import/pull-common.c \
--replace '"gpg"' '"${gnupg}/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.
2020-10-27 22:28:29 +00:00
"-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.
2020-10-27 22:28:29 +00:00
"-USYSTEMD_CGROUP_AGENT_PATH"
"-DSYSTEMD_CGROUP_AGENT_PATH=\"/run/current-system/systemd/lib/systemd/systemd-cgroups-agent\""
2020-10-27 22:28:29 +00:00
"-USYSTEMD_BINARY_PATH"
"-DSYSTEMD_BINARY_PATH=\"/run/current-system/systemd/lib/systemd/systemd\""
2019-10-29 23:53:51 +00:00
];
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 {} \;
2020-10-27 23:54:08 +00:00
'' + lib.optionalString (!withDocumentation) ''
rm -rf $out/share/doc
'';
enableParallelBuilding = true;
# 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;
meta = with 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 22:32:36 +00:00
license = licenses.lgpl21Plus;
platforms = platforms.linux;
priority = 10;
maintainers = with maintainers; [ andir eelco flokli kloenk ];
};
}