Commit graph

62227 commits

Author SHA1 Message Date
Jan Janssen cd4300f30f meson: Move bootctl sources defintion to its own file
The root meson.build file is already large enough.
2023-01-23 14:41:26 +01:00
Zbigniew Jędrzejewski-Szmek e830d6dd2d
Merge pull request #25145 from yuwata/udevadm-trigger
udev: make 'udevadm trigger --settle' work even if device is renamed
2023-01-23 13:49:20 +01:00
Michael Biebl a4bc35740a test: fix TEST-73-LOCALE on Debian
Fix incorrection assumption about the Debian patch being buggy and
actually making TEST-73-LOCALE fail on Debian.

```
 # localectl set-locale LANG=C.UTF-8
 # cat /etc/default/locale
 LANG=C.UTF-8
```
2023-01-23 11:41:14 +00:00
Yu Watanabe 8589823f9d locale: also save XKB settings to vconsole.conf
Closes #24228.
Replaces #25412.
2023-01-23 11:30:03 +00:00
Yu Watanabe 50ec824570 locale: make errors in writing files not critical
Suggested at https://github.com/systemd/systemd/pull/25805#discussion_r1054871210

> we now write multiple files and we cannot possibly guarantee that
> either both updates worked or neither. unix fs apis simply have
> no concept that would allow us to implement that. hence I think
> we should update what we can, log about what we cannot, but return
> success as long as our in-memory state was updated.
2023-01-23 11:30:03 +00:00
Yu Watanabe 4f34fd5d40 locale: merge vconsole_convert_to_x11_and_emit() with method_set_vc_keyboard()
Similary, this also merges x11_convert_to_vconsole_and_emit() with
method_set_x11_keyboard().

No functional changes, preparation for later commits.
2023-01-23 11:30:03 +00:00
Yu Watanabe b41ec10ae4 locale: split out XKB settings to X11Context
No functional changes, just refactoring and preparation for later
commits.
2023-01-23 11:30:03 +00:00
Yu Watanabe c2ddaed483 locale: rename context_free_vconsole() -> context_clear_vconsole()
Similary, this also renames context_free_x11() -> context_clear_x11(),
to make it clear that these functions do not free Context.

Also, this makes context_clear() support to be called more than once.
2023-01-23 11:29:11 +00:00
Yu Watanabe 6f4514e84a locale: do not use alloca() for strings which can be potentially arbitrary 2023-01-23 11:29:11 +00:00
Yu Watanabe 76400a623f locale: several coding style fixlets
- add missing assertions,
- rename arguments for storing results,
- always initialize results on success,
- use _cleanup_ attribute at more places, etc.
2023-01-23 11:29:11 +00:00
Luca Boccassi 901339702c
Merge pull request #26147 from keszybz/silence-gcc-13-warning
Silence gcc-13 warning
2023-01-23 00:44:41 +00:00
Luca Boccassi e24652ac2e
Merge pull request #26146 from keszybz/two-man-page-tweaks
Two man page tweaks
2023-01-22 20:14:33 +00:00
Steve Ramage fdbbb5ffc0 Resolves #26142 - Fix list of supported personalities 2023-01-22 18:57:12 +01:00
DaPigGuy 60eac27a0d hwdb: Prevent activation of airplane mode on HP ENVY x360 2023-01-22 18:46:27 +01:00
Zbigniew Jędrzejewski-Szmek 8f5d716a71 shared/install: rework an assert to appease gcc-13
With the previous form, gcc is confused and thinks that .type might be unset.

Fixes #26118.
2023-01-22 18:25:56 +01:00
Zbigniew Jędrzejewski-Szmek 4a4af850b3 shared/install: rework InstallChange to always have .path set
We would set .path in all cases except INSTALL_CHANGE_AUXILIARY_FAILED, where
we would just just .source. This special case is just not worth it, because
we can't easily assert that .path is set. Let's remove this special case to
help the compiler know that .path is actually set.

Avoids a warning with gcc-13.0.1-0.1.fc38.x86_64.
2023-01-22 18:25:56 +01:00
Zbigniew Jędrzejewski-Szmek 066991f9fe man/sd_notify: fix indentation in sample programs
Whether we use a newline at the beginning of <programlisting> or not doesn't
seem to have any effect. So let's use the newline in multi-line examples; it is
easier to get the indentation right this way.
2023-01-22 17:55:34 +01:00
Zbigniew Jędrzejewski-Szmek a9ba6f8a88 man: minor corrections
Two issues that were missed in 8b9f092112.
2023-01-22 17:55:34 +01:00
David Tardon 7100653885 sd-path: export env. generators paths 2023-01-21 11:27:40 +00:00
Lennart Poettering 2155bd9441
Merge pull request #26139 from yuwata/test-load-fragment-fix-memleak
test-load-fragment: fix memleak
2023-01-21 10:50:07 +01:00
Yu Watanabe 1dcfbc514c systemctl,test: -EBADF instead of -EBADFD
Follow-up for da20baaecc.
2023-01-21 10:47:54 +01:00
Lennart Poettering 23fcf34a51
Merge pull request #26137 from poettering/timesyncd-touch-file-tweaks
timesync: some tweaks to saved timestamp file handling
2023-01-21 10:46:54 +01:00
Lennart Poettering 8b70155815 logs-show: add a splash of colour to verbose output 2023-01-21 10:46:35 +01:00
Lennart Poettering b1cc0822c3 logs-show: minor modernizations 2023-01-21 10:46:20 +01:00
Lennart Poettering 404803e6ca sd-journal: validate monotonic timestamp before returning it 2023-01-21 10:46:02 +01:00
Lennart Poettering 7153213e40 string-util: add common implementation of function that converts sized character buffers to NUL terminated C strings 2023-01-21 10:45:25 +01:00
Yu Watanabe 93d0cf7a37 test-load-fragment: shorten code a bit 2023-01-21 15:11:43 +09:00
Yu Watanabe c9b733265f test-load-fragment: fix memleak
Fixes a leak reported at https://github.com/systemd/systemd/pull/26115#issuecomment-1398026085.
2023-01-21 15:11:29 +09:00
13r0ck 9e2e3342ca hwdb: Add touchpad toggle mapping for System76 Pangolin 12 2023-01-21 00:40:09 +00:00
Lennart Poettering 8cc3cdac23 logs-show: move strlen() handling into update_json_data() so that we can use SD_ID128_TO_STRING() 2023-01-21 00:39:09 +00:00
Lennart Poettering 1acb4f6157 timesyncd: make sure to update mtime of clock file on each boot
Let's make sure the timestamp file's mtime is guaranteed to change for
each boot, so that it is a useful indicator of time. Or in other words
this gurantees that systemd-timesyncd.service acts as a new kind of
milestone: that time definitely progressed on this boot even the machine
died abnormally imediately after.
2023-01-20 22:33:05 +01:00
Lennart Poettering 84447fe79d timesyncd: modernize load_clock_timestamp() a bit
Let's log more.
2023-01-20 22:33:05 +01:00
Lennart Poettering 29920c5b1f timesyncd: write structured log messages whenever we bump the clock based on disk timestamp
It's useful being able to easily detect if a disk-based clock bump was
done, let's make it a structure message, the same way as acquiring an
NTP fix already is.

