Commit Graph
100 Commits
Author SHA1 Message Date
Yu Watanabe 0fb613000d test-network: disable NDISC on veth-peer
This should speed the tests up.
2021-02-03 22:09:07 +00:00
Yu Watanabe 27897cecff Merge pull request #18319 from yuwata/udev-move-tx-rx-queues
network,udev: move TransmitQueues=/ReceiveQueues= from .network to .link
2021-02-03 18:18:57 +09:00
Yu Watanabe 89d2da287b Merge pull request #18423 from DaanDeMeyer/sd-boot-no-include
More sd-boot cleanups
2021-02-03 15:04:26 +09:00
Yu Watanabe face9fcc16 network,udev: move TransmitQueues=/ReceiveQueues= from .network to .link
As the settings are mostly hardware setup, and merely see from network
layer.

See also discussions in
https://github.com/systemd/systemd/pull/18170#issuecomment-758807497
https://github.com/orgs/systemd/teams/systemd/discussions/1
2021-02-03 14:44:51 +09:00
Yu Watanabe 1f8dc96c06 udev: rename TxQueueLength= -> TransmitQueueLength=
As we usually (unfortunately not always though) do not use abbreviations.

Tx may be standard abbreviation, but we already have e.g.
TransmitChecksumOffload=. So, let's use Transmit instead of Tx.

Follow-up for ef4a91a7e8.
2021-02-03 14:43:49 +09:00
Yu Watanabe ecf83c2429 libudev: add one more assertion 2021-02-02 03:23:31 +09:00
Yu Watanabe 65c637ad2c libudev: unset uptodate flag before free()ing entries
udev_list_entry_free() also removes the entry from LIST if the flag is
set. This slightly optimizes the cleanup logic.
2021-02-02 02:34:23 +09:00
Yu Watanabe 8e5ce38727 libudev: also drop the entry from LIST even if unique flag is set
Otherwise, the list becomes dirty when an entry is freed.

This also remove the entry from the hashmap only when its name is set.
The name should be always set, so that does not change anything. But
just for safety.
2021-02-02 02:28:33 +09:00
Yu Watanabe 140716a516 libudev: set entry->list after the entry is stored in the list
This should not change anything. As hashmap_remove() is called before
hashmap_ensure_put(). So, even if hashmap_ensure_put() fails, a wrong
entry will not removed from the hashmap by udev_list_entry_free().
But anyway, just for safety.
2021-02-02 02:22:59 +09:00
Yu Watanabe eaef130d3f libudev: use hashmap_ensure_put() 2021-02-02 02:22:35 +09:00
Yu Watanabe 8ccc31d498 network: drop one more link_dirty()
Follow-up for 9092113d93.

link_dirty() will be called later in this function when a DNS or domain
is dropped.
2021-02-01 01:11:44 +09:00
Yu Watanabe 5caac53adb Merge pull request #18417 from DaanDeMeyer/sd-boot-no-include
sd-boot fixes
2021-01-31 22:26:59 +09:00
Yu Watanabe 37baf8db56 Merge pull request #18380 from yuwata/test-network-ipv6-proxy-ndp
test-network: add tests for IPv6ProxyNDPAddress=
2021-01-27 10:47:36 +09:00
Yu Watanabe f0d87798ea test-network: retry several times if expected LLDP info is not obtained
As LLDP thing does not get involved in the link status, `networkctl lldp`
may not provide an expected information even if the link is in
'configured' state.

