1<?xml version='1.0'?> <!--*-nxml-*-->
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 -->
5
6<refentry id="os-release" xmlns:xi="http://www.w3.org/2001/XInclude">
7  <refentryinfo>
8    <title>os-release</title>
9    <productname>systemd</productname>
10  </refentryinfo>
11
12  <refmeta>
13    <refentrytitle>os-release</refentrytitle>
14    <manvolnum>5</manvolnum>
15  </refmeta>
16
17  <refnamediv>
18    <refname>os-release</refname>
19    <refname>initrd-release</refname>
20    <refname>extension-release</refname>
21    <refpurpose>Operating system identification</refpurpose>
22  </refnamediv>
23
24  <refsynopsisdiv>
25    <para><filename>/etc/os-release</filename></para>
26    <para><filename>/usr/lib/os-release</filename></para>
27    <para><filename>/etc/initrd-release</filename></para>
28    <para><filename>/usr/lib/extension-release.d/extension-release.<replaceable>IMAGE</replaceable></filename></para>
29  </refsynopsisdiv>
30
31  <refsect1>
32    <title>Description</title>
33
34    <para>The <filename>/etc/os-release</filename> and
35    <filename>/usr/lib/os-release</filename> files contain operating
36    system identification data.</para>
37
38    <para>The format of <filename>os-release</filename> is a newline-separated list of
39    environment-like shell-compatible variable assignments. It is possible to source the configuration from
40    Bourne shell scripts, however, beyond mere variable assignments, no shell features are supported (this
41    means variable expansion is explicitly not supported), allowing applications to read the file without
42    implementing a shell compatible execution engine. Variable assignment values must be enclosed in double
43    or single quotes if they include spaces, semicolons or other special characters outside of A–Z, a–z,
44    0–9. (Assignments that do not include these special characters may be enclosed in quotes too, but this is
45    optional.) Shell special characters ("$", quotes, backslash, backtick) must be escaped with backslashes,
46    following shell style. All strings should be in UTF-8 encoding, and non-printable characters should not
47    be used. Concatenation of multiple individually quoted strings is not supported. Lines beginning with "#"
48    are treated as comments. Blank lines are permitted and ignored.</para>
49
50    <para>The file <filename>/etc/os-release</filename> takes
51    precedence over <filename>/usr/lib/os-release</filename>.
52    Applications should check for the former, and exclusively use its
53    data if it exists, and only fall back to
54    <filename>/usr/lib/os-release</filename> if it is missing.
55    Applications should not read data from both files at the same
56    time. <filename>/usr/lib/os-release</filename> is the recommended
57    place to store OS release information as part of vendor trees.
58    <filename>/etc/os-release</filename> should be a relative symlink
59    to <filename>/usr/lib/os-release</filename>, to provide
60    compatibility with applications only looking at
61    <filename>/etc/</filename>. A relative symlink instead of an
62    absolute symlink is necessary to avoid breaking the link in a
63    chroot or initrd environment such as dracut.</para>
64
65    <para><filename>os-release</filename> contains data that is
66    defined by the operating system vendor and should generally not be
67    changed by the administrator.</para>
68
69    <para>As this file only encodes names and identifiers it should
70    not be localized.</para>
71
72    <para>The <filename>/etc/os-release</filename> and
73    <filename>/usr/lib/os-release</filename> files might be symlinks
74    to other files, but it is important that the file is available
75    from earliest boot on, and hence must be located on the root file
76    system.</para>
77
78    <para><filename>os-release</filename> must not contain repeating keys. Nevertheless, readers should pick
79    the entries later in the file in case of repeats, similarly to how a shell sourcing the file would. A
80    reader may warn about repeating entries.</para>
81
82    <para>For a longer rationale for <filename>os-release</filename>
83    please refer to the <ulink
84    url="http://0pointer.de/blog/projects/os-release">Announcement of <filename>/etc/os-release</filename></ulink>.</para>
85
86    <refsect2>
87      <title><filename>/etc/initrd-release</filename></title>
88
89      <para>In the <ulink
90      url="https://www.kernel.org/doc/html/latest/admin-guide/initrd.html">initrd</ulink>,
91      <filename>/etc/initrd-release</filename> plays the same role as <filename>os-release</filename> in the
92      main system. Additionally, the presence of that file means that the system is in the initrd phase.
93      <filename>/etc/os-release</filename> should be symlinked to <filename>/etc/initrd-release</filename>
94      (or vice versa), so programs that only look for <filename>/etc/os-release</filename> (as described
95      above) work correctly.</para>
96
97      <para>The rest of this document that talks about <filename>os-release</filename> should be understood
98      to apply to <filename>initrd-release</filename> too.</para>
99    </refsect2>
100
101    <refsect2>
102      <title><filename>/usr/lib/extension-release.d/extension-release.<replaceable>IMAGE</replaceable></filename></title>
103
104      <para><filename>/usr/lib/extension-release.d/extension-release.<replaceable>IMAGE</replaceable></filename>
105      plays the same role for extension images as <filename>os-release</filename> for the main system, and
106      follows the syntax and rules as described in the <ulink
107      url="https://systemd.io/PORTABLE_SERVICES">Portable Services Documentation</ulink>. The purpose of this
108      file is to identify the extension and to allow the operating system to verify that the extension image
109      matches the base OS. This is typically implemented by checking that the <varname>ID=</varname> options
110      match, and either <varname>SYSEXT_LEVEL=</varname> exists and matches too, or if it is not present,
111      <varname>VERSION_ID=</varname> exists and matches. This ensures ABI/API compatibility between the
112      layers and prevents merging of an incompatible image in an overlay.</para>
113
114      <para>In the <filename>extension-release.<replaceable>IMAGE</replaceable></filename> filename, the
115      <replaceable>IMAGE</replaceable> part must exactly match the file name of the containing image with the
116      suffix removed. In case it is not possible to guarantee that an image file name is stable and doesn't
117      change between the build and the deployment phases, it is possible to relax this check: if exactly one
118      file whose name matches <literal><filename>extension-release.*</filename></literal> is present in this
119      directory, and the file is tagged with a <varname>user.extension-release.strict</varname>
120      <citerefentry project='man-pages'><refentrytitle>xattr</refentrytitle><manvolnum>7</manvolnum></citerefentry> set to the
121      string <literal>0</literal>, it will be used instead.</para>
122
123      <para>The rest of this document that talks about <filename>os-release</filename> should be understood
124      to apply to <filename>extension-release</filename> too.</para>
125    </refsect2>
126  </refsect1>
127
128  <refsect1>
129    <title>Options</title>
130
131    <para>The following OS identifications parameters may be set using
132    <filename>os-release</filename>:</para>
133
134    <refsect2>
135      <title>General information identifying the operating system</title>
136
137      <variablelist class='environment-variables'>
138        <varlistentry>
139          <term><varname>NAME=</varname></term>
140
141          <listitem><para>A string identifying the operating system, without a version component, and
142          suitable for presentation to the user. If not set, a default of <literal>NAME=Linux</literal> may
143          be used.</para>
144
145          <para>Examples: <literal>NAME=Fedora</literal>, <literal>NAME="Debian GNU/Linux"</literal>.
146          </para></listitem>
147        </varlistentry>
148
149        <varlistentry>
150          <term><varname>ID=</varname></term>
151
152          <listitem><para>A lower-case string (no spaces or other characters outside of 0–9, a–z, ".", "_"
153          and "-") identifying the operating system, excluding any version information and suitable for
154          processing by scripts or usage in generated filenames. If not set, a default of
155          <literal>ID=linux</literal> may be used. Note that even though this string may not include
156          characters that require shell quoting, quoting may nevertheless be used.</para>
157
158          <para>Examples: <literal>ID=fedora</literal>, <literal>ID=debian</literal>.</para></listitem>
159        </varlistentry>
160
161        <varlistentry>
162          <term><varname>ID_LIKE=</varname></term>
163
164          <listitem><para>A space-separated list of operating system identifiers in the same syntax as the
165          <varname>ID=</varname> setting. It should list identifiers of operating systems that are closely
166          related to the local operating system in regards to packaging and programming interfaces, for
167          example listing one or more OS identifiers the local OS is a derivative from.  An OS should
168          generally only list other OS identifiers it itself is a derivative of, and not any OSes that are
169          derived from it, though symmetric relationships are possible. Build scripts and similar should
170          check this variable if they need to identify the local operating system and the value of
171          <varname>ID=</varname> is not recognized. Operating systems should be listed in order of how
172          closely the local operating system relates to the listed ones, starting with the closest. This
173          field is optional.</para>
174
175          <para>Examples: for an operating system with <literal>ID=centos</literal>, an assignment of
176          <literal>ID_LIKE="rhel fedora"</literal> would be appropriate. For an operating system with
177          <literal>ID=ubuntu</literal>, an assignment of <literal>ID_LIKE=debian</literal> is appropriate.
178          </para></listitem>
179        </varlistentry>
180
181        <varlistentry>
182          <term><varname>PRETTY_NAME=</varname></term>
183
184          <listitem><para>A pretty operating system name in a format suitable for presentation to the
185          user. May or may not contain a release code name or OS version of some kind, as suitable. If not
186          set, a default of <literal>PRETTY_NAME="Linux"</literal> may be used</para>
187
188          <para>Example: <literal>PRETTY_NAME="Fedora 17 (Beefy Miracle)"</literal>.</para></listitem>
189        </varlistentry>
190
191        <varlistentry>
192          <term><varname>CPE_NAME=</varname></term>
193
194          <listitem><para>A CPE name for the operating system, in URI binding syntax, following the <ulink
195          url="http://scap.nist.gov/specifications/cpe/">Common Platform Enumeration Specification</ulink> as
196          proposed by the NIST. This field is optional.</para>
197
198          <para>Example: <literal>CPE_NAME="cpe:/o:fedoraproject:fedora:17"</literal></para></listitem>
199        </varlistentry>
200
201        <varlistentry>
202          <term><varname>VARIANT=</varname></term>
203
204          <listitem><para>A string identifying a specific variant or edition of the operating system suitable
205          for presentation to the user. This field may be used to inform the user that the configuration of
206          this system is subject to a specific divergent set of rules or default configuration settings. This
207          field is optional and may not be implemented on all systems.</para>
208
209          <para>Examples: <literal>VARIANT="Server Edition"</literal>, <literal>VARIANT="Smart Refrigerator
210          Edition"</literal>.</para>
211
212          <para>Note: this field is for display purposes only. The <varname>VARIANT_ID</varname> field should
213          be used for making programmatic decisions.</para></listitem>
214        </varlistentry>
215
216        <varlistentry>
217          <term><varname>VARIANT_ID=</varname></term>
218
219          <listitem><para>A lower-case string (no spaces or other characters outside of 0–9, a–z, ".", "_" and
220          "-"), identifying a specific variant or edition of the operating system. This may be interpreted by
221          other packages in order to determine a divergent default configuration. This field is optional and
222          may not be implemented on all systems.</para>
223
224          <para>Examples: <literal>VARIANT_ID=server</literal>, <literal>VARIANT_ID=embedded</literal>.
225          </para></listitem>
226        </varlistentry>
227      </variablelist>
228    </refsect2>
229
230    <refsect2>
231      <title>Information about the version of the operating system</title>
232
233      <variablelist class='environment-variables'>
234        <varlistentry>
235          <term><varname>VERSION=</varname></term>
236
237          <listitem><para>A string identifying the operating system version, excluding any OS name
238          information, possibly including a release code name, and suitable for presentation to the
239          user. This field is optional.</para>
240
241          <para>Examples: <literal>VERSION=17</literal>, <literal>VERSION="17 (Beefy Miracle)"</literal>.
242          </para></listitem>
243        </varlistentry>
244
245        <varlistentry>
246          <term><varname>VERSION_ID=</varname></term>
247
248          <listitem><para>A lower-case string (mostly numeric, no spaces or other characters outside of 0–9,
249          a–z, ".", "_" and "-") identifying the operating system version, excluding any OS name information
250          or release code name, and suitable for processing by scripts or usage in generated filenames. This
251          field is optional.</para>
252
253          <para>Examples: <literal>VERSION_ID=17</literal>, <literal>VERSION_ID=11.04</literal>.
254          </para></listitem>
255        </varlistentry>
256
257        <varlistentry>
258          <term><varname>VERSION_CODENAME=</varname></term>
259
260          <listitem><para>A lower-case string (no spaces or other characters outside of 0–9, a–z, ".", "_"
261          and "-") identifying the operating system release code name, excluding any OS name information or
262          release version, and suitable for processing by scripts or usage in generated filenames. This field
263          is optional and may not be implemented on all systems.</para>
264
265          <para>Examples: <literal>VERSION_CODENAME=buster</literal>,
266          <literal>VERSION_CODENAME=xenial</literal>.</para></listitem>
267        </varlistentry>
268
269        <varlistentry>
270          <term><varname>BUILD_ID=</varname></term>
271
272          <listitem><para>A string uniquely identifying the system image originally used as the installation
273          base. In most cases, <varname>VERSION_ID</varname> or
274          <varname>IMAGE_ID</varname>+<varname>IMAGE_VERSION</varname> are updated when the entire system
275          image is replaced during an update. <varname>BUILD_ID</varname> may be used in distributions where
276          the original installation image version is important: <varname>VERSION_ID</varname> would change
277          during incremental system updates, but <varname>BUILD_ID</varname> would not. This field is
278          optional.</para>
279
280          <para>Examples: <literal>BUILD_ID="2013-03-20.3"</literal>, <literal>BUILD_ID=201303203</literal>.
281          </para></listitem>
282        </varlistentry>
283
284        <varlistentry>
285          <term><varname>IMAGE_ID=</varname></term>
286
287          <listitem><para> A lower-case string (no spaces or other characters outside of 0–9, a–z, ".", "_"
288          and "-"), identifying a specific image of the operating system. This is supposed to be used for
289          environments where OS images are prepared, built, shipped and updated as comprehensive, consistent
290          OS images. This field is optional and may not be implemented on all systems, in particularly not on
291          those that are not managed via images but put together and updated from individual packages and on
292          the local system.</para>
293
294          <para>Examples: <literal>IMAGE_ID=vendorx-cashier-system</literal>,
295          <literal>IMAGE_ID=netbook-image</literal>.</para></listitem>
296        </varlistentry>
297
298        <varlistentry>
299          <term><varname>IMAGE_VERSION=</varname></term>
300
301          <listitem><para>A lower-case string (mostly numeric, no spaces or other characters outside of 0–9,
302          a–z, ".", "_" and "-") identifying the OS image version. This is supposed to be used together with
303          <varname>IMAGE_ID</varname> described above, to discern different versions of the same image.
304          </para>
305
306          <para>Examples: <literal>IMAGE_VERSION=33</literal>, <literal>IMAGE_VERSION=47.1rc1</literal>.
307          </para></listitem>
308        </varlistentry>
309      </variablelist>
310
311      <para>To summarize: if the image updates are built and shipped as comprehensive units,
312      <varname>IMAGE_ID</varname>+<varname>IMAGE_VERSION</varname> is the best fit. Otherwise, if updates
313      eventually completely replace previously installed contents, as in a typical binary distribution,
314      <varname>VERSION_ID</varname> should be used to identify major releases of the operating system.
315      <varname>BUILD_ID</varname> may be used instead or in addition to <varname>VERSION_ID</varname> when
316      the original system image version is important.</para>
317    </refsect2>
318
319    <refsect2>
320      <title>Presentation information and links</title>
321
322      <variablelist class='environment-variables'>
323        <varlistentry>
324          <term><varname>HOME_URL=</varname></term>
325          <term><varname>DOCUMENTATION_URL=</varname></term>
326          <term><varname>SUPPORT_URL=</varname></term>
327          <term><varname>BUG_REPORT_URL=</varname></term>
328          <term><varname>PRIVACY_POLICY_URL=</varname></term>
329
330          <listitem><para>Links to resources on the Internet related to the operating system.
331          <varname>HOME_URL=</varname> should refer to the homepage of the operating system, or alternatively
332          some homepage of the specific version of the operating system.
333          <varname>DOCUMENTATION_URL=</varname> should refer to the main documentation page for this
334          operating system.  <varname>SUPPORT_URL=</varname> should refer to the main support page for the
335          operating system, if there is any. This is primarily intended for operating systems which vendors
336          provide support for. <varname>BUG_REPORT_URL=</varname> should refer to the main bug reporting page
337          for the operating system, if there is any. This is primarily intended for operating systems that
338          rely on community QA. <varname>PRIVACY_POLICY_URL=</varname> should refer to the main privacy
339          policy page for the operating system, if there is any. These settings are optional, and providing
340          only some of these settings is common. These URLs are intended to be exposed in "About this system"
341          UIs behind links with captions such as "About this Operating System", "Obtain Support", "Report a
342          Bug", or "Privacy Policy". The values should be in <ulink
343          url="https://tools.ietf.org/html/rfc3986">RFC3986 format</ulink>, and should be
344          <literal>http:</literal> or <literal>https:</literal> URLs, and possibly <literal>mailto:</literal>
345          or <literal>tel:</literal>. Only one URL shall be listed in each setting. If multiple resources
346          need to be referenced, it is recommended to provide an online landing page linking all available
347          resources.</para>
348
349          <para>Examples: <literal>HOME_URL="https://fedoraproject.org/"</literal>,
350          <literal>BUG_REPORT_URL="https://bugzilla.redhat.com/"</literal>.</para></listitem>
351        </varlistentry>
352
353        <varlistentry>
354          <term><varname>LOGO=</varname></term>
355
356          <listitem><para>A string, specifying the name of an icon as defined by <ulink
357          url="http://standards.freedesktop.org/icon-theme-spec/latest">freedesktop.org Icon Theme
358          Specification</ulink>. This can be used by graphical applications to display an operating system's
359          or distributor's logo. This field is optional and may not necessarily be implemented on all
360          systems.</para>
361
362          <para>Examples: <literal>LOGO=fedora-logo</literal>, <literal>LOGO=distributor-logo-opensuse</literal>
363          </para></listitem>
364        </varlistentry>
365
366        <varlistentry>
367          <term><varname>ANSI_COLOR=</varname></term>
368
369          <listitem><para>A suggested presentation color when showing the OS name on the console. This should
370          be specified as string suitable for inclusion in the ESC [ m ANSI/ECMA-48 escape code for setting
371          graphical rendition. This field is optional.</para>
372
373          <para>Examples: <literal>ANSI_COLOR="0;31"</literal> for red, <literal>ANSI_COLOR="1;34"</literal>
374          for light blue, or <literal>ANSI_COLOR="0;38;2;60;110;180"</literal> for Fedora blue.
375          </para></listitem>
376        </varlistentry>
377      </variablelist>
378    </refsect2>
379
380    <refsect2>
381      <title>Distribution-level defaults and metadata</title>
382
383      <variablelist class='environment-variables'>
384        <varlistentry>
385          <term><varname>DEFAULT_HOSTNAME=</varname></term>
386
387          <listitem><para>A string specifying the hostname if
388          <citerefentry><refentrytitle>hostname</refentrytitle><manvolnum>5</manvolnum></citerefentry> is not
389          present and no other configuration source specifies the hostname. Must be either a single DNS label
390          (a string composed of 7-bit ASCII lower-case characters and no spaces or dots, limited to the
391          format allowed for DNS domain name labels), or a sequence of such labels separated by single dots
392          that forms a valid DNS FQDN. The hostname must be at most 64 characters, which is a Linux
393          limitation (DNS allows longer names).</para>
394
395          <para>See <citerefentry><refentrytitle>org.freedesktop.hostname1</refentrytitle><manvolnum>5</manvolnum></citerefentry>
396          for a description of how
397          <citerefentry><refentrytitle>systemd-hostnamed.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
398          determines the fallback hostname.</para></listitem>
399        </varlistentry>
400
401        <varlistentry>
402          <term><varname>SYSEXT_LEVEL=</varname></term>
403
404          <listitem><para>A lower-case string (mostly numeric, no spaces or other characters outside of 0–9,
405          a–z, ".", "_" and "-") identifying the operating system extensions support level, to indicate which
406          extension images are supported. See <filename>/usr/lib/extension-release.d/extension-release.<replaceable>IMAGE</replaceable></filename>,
407          <ulink url="https://www.kernel.org/doc/html/latest/admin-guide/initrd.html">initrd</ulink> and
408          <citerefentry><refentrytitle>systemd-sysext</refentrytitle><manvolnum>8</manvolnum></citerefentry>)
409          for more information.</para>
410
411          <para>Examples: <literal>SYSEXT_LEVEL=2</literal>, <literal>SYSEXT_LEVEL=15.14</literal>.
412          </para></listitem>
413        </varlistentry>
414
415        <varlistentry>
416          <term><varname>SYSEXT_SCOPE=</varname></term>
417          <listitem><para>Takes a space-separated list of one or more of the strings
418          <literal>system</literal>, <literal>initrd</literal> and <literal>portable</literal>. This field is
419          only supported in <filename>extension-release.d/</filename> files and indicates what environments
420          the system extension is applicable to: i.e. to regular systems, to initial RAM filesystems
421          ("initrd") or to portable service images. If unspecified, <literal>SYSEXT_SCOPE=system
422          portable</literal> is implied, i.e. any system extension without this field is applicable to
423          regular systems and to portable service environments, but not to initrd
424          environments.</para></listitem>
425        </varlistentry>
426
427        <varlistentry>
428          <term><varname>PORTABLE_PREFIXES=</varname></term>
429          <listitem><para>Takes a space-separated list of one or more valid prefix match strings for the
430          <ulink url="https://systemd.io/PORTABLE_SERVICES">Portable Services</ulink> logic. This field
431          serves two purposes: it is informational, identifying portable service images as such (and thus
432          allowing them to be distinguished from other OS images, such as bootable system images). In is also
433          used when a portable service image is attached: the specified or implied portable service prefix is
434          checked against the list specified here, to enforce restrictions how images may be attached to a
435          system.</para></listitem>
436        </varlistentry>
437      </variablelist>
438    </refsect2>
439
440    <refsect2>
441      <title>Notes</title>
442
443      <para>If you are using this file to determine the OS or a specific version of it, use the
444      <varname>ID</varname> and <varname>VERSION_ID</varname> fields, possibly with
445      <varname>ID_LIKE</varname> as fallback for <varname>ID</varname>. When looking for an OS identification
446      string for presentation to the user use the <varname>PRETTY_NAME</varname> field.</para>
447
448      <para>Note that operating system vendors may choose not to provide version information, for example to
449      accommodate for rolling releases. In this case, <varname>VERSION</varname> and
450      <varname>VERSION_ID</varname> may be unset. Applications should not rely on these fields to be
451      set.</para>
452
453      <para>Operating system vendors may extend the file format and introduce new fields. It is highly
454      recommended to prefix new fields with an OS specific name in order to avoid name clashes. Applications
455      reading this file must ignore unknown fields.</para>
456
457      <para>Example: <literal>DEBIAN_BTS="debbugs://bugs.debian.org/"</literal>.</para>
458
459      <para>Container and sandbox runtime managers may make the host's identification data available to
460      applications by providing the host's <filename>/etc/os-release</filename> (if available, otherwise
461      <filename>/usr/lib/os-release</filename> as a fallback) as
462      <filename>/run/host/os-release</filename>.</para>
463    </refsect2>
464  </refsect1>
465
466  <refsect1>
467    <title>Examples</title>
468
469    <example>
470      <title><filename>os-release</filename> file for Fedora Workstation</title>
471
472      <programlisting>NAME=Fedora
473VERSION="32 (Workstation Edition)"
474ID=fedora
475VERSION_ID=32
476PRETTY_NAME="Fedora 32 (Workstation Edition)"
477ANSI_COLOR="0;38;2;60;110;180"
478LOGO=fedora-logo-icon
479CPE_NAME="cpe:/o:fedoraproject:fedora:32"
480HOME_URL="https://fedoraproject.org/"
481DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f32/system-administrators-guide/"
482SUPPORT_URL="https://fedoraproject.org/wiki/Communicating_and_getting_help"
483BUG_REPORT_URL="https://bugzilla.redhat.com/"
484REDHAT_BUGZILLA_PRODUCT="Fedora"
485REDHAT_BUGZILLA_PRODUCT_VERSION=32
486REDHAT_SUPPORT_PRODUCT="Fedora"
487REDHAT_SUPPORT_PRODUCT_VERSION=32
488PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy"
489VARIANT="Workstation Edition"
490VARIANT_ID=workstation</programlisting>
491    </example>
492
493    <example>
494      <title><filename>extension-release</filename> file for an extension for Fedora Workstation 32</title>
495
496      <programlisting>ID=fedora
497VERSION_ID=32</programlisting>
498    </example>
499
500    <example>
501      <title>Reading <filename>os-release</filename> in
502      <citerefentry project='man-pages'><refentrytitle>sh</refentrytitle><manvolnum>1</manvolnum></citerefentry></title>
503
504      <programlisting><xi:include href="check-os-release.sh" parse="text" /></programlisting>
505    </example>
506
507    <example>
508      <title>Reading <filename>os-release</filename> in
509      <citerefentry project='die-net'><refentrytitle>python</refentrytitle><manvolnum>1</manvolnum></citerefentry> (versions &gt;= 3.10)</title>
510
511      <programlisting><xi:include href="check-os-release-simple.py" parse="text" /></programlisting>
512
513      <para>See docs for <ulink url="https://docs.python.org/3/library/platform.html#platform.freedesktop_os_release">
514      <function>platform.freedesktop_os_release</function></ulink> for more details.
515      </para>
516    </example>
517
518    <example>
519      <title>Reading <filename>os-release</filename> in
520      <citerefentry project='die-net'><refentrytitle>python</refentrytitle><manvolnum>1</manvolnum></citerefentry> (any version)</title>
521
522      <programlisting><xi:include href="check-os-release.py" parse="text" /></programlisting>
523
524      <para>Note that the above version that uses the built-in implementation is preferred
525      in most cases, and the open-coded version here is provided for reference.</para>
526    </example>
527
528  </refsect1>
529
530  <refsect1>
531      <title>See Also</title>
532      <para>
533        <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
534        <citerefentry project='die-net'><refentrytitle>lsb_release</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
535        <citerefentry><refentrytitle>hostname</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
536        <citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
537        <citerefentry><refentrytitle>machine-info</refentrytitle><manvolnum>5</manvolnum></citerefentry>
538      </para>
539  </refsect1>
540
541</refentry>
542