1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-30 06:25:37 +03:00
Commit Graph

56235 Commits

Author SHA1 Message Date
Yu Watanabe
b4d55e8364 wifi-util: introduce nl80211_iftype_from_string() 2022-02-15 16:06:43 +09:00
Yu Watanabe
edb69db2b0 network: manage WLAN phy 2022-02-15 16:06:43 +09:00
Yu Watanabe
1d4312d5f9 network: netdev: add flag to skip kind check
It will be used in later commit.
2022-02-15 16:06:43 +09:00
Yu Watanabe
5d4a925af0 network: netdev: use request queue to create independent netdevs 2022-02-15 16:06:37 +09:00
Yu Watanabe
efa7b8adde network: netdev: increment reference counter on request
Otherwise, it may be freed on reload.
2022-02-15 15:54:02 +09:00
Yu Watanabe
d708bc6e4f network: netdev: make netdev_is_ready_to_create() return negative errno on fatal error 2022-02-15 15:54:02 +09:00
Yu Watanabe
709055dabb network: rename REQUEST_TYPE_STACKED_NETDEV -> REQUEST_TYPE_NETDEV_STACKED 2022-02-15 15:54:02 +09:00
Yu Watanabe
6dc07e095d meson: sort listed files 2022-02-15 15:54:02 +09:00
Frantisek Sumsal
b6fc52408a test: set ReadWritePaths=$BUILD_DIR when running w/ coverage
otherwise units using `DynamicUser=yes` won't be able to write the
coverage stats (currently affecting TEST-20-MAINPIDGAMES).

`DynamicUser=yes` implies `ProtectSystem=strict` and
`ProtectHome=read-only` and can't be overridden hence we need to
utilize `ReadWritePaths=` to work around that.
2022-02-14 21:59:33 +00:00
Yu Watanabe
f3376ee8fa
Merge pull request #22487 from poettering/bootspec-source-flags
bootctl: show all discovered entries, but show state + type in details
2022-02-15 04:45:59 +09:00
Yu Watanabe
88586e5d32
Merge pull request #22508 from poettering/stat-ino-compare
stat-util: add new stat_inode_same() helper
2022-02-15 04:45:31 +09:00
Yu Watanabe
d1e7fa02ca
Merge pull request #22507 from poettering/id128-compare-tweaks
sd-id128: comparison tweaks
2022-02-15 04:40:53 +09:00
Lennart Poettering
1d7150ec7f docs: make clear that if you use threaded cgroups you need to do that two levels down from your delegated cgroup
Prompted by: #22486
2022-02-14 19:06:40 +00:00
Lennart Poettering
d6b218e742 sd-daemon: use path_join() instead of manual path concat 2022-02-14 17:27:24 +01:00
Lennart Poettering
c20c77eff8 coredump: fix inode check
When checking if we look at the root directory we actually need to
compare both st_dev *and* st_ino. The existing check only checked the
latter. Fix that.
2022-02-14 17:27:21 +01:00
Lennart Poettering
675e7fc22c fd-util: use ERRNO_IS_XYZ() macros where appropriate 2022-02-14 17:27:18 +01:00
Lennart Poettering
a9dac7a6dd tree-wide: port various places over to new stat_inode_same() helper 2022-02-14 17:27:14 +01:00
Lennart Poettering
38db6211b5 stat-util: add helper stat_inode_same() for comparing stat's st_dev/st_ino in one
We do this all over the place, hence let's add a simple helper that does
this and particularly carefully and thoroughly.
2022-02-14 17:27:09 +01:00
Luca Boccassi
d74da762a3
Merge pull request #22506 from poettering/devnum-zero-btrfs-block-dev
gpt-auto: some (primarily cosmetic) fixes to backing block device detection in gpt-auto-generator/sd-device
2022-02-14 16:17:04 +00:00
Luca Boccassi
bfba9946a1
Merge pull request #22445 from lnussel/logind
logind: post review fixes
2022-02-14 16:16:39 +00:00
Lennart Poettering
d5ac1d4e10 bootspec: avoid zero size VLA
apparently some checkers don't like that. Let's be entirely safe here,
and use malloc() based allocation, given that the entries are user
controlled.
2022-02-14 16:24:04 +01:00
Lennart Poettering
f63b5ad935 boot: suppress XBOOTLDR if same device as ESP when enumerating entries
On my local system I linked up the ESP and XBOOTLDR partitions, and
ended up with duplicate entries being listed. Try hard to detect that
and only enumerate entries in the ESP if it turns out that both dirs
have the same dev_t.