Fixes #17360.
2021-01-26 18:48:44 +01:00
Yu Watanabe 190d05c0e7 network: drop unnecessary condition in error path
See neigh_add() in kernel. It does not return EEXIST.
2021-01-27 01:28:28 +09:00
Yu Watanabe 4816e7bb75 network: drop wrong flag for neighbor entry
NLM_F_REQUEST is a nlmsg flag, not a neighbor flag.
2021-01-27 01:28:28 +09:00
Yu Watanabe cff0cadcac test-network: add tests for IPv6ProxyNDPAddress= 2021-01-27 01:28:28 +09:00
Yu Watanabe 49f2369377 sd-device: do not use downgrade-to-bool feature 2021-01-27 00:01:02 +09:00
Yu Watanabe d6ae82bdd9 sd-netlink: fix indentation 2021-01-26 23:58:08 +09:00
Yu Watanabe 22d33e8090 sd-netlink: do not use downgrade-to-bool feature 2021-01-26 23:57:59 +09:00
Yu Watanabe 679dab6a8f docs/ENVIRONMENT: move entry for systemd-udevd
`$SYSTEMD_REBOOT_TO_FIRMWARE_SETUP=` or friends are for logind.
2021-01-26 13:45:47 +00:00
Yu Watanabe ce634c4a4d sd-device: use size_t for index in the loop 2021-01-26 20:35:53 +09:00
Yu Watanabe 61c0972dad sd-device: use string_hash_ops_free_free 2021-01-26 20:26:33 +09:00
Yu Watanabe 327379f5f2 sd-device: add a short comment why we simply return negative errno here on failure 2021-01-26 20:07:38 +09:00
Yu Watanabe 4f1ef7f9e0 sd-device: rename variables and use TAKE_PTR() 2021-01-26 19:56:13 +09:00
Yu Watanabe dd75bbee43 sd-device: use string_hash_ops_free_free 2021-01-26 19:52:56 +09:00
Yu Watanabe 4c6eb1d77d Merge pull request #18371 from yuwata/use-ansi-normal
tree-wide: use ansi_normal() instead of ANSI_NORMAL
2021-01-25 23:40:14 +09:00
Yu Watanabe 5312fa8751 Merge pull request #18281 from yuwata/log-drop-log-realm
log: drop LogRealm
2021-01-25 23:39:29 +09:00
Yu Watanabe 6d533e56f8 cgtop: use ansi_normal() or friends instead of ANSI_NORMAL 2021-01-25 20:52:53 +09:00
Yu Watanabe cd7ae1b44e logs-show: simplify code 2021-01-25 20:52:20 +09:00
Yu Watanabe bb146d238f terminal-util: use ansi_normal() or friends instead of ANSI_NORMAL 2021-01-25 20:52:12 +09:00
Yu Watanabe 7b376b29a3 log: use ansi_normal() instead of ANSI_NORMAL 2021-01-25 20:52:03 +09:00
Yu Watanabe 9fdee66f2d log: drop unused LogRealm
Already no binary is built with LOG_REALM= argument.
Hence, we can safely drop LogRealm now.
2021-01-25 20:32:18 +09:00
Yu Watanabe 3cc6b14a87 udev: stop to use LOG_REALM_UDEV
Before this commit, udevd is built with LOG_REALM=LOG_REALM_UDEV.
However, log level specified by e.g. environment variable or kernel
command line option are also passed to LOG_REALM_SYSTEMD. So, the
maximum log level for the two realms are always equivalent, and it is
not necessary to specify the build option. Hence drop it.
2021-01-25 20:32:18 +09:00
Yu Watanabe 10d296c189 selinux-util: do not use log_internal_realm() without setting log realm 2021-01-25 20:32:18 +09:00
Yu Watanabe 5df4f46f28 log: drop unused log_full_errno_realm() macro 2021-01-25 20:32:18 +09:00
Yu Watanabe f190ac486e hostname: accept an empty hostname to unset transient hostname
Follow-up for 60e4fb4240.

Before 60e4fb4240,
`hostnamectl --transient set-hostname ""` unsets the transient hostname.
But after the commit, it is refused. This fixes the issue.
2021-01-22 07:40:26 +01:00
Yu Watanabe abcf60e730 dhcp: use conservative_rename() 2021-01-22 12:55:54 +09:00
Yu Watanabe af664001f5 network: use conservative_rename() to reduce to trigger network events
networkd part to fix #17577.

Note resolved part is f3e1f00d03.
2021-01-22 12:55:54 +09:00
Yu Watanabe 10195179bb fs-util: rename conservative_rename() -> conservative_renameat()
And this introduces conservative_rename() which does not take dirfd.
2021-01-22 12:55:54 +09:00
Yu Watanabe 9092113d93 network: drop many unnecessary link_dirty() calls
Now link state saves mostly link state, DNS and NTP settings, .network
file name. So, it is not necessary to call link_dirty() e.g. when an
address is updated. This drops such unnecessary link_dirty() calls.
2021-01-22 12:55:51 +09:00
Yu Watanabe 92395e0e83 network: do not re-assign static routes when dynamic IPv6 addresses are updated
This effectively reverts 6545067aa9.

