Commit Graph
75037 Commits
Author SHA1 Message Date
Lennart Poettering 0e08325baa terminal-util: remember error code from tcsetattr() 2024-07-19 11:41:43 +02:00
Lennart Poettering 1c685216f4 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.
2024-07-19 11:41:43 +02:00
Lennart Poettering 1df569b2e6 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.
2024-07-19 11:41:42 +02:00
Lennart Poettering 4c8c499e2c terminal-util: return correct error in chvt() 2024-07-19 11:41:42 +02:00
Lennart Poettering 9a5e421af5 terminal-util: refuse a few more unexpected open flags in open_terminal() 2024-07-19 11:41:42 +02:00
Lennart Poettering 845be16ffd terminal-util: trivial white space fix 2024-07-19 11:41:42 +02:00
Lennart Poettering cc915eefaf env-util: suppress unnecessary setenv() in setenvf() 2024-07-19 11:41:42 +02:00
Lennart Poettering 95a8308d53 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.
2024-07-19 11:38:46 +02:00
Luca Boccassi 68d939350f Merge pull request #33591 from teknoraver/o_path
use O_PATH when possible
2024-07-19 11:01:01 +02:00
Luca Boccassi 433b9a6884 Merge pull request #33770 from bluca/polkit-root
polkit: map POLKIT_ALWAYS_QUERY to new polkit flag
2024-07-19 10:57:07 +02:00
Lucas Werkmeister 8c4aa0f1c6 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.
2024-07-19 09:39:51 +02:00
Luca Boccassi 20de757b69 Merge pull request #33773 from kovalev0/fix_aquarius_cmp_ns483_keyb_and_sensor
Fix aquarius cmp ns483 keyboard and sensor
2024-07-18 22:28:23 +02:00
Vasiliy Kovalev 3585e55881 hwdb: add backslash and touchpad toggle mapping for Aquarius Cmp NS483
Signed-off-by: Vasiliy Kovalev <kovalev@altlinux.org>
2024-07-18 22:07:36 +03:00
Vasiliy Kovalev 8891f9332f hwdb: fix accelerometer mount matrix for Aquarius Cmp NS483
Signed-off-by: Vasiliy Kovalev <kovalev@altlinux.org>
2024-07-18 22:07:33 +03:00
Luca Boccassi d108c2d157 Merge pull request #33767 from keszybz/test-ukify-nicer
Make test_ukify not use a real initrd
2024-07-18 17:59:55 +02:00
Luca Boccassi b61d69fae0 polkit: fix typo in enum name 2024-07-18 16:43:56 +01:00
Léane GRASSER 0d8b38415c l10n: fix credits for the French translation 2024-07-18 17:14:48 +02:00
Luca Boccassi 5c48335ef4 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.
2024-07-18 16:11:26 +01:00
Daan De Meyer 4698411ff3 Merge pull request #33763 from DaanDeMeyer/mkosi
mkosi: Two fixlets
2024-07-18 16:43:15 +02:00
Lennart Poettering 46b89b83e3 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").
2024-07-18 15:41:33 +02:00
Zbigniew Jędrzejewski-Szmek a669091a43 test_ukify: add instructions
Copied directly from a1d6dbb1c9.
2024-07-18 15:04:28 +02:00
Zbigniew Jędrzejewski-Szmek 87204601df 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
2024-07-18 15:04:28 +02:00
Zbigniew Jędrzejewski-Szmek 987f4bce93 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.
2024-07-18 15:04:28 +02:00
Luca Boccassi dbc66f87b3 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
2024-07-18 14:53:17 +02:00
Daan De Meyer 2315c6996f mkosi: Fix indentation 2024-07-18 13:01:27 +02:00
Daan De Meyer ac31804db7 mkosi: Fix typo
Our config parsing is flexible enough that this kind of worked surprisingly
enough.
2024-07-18 12:53:53 +02:00
Daan De Meyer 91cc65c5ad mkosi: Drop util-linux from centos/fedora packages
It's already included in the packages list in mkosi.conf.
2024-07-18 12:51:44 +02:00
Daan De Meyer 1d914b268c mkosi: Drop udev from Packages= list
It's pulled in via VolatilePackages=, no need to put it in Packages=.
2024-07-18 12:48:48 +02:00
Daan De Meyer 1250dc6a1d mkosi: Fix formatting
All of our lists start on the next line, so let's make KernelCommandLine=
fit that as well.
2024-07-18 12:47:51 +02:00
Daan De Meyer 20e943f987 Merge pull request #33761 from DaanDeMeyer/mkosi
mkosi: Various NO_BUILD improvements
2024-07-18 12:46:58 +02:00
Daan De Meyer 773f2e9633 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.
2024-07-18 11:52:01 +02:00
Lennart Poettering 1717a939be update TODO 2024-07-18 11:40:10 +02:00
Daan De Meyer d279ec4a50 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.
2024-07-18 11:39:07 +02:00
Daan De Meyer bb8f6ac445 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.
2024-07-18 11:17:42 +02:00
Mike Yuan bbddfe5249 Merge pull request #33092 from YHNdnzj/freezer-cleanup
UnitFreezer: several cleanups
2024-07-17 23:45:32 +02:00
Lennart Poettering a68c97a545 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.
2024-07-17 23:05:12 +02:00
Lennart Poettering f499191c2e 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.
2024-07-17 23:04:46 +02:00
Lennart Poettering ddc6f19e93 varlink-util: minor tweak
Apparently I forgot that in the initial PR. Fix that.

https://github.com/systemd/systemd/pull/33714#pullrequestreview-2177885475
2024-07-17 23:04:28 +02:00
Lennart Poettering 5d6658deec Merge pull request #33609 from AdrianVovk/table-json
Improve table JSON name mangling
2024-07-17 23:03:54 +02:00
Adrian Vovk c82dfaf7e2 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.
2024-07-17 14:15:44 -04:00
Adrian Vovk c4cb49eb34 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.
2024-07-17 14:15:43 -04:00
Adrian Vovk bf01601f11 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");
2024-07-17 14:15:41 -04:00
Daan De Meyer 473747b8cf Merge pull request #33752 from DaanDeMeyer/lsm
Two mkosi improvements
2024-07-17 20:15:17 +02:00
Daan De Meyer f5c44df929 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.
2024-07-17 18:56:02 +02:00
Daan De Meyer 5319be5f0c 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.
2024-07-17 18:55:24 +02:00
Mike Yuan b1ed7e6749 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.
2024-07-17 18:14:33 +02:00
Mike Yuan 1b5caddfee sleep: also log about errno when getenv_bool fails 2024-07-17 18:14:33 +02:00
Mike Yuan a99935557a sleep: explicitly list valid sleep operations in switch
To follow our usual coding style.
2024-07-17 18:14:32 +02:00
Mike Yuan 6798fa11d2 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.
2024-07-17 18:14:32 +02:00
Mike Yuan e1ac52594d core/unit: introduce unit_freezer_complete, correctly report end state 2024-07-17 18:14:32 +02:00