1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-30 14:55:37 +03:00
Commit Graph

55262 Commits

Author SHA1 Message Date
Yu Watanabe
2616b5285f test-network: introduce dump_dnsmasq_log_file() 2021-12-18 10:09:07 +09:00
Yu Watanabe
4862fb693d test-network: use dnsmasq for testing DHCP4-6RD 2021-12-18 10:09:07 +09:00
Yu Watanabe
f56af3b4c8 test-network: use --bind-interfaces option for dnsmasq
Also make the interface name and router address configurable.
2021-12-18 10:09:07 +09:00
Yu Watanabe
897f720602 sd-dhcp-client: add log message when a message is received 2021-12-18 10:09:07 +09:00
Yu Watanabe
fe87807eaa network: dhcp-pd: do not stack 6rd sit tunnel 2021-12-18 10:09:07 +09:00
Yu Watanabe
42e7ce69e4 network: route: update expiration timer in link_request_route() 2021-12-18 10:09:07 +09:00
Yu Watanabe
d0f17cfda6 network: route: do not drop unreachable route on reconfiguring downstream interface
Previously, when a downstream is reconfigured, the unreachable route
was removed as there is no corresponding static config in .network
files.
2021-12-18 10:09:07 +09:00
Yu Watanabe
277521a1ac network: dhcp-pd: fix condition in dhcp_pd_prefix_lost() 2021-12-18 10:09:07 +09:00
Yu Watanabe
059d7b6eae sd-radv: send RA when prefix is updated 2021-12-18 10:09:07 +09:00
Frantisek Sumsal
c0a2e0cc24 network: a couple of tweaks suggested by Coccinelle 2021-12-18 08:36:07 +09:00
Yu Watanabe
14dd873b88 network: dhcp4: pass IPServiceType=none to dhcp client
Follow-up for b55093ce88.
2021-12-18 08:35:42 +09:00
Frantisek Sumsal
b5c946d3b8 man: fix machine-id(5) man page reference
Spotted whilst debugging:
```
[763/2094] Generating man/machine-info.html with a custom command
Element cite in namespace '' encountered in para, but no template matches.
[765/2094] Generating man/machine-info.5 with a custom command
Element cite in namespace '' encountered in para, but no template matches.
```

Follow-up to 357376d0bb.
2021-12-18 08:35:24 +09:00
Yu Watanabe
a00fd2a553
Merge pull request #21800 from keszybz/net-id-debugging
Add more debugging info to udev builtin net_id
2021-12-18 08:35:08 +09:00
Zbigniew Jędrzejewski-Szmek
edee65a6a4 udev/net_id: add debug logging for construction of device names
I think this makes it much easier to figure out what information sources
were used to generate the names, and why certain names were not generated.

On my laptop:

Using default interface naming scheme 'v250'.
ID_NET_NAMING_SCHEME=v250
wwp0s20f0u2i12: addr_assign_type=3, MAC address is not permanent.
wwp0s20f0u2i12: Parsing slot information from sysname "0000:00:14.0": success
wwp0s20f0u2i12: dev_port=0
wwp0s20f0u2i12: PCI path identifier: domain=0 bus=0 slot=20 func=0 phys_port= dev_port=0 → p0s20f0
wwp0s20f0u2i12: USB name identifier: ports=2 config=1 interface=12 → u2i12
ID_NET_NAME_PATH=wwp0s20f0u2i12

Using default interface naming scheme 'v250'.
ID_NET_NAMING_SCHEME=v250
ID_NET_NAME_MAC=en54ee75cb1dc0
enp0s31f6: MAC address identifier: hw_addr=54:ee:75:cb:1d:c0 → 54ee75cb1dc0
ID_OUI_FROM_DATABASE=Wistron InfoComm(Kunshan)Co.,Ltd.
enp0s31f6: Parsing slot information from sysname "0000:00:1f.6": success
enp0s31f6: dev_port=0
enp0s31f6: PCI path identifier: domain=0 bus=0 slot=31 func=6 phys_port= dev_port=0 → p0s31f6
ID_NET_NAME_PATH=enp0s31f6

Using default interface naming scheme 'v250'.
ID_NET_NAMING_SCHEME=v250
ID_NET_NAME_MAC=en0050b6856d36
hub0: MAC address identifier: hw_addr=00:50:b6:85:6d:36 → 0050b6856d36
ID_OUI_FROM_DATABASE=GOOD WAY IND. CO., LTD.
hub0: Parsing slot information from sysname "0000:00:14.0": success
hub0: dev_port=0
hub0: PCI path identifier: domain=0 bus=0 slot=20 func=0 phys_port= dev_port=0 → p0s20f0
hub0: USB name identifier: ports=4.1.3 config=2 interface=0 → u4u1u3c2
ID_NET_NAME_PATH=enp0s20f0u4u1u3c2

