Debian Codegraph @

upstream/debian-unstable/man5/os-release.5

raw
1 '\" t
2 .TH "OS\-RELEASE" "5" "" "systemd 261~rc3" "os-release"
3 .\" -----------------------------------------------------------------
4 .\" * Define some portability stuff
5 .\" -----------------------------------------------------------------
6 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 .\" http://bugs.debian.org/507673
8 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
9 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10 .ie \n(.g .ds Aq \(aq
11 .el .ds Aq '
12 .\" -----------------------------------------------------------------
13 .\" * set default formatting
14 .\" -----------------------------------------------------------------
15 .\" disable hyphenation
16 .nh
17 .\" disable justification (adjust text to left margin only)
18 .ad l
19 .\" -----------------------------------------------------------------
20 .\" * MAIN CONTENT STARTS HERE *
21 .\" -----------------------------------------------------------------
22 .SH "NAME"
23 os-release, initrd-release, extension-release \- Operating system identification
24 .SH "SYNOPSIS"
25 .PP
26 .RS 4
27 /etc/os\-release
28 .RE
29 .RS 4
30 /usr/lib/os\-release
31 .RE
32 .RS 4
33 /etc/initrd\-release
34 .RE
35 .RS 4
36 /usr/lib/extension\-release\&.d/extension\-release\&.\fIIMAGE\fR
37 .RE
38 .SH "DESCRIPTION"
39 .PP
40 The
41 /etc/os\-release
42 and
43 /usr/lib/os\-release
44 files contain operating system identification data\&.
45 .PP
46 The format of
47 os\-release
48 is a newline\-separated list of environment\-like shell\-compatible variable assignments\&. It is possible to source the configuration from Bourne shell scripts, however, beyond mere variable assignments, no shell features are supported (this means variable expansion is explicitly not supported), allowing applications to read the file without implementing a shell compatible execution engine\&. Variable assignment values must be enclosed in double or single quotes if they include spaces, semicolons or other special characters outside of A\(enZ, a\(enz, 0\(en9\&. (Assignments that do not include these special characters may be enclosed in quotes too, but this is optional\&.) Shell special characters ("$", quotes, backslash, backtick) must be escaped with backslashes, following shell style\&. All strings should be in UTF\-8 encoding, and non\-printable characters should not be used\&. Concatenation of multiple individually quoted strings is not supported\&. Lines beginning with "#" are treated as comments\&. Blank lines are permitted and ignored\&.
49 .PP
50 The file
51 /etc/os\-release
52 takes precedence over
53 /usr/lib/os\-release\&. Applications should check for the former, and exclusively use its data if it exists, and only fall back to
54 /usr/lib/os\-release
55 if that is missing\&. Applications should not combine the data from both files\&.
56 /usr/lib/os\-release
57 is the recommended place to store OS release information as part of vendor trees\&.
58 /etc/os\-release
59 should be a relative symlink to
60 /usr/lib/os\-release, to provide compatibility with applications only looking at
61 /etc/\&. A relative symlink instead of an absolute symlink is necessary to avoid breaking the link in a chroot or initrd environment\&.
62 .PP
63 os\-release
64 contains data that is defined by the operating system vendor and should generally not be changed by the administrator\&.
65 .PP
66 As this file only encodes names and identifiers it should not be localized\&.
67 .PP
68 The
69 /etc/os\-release
70 and
71 /usr/lib/os\-release
72 files might be symlinks to other files, but it is important that the file is available from earliest boot on, and hence must be located on the root file system\&.
73 .PP
74 os\-release
75 must not contain repeating keys\&. Nevertheless, readers should pick the entries later in the file in case of repeats, similarly to how a shell sourcing the file would\&. A reader may warn about repeating entries\&.
76 .PP
77 For a longer rationale for
78 os\-release
79 please refer to the
80 \m[blue]\fBAnnouncement of /etc/os\-release\fR\m[]\&\s-2\u[1]\d\s+2\&.
81 .SS "/etc/initrd\-release"
82 .PP
83 In the
84 \m[blue]\fBinitrd\fR\m[]\&\s-2\u[2]\d\s+2
85 and exitrd,
86 /etc/initrd\-release
87 plays the same role as
88 os\-release
89 in the main system\&. Additionally, the presence of that file means that the system is in the initrd/exitrd phase\&.
90 /etc/os\-release
91 should be symlinked to
92 /etc/initrd\-release
93 (or vice versa), so programs that only look for
94 /etc/os\-release
95 (as described above) work correctly\&.
96 .PP
97 The rest of this document that talks about
98 os\-release
99 should be understood to apply to
100 initrd\-release
101 too\&.
102 .SS "/usr/lib/extension\-release\&.d/extension\-release\&.\fIIMAGE\fR"
103 .PP
104 /usr/lib/extension\-release\&.d/extension\-release\&.\fIIMAGE\fR
105 plays the same role for extension images as
106 os\-release
107 for the main system, and follows the syntax and rules as described in the
108 \m[blue]\fBPortable Services\fR\m[]\&\s-2\u[3]\d\s+2
109 page\&. The purpose of this file is to identify the extension and to allow the operating system to verify that the extension image matches the base OS\&. This is typically implemented by checking that the extension
110 \fIID=\fR
111 option either matches the host
112 \fIID=\fR
113 option or is included the host
114 \fIID_LIKE=\fR
115 option, and either
116 \fISYSEXT_LEVEL=\fR
117 exists and matches too, or if it is not present,
118 \fIVERSION_ID=\fR
119 exists and matches\&. This ensures ABI/API compatibility between the layers and prevents merging of an incompatible image in an overlay\&.
120 .PP
121 In order to identify the extension image itself, the same fields defined below can be added to the
122 extension\-release
123 file with a
124 \fISYSEXT_\fR
125 prefix (to disambiguate from fields used to match on the base image)\&. E\&.g\&.:
126 \fISYSEXT_ID=myext\fR,
127 \fISYSEXT_VERSION_ID=1\&.2\&.3\fR\&.
128 .PP
129 In the
130 extension\-release\&.\fIIMAGE\fR
131 filename, the
132 \fIIMAGE\fR
133 part must exactly match the file name of the containing image with the suffix removed\&. In case it is not possible to guarantee that an image file name is stable and does not change between the build and the deployment phases, it is possible to relax this check: if exactly one file whose name matches
134 "extension\-release\&.*"
135 is present in this directory, and the file is tagged with a
136 \fIuser\&.extension\-release\&.strict\fR
137 \fBxattr\fR(7)
138 set to the string
139 "0", it will be used instead\&.
140 .PP
141 The rest of this document that talks about
142 os\-release
143 should be understood to apply to
144 extension\-release
145 too\&.
146 .SH "OPTIONS"
147 .PP
148 The following OS identifications parameters may be set using
149 os\-release:
150 .SS "General information identifying the operating system"
151 .PP
152 \fINAME=\fR
153 .RS 4
154 A string identifying the operating system, without a version component, and suitable for presentation to the user\&. If not set, a default of
155 "NAME=Linux"
156 may be used\&.
157 .sp
158 Examples:
159 "NAME=Fedora",
160 "NAME="Debian GNU/Linux""\&.
161 .RE
162 .PP
163 \fIID=\fR
164 .RS 4
165 A lower\-case string (no spaces or other characters outside of 0\(en9, a\(enz, "\&.", "_" and "\-") identifying the operating system, excluding any version information and suitable for processing by scripts or usage in generated filenames\&. If not set, a default of
166 "ID=linux"
167 may be used\&. Note that even though this string may not include characters that require shell quoting, quoting may nevertheless be used\&.
168 .sp
169 Examples:
170 "ID=fedora",
171 "ID=debian"\&.
172 .RE
173 .PP
174 \fIID_LIKE=\fR
175 .RS 4
176 A space\-separated list of operating system identifiers in the same syntax as the
177 \fIID=\fR
178 setting\&. It should list identifiers of operating systems that are closely related to the local operating system in regards to packaging and programming interfaces, for example listing one or more OS identifiers the local OS is a derivative from\&. An OS should generally only list other OS identifiers it itself is a derivative of, and not any OSes that are derived from it, though symmetric relationships are possible\&. Build scripts and similar should check this variable if they need to identify the local operating system and the value of
179 \fIID=\fR
180 is not recognized\&. Operating systems should be listed in order of how closely the local operating system relates to the listed ones, starting with the closest\&. This field is optional\&.
181 .sp
182 Examples: for an operating system with
183 "ID=centos", an assignment of
184 "ID_LIKE="rhel fedora""
185 would be appropriate\&. For an operating system with
186 "ID=ubuntu", an assignment of
187 "ID_LIKE=debian"
188 is appropriate\&.
189 .RE
190 .PP
191 \fIPRETTY_NAME=\fR
192 .RS 4
193 A pretty operating system name in a format suitable for presentation to the user\&. May or may not contain a release code name or OS version of some kind, as suitable\&. If not set, a default of
194 "PRETTY_NAME="Linux""
195 may be used\&.
196 .sp
197 Example:
198 "PRETTY_NAME="Fedora 17 (Beefy Miracle)""
199 .RE
200 .PP
201 \fIFANCY_NAME=\fR
202 .RS 4
203 Similar to
204 \fIPRETTY_NAME=\fR, but may contain ANSI sequences and fancy UTF\-8 characters such as emojis\&. If defined this shall preferably used when displaying the OS name on modern terminal emulators\&. If the terminal emulator does not support emojis,
205 \fIPRETTY_NAME=\fR
206 shall be shown instead, possibly with
207 \fIANSI_COLOR=\fR
208 coloring\&. Use
209 "\e033"
210 to encode the ESC character and
211 "\e\e"
212 to encode the backslash character\&.
213 .sp
214 Unlike
215 \fIPRETTY_NAME=\fR
216 this field must not contain information that is present in other fields, in particular the version (already specified in
217 \fIVERSION=\fR) or the codename (already specified in
218 \fIVERSION_CODENAME=\fR)\&.
219 .sp
220 Example:
221 "FANCY_NAME="🍅 \e033[31mTomato\e033[0;1mOS\e033[0m""
222 .sp
223 Added in version 260\&.
224 .RE
225 .PP
226 \fICPE_NAME=\fR
227 .RS 4
228 A CPE name for the operating system, in URI binding syntax, following the
229 \m[blue]\fBCommon Platform Enumeration Specification\fR\m[]\&\s-2\u[4]\d\s+2
230 as proposed by the NIST\&. This field is optional\&.
231 .sp
232 Example:
233 "CPE_NAME="cpe:/o:fedoraproject:fedora:17""
234 .RE
235 .PP
236 \fIVARIANT=\fR
237 .RS 4
238 A string identifying a specific variant or edition of the operating system suitable for presentation to the user\&. This field may be used to inform the user that the configuration of this system is subject to a specific divergent set of rules or default configuration settings\&. This field is optional and may not be implemented on all systems\&.
239 .sp
240 Examples:
241 "VARIANT="Server Edition"",
242 "VARIANT="Smart Refrigerator Edition""\&.
243 .sp
244 Note: this field is for display purposes only\&. The
245 \fIVARIANT_ID\fR
246 field should be used for making programmatic decisions\&.
247 .sp
248 Added in version 220\&.
249 .RE
250 .PP
251 \fIVARIANT_ID=\fR
252 .RS 4
253 A lower\-case string (no spaces or other characters outside of 0\(en9, a\(enz, "\&.", "_" and "\-"), identifying a specific variant or edition of the operating system\&. This may be interpreted by other packages in order to determine a divergent default configuration\&. This field is optional and may not be implemented on all systems\&.
254 .sp
255 Examples:
256 "VARIANT_ID=server",
257 "VARIANT_ID=embedded"\&.
258 .sp
259 Added in version 220\&.
260 .RE
261 .SS "Information about the version of the operating system"
262 .PP
263 \fIVERSION=\fR
264 .RS 4
265 A string identifying the operating system version, excluding any OS name information, possibly including a release code name, and suitable for presentation to the user\&. This field is optional\&.
266 .sp
267 Examples:
268 "VERSION=17",
269 "VERSION="17 (Beefy Miracle)""\&.
270 .RE
271 .PP
272 \fIVERSION_ID=\fR
273 .RS 4
274 A lower\-case string (mostly numeric, no spaces or other characters outside of 0\(en9, a\(enz, "\&.", "_" and "\-") identifying the operating system version, excluding any OS name information or release code name, and suitable for processing by scripts or usage in generated filenames\&. This field is optional\&.
275 .sp
276 Examples:
277 "VERSION_ID=17",
278 "VERSION_ID=11\&.04"\&.
279 .RE
280 .PP
281 \fIVERSION_CODENAME=\fR
282 .RS 4
283 A lower\-case string (no spaces or other characters outside of 0\(en9, a\(enz, "\&.", "_" and "\-") identifying the operating system release code name, excluding any OS name information or release version, and suitable for processing by scripts or usage in generated filenames\&. This field is optional and may not be implemented on all systems\&.
284 .sp
285 Examples:
286 "VERSION_CODENAME=buster",
287 "VERSION_CODENAME=xenial"\&.
288 .sp
289 Added in version 231\&.
290 .RE
291 .PP
292 \fIBUILD_ID=\fR
293 .RS 4
294 A string uniquely identifying the system image originally used as the installation base\&. In most cases,
295 \fIVERSION_ID\fR
296 or
297 \fIIMAGE_ID\fR+\fIIMAGE_VERSION\fR
298 are updated when the entire system image is replaced during an update\&.
299 \fIBUILD_ID\fR
300 may be used in distributions where the original installation image version is important:
301 \fIVERSION_ID\fR
302 would change during incremental system updates, but
303 \fIBUILD_ID\fR
304 would not\&. This field is optional\&.
305 .sp
306 Examples:
307 "BUILD_ID="2013\-03\-20\&.3"",
308 "BUILD_ID=201303203"\&.
309 .sp
310 Added in version 200\&.
311 .RE
312 .PP
313 \fIIMAGE_ID=\fR
314 .RS 4
315 A lower\-case string (no spaces or other characters outside of 0\(en9, a\(enz, "\&.", "_" 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 particularly not on those that are not managed via images but put together and updated from individual packages and on the local system\&.
316 .sp
317 Examples:
318 "IMAGE_ID=vendorx\-cashier\-system",
319 "IMAGE_ID=netbook\-image"\&.
320 .sp
321 Added in version 249\&.
322 .RE
323 .PP
324 \fIIMAGE_VERSION=\fR
325 .RS 4
326 A lower\-case string (mostly numeric, no spaces or other characters outside of 0\(en9, a\(enz, "\&.", "_" and "\-") identifying the OS image version\&. This is supposed to be used together with
327 \fIIMAGE_ID\fR
328 described above, to discern different versions of the same image\&.
329 .sp
330 Examples:
331 "IMAGE_VERSION=33",
332 "IMAGE_VERSION=47\&.1rc1"\&.
333 .sp
334 Added in version 249\&.
335 .RE
336 .PP
337 \fIRELEASE_TYPE=\fR
338 .RS 4
339 A lower\-case string (no spaces or other characters outside of 0\-9, a\-z, "\&.", "_", and "\-"), describing what kind of release this version of the OS is\&. Known values follow:
340 .sp
341 .RS 4
342 .ie n \{\
343 \h'-04'\(bu\h'+03'\c
344 .\}
345 .el \{\
346 .sp -1
347 .IP \(bu 2.3
348 .\}
349 "stable"
350 is for normal releases of the system, suitable for production use\&. Generally, stable releases become end\-of\-life soon after the next major stable release is out, although this might not be the case if, for example, a distribution adopts a rolling release model and still be production ready\&. Examples include Fedora 40, Ubuntu 23\&.10, OpenSUSE Tumbleweed, and Arch Linux\&.
351 .RE
352 .sp
353 .RS 4
354 .ie n \{\
355 \h'-04'\(bu\h'+03'\c
356 .\}
357 .el \{\
358 .sp -1
359 .IP \(bu 2.3
360 .\}
361 "lts"
362 is for long term support releases of the system, suitable for production use and supported for an extended period of time\&. Generally, LTS releases continue to receive support even if newer major releases of the distribution are available\&. Examples include Ubuntu 24\&.04, Debian 12 Bookworm, and RHEL 9\&.4\&.
363 .RE
364 .sp
365 .RS 4
366 .ie n \{\
367 \h'-04'\(bu\h'+03'\c
368 .\}
369 .el \{\
370 .sp -1
371 .IP \(bu 2.3
372 .\}
373 "development"
374 is for unstable versions of the system, unsuitable for production use, such as alpha, beta, or rolling unstable releases\&. Examples include Fedora Rawhide, Debian Testing, Fedora 40 Beta, and GNOME OS Nightly\&.
375 .RE
376 .sp
377 .RS 4
378 .ie n \{\
379 \h'-04'\(bu\h'+03'\c
380 .\}
381 .el \{\
382 .sp -1
383 .IP \(bu 2.3
384 .\}
385 "experiment"
386 is for experimental builds of the system, created specifically to test some work\-in\-progress feature\&. This is meant to be used in combination with
387 \fIEXPERIMENT=\fR\&.
388 .RE
389 .sp
390 If unset, or an unknown value, assume that the release is
391 "stable"\&.
392 .sp
393 Examples:
394 "RELEASE_TYPE=development",
395 "RELEASE_TYPE=lts"\&.
396 .sp
397 Added in version 257\&.
398 .RE
399 .PP
400 To summarize: if the image updates are built and shipped as comprehensive units,
401 \fIIMAGE_ID\fR+\fIIMAGE_VERSION\fR
402 is the best fit\&. Otherwise, if updates eventually completely replace previously installed contents, as in a typical binary distribution,
403 \fIVERSION_ID\fR
404 should be used to identify major releases of the operating system\&.
405 \fIBUILD_ID\fR
406 may be used instead or in addition to
407 \fIVERSION_ID\fR
408 when the original system image version is important\&.
409 .SS "Presentation information and links"
410 .PP
411 \fIHOME_URL=\fR, \fIDOCUMENTATION_URL=\fR, \fISUPPORT_URL=\fR, \fIBUG_REPORT_URL=\fR, \fIPRIVACY_POLICY_URL=\fR
412 .RS 4
413 Links to resources on the Internet related to the operating system\&.
414 \fIHOME_URL=\fR
415 should refer to the homepage of the operating system, or alternatively some homepage of the specific version of the operating system\&.
416 \fIDOCUMENTATION_URL=\fR
417 should refer to the main documentation page for this operating system\&.
418 \fISUPPORT_URL=\fR
419 should refer to the main support page for the operating system, if there is any\&. This is primarily intended for operating systems which vendors provide support for\&.
420 \fIBUG_REPORT_URL=\fR
421 should refer to the main bug reporting page for the operating system, if there is any\&. This is primarily intended for operating systems that rely on community QA\&.
422 \fIPRIVACY_POLICY_URL=\fR
423 should refer to the main privacy policy page for the operating system, if there is any\&. These settings are optional, and providing only some of these settings is common\&. These URLs are intended to be exposed in "About this system" UIs behind links with captions such as "About this Operating System", "Obtain Support", "Report a Bug", or "Privacy Policy"\&. The values should be in
424 \m[blue]\fBRFC3986 format\fR\m[]\&\s-2\u[5]\d\s+2, and should be
425 "http:"
426 or
427 "https:"
428 URLs, and possibly
429 "mailto:"
430 or
431 "tel:"\&. Only one URL shall be listed in each setting\&. If multiple resources need to be referenced, it is recommended to provide an online landing page linking all available resources\&.
432 .sp
433 Examples:
434 "HOME_URL="https://fedoraproject\&.org/"",
435 "BUG_REPORT_URL="https://bugzilla\&.redhat\&.com/""\&.
436 .RE
437 .PP
438 \fISUPPORT_END=\fR
439 .RS 4
440 The date at which support for this version of the OS ends\&. (What exactly "lack of support" means varies between vendors, but generally users should assume that updates, including security fixes, will not be provided\&.) The value is a date in the ISO 8601 format
441 "YYYY\-MM\-DD", and specifies the first day on which support
442 \fIis not\fR
443 provided\&.
444 .sp
445 For example,
446 "SUPPORT_END=2001\-01\-01"
447 means that the system was supported until the end of the last day of the previous millennium\&.
448 .sp
449 Added in version 252\&.
450 .RE
451 .PP
452 \fILOGO=\fR
453 .RS 4
454 A string, specifying the name of an icon as defined by
455 \m[blue]\fBfreedesktop\&.org Icon Theme Specification\fR\m[]\&\s-2\u[6]\d\s+2\&. This can be used by graphical applications to display an operating system\*(Aqs or distributor\*(Aqs logo\&. This field is optional and may not necessarily be implemented on all systems\&.
456 .sp
457 Examples:
458 "LOGO=fedora\-logo",
459 "LOGO=distributor\-logo\-opensuse"
460 .sp
461 Added in version 240\&.
462 .RE
463 .PP
464 \fIANSI_COLOR=\fR
465 .RS 4
466 A suggested presentation (foreground) text color when showing the OS name on the console\&. This should be specified as string suitable for inclusion in the ESC [ m ANSI/ECMA\-48 escape code for setting graphical rendition\&. This field is optional\&.
467 .sp
468 Examples:
469 "ANSI_COLOR="0;31""
470 for red,
471 "ANSI_COLOR="1;34""
472 for light blue, or
473 "ANSI_COLOR="0;38;2;60;110;180""
474 for Fedora blue\&.
475 .RE
476 .PP
477 \fIANSI_COLOR_REVERSE=\fR
478 .RS 4
479 Similar to
480 \fIANSI_COLOR=\fR, but should encode the desired presentation color as background color, along with a suitable foreground color\&. This is may be used by console applications to set off "chrome" UI elements from the main terminal contents\&. This field is optional\&.
481 .sp
482 Added in version 259\&.
483 .RE
484 .PP
485 \fIVENDOR_NAME=\fR
486 .RS 4
487 The name of the OS vendor\&. This is the name of the organization or company which produces the OS\&. This field is optional\&.
488 .sp
489 This name is intended to be exposed in "About this system" UIs or software update UIs when needed to distinguish the OS vendor from the OS itself\&. It is intended to be human\-readable\&.
490 .sp
491 Examples:
492 "VENDOR_NAME="Fedora Project""
493 for Fedora Linux,
494 "VENDOR_NAME="Canonical""
495 for Ubuntu\&.
496 .sp
497 Added in version 254\&.
498 .RE
499 .PP
500 \fIVENDOR_URL=\fR
501 .RS 4
502 The homepage of the OS vendor\&. This field is optional\&. The
503 \fIVENDOR_NAME=\fR
504 field should be set if this one is, although clients must be robust against either field not being set\&.
505 .sp
506 The value should be in
507 \m[blue]\fBRFC3986 format\fR\m[]\&\s-2\u[5]\d\s+2, and should be
508 "http:"
509 or
510 "https:"
511 URLs\&. Only one URL shall be listed in the setting\&.
512 .sp
513 Examples:
514 "VENDOR_URL="https://fedoraproject\&.org/"",
515 "VENDOR_URL="https://canonical\&.com/""\&.
516 .sp
517 Added in version 254\&.
518 .RE
519 .PP
520 \fIEXPERIMENT=\fR
521 .RS 4
522 A human\-presentable description of what makes this build of the OS experimental\&. This field is optional\&. The
523 \fIRELEASE_TYPE\fR
524 field should be set to
525 "experiment"
526 if this field is set, otherwise clients should ignore this field\&.
527 .sp
528 This description is intended to be exposed at system installation time, or in "About this system" UIs, to warn the user that they\*(Aqre installing/running an experimental build of the OS\&. If
529 \fIRELEASE_TYPE\fR
530 is
531 "experiment"
532 but this field is unset, the UI should still warn the user, but it will be unable to explain what exactly is experimental about the current build of the OS\&.
533 .sp
534 Examples:
535 "EXPERIMENT="Switch to DNF5""
536 for an experimental build of Fedora Linux made to test DNF5,
537 "EXPERIMENT="Port to Apple M3 chip""
538 for experimental builds of Asahi Linux ported to the Apple M3 SoC,
539 "EXPERIMENT="Mutter !1441: Dynamic triple/double buffering (v4)""
540 for builds of GNOME OS created by Mutter\*(Aqs CI for merge request !1441\&.
541 .sp
542 Added in version 257\&.
543 .RE
544 .PP
545 \fIEXPERIMENT_URL=\fR
546 .RS 4
547 The main informational page about what makes the current OS build experimental, where users can learn more about the experiment\*(Aqs status and potentially leave feedback\&. This field is optional\&. The
548 \fIEXPERIMENT=\fR
549 field should be set if this one is, although clients must be robust against either field not being set\&.
550 .sp
551 The value should be in
552 \m[blue]\fBRFC3986 format\fR\m[]\&\s-2\u[5]\d\s+2, and should be
553 "http:"
554 or
555 "https:"
556 URLs\&. Only one URL shall be listed in the setting\&.
557 .sp
558 Examples, corresponding to the examples above in
559 \fIEXPERIMENT=\fR:
560 "EXPERIMENT_URL="https://fedoraproject\&.org/wiki/Changes/SwitchToDnf5"",
561 "EXPERIMENT_URL="https://github\&.com/AsahiLinux/docs/wiki/M3\-Series\-Feature\-Support"",
562 "EXPERIMENT_URL="https://gitlab\&.gnome\&.org/GNOME/mutter/\-/merge_requests/1441""\&.
563 .sp
564 Added in version 257\&.
565 .RE
566 .SS "Distribution\-level defaults and metadata"
567 .PP
568 \fIDEFAULT_HOSTNAME=\fR
569 .RS 4
570 A string specifying the hostname if
571 \fBhostname\fR(5)
572 is not present and no other configuration source specifies the hostname\&. Must be either a single DNS label (a string composed of 7\-bit ASCII lower\-case characters and no spaces or dots, limited to the format allowed for DNS domain name labels), or a sequence of such labels separated by single dots that forms a valid DNS FQDN\&. The hostname must be at most 64 characters, which is a Linux limitation (DNS allows longer names)\&.
573 .sp
574 If the question mark character
575 "?"
576 appears in the hostname, it is automatically substituted by a hexadecimal character derived from the
577 \fBmachine-id\fR(5)
578 when applied, securely and deterministically by cryptographic hashing\&. Example:
579 "foobar\-????\-????"
580 will automatically expand to
581 "foobar\-92a9\-061c"
582 or similar, depending on the local machine ID\&.
583 .sp
584 See
585 \fBorg.freedesktop.hostname1\fR(5)
586 for a description of how
587 \fBsystemd-hostnamed.service\fR(8)
588 determines the fallback hostname\&.
589 .sp
590 Added in version 248\&.
591 .RE
592 .PP
593 \fIARCHITECTURE=\fR
594 .RS 4
595 A string that specifies which CPU architecture the userspace binaries require\&. The architecture identifiers are the same as for
596 \fIConditionArchitecture=\fR
597 described in
598 \fBsystemd.unit\fR(5)\&. The field is optional and should only be used when just single architecture is supported\&. It may provide redundant information when used in a GPT partition with a GUID type that already encodes the architecture\&. If this is not the case, the architecture should be specified in e\&.g\&., an extension image, to prevent an incompatible host from loading it\&.
599 .sp
600 Added in version 252\&.
601 .RE
602 .PP
603 \fISYSEXT_LEVEL=\fR
604 .RS 4
605 A lower\-case string (mostly numeric, no spaces or other characters outside of 0\(en9, a\(enz, "\&.", "_" and "\-") identifying the operating system extensions support level, to indicate which extension images are supported\&. See
606 /usr/lib/extension\-release\&.d/extension\-release\&.\fIIMAGE\fR,
607 \m[blue]\fBinitrd\fR\m[]\&\s-2\u[2]\d\s+2
608 and
609 \fBsystemd-sysext\fR(8)) for more information\&.
610 .sp
611 Examples:
612 "SYSEXT_LEVEL=2",
613 "SYSEXT_LEVEL=15\&.14"\&.
614 .sp
615 Added in version 248\&.
616 .RE
617 .PP
618 \fICONFEXT_LEVEL=\fR
619 .RS 4
620 Semantically the same as
621 \fISYSEXT_LEVEL=\fR
622 but for confext images\&. See
623 /etc/extension\-release\&.d/extension\-release\&.\fIIMAGE\fR
624 for more information\&.
625 .sp
626 Examples:
627 "CONFEXT_LEVEL=2",
628 "CONFEXT_LEVEL=15\&.14"\&.
629 .sp
630 Added in version 254\&.
631 .RE
632 .PP
633 \fISYSEXT_SCOPE=\fR
634 .RS 4
635 Takes a space\-separated list of one or more of the strings
636 "system",
637 "initrd"
638 and
639 "portable"\&. This field is only supported in
640 extension\-release\&.d/
641 files and indicates what environments the system extension is applicable to: i\&.e\&. to regular systems, to initrds and exitrds, or to portable service images\&. If not specified,
642 "SYSEXT_SCOPE=system portable"
643 is implied, i\&.e\&. any system extension without this field is applicable to regular systems and to portable service environments, but not to initrd/exitrd environments\&.
644 .sp
645 Added in version 250\&.
646 .RE
647 .PP
648 \fICONFEXT_SCOPE=\fR
649 .RS 4
650 Semantically the same as
651 \fISYSEXT_SCOPE=\fR
652 but for confext images\&.
653 .sp
654 Added in version 254\&.
655 .RE
656 .PP
657 \fIPORTABLE_PREFIXES=\fR
658 .RS 4
659 Takes a space\-separated list of one or more valid prefix match strings for the
660 \m[blue]\fBPortable Services\fR\m[]\&\s-2\u[3]\d\s+2
661 logic\&. This field serves two purposes: it is informational, identifying portable service images as such (and thus allowing them to be distinguished from other OS images, such as bootable system images)\&. It is also used when a portable service image is attached: the specified or implied portable service prefix is checked against the list specified here, to enforce restrictions how images may be attached to a system\&.
662 .sp
663 Added in version 250\&.
664 .RE
665 .PP
666 \fIPORTABLE_SCOPE=\fR
667 .RS 4
668 Specifies the scope of the portable service\&. Takes one of
669 "system",
670 "user", or
671 "any"\&. When set to
672 "system", the portable service can only be attached to the system instance of
673 \fBsystemd\-portabled\fR\&. When set to
674 "user", the portable service can only be attached to the user instance of
675 \fBsystemd\-portabled\fR\&. When set to
676 "any", the portable service can be attached to both the system and user instances of
677 \fBsystemd\-portabled\fR\&. If not set,
678 "PORTABLE_SCOPE=system"
679 is implied\&.
680 .sp
681 Added in version 259\&.
682 .RE
683 .SS "Notes"
684 .PP
685 If you are using this file to determine the OS or a specific version of it, use the
686 \fIID\fR
687 and
688 \fIVERSION_ID\fR
689 fields, possibly with
690 \fIID_LIKE\fR
691 as fallback for
692 \fIID\fR\&. When looking for an OS identification string for presentation to the user use the
693 \fIPRETTY_NAME\fR
694 field\&.
695 .PP
696 Note that operating system vendors may choose not to provide version information, for example to accommodate for rolling releases\&. In this case,
697 \fIVERSION\fR
698 and
699 \fIVERSION_ID\fR
700 may be unset\&. Applications should not rely on these fields to be set\&.
701 .PP
702 Operating system vendors may extend the file format and introduce new fields\&. It is highly recommended to prefix new fields with an OS\-specific name in order to avoid name clashes\&. Applications reading this file must ignore unknown fields\&.
703 .PP
704 Example:
705 "DEBIAN_BTS="debbugs://bugs\&.debian\&.org/""\&.
706 .PP
707 Container and sandbox runtime managers may make the host\*(Aqs identification data available to applications by providing the host\*(Aqs
708 /etc/os\-release
709 (if available, otherwise
710 /usr/lib/os\-release
711 as a fallback) as
712 /run/host/os\-release\&.
713 .SH "EXAMPLES"
714 .PP
715 \fBExample\ \&1.\ \&os\-release file for Fedora Workstation\fR
716 .sp
717 .if n \{\
718 .RS 4
719 .\}
720 .nf
721 NAME=Fedora
722 VERSION="32 (Workstation Edition)"
723 ID=fedora
724 VERSION_ID=32
725 PRETTY_NAME="Fedora 32 (Workstation Edition)"
726 ANSI_COLOR="0;38;2;60;110;180"
727 LOGO=fedora\-logo\-icon
728 CPE_NAME="cpe:/o:fedoraproject:fedora:32"
729 HOME_URL="https://fedoraproject\&.org/"
730 DOCUMENTATION_URL="https://docs\&.fedoraproject\&.org/en\-US/fedora/f32/system\-administrators\-guide/"
731 SUPPORT_URL="https://fedoraproject\&.org/wiki/Communicating_and_getting_help"
732 BUG_REPORT_URL="https://bugzilla\&.redhat\&.com/"
733 REDHAT_BUGZILLA_PRODUCT="Fedora"
734 REDHAT_BUGZILLA_PRODUCT_VERSION=32
735 REDHAT_SUPPORT_PRODUCT="Fedora"
736 REDHAT_SUPPORT_PRODUCT_VERSION=32
737 PRIVACY_POLICY_URL="https://fedoraproject\&.org/wiki/Legal:PrivacyPolicy"
738 VARIANT="Workstation Edition"
739 VARIANT_ID=workstation
740 .fi
741 .if n \{\
742 .RE
743 .\}
744 .PP
745 \fBExample\ \&2.\ \&extension\-release file for an extension for Fedora Workstation 32\fR
746 .sp
747 .if n \{\
748 .RS 4
749 .\}
750 .nf
751 ID=fedora
752 VERSION_ID=32
753 .fi
754 .if n \{\
755 .RE
756 .\}
757 .PP
758 \fBExample\ \&3.\ \&Reading os\-release in sh(1)\fR
759 .sp
760 .if n \{\
761 .RS 4
762 .\}
763 .nf
764 #!/bin/sh \-eu
765 # SPDX\-License\-Identifier: MIT\-0
766
767 test \-e /etc/os\-release && os_release=\*(Aq/etc/os\-release\*(Aq || os_release=\*(Aq/usr/lib/os\-release\*(Aq
768 \&. "${os_release}"
769
770 echo "Running on ${PRETTY_NAME:\-Linux}"
771
772 if [ "${ID:\-linux}" = "debian" ] || [ "${ID_LIKE#*debian*}" != "${ID_LIKE}" ]; then
773 echo "Looks like Debian!"
774 fi
775 .fi
776 .if n \{\
777 .RE
778 .\}
779 .PP
780 \fBExample\ \&4.\ \&Reading os\-release in python(1) (versions >= 3\&.10)\fR
781 .sp
782 .if n \{\
783 .RS 4
784 .\}
785 .nf
786 #!/usr/bin/python
787 # SPDX\-License\-Identifier: MIT\-0
788
789 import platform
790
791 os_release = platform\&.freedesktop_os_release()
792
793 pretty_name = os_release\&.get(\*(AqPRETTY_NAME\*(Aq, \*(AqLinux\*(Aq)
794 print(f\*(AqRunning on {pretty_name!r}\*(Aq)
795
796 if \*(Aqfedora\*(Aq in [os_release\&.get(\*(AqID\*(Aq, \*(Aqlinux\*(Aq), *os_release\&.get(\*(AqID_LIKE\*(Aq, \*(Aq\*(Aq)\&.split()]:
797 print(\*(AqLooks like Fedora!\*(Aq)
798 .fi
799 .if n \{\
800 .RE
801 .\}
802 .PP
803 See docs for
804 \fB\m[blue]\fBplatform\&.freedesktop_os_release\fR\m[]\&\s-2\u[7]\d\s+2\fR
805 for more details\&.
806 .PP
807 \fBExample\ \&5.\ \&Reading os\-release in python(1) (any version)\fR
808 .sp
809 .if n \{\
810 .RS 4
811 .\}
812 .nf
813 #!/usr/bin/python
814 # SPDX\-License\-Identifier: MIT\-0
815
816 import ast
817 import re
818 import sys
819
820
821 def read_os_release():
822 try:
823 filename = \*(Aq/etc/os\-release\*(Aq
824 f = open(filename)
825 except FileNotFoundError:
826 filename = \*(Aq/usr/lib/os\-release\*(Aq
827 f = open(filename)
828
829 for line_number, line in enumerate(f, start=1):
830 line = line\&.rstrip()
831 if not line or line\&.startswith(\*(Aq#\*(Aq):
832 continue
833 if m := re\&.match(r\*(Aq([A\-Z][A\-Z_0\-9]+)=(\&.*)\*(Aq, line):
834 name, val = m\&.groups()
835 if val and val[0] in \*(Aq"\e\*(Aq\*(Aq:
836 val = ast\&.literal_eval(val)
837 yield name, val
838 else:
839 print(f\*(Aq{filename}:{line_number}: bad line {line!r}\*(Aq, file=sys\&.stderr)
840
841
842 os_release = dict(read_os_release())
843
844 pretty_name = os_release\&.get(\*(AqPRETTY_NAME\*(Aq, \*(AqLinux\*(Aq)
845 print(f\*(AqRunning on {pretty_name!r}\*(Aq)
846
847 if \*(Aqdebian\*(Aq in [os_release\&.get(\*(AqID\*(Aq, \*(Aqlinux\*(Aq), *os_release\&.get(\*(AqID_LIKE\*(Aq, \*(Aq\*(Aq)\&.split()]:
848 print(\*(AqLooks like Debian!\*(Aq)
849 .fi
850 .if n \{\
851 .RE
852 .\}
853 .PP
854 Note that the above version that uses the built\-in implementation is preferred in most cases, and the open\-coded version here is provided for reference\&.
855 .SH "SEE ALSO"
856 .PP
857 \fBsystemd\fR(1), \fBlsb_release\fR(1), \fBhostname\fR(5), \fBmachine-id\fR(5), \fBmachine-info\fR(5)
858 .SH "NOTES"
859 .IP " 1." 4
860 Announcement of /etc/os-release
861 .RS 4
862 \%https://0pointer.de/blog/projects/os-release
863 .RE
864 .IP " 2." 4
865 initrd
866 .RS 4
867 \%https://docs.kernel.org/admin-guide/initrd.html
868 .RE
869 .IP " 3." 4
870 Portable Services
871 .RS 4
872 \%https://systemd.io/PORTABLE_SERVICES
873 .RE
874 .IP " 4." 4
875 Common Platform Enumeration Specification
876 .RS 4
877 \%http://scap.nist.gov/specifications/cpe/
878 .RE
879 .IP " 5." 4
880 RFC3986 format
881 .RS 4
882 \%https://tools.ietf.org/html/rfc3986
883 .RE
884 .IP " 6." 4
885 freedesktop.org Icon Theme Specification
886 .RS 4
887 \%https://standards.freedesktop.org/icon-theme-spec/latest
888 .RE
889 .IP " 7." 4
890 platform.freedesktop_os_release
891 .RS 4
892 \%https://docs.python.org/3/library/platform.html#platform.freedesktop_os_release
893 .RE