Commit Graph
57095 Commits
Author SHA1 Message Date
Anita Zhang 914d4e99f4 oomd: handle situations when no cgroups are killed
Currently if systemd-oomd doesn't kill anything in a selected cgroup, it
selects a new candidate immediately. But if a selected cgroup wasn't killed,
it is likely due to it disappearing or getting cleaned up between the time
it was selected as a candidate and getting sent SIGKILL(s). We should handle
it as though systemd-oomd did perform a kill so that it will check
swap/pressure again before it tries to select a new candidate.
2022-01-20 14:15:13 -08:00
Anita Zhang 2ee209466b oomd: fix race with path unavailability when killing cgroups
There can be a situation where systemd-oomd would kill all of the processes
in a cgroup, pid1 would clean up that cgroup, and systemd-oomd would get
ENODEV trying to iterate the cgroup a final time to ensure it was empty.
systemd-oomd sees this as an error and immediately picks a new candidate even
though pressure may have recovered. To counter this, check and handle
path unavailability errnos specially.

Fixes: #22030
2022-01-20 14:15:11 -08:00
Zbigniew Jędrzejewski-Szmek 01c6946081 shared/specifier: treat NULL the same as ""
We would busily allocate an empty string to concatenate all of it's
zero characters to the output. Let's make things a bit simpler by letting
the specifier functions return NULL to mean "nothing to append".
2022-01-20 22:34:08 +01:00
Yu Watanabe 92796278f8 resolve: reduce attempts of reading link file
The function `link_relevant()` is called repeatedly in `link_allocate_scopes()`.
Let's not read networkd's link file in `link_relevant()`.

Closes #22190.
2022-01-21 06:22:39 +09:00
Yu Watanabe 1a4152f02b wait-online: use network_link_get_operational_state() 2022-01-21 06:22:39 +09:00
Yu Watanabe 61dc4b9ea9 network-util: introduce network_link_get_operational_state() 2022-01-21 06:22:21 +09:00
Yu Watanabe e9662a28a4 resolve: use FLAGS_SET() macro 2022-01-21 06:22:16 +09:00
Yu Watanabe 12f45cbbbe resolve: use netif_has_carrier() 2022-01-21 05:07:10 +09:00
Yu Watanabe 61e964df71 netif-util: introduce netif_has_carrier() 2022-01-21 05:02:42 +09:00
Yu Watanabe 605bb1634b resolve: drop redundant call of link_allocate_scopes() and link_add_rrs()
In `manager_process_link()`, the function `link_update()` is called just
after `link_process_rtnl()`, and `link_update()` also calls
`link_allocate_scopes()` and `link_add_rrs()`. Hence, the calls in
`link_process_rtnl()` are redundant.
2022-01-21 04:46:20 +09:00
Yu Watanabe 8827f4106b resolve: use log_link_warning_errno() or freinds more 2022-01-21 04:43:37 +09:00
Yu Watanabe 57786db797 resolve: add debuging log of interface name change 2022-01-21 04:33:11 +09:00
Evgeny Vereshchagin 381ccb5cc0 tests: make fuzz-journal-remote less flaky
by always calling journal_remote_server_destroy, which resets global
variables like journal_remote_server_global. It should prevent crashes like
```
Assertion 'journal_remote_server_global == NULL' failed at src/journal-remote/journal-remote.c:312, function int journal_remote_server_init(RemoteServer *, const char *, JournalWriteSplitMode, _Bool, _Bool)(). Aborting.
AddressSanitizer:DEADLYSIGNAL
=================================================================
==24769==ERROR: AddressSanitizer: ABRT on unknown address 0x0539000060c1 (pc 0x7f23b4d5818b bp 0x7ffcbc4080c0 sp 0x7ffcbc407e70 T0)
SCARINESS: 10 (signal)
    #0 0x7f23b4d5818b in raise /build/glibc-eX1tMB/glibc-2.31/sysdeps/unix/sysv/linux/raise.c:51:1
    #1 0x7f23b4d37858 in abort /build/glibc-eX1tMB/glibc-2.31/stdlib/abort.c:79:7
    #2 0x7f23b5731809 in log_assert_failed systemd/src/basic/log.c:866:9
```
2022-01-21 04:20:47 +09:00
Zbigniew Jędrzejewski-Szmek 601dc59be2 Use ASSERT_PTR() in more places 2022-01-20 17:29:51 +01:00
Evgeny Vereshchagin 478c632e00 ci: switch to fedora-35 on i386 on Packit
systemd seems to be failing to compile there with gcc-12 but considering
that gcc-12 hasn't been released yet it doesn't seem to make sense
to add workarounds to get it to compile there. Until gcc-12 is
stabilized it should be enough to build systemd on fedora-35 to
make sure it's buildable on i386.
2022-01-20 21:02:16 +09:00
Thomas Batten 5888fa9b16 hwdb: Add accel orientation quirk for the GPD Pocket 3 2022-01-20 19:54:53 +09:00
Tyson Whitehead 230ed4c4ba hwdb: CH Pro Pedals not classified correctly due to no buttons 2022-01-20 19:54:26 +09:00
Evgeny Vereshchagin e0ec0450e9 tests: fuzz etc_hosts_parse
That's just a follow-up to https://github.com/systemd/systemd/pull/22179
2022-01-20 15:53:48 +09:00
Yu Watanabe 98b1eb711c resolve: fix assertion triggered when r == 0
Fixes #22178.
2022-01-20 15:52:14 +09:00
Jan Janssen acac88340a bus: Use OrderedSet for introspection
Otherwise, the generated xml files are not reproducible.
2022-01-19 23:07:59 +00:00
Luca Boccassi de843f8582 Merge pull request #21865 from yuwata/network-sr-iov
udev/net: support configuring SR-IOV virtual functions through .link file
2022-01-19 22:38:00 +00:00
Jan Janssen 1bc8417cfe boot: Use -ffile-prefix-map when present
This should make sure the stub elf binary is reproducible.

