Commit graph

41921 commits

Author SHA1 Message Date
Yu Watanabe 3adf85b72f
Merge pull request #13735 from ssahani/ip-nexthop
network: introduce ip nexthop routing
2019-10-14 23:25:23 +09:00
Jan Synacek 4801d8afe2 udev: introduce CONST key name
Currently, there is no way to match against system-wide constants, such
as architecture or virtualization type, without forking helper binaries.
That potentially results in a huge number of spawned processes which
output always the same answer.

This patch introduces a special CONST keyword which takes a hard-coded
string as its key and returns a value assigned to that key. Currently
implemented are CONST{arch} and CONST{virt}, which can be used to match
against the system's architecture and virtualization type.
2019-10-14 22:01:11 +09:00
Yu Watanabe 086bcf5dca test-network: add a test case for nexthop 2019-10-14 21:55:57 +09:00
Yu Watanabe 4abcdaa08c network: update comment as DHCP is deprecated now 2019-10-14 21:33:22 +09:00
Susant Sahani c16c780804 network: introduce ip nexthop routing
Used to manipulate entries in the kernel's nexthop tables.
Example:
```
[NextHop]
Id=3
Gateway=192.168.5.1
```
2019-10-14 21:32:48 +09:00
Yu Watanabe 55d3fdcf5e network: ndisc: do not drop all prefixes when a prefix matches a blacklist
Fixes #13767.
2019-10-14 20:54:43 +09:00
Yu Watanabe c94f7809e3
Merge pull request #13761 from dtardon/program-name
udev: do not hardcode program name
2019-10-14 20:17:28 +09:00
Yu Watanabe 0486a7d15b
Merge pull request #13765 from yuwata/udev-memleak-13764
udev,systemctl: fix memleak caused by wrong cleanup function
2019-10-14 20:16:58 +09:00
Yu Watanabe 13f697b7b1 systemctl: fix memleak caused by wrong cleanup func 2019-10-14 01:18:41 +09:00
Yu Watanabe f4f6f2c740 udev: fix memleak caused by wrong cleanup function
Fixes #13764.
2019-10-13 00:35:53 +09:00
David Tardon 9e385314b0 udev: do not hardcode program name 2019-10-11 14:45:02 +02:00
David Tardon 9b2aee4170 udev/fido_id: fix program name in usage output 2019-10-11 14:44:53 +02:00
Zbigniew Jędrzejewski-Szmek 2cea199ec1 core: pass around pointer, not struct
Since this is a static function, the compiler is likely to optimize it away
anyway, but let's do the normal thing here.
2019-10-11 13:46:05 +02:00
Zbigniew Jędrzejewski-Szmek 27e946a5b3 shared/bus-unit-util: remove some empty lines
We generally don't add empty lines after if. It looks especially strange
when the block has is just a single line without braces.
2019-10-11 13:46:05 +02:00
Zbigniew Jędrzejewski-Szmek 75193d4128 core: adjust load functions for other unit types to be more like service
No functional change, just adjusting code to follow the same pattern
everywhere. In particular, never call _verify() on an already loaded unit,
but return early from the caller instead. This makes the code a bit easier
to follow.
2019-10-11 13:46:05 +02:00
Zbigniew Jędrzejewski-Szmek c3784a7d78 core: simplify unit_load() a bit
Now all unit types define .load. But even if it wasn't defined, we'd need
to call unit_load_fragment_and_dropin() anyway, so this code would not have
worked correctly.

Also, unit_load_fragment_and_dropin() either returns -ENOENT or changes
UNIT_STUB to UNIT_LOADED, so we don't need to repeat this here.
2019-10-11 11:25:04 +02:00
Zbigniew Jędrzejewski-Szmek e0cfed4c59 core/service: use common implementation of unit_load_fragment_and_dropin()
There is a slight functional change when load_state == UNIT_MERGED. Before,
we would not call unit_load_dropin(), but now we do. I'm not sure if this
causes an actual difference in behaviour, but since all other unit types do
this, I think it's better to do the same thing here too.
2019-10-11 11:25:04 +02:00
Zbigniew Jędrzejewski-Szmek c362077087 core: turn unit_load_fragment_and_dropin_optional() into a flag
unit_load_fragment_and_dropin() and unit_load_fragment_and_dropin_optional()
are really the same, with one minor difference in behaviour. Let's drop
the second function.

"_optional" in the name suggests that it's the "dropin" part that is optional.
(Which it is, but in this case, we mean the fragment to be optional.)
I think the new version with a flag is easier to understand.
2019-10-11 10:45:33 +02:00
Yu Watanabe 349176ae6c
Merge pull request #13749 from keszybz/pyparsing-2.4
Compatibility with pyparsing 2.4
2019-10-11 08:43:10 +09:00
Zbigniew Jędrzejewski-Szmek 2382a2e32b parse_hwdb: fix compatibility with pyparsing 2.4.*
pyparsing 2.3.1/2.4.0 had some changes to grouping of And matches, and as a
result we'd report 0 properties and 0 matches, and not really do any checks.

With this change we get identical behaviour for pyparsing 2.3.1, 2.4.0, 2.4.2:

$ hwdb/parse_hwdb.py
hwdb/60-evdev.hwdb: 72 match groups, 94 matches, 262 properties
hwdb/60-input-id.hwdb: 3 match groups, 3 matches, 4 properties
hwdb/60-keyboard.hwdb: 173 match groups, 256 matches, 872 properties
Keycode KBD_LCD_MENU1 unknown
Keycode KBD_LCD_MENU4 unknown
Keycode KBD_LCD_MENU2 unknown
Keycode KBD_LCD_MENU3 unknown
hwdb/60-sensor.hwdb: 101 match groups, 120 matches, 105 properties
hwdb/70-joystick.hwdb: 2 match groups, 3 matches, 2 properties
hwdb/70-mouse.hwdb: 104 match groups, 119 matches, 123 properties
hwdb/70-pointingstick.hwdb: 8 match groups, 30 matches, 11 properties
hwdb/70-touchpad.hwdb: 6 match groups, 9 matches, 6 properties
2019-10-10 09:48:23 +02:00
Zbigniew Jędrzejewski-Szmek b32ae3aa7b parse_hwdb: process files in order
Also, make the pattern more general. There are some plans to add more files
there, let's make sure we don't miss them.
2019-10-10 09:48:23 +02:00
Zbigniew Jędrzejewski-Szmek f3c80bc01e parse_hwdb: bail with an error if no matches or groups are detected
pyparsing sometimes changes behaviour and stops giving matches. This should
allow us to detect such scenario. With this change, parse_hwdb fails with
pyparsing 2.4 on F31.
2019-10-10 09:48:23 +02:00
Zbigniew Jędrzejewski-Szmek 4f10b80786 Rename udev's hwdb/ to hwdb.d/
As in the parent commit, this makes the name consistent with the
rest of the source tree and the actuall installation path.
2019-10-10 00:53:09 +01:00
Zbigniew Jędrzejewski-Szmek ef2ad30aee Rename udev's rules/ to rules.d/
This change is only about the source tree. We have tmpfiles.d/, modprobe.d/,
sysctl.d/, and sysusers.d/, but for historical reasons, rules/ didn't fit this
pattern. We also *install* it as rules.d/. Let's rename to be consistent.
2019-10-10 00:53:09 +01:00
Balint Reczey bd89d03544 test: Pass personality test even when i686 userland runs on x86_64 kernel 2019-10-10 00:52:16 +01:00
Zbigniew Jędrzejewski-Szmek 7891aa0040
Merge pull request #13568 from ddstreet/ubuntu-ci-blacklists
test: add temporarily blacklisted tests
2019-10-09 12:04:42 +02:00
Yu Watanabe 6e5d630265
Merge pull request #13727 from keszybz/pstore-greedy-realloc
Use greedy realloc in pstore
2019-10-09 15:01:45 +09:00
Yu Watanabe d3d1aeaf8e
Merge pull request #13753 from keszybz/change-man-ordering
Change section ordering to have commands above options
2019-10-09 14:51:06 +09:00
Hans de Goede 889ee82032 hwdb: Update Primebook C11B sensor entry to also work with older BIOS versions
Older Primebook C11B BIOS versions use "Primebook C11B" as product name
instead of "PRIMEBOOK C11B", update the Primebook C11B 60-sensor.hwdb entries
to match on both spellings.
2019-10-09 14:44:13 +09:00
Zbigniew Jędrzejewski-Szmek ce2529b4a2 Highlight the synopsis and summary in --help
This doesn't cover all the binaries, but I don't know how to script
this, and I run out of steam ;)
2019-10-08 18:21:27 +02:00
Zbigniew Jędrzejewski-Szmek 9daa657836 networkctl: add missing dots in --help 2019-10-08 18:21:27 +02:00
Zbigniew Jędrzejewski-Szmek e1fac8a68a Move the Commands section above Options section
For executables which take a verb, we should list the verbs first, and
then options which modify those verbs second. The general layout of
the man page is from general description to specific details, usually
Overview, Commands, Options, Return Value, Examples, References.
2019-10-08 18:21:26 +02:00
Zbigniew Jędrzejewski-Szmek 69d0eb4475
Merge pull request #13746 from keszybz/tests-reduce-boilerplate
Reduce test boilerplate
2019-10-08 15:39:28 +02:00
Zbigniew Jędrzejewski-Szmek fd3561bae0 test/TEST-31-DEVICE-ENUMERATION: do not use -x to avoid grep loop
https://github.com/systemd/systemd/pull/13746#issuecomment-539410752:
> [grep] now matches the grep command itself, as it's logged into journal as well, thanks to set -x.

Also, use journalctl --grep and -t to make things a bit quicker.
2019-10-08 11:11:49 +02:00
Zbigniew Jędrzejewski-Szmek e0a0c64cb9
Merge pull request #13632 from fbuihuu/ask-password-some-reworks
Ask password some reworks
2019-10-08 09:20:40 +02:00
Zbigniew Jędrzejewski-Szmek 51fa85913c test: add function to reduce copied setup boilerplate
Many tests were also masking systemd-machined.service. But machined
should only start when activated, so having it not masked shouldn't be
noticable. TEST-25-IMPORT needs it.
2019-10-08 09:10:12 +02:00
Zbigniew Jędrzejewski-Szmek 0f714a34c4 test: drop redirection to tty in integration tests
I *think* this was originally added to make it easier to see what was happening
in tests. Later we added the functionality to print the journal on failure, so
this redirection has stopped being useful.

