1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-03-15 18:50:12 +03:00

41769 Commits

Author SHA1 Message Date
Jan Janssen
4a7ee0a521 meson: Do not include headers in source lists
Meson+ninja+compiler do this for us and are better at it.

https://mesonbuild.com/FAQ.html#do-i-need-to-add-my-headers-to-the-sources-list-like-in-autotools
2023-01-24 22:04:03 +01:00
Dan Streetman
40c5cc2b21 Consolidate various TAKE_* into TAKE_GENERIC(), add TAKE_STRUCT() 2023-01-24 18:33:43 +00:00
Zbigniew Jędrzejewski-Szmek
1552670852 test-sleep: reduce timeout
The timeout was raised during review and I wrote that I lowered it, but forgot
to actually commit the diff. Follow-up for 31f62bdd79472c32d52408956d5c82e9991ca425.
2023-01-24 19:14:27 +01:00
Zbigniew Jędrzejewski-Szmek
aaa448a5dc udevadm: add todo to remind us to remove compat code
https://github.com/systemd/systemd/pull/25145#issuecomment-1397606521
2023-01-24 19:14:27 +01:00
Lennart Poettering
4476fdd4c2
Merge pull request #26158 from poettering/hostnamed-end-of-support
hostnamed/hostnamectl: support os-release END_OF_SUPPORT= field
2023-01-24 18:13:45 +01:00
Lennart Poettering
162f6477c6 path-util: rework file_in_same_dir() on top of path_extract_directory()
Let's port one more over.

Note that this changes behaviour of file_in_same_dir() in some regards.
Specifically, a trailing slash of the input path will be treated
differently: previously we'd operate below that dir then, instead of the
parent. I think that makes little sense however, and I think the code
using this function doesn't expect that either.

Moroever, addresses some corner cases if the path is specified as "/" or
".", i.e. where e cannot extract a parent. These will now be treated as
error, which I think is much cleaner.
2023-01-24 18:13:27 +01:00
Yu Watanabe
5b532e14e3 bootctl-uki: several coding style fixlets
Mostly follow-ups for #26082.
2023-01-24 16:32:34 +01:00
Gerd Hoffmann
2d4260482c bootctl: kernel-inspect: print os info 2023-01-24 16:32:16 +01:00
Lennart Poettering
2b72626ee5 hostnamectl: show support and among output 2023-01-24 15:33:38 +01:00
Lennart Poettering
b563d5ce6f hostnamed: expose support end timestamp as property on the bus 2023-01-24 15:32:43 +01:00
Lennart Poettering
6bfe9b3b8d os-util: optionally, return EOL time in os_release_support_ended() 2023-01-24 15:32:43 +01:00
Lennart Poettering
a9bd4b4ed9 os-util: accept SUPPORT_END= with empty string as explicit way to disable concept 2023-01-24 15:32:43 +01:00
Lennart Poettering
469af08f58 os-util: when determining support end, don't treat /etc/os-release file as error
Instead, let's just treat it as "field unset".
2023-01-24 15:32:43 +01:00
Lennart Poettering
3d46a8292f format-table: add new cell type TABLE_TIMESPAN_DAY
This is just like TABLE_TIMESPAN_MSEC, but shows time spans in accuracy
of days.
2023-01-24 15:32:42 +01:00
Lennart Poettering
856ad0fdb6 os-util: determine distro EOL in UTC, not local timezone
Presumably vendors establish a global EOL time, hence its better to
interpret the date specification everywhere the same, instead of
timezone dependent.
2023-01-24 15:32:42 +01:00
Lennart Poettering
02b7005e38 tree-wide: unify how we pick OS pretty name to display 2023-01-24 15:32:42 +01:00
Mike Yuan
c2434a61f2 machinectl: add --now to start/stop containers when enabling/disabling
Closes #26154
2023-01-24 11:09:03 +00:00
Zbigniew Jędrzejewski-Szmek
52d370f811
Merge pull request #26159 from keszybz/capacity-to-crash
Resolve crash in systemd-sleep and other minor fixes
2023-01-24 07:52:36 +01:00
Luca Boccassi
780b9ae133
Merge pull request #26110 from medhefgo/boot-no-gnu-efi
boot: Stop linking against libefi.a
2023-01-23 23:51:49 +00:00
Luca Boccassi
ecb1456d0c
Merge pull request #26162 from YHNdnzj/machinectl-check-target-enabled
machinectl: also enable machines.target when enabling machines
2023-01-23 22:52:34 +00:00
Callum Farmer
9c100c4e70 boot: Use objcopy with arm64
Binutils 2.38 added support for efi-app-aarch64
Still use binary mode if we have an older objcopy
Add check for incompatible gnu-efi crt0 containing the header section
which gets added by objcopy and if used results in duplicate header
and subsequently a broken binary

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2023-01-23 22:52:07 +00:00
Zbigniew Jędrzejewski-Szmek
de5d8b40ed sleep: fix memleak
Those hashmaps are created anew in each iteration of the loop. The
leak wasn't really a problem, because the loop is bounded and the
hashmaps were not huge, but it's nicer to be correct.
2023-01-23 22:06:05 +01:00
Zbigniew Jędrzejewski-Szmek
099810a65b sleep: reduce double logging and improve messages and comments a bit
read_battery_capacity_percentage() was already logging, but with a slightly
different wording.