Unlike IPv4 addresses, routes are not removed when IPv6 addresses are
removed. So, it is not necessary to re-assign routes.
2021-01-22 12:53:18 +09:00
Yu Watanabe 3e405f28f4 Merge pull request #16228 from ddstreet/administrative_state
Add ActivationPolicy= [Link] parameter
2021-01-22 12:11:29 +09:00
Yu Watanabe 33f7b61ca5 Merge pull request #18329 from poettering/notify-chroot
chroot/sd_notify() fixes
2021-01-21 13:16:59 +09:00
Yu Watanabe 4723205968 Merge pull request #18311 from poettering/sysext-fixups
sysext: post-merge fixups
2021-01-21 07:20:04 +09:00
Yu Watanabe 4dbc0be2e5 udev/cdrom_id: re-enable logging related functions
The logging related functions are mistakenly located in main() by
a084b38789, and dropped by
23afa884d4.
2021-01-20 18:31:10 +00:00
Yu Watanabe 888f65ace6 path-util: simplify check_x_access()
Follow-up for ece852c845.

This addresses the following comments by the Lennart:
---
hmm, so this now does two access() calls for the case where the fd is
not requested, and opens things up for races (theoretically, …). now,
the access() code path was in place for optimization, but if an optimization
is less sexy than the original (and i think it is less sexy, since more
than one syscall, and non-atomic), i think we shouldn't do the optimization.

maybe we should just always use open(O_PATH) now, and then fstat() it to
check if regular file, and then access_fd() it for checking if its executable.
2021-01-20 17:43:36 +01:00
Yu Watanabe 7b5ed18779 Merge pull request #18294 from ssahani/net-2
tree wide use ensure_put
2021-01-19 16:46:41 +09:00
Yu Watanabe 29d65a4388 Merge pull request #18303 from yuwata/verity-cleanup
veritysetup-generator: drop unused struct and variable
2021-01-19 12:22:55 +09:00
Yu Watanabe 7e2757c42f Merge pull request #18038 from yuwata/meson-split
meson: various cleanups
2021-01-19 12:22:34 +09:00
Yu Watanabe 4c6dd238b8 Merge pull request #18267 from lucaswerkmeister/truncate
Two StandardOutput=truncate:file improvements
2021-01-19 08:47:39 +09:00
Yu Watanabe ceed428305 Merge pull request #18299 from ssahani/ensure-put
More use of hashmap_ensure_put and ordered_hashmap_ensure_put
2021-01-19 08:42:26 +09:00
Yu Watanabe 13a4e9f209 TODO: fix typo 2021-01-19 07:22:48 +09:00
Yu Watanabe 71ce3ba25b veritysetup-generator: drop unused struct and variable
Follow-ups for 08b04ec7e7.

This also drops unnecessary inclusion.

