]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agoudevadm: cleanup-db: don't delete information for kept db entries 22202/head
Martin Wilck [Thu, 20 Jan 2022 13:31:45 +0000 (14:31 +0100)] 
udevadm: cleanup-db: don't delete information for kept db entries

devices with the db_persist property won't be deleted during database
cleanup. This applies to dm and md devices in particular.
For such devices, we should also keep the files under /run/udev/links,
/run/udev/tags, and /run/udev/watch, to make sure that after restart,
udevd has the same information about the devices as it did before
the cleanup.

If we don't do this, a lower-priority device that is discovered in
the coldplug phase may take over symlinks from a device that persisted.
Not removing the watches also enables udevd to resume watching a device
after restart.

Signed-off-by: Martin Wilck <mwilck@suse.com>
3 years agoudevadm: cleanup_dir: use dot_or_dot_dot()
Martin Wilck [Fri, 21 Jan 2022 09:44:26 +0000 (10:44 +0100)] 
udevadm: cleanup_dir: use dot_or_dot_dot()

which is safer than just checking dent[0].
Also, fix two style issues.

3 years agohwdb: Add accel orientation quirk for the GPD Pocket 3
Thomas Batten [Thu, 20 Jan 2022 08:54:00 +0000 (19:24 +1030)] 
hwdb: Add accel orientation quirk for the GPD Pocket 3

3 years agohwdb: CH Pro Pedals not classified correctly due to no buttons
Tyson Whitehead [Thu, 20 Jan 2022 03:38:21 +0000 (22:38 -0500)] 
hwdb: CH Pro Pedals not classified correctly due to no buttons

3 years agotests: fuzz etc_hosts_parse
Evgeny Vereshchagin [Thu, 20 Jan 2022 05:06:49 +0000 (05:06 +0000)] 
tests: fuzz etc_hosts_parse

That's just a follow-up to https://github.com/systemd/systemd/pull/22179

3 years agoresolve: fix assertion triggered when r == 0
Yu Watanabe [Wed, 19 Jan 2022 20:24:31 +0000 (05:24 +0900)] 
resolve: fix assertion triggered when r == 0

Fixes #22178.

3 years agobus: Use OrderedSet for introspection
Jan Janssen [Wed, 19 Jan 2022 09:15:36 +0000 (10:15 +0100)] 
bus: Use OrderedSet for introspection

Otherwise, the generated xml files are not reproducible.

3 years agoMerge pull request #21865 from yuwata/network-sr-iov
Luca Boccassi [Wed, 19 Jan 2022 22:38:00 +0000 (22:38 +0000)] 
Merge pull request #21865 from yuwata/network-sr-iov

udev/net: support configuring SR-IOV virtual functions through .link file

3 years agoboot: Use -ffile-prefix-map when present
Jan Janssen [Wed, 19 Jan 2022 15:37:25 +0000 (16:37 +0100)] 
boot: Use -ffile-prefix-map when present

This should make sure the stub elf binary is reproducible.

Fixes: #22157
3 years agoMerge pull request #22172 from yuwata/udev-sd-device-more-debugging-logs
Zbigniew Jędrzejewski-Szmek [Wed, 19 Jan 2022 14:11:48 +0000 (15:11 +0100)] 
Merge pull request #22172 from yuwata/udev-sd-device-more-debugging-logs

udev, sd-device: more debugging logs

3 years agotest: replace multiple echo with cat 22172/head
Yu Watanabe [Wed, 19 Jan 2022 10:03:52 +0000 (19:03 +0900)] 
test: replace multiple echo with cat

Suggested by shell check SC2129.

3 years agoudev-util: add event UUID to debugging logs
Yu Watanabe [Wed, 19 Jan 2022 09:20:49 +0000 (18:20 +0900)] 
udev-util: add event UUID to debugging logs

3 years agosd-device: add more debugging logs in device_set_syspath()
Yu Watanabe [Wed, 19 Jan 2022 07:07:26 +0000 (16:07 +0900)] 
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.

3 years agomeson: skip to search clang, llvm-string, and bpftool, if libbpf not found
Yu Watanabe [Wed, 19 Jan 2022 09:46:09 +0000 (18:46 +0900)] 
meson: skip to search clang, llvm-string, and bpftool, if libbpf not found

Prompted by https://github.com/systemd/systemd/pull/22093#issuecomment-1016254914.

