tmpfiles: add the specifiers for the OS release and architecture

An entry with %a, or one of the specifiers that come from os-release,
was skipped as unsupported:

    d /var/lib/app/%o-%w 0755 - - -

Add %o, %w, %W, %B, %M, and %A, read from /etc/os-release with
/usr/lib/os-release as fallback, and %a with the names tmpfiles.d(5)
has for the architectures.  A field that os-release lacks gives an
empty string, as in tmpfiles.d(5).  An entry is still skipped when
the architecture is not one of those known.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2026-11-20 18:35:36 +01:00
1 parent bccd04d81d
commit fb3b13a245
6 files changed
+113 -22

No files matched your search

+3 -2
View File
@@ -17,8 +17,9 @@ All relevant changes are documented in this file.
at boot and no longer need a separate call
- tmpfiles: add the `%` specifiers of tmpfiles.d(5) for the path, and for
the argument of `C`, `f`, `F`, `L`, and `w` entries: `%b`, `%m`, `%H`,
`%l`, `%v`, the directories `%t`, `%T`, `%V`, `%S`, `%C`, `%L`, `%h`,
and the user ones `%u`, `%U`, `%g`, `%G`. Before, an entry with a `%`
`%l`, `%v`, `%a`, the directories `%t`, `%T`, `%V`, `%S`, `%C`, `%L`,
`%h`, the user ones `%u`, `%U`, `%g`, `%G`, and from os-release `%o`,
`%w`, `%W`, `%B`, `%M`, and `%A`. Before, an entry with a `%`
in the path was skipped. **Note:** a literal `%` in such an argument,
e.g. in a `w` entry for `core_pattern`, must now be written `%%`
- tmpfiles: the age of an entry can now have several units, as in