Fixes CID#1443889.
2021-01-19 07:21:57 +09:00
Yu Watanabe 024e9084c1 meson: move several definitions related libsystemd to src/libsystemd/meson.build 2021-01-19 07:06:32 +09:00
Yu Watanabe 40dbce36df meson: use static_libsystemd_pic 2021-01-19 07:06:32 +09:00
Yu Watanabe a0e150b2f4 meson: add missing license header 2021-01-19 07:06:32 +09:00
Yu Watanabe e025c9dfe3 meson: move test or fuzzer definitions to relevant meson.build in subdirectories 2021-01-19 07:06:32 +09:00
Yu Watanabe b5c34d6bf1 meson: drop unused variable 2021-01-19 07:06:32 +09:00
Yu Watanabe 04e7ada0d7 meson: drop unnecessary files from test definitions 2021-01-19 07:06:32 +09:00
Yu Watanabe 74b28f2b36 meson: drop unnecessary libraries from journal related tests 2021-01-19 07:06:32 +09:00
Yu Watanabe 8d40961c3c meson: slightly disentangle code dependencies
But, still sd-id128 is used in src/basic.
2021-01-19 07:06:32 +09:00
Yu Watanabe b61016f207 meson: sort inclusion of meson.build files in subdirectories 2021-01-19 07:06:32 +09:00
Yu Watanabe 529642936b meson: move libjournal_core definition to src/journal/meson.build 2021-01-19 07:06:32 +09:00
Yu Watanabe 3976f372ae meson: move libudev related definitions to src/libudev/meson.build
Also, this makes libudev.so built in build directory.
2021-01-19 07:06:32 +09:00
Yu Watanabe f6fe732ff3 meson: move and gather find_program() 2021-01-19 07:06:32 +09:00
Yu Watanabe 73e994f291 meson: drop redundant source files in executable() 2021-01-19 07:06:32 +09:00
Yu Watanabe 0275e918af meson: move source file list for systemd-xdg-autostart-generator and its tests 2021-01-19 07:06:32 +09:00
Yu Watanabe f98df767e1 meson: move source file list for busctl 2021-01-19 07:06:32 +09:00
Yu Watanabe 2ad279cfa4 meson: move source file list for systemd-cryptenroll 2021-01-19 07:06:32 +09:00
Yu Watanabe b4d1892aac meson: move source file list for systemd-cryptsetup 2021-01-19 07:06:32 +09:00
Yu Watanabe 18b49798a6 meson: show standalone-binaries setting in the summary 2021-01-19 07:06:32 +09:00
Yu Watanabe d33b0daa6c meson: use condition argument in test definition 2021-01-19 07:06:32 +09:00
Yu Watanabe cbaaf7b9dd meson: drop redundant directory specification in additional source files 2021-01-19 07:06:32 +09:00
Yu Watanabe c35125732f meson: move definition of systemctl source files 2021-01-19 07:06:29 +09:00
Yu Watanabe f5a5284ea1 meson: introduce libtimesyncd_core library 2021-01-19 07:04:19 +09:00
Yu Watanabe b09f01463a meson: enable several tests even if the relevant features are disabled 2021-01-19 07:04:19 +09:00
Yu Watanabe a28c0617de meson: fix indentation 2021-01-19 07:04:19 +09:00
Yu Watanabe 4fc47fa82a meson: drop unnecessary variable declarations 2021-01-19 07:04:19 +09:00
Yu Watanabe 7087e4729f meson: drop unnecessary loop 2021-01-19 07:04:19 +09:00
Yu Watanabe 6969a671d9 test: drop bus-util.h from sd-bus
To drop src/shared from include directories to build libsystemd.so later.
2021-01-19 07:04:19 +09:00
Yu Watanabe 0159eee04a efi: create symbolic link to efi/loader-feature.h
To drop src/boot/efi from include directories for binaries later.
2021-01-19 07:04:19 +09:00
Yu Watanabe c11e5f43d2 util: move several DNS related definitions to src/basic/dns-def.h
DNS_HOSTNAME_MAX is used by sd-resolve, but it was defined in
src/shared/dns-domain.h. The library libsystemd should be independent
of source files under src/shared.
2021-01-19 07:04:19 +09:00
Yu Watanabe af182ae1dc util: move unit-file.[ch] to src/basic
As basic/path-lookup.[ch] depend on them.
2021-01-19 07:04:19 +09:00
Yu Watanabe 22eadc289b util: move parse_syscall_and_errno() to seccomp-util.c
This makes parse-util.c independent of seccomp-util.c, which is located
in src/shared.
2021-01-19 07:04:19 +09:00
Yu Watanabe 09f7c7c668 fuzzers: move several fuzzers 2021-01-19 07:04:19 +09:00
Yu Watanabe c5abccfa58 meson: fix indentation 2021-01-19 07:04:19 +09:00
Yu Watanabe 5acb3cabd1 meson: make the second and third elements of tests or fuzzers optional
Then, we can shorten many test definitions.
2021-01-19 07:04:19 +09:00
Yu Watanabe 9aeec01e77 test: move test-umount.c to src/shutdown
Then, we can drop src/shutdown from include directories later.
2021-01-19 07:04:19 +09:00
Yu Watanabe bac11cd667 core: move several source files to src/shared
As, the files are used by many executables, fstab-generator, remount-fs,
machine-id-setup, and etc.
With this change, the total size of the relevant executables and
libshared slightly decreases.