In https://github.com/systemd/systemd/pull/13719#issuecomment-539292650
@filbranden shows that grep tries to write to stdout and fails. In general,
we should not assume that writing to the console it always possible. We have
special code to handle this in pid1 after all:

99    19:22:10.731965 fstat(1,  <unfinished ...>
99    19:22:10.731993 <... fstat resumed>{st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0), ...}) = 0
99    19:22:10.732070 write(1, "ExecStartPost={ path=/bin/echo ; argv[]=/bin/echo ${4_four_ex} ; ignore_errors=no ; start_time=[Mon 2019-10-07 19:22:10 PDT] ; stop_time=[Mon 209-10-07 19:22:10 PDT] ; pid=97 ; code=exited ; status=0 }\n", 203) = -1 EIO (Input/output error)
99    19:22:10.732174 write(2, "grep: ", 6) = -1 EIO (Input/output error)
99    19:22:10.732226 write(2, "write error", 11) = -1 EIO (Input/output error)
99    19:22:10.732263 write(2, ": Input/output error", 20) = -1 EIO (Input/output error)
99    19:22:10.732298 write(2, "\n", 1 <unfinished ...>
99    19:22:10.732325 <... write resumed>) = -1 EIO (Input/output error)
99    19:22:10.732349 exit_group(2)     = ?
99    19:22:10.732424 +++ exited with 2 +++

Removing the redirection should make the tests less flakey.

Replaces #13719.

While at it, also drop NotifyAccess=all. I think it was added purposefully in
TEST-20-MAINPIDGAMES, and then cargo culted to newer tests.
2019-10-08 08:48:48 +02:00
Anita Zhang f18f809c07 basic/set: const-ify set_first()
set_steal_first() is the version that modifies Set so this one should be
const.
2019-10-07 12:02:12 -07:00
Anita Zhang e23d911664 core: disallow using '-.service' as a service name
-.service.d will become a special top level drop in so don't let it be a
usable service name (otherwise the interaction gets complicated).
2019-10-07 12:02:12 -07:00
Tim Teichmann 0490b44031 trivial: rename chromeos to chromiumos 2019-10-07 08:58:13 +09:00
Zbigniew Jędrzejewski-Szmek 581004bd33 docs: fix inadvertent change in uid range
a305eda35f (r35378755)
2019-10-06 19:05:57 +02:00
Mario Limonciello f10bb2ce03 trivial: update tools/chromeos/gen_autosuspend_rules.py
Adds CNP PCH xHCI device PCIID to udev rules
2019-10-05 15:52:53 +02:00
Tim Teichmann 13cd6f0b98 Add missing license file and information for tools/chromeos/gen_autosuspend_rules.py (#13729)
The license file for the python script that was commited with b61d777abe was missing. The license was copied from https://chromium.googlesource.com/chromiumos/platform2/+/master/LICENSE.
2019-10-05 15:52:37 +02:00
Franck Bui 6b2faba764 tty-ask-pwd-agent: move ask_password_plymouth() in ask-password-api.c 2019-10-05 08:08:24 +02:00
Franck Bui 87c4444ac9 tty-ask-pwd-agent: small cleanup in process_one_password_file()
Split the part dealing which asks for password on tty in a dedicated function
making process_one_password_file() hopefully easier to read.

No functional changes.
2019-10-05 08:08:24 +02:00
Franck Bui 825721eb8d tty-ask-pwd-agent: add a FIXME 2019-10-05 08:08:24 +02:00
Franck Bui 1322757061 tty-ask-pwd-agent: share the same init code for --query and --watch
Previously we would have skipped the init code which consists in setting the
signal handling up and the wall tty block thingie.
2019-10-05 08:08:24 +02:00
Franck Bui 998c6da8ca tty-ask-pwd-agent: treat SIGINT as a request to exit immediately
Unlike SIGTERM, SIGINT is now treated as a request to exit as soon as
possible. IOW, if SIGINT is received, the agent wont process all remaining
passwords before exiting.

This allows a more comprehensive behavior when C-c is pressed and when the
agent is spawned by systemctl.

Before that patch, pressing C-c killed systemctl but left the agent waiting
for a password since SIGINT was blocked. The result was pretty clumsy.
2019-10-05 08:08:24 +02:00
Franck Bui d325f2443e tty-ask-pwd-agent: give the possiblity to skip a password prompt
If multiple passwords are waiting the agent will prompt for each of them. Give
the possiblity to the user to skip some of them by pressing 'C-d'.
2019-10-05 08:08:24 +02:00
Franck Bui 1503bcb12e tty-ask-pwd-agent: minor simplification by using FOREACH_DIRENT instead of FOREACH_DIRENT_ALL 2019-10-05 08:08:24 +02:00