]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 months agosleep: Always freeze user.slice
Adrian Vovk [Sat, 23 Dec 2023 22:03:42 +0000 (17:03 -0500)] 
sleep: Always freeze user.slice

Previously, we'd only freeze user.slice in the case of s2h, because we
didn't want the user session to resume while systemd was transitioning
from suspend to hibernate.

This commit extends this freezing behavior to all sleep modes.

We also have an environment variable to disable the freezing behavior
outright. This is a necessary workaround for someone that has hooks
in /usr/lib/systemd/system-sleep/ which communicate with some
process running under user.slice, or if someone is using the proprietary
NVIDIA driver which breaks when user.slice is frozen (issue #27559)

Fixes #27559

2 months agobus-unit-util: Add utility to freeze/thaw units
Adrian Vovk [Sat, 23 Dec 2023 21:57:47 +0000 (16:57 -0500)] 
bus-unit-util: Add utility to freeze/thaw units

This utility lets us freeze units, and then automatically thaw them
when via a _cleanup_ handler. For example, you can now write something
like:

```
_cleanup_(unit_freezer_thaw) UnitFreezer freezer = UNIT_FREEZER_NULL;
r = unit_freezer_freeze("myunit.service", &freezer);
if (r < 0)
    return r;
// Freeze is thawed once this scope ends
```

Aside from the basic _freeze and _thaw methods, there's also
_cancel and _restore. Cancel destroys the UnitFreezer without
thawing the unit. Restore creates a UnitFreezer without freezing it.
The idea of these two methods is that it allows the freeze/thaw to
be separated from each other (i.e. done in response to two separate
DBus method calls). For example:

```
_cleanup_(unit_freezer_thaw) UnitFreezer freezer = UNIT_FREEZER_NULL;
r = unit_freezer_freeze("myunit.service", &freezer);
if (r < 0)
    return r;
// Freeze is thawed once this scope ends

r = do_something()
if (r < 0)
    return r; // Freeze is thawed

unit_freezer_cancel(&freezer); // Thaw is canceled.
```

Then in another scope:
```
// Bring back a UnitFreezer object for the already-frozen service
_cleanup_(unit_freezer_thaw) UnitFreezer freezer = UNIT_FREEZER_NULL;
r = unit_freezer_restore("myunit.service", &freezer);
if (r < 0)
    return r;
// Freeze is thawed once this scope ends
```

2 months agoMerge pull request #31631 from mrc0mmand/mkosi-addons
Luca Boccassi [Tue, 5 Mar 2024 14:16:49 +0000 (14:16 +0000)] 
Merge pull request #31631 from mrc0mmand/mkosi-addons

mkosi: fix UKI addons test

2 months agoextract-word: update remaining calls to `extract_many_words`
Antonio Alvarez Feijoo [Tue, 5 Mar 2024 07:50:07 +0000 (08:50 +0100)] 
extract-word: update remaining calls to `extract_many_words`

Follow-up to 4f49512695f8214c55c206b3c2f583dc7b309e1b

2 months agosd-netlink: allow to call rtnl_get_link_info() without iftype and flags
Yu Watanabe [Tue, 5 Mar 2024 07:22:09 +0000 (16:22 +0900)] 
sd-netlink: allow to call rtnl_get_link_info() without iftype and flags

2 months agomkosi: make shellcheck happy 31631/head
Frantisek Sumsal [Tue, 5 Mar 2024 11:41:30 +0000 (12:41 +0100)] 
mkosi: make shellcheck happy

2 months agoRevert "mkosi: Don't fail on systemd-vconsole-setup.service failure for now"
Frantisek Sumsal [Tue, 5 Mar 2024 11:18:40 +0000 (12:18 +0100)] 
Revert "mkosi: Don't fail on systemd-vconsole-setup.service failure for now"

This doesn't seem to fail anymore.

This reverts commit 84c7929cd461f6f1cc2c44c69877b9fd0676c794.

2 months agoRevert "mkosi: Disable cmdline addon test for now"
Frantisek Sumsal [Tue, 5 Mar 2024 10:51:52 +0000 (11:51 +0100)] 
Revert "mkosi: Disable cmdline addon test for now"

Let's see if this finally works.

This reverts commit e167a8283d5964ca0f903b3e362ab7e48a1ed2ab.

2 months agomkosi: fix UKI addons test
Frantisek Sumsal [Tue, 5 Mar 2024 10:49:30 +0000 (11:49 +0100)] 
mkosi: fix UKI addons test

The test hasn't been working for a while, since there's no /efi or /boot
in $DESTDIR.

Resolves: #31618

2 months agotest: check for kernel.apparmor_restrict_unprivileged_userns
Nick Rosbrook [Mon, 4 Mar 2024 20:43:57 +0000 (15:43 -0500)] 
test: check for kernel.apparmor_restrict_unprivileged_userns

Some tests in test-execute are already skipped if we do not have
unprivileged user namespaces. Extend this check to look for an apparmor
specific sysctl indicating that unprivileged userns creation is
restricted.

2 months agoFixing bad link to Debian packages tests
Max Gautier [Tue, 5 Mar 2024 09:58:29 +0000 (10:58 +0100)] 
Fixing bad link to Debian packages tests

2 months agoMerge pull request #31597 from keszybz/option-P-for-machinectl-and-timedatectl
Zbigniew Jędrzejewski-Szmek [Tue, 5 Mar 2024 06:11:40 +0000 (10:11 +0400)] 
Merge pull request #31597 from keszybz/option-P-for-machinectl-and-timedatectl

Option -P for machinectl and timedatectl

2 months agofuzz: dump LLDP neighbors JSON too
Evgeny Vereshchagin [Sun, 3 Mar 2024 21:04:39 +0000 (21:04 +0000)] 
fuzz: dump LLDP neighbors JSON too

to make sure all the fields are in more or less good shape.

It's a follow-up to https://github.com/systemd/systemd/pull/31583

2 months agoMerge pull request #31582 from bluca/fix_hostnamed_ci
Luca Boccassi [Mon, 4 Mar 2024 20:37:52 +0000 (20:37 +0000)] 
Merge pull request #31582 from bluca/fix_hostnamed_ci

test: fix test-loopback and test-resolved-stream on Ubuntu 24.04

2 months agostat-util: generalize is_* and verify_* handling
Mike Yuan [Sat, 2 Mar 2024 09:41:29 +0000 (17:41 +0800)] 
stat-util: generalize is_* and verify_* handling

2 months agoresolved,pcrlock: make a bunch of varlink introspection structures static
Lennart Poettering [Mon, 4 Mar 2024 09:11:53 +0000 (10:11 +0100)] 
resolved,pcrlock: make a bunch of varlink introspection structures static

Not sure why gcc doesn't warn that these have no "extern" definition,
but also aren't static...

2 months agoresolved: mention the Varlink interface of resolved
Lennart Poettering [Mon, 4 Mar 2024 10:34:09 +0000 (11:34 +0100)] 
resolved: mention the Varlink interface of resolved

This is ready from prime-time, hence mention it.

2 months agoresolvectl: output nice error message if we can't JSONify RR
Lennart Poettering [Mon, 4 Mar 2024 09:00:05 +0000 (10:00 +0100)] 
resolvectl: output nice error message if we can't JSONify RR

Some RR types we don't have a mapping to JSON for. Handle this
reasonably.

2 months agovarlink: allow strings for integer varlink IDL fields
Lennart Poettering [Mon, 4 Mar 2024 10:23:38 +0000 (11:23 +0100)] 
varlink: allow strings for integer varlink IDL fields

This is a follow-up for 67a3028555c58cea152cd8b8e863a643eb147a97: also
allow strings as integer during IDL validation of JSON records.

2 months agoMerge pull request #31619 from weblate/weblate-systemd-main
Frantisek Sumsal [Mon, 4 Mar 2024 19:29:34 +0000 (20:29 +0100)] 
Merge pull request #31619 from weblate/weblate-systemd-main

Translations update from Fedora Weblate

2 months agoman/systemd-debug-generator: be consistent on '=' for boolean options
Mike Yuan [Mon, 4 Mar 2024 18:19:58 +0000 (02:19 +0800)] 
man/systemd-debug-generator: be consistent on '=' for boolean options

2 months agopo: Translated using Weblate (Turkish) 31619/head
Oğuz Ersen [Mon, 4 Mar 2024 16:32:52 +0000 (17:32 +0100)] 
po: Translated using Weblate (Turkish)

Currently translated at 100.0% (233 of 233 strings)

Co-authored-by: Oğuz Ersen <oguz@ersen.moe>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/tr/
Translation: systemd/main

2 months agopo: Translated using Weblate (Polish)
Piotr Drąg [Mon, 4 Mar 2024 16:32:52 +0000 (17:32 +0100)] 
po: Translated using Weblate (Polish)

Currently translated at 100.0% (233 of 233 strings)

Co-authored-by: Piotr Drąg <piotrdrag@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/pl/
Translation: systemd/main

2 months agopo: Translated using Weblate (Korean)
김인수 [Mon, 4 Mar 2024 16:32:52 +0000 (17:32 +0100)] 
po: Translated using Weblate (Korean)

Currently translated at 100.0% (233 of 233 strings)

Co-authored-by: 김인수 <simmon@nplob.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/ko/
Translation: systemd/main

2 months agoupdate TODO
Lennart Poettering [Mon, 4 Mar 2024 16:30:15 +0000 (17:30 +0100)] 
update TODO

2 months agotest: fix test-resolved-stream unit test failure 31582/head
Luca Boccassi [Sun, 3 Mar 2024 18:14:31 +0000 (18:14 +0000)] 
test: fix test-resolved-stream unit test failure

On Noble setting this ioctl fails:

1570s  819/1330 systemd:resolve / test-resolved-stream  FAIL 0.14s   killed by signal 6 SIGABRT
1570s Successfully forked off '(usernstest)' as PID 27737.
1570s Skipping PR_SET_MM, as we don't have privileges.
1570s (usernstest) succeeded.
1570s Assertion 'ioctl(socket_fd, SIOCSIFFLAGS, &req) >= 0' failed at src/resolve/test-resolved-stream.c:372, function try_isolate_network(). Aborting.

Ignore the result.

2 months agotest: fix test-loopback failure when lacking privileges
Luca Boccassi [Sun, 3 Mar 2024 18:15:26 +0000 (18:15 +0000)] 
test: fix test-loopback failure when lacking privileges

Setting up the loopback might fail due to lack of privileges, as it
happens when running unit tests in the Noble CI environment. Skip
the test when it happens.

1584s  862/1330 systemd:test / test-loopback   FAIL  0.01s   exit status 1
1584s /* test_loopback_setup */
1584s Failed to configure loopback network device, ignoring: Operation not permitted
1584s loopback: Operation not permitted

2 months agoMerge pull request #31600 from YHNdnzj/fd-poll
Mike Yuan [Mon, 4 Mar 2024 14:28:00 +0000 (22:28 +0800)] 
Merge pull request #31600 from YHNdnzj/fd-poll

core/service: several trivial cleanups for fdstore

2 months agoMerge pull request #31615 from poettering/hostname-method-missing
Luca Boccassi [Mon, 4 Mar 2024 14:09:40 +0000 (14:09 +0000)] 
Merge pull request #31615 from poettering/hostname-method-missing

hostnamectl: deal gracefully when talking to old hostnamed

2 months agomachinectl: add -P 31597/head
Zbigniew Jędrzejewski-Szmek [Sat, 2 Mar 2024 11:25:22 +0000 (12:25 +0100)] 
machinectl: add -P

2 months agotimedatectl: add -P
Zbigniew Jędrzejewski-Szmek [Sat, 2 Mar 2024 11:17:54 +0000 (12:17 +0100)] 
timedatectl: add -P

2 months agohostnamectl: gracefully handle old hostnamed replies to GetHardwareSerial() 31615/head
Lennart Poettering [Mon, 4 Mar 2024 12:04:20 +0000 (13:04 +0100)] 
hostnamectl: gracefully handle old hostnamed replies to GetHardwareSerial()

Old versions of hostnamed used to propagate ENODEV/ENOENT as-is. Bad
idea. This was fixed in 171ddae1a122e9c97b4ef12ccb2d29e1ba7a318a, but
let's handle this gracefully in hostnamectl.

2 months agohostnamectl: properly initialize the two timestamp fields before doing bus call
Lennart Poettering [Mon, 4 Mar 2024 12:02:57 +0000 (13:02 +0100)] 
hostnamectl: properly initialize the two timestamp fields before doing bus call

Otherwise if talking to an old hostnamed (which doesn't have these
fields) we'd assume the timestamp is valid even though it isn't and show
garbage.

2 months agopo: Update translation files
Weblate [Mon, 4 Mar 2024 11:27:23 +0000 (12:27 +0100)] 
po: Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Co-authored-by: Weblate <noreply@weblate.org>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/
Translation: systemd/main

2 months agoMerge pull request #31607 from mrc0mmand/update-translation-strings
Luca Boccassi [Mon, 4 Mar 2024 11:35:53 +0000 (11:35 +0000)] 
Merge pull request #31607 from mrc0mmand/update-translation-strings

po: update translation strings

2 months agodocs: update translation-related instructions 31607/head
Frantisek Sumsal [Mon, 4 Mar 2024 09:11:34 +0000 (10:11 +0100)] 
docs: update translation-related instructions

Just making them consistent with the rest of the doc.

2 months agopo: update translation strings
Frantisek Sumsal [Mon, 4 Mar 2024 09:07:54 +0000 (10:07 +0100)] 
po: update translation strings

Resolves: #31603

2 months agotest: explicitly set TERM=linux for TEST-69-SHUTDOWN
Frantisek Sumsal [Sun, 3 Mar 2024 16:15:23 +0000 (17:15 +0100)] 
test: explicitly set TERM=linux for TEST-69-SHUTDOWN

sulogin from the latest util-linux started falling back to vt102 instead
of linux, which makes screen sad (because we install only the linux
terminfo into the test image) and expect trips over the unexpected
warning. Let's just explicitly set TERM=linux before invoking screen to
avoid this.

+ make -C TEST-69-SHUTDOWN setup run
...
INFO:test-shutdown:log in and start screen
root
root
Last login: Sun Mar  3 13:19:31 from 18.191.105.60
-bash-5.2# screen
screen
Cannot find terminfo entry for 'vt102'.
-bash-5.2# ERROR:test-shutdown:Timeout exceeded.

2 months agokernel-install: Add kernel version to title (#31581)
Guilhem Lettron [Sun, 3 Mar 2024 12:36:57 +0000 (13:36 +0100)] 
kernel-install: Add kernel version to title (#31581)

When using uki, kernel installations always have the same name in
systemd-boot menu.

Signed-off-by: Guilhem Lettron <guilhem@barpilot.io>
2 months agoman/sd_notify: be explicit that FDPOLL= is not a global setting 31600/head
Mike Yuan [Sun, 3 Mar 2024 10:37:36 +0000 (18:37 +0800)] 
man/sd_notify: be explicit that FDPOLL= is not a global setting

"submitted" is already used in the description of FDNAME=.
Let's use that instead of "stored" for FDPOLL= too, to make
it more clear that it's a per-submission/per-fdset setting.

2 months agocore/service: use extract_many_words at one more place
Mike Yuan [Sun, 3 Mar 2024 10:28:21 +0000 (18:28 +0800)] 
core/service: use extract_many_words at one more place

2 months agoextract-word: modernize extract_many_words
Mike Yuan [Sun, 3 Mar 2024 10:13:52 +0000 (18:13 +0800)] 
extract-word: modernize extract_many_words

2 months agocore/service: minor cleanup for service_add_fd_store
Mike Yuan [Sun, 3 Mar 2024 09:56:57 +0000 (17:56 +0800)] 
core/service: minor cleanup for service_add_fd_store

2 months agoMerge pull request #31594 from YHNdnzj/logind-seat-basename
Luca Boccassi [Sat, 2 Mar 2024 22:07:22 +0000 (22:07 +0000)] 
Merge pull request #31594 from YHNdnzj/logind-seat-basename

logind: several coding style cleanups

2 months agohostnamed: use sd_bus_reply_method_return() to shorten code a bit
Lennart Poettering [Sat, 2 Mar 2024 18:39:13 +0000 (19:39 +0100)] 
hostnamed: use sd_bus_reply_method_return() to shorten code a bit

2 months agodocs/UEFI_SECURITY: minor tweaks to the text
Zbigniew Jędrzejewski-Szmek [Sat, 2 Mar 2024 10:26:38 +0000 (11:26 +0100)] 
docs/UEFI_SECURITY: minor tweaks to the text

Oxford comma, some mistakes in counts, and splitting of long sentences.

2 months agoresolved: explicitly disconnect all left-over TCP connections when coming back from...
Lennart Poettering [Fri, 1 Mar 2024 20:46:46 +0000 (21:46 +0100)] 
resolved: explicitly disconnect all left-over TCP connections when coming back from suspend

Fixes: #13730 (original reporter's log shows the TCP connection needed
to time out first)

2 months agopo: add false positives to POTFILES.skip
Piotr Drąg [Sat, 2 Mar 2024 15:06:15 +0000 (16:06 +0100)] 
po: add false positives to POTFILES.skip

Scripts used to detect files that should be in POTFILES.in, like
intltool-update -m used on https://l10n.gnome.org/module/systemd/,
falsely detect these files as containing translations. Avoid this
behavior by putting the files in POTFILES.skip.

2 months agologind-{session,seat}: get rid of basename() in _new() 31594/head
Mike Yuan [Sat, 2 Mar 2024 15:46:00 +0000 (23:46 +0800)] 
logind-{session,seat}: get rid of basename() in _new()

2 months agologind-device: remove unneeded 'struct'
Mike Yuan [Sat, 2 Mar 2024 15:44:14 +0000 (23:44 +0800)] 
logind-device: remove unneeded 'struct'

2 months agologind: place 'ret' param at last
Mike Yuan [Sat, 2 Mar 2024 15:43:39 +0000 (23:43 +0800)] 
logind: place 'ret' param at last

2 months agoMerge pull request #31587 from yuwata/udev-rps-follow-ups
Luca Boccassi [Sat, 2 Mar 2024 11:47:44 +0000 (11:47 +0000)] 
Merge pull request #31587 from yuwata/udev-rps-follow-ups

udev: follow-ups for RPS setting

2 months agoMerge pull request #31586 from YHNdnzj/progress-bar-minor-followup
Yu Watanabe [Sat, 2 Mar 2024 06:31:29 +0000 (15:31 +0900)] 
Merge pull request #31586 from YHNdnzj/progress-bar-minor-followup

shared/pretty-print: minor follow-up for progress bar

2 months agoMerge pull request #31583 from yuwata/sd-lldp-json-follow-up
Yu Watanabe [Sat, 2 Mar 2024 06:31:00 +0000 (15:31 +0900)] 
Merge pull request #31583 from yuwata/sd-lldp-json-follow-up

sd-lldp: fix assignment of capabilities in JSON output

2 months agotest-network: wait for the interface being processed by udevd 31587/head
Yu Watanabe [Sat, 2 Mar 2024 05:48:33 +0000 (14:48 +0900)] 
test-network: wait for the interface being processed by udevd

Otherwise, even if the interface is available, the requested config may
not be applied to the interface yet.

This also merges multiple tests for RPS setting. Hopefully the
performance of the test is improved.

2 months agotest-network: introduce udevadm() and friends
Yu Watanabe [Sat, 2 Mar 2024 05:34:49 +0000 (14:34 +0900)] 
test-network: introduce udevadm() and friends

2 months agoudev/net: fix ReceivePacketSteeringCPUMask=disable assignment
Yu Watanabe [Sat, 2 Mar 2024 05:45:44 +0000 (14:45 +0900)] 
udev/net: fix ReceivePacketSteeringCPUMask=disable assignment

Follow-up for 0f30bf5886f839984df545df74e9658daf3533d2.

If 'mask' is newly allocated, previously the value was ignored.

2 months agofuzz-lldp-rx: fuzz lldp_rx_build_neighbors_json() 31583/head
Yu Watanabe [Sat, 2 Mar 2024 04:50:50 +0000 (13:50 +0900)] 
fuzz-lldp-rx: fuzz lldp_rx_build_neighbors_json()

Addresses https://github.com/systemd/systemd/pull/31583#discussion_r1509882453.

2 months agotest-network: check enabled capabilities in LLDP neighbors
Yu Watanabe [Sat, 2 Mar 2024 04:44:20 +0000 (13:44 +0900)] 
test-network: check enabled capabilities in LLDP neighbors

Addresses https://github.com/systemd/systemd/pull/31583#discussion_r1509880349.

2 months agosd-lldp: fix assignment of capabilities in JSON output
Yu Watanabe [Sat, 2 Mar 2024 02:08:18 +0000 (11:08 +0900)] 
sd-lldp: fix assignment of capabilities in JSON output

Follow-up for 329146a9ac73ac3f91b80f318e3037041488087c.

2 months agoshared/pretty-print: use strrepa where appropriate 31586/head
Mike Yuan [Sat, 2 Mar 2024 03:33:29 +0000 (11:33 +0800)] 
shared/pretty-print: use strrepa where appropriate

2 months agoshared/pretty-print: print color sequence only when needed
Mike Yuan [Sat, 2 Mar 2024 03:45:02 +0000 (11:45 +0800)] 
shared/pretty-print: print color sequence only when needed

Follow-up for 71cb203a6ea6de409c6b9c042feda2ff655101e9

2 months agoman: fix typo
Yu Watanabe [Sat, 2 Mar 2024 02:57:36 +0000 (11:57 +0900)] 
man: fix typo

Follow-up for 419b25ddcac39cf967555c7a2eaa274fbf1ad03c.

2 months agohashmap: reorder fields to pack structure better
Lennart Poettering [Fri, 1 Mar 2024 20:43:21 +0000 (21:43 +0100)] 
hashmap: reorder fields to pack structure better

When building with ENABLE_DEBUG_HASHMAP we can pack the hashmap iterator
structure a bit better.

Fixes: #31558
2 months agoMerge pull request #31507 from poettering/import-modernize
Lennart Poettering [Fri, 1 Mar 2024 22:42:32 +0000 (23:42 +0100)] 
Merge pull request #31507 from poettering/import-modernize

importd: various modernizations

2 months agoMerge pull request #31571 from poettering/hostnamed-show-more
Lennart Poettering [Fri, 1 Mar 2024 22:42:10 +0000 (23:42 +0100)] 
Merge pull request #31571 from poettering/hostnamed-show-more

hostnamectl: show product uuid/hardware serial in regular output, plus various fixes

2 months agoMerge pull request #31274 from bluca/measure_engine
Lennart Poettering [Fri, 1 Mar 2024 22:41:25 +0000 (23:41 +0100)] 
Merge pull request #31274 from bluca/measure_engine

repart/measure/ukify: add support for OpenSSL engines/providers

2 months agoresolve: skip IP_UNICAST_IF for local sockets
Ronan Pigott [Fri, 1 Mar 2024 04:42:43 +0000 (21:42 -0700)] 
resolve: skip IP_UNICAST_IF for local sockets

SO_BINDTODEVICE was used during connect() to fix an issue where
IP_UNICAST_IF was improperly ignored for route lookups made by connect
in linux. This has since been resolved upstream [1][2], but as a result
we must apply the local socket excpetion to IP_UNICAST_IF as well.

The SO_BINDTODEVICE is no longer necessary, but left in place for 5.x
kernels.

[1] https://lore.kernel.org/all/20220829111554.GA1771@debian/
[2] https://lore.kernel.org/all/20221208145437.GA75680@debian/

2 months agoMerge pull request #31567 from YHNdnzj/service-unused-param
Lennart Poettering [Fri, 1 Mar 2024 21:39:27 +0000 (22:39 +0100)] 
Merge pull request #31567 from YHNdnzj/service-unused-param

core/service: remove unused function param and minor cleanup

2 months agoMerge pull request #31565 from YHNdnzj/safe_dlclose
Lennart Poettering [Fri, 1 Mar 2024 21:39:11 +0000 (22:39 +0100)] 
Merge pull request #31565 from YHNdnzj/safe_dlclose

dlfcn-util: use safe_dlclose for dlclosep

2 months agohostnamectl: display product uuid + hardware serial in regular status output 31571/head
Lennart Poettering [Fri, 1 Mar 2024 13:43:20 +0000 (14:43 +0100)] 
hostnamectl: display product uuid + hardware serial in regular status output

hostnamed provides this, hence hostnamectl should show it

2 months agohostnamed: add explicit BUS_ERROR_NO_HARDWARE_SERIAL error
Lennart Poettering [Fri, 1 Mar 2024 13:46:27 +0000 (14:46 +0100)] 
hostnamed: add explicit BUS_ERROR_NO_HARDWARE_SERIAL error

For the very similar case of the product UUID we have its own error
BUS_ERROR_NO_PRODUCT_UUID if we have no UUID. Let's mirror this for the
hardware serial, and expose the same, to keep things nicely symmteric.

2 months agohostnamed: do some validation of the hw serial before we return it
Lennart Poettering [Fri, 1 Mar 2024 13:46:00 +0000 (14:46 +0100)] 
hostnamed: do some validation of the hw serial before we return it

Let's make sure the serial contains not control chars, and is UTF-8
clean. In particular the latter matters as D-Bus shouldn't kick us
from the bus.

2 months agohostnamed: in get_hardware_firmware_data() don't dup a string if we shan't return it
Lennart Poettering [Fri, 1 Mar 2024 13:45:37 +0000 (14:45 +0100)] 
hostnamed: in get_hardware_firmware_data() don't dup a string if we shan't return it

2 months agohostnamed: our base indentation is 8 spaces, not 9 spaces
Lennart Poettering [Fri, 1 Mar 2024 13:44:27 +0000 (14:44 +0100)] 
hostnamed: our base indentation is 8 spaces, not 9 spaces

No idea what was going on here...

2 months agobus-util: add generic parser for extracting id128 values from bus messages
Lennart Poettering [Fri, 1 Mar 2024 13:47:52 +0000 (14:47 +0100)] 
bus-util: add generic parser for extracting id128 values from bus messages

2 months agoupdate TODO 31507/head
Lennart Poettering [Tue, 27 Feb 2024 14:05:26 +0000 (15:05 +0100)] 
update TODO

2 months agotest: add integration test for importctl
Lennart Poettering [Fri, 23 Feb 2024 21:50:30 +0000 (22:50 +0100)] 
test: add integration test for importctl

(these are explicit tests, on top of the existing machinectl tests that
are now chainload importctl)

2 months agoman: document new importctl/importd functionality
Lennart Poettering [Tue, 27 Feb 2024 08:39:57 +0000 (09:39 +0100)] 
man: document new importctl/importd functionality

This also replaces the Fedora download example with another one from
Ubuntu, since Fedora's images these days no longer qualify as DDIs, they
have no distinctive partition type UUIDs set for multiple of their
partitions, hence the images cannot be booted. A bit sad. Let's provide
a command that just works in its place.

2 months agoimportd: add command to list downloaded images
Lennart Poettering [Tue, 27 Feb 2024 10:08:49 +0000 (11:08 +0100)] 
importd: add command to list downloaded images

It's a bit weird we allow importing/pulling/exporting images, but we
have no scheme for showing what#s already downloaded. Hence let's add
this, it's easy to add after all.

2 months agoimportd: pass log level to invoked child
Lennart Poettering [Mon, 26 Feb 2024 18:04:48 +0000 (19:04 +0100)] 
importd: pass log level to invoked child

2 months agoimport: mention explicitly which image directory we operate on
Lennart Poettering [Mon, 26 Feb 2024 14:53:35 +0000 (15:53 +0100)] 
import: mention explicitly which image directory we operate on

Also, let's move the similar message about sync() mode to more common
code.

2 months agoimport: downgrade HTTP error code log message levels
Lennart Poettering [Mon, 26 Feb 2024 14:47:40 +0000 (15:47 +0100)] 
import: downgrade HTTP error code log message levels

Let's downgrade log levels a bit on HTTP error codes. After all we
gracefully handle many of them, and we do generated an extra message for
the ones which are fatal anyway, hence there's no point in emphasizing
the HTTP erro message levels as we currently do.

2 months agoimportctl: draw a pretty progress bar while downloading
Lennart Poettering [Mon, 26 Feb 2024 14:46:50 +0000 (15:46 +0100)] 
importctl: draw a pretty progress bar while downloading

Everybody loves pretty terminal progress bar.

2 months agomachinectl: chainload importctl for relevant verbs
Lennart Poettering [Thu, 22 Feb 2024 17:54:39 +0000 (18:54 +0100)] 
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.

2 months agoimportd: log the import callout that is going to be called
Lennart Poettering [Fri, 23 Feb 2024 20:50:29 +0000 (21:50 +0100)] 
importd: log the import callout that is going to be called

2 months agoimportd: make keeping pristine copy of downloaded images optional
Lennart Poettering [Thu, 22 Feb 2024 17:50:32 +0000 (18:50 +0100)] 
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.

2 months agoimportd: validate local image names with the right helper
Lennart Poettering [Thu, 22 Feb 2024 11:31:03 +0000 (12:31 +0100)] 
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.

2 months agoimportlisttransfersxclient
Lennart Poettering [Fri, 1 Mar 2024 15:13:59 +0000 (16:13 +0100)] 
importlisttransfersxclient

2 months agoimportctl: add support for selecting image class to download
Lennart Poettering [Thu, 22 Feb 2024 09:16:43 +0000 (10:16 +0100)] 
importctl: add support for selecting image class to download

2 months agoimportd: tighten checks in fds passed to us
Lennart Poettering [Thu, 22 Feb 2024 10:47:34 +0000 (11:47 +0100)] 
importd: tighten checks in fds passed to us

2 months agoimportd: add support for downloading sysext/confext/portable images too
Lennart Poettering [Thu, 22 Feb 2024 08:43:01 +0000 (09:43 +0100)] 
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.

2 months agoimport: merge PullFlags enum into ImportFlags
Lennart Poettering [Thu, 22 Feb 2024 12:32:35 +0000 (13:32 +0100)] 
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.

2 months agoimportctl: port tabular output for format-table.h APIs
Lennart Poettering [Wed, 21 Feb 2024 15:42:40 +0000 (16:42 +0100)] 
importctl: port tabular output for format-table.h APIs

2 months agoimportctl: modernize signal handling
Lennart Poettering [Fri, 16 Feb 2024 17:55:21 +0000 (18:55 +0100)] 
importctl: modernize signal handling

2 months agoimportctl: add standalone client to importd
Lennart Poettering [Fri, 16 Feb 2024 17:40:47 +0000 (18:40 +0100)] 
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.

2 months agoimportd: modernize signal handling a bit
Lennart Poettering [Fri, 16 Feb 2024 17:20:51 +0000 (18:20 +0100)] 
importd: modernize signal handling a bit

2 months agoimportd: trivial modernizations
Lennart Poettering [Fri, 16 Feb 2024 17:20:36 +0000 (18:20 +0100)] 
importd: trivial modernizations

2 months agoimportd: switch to pidref
Lennart Poettering [Fri, 16 Feb 2024 17:20:24 +0000 (18:20 +0100)] 
importd: switch to pidref

2 months agocurl-util: fix downloads from file:// URLs
Lennart Poettering [Fri, 23 Feb 2024 17:22:40 +0000 (18:22 +0100)] 
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.