1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-25 01:34:28 +03:00
Commit Graph

71573 Commits

Author SHA1 Message Date
Lennart Poettering
71cb203a6e importctl: draw a pretty progress bar while downloading
Everybody loves pretty terminal progress bar.
2024-03-01 22:25:42 +01:00
Lennart Poettering
8ce438bb71 machinectl: chainload importctl for relevant verbs
Now that "importctl" exists, let's chainload it from machinectl for the
relevant verbs so that we only have a single implementation of the
logic.
2024-03-01 22:25:42 +01:00
Lennart Poettering
1a176d5bb7 importd: log the import callout that is going to be called 2024-03-01 22:25:42 +01:00
Lennart Poettering
b146afc449 importd: make keeping pristine copy of downloaded images optional
Previously, when downloading an image, importd would first download them
into one image which it would then consider immutable (named after the
originating URL/etag), and then immediately make a copy of it (named
after the client chosen name).

This makes some sense in VM/container cases where the images are
typically mutable, and thus the original downloaded copy is of some
value.

For sysexts/confexts/portable this doesn't make much sense though, as
they are typically immutable. Hence make the concept optional.

This adds --keep-download=yes/no as a new option that controls the
above. Moreover it disables the behaviour for all image classes but
"machine". The behaviour remains enabled for "machine", for compat.
2024-03-01 22:25:42 +01:00
Lennart Poettering
8f20b498bd importd: validate local image names with the right helper
A while back we introduced image_name_is_valid() for validating image
file names. It's more liberal than hostname_is_valid() in many ways (and
allows version suffixes and such). Since importd deals in offline images
(as opposed to machined otherwise which deals in running machines),
let's hence use the right helper to validate the identifiers.
2024-03-01 22:25:42 +01:00
Lennart Poettering
420b8ce798 importlisttransfersxclient 2024-03-01 22:25:42 +01:00
Lennart Poettering
67c7ee11af importctl: add support for selecting image class to download 2024-03-01 22:25:42 +01:00
Lennart Poettering
c3c892b41f importd: tighten checks in fds passed to us 2024-03-01 22:25:42 +01:00
Lennart Poettering
7af5785d77 importd: add support for downloading sysext/confext/portable images too
This adds "Ex" versions of all bus calls import implements, that make
two changes:

