1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-12 09:17:44 +03:00
Commit Graph

57951 Commits

Author SHA1 Message Date
Benjamin Franzke
ae00bafdf8 docs: improve table readability
Let the table span more than the default content width,
if the table contains alot of data (controlled by width: auto)
(720px is very good for continuous text, but too narrow for tables).

The container class is therefore adapted to put the
width restriction on the elements itself, allowing for
exceptions for individual elements like <table> and
<h1> (which used an offset margin before and is now
streamlined to use a max-width as well).

Also add a striped background to ease reading rows
and allow for horizontal mobile scrolling without
overflowing the entire document, only the table itself.
2022-05-21 22:41:21 +01:00
Luca Boccassi
ebd4571e31
Merge pull request #22550 from medhefgo/boot-mixed
boot: EFI mixed mode support
2022-05-21 22:38:56 +01:00
Luca Boccassi
1f9aa3d2a6 resolved: default to OpenSSL
If both gnutls and openssl are available, prefer openssl.
We are gradually moving toward supporting openssl only as the
crypto library, and the resolved gnutls backend will be dropped
at some point, so start nudging users toward the openssl one.
2022-05-21 18:13:38 +02:00
Zbigniew Jędrzejewski-Szmek
6be96a9aed
Merge pull request #23460 from keszybz/docs-redirect
docs: rename COREDUMP_PACKAGE_METADATA → ELF_PACKAGE_METADATA
2022-05-21 18:11:18 +02:00
Benjamin Franzke
9ba7734f1e docs: adapt forward layout to systemd.io design 2022-05-21 18:09:50 +02:00
Zbigniew Jędrzejewski-Szmek
d4224b9cc7 docs: rename COREDUMP_PACKAGE_METADATA → ELF_PACKAGE_METADATA
The format described by this document is used not only for coredumps,
but also for other purposes, so we've outgrown the old title.

A redirect was added based on https://codepo8.github.io/github-redirection-demo/.
I tried to use a relative link, but it's hard to test if it works
before merging.

Co-authored-by: Benjamin Franzke <benjaminfranzke@googlemail.com>
2022-05-21 18:08:19 +02:00
Yu Watanabe
7d3f2499b8
Merge pull request #23464 from bnf/update-wiki-links
tree-wide: replace obsolete wiki links with systemd.io/manpages
2022-05-21 23:48:58 +09:00
Jan Janssen
6e9165397f bootctl: Add EFI arch detection support 2022-05-21 15:11:13 +01:00
Jan Janssen
c43a282c29 boot: Support booting in EFI mixed mode
The kernel provides a ".compat" PE section that contains a list of
compat entry points with their respective arches. This entry point
does all the heavy lifting to support running 64bit kernels when
the UEFI firmware is 32bit.

Note that the EFI handover protocol code in linux_x86.c does not
need any adjustments as it already correctly calls the 32bit handover
code.

Fixes: #17056
2022-05-21 15:11:13 +01:00
Jan Janssen
46ce6cf774 boot: Add LINUX_INITRD_MEDIA support to boot.c 2022-05-21 15:11:13 +01:00
Jan Janssen
acdf7d157b boot: Keep initrds separate from cmdline options
This is in preparation for LINUX_INITRD_MEDIA support in boot.c. One
downside is that adding or changing the used initrds by command line
editing is not possible anymore.
2022-05-21 15:11:13 +01:00
Jan Janssen
5c330b3682 boot: Edit config entry options inline
An edited entry command line should not be saved globally as it
should be tied to that one entry only.
2022-05-21 15:11:13 +01:00
Jan Janssen
7b19627697 fundamental: Move some helpers into string-util-fundamental 2022-05-21 15:11:13 +01:00
Jan Janssen
f386daa054 boot: Use cleanup handler to unload image
This also moves the message about failed image execution into
image_start() as we would otherwise show two error messages if
any of the preparatory steps failed.
2022-05-21 15:11:13 +01:00
Yu Watanabe
93a72170bd network: drop support for old kernels which cannot set prefix route with non-main route table
Not sure when the issue was fixed.
- kernel-3.10 on CentOS 7 has the issue,
- kernel-4.18 on CentOS 8 works fine.

