]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
5 years agotests: add a fuzzer for the json parser and dumper 10316/head
Evgeny Vereshchagin [Wed, 1 Aug 2018 10:25:26 +0000 (10:25 +0000)] 
tests: add a fuzzer for the json parser and dumper

5 years agojson: add test
Lennart Poettering [Wed, 4 Jul 2018 13:42:04 +0000 (15:42 +0200)] 
json: add test

5 years agojson: add a nice JSON parser
Lennart Poettering [Wed, 25 Apr 2018 09:21:59 +0000 (11:21 +0200)] 
json: add a nice JSON parser

As preparation for OCI support in nspawn, let's add a JSON parser.

The json.h file contains an explanation why this is new code instead of
just us linking against an existing JSON library.

5 years agoman: fix typo
Asbjørn Apeland [Wed, 10 Oct 2018 07:13:39 +0000 (09:13 +0200)] 
man: fix typo

5 years agoMerge pull request #10062 from rgushchin/device
Lennart Poettering [Tue, 9 Oct 2018 21:29:27 +0000 (23:29 +0200)] 
Merge pull request #10062 from rgushchin/device

Support cgroup v2 bpf-based device controller

5 years agomeson: we cannot call get_compiler('cpp') if we didn't "add" it
Zbigniew Jędrzejewski-Szmek [Tue, 9 Oct 2018 16:48:09 +0000 (18:48 +0200)] 
meson: we cannot call get_compiler('cpp') if we didn't "add" it

Follow-up for f6d783ac3d145f3f3ffc2023d4ad90f76cf7fe34.

5 years agobpf-firewall: always use log_unit_xyz() insteadof log_xyz()
Lennart Poettering [Tue, 9 Oct 2018 16:45:10 +0000 (18:45 +0200)] 
bpf-firewall: always use log_unit_xyz() insteadof log_xyz()

That way it's easier to figure out what the various messages belong to

5 years agodevice: clean up DeviceFound flags set
Lennart Poettering [Tue, 9 Oct 2018 11:14:04 +0000 (13:14 +0200)] 
device: clean up DeviceFound flags set

No need to avoid bit 0. Also the U suffix has no effect, don't use it.

5 years agocore: add missing 'continue' statement
Lennart Poettering [Tue, 9 Oct 2018 13:33:13 +0000 (15:33 +0200)] 
core: add missing 'continue' statement

5 years agocore: support cgroup v2 device controller 10062/head
Roman Gushchin [Mon, 8 Oct 2018 21:33:05 +0000 (14:33 -0700)] 
core: support cgroup v2 device controller

Cgroup v2 provides the eBPF-based device controller, which isn't currently
supported by systemd. This commit aims to provide such support.

There are no user-visible changes, just the device policy and whitelist
start working if cgroup v2 is used.

5 years agocore: bump mlock ulimit to 64Mb
Roman Gushchin [Thu, 23 Aug 2018 17:46:20 +0000 (10:46 -0700)] 
core: bump mlock ulimit to 64Mb

Bpf programs are charged against memlock ulimit, and the default value
can be too tight on machines with many cgroups and attached bpf programs.

Let's bump it to 64Mb.

5 years agolibbpf.h: add BPF_JMP_A macro
Roman Gushchin [Thu, 23 Aug 2018 17:45:26 +0000 (10:45 -0700)] 
libbpf.h: add BPF_JMP_A macro

Add unconditional jump macro to use in generated bpf programs.

5 years agocore: refactor bpf firewall support into a pseudo-controller
Roman Gushchin [Sun, 30 Sep 2018 10:33:16 +0000 (11:33 +0100)] 
core: refactor bpf firewall support into a pseudo-controller

The idea is to introduce a concept of bpf-based pseudo-controllers
to make adding new bpf-based features easier.

5 years agoMerge pull request #10331 from keszybz/tests-ip6-and-readme
Lennart Poettering [Tue, 9 Oct 2018 16:11:08 +0000 (18:11 +0200)] 
Merge pull request #10331 from keszybz/tests-ip6-and-readme

Test suite fix and README update

5 years agoMore polite passphrase prompt
Marko Myllynen [Tue, 9 Oct 2018 14:13:34 +0000 (17:13 +0300)] 
More polite passphrase prompt

Instead of

Please enter passphrase for disk <disk-name>!

use

Please enter passphrase for disk <disk-name>:

which is more polite and matches Plymouth convention.