3 years agotest: wait for newly created btrfs triggered
Yu Watanabe [Wed, 19 Jan 2022 06:48:20 +0000 (15:48 +0900)] 
test: wait for newly created btrfs triggered

Fixes the second issue in #21819.

3 years agoMerge pull request #22163 from bluca/extension_images_validation
Zbigniew Jędrzejewski-Szmek [Wed, 19 Jan 2022 07:57:15 +0000 (08:57 +0100)] 
Merge pull request #22163 from bluca/extension_images_validation

Improve ExtensionImages validation

3 years agosysext: use LO_FLAGS_PARTSCAN when opening image
Luca Boccassi [Wed, 19 Jan 2022 00:27:45 +0000 (00:27 +0000)] 
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

3 years agotest-network: add testcases for configuring SR-IOV by .link file 21865/head
Yu Watanabe [Sat, 15 Jan 2022 00:26:32 +0000 (09:26 +0900)] 
test-network: add testcases for configuring SR-IOV by .link file

3 years agotest-network: split out SR-IOV test to new class
Yu Watanabe [Fri, 14 Jan 2022 23:54:36 +0000 (08:54 +0900)] 
test-network: split out SR-IOV test to new class

3 years agotest-network: silence check for alternative names
Yu Watanabe [Sat, 15 Jan 2022 00:30:21 +0000 (09:30 +0900)] 
test-network: silence check for alternative names

3 years agonetwork: show driver in debug log
Yu Watanabe [Sat, 15 Jan 2022 00:08:47 +0000 (09:08 +0900)] 
network: show driver in debug log

3 years agoudev/net: check if the requested SR-IOV virtual function exists before configuring it
Yu Watanabe [Fri, 14 Jan 2022 22:03:20 +0000 (07:03 +0900)] 
udev/net: check if the requested SR-IOV virtual function exists before configuring it

3 years agoudev/net: allow to set number of SR-IOV virtual functions
Yu Watanabe [Fri, 14 Jan 2022 18:35:27 +0000 (03:35 +0900)] 
udev/net: allow to set number of SR-IOV virtual functions

This adds SR-IOVVirtualFunctions= setting in [Link] section.

3 years agoudev/net: also support [SR-IOV] section in .link files
Yu Watanabe [Fri, 14 Jan 2022 08:24:49 +0000 (17:24 +0900)] 
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.

3 years agonetwork: move SR-IOV related functions to src/shared/netif-sriov.[ch]
Yu Watanabe [Mon, 27 Dec 2021 02:09:02 +0000 (11:09 +0900)] 
network: move SR-IOV related functions to src/shared/netif-sriov.[ch]

3 years agonetwork: rename NetworkConfigSection -> ConfigSection
Yu Watanabe [Mon, 27 Dec 2021 01:34:24 +0000 (10:34 +0900)] 
network: rename NetworkConfigSection -> ConfigSection

And move it and relevant functions to conf-parser.[ch].

3 years agonetwork: sr-iov: add missing assertion
Yu Watanabe [Fri, 14 Jan 2022 21:17:27 +0000 (06:17 +0900)] 
network: sr-iov: add missing assertion

3 years agonetwork: sr-iov: drop conflicting sections
Yu Watanabe [Thu, 23 Dec 2021 03:59:52 +0000 (12:59 +0900)] 
network: sr-iov: drop conflicting sections

3 years agonetwork: sr-iov: fix section name in log messages
Yu Watanabe [Thu, 23 Dec 2021 03:59:08 +0000 (12:59 +0900)] 
network: sr-iov: fix section name in log messages

3 years agoMerge pull request #22161 from kreijack/ignore-boot-entries
Yu Watanabe [Wed, 19 Jan 2022 05:43:10 +0000 (14:43 +0900)] 
Merge pull request #22161 from kreijack/ignore-boot-entries

