Commit Graph
56799 Commits
Author SHA1 Message Date
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 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
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
Nishal Kulkarni de0988f9d2 shell-completion: Add completion for oomctl
Added bash and zsh completions for oomctl arguments and commands.

Related To: #22118
2022-03-18 13:41:19 +00:00
Lennart Poettering 7d469b63a1 Merge pull request #22787 from poettering/bootspec-split
shared: split bootspec.c in two
2022-03-18 14:22:07 +01:00
AlexCatze 1a34f913a6 Add HP Elitebook 2760p support (#22766) 2022-03-18 13:45:43 +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 f620a36865 update TODO 2022-03-18 11:59:30 +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 1011935785 docs: add new "sort-key" field to boot loader spec
This allows snippet generators to explicitly order entries: any string
can be set as an entry's "sort key". If set, sd-boot will use it to sort
entries on display.

New logic is hence (ignore the boot counting logic)

  sort-key is set → primary sort key: sort-key (lexicographically increasing order)
                  → secondary sort key: machine-id (also increasing order)
                  → tertiary sort key: version (lexicographically decreasing order!)

  sort-key is not set → primary sort key: entry filename (aka id), lexicographically increasing order)

With this scheme we can order OSes by their names from A-Z but then put
within the same OS still the newest version first. This should clean up
the order to match expectations more.

Based on discussions here:

https://github.com/systemd/systemd/pull/22391#issuecomment-1040092633
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 09d4d60360 doc: mention that setfsuid() is a reason why UIDs >= 2147483648 are icky 2022-03-18 11:54:45 +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 f60b0813ea man/systemd.exec: tweak markup a bit 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
Nishal Kulkarni f1c70ed13d shell-completion: Add completion in bootctl
Added new completion for `--make-machine-id-directory`
provideds 3 options(yes no auto)

Closes: #22308
2022-03-18 09:19:56 +00: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 1219bd4306 Add tests and documentation for all remaining sandboxing in user manager 2022-03-18 10:09:56 +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