Commit graph

34924 commits

Author SHA1 Message Date
Yu Watanabe f24648a66c network: move and rename link_duid() 2018-08-08 10:15:00 +09:00
Yu Watanabe 27eba50e76 sd-dhcp: use application specific machine ID when DUIDType=uuid but DUIDRawData= is not set 2018-08-08 10:15:00 +09:00
Yu Watanabe 21e627daa5 hostname: expose product UUID on bus 2018-08-08 10:15:00 +09:00
Thomas Haller cc2ff878fa link: fix type for link-config's "features" array of tristates
The "features" fields is parsed as a tristate value. The values
are thus not of type NetDevFeature enum but int. The NetDevFeature
enum is instead the index for the features array.

Adjust the type. In practice, this had no impact because NetDevFeature
enum commonly has size of int.

Also, don't use memset() 0xFF to initilize the int with -1. While
it works correctly in practice, it feels ugly.
2018-08-07 15:40:39 +02:00
Yu Watanabe ef6e83f02b test: cast values in proper type to suppress warnings
Follow-up for #9789.
2018-08-07 15:40:16 +02:00
Lennart Poettering 91f4424012
Merge pull request #9817 from yuwata/shorten-error-logging
tree-wide: Shorten error logging and several code cleanups
2018-08-07 10:44:44 +02:00
Lennart Poettering 6f663594bc
Merge pull request #9744 from yuwata/fix-9737
Make RootImage= work with PrivateDevices=
2018-08-07 09:55:07 +02:00
Michael 'pbone' Pobega fc0bb34db3 hwdb: redefine Lenovo ThinkPad X140e touchpad dimensions (#9818)
The default setup for the Lenovo ThinkPad X140e is 104x104mm, and the kernel
claims that it's 64x21. The default 104x104mm dimensions causes the vertical
axis to act oddly, causing random vertical jitters and higher vertical
sensitivity.

Measuring it showed that it was 74x32, and these touchpad dimensions provide
a better (if a little bit slower) experience but a consistent sensitivity
in all directions.

These values were obtained using the `touchpad-edge-detector` tool.
2018-08-07 17:41:49 +10:00
Lennart Poettering 2ed7449fcb
Merge pull request #9789 from filbranden/cmp1
Add new CMP(a, b) macro
2018-08-07 09:39:26 +02:00
Filipe Brandenburger adb6cd9be2 systemctl: add support for --wait to is-system-running
This makes it possible to wait until boot is finished without having to poll
for this command repeatedly, instead using the syntax:

  $ systemctl is-system-running --wait

Waiting is implemented by waiting for the StartupFinished signal to be posted
on the bus.

Register the matcher before checking for the property to avoid race conditions.

Tested by artificially delaying startup with a oneshot service and calling this
command, checked that it emitted `running` and exited with a 0 return code as
soon as the delay service completed startup.

Also tested that booting to degraded state unblocks the command.

Inserted a delay between getting the property and waiting for the signal and
confirmed this seems to work free of race conditions.

Updated the --help text (under --wait) and the man page to document the new
feature.
2018-08-07 09:33:25 +02:00
Yu Watanabe fc95c359f6 tree-wide: use returned value from log_*_errno() 2018-08-07 15:48:37 +09:00
Filipe Brandenburger b994fe95a1 dns-domain: use CMP() in dns_name_compare_func 2018-08-06 19:26:44 -07:00
Filipe Brandenburger 53c5797fbd resolve: use CMP() in dns_resource_record_compare_func
This function doesn't really implement ordering, but CMP() is still fine to use
there. Keep the comment in place, just update it slightly to indicate that.
2018-08-06 19:26:44 -07:00
Filipe Brandenburger a0edd02e43 tree-wide: Convert compare_func's to use CMP() macro wherever possible.
Looked for definitions of functions using the *_compare_func() suffix.

Tested:
- Unit tests passed (ninja -C build/ test)
- Installed this build and booted with it.
2018-08-06 19:26:35 -07:00
Filipe Brandenburger 26cdf3e50b network: Use CMP() macro for comparison.
Follow up for PRs #9764 and #9760.
2018-08-06 19:19:12 -07:00
Filipe Brandenburger 84fb2131d0 macros: add CMP(a, b) macro.
Macro returns -1, 0, 1 depending on whether a < b, a == b or a > b.

It's safe to use on unsigned types.

Add tests to confirm corner cases are properly covered.
2018-08-06 19:19:05 -07:00
Filipe Brandenburger 117efe065a macro: drop __extension__, reformat and reindent
Drop __extension__, since we don't use gcc -Wpedantic or -ansi.

Reformat code for spacing. Add spaces after commas almost everywhere.
Reindent code blocks in macro definitions, for consistency.
2018-08-06 19:15:02 -07:00
Yu Watanabe 4ae25393f3 tree-wide: shorten error logging a bit
Continuation of 4027f96aa0.
2018-08-07 10:14:33 +09:00
Yu Watanabe 906119c046 resolve: use _cleanup_ attribute 2018-08-07 10:13:44 +09:00
Yu Watanabe 354f62cf3c machine: use free_and_replace() and TAKE_PTR() 2018-08-07 10:11:56 +09:00
Yu Watanabe fb2367edd9 login: use free_and_replace() and TAKE_PTR() 2018-08-07 10:10:12 +09:00
Yu Watanabe 73e47c42ab initctl: do not ignore errors in function 2018-08-07 10:06:49 +09:00
Lennart Poettering 4027f96aa0 machinectl: shorten error logging a bit 2018-08-07 08:58:36 +09:00
Shawn Landden 6a5558491b sd-bus: fix test cases on host handling 2018-08-06 14:30:53 -07:00
Zbigniew Jędrzejewski-Szmek 8a0c1913e0 test-bus-address: a simple test for address parsing 2018-08-06 14:30:53 -07:00
Shawn Landden 2e6fe09002 man/sd_bus_default: update to reflect changes 2018-08-06 14:30:53 -07:00
Shawn Landden 19df1528fc stdio-bridge: support --machine
--machine hasn't been supported since 798c486
Closes: #8116
2018-08-06 14:30:53 -07:00
Shawn Landden b85b4a70d7 sd-bus rework host handling
--machine has been missing for a while in systemd-stdio-bridge
this syntax can be switched to be more standard.

v2: Support the old syntax too.

timedatectl -H server1.myhostingcompany.com:5555/container1

Closes: #8071
2018-08-06 14:30:53 -07:00
Shawn Landden 026df70eaf man: update to reflect changes in -H HOST parsing 2018-08-06 14:29:46 -07:00
Lennart Poettering ac93390b03 random-seed: read the full seed file, even if it is larger than 512 byte
Previously, we'd only ever read 512 byte from the random seed file,
under the assumption we won't need more. With this change we'll read the
full file, even if it is larger.

The idea behind htis change is that people can dump additional data into the
random seed file offline if they like, and it can be low quality, and
we'll seed the pool with it anyway. Moreover, if people are paranoid and
want us to save/restore a bigger seed, it's easy to do: just truncate
the file to the right size and we'll save/restore as much in the future.

This also reworks the file a bit, introducing two clear if blocks that
load and that save the random seed, and that each are conditionalized
more carefully.
2018-08-06 21:21:51 +02:00
Lennart Poettering 5d00545a6e test-resolved: fix whitespace issue 2018-08-06 21:16:31 +02:00
Lennart Poettering 6fb93e10cf test-resolved: add one more assert_se() check 2018-08-06 21:16:31 +02:00
Franck Bui 0ec113366d smack-util: use 'path' paremeter as is if it's already absolute in mac_smack_fix_at() 2018-08-06 20:25:56 +02:00
Kirill Marinushkin 02be0ccad2 analyze: fix condition for pretty printing kernel time
On target boards without RTC, `t->kernel_time` is 0 or 1 usec.
`systemd-analyze` reads this value over D-Bus from
`org.freedesktop.systemd1.Manager`, property `KernelTimestamp`.

The issue is: if `t->kernel_time` is 0, `systemd-analyze` does not print
the kernel time:

~~~~
$ systemd-analyze
Startup finished in 1.860s (userspace) = 5.957s
~~~~

This commit fixes the misbehaviour:

~~~~
$ systemd-analyze
Startup finished in 3.866s (kernel) + 2.015s (userspace) = 5.881s
~~~~

Fixes #7721.

v2: fixes one more condition (by Yu Watanabe <watanabe.yu+github@gmail.com>)
v3: fixes one more condition (by Kirill Marinushkin <kmarinushkin@de.adit-jv.com>)
2018-08-06 23:13:53 +09:00
Yu Watanabe eddb5037f1 analyze: set reverse_offset for containerized system 2018-08-06 22:21:05 +09:00
Yu Watanabe 79ecaae47d analyze-plot: do not show the legend for security when --user is specified
systemd of user instance always does not have valid value of
TIMESTAMP_SECURITY_*.
2018-08-06 22:21:05 +09:00
Yu Watanabe 7bc740f480 core: add comments about timestamps stored in manager 2018-08-06 22:21:05 +09:00
Yu Watanabe cc0eb780bd analyze: use bus_map_all_properties() 2018-08-06 22:21:05 +09:00
Yu Watanabe 97cec9ba5e analyze: use size_t for number of units 2018-08-06 22:21:05 +09:00
Zbigniew Jędrzejewski-Szmek 7735d9397b
Merge pull request #9792 from poettering/hashmap-mempool
minor hashmap fixes
2018-08-06 14:13:30 +02:00
Yu Watanabe 68c597e9e4 resolve: treat some icmp errors as disconnected
Fixes #9773.
2018-08-06 09:57:00 +02:00
Yu Watanabe 72938b9309 resolve: sort headers 2018-08-06 09:57:00 +02:00
Zbigniew Jędrzejewski-Szmek cad8d67194 Merge pull request #9775 from yuwata/follow-up-9766 2018-08-06 07:59:34 +02:00
Yu Watanabe fe65e88ba6 namespace: implicitly adds DeviceAllow= when RootImage= is set
RootImage= may require the following settings
```
DeviceAllow=/dev/loop-control rw
DeviceAllow=block-loop rwm
DeviceAllow=block-blkext rwm
```
This adds the following settings implicitly when RootImage= is
specified.

Fixes #9737.
2018-08-06 14:02:31 +09:00
Yu Watanabe fd870bac25 core: introduce cgroup_add_device_allow() 2018-08-06 13:42:14 +09:00
Yu Watanabe 839f187753 core/namespace: drop mount points outside of root even if RootDirectory= is not set 2018-08-06 12:51:33 +09:00
Yu Watanabe 9b68367b3a core/namespace: drop conditions depends on root is empty or not
After 0722b35934, the variable `root`
is always set.
2018-08-06 12:51:33 +09:00
Yu Watanabe 10c6e7e51e resolve: fix error handling of dns_name_is_valid() 2018-08-06 10:48:20 +09:00
Yu Watanabe 31ee397327 man: mention that Hostname= for DHCP must be a valid DNS domain name 2018-08-06 10:48:12 +09:00
Yu Watanabe a8494759b4 network: DHCP: ignore error in setting hostname when it is given by uname()
C.f. #9759.
2018-08-06 10:48:02 +09:00