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

53949 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
546e57f51b gitattributes: mark more files as "binary"
This way we know that we shouldn't look for a spdx header in them.
2021-10-18 09:40:35 +02:00
Zbigniew Jędrzejewski-Szmek
d632e6fe3b tests: use !/usr/bin/env bash consistently
This adjustment was last done in f96bc66901,
but it seems some files were missed and some were added later.
2021-10-18 09:04:45 +02:00
Zbigniew Jędrzejewski-Szmek
7b3cec95db tests: add spdx headers to scripts and Makefiles 2021-10-18 09:04:45 +02:00
Zbigniew Jędrzejewski-Szmek
22d3cfe54c tests: add spdx license header to test unit/link/network/conf files
Those are all consumed by our parser, so they all support comments.
I was considering whether they should have a license header at all,
but in the end I decided to add it because those files are often created
by copying parts of real unit files. And if the real ones have a license,
then those might as well. It's easier to add it than to make an exception.
2021-10-18 09:04:45 +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
Zbigniew Jędrzejewski-Szmek
703c70ccd4 licensing: add two missing spdx headers
Both files were developed in our tree, so they are under the default license.
2021-10-18 09:04:45 +02:00
Zbigniew Jędrzejewski-Szmek
7b84e701a8 gitattributes: mark fuzz inputs that are pure binary as such
We also have a bunch of files that have some bytes and a lot
of text, like the journal export format. For those, it is still quite
useful when the tools try to diff them, so let's not mark those.
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
Yu Watanabe
cef916c743
Merge pull request #21023 from poettering/home-prepare-rename
homed: rename some functions
2021-10-17 04:32:07 +09: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
Piotr Drąg
22e5118cda po: add a false positive to POTFILES.skip 2021-10-16 14:42:17 +02:00
Max Resch
111c9ba6c2 [st-stub] documenting the .dtb section 2021-10-16 13:26:21 +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
Tony Asleson
1f1a2243c0 Add stand-alone dm-integrity support
This adds support for dm integrity targets and an associated
/etc/integritytab file which is required as the dm integrity device
super block doesn't include all of the required metadata to bring up
the device correctly.  See integritytab man page for details.
2021-10-15 10:19:54 -05:00
Lennart Poettering
0a51337df1
Merge pull request #20983 from mxre/feature/aarch64
[sd-stub] Add support for aarch64 booting via pe-entry point
2021-10-15 10:26:10 +02:00
Zbigniew Jędrzejewski-Szmek
0bb6699edc
Merge pull request #20980 from bluca/compat_readme
docs: add guidelines w.r.t. compatibility to docs/CONTRIBUTING.md
2021-10-15 09:49:29 +02:00
Zbigniew Jędrzejewski-Szmek
6b292fa17b
Merge pull request #20996 from yuwata/udevadm-trigger-debug
test: show debug and verbose message
2021-10-15 09:44:59 +02:00
Yu Watanabe
a6d4e83b8a unit: networkd does not require AF_ALG anymore
As khash is retired.
2021-10-15 09:25:38 +02:00
Tony Asleson
9a2a6ec4e3 dm-verity: Remove usage of integrity
There is a difference between dm-verity and dm-integrity.  Remove
usage of integrity from verity documentation in man pages and
target files.
2021-10-14 12:17:02 -05:00
Yu Watanabe
81218ac1e1
Merge pull request #21001 from poettering/alloca-safe
honour ALLOCA_MAX limit on all alloca() allocations, not just some
2021-10-15 00:57:27 +09:00
Lennart Poettering
82fb0911fc homework: fix incorrect error variable use 2021-10-15 00:56:57 +09:00
Yu Watanabe
3780f3993f
Merge pull request #21006 from DaanDeMeyer/mkosi-ordering
mkosi: Add number prefixes to per-distro files for easier overriding
2021-10-15 00:07:21 +09:00
Lennart Poettering
e3bde91293 doc: document that alloca_safe() and friends are the APIs to use 2021-10-14 15:57:52 +02:00
Lennart Poettering
2f82562bad alloc-util: add strdupa_safe() + strndupa_safe() and use it everywhere
Let's define two helpers strdupa_safe() + strndupa_safe() which do the
same as their non-safe counterparts, except that they abort if called
with allocations larger than ALLOCA_MAX.

This should ensure that all our alloca() based allocations are subject
to this limit.

afaics glibc offers three alloca() based APIs: alloca() itself,
strndupa() + strdupa(). With this we have now replacements for all of
them, that take the limit into account.
2021-10-14 15:57:52 +02:00
Lennart Poettering
5222651ecc journal: drop unnecessary +1 in newa() expression
newa() does this internally anyway, no need to do this explicitly.
2021-10-14 15:57:52 +02:00
Lennart Poettering
698cec65c4 tree-wide: port all calls to alloca() to alloca_safe() 2021-10-14 15:57:52 +02:00
Lennart Poettering
5e76324eea alloca-util: drop two unnecessary casts
memset() already returns void*, no need to cast it to that.
2021-10-14 15:57:52 +02:00
Lennart Poettering
9e1a759903 alloc-util: introduce new helper alloca_safe()
This is like alloca(), but does two things:

1. Verifies the allocation is smaller than ALLOCA_MAX
2. Ensures we allocate at least one byte

This was previously done manually in all invocations. This adds a handy
helper that does that implicitly.
2021-10-14 15:57:52 +02:00
Dan Streetman
a69f1dd9ca cgroup: when checking for legacy controllers, ignore any we don't care about 2021-10-14 14:57:49 +02:00
Daan De Meyer
6da99d33a4 Ignore local files in subdirectories of mkosi.default.d/ as well 2021-10-14 14:07:16 +02:00
Daan De Meyer
1427e56dfd mkosi: Add number prefixes to per-distro files for easier overriding
This allows developers to add override files to override per-distro settings.
2021-10-14 14:06:53 +02:00
Boqun Feng
506bbc8569 virt: Support detection for ARM64 Hyper-V guests
The detection of Microsoft Hyper-V VMs is done by cpuid currently,
however there is no cpuid on ARM64. And since ARM64 is now a supported
architecture for Microsoft Hyper-V guests[1], then use DMI tables to
detect a Hyper-V guest, which is more generic and works for ARM64.

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7aff79e297ee1aa0126924921fd87a4ae59d2467
2021-10-13 22:22:24 +02:00
Luca Boccassi
0bc0726ead
Merge pull request #21002 from poettering/watchdog-off
minor tweaks to watchdog configuration logic
2021-10-13 20:03:06 +01:00