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">
7 This file is part of systemd.
9 Copyright 2010 Lennart Poettering
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.
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.
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/>.
25 <refentry id="os-release">
27 <title>os-release</title>
28 <productname>systemd</productname>
32 <contrib>Developer</contrib>
33 <firstname>Lennart</firstname>
34 <surname>Poettering</surname>
35 <email>lennart@poettering.net</email>
41 <refentrytitle>os-release</refentrytitle>
42 <manvolnum>5</manvolnum>
46 <refname>os-release</refname>
47 <refpurpose>Operating system identification</refpurpose>
51 <para><filename>/etc/os-release</filename></para>
55 <title>Description</title>
57 <para>The <filename>/etc/os-release</filename> file
58 contains operating system identification data.</para>
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>
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>
76 <title>Options</title>
78 <para>The following OS identifications parameters may be set using
79 <filename>/etc/os-release</filename>:</para>
84 <term><varname>NAME=</varname></term>
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
91 <literal>NAME=Linux</literal>. Example:
92 <literal>NAME=Fedora</literal> or
94 GNU/Linux"</literal>.</para></listitem>
98 <term><varname>VERSION=</varname></term>
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
107 (Beefy Miracle)"</literal>.</para></listitem>
111 <term><varname>ID=</varname></term>
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
121 <literal>ID=linux</literal>. Example:
122 <literal>ID=fedora</literal>.</para></listitem>
126 <term><varname>VERSION_ID=</varname></term>
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>
142 <term><varname>PRETTY_NAME=</varname></term>
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>
155 <term><varname>ANSI_COLOR=</varname></term>
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
165 <literal>ANSI_COLOR="0;31"</literal>
167 <literal>ANSI_COLOR="1;34"</literal>
168 for light blue.</para></listitem>
172 <term><varname>CPE_NAME=</varname></term>
174 <listitem><para>A CPE name for the
175 operating system, following the <ulink
176 url="http://cpe.mitre.org/specification/">Common
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>
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>
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>
200 <title>Example</title>
202 <programlisting>NAME=Fedora
203 VERSION="17 (Beefy Miracle)"
206 PRETTY_NAME="Fedora 17 (Beefy Miracle)"
208 CPE_NAME="cpe:/o:fedoraproject:fedora:17"</programlisting>
212 <title>See Also</title>
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>