Commit Graph
76152 Commits
Author SHA1 Message Date
Yu Watanabe 6d449bc71f Merge pull request #34318 from YHNdnzj/networkctl-edit-if-netdev
networkctl: support editing netdev files by link and cat ":all"
2024-09-10 14:32:28 +09:00
Yu Watanabe 214c2508f3 Merge pull request #34336 from yuwata/nspawn-fuse-follow-ups
nspawn: follow-ups for FUSE support
2024-09-10 14:32:09 +09:00
Lennart Poettering 9f6f3bd2fb Merge pull request #34297 from poettering/shell-prompt-extra
shell: define three system credentials we can propagate into shell prompts and welcome msgs
2024-09-10 06:42:31 +02:00
Lennart Poettering 89cdd4866a Merge pull request #34328 from poettering/analyze-help-text
analyze: --help text improvements
2024-09-10 06:42:03 +02:00
Lennart Poettering b4199a97e6 Merge pull request #34330 from poettering/shutdown-async-sync
shutdown: make all fsync()s asynchronous and apply timeout
2024-09-10 06:41:46 +02:00
Mike Yuan 0d3787deac networkctl: support editing netdev files by link and cat ":all"
Also, don't abuse RET_GATHER in verb_cat(), where the failures
are most likely unrelated to each other.

Closes #34281
2024-09-09 23:20:42 +02:00
Mike Yuan c9837c17d5 networkctl-status-link: show netdev files associated with link 2024-09-09 23:20:42 +02:00
Mike Yuan 4591c89a15 sd-network: introduce sd_network_link_get_netdev_file{,_dropins} 2024-09-09 23:20:42 +02:00
Mike Yuan 2cf9b1a0ee network: store netdev drop-in paths and dump into state file 2024-09-09 23:20:41 +02:00
Mike Yuan 4c8dc66438 networkd-state-file: use ASSERT_PTR where appropriate 2024-09-09 21:45:42 +02:00
Yu Watanabe da7fb6dad7 nspawn: use ERRNO_IS_NEG_NOT_SUPPORTED() at one more place
Follow-up for dc3223919f.
Addresses https://github.com/systemd/systemd/pull/34067#discussion_r1748061156.

Error codes other than ENOSYS may not come here, but if it comes, still
there is nothing we can do here, so let's not log the failure loudly.
2024-09-10 04:38:33 +09:00
Yu Watanabe b86b90cec5 nspawn: sync DeviceAllow= setting with systemd-nspawn@.service
Follow-up for dc3223919f.
Addresses https://github.com/systemd/systemd/pull/34067#discussion_r1748592958.

Otherwise, containers started with and without --keep-unit option run in
different device policies.
2024-09-10 04:38:11 +09:00
Lennart Poettering b4b66b2662 shutdown: replace unbounded fsync() with bounded sync_with_progress()
Let's put a time-out on this syncing.

Inspired-by: #34289 #34283
2024-09-09 19:12:31 +02:00
Lennart Poettering 13b5225d62 shutdown: teach sync_with_progress() to optionally sync a specific fd only
This is preparation for reusing the logic for syncing DM and other
devices with a timeout applied.
2024-09-09 19:12:31 +02:00
Lennart Poettering a8ea7c1940 meson: tweak meson conditionalization for ssh{d,}_config drop-ins
Let's make sure "no" is an acceptable setting for these paths.
2024-09-09 19:03:48 +02:00
Lennart Poettering 229d4a9806 shell: define three system credentials we can propagate into shell prompts and welcome messages 2024-09-09 19:03:48 +02:00
Lennart Poettering 8b29949a41 machinectl: suppress redirection notice if --quiet is specified 2024-09-09 18:58:57 +02:00
Daan De Meyer fa693fdc7e core: Add support for PrivateUsers=identity
This configures an indentity mapping similar to
systemd-nspawn --private-users=identity.
2024-09-09 18:31:01 +02:00
Yanqing Jing d8b4be38dd update keyboard hwdb to add acer Predator PHN16-72 2024-09-09 17:19:28 +02:00
Lennart Poettering 7a3223f509 Merge pull request #34258 from yuwata/nspawn-volatile-u
nspawn: make --volatile work with -U
2024-09-09 17:11:11 +02:00
Lennart Poettering 645a3fa9e8 analyze: add some roughly useful subsections to --help text
It's a long long list of verbs we support now, let's make it easier to
digest, like we did in systemctl --help and elsewhere.
2024-09-09 17:01:22 +02:00
Lennart Poettering fd4b848436 analyze: add section underlining to --help text
Do this like we usually do these days.
2024-09-09 17:01:19 +02:00
Daan De Meyer c1852f9d5f sysupdate: Add --transfer-source=
In mkosi, I want to add a sysupdate verb to wrap systemd-sysupdate.
The definitions will be picked up from mkosi.sysupdate/ and passed
to systemd-sysupdate. I want users to be able to write transfer
definitions that are independent of the output directory used by
mkosi. To make this possible, it should be possible to specify the
directory that transfer sources should be looked up in on the sysupdate
command line. Let's allow this via a new --transfer-source= option.