1. A "class" parameter is added that allows choosing between
   machine/sysext/confext/portable images to download. Depending on the
   chose class the target directory is selected differently (i.e. not
   just /var/lib/machines/, but alternatively /var/lib/portables/,
   /var/lib/extensions/, /var/lib/confexts/.

2. The boolean flags are replaced by a 64bit flags parameter.
2024-03-01 22:25:42 +01:00
Lennart Poettering
83d7411209 import: merge PullFlags enum into ImportFlags
The two enums are mostly the same, the former is just an extension of
the latter. Let's merge them, to simplify things. This is particularly
useful as we then can reuse this systematically as D-Bus method call
flags too, in a generic fashion that works for both imports and pulls
the same.

Pretty much just renaming of flags.
2024-03-01 22:25:42 +01:00
Lennart Poettering
8229e226fe importctl: port tabular output for format-table.h APIs 2024-03-01 22:25:42 +01:00
Lennart Poettering
663a15e7cc importctl: modernize signal handling 2024-03-01 22:25:42 +01:00
Lennart Poettering
1db33ce50b importctl: add standalone client to importd
This is pretty much a 1:1 copy of the importd specific part of
machinectl.

We turn this into a separate tool, so that we can eventually make the
tool generic to also download other DDIs, not just machine images.
2024-03-01 22:25:42 +01:00
Lennart Poettering
423bba9926 importd: modernize signal handling a bit 2024-03-01 22:25:42 +01:00
Lennart Poettering
b37ec1e7ca importd: trivial modernizations 2024-03-01 22:25:42 +01:00
Lennart Poettering
09232207b1 importd: switch to pidref 2024-03-01 22:25:42 +01:00
Lennart Poettering
8bd4d506a4 curl-util: fix downloads from file:// URLs
if we try to open file:// URLs that don't exist, we'll not get IO/timer
events about it, hence it is not sufficient to check for completion in
these events. Let's add a defer event, to deal with that.

Also, curl_multi_info_read() is a queue, make sure to handle all events
that might be queued.
2024-03-01 22:25:42 +01:00
Lennart Poettering
7253eaa0fb sd-event: make return code of sd_event_get_exit_code() optional 2024-03-01 22:25:42 +01:00
Lennart Poettering
4a5aa6842d fd-util: O_DIRECTORY is fine in fd_verify_safe_flags() too 2024-03-01 22:25:42 +01:00
Lennart Poettering
120f4a4451 test74: create ssh empty dir all at the same place
A follow up for 8fddb50fd4, which mirrors
the change also in test 74.
2024-03-01 22:24:32 +01:00
Lennart Poettering
3c1053ff27 machinectl: mention -V in --help text
Follow-up for f82dcc3fc3
2024-03-01 22:24:19 +01:00
Lennart Poettering
5f76155e65 busctl: don't hit an assert if we call invalid bus method names
We should validate this explicitly and generate a clear error string,
rather then hit an assert() later in the code.
2024-03-01 22:24:01 +01:00
Lennart Poettering
9c046d93fe vmspawn: actually pass UUID down to qemu
qemu then adds this to SMBIOS product uuid, and we can actually read it
from the payload.

Followup for b0dc766852
2024-03-01 22:23:45 +01:00
Luca Boccassi
5e39dc2f30 CI: free up diskspace before mkosi jobs
The runner has a lot of useless things installed, taking ~10GB, and
jobs have started to fail when booting images due to lack of disk
space, so delete some directories to make room.

2024-02-27T20:20:58.0998709Z ##[warning]You are running out of disk space. The runner will stop working when the machine runs out of disk space. Free space left: 0 MB

Co-authored-by: Daan De Meyer <daan.j.demeyer@gmail.com>
2024-03-01 20:04:13 +00:00
Luca Boccassi
419b25ddca ukify: add support for engine signing of PCR signatures 2024-03-01 17:32:19 +00:00
Luca Boccassi
ed896a5b85 measure: add support for --certificate and --private-key-source for engine/provider signing
Allow signing with an OpenSSL engine/provider, such as PKCS11. A public key is
not enough, a full certificate is needed for PKCS11, so a new parameter is
added for that too.
2024-03-01 17:32:19 +00:00
Luca Boccassi
a73144bbdf repart: add --private-key-source and drop --private-key-uri
It turns out it's mostly PKCS11 that supports the URI format,
and other engines just take files. For example the tpm2-tss-openssl
engine just takes a sealed private key file path as the key input,
and the engine needs to be specified separately.

Add --private-key-source=file|engine:foo|provider:bar to
manually specify how to use the private key parameter.

Follow-up for 0a8264080a
2024-03-01 17:32:19 +00:00
Adrian Vovk
793ceda177 user-record: Add preferredSession{Type,Launcher}
These will be used by display managers to pre-select the user's
preferred desktop environment and display server type. On homed, the
display manager will also be able to set these fields to cache the
user's last selection.
2024-03-01 16:28:10 +00:00
Lennart Poettering
9dbabd0a8b tree-wide: switch dlopen hooks over to DLSYM_PROTOTYPE()/DLSYM_FUNCTION()
We have these pretty macros, let's use them everywhere (so far we mostly
used them for newer additions only).

This PR is mostly an excercise in "perl -p -i -e", but there are some
special cases:

* idn-util.c exposes a function whose prototype in the official library
  headers is marked with the "const" attribute, and this apparently does
  not propagate along typeof() correctly and then
  __builtin_types_compatible_p() fails later because it detects that
  prototype and original function don't match in prototype.

* libbpf removed some symbols in newer versions, hence we need to define
  some prototypes manually to still be able to build.

* libcryptsetup marked a symbol as deprecated we want to use (knowing it
  is deprecated). By using the macros this is detected by the compiler.
  We work around it via the usual warning off macros.