5 years agoMerge pull request #10136 from yuwata/run-unit-tests
Zbigniew Jędrzejewski-Szmek [Tue, 9 Oct 2018 13:33:49 +0000 (15:33 +0200)] 
Merge pull request #10136 from yuwata/run-unit-tests

test: run unit tests under containers

5 years agoREADME.testsuite: update the documentation for meson 10331/head
Zbigniew Jędrzejewski-Szmek [Tue, 9 Oct 2018 12:37:00 +0000 (14:37 +0200)] 
README.testsuite: update the documentation for meson

5 years agoMerge pull request #10307 from poettering/portable-path
Zbigniew Jędrzejewski-Szmek [Tue, 9 Oct 2018 12:58:22 +0000 (14:58 +0200)] 
Merge pull request #10307 from poettering/portable-path

finishing touches to portable services, and let's move portablectl to /usr/bin to make it official

5 years agosd-hwdb: update error log a bit
Yu Watanabe [Tue, 9 Oct 2018 10:19:19 +0000 (19:19 +0900)] 
sd-hwdb: update error log a bit

5 years agotree-wide: use CMP() macros where applicable
Yu Watanabe [Tue, 9 Oct 2018 10:50:43 +0000 (19:50 +0900)] 
tree-wide: use CMP() macros where applicable

5 years agohwdb: Map 45 to bookmarks on the ThinkPad L380
Zhang Xianwei [Tue, 9 Oct 2018 10:53:25 +0000 (18:53 +0800)] 
hwdb: Map 45 to bookmarks on the ThinkPad L380

The ThinkPad L380 has a F12(Favorate) key. The keycode 0x45 is mapped
to KEY_FAVORITES(0x16c) in kernel thinkpad_acpi driver, but this
keycode is too big for xorg to handle.
xkeyboard-config mapped KEY_BOOKMARKS to XF86Favorites:

keycodes/evdev:
    <I164> = 164;   // #define KEY_BOOKMARKS           156

symbols/inet:
    key <I164>   {      [ XF86Favorites         ]       };

So map 45 to bookmarks to correct keycode.

Signed-off-by: Zhang Xianwei <zhang.xianwei8@zte.com.cn>
5 years agotest-execute: filter out ip6tnl0@ and ip6gre0@ interfaces
Zbigniew Jędrzejewski-Szmek [Tue, 9 Oct 2018 12:08:09 +0000 (14:08 +0200)] 
test-execute: filter out ip6tnl0@ and ip6gre0@ interfaces

Those interfaces are created automatically when ip6_tunnel and ip6_gre loaded.
They break the test with exec-privatenetwork-yes.service.

C.f. 6b08180ca6f1ceb913f6a69ffcaf96e9818fbdf5.

5 years agotest: add TEST-24-UNIT-TESTS running all basic tests under containers 10136/head
Yu Watanabe [Wed, 19 Sep 2018 05:30:29 +0000 (14:30 +0900)] 
test: add TEST-24-UNIT-TESTS running all basic tests under containers

5 years agotest: do not use global variable to pass error
Yu Watanabe [Fri, 14 Sep 2018 04:25:02 +0000 (13:25 +0900)] 
test: do not use global variable to pass error

5 years agotest: replace duplicated Makefile by symbolic link
Yu Watanabe [Wed, 12 Sep 2018 18:01:42 +0000 (03:01 +0900)] 
test: replace duplicated Makefile by symbolic link

5 years agotest: make install_keymaps() optionally install more keymaps
Yu Watanabe [Wed, 19 Sep 2018 01:54:28 +0000 (10:54 +0900)] 
test: make install_keymaps() optionally install more keymaps

5 years agotest: add paths of keymaps in install_keymaps()
Yu Watanabe [Wed, 19 Sep 2018 01:54:16 +0000 (10:54 +0900)] 
test: add paths of keymaps in install_keymaps()

It seems that the paths of directories storing keymaps are changed.

5 years agotest: introduce install_zoneinfo()
Yu Watanabe [Wed, 12 Sep 2018 09:20:31 +0000 (18:20 +0900)] 
test: introduce install_zoneinfo()

But it is not called by default.

5 years agotest: install libraries required by tests
Yu Watanabe [Wed, 12 Sep 2018 09:19:45 +0000 (18:19 +0900)] 
test: install libraries required by tests

5 years agoMerge pull request #10324 from poettering/audit-serialize-bool
Lennart Poettering [Tue, 9 Oct 2018 09:59:05 +0000 (11:59 +0200)] 
Merge pull request #10324 from poettering/audit-serialize-bool