bootctl: Ignore boot entries (continue #22041)

3 years agocore: refuse to mount ExtensionImages if the base layer doesn't at least have ID... 22163/head
Luca Boccassi [Wed, 19 Jan 2022 00:08:57 +0000 (00:08 +0000)] 
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

3 years agodissect-image: validate extension-release even if the host has only ID in os-release
Luca Boccassi [Wed, 19 Jan 2022 00:01:48 +0000 (00:01 +0000)] 
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

3 years agoMerge pull request #22159 from medhefgo/boot-xbootldr
Luca Boccassi [Tue, 18 Jan 2022 22:40:58 +0000 (22:40 +0000)] 
Merge pull request #22159 from medhefgo/boot-xbootldr

boot: xbootldr improvements

3 years agomachined: provide more details to polkit auth
Ludwig Nussel [Tue, 18 Jan 2022 13:47:41 +0000 (14:47 +0100)] 
machined: provide more details to polkit auth

3 years agobootctl: removed unused parameter only_auto 22161/head
Goffredo Baroncelli [Tue, 18 Jan 2022 18:32:35 +0000 (19:32 +0100)] 
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>
3 years agobootctl: ignore the bootloader boot entries
Goffredo Baroncelli [Tue, 18 Jan 2022 18:32:35 +0000 (19:32 +0100)] 
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>
3 years agoboot: Pass around HARDDRIVE_DEVICE_PATH 22159/head
Jan Janssen [Tue, 18 Jan 2022 12:35:53 +0000 (13:35 +0100)] 
boot: Pass around HARDDRIVE_DEVICE_PATH

3 years agoboot: Simplify looking for the xboot hard drive
Jan Janssen [Tue, 18 Jan 2022 12:01:39 +0000 (13:01 +0100)] 
boot: Simplify looking for the xboot hard drive

The device path should not contain multiple hard drive nodes in it,
so looking at them all should not be needed.
If some crazy firmware/driver were to make nested GPT drives
available like that, we should be only looking at the last partition
and its containing GPT drive anyway.

3 years agoboot: Search for the partition node directly
Jan Janssen [Tue, 18 Jan 2022 11:24:26 +0000 (12:24 +0100)] 
boot: Search for the partition node directly

Some firmware creates partition device paths without a messaging
device path node, making the search for the xboot loader partition
fail.

Fixes: #17756
3 years agoMerge pull request #21805 from наб
Zbigniew Jędrzejewski-Szmek [Tue, 18 Jan 2022 14:20:37 +0000 (15:20 +0100)] 
Merge pull request #21805 from наб

A trivial merge conflict was fixed manually.

3 years agoMerge pull request #22093 from yuwata/meson-bpftool-version
Zbigniew Jędrzejewski-Szmek [Tue, 18 Jan 2022 14:09:47 +0000 (15:09 +0100)] 
Merge pull request #22093 from yuwata/meson-bpftool-version

meson: require bpftool version >= 5.6

3 years agomeson: force ctags to use absolute paths
Evgeny Vereshchagin [Sun, 16 Jan 2022 06:06:15 +0000 (06:06 +0000)] 
meson: force ctags to use absolute paths

Looks like https://github.com/mesonbuild/meson/issues/957 was
reintroduced in meson-0.57.0 (and looking and https://mesonbuild.com/Release-notes-for-0-57-0.html
I'm not sure whether it was intentional or not) so run_command can no
longer be used to get around
https://github.com/mesonbuild/meson/issues/3589. Let's just force
ctags to always use absolute paths to fix it once and for all.

3 years agoMerge pull request #22153 from evverx/switch-to-bullseye
Luca Boccassi [Tue, 18 Jan 2022 11:54:35 +0000 (11:54 +0000)] 
Merge pull request #22153 from evverx/switch-to-bullseye

ci: switch Debian from unstable to testing on mkosi

3 years agopid1,cgroup-show: ignore -EOPNOTSUPP in cg_read_pid()
Yu Watanabe [Wed, 12 Jan 2022 15:09:38 +0000 (00:09 +0900)] 
pid1,cgroup-show: ignore -EOPNOTSUPP in cg_read_pid()

The function is called in recursion, and cgroup.procs in some subcgroups
may not be read.

Fixes #22089.

3 years agoci: point mkosi to commit where "testing" is fixed 22153/head
Evgeny Vereshchagin [Tue, 18 Jan 2022 10:30:33 +0000 (10:30 +0000)] 
ci: point mkosi to commit where "testing" is fixed

https://github.com/systemd/mkosi/pull/886

3 years agoci: switch from unstable to testing on mkosi
Evgeny Vereshchagin [Mon, 17 Jan 2022 22:17:04 +0000 (22:17 +0000)] 
ci: switch from unstable to testing on mkosi

3 years agotest: fix a copy-and-paste error
Yu Watanabe [Tue, 18 Jan 2022 05:13:02 +0000 (14:13 +0900)] 
test: fix a copy-and-paste error

Follow-up for 12727c2bc2859995cbd561ffc3d9a4d571202254.

Addresses https://github.com/systemd/systemd/pull/22125#discussion_r786358474.

Fixes CID#1469023.

3 years agoman: add more references for extensions to portablectl
Luca Boccassi [Mon, 17 Jan 2022 15:11:29 +0000 (15:11 +0000)] 
man: add more references for extensions to portablectl

Link in systemd.io and systemd-sysext

Fixes #22146

3 years agoMerge pull request #22142 from evverx/libxkbcommon-dev
Evgeny Vereshchagin [Mon, 17 Jan 2022 21:15:56 +0000 (00:15 +0300)] 
Merge pull request #22142 from evverx/libxkbcommon-dev

ci: get Coverity and CodeQL to analyze the "libxkbcommon" part

3 years agoMerge pull request #22125 from DaanDeMeyer/copy-holes
Luca Boccassi [Mon, 17 Jan 2022 21:15:14 +0000 (21:15 +0000)] 
Merge pull request #22125 from DaanDeMeyer/copy-holes

shared: Copy holes in sparse files in copy_bytes_full()

3 years agojournal: Copy holes when archiving BTRFS journal files 22125/head
Daan De Meyer [Fri, 14 Jan 2022 16:49:06 +0000 (16:49 +0000)] 
journal: Copy holes when archiving BTRFS journal files

Previously, the holes we punched earlier would get removed when
copying the file. Let's enable the new COPY_HOLES flag to make
sure this doesn't happen.

In my test, this drops a 800MB btrfs journal (without compression)
to 720 MB.

Fixes #22087

3 years agoMerge pull request #22147 from keszybz/stdio-bridge-docs
Luca Boccassi [Mon, 17 Jan 2022 14:11:53 +0000 (14:11 +0000)] 
Merge pull request #22147 from keszybz/stdio-bridge-docs

More docs for systemd-stdio-bridge

3 years agokernel-install: also remove modules.builtin.alias.bin
Yu Watanabe [Fri, 14 Jan 2022 18:37:40 +0000 (03:37 +0900)] 
kernel-install: also remove modules.builtin.alias.bin

Fixes RHBZ#2016630.

3 years agomeson: drop unused SYSTEMD_STDIO_BRIDGE_BINARY_PATH 22147/head
Zbigniew Jędrzejewski-Szmek [Mon, 17 Jan 2022 10:49:41 +0000 (11:49 +0100)] 
meson: drop unused SYSTEMD_STDIO_BRIDGE_BINARY_PATH

The whole point of systemd-stdio-bridge is to be executed on "foreign" systems
where the path might be different, so we use $PATH to find the binary everywhere.

3 years agostdio-bridge: trim whitespace and braces
Zbigniew Jędrzejewski-Szmek [Mon, 17 Jan 2022 10:44:59 +0000 (11:44 +0100)] 
stdio-bridge: trim whitespace and braces

3 years agostdio-bridge: make the error more straightforward
Zbigniew Jędrzejewski-Szmek [Mon, 17 Jan 2022 10:44:44 +0000 (11:44 +0100)] 
stdio-bridge: make the error more straightforward

3 years agoman: enhance the description of systemd-stdio-bridge
Zbigniew Jędrzejewski-Szmek [Mon, 17 Jan 2022 10:43:48 +0000 (11:43 +0100)] 
man: enhance the description of systemd-stdio-bridge

I hope that this fixes the comment
https://github.com/systemd/systemd/pull/22141#issuecomment-1013960371
> As someone who doesn't know what this prog does

The listing in the man page is sorted according to logical
use: all the options setting the address are now together.

3 years agosystemd-stdio-bridge: add manpage
Luca Boccassi [Sun, 16 Jan 2022 18:41:10 +0000 (18:41 +0000)] 
systemd-stdio-bridge: add manpage

3 years agobuild(deps): bump github/codeql-action from 1.0.26 to 1.0.27
dependabot[bot] [Mon, 17 Jan 2022 05:26:55 +0000 (05:26 +0000)] 
build(deps): bump github/codeql-action from 1.0.26 to 1.0.27

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 1.0.26 to 1.0.27.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/5f532563584d71fdef14ee64d17bafb34f751ce5...cd783c8a29bdcf5a5c79c5137889e24651fa626c)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years agoci: trigger CodeQL on PRs when its dependencies change 22142/head
Evgeny Vereshchagin [Mon, 17 Jan 2022 01:59:55 +0000 (01:59 +0000)] 
ci: trigger CodeQL on PRs when its dependencies change

3 years agoboot: Beep n times for n-th entry
Jan Janssen [Sun, 16 Jan 2022 14:57:38 +0000 (15:57 +0100)] 
boot: Beep n times for n-th entry

3 years agoman: change 'allow[s] to' -> 'allow[s] one to'
Luca Boccassi [Sun, 16 Jan 2022 12:44:52 +0000 (12:44 +0000)] 
man: change 'allow[s] to' -> 'allow[s] one to'

Lintian is opinionated about this and we get nagged

3 years agoci: get Coverity and CodeQL to analyze the "libxkbcommon" part
Evgeny Vereshchagin [Sun, 16 Jan 2022 15:30:22 +0000 (15:30 +0000)] 
ci: get Coverity and CodeQL to analyze the "libxkbcommon" part

By analogy with https://github.com/systemd/systemd/pull/22138, to get
the static analyzers to analyze that part of code that package should
be installed there as well.

3 years agocore: add missing dependency DBus properties
Yu Watanabe [Sun, 16 Jan 2022 06:32:27 +0000 (15:32 +0900)] 
core: add missing dependency DBus properties

Follow-up for 0bc488c99ab2ed3464237607e381f4d72cd321d5.

Also sort dependency properties to make them match the definition of
`enum UnitDependency` in basic/unit-def.h.

Fixes #22133.

3 years agocore: update log message
Yu Watanabe [Sun, 16 Jan 2022 11:19:19 +0000 (20:19 +0900)] 
core: update log message

Fixes CID#1469009.

3 years agoMerge pull request #22136 from yuwata/network-wireguard-disable-adding-routes-to...
Luca Boccassi [Sun, 16 Jan 2022 14:04:30 +0000 (14:04 +0000)] 
Merge pull request #22136 from yuwata/network-wireguard-disable-adding-routes-to-allowed-ips-by-default

network: wireguard: disable adding routes to allowed ips by default

3 years agoci: install libbpf-dev in the unit_tests workflow
Evgeny Vereshchagin [Sun, 16 Jan 2022 08:32:17 +0000 (08:32 +0000)] 
ci: install libbpf-dev in the unit_tests workflow

Those dependencies are also used by Coverity and Codeql so
it should be installed there to get them to analyze that code.

Judging by https://github.com/systemd/systemd/pull/22137 it seems
to be working.

3 years agoboot: Add PC speaker support
Jan Janssen [Fri, 14 Jan 2022 13:27:08 +0000 (14:27 +0100)] 
boot: Add PC speaker support

Fixes: #17508
3 years agonetwork: wireguard: also accept negative boolean values to disable adding routes 22136/head
Yu Watanabe [Sun, 16 Jan 2022 06:59:45 +0000 (15:59 +0900)] 
network: wireguard: also accept negative boolean values to disable adding routes

RouteTable=off was introduced to provide consistency with wg-quick
command. This makes the RouteTable= settings accepts other negative
boolean values.

3 years agonetwork: wireguard: do not add routes to AllowedIPs= by default
Yu Watanabe [Sun, 16 Jan 2022 06:53:13 +0000 (15:53 +0900)] 
network: wireguard: do not add routes to AllowedIPs= by default

As setting such routes may break existing setups.

Closes #21964.

3 years agoMerge pull request #22130 from keszybz/silence-gcc-warning-in-sd-device
Luca Boccassi [Sat, 15 Jan 2022 16:22:59 +0000 (16:22 +0000)] 
Merge pull request #22130 from keszybz/silence-gcc-warning-in-sd-device

Silence gcc warning in sd-device

3 years agosd-device: drop unnecessary parenthesis 22130/head
Zbigniew Jędrzejewski-Szmek [Sat, 15 Jan 2022 12:38:49 +0000 (13:38 +0100)] 
sd-device: drop unnecessary parenthesis

3 years agosd-device: silence gcc warning with newest gcc
Zbigniew Jędrzejewski-Szmek [Sat, 15 Jan 2022 12:38:30 +0000 (13:38 +0100)] 
sd-device: silence gcc warning with newest gcc

3 years agoshared: Copy holes in sparse files in copy_bytes_full()
Daan De Meyer [Fri, 14 Jan 2022 16:41:28 +0000 (16:41 +0000)] 
shared: Copy holes in sparse files in copy_bytes_full()

Previously, all holes in sparse files copied with copy_bytes_full()
would be expanded in the target file. Now, we correctly detect holes
in the input file and we replicate them in the target file.

3 years agoMerge pull request #22098 from DaanDeMeyer/journal-corrupt-2
Yu Watanabe [Fri, 14 Jan 2022 12:23:32 +0000 (21:23 +0900)] 
Merge pull request #22098 from DaanDeMeyer/journal-corrupt-2

journal: Fixes for handling of corrupt entry objects

3 years agoMerge pull request #22096 from keszybz/networkctl-bus-once
Yu Watanabe [Fri, 14 Jan 2022 12:21:08 +0000 (21:21 +0900)] 
Merge pull request #22096 from keszybz/networkctl-bus-once

Open the bus once in networkctl

3 years agojournal: Fix entry array iteration corruption checks 22098/head
Daan De Meyer [Wed, 12 Jan 2022 18:10:54 +0000 (18:10 +0000)] 
journal: Fix entry array iteration corruption checks

Previously, we'd try to handle corruption by bumping the index even
if it was an entry array object that was corrupted (which we can't
deal with).

Now, we only try to deal with corrupted entry objects by moving the
corruption handling into generic_array_get().

On top, we also add an additional check for -EADDRNOTAVAIL which can
also be caused by corrupted journal data.

3 years agoci: switch to requirements.txt in the unit tests workflow
Evgeny Vereshchagin [Thu, 13 Jan 2022 17:36:56 +0000 (17:36 +0000)] 
ci: switch to requirements.txt in the unit tests workflow

3 years agomeson: use the compiler command array as is 22093/head
Yu Watanabe [Thu, 13 Jan 2022 06:43:24 +0000 (15:43 +0900)] 
meson: use the compiler command array as is

Also check if the flags used when building bpf are supported by clang.

3 years agomeson: check if clang supports bpf
Yu Watanabe [Thu, 13 Jan 2022 06:33:46 +0000 (15:33 +0900)] 
meson: check if clang supports bpf

3 years agomeson: require bpftool version >= 5.6
Yu Watanabe [Wed, 12 Jan 2022 13:42:18 +0000 (22:42 +0900)] 
meson: require bpftool version >= 5.6

Closes #22051.

3 years agonetworkctl: use xsprintf a bit more 22096/head
Zbigniew Jędrzejewski-Szmek [Wed, 12 Jan 2022 16:44:49 +0000 (17:44 +0100)] 
networkctl: use xsprintf a bit more

3 years agonetworkctl: open the bus just once
Zbigniew Jędrzejewski-Szmek [Tue, 11 Jan 2022 14:12:42 +0000 (15:12 +0100)] 
networkctl: open the bus just once

We'd connect to the bus twice: the first time to check networkd namespace,
and then the second time to do the deed we were asked to do. It's nicer
to open the bus just once, for efficience and also to avoid the open call
in all functions.

An ASSERT_PTR helper is added:
- sd_bus *bus = userdata;
  ...
- assert(bus);
+ sd_bus *bus = ASSERT_PTR(userdata);
  ...

It can be used in other place too, but I'm leaving that for a later
refactoring.

3 years agoman: Add more details about desktop file processing
Benjamin Berg [Thu, 13 Jan 2022 17:47:08 +0000 (18:47 +0100)] 
man: Add more details about desktop file processing

In particular, mention the contract the generator has with external
ExecCondition= binaries that may be provided by desktop environments.

But, also mention all the other relevant keys. In particular
X-systemd-skip= is important to be documented.

3 years agoci: turn meson warnings into errors
Evgeny Vereshchagin [Thu, 13 Jan 2022 12:28:09 +0000 (12:28 +0000)] 
ci: turn meson warnings into errors

3 years agoMerge pull request #22111 from medhefgo/boot-cleanup
Luca Boccassi [Thu, 13 Jan 2022 22:50:52 +0000 (22:50 +0000)] 
Merge pull request #22111 from medhefgo/boot-cleanup

boot: Cleanup

3 years agonetwork: use scope link for direct unicast routes by default
Yu Watanabe [Thu, 13 Jan 2022 12:42:28 +0000 (21:42 +0900)] 
network: use scope link for direct unicast routes by default

Strictly speaking, this breaks the backward compatibility, but I guess
in most cases people already sets Scope=link for such routes.

This behavior matches with how 'ip route' command adds such route by
default.

Prompted by https://twitter.com/jplitza/status/1480500562391179270.

3 years agoMerge pull request #22106 from yuwata/dhcp6-broken-NTP
Luca Boccassi [Thu, 13 Jan 2022 22:43:07 +0000 (22:43 +0000)] 
Merge pull request #22106 from yuwata/dhcp6-broken-NTP

sd-dhcp6-client: handle broken NTP server option gracefully

3 years agojournal: Don't discard -b arg when followed by -e
Daan De Meyer [Thu, 13 Jan 2022 13:26:25 +0000 (13:26 +0000)] 
journal: Don't discard -b arg when followed by -e

Allowing -e to be used to view the last logs of a previous boot seems
like a useful feature so let's not discard -b options anymore when
followed by -e.

Fixes #22107

3 years agoboot: Use FreePool from boot services directly 22111/head
Jan Janssen [Thu, 13 Jan 2022 12:47:39 +0000 (13:47 +0100)] 
boot: Use FreePool from boot services directly

This should hopefully allow the compiler to optimize this a bit even
when gnu-efi is not compiled with LTO.

3 years agoboot: Add missing assert to file_read()
Jan Janssen [Thu, 13 Jan 2022 12:43:29 +0000 (13:43 +0100)] 
boot: Add missing assert to file_read()

3 years agoboot: Use _cleanup_ in shim
Jan Janssen [Thu, 13 Jan 2022 12:41:57 +0000 (13:41 +0100)] 
boot: Use _cleanup_ in shim

Also, better be safe than sorry and check the return value.

3 years agoboot: Don't try to free loaded_image
Jan Janssen [Thu, 13 Jan 2022 13:29:46 +0000 (14:29 +0100)] 
boot: Don't try to free loaded_image

EFI_LOADED_IMAGE is a protocol pointer and thus, we shouldn't try
to free it.

3 years agoboot: Use EFI_FILE* instead of EFI_FILE_HANDLE
Jan Janssen [Thu, 13 Jan 2022 11:34:35 +0000 (12:34 +0100)] 
boot: Use EFI_FILE* instead of EFI_FILE_HANDLE

They are both the same, but the former is shorter and also closer
to how file handles are represented in the UEFI spec.

3 years agoboot: Fix invalid free
Jan Janssen [Thu, 13 Jan 2022 11:32:07 +0000 (12:32 +0100)] 
boot: Fix invalid free

LocateDevicePath() advances the device path pointer, making it invalid
when freed.

3 years agoboot: add missing error check
Yu Watanabe [Thu, 13 Jan 2022 06:57:57 +0000 (15:57 +0900)] 
boot: add missing error check

Follow-up for 661615a0afacee3545cde0a48286c0fef983f8fe.

Fixes CID#1468973.

3 years ago{build|unit}-test: show meson-log.txt when meson fails
Evgeny Vereshchagin [Thu, 13 Jan 2022 07:01:17 +0000 (07:01 +0000)] 
{build|unit}-test: show meson-log.txt when meson fails

to make it easier to figure out why it fails.

For example in https://github.com/systemd/systemd/runs/4799774735?check_suite_focus=true
it failed with
```

meson.build:1003:8: ERROR: Command "/usr/bin/clang -print-targets" failed with status 1.

A full log can be found at /home/runner/work/systemd/systemd/build/meson-logs/meson-log.txt
Error: Process completed with exit code 1.
```
and it wasn't clear what exactly happened there.

3 years agopo: Translated using Weblate (Portuguese)
Hugo Carvalho [Thu, 13 Jan 2022 11:16:35 +0000 (12:16 +0100)] 
po: Translated using Weblate (Portuguese)

Currently translated at 100.0% (189 of 189 strings)

Co-authored-by: Hugo Carvalho <hugokarvalho@hotmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/pt/
Translation: systemd/main

3 years agotest: add testcase for broken NTP server option 22106/head
Yu Watanabe [Thu, 13 Jan 2022 11:19:46 +0000 (20:19 +0900)] 
test: add testcase for broken NTP server option

For issue #22099.

3 years agotest: voidify test functions
Yu Watanabe [Thu, 13 Jan 2022 09:55:51 +0000 (18:55 +0900)] 
test: voidify test functions

This also drops unnecessary arguments, and unbreak several lines.