Commit Graph

47515 Commits

Author SHA1 Message Date
Frantisek Sumsal 5310fc624e ci: add the libfido2 dependency for better coverage 2020-10-21 16:28:22 +02:00
Frantisek Sumsal 0273f6e7f2 ci: build with clang-11 as well
The LLVM nightly repositories now have a separate branch for clang-11,
so let's build with it as well.
2020-10-21 16:24:01 +02:00
Frantisek Sumsal f1150eddf6 ci: bump the 'build test' image to Ubuntu Focal 2020-10-21 16:23:59 +02:00
Arian van Putten 429495163c cgtop: Display cpu time in microseonds with --raw
this makes the CPU time easily parseable; which was the goal
of --raw in the first place.

This only triggers if --raw is combined with --cpu=time
2020-10-21 14:29:48 +02:00
Zbigniew Jędrzejewski-Szmek 9d7b11fdc8
Merge pull request #17395 from keszybz/hwdb-drop-quotes
hwdb: drop quotes from XKB_FIXED_*= properties
2020-10-21 11:34:39 +02:00
Lennart Poettering aa5502bb33
Merge pull request #16444 from oniko/luks-detached-header
Add support for detached LUKS header on kernel cmd line
2020-10-21 10:41:11 +02:00
Lennart Poettering af918c4818 test-mountpoint-util: run test in private mount namespace
This creates a private mount namespace for test-mountpint-util, with all
propagation from the host turned off. This gives us the guarantee that
/proc/self/mountinfo remains fixed and constant while we operate,
removing potential races against other unrelated stuff running on the
system that changes the mount table.

Prompted-by: #17050

