Skip to content

Commit 0e66f6b

Browse files
committed
systemd: add comments to patches
1 parent 6e667dc commit 0e66f6b

1 file changed

Lines changed: 55 additions & 2 deletions

File tree

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

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,74 @@ in stdenv.mkDerivation {
4343
};
4444

4545
patches = [
46+
# I heard rumours this is also an upstream discussion. But what bug does this fix?
47+
# can we fix this by building systemd with crypttab support enabled, and having NixOS
48+
# properly populate /etc/crypttab?
4649
./0001-Start-device-units-for-uninitialised-encrypted-devic.patch
47-
./0003-Don-t-try-to-unmount-nix-or-nix-store.patch
50+
51+
./0003-Don-t-try-to-unmount-nix-or-nix-store.patch # x-initrd ?
52+
53+
# Does this still apply? If yes (and too complicated to check for bind
54+
# mounts), can we add a command line argument to nspawn to ignore the
55+
# check?
56+
# this seems to be not the init script, but /etc/os-release
4857
./0004-Fix-NixOS-containers.patch
58+
59+
# What other occurences of /sbin/… are there in systemd?
60+
# Can /sbin be overridden by meson? Or do we want to look these things up
61+
# from $PATH?
4962
./0006-Look-for-fsck-in-the-right-place.patch
63+
64+
# As for some of the path *removals*:
65+
# These are probably micro-optimizations, we can just include
66+
# As for the addition of /etc/systemd-mutable/ (and the per-user equivalent)
67+
# This seems to be only used for dysnomia. Can we solve this more
68+
# elegantly, while still having /etc/ mostly read-only?
69+
# in the very future, we might want to have NixOS populate in
70+
# /usr/lib/systemd/system (or another, more NixOS-y path), and make
71+
# /etc/systemd/system mutable (maybe behind a warning knob)
5072
./0007-Add-some-NixOS-specific-unit-directories.patch
51-
./0009-Get-rid-of-a-useless-message-in-user-sessions.patch
73+
74+
./0009-Get-rid-of-a-useless-message-in-user-sessions.patch # x-initrd ?
75+
76+
# Most of these files are read-only on NixOS.
77+
# Check if the error messages are good enough, upstream if they aren't,
78+
# then drop that patch.
5279
./0010-hostnamed-localed-timedated-disable-methods-that-cha.patch
80+
81+
# Probably micro-optimization and droppable.
5382
./0011-Fix-hwdb-paths.patch
83+
84+
# Should this be configurable through meson?
5485
./0012-Change-usr-share-zoneinfo-to-etc-zoneinfo.patch
86+
87+
# Should this be configurable through meson?
88+
# meson knob to change /usr/share
5589
./0013-localectl-use-etc-X11-xkb-for-list-x11.patch
90+
91+
# This could probably work by setting DESTDIR to an empty string
92+
# Ask on ML: This should probably be created at boot, why is it part of the build system?
5693
./0016-build-don-t-create-statedir-and-don-t-touch-prefixdi.patch
94+
95+
# introduces factoryconfdir
96+
# This should just be DESTDIR
97+
# TODO: follow up with Mic92
5798
./0018-Install-default-configuration-into-out-share-factory.patch
99+
100+
# probably similar question as 0006-*?
58101
./0019-inherit-systemd-environment-when-calling-generators.patch
102+
103+
# we should chase usages of these constants, not have things fail at runtime!
59104
./0020-reintroduce-the-no-such-path-PATH-that-was-dropped-s.patch
105+
106+
# far future: add nixos-specific stuff like /etc/systemd-mutable stuff in here,
107+
# and chase hardcoded paths inside systemd src
60108
./0021-add-rootprefix-to-lookup-dir-paths.patch
109+
110+
# Might be useful upstream too (just needs to be added to the docs?)
61111
./0022-systemd-shutdown-execute-scripts-in-etc-systemd-syst.patch
112+
113+
# Might be useful upstream too (just needs to be added to the docs?)
62114
./0023-systemd-sleep-execute-scripts-in-etc-systemd-system-.patch
63115

64116
# NixOS-specific patches
@@ -270,6 +322,7 @@ in stdenv.mkDerivation {
270322
# The reference will be replaced by the same reference the usual nukeRefs
271323
# tooling uses. The standard tooling can not / should not be uesd since it
272324
# is a bit too excessive and could potentially do us some (more) harm.
325+
# TODO: check if it's still an issue, check with another linker, maybe binutils bug?
273326
postFixup = ''
274327
nukedRef=$(echo $out | sed -e "s,$NIX_STORE/[^-]*-\(.*\),$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-\1,")
275328
cat $lib/lib/libsystemd.so | perl -pe "s|$out/lib/systemd/catalog|$nukedRef/lib/systemd/catalog|" > $lib/lib/libsystemd.so.tmp

0 commit comments

Comments
 (0)