summaryrefslogtreecommitdiffstats
path: root/src/portable/portabled-image-bus.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* portable: add flag to return extension-releases in ↵Luca Boccassi2022-01-251-4/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GetImageMetadataWithExtensions Return the name of each extension and the associated extension-release file, and pretty-print them in 'portablectl inspect', if a new flag is passed. $ portablectl inspect --extension app2 --extension app0 minimal app0 app1 (Matching unit files with prefixes 'app0', 'app1'.) Image: /run/portables/minimal.raw Portable Service: n/a Operating System: Debian GNU/Linux 10 (buster) Extension: /run/portables/app2.raw Extension Scope: n/a Extension Compatibility Level: n/a Portable Service: n/a Portable Prefixes: n/a Operating System: n/a (debian 10) Extension: /run/portables/app0.raw Extension Scope: n/a Extension Compatibility Level: n/a Portable Service: n/a Portable Prefixes: n/a Operating System: n/a (debian 10) Unit files: app0.service
* portable: add GetImageStateWithExtensions methodLuca Boccassi2022-01-241-0/+27
| | | | | Allow to correctly query a layered portable service for attached/detached state.
* os-release: add new PORTABLE_PREFIXES= field for declaring valid portable ↵Lennart Poettering2021-11-231-0/+1
| | | | service match prefixes
* alloc-util: simplify GREEDY_REALLOC() logic by relying on malloc_usable_size()Lennart Poettering2021-05-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | We recently started making more use of malloc_usable_size() and rely on it (see the string_erase() story). Given that we don't really support sytems where malloc_usable_size() cannot be trusted beyond statistics anyway, let's go fully in and rework GREEDY_REALLOC() on top of it: instead of passing around and maintaining the currenly allocated size everywhere, let's just derive it automatically from malloc_usable_size(). I am mostly after this for the simplicity this brings. It also brings minor efficiency improvements I guess, but things become so much nicer to look at if we can avoid these allocation size variables everywhere. Note that the malloc_usable_size() man page says relying on it wasn't "good programming practice", but I think it does this for reasons that don't apply here: the greedy realloc logic specifically doesn't rely on the returned extra size, beyond the fact that it is equal or larger than what was requested. (This commit was supposed to be a quick patch btw, but apparently we use the greedy realloc stuff quite a bit across the codebase, so this ends up touching *a*lot* of code.)
* tree-wide: sd_bus_error_setf → set_bus_error_setZbigniew Jędrzejewski-Szmek2021-04-071-2/+2
| | | | strdup() is more efficient than asprintf().
* portabled: add --extension parameter for layered images supportLuca Boccassi2021-03-311-27/+171
| | | | | | | | | Add an --extension parameter to portablectl, and new DBUS methods to attach/detach/reattach/inspect. Allows to append separate images on top of the root directory (os-release will be searched in there) and mount the images using an overlay-like setup (unit files will be searched in there) using the new ExtensionImages service option.
* Move os-util.[ch] to basic/Zbigniew Jędrzejewski-Szmek2021-02-221-0/+1
| | | | parse_os_release() will be used basic/hostname-util.c later on.
* portable: make PortableChangeType enum anonymousLennart Poettering2021-02-171-1/+1
| | | | Same reasons as previous commit.
* portabled: use SD_BUS_METHOD_WITH_ARGSLuca Boccassi2021-02-151-9/+54
|
* portabled: use service_parse_argv/bus_add_implementationLuca Boccassi2021-02-151-0/+8
| | | | Remove some boilerplate and allow introspection
* portable: add 'reattach' verb and DBUS interfaceLuca Boccassi2021-02-101-0/+181
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add 'reattach' verb to portablectl, and corresponding DBUS interface to systemd-portabled. Takes the same parameters as 'attach', but it will do a 'detach' (and it will refuse to proceed if it cannot be done) first, matching on the unversioned prefix of the new image. Eg: portablectl reattach /tmp/foo_2.raw will cause foo_1.raw to be detached, and foo_2.raw to be attached. The key difference with a manual 'detach old' plus 'attach new' is that the running units are not disturbed until after the attach completed, and if --now is passed they are then restarted. A 'detach' is not allowed normally if the units are running. By using a restart-after-deploy method, 'reattach' allows for minimal interruption of service and also for features that only work on restart (eg: file descriptor store) to work as intended. The DBUS interface returns two lists: first the removals from the detach that were not immediately re-added in the attach, so that the caller can stop the relevant units, and then the list of additions that are either new or updates, so that the caller can restart/enable the relevant units. portablectl already implements this with the existing --now/--enable switches.
* shared: rename machine-image.[ch] → discover-image.[ch]Lennart Poettering2021-02-031-1/+1
| | | | | | | | | | The old name originates when this was used to discover "machine" images, as managed by machined/machinectl. But nowadays this is also used by portable services and system extensions, hence let's use a more generic name for this API. Taking inspiration from "dissect-image.[ch]", let's call this "discover-image.[ch]". This is pure renaming, no other changes.
* machine-image: properly support searching for images below some --root= pathLennart Poettering2021-01-191-1/+1
| | | | | systemd-sysext supports --root= for everything but the image discovery. Fix that.
* license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-091-1/+1
|
* tree-wide: define iterator inside of the macroZbigniew Jędrzejewski-Szmek2020-09-081-2/+1
|
* shared: split out property get helpersLennart Poettering2020-06-301-0/+1
| | | | No code changes, just some refactoring.
* *: convert amenable fdopen calls to take_fdopenVito Caputo2020-03-311-3/+1
| | | | | Mechanical change to eliminate some cruft by using the new take_fdopen{_unlocked}() wrappers where trivial.
* shared: split out polkit stuff from bus-util.c → bus-polkit.cLennart Poettering2020-01-221-0/+1
| | | | | | It's enough, complex stuff to warrant its own source file. No other changes, just splitting out.
* portabled: fix method nameLennart Poettering2019-04-031-1/+1
| | | | yikes.
* headers: remove unneeded includes from util.hZbigniew Jędrzejewski-Szmek2019-03-271-0/+5
| | | | | This means we need to include many more headers in various files that simply included util.h before, but it seems cleaner to do it this way.
* tree-wide: Remove O_CLOEXEC from fdopenChris Down2018-12-121-1/+1
| | | | | | | | | | | | fdopen doesn't accept "e", it's ignored. Let's not mislead people into believing that it actually sets O_CLOEXEC. From `man 3 fdopen`: > e (since glibc 2.7): > Open the file with the O_CLOEXEC flag. See open(2) for more information. This flag is ignored for fdopen() As mentioned by @jlebon in #11131.
* lockfile: drop unnecessary headers from lockfile-util.hYu Watanabe2018-12-061-0/+1
|
* portable: introduce portable_metadata_hash_ops and use itYu Watanabe2018-12-021-1/+1
|
* machine-image: introduce image_hash_ops and use itYu Watanabe2018-12-021-2/+2
|
* portabled: generate a more useful error when invalid image types are ↵Lennart Poettering2018-10-081-0/+4
| | | | | | attempted to be attached Fixes: #10095
* tree-wide: drop some double newlinesLennart Poettering2018-05-311-1/+0
|
* portable: fix memleakYu Watanabe2018-05-261-3/+2
| | | | Closes #9086.
* add new portable service frameworkLennart Poettering2018-05-241-0/+733
This adds a small service "systemd-portabled" and a matching client "portablectl", which implement the "portable service" concept. The daemon implements the actual operations, is PolicyKit-enabled and is activated on demand with exit-on-idle. Both the daemon and the client are an optional build artifact, enabled by default rhough.