Fixes: #22157
2022-01-19 21:06:24 +00:00
Zbigniew Jędrzejewski-Szmek b09869eaf7 Merge pull request #22172 from yuwata/udev-sd-device-more-debugging-logs
udev, sd-device: more debugging logs
2022-01-19 15:11:48 +01:00
Yu Watanabe 5ab9addd68 test: replace multiple echo with cat
Suggested by shell check SC2129.
2022-01-19 20:48:36 +09:00
Yu Watanabe e916276016 udev-util: add event UUID to debugging logs 2022-01-19 20:48:36 +09:00
Yu Watanabe d7cb60daf6 sd-device: add more debugging logs in device_set_syspath()
On failure, the function previously sometimes logs in debug level, but
sometimes does not. Let's always log the error cause.
2022-01-19 20:48:36 +09:00
Yu Watanabe 30b6f7d714 meson: skip to search clang, llvm-string, and bpftool, if libbpf not found
Prompted by https://github.com/systemd/systemd/pull/22093#issuecomment-1016254914.
2022-01-19 14:23:41 +03:00
Yu Watanabe 39f83dd760 test: wait for newly created btrfs triggered
Fixes the second issue in #21819.
2022-01-19 09:32:23 +00:00
Zbigniew Jędrzejewski-Szmek 01f5177ffd Merge pull request #22163 from bluca/extension_images_validation
Improve ExtensionImages validation
2022-01-19 08:57:15 +01:00
Luca Boccassi 70a5c6dce0 sysext: use LO_FLAGS_PARTSCAN when opening image
Jan 17 12:34:59 myguest1 (sd-sysext)[486]: Device '/var/lib/extensions/myext.raw' is loopback block device with partition scanning turned off, please turn it on.

Fixes https://github.com/systemd/systemd/issues/22146
2022-01-19 08:54:50 +01:00
Yu Watanabe 1e8e9730d2 test-network: add testcases for configuring SR-IOV by .link file 2022-01-19 15:00:53 +09:00
Yu Watanabe a03ff4c0fe test-network: split out SR-IOV test to new class 2022-01-19 15:00:53 +09:00
Yu Watanabe 0eed039c92 test-network: silence check for alternative names 2022-01-19 15:00:53 +09:00
Yu Watanabe df25b9e48c network: show driver in debug log 2022-01-19 15:00:53 +09:00
Yu Watanabe 252e96eaa9 udev/net: check if the requested SR-IOV virtual function exists before configuring it 2022-01-19 15:00:53 +09:00
Yu Watanabe 41ce9d769d udev/net: allow to set number of SR-IOV virtual functions
This adds SR-IOVVirtualFunctions= setting in [Link] section.
2022-01-19 15:00:53 +09:00
Yu Watanabe bd29dfef8b udev/net: also support [SR-IOV] section in .link files
The same section is already supported by .network files. But such
low-level inteerface setting should be done by udevd, instead of
networkd. Let's also support the same semantics by .link files.

