Commit Graph

35564 Commits

Author SHA1 Message Date
Lennart Poettering 38b581bc05 logs-show: make highlight parameter const (#10311) 2018-10-09 16:43:47 +09:00
Zbigniew Jędrzejewski-Szmek 304d6b1886
Merge pull request #10175 from poettering/sd-boot-count-bootctl
the bootctl changes from PR #9437 (the boot counting PR)
2018-10-08 23:14:14 +02:00
Lennart Poettering bd2865caf6 bootctl: include boot entries discovered by the boot loader but not in $BOOT in the "list" output
Let's use the new LoaderEntries efi var for this, and show all entries
we couldn't find via the config snippets.
2018-10-08 21:40:44 +02:00
Lennart Poettering d88c96ffe5 bootctl: add new verbs for setting the default boot/oneshot entry
Fixes: #5739 #8574
2018-10-08 21:40:44 +02:00
Lennart Poettering 2c3bf2789a efivars: newer efivarfs sets FS_IMMUTABLE_FL by default, deal with that
On EFI variables that aren't whitelisted in the kernel the
FS_IMMUTABLE_FL is set, as protection against accidental
removal/modification. Since our own variables do not appear in those
whielists, and we are not changing these variables, let's unset the flag
temporarily when needed. We restore the flag after all writes, just in
case.
2018-10-08 21:40:44 +02:00
Lennart Poettering db9a42545a chattr: optionally, return the old flags when updating them 2018-10-08 21:40:44 +02:00
Lennart Poettering 8cbb7d8783 efi: allow ESP validity checks to be turned off
let's add an env var for this, as this really shouldn't be a top-level
feature, as it turning off the validity checks certainly isn't
advisable.

Fixes: #4925
2018-10-08 21:40:44 +02:00
Lennart Poettering 4eb5636b6c man: various updates to the bootctl man page 2018-10-08 21:40:44 +02:00
Lennart Poettering dcb4fe7401 man: document the new --no-pager switch of bootctl
Also, let's move the --help and --version items to the end of the list.
2018-10-08 21:40:44 +02:00
Lennart Poettering 57db6f18d4 bootctl: add auto-paging 2018-10-08 21:40:44 +02:00
Lennart Poettering ba85725324 bootctl: highlight various title/product fields in output 2018-10-08 21:40:44 +02:00
Lennart Poettering 20a28174c5 bootctl: unify the code which we use to show boot loader entries 2018-10-08 21:40:44 +02:00
Lennart Poettering 48184e4391 bootctl: downgrade to log messages that aren't actually errors 2018-10-08 21:40:44 +02:00
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