]>
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> | |
73 | ||
74 | <para>Depending on the operating system other | |
75 | configuration files might be checked for OS | |
76 | identification as well, however only as | |
77 | fallback.</para> | |
78 | </refsect1> | |
79 | ||
80 | <refsect1> | |
81 | <title>Options</title> | |
82 | ||
83 | <para>The following OS identifications parameters may be set using | |
84 | <filename>/etc/os-release</filename>:</para> | |
85 | ||
86 | <variablelist> | |
87 | ||
88 | <varlistentry> | |
89 | <term><varname>NAME=</varname></term> | |
90 | ||
91 | <listitem><para>A string identifying | |
92 | the operating system, without a | |
93 | version string, and not necessarily | |
94 | suitable for presentation to the | |
95 | user. If not set defaults to | |
96 | <literal>Linux</literal>. Example: | |
97 | <literal>NAME=Fedora</literal> or | |
98 | <literal>NAME="Debian | |
99 | GNU/Linux"</literal>.</para></listitem> | |
100 | </varlistentry> | |
101 | ||
102 | <varlistentry> | |
103 | <term><varname>VERSION=</varname></term> | |
104 | ||
105 | <listitem><para>A string identifying | |
106 | the operating system version, | |
107 | excluding any name information and | |
108 | suitable for presentation to the | |
109 | user. Example: | |
110 | <literal>VERSION=15</literal> or | |
111 | <literal>VERSION="15 | |
112 | (Rawhide)"</literal>.</para></listitem> | |
113 | </varlistentry> | |
114 | ||
115 | <varlistentry> | |
116 | <term><varname>ID=</varname></term> | |
117 | ||
118 | <listitem><para>A lower-case string | |
119 | identifying the operating system, | |
120 | excluding any version information and | |
121 | suitable for processing by scripts. If | |
122 | not set defaults to | |
123 | <literal>linux</literal>. Example: | |
124 | <literal>ID=fedora</literal>.</para></listitem> | |
125 | </varlistentry> | |
126 | ||
127 | <varlistentry> | |
128 | <term><varname>VERSION_ID=</varname></term> | |
129 | ||
130 | <listitem><para>A lower-case string | |
131 | (mostly numeric) identifying the | |
132 | operating system version, excluding | |
133 | any name information and suitable for | |
134 | processing by scripts. Example: | |
135 | <literal>VERSION_ID=15</literal>.</para></listitem> | |
136 | </varlistentry> | |
137 | ||
138 | <varlistentry> | |
139 | <term><varname>PRETTY_NAME=</varname></term> | |
140 | ||
141 | <listitem><para>A pretty operating | |
142 | system name in a format suitable for | |
143 | presentation to the user. May or may | |
144 | not contain an OS version of some | |
145 | kind, as suitable. If not set defaults | |
146 | to <literal>Linux</literal>. Example: | |
147 | <literal>PRETTY_NAME=Fedora 15 | |
148 | (Rawhide)</literal>.</para></listitem> | |
149 | </varlistentry> | |
150 | ||
151 | <varlistentry> | |
152 | <term><varname>ANSI_COLOR=</varname></term> | |
153 | ||
154 | <listitem><para>A suggested | |
155 | presentation color when showing the | |
156 | distribution name on the console. This | |
157 | should be specified as string suitable | |
158 | for inclusion in the ESC [ m | |
159 | ANSI/ECMA-48 escape code for setting | |
160 | graphical rendition. Example: | |
161 | <literal>ANSI_COLOR=0;31</literal> for | |
162 | red, or | |
163 | <literal>ANSI_COLOR=1;34</literal> for | |
164 | light blue.</para></listitem> | |
165 | </varlistentry> | |
166 | </variablelist> | |
167 | ||
168 | <para>If you interpreting this file from code or a | |
169 | shell script, use the ID and VERSION_ID fields. When | |
170 | looking for an OS indetification string for | |
171 | presentation to the user use the PRETTY_STRING | |
172 | field.</para> | |
173 | </refsect1> | |
174 | ||
175 | <refsect1> | |
176 | <title>Example</title> | |
177 | ||
178 | <programlisting>NAME=Fedora | |
179 | VERSION=15 (Rawhide) | |
180 | ID=fedora | |
181 | VERSION_ID=15 | |
182 | PRETTY_NAME=Fedora 15 (Rawhide) | |
183 | ANSI_COLOR=0;34</programlisting> | |
184 | </refsect1> | |
185 | ||
186 | <refsect1> | |
187 | <title>See Also</title> | |
188 | <para> | |
189 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
190 | <citerefentry><refentrytitle>lsb_release</refentrytitle><manvolnum>1</manvolnum></citerefentry> | |
191 | </para> | |
192 | </refsect1> | |
193 | ||
194 | </refentry> |