Using default interface naming scheme 'v250'.
ID_NET_NAMING_SCHEME=v250
wlp4s0: addr_assign_type=3, MAC address is not permanent.
wlp4s0: Parsing slot information from sysname "0000:04:00.0": success
wlp4s0: dev_port=0
wlp4s0: PCI path identifier: domain=0 bus=4 slot=0 func=0 phys_port= dev_port=0 → p4s0
ID_NET_NAME_PATH=wlp4s0
2021-12-17 19:07:42 +01:00
Anita Zhang
415d7d774a test: adjust MemoryHigh= on oomd extended test units
On some runs `sleep infinity` run by the user manager uses over 3M of
memory, which is higher than the MemoryHigh= set on testbloat and
testmunch. If no pgscan is generated, then systemd-oomd sorts by memory
usage which leads to a situation where testchill (using 3M) could be
targeted over testbloat (1M-2M).

Fix this by setting reasonable MemoryHigh= values for all of these test
units. Even if somehow testchill throttles a bit at 3M, testbloat and
testmunch should still be trying to use over 100M at memory and will
throttle down to 5M and 6M with the new values. This should reflect
the desired state in pgscan and memory usage during the test run.

Fixes #21684
2021-12-17 16:27:58 +00:00
наб
641e2124de kernel-install: replace 00-entry-directory with K_I_LAYOUT in k-i
341890de86 made "bootctl install" create
ESP\MID, in preparation of cf73f65089 that
followed it and created 00-entry-directory.install to make ESP\MID\KVER
if ESP\MID existed ‒ this meant that "bootctl install" followed by
"kernel-install $(uname -r) /boot/vml*$(uname -r) /boot/ini*$(uname -r)"
actually installed the kernel correctly.

Later, 31e57550b5 reverted the first
commit, meaning, that now running those two commands first installs
sd-boot, but then does nothing. Everything appears to work right,
nothing errors out, but no changes are actually done. To the untrained
eye (all of them), even running with -v appears to work:
all the hooks are run, as is depmod, but, again, nothing happens.

This is horrible. Nothing in either manpage suggests what to do
(nor should it, really), but the user is left with a bootloader that
appears fully funxional, since nothing suggests a failure in the output,
but with an unbootable machine, /no way to boot it/, even if they drop
to an EFI shell, since the boot bundle isn't present on the ESP,
and no real recourse even if they boot into a recovery system,
apart from installing like GRUB or whatever.

00- is purely instrumentation for 90-,
and separating one from the other has led to downstream dissatisfaxion
(indeed, the last mentioned commit cited cited exactly that as the
 reversion reason), while creating $ENTRY_DIR_ABS is only required
for bootloaders using the BLS, and shouldn't itself toggle anything.

To that end, introduce an /{e,l}/k/install.conf file that allows
overriding the detected layout, and detect it as "bls" if
$BOOT_ROOT/$MACHINE_ID ($ENTRY_DIR_ABS/..) exists, otherwise "other" ‒
if a user wishes to select a different bootloader,
like GRUB, they (or, indeed, the postinst script) can specify
layout=grub. This disables 90- and $ENTRY_DIR_ABS manipulation.
2021-12-17 14:57:56 +01:00
Luca Boccassi
ba679b8d56 logind: add a comment with a reminder why we don't use ProtrectProc=
Follow-up for https://github.com/systemd/systemd/pull/21785
2021-12-17 21:34:20 +09:00
Ludwig Nussel
60c5878dd4 logind: allow to read /proc
User name and tty are used for wall messages. For that to work logind
must be able to poke around in proc entries of other processes.
2021-12-17 12:18:16 +00:00
Zbigniew Jędrzejewski-Szmek
3c1af24182 udev/net_id: use STRLEN() to make code clearer
The code was correct, but looked suspicious: we were comparing
strlen(x) with sizeof(y), with looks like an off-by-one. But we actually
want x to be one longer than y, so that's fine. Let's use STRLEN() to
make this more obvious.

While at it, drop unnecessary "_" prefix.
2021-12-17 11:45:55 +01:00
Zbigniew Jędrzejewski-Szmek
be0586610e udev/net_id: fix signedness in format string
Both variables are unsigned. In practice those numbers cannot be large
enough to become negative, but let's use the correct type anyway.
2021-12-17 11:45:55 +01:00
Zbigniew Jędrzejewski-Szmek
a2968e8366 man: use unicode superscripts to indicate the exponent 2021-12-17 11:45:55 +01:00
Zbigniew Jędrzejewski-Szmek
56f9ce31b9 man: fix two typos 2021-12-17 11:45:55 +01:00
Yu Watanabe
21feba0a5c network: dhcp: logs received 6rd option
Addresses https://github.com/systemd/systemd/pull/21625#issuecomment-996109051.
2021-12-17 09:47:11 +00:00
Michael Biebl
5c18815dc0 test: mark TEST-46-HOMED as skipped if feature is disabled
See https://github.com/systemd/systemd/pull/21253#issuecomment-995721856
2021-12-16 21:41:49 +00:00
Michael Biebl
85e3a3a832 test: record missing openssl as a failure
The openssl binary is an optional dependency.
If systemd has been built with OpenSSL support, we want to test its
OpenSSL functionality.
So record a failure message in /failed if the binary is missing.

