Commit Graph
66791 Commits
Author SHA1 Message Date
Maanya Goenka d07246a621 documentation: add man page data for confext 2023-08-16 19:19:44 +01:00
Luca Boccassi 1c693730ef Merge pull request #28758 from keszybz/negative-errno-macro
Use macros to reduce indentation in errno error handling
2023-08-16 17:18:45 +01:00
Mike Yuan f2e2c93d0f journalctl: minor follow-up for --lines=
Follow-up for 8d6791d2aa

Addresses https://github.com/systemd/systemd/pull/28777#discussion_r1295790102
2023-08-16 16:23:35 +01:00
Luca Boccassi 663e27564f core: stage /run/host/os-release with a symlink to avoid possible race condition
If someone reads /run/host/os-release at the exact same time it is being updated, and it
is large enough, they might read a half-written file. This is very unlikely as
os-release is typically small and very rarely changes, but it is not
impossible.

Bind mount a staging directory instead of the file, and symlink the file
into into, so that we can do atomic file updates and close this gap.
Atomic replacement creates a new inode, so existing bind mounts would
continue to see the old file, and only new services would see the new file.
The indirection via the directory allows to work around this, as the
directory is fixed and never changes so the bind mount is always valid,
and its content is shared with all existing services.

Fixes https://github.com/systemd/systemd/issues/28794

Follow-up for 3f37a82545
2023-08-16 16:17:41 +01:00
Daan De Meyer 409986ed3e Merge pull request #28859 from poettering/btrfs-subvol-fix
btrfs: create subvol fix
2023-08-16 16:03:54 +02:00
Lennart Poettering 33b2da2d5b btrfs: use ERRNO_IS_NOT_SUPPORTED() where appropriate 2023-08-16 14:30:51 +02:00
Lennart Poettering f5254d0047 btrfs: drop O_PATH from dir_fd passed to btrfs_subvol_make() if needed
Let's make sure btrfs_subvol_make() can operate on O_PATH fds, just like
mkdirat().

Fixes a bunch of tmpfiles errors at boot if we try to create btrfs
subvols, introduced by e54c79ccc2

Fixes: e54c79ccc2
2023-08-16 14:29:20 +02:00
Mike Yuan 8d6791d2aa journalctl: support --lines=+N for showing the oldest N entries
After f582695107, the wrong behavior
occurred when --since= and --lines= are both specified is fixed.
However, it seems that the old behavior is already being somewhat
widely used, and the function itself makes sense, i.e. to allow --lines=
to output the first N journal entries.

Therefore, let's support prefixing the number for --lines= with '+',
and provide such functionality.

Related: #28746
2023-08-16 14:05:19 +02:00
Luca Boccassi d401182643 Merge pull request #28854 from keszybz/mailmap-and-license-info
Mailmap and license info
2023-08-16 12:34:22 +01:00
Luca Boccassi 2f72e94984 hwdb: update autosuspend rules
ninja -C build update-hwdb-autosuspend
2023-08-16 13:01:07 +02:00
Zbigniew Jędrzejewski-Szmek 5fa01ac036 manager: fix error handling after failure to set up child
exec_child() is supposed to set *exit_status when returning failure.
Unfortunately, we didn't do that in two cases. The result would be:
- a bogus error message "Failed at step SUCCESS spawning foo: …",
- a bogus success exit status.

Bugs introduced in 390902012c and
ad21e542b2.

The code is reworked to add some asserts and not set exit_status in the caller
so that it's clearer (also to the compiler) that it needs to be set.
2023-08-16 12:52:56 +02:00
Zbigniew Jędrzejewski-Szmek 7ab24710a6 shared/barrier: remove parens 2023-08-16 12:52:56 +02:00
Zbigniew Jędrzejewski-Szmek 3c098014f5 nspawn,shared: make ERRNO_IS_SECCOMP_FATAL an inline func with _NEG_ variant
Also rebreak comments and lines.

No functional change.
2023-08-16 12:52:56 +02:00
Zbigniew Jędrzejewski-Szmek 7d01eb35dc shared/kbd-util: simplify error handling in keymap_exists()
Once we know the return value, we can just return it, no need to
exit the loop.
2023-08-16 12:52:56 +02:00
Zbigniew Jędrzejewski-Szmek bb44fd0734 various: use _NEG_ macros to reduce indentation
No functional change intended.
2023-08-16 12:52:56 +02:00
Zbigniew Jędrzejewski-Szmek 1f2db2e315 libsystemd-network: use _NEG_ macros to reduce indentation
No functional change intended.
2023-08-16 12:52:56 +02:00
Zbigniew Jędrzejewski-Szmek c5ed77b220 libsystemd: use _NEG_ macros, adjust some comments
No functional change.
2023-08-16 12:52:56 +02:00
Zbigniew Jędrzejewski-Szmek 882321a139 manager: use _NEG_ macros to reduce indentation, reword comments, drop parens 2023-08-16 12:52:56 +02:00
Zbigniew Jędrzejewski-Szmek fe0feacb9e errno-util: allow ERRNO_IS_* to accept types wider than int
This is useful if the variable is ssize_t and we don't want to trigger a
warning or truncation.