This should detect both bind mounted and symlinked cases and should make
our list output less confusing.
2022-02-14 16:24:04 +01:00
Lennart Poettering
5635040091 bootspec: make sure all return values are initialized on return of find_esp_and_warn()
THis makes sure that find_esp_and_warn() + find_xbootldr_and_warn()
follow our usual coding style that on success all return values are
initialized. We got that right in most successful codepaths out of these
functions, but missed the one where the paths are manually overwritten
via env vars.
2022-02-14 15:44:07 +01:00
Lennart Poettering
bb68205768 bootctl: show more information about boot entry state in list
Let's improve display of boot entries and show what type they have (i.e.
boot loader spec type 1, or type 2, or auto-discovered or reported by
boot loader), and in particular mark entries the boot loader discovered
but we can't find (i.e. that likely vanished, or possibly couldn't be
found due to a misconfiguration) and that the boot loader didn't find
but we see (which are new, or possibly also the result of
misconfiguraiton).

This is supposed to be a replacement for #22161, but instead of hiding
vanished entries, highlights them, which I think is more appropriate for
a low-level tool such bootctl.

Replaces: #22161 #22398
2022-02-14 15:44:07 +01:00
Lennart Poettering
a78e472dfd bootspec: also collect/mark the "selected" boot entry (i.e. the one currently booted)
it's helpful and easy, so let's do it
2022-02-14 15:44:07 +01:00
Lennart Poettering
d403d8f0d6 bootspec: also parse new 'beep' loader.conf variable 2022-02-14 15:44:07 +01:00
Lennart Poettering
fdc5c04299 bootspec: parse/show devicetree-overlay field too
It has been defined in the boot loader spec, and is the only field we
currently don't parse, hence fix that.
2022-02-14 15:44:07 +01:00
Lennart Poettering
4cddc18d0a update TODO 2022-02-14 15:44:07 +01:00
Lennart Poettering
736783d420 bootspec: port one more use of basename() to path_extract_filename() 2022-02-14 15:44:07 +01:00
Lennart Poettering
9951736b7f Revert "bootctl: Ignore boot entries (continue #22041)" 2022-02-14 15:44:07 +01:00
Lennart Poettering
93e0d3204c veritysetup: whitespace fix 2022-02-14 15:14:17 +01:00
Lennart Poettering
fe9bd5ad36 homed: use SD_ID128_TO_UUID_STRING() at one more place 2022-02-14 15:14:14 +01:00
Lennart Poettering
e46433bb92 tree-wide: use id128_equal_string() at various places 2022-02-14 15:14:11 +01:00
Lennart Poettering
75a505c600 id128-util: add new helper id128_equal_string()
Quite often we compare uuids/id128 formatted as strings with specific
values. So far we usually used streq() for that. let's add a new
explicit helper for this in id128_equal_string() that compares a string
with an sd_id128_t and is more robust than a simple string comparison.
Moreover, we can mroe easily reuse the various defines we have for
specific UUIDs, for example those from gpt.h.
2022-02-14 15:14:03 +01:00
Lennart Poettering
b74163607b sd128: export sd_id128_to_uuid_string()
We expose various other forms of UUID helpers already, i.e.
SD_ID128_UUID_FORMAT_STR and SD_ID128_MAKE_UUID_STR(), and we parse
UUIDs, hence add a high-level helper for formatting UUIDs too.