Note by using these macros we assume that all symbols are known during
build time. Which might not be the case. We might need to revert this
commit for some symbols if this trips up builds on older distros.
2024-03-01 15:51:24 +00:00
Mike Yuan
f8d6694783
core/service: remove unused function param and minor cleanup 2024-03-01 21:56:43 +08:00
Xiaotian Wu
96069e57a0 uki: Support zboot efistub kernel
Generic EFI zboot added since kernel 6.1
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/firmware/efi/libstub/Makefile.zboot?h=v6.1
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/firmware/efi/libstub/zboot-header.S?h=v6.1
2024-03-01 14:51:37 +01:00
Mike Yuan
b7a22068ae
core/service: rearrange variables, use ASSERT_PTR 2024-03-01 21:49:08 +08:00
Mike Yuan
3a45fdfce0
core/service: reorder two functions 2024-03-01 21:49:08 +08:00
dependabot[bot]
5346a81024 build(deps): bump meson from 1.3.1 to 1.3.2 in /.github/workflows
Bumps [meson](https://github.com/mesonbuild/meson) from 1.3.1 to 1.3.2.
- [Release notes](https://github.com/mesonbuild/meson/releases)
- [Commits](https://github.com/mesonbuild/meson/compare/1.3.1...1.3.2)

---
updated-dependencies:
- dependency-name: meson
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-01 12:08:07 +01:00
Mike Yuan
cf76caf871
dlfcn-util: use safe_dlclose for dlclosep 2024-03-01 18:59:50 +08:00
Mike Yuan
d4d3e48601
shared/userdb: remove unneeded cast for dlsym 2024-03-01 18:59:50 +08:00
dependabot[bot]
99e59d24f3 build(deps): bump actions/upload-artifact from 4.3.0 to 4.3.1
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.0 to 4.3.1.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](26f96dfa69...5d5d22a312)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-01 11:57:31 +01:00
Luca Boccassi
0abe0cd402 test: enable PAM debug logs in TEST-46-HOMED 2024-03-01 10:07:27 +00:00
dependabot[bot]
ba959322a4 build(deps): bump github/codeql-action from 3.22.12 to 3.24.6
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.22.12 to 3.24.6.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](012739e508...8a470fddaf)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-01 11:06:02 +01:00
dependabot[bot]
04dd8258b4 build(deps): bump redhat-plumbers-in-action/differential-shellcheck
Bumps [redhat-plumbers-in-action/differential-shellcheck](https://github.com/redhat-plumbers-in-action/differential-shellcheck) from 5.0.2 to 5.1.0.
- [Release notes](https://github.com/redhat-plumbers-in-action/differential-shellcheck/releases)
- [Changelog](https://github.com/redhat-plumbers-in-action/differential-shellcheck/blob/main/docs/CHANGELOG.md)
- [Commits](91e2582e40...b9df2a9417)

---
updated-dependencies:
- dependency-name: redhat-plumbers-in-action/differential-shellcheck
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-01 10:57:00 +01:00
Yu Watanabe
d5e6df24bd
Merge pull request #31498 from ssahani/bond
netdev: bond - add support for peer_notif_delay
2024-03-01 12:45:52 +09:00
Yu Watanabe
3807936cc5
Merge pull request #31502 from yuwata/network-lldp-json
network: support to dump LLDP neighbors in JSON format
2024-03-01 12:18:53 +09:00
Yu Watanabe
6a5134e83a
Merge pull request #31555 from yuwata/sd-ndisc-trivial-cleanups
sd-ndisc: trivial cleanups
2024-03-01 12:18:19 +09:00
Yu Watanabe
ccb1ace77f sd-ndisc: drop unused sd_ndisc_router_get_raw() 2024-03-01 09:44:58 +09:00
Yu Watanabe
f169c56447 sd-ndisc: use _packed_ attribute 2024-03-01 09:44:58 +09:00
Luca Boccassi
7a2ba85aee
Merge pull request #31551 from keszybz/rpm-macro-kernel-install
New rpm macro %_kernel_install_dir
2024-03-01 00:44:52 +00:00
Yu Watanabe
bbb2a0fb41 icmp6-packet: check the alignment of struct nd_opt_hdr for safety
Addresses https://github.com/systemd/systemd/pull/31492#discussion_r1507481748.
2024-03-01 09:44:45 +09:00
Yu Watanabe
d6360819a7 test-network: add more test cases for LLDP 2024-03-01 09:40:26 +09:00
Yu Watanabe
ac23c5596e sd-lldp-rx: drop unused functions
These are not used anymore.
2024-03-01 09:40:26 +09:00
Yu Watanabe
5a0f6adbb2 network/lldp: do not save LLDP neighbors under /run/systemd
Now LLDP neighbors are exposed through varlink. Hence, it is not
necessary to save to a file.
2024-03-01 09:40:26 +09:00