Lennart Poettering
1aa7ca2241
timesyncd: add debug logging in case we can't touch /run/systemd/timesync/synchronized
2022-03-18 23:54:01 +01:00
Lennart Poettering
1f129b7fb7
timesyncd: when updating timestamp file, use best time we know, instead of system clock
...
We adjust the system clock slowly after all, even if we know a more
accurate time. Use the accurate time for the timestamp.
2022-03-18 23:53:58 +01:00
Lennart Poettering
87057128e6
timesyncd: rename bool 'good' → 'talking'
...
THe name is just too generic. Let's pick a name that makes clear that
this is about successful communication.
2022-03-18 23:53:54 +01:00
Lennart Poettering
20c1a21066
timesyncd: don't abort packet handling if we can't save the timestamp to disk
...
This should not be a fatal error, and it isn't in the other place we
call this.
2022-03-18 23:53:50 +01:00
Lennart Poettering
ec75e8e07a
sd-event: add a single implementation of an event source that runs on clock changes
...
We basically had the same code in three places. Let's unify it in a
common helper function.
event_add_time_change() might be something we should add to the official
sd-event API sooner or later, given its general usefulness.
2022-03-18 23:53:34 +01:00
Lennart Poettering
7cb08ea80f
timesyncd: move stuff that is not about setting the clock out of manager_adjust_clock()
...
Let's make sure manager_adjust_clock() is purely about setting the
clock, and nothing else.
Let's clean up logging this way. manager_adjust_clock() now won#t log
about errors, but the caller can safely do that, and do with the right
log message string.
2022-03-18 23:53:31 +01:00
Lennart Poettering
adc07c2bf5
timesyncd: use CMSG_FIND_DATA() macro where appropriate
2022-03-18 23:53:27 +01:00
Lennart Poettering
5ba674cca5
timesyncd: merge some variable declarations
2022-03-18 23:53:24 +01:00
Lennart Poettering
9a8b43021b
timesyncd: rebreak some comments
2022-03-18 23:53:20 +01:00
Lennart Poettering
0fd08026f8
timesyncd: add comment what bool arg is
2022-03-18 23:53:17 +01:00
Lennart Poettering
853efc39ea
timesyncd: make a constant structure actually static/const
2022-03-18 23:53:13 +01:00
Lennart Poettering
c696878ac0
timesyncd: cast some function invocations to void
2022-03-18 23:53:09 +01:00
Lennart Poettering
aabda4f3e0
timesyncd: get rid of unnecessary 'r' assignments
2022-03-18 23:53:06 +01:00
Lennart Poettering
40c6b5143b
timesyncd: use structured initialization more
2022-03-18 23:52:36 +01:00
Zbigniew Jędrzejewski-Szmek
40f35786b0
various: make parse_env_file error handling the same in various places
...
No big reason to do this, except that I was looking at all call sites
and it's nicer if the same style is used accross the codebase.
2022-03-18 23:26:59 +01:00
Jan Janssen
592d576552
boot: Draw unicode separator line for status messages
2022-03-18 19:33:13 +01:00
Zbigniew Jędrzejewski-Szmek
62a4b584bb
sd-boot+bootctl: invert order of entries w/o sort-key
...
With the changes in 20ec8f534f , we would sort
entries with sort-key as expected (higher versions earlier, i.e. at the top of
the menu), but entries without the sort-key as before, with higher versions
later.
When we have a bunch of boot entries grouped by machine-id (or even in the
typical case of all boot entries having the same machine id), sorting by id
should generally give good results. Entries will be grouped by installation,
and then newer entries should generally be at the top of the menu.
2022-03-18 19:11:59 +01:00
Zbigniew Jędrzejewski-Szmek
5f1077af1e
Merge pull request #22519 from poettering/boot-order-title-revert
...
sd-boot: rework boot entry sorting
2022-03-18 19:04:48 +01:00
Zbigniew Jędrzejewski-Szmek
523487f713
efi: use CMP() more
2022-03-18 19:00:10 +01:00
Zbigniew Jędrzejewski-Szmek
9817b7dbc9
shared/bootspec: reduce scope of variables
2022-03-18 18:49:07 +01:00
Yu Watanabe
d0b4f13ef8
strv: use STRV_FOREACH() at two more places
2022-03-18 18:38:08 +01:00
Yu Watanabe
9eb814818d
strv: rewrite strv_copy() with cleanup attribute and STRV_FOREACH()
2022-03-18 18:36:48 +01:00
Lennart Poettering
52bb308c13
time-util: add macros around timespec_store() that operates on compund literal allocated timespec struct
...
This way we can convert usec_t to timespec on-the-fly, without a buffer.
No actual behaviour change just some shortening of code.
2022-03-18 17:13:36 +01:00
Lennart Poettering
b7df2c78ea
meson: sort shared source file list again
2022-03-18 12:01:45 +01:00
Lennart Poettering
e94830c0a1
shared: split out ESP/XBOOTLDR search stuff from bootspec.c
...
The code is quite different from the rest of bootspec.c, with different
deps and stuff. There's even a /***/ line to separate the two parts.
Given how large the file already is, let#s just split it into two.
No code changes, just some splitting out.
2022-03-18 12:01:45 +01:00
Lennart Poettering
1fe368e526
test: add test that verifies correct order of boot entries
2022-03-18 11:59:30 +01:00
Lennart Poettering
d23b3bfdd6
kernel-install: automatically generate "sort-key" field
...
Let's order by IMAGE_ID=/ID= by default.
2022-03-18 11:59:30 +01:00
Lennart Poettering
cf5d9598b6
sd-boot: add comments highlighting type 1 vs. type 2
2022-03-18 11:59:30 +01:00
Lennart Poettering
20ec8f534f
sd-boot: make use of new "sort-key" boot loader spec field
2022-03-18 11:59:30 +01:00
Lennart Poettering
f65a33269e
Revert "boot: Change boot entry sorting"
...
This reverts commit 9818ec8ea5 .
2022-03-18 11:59:30 +01:00
Lennart Poettering
af5ee76c56
Merge pull request #22784 from poettering/bootctl-fixlets
...
Trivial bootctl/kernel-install fixlets
2022-03-18 11:53:08 +01:00
Zbigniew Jędrzejewski-Szmek
23484e1205
systemctl: fix operations on relative paths
...
We should treat ./some.service and $PWD/some.service as equivalent. But we'd
try to send the relative paths over dbus, which can't work well:
$ sudo systemctl enable ./test2.service
Failed to look up unit file state: Invalid argument
$ sudo systemctl enable $PWD/test2.service
Created symlink /etc/systemd/system/multi-user.target.wants/test2.service → /home/zbyszek/src/systemd/test2.service.
Created symlink /etc/systemd/system/test2.service → /home/zbyszek/src/systemd/test2.service.
Now both are equivalent.
2022-03-18 10:22:20 +01:00
Zbigniew Jędrzejewski-Szmek
2cdd6bef9c
shared/install-printf: drop now-unused install_path_printf()
2022-03-18 10:22:20 +01:00
Zbigniew Jędrzejewski-Szmek
46801e7647
shared/install: do not print aliases longer than UNIT_NAME_MAX
...
0653649202 did the conversion to install_path_printf().
But IIUC, here we are just looking at a unit file name, not the full
path.
2022-03-18 10:22:20 +01:00
Zbigniew Jędrzejewski-Szmek
09f5fc66f2
basic/env-file: inline one variable declaration
2022-03-18 10:22:20 +01:00
Zbigniew Jędrzejewski-Szmek
20afd9a184
systemctl: remove unused parameter
2022-03-18 10:22:20 +01:00
Zbigniew Jędrzejewski-Szmek
4f5160698e
systemctl: drop left-over parens
2022-03-18 10:22:20 +01:00
Zbigniew Jędrzejewski-Szmek
4f5c24857b
shared/install: adjust comment formatting
2022-03-18 10:22:20 +01:00
Zbigniew Jędrzejewski-Szmek
d29cc4d6e1
tree-wide: use strv_contains() in more places
2022-03-18 10:22:20 +01:00
Zbigniew Jędrzejewski-Szmek
d3e85c9c81
shared/install: drop unnecessary casts
...
The compiler coerces to bool for us, no need to do it explicitly.
2022-03-18 10:22:20 +01:00
Zbigniew Jędrzejewski-Szmek
066931818d
shared/install: drop unnecessary parentheses
2022-03-18 10:22:20 +01:00
Zbigniew Jędrzejewski-Szmek
c3e7fba07c
shared/install: consistently use 'lp' as the name for the LookupPaths instance
...
Most of the codebase does this. Here we were using 'p' or 'paths'
instead. Those names are very generic and not good for a "global-like"
object like the LookupPaths instance. And we also have 'path' variable,
and it's confusing to have 'path' and 'paths' in the same function that
are unrelated.
Also pass down LookupPaths* lower in the call stack, in preparation for
future changes.
2022-03-18 10:11:37 +01:00
Luca Boccassi
4355c04fef
core: insist on sandboxing if ExtensionImages/Directories are configured
...
Same as other image mounting in the namespace
2022-03-18 10:02:47 +01:00
Yu Watanabe
827f865063
sd-device: shorten code a bit
2022-03-18 09:57:24 +01:00
Yu Watanabe
29e6f70b8d
sd-device-enumerator: fix typo: contolC -> controlC
...
Also shorten code a bit.
2022-03-18 09:43:09 +01:00
Yu Watanabe
f79856d9e8
sort-util: add missing parens
...
With this, we can call e.g.
```
typesafe_qsort(buf + m, n - m, comp);
```
2022-03-18 09:42:38 +01:00
Lennart Poettering
8d3e0d607e
bootctl: add comment, explaining when verb_install() is called
2022-03-18 09:30:29 +01:00
Lennart Poettering
d16da79ec0
bootctl: use faccessat() more
2022-03-18 09:30:25 +01:00
Lennart Poettering
1c2b617703
bootctl: fix typo
2022-03-18 09:30:21 +01:00
Lennart Poettering
acbb4d7ec4
kernel-install: drop spurious double empty line
2022-03-18 09:30:17 +01:00