This doesn't add any new code, it just moves some helpers
id128-util.[ch] → sd-id128.[ch], to make them public.
2022-02-14 15:13:23 +01:00
Frantisek Sumsal
fdf9de694f
Merge pull request #22505 from mrc0mmand/more-coverage-tweaks
A couple of coverage-related tweaks
2022-02-14 13:51:08 +00:00
Yu Watanabe
42672c80dc test: check if running in container earlier 2022-02-14 13:46:17 +00:00
Luca Boccassi
d0ebe2a835
Merge pull request #22496 from yuwata/network-cleanups-keep-configuration
network: cleanups for KeepConfiguration= setting
2022-02-14 13:17:23 +00:00
Lennart Poettering
d5cb053cd9 gpt-auto: properly handle case where we can't determine devno of /usr/ fs
get_block_device_harder() returns == 0 if the fs is valid, but it is not
backed by a single devno. (As opposed to returning > 0 if the devno is
valid). Let's catch this case and log a clear message, and don't bother
open the device in that case.

This is mostly cosmetical, as either way, systemd-gpt-auto-generator
doesn't work in scenarios like that.

Prompted-by: #22504
2022-02-14 13:40:59 +01:00
Lennart Poettering
f1ad2c9238 sd-device: refuse opening device mit major/minor of zero early
device nodes with 0 dev_t are not real (and for that reason such inodes
are used as whiteouts in overlayfs, for example), hence refuse them
early. It seems wrong going to sysfs for something we know can't exist
anyway.
2022-02-14 13:40:56 +01:00
Frantisek Sumsal
d282e57e2a test: check for (possibly) missing test coverage
If the test logs contain lines like:

```
...systemd-resolved[735885]: profiling:/systemd-meson-build/src/shared/libsystemd-shared-250.a.p/base-filesystem.c.gcda:Cannot open
```

it means we're possibly missing some coverage since gcov can't write the stats,
usually due to the sandbox being too restrictive (e.g. ProtectSystem=yes,
ProtectHome=yes) or the $BUILD_DIR being inaccessible to non-root users.
2022-02-14 12:20:02 +01:00
Frantisek Sumsal
e4c822e9ac test: set ACLs for the build dir when built with coverage
Otherwise unprivileged processes (like systemd-resolved) can't write
coverage data.
2022-02-14 11:58:54 +01:00
Matija Skala
1b46eb23bc do not call __register_atfork directly
this way it is cleaner and more portable and systemd links against libpthread anyway
2022-02-14 10:49:43 +01:00
Ludwig Nussel
2a3a5288cb systemctl: fix halt -f
Commit adefc8789b always asks logind for shutdown first. So I broke halt
-f which is supposed to issue a direct syscall in that case.
2022-02-14 09:35:12 +01:00
Ludwig Nussel
54141d8ddd logind: more verbose struct initialization 2022-02-14 09:35:12 +01:00
Ludwig Nussel
1831759a70 logind: increase max wall message length to 4096 2022-02-14 09:35:12 +01:00
Ludwig Nussel
d2fc0ecf9a logind: style fixes 2022-02-14 09:35:12 +01:00
Ludwig Nussel
138224fc80 logind: add handle enum to struct
Avoid pointer arithmetic at the expense of repeating the enum value
in the struct.
2022-02-14 09:35:12 +01:00
Evgeny Vereshchagin
74b781de25
Merge pull request #22499 from mrc0mmand/ci-tweaks
A couple of Packit/Super-Linter tweaks
2022-02-13 19:13:05 +03:00
Frantisek Sumsal
ebcccfd950 ci: re-enable s390x Packit builds
The s390x Copr builders are finally[0] 'native' instead of QEMU-emulated,
which makes them pretty quick to be used in PRs.

[0] https://lists.fedoraproject.org/archives/list/copr-devel@lists.fedorahosted.org/message/AR3ZDKET3EXZHV3MSU3UHMO7EIKBGAN2/
2022-02-13 15:06:24 +01:00