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

57914 Commits

Author SHA1 Message Date
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
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
Zbigniew Jędrzejewski-Szmek
1ab191b3a9
Merge pull request #23432 from bnf/docs-relative-links
docs: use relative links
2022-05-19 08:54:49 +02:00
Daan De Meyer
1751d8c80c portable: Remove unnecessary assert()
Fixes #23433

matches is plumbed through until it finally gets used in unit_match()
which can deal with NULL matches so the assert() is unnecessary and
can be removed.

The two call sites of extract_image_and_extensions() also don't
assert() on matches either.
2022-05-19 15:39:25 +09:00
Luca Boccassi
7269d39a91 test: double timeout of TEST-50-DISSECT
It times out on slow CIs near the end of the test, eg:

[  553.539368] kernel: loop_reread_partitions: partition scan of loop3 () failed (rc=-5)
TEST-50-DISSECT: (timeout)

https://autopkgtest.ubuntu.com/results/autopkgtest-focal-upstream-systemd-ci-systemd-ci/focal/ppc64el/s/systemd-upstream/20220518_172659_bf20f@/log.gz
2022-05-19 15:36:06 +09:00
Yu Watanabe
f9aabf2c2c meson: install 70-power-switch.rules
Fixes a bug introduced by 155078c835.

Fixes #23425.
2022-05-19 05:04:58 +09:00
Tomasz Pala
d1df0466d9 udev: fixed config_parse_ifalias() logic not to skip setting IFLA_IFALIAS
this flaw was introduced in 6a74900002
2022-05-19 05:04:26 +09:00
Benjamin Franzke
63812e15c6 docs: streamline headline structure in JOURNAL_EXPORT_FORMATS.md
Add one general first-level headline and transform
the existing ones into second-level headlines.
2022-05-18 20:34:10 +02:00
Benjamin Franzke
5c90c67a34 docs: use relative links
Allows for links to work both on systemd.io (or forks) and
when viewed on https://github.com/systemd/systemd/tree/main/docs

Note that the markdown links are converted by jekyll-relative-links[1]
to html. This plugin is enabled by default on github pages[2][3].

Due to a bug in jekyll-relative-links – see
https://github.com/benbalter/jekyll-relative-links/issues/61 –
we need to avoid line-wrapped links when using relative markdown links.

[1] https://github.com/benbalter/jekyll-relative-links
[2] https://github.blog/2016-12-05-relative-links-for-github-pages/
[3] https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll/about-github-pages-and-jekyll#plugins
2022-05-18 20:34:10 +02:00
Zbigniew Jędrzejewski-Szmek
e4885958dc
Merge pull request #23417 from bnf/docs-dark-mode
docs: add dark mode
2022-05-18 13:09:50 +02:00
Yu Watanabe
69ce09afc2 doc: fix typo 2022-05-18 17:57:05 +09:00
Yu Watanabe
99b5421c48
Merge pull request #23422 from keszybz/two-doc-tweaks
Two doc tweaks
2022-05-18 17:36:33 +09:00
Zbigniew Jędrzejewski-Szmek
b16e93d73e README: fix typo 2022-05-18 08:29:17 +02:00
Zbigniew Jędrzejewski-Szmek
50db8d97b9 NEWS: reword description of credstore
The "in" at the end made the sentence hard to parse…
2022-05-18 08:29:17 +02:00
Benjamin Franzke
2eca6d602f docs: overhaul styling for example log messages on startpage
* Use brand-green for demo log messages on the startpage
   instead of the default `green` color defined by the browser vendor
   (after all, the brand green color is intended to reflect the
   boot status output)
 * Add a matching blue intro color (mixed using HSL from brand-green
   by 55deg hue rotation and 4% lightness)
 * Use a defined font-size
   (to avoid blurry rendering at 13.33333px, due to font-size: smaller)
 * Add possibility for the browser to show horizontal scrollbar
   (avoid overflow in mobile view)
2022-05-17 23:00:18 +02:00
Benjamin Franzke
9b266e4349 docs: add dark mode
Respect the user agent property  `prefers-color-scheme` by
rendering the documentation in dark mode, if requested.

Reorganise CSS to store the color palette into CSS variables
and reference these from another set of CSS variables that
are dynamically switched based on the prefers-color-scheme
media query.

Light mode variables stay they same as before,
but to ease color mixing, the current RGB values
have been transformed to HSL (using chrome devtools).
The current body background is now --sd-gray-extralight,
the current body color is now --sd-gray-extradark.
Other gray-variations, needed for dark-mode constrasts
are derived from these colors using HSL lightness shifting.