(I doubt this actually fixes 17050, this is mostly to make sure that we
aren't possibly affected by such races in our test)
2020-10-21 09:18:35 +02:00
Lennart Poettering 0393e6a274
Merge pull request #17407 from keszybz/test-ipcrm
Make test-ipcrm not fail cryptically
2020-10-21 09:04:12 +02:00
Lennart Poettering 141261f127 dhcp-server: make parameter const 2020-10-21 15:02:16 +09:00
Michael Biebl 427103f7a6
Merge pull request #17297 from keszybz/tmpfiles-sysusers-disable-standalone-image
tmpfiles,sysusers: disable --image= support in standalone versions
2020-10-20 23:07:16 +02:00
Zbigniew Jędrzejewski-Szmek bb4febf4c1 test-ipcrm: modernize, skip test on permission errors
I now get:
$ build/test-ipcrm
Failed to enter shared memory directory /dev/shm/multipath: Permission denied
test-ipcrm: No privileges, skipping tests.
2020-10-20 18:06:28 +02:00
Zbigniew Jędrzejewski-Szmek aecdef08be shared/clean-ipc: improve error message a bit
Failed to enter shared memory directory multipath: Permission denied
→
Failed to enter shared memory directory /dev/shm/multipath: Permission denied

When looking at nested directories, we will print only the final two elements
of the path. That is still more useful than just the last component of the
path. To print the full path, we'd have to allocate the string, and since the
error occurs so very rarely, I think the current best-effort approach is
enough.
2020-10-20 18:06:28 +02:00
Zbigniew Jędrzejewski-Szmek 327d8f3ab8 sd-hwdb: reduce variable scope, use periods 2020-10-20 17:23:40 +02:00
Zbigniew Jędrzejewski-Szmek afe87974dd sd-hwdb: allow empty properties
So far we didn't allow empty properties, but it makes sense to do so, for
example to distinguish empty data from lack of data. It also makes it easy to
override properties (back to the empty) value for specific cases.
2020-10-20 17:12:42 +02:00
Дамјан Георгиевски c4b843473a bootctl: add @current/@oneshot/@default targets to set-default/set-oneshot
Using `bootctl set-default @current` will set the default loader entry
to the currently booted entry as read from the `LoaderEntrySelected` EFI
variable.

Also `bootctl set-oneshot @current` will set the oneshot loader entry to
the current booted entry.

Correspondingly `@default` and `@oneshot` can be used to read from the
LoaderEntryDefault and LoaderEntryOneshot EFI variables.
2020-10-20 15:02:58 +02:00
Lennart Poettering 558e5654a5
Merge pull request #17401 from mrc0mmand/sempahore-fixups
semaphore: try to use different keyservers
2020-10-20 15:01:11 +02:00
Lennart Poettering 08d3365677 update TODO 2020-10-20 14:46:55 +02:00
Frantisek Sumsal 9ac47d9261 semaphore: temporarily explicitly use the US image mirror
The UK one contains an incorrectly signed index file, causing the CI to
fail.
2020-10-20 12:39:25 +02:00
Frantisek Sumsal 493c965657 semaphore: try to use different keyservers
Recently the Semaphore CI started to fail pretty much constantly due to
GPG key verification fails. After a quick search this is a pretty common
issue with the Ubuntu keyserver in the last month. To make this,
hopefully, a bit more stable, let's use a few different keyservers in
case some of them fail.
2020-10-20 11:36:40 +02:00
Yu Watanabe fc9e3b8129 udevadm: also support alias .device units to specify devices
Previously, .device units generated by SYSTEMD_ALIAS= udev properties
are not supported to specify devices for e.g. 'udevadm info'.

Before:
```
$ udevadm info sys-subsystem-net-devices-enp0s31f6.device
Unknown device "sys-subsystem-net-devices-enp0s31f6.device": No such device
```

After:
```
$ ./udevadm info sys-subsystem-net-devices-enp0s31f6.device
P: /devices/pci0000:00/0000:00:1f.6/net/enp0s31f6
L: 0
E: DEVPATH=/devices/pci0000:00/0000:00:1f.6/net/enp0s31f6
E: INTERFACE=enp0s31f6
E: IFINDEX=2
E: SUBSYSTEM=net
E: USEC_INITIALIZED=25317523
E: ID_NET_NAMING_SCHEME=v245
(snip)
```
2020-10-20 10:09:01 +02:00
Kai-Chuan Hsieh a5fe8447bf Add ACCEL_LOCATION property for Dell clamshell models 2020-10-20 09:13:55 +02:00
Lennart Poettering 67bd5620f6 util: make size macros unsigned
By making them unsigned comparing them with other sizes is less likely
to trigger compiler warnings regarding signed/unsigned comparisons.
After all sizes (i.e. size_t) are generally assumed to be unsigned, so
these should be too.

Prompted-by: https://github.com/systemd/systemd/pull/17345#issuecomment-709402332
2020-10-20 15:51:48 +09:00
Zbigniew Jędrzejewski-Szmek a136c2cdd8 hwdb: drop quotes from XKB_FIXED_*= properties
The properties are not unquoted by udev, so the quotes effectively became part
of the value.

Even though those properties were added quite a while ago
(086c001e29,
d7d31692bf), they never started being used
(because of issues with having multiple layouts), see
https://gitlab.gnome.org/GNOME/mutter/-/issues/906,
https://bugzilla.gnome.org/show_bug.cgi?id=775681.

Let's remove the quotes while we still can.

From https://bugzilla.gnome.org/show_bug.cgi?id=775681#c7:
> Note to self: the values for XKB_FIXED_LAYOUT and XKB_FIXED_VARIANT are
> quoted, meaning that we need to remove the quotes before passing the values
> from udev_device_get_property_value() to xkb_keymap_new_from_names()
> otherwise the compilation of the keymap fails (please don't ask how I found
> out...)
2020-10-20 08:37:07 +02:00
Yu Watanabe 0ce8a9d6e5
Merge pull request #16939 from Rahix/robust-first-boot-machine-id
Make ConditionFirstBoot safe against power failures
2020-10-20 14:01:41 +09:00
Yu Watanabe 1586d324bd
Merge pull request #17352 from msekletar/ens-names-fix
udev/net_id: don't generate slot based names if multiple devices might claim the same slot
2020-10-20 13:49:29 +09:00
Felix Riemann 1eee15c388 update-done: Do not fail with read-only /etc or /var
With the switch from log_debug() to log_debug_errno() in commit c413bb28df
systemd-update-done would fail without any error message if /etc
or /var were read-only. This restores the previous behaviour to
silently ignore these directories again.
2020-10-20 13:46:36 +09:00
Yu Watanabe 4b28e50f9e
Merge pull request #17390 from keszybz/logind-notifications-and-links
Fix sd_notify() usage in various daemons and update some documentation links
2020-10-20 13:44:52 +09:00
Michal Sekletár 2c8ec0095e udev/net_id: don't generate slot based names if multiple devices might claim the same slot 2020-10-19 17:55:44 +02:00
Lennart Poettering 43e7dd70bc
Merge pull request #17344 from keszybz/bus-connect-more-logs
Add some debug logs to help diagnose bus connections
2020-10-19 17:39:37 +02:00
Lennart Poettering 115fae8a07
Merge pull request #17387 from anitazha/systoomd_fixups
oomd fixups
2020-10-19 17:29:22 +02:00
Lennart Poettering f105d29b47
Merge pull request #17389 from poettering/bootspec-clarifications
bootspec entry character set clarifications
2020-10-19 17:17:10 +02:00
Harald Seiler a48627ef87 man: Document new machine-id and first boot behavior 2020-10-19 16:28:22 +02:00
Harald Seiler 3af54f9bbe units: order systemd-random-seed.service before first-boot-complete.target
Ensure that systemd-random-seed.service has completed before marking
a first boot as completed to guarantee that a saved seed will only be
used after it has been initialized at least once.
2020-10-19 16:28:22 +02:00
Harald Seiler a1e3787148 units: order systemd-firstboot.service before first-boot-complete.target
Make sure systemd-firstboot completes before reaching first-boot-complete.target
and thus marking the first boot as completed.  This way, it is
guaranteed that systemd-firstboot has a chance to complete provisioning
at least once, even in cases of the first boot getting aborted early.
2020-10-19 16:28:22 +02:00
Harald Seiler f4466bdbf9 units: add first-boot-complete.target for first boot ordering
Add a new target for synchronizing units that wish to run once during
the first boot of the system.  The machine-id will be committed to disk
only after the target has been reached, thus ensuring that all units
ordered before it had a chance to complete.
2020-10-19 16:28:22 +02:00
Harald Seiler c261a5d014 machine-id-setup: sync before committing machine-id
sync() before committing a transient machine-id to disk.  This will
ensure that any filesystem changes made by first-boot units will have
been persisted before the first boot is marked as completed.
2020-10-19 16:28:22 +02:00
Harald Seiler 3023f2fead core: keep machine-id transient until first boot completes
Currently, a loss of power after the machine-id was written but before
all units with ConditionFirstBoot=yes ran would lead to the next boot
finding a valid machine-id, thus not being marked first boot and not
re-running these units.

To make the first boot mechanism more robust, instead of writing
/etc/machine-id very early, fill it with a marker value "uninitialized"
and overmount it with a transiently provisioned machine-id.  Then, after
the first boots completes (when systemd-machine-id-commit.service runs),
write the real machine-id to disk.

This mechanism is of course only invoked on first boot.  If a first boot
is not detected, the machine-id is handled as previously.

Fixes: #4511
2020-10-19 16:28:22 +02:00
Harald Seiler ab763cb2be dissect-image: support "uninitialized" machine-id
If the first boot was aborted, /etc/machine-id might read as
"uninitialized" in some cases.  Add a separate case for this
instead of printing a confusing error message.
2020-10-19 16:28:22 +02:00
Harald Seiler 448b782cb2 repart: correctly handle "uninitialized" machine-id
When systemd-repart runs from initramfs, it reads out /etc/machine-id
from the rootfs as a seed for partition UUIDs.  However, the machine-id
could be in an "uninitialized" state from a previous failed first boot.
In this situation the -ENOMEDIUM code-path (no machine-id set) should be
taken.
2020-10-19 16:28:21 +02:00
Harald Seiler c5fbeedb0c nspawn: robustly deal with "uninitialized" machine-id
When nspawn starts an image, this image could be in any state, including
an aborted first boot.  For this case, it needs to correctly handle the
situation like there was no machine-id at all.
2020-10-19 16:28:21 +02:00
Harald Seiler 8085114828 id128: add format which treats "uninitialized" like an empty id
Add a new ID128_PLAIN_OR_UNINIT format which treats the string
"uninitialized" like the file was empty and return -ENOMEDIUM.  This
format should be used when reading an /etc/machine-id file from an image
that is not currently running.
2020-10-19 16:28:21 +02:00
Lennart Poettering cf33b70765 docs: some coding style updates
Primarily:

1. Mention that we prefer if return parameters carry "ret_" as prefix in
   their name

2. Clarify that debug-level logging is always OK, and irrelevant to when
   deciding whether a function is logging or non-logging.
2020-10-19 15:30:11 +02:00
Zbigniew Jędrzejewski-Szmek 515736d0f3 tree-wide: update web link to logind description
https://www.freedesktop.org/wiki/Software/systemd/multiseat/ says that it
is obsoleted by sd-login(3), so it doesn't make much sense to link to the former.
2020-10-19 15:23:37 +02:00
Zbigniew Jędrzejewski-Szmek 6c75e31703 logind: minor indentation adjustments 2020-10-19 15:23:37 +02:00
Zbigniew Jędrzejewski-Szmek 21fe744cfb logind: use notify_start/notify_on_cleanup
Logging about the pid is dropped, pid1 does that better.
2020-10-19 15:23:37 +02:00
Zbigniew Jędrzejewski-Szmek 297fc20dc4 shared/daemon-util: fix notify_on_cleanup()
p itself is never null. Because of this, we would always
call sd_notify() in cleanup, even though the intention was to only
call it if notify_start() was executed.
2020-10-19 15:23:37 +02:00
Lennart Poettering 6008336ffa tmpfiles: no need to specify a synthetic error code if we don't propagate it 2020-10-19 14:22:25 +02:00
Lennart Poettering dfc22cb472 bootspec: tweak error message
Clarify that the name of the entry failed validation, not the entry
itself.
2020-10-19 14:22:25 +02:00
Lennart Poettering d9067aba40 doc: document charset to use for bootspec entry names
Prompted-by: https://github.com/systemd/systemd/issues/12572#issuecomment-711074702
2020-10-19 14:22:12 +02:00
Harald Seiler 583cef3b73 core: treat "uninitialized" in /etc/machine-id as first boot as well
When /etc/machine-id contains the string "uninitialized" instead of
a valid machine-id, treat this like the file was missing and mark this
boot as the first (-> units with ConditionFirstBoot=yes will run).
2020-10-19 12:33:39 +02:00