]>
Commit | Line | Data |
---|---|---|
e17fb729 LP |
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> | |
e17fb729 LP |
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 string, and not necessarily | |
89 | suitable for presentation to the | |
90 | user. If not set defaults to | |
91 | <literal>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 name information and | |
103 | suitable for presentation to the | |
104 | user. Example: | |
105 | <literal>VERSION=15</literal> or | |
106 | <literal>VERSION="15 | |
107 | (Rawhide)"</literal>.</para></listitem> | |
108 | </varlistentry> | |
109 | ||
110 | <varlistentry> | |
111 | <term><varname>ID=</varname></term> | |
112 | ||
113 | <listitem><para>A lower-case string | |
f9f0c31a LP |
114 | (no spaces) identifying the operating |
115 | system, excluding any version | |
116 | information and suitable for | |
117 | processing by scripts or usage in | |
118 | generated file names. If not set | |
119 | defaults to | |
e17fb729 LP |
120 | <literal>linux</literal>. Example: |
121 | <literal>ID=fedora</literal>.</para></listitem> | |
122 | </varlistentry> | |
123 | ||
124 | <varlistentry> | |
125 | <term><varname>VERSION_ID=</varname></term> | |
126 | ||
127 | <listitem><para>A lower-case string | |
f9f0c31a | 128 | (mostly numeric, no spaces) identifying the |
e17fb729 LP |
129 | operating system version, excluding |
130 | any name information and suitable for | |
f9f0c31a | 131 | processing by scripts or usage in generated file names. Example: |
e17fb729 LP |
132 | <literal>VERSION_ID=15</literal>.</para></listitem> |
133 | </varlistentry> | |
134 | ||
135 | <varlistentry> | |
136 | <term><varname>PRETTY_NAME=</varname></term> | |
137 | ||
138 | <listitem><para>A pretty operating | |
139 | system name in a format suitable for | |
140 | presentation to the user. May or may | |
141 | not contain an OS version of some | |
142 | kind, as suitable. If not set defaults | |
143 | to <literal>Linux</literal>. Example: | |
26fd9acf LP |
144 | <literal>PRETTY_NAME="Fedora 15 |
145 | (Rawhide)"</literal>.</para></listitem> | |
e17fb729 LP |
146 | </varlistentry> |
147 | ||
148 | <varlistentry> | |
149 | <term><varname>ANSI_COLOR=</varname></term> | |
150 | ||
151 | <listitem><para>A suggested | |
152 | presentation color when showing the | |
153 | distribution name on the console. This | |
154 | should be specified as string suitable | |
155 | for inclusion in the ESC [ m | |
156 | ANSI/ECMA-48 escape code for setting | |
157 | graphical rendition. Example: | |
26fd9acf | 158 | <literal>ANSI_COLOR="0;31"</literal> for |
e17fb729 | 159 | red, or |
26fd9acf | 160 | <literal>ANSI_COLOR="1;34"</literal> for |
e17fb729 LP |
161 | light blue.</para></listitem> |
162 | </varlistentry> | |
163 | </variablelist> | |
164 | ||
811ad2b3 LP |
165 | <para>If you are reading this file from code or a |
166 | shell script to determine the OS or a specific version | |
167 | of it, use the ID and VERSION_ID fields. When looking | |
168 | for an OS identification string for presentation to | |
169 | the user use the PRETTY_NAME field.</para> | |
6bd21277 LP |
170 | |
171 | <para>Note that operating system vendors may choose | |
172 | not to provide version information, for example to | |
01c3a63e | 173 | accommodate for rolling releases. In this case VERSION |
6bd21277 LP |
174 | and VERSION_ID may be unset. Applications should not |
175 | rely on these fields to be set.</para> | |
e17fb729 LP |
176 | </refsect1> |
177 | ||
178 | <refsect1> | |
179 | <title>Example</title> | |
180 | ||
181 | <programlisting>NAME=Fedora | |
7640a5de | 182 | VERSION="15 (Rawhide)" |
e17fb729 LP |
183 | ID=fedora |
184 | VERSION_ID=15 | |
7640a5de | 185 | PRETTY_NAME="Fedora 15 (Rawhide)" |
26fd9acf | 186 | ANSI_COLOR="0;34"</programlisting> |
e17fb729 LP |
187 | </refsect1> |
188 | ||
189 | <refsect1> | |
190 | <title>See Also</title> | |
191 | <para> | |
192 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
7640a5de LP |
193 | <citerefentry><refentrytitle>lsb_release</refentrytitle><manvolnum>1</manvolnum></citerefentry>, |
194 | <citerefentry><refentrytitle>hostname</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
195 | <citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
196 | <citerefentry><refentrytitle>machine-info</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
e17fb729 LP |
197 | </para> |
198 | </refsect1> | |
199 | ||
200 | </refentry> |