Also, set the clock to 1 µs further than the timestamp from the disk,
after all we know that that timestamp was current when it was written,
hence it can't be the right one right now anymore.
2023-01-20 22:33:04 +01:00
Lennart Poettering 902ee764a4
Merge pull request #26131 from poettering/bootctl-help-text-fix
bootctl --help fixes
2023-01-20 22:21:17 +01:00
Lennart Poettering 6f30a67a7a journal: use compound initializors at one more place 2023-01-20 21:46:50 +01:00
Lennart Poettering 6320409c56 journal: modernize match_make_string() 2023-01-20 21:46:32 +01:00
Lennart Poettering c5da14cd59 journalctl: don't convert between strv/Set for each log line
If output fields are specified, let's store this in a Set right-away,
instead of converting between strv and Set again and again for each
line.

This is not only faster, but also simpler and shorter.
2023-01-20 21:46:01 +01:00
Lennart Poettering 8ba814df25 logs-show: use json_variant_unref_many() where appropriate 2023-01-20 21:45:45 +01:00
Lennart Poettering fcd172b123
Merge pull request #26126 from poettering/format-table-date
hostnamectl: show firmware date as date only, with now time
2023-01-20 21:45:28 +01:00
Jan Janssen 1d278ad7d4 boot: Stop linking against libefi.a
libefi.a just provided the c helper API that was slowly removed. As we
do not depend on anything provided by it anymore, it is safe to drop
now.

Since the ST/BS/RT pointers are very convenient and needed everywhere,
they are retained and initialized by us.
2023-01-20 21:02:16 +01:00
Jan Janssen 31a131bb32 boot: Introduce DEFINE_EFI_MAIN macro 2023-01-20 21:01:08 +01:00
Jan Janssen 831b6a7fb0 boot: Simplify debug hook 2023-01-20 20:55:11 +01:00
Jan Janssen 19f08504c5 boot: Rework GUID handling
This stops using global GUID variables provided by gnu-efi. The globals
presumably exist to make EFI calls easier. But these GUIDs are just
128bits, so it's cheap to just put them on the stack when needed. C99
compound literals makes this even easier.

This also adds a convenience macro to create GUID pointers and uses it
everywhere. Not forcing a GUID definition to be a compound literal makes
them easier to use when assigning them to variables:
    EFI_GUID before = *SOME_CONST_GUID;
    EFI_GUID after = SOME_GUID;

And MAKE_GUID_PTR() makes it more explicit what is happening. It was
easy to confuse the old code as a cast:
    before(&(EFI_GUID) SOME_GUID);
    after(MAKE_GUID_PTR(SOME));
2023-01-20 20:55:11 +01:00
Jan Janssen 888b678f9f boot: Drop use of ValueToString 2023-01-20 20:55:11 +01:00
Jan Janssen edb73ee742 boot: Drop use of GuidToString 2023-01-20 20:55:11 +01:00
Lennart Poettering e684d2d5f8 bootctl: remove space that should not be there 2023-01-20 18:42:25 +01:00
Lennart Poettering eab7061898 bootctl: split out boot loader spec + boot loader interface commands in --help text
grub (at least on fedora) nowadays implements the boot loader spec, but
not the boot loader interface. Hence let's split out the commands
specific to each in two groups in the --help text. This way the first
group just covers boot lodaer spec stuff (i.e. stuff on disk in the
ESP/XBOOTLDR partition). And the other covers talking to the boot loader
via EFI var.
2023-01-20 18:42:25 +01:00
Lennart Poettering 5bbf72bb9e bootctl: realign column in --help text
for some reason the descriptions of the switches and the commands
weren't aligned, one space off. Fix that.
2023-01-20 18:30:47 +01:00
Lennart Poettering 1e7d6cc072 bootctl: change section title for kernel image commands
Let's call them kernel *images*, not just *kernels*.
2023-01-20 18:30:06 +01:00
Lennart Poettering 2b197967bf bootctl: drop full stop at end of --help texts
We never do that, don't do so here either.
2023-01-20 18:29:15 +01:00