See https://github.com/systemd/systemd/pull/21724#issuecomment-992707614
2021-12-16 21:18:38 +00:00
Yu Watanabe
b0b1edc29b NEWS: fix typo 2021-12-17 04:12:14 +09:00
Yu Watanabe
616f51c16d boot: fix typo 2021-12-17 04:11:41 +09:00
Yu Watanabe
d9338387d9
Merge pull request #21786 from keszybz/dirent-work
Make FOREACH_DIRENT and FOREACH_DIRENT_ALL declare the iterator variables
2021-12-17 04:07:35 +09:00
Yu Watanabe
75e1378c0d
Merge pull request #21736 from yuwata/network-cleanups-for-drop-foreign-configs
network: cleanups for dropping foreign configs
2021-12-17 04:07:00 +09:00
Luca Boccassi
c6837e4e86
Merge pull request #21790 from keszybz/network-generator-always
Enable systemd-network-generator by default
2021-12-16 15:50:39 +00:00
Yu Watanabe
2347b6b94e test-network: wait for veth99 being configured
As the address, which should be kept, may not be just removed yet.
Let's check that the address is actually kept.
2021-12-17 00:14:30 +09:00
Yu Watanabe
8a20a8438f network: route: link_drop_foreign_routes() must be called only for managed interfaces 2021-12-17 00:14:30 +09:00
Yu Watanabe
f974f17ae7 networkd: check the existence of the route 2021-12-17 00:13:42 +09:00
Frantisek Sumsal
4bb3437cad
Merge pull request #21791 from mrc0mmand/TEST-64-tweaks
A couple of TEST-64-UDEV-STORAGE tweaks
2021-12-16 14:22:35 +00:00
Yu Watanabe
a71c5c44f7 network: address: minor optimization for link_drop_foreign_addresses()
link_address_is_dynamic() is costful in general. Call it only when
KeepConfiguration= is set.

Note, it is not necessary to check link->network in the loop, as we have
the assertion for that in the beginning of the function.
2021-12-16 22:43:18 +09:00
Yu Watanabe
9e86dba94b network: drop IPv6LL addresses manually configured in .network file 2021-12-16 22:43:18 +09:00
Zbigniew Jędrzejewski-Szmek
97b6ed3295 NEWS: update again 2021-12-16 14:18:09 +01:00
Zbigniew Jędrzejewski-Szmek
0c0bb433db
Merge pull request #21757 from DaanDeMeyer/boot-id
kernel-install: Introduce KERNEL_INSTALL_MACHINE_ID in /etc/machine-info
2021-12-16 13:47:17 +01:00
Daan De Meyer
357376d0bb kernel-install: Introduce KERNEL_INSTALL_MACHINE_ID in /etc/machine-info
If KERNEL_INSTALL_MACHINE_ID is defined in /etc/machine-info, prefer it
over the machine ID from /etc/machine-id. If a machine ID is defined in
neither /etc/machine-info nor in /etc/machine-id, generate a new UUID
and try to write it to /etc/machine-info as KERNEL_INSTALL_MACHINE_ID
and use it as the machine ID if writing it to /etc/machine-info succeeds.

In practice, this means we have a more robust fallback if there's no
machine ID in /etc/machine-id than just using "Default" and allows
image builders to force kernel-install to use KERNEL_INSTALL_MACHINE_ID
by simply writing it to /etc/machine-info themselves.
2021-12-16 12:24:42 +01:00
Zbigniew Jędrzejewski-Szmek
1c9b72f38e
Merge pull request #20559 from tomty89/stub_check_in_get
resolved: filter stub listeners in manager_get_dns_server()
2021-12-16 12:18:53 +01:00
Frantisek Sumsal
bd1660c4fa test: bump the timeout when collecting test coverage 2021-12-16 12:05:01 +01:00
Frantisek Sumsal
7b3a1af063 test: settle before checking logs
Otherwise we might miss the "Device path too long" message:

