1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-25 10:04:04 +03:00

66987 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
b5c27ebca4 man: document sd_id128_get_app_specific 2023-08-29 17:06:47 +03:00
Zbigniew Jędrzejewski-Szmek
62b4bee9bc sd-id128: export sd_id128_get_app_specific()
We exported sd_id128_get_machine_app_specific() and
sd_id128_get_boot_app_specific(). But those operate on the current machine,
and sometimes the user might want to do the same calculation for a different
machine, or an earlier boot, etc. We expose the underlying implementation
to make this easy.
2023-08-29 17:06:47 +03:00
Zbigniew Jędrzejewski-Szmek
0f7735d7a9 sd-id128: avoid one memcpy
By aligning the output buffer, we can just use the result directly, no need to
copy stuff around.
2023-08-29 17:06:47 +03:00
Zbigniew Jędrzejewski-Szmek
f1c0ad5279 shared/id128-print: fix indentation, reduce variable scope 2023-08-29 17:06:47 +03:00
Zbigniew Jędrzejewski-Szmek
782902f217 id128: add option -P to only show value
We have '-P' in systemctl with similar meaning.

Partially closes https://github.com/systemd/systemd/issues/27514.
2023-08-29 17:06:47 +03:00
Zbigniew Jędrzejewski-Szmek
6a73a4f7c4
Merge pull request #28900 from abderrahim/version-info
man: add version info
2023-08-29 16:59:48 +03:00
Malte Poll
4947de275a mkfs-util: propagate SOURCE_DATE_EPOCH to mcopy
Co-authored-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
2023-08-29 14:58:44 +01:00
Abderrahim Kitouni
ec07c3c80b man: add version info
This tries to add information about when each option was added. It goes
back to version 183.

The version info is included from a separate file to allow generating it,
which would allow more control on the formatting of the final output.
2023-08-29 14:07:24 +01:00
Luca Boccassi
599a312484
Merge pull request #28998 from YHNdnzj/logind-vt-handling
logind: several cleanups
2023-08-29 01:09:10 +01:00
Jan Janssen
29c2f6ac4b meson: Fix version script
Apparently, the `|` has a higher priority…
2023-08-29 01:08:38 +01:00
Frantisek Sumsal
5599c84bcd test: fix debugging of nspawn tests
The pipe stuff introduced in 701e0c2660 causes nspawn to switch the
console from 'interactive' into 'read-only' which is a bit useless when
debugging. Let's set --console=interactive explicitly in such case.

Follow-up to 701e0c2660.
2023-08-29 01:08:08 +01:00
Abderrahim Kitouni
4623eecb2f man: Add xinclude namespace
This will be used by the next commit to add version information to the
nodes.
2023-08-28 18:27:10 +01:00
Luca Boccassi
337e8504f7
Merge pull request #28328 from yuwata/network-ndisc-limit-captive-portal
network: limit number of captive portals by RA
2023-08-28 17:45:22 +01:00
Mike Yuan
08a5bc4f48 Revert "Revert "test: add test case for systemd-update-utmp vs daemon-reexec""
This reverts commit 837773add465bd0a0d1f598203d297cf0129468b.

The original issue #27287 is fixed by #28123. Let's
reintroduce the test for systemd-update-utmp.
2023-08-28 17:43:57 +01:00
Luca Boccassi
cd4ed8579b
Merge pull request #28948 from poettering/tpm2-duplicate-pcr-names
tpm2: unify tpm2 PCR symbolic identifiers
2023-08-28 17:43:10 +01:00
Luca Boccassi
f154440980
Merge pull request #28916 from ddstreet/tpm2_pcr_value_post_merge
Tpm2 pcr value post merge
2023-08-28 17:42:48 +01:00
Mike Yuan
93041c6010
logind-session: generalize EIO handling for {restore,leave}_vt
Replaces #28949
2023-08-28 23:58:39 +08:00
Mike Yuan
a8d5378a88
logind: add missing asserts 2023-08-28 22:50:42 +08:00
Mike Yuan
2d7cbead01
logind: use hashmap value destructors 2023-08-28 22:37:21 +08:00
Mike Yuan
36f9fadfe3
logind: rephrase log messages 2023-08-28 22:37:21 +08:00
msizanoen
99d4ad71b7 login: Properly handle -EIO in session_leave_vt
session_leave_vt may be called after the VT device was hung up, which
will cause vt_release to fail with -EIO. This is known to cause an issue
with GNOME 44 on Fedora where gdm-session-worker sometimes freezes when
trying to switch to VT 1 after a `loginctl terminate-user` operation.

