Commit graph

62222 commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 58634a2989 github/labeller: add more match patterns 2023-01-26 10:04:58 +01:00
Lennart Poettering bd524f497f journal: automatically pick up boot ID in journal_file_append_entry()
Let's pick up the boot ID early if unspecified, in
journal_file_append_entry(). This is symmetric to the fact that we
already pick up the monotonic timestamp in journal_file_append_entry()
if unspecified, and given that the monotonic clock is not too useful
without its boot ID it makes a lot of sense to pick them up at the same
time.

There are two relevant callers of journal_file_append_entry() right now:
journald (which leaves the boot ID unspecified) and journal-remote
(there are also some tests, but those don't matter too much). The former
calls it to store new entries in the journal file, the latter for
converting/processing/merging existing ones (where it passes along the
original boot ID). This new code hence only is relevant on the former,
and using the boot ID of the current system is the right choice for live
generated entries.

Note that this effectively changes little, since the lower-level
function journal_file_append_entry_internal() will copy boot ID stored
in the file header into all records if unspecified, and typically that's
the one of the local system. But strictly speaking this is not the right
thing to do, since we actually might end up appending to journal files
from previous boots. (The lower level function is indirectly used by
various tests, where the copying-from-header logic kinda makes sense
since they are detached from any live messages streaming in from the
host after all).
2023-01-26 09:52:49 +01:00
William Roberts 6ae3bd82d0 sha256: header needs stddef
The sha256 header uses size_t which is within stddef, so add it.

Signed-off-by: William Roberts <william.c.roberts@intel.com>
2023-01-25 22:26:26 +01:00
Lennart Poettering 79f7681621
Merge pull request #26204 from poettering/journal-header-compoung-init
journal: use compound initialization for journal file "Header" structure
2023-01-25 21:22:07 +01:00
Luca Boccassi 2f03e5087e
Merge pull request #26179 from medhefgo/boot-no-gnu-efi
boot: Use size_t/unicode string literals
2023-01-25 19:51:24 +00:00
Daan De Meyer 2ecc7a5bca repart: Add roothash to output of all verity siblings
This can be used to match verity partitions together using the repart
JSON output.
2023-01-25 19:50:44 +00:00
Luca Boccassi 37aabb488e
Merge pull request #26195 from mrc0mmand/update-uapi
basic/linux: update l2tp.h
2023-01-25 19:49:00 +00:00
Luca Boccassi a4e05a6aa7
Merge pull request #26192 from mrc0mmand/fix-errno-check
sysupdate: fix errno check
2023-01-25 19:48:23 +00:00
Daan De Meyer 34b5977015 test-execute: Skip when /sys is read-only
The test depends on /sys being writable, so let's skip it when /sys
is read-only.
2023-01-25 19:47:43 +00:00
Michael Biebl d173c9ebb0 test: skip firstboot --prompt-keymap check if keymaps are missing
Fixes: #26165
2023-01-25 19:46:33 +00:00
Lennart Poettering 71df05fab3
Merge pull request #26197 from poettering/journal-file-size-t-fix
journal: some trivial size_t array size fixes
2023-01-25 19:04:11 +01:00
Lennart Poettering c3dd0dcb88 journal: use compound initialization for journal file Header structure 2023-01-25 18:48:31 +01:00
Lennart Poettering 6fe167d0a7 journal-def: fix type of signature to match the actual field in the Header structure 2023-01-25 18:47:05 +01:00
Jan Janssen a083aed03f boot: Use unicode literals
No changes in behavior.
2023-01-25 15:24:10 +01:00
Jan Janssen 54d9ecc380 boot: Use unsigned for beep counting 2023-01-25 15:23:49 +01:00
Jan Janssen dede50a715 boot: Replace UINTN with size_t
No changes in behavior.
2023-01-25 15:22:41 +01:00
Lennart Poettering f2592ef0e1 dlfcn: add new safe_dclose() helper
Let's allow destructing loaded module handles in our usual way that is
fine with NULL handles, and also returns the NULL handle again.
2023-01-25 15:07:35 +01:00
Frantisek Sumsal ed614f17fc partition: fix build with newer linux/btrfs.h uapi header
linux/btrfs.h needs  to be included after sys/mount.h, as since [0]
linux/btrfs.h includes linux/fs.h causing build errors:

```
In file included from /usr/include/linux/fs.h:19,
                 from ../src/basic/linux/btrfs.h:29,
                 from ../src/partition/growfs.c:6:
/usr/include/sys/mount.h:35:3: error: expected identifier before numeric constant
   35 |   MS_RDONLY = 1,                /* Mount read-only.  */
      |   ^~~~~~~~~
[1222/2169] Compiling C object systemd-creds.p/src_creds_creds.c.o
ninja: build stopped: subcommand failed.
```

See: https://github.com/systemd/systemd/issues/8507

[0] a28135303a
2023-01-25 14:27:18 +01:00
Frantisek Sumsal a95ff98ec4 basic/linux: update linux uapi headers
IPPROTO_L2TP was moved from linux/l2tp.h to linux/in.h [0], so let's
reflect that change to fix build with newer kernels:

```
In file included from ../src/libsystemd/sd-netlink/netlink-types-genl.c:10:
../src/basic/linux/l2tp.h:16: error: "IPPROTO_L2TP" redefined [-Werror]
   16 | #define IPPROTO_L2TP            115
      |
In file included from ../src/libsystemd/sd-netlink/netlink-types-genl.c:3:
/usr/include/netinet/in.h:85: note: this is the location of the previous definition
   85 | #define IPPROTO_L2TP            IPPROTO_L2TP
      |
cc1: all warnings being treated as errors
```

When at it, update the rest of the headers we ship as well.

[0] 65b32f801b
2023-01-25 14:27:18 +01:00
Lennart Poettering 8c29ac2f8a journal-file: cast file size to to fixed size type
(We generally avoid using off_t for file sizes/offsets, and instead use
uint64_t to get the same behaviour everywhere. Do so here too.)
2023-01-25 14:17:20 +01:00
Lennart Poettering b45a7215fd journal-file: fix type of array counter 2023-01-25 14:16:44 +01:00
Luca Boccassi 6ec7a722ba
Merge pull request #26193 from aafeijoo-suse/cryptenroll-unlock-fido2-device-man-and-bash-completion-fix
Add missing --unlock-fido2-device to systemd-cryptenroll man and bash-completion
2023-01-25 13:15:13 +00:00
Antonio Alvarez Feijoo d8c5bd048c
man: add missing --unlock-fido2-device to systemd-cryptenroll 2023-01-25 11:58:19 +01:00
Lennart Poettering 43057bf604 update TODO 2023-01-25 11:54:02 +01:00
Antonio Alvarez Feijoo 4d206f1cf9
bash-completion: add missing --unlock-fido2-device to systemd-cryptenroll 2023-01-25 11:53:50 +01:00
Yu Watanabe a0344b17dd bootctl-status: several follow-ups for unlink command
Follow-ups for 8702496bfb.

- add missing error cause in logging,
- add several missing assertions,
- drop an unnecessary initialization,
- make boot_config_find_in() return negative errno if nothing found,
- and several coding style fixlets.
2023-01-25 10:51:50 +00:00
Yu Watanabe 1b7586df97 bootctl-uki: several follow-ups for inspect_osrel()
Follow-ups for #26124 and #26158.

- use os_release_pretty_name(),
- constify the buffer passed to inspect_osrel(),
- propagate errors in inspect_osrele(), and ignore them in the caller
  side,
- and several coding style fixlets.
2023-01-25 10:51:38 +00:00
Frantisek Sumsal 19615a650b coccinelle: skip the empty-to-null transformation on the macro itself
Since the empty_to_null() function was "macrofied", we need to use a bit
of black magic to make Coccinelle avoid running the transformation on
the macro itself.

Follow-up to ef2409cbde.
2023-01-25 11:35:06 +01:00
Frantisek Sumsal d56afce6aa sysupdate: fix errno check 2023-01-25 11:28:46 +01:00
Luca Boccassi 903dd65b5e NEWS: update date and location 2023-01-24 23:09:17 +00:00
Zbigniew Jędrzejewski-Szmek 2f6c52b919 shared/efi-loader: fix compilation with !ENABLE_EFI, improve messages
When compiled without ENABLE_EFI, efi_stub_measured() was not defined, so
compilation would fail. But it's not enough to add a stub that returns
-EOPNOTSUPP. We call this function in various places and usually print the error
at warning or error level, so we'd print a confusing message. We also can't add
a stub that always returns 0, because then we'd print a message like "Kernel
stub did not measure", which would be confusing too. Adding special handling for
-EOPNOTSUPP in every caller is also unattractive. So instead efi_stub_measured()
is reworked to log the warning or error internally, and such logging is removed
from the callers, and a stub is added that logs a custom message.
2023-01-24 23:07:21 +00:00
Luca Boccassi 1d62f3a7a1
Merge pull request #26184 from keszybz/cleanups
Various fixups to recent commits
2023-01-24 23:07:05 +00:00
Luca Boccassi 1fd579061a locale: rename new XKB variables to match Debian/Ubuntu's
Debian/Ubuntu use almost the same variables, but without '_'. Given
our usage is new, rename them so that they match and downstream tech
debt can be removed.

Follow-up for https://github.com/systemd/systemd/pull/25805

See:
 https://github.com/systemd/systemd/issues/24228
 https://github.com/systemd/systemd/pull/25412
2023-01-24 22:09:58 +01:00
Daan De Meyer 246fd4d2ed docs: Update HACKING.md to mention latest mkosi is needed
Let's require users to run mkosi from git so we can fix any issues
forward instead of trying to keep the configs working with older
versions.
2023-01-24 22:05:49 +01:00
Jan Janssen 4a7ee0a521 meson: Do not include headers in source lists
Meson+ninja+compiler do this for us and are better at it.

https://mesonbuild.com/FAQ.html#do-i-need-to-add-my-headers-to-the-sources-list-like-in-autotools
2023-01-24 22:04:03 +01:00
Luca Boccassi be55191793 Update NEWS 2023-01-24 19:12:36 +00:00
Dan Streetman 40c5cc2b21 Consolidate various TAKE_* into TAKE_GENERIC(), add TAKE_STRUCT() 2023-01-24 18:33:43 +00:00
Lennart Poettering 98a1353014 man: clarify that MESSAGE= should not appear more than once in the same journal entry
One would think this was clear already, but apparently it's not clear
enough, hence let's be more explicit.

Fixes: #26175
2023-01-24 19:29:06 +01:00
Zbigniew Jędrzejewski-Szmek 1552670852 test-sleep: reduce timeout
The timeout was raised during review and I wrote that I lowered it, but forgot
to actually commit the diff. Follow-up for 31f62bdd79.
2023-01-24 19:14:27 +01:00
Zbigniew Jędrzejewski-Szmek 621f7615a9 NEWS: update for v253-rc1 2023-01-24 19:14:27 +01:00
Zbigniew Jędrzejewski-Szmek aaa448a5dc udevadm: add todo to remind us to remove compat code
https://github.com/systemd/systemd/pull/25145#issuecomment-1397606521
2023-01-24 19:14:27 +01:00
Zbigniew Jędrzejewski-Szmek 8072c9c8b0 man/bootctl: add missing markup
Fixup for 53c368d71b.
2023-01-24 19:14:27 +01:00
Lennart Poettering edfb4a474e
Merge pull request #26152 from systemd/revert-26143-issue-26142
Revert "Resolves #26142 - Fix list of supported personalities"
2023-01-24 18:14:05 +01:00
Lennart Poettering 4476fdd4c2
Merge pull request #26158 from poettering/hostnamed-end-of-support
hostnamed/hostnamectl: support os-release END_OF_SUPPORT= field
2023-01-24 18:13:45 +01:00
Lennart Poettering 162f6477c6 path-util: rework file_in_same_dir() on top of path_extract_directory()
Let's port one more over.

Note that this changes behaviour of file_in_same_dir() in some regards.
Specifically, a trailing slash of the input path will be treated
differently: previously we'd operate below that dir then, instead of the
parent. I think that makes little sense however, and I think the code
using this function doesn't expect that either.

Moroever, addresses some corner cases if the path is specified as "/" or
".", i.e. where e cannot extract a parent. These will now be treated as
error, which I think is much cleaner.
2023-01-24 18:13:27 +01:00
Yu Watanabe 5b532e14e3 bootctl-uki: several coding style fixlets
Mostly follow-ups for #26082.
2023-01-24 16:32:34 +01:00
Gerd Hoffmann 2d4260482c bootctl: kernel-inspect: print os info 2023-01-24 16:32:16 +01:00
Lennart Poettering 4c8ca41fa5 man: extend Personality= docs a bit
Let's make clear personalities are supported on ARM (as per
https://github.com/systemd/systemd/pull/26152#issuecomment-1400321944).

Also, clarify that on many archs this functionality is pretty pointless,
i.e. where only a single native arch was ever known.
2023-01-24 16:08:09 +01:00
Lennart Poettering 793fc32169 Revert "Resolves #26142 - Fix list of supported personalities"
This reverts commit fdbbb5ffc0.
2023-01-24 15:53:30 +01:00
Lennart Poettering aa9424cbe8 update TODO 2023-01-24 15:33:38 +01:00