Note, the workaround dropped by the commit is not incomplete:
with an old kernel which has the issue, all non-prefix routes are
configured on the specified route table, but the prefix route is
configured on the main table. That should not work for most cases,
hence, the workaround is mostly meaningless.
2022-05-21 15:09:53 +01:00
Luca Boccassi
0168b91603
Merge pull request #23339 from poettering/sockaddr-size-limit
tree-wide: add support for connecting to AF_UNIX sockets in the file system beyond the 108ch limit
2022-05-21 15:09:04 +01:00
Luca Boccassi
051c4e5419
Merge pull request #23342 from poettering/efi-monotonic-counter-random-seed
sd-boot: include GetNextMonotonicCount() in random seed calculations
2022-05-21 15:08:21 +01:00
Jan Janssen
7d4953de13 boot: Build with -flto=auto if available
Without this, we may get the following warning with gcc-12:
    lto-wrapper: warning: using serial compilation of 2 LTRANS jobs
2022-05-21 15:07:47 +01:00
Jan Janssen
351b30dae0 macro: Use C11 noreturn only
No need to provide a fallback as we compile with gnu11.
2022-05-21 15:01:47 +01:00
Yu Watanabe
1246d09705 networkctl: show error message provided through dbus
Prompted by #23416.
2022-05-21 15:01:09 +01:00
Luca Boccassi
6910d43af5
Merge pull request #23453 from keszybz/strv-parsing
Add strv methods with externally-supplied size argument and speed up parsing of /etc/hosts
2022-05-21 15:00:51 +01:00
Luca Boccassi
b622e95f2f
Merge pull request #23463 from bluca/hwdb
Finalize NEWS and hwdb for v251
2022-05-21 14:23:41 +01:00
Benjamin Franzke
a8c03388f8 tree-wide: Update homepage to systemd.io 2022-05-21 14:33:24 +02:00
Benjamin Franzke
92897d768d tree-wide: replace obsolete wiki links with systemd.io/manpages
All wiki pages that contain a deprecation banner
pointing to systemd.io or manpages are updated to
point to their replacements directly.

Helpful command for identification of available links:
git grep freedesktop.org/wiki | \
    sed "s#.*\(https://www.freedesktop.org/wiki[^ $<'\\\")]*\)\(.*\)#\\1#" | \
    sort | uniq
2022-05-21 14:29:14 +02:00
Benjamin Franzke
a25d9395ad tree-wide: streamline wiki links
* Avoid traling slash as most links are defined without.
* Always use https:// protocol and www. subdomain

Allows for easier tree-wide linkvalidation
for our migration to systemd.io.
2022-05-21 14:28:03 +02:00
Luca Boccassi
7f2ec323f6 NEWS: finalize 2022-05-21 12:55:07 +01:00
Luca Boccassi
5ea8bcd93d hwdb: update via ninja -C build update-hwdb 2022-05-21 12:44:36 +01:00
Luca Boccassi
410b996a72 NEWS: update contributors list 2022-05-21 12:43:19 +01:00
Yu Watanabe
30e29edf4c sysext: refuse empty release ID to avoid triggering assertion
Otherwise, the assertion in extension_release_validate() will be
triggered.
2022-05-21 06:37:56 +09:00
Yu Watanabe
1f97c2da0c test: add test for bus introspection of portable1
Follow-up for #23454.
2022-05-21 06:31:19 +09:00
Yu Watanabe
f65dcad5b7
Merge pull request #23439 from keszybz/kernel-install-verbose
Make kernel-install --verbose more verbose and some autodetection logic fixups
2022-05-21 04:26:03 +09:00
Yu Watanabe
3833c3356b
Merge pull request #23451 from medhefgo/boot-static-assert
boot: C11/static_assert
2022-05-21 04:22:17 +09:00
Luca Boccassi
54cd2d6869 sd-bus: add comment and test in sd_bus_path_decode() for empty string
3970	        e = object_path_startswith(path, prefix);
(gdb) p path
$1 = 0x55c5a166f768 "/org/freedesktop/portable1/image"
(gdb) p prefix
$2 = 0x55c59ffc2928 "/org/freedesktop/portable1/image"
(gdb) p e
$1 = 0x5581a1675788 ""

