2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
4 <!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
6 <refentry id="sysupdate.features" conditional='ENABLE_SYSUPDATE'
7 xmlns:xi="http://www.w3.org/2001/XInclude">
10 <title>sysupdate.features</title>
11 <productname>systemd</productname>
15 <refentrytitle>sysupdate.features</refentrytitle>
16 <manvolnum>5</manvolnum>
20 <refname>sysupdate.features</refname>
21 <refpurpose>Definition Files for Optional Features</refpurpose>
26 <member><filename>/etc/sysupdate.d/*.feature</filename></member>
27 <member><filename>/run/sysupdate.d/*.feature</filename></member>
28 <member><filename>/usr/local/lib/sysupdate.d/*.feature</filename></member>
29 <member><filename>/usr/lib/sysupdate.d/*.feature</filename></member>
34 <title>Description</title>
36 <para>"Optional Features" are functionality provided by
37 <citerefentry><refentrytitle>systemd-sysupdate</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
38 that allow a distribution to define sets of
39 <citerefentry><refentrytitle>sysupdate.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>
40 transfer definitions that are intended to be enabled or disabled by the system administrator.</para>
42 <para>When a feature is enabled, transfers belonging to it will be considered when checking for and
43 downloading updates, when vacuuming, and in all other situations.
44 In effect, transfers belonging to a feature will always be updated in lock-step with the rest of their
46 This is the primary difference an Optional Feature and a <command>systemd-sysupdate</command> component.
47 When a feature is disabled, its transfers will not be considered when checking for and downloading updates,
48 but <command>systemd-sysupdate</command> will still consider them while vacuuming and in other situations
49 where it needs to determine ownership over previously downloaded system resources.
50 <command>systemd-sysupdate</command> will clean up all instances of the feature's transfers whenever it
51 is disabled, effectively uninstalling it.</para>
53 <para>Optional Features are described by <filename>sysupdate.d/*.feature</filename> files, which are
55 Transfers can declare that they belong to a feature via the <varname>Features=</varname> setting.
56 Feature definitions support drop-in files, which are most commonly used to override the
57 <varname>Enabled=</varname> setting).
58 They can also be masked out to hide the availability of the feature entirely.</para>
60 <para>Each <filename>*.feature</filename> file contains one section: [Feature].</para>
64 <title>[Feature] Section Options</title>
66 <para>This section defines general properties of this feature.</para>
70 <term><varname>Description=</varname></term>
72 <listitem><para>A short human readable description of this feature.
73 This may be used as a label for this feature, so the string should meaningfully identify the feature
74 among the features available in <filename>sysupdate.d/</filename>.</para>
76 <xi:include href="version-info.xml" xpointer="v257"/></listitem>
80 <term><varname>Documentation=</varname></term>
82 <listitem><para>A user-presentable URL to documentation about this feature.
83 This setting supports specifier expansion; see below for details on supported specifiers.</para>
85 <xi:include href="version-info.xml" xpointer="v257"/></listitem>
89 <term><varname>AppStream=</varname></term>
91 <listitem><para>A URL to an
92 <ulink url="https://www.freedesktop.org/software/appstream/docs/chap-CatalogData.html">AppStream catalog</ulink>
94 This may be used by software centers (such as GNOME Software or KDE Discover) to present rich
95 metadata about this feature.
96 This includes display names, changelogs, icons, and more.
97 This setting supports specifier expansion; see below for details on supported specifiers.</para>
99 <xi:include href="version-info.xml" xpointer="v257"/></listitem>
103 <term><varname>Enabled=</varname></term>
105 <listitem><para>Whether or not this feature is enabled. If unspecified, the feature is disabled
108 <xi:include href="version-info.xml" xpointer="v257"/></listitem>
114 <title>Specifiers</title>
116 <para>Specifiers may be used in the <varname>Documentation=</varname> and <varname>AppStream=</varname>
117 settings. The following expansions are understood:</para>
119 <table class='specifiers'>
120 <title>Specifiers available</title>
121 <tgroup cols='3' align='left' colsep='1' rowsep='1'>
122 <colspec colname="spec" />
123 <colspec colname="mean" />
124 <colspec colname="detail" />
127 <entry>Specifier</entry>
128 <entry>Meaning</entry>
129 <entry>Details</entry>
133 <xi:include href="standard-specifiers.xml" xpointer="a"/>
134 <xi:include href="standard-specifiers.xml" xpointer="A"/>
135 <xi:include href="standard-specifiers.xml" xpointer="b"/>
136 <xi:include href="standard-specifiers.xml" xpointer="B"/>
137 <xi:include href="standard-specifiers.xml" xpointer="H"/>
138 <xi:include href="standard-specifiers.xml" xpointer="l"/>
139 <xi:include href="standard-specifiers.xml" xpointer="m"/>
140 <xi:include href="standard-specifiers.xml" xpointer="M"/>
141 <xi:include href="standard-specifiers.xml" xpointer="o"/>
142 <xi:include href="standard-specifiers.xml" xpointer="v"/>
143 <xi:include href="standard-specifiers.xml" xpointer="w"/>
144 <xi:include href="standard-specifiers.xml" xpointer="W"/>
145 <xi:include href="standard-specifiers.xml" xpointer="T"/>
146 <xi:include href="standard-specifiers.xml" xpointer="V"/>
147 <xi:include href="standard-specifiers.xml" xpointer="percent"/>
154 <title>Examples</title>
157 <title>Development Tools for Image-Based OS</title>
159 <para>We'll use the hypothetical "foobarOS" described in
160 <citerefentry><refentrytitle>sysupdate.d</refentrytitle><manvolnum>5</manvolnum></citerefentry> as our
162 The vast majority of foobarOS's users have no need for a compiler, build system, debugger, and other
163 such development tools to be part of their OS.
164 However, the developers of foobarOS itself need this build tooling to be available.
165 So, foobarOS needs to provide a system extension image (see
166 <citerefentry><refentrytitle>systemd-sysext</refentrytitle><manvolnum>8</manvolnum></citerefentry>)
167 containing these development tools, and this image must be updated in lock-step with the underlying
169 This is a great use case for an optional OS feature, so let's define one:
172 <para><programlisting># /usr/lib/sysupdate.d/devel.feature
174 Description=Development Tools
175 Documentation=https://developer.example.com/foobarOS/getting-started
177 </programlisting></para>
179 <para>The above defines the <literal>devel</literal> feature, and disables it by default.
180 Now let's define a transfer that's associated with this feature:</para>
182 <para><programlisting># /usr/lib/sysupdate.d/50-devel.transfer
189 Path=https://download.example.com/
190 MatchPattern=foobarOS_@v_devel.raw.xz
194 Path=/var/lib/extensions
195 MatchPattern=foobarOS_@v_devel.raw
198 </programlisting></para>
200 <para>With these two files, we have created a feature called <literal>devel</literal> that, when
201 enabled, will download and decompress the appropriate version of
202 <literal>https://download.example.com/foobarOS_@v_devel.raw.xz</literal> into
203 <literal>/var/lib/extensions/foobarOS_@v_devel.raw</literal> during each OS update.</para>
205 <para>The developers of foobarOS can enable the <literal>devel</literal> feature on their workstations
206 by creating the following drop-in:</para>
208 <para><programlisting># /etc/sysupdate.d/devel.feature.d/enable.conf
211 </programlisting></para>
215 <title>Proprietary Drivers</title>
217 <para>Suppose that many of foobarOS's users have a GPU manufactured by the MVISUAL corporation.
218 Due to lack of documentation and difficulty in reverse-engineering the hardware, the open-source
219 drivers for MVISUAL GPUs are unable to make proper use of available graphics and compute performance.
220 MVISUAL provides a redistributable proprietary driver for their cards, and foobarOS's developers
221 distribute them to address their users' needs.</para>
223 <para>MVISUAL's driver has a couple different parts that must be installed for it to function: a UKI
224 addon to configure the kernel command-line, an initrd system extension image to add the MVISUAL kernel
225 module into the initrd, and a regular system extension image to add the proprietary OpenGL and Vulkan
227 All of these should be version-locked to the core OS.</para>
229 <para>Let's start by defining an optional feature named <literal>mvisual-driver</literal>:</para>
231 <para><programlisting># /usr/lib/sysupdate.d/mvisual-driver.feature
233 Description=MVISUAL Proprietary GPU Driver
234 Documentation=https://support.example.com/foobarOS/mvisual
235 AppStream=https://metadata.example.com/mvisual-driver-%A.xml.gz
236 </programlisting></para>
238 <para>Note that we define AppStream metadata for this feature, because we want software centers to
239 present it to end-users.
240 Next, let's define the corresponding transfers:</para>
242 <para><programlisting># /usr/lib/sysupdate.d/50-mvisual-userspace.transfer
244 Features=mvisual-driver
249 Path=https://download.example.com/
250 MatchPattern=foobarOS_@v_mvisual_userspace.raw.xz
254 Path=/var/lib/extensions
255 MatchPattern=foobarOS_@v_mvisual.raw
258 </programlisting></para>
260 <para><programlisting># /usr/lib/sysupdate.d/70-mvisual-initrd.transfer
262 Features=mvisual-driver
267 Path=https://download.example.com/
268 MatchPattern=foobarOS_@v_mvisual_initrd.raw.xz
274 MatchPattern=foobarOS_@v.efi.extra.d/foobarOS_mvisual.raw
277 </programlisting></para>
279 <para><programlisting># /usr/lib/sysupdate.d/90-mvisual-addon.transfer
281 Features=mvisual-driver
286 Path=https://download.example.com/
287 MatchPattern=foobarOS_@v_mvisual_addon.efi.xz
293 MatchPattern=foobarOS_@v.efi.extra.d/foobarOS_mvisual.addon.efi
296 </programlisting></para>
300 <title>Intersecting Features</title>
302 <para>Suppose that MVISUAL releases special tooling to help a distribution developer troubleshoot
303 crashes in their proprietary driver.
304 Let's define a transfer:</para>
306 <para><programlisting># /usr/lib/sysupdate.d/50-mvisual-debugger.transfer
308 RequisiteFeatures=devel mvisual-driver
313 Path=https://download.example.com/
314 MatchPattern=foobarOS_@v_devel.raw.xz
318 Path=/var/lib/extensions
319 MatchPattern=foobarOS_@v_devel.raw
322 </programlisting></para>
324 <para>This transfer will be used only if both the <literal>devel</literal> and
325 <literal>mvisual-driver</literal> features are enabled.</para>
330 <title>See Also</title>
331 <para><simplelist type="inline">
332 <member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
333 <member><citerefentry><refentrytitle>systemd-sysupdate</refentrytitle><manvolnum>8</manvolnum></citerefentry></member>
334 <member><citerefentry><refentrytitle>sysupdate.d</refentrytitle><manvolnum>5</manvolnum></citerefentry></member>