properly serialize in_audit boolean

5 years agomeson: use same compilers to build fuzzers
Yu Watanabe [Wed, 3 Oct 2018 19:52:44 +0000 (04:52 +0900)] 
meson: use same compilers to build fuzzers

5 years agonspawn: add comments explaining the namespacing situation and the inner/outer children
Lennart Poettering [Thu, 26 Jul 2018 15:26:18 +0000 (17:26 +0200)] 
nspawn: add comments explaining the namespacing situation and the inner/outer children

5 years agoMerge pull request #10323 from keszybz/test-udev-cleanup
Lennart Poettering [Tue, 9 Oct 2018 08:30:35 +0000 (10:30 +0200)] 
Merge pull request #10323 from keszybz/test-udev-cleanup

Small cleanup for test-udev

5 years agoptyfwd: when we can't copy the window size from caller, use $LINES and $COLUMNS
Lennart Poettering [Mon, 30 Jul 2018 18:57:22 +0000 (20:57 +0200)] 
ptyfwd: when we can't copy the window size from caller, use $LINES and $COLUMNS

This way users can directly influence the tty size if they like when
nspawn is invoked as a service and thus stdin/stdout/stderr are not
connected to a TTY.

5 years agocore: introduce systemd.early_core_pattern= kernel cmdline option
Franck Bui [Mon, 8 Oct 2018 14:09:59 +0000 (16:09 +0200)] 
core: introduce systemd.early_core_pattern= kernel cmdline option

Until a core dump handler is installed by systemd-sysctl, the generation of
core dump for services is turned OFF which can make the debugging of the early
boot process harder especially since there's no easy way to restore the core
dump generation.

This patch introduces a new kernel command line option which specifies an
absolute path where the kernel should write the core dump file when an early
process crashes.

This will take effect until systemd-coredump (or any other handlers) takes
over.

5 years agotest-udev: sprinkle (void) and assert_se() as necessary 10323/head
Zbigniew Jędrzejewski-Szmek [Tue, 9 Oct 2018 07:27:26 +0000 (09:27 +0200)] 
test-udev: sprinkle (void) and assert_se() as necessary

CID #996263.

5 years agotest-udev: remove unsatisfiable conditionals
Zbigniew Jędrzejewski-Szmek [Tue, 9 Oct 2018 07:23:52 +0000 (09:23 +0200)] 
test-udev: remove unsatisfiable conditionals

CID #1396013.

5 years agocore: properly serialize "in_audit" per-unit boolean 10324/head
Lennart Poettering [Tue, 9 Oct 2018 08:08:44 +0000 (10:08 +0200)] 
core: properly serialize "in_audit" per-unit boolean

Fixes: #9962
5 years agocore: rearrange conditions in unit_notify() a bit
Lennart Poettering [Tue, 9 Oct 2018 08:05:44 +0000 (10:05 +0200)] 
core: rearrange conditions in unit_notify() a bit

This shouldn't change control flow, with one exception: we won't send
notifications for boot progress to plymouth anymore during reload, which
is something we really shouldn't.