This can be a bit confusing in certain cases, so add a comment and a
test to make the behaviour clearer and explicit.
2022-05-21 03:44:09 +09:00
Yu Watanabe
cd532c633f
Merge pull request #23454 from keszybz/portable-introspect
Fix bus introspection of portable1
2022-05-21 03:41:22 +09:00
Zbigniew Jędrzejewski-Szmek
1b43f86893 kernel-install: restore priority of check for /boot/loader/entries
Before 9e82a74cb0, we had a check like the
following:

if [[ -d /efi/loader/entries ]] || [[ -d /efi/$MACHINE_ID ]]; then
    ENTRY_DIR_ABS="/efi/$MACHINE_ID/$KERNEL_VERSION"
elif [[ -d /boot/loader/entries ]] || [[ -d /boot/$MACHINE_ID ]]; then
    ENTRY_DIR_ABS="/boot/$MACHINE_ID/$KERNEL_VERSION"
elif [[ -d /boot/efi/loader/entries ]] || [[ -d /boot/efi/$MACHINE_ID ]]; then
    ENTRY_DIR_ABS="/boot/efi/$MACHINE_ID/$KERNEL_VERSION"
…

In stock Fedora 34-, /efi isn't used, but grub creates /boot/loader/entries and
installs kernels and initrds directly in /boot. Thus the second arm of the
check wins, and we end up with BOOT_ROOT=/boot.

After 9e82a74cb0, we iterate over the inner
directory first and over the second directory later:

[ -d /efi/<machine-id> ]
[ -d /boot/efi/<machine-id> ]
[ -d /boot/<machine-id> ]
[ -d /efi/Default ]
[ -d /boot/efi/Default ]
[ -d /boot/Default ]
[ -d /efi/loader/entries ]
[ -d /boot/efi/loader/entries ]
[ -d /boot/loader/entries ]

This was partially reverted by 447a822f8e which
removed Default from the list, and a5307e173b,
which moved checks for /boot up, so we ended up with:

[ -d /efi/<machine-id> ]
[ -d /boot/<machine-id> ]
[ -d /boot/efi/<machine-id> ]
[ -d /efi/loader/entries ]
[ -d /boot/loader/entries ]
[ -d /boot/efi/loader/entries ]

6637cf9db6 added autodetection of an entry
token, so we end up checking the following suffixes:

<machine-id>, $IMAGE_ID, $ID, Default

But the important unchanged characteristic is that we iterate over the suffix
first. Sadly this breaks Fedora, because we find /boot/efi/<machine-id> before
we could find /boot/loader/entries. It seems that every possible aspect of
behaviour matters for somebody, so we need to keep the original order of
detection.

With the patch:

[ -d /efi/<machine-id> ]
...
[ -d /efi/loader/entries ]
[ -d /boot/<machine-id> ]
...
[ -d /boot/loader/entries ]
[ -d /boot/efi/<machine-id> ]
...
[ -d /boot/efi/loader/entries ]

Note that we need to check for "loader/entries" too, even though it is not
an entry-token candidate, so that we get the same detection priority as
before.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2071034.
2022-05-20 15:34:17 +02:00
Zbigniew Jędrzejewski-Szmek
eb164c51ea resolved: use strv_extend_with_size() to avoid slow parsing of /etc/hosts
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43942 is a simple case
where a repeated entry generates a timeout. I didn't import that case, but
generated a simpler one by hand.

$ time build/fuzz-etc-hosts test/fuzz/fuzz-etc-hosts/timeout-many-entries
test/fuzz/fuzz-etc-hosts/timeout-many-entries... ok
build/fuzz-etc-hosts test/fuzz/fuzz-etc-hosts/timeout-many-entries  3.17s (old)
  ↓
build/fuzz-etc-hosts test/fuzz/fuzz-etc-hosts/timeout-many-entries  0.11s (new)

I considered simply disallowing too many aliases. E.g. microsoft appearently
sometimes ignores entries after the ninth [1], and other systems set stringent
limits [2,3], but the recommended way to get around that is to simply use more
lines (as is done in the sample), so this wouldn't change anything.

Even if we cannot put all those names in a reply packet, the resolution from
the alias to the address should work. I think cases where people define lots
and lots of aliases through some programmatic interface is realistic, for
example for a blocklist, and such a file shouldn't bring resolved down to its
knees.

