Alexander Sverdlin [Sun, 18 Apr 2021 23:53:45 +0000 (01:53 +0200)]
systemd-coredump: Add conflict with shutdown.target
Otherwise a coredump started at the inconvinient moment can stop
shutdown.target leaving the system in a halfway-down state:
Pulling in shutdown.target/start from systemd-poweroff.service/start
Added job shutdown.target/start to transaction.
...
Keeping job shutdown.target/start because of systemd-poweroff.service/start
...
[ OK ] Stopped target Remote File Systems.
shutdown.target: starting held back, waiting for: systemd-networkd.socket
sysinit.target: stopping held back, waiting for: remount_tmp.service
systemd-coredump.socket: Incoming traffic
...
systemd-coredump@0-243-0.service: Trying to enqueue job systemd-coredump@0-243-0.service/start/replace
Added job systemd-coredump@0-243-0.service/start to transaction.
Pulling in systemd-journald.socket/start from systemd-coredump@0-243-0.service/start
Added job systemd-journald.socket/start to transaction.
Pulling in system.slice/start from systemd-journald.socket/start
Added job system.slice/start to transaction.
Pulling in -.slice/start from system.slice/start
Added job -.slice/start to transaction.
Pulling in system-systemd\x2dcoredump.slice/start from systemd-coredump@0-243-0.service/start
Added job system-systemd\x2dcoredump.slice/start to transaction.
Pulling in system.slice/start from system-systemd\x2dcoredump.slice/start
Pulling in shutdown.target/stop from system-systemd\x2dcoredump.slice/start
Added job shutdown.target/stop to transaction.
...
Keeping job systemd-poweroff.service/stop because of umount.target/stop
Keeping job shutdown.target/stop because of systemd-coredump@0-243-0.service/start
Lennart Poettering [Thu, 29 Apr 2021 19:39:30 +0000 (21:39 +0200)]
Merge pull request #19458 from yuwata/network-route-remove
network: fix route removal logic a bit
Viktor Mihajlovski [Tue, 27 Apr 2021 13:25:16 +0000 (15:25 +0200)]
udev: allow onboard index up to 65535
The maximum allowed value of the sysfs device index entry was limited to
16383 (2^14-1) to avoid the generation of unreasonable onboard interface
names.
For s390 the index can assume a value of up to 65535 (2^16-1) which is
now allowed depending on the new naming flag NAMING_16BIT_INDEX.
Larger index values are considered unreasonable and remain to be
ignored.
Lennart Poettering [Thu, 29 Apr 2021 19:37:52 +0000 (21:37 +0200)]
Merge pull request #19451 from poettering/hostnamed-json
hostnamed: add JSON output to hostnamectl
Lennart Poettering [Wed, 28 Apr 2021 13:59:13 +0000 (15:59 +0200)]
man: document new dbus method
Lennart Poettering [Thu, 29 Apr 2021 09:29:46 +0000 (11:29 +0200)]
hostnamectl: add --json= switch for JSON output
This wraps the new Describe() bus call of hostnamed.
Lennart Poettering [Thu, 29 Apr 2021 09:29:54 +0000 (11:29 +0200)]
hostnamed: add Describe() call to hostnamed, returning all props a JSON
Lennart Poettering [Wed, 28 Apr 2021 13:33:14 +0000 (15:33 +0200)]
hostnamed: drop unused enums
Lennart Poettering [Wed, 28 Apr 2021 13:28:53 +0000 (15:28 +0200)]
hostnamed: split out how we determine the hostname a bit
No changes in code, just some splitting out of code we want to use
elsewhere soon.
Lennart Poettering [Wed, 28 Apr 2021 13:11:54 +0000 (15:11 +0200)]
hostnamed: refactor vendor/model querying a bit, reuse function
Lennart Poettering [Wed, 28 Apr 2021 12:33:19 +0000 (14:33 +0200)]
hostnamed: use byte array when we need a byte array
it's more corect this way, but shouldn#t change a thing binary-wise
Lennart Poettering [Wed, 28 Apr 2021 12:32:49 +0000 (14:32 +0200)]
hostnamed: retrieve product UUID after authentication, not before
Lennart Poettering [Wed, 28 Apr 2021 12:15:36 +0000 (14:15 +0200)]
id128-util: use common implementation of helper to get/validate product ID
Yu Watanabe [Thu, 29 Apr 2021 11:58:10 +0000 (20:58 +0900)]
network: do not set nexthop ID, gateway, and multipath routes simultaneously
See kernel's rtm_to_fib_config() in net/ipv4/fib_frontend.c and
rtm_to_fib6_config() in net/ipv6/route.c.
Note that if both gateway and multipath routes are specified, then
kernel ignores gateway. So, strictly speaking, setting both gateway and
multipath routes is allowed by kernel. But such situation is mostly
user's misconfiguration. Let's refuse it.
Note that the conditions newly added in route_configure() are redundant,
as all static configurations are already verified in
route_section_verify(), and dynamic configurations do not set
nexthop_id or multipath routes. Just for safety.
caoxia2008cxx [Thu, 29 Apr 2021 09:05:01 +0000 (17:05 +0800)]
set boot time from monotonic time (#19444)
utmp: calculate boot timestamp from monotonic timestamp instead of realtime timestamp
Yu Watanabe [Wed, 28 Apr 2021 17:42:42 +0000 (02:42 +0900)]
network: do not remove reject type routes more than once
Usually, removing non-existing addresses, routes, and etc, are safe.
However, when multiple interfaces lost their carriers simultaneously,
then manager_drop_routes() and manager_drop_nexthop() are called multiple
times. If a route with a blackhole nexthop is removed in that process,
the later removal requests of the route fail with -EINVAL, rathar
than -ESRCH, as the corresponding nexthop does not exist anymore.
So, let's not remove routes which managed by Manager more than once.
Yu Watanabe [Wed, 28 Apr 2021 17:34:17 +0000 (02:34 +0900)]
network: do not set route type on specific route removal
Yu Watanabe [Wed, 28 Apr 2021 16:17:36 +0000 (01:17 +0900)]
network: unify log_link_message_full_errno() and log_message_warning_errno()
This also introduces log_message_error_errno() or friends.
Yu Watanabe [Wed, 28 Apr 2021 15:07:09 +0000 (00:07 +0900)]
network: dhcp4: downgrade log level when interface is removed
Yu Watanabe [Mon, 26 Apr 2021 14:55:09 +0000 (23:55 +0900)]
network: drop meaningless bitfield specifiers
Yu Watanabe [Wed, 28 Apr 2021 23:54:08 +0000 (08:54 +0900)]
Merge pull request #19449 from yuwata/network-downgrade-log-level
network: downgrade log level and fix typo
Yu Watanabe [Wed, 28 Apr 2021 13:26:48 +0000 (22:26 +0900)]
network: ndisc: fix ipv6 route preference for routes with Gateway=_ipv6ra
Lennart Poettering [Wed, 28 Apr 2021 20:47:21 +0000 (22:47 +0200)]
Merge pull request #19374 from yuwata/network-dhcp-routes-to-ntp
network: dhcp4: introduce RoutesToNTP= boolean setting
Lennart Poettering [Wed, 28 Apr 2021 19:17:43 +0000 (21:17 +0200)]
Merge pull request #19441 from keszybz/riscv-syscall-lists
Add syscall list for riscv
Yu Watanabe [Wed, 28 Apr 2021 13:18:45 +0000 (22:18 +0900)]
network: neighbor: downgrade log level
As commented in the code, kernel sends messages about neighbors after
a link is removed.
Yu Watanabe [Wed, 28 Apr 2021 13:17:39 +0000 (22:17 +0900)]
network: link: downgrade log level
The error is harmless, and will be ignored. Let's downgrade log level.
Yu Watanabe [Wed, 28 Apr 2021 13:15:40 +0000 (22:15 +0900)]
network: dhcp4: downgrade log level
It is not necessary to log such information on higher level.
Yu Watanabe [Wed, 28 Apr 2021 15:47:39 +0000 (00:47 +0900)]
systemctl: fix build failure
Follow-up for
255b1fc8a3055a7d59946a0fc483ee3885740398.
Yu Watanabe [Tue, 27 Apr 2021 05:22:34 +0000 (14:22 +0900)]
bus-print-property: introduce BusPrintPropertyFlags
Follow-ups for
1ceaad69378272c64da4ecaab0d59ebb7a92ca0a.
Lennart Poettering [Wed, 28 Apr 2021 14:40:58 +0000 (16:40 +0200)]
docs: document that one shouldn't pass the audit caps to containers
Apparently this is not well know, so let' document this.
Zbigniew Jędrzejewski-Szmek [Wed, 28 Apr 2021 13:35:44 +0000 (15:35 +0200)]
basic/missing-syscall: add regen instructions
Lennart Poettering [Tue, 27 Apr 2021 12:16:06 +0000 (14:16 +0200)]
missing: add syscall wrappers for new mount API
Zbigniew Jędrzejewski-Szmek [Wed, 28 Apr 2021 08:46:48 +0000 (10:46 +0200)]
basic/missing-syscall: sort syscalls alphabetically and add numbers for mount_setattr, move_mount, open_tree
Zbigniew Jędrzejewski-Szmek [Tue, 27 Apr 2021 19:34:38 +0000 (03:34 +0800)]
basic/missing-syscall: add numbers for riscv (64-bit)
Zbigniew Jędrzejewski-Szmek [Tue, 27 Apr 2021 19:18:05 +0000 (03:18 +0800)]
basic/missing-syscalls: only emit one warning about missing numbers
The ifdef pattern is the same for all syscalls, so most of the time, if one is
not defined, all others will too. So let's reduce the noise a bit and emit one
warning in case the support for the architecture is fully missing. (Current
template was copied over from before when we added numbers for each syscall by
hand and stopped making sense when we started generating the header from a
table that is expected to have all syscall numbers.)
Lennart Poettering [Wed, 28 Apr 2021 13:12:59 +0000 (15:12 +0200)]
Merge pull request #19316 from keszybz/mkosi-f34
Bump mkosi config for F34
Lennart Poettering [Wed, 28 Apr 2021 11:26:29 +0000 (13:26 +0200)]
Merge pull request #19446 from poettering/logind-trigger-new
logind/dissect: use sd_device_trigger() more
Perry.Yuan [Wed, 28 Apr 2021 10:37:39 +0000 (18:37 +0800)]
hwdb: 60-keyboard:: Update Dell Privacy Local Mic Mute Hotkey (#19261)
This patch fix scancode 0x120001 mapping to key code F20 micmute
The previous scancode is not correct, it will cause the micmute
hotkey no function when testing the mic mute
Zbigniew Jędrzejewski-Szmek [Thu, 15 Apr 2021 11:14:09 +0000 (13:14 +0200)]
mkosi: do not pull in perl dependencies
It was added in
e2c5e698c0, but nobody remembers why exactly.
Zbigniew Jędrzejewski-Szmek [Thu, 15 Apr 2021 06:20:31 +0000 (08:20 +0200)]
hwdb-test: pass an explit path to systemd-hwdb
https://github.com/systemd/systemd/pull/19316 failed with:
[1065/1670] Linking target systemd-hwdb
--- command ---
14:28:29 /root/src/test/hwdb-test.sh
--- stdout ---
./systemd-hwdb does not exist, please build first
I'm not sure what is going on here… In principle meson says that tests may be
called from any directory, but in practice is was always the build directory.
So far we were relying on systemd-hwdb being present in '.', and this worked.
Either way, it's nicer to pass the exact path, so let's do that.
Zbigniew Jędrzejewski-Szmek [Tue, 13 Apr 2021 12:15:29 +0000 (14:15 +0200)]
mkosi,man: bump fedora version
F34 was just released and should be fine for systemd builds.
Cloud-1.2 is the latest version.
Uwe Kleine-König [Fri, 9 Oct 2020 10:13:00 +0000 (12:13 +0200)]
Add support for conditions on the machines firmware
This allows to limit units to machines that run on a certain firmware
type. For device tree defined machines checking against the machine's
compatible is also possible.
Lennart Poettering [Wed, 28 Apr 2021 07:51:55 +0000 (09:51 +0200)]
dissect-image: use sd_device_trigger() API
Let's use the new API here too.
Lennart Poettering [Wed, 28 Apr 2021 07:48:06 +0000 (09:48 +0200)]
logind: use new sd_device_trigger() API
This is a follow-up for
21012e20a4f0b939d449ad31d9bcbeafdfb8b931 and
related commits, i.e. one more occasion we can use the
sd_device_trigger() API.
William A. Kennington III [Tue, 27 Apr 2021 08:25:58 +0000 (01:25 -0700)]
network: neighbor: Always add neighbors with replace
We were duplicating setting flags for the message and a combination of
NLM_F_APPEND and NLM_F_CREATE which does not make sense. We should have
been using NLM_F_REPLACE and NLM_F_CREATE since the kernel can
dynamically create neighbors prior to us adding an entry. Otherwise, we
can end up with cases where the message will time out after ~25s even
though the neighbor still gets added. This delays the rest of the setup
of the interface even though the error is ultimately ignored.
Franck Bui [Tue, 27 Apr 2021 08:59:24 +0000 (10:59 +0200)]
system-conf: drop reference to ShutdownWatchdogUsec=
Commit
65224c1d0e50667a87c2c4f840c49d4918718f80 renamed ShutdownWatchdogUsec
into RebootWatchdogUsec but left a reference of ShutdownWatchdogUsec in
system.conf.
Zbigniew Jędrzejewski-Szmek [Tue, 27 Apr 2021 10:52:30 +0000 (12:52 +0200)]
Merge pull request #17655 from wat-ze-hex/bpf-build-rule
Introduce SocketBind{Allow|Deny}= properties powered by source compiled BPF
Frantisek Sumsal [Mon, 26 Apr 2021 20:03:19 +0000 (22:03 +0200)]
systemctl: hide some empty properties without --all
Fixes: #19423
Julia Kartseva [Fri, 12 Feb 2021 07:15:17 +0000 (23:15 -0800)]
fuzz: add SocketBind{Allow|Deny}= directive
Julia Kartseva [Sat, 28 Nov 2020 01:54:02 +0000 (17:54 -0800)]
readme: update README with requirements for bpf
Julia Kartseva [Wed, 18 Nov 2020 08:32:14 +0000 (00:32 -0800)]
man: add SocketBind{Allow|Deny}= documentation
Julia Kartseva [Tue, 20 Apr 2021 23:33:29 +0000 (16:33 -0700)]
systemctl: show SocketBind{Allow|Deny} properties
Julia Kartseva [Wed, 18 Nov 2020 08:31:55 +0000 (00:31 -0800)]
dbus: add dbus-cgroup for SocketBind{Allow|Deny}=
Julia Kartseva [Mon, 16 Nov 2020 08:26:44 +0000 (00:26 -0800)]
tests: add test program for SocketBind{Allow|Deny}=
Verify that service exited correctly if valid ports are passed to
SocketBind{Allow|Deny}=
Use `ncat` program starting a listening service binding to a specified
port, e.g.
"timeout --preserve-status -sSIGTERM 1s /bin/nc -l -p ${port} -vv"
Julia Kartseva [Mon, 19 Apr 2021 20:27:07 +0000 (13:27 -0700)]
shared, bpf: add bpf link serialization
core: serialize socket_bind bpf links
Julia Kartseva [Tue, 20 Apr 2021 07:09:51 +0000 (00:09 -0700)]
core: add SocketBind{Allow|Deny} fragment parser
Julia Kartseva [Thu, 12 Nov 2020 22:05:15 +0000 (14:05 -0800)]
core: add socket-bind cgroup mask harness
Standard cgroup harness for bpf feature.
Julia Kartseva [Mon, 26 Apr 2021 02:10:40 +0000 (19:10 -0700)]
core, bpf: add socket-bind feature to unit
Add supported and install unit interface for socket-bind feature.
supported verifies that
- unified cgroup hierarchy (cgroup v2) is used
- BPF_FRAMEWORK (libbpf + clang + llvm + bpftool) was available in
compile time
- kernel supports BPF_PROG_TYPE_CGROUP_SOCK_ADDR
- bpf programs can be loaded into kernel
- bpf link can be used
install:
- load bpf_object from bpf skeleton
- resize rules map to fit socket_bind_allow and socket_bind deny rules
from cgroup context
- populate cgroup-bpf maps with rules
- get bpf programs from bpf skeleton
- attach programs to unit cgroup using bpf link
- save bpf link in the unit
Julia Kartseva [Wed, 10 Mar 2021 19:44:07 +0000 (11:44 -0800)]
cgroup: add socket-bind to cgroup context
Julia Kartseva [Fri, 12 Feb 2021 03:38:36 +0000 (19:38 -0800)]
shared, bpf: add bpf link helpers
add can_link_bpf_program and bpf_link_free helpers.
Julia Kartseva [Tue, 20 Apr 2021 06:30:08 +0000 (23:30 -0700)]
meson, bpf: add build rule for socket-bind program
Julia Kartseva [Sat, 14 Nov 2020 01:08:15 +0000 (17:08 -0800)]
meson, bpf: add HAVE_LIBBPF, BPF_FRAMEWORK options
* Add `bpf-framework` feature gate with 'auto', 'true' and 'false' choices
* Add libbpf [0] dependency
* Search for clang llvm-strip and bpftool binaries in compile time to
generate bpf skeleton.
For libbpf [0], make 0.2.0 [1] the minimum required version.
If libbpf is satisfied, set HAVE_LIBBPF config option to 1.
If `bpf-framework` feature gate is set to 'auto', means that whether
bpf feature is enabled or now is defined by the presence of all of
libbpf, clang, llvm and bpftool in build
environment.
With 'auto' all dependencies are optional.
If the gate is set to `true`, make all of the libbpf, clang and llvm
dependencies mandatory.
If it's set to `false`, set `BPF_FRAMEWORK` to false and make libbpf
dependency optional.
libbpf dependency is dynamic followed by the common pattern in systemd.
meson, bpf: add build rule for socket_bind program
Julia Kartseva [Sat, 14 Nov 2020 01:02:50 +0000 (17:02 -0800)]
bpf: add build script for bpf programs
Add a build script to compile bpf source code. A program in restricted
C is compiled into an object file. Object file is converted to BPF
skeleton [0] header file.
If build with custom meson build rule, the target header will reside in
build/ directory (not in source tree), e.g the path for socket_bind:
`build/src/core/bpf/socket_bind/socket-bind.skel.h`
Script runs the phases:
* clang to generate *.o from restricted C
* llvm-strip to remove useless DWARF info
* bpf skeleton generation with bpftool
These phases are logged to stderr for debug purposes.
To include BTF debug information, -g option is passed to clang.
[0] https://lwn.net/Articles/806911/
Julia Kartseva [Sat, 14 Nov 2020 01:40:17 +0000 (17:40 -0800)]
bpf: add socket-bind BPF program code sources
Introduce BPF program compiled from BPF source code in
restricted C - socket-bind.
It addresses feature request [0].
The goal is to allow systemd services to bind(2) only to a predefined set
of ports. This prevents assigning socket address with unallowed port
to a socket and creating servers listening on that port.
This compliments firewalling feature presenting in systemd:
whereas cgroup/{egress|ingress} hooks act on packets, this doesn't
protect from untrusted service or payload hijacking an important port.
While ports in 0-1023 range are restricted to root only, 1024-65535
range is not protected by any mean.
Performance is another aspect of socket_bind feature since per-packet
cost can be eliminated for some port-based filtering policies.
The feature is implemented with cgroup/bind{4|6} hooks [1].
In contrast to the present systemd approach using raw bpf instructions,
this program is compiled from sources. Stretch goal is to
make bpf ecosystem in systemd more friendly for developer and to clear
path for more BPF programs.
[0] https://github.com/systemd/systemd/pull/13496#issuecomment-
570573085
[1] https://www.spinics.net/lists/netdev/msg489054.html
Zbigniew Jędrzejewski-Szmek [Mon, 26 Apr 2021 21:03:13 +0000 (23:03 +0200)]
Merge pull request #19416 from mrc0mmand/test-id-detection
test: "detect" the test number automagically
Frantisek Sumsal [Sun, 25 Apr 2021 18:57:27 +0000 (20:57 +0200)]
test: reorganize the TEST-52 a bit
Frantisek Sumsal [Mon, 26 Apr 2021 17:22:42 +0000 (19:22 +0200)]
test: add a couple of hooks for the check_result_*() functions
So we don't have to duplicate the whole functions if we need to inject
some test-specific checks.
Frantisek Sumsal [Mon, 26 Apr 2021 17:20:18 +0000 (19:20 +0200)]
test: "detect" the test number automagically
Specifying the test number manually is tedious and prone to errors (as
recently proven). Since we have all the necessary data to work out the
test number, let's do it automagically.
Frantisek Sumsal [Mon, 26 Apr 2021 17:16:44 +0000 (19:16 +0200)]
Merge pull request #19383 from keszybz/test58-fixes
Fixes for TEST-58-REPART and ExecStart deserialization logic
Yu Watanabe [Tue, 20 Apr 2021 17:36:39 +0000 (02:36 +0900)]
test-network: add tests for RoutesToNTP=
Yu Watanabe [Tue, 20 Apr 2021 17:23:00 +0000 (02:23 +0900)]
network: dhcp4: introduce RoutesToNTP= boolean setting
Yu Watanabe [Tue, 20 Apr 2021 17:22:30 +0000 (02:22 +0900)]
network: dhcp4: split and rename link_set_dns_routes()
Yu Watanabe [Tue, 20 Apr 2021 17:04:32 +0000 (02:04 +0900)]
network: dhcp4: enable RoutesToDNS= by default
Zbigniew Jędrzejewski-Szmek [Fri, 23 Apr 2021 10:37:09 +0000 (12:37 +0200)]
test-unit-serialize: add a very basic test that command deserialization works
We should test both serialization and deserialization works properly.
But the serialization/deserialization code is deeply entwined with the
manager state, and I think quite a bit of refactoring will be required before
this is possible. But let's at least add this simple test for now.
Zbigniew Jędrzejewski-Szmek [Mon, 26 Apr 2021 13:10:41 +0000 (15:10 +0200)]
Merge pull request #19286 from yuwata/network-dhcp-routes-to-dns-19077
network: dhcp4: set gateway for route to dns server if it is not in the same network
Yu Watanabe [Mon, 26 Apr 2021 00:03:33 +0000 (09:03 +0900)]
network: update comment and log message
After
4b30f2e135ee84041bb597edca7225858f4ef4fb, reading stable_secret
sysctl property fails with -ENOMEM, instead of -EIO.
This is due to read_full_virtual_file() uses read() as the backend while
read_one_line_file() uses fgetc(). And each functions return different
error on fails.
Anyway, the failure is harmless here. So, the log message and comment is
updated.
Closes one of the issues in #19410.
Luca Boccassi [Mon, 26 Apr 2021 09:08:07 +0000 (10:08 +0100)]
Merge pull request #19421 from yuwata/fix-typo
core, network: Fix typo
Yu Watanabe [Sun, 25 Apr 2021 23:16:08 +0000 (08:16 +0900)]
network: add missing sections
Follow-up for
4e26a5baa0045c8bbb899f0c72f07ac630692bd3.
Fixes one of issues in #19410.
Yu Watanabe [Mon, 26 Apr 2021 00:20:24 +0000 (09:20 +0900)]
Yu Watanabe [Mon, 26 Apr 2021 00:19:38 +0000 (09:19 +0900)]
Lennart Poettering [Sat, 24 Apr 2021 07:17:38 +0000 (09:17 +0200)]
Merge pull request #19411 from poettering/homectl-fixes
homectl password caching fixes
Lennart Poettering [Fri, 23 Apr 2021 14:31:12 +0000 (16:31 +0200)]
homectl: pick up cached/credential store/env var passwords *before* issuing first request
Previously, we'd generally attempt the operation first, without any
passwords, and only query for a password if that operation then fails
and asks for one. This is done to improve compatibility with
password-less authentication schemes, such as security tokens and
similar.
This patch modifies this slightly: if a password can be acquired cheaply
via the keyring password cache, the $CREDENTIALS_PATH credential store,
or the $PASSWORD/$PIN environment variables, acquire it *before* issuing
the first requested.
This should save us a pointless roundtrip, and should never hurt.
Lennart Poettering [Fri, 23 Apr 2021 14:14:57 +0000 (16:14 +0200)]
homectl: don't use password cache if we operate on other user
Lennart Poettering [Fri, 23 Apr 2021 12:53:32 +0000 (14:53 +0200)]
homectl: don't use cached passwords when re-requesting password because wrong
Asking repeatedly for a password is pointless if we always use the same
cached one. Let's thus disable cache use whenever we failed already
once.
Lennart Poettering [Fri, 23 Apr 2021 15:17:26 +0000 (17:17 +0200)]
test: use systemd-run -P instead of -t in TEST-50
We want to use the result in a shell pipeline hence use -P mode (pipe
mode) instead of -t mode (interactive tty mode) for systemd-run.
This shouldn't change much about the test, but is slightly more correct
(and quicker).
Zbigniew Jędrzejewski-Szmek [Tue, 20 Apr 2021 15:47:50 +0000 (17:47 +0200)]
tests: use setfacl to give $SUDO_USER read permissions on artifacts
We have to invoke the tests as superuser, and not being able to read
the journal as the invoking user is annoying. I don't think there are
any security considerations here, since the invoking user can already
put arbitrary code in the Makefile and test scripts which get executed
with root privileges.
Luca Boccassi [Fri, 23 Apr 2021 15:43:45 +0000 (16:43 +0100)]
Merge pull request #19156 from dtardon/enable-warn
install: warn if WantedBy targets don't exist
Lennart Poettering [Wed, 7 Apr 2021 09:44:29 +0000 (11:44 +0200)]
fstab-generator: clean up mount point flags handling
Let's rename MountpointsFlags → MountPointFlags. In most of our codebase
we name things mount_point/MountPoint rather than mountpoint/Mountpoint,
do so here too.
Also, prefix the enum values with "MOUNT_". The fact the enum values
weren#t prefixed was pretty unique in our codebase, and pretty
surprising. Let's fix that.
This is just refactoring, no actual change in behaviour
Zbigniew Jędrzejewski-Szmek [Fri, 23 Apr 2021 10:40:07 +0000 (12:40 +0200)]
core/service: also reject deserialized commands with no argv[0]
I'm pretty sure that bad things would happen later on.
Zbigniew Jędrzejewski-Szmek [Fri, 23 Apr 2021 10:39:03 +0000 (12:39 +0200)]
core/service: fix deserialization of non-absolute commands
We'd fail with:
Apr 23 10:58:26 systemd[1]: Deserializing state...
Apr 23 10:58:26 systemd[1]: testsuite-01.service: Failed to parse serialized command "ExecStart 0 sh "sh" "-e" "-x" "-c" "systemctl --state=failed --no-legend --no-pager >/failed ; systemctl daemon-reload ; echo OK >/testok"": Invalid argument
Apr 23 10:58:26 systemd[1]: testsuite-01.service: Reinstalled deserialized job testsuite-01.service/start as 209
This was missed in
5008da1ec1, and apparently nobody noticed until now :(
Zbigniew Jędrzejewski-Szmek [Wed, 21 Apr 2021 21:37:57 +0000 (23:37 +0200)]
TEST-58: exit immediately if systemd-repart is not available
Debian disables systemd-repart at config time.
Zbigniew Jędrzejewski-Szmek [Wed, 21 Apr 2021 14:26:18 +0000 (16:26 +0200)]
TEST-58: only run under qemu
In a container, /dev/loop* will most likely be inaccessible.
Zbigniew Jędrzejewski-Szmek [Fri, 23 Apr 2021 08:55:49 +0000 (10:55 +0200)]
test: move the logic to support /skipped into shared logic
The logic to query test state was rather complex. I don't quite grok the point
of ret=$((ret+1))… But afaics, the precise result was always ignored by the
caller anyway.
Zbigniew Jędrzejewski-Szmek [Wed, 21 Apr 2021 07:07:30 +0000 (09:07 +0200)]
various: print the image path when setting up of the loopback device fails
Zbigniew Jędrzejewski-Szmek [Tue, 20 Apr 2021 16:28:19 +0000 (18:28 +0200)]
core: fix typos in comment
Zbigniew Jędrzejewski-Szmek [Wed, 21 Apr 2021 07:37:18 +0000 (09:37 +0200)]
TODO: add some items for repart
Zbigniew Jędrzejewski-Szmek [Tue, 20 Apr 2021 15:53:55 +0000 (17:53 +0200)]
TEST-58: remove stale artifacts to not fail on repeated invocations
We would remove stuff only if successful, so repeated invocations would
trivially fail.
Also drop "-f", so that if we expect to remove something, it must be there.
Zbigniew Jędrzejewski-Szmek [Wed, 21 Apr 2021 07:58:26 +0000 (09:58 +0200)]
tests: install mkfs.ext4, mkfs.vfat and modules into the test image
This allows TEST-58-REPART to at least start. It fails later with with loopback
device errors.
Zbigniew Jędrzejewski-Szmek [Tue, 20 Apr 2021 15:07:41 +0000 (17:07 +0200)]
TEST-58: adjust whitespace and enable pipefail
Zbigniew Jędrzejewski-Szmek [Tue, 20 Apr 2021 14:10:25 +0000 (16:10 +0200)]
TEST-58: execute the right test