1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-23 17:34:00 +03:00
Commit Graph

35527 Commits

Author SHA1 Message Date
Lennart Poettering
aabb252577
Merge pull request #20905 from medhefgo/boot-cleanup
sd-boot: Code cleanups
2021-10-19 10:23:12 +02:00
Zbigniew Jędrzejewski-Szmek
33539ffe59
Merge pull request #20988 from DaanDeMeyer/rotate-reason
journal: Improve rotation logging
2021-10-19 09:53:31 +02:00
Zbigniew Jędrzejewski-Szmek
b5d26617bb
Merge pull request #21037 from yuwata/network-dhcp6-pd-simplify-distribute
network: dhcp6-pd: simplify dhcp6_pd_prefix_distribute()
2021-10-19 09:24:38 +02:00
Zbigniew Jędrzejewski-Szmek
221e9cfe4b
Merge pull request #21036 from yuwata/network-dhcp6-pd-manage-prefix-with-hashmap
network: dhcp6-pd: manage prefix with hashmap
2021-10-19 09:22:32 +02:00
Vincent Bernat
33331d116d utmp: remove /dev from line
utmp(5) says `ut_line` is the device name minus the leading "/dev/". Therefore,
remove it. Without that, when using UtmpMode=user, we get `/dev/tty` in the
output of `last`/`w`.
2021-10-19 09:21:54 +02:00
Zbigniew Jędrzejewski-Szmek
07721d1380
Merge pull request #21038 from yuwata/network-dhcp6-pd-fix-address-check
network: dhcp6-pd: fix address check
2021-10-19 09:16:09 +02:00
Yu Watanabe
38f8ae2c48 network: neighbor: fix log message 2021-10-19 09:07:30 +02:00
Yu Watanabe
0522729e19 tree-wide: use AF_NETLINK instead of PF_NETLINK 2021-10-18 22:46:37 +02:00
Lennart Poettering
ec3f41e09c
Merge pull request #21034 from poettering/homed-password-cache-tweaks
homed: minor tweaks to the PasswordCache logic
2021-10-18 22:46:16 +02:00
Lennart Poettering
be0398bd4b
Merge pull request #21028 from poettering/watchdog-fixlets
pid1: various small watchdog tweaks and fixes
2021-10-18 22:45:44 +02:00
Lennart Poettering
a74e2e447f homework: move allocation/destruction into outer/generic scope
Previously in most cases we'd allocate the HomeSetup context object
in generic code in homework.c. But for some cases we allocated them
instead inside the specific code in homework-{cifs,directory,luks}.c
Let's clean that up, and systematically allocate it in the outer
"entrypoint" calls in homework.c instead of the inner ones.

This doesn't change much in behaviour (i.e. it just means when something
fails we'll now clean it up one stack frame further up). But it will
allow is to more easily work with the context objects, since we'll have
them around in all stack frames.
2021-10-18 22:45:19 +02:00
Lennart Poettering
4e660eca45 homework: unify code that opens the backing image file in open_image_file()
Also, reuse an already opened image file if we have one.
2021-10-18 22:41:34 +02:00
Yu Watanabe
d205851dbe network: dhcp6: use IPv6 specific functions 2021-10-19 00:57:32 +09:00
Yu Watanabe
cde09c3450 network: dhcp6: manage assigned downstream prefixes by using Hashmap
When a system has thousands of downstream interfaces, previously the
total cost of finding free subnet ID was O(n^2), where n is the number
of downstream interfaces.

This makes assigned prefixes are managed by Manager with Hashmap. So,
the cost becomes O(n log n).
2021-10-19 00:57:23 +09:00
Yu Watanabe
742c2f217f network: dhcp6: shorten code a bit 2021-10-19 00:55:55 +09:00
Yu Watanabe
63e43d0800 network: dhcp6: always assign prefix through dhcp6_pd_assign_prefix()
For uplink interface, we request Assign= is enabled in the above.
So, we can always use dhcp6_pd_assign_prefix().