[1] https://superuser.com/questions/932112/is-there-a-maximum-number-of-hostname-aliases-per-line-in-a-windows-hosts-file
[2] https://library.netapp.com/ecmdocs/ECMP1516135/html/GUID-C6F3B6D1-232D-44BB-A76C-3304C19607A3.html
[3] https://www.ibm.com/docs/en/zos/2.1.0?topic=optional-creating-etchosts
2022-05-20 15:18:28 +02:00
Zbigniew Jędrzejewski-Szmek
3ec3ae68d2 basic/strv: add optimizable version of strv_push/consume/extend
This will be helpful in cases where we are repeatedly adding entries
to a long strv and want to skip the iteration over old entries leading
to quadratic behaviour.

Note that we don't want to calculate the length if not necessary, so
the calculation is delayed until after we've checked that value is not
NULL.
2022-05-20 15:18:28 +02:00
Zbigniew Jędrzejewski-Szmek
5943d85f34 portabled: wrap long lines and fix typo in error message 2022-05-20 15:01:56 +02:00
Zbigniew Jędrzejewski-Szmek
4313e2b69f portabled: refuse queries for empty image name
I took inspiration from pid1:
bus_unit_find()
  → find_unit()
    → manager_load_unit_from_dbus_path()
      → unit_name_from_dbus_path()
        → !startswith(path, "/org/freedesktop/systemd1/unit/")
          → return -EINVAL
          ←
        ←
      ←
    ← if (r < 0) return 0
  ← 0
←

i.e. we return 0 when queried for "/org/freedesktop/systemd1/unit".

Fixes #23445.
2022-05-20 14:59:50 +02:00
Yu Watanabe
d316426eee shared/extension-release: drop unnecessary strna() wrapper
These are not NULL.
2022-05-20 14:26:47 +02:00
Luca Boccassi
7b2e763242 portable: reject root directories without an ID field in os-release
We always require at least ID to be set in os-release, reject
and propagate error to the caller instead of asserting later
2022-05-20 13:08:45 +01:00
Luca Boccassi
a2cf73f0b6 dissect: ID from os-release should be non-empty, not just non-NULL 2022-05-20 12:05:34 +01:00
Jan Janssen
6c405f20a3 macro: Use C11 static_assert
Now that we require C11 everywhere, we can always use static_assert.
2022-05-20 12:49:50 +02:00
Jan Janssen
b1672234e0 boot: Build with C11 too 2022-05-20 12:47:43 +02:00
Zbigniew Jędrzejewski-Szmek
eb45cf97a9 kernel-install: fix detection of entry-token if $BOOT_ROOT is configured
If $BOOT_ROOT is specified, but entry-token not, we'd skip the detection
altogether, effectively defaulting to entry-token=machine-id.
The case where $BOOT_ROOT was not specied, but entry-token was configured
was handled correctly.
This patch makes the handling of both symmetrical, i.e. will only set what
wasn't configured.
2022-05-20 09:44:22 +02:00
Zbigniew Jędrzejewski-Szmek
4db4c28dc6 kernel-install: debug the configuration detection if --verbose
No changes to behaviour, but let's print everything out as we discover it.

The docs say that BOOT_ROOT can be specified by the environment. I have
it locally in /etc/kernel/install.conf, and then the override doesn't work.
It'd be nice to handle such cases more reliably.
2022-05-20 09:44:22 +02:00
Khem Raj
29b7114c5d Add sys/stat.h for S_IFDIR
Fixes
../git/src/shared/mkdir-label.c:13:61: error: use of undeclared identifier 'S_IFDIR'
        r = mac_selinux_create_file_prepare_at(dirfd, path, S_IFDIR);

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2022-05-20 14:54:02 +09:00
Daan De Meyer
dcb4e45ad8 sd-bus: Fix introspect memory leak
We have to free the contents of the set on top of the set itself.

Fixes #23443.
2022-05-20 14:53:28 +09:00
Zbigniew Jędrzejewski-Szmek
b21ba8ac6b kernel-install: bail if machine id generation fails
The call is unlikely to fail, but systemd-id128 might not be installed.
We shouldn't continue with the empty string.
2022-05-19 15:38:25 +02:00
Zbigniew Jędrzejewski-Szmek
94cbddf439 kernel-install: actually export KERNEL_INSTALL_VERBOSE
:(
2022-05-19 15:38:25 +02:00