os-release.xml revision f8045772bd4e555a486fc9f440c80c9fad006fb7
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?>
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering This file is part of systemd.
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering Copyright 2010 Lennart Poettering
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering systemd is free software; you can redistribute it and/or modify it
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering under the terms of the GNU General Public License as published by
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering the Free Software Foundation; either version 2 of the License, or
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering (at your option) any later version.
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering systemd is distributed in the hope that it will be useful, but
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering General Public License for more details.
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering You should have received a copy of the GNU General Public License
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering <refentryinfo>
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering </authorgroup>
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering </refentryinfo>
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering <refentrytitle>os-release</refentrytitle>
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering <refpurpose>Operating system identification</refpurpose>
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering <refsynopsisdiv>
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering <para><filename>/etc/os-release</filename></para>
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering </refsynopsisdiv>
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering <para>The <filename>/etc/os-release</filename> file
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering contains operating system identification data.</para>
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering <para>The basic file format of
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering newline-separated list of environment-like
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering shell-compatible variable assignments. It is possible
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering to source the configuration from shell scripts,
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering however, beyond mere variable assignments no shell
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering features are supported, allowing applications to read
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering the file without implementing a shell compatible
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering execution engine.</para>
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering <para><filename>/etc/os-release</filename> contains
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering data that is defined by the operating system vendor
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering and should not be changed by the administrator.</para>
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering <para>The following OS identifications parameters may be set using
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering <filename>/etc/os-release</filename>:</para>
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering <variablelist>
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering <varlistentry>
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering the operating system, without a
f8045772bd4e555a486fc9f440c80c9fad006fb7Lennart Poettering version component, and suitable for
f8045772bd4e555a486fc9f440c80c9fad006fb7Lennart Poettering presentation to the user. If not set
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering <literal>NAME="Debian
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering </varlistentry>
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering <varlistentry>
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering the operating system version,
f8045772bd4e555a486fc9f440c80c9fad006fb7Lennart Poettering excluding any OS name information, and
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering suitable for presentation to the
f8045772bd4e555a486fc9f440c80c9fad006fb7Lennart Poettering user. This field is optional. Example:
f8045772bd4e555a486fc9f440c80c9fad006fb7Lennart Poettering <literal>VERSION="17
f8045772bd4e555a486fc9f440c80c9fad006fb7Lennart Poettering (Beefy Miracle)"</literal>.</para></listitem>
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering </varlistentry>
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering <varlistentry>
f8045772bd4e555a486fc9f440c80c9fad006fb7Lennart Poettering (no spaces or other characters outside of
f8045772bd4e555a486fc9f440c80c9fad006fb7Lennart Poettering 0-9, a-z, ".", "_" and "-") identifying
f8045772bd4e555a486fc9f440c80c9fad006fb7Lennart Poettering the operating system, excluding any
f8045772bd4e555a486fc9f440c80c9fad006fb7Lennart Poettering version information and suitable for
f9f0c31ae58250341636c3be9aa439c77c26fcc1Lennart Poettering processing by scripts or usage in
f9f0c31ae58250341636c3be9aa439c77c26fcc1Lennart Poettering generated file names. If not set
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering <literal>ID=fedora</literal>.</para></listitem>
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering </varlistentry>
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering <varlistentry>
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering <term><varname>VERSION_ID=</varname></term>
f8045772bd4e555a486fc9f440c80c9fad006fb7Lennart Poettering (mostly numeric, no spaces or other
f8045772bd4e555a486fc9f440c80c9fad006fb7Lennart Poettering characters outside of 0-9, a-z, ".",
f8045772bd4e555a486fc9f440c80c9fad006fb7Lennart Poettering "_" and "-") identifying the operating
f8045772bd4e555a486fc9f440c80c9fad006fb7Lennart Poettering system version, excluding any OS name
f8045772bd4e555a486fc9f440c80c9fad006fb7Lennart Poettering information or release code names, and
f8045772bd4e555a486fc9f440c80c9fad006fb7Lennart Poettering suitable for processing by scripts or
f8045772bd4e555a486fc9f440c80c9fad006fb7Lennart Poettering usage in generated file names. This
f8045772bd4e555a486fc9f440c80c9fad006fb7Lennart Poettering field is optional. Example:
f8045772bd4e555a486fc9f440c80c9fad006fb7Lennart Poettering <literal>VERSION_ID=11.04</literal>.</para></listitem>
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering </varlistentry>
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering <varlistentry>
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering <term><varname>PRETTY_NAME=</varname></term>
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering system name in a format suitable for
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering presentation to the user. May or may
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering not contain an OS version of some
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering kind, as suitable. If not set defaults
f8045772bd4e555a486fc9f440c80c9fad006fb7Lennart Poettering to <literal>PRETTY_NAME="Linux"</literal>. Example:
f8045772bd4e555a486fc9f440c80c9fad006fb7Lennart Poettering <literal>PRETTY_NAME="Fedora 17
f8045772bd4e555a486fc9f440c80c9fad006fb7Lennart Poettering (Beefy Miracle)"</literal>.</para></listitem>
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering </varlistentry>
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering <varlistentry>
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering <term><varname>ANSI_COLOR=</varname></term>
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering presentation color when showing the
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering distribution name on the console. This
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering should be specified as string suitable
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering for inclusion in the ESC [ m
f8045772bd4e555a486fc9f440c80c9fad006fb7Lennart Poettering graphical rendition. This field is
f8045772bd4e555a486fc9f440c80c9fad006fb7Lennart Poettering optional. Example:
f8045772bd4e555a486fc9f440c80c9fad006fb7Lennart Poettering </varlistentry>
f8045772bd4e555a486fc9f440c80c9fad006fb7Lennart Poettering <varlistentry>
f8045772bd4e555a486fc9f440c80c9fad006fb7Lennart Poettering <term><varname>CPE_NAME=</varname></term>
f8045772bd4e555a486fc9f440c80c9fad006fb7Lennart Poettering operating system, following the <ulink
f8045772bd4e555a486fc9f440c80c9fad006fb7Lennart Poettering url="http://cpe.mitre.org/specification/">Common
f8045772bd4e555a486fc9f440c80c9fad006fb7Lennart Poettering Platform Enumeration
f8045772bd4e555a486fc9f440c80c9fad006fb7Lennart Poettering Specification</ulink> as proposed by
f8045772bd4e555a486fc9f440c80c9fad006fb7Lennart Poettering the MITRE Corporation. This field
f8045772bd4e555a486fc9f440c80c9fad006fb7Lennart Poettering is optional. Example:
f8045772bd4e555a486fc9f440c80c9fad006fb7Lennart Poettering <literal>CPE_NAME="cpe:/o:fedoraproject:fedora:17"</literal>
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering </varlistentry>
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering </variablelist>
f8045772bd4e555a486fc9f440c80c9fad006fb7Lennart Poettering <para>If you are reading this file from C code or a
811ad2b3a4f0a53c22ac26a19d1b3e93afcbd32fLennart Poettering shell script to determine the OS or a specific version
811ad2b3a4f0a53c22ac26a19d1b3e93afcbd32fLennart Poettering of it, use the ID and VERSION_ID fields. When looking
811ad2b3a4f0a53c22ac26a19d1b3e93afcbd32fLennart Poettering for an OS identification string for presentation to
811ad2b3a4f0a53c22ac26a19d1b3e93afcbd32fLennart Poettering the user use the PRETTY_NAME field.</para>
6bd212771129d00cf7b42d6774a6b81547569384Lennart Poettering <para>Note that operating system vendors may choose
6bd212771129d00cf7b42d6774a6b81547569384Lennart Poettering not to provide version information, for example to
01c3a63e179ae7abb7447570a82087289d1bcab4Miklos Vajna accommodate for rolling releases. In this case VERSION
6bd212771129d00cf7b42d6774a6b81547569384Lennart Poettering and VERSION_ID may be unset. Applications should not
6bd212771129d00cf7b42d6774a6b81547569384Lennart Poettering rely on these fields to be set.</para>
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering <programlisting>NAME=Fedora
f8045772bd4e555a486fc9f440c80c9fad006fb7Lennart PoetteringVERSION="17 (Beefy Miracle)"
f8045772bd4e555a486fc9f440c80c9fad006fb7Lennart PoetteringPRETTY_NAME="Fedora 17 (Beefy Miracle)"
f8045772bd4e555a486fc9f440c80c9fad006fb7Lennart PoetteringANSI_COLOR="0;34"
f8045772bd4e555a486fc9f440c80c9fad006fb7Lennart PoetteringCPE_NAME="cpe:/o:fedoraproject:fedora:17"</programlisting>
e17fb72914e328f962e5df1bf88f301c0e7fa6e1Lennart Poettering <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
7640a5de1b3ffe6547200ad204d14e4f067caf4fLennart Poettering <citerefentry><refentrytitle>lsb_release</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
7640a5de1b3ffe6547200ad204d14e4f067caf4fLennart Poettering <citerefentry><refentrytitle>hostname</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
7640a5de1b3ffe6547200ad204d14e4f067caf4fLennart Poettering <citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
7640a5de1b3ffe6547200ad204d14e4f067caf4fLennart Poettering <citerefentry><refentrytitle>machine-info</refentrytitle><manvolnum>5</manvolnum></citerefentry>