Fix this by reopening the VT in session_leave_vt if we get an -EIO.
2023-08-28 17:35:24 +03:00
Susant Sahani
1a6b1214af sd-radv: fix memory leak 2023-08-28 14:07:16 +01:00
Zbigniew Jędrzejewski-Szmek
56a0b9065e meson: restore specifications of dependency on version_h
This partially reverts 3c1eee5beda642707037b189481c3c30d1668da7.
I thought that it is not necessary, but
https://mesonbuild.com/Reference-manual_functions.html#vcs_tag says:

> This method returns a custom_tgt should be used to signal dependencies if
> other targets use the file outputted by this.
>
> For example, if you generate a header with this and want to use that in a
> build target, you must add the return value to the sources of that build
> target. Without that, Meson will not know the order in which to build the
> targets.

We can use version_h directly, since we already have it.

Hopefully fixes https://github.com/systemd/systemd/issues/28994.
2023-08-28 14:06:23 +01:00
Luca Boccassi
1686c884bf test-dhcp-client: add temporary workaround for assertion failure
Workaround for https://github.com/systemd/systemd/issues/28990

Introduced by https://github.com/systemd/systemd/pull/28932 but CI was
green there. Add a workaround to get the CI back in shape while it is
being investigated.
2023-08-28 12:29:10 +01:00
Lennart Poettering
73f0eedf9b boot: don't pass kernel cmdline option to UKIs which have the very same line built-in
There's really no point in first extracting a command line from an UKI
to just pass it unmodified to the UKI. In particular as this is
systematically ignored in SecureBoot is enabled.

Let's drop this, so that unless the user actually edits the cmdline we
pass nothing to the invoked kernel.

Note that this low-key is a compat break, since the passed cmdline gets
measured. However, in the interest of minimized the difference between
systems with and without sd-boot to behave the same i think we should
suppress the command line anyway.
2023-08-28 11:24:53 +01:00
Chris Patterson
23cbe90d7d 99-systemd.rules.in: tag PTP devices with systemd
Chronyd and similar time services, when using PTP devices, may need
the BindsTo/After directives to ensure the devices are available
before starting.  Tag PTP devices with systemd to allow for wider
adoption.

Signed-off-by: Chris Patterson <cpatterson@microsoft.com>
2023-08-28 10:42:27 +01:00
Yu Watanabe
b2851e8d62 sd-dhcp-client: make client initially in stopped state
Previously, DHCP_STATE_STOPPED and DHCP_STATE_INIT are both handled as
not-running. Moreover, previously after sd_dhcp_client_start() is
called, the client still in INIT state (and thus handled as not-running)
even if its internal timer event sources are initialized.

Let's make only STOPPED state handled as not-running, and make the
client initially in STOPPED state.

Prompted by #28896.
2023-08-28 10:25:14 +01:00
Michael Vasseur
c91d636fad pkg.m4 macro needs brackets
See documentation at: https://manpages.debian.org/testing/pkgconf/pkg.m4.7.en.html