5 years agoterminal-util: extra safety checks when parsing $COLUMNS or $LINES (#10314)
Lennart Poettering [Tue, 9 Oct 2018 07:49:04 +0000 (09:49 +0200)] 
terminal-util: extra safety checks when parsing $COLUMNS or $LINES (#10314)

Let's make sure the integers we parse out are not larger than USHRT_MAX.
This is a good idea as the kernel's TIOCSWINSZ ioctl for sizing
terminals can't take larger values, and we shouldn't risk an overflow.

5 years agomachine: use size_t for array sizes (#10309)
Lennart Poettering [Tue, 9 Oct 2018 07:45:55 +0000 (09:45 +0200)] 
machine: use size_t for array sizes (#10309)

Some uses of n_netif already assumed it had time size_t. Others were a
bit sloppy. Let's clean this up.

5 years agologs-show: make highlight parameter const (#10311)
Lennart Poettering [Tue, 9 Oct 2018 07:43:47 +0000 (09:43 +0200)] 
logs-show: make highlight parameter const (#10311)

5 years agoMerge pull request #10175 from poettering/sd-boot-count-bootctl
Zbigniew Jędrzejewski-Szmek [Mon, 8 Oct 2018 21:14:14 +0000 (23:14 +0200)] 
Merge pull request #10175 from poettering/sd-boot-count-bootctl

the bootctl changes from PR #9437 (the boot counting PR)

5 years agobootctl: include boot entries discovered by the boot loader but not in $BOOT in the... 10175/head
Lennart Poettering [Mon, 25 Jun 2018 19:09:37 +0000 (21:09 +0200)] 
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.

5 years agobootctl: add new verbs for setting the default boot/oneshot entry
Lennart Poettering [Mon, 25 Jun 2018 17:19:09 +0000 (19:19 +0200)] 
bootctl: add new verbs for setting the default boot/oneshot entry

Fixes: #5739 #8574
5 years agoefivars: newer efivarfs sets FS_IMMUTABLE_FL by default, deal with that
Lennart Poettering [Mon, 25 Jun 2018 18:12:00 +0000 (20:12 +0200)] 
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.

5 years agochattr: optionally, return the old flags when updating them
Lennart Poettering [Mon, 25 Jun 2018 18:04:07 +0000 (20:04 +0200)] 
chattr: optionally, return the old flags when updating them

5 years agoefi: allow ESP validity checks to be turned off
Lennart Poettering [Mon, 25 Jun 2018 13:08:24 +0000 (15:08 +0200)] 
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
5 years agoman: various updates to the bootctl man page
Lennart Poettering [Fri, 22 Jun 2018 18:19:27 +0000 (20:19 +0200)] 
man: various updates to the bootctl man page

5 years agoman: document the new --no-pager switch of bootctl
Lennart Poettering [Fri, 22 Jun 2018 18:07:32 +0000 (20:07 +0200)] 
man: document the new --no-pager switch of bootctl

Also, let's move the --help and --version items to the end of the list.

5 years agobootctl: add auto-paging
Lennart Poettering [Fri, 22 Jun 2018 18:03:49 +0000 (20:03 +0200)] 
bootctl: add auto-paging

5 years agobootctl: highlight various title/product fields in output
Lennart Poettering [Fri, 22 Jun 2018 18:00:19 +0000 (20:00 +0200)] 
bootctl: highlight various title/product fields in output

5 years agobootctl: unify the code which we use to show boot loader entries
Lennart Poettering [Fri, 22 Jun 2018 17:57:06 +0000 (19:57 +0200)] 
bootctl: unify the code which we use to show boot loader entries

5 years agobootctl: downgrade to log messages that aren't actually errors
Lennart Poettering [Fri, 22 Jun 2018 17:46:13 +0000 (19:46 +0200)] 
bootctl: downgrade to log messages that aren't actually errors

5 years agobootctl: reword status/list section headers a bit
Lennart Poettering [Fri, 22 Jun 2018 17:39:17 +0000 (19:39 +0200)] 
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.

5 years agobootspec: access EFI variables on on EFI boots
Lennart Poettering [Fri, 22 Jun 2018 17:33:42 +0000 (19:33 +0200)] 
bootspec: access EFI variables on on EFI boots

5 years agobootctl: show 'Default Boot Entry' header only when we found something
Lennart Poettering [Fri, 22 Jun 2018 17:32:49 +0000 (19:32 +0200)] 
bootctl: show 'Default Boot Entry' header only when we found something

5 years agobootspec: it's fine if loader.conf is absent
Lennart Poettering [Fri, 22 Jun 2018 17:31:50 +0000 (19:31 +0200)] 
bootspec: it's fine if loader.conf is absent

We shouldn't generate an error in that case, as the file is optional.

5 years agobootspec: reduce number of functions we export
Lennart Poettering [Fri, 22 Jun 2018 17:30:12 +0000 (19:30 +0200)] 
bootspec: reduce number of functions we export

Let's internalize these four calls as noone else calls them.

5 years agobootspec: remove redundant logging
Lennart Poettering [Fri, 22 Jun 2018 17:26:22 +0000 (19:26 +0200)] 
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.

5 years agotest: shorten test-boot-timestamps a bit
Lennart Poettering [Fri, 22 Jun 2018 17:01:21 +0000 (19:01 +0200)] 
test: shorten test-boot-timestamps a bit

5 years agoefivars: some trivial coding style updates
Lennart Poettering [Fri, 22 Jun 2018 16:49:47 +0000 (18:49 +0200)] 
efivars: some trivial coding style updates

5 years agoefivars: check whether we are booted with EFI before reading/writing to variables
Lennart Poettering [Fri, 22 Jun 2018 16:47:37 +0000 (18:47 +0200)] 
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.

5 years agoefi: detect containers in is_efi_boot()
Lennart Poettering [Fri, 22 Jun 2018 16:40:43 +0000 (18:40 +0200)] 
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.

5 years agobootctl: tiny shortification
Lennart Poettering [Fri, 22 Jun 2018 09:43:13 +0000 (11:43 +0200)] 
bootctl: tiny shortification

5 years agobootctl: let's be paranoid and synchronize the ESP in full after all changes
Lennart Poettering [Fri, 22 Jun 2018 09:36:58 +0000 (11:36 +0200)] 
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.

5 years agoMerge pull request #10262 from keszybz/hibres-disable
Lennart Poettering [Mon, 8 Oct 2018 19:39:54 +0000 (21:39 +0200)] 
Merge pull request #10262 from keszybz/hibres-disable

Switches to disable hibernation and/or resuming

5 years agomount-util: show mount source in failure log message (#10312)
Lennart Poettering [Mon, 8 Oct 2018 18:59:11 +0000 (20:59 +0200)] 
mount-util: show mount source in failure log message (#10312)

5 years agoptyfwd: voidify more calls (#10310)
Lennart Poettering [Mon, 8 Oct 2018 18:53:35 +0000 (20:53 +0200)] 
ptyfwd: voidify more calls (#10310)

5 years agoMerge pull request #10159 from poettering/killall-spree-kernel-thread
Zbigniew Jędrzejewski-Szmek [Mon, 8 Oct 2018 18:12:18 +0000 (20:12 +0200)] 
Merge pull request #10159 from poettering/killall-spree-kernel-thread

killall.c fixes regarding kernel thread detection

5 years agoupdate TODO 10307/head
Lennart Poettering [Mon, 8 Oct 2018 15:33:30 +0000 (17:33 +0200)] 
update TODO

5 years agoportabled: generate a more useful error when invalid image types are attempted to...
Lennart Poettering [Mon, 8 Oct 2018 15:58:34 +0000 (17:58 +0200)] 
portabled: generate a more useful error when invalid image types are attempted to be attached

Fixes: #10095
5 years agosd-bus: add three missing entries from bus-common.c that are listed in the .h file
Lennart Poettering [Mon, 8 Oct 2018 15:58:11 +0000 (17:58 +0200)] 
sd-bus: add three missing entries from bus-common.c that are listed in the .h file

5 years agoportable: move portablectl to /usr/bin
Lennart Poettering [Mon, 8 Oct 2018 15:28:44 +0000 (17:28 +0200)] 
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.

5 years agoportable: create/remove the 'attached' unit file directory when we can
Lennart Poettering [Mon, 8 Oct 2018 15:44:52 +0000 (17:44 +0200)] 
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.

5 years agoman: explain the two search paths in the SYNOPSIS with a header
Lennart Poettering [Mon, 8 Oct 2018 16:46:12 +0000 (18:46 +0200)] 
man: explain the two search paths in the SYNOPSIS with a header

5 years agoman,docs: document the new unit file directory for attached images
Lennart Poettering [Mon, 8 Oct 2018 16:43:14 +0000 (18:43 +0200)] 
man,docs: document the new unit file directory for attached images

5 years agoportable: properly handle if the unit file directory for portable service images...
Lennart Poettering [Mon, 8 Oct 2018 15:25:15 +0000 (17:25 +0200)] 
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".

5 years agoportable: make use of the new unit file path
Lennart Poettering [Mon, 8 Oct 2018 15:24:00 +0000 (17:24 +0200)] 
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.

5 years agopath-lookup: define explicit unit file directory for attached unit files
Lennart Poettering [Mon, 8 Oct 2018 15:22:06 +0000 (17:22 +0200)] 
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.

5 years agopath-lookup: TAKE_PTRify more things
Lennart Poettering [Mon, 8 Oct 2018 14:59:31 +0000 (16:59 +0200)] 
path-lookup: TAKE_PTRify more things

5 years agoMerge pull request #10281 from yuwata/follow-up-10277
Zbigniew Jędrzejewski-Szmek [Mon, 8 Oct 2018 16:42:47 +0000 (18:42 +0200)] 
Merge pull request #10281 from yuwata/follow-up-10277

meson: add more compile tests

5 years agomeson: use c_args in generator scripts (#10289)
Yu Watanabe [Mon, 8 Oct 2018 16:37:06 +0000 (01:37 +0900)] 
meson: use c_args in generator scripts (#10289)

May be useful in some cases.

5 years agonspawn: optionally don't mount a tmpfs over /tmp (#10294)
Lennart Poettering [Mon, 8 Oct 2018 16:32:03 +0000 (18:32 +0200)] 
nspawn: optionally don't mount a tmpfs over /tmp (#10294)

nspawn: optionally, don't mount a tmpfs on /tmp

Fixes: #10260
5 years agomeson: only build src/shared/tests.c if tests are enabled
Michael Olbrich [Sun, 30 Sep 2018 14:08:14 +0000 (16:08 +0200)] 
meson: only build src/shared/tests.c if tests are enabled

It's only needed for tests and leaks build directories into
libsystemd-shared.

5 years agolibsystemd: drop *_unrefp from symbol list
Yu Watanabe [Mon, 1 Oct 2018 19:45:05 +0000 (04:45 +0900)] 
libsystemd: drop *_unrefp from symbol list

Follow-up for 3f608087bd57c4d9134754cdad562fa057a97c9e and
6083c4b763eb3c890396974335a47b880a55cdfd.

5 years agoTODO: remove entry 10262/head
Zbigniew Jędrzejewski-Szmek [Wed, 26 Sep 2018 09:18:25 +0000 (11:18 +0200)] 
TODO: remove entry

Swap on luks works great. Nothing to do here.

5 years agoshared/sleep-config: add switches to kill specific sleep modes
Zbigniew Jędrzejewski-Szmek [Wed, 26 Sep 2018 09:17:36 +0000 (11:17 +0200)] 
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.

5 years agoshared/sleep-config: forbid hibernation if resume= is not configured
Zbigniew Jędrzejewski-Szmek [Wed, 26 Sep 2018 08:15:46 +0000 (10:15 +0200)] 
shared/sleep-config: forbid hibernation if resume= is not configured

5 years agotest-sleep: print function names
Zbigniew Jędrzejewski-Szmek [Wed, 26 Sep 2018 08:15:16 +0000 (10:15 +0200)] 
test-sleep: print function names

5 years agobasic/proc-cmdline: allow parsing of cmdline from a string
Zbigniew Jędrzejewski-Szmek [Wed, 26 Sep 2018 07:29:09 +0000 (09:29 +0200)] 
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.

5 years agoDrop empty lines in proc-cmdline.c
Zbigniew Jędrzejewski-Szmek [Wed, 26 Sep 2018 06:45:25 +0000 (08:45 +0200)] 
Drop empty lines in proc-cmdline.c

5 years agoshared/bootspec: remember the full path to boot entry and use it in logging
Zbigniew Jędrzejewski-Szmek [Wed, 26 Sep 2018 06:35:12 +0000 (08:35 +0200)] 
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.

5 years agoMove logic to find default sd-boot entry from systemctl to shared
Zbigniew Jędrzejewski-Szmek [Wed, 26 Sep 2018 05:45:56 +0000 (07:45 +0200)] 
Move logic to find default sd-boot entry from systemctl to shared

In preparation for use in other places. No functional change.

5 years agohib-res-generator: add "noresume"
Zbigniew Jędrzejewski-Szmek [Wed, 26 Sep 2018 05:31:10 +0000 (07:31 +0200)] 
hib-res-generator: add "noresume"

This is an override parameter, to totally skip dehiberanation.

5 years agohib-res-generator: open logging before emitting the first message
Zbigniew Jędrzejewski-Szmek [Wed, 26 Sep 2018 05:23:03 +0000 (07:23 +0200)] 
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.

5 years agoAdd $SYSTEMD_IN_INITRD=yes|no override for debugging
Zbigniew Jędrzejewski-Szmek [Wed, 26 Sep 2018 05:15:55 +0000 (07:15 +0200)] 
Add $SYSTEMD_IN_INITRD=yes|no override for debugging

5 years agologind: ensure seat0 CanGraphical state is written
Ray Strode [Sat, 6 Oct 2018 10:08:31 +0000 (06:08 -0400)] 
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.

5 years agoMerge pull request #10293 from poettering/cryptsetup-fixes
Yu Watanabe [Sat, 6 Oct 2018 14:35:28 +0000 (23:35 +0900)] 
Merge pull request #10293 from poettering/cryptsetup-fixes

two tiny cryptsetup-generator fixes

5 years agocryptsetup: use PATH_IN_SET() instead of STR_IN_SET() when comparing paths 10293/head
Lennart Poettering [Fri, 5 Oct 2018 20:39:02 +0000 (22:39 +0200)] 
cryptsetup: use PATH_IN_SET() instead of STR_IN_SET() when comparing paths

It's formally more correct.