Before:
```
$ ll systemd-fstab-generator systemd-remount-fs systemd-machine-id-setup systemd-shutdown systemd-nspawn systemd src/shared/libsystemd-shared-247.so
-rwxrwxr-x 1 watanabe watanabe 7577800 Jan  5 13:35 src/shared/libsystemd-shared-247.so
-rwxrwxr-x 1 watanabe watanabe 4608360 Jan  5 13:35 systemd
-rwxrwxr-x 1 watanabe watanabe  117240 Jan  5 13:35 systemd-fstab-generator
-rwxrwxr-x 1 watanabe watanabe   61576 Jan  5 13:35 systemd-machine-id-setup
-rwxrwxr-x 1 watanabe watanabe  853080 Jan  5 13:35 systemd-nspawn
-rwxrwxr-x 1 watanabe watanabe   70600 Jan  5 13:35 systemd-remount-fs
-rwxrwxr-x 1 watanabe watanabe  172624 Jan  5 13:35 systemd-shutdown
```
Total: 13461280

After:
```
$ ll systemd-fstab-generator systemd-remount-fs systemd-machine-id-setup systemd-shutdown systemd-nspawn systemd src/shared/libsystemd-shared-247.so
-rwxrwxr-x 1 watanabe watanabe 7658336 Jan  5 13:32 src/shared/libsystemd-shared-247.so
-rwxrwxr-x 1 watanabe watanabe 4523560 Jan  5 13:32 systemd
-rwxrwxr-x 1 watanabe watanabe   78288 Jan  5 13:32 systemd-fstab-generator
-rwxrwxr-x 1 watanabe watanabe   30984 Jan  5 13:32 systemd-machine-id-setup
-rwxrwxr-x 1 watanabe watanabe  840384 Jan  5 13:32 systemd-nspawn
-rwxrwxr-x 1 watanabe watanabe   39104 Jan  5 13:32 systemd-remount-fs
-rwxrwxr-x 1 watanabe watanabe  117160 Jan  5 13:32 systemd-shutdown
```
Total: 13287816
2021-01-19 07:04:19 +09:00
Yu Watanabe 772e0a76f3 test: rewrite test-sd-device-thread.c to depend only on libsystemd
Similarly, this makes test-udev-device-thread.c depend only on libudev.
2021-01-19 07:04:19 +09:00
Yu Watanabe 261fc53b99 test: move tests for libudev into src/libudev 2021-01-19 07:04:19 +09:00
Yu Watanabe cf2423503b time-wait-sync: move time-wait-sync.c -> src/timesync/wait-sync.c
As wait-online is located under src/network.
2021-01-19 07:04:19 +09:00
Yu Watanabe e2e7888191 xdg: move tests for xdg-autostart-generator
Then, we can drop src/xdg-autostart-generator from include directories
later.
2021-01-19 07:04:19 +09:00
Yu Watanabe a79e17234d meson.build: drop unused variable 2021-01-19 07:04:19 +09:00
Yu Watanabe 0703d2f6c4 test: move test-systemd-tmpfiles.py from src/test to test
As the other test scripts, e.g. test-sysusers.sh, are located under
test rather than src/test.
2021-01-19 07:04:19 +09:00
Yu Watanabe 0f46548deb login: move src/login/logind-acl.[ch] -> src/shared/devnode-acl.[ch]
The files are used by logind and udevd. And the functions in the files
are not specific to logind, and quite general enough to move to
libshared.
2021-01-19 07:04:19 +09:00
Yu Watanabe 100fd93f55 tmpfiles: move offline-passwd.[ch] to src/tmpfiles
offline-passwd.[ch] are only used by systemd-tmpfiles and the relevant
test. And are not included in libshared. So, it is not suitable to
located under src/shared.
2021-01-19 07:04:18 +09:00
Yu Watanabe 99b9f8fddd sd-journal: move source files for sd-journal to src/libsystemd/sd-journal 2021-01-19 07:04:18 +09:00
Yu Watanabe b9b442a0cc analyze: resolve executable path if it is relative
Fixes #18252.
2021-01-19 06:39:25 +09:00