Without this the macro was not always correctly resolved so the correct command was not used in the rest of the snippet.
2023-08-28 10:07:26 +01:00
Luca Boccassi
4c427929e0
Merge pull request #28977 from keszybz/drop-versiondep
meson: simplify handling of the version tag
2023-08-28 10:02:01 +01:00
Zbigniew Jędrzejewski-Szmek
7abb0eef8f man/gpt-auto-generator: avoid saying "negative" for boolean
Fixes #28928.
2023-08-28 09:46:54 +01:00
Zbigniew Jędrzejewski-Szmek
6f420b5f75
Merge pull request #28968 from DaanDeMeyer/rlimit
Limit rlim_max in rlimit_nofile_safe() to nr_open
2023-08-27 16:06:58 +02:00
Alvin Alvarado
c766e05f29 man: Fix typo in config file example for ukify
or else it would output 'Unknown config setting [UKI] SecureBootCerificate=' or just an error outright if not overrode.
2023-08-27 15:03:49 +08:00
Zbigniew Jędrzejewski-Szmek
3c1eee5bed meson: drop "versiondep" object
It was added to make sure that the version tag was built early
enough. Now that we use vcs_tag, meson should take care of building
it early enough.
2023-08-26 17:16:59 +02:00
Zbigniew Jędrzejewski-Szmek
1671799bee meson: simplify version_tag handling
Let's also use vcs_tag() when we're doing a non-git build. In those scenarios,
the build would normally be done just once in a given copy, so doing an extra
call does not matter. We can save a few lines of meson config.

The special path was added in 064b8e2c99ceb348c515353cc5c7d7bd05c49fcb, with
the justifaction that vcs_tag() is slow and -Dversion-tag=foo can be used to
fix the version tag and speed up partial rebuilds. I think the justification
for this is weak: having an accurate version tag is particularly useful when
developing the code. Shaving of a fraction of a second at the cost of having to
manually update the version seems iffy.

Secondly, with vcs_tag() we can be pretty sure that meson will build the
version file first and that it'll be available to all build steps. Because we
didn't use version tag, we had to manually specify the dependency on version.h
in various places. It seems nicer to use vcs_tag() and not have to deal with
this problem at all.

Finally, the savings in time seem much smaller than back when
064b8e2c99ceb348c515353cc5c7d7bd05c49fcb was made. It reported a change
from 94 ms to 521 ms. But now the difference seems to be about 50 ms:

Before this patch:
$ time ninja -C build
ninja: Entering directory `build'
ninja: no work to do.
ninja -C build  0.04s user 0.02s system 97% cpu 0.057 total
ninja -C build  0.03s user 0.01s system 97% cpu 0.049 total
ninja -C build  0.03s user 0.02s system 96% cpu 0.051 total
ninja -C build  0.03s user 0.01s system 96% cpu 0.049 total
ninja -C build  0.03s user 0.01s system 97% cpu 0.046 total

With the two patches in this PR:
systemd-stable [drop-versiondep] time ninja -C build
ninja: Entering directory `build'
[1/669] Generating version.h with a custom command
ninja -C build  0.08s user 0.03s system 98% cpu 0.106 total
ninja -C build  0.08s user 0.03s system 98% cpu 0.104 total
ninja -C build  0.09s user 0.02s system 98% cpu 0.116 total
ninja -C build  0.08s user 0.02s system 97% cpu 0.108 total