Prompted by https://github.com/systemd/systemd/issues/20474#issuecomment-901901360.
2022-01-19 15:00:49 +09:00
Yu Watanabe b4fd34d81c network: move SR-IOV related functions to src/shared/netif-sriov.[ch] 2022-01-19 14:57:59 +09:00
Yu Watanabe 307fe3cdf2 network: rename NetworkConfigSection -> ConfigSection
And move it and relevant functions to conf-parser.[ch].
2022-01-19 14:57:59 +09:00
Yu Watanabe e5c4289a9d network: sr-iov: add missing assertion 2022-01-19 14:57:59 +09:00
Yu Watanabe e217e22a77 network: sr-iov: drop conflicting sections 2022-01-19 14:57:59 +09:00
Yu Watanabe cfd1d61fe4 network: sr-iov: fix section name in log messages 2022-01-19 14:57:59 +09:00
Yu Watanabe edaca18739 Merge pull request #22161 from kreijack/ignore-boot-entries
bootctl: Ignore boot entries (continue #22041)
2022-01-19 14:43:10 +09:00
Luca Boccassi 78ab2b5064 core: refuse to mount ExtensionImages if the base layer doesn't at least have ID in os-release
We can't match an extension if we don't at least have an ID,
so refuse to continue
2022-01-19 00:08:57 +00:00
Luca Boccassi 37361f46d5 dissect-image: validate extension-release even if the host has only ID in os-release
A rolling distro won't set VERSION_ID or SYSEXT_LEVEL in os-release,
which means we skip validation of ExtensionImages.
Validate even with just an ID, the lower level helper already
recognizes and accepts this use case.

Fixes https://github.com/systemd/systemd/issues/22146
2022-01-19 00:01:48 +00:00
Luca Boccassi 095162d721 Merge pull request #22159 from medhefgo/boot-xbootldr
boot: xbootldr improvements
2022-01-18 22:40:58 +00:00
Ludwig Nussel 8dd3f6a3fd machined: provide more details to polkit auth 2022-01-18 22:35:09 +00:00
Goffredo Baroncelli 2fbf50d675 bootctl: removed unused parameter only_auto
Remove the parameter 'only_auto' from the function
boot_entries_augment_from_loader() because each caller set it always to
true.

Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>
2022-01-18 19:32:35 +01:00
Goffredo Baroncelli 9914d89b51 bootctl: ignore the bootloader boot entries
When bootctl lists the boot entries, considers also the ones
returned by systemd-boot (via the efi LoaderEntries variable),
created at boot time.

Unfortunately this list may became incorrect if (e.g.) the user remove a
kernel package.

This patch changes this behaviour, so bootctl ignores some the
boot entries returned by systemd-boot.

In any case, bootctl still considers the 'auto-xxx' boot entries
listed below:

  Boot entrie name                 Title
  -----------------------------    ------------------------------
  auto-osx                         macOS boot loader
  auto-windows                     Windows Boot Manager
  auto-efi-shell                   EFI Shell
  auto-efi-default                 EFI Default Loader
  auto-reboot-to-firmware-setup    Reboot Into Firmware Interface

The other entries that systemd-boot synthetizes (e.g. the ones loaded from
/efi/loader/entries/<uuid>) can be synthetized by bootctl too, so no
information is lost.

Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>
2022-01-18 19:32:35 +01:00
Zbigniew Jędrzejewski-Szmek 5c1b257faf kernel-install: add new variable $KERNEL_INSTALL_INITRD_GENERATOR
The idea is that when not set, we do whatever we did in the past. But
with a new setting of initrd_generator=mkosi-initrd, mkosi-initrd will
generate an initrd.
2022-01-18 17:40:13 +01:00