Commit Graph
68766 Commits
Author SHA1 Message Date
David Tardon f20ae7dbdf udev-util: add wrapper for sd_device_get_property_value()
... that allows to pass additional properties to fall back to.
2023-11-13 19:18:23 +01:00
Yu Watanabe aa78d138ed Merge pull request #30005 from poettering/storagetm-plymout
storagetm: plymouth hookup
2023-11-14 02:39:17 +09:00
Yu Watanabe 4cec9b1b17 Merge pull request #30015 from poettering/tpm2-slow-tests
tests: skip slow tpm2 tests if slow tests aren't enabled
2023-11-14 02:38:33 +09:00
Yu Watanabe 4e2df3082d Merge pull request #30010 from poettering/mount-tool-tweakles
mount-tool: trivial tweaklets
2023-11-14 02:38:09 +09:00
Yu Watanabe 175ff7bf0d Merge pull request #30003 from poettering/vendor-model-unify
udev-util: add generic device_get_{vendor,model}_string() helpers
2023-11-14 02:36:08 +09:00
Lennart Poettering 0408d802db id128: add id128_digest() helper
This helper hashes some arbitrary data and turns it into a v4 UUID.
2023-11-13 17:39:53 +01:00
Zbigniew Jędrzejewski-Szmek f99304fe23 ukify: show .sbom sections as binary
Fixup for e87dec82be:
I misunderstood the format. It's actually CBOR, i.e. some binary format.
When trying to show show text we would first check if it's valid UTF-8,
so we would handle this gracefully, i.e. emit a warning and not print
the contents.
2023-11-13 16:33:07 +00:00
Lennart Poettering cc8c679281 test-tpm2: raise timeout, as RSA is slow 2023-11-13 16:53:56 +01:00
Lennart Poettering 3aea672bff test-tpm2: skip RSA generating TPM2 tests on physical hw
The TPM2 tests that genreate an RSA primary key are fast on vtpms, but
very slow on physical TPMs, simply because TPMs aren't precisely fast
devices. It makes sense to keep the tests around however. Hence hide the
test behind the "slow test" logic by default – but only if we run on
physical hw, and keep them in place on VMs (where we'd expect a vtpm, if
any).
2023-11-13 16:51:57 +01:00
Lennart Poettering 47a7a4d404 tests: add macro for generating function enter log message
The test-tpm2 test multiplexes a bunch of tests from a single
entrypoint test that creates the TPM2 connection. This means we only get
the nice log output which test we are looking for once for the
entrypoint.

Let's add a macro that allows it to nicely generate it for the inner
tests too and use it.
2023-11-13 16:50:55 +01:00
Lennart Poettering 3cc7a9fd25 udev-util: add generic device_get_{vendor,model}_string() helpers
We chck the same props in various places, add a single implementation of
a call to inquire this.
2023-11-13 16:24:17 +01:00
Lennart Poettering 7e91c97aff ci: work around mold/clang incompat
See discussion:

https://github.com/systemd/systemd/pull/30003#issuecomment-1808349258
2023-11-13 16:24:17 +01:00
Lennart Poettering b86155d071 mount-tool: make internal and external column name match 2023-11-13 16:13:07 +01:00
Lennart Poettering 4096143827 mount-tool: rely on format-table.c's ersatz logic
Let the table logic handle the special casing ov unavailable data,
rather than doing that ourselves.
2023-11-13 16:13:07 +01:00
Lennart Poettering 4cbf9d52f3 mount-tool: reduce scope of enum 2023-11-13 16:13:07 +01:00
Lennart Poettering 4134f47de2 units: pull in plymouth when booting into storagetm mode 2023-11-13 15:45:16 +01:00
Lennart Poettering 95d548026f storagetm: show connection data also via plymouth
Pretty!
2023-11-13 15:45:16 +01:00
Lennart Poettering aa25e19b47 util-lib: share plymouth client code
Let's add a new "plymouth-util.c" module with helpers for talking to
plymouth. We so far had three places for this, let's unify the code
doing this a bit.
2023-11-13 14:17:05 +00:00
Lennart Poettering 1a292659f2 Merge pull request #29995 from keszybz/voidify-timestamp-getters
Rename and voidify timestamp getters
2023-11-13 14:41:42 +01:00
Zbigniew Jędrzejewski-Szmek 2233035275 meson: fix printing of first-boot-full-preset
The meson summary logic checks for ENABLE_* and HAVE_*, but we used a define
with no prefix. Let's make it ENABLE_… for consistency with other config
options. Obviously this also fixes the summary output.
2023-11-13 13:27:31 +00:00
Luca Boccassi 95d0afbfa9 Merge pull request #29996 from keszybz/ukify-summary-and-sbom-sections
Ukify synopsis and SBOM sections
2023-11-13 13:26:38 +00:00
Yu Watanabe 58cde42f65 core: rename MemoryZswapCurrent -> MemoryZSwapCurrent
Follow-up for 26caa66867.
2023-11-13 13:54:56 +01:00
Zbigniew Jędrzejewski-Szmek cee60fc36f tree-wide: use the usual spelling of "cannot"
(There's a bunch more in src/basic/linux/, but those files are copied from the
kernel and should not be modified.)
2023-11-13 13:27:36 +01:00
Zbigniew Jędrzejewski-Szmek ffcf54d4fb core/unit: use assert for checking internal call sanity
The only way this could be called with an invalid value would be if
somebody forgot to initialize unit type. In such cases, it's better to
fail hard immediately.
2023-11-13 13:27:36 +01:00
Zbigniew Jędrzejewski-Szmek fa5a025167 Rename {dual,triple}_timestamp_get to {dual,triple}_timestamp_now
Those functions take a pointer to a timestamp and return a timestamp pointer,
so the reader would be justified to think that those are just getters. Rename
them to avoid confusion.
2023-11-13 13:27:07 +01:00
Mike Yuan 8ea288db01 conf-parser: remove unused condition
Follow-up for 9ac2f3c4d2

config_parse() returns 0 only on ENOENT, which can
never happen since we pass the FILE stream.
2023-11-13 10:32:38 +00:00
Zbigniew Jędrzejewski-Szmek e87dec82be ukify: show .sbom sections as text
There are draft proposals to embed SBOM metadata in the .sbom section of PE
binaries [1], in the coSWID XML format. Some details of how this is actually
implemented might change, but it seems very likely that both section name and
it being text will stay. Let's show the section as text to make such binaries
easier to inspect. ([1] recommends using 'objcopy -j .sbom' which isn't
particularly readable.)  Once there's more standarization of the actual
format, we can add pretty-printing and/or syntax highlighting.

[1] https://uefi.org/blog/firmware-sbom-proposal
[2] https://www.ietf.org/archive/id/draft-ietf-sacm-coswid-21.html
2023-11-13 10:59:30 +01:00
Zbigniew Jędrzejewski-Szmek 51faf83696 ukify: print a more readable synopsis in --help
The details of formatting are copied from mkosi. This results in the following:

   usage:
     ukify build [--linux=LINUX] [--initrd=INITRD] [options…]
     ukify genkey [options…]
     ukify inspect FILE… [options…]

  Build and sign Unified Kernel Images

  options:
    --version             show program's version number and exit
    ...

I put "[options…]" at the end, because that's what one would generally do
with long options like "--cmdline" and others.
2023-11-13 10:59:30 +01:00
Mike Yuan 6f510ec8d6 Merge pull request #29990 from Flowdalic/memory-zswap-current
cgroup: add support for memory.zswap.current
2023-11-13 16:40:18 +08:00
Florian Schmaus 7bf87a6477 systemctl-show: merge subsequent swap printf() blocks 2023-11-12 21:12:02 +01:00
Mike Yuan 9ac2f3c4d2 conf-parser: pin seen config files
Follow-up for 93f1da4556

