]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
portable: Add ExtensionImages drop-in for any extension (#40911)
authorZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Wed, 4 Mar 2026 10:44:00 +0000 (11:44 +0100)
committerGitHub <noreply@github.com>
Wed, 4 Mar 2026 10:44:00 +0000 (11:44 +0100)
The diff seems big, but it's just removing and if and deleting the
indentation. With `git show -w` you can see clearly that is just one
line. In the files tab, in github, you can click "hide whitespaces" and
it is clear too.

I don't know if there is some better way, but when using a portable
service with an extension image that just overlays files I need to
manually add the `ExtensionImages=`. And that is added automatically for
other extension images that provide a service unit.

So, this patch just makes sure we add the `ExtensionImages=` for any
extension.

Any thoughts?

Below the commit msg for more details:

---

    Before this patch, when running:

            portablectl attach --extension ext.raw ./base.raw

No drop-in is added for the "ExtensionImages" if there aren't units from
    the extension loaded.

But the extension can just overlay files, as in my case. So before this
patch, I also need to manually add a drop-in with "ExtensionImages=" for
    it to really be loaded.

Let's just always add the drop-in for extensions. This way, it works for
    extensions that just overlay files too.

Please note this commit just removes the if (simpler to view the diff
    with git show -w). Also, the if checked for m->image_path being not
NULL, but removing it shouldn't cause a NULL pointer dereference.
Because
m->image_path is not used inside the if (it was needed just for the if
itself) and image_path is asserted at the beginning of the function to
    be non-NULL too.

    This was like this since the beginning of time in 907952bbc9
    ("portabled: add --extension parameter for layered images support")


Trivial merge