Yu Watanabe [Sun, 13 Nov 2022 17:52:55 +0000 (02:52 +0900)]
sleep: fix indentation
Yu Watanabe [Sun, 13 Nov 2022 17:49:19 +0000 (02:49 +0900)]
sleep: introduce siphash24_compress_id128()
Also, rename get_battery_identifier() to siphash24_compress_device_sysattr().
This also makes any errors in sd_id128_get_machine() or id128_get_product()
ignored. For the machine ID, the failure should not be significant unless
the file stored in the discharge level is reused by another system, which
is quite unusual. For the product ID, if the firmware provides useless
ID (all zero or all 0xFF), then loading/storing the discharge rate
becomes completely broken, that should be avoided.
Note, now sysattrs are used instead of properties in uevent files, but
both provide the same information, hence no functionality should be
changed.
Yu Watanabe [Sun, 13 Nov 2022 17:46:53 +0000 (02:46 +0900)]
sleep: simplify code a bit
- use device_get_sysattr_int(),
- drop redundant log message.
Yu Watanabe [Sun, 13 Nov 2022 17:44:13 +0000 (02:44 +0900)]
sleep: coding style fixlets
Yu Watanabe [Sun, 13 Nov 2022 17:08:05 +0000 (02:08 +0900)]
sleep: introduce SuspendEstimationSec=
Before v252, HibernateDelaySec= specifies the maximum timespan that the
system in suspend state, and the system hibernate after the timespan.
However, after
96d662fa4c8cab24da57523c5e49e6ef3967fc13, the setting is
repurposed as the default interval to measure battery charge level and
estimate the battery discharging late. And if the system has enough
battery capacity, then the system will stay in suspend state and not
hibernate even if the time passed. See issue #25269.
To keep the backward compatibility, let's introduce another setting
SuspendEstimationSec= for controlling the interval to measure
battery charge level, and make HibernateDelaySec= work as of v251.
This also drops implementation details from the man page.
Fixes #25269.
Yu Watanabe [Sun, 13 Nov 2022 15:09:34 +0000 (00:09 +0900)]
sleep: drop unnecessary temporal vaiable and initialization
Yu Watanabe [Sun, 13 Nov 2022 23:31:09 +0000 (08:31 +0900)]
sleep: fetch_batteries_capacity_by_name() does not return -ENOENT
Yu Watanabe [Sun, 13 Nov 2022 14:59:49 +0000 (23:59 +0900)]
sleep: rename hibernate_delay_sec -> _usec
Lennart Poettering [Thu, 26 Jan 2023 10:51:38 +0000 (11:51 +0100)]
update TODO
Lennart Poettering [Thu, 26 Jan 2023 09:10:20 +0000 (10:10 +0100)]
journald: minor modernizations in kmsg handling code
Nothing earth shattering. Mostly just fixes (and some more careful
checking of the boolean variables we keep)
Lennart Poettering [Thu, 26 Jan 2023 10:19:54 +0000 (11:19 +0100)]
Merge pull request #26198 from poettering/journal-strict-mode
journal: enforce strict ordering only when writing journal files from journald, but not from journal-remote and similar
Zbigniew Jędrzejewski-Szmek [Thu, 26 Jan 2023 09:42:05 +0000 (10:42 +0100)]
github/labeller: fix yaml syntax
Zbigniew Jędrzejewski-Szmek [Wed, 25 Jan 2023 16:41:16 +0000 (17:41 +0100)]
github/labeller: add more match patterns
Lennart Poettering [Thu, 19 Jan 2023 21:45:17 +0000 (22:45 +0100)]
journal: automatically pick up boot ID in journal_file_append_entry()
Let's pick up the boot ID early if unspecified, in
journal_file_append_entry(). This is symmetric to the fact that we
already pick up the monotonic timestamp in journal_file_append_entry()
if unspecified, and given that the monotonic clock is not too useful
without its boot ID it makes a lot of sense to pick them up at the same
time.
There are two relevant callers of journal_file_append_entry() right now:
journald (which leaves the boot ID unspecified) and journal-remote
(there are also some tests, but those don't matter too much). The former
calls it to store new entries in the journal file, the latter for
converting/processing/merging existing ones (where it passes along the
original boot ID). This new code hence only is relevant on the former,
and using the boot ID of the current system is the right choice for live
generated entries.
Note that this effectively changes little, since the lower-level
function journal_file_append_entry_internal() will copy boot ID stored
in the file header into all records if unspecified, and typically that's
the one of the local system. But strictly speaking this is not the right
thing to do, since we actually might end up appending to journal files
from previous boots. (The lower level function is indirectly used by
various tests, where the copying-from-header logic kinda makes sense
since they are detached from any live messages streaming in from the
host after all).
William Roberts [Wed, 25 Jan 2023 19:46:19 +0000 (13:46 -0600)]
sha256: header needs stddef
The sha256 header uses size_t which is within stddef, so add it.
Signed-off-by: William Roberts <william.c.roberts@intel.com>
Lennart Poettering [Wed, 25 Jan 2023 14:05:36 +0000 (15:05 +0100)]
journal: add some line breaks/comments
Lennart Poettering [Thu, 19 Jan 2023 21:45:06 +0000 (22:45 +0100)]
journal-file: make strict order optional
This is a follow-up for
1d8d483f59ffa62974772fb58a8ef4abe88550ec and
makes the strict ordering by realtime clock within each journal file
optional, not mandatory. It then enables it for all journal files
written by journald, but leaves it off on others (for example those
written by journald-remote).
This relaxes the logic behind writing journal files to the status quo
ante for all cases where the journal files are not generated, but are
merged/processed/propagated. Typically when processing journal records
from many files ordering by realtime clock and monotonic clock are
contradictory, and cannot be universally guaranteed as the records are
interleaved. By enforcing strict rules we would thus end up generating
myriads of separate journal files, each with just a few records in them.
Hence, let's losen restrictions again, but continue to enforce them in
journald, i.e. when we original create the journal files locally.
Note that generally there's nothing really wring with having journal
files with non-monotonically ordered entries by realtime clock. Looking
for records will not be deterministic anymore, but that's inherent to a
realtime clock that jumps up and down. So you won't get the "only"
answer, but still *a* answer that is correct if you seek for a realtime
clock.
This also adds similar logic on the monotonic clock, which is also only
enabled when generating journal files locally. This should be harder to
trigger (as journald will generate the messages, and should run with a
stable boot id and monotonic clock), but let's better be safe than
sorry, and refuse on the lower layer what makes no sense, even if it's
unlikely the higher layer will ever generate records that aren't ordered
by their monotonic clock.
Lennart Poettering [Wed, 25 Jan 2023 20:22:07 +0000 (21:22 +0100)]
Merge pull request #26204 from poettering/journal-header-compoung-init
journal: use compound initialization for journal file "Header" structure
Luca Boccassi [Wed, 25 Jan 2023 19:51:24 +0000 (19:51 +0000)]
Merge pull request #26179 from medhefgo/boot-no-gnu-efi
boot: Use size_t/unicode string literals
Daan De Meyer [Wed, 25 Jan 2023 14:56:30 +0000 (15:56 +0100)]
repart: Add roothash to output of all verity siblings
This can be used to match verity partitions together using the repart
JSON output.
Luca Boccassi [Wed, 25 Jan 2023 19:49:00 +0000 (19:49 +0000)]
Merge pull request #26195 from mrc0mmand/update-uapi
basic/linux: update l2tp.h
Luca Boccassi [Wed, 25 Jan 2023 19:48:23 +0000 (19:48 +0000)]
Merge pull request #26192 from mrc0mmand/fix-errno-check
sysupdate: fix errno check
Daan De Meyer [Wed, 25 Jan 2023 08:39:13 +0000 (09:39 +0100)]
test-execute: Skip when /sys is read-only
The test depends on /sys being writable, so let's skip it when /sys
is read-only.
Michael Biebl [Wed, 25 Jan 2023 08:13:37 +0000 (09:13 +0100)]
test: skip firstboot --prompt-keymap check if keymaps are missing
Fixes: #26165
Lennart Poettering [Wed, 25 Jan 2023 18:04:11 +0000 (19:04 +0100)]
Merge pull request #26197 from poettering/journal-file-size-t-fix
journal: some trivial size_t array size fixes
Lennart Poettering [Wed, 25 Jan 2023 17:48:31 +0000 (18:48 +0100)]
journal: use compound initialization for journal file Header structure
Lennart Poettering [Wed, 25 Jan 2023 17:47:05 +0000 (18:47 +0100)]
journal-def: fix type of signature to match the actual field in the Header structure
Jan Janssen [Fri, 9 Dec 2022 10:15:41 +0000 (11:15 +0100)]
boot: Use unicode literals
No changes in behavior.
Jan Janssen [Wed, 25 Jan 2023 14:23:49 +0000 (15:23 +0100)]
boot: Use unsigned for beep counting
Jan Janssen [Fri, 9 Dec 2022 10:13:09 +0000 (11:13 +0100)]
boot: Replace UINTN with size_t
No changes in behavior.
Lennart Poettering [Wed, 25 Jan 2023 10:54:44 +0000 (11:54 +0100)]
dlfcn: add new safe_dclose() helper
Let's allow destructing loaded module handles in our usual way that is
fine with NULL handles, and also returns the NULL handle again.
Frantisek Sumsal [Wed, 25 Jan 2023 12:21:09 +0000 (13:21 +0100)]
partition: fix build with newer linux/btrfs.h uapi header
linux/btrfs.h needs to be included after sys/mount.h, as since [0]
linux/btrfs.h includes linux/fs.h causing build errors:
```
In file included from /usr/include/linux/fs.h:19,
from ../src/basic/linux/btrfs.h:29,
from ../src/partition/growfs.c:6:
/usr/include/sys/mount.h:35:3: error: expected identifier before numeric constant
35 | MS_RDONLY = 1, /* Mount read-only. */
| ^~~~~~~~~
[1222/2169] Compiling C object systemd-creds.p/src_creds_creds.c.o
ninja: build stopped: subcommand failed.
```
See: https://github.com/systemd/systemd/issues/8507
[0] https://github.com/torvalds/linux/commit/
a28135303a669917002f569aecebd5758263e4aa
Frantisek Sumsal [Wed, 25 Jan 2023 11:37:49 +0000 (12:37 +0100)]
basic/linux: update linux uapi headers
IPPROTO_L2TP was moved from linux/l2tp.h to linux/in.h [0], so let's
reflect that change to fix build with newer kernels:
```
In file included from ../src/libsystemd/sd-netlink/netlink-types-genl.c:10:
../src/basic/linux/l2tp.h:16: error: "IPPROTO_L2TP" redefined [-Werror]
16 | #define IPPROTO_L2TP 115
|
In file included from ../src/libsystemd/sd-netlink/netlink-types-genl.c:3:
/usr/include/netinet/in.h:85: note: this is the location of the previous definition
85 | #define IPPROTO_L2TP IPPROTO_L2TP
|
cc1: all warnings being treated as errors
```
When at it, update the rest of the headers we ship as well.
[0] https://github.com/torvalds/linux/commit/
65b32f801bfbc54dc98144a6ec26082b59d131ee
Lennart Poettering [Wed, 25 Jan 2023 13:09:19 +0000 (14:09 +0100)]
journal-file: cast file size to to fixed size type
(We generally avoid using off_t for file sizes/offsets, and instead use
uint64_t to get the same behaviour everywhere. Do so here too.)
Lennart Poettering [Wed, 25 Jan 2023 13:07:50 +0000 (14:07 +0100)]
journal-file: fix type of array counter
Luca Boccassi [Wed, 25 Jan 2023 13:15:13 +0000 (13:15 +0000)]
Merge pull request #26193 from aafeijoo-suse/cryptenroll-unlock-fido2-device-man-and-bash-completion-fix
Add missing --unlock-fido2-device to systemd-cryptenroll man and bash-completion
Antonio Alvarez Feijoo [Wed, 25 Jan 2023 10:58:19 +0000 (11:58 +0100)]
man: add missing --unlock-fido2-device to systemd-cryptenroll
Lennart Poettering [Wed, 25 Jan 2023 10:54:02 +0000 (11:54 +0100)]
update TODO
Antonio Alvarez Feijoo [Wed, 25 Jan 2023 10:53:50 +0000 (11:53 +0100)]
bash-completion: add missing --unlock-fido2-device to systemd-cryptenroll
Yu Watanabe [Wed, 25 Jan 2023 02:26:21 +0000 (11:26 +0900)]
bootctl-status: several follow-ups for unlink command
Follow-ups for
8702496bfb0205764569782a9a2ebd11fd80e5e8.
- add missing error cause in logging,
- add several missing assertions,
- drop an unnecessary initialization,
- make boot_config_find_in() return negative errno if nothing found,
- and several coding style fixlets.
Yu Watanabe [Wed, 25 Jan 2023 02:05:46 +0000 (11:05 +0900)]
bootctl-uki: several follow-ups for inspect_osrel()
Follow-ups for #26124 and #26158.
- use os_release_pretty_name(),
- constify the buffer passed to inspect_osrel(),
- propagate errors in inspect_osrele(), and ignore them in the caller
side,
- and several coding style fixlets.
Frantisek Sumsal [Wed, 25 Jan 2023 10:35:06 +0000 (11:35 +0100)]
coccinelle: skip the empty-to-null transformation on the macro itself
Since the empty_to_null() function was "macrofied", we need to use a bit
of black magic to make Coccinelle avoid running the transformation on
the macro itself.
Follow-up to
ef2409cbde3.
Frantisek Sumsal [Wed, 25 Jan 2023 10:28:46 +0000 (11:28 +0100)]
sysupdate: fix errno check
Luca Boccassi [Tue, 24 Jan 2023 23:09:17 +0000 (23:09 +0000)]
NEWS: update date and location
Zbigniew Jędrzejewski-Szmek [Tue, 24 Jan 2023 21:45:25 +0000 (22:45 +0100)]
shared/efi-loader: fix compilation with !ENABLE_EFI, improve messages
When compiled without ENABLE_EFI, efi_stub_measured() was not defined, so
compilation would fail. But it's not enough to add a stub that returns
-EOPNOTSUPP. We call this function in various places and usually print the error
at warning or error level, so we'd print a confusing message. We also can't add
a stub that always returns 0, because then we'd print a message like "Kernel
stub did not measure", which would be confusing too. Adding special handling for
-EOPNOTSUPP in every caller is also unattractive. So instead efi_stub_measured()
is reworked to log the warning or error internally, and such logging is removed
from the callers, and a stub is added that logs a custom message.
Luca Boccassi [Tue, 24 Jan 2023 23:07:05 +0000 (23:07 +0000)]
Merge pull request #26184 from keszybz/cleanups
Various fixups to recent commits
Luca Boccassi [Tue, 24 Jan 2023 17:18:31 +0000 (17:18 +0000)]
locale: rename new XKB variables to match Debian/Ubuntu's
Debian/Ubuntu use almost the same variables, but without '_'. Given
our usage is new, rename them so that they match and downstream tech
debt can be removed.
Follow-up for https://github.com/systemd/systemd/pull/25805
See:
https://github.com/systemd/systemd/issues/24228
https://github.com/systemd/systemd/pull/25412
Daan De Meyer [Tue, 24 Jan 2023 11:46:41 +0000 (12:46 +0100)]
docs: Update HACKING.md to mention latest mkosi is needed
Let's require users to run mkosi from git so we can fix any issues
forward instead of trying to keep the configs working with older
versions.
Jan Janssen [Tue, 24 Jan 2023 14:14:15 +0000 (15:14 +0100)]
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
Luca Boccassi [Tue, 24 Jan 2023 19:12:36 +0000 (19:12 +0000)]
Update NEWS
Dan Streetman [Tue, 6 Dec 2022 18:07:34 +0000 (13:07 -0500)]
Consolidate various TAKE_* into TAKE_GENERIC(), add TAKE_STRUCT()
Lennart Poettering [Tue, 24 Jan 2023 15:39:02 +0000 (16:39 +0100)]
man: clarify that MESSAGE= should not appear more than once in the same journal entry
One would think this was clear already, but apparently it's not clear
enough, hence let's be more explicit.
Fixes: #26175
Zbigniew Jędrzejewski-Szmek [Tue, 24 Jan 2023 06:58:23 +0000 (07:58 +0100)]
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.
Zbigniew Jędrzejewski-Szmek [Tue, 24 Jan 2023 18:13:29 +0000 (19:13 +0100)]
NEWS: update for v253-rc1
Zbigniew Jędrzejewski-Szmek [Mon, 23 Jan 2023 12:52:28 +0000 (13:52 +0100)]
udevadm: add todo to remind us to remove compat code
https://github.com/systemd/systemd/pull/25145#issuecomment-
1397606521
Zbigniew Jędrzejewski-Szmek [Sun, 22 Jan 2023 17:40:50 +0000 (18:40 +0100)]
man/bootctl: add missing markup
Fixup for
53c368d71ba43da7414ac86c58291a11da05ba84.
Lennart Poettering [Tue, 24 Jan 2023 17:14:05 +0000 (18:14 +0100)]
Merge pull request #26152 from systemd/revert-26143-issue-26142
Revert "Resolves #26142 - Fix list of supported personalities"
Lennart Poettering [Tue, 24 Jan 2023 17:13:45 +0000 (18:13 +0100)]
Merge pull request #26158 from poettering/hostnamed-end-of-support
hostnamed/hostnamectl: support os-release END_OF_SUPPORT= field
Lennart Poettering [Mon, 23 Jan 2023 15:34:07 +0000 (16:34 +0100)]
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.
Yu Watanabe [Tue, 24 Jan 2023 13:59:59 +0000 (22:59 +0900)]
bootctl-uki: several coding style fixlets
Mostly follow-ups for #26082.
Gerd Hoffmann [Fri, 20 Jan 2023 14:40:36 +0000 (15:40 +0100)]
bootctl: kernel-inspect: print os info
Lennart Poettering [Tue, 24 Jan 2023 15:08:09 +0000 (16:08 +0100)]
man: extend Personality= docs a bit
Let's make clear personalities are supported on ARM (as per
https://github.com/systemd/systemd/pull/26152#issuecomment-
1400321944).
Also, clarify that on many archs this functionality is pretty pointless,
i.e. where only a single native arch was ever known.
Lennart Poettering [Mon, 23 Jan 2023 09:11:36 +0000 (10:11 +0100)]
Revert "Resolves #26142 - Fix list of supported personalities"
This reverts commit
fdbbb5ffc04c48e6e1b97ddfff366672c2f8a073.
Lennart Poettering [Mon, 23 Jan 2023 12:24:04 +0000 (13:24 +0100)]
update TODO
Lennart Poettering [Mon, 23 Jan 2023 12:17:21 +0000 (13:17 +0100)]
hostnamectl: show support and among output
Lennart Poettering [Mon, 23 Jan 2023 12:16:52 +0000 (13:16 +0100)]
hostnamed: expose support end timestamp as property on the bus
Lennart Poettering [Mon, 23 Jan 2023 12:16:12 +0000 (13:16 +0100)]
os-util: optionally, return EOL time in os_release_support_ended()
Lennart Poettering [Mon, 23 Jan 2023 12:15:27 +0000 (13:15 +0100)]
os-util: accept SUPPORT_END= with empty string as explicit way to disable concept
Lennart Poettering [Mon, 23 Jan 2023 12:14:26 +0000 (13:14 +0100)]
os-util: when determining support end, don't treat /etc/os-release file as error
Instead, let's just treat it as "field unset".
Lennart Poettering [Mon, 23 Jan 2023 12:12:43 +0000 (13:12 +0100)]
format-table: add new cell type TABLE_TIMESPAN_DAY
This is just like TABLE_TIMESPAN_MSEC, but shows time spans in accuracy
of days.
Lennart Poettering [Mon, 23 Jan 2023 11:29:54 +0000 (12:29 +0100)]
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.
Lennart Poettering [Mon, 23 Jan 2023 11:28:38 +0000 (12:28 +0100)]
tree-wide: unify how we pick OS pretty name to display
Lennart Poettering [Tue, 24 Jan 2023 14:24:24 +0000 (15:24 +0100)]
Merge pull request #26176 from bluca/rc
preparations for rc1
Luca Boccassi [Tue, 24 Jan 2023 13:30:02 +0000 (13:30 +0000)]
docs: update instructions for translation strings
Luca Boccassi [Tue, 24 Jan 2023 12:34:00 +0000 (12:34 +0000)]
docs: drop manual rc PR warning step
it is not automated, yay
Luca Boccassi [Tue, 24 Jan 2023 12:32:15 +0000 (12:32 +0000)]
meson: bump numbers for v253-rc1
Luca Boccassi [Tue, 24 Jan 2023 12:30:25 +0000 (12:30 +0000)]
Update hwdb
Luca Boccassi [Tue, 24 Jan 2023 12:26:34 +0000 (12:26 +0000)]
NEWS: add list of contributors
Daan De Meyer [Tue, 24 Jan 2023 10:52:55 +0000 (11:52 +0100)]
repart: Mention broken XFS protofile format
Mike Yuan [Mon, 23 Jan 2023 17:20:14 +0000 (01:20 +0800)]
machinectl: add --now to start/stop containers when enabling/disabling
Closes #26154
Дамјан Георгиевски [Mon, 23 Jan 2023 23:43:00 +0000 (00:43 +0100)]
man: fix explanation for Credential= match in .link files
.link files are handled by systemd-udevd, not by systemd-networkd,
so fix the man page to say that the Credential= match uses credentials set
on the systemd-udevd.service
Zbigniew Jędrzejewski-Szmek [Tue, 24 Jan 2023 09:20:30 +0000 (10:20 +0100)]
Merge pull request #26167 from ldv-alt/docs-fixes
docs: fix a few relatively trivial issues
Frantisek Sumsal [Tue, 24 Jan 2023 08:49:29 +0000 (08:49 +0000)]
Merge pull request #26164 from mrc0mmand/test-bus-timeout
test: bump the client-side timeout in sd-bus as well
Zbigniew Jędrzejewski-Szmek [Tue, 24 Jan 2023 06:52:36 +0000 (07:52 +0100)]
Merge pull request #26159 from keszybz/capacity-to-crash
Resolve crash in systemd-sleep and other minor fixes
Luca Boccassi [Mon, 23 Jan 2023 23:51:49 +0000 (23:51 +0000)]
Merge pull request #26110 from medhefgo/boot-no-gnu-efi
boot: Stop linking against libefi.a
Dmitry V. Levin [Sun, 15 Jan 2023 08:00:00 +0000 (08:00 +0000)]
docs, man: consistently use comma after "For example"
Luca Boccassi [Mon, 23 Jan 2023 22:52:34 +0000 (22:52 +0000)]
Merge pull request #26162 from YHNdnzj/machinectl-check-target-enabled
machinectl: also enable machines.target when enabling machines
Dmitry V. Levin [Sun, 15 Jan 2023 08:00:00 +0000 (08:00 +0000)]
docs: fix formatting a bit
Dmitry V. Levin [Sun, 15 Jan 2023 08:00:00 +0000 (08:00 +0000)]
docs: fix grammar a bit
Dmitry V. Levin [Sun, 15 Jan 2023 08:00:00 +0000 (08:00 +0000)]
docs: fix a few typos
Callum Farmer [Thu, 12 Jan 2023 19:19:56 +0000 (19:19 +0000)]
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>
Zbigniew Jędrzejewski-Szmek [Mon, 23 Jan 2023 14:50:36 +0000 (15:50 +0100)]
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.
Zbigniew Jędrzejewski-Szmek [Mon, 23 Jan 2023 14:47:58 +0000 (15:47 +0100)]
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.
Zbigniew Jędrzejewski-Szmek [Mon, 23 Jan 2023 14:44:33 +0000 (15:44 +0100)]
test-sleep: add a very simple test that prints battery suspend estimates
Zbigniew Jędrzejewski-Szmek [Mon, 23 Jan 2023 14:43:35 +0000 (15:43 +0100)]
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.
Zbigniew Jędrzejewski-Szmek [Mon, 23 Jan 2023 20:46:55 +0000 (21:46 +0100)]
Merge pull request #26153 from DaanDeMeyer/repart-remove-userns
mkfs-util: Remove user namespace owner => root mapping
Luca Boccassi [Fri, 20 Jan 2023 23:00:38 +0000 (23:00 +0000)]
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.
Lennart Poettering [Mon, 23 Jan 2023 15:23:45 +0000 (16:23 +0100)]
build: add some coloring to --version output
Make it easier to discern enabled and disabled build options.
Luca Boccassi [Mon, 23 Jan 2023 19:41:51 +0000 (19:41 +0000)]
Merge pull request #26157 from medhefgo/meson
meson: Small improvements
Luca Boccassi [Mon, 23 Jan 2023 19:40:12 +0000 (19:40 +0000)]
Merge pull request #25805 from yuwata/locale-xkb-save-vconsole
locale: also save X11 keyboard settings to /etc/vconsole.conf