Overall, I think the tiny time savings are not worth the complexity.
2023-08-26 17:09:10 +02:00
Juno Computers
8a76d3cc70
Update 60-sensor.hwdb (#28804)
Updated T11/Juno Tab 2.
2023-08-26 22:35:57 +09:00
Jan Janssen
c78b611e48 meson: Bring back use of vcs_tag
The use of vcs_tag was dropped in #28567, which results in builds having
stale version information once new commit are made.

This also fixes a case where CI builds would have no version information
because they are checked out without any tags for git-describe to use.

Additionally, use `--git-dir` now, as that particular issues seems to
have been fixed by now.
2023-08-26 13:53:42 +09:00
Mike Yuan
82007efa44 mount/mount-tool: return correct errno
Follow-up for 9269296df05a724c6b121bcbb0b420c8b4088f2f
2023-08-26 09:27:23 +09:00
Zbigniew Jędrzejewski-Szmek
3b9b33a143
Merge pull request #28913 from keszybz/tmpfs-top-level-dir-mode
systemd-mount: do not create tmpfs mounts with sticky permission bit
2023-08-25 18:36:30 +02:00
Susant Sahani
1925f829ab network: sd-radv - Introduce pref64 support (RFC8781)
Implements: https://datatracker.ietf.org/doc/html/rfc8781

```

[IPv6PREF64Prefix]
Prefix=2003:da8:1:0::/64
ValidLifetimeSec=30m

Frame 16: 126 bytes on wire (1008 bits), 126 bytes captured (1008 bits) on interface veth99, id 0
Ethernet II, Src: 06:c7:41:95:1d:7f (06:c7:41:95:1d:7f), Dst: IPv6mcast_01 (33:33:00:00:00:01)
Internet Protocol Version 6, Src: fe80::4c7:41ff:fe95:1d7f, Dst: ff02::1
Internet Control Message Protocol v6
    Type: Router Advertisement (134)
    Code: 0
    Checksum: 0x0ca0 [correct]
    [Checksum Status: Good]
    Cur hop limit: 0
    Flags: 0x00, Prf (Default Router Preference): Medium
    Router lifetime (s): 1800
    Reachable time (ms): 0
    Retrans timer (ms): 0
    ICMPv6 Option (Source link-layer address : 06:c7:41:95:1d:7f)
    ICMPv6 Option (Prefix information : 2002:da8:1::/64)
    ICMPv6 Option (PREF64 Option)
        Type: PREF64 Option (38)
        Length: 2 (16 bytes)
        0000 0111 0000 1... = Scaled Lifetime: 225
        .... .... .... .001 = PLC (Prefix Length Code): 64 bits prefix length (0x1)
        Prefix: 64:ff9b::

```
2023-08-25 15:13:06 +02:00
Daan De Meyer
f470dafddc Limit rlim_max in rlimit_nofile_safe() to nr_open
We might inherit a max rlim value that's larger than the kernel's
maximum (nr_open). This will cause setrlimit() to fail as the given
maximum is larger than the kernel's maximum. To get around this,
let's limit the max rlim we pass to rlimit() to the value of nr_open.

Should fix #28965
2023-08-25 14:26:11 +02:00
Daan De Meyer
fbc6a75571 mkfs-util: Set FORK_REOPEN_LOG
We set FORK_CLOSE_ALL_FDS, so we should also set FORK_REOPEN_LOG to
reopen the log in the child process so we don't miss any logging
messages.
2023-08-25 14:25:33 +02:00
Dan Streetman
a11a2e059c cryptenroll: change man page example to remove leading 0x and lowercase hex 2023-08-24 12:35:58 -04:00
Dan Streetman
81e3d37211 tpm2: wrap (7) in UINT32_C() 2023-08-24 12:35:58 -04:00
Dan Streetman
26d8d71fa5 tpm2: add tpm2_pcr_values_has_(any|all)_values() functions 2023-08-24 12:35:58 -04:00
Dan Streetman
70cb382d36 tpm2: remove unnecessary void* cast 2023-08-24 12:35:58 -04:00
Dan Streetman
ed35ac3155 tpm2: make logging level consistent at debug for some functions 2023-08-24 12:35:58 -04:00
Dan Streetman
3f4d5dfd65 tpm2: use switch() instead of if-else 2023-08-24 12:35:58 -04:00
Dan Streetman
6761e1355e tpm2: use table for openssl<->tpm2 ecc curve id mappings 2023-08-24 12:35:54 -04:00
Dan Streetman
b030710295 openssl: use new(char, size) instead of malloc(size) 2023-08-24 12:33:26 -04:00
Dan Streetman
65fd657e0a tpm2: use memcpy_safe() instead of memcpy() 2023-08-24 12:33:26 -04:00