With gcc (gcc-13.2.1-1.fc38.x86_64), the resulting systemd binary is identical,
so I assume that the compiler is able to completely optimize away the type.
2023-08-16 12:52:56 +02:00
Zbigniew Jędrzejewski-Szmek d66ad6ff85 sd-id128: introduce ERRNO_IS_NEG_MACHINE_ID_UNSET 2023-08-16 12:52:56 +02:00
Zbigniew Jędrzejewski-Szmek 3c8c67ce1d shared/cgroup-show: do not format path twice
Also, invert the "negative" condition to positive so that it matches the assert
right above. Also, print the path in the debug message.
2023-08-16 12:52:56 +02:00
Zbigniew Jędrzejewski-Szmek 13d84288bc tree-wide: use cocinnelle to apply _NEG_ macros 2023-08-16 12:52:56 +02:00
Zbigniew Jędrzejewski-Szmek b0be985cdd basic/errno-util: add wrappers which only accept negative errno
We do 'IN_SET(r, -CONST1, -CONST2)', instead of 'IN_SET(-r, CONST1, CONST2)'
because -r is undefined if r is the minimum value (i.e. INT_MIN). But we know
that the constants are small, so their negative values are fine.
2023-08-16 12:52:56 +02:00
Zbigniew Jędrzejewski-Szmek 767aad7bfd Mark all base64 files as generated
This makes them ignored by license review.
2023-08-16 12:49:45 +02:00
Zbigniew Jędrzejewski-Szmek 4afa722868 bsod: fix license tag 2023-08-16 12:49:44 +02:00
Zbigniew Jędrzejewski-Szmek 140d6853e9 mailmap: "reduce contributor count by 13"
This merges the counts for a few people who existed with and without accents,
or with different capitalizations, and suffixes. Also, stop overriding
NeilBrown's spelling of the name.

Note: IIUC, we have two Luca Bruno's: lucab@debian.net is not the same as the
other Luca BRUNO who works on coreos.

@@ -386 +385,0 @@
-     2	Damjan Georgievski
@@ -401 +399,0 @@
-     1	Daniel Berrange
@@ -425 +423 @@
-    11	Daniel P. Berrangé
+    12	Daniel P. Berrangé
@@ -888 +885,0 @@
-     1	Jiri Pirko
@@ -891 +888 @@
-     1	Jiří Pírko
+     2	Jiří Pírko
@@ -1105 +1102 @@
-    12	Luca BRUNO
+    18	Luca BRUNO
@@ -1107 +1104 @@
-     8	Luca Bruno
+     2	Luca Bruno
@@ -1160,2 +1157 @@
-     1	Marc-Andre Lureau
-    17	Marc-André Lureau
+    18	Marc-André Lureau
@@ -1313,2 +1309 @@
-    31	Michal Sekletar
-   168	Michal Sekletár
+   199	Michal Sekletár
@@ -1383,3 +1378 @@
-     2	Neal Gompa
-     1	Neal Gompa (ニール・ゴンパ)
-    12	Neil Brown
+     3	Neal Gompa (ニール・ゴンパ)
@@ -1387,0 +1381 @@
+    12	NeilBrown
@@ -1494,2 +1488 @@
-     1	Perry Yuan
-     1	Perry.Yuan
+     3	Perry Yuan
@@ -1941,2 +1934 @@
-     2	Viktar Vauchkevich
-     2	Viktar Vaŭčkievič
+     4	Viktar Vaŭčkievič
@@ -2016,2 +2008 @@
-     1	Yao Wei
-     1	Yao Wei (魏銘廷)
+     2	Yao Wei (魏銘廷)
@@ -2145 +2135,0 @@
-     1	gdamjan
@@ -2256 +2245,0 @@
-     1	perry_yuan
@@ -2331 +2320 @@
-    18	Дамјан Георгиевски
+    21	Дамјан Георгиевски
2023-08-16 12:49:42 +02:00
Lennart Poettering aea0f9abc5 update TODO 2023-08-16 11:42:13 +02:00
Lennart Poettering 79ae9015ac update TODO 2023-08-16 11:37:56 +02:00
Lennart Poettering c7c46845ff update TODO 2023-08-16 11:31:31 +02:00
Luca Boccassi 28bd57e350 Merge pull request #28733 from goenkam/maanya/systemd-scoped
core: add confext support for ExtensionImages= and ExtensionDirectories=
2023-08-16 10:12:46 +01:00
Brian Norris bd2f6a568d tools: update-hwdb-autosuspend.sh: Point at HEAD, not master branch
Many Chromium projects have moved from 'master' to 'main', where
'master' is no longer updated. Point at HEAD instead, which should
always represent the default branch.

