Files
systemd/src/shared
Luca Boccassi de862276ed sysext: stop storing under /usr/lib[/local]/extensions/
sysexts are meant to extend /usr. All extension images and directories are opened and merged in a
single, read-only overlayfs layer, mounted on /usr.
So far, we had fallback storage directories in /usr/lib/extensions and /usr/local/lib/extensions.
This is problematic for three reasons.

Firstly, technically, for directory-based extensions the kernel will reject
creating such an overlay, as there is a recursion problem. It actively
validates that a lowerdir is not a child of another lowerdir, and fails with
-ELOOP if it is. So having a sysext /usr/lib/extensions/myextdir/ would result
in an overlayfs config lowerdir=/usr/lib/extensions/myextdir/usr/:/usr which is
not allowed, as indicated by Christian the kernel performs this check:

/*
 * Check if this layer root is a descendant of:
 * - another layer of this overlayfs instance
 * - upper/work dir of any overlayfs instance
 */

<...>

/* Walk back ancestors to root (inclusive) looking for traps */
while (!err && parent != next) {
        if (is_lower && ovl_lookup_trap_inode(sb, parent)) {
                err = -ELOOP;
                pr_err("overlapping %s path\n", name);

Secondly, there's a confusing aspect to this recursive storage. If you
have /usr/lib/extensions/myext.raw which contains /usr/lib/extensions/mynested.raw
'systemd-sysext merge' will only pick up the first one, but both will appear in
the merged root under /usr/lib/extensions/. So you have two extension images, both
appear in your merged filesystem, but only one is actually in use.

Finally, there's a conceptual aspect: the idea behind sysexts and hermetic /usr
is that the /usr tree is not modified locally, but owned by the vendor. Dropping
extensions in /usr thus goes contrary to this foundational concept.
2023-03-30 11:25:17 +01:00
..
2022-12-05 10:37:58 +01:00
2022-12-05 10:37:58 +01:00
…
…
…
2022-11-22 01:30:03 +01:00
2022-09-13 08:13:27 +02:00
2023-03-10 09:47:39 +01:00
2023-03-10 09:47:39 +01:00
2023-03-10 09:47:39 +01:00
2023-03-21 20:53:09 +01:00
2023-03-21 20:53:09 +01:00
2022-12-02 13:27:08 +09:00
…
…
…
2023-03-29 19:09:10 +02:00
2023-03-29 19:09:10 +02:00
2023-03-11 03:32:23 +09:00
2023-03-03 13:44:12 +01:00
…
2023-03-10 09:47:39 +01:00
2023-03-10 09:47:39 +01:00
2023-03-10 09:47:39 +01:00
2022-11-08 18:21:10 +01:00
…
2023-02-14 15:09:32 +01:00
2022-09-13 08:13:27 +02:00
2022-09-13 08:13:27 +02:00
2023-01-13 17:14:23 +01:00
2023-01-10 15:16:26 +01:00
…
2022-09-13 08:13:27 +02:00
2022-12-19 14:49:01 +01:00
2022-12-19 14:49:01 +01:00
2022-11-08 18:21:10 +01:00
…
2022-11-02 20:47:41 +01:00
…
2022-09-22 14:52:37 +02:00
2023-03-09 10:46:19 -05:00
2022-11-08 18:21:10 +01:00
…
…
…
2022-09-13 08:13:27 +02:00
2022-11-08 18:21:10 +01:00
…
…