Additionally, transfer sources that want to take advantage of this
feature should specify PathRelativeTo=directory to indicate the configured
Path= is interpreted relative to the tranfer source directory specified
on the CLI.

This allows for the following transfer definition to be put in
mkosi.sysupdate:

"""
[Transfer]
ProtectVersion=%A

[Source]
Type=regular-file
Path=/
PathRelativeTo=directory
MatchPattern=ParticleOS_@v.usr-%a.@u.raw

[Target]
Type=partition
Path=auto
MatchPattern=ParticleOS_@v
MatchPartitionType=usr
PartitionFlags=0
ReadOnly=1
"""
2024-09-09 16:41:52 +02:00
Mike Yuan 4ec630bfba Merge pull request #33833 from YHNdnzj/manager-reload-assert
core/manager: do not re-init Manager.lookup_paths when manager_reload(), minor assorted cleanups
2024-09-09 14:21:57 +02:00
Daan De Meyer 6e4d47b5ae repart: Initialize split_name_format in copy_from_one()
Let's allow splitting the partitions from an existing disk image
by initializing split_name_format when using --copy-from=.
2024-09-09 13:22:26 +02:00
Yu Watanabe c1062559a9 Merge pull request #34307 from yuwata/linux-more-network-headers
linux: import more network headers
2024-09-09 19:33:14 +09:00
Yu Watanabe ef32235db1 Merge pull request #34067 from LukeShu/lukeshu/nspawn-fuse
nspawn: enable FUSE in containers
2024-09-09 19:32:16 +09:00
Yu Watanabe 85fd8df03d missing_socket: drop unnecessary definitions
Now, we have copy of vm_sockets.h, hence these definitions are not
necessary anymore.
2024-09-09 14:52:18 +09:00
Yu Watanabe 47a71f9852 missing_network: drop unnecessary definition
Now we have ipv6.h, hence the definition is not necessary anymore.
2024-09-09 14:52:18 +09:00
Yu Watanabe 0ca88780d6 arphrd-list: use imported linux/if_arp.h 2024-09-09 14:52:18 +09:00
Yu Watanabe a84649592c linux: import more network related headers from v6.11-rc6
Hopefully, no effective change.
2024-09-09 14:52:18 +09:00
Mike Yuan 978e7d166c terminal-util: correct fd validity check
Follow-up for 14f594b995
2024-09-08 20:45:33 +02:00
samuelvw01 54ada3d13a Fix typo in escape.c 2024-09-08 18:55:13 +09:00
Erik Sjölund fdc1b714d4 TODO: fix typo 2024-09-08 18:54:20 +09:00
marginaldev 5bad3c4222 Fix grammar in udevadm settle timeout message 2024-09-08 12:28:22 +09:00
Luke T. Shumaker dc3223919f nspawn: enable FUSE in containers
Linux kernel v4.18 (2018-08-12) added user-namespace support to FUSE, and
bumped the FUSE version to 7.27 (see: da315f6e0398 (Merge tag
'fuse-update-4.18' of
git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse, Linus Torvalds,
2018-06-07).  This means that on such kernels it is safe to enable FUSE in
nspawn containers.

In outer_child(), before calling copy_devnodes(), check the FUSE version to
decide whether enable (>=7.27) or disable (<7.27) FUSE in the container.  We
look at the FUSE version instead of the kernel version in order to enable FUSE
support on older-versioned kernels that may have the mentioned patchset
backported ([as requested by @poettering][1]).  However, I am not sure that
this is safe; user-namespace support is not a documented part of the FUSE
protocol, which is what FUSE_KERNEL_VERSION/FUSE_KERNEL_MINOR_VERSION are meant
to capture.  While the same patchset
 - added FUSE_ABORT_ERROR (which is all that the 7.27 version bump
   is documented as including),
 - bumped FUSE_KERNEL_MINOR_VERSION from 26 to 27, and
 - added user-namespace support
these 3 things are not inseparable; it is conceivable to me that a backport
could include the first 2 of those things and exclude the 3rd; perhaps it would
be safer to check the kernel version.

Do note that our get_fuse_version() function uses the fsopen() family of
syscalls, which were not added until Linux kernel v5.2 (2019-07-07); so if
nothing has been backported, then the minimum kernel version for FUSE-in-nspawn
is actually v5.2, not v4.18.

Pass whether or not to enable FUSE to copy_devnodes(); have copy_devnodes()
copy in /dev/fuse if enabled.

Pass whether or not to enable FUSE back over fd_outer_socket to run_container()
so that it can pass that to append_machine_properties() (via either
register_machine() or allocate_scope()); have append_machine_properties()
append "DeviceAllow=/dev/fuse rw" if enabled.

For testing, simply check that /dev/fuse can be opened for reading and writing,
but that actually reading from it fails with EPERM.  The test assumes that if
FUSE is supported (/dev/fuse exists), then the testsuite is running on a kernel
with FUSE >= 7.27; I am unsure how to go about writing a test that validates
that the version check disables FUSE on old kernels.

[1]: https://github.com/systemd/systemd/issues/17607#issuecomment-745418835

Closes #17607
2024-09-07 10:18:35 -06:00
Yu Watanabe a9987de62c NEWS: fix typo
Follow-up for 7a3a49386c.
2024-09-07 22:26:24 +09:00
Yu Watanabe c8f2409574 man/varlinkctl: fix typo
Follow-up for 39ce86d19c.
2024-09-07 22:24:58 +09:00
Yu Watanabe 14a499ed77 network/route: fix typo
Follow-up for 195bb6f97e.
2024-09-07 22:22:44 +09:00
Mike Yuan 30b55e98d1 core/manager: do not re-init Manager.lookup_paths when manager_reload()
Follow-up for 99aad9a2b9

The commit changed lookup_paths_init_or_warn() call to
be fatal to manager_reload(), but invoke_main_loop()
assumes that manager_reload() would only return
recoverable error, and put the manager back to
MANAGER_OK in that case, which is spurious.

Looking at it more, it appears to be utterly unnecessary
to reinitialize LookupPaths here, given that nothing during
the reload process would change the search dirs. Let's drop
the path altogether hence.
2024-09-07 14:52:50 +02:00
Mike Yuan e634df9f16 core/manager: rename NOTIFY_RCVBUF_SIZE to MANAGER_SOCKET_RCVBUF_SIZE
This is used for all our sockets, hence rename as so.
2024-09-07 14:52:50 +02:00
Mike Yuan ebf0e859da varlinkctl: downgrade ignored error msg to LOG_WARNING
Follow-up for 39ce86d19c
2024-09-07 14:46:18 +02:00
Mike Yuan 5bab5e4ac3 chattr-util: use BIT_FOREACH where appropriate 2024-09-07 14:46:18 +02:00
Mike Yuan 26f5897767 chattr-util: set O_NOCTTY when reopening O_PATH fd
Follow-up for 07862c9fc2
2024-09-07 14:46:18 +02:00
Daan De Meyer 517e892210 mkosi: Drop _fixperms workaround
This was added to deal with a bug in the rpm 4.20 rc in Rawhide
but since that's been fixed, let's drop the workaround.
2024-09-07 21:20:09 +09:00
Michal Sekletar 887a18b0d3 docs: use actual docs/HACKING.md URL 2024-09-07 12:14:42 +02:00
Luke T. Shumaker f1bf6054ce nspawn: register_machine() and allocate_scope() bools to flags 2024-09-06 18:33:50 -06:00
Luke T. Shumaker 14762b27d3 nspawn: re-flow comments that are wrapped weird 2024-09-06 18:33:50 -06:00
Luke T. Shumaker 93c15c6d43 test: add a testcase for unprivileged nspawn
Right now it mostly duplicates a test that already exists in
TEST-50-DISSECT.mountfsd.sh, but it serves as a template for more unprivileged
nspawn tests.
2024-09-06 18:33:50 -06:00
Luke T. Shumaker 6cb5c6aeef nspawn: convert copy_devnodes():devnodes from nulstr to strv 2024-09-06 18:33:50 -06:00