I don't actually rerun/regenerate the database, since I don't really run
systemd environments to test that update on.
2023-08-16 02:07:00 +01:00
Maanya Goenka b856f1dfc5 test: add test for confext service-scoped support 2023-08-15 18:34:57 +00:00
Maanya Goenka 55ea4ef096 allow ExtensionImages= and ExtensionDirectories= settings to support confext images 2023-08-15 18:34:46 +00:00
Maanya Goenka 0da675fddd add an @ option for confext 2023-08-15 17:41:35 +00:00
Luca Boccassi 75bb2425a3 Merge pull request #28839 from DaanDeMeyer/repart-followups
Repart followups
2023-08-15 16:40:05 +01:00
Michael A Cassaniti c380047bf4 repart: Add verity configuration section and options 2023-08-15 15:32:09 +01:00
Daan De Meyer f19659b91f Merge pull request #28838 from DaanDeMeyer/repart-subvolume
mkosi: Create a few subvolumes in the root partition
2023-08-15 14:56:10 +02:00
Daan De Meyer 7bc6c02896 repart: Massage the minimize for XFS a bit
A 1.5 multiplier doesn't seem to be sufficient for XFS as seen in
mkosi CI. Let's increase it to 2 for XFS to hopefully get better
results.
2023-08-15 12:58:28 +02:00
Kiran Vemula a67e5c6e37 resolved: fixed bugs reported in varlink statistics (#28796)
Fixes https://github.com/systemd/systemd/issues/28791

Follow-up for bc837621a3
2023-08-15 11:45:58 +01:00
Daan De Meyer c3e83f09ea mkosi: Update to v15.1 release 2023-08-15 12:32:39 +02:00
Daan De Meyer 06ba811a76 mkosi: Create a few subvolumes in the root partition
Let's exercise the repart Subvolumes= setting by creating a few
subvolumes in the root partition when we create it.
2023-08-15 12:32:39 +02:00
Daan De Meyer ade85cd519 repart: Rework read-only logic
verity sig partitions can't actually be marked read-only, so let's
not do that to avoid an ugly warning about that. Instead, let's just
make sure that we mark verity hash and verity data partitions as
read-only.
2023-08-15 12:32:39 +02:00
Daan De Meyer ffd9d75cde repart: Allow using Subvolumes= with automatic --offline
If we fail to allocate a loopback device and subvolumes are configured,
we fail instead of falling back to a regular file.
2023-08-15 12:32:36 +02:00
Warren 5007942477 p11kit: check the flags associated with the slot instead of flags associated with the token
The logic around checking PKCS11 tokens (used by systemd-cryptenroll) contains a bug.
The code is checking the flags field of a pkcs11 token_info structure against a set of flags defined for the pkcs11 slot_info structure. This PR changes the check so that the correct structure's flag field is being checked.
(Reference to the PKCS#11 spec:http://docs.oasis-open.org/pkcs11/pkcs11-base/v2.40/os/pkcs11-base-v2.40-os.html, section CK_SLOT_INFO).
2023-08-15 11:28:14 +01:00
Daan De Meyer b1110c81d8 mkfs-util: Don't set MKE2FS_DEVICE_PHYS_SECTSIZE
We only care about the logical sector size and if the physical sector
size isn't set and we're operating on a file, mke2fs will default the
physical sector size to the logical block size anyway.

This change makes sure that if we're operating on a block device and
set an explicit logical sector size, that doesn't affect the physical
sector size.
2023-08-15 12:10:14 +02:00
Daan De Meyer 5f13fb0a73 repart: Put function call closer to its error handling 2023-08-15 12:09:31 +02:00
Luca Boccassi 4ccee4b426 Merge pull request #28812 from DaanDeMeyer/sector-size
repart: Use 4096 as the fallback sector size for verity/luks/filesystems
2023-08-15 10:16:24 +01:00
Daan De Meyer c81e350c03 Merge pull request #28833 from DaanDeMeyer/copy-subvolume
repart: Add Subvolumes= setting
2023-08-15 09:53:02 +02:00
Michael A Cassaniti eeee486159 sysupdate: Use sector size for partition size calculations 2023-08-15 09:17:12 +02:00
Daan De Meyer 4b17f5c378 Merge pull request #28829 from DaanDeMeyer/mount-fd
tree-wide: Mount file descriptors via /proc/<pid>/fd
2023-08-15 09:04:45 +02:00