| 1 |
<?xml version='1.0'?> |
| 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 --> |
| 5 |
|
| 6 |
<refentry id="sysupdate.features" conditional='ENABLE_SYSUPDATE' |
| 7 |
xmlns:xi="http://www.w3.org/2001/XInclude"> |
| 8 |
|
| 9 |
<refentryinfo> |
| 10 |
<title>sysupdate.features</title> |
| 11 |
<productname>systemd</productname> |
| 12 |
</refentryinfo> |
| 13 |
|
| 14 |
<refmeta> |
| 15 |
<refentrytitle>sysupdate.features</refentrytitle> |
| 16 |
<manvolnum>5</manvolnum> |
| 17 |
</refmeta> |
| 18 |
|
| 19 |
<refnamediv> |
| 20 |
<refname>sysupdate.features</refname> |
| 21 |
<refpurpose>Definition Files for Optional Features</refpurpose> |
| 22 |
</refnamediv> |
| 23 |
|
| 24 |
<refsynopsisdiv> |
| 25 |
<para><simplelist> |
| 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> |
| 30 |
</simplelist></para> |
| 31 |
</refsynopsisdiv> |
| 32 |
|
| 33 |
<refsect1> |
| 34 |
<title>Description</title> |
| 35 |
|
| 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> |
| 41 |
|
| 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 |
| 45 |
target. |
| 46 |
This is the primary difference an Optional Feature and a |
| 47 |
<citerefentry><refentrytitle>systemd-sysupdate</refentrytitle><manvolnum>8</manvolnum></citerefentry> |
| 48 |
component. |
| 49 |
When a feature is disabled, its transfers will not be considered when checking for and downloading updates, |
| 50 |
but <command>systemd-sysupdate</command> will still consider them while vacuuming and in other situations |
| 51 |
where it needs to determine ownership over previously downloaded system resources. |
| 52 |
<command>systemd-sysupdate</command> will clean up all instances of the feature's transfers whenever it |
| 53 |
is disabled, effectively uninstalling it.</para> |
| 54 |
|
| 55 |
<para>Optional Features are described by <filename>sysupdate.d/*.feature</filename> files, which are |
| 56 |
defined below. |
| 57 |
Transfers can declare that they belong to a feature via the <varname>Features=</varname> setting. |
| 58 |
Feature definitions support drop-in files, which are most commonly used to override the |
| 59 |
<varname>Enabled=</varname> setting. |
| 60 |
They can also be masked to hide the availability of the feature entirely.</para> |
| 61 |
|
| 62 |
<para>Each <filename>*.feature</filename> file contains one section: [Feature].</para> |
| 63 |
</refsect1> |
| 64 |
|
| 65 |
<refsect1> |
| 66 |
<title>[Feature] Section Options</title> |
| 67 |
|
| 68 |
<para>This section defines general properties of this feature.</para> |
| 69 |
|
| 70 |
<variablelist> |
| 71 |
<varlistentry> |
| 72 |
<term><varname>Description=</varname></term> |
| 73 |
|
| 74 |
<listitem><para>A short human-readable description of this feature. |
| 75 |
This may be used as a label for this feature, so the string should meaningfully identify the feature |
| 76 |
among the features available in <filename>sysupdate.d/</filename>.</para> |
| 77 |
|
| 78 |
<xi:include href="version-info.xml" xpointer="v257"/></listitem> |
| 79 |
</varlistentry> |
| 80 |
|
| 81 |
<varlistentry> |
| 82 |
<term><varname>Documentation=</varname></term> |
| 83 |
|
| 84 |
<listitem><para>A user-presentable URL to documentation about this feature. |
| 85 |
This setting supports specifier expansion; see below for details on supported specifiers.</para> |
| 86 |
|
| 87 |
<xi:include href="version-info.xml" xpointer="v257"/></listitem> |
| 88 |
</varlistentry> |
| 89 |
|
| 90 |
<varlistentry> |
| 91 |
<term><varname>AppStream=</varname></term> |
| 92 |
|
| 93 |
<listitem><para>A URL to an |
| 94 |
<ulink url="https://www.freedesktop.org/software/appstream/docs/chap-CatalogData.html">AppStream catalog</ulink> |
| 95 |
XML file. |
| 96 |
This may be used by software centers (such as GNOME Software or KDE Discover) to present rich |
| 97 |
metadata about this feature. |
| 98 |
This includes display names, changelogs, icons, and more. |
| 99 |
This setting supports specifier expansion; see below for details on supported specifiers.</para> |
| 100 |
|
| 101 |
<xi:include href="version-info.xml" xpointer="v257"/></listitem> |
| 102 |
</varlistentry> |
| 103 |
|
| 104 |
<varlistentry> |
| 105 |
<term><varname>Enabled=</varname></term> |
| 106 |
|
| 107 |
<listitem><para>Whether or not this feature is enabled. If unspecified, the feature is disabled |
| 108 |
by default.</para> |
| 109 |
|
| 110 |
<xi:include href="version-info.xml" xpointer="v257"/></listitem> |
| 111 |
</varlistentry> |
| 112 |
</variablelist> |
| 113 |
</refsect1> |
| 114 |
|
| 115 |
<refsect1> |
| 116 |
<title>Specifiers</title> |
| 117 |
|
| 118 |
<para>Specifiers may be used in the <varname>Documentation=</varname> and <varname>AppStream=</varname> |
| 119 |
settings. The following expansions are understood:</para> |
| 120 |
|
| 121 |
<table class='specifiers'> |
| 122 |
<title>Specifiers available</title> |
| 123 |
<tgroup cols='3' align='left' colsep='1' rowsep='1'> |
| 124 |
<colspec colname="spec" /> |
| 125 |
<colspec colname="mean" /> |
| 126 |
<colspec colname="detail" /> |
| 127 |
<thead> |
| 128 |
<row> |
| 129 |
<entry>Specifier</entry> |
| 130 |
<entry>Meaning</entry> |
| 131 |
<entry>Details</entry> |
| 132 |
</row> |
| 133 |
</thead> |
| 134 |
<tbody> |
| 135 |
<xi:include href="standard-specifiers.xml" xpointer="a"/> |
| 136 |
<xi:include href="standard-specifiers.xml" xpointer="A"/> |
| 137 |
<xi:include href="standard-specifiers.xml" xpointer="b"/> |
| 138 |
<xi:include href="standard-specifiers.xml" xpointer="B"/> |
| 139 |
<xi:include href="standard-specifiers.xml" xpointer="H"/> |
| 140 |
<xi:include href="standard-specifiers.xml" xpointer="l"/> |
| 141 |
<xi:include href="standard-specifiers.xml" xpointer="m"/> |
| 142 |
<xi:include href="standard-specifiers.xml" xpointer="M"/> |
| 143 |
<xi:include href="standard-specifiers.xml" xpointer="o"/> |
| 144 |
<xi:include href="standard-specifiers.xml" xpointer="v"/> |
| 145 |
<xi:include href="standard-specifiers.xml" xpointer="w"/> |
| 146 |
<xi:include href="standard-specifiers.xml" xpointer="W"/> |
| 147 |
<xi:include href="standard-specifiers.xml" xpointer="T"/> |
| 148 |
<xi:include href="standard-specifiers.xml" xpointer="V"/> |
| 149 |
<xi:include href="standard-specifiers.xml" xpointer="percent"/> |
| 150 |
</tbody> |
| 151 |
</tgroup> |
| 152 |
</table> |
| 153 |
</refsect1> |
| 154 |
|
| 155 |
<refsect1> |
| 156 |
<title>Examples</title> |
| 157 |
|
| 158 |
<example> |
| 159 |
<title>Development Tools for Image-Based OS</title> |
| 160 |
|
| 161 |
<para>We'll use the hypothetical "foobarOS" described in |
| 162 |
<citerefentry><refentrytitle>sysupdate.d</refentrytitle><manvolnum>5</manvolnum></citerefentry> as our |
| 163 |
example base OS. |
| 164 |
The vast majority of foobarOS's users have no need for a compiler, build system, debugger, and other |
| 165 |
such development tools to be part of their OS. |
| 166 |
However, the developers of foobarOS itself need this build tooling to be available. |
| 167 |
So, foobarOS needs to provide a system extension image (see |
| 168 |
<citerefentry><refentrytitle>systemd-sysext</refentrytitle><manvolnum>8</manvolnum></citerefentry>) |
| 169 |
containing these development tools, and this image must be updated in lock-step with the underlying |
| 170 |
base OS. |
| 171 |
This is a great use case for an optional OS feature, so let's define one: |
| 172 |
</para> |
| 173 |
|
| 174 |
<para><programlisting># /usr/lib/sysupdate.d/devel.feature |
| 175 |
[Feature] |
| 176 |
Description=Development Tools |
| 177 |
Documentation=https://developer.example.com/foobarOS/getting-started |
| 178 |
Enabled=false |
| 179 |
</programlisting></para> |
| 180 |
|
| 181 |
<para>The above defines the <literal>devel</literal> feature, and disables it by default. |
| 182 |
Now let's define a transfer that's associated with this feature:</para> |
| 183 |
|
| 184 |
<para><programlisting># /usr/lib/sysupdate.d/50-devel.transfer |
| 185 |
[Transfer] |
| 186 |
Features=devel |
| 187 |
ProtectVersion=%A |
| 188 |
|
| 189 |
[Source] |
| 190 |
Type=url-file |
| 191 |
Path=https://download.example.com/ |
| 192 |
MatchPattern=foobarOS_@v_devel.raw.xz |
| 193 |
|
| 194 |
[Target] |
| 195 |
Type=regular-file |
| 196 |
Path=/var/lib/extensions |
| 197 |
MatchPattern=foobarOS_@v_devel.raw |
| 198 |
Mode=0444 |
| 199 |
InstancesMax=2 |
| 200 |
</programlisting></para> |
| 201 |
|
| 202 |
<para>With these two files, we have created a feature called <literal>devel</literal> that, when |
| 203 |
enabled, will download and decompress the appropriate version of |
| 204 |
<literal>https://download.example.com/foobarOS_@v_devel.raw.xz</literal> into |
| 205 |
<literal>/var/lib/extensions/foobarOS_@v_devel.raw</literal> during each OS update.</para> |
| 206 |
|
| 207 |
<para>The developers of foobarOS can enable the <literal>devel</literal> feature on their workstations |
| 208 |
by creating the following drop-in:</para> |
| 209 |
|
| 210 |
<para><programlisting># /etc/sysupdate.d/devel.feature.d/enable.conf |
| 211 |
[Feature] |
| 212 |
Enabled=true |
| 213 |
</programlisting></para> |
| 214 |
</example> |
| 215 |
|
| 216 |
<example> |
| 217 |
<title>Proprietary Drivers</title> |
| 218 |
|
| 219 |
<para>Suppose that many of foobarOS's users have a GPU manufactured by the MVISUAL corporation. |
| 220 |
Due to lack of documentation and difficulty in reverse-engineering the hardware, the open-source |
| 221 |
drivers for MVISUAL GPUs are unable to make proper use of available graphics and compute performance. |
| 222 |
MVISUAL provides a redistributable proprietary driver for their cards, and foobarOS's developers |
| 223 |
distribute them to address their users' needs.</para> |
| 224 |
|
| 225 |
<para>MVISUAL's driver has a couple different parts that must be installed for it to function: a UKI |
| 226 |
addon to configure the kernel command-line, an initrd system extension image to add the MVISUAL kernel |
| 227 |
module into the initrd, and a regular system extension image to add the proprietary OpenGL and Vulkan |
| 228 |
userspace drivers. |
| 229 |
All of these should be version-locked to the core OS.</para> |
| 230 |
|
| 231 |
<para>Let's start by defining an optional feature named <literal>mvisual-driver</literal>:</para> |
| 232 |
|
| 233 |
<para><programlisting># /usr/lib/sysupdate.d/mvisual-driver.feature |
| 234 |
[Feature] |
| 235 |
Description=MVISUAL Proprietary GPU Driver |
| 236 |
Documentation=https://support.example.com/foobarOS/mvisual |
| 237 |
AppStream=https://metadata.example.com/mvisual-driver-%A.xml.gz |
| 238 |
</programlisting></para> |
| 239 |
|
| 240 |
<para>Note that we define AppStream metadata for this feature, because we want software centers to |
| 241 |
present it to end-users. |
| 242 |
Next, let's define the corresponding transfers:</para> |
| 243 |
|
| 244 |
<para><programlisting># /usr/lib/sysupdate.d/50-mvisual-userspace.transfer |
| 245 |
[Transfer] |
| 246 |
Features=mvisual-driver |
| 247 |
ProtectVersion=%A |
| 248 |
|
| 249 |
[Source] |
| 250 |
Type=url-file |
| 251 |
Path=https://download.example.com/ |
| 252 |
MatchPattern=foobarOS_@v_mvisual_userspace.raw.xz |
| 253 |
|
| 254 |
[Target] |
| 255 |
Type=regular-file |
| 256 |
Path=/var/lib/extensions |
| 257 |
MatchPattern=foobarOS_@v_mvisual.raw |
| 258 |
Mode=0444 |
| 259 |
InstancesMax=2 |
| 260 |
</programlisting></para> |
| 261 |
|
| 262 |
<para><programlisting># /usr/lib/sysupdate.d/70-mvisual-initrd.transfer |
| 263 |
[Transfer] |
| 264 |
Features=mvisual-driver |
| 265 |
ProtectVersion=%A |
| 266 |
|
| 267 |
[Source] |
| 268 |
Type=url-file |
| 269 |
Path=https://download.example.com/ |
| 270 |
MatchPattern=foobarOS_@v_mvisual_initrd.raw.xz |
| 271 |
|
| 272 |
[Target] |
| 273 |
Type=regular-file |
| 274 |
Path=/EFI/Linux |
| 275 |
PathRelativeTo=boot |
| 276 |
[email protected]/foobarOS_mvisual.raw |
| 277 |
Mode=0444 |
| 278 |
InstancesMax=2 |
| 279 |
</programlisting></para> |
| 280 |
|
| 281 |
<para><programlisting># /usr/lib/sysupdate.d/90-mvisual-addon.transfer |
| 282 |
[Transfer] |
| 283 |
Features=mvisual-driver |
| 284 |
ProtectVersion=%A |
| 285 |
|
| 286 |
[Source] |
| 287 |
Type=url-file |
| 288 |
Path=https://download.example.com/ |
| 289 |
MatchPattern=foobarOS_@v_mvisual_addon.efi.xz |
| 290 |
|
| 291 |
[Target] |
| 292 |
Type=regular-file |
| 293 |
Path=/EFI/Linux |
| 294 |
PathRelativeTo=boot |
| 295 |
[email protected]/foobarOS_mvisual.addon.efi |
| 296 |
Mode=0444 |
| 297 |
InstancesMax=2 |
| 298 |
</programlisting></para> |
| 299 |
</example> |
| 300 |
|
| 301 |
<example> |
| 302 |
<title>Intersecting Features</title> |
| 303 |
|
| 304 |
<para>Suppose that MVISUAL releases special tooling to help a distribution developer troubleshoot |
| 305 |
crashes in their proprietary driver. |
| 306 |
Let's define a transfer:</para> |
| 307 |
|
| 308 |
<para><programlisting># /usr/lib/sysupdate.d/50-mvisual-debugger.transfer |
| 309 |
[Transfer] |
| 310 |
RequisiteFeatures=devel mvisual-driver |
| 311 |
ProtectVersion=%A |
| 312 |
|
| 313 |
[Source] |
| 314 |
Type=url-file |
| 315 |
Path=https://download.example.com/ |
| 316 |
MatchPattern=foobarOS_@v_devel.raw.xz |
| 317 |
|
| 318 |
[Target] |
| 319 |
Type=regular-file |
| 320 |
Path=/var/lib/extensions |
| 321 |
MatchPattern=foobarOS_@v_devel.raw |
| 322 |
Mode=0444 |
| 323 |
InstancesMax=2 |
| 324 |
</programlisting></para> |
| 325 |
|
| 326 |
<para>This transfer will be used only if both the <literal>devel</literal> and |
| 327 |
<literal>mvisual-driver</literal> features are enabled.</para> |
| 328 |
</example> |
| 329 |
</refsect1> |
| 330 |
|
| 331 |
<refsect1> |
| 332 |
<title>See Also</title> |
| 333 |
<para><simplelist type="inline"> |
| 334 |
<member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member> |
| 335 |
<member><citerefentry><refentrytitle>systemd-sysupdate</refentrytitle><manvolnum>8</manvolnum></citerefentry></member> |
| 336 |
<member><citerefentry><refentrytitle>sysupdate.d</refentrytitle><manvolnum>5</manvolnum></citerefentry></member> |
| 337 |
</simplelist></para> |
| 338 |
</refsect1> |
| 339 |
|
| 340 |
</refentry> |