Just a minor simplification for later commits.
2021-10-19 00:54:45 +09:00
Yu Watanabe
06d1105e54 network: dhcp6pd: check if address is ready only when Assign=yes 2021-10-19 00:54:01 +09:00
Yu Watanabe
d9098371df network: add missing DHCPv6PD address check 2021-10-19 00:53:53 +09:00
Daan De Meyer
b2b7cf1df5 journal: Expand rotate log messages in journald
Make sure we always log when we rotate journals and always do so at
least at INFO log level. Doing so we make sure there's always a clear
reason available explaining why we rotated a journal.
2021-10-18 16:48:13 +01:00
Daan De Meyer
012181eaef journal: Add two more log messages to journal_file_rotate_suggested()
This ensures every reason for rotation has an associated log message.
2021-10-18 16:48:06 +01:00
Lennart Poettering
3361d1ca1b homework: mae sure PasswordCache is really optional
It was supposed to be optional (i.e. there's a reason why we never
assert()ed on it), and in many codepaths it is, let's make sure it is
everywhere.
2021-10-18 15:35:41 +02:00
Lennart Poettering
37a1bf7f76 homework: make PasswordCache const wherever we can 2021-10-18 15:34:32 +02:00
Daan De Meyer
c8e6e1f10d journal: Add log level argument to journal_file_rotate_suggested()
When journald is rotating a file, we'd like to log the reason at
LOG_INFO or higher instead of LOG_DEBUG. For journalctl --header,
logging the reason at a level higher than LOG_DEBUG doesn't really
make sense. To accomodate both use cases, make the log level used
by journal_file_rotate_suggested() configurable.
2021-10-18 15:26:06 +02:00
Luca Boccassi
e740cdb6f1
Merge pull request #21026 from keszybz/licensing-info-for-generated-files
Licensing info for generated files
2021-10-18 13:08:36 +01:00
Lennart Poettering
d9752ca196 watchdog: fix fd validity check 2021-10-18 11:27:39 +02:00
Lennart Poettering
ef52fa5bd1 watchdog: drop unnecessary variable 2021-10-18 11:27:39 +02:00
Lennart Poettering
59bcac0b1a watchdog: always prefer /dev/watchdog0 over /dev/watchdog 2021-10-18 11:27:39 +02:00
Lennart Poettering
a73b7b1b0e watchdog: fix error code handling 2021-10-18 11:27:39 +02:00
Zbigniew Jędrzejewski-Szmek
0fdf494834 fuzz-fido-id-desc: drop unused case file
It wasn't picked up automatically because it's not in
test/fuzz/fuzz-fido-id-desc/. But looking at the contents, it doesn't seem to
be in the expected input format either.
2021-10-18 09:43:18 +02:00
Zbigniew Jędrzejewski-Szmek
010b5f35f3 bpf: fix SPDX short identifier for LGPL-2.1-or-later 2021-10-18 09:04:45 +02:00
Lennart Poettering
e1df968b33 homed: replace "already_activated" boolean parameter by a flags value
This is mostly preparation for further defined flags to be added in
later PRs/commits.

No change in behaviour just the flagsification.
2021-10-17 22:20:05 +02:00
Jan Janssen
a36a0d1540 macro: Move ALIGN_TO to macro-fundamental.h and introduce CONST_ALIGN_TO 2021-10-17 11:56:05 +02:00
Jan Janssen
53f69d671c sd-boot: Require gnu-efi 3.0.5
This version is from 2017 and should be stale enough to not cause
an outrage. All the relevant distros have it or a newer version.

We also already depend on some symbols defined in 3.0.5 anyway,
so let's take the opportunity to reduce our missing_efi.h
baggage.
2021-10-17 11:56:05 +02:00
Jan Janssen
12f32748aa sd-boot: Get rid of uefi_call_wrapper
The uefi_call_wrapper exists to convert to the right calling convention
and presumably predates compilers that can do so natively. The only
architecture where this is even needed is x86_64.
But because we are building with GNU_EFI_USE_MS_ABI defined, the
EFIAPI macro tells the compiler to use the right calling convention
for EFI functions. Our shim callback (which is called by EFI itself)
already relies on this.

This also adds a safety check to make se we are compiling with
GNU_EFI_USE_MS_ABI defined and also adds it to the compiler args
unconditionally. It is only used with x86_64 anyways, so it should
be fine to do so. EFI_FUNCTION_WRAPPER is unused in gnu-efi, so
it is dropped.
2021-10-17 11:55:57 +02:00
Jan Janssen
70cd15e97b sd-boot: Convert VOID -> void
We are already using void in several places and having a screaming
typedef for void feels pointless. There are also CONST, IN, OUT
and OPTIONAL which we aren't using either.