More could be done, I just touched the most noticable places. Especially
in debug messages, it is much more useful to be direct about what couldn't
be accessed or parsed, instead of providing "descriptive names" which are
not useful to the user at all, who then needs to read the code to figure out
what was the actual property name.
2023-01-23 22:06:05 +01:00
Zbigniew Jędrzejewski-Szmek
31f62bdd79 test-sleep: add a very simple test that prints battery suspend estimates 2023-01-23 22:06:05 +01:00
Zbigniew Jędrzejewski-Szmek
7ebbe4a5ce sleep: do not abort if we try to query capacity of missing battery
Fixes #25584.

From the issue:
Assertion 'capacity >= 0' failed at src/shared/sleep-config.c:58, function PTR_TO_CAPACITY(). Aborting.

(gdb) bt

The problem is that PTR_TO_CAPACITY(hashmap_get(last_capacity, battery_name))
will abort if it's called with a name not present in the hashmap. We want to
skip the device silently in this case instead.
2023-01-23 22:05:36 +01:00
Zbigniew Jędrzejewski-Szmek
d4fc020996
Merge pull request #26153 from DaanDeMeyer/repart-remove-userns
mkfs-util: Remove user namespace owner => root mapping
2023-01-23 21:46:55 +01:00
Luca Boccassi
020b2e41ea core: ensure init.scope is realized after drop-ins have been loaded
If we add a drop-in for init.scope (e.g.: to set some memory limit),
it will be loaded long after the cgroup has already been realized.
Do it again when creating the special unit.
2023-01-23 21:40:54 +01:00
Lennart Poettering
4453ebe4db build: add some coloring to --version output
Make it easier to discern enabled and disabled build options.
2023-01-23 21:38:51 +01:00
Luca Boccassi
53fd537472
Merge pull request #26157 from medhefgo/meson
meson: Small improvements
2023-01-23 19:41:51 +00:00
Luca Boccassi
deeebc95af
Merge pull request #25805 from yuwata/locale-xkb-save-vconsole
locale: also save X11 keyboard settings to /etc/vconsole.conf
2023-01-23 19:40:12 +00:00
Mike Yuan
e6afd73ba2
machinectl: remove unnecessary initialization 2023-01-24 00:32:33 +08:00
Mike Yuan
d2493703c1
machinectl: also enable machines.target when enabling machines
It's mostly desired to enable machines.target
along with the machine since only when both are
enabled it would really work.
2023-01-24 00:13:23 +08:00
Daan De Meyer
ff1b55ffdf Revert "repart: Ensure files end up owned by root in generated filesystems"
This reverts commit e59678b2cf42e4206ddabc959d3cf9a5a865ecdc.

We also modify the repart integration tests to make them pass with the
changes in this commit. In short, we have to make sure every file is
owned by the user executing repart. We use tee instead of cat since it
makes that easier. This also has the benefit of improving debugability
as seeing the config file contents on stdout makes it easier to know
which test is failing.
2023-01-23 16:33:03 +01:00
Lennart Poettering
782418a166
Merge pull request #25168 from valentindavid/valentindavid/umount-move-recursive-list
shutdown: move busy mounts to not block parent mounts
2023-01-23 15:24:13 +01:00
Daan De Meyer
49fb6e97d2 Revert "repart: Make sure all files in the image are owned by root"
This reverts commit d2ac7698cb43807a2dd0af727599db486180ebf1.
2023-01-23 14:41:33 +01:00
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
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
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
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 da20baaeccbcca78350bf64bdc069dec685c95bc.
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