1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-29 21:55:36 +03:00
Commit Graph

64059 Commits

Author SHA1 Message Date
Yu Watanabe
49e3e219b0 rules: drop doubled space 2023-04-08 04:50:04 +09:00
Zbigniew Jędrzejewski-Szmek
d05e1be86e udev: restore compat symlink for nvme devices
In 5118e8e71d, the rules were changed to add
OPTIONS="string_escape=replace" to creation of
ENV{ID_SERIAL}="$env{ID_MODEL}_$env{ID_SERIAL_SHORT}", so that "/" would be
escaped. But this also changes how the symlink looks for devices that do not
have "/". This adds back the old symlink for compat, except when a slash
is present.

In the meantime, we changed the symlink format to include ${ND_NSID}. Since
the symlink with unescaped characters are older than that, for compat we
only need to cover the older type. (Symlinks without escaping and with ${ND_NSID}
were never created.)  This makes it slightly easier on users: the non-deprecated
symlinks are with "_${ND_NSID}", so they are easier to distinguish.

Fixes #27155.

Mostly untested :(  I only have a boring nvme device with no special characters
in the id, and the symlinks are unchanged for it by this patch.
2023-04-08 04:50:04 +09:00
Yu Watanabe
8f5a8d7c36 sd-device: manage cached sysattr values with path_hash_ops
As here keys are relative paths to sysattrs.
2023-04-08 04:50:04 +09:00
Yu Watanabe
0b4c70b47a sd-device,udev: tag must be a valid filename
All tags are managed under /run/udev/tags, and the directories there are
named with tags. Hence, each tag must be a valid filename.

This also makes all validity check moved to sd-device side, and
makes failure caused by setting invalid tags non-critical.

With this change, an empty string cannot be assigned to TAG=, hence the
test cases are adjusted.
2023-04-08 04:49:46 +09:00
Yu Watanabe
b6b446cb62 test: handle one more error gracefully
Fixes #27175.
2023-04-07 20:54:23 +02:00
Yu Watanabe
2c5f119c3c sd-device,udev: refuse invalid devlink and store in normalized form
This is especially for the case that the path contains "..".
Prompted by https://github.com/systemd/systemd/pull/27164#issuecomment-1498863858.

This also makes SYMLINK= gracefully handle paths prefixed with "/dev/",
and manage devlink paths with path_hash_ops.
2023-04-08 03:38:19 +09:00
Yu Watanabe
733b7bfd79 udev-rules: replace ingrowing word extractor with extract_first_word()
No functional change, just refactoring.
2023-04-08 03:38:19 +09:00
Yu Watanabe
f17af9c927 udev-rules: rename variable "filename" -> "path" 2023-04-08 03:38:19 +09:00
Yu Watanabe
03ff9c70ce udev-rules: add/update comments 2023-04-08 03:38:19 +09:00
Yu Watanabe
29162ba05c udev-rules: add missing paren 2023-04-08 03:38:19 +09:00
Olivier Gayot
b24b10592d localed: fix invalid free after shifting pointers using strstrip
After manually editing /etc/locale.gen, calling localectl set-locale
sometimes fails. When it fails, the systemd journal shows:
systemd-localed: free() / invalid pointer.

It turned out that it only fails if some of the uncommented lines in
/etc/locale.gen have leading spaces, as in:

  * C.UTF-8       <= OK
  * en_US.UTF-8   <= OK
  *  fr_FR.UTF-8  <= NOK

After parsing a line from /etc/locale.gen, we use strstrip() to obtain
the "trimmed" line (without leading or trailing spaces).

However, we store the result of strstrip() in the original pointer
containing the untrimmed line. This pointer is later passed to free
(this is done automatically using _cleanup_free_).

This is a problem because if any leading space is present, the pointer
will essentially be shifted from its original value. This will result in
an invalid free upon cleanup.

The same issue is present in the locale_gen_locale_supported function.

Fixed by storing the result of strstrip() in a different pointer.
2023-04-08 00:08:43 +08:00
Frantisek Sumsal
cb58571a11 test: bump the timeout for non-qemu runs to 90s
When Ubuntu CI is oversaturated, 60s doesn't seem to be enough.
2023-04-07 17:23:59 +02:00
Frantisek Sumsal
6de6376075 test: enable the systemd-resolved unit in TEST-75
Without enabling itx, there's no symlink to the org.freedesktop.resolve1
dbus service, so there exists a tiny window in which the sequence of
`systemctl start` and `systemctl service-log-level` commands might fail:

[ 1127.615151] H systemd[1]: Started Network Name Resolution.
[ 1127.617768] H testsuite-75.sh[34]: + systemctl service-log-level systemd-resolved.service debug
[ 1127.621251] H dbus-daemon[54]: [system] Activating via systemd: service name='org.freedesktop.resolve1' unit='dbus-org.freedesktop.resolve1.service' requested by ':1.24' (uid=0 pid=119 comm="systemctl service-log-level systemd-resolved>
[ 1127.621336] H systemd[1]: dbus-org.freedesktop.resolve1.service: Failed to load configuration: No such file or directory
[ 1127.621364] H systemd[1]: dbus-org.freedesktop.resolve1.service: Trying to enqueue job dbus-org.freedesktop.resolve1.service/start/replace
[ 1127.621395] H systemd[1]: D-Bus activation failed for dbus-org.freedesktop.resolve1.service: Unit dbus-org.freedesktop.resolve1.service not found.
[ 1127.621965] H dbus-daemon[54]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.resolve1.service': Unit dbus-org.freedesktop.resolve1.service not found.
[ 1127.622046] H systemd[1]: systemd-resolved.service: D-Bus name org.freedesktop.resolve1 now owned by :1.25
[ 1127.622130] H systemctl[119]: Failed to set log level of org.freedesktop.resolve1 to debug: Unit dbus-org.freedesktop.resolve1.service not found.

Spotted in a couple of recent Ubuntu CI runs.
2023-04-07 17:00:10 +02:00
Uwe Kleine-König
381ccb4246 man/systemd-mount: Clearify documentation about --bind-device
The documentation suggests that the mount point (i.e. the directory
where the device is mounted) is removed when the device vanishes.
However only stopping of the automount unit is implemented.

So adapt the documentation to reality.
2023-04-07 16:33:46 +02:00
Daan De Meyer
3267fc3885 mkosi: Update to latest
This contains the recently merged fixes to config parsing ordering
and overrides.
2023-04-07 21:56:22 +09:00
b84b9f0414 hwdb: Add support for "Passion Model P612F"
Add hwdb sensor entry for device Passion with accelerometer "MXC6655".
2023-04-07 21:55:25 +09:00
Zbigniew Jędrzejewski-Szmek
ddd43f31e3
Merge pull request #26887 from yuwata/proc-cmdline-filter-arguments
proc-cmdline: filter PID1 arguments on container
2023-04-07 10:55:30 +02:00
Zbigniew Jędrzejewski-Szmek
9c1d3d6fa7
Merge pull request #27161 from pothos/sysext-refresh
systemd-sysext/confext.service: Refresh on start/reload
2023-04-07 10:40:18 +02:00
Daan De Meyer
05f7052732 bootctl: Gracefully handle missing bootloader directory
When --graceful is specified, let's gracefully deal with a missing
bootloader directory.
2023-04-07 10:34:34 +02:00
Ludwig Nussel
4bc14b1790 bootctl: show report state and type in json output 2023-04-07 10:22:37 +02:00
Mike Yuan
77c9bb177a
edit-util: improve log messages 2023-04-07 16:13:00 +08:00
Mike Yuan
bc6c7a58c2
edit-util: introduce overwrite_with_origin switch
Before this commit, if `original_path` is given,
it will always be used to overwrite `path`.
After this commit, it's controlled by the newly-added
switch `overwrite_with_origin`.
2023-04-07 16:13:00 +08:00
Mike Yuan
54ad6aa164
edit-util: make original_path and comment_paths work together 2023-04-07 16:10:57 +08:00
Mike Yuan
6e5d0e319e
edit-util: add DROPIN_MARKER_{START,END} 2023-04-07 16:10:54 +08:00
Cristian Rodríguez
e144a26306
resolve: change DNS_PACKET_UNICAST_SIZE_LARGE_MAX to 1232 (#27171)
The old common default was 4096, until 2020 on which all DNS servers (verified
on BIND9, NSD, Unbound, dnsmasq) switched to 1232 as an agreed max size [1].

[1] https://www.dnsflagday.net/2020/#message-size-considerations
2023-04-07 09:52:52 +02:00
Zbigniew Jędrzejewski-Szmek
1e094cb4ba
Merge pull request #27126 from yuwata/journal-compress
sd-journal: allow to specify compression algorithm through env
2023-04-07 09:28:27 +02:00
Sorah Fukumori
744b04c557 man: netdev: Clarify wireguard IPv6 endpoint format 2023-04-07 08:15:34 +09:00
Daan De Meyer
af6c5c7025 mkosi: Update to latest
This also migrates the configuration to the new format that was
just merged in mkosi. Specifically, we make use of the new [Match]
sections to only include specific config snippets per distro.
2023-04-07 08:13:42 +09:00
Yu Watanabe
0864b5eb6e
Merge pull request #27158 from mrc0mmand/more-tests
test: introduce TEST-81-GENERATORS
2023-04-07 07:53:37 +09:00
Frantisek Sumsal
61961e693d test: check if we skip the full setup on daemon-reexec
A simple test case for issue #27106.

Resolves: #27139
2023-04-07 07:53:14 +09:00
Yu Watanabe
d23a1c52a9 test: add test case that journal file is created with the requested compression algorithm 2023-04-07 02:30:43 +09:00
Kai Lueke
721412ac98 systemd-sysext/confext.service: Refresh on start/reload
When adding a sysext image to the system and manuall merging it, a
later "systemctl (re)start systemd-sysext" won't work because "merge"
refuses to work when something is merged already. Another problem with
"merge" at start plus "unmerge" at stop is that a service restart can't
make use of the new MOVE_MOUNT_BENEATH in the future even which would
only be available in "refresh". It also prepares us for setting up the
merged overlay for the sysroot from the initrd already, which also
would lead to the mentioned start problem of the service (One
optimization could be to skip the loading but only if we are sure that
all images were loaded and weren't modified since - this assumption is
hard because early services could want to inject a sysext, too).

Use "refresh" on service start to fix the problem that the service
can't start as soon as a manual merge was done. Also add a reload
action that allows to issue "systemctl reload systemd-sysext" and it
will make use of MOVE_MOUNT_BENEATH once we implement this in
systemd-sysext refresh (and it's available from the kernel).
2023-04-06 20:47:26 +09:00
Kai Lueke
1e07c6f31d man/systemd-dissect.xml: Remove old sysext path, add confext path
The /usr/lib/extensions/ location for systemd-sysext images is not
supported anymore. In https://github.com/systemd/systemd/pull/26013
systemd-confext images got introduced and we can list its path under
/usr instead.
2023-04-06 20:46:43 +09:00
Frantisek Sumsal
17c9dbc98b test: introduce TEST-81-GENERATORS
Add some explicit tests for various generators we ship, e.g.:
    - systemd-debug-generator
    - systemd-environment-d-generator
    - systemd-fstab-generator
2023-04-06 13:16:40 +02:00
Luca Boccassi
d7805ff711
Merge pull request #26013 from goenkam/maanya/syscfg-feature
confext: extension of sysext
2023-04-06 10:59:18 +01:00
Frantisek Sumsal
9948a169c0 test: add a couple of tests for systemd-modules-load 2023-04-06 10:26:47 +02:00
Frantisek Sumsal
006a60e079 fstab-generator: don't propagate ignored errno
With certain fstabs we may propagate ENXIO from the $SYSTEMD_SYSFS_CHECK
check all the way up, making fstab-generator exit with a non-zero EC and
without any helpful message, which is really confusing.
2023-04-06 10:26:47 +02:00
Daan De Meyer
b24bfd6ee4 repart: Add more logging 2023-04-06 09:45:46 +02:00
maanyagoenka
bbcc658e35 confext: shell completion for systemd-confext 2023-04-05 21:50:04 +00:00
maanyagoenka
1f4f166690 confext: documentation and man page updates for confext 2023-04-05 21:50:04 +00:00
maanyagoenka
f7700ea599 test-os-util: add tests for sysext and confext release files 2023-04-05 21:50:04 +00:00
maanyagoenka
c3c6a4f0a9 confext: add tests for systemd-confext 2023-04-05 21:50:04 +00:00
maanyagoenka
1f839f48e0 confext: add the systemd-confext.service file 2023-04-05 21:50:04 +00:00
maanyagoenka
4da1df42ac confext: add multi call functionality to sysext
The confext concept is an extension of the existing sysext concept and
allows to extend the host's filesystem or a unit's filesystem with signed
images that add new files to the /etc/ directory using OverlayFS.
2023-04-05 21:50:04 +00:00
maanyagoenka
30dfe035eb extension-release: establish compatibility between host file and extension-release file
The release file that accompanies the confext images needs to be
host compatible to be able to be merged into the host /etc/ directory.
This commit checks for version compatibility between the image file and
the host file.
2023-04-05 21:50:04 +00:00
maanyagoenka
b60e0f5777 os-util: add a new confext image type and the ability to parse their release files
Adds a new image type called IMAGE_CONFEXT which is similar to IMAGE_SYSEXT but works
for the /etc/ directory instead of /usr/ and /opt/. This commit also adds the ability to
parse the release file that is present with the confext image in /etc/confext-release.d/
directory.
2023-04-05 21:50:04 +00:00
Luca Boccassi
7393530f22
Merge pull request #27154 from DaanDeMeyer/kconfig
mkosi kernel build updates
2023-04-05 19:59:24 +01:00
Franck Bui
f9a23d428a test: use kbd-mode-map we ship in TEST-73-LOCALE
The rational is the same as the one described in commit
be0cc2ce6c.
2023-04-05 19:58:57 +01:00
Lennart Poettering
3bcf564530 update TODO 2023-04-05 20:56:16 +02:00
Lennart Poettering
9ea811914f man: document image policy syntax and semantics, and the hooks in the various components 2023-04-05 20:55:15 +02:00