2 <!DOCTYPE refentry PUBLIC
"-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" >
4 <!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
6 <refentry id=
"org.freedesktop.portable1" conditional='ENABLE_PORTABLED'
7 xmlns:
xi=
"http://www.w3.org/2001/XInclude">
9 <title>org.freedesktop.portable1
</title>
10 <productname>systemd
</productname>
14 <refentrytitle>org.freedesktop.portable1
</refentrytitle>
15 <manvolnum>5</manvolnum>
19 <refname>org.freedesktop.portable1
</refname>
20 <refpurpose>The D-Bus interface of systemd-portabled
</refpurpose>
24 <title>Introduction
</title>
27 <citerefentry><refentrytitle>systemd-portabled.service
</refentrytitle><manvolnum>8</manvolnum></citerefentry>
28 is a system service that may be used to attach, detach and inspect portable services. This page describes the
29 D-Bus interface.
</para>
33 <title>The Manager Object
</title>
35 <para>The service exposes the following interfaces on the Manager object on the bus:
</para>
37 <programlisting executable=
"systemd-portabled" node=
"/org/freedesktop/portable1" interface=
"org.freedesktop.portable1.Manager">
38 node /org/freedesktop/portable1 {
39 interface org.freedesktop.portable1.Manager {
43 ListImages(out a(ssbtttso) images);
44 GetImageOSRelease(in s image,
45 out a{ss} os_release);
46 GetImageMetadata(in s image,
51 GetImageMetadataWithExtensions(in s image,
57 out a{say} extensions,
59 GetImageState(in s image,
61 GetImageStateWithExtensions(in s image,
65 AttachImage(in s image,
71 AttachImageWithExtensions(in s image,
78 DetachImage(in s image,
81 DetachImageWithExtensions(in s image,
85 ReattachImage(in s image,
90 out a(sss) changes_removed,
91 out a(sss) changes_updated);
92 ReattachImageWithExtensions(in s image,
98 out a(sss) changes_removed,
99 out a(sss) changes_updated);
100 RemoveImage(in s image);
101 MarkImageReadOnly(in s image,
103 SetImageLimit(in s image,
105 SetPoolLimit(in t limit);
107 @org.freedesktop.DBus.Property.EmitsChangedSignal(
"false")
108 readonly s PoolPath = '...';
109 @org.freedesktop.DBus.Property.EmitsChangedSignal(
"false")
110 readonly t PoolUsage = ...;
111 @org.freedesktop.DBus.Property.EmitsChangedSignal(
"false")
112 readonly t PoolLimit = ...;
113 @org.freedesktop.DBus.Property.EmitsChangedSignal(
"false")
114 readonly as Profiles = ['...', ...];
116 interface org.freedesktop.DBus.Peer { ... };
117 interface org.freedesktop.DBus.Introspectable { ... };
118 interface org.freedesktop.DBus.Properties { ... };
122 <!--Autogenerated cross-references for systemd.directives, do not edit-->
124 <variablelist class=
"dbus-interface" generated=
"True" extra-ref=
"org.freedesktop.portable1.Manager"/>
126 <variablelist class=
"dbus-interface" generated=
"True" extra-ref=
"org.freedesktop.portable1.Manager"/>
128 <variablelist class=
"dbus-method" generated=
"True" extra-ref=
"GetImage()"/>
130 <variablelist class=
"dbus-method" generated=
"True" extra-ref=
"ListImages()"/>
132 <variablelist class=
"dbus-method" generated=
"True" extra-ref=
"GetImageOSRelease()"/>
134 <variablelist class=
"dbus-method" generated=
"True" extra-ref=
"GetImageMetadata()"/>
136 <variablelist class=
"dbus-method" generated=
"True" extra-ref=
"GetImageMetadataWithExtensions()"/>
138 <variablelist class=
"dbus-method" generated=
"True" extra-ref=
"GetImageState()"/>
140 <variablelist class=
"dbus-method" generated=
"True" extra-ref=
"GetImageStateWithExtensions()"/>
142 <variablelist class=
"dbus-method" generated=
"True" extra-ref=
"AttachImage()"/>
144 <variablelist class=
"dbus-method" generated=
"True" extra-ref=
"AttachImageWithExtensions()"/>
146 <variablelist class=
"dbus-method" generated=
"True" extra-ref=
"DetachImage()"/>
148 <variablelist class=
"dbus-method" generated=
"True" extra-ref=
"DetachImageWithExtensions()"/>
150 <variablelist class=
"dbus-method" generated=
"True" extra-ref=
"ReattachImage()"/>
152 <variablelist class=
"dbus-method" generated=
"True" extra-ref=
"ReattachImageWithExtensions()"/>
154 <variablelist class=
"dbus-method" generated=
"True" extra-ref=
"RemoveImage()"/>
156 <variablelist class=
"dbus-method" generated=
"True" extra-ref=
"MarkImageReadOnly()"/>
158 <variablelist class=
"dbus-method" generated=
"True" extra-ref=
"SetImageLimit()"/>
160 <variablelist class=
"dbus-method" generated=
"True" extra-ref=
"SetPoolLimit()"/>
162 <variablelist class=
"dbus-property" generated=
"True" extra-ref=
"PoolPath"/>
164 <variablelist class=
"dbus-property" generated=
"True" extra-ref=
"PoolUsage"/>
166 <variablelist class=
"dbus-property" generated=
"True" extra-ref=
"PoolLimit"/>
168 <variablelist class=
"dbus-property" generated=
"True" extra-ref=
"Profiles"/>
170 <!--End of Autogenerated section-->
173 <title>Methods
</title>
175 <para><function>GetImage()
</function> may be used to get the image object path of the image with the
176 specified name.
</para>
178 <para><function>ListImages()
</function> returns an array of all currently known images. The
179 structures in the array consist of the following fields: image name, type, read-only flag, creation
180 time, modification time, current disk space, usage and image object path.
</para>
182 <para><function>GetImageOSRelease()
</function> retrieves the OS release information of an image.
183 This method returns an array of key value pairs read from the
184 <citerefentry><refentrytitle>os-release
</refentrytitle><manvolnum>5</manvolnum></citerefentry> file in
185 the image and is useful to identify the operating system used in a portable service.
</para>
187 <para><function>GetImageMetadata()
</function> retrieves metadata associated with an image.
188 This method returns the image name, the image's
<citerefentry><refentrytitle>os-release
</refentrytitle>
189 <manvolnum>5</manvolnum></citerefentry> content in the form of a (streamable) array of bytes,
190 and a list of portable units contained in the image, in the form of a string (unit name) and
191 an array of bytes with the content.
</para>
193 <para><function>GetImageMetadataWithExtensions()
</function> retrieves metadata associated with an
194 image. This method is a superset of
<function>GetImageMetadata()
</function> with the addition of a list
195 of extensions as input parameter, which were overlaid on top of the main image via
196 <function>AttachImageWithExtensions()
</function>. The path of each extension and an array of bytes with
197 the content of the respective extension-release file are returned, one such structure for each
198 extension named in the input arguments.
</para>
200 <para><function>GetImageState()
</function> retrieves the image state as one of the following
203 <listitem><para>detached
</para></listitem>
205 <listitem><para>attached
</para></listitem>
207 <listitem><para>attached-runtime
</para></listitem>
209 <listitem><para>enabled
</para></listitem>
211 <listitem><para>enabled-runtime
</para></listitem>
213 <listitem><para>running
</para></listitem>
215 <listitem><para>running-runtime
</para></listitem>
216 </itemizedlist></para>
218 <para><function>GetImageStateWithExtensions()
</function> is a superset of
219 <function>GetImageState()
</function>, with additional support for a list of extensions
220 as input parameters, which is necessary to query the state in case the image was attached
221 in that particular way. The
<varname>flag
</varname> parameter is currently unused and
222 reserved for future purposes.
</para>
224 <para><function>AttachImage()
</function> attaches a portable image to the system.
225 This method takes an image path or name, a list of strings that will be used to search for
226 unit files inside the image (partial or complete matches), a string indicating which
227 portable profile to use for the image (see
<varname>Profiles
</varname> property for
228 a list of available profiles), a boolean indicating whether to attach the image only
229 for the current boot session, and a string representing the preferred copy mode
230 (whether to copy the image or to just symlink it) with the following possible values:
232 <listitem><para>(null)
</para></listitem>
234 <listitem><para>copy
</para></listitem>
236 <listitem><para>symlink
</para></listitem>
238 This method returns the list of changes applied to the system (for example, which unit was
239 added and is now available as a system service). Each change is represented as a triplet of
240 strings: the type of change applied, the path on which it was applied, and the source
241 (if any). The type of change applied will be one of the following possible values:
243 <listitem><para>copy
</para></listitem>
245 <listitem><para>symlink
</para></listitem>
247 <listitem><para>write
</para></listitem>
249 <listitem><para>mkdir
</para></listitem>
251 Note that an image cannot be attached if a unit that it contains is already present
252 on the system.
</para>
254 <para><function>AttachImageWithExtensions()
</function> attaches a portable image to the system.
255 This method is a superset of
<function>AttachImage()
</function> with the addition of
256 a list of extensions as input parameter, which will be overlaid on top of the main
257 image. When this method is used, detaching must be done by passing the same arguments via the
258 <function>DetachImageWithExtensions()
</function> method. For more details on this functionality,
259 see the
<varname>MountImages=
</varname> entry on
260 <citerefentry><refentrytitle>systemd.exec
</refentrytitle><manvolnum>5</manvolnum></citerefentry>
261 and
<citerefentry><refentrytitle>systemd-sysext
</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
264 <para><function>DetachImage()
</function> detaches a portable image from the system.
265 This method takes an image path or name, and a boolean indicating whether the image to
266 detach was attached only for the current boot session or persistently. This method
267 returns the list of changes applied to the system (for example, which unit was removed
268 and is no longer available as a system service). Each change is represented as a triplet of
269 strings: the type of change applied, the path on which it was applied, and the source
270 (if any). The type of change applied will be one of the following possible values:
272 <listitem><para>unlink
</para></listitem>
274 Note that an image cannot be detached if a unit that it contains is running.
</para>
276 <para><function>DetachImageWithExtensions()
</function> detaches a portable image from the system.
277 This method is a superset of
<function>DetachImage()
</function> with the addition of
278 a list of extensions as input parameter, which were overlaid on top of the main
279 image via
<function>AttachImageWithExtensions()
</function>.
280 The
<varname>flag
</varname> parameter is currently unused and reserved for future purposes.
</para>
282 <para><function>ReattachImage()
</function> combines the effects of the
283 <function>AttachImage()
</function> method and the
<function>DetachImage()
</function> method.
284 The difference is that it is allowed to reattach an image while one or more of its units
285 are running. The reattach operation will fail if no matching image is attached.
286 The input parameters match the
<function>AttachImage()
</function> method, and the return
287 parameters are the combination of the return parameters of the
288 <function>DetachImage()
</function> method (first array, units that were removed) and the
289 <function>AttachImage()
</function> method (second array, units that were updated or added).
</para>
291 <para><function>ReattachImageWithExtensions()
</function> reattaches a portable image to the system.
292 This method is a superset of
<function>ReattachImage()
</function> with the addition of
293 a list of extensions as input parameter, which will be overlaid on top of the main
294 image. For more details on this functionality, see the
<varname>MountImages=
</varname> entry on
295 <citerefentry><refentrytitle>systemd.exec
</refentrytitle><manvolnum>5</manvolnum></citerefentry>
296 and
<citerefentry><refentrytitle>systemd-sysext
</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
297 The
<varname>flag
</varname> parameter is currently unused and reserved for future purposes
</para>
299 <para><function>RemoveImage()
</function> removes the image with the specified name.
</para>
301 <para><function>MarkImageReadOnly()
</function> toggles the read-only flag of an image.
</para>
303 <para><function>SetPoolLimit()
</function> sets an overall quota limit on the pool of images.
</para>
305 <para><function>SetImageLimit()
</function> sets a per-image quota limit.
</para>
307 <para>The
<function>AttachImageWithExtensions()
</function>,
308 <function>DetachImageWithExtensions()
</function> and
309 <function>ReattachImageWithExtensions()
</function> methods take in options as flags instead of
310 booleans to allow for extendability.
<varname>SD_SYSTEMD_PORTABLE_FORCE_ATTACH
</varname> will cause
311 safety checks that ensure the units are not running while the new image is attached or detached
312 to be skipped.
<varname>SD_SYSTEMD_PORTABLE_FORCE_SYSEXT
</varname> will cause the check that the
313 <filename>extension-release.
<replaceable>NAME
</replaceable></filename> file in the extension image
314 matches the image name to be skipped. They are defined as follows:
</para>
317 #define SD_SYSTEMD_PORTABLE_RUNTIME (UINT64_C(
1)
<< 0)
318 #define SD_SYSTEMD_PORTABLE_FORCE_ATTACH (UINT64_C(
1)
<< 1)
319 #define SD_SYSTEMD_PORTABLE_FORCE_SYSEXT (UINT64_C(
1)
<< 2)
324 <title>Properties
</title>
326 <para><varname>PoolPath
</varname> specifies the file system path where images are written to.
</para>
328 <para><varname>PoolUsage
</varname> specifies the current usage size of the image pool in bytes.
</para>
330 <para><varname>PoolLimit
</varname> specifies the size limit of the image pool in bytes.
</para>
332 <para><varname>Profiles
</varname> specifies the available runtime profiles for portable services.
</para>
337 <title>The Image Object
</title>
339 <para>The service exposes the following interfaces on the Image object on the bus:
</para>
341 <programlisting executable=
"systemd-portabled" node=
"/org/freedesktop/portable1" interface=
"org.freedesktop.portable1.Image">
342 node /org/freedesktop/portable1 {
343 interface org.freedesktop.portable1.Image {
345 GetOSRelease(out a{ss} os_release);
346 GetMetadata(in as matches,
350 GetMetadataWithExtensions(in as extensions,
355 out a{say} extensions,
357 GetState(out s state);
358 GetStateWithExtensions(in as extensions,
361 Attach(in as matches,
366 AttachWithExtensions(in as extensions,
374 DetachWithExtensions(in as extensions,
377 Reattach(in as matches,
381 out a(sss) changes_removed,
382 out a(sss) changes_updated);
383 ReattachWithExtensions(in as extensions,
388 out a(sss) changes_removed,
389 out a(sss) changes_updated);
391 MarkReadOnly(in b read_only);
392 SetLimit(in t limit);
394 @org.freedesktop.DBus.Property.EmitsChangedSignal(
"false")
395 readonly s Name = '...';
396 @org.freedesktop.DBus.Property.EmitsChangedSignal(
"false")
397 readonly s Path = '...';
398 @org.freedesktop.DBus.Property.EmitsChangedSignal(
"false")
399 readonly s Type = '...';
400 @org.freedesktop.DBus.Property.EmitsChangedSignal(
"false")
401 readonly b ReadOnly = ...;
402 @org.freedesktop.DBus.Property.EmitsChangedSignal(
"false")
403 readonly t CreationTimestamp = ...;
404 @org.freedesktop.DBus.Property.EmitsChangedSignal(
"false")
405 readonly t ModificationTimestamp = ...;
406 @org.freedesktop.DBus.Property.EmitsChangedSignal(
"false")
407 readonly t Usage = ...;
408 @org.freedesktop.DBus.Property.EmitsChangedSignal(
"false")
409 readonly t Limit = ...;
410 @org.freedesktop.DBus.Property.EmitsChangedSignal(
"false")
411 readonly t UsageExclusive = ...;
412 @org.freedesktop.DBus.Property.EmitsChangedSignal(
"false")
413 readonly t LimitExclusive = ...;
415 interface org.freedesktop.DBus.Peer { ... };
416 interface org.freedesktop.DBus.Introspectable { ... };
417 interface org.freedesktop.DBus.Properties { ... };
421 <!--method GetOSRelease is not documented!-->
423 <!--method GetMetadata is not documented!-->
425 <!--method GetMetadataWithExtensions is not documented!-->
427 <!--method GetState is not documented!-->
429 <!--method GetStateWithExtensions is not documented!-->
431 <!--method Attach is not documented!-->
433 <!--method AttachWithExtensions is not documented!-->
435 <!--method Detach is not documented!-->
437 <!--method DetachWithExtensions is not documented!-->
439 <!--method Reattach is not documented!-->
441 <!--method ReattachWithExtensions is not documented!-->
443 <!--method Remove is not documented!-->
445 <!--method MarkReadOnly is not documented!-->
447 <!--method SetLimit is not documented!-->
449 <!--Autogenerated cross-references for systemd.directives, do not edit-->
451 <variablelist class=
"dbus-interface" generated=
"True" extra-ref=
"org.freedesktop.portable1.Image"/>
453 <variablelist class=
"dbus-interface" generated=
"True" extra-ref=
"org.freedesktop.portable1.Image"/>
455 <variablelist class=
"dbus-method" generated=
"True" extra-ref=
"GetOSRelease()"/>
457 <variablelist class=
"dbus-method" generated=
"True" extra-ref=
"GetMetadata()"/>
459 <variablelist class=
"dbus-method" generated=
"True" extra-ref=
"GetMetadataWithExtensions()"/>
461 <variablelist class=
"dbus-method" generated=
"True" extra-ref=
"GetState()"/>
463 <variablelist class=
"dbus-method" generated=
"True" extra-ref=
"GetStateWithExtensions()"/>
465 <variablelist class=
"dbus-method" generated=
"True" extra-ref=
"Attach()"/>
467 <variablelist class=
"dbus-method" generated=
"True" extra-ref=
"AttachWithExtensions()"/>
469 <variablelist class=
"dbus-method" generated=
"True" extra-ref=
"Detach()"/>
471 <variablelist class=
"dbus-method" generated=
"True" extra-ref=
"DetachWithExtensions()"/>
473 <variablelist class=
"dbus-method" generated=
"True" extra-ref=
"Reattach()"/>
475 <variablelist class=
"dbus-method" generated=
"True" extra-ref=
"ReattachWithExtensions()"/>
477 <variablelist class=
"dbus-method" generated=
"True" extra-ref=
"Remove()"/>
479 <variablelist class=
"dbus-method" generated=
"True" extra-ref=
"MarkReadOnly()"/>
481 <variablelist class=
"dbus-method" generated=
"True" extra-ref=
"SetLimit()"/>
483 <variablelist class=
"dbus-property" generated=
"True" extra-ref=
"Name"/>
485 <variablelist class=
"dbus-property" generated=
"True" extra-ref=
"Path"/>
487 <variablelist class=
"dbus-property" generated=
"True" extra-ref=
"Type"/>
489 <variablelist class=
"dbus-property" generated=
"True" extra-ref=
"ReadOnly"/>
491 <variablelist class=
"dbus-property" generated=
"True" extra-ref=
"CreationTimestamp"/>
493 <variablelist class=
"dbus-property" generated=
"True" extra-ref=
"ModificationTimestamp"/>
495 <variablelist class=
"dbus-property" generated=
"True" extra-ref=
"Usage"/>
497 <variablelist class=
"dbus-property" generated=
"True" extra-ref=
"Limit"/>
499 <variablelist class=
"dbus-property" generated=
"True" extra-ref=
"UsageExclusive"/>
501 <variablelist class=
"dbus-property" generated=
"True" extra-ref=
"LimitExclusive"/>
503 <!--End of Autogenerated section-->
506 <title>Methods
</title>
508 <para>The following methods implement the same operation as the respective methods on the
509 <interfacename>Manager
</interfacename> object (see above). However, these methods operate on the image
510 object and hence does not take an image name parameter. Invoking the methods directly on the Manager
511 object has the advantage of not requiring a
<function>GetImage()
</function> call to get the image object
512 for a specific image name. Calling the methods on the Manager object is hence a round trip
513 optimization. List of methods:
515 <listitem><para>GetOSRelease()
</para></listitem>
517 <listitem><para>GetMetadata()
</para></listitem>
519 <listitem><para>GetMetadataWithExtensions()
</para></listitem>
521 <listitem><para>GetState()
</para></listitem>
523 <listitem><para>Attach()
</para></listitem>
525 <listitem><para>AttachWithExtensions()
</para></listitem>
527 <listitem><para>Detach()
</para></listitem>
529 <listitem><para>DetachWithExtensions()
</para></listitem>
531 <listitem><para>Reattach()
</para></listitem>
533 <listitem><para>ReattachWithExtensions()
</para></listitem>
535 <listitem><para>Remove()
</para></listitem>
537 <listitem><para>MarkReadOnly()
</para></listitem>
539 <listitem><para>SetLimit()
</para></listitem>
540 </itemizedlist></para>
544 <title>Properties
</title>
546 <para><varname>Name
</varname> specifies the image name.
</para>
548 <para><varname>Path
</varname> specifies the file system path where image is stored.
</para>
550 <para><varname>Type
</varname> specifies the image type.
</para>
552 <para><varname>ReadOnly
</varname> specifies whether the image is read-only.
</para>
554 <para><varname>CreationTimestamp
</varname> specifies the image creation timestamp.
</para>
556 <para><varname>ModificationTimestamp
</varname> specifies the image modification timestamp.
</para>
558 <para><varname>Usage
</varname> specifies the image disk usage.
</para>
560 <para><varname>Limit
</varname> specifies the image disk usage limit.
</para>
562 <para><varname>UsageExclusive
</varname> specifies the image disk usage (exclusive).
</para>
564 <para><varname>LimitExclusive
</varname> specifies the image disk usage limit (exclusive).
</para>
568 <xi:include href=
"org.freedesktop.locale1.xml" xpointer=
"versioning"/>
571 <title>History
</title>
573 <title>The Manager Object
</title>
574 <para><function>GetImageStateWithExtensions()
</function> was added in version
251.
</para>
577 <title>The Image Object
</title>
578 <para><function>GetStateWithExtensions()
</function> was added in version
251.
</para>
579 <para><function>ReattachWithExtensions()
</function> was added in version
254.
</para>