<literal>SYSEXT_LEVEL=15.14</literal>.</para></listitem>
</varlistentry>
+ <varlistentry>
+ <term><varname>IMAGE_ID=</varname></term>
+
+ <listitem><para> A lower-case string (no spaces or other characters outside of 0–9, a–z, ".", "_" and
+ "-"), identifying a specific image of the operating system. This is supposed to be used for
+ environments where OS images are prepared, built, shipped and updated as comprehensive, consistent OS
+ images. This field is optional and may not be implemented on all systems, in particulary not on those
+ that are not managed via images but put together and updated from individual packages and on the
+ local system. Examples: <literal>IMAGE_ID=vendorx-cashier-system</literal>,
+ <literal>IMAGE_ID=netbook-image</literal> </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><varname>IMAGE_VERSION=</varname></term>
+
+ <listitem><para>A lower-case string (mostly numeric, no spaces or other characters outside of 0–9,
+ a–z, ".", "_" and "-") identifying the OS image version. This is supposed to be used together with
+ <varname>IMAGE_ID</varname> described above, to discern different versions of the same
+ image. Examples: <literal>IMAGE_VERSION=33</literal>,
+ <literal>IMAGE_VERSION=47.1rc1</literal> </para></listitem>
+ </varlistentry>
+
</variablelist>
<para>If you are reading this file from C code or a shell script
</thead>
<tbody>
<xi:include href="standard-specifiers.xml" xpointer="a"/>
+ <xi:include href="standard-specifiers.xml" xpointer="A"/>
<xi:include href="standard-specifiers.xml" xpointer="b"/>
<xi:include href="standard-specifiers.xml" xpointer="B"/>
<xi:include href="standard-specifiers.xml" xpointer="H"/>
<xi:include href="standard-specifiers.xml" xpointer="l"/>
<xi:include href="standard-specifiers.xml" xpointer="m"/>
+ <xi:include href="standard-specifiers.xml" xpointer="M"/>
<xi:include href="standard-specifiers.xml" xpointer="o"/>
<xi:include href="standard-specifiers.xml" xpointer="v"/>
<xi:include href="standard-specifiers.xml" xpointer="w"/>
<!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
<tbody>
- <row id='b'>
- <entry><literal>%b</literal></entry>
- <entry>Boot ID</entry>
- <entry>The boot ID of the running system, formatted as string. See <citerefentry><refentrytitle>random</refentrytitle><manvolnum>4</manvolnum></citerefentry> for more information.</entry>
- </row>
<row id='a'>
<entry><literal>%a</literal></entry>
<entry>Architecture</entry>
<entry>A short string identifying the architecture of the local system. A string such as <constant>x86</constant>, <constant>x86-64</constant> or <constant>arm64</constant>. See the architectures defined for <varname>ConditionArchitecture=</varname> in <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry> for a full list.</entry>
</row>
+ <row id='A'>
+ <entry><literal>%A</literal></entry>
+ <entry>Operating system image version</entry>
+ <entry>The operating system image version identifier of the running system, as read from the <varname>IMAGE_VERSION=</varname> field of <filename>/etc/os-release</filename>. If not set, resolves to an empty string. See <citerefentry><refentrytitle>os-release</refentrytitle><manvolnum>5</manvolnum></citerefentry> for more information.</entry>
+ </row>
+ <row id='b'>
+ <entry><literal>%b</literal></entry>
+ <entry>Boot ID</entry>
+ <entry>The boot ID of the running system, formatted as string. See <citerefentry><refentrytitle>random</refentrytitle><manvolnum>4</manvolnum></citerefentry> for more information.</entry>
+ </row>
<row id='B'>
<entry><literal>%B</literal></entry>
<entry>Operating system build ID</entry>
<entry>Machine ID</entry>
<entry>The machine ID of the running system, formatted as string. See <citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry> for more information.</entry>
</row>
+ <row id='M'>
+ <entry><literal>%M</literal></entry>
+ <entry>Operating system image identifier</entry>
+ <entry>The operating system image identifier of the running system, as read from the <varname>IMAGE_ID=</varname> field of <filename>/etc/os-release</filename>. If not set, resolves to an empty string. See <citerefentry><refentrytitle>os-release</refentrytitle><manvolnum>5</manvolnum></citerefentry> for more information.</entry>
+ </row>
<row id='o'>
<entry><literal>%o</literal></entry>
<entry>Operating system ID</entry>
</thead>
<tbody>
<xi:include href="standard-specifiers.xml" xpointer="a"/>
+ <xi:include href="standard-specifiers.xml" xpointer="A"/>
<xi:include href="standard-specifiers.xml" xpointer="b"/>
<xi:include href="standard-specifiers.xml" xpointer="B"/>
<xi:include href="standard-specifiers.xml" xpointer="H"/>
<xi:include href="standard-specifiers.xml" xpointer="m"/>
+ <xi:include href="standard-specifiers.xml" xpointer="M"/>
<xi:include href="standard-specifiers.xml" xpointer="o"/>
<xi:include href="standard-specifiers.xml" xpointer="v"/>
<xi:include href="standard-specifiers.xml" xpointer="w"/>
<entry>Architecture</entry>
<entry>A short string identifying the architecture of the local system. A string such as <constant>x86</constant>, <constant>x86-64</constant> or <constant>arm64</constant>. See the architectures defined for <varname>ConditionArchitecture=</varname> above for a full list.</entry>
</row>
+ <xi:include href="standard-specifiers.xml" xpointer="A"/>
<xi:include href="standard-specifiers.xml" xpointer="b"/>
<xi:include href="standard-specifiers.xml" xpointer="B"/>
<row>
<entry>This is either <filename>/var/log</filename> (for the system manager) or the path <literal>$XDG_CONFIG_HOME</literal> resolves to with <filename index="false">/log</filename> appended (for user managers).</entry>
</row>
<xi:include href="standard-specifiers.xml" xpointer="m"/>
+ <xi:include href="standard-specifiers.xml" xpointer="M"/>
<row>
<entry><literal>%n</literal></entry>
<entry>Full unit name</entry>
</thead>
<tbody>
<xi:include href="standard-specifiers.xml" xpointer="a"/>
+ <xi:include href="standard-specifiers.xml" xpointer="A"/>
<xi:include href="standard-specifiers.xml" xpointer="b"/>
<xi:include href="standard-specifiers.xml" xpointer="B"/>
<xi:include href="standard-specifiers.xml" xpointer="H"/>
<xi:include href="standard-specifiers.xml" xpointer="l"/>
<xi:include href="standard-specifiers.xml" xpointer="m"/>
+ <xi:include href="standard-specifiers.xml" xpointer="M"/>
<xi:include href="standard-specifiers.xml" xpointer="o"/>
<xi:include href="standard-specifiers.xml" xpointer="T"/>
<xi:include href="standard-specifiers.xml" xpointer="v"/>
</thead>
<tbody>
<xi:include href="standard-specifiers.xml" xpointer="a"/>
+ <xi:include href="standard-specifiers.xml" xpointer="A"/>
<xi:include href="standard-specifiers.xml" xpointer="b"/>
<xi:include href="standard-specifiers.xml" xpointer="B"/>
<row>
<entry>In <option>--user</option> mode, this is the same as <varname>$XDG_CONFIG_HOME</varname> with <filename index="false">/log</filename> appended, and <filename>/var/log</filename> otherwise.</entry>
</row>
<xi:include href="standard-specifiers.xml" xpointer="m"/>
+ <xi:include href="standard-specifiers.xml" xpointer="M"/>
<xi:include href="standard-specifiers.xml" xpointer="o"/>
<row>
<entry><literal>%S</literal></entry>
return specifier_os_release_common("VARIANT_ID", ret);
}
+int specifier_os_image_id(char specifier, const void *data, const void *userdata, char **ret) {
+ return specifier_os_release_common("IMAGE_ID", ret);
+}
+
+int specifier_os_image_version(char specifier, const void *data, const void *userdata, char **ret) {
+ return specifier_os_release_common("IMAGE_VERSION", ret);
+}
+
int specifier_group_name(char specifier, const void *data, const void *userdata, char **ret) {
char *t;
int specifier_os_version_id(char specifier, const void *data, const void *userdata, char **ret);
int specifier_os_build_id(char specifier, const void *data, const void *userdata, char **ret);
int specifier_os_variant_id(char specifier, const void *data, const void *userdata, char **ret);
+int specifier_os_image_id(char specifier, const void *data, const void *userdata, char **ret);
+int specifier_os_image_version(char specifier, const void *data, const void *userdata, char **ret);
int specifier_group_name(char specifier, const void *data, const void *userdata, char **ret);
int specifier_group_id(char specifier, const void *data, const void *userdata, char **ret);
*
* COMMON_SYSTEM_SPECIFIERS:
* %a: the native userspace architecture
+ * %A: the OS image version, according to /etc/os-release
* %b: the boot ID of the running system
* %B: the OS build ID, according to /etc/os-release
* %H: the hostname of the running system
* %l: the short hostname of the running system
* %m: the machine ID of the running system
+ * %M: the OS image ID, according to /etc/os-release
* %o: the OS ID according to /etc/os-release
* %v: the kernel version
* %w: the OS version ID, according to /etc/os-release
#define COMMON_SYSTEM_SPECIFIERS \
{ 'a', specifier_architecture, NULL }, \
+ { 'A', specifier_os_image_version,NULL }, \
{ 'b', specifier_boot_id, NULL }, \
{ 'B', specifier_os_build_id, NULL }, \
{ 'H', specifier_host_name, NULL }, \
{ 'l', specifier_short_host_name, NULL }, \
{ 'm', specifier_machine_id, NULL }, \
+ { 'M', specifier_os_image_id, NULL }, \
{ 'o', specifier_os_id, NULL }, \
{ 'v', specifier_kernel_release, NULL }, \
{ 'w', specifier_os_version_id, NULL }, \
{ 'W', specifier_os_variant_id, NULL }
+
#define COMMON_CREDS_SPECIFIERS \
{ 'g', specifier_group_name, NULL }, \
{ 'G', specifier_group_id, NULL }, \