chiark / gitweb /
man: document CPE field in os-release file
[elogind.git] / man / os-release.xml
1 <?xml version='1.0'?> <!--*-nxml-*-->
2 <?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?>
3 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
4         "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
5
6 <!--
7   This file is part of systemd.
8
9   Copyright 2010 Lennart Poettering
10
11   systemd is free software; you can redistribute it and/or modify it
12   under the terms of the GNU General Public License as published by
13   the Free Software Foundation; either version 2 of the License, or
14   (at your option) any later version.
15
16   systemd is distributed in the hope that it will be useful, but
17   WITHOUT ANY WARRANTY; without even the implied warranty of
18   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19   General Public License for more details.
20
21   You should have received a copy of the GNU General Public License
22   along with systemd; If not, see <http://www.gnu.org/licenses/>.
23 -->
24
25 <refentry id="os-release">
26         <refentryinfo>
27                 <title>os-release</title>
28                 <productname>systemd</productname>
29
30                 <authorgroup>
31                         <author>
32                                 <contrib>Developer</contrib>
33                                 <firstname>Lennart</firstname>
34                                 <surname>Poettering</surname>
35                                 <email>lennart@poettering.net</email>
36                         </author>
37                 </authorgroup>
38         </refentryinfo>
39
40         <refmeta>
41                 <refentrytitle>os-release</refentrytitle>
42                 <manvolnum>5</manvolnum>
43         </refmeta>
44
45         <refnamediv>
46                 <refname>os-release</refname>
47                 <refpurpose>Operating system identification</refpurpose>
48         </refnamediv>
49
50         <refsynopsisdiv>
51                 <para><filename>/etc/os-release</filename></para>
52         </refsynopsisdiv>
53
54         <refsect1>
55                 <title>Description</title>
56
57                 <para>The <filename>/etc/os-release</filename> file
58                 contains operating system identification data.</para>
59
60                 <para>The basic file format of
61                 <filename>os-release</filename> is a
62                 newline-separated list of environment-like
63                 shell-compatible variable assignments. It is possible
64                 to source the configuration from shell scripts,
65                 however, beyond mere variable assignments no shell
66                 features are supported, allowing applications to read
67                 the file without implementing a shell compatible
68                 execution engine.</para>
69
70                 <para><filename>/etc/os-release</filename> contains
71                 data that is defined by the operating system vendor
72                 and should not be changed by the administrator.</para>
73         </refsect1>
74
75         <refsect1>
76                 <title>Options</title>
77
78                 <para>The following OS identifications parameters may be set using
79                 <filename>/etc/os-release</filename>:</para>
80
81                 <variablelist>
82
83                         <varlistentry>
84                                 <term><varname>NAME=</varname></term>
85
86                                 <listitem><para>A string identifying
87                                 the operating system, without a
88                                 version component, and suitable for
89                                 presentation to the user. If not set
90                                 defaults to
91                                 <literal>NAME=Linux</literal>. Example:
92                                 <literal>NAME=Fedora</literal> or
93                                 <literal>NAME="Debian
94                                 GNU/Linux"</literal>.</para></listitem>
95                         </varlistentry>
96
97                         <varlistentry>
98                                 <term><varname>VERSION=</varname></term>
99
100                                 <listitem><para>A string identifying
101                                 the operating system version,
102                                 excluding any OS name information, and
103                                 suitable for presentation to the
104                                 user. This field is optional. Example:
105                                 <literal>VERSION=17</literal> or
106                                 <literal>VERSION="17
107                                 (Beefy Miracle)"</literal>.</para></listitem>
108                         </varlistentry>
109
110                         <varlistentry>
111                                 <term><varname>ID=</varname></term>
112
113                                 <listitem><para>A lower-case string
114                                 (no spaces or other characters outside of
115                                 0-9, a-z, ".", "_" and "-") identifying
116                                 the operating system, excluding any
117                                 version information and suitable for
118                                 processing by scripts or usage in
119                                 generated file names. If not set
120                                 defaults to
121                                 <literal>ID=linux</literal>. Example:
122                                 <literal>ID=fedora</literal>.</para></listitem>
123                         </varlistentry>
124
125                         <varlistentry>
126                                 <term><varname>VERSION_ID=</varname></term>
127
128                                 <listitem><para>A lower-case string
129                                 (mostly numeric, no spaces or other
130                                 characters outside of 0-9, a-z, ".",
131                                 "_" and "-") identifying the operating
132                                 system version, excluding any OS name
133                                 information or release code names, and
134                                 suitable for processing by scripts or
135                                 usage in generated file names. This
136                                 field is optional. Example:
137                                 <literal>VERSION_ID=17</literal> or
138                                 <literal>VERSION_ID=11.04</literal>.</para></listitem>
139                         </varlistentry>
140
141                         <varlistentry>
142                                 <term><varname>PRETTY_NAME=</varname></term>
143
144                                 <listitem><para>A pretty operating
145                                 system name in a format suitable for
146                                 presentation to the user. May or may
147                                 not contain an OS version of some
148                                 kind, as suitable. If not set defaults
149                                 to <literal>PRETTY_NAME="Linux"</literal>. Example:
150                                 <literal>PRETTY_NAME="Fedora 17
151                                 (Beefy Miracle)"</literal>.</para></listitem>
152                         </varlistentry>
153
154                         <varlistentry>
155                                 <term><varname>ANSI_COLOR=</varname></term>
156
157                                 <listitem><para>A suggested
158                                 presentation color when showing the
159                                 distribution name on the console. This
160                                 should be specified as string suitable
161                                 for inclusion in the ESC [ m
162                                 ANSI/ECMA-48 escape code for setting
163                                 graphical rendition. This field is
164                                 optional. Example:
165                                 <literal>ANSI_COLOR="0;31"</literal>
166                                 for red, or
167                                 <literal>ANSI_COLOR="1;34"</literal>
168                                 for light blue.</para></listitem>
169                         </varlistentry>
170
171                         <varlistentry>
172                                 <term><varname>CPE_NAME=</varname></term>
173
174                                 <listitem><para>A CPE name for the
175                                 operating system, following the <ulink
176                                 url="http://cpe.mitre.org/specification/">Common
177                                 Platform Enumeration
178                                 Specification</ulink> as proposed by
179                                 the MITRE Corporation. This field
180                                 is optional. Example:
181                                 <literal>CPE_NAME="cpe:/o:fedoraproject:fedora:17"</literal>
182                                 </para></listitem>
183                         </varlistentry>
184                 </variablelist>
185
186                 <para>If you are reading this file from C code or a
187                 shell script to determine the OS or a specific version
188                 of it, use the ID and VERSION_ID fields. When looking
189                 for an OS identification string for presentation to
190                 the user use the PRETTY_NAME field.</para>
191
192                 <para>Note that operating system vendors may choose
193                 not to provide version information, for example to
194                 accommodate for rolling releases. In this case VERSION
195                 and VERSION_ID may be unset. Applications should not
196                 rely on these fields to be set.</para>
197         </refsect1>
198
199         <refsect1>
200                 <title>Example</title>
201
202                 <programlisting>NAME=Fedora
203 VERSION="17 (Beefy Miracle)"
204 ID=fedora
205 VERSION_ID=15
206 PRETTY_NAME="Fedora 17 (Beefy Miracle)"
207 ANSI_COLOR="0;34"
208 CPE_NAME="cpe:/o:fedoraproject:fedora:17"</programlisting>
209         </refsect1>
210
211         <refsect1>
212                   <title>See Also</title>
213                   <para>
214                           <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
215                           <citerefentry><refentrytitle>lsb_release</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
216                           <citerefentry><refentrytitle>hostname</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
217                           <citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
218                           <citerefentry><refentrytitle>machine-info</refentrytitle><manvolnum>5</manvolnum></citerefentry>
219                   </para>
220         </refsect1>
221
222 </refentry>