This leaves missing_efi.h to keep it in line with how they are
defined in gnu-efi and/or the specs.
2021-10-17 11:54:17 +02:00
Jan Janssen
f69434002c sd-boot: Rework print_status()
A little helper function and some unusual formatting makes this
whole thing a lot easier on the eyes. Also, right-aligning the
properties for better readability at runtime.
2021-10-17 11:52:36 +02:00
Jan Janssen
6ae9a5a0bb sd-boot: Rearm the watchdog in console_key_read
Let's not disable the watchdog at all and instead rearm it inside
of console_key_read(). This way, we are covered by the watchdog everywhere.
2021-10-17 11:52:36 +02:00
Jan Janssen
9f04812331 sd-boot: Check for OOM in some places 2021-10-17 11:52:36 +02:00
Lennart Poettering
e00324d092
Merge pull request #21013 from mxre/feature/stub-dtb
[sd-stub] add support for embedding devicetree
2021-10-17 11:27:03 +02:00
Lennart Poettering
66aa51f8f9 homed: rename home_setup_undo() → home_setup_done()
This function is a destructor, hence it should be named like one.

(We usually use xyz_free() for a destructor that frees the object passed
itself. xyz_unref() we typically use for destructors that are similar,
but ref counted. xyz_done() usually is used for destructors which free
the members of an object, but not the object itself – to allow stack
allocation of objects. We don't strictly follow this, but it's good to
stick to rules wherever we can.)

No actual code change, just renaming.
2021-10-16 14:48:10 +02:00
Lennart Poettering
aa0a6214e2 homed: rename home_prepare*() → home_setup*()
These set of functions are constructors for an object called HomeSetup,
which has a destructor home_setup_undo(), hence to be reasonably
symmetric, let's call it home_setup*() too, instead of using a new verb
"prepare" for its name.

No actual code changes, just some renaming.
2021-10-16 14:47:57 +02:00
Lennart Poettering
e1ab663575 homework: reuse home_validate_update_luks() at one more place
We have the same code at two places, let's reuse it. Given the more
generic scope let's rename the function home_get_state() since it
retrieve the current setup state of the LUKS logic.
2021-10-16 10:13:02 +02:00
Lennart Poettering
c8e2a76807 homework: remove duplicate error logging when doing ext4 resizes 2021-10-16 10:12:15 +02:00
Lennart Poettering
fc4941d61c homework: let's simply some code via erase_and_free() 2021-10-16 10:11:42 +02:00
Lennart Poettering
48f462547d homed,shutdown: call valgrind magic after LOOP_GET_STATUS64
valgrind doesn't understand LOOP_GET_STATUS64. We already work around
this in various placed, via VALGRIND_MAKE_MEM_DEFINE(), but we forgot
three places. Let's fix that.
2021-10-16 10:11:15 +02:00
Yu Watanabe
c14e57356f userdb: fix type to pass to connect()
Fixes https://github.com/systemd/systemd/pull/20613#issuecomment-944621275.
2021-10-16 10:10:51 +02:00
Max Resch
33bc9b756e [sd-stub] add support for embedding devicetree 2021-10-15 21:47:42 +02:00
Lennart Poettering
eaaa02bffe
Merge pull request #20902 from tasleson/integritysetup-generator
Add stand-alone dm integrity support
2021-10-15 18:57:17 +02:00
Lennart Poettering
2aa94bb88a homework: only do image locks for regular image files
If an image file is actually a block device taking a lock on it doesn't
really make sense for us: it will interfere with udev's block device
probing logic, and it's not going to propagated across the network
anyway (which is what we are after here). Hence simply don't do it.

Follow-up for 2aaf565a2d
2021-10-15 18:03:32 +02:00
Lennart Poettering
6a1301d8c9 homework: don't bother with BLKRRPART on images that aren't block devices
We currently call this ioctl even if we are backed by a regular file,
which is actually the common case. While this doesn't really hurt, it
does result in very confusing logs.
2021-10-15 18:03:12 +02:00