Lennart Poettering [Thu, 11 Jul 2024 08:54:24 +0000 (10:54 +0200)]
terminal-util: remove terminal_vhangup() because apparently unused
Lennart Poettering [Thu, 11 Jul 2024 08:50:51 +0000 (10:50 +0200)]
terminal-util: rename return parameters ret_xyz
Lennart Poettering [Fri, 19 Jul 2024 07:17:29 +0000 (09:17 +0200)]
terminal-util: modernize vt_reset_keyboard() a bit
Lennart Poettering [Thu, 11 Jul 2024 08:47:01 +0000 (10:47 +0200)]
terminal-util: don't export vt_reset_keyboard() + vt_default_utf8()
Lennart Poettering [Fri, 19 Jul 2024 07:17:48 +0000 (09:17 +0200)]
terminal-util: modernize terminal_reset_ansi_seq() a bit
Let's update the commentary a bit. Also, use a time-out of 100ms rather
than 50ms for this, simply to unify on the same value used in
vt_disallocate() in a similar case.
Lennart Poettering [Thu, 11 Jul 2024 08:37:32 +0000 (10:37 +0200)]
terminal-util: don't export terminal_reset_ioctl()/terminal_reset_ansi_seq() anymore
We only use them in terminal-util.c, hence make them static (and move
them before their first using function).
Lennart Poettering [Thu, 11 Jul 2024 08:26:14 +0000 (10:26 +0200)]
terminal-util: rename reset_terminal_fd() → terminal_reset_ioctl()
Let's put "terminal_" as prefix, like with the other reset calls, and
let's make clear that this only encapsulates the ioctl-based reset
logic, not the ANSI sequence based reset logic.
Lennart Poettering [Thu, 11 Jul 2024 08:23:14 +0000 (10:23 +0200)]
terminal-util: remove reset_terminal() as it is unused
Lennart Poettering [Thu, 11 Jul 2024 07:34:11 +0000 (09:34 +0200)]
terminal-util: don't issue "ESC c" sequence on reset, but only when erasing the screen
ESC c is a (vaguely defined) "reset to initial state" ANSI sequence.
Many terminals clear the screen in this case, but that's a bit drastic I
think for most resets.
ESC c was added to the reset logic in
00bc83a275fa3ca8d90579fe9597d8b651d47332 (i.e. very recently), and I
don't think the effect was clear at that time.
Let's keep the ESC c in place however when we actually want to clear the
screen. Hence move it from reset_terminal_fd() into vt_disallocate().
Fixes: #33689
Lennart Poettering [Thu, 11 Jul 2024 07:26:07 +0000 (09:26 +0200)]
terminal-util: add new helper terminal_reset_defensive() that combines reset-by-ioctl and reset-by-sequence reasonably
Lennart Poettering [Wed, 10 Jul 2024 16:52:42 +0000 (18:52 +0200)]
terminal-util: add terminal_is_pty_fd() helper
The helper checks if an fd references a pty
Lennart Poettering [Wed, 10 Jul 2024 16:02:31 +0000 (18:02 +0200)]
terminal-util: unify code that resets /dev/console in common helper
We have pretty much the same code at two places, let's make it one.
Lennart Poettering [Wed, 10 Jul 2024 15:53:58 +0000 (17:53 +0200)]
terminal-util: reset /dev/console via ansi seq also in make_console_stdio()
This appears to have been the intention of
00bc83a275fa3ca8d90579fe9597d8b651d47332, judging by the comments on
that.
Lennart Poettering [Wed, 10 Jul 2024 15:17:58 +0000 (17:17 +0200)]
terminal-util: try to initialize rows/cols via ansi sequence in make_console_stdio()
Let's hook this up.
Lennart Poettering [Wed, 10 Jul 2024 14:33:10 +0000 (16:33 +0200)]
terminal-util: add helper that adjust terminal width/height from data acquired via ANSI sequences
Lennart Poettering [Wed, 10 Jul 2024 14:02:52 +0000 (16:02 +0200)]
terminal-util: add helper that queries terminal sizes via ANSI sequence
When we are talking to a serial terminal quite commonly the dimensions
are not set properly, because the serial protocol has not handshake or
similar to transfer this information.
However, we can derive the dimensions via ANSI sequences too, which
should get us the right information, since ANSI sequences are
interpreted by the final terminal, rather than an intermediary local tty
driver (which is where TIOCGWINSZ is interpreted).
This adds a helper call that gets the dimensions this way.
Lennart Poettering [Thu, 11 Jul 2024 08:31:02 +0000 (10:31 +0200)]
terminal-util: rename set_terminal_cursor_position() → terminal_set_cursor_position()
Let's prefix these functions with the subsystem name, and clean them up
a bit. Specifically, drop the error logging, it's entirely duplicative,
since every single caller does it anyway.
Lennart Poettering [Wed, 10 Jul 2024 15:18:55 +0000 (17:18 +0200)]
terminal-util: when querying bg color, ensure input fd and output fd refer to same tty
Let's add an extra safety check: before issuing the ansi sequence to
query the bg color, let's make sure input and output fd actually
reference the same tty. because otherwise it's unlikely we'll be able to
read back the response from the tty driver.
This is mostly just paranoia.
Lennart Poettering [Fri, 12 Jul 2024 17:04:39 +0000 (19:04 +0200)]
terminal-util: remember error code from tcsetattr()
Lennart Poettering [Wed, 10 Jul 2024 14:32:22 +0000 (16:32 +0200)]
terminal-util: turn off echo on stdin, not stdout
This doesn't make much of a different IRL, but it feels more right that
an operation that happens in input is turned off via the input fd.
Lennart Poettering [Wed, 10 Jul 2024 14:06:30 +0000 (16:06 +0200)]
terminal-util: don't process the same data twice when reading back bg color info
If we only read partial information from the tty we ended up parsing it
again and again, confusing the state machine. hence, return how much
data we actually processed and drop it from the buffer.
Lennart Poettering [Wed, 10 Jul 2024 14:32:35 +0000 (16:32 +0200)]
terminal-util: return correct error in chvt()
Lennart Poettering [Wed, 10 Jul 2024 15:01:47 +0000 (17:01 +0200)]
terminal-util: refuse a few more unexpected open flags in open_terminal()
Lennart Poettering [Wed, 10 Jul 2024 15:17:20 +0000 (17:17 +0200)]
terminal-util: trivial white space fix
Lennart Poettering [Wed, 17 Jul 2024 15:54:09 +0000 (17:54 +0200)]
env-util: suppress unnecessary setenv() in setenvf()
Lennart Poettering [Thu, 18 Jul 2024 13:39:39 +0000 (15:39 +0200)]
vmspawn: make "-n" just work
The tap network device should be called "vt-", so that that the
80-vm-vt.network file we ship by default actually matches against it.
Also, turn off any qemu callout stuff, networkd is smart enough to
handle all this on its own, without ugly callouts.
Luca Boccassi [Fri, 19 Jul 2024 09:01:01 +0000 (11:01 +0200)]
Merge pull request #33591 from teknoraver/o_path
use O_PATH when possible
Luca Boccassi [Fri, 19 Jul 2024 08:57:07 +0000 (10:57 +0200)]
Merge pull request #33770 from bluca/polkit-root
polkit: map POLKIT_ALWAYS_QUERY to new polkit flag
Lucas Werkmeister [Tue, 16 Jul 2024 16:15:32 +0000 (18:15 +0200)]
man: Mention Type=oneshot timeout directive
Make the warning for oneshot services (where RuntimeMaxSec= has no
effect) more actionable by pointing to the directive people can use
instead to effectively limit their runtime.
Luca Boccassi [Thu, 18 Jul 2024 20:28:23 +0000 (22:28 +0200)]
Merge pull request #33773 from kovalev0/fix_aquarius_cmp_ns483_keyb_and_sensor
Fix aquarius cmp ns483 keyboard and sensor
Vasiliy Kovalev [Thu, 18 Jul 2024 18:58:55 +0000 (21:58 +0300)]
hwdb: add backslash and touchpad toggle mapping for Aquarius Cmp NS483
Signed-off-by: Vasiliy Kovalev <kovalev@altlinux.org>
Vasiliy Kovalev [Thu, 18 Jul 2024 18:42:18 +0000 (21:42 +0300)]
hwdb: fix accelerometer mount matrix for Aquarius Cmp NS483
Signed-off-by: Vasiliy Kovalev <kovalev@altlinux.org>
Luca Boccassi [Thu, 18 Jul 2024 15:59:55 +0000 (17:59 +0200)]
Merge pull request #33767 from keszybz/test-ukify-nicer
Make test_ukify not use a real initrd
Luca Boccassi [Thu, 18 Jul 2024 15:43:56 +0000 (16:43 +0100)]
polkit: fix typo in enum name
Léane GRASSER [Thu, 18 Jul 2024 13:15:16 +0000 (15:15 +0200)]
l10n: fix credits for the French translation
Luca Boccassi [Thu, 27 Jun 2024 19:55:34 +0000 (20:55 +0100)]
polkit: map POLKIT_ALWAYS_QUERY to new polkit flag
polkitd by default just waves through requests from a root process.
A new POLKIT_CHECK_AUTHORIZATION_FLAGS_ALWAYS_CHECK flag was added
to main (will be part of v125 when it ships) that forces it to go
through the policy checks for root too. Previous versions will just
ignore it.
Change the flags handling slightly so that we pass this or the
interactive flags through, as the values match what polkit expects.
Daan De Meyer [Thu, 18 Jul 2024 14:43:15 +0000 (16:43 +0200)]
Merge pull request #33763 from DaanDeMeyer/mkosi
mkosi: Two fixlets
Lennart Poettering [Thu, 18 Jul 2024 12:28:52 +0000 (14:28 +0200)]
ptyfwd: reset color after two tty reset sequences, too
When we patch in a bg color we must make sure that when certain "reset"
sequences are transferred we fix up the bg color again.
Do so for \033[!p ("soft terminal reset") and \033c ("reset to initial
state" aka "full reset").
Zbigniew Jędrzejewski-Szmek [Thu, 18 Jul 2024 12:50:43 +0000 (14:50 +0200)]
test_ukify: add instructions
Copied directly from
a1d6dbb1c94685d7972f63ed2762fe4ba0251287.
Zbigniew Jędrzejewski-Szmek [Thu, 18 Jul 2024 12:48:37 +0000 (14:48 +0200)]
test_ukify: use sha384 in the signing tests
On Fedora, with crypto policy TEST-FEDORA41, sha1 is not allowed:
$ SYSTEMD_LOG_LEVEL=debug build/systemd-measure sign
--linux=/lib/modules/6.9.7-200.fc40.x86_64/vmlinuz
--osrel=/tmp/tmp.osrelbl2sr77f
--cmdline=/tmp/tmp.cmdlineouc7hqtj
--uname=/tmp/tmp.unamecbjgesty
--pcrpkey=/tmp/tmpufiadu8l
--initrd=/boot/
3a9d668b4db749398a4a5e78a03bffa5/6.9.7-200.fc40.x86_64/initrd
--sbat=/tmp/tmp.sbataz9arpy0
--private-key=/tmp/tmppyf0gx6w
--public-key=/tmp/tmpufiadu8l
--bank=sha1
Measuring boot phases: enter-initrd, enter-initrd:leave-initrd, enter-initrd:leave-initrd:sysinit, enter-initrd:leave-initrd:sysinit:ready
Loaded 'libtss2-esys.so.0' via dlopen()
Loaded 'libtss2-rc.so.0' via dlopen()
Loaded 'libtss2-mu.so.0' via dlopen()
PolicyPCR calculated digest:
cec1a2ccb188ddd171a2be7bfa6b31cb9148776647354eb1069e0f891ed2dbe7
Failed to initialize signature context: error:
03000098:digital envelope routines::invalid digest
Failed to sign PCR policy: Input/output error
Zbigniew Jędrzejewski-Szmek [Thu, 18 Jul 2024 12:43:32 +0000 (14:43 +0200)]
test_ukify: do not use files from /boot
They might not be readable to the unprivileged user running the tests
and it shouldn't really matter what is used. OTOH, we need a real kernel
because we look at the header.
Luca Boccassi [Thu, 18 Jul 2024 11:44:41 +0000 (12:44 +0100)]
mkosi: update debian commit reference
*
2d10c12bd5 Drop /etc/sysctl.d/99-sysctl.conf symlink
*
fb73af0d22 update changelog
*
9d74923dd7 Move systemd-time-wait-sync to systemd-timesyncd package
*
8e0914aa0d Update changelog for 256.2-1 release
*
6dabf74a81 Install run0 zsh completion file
*
a72e454b2b Update upstream source from tag 'upstream/256.2'
|\
| *
cf928e099f New upstream version 256.2
*
c473d940f7 d/e/checkout-upstream: switch packaging branch on upstream stable PRs
*
13586fc76f d/e/checkout-upstream: do not fail if rebase fails
*
19785960d1 d/e/checkout-upstream: fix shellcheck warnings
*
72b215c3f0 Install zsh completion for run0
*
51f87a981e initramfs-tools: copy network drop-ins too
Daan De Meyer [Thu, 18 Jul 2024 11:01:27 +0000 (13:01 +0200)]
mkosi: Fix indentation
Daan De Meyer [Thu, 18 Jul 2024 10:53:53 +0000 (12:53 +0200)]
mkosi: Fix typo
Our config parsing is flexible enough that this kind of worked surprisingly
enough.
Daan De Meyer [Thu, 18 Jul 2024 10:51:44 +0000 (12:51 +0200)]
mkosi: Drop util-linux from centos/fedora packages
It's already included in the packages list in mkosi.conf.
Daan De Meyer [Thu, 18 Jul 2024 10:48:48 +0000 (12:48 +0200)]
mkosi: Drop udev from Packages= list
It's pulled in via VolatilePackages=, no need to put it in Packages=.
Daan De Meyer [Thu, 18 Jul 2024 10:47:51 +0000 (12:47 +0200)]
mkosi: Fix formatting
All of our lists start on the next line, so let's make KernelCommandLine=
fit that as well.
Daan De Meyer [Thu, 18 Jul 2024 10:46:58 +0000 (12:46 +0200)]
Merge pull request #33761 from DaanDeMeyer/mkosi
mkosi: Various NO_BUILD improvements
Daan De Meyer [Thu, 18 Jul 2024 06:46:14 +0000 (08:46 +0200)]
mkosi: Build CentOS Stream 10 images by default
CentOS Stream 10 has a newer util-linux which means the terminal
gets correctly resized to the size specified by mkosi. This is a
much nicer experience than CentOS Stream 9 where you're stuck on
80x24 so let's make CentOS Stream 10 the default release to build.
Lennart Poettering [Thu, 18 Jul 2024 09:40:10 +0000 (11:40 +0200)]
update TODO
Daan De Meyer [Thu, 11 Jul 2024 14:09:47 +0000 (16:09 +0200)]
mkosi: Streamline running the integration tests without building systemd
Let's document in detail how to build the integration test image and run
the integration tests without building systemd. To streamline the process,
we stop automatically using binaries from build/ when invoking mkosi directly
and don't automatically use a tools tree anymore if systemd on the host is too
old. Instead, we document these options in HACKING.md and change the mkosi meson
target to automatically use the current build directory as an extra binary search
path for mkosi.
Daan De Meyer [Thu, 11 Jul 2024 14:09:15 +0000 (16:09 +0200)]
mkosi: Skip sync script if NO_BUILD is enabled
If we're not doing a build, there's no point in syncing either so
lets skip it.
Mike Yuan [Wed, 17 Jul 2024 21:45:32 +0000 (23:45 +0200)]
Merge pull request #33092 from YHNdnzj/freezer-cleanup
UnitFreezer: several cleanups
Lennart Poettering [Wed, 17 Jul 2024 13:56:59 +0000 (15:56 +0200)]
sd-device: remove debug log message when dirs are missing
This is a common case, and nothing noteworthy at all. For example, if we
establish an enumerator for listing all devices tagged by some tag, then
the per-tag dir is not going to exist if there are currently no devices
tagged that way, but that's a really common case, and doesn't really
deserve any mention, not even at debug level.
Lennart Poettering [Wed, 17 Jul 2024 13:07:29 +0000 (15:07 +0200)]
main: show different welcome msg in initrd than on the host
It has bugged me for a while that we show the exact same welcome message
at boot twice: once in the initrd, and once after the initrd→host
transition. That's very confusing.
Let's change the text a bit, and tone down the initrd message a bit (by
removing the empty line before and after it), because it is the less
relevant one.
Lennart Poettering [Wed, 17 Jul 2024 16:56:31 +0000 (18:56 +0200)]
varlink-util: minor tweak
Apparently I forgot that in the initial PR. Fix that.
https://github.com/systemd/systemd/pull/33714#pullrequestreview-
2177885475
Lennart Poettering [Wed, 17 Jul 2024 21:03:54 +0000 (23:03 +0200)]
Merge pull request #33609 from AdrianVovk/table-json
Improve table JSON name mangling
Adrian Vovk [Thu, 11 Jul 2024 23:35:10 +0000 (19:35 -0400)]
table: Fix JSON name mangling breaking changes
In previous commits, we've changed the JSON name mangling logic. This,
of course, will cause breaking changes to occur on anything that relied
on the JSON mangling logic.
This commit fixes those breaking changes by manually forcing the JSON
name back to what it was before.
Adrian Vovk [Wed, 3 Jul 2024 21:57:42 +0000 (17:57 -0400)]
table: Improve mangling of JSON field names
First, when displaying JSON we convert dashes into underscores. We want
to avoid using dashes in JSON field names in new code, because some
JSON parsers don't support dashes very well.
Second, we make the first character of every word lower-case. This
better matches our JSON field name style, and makes the automatic
JSON name mangling a lot more useful for vertical tables, where fields
are given a display name. For example, "Foo Bar" would be converted into
"foo_bar" instead of "Foo_Bar", which much better matches our style.
We don't make the whole string lowercase to support cases like:
"fooBar" should stay as "fooBar".
Some situations don't behave quite perfectly, such as "Foo BarBaz" gets
converted into "foo_barBaz", or all-caps headings get mangled
incorrectly. In these situations, the JSON field should be overridden
manually. In most cases, or at least more cases than before, this
heuristic does good enough.
Adrian Vovk [Wed, 3 Jul 2024 21:51:35 +0000 (17:51 -0400)]
table: Add TABLE_SET_JSON_FIELD_NAME
Lets you conveniently set JSON field names in table_add_many. Especially
useful for vertical tables. For example:
table_add_many(t,
TABLE_FIELD, "Display Name",
TABLE_STRING, obj->display_name,
TABLE_SET_JSON_FIELD_NAME, "displayName",
TABLE_FIELD, "Timestamp",
TABLE_TIMESTAMP, obj->timestamp,
TABLE_SET_JSON_FIELD_NAME, "timestampUSec");
Daan De Meyer [Wed, 17 Jul 2024 18:15:17 +0000 (20:15 +0200)]
Merge pull request #33752 from DaanDeMeyer/lsm
Two mkosi improvements
Daan De Meyer [Wed, 17 Jul 2024 16:56:02 +0000 (18:56 +0200)]
mkosi: Remove enforcing=0 from default kernel command line
We already have selinux=0 in the default kernel command line so
enforcing=0 is redundant. Instead, pass in enforcing=0 when we
enable selinux in TEST-06-SELINUX.
Daan De Meyer [Wed, 17 Jul 2024 16:55:24 +0000 (18:55 +0200)]
mkosi: Stop setting apparmor=0
It doesn't get pulled in as a dependency anyway and kernel command
line space is precious so let's remove apparmor=0 as it's a noop
anyway.
Mike Yuan [Tue, 11 Jun 2024 14:00:22 +0000 (16:00 +0200)]
sleep,home: always initialize UnitFreezer if used
Previously, unit_freezer_new_freeze() would only return
UnitFreezer object if FreezeUnit() succeeds. This is not
ideal though, as a failed bus call doesn't mean the action
actually failed. E.g. a timeout might occur because pid1
is waiting for cgroup event from kernel, while the bus call
timeout was exceeded (#33269). In such a case, ThawUnit()
will never be called, resulting in frozen units remain that
way after resuming from sleep.
Therefore, let's get rid of unit_freezer_new_freeze(),
and make sure as long as unit freezer is involved, we'll
call ThawUnit() when we're done. This should make things
a lot more robust.
Mike Yuan [Tue, 11 Jun 2024 16:17:01 +0000 (18:17 +0200)]
sleep: also log about errno when getenv_bool fails
Mike Yuan [Fri, 31 May 2024 04:18:44 +0000 (12:18 +0800)]
sleep: explicitly list valid sleep operations in switch
To follow our usual coding style.
Mike Yuan [Tue, 11 Jun 2024 17:09:05 +0000 (19:09 +0200)]
core/dbus-unit: add an explicit bus error when unit is frozen by parent
While at it, use more accurate errno (EDEADLK) instead of ECHILD.
Mike Yuan [Fri, 31 May 2024 12:43:53 +0000 (20:43 +0800)]
core/unit: introduce unit_freezer_complete, correctly report end state
Mike Yuan [Fri, 31 May 2024 12:46:16 +0000 (20:46 +0800)]
core/unit: introduce unit_set_freezer_state, make logging consistent
Also, emit PropertiesChanged signal for FreezerState too.
Fixes #31115
Mike Yuan [Sat, 25 May 2024 10:46:55 +0000 (18:46 +0800)]
core/cgroup: skip freezer action wholly if current == objective
Mike Yuan [Mon, 15 Jul 2024 18:32:47 +0000 (20:32 +0200)]
core/cgroup: replace hardcoded state set with freezer_state_finish()
This makes code simpler and more readable.
Mike Yuan [Wed, 17 Jul 2024 15:34:16 +0000 (17:34 +0200)]
core/unit: rename a few more vars for unit_next_freezer_state()
Luca Boccassi [Tue, 16 Jul 2024 15:53:08 +0000 (16:53 +0100)]
id128: add 'var-partition-uuid' verb
As per DPS the UUID for /var/ should be keyed by the local machine-id,
which is non-trivial to do in a script. Enhance 'systemd-id128' to
take 'var-partition-uuid' as a verb, and if so perform the
calculation.
Mike Yuan [Sat, 25 May 2024 10:46:23 +0000 (18:46 +0800)]
core/unit: use switch for unit_next_freezer_state
Mike Yuan [Sat, 25 May 2024 10:44:51 +0000 (18:44 +0800)]
core/unit: rename freezer "target" to "objective"
Mike Yuan [Sat, 25 May 2024 10:45:31 +0000 (18:45 +0800)]
core/slice: simplify slice_freezer_action a bit
Mike Yuan [Fri, 24 May 2024 14:57:18 +0000 (22:57 +0800)]
core: make unit_can_freeze take const Unit*
Mike Yuan [Fri, 24 May 2024 14:52:28 +0000 (22:52 +0800)]
core,unit-def: use our usual way of asserting enums
Mike Yuan [Fri, 24 May 2024 14:27:52 +0000 (22:27 +0800)]
core/unit: drop pointless unit_freezer_state wrapper
Mike Yuan [Thu, 30 May 2024 12:54:24 +0000 (20:54 +0800)]
core/dbus-unit: use UNIT_IS_LOAD_ERROR where appropriate
Daan De Meyer [Wed, 17 Jul 2024 10:58:50 +0000 (12:58 +0200)]
Merge pull request #33714 from poettering/make-varlink-public
varlink: make API public as "sd-varlink.h"
migleeson [Wed, 17 Jul 2024 07:45:26 +0000 (03:45 -0400)]
docs: update mkosi version mentioned in HACKING.md (#33723)
* fix: update docs since the default config uses a setting only available in v23
* fix: update docs to only refer to installing from the mkosi repo
Hans de Goede [Tue, 16 Jul 2024 15:46:09 +0000 (17:46 +0200)]
rules: Add uaccess tag to /dev/udmabuf
In some cases userspace may need to create dmabuffers from userspace
on such example is the software ISP part of libcamera which needs to
allocate dma-buffers for the output of the software ISP.
At first the plan was to allow console users access to /dev/dma_heap/*,
this was discussed with various kernel folks here:
https://lore.kernel.org/all/
bb372250-e8b8-4458-bc99-
dd8365b06991@redhat.com/
Giving console users access to the dma_heap's was deemed a bad idea
because memory allocated this way is not accounted in cgroup limits.
Giving access to /dev/udmabuf OTOH was deemed acceptable so that
is what this patch adds.
Resolves: #32662
Mike Yuan [Tue, 16 Jul 2024 19:10:46 +0000 (21:10 +0200)]
id128: refuse --app-specific= if we're listing GPT types
Prompted by #33737
The intention of
b37e8184a5a376749fbf68674ed6d7a4fc9901aa
is to expose sd_id128_get_app_specific() on command line.
But combining that with GPT type list makes little sense.
Luca Boccassi [Tue, 16 Jul 2024 16:46:54 +0000 (17:46 +0100)]
gpt: add more architecture aliases
Same as the other aliases. Allows chaining commands like:
$ systemd-id128 show -P root-$(dpkg-architecture --query DEB_HOST_ARCH)
4f68bce3e8cd4db196e7fbcaf984b709
Matteo Croce [Tue, 9 Jul 2024 00:05:29 +0000 (02:05 +0200)]
homed: open blob dir with O_PATH
`sys_base_dfd` is only used as dirfd argument to *_at functions,
open it with O_PATH.
Matteo Croce [Mon, 8 Jul 2024 23:50:53 +0000 (01:50 +0200)]
homed: use O_PATH for FDs
`Home->pin_fd` is used only for pinning, open it with O_PATH.
Matteo Croce [Mon, 8 Jul 2024 23:24:50 +0000 (01:24 +0200)]
use O_PATH to get the root fds
`switch_root()` opens two file descriptors to do the switch but never
reads from them. Open them with O_PATH.
Matteo Croce [Thu, 4 Jul 2024 01:16:29 +0000 (03:16 +0200)]
use O_PATH to obtain cgroupfs fd
We get a fd to cgroupfs just to avoid it being umounted, O_PATH
is enough, use it instead of O_RDONLY.
Matteo Croce [Thu, 4 Jul 2024 01:14:22 +0000 (03:14 +0200)]
use O_PATH when getting cgroup fd
O_PATH mode is enough to attach a bpf program to a cgroup, use it
instead of O_RDONLY
Daan De Meyer [Tue, 16 Jul 2024 12:15:38 +0000 (14:15 +0200)]
mkosi: List library packages explicitly in VolatilePackages=
These should already get pulled in as dependencies, but it doesn't
hurt to be explicit.
Daan De Meyer [Tue, 16 Jul 2024 10:07:38 +0000 (12:07 +0200)]
mkosi: Build initrd as a subimage
Let's make things a little more consistent and build the initrd
explicitly as a subimage as well instead of relying on mkosi building
it as part of the main image build.
We drop the opensuse initrd postinst script as we don't use erofs by
default anymore. We can always reintroduce it again later if needed.
Daan De Meyer [Tue, 16 Jul 2024 09:45:43 +0000 (11:45 +0200)]
mkosi: Drop CacheOnly=always from two subimages
This is a universal setting and can only be configured in the main
image so let's drop it from the subimages.
Lennart Poettering [Fri, 12 Jul 2024 14:38:20 +0000 (16:38 +0200)]
update TODO
Lennart Poettering [Fri, 12 Jul 2024 14:39:01 +0000 (16:39 +0200)]
sd-json/sd-varlink: downgrade assert() → assert_ret()
Our usual rule is that we are more lenient towards misuse for public
users of our code than for ourselves. Or in other words: when validating
parameters of our public functions (those starting with sd_…) we prefer
assert_ret() over assert().
Lennart Poettering [Fri, 12 Jul 2024 14:27:25 +0000 (16:27 +0200)]
libsystemd: use C23 explicit enum types where available
In C23 we can explicitly choose the integer type for an enum. Let's do
so to make our requirements for 64bit integers explicitly. Previously,
we'd rely on a GNU extension that would size the enum to 64bit if at
least one value outside the 32bit range is in the enum. Let's keep that
too, for compat with older compilers.
(Also, add the support for older compilers to the definition of
sd_json_dispatch_flags_t, where it was forgotten so far)
Lennart Poettering [Fri, 12 Jul 2024 09:22:58 +0000 (11:22 +0200)]
sd-varlink: make our internal Varlink API public as sd-varlink.[ch]
It's time. sd-json was already done earlier in this cycle, let's now
make sd-varlink public too.
This is mostly just a search/replace job of epical proportions.
I left some functions internal (mostly IDL handling), and I turned some
static inline calls into regular calls.
Daan De Meyer [Tue, 16 Jul 2024 09:43:49 +0000 (11:43 +0200)]
Merge pull request #33695 from DaanDeMeyer/epel
mkosi: Add CI for CentOS Stream 10
Daan De Meyer [Mon, 15 Jul 2024 21:07:52 +0000 (23:07 +0200)]
TEST-13-NSPAWN: make sure we don't load libnss_systemd
Let's make sure we don't load libnss_systemd.so from bash as the
necessary environment variables aren't set to make that work when
we're running with sanitizers enabled.
We can't add a sanitizer wrapper for bash as the wrapper runs using
bash so you end up in a loop.
Daan De Meyer [Mon, 15 Jul 2024 15:15:43 +0000 (17:15 +0200)]
mkosi: Disable unique debug source names
We use -fdebug-prefix-map= because debugedit doesn't work for us (for
a currently unknown reason since it's the most obtuse code I've ever
had the pleasure of reading). With all the unique macros enabled, the
destination directory we pass to -fdebug-prefix-map= includes the package
release. The release is either the timestamp of the current commit or
the current time if the working tree is dirty. This means it generally
changes every time we rerun the build script. However, meson only reads
compiler arguments the first time it is invoked or if --wipe is specified.
This means that on a rerun -fdebug-prefix-map= will be configured wrong
and the build will fail.
Let's prevent this from happening by disabling the unique debug source
names by overriding the --unique-debug-src-base option that is passed to
find-debuginfo.sh by rpm via the _find_debuginfo_opts macro.