Commit Graph

35551 Commits

Author SHA1 Message Date
Lennart Poettering 7fd66f3c3d bootctl: reword status/list section headers a bit
This is really confusing, let's try to clean this up a bit, in
particular as there are two very similar concepts:

1. The boot loaders, i.e. the category you find systemd-boot, the
   Windows and Apple boot loaders in. These may typically be listed in the
   firmware's EFI variables.

2. The boot loader entries, as defined by the Boot Loader Spec. In this
   category you find the various Linux kernels that are installed, i.e.
   the stuff systemd-boot shows on screen. To make things confusing, the
   Windows and Apple boot loaders can appear both as boot loaders and as
   boot loader entries.

This tries to establish the following nomenclature: "boot loaders" and
"boot loader entries" for these two concepts.
2018-10-08 21:40:44 +02:00
Lennart Poettering 9c4a6c1319 bootspec: access EFI variables on on EFI boots 2018-10-08 21:40:44 +02:00
Lennart Poettering a099e0352c bootctl: show 'Default Boot Entry' header only when we found something 2018-10-08 21:40:44 +02:00
Lennart Poettering f91ed3dc81 bootspec: it's fine if loader.conf is absent
We shouldn't generate an error in that case, as the file is optional.
2018-10-08 21:40:44 +02:00
Lennart Poettering 0de2e1fd2e bootspec: reduce number of functions we export
Let's internalize these four calls as noone else calls them.
2018-10-08 21:40:44 +02:00
Lennart Poettering 21f7a622d5 bootspec: remove redundant logging
boot_loader_read_conf(), boot_entries_find(), boot_entries_load_config()
all log their errors internally, hence no need to log a second or third
time about the same error when they return.
2018-10-08 21:40:44 +02:00
Lennart Poettering 36cd739a78 test: shorten test-boot-timestamps a bit 2018-10-08 21:40:44 +02:00
Lennart Poettering e78c250b00 efivars: some trivial coding style updates 2018-10-08 21:40:44 +02:00
Lennart Poettering 337eed30e4 efivars: check whether we are booted with EFI before reading/writing to variables
We do these checks only for the high-level calls as for the low-level
ones it might make sense in some exotic uses to read the host EFI data
from a container or so.
2018-10-08 21:40:44 +02:00
Lennart Poettering bb161cdc24 efi: detect containers in is_efi_boot()
Let's make sure that we never assume we booted up in EFI mode if we are
run in a container.
2018-10-08 21:40:44 +02:00
Lennart Poettering a36b411ea2 bootctl: tiny shortification 2018-10-08 21:40:44 +02:00
Lennart Poettering e0e8d177c8 bootctl: let's be paranoid and synchronize the ESP in full after all changes
We already synchronize all files we write individually, as well as the
directories they are stored in. Let's also synchronize the ESP as a
whole after our work, just in case.
2018-10-08 21:40:44 +02:00
Lennart Poettering 1634ebb54a
Merge pull request #10262 from keszybz/hibres-disable
Switches to disable hibernation and/or resuming
2018-10-08 21:39:54 +02:00
Lennart Poettering 3ccf61268f mount-util: show mount source in failure log message (#10312) 2018-10-08 11:59:11 -07:00
Lennart Poettering 4b3c721234 ptyfwd: voidify more calls (#10310) 2018-10-08 11:53:35 -07:00
Zbigniew Jędrzejewski-Szmek 29abe1664e
Merge pull request #10159 from poettering/killall-spree-kernel-thread
killall.c fixes regarding kernel thread detection
2018-10-08 20:12:18 +02:00
Lennart Poettering 42d0958195 update TODO 2018-10-08 18:49:45 +02:00
Lennart Poettering 787dfb82f5 portabled: generate a more useful error when invalid image types are attempted to be attached
Fixes: #10095
2018-10-08 18:49:45 +02:00
Lennart Poettering b281b12105 sd-bus: add three missing entries from bus-common.c that are listed in the .h file 2018-10-08 18:49:45 +02:00
Lennart Poettering 80f39b81f3 portable: move portablectl to /usr/bin
Let's declare this a supported API. After all feedback I got at
conferences I think we are good to consider this stable now and make it
official API.
2018-10-08 18:49:45 +02:00
Lennart Poettering d09d85a2a0 portable: create/remove the 'attached' unit file directory when we can
Let's not litter the system with this unit directory unnecessarily, and
let's try to create/remove it when necessary.
2018-10-08 18:49:45 +02:00
Lennart Poettering 2ace445da7 man: explain the two search paths in the SYNOPSIS with a header 2018-10-08 18:49:45 +02:00
Lennart Poettering 83f72cd65f man,docs: document the new unit file directory for attached images 2018-10-08 18:49:45 +02:00
Lennart Poettering 339731dba1 portable: properly handle if the unit file directory for portable service images doesn't exist
if the dir doesn#t exist then let's consider this indication for "this
image isn't attached".
2018-10-08 18:49:45 +02:00
Lennart Poettering 40a7b232de portable: make use of the new unit file path
Note that this breaks compatibility with older versions, as the detach
code won't find unit files attached with older releases anymore. But
given that the portable service logic was not deemed stable so far, and
this was explicitly documented and enforced through portablectl's
installation to /usr/lib/systemd/ such a compat breakage should be fine.
2018-10-08 18:49:45 +02:00
Lennart Poettering 0cd4628de9 path-lookup: define explicit unit file directory for attached unit files
Let's separate out the unit files copied from attached portable service
image files from the admin's own files. Let's introduce
/etc/systemd/system.attached/ + /run/systemd/system.attached/ for the
files of portable services, and leave /etc/systemd/system/ and
/run/systemd/system/ for the admin.
2018-10-08 18:49:45 +02:00
Lennart Poettering 61c22b0be6 path-lookup: TAKE_PTRify more things 2018-10-08 18:49:45 +02:00
Zbigniew Jędrzejewski-Szmek ef07c97b0f
Merge pull request #10281 from yuwata/follow-up-10277
meson: add more compile tests
2018-10-08 18:42:47 +02:00
Yu Watanabe 56f56d5ad8 meson: use c_args in generator scripts (#10289)
May be useful in some cases.
2018-10-08 18:37:06 +02:00
Lennart Poettering 1099ceebce nspawn: optionally don't mount a tmpfs over /tmp (#10294)
nspawn: optionally, don't mount a tmpfs on /tmp

Fixes: #10260
2018-10-08 18:32:03 +02:00
Michael Olbrich b9fa9b71c6 meson: only build src/shared/tests.c if tests are enabled
It's only needed for tests and leaks build directories into
libsystemd-shared.
2018-10-08 18:29:36 +02:00
Yu Watanabe aacd352d8c libsystemd: drop *_unrefp from symbol list
Follow-up for 3f608087bd and
6083c4b763.
2018-10-08 18:28:58 +02:00
Zbigniew Jędrzejewski-Szmek 9259d0e23e TODO: remove entry
Swap on luks works great. Nothing to do here.
2018-10-08 18:21:00 +02:00
Zbigniew Jędrzejewski-Szmek e8f1d00d69 shared/sleep-config: add switches to kill specific sleep modes
/etc/systemd/sleep.conf gains four new switches:
AllowSuspend=, AllowHibernation=, AllowSuspendThenHibernate=, AllowHybridSleep=.

Disabling specific modes was already possible by masking suspend.target,
hibernate.target, suspend-then-hibernate.target, or hybrid-sleep.target.
But this is not convenient for distributions, which want to set some defaults
based on what they want to support. Having those available as configuration
makes it easy to put a config file in /usr/lib/systemd/sleep.conf.d/ that
overrides the defaults and gives instructions how to undo that override.
2018-10-08 18:21:00 +02:00
Zbigniew Jędrzejewski-Szmek 5fdf2d51c2 shared/sleep-config: forbid hibernation if resume= is not configured 2018-10-08 18:20:58 +02:00
Zbigniew Jędrzejewski-Szmek edf43e3df7 test-sleep: print function names 2018-10-08 17:05:32 +02:00
Zbigniew Jędrzejewski-Szmek 9a135c084a basic/proc-cmdline: allow parsing of cmdline from a string
Comes with tests.

Also add direct test for $SYSTEMD_PROC_CMDLINE.

In test-proc-cmdline, "true" was masquerading as PROC_CMDLINE_STRIP_RD_PREFIX,
fix that. Also, reorder functions to match call order.
2018-10-08 17:05:19 +02:00
Zbigniew Jędrzejewski-Szmek 1af294fc82 Drop empty lines in proc-cmdline.c 2018-10-08 17:05:18 +02:00
Zbigniew Jędrzejewski-Szmek 2d3bfb6904 shared/bootspec: remember the full path to boot entry and use it in logging
It's much easier to understand what is going on when the full path is
logged.
2018-10-08 17:05:17 +02:00
Zbigniew Jędrzejewski-Szmek 1b20d88987 Move logic to find default sd-boot entry from systemctl to shared
In preparation for use in other places. No functional change.
2018-10-08 16:06:26 +02:00
Zbigniew Jędrzejewski-Szmek e83419d043 hib-res-generator: add "noresume"
This is an override parameter, to totally skip dehiberanation.
2018-10-08 16:06:16 +02:00
Zbigniew Jędrzejewski-Szmek a79858bfd1 hib-res-generator: open logging before emitting the first message
Also add a debug message when we are not in initrd, because it can be
confusing why nothing is happenning.
2018-10-08 16:06:05 +02:00
Zbigniew Jędrzejewski-Szmek 0307ea49c7 Add $SYSTEMD_IN_INITRD=yes|no override for debugging 2018-10-08 16:04:51 +02:00
Ray Strode ad1bf59c67 logind: ensure seat0 CanGraphical state is written
For non-`seat0` seats, attaching a graphics card to a seat can
lead to it getting created. This is because the graphics device
is a "master device" which means that device is a seat-defining
device.

`seat0` may get created, even before the graphics driver is loaded,
though. This is because the graphics driver is loaded
asynchronously at startup, and `seat0` is the primary seat of
system, associated with the system VTs.

When a graphics card is attached to a seat the `CanGraphical`
property on that seat will flip to `true`.

For seats that haven't been created yet (non-`seat0` seats), this
leads to `seat_start` getting called which ultimately causes the
seat to get serialized to `/run/systemd/seats`.

For `seat0`, which is already created, `seat_start` will return
immediately, which means the updated `CanGraphical` state will
never get written to `/run/systemd/seats`.

The end result is that clients querying `sd_seat_can_graphical`
won't get the correct answer for `seat0` in cases where the
graphics device takes a long time to load until some other peice
of seat state is updated.

This commit fixes the problem by calling `seat_save` explicitly
for already running seats at the time a graphics device is
attached.
2018-10-06 16:52:48 +02:00
Yu Watanabe dcf0b8a5be
Merge pull request #10293 from poettering/cryptsetup-fixes
two tiny cryptsetup-generator fixes
2018-10-06 23:35:28 +09:00
Lennart Poettering e3ca6580ae cryptsetup: use PATH_IN_SET() instead of STR_IN_SET() when comparing paths
It's formally more correct.
2018-10-05 22:39:02 +02:00
Lennart Poettering 2abe64666e cryptsetup: don't use %m if there's no error to show
We are not the ones receiving an error here, but the ones generating it,
hence we shouldn't show it with %m, that's just confusing, as it
suggests we received an error from some other call.
2018-10-05 22:37:58 +02:00
Thomas Haller afbae3e9f2 path-util: fix path_simplify() with kill_dots and "."
Previously, together with kill_dots true, patch like
".", "./.", ".//.//" would all return an empty string.

That is wrong. There must be one "." left to reference
the current directory.

Also, the comment with examples was wrong.
2018-10-05 21:41:33 +02:00
Yu Watanabe c250bf671b core/dbus-execute: fix parsing CPUScheduling* and Nice for transient services
Fixes #10290.
2018-10-05 21:41:05 +02:00
Frank Schaefer 14ee72b7d8 * hack around deficiencies in prctl() PR_SET_MM_* 2018-10-05 21:40:41 +02:00