Addresses https://github.com/systemd/systemd/commit/93f1da45566d064f4f053b37bbac2813631f58b1#r132152321
2023-11-13 05:11:26 +09:00
Florian Schmaus 26caa66867 cgroup: add support for memory.zswap.current 2023-11-12 21:10:40 +01:00
Yu Watanabe 49a6f7c849 Merge pull request #29976 from YHNdnzj/session-by-leader-pidref
logind: switch sessions_by_leader to PidRef
2023-11-13 05:09:47 +09:00
Yu Watanabe 7fd93e5acc Merge pull request #29968 from bluca/executor_selinux_lazy_load
executor: lazily load SELinux
2023-11-13 05:06:44 +09:00
Luca Boccassi 049ef475d5 Merge pull request #29989 from yuwata/conf-parser-arg-type
conf-parser: fix argument type
2023-11-12 17:30:44 +00:00
Yu Watanabe 5996cc348c conf-parser: fix argument type of ConfigPerfItemLookup
Prompted by #29972.
2023-11-13 00:46:39 +09:00
Yu Watanabe 62c9beaa2c conf-parser: inline variable declaration 2023-11-13 00:46:34 +09:00
Jeremy Fleischman 121cb88292 Fix some typos in RESOLVED-VPNS.md 2023-11-12 12:55:29 +00:00
Mike Yuan 214bed77e8 Merge pull request #29941 from Flowdalic/cgroup-memory-swap-peak
cgroup: add support for memory.swap.peak and memory.swap.current
2023-11-12 16:21:44 +08:00
Luca Boccassi 22f62b8917 test: sort files in generate-sym-test.py
The test binaries are different depending on the filesystem, due to os.walk().
Sort the input before iterating on it to make it stable.
2023-11-12 12:54:23 +09:00
Mike Yuan 8494f562c8 logind: switch sessions_by_leader to PidRef 2023-11-11 22:31:00 +08:00
Luca Boccassi 0b511787fd selinux: change fd check into assertion 2023-11-11 12:33:19 +00:00
Luca Boccassi 894288340f executor: lazily load SELinux
Loading the SELinux DB on every invocation can be slow and
takes 2ms-10ms, so do not initialize it unconditionally, but
wait for the first use. On a mkosi Fedora rawhide image, this
cuts the number of loads in half.
2023-11-11 12:33:19 +00:00
Luca Boccassi 0617da2edb selinux: support lazy initialization
Loading the SELinux DB is slow, so support lazy initialization so
that it is done when needed.
2023-11-11 12:33:19 +00:00
Luca Boccassi 2c6a231b47 selinux: avoid probing memory status if debug logs are not enabled
Given we are optimizing the selinux paths, avoid doing these operations
unless the result is actually used
2023-11-11 12:29:52 +00:00
Florian Schmaus 37533c9432 cgroup: add support for memory.swap.current
In systemctl-show we only show current swap if ever swapped or non-zero. This
reduces the noise on swapless systems, that would otherwise always show a swap
value that never has the chance to become non-zero. It further reduces the
noise for services that never swapped.
2023-11-11 12:16:29 +01:00
Florian Schmaus 991506ae5d cgroup: de-duplicate uni_get_memory_* code 2023-11-11 12:14:07 +01:00
Florian Schmaus aac3384e56 cgroup: add support for memory.swap.peak 2023-11-11 12:14:07 +01:00
Mike Yuan 1c2beeb04f core/unit: remove unneeded comparison for hashmap_remove_value
hashmap_remove_value returns NULL if the value in the hashmap doesn't
match with the one provided by the caller.
2023-11-11 17:21:10 +08:00
Mike Yuan 4c8d5f0217 pidref: introduce hash ops that doesn't come with destructor 2023-11-11 17:21:10 +08:00