The systemd brand black color is used as dark mode background
and a matching extralight gray font color has been selected.

The link font-weight is reduced to 400 in dark mode,
as the green color on dark ground becomes to overwhelming
with a bold font.

The systemd logo color is dynamically swapped by using
the special fill value `currentColor` for dark/light-mode
depending parts – as per specification on brand.systemd.io
2022-05-17 23:00:18 +02:00
Benjamin Franzke
62bbb96d00 docs: regenerate highlight style and streamline background overwrite
* Update to rougify 3.26.1 styling
 * Adapt background overwrite by removing default background color
   and only adding explicit overwrites for syntax error
   (error stylings appear for example in json-excerpts –
   see HACKING.md – and are therefore hidden by our css)
2022-05-17 23:00:18 +02:00
Benjamin Franzke
818e46ae7c docs: avoid multiple first-level headlines
One document should only contain one main
headline, both for structuring and for
visual reasons.

Relevant cases found via:

  git grep -A2 '^# ' docs/
2022-05-17 23:00:18 +02:00
Benjamin Franzke
85b5930b7b docs: provide a first level headline for the frontpage
* Provides a nice introduction to the intro paragraph
 * Ensures text of subpages start at the same position as the intro text
   on the homepage
   => less visual "jumps" while navigating
2022-05-17 23:00:18 +02:00
Benjamin Franzke
bd59f2bf92 docs: respect default browser font-size
16px is default by all browser vendors when
font-setting is defined to be 'medium'.

Scale all font sizes and margins to
based on 16px base size.
2022-05-17 23:00:18 +02:00
Benjamin Franzke
68f0d3ff12 docs: add reasonable difference between h2 and h3 font-size 2022-05-17 23:00:18 +02:00
Benjamin Franzke
cfcbf1dafb docs: replace <pre>, <code> and <tt> tags by backticks
Let jekyll render a proper codeblock, instead
of using custom HTML code in markdown.
Also <tt> is deprecated.
2022-05-17 22:35:54 +02:00
Benjamin Franzke
86a3a73bb4 docs: adapt theme color meta property
The theme color is used on android to style the chrome
browser-ui with a color that suits the webpage.

Use the dark brand color instead of a random default blue color
in order to fit to the rest of the color scheme.
2022-05-17 22:35:54 +02:00
Benjamin Franzke
74de5ddb99 docs: remove unneeded font-related attributes from svg logo
The font has been vectorized and therefore all
font related properties are ignored anyway.
2022-05-17 22:35:54 +02:00
Benjamin Franzke
b336535c6e docs: use whole numbers for circle in page-logo
0.001 is usually rounded to 0 by browsers, still,
better to be explicit and save some bytes.
2022-05-17 22:35:54 +02:00
Benjamin Franzke
f08446a4f5 docs: replace invalid h1 font-weight
h1 font weight is defined to be 100 but no font-face
definition for weight 100 is included.
The browser will use the nearest available font-weight
instead. As that is 400, we do specify it explicitly now.
2022-05-17 22:35:53 +02:00
Benjamin Franzke
d5ce270ced docs: remove link to missing apple-touch-icon 2022-05-17 21:13:24 +02:00
Benjamin Franzke
f32c5aa16c docs: remove invalid link to feed.xml 2022-05-17 21:13:21 +02:00
Benjamin Franzke
55813558cd docs: remove trailing space 2022-05-17 21:13:19 +02:00
Benjamin Franzke
add4a110f7 docs: configure editorconfig for css and html 2022-05-17 21:13:17 +02:00
Luca Boccassi
bd144c9643
Merge pull request #23412 from yuwata/network-bond-param
networkctl: bond param
2022-05-17 20:11:55 +01:00
Luca Boccassi
070f737083 Update TODO 2022-05-17 17:47:38 +01:00
Zbigniew Jędrzejewski-Szmek
80c48dd3a2
Merge pull request #23114 from yuwata/resolve-dnssec
resolve: always request additional record to verify negative answer
2022-05-17 16:53:09 +02:00
Zbigniew Jędrzejewski-Szmek
776fabbc8b Add a "test" that prints the SBAT table
The SBAT section was included in a special section in the EFI code, but
the contents weren't directly visible in any way. Let's add a "test" that
prints them for visual inspection.

If there's some external linter for this format, we could hook it up in the
future.
2022-05-17 16:45:15 +02:00