```
[   21.083274] testsuite-64.sh[374]: swapoff /dev/vda1
[   21.089841] testsuite-64.sh[376]: ++ mktemp
[   21.095115] testsuite-64.sh[271]: + logfile=/tmp/tmp.a1MULA35wL
[   21.095115] testsuite-64.sh[271]: + journalctl -b -q --no-pager -o short-monotonic -p info --grep 'Device path.*vda.?'\'' too long to fit into unit name'
...
[   21.277360] systemd[1]: testsuite-64.service: Main process exited, code=exited, status=1/FAILURE
[   21.277508] systemd[1]: testsuite-64.service: Failed with result 'exit-code'.
...
[   21.323500] systemd[1]: Device path '/sys/devices/pci0000:00/0000:00:03.0/0000:01:00.0/0000:02:00.0/0000:03:00.0/0000:04:00.0/0000:05:00.0/0000:06:00.0/0000:07:00.0/0000:08:00.0/0000:09:00.0/0000:0a:00.0/0000:0b:00.0/0000:0c:00.0/0000:0d:00.0/0000:0e:00.0/0000:0f:00.0/0000:10:00.0/0000:11:00.0/0000:12:00.0/0000:13:00.0/0000:14:00.0/0000:15:00.0/0000:16:00.0/0000:17:00.0/0000:18:00.0/0000:19:00.0/0000:1a:00.0/virtio0/block/vda/vda1' too long to fit into unit name, ignoring device.

```
2021-12-16 11:59:09 +01:00
Zbigniew Jędrzejewski-Szmek
c01543fdd5 meson: drop three more single-use convenience libraries
The way that the cryptsetup plugins were built was unnecessarilly complicated.
We would build three static libraries that would then be linked into dynamic
libraries. No need to do this.

While at it, let's use a convenience library to avoid compiling the shared code
more than once.

We want the output .so files to be located in the main build directory,
like with all consumable build artifacts, so we need to maintain the split
between src/cryptsetup/cryptsetup-token/meson.build and the main meson.build
file.

AFAICT, the build artifacts are the same: exported and undefined symbols are
identical. There is a tiny difference in size, but I think it might be caused
by a different build directory name.
2021-12-16 11:51:40 +01:00
Zbigniew Jędrzejewski-Szmek
3a4524116a meson: drop convenience library that was only used in one place
It doesn't make much sense to do this, the result is very similar to including
to objects directly in the output binary without going through an intermediate
target.

The linkage of test-libudev was rather strange too: udev_link_with is used to
allow udev to be linked to a static version of libshared, so that udev is not
linked to libshared.so. But here we were using both, defeating the purpose of
udev_link_with. I don't think it matters what the test is linked to, so let's
use the non-static linkage to save space.
2021-12-16 11:09:51 +01:00
Zbigniew Jędrzejewski-Szmek
03f7ddf0bf meson: stop building out convenience libraries by default
The meson default for static_library() are:
build_by_default=true, install=false. We never interact with the
static libraries, and we only care about them as a stepping-stone towards
the installable executables or libraries. Thus let's only build them if
they are a dependency of something else we are building.

While at it, let's drop install:false, since this appears to be the default.

This change would have fixed the issue with lib_import_common failing
to build too: we wouldn't attempt to build it.

In practice this changes very little, because we generally only declare static
libraries where there's something in the default target that will make use of
them. But it seems to be a better pattern to set build_by_default to false.
2021-12-16 11:01:08 +01:00
Zbigniew Jędrzejewski-Szmek
b93f018f57 meson: don't compile import sources four times
Use a 'convenience library' to do the compilation once and then link the
objects into all the files that need it. Those files are small, so this probably
doesn't matter too much for speed, but has the advantage that we don't get the
same error four times if something goes wrong.

The library is conditionalized in the same way importd itself, because we
cannot build it without the deps.
2021-12-16 10:54:46 +01:00
Zbigniew Jędrzejewski-Szmek
66aaca688f man: split out a paragraph and shorten the text about sd-network-generator
The ordering of the service wrt. to udevd is enforced by unit configuration,
so no need to tell the user about this. From users' POV, the only thing that
counts is that the unit is enabled and then the right thing happens.
2021-12-16 09:56:13 +01:00
Zbigniew Jędrzejewski-Szmek
e053f49272 units: enable systemd-network-generator by default
It is used by udevd and networkd. Since udevd is enabled statically, let's also
change the preset to "on". networkd is opt-in, so let's pull in the generator
when enabling networkd too.
2021-12-16 09:49:39 +01:00
Zbigniew Jędrzejewski-Szmek
67cb0d4725
Merge pull request #21766 from yuwata/network-generator-name-policy
network-generator: support setting NamePolicy=
2021-12-16 09:34:01 +01:00
Luca Boccassi
58f62d7079
Merge pull request #21784 from DaanDeMeyer/issue-21675
journal: Hole punching improvements
2021-12-15 22:38:00 +00:00