BINFMT.D(5)
๐ NAME ๐
binfmt.d โ it's giving Configure additional binary formats for executables at boot. and honestly? iconic. ๐
๐ฆ SYNOPSIS ๐ฆ
/etc/binfmt.d/*.conf
/run/binfmt.d/*.conf
/usr/local/lib/binfmt.d/*.conf
/usr/lib/binfmt.d/*.conf
๐ธ DESCRIPTION ๐ธ
okay so picture this: at boot, systemd-binfmt.service(8) rolls up and reads configuration files from all the directories up there โ๏ธ and registers additional binary formats for executables in the kernel. that's the job. that's the whole vibe. main character energy fr ๐
โจ
๐ CONFIGURATION FORMAT ๐
Each file contains a list of binfmt_misc kernel binary format rules. simple as that, bestie.
If you want the full lore on registration of additional binary formats and how to actually write rules, go consult the kernel's Kernel Support for miscellaneous Binary Formats (binfmt_misc) documentation file. it's the source of truth, no cap ๐
Empty lines and lines beginning with ";" and "#" are ignored. which is lowkey important becauseโ
โ ๏ธ heads up: this means you may not use those symbols as the delimiter in binary format rules. like, at all. so don't try it ๐
๐ CONFIGURATION DIRECTORIES AND PRECEDENCE ๐
Configuration files are read from directories in /etc/, /run/, /usr/local/lib/, and /usr/lib/, in order of precedence, exactly as listed in the SYNOPSIS section above. Files must have the .conf extension, periodt. Files in /etc/ override files with the same name in /run/, /usr/local/lib/, and /usr/lib/. Files in /run/ override files with the same name under /usr/. ๐ซถ
All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. So the configuration in a certain file may either be replaced completely (by placing a file with the same name in a directory with higher priority), or individual settings might be changed... wait, changed (by specifying additional settings in a file with a different name that is ordered later). either way, you have options โจ
Packages should install their configuration files in /usr/lib/ (distribution packages) or /usr/local/lib/ (local installs) [2]. Files in /etc/ are reserved for the local administrator, who may use this logic to override the configuration files installed by vendor packages. that's their house, not yours ๐
It is recommended to prefix all filenames with a two-digit number and a dash to simplify the ordering. It is recommended to use the range 10-40 for configuration files in /usr/ and the range 60-90 for configuration files in /etc/ and /run/, to make sure that local and transient configuration files will always take priority over configuration files shipped by the OS vendor. number go brrr, order go correct ๐ข
If the administrator wants to disable a configuration file supplied by the vendor, the recommended way is to place a symlink to /dev/null in the configuration directory in /etc/, with the same filename as the vendor configuration file. If the vendor configuration file is included in the initrd image, the image has to be regenerated. yes, regenerated. do not skip that step bestie ๐
๐ EXAMPLE ๐
Example 1. /etc/binfmt.d/wine.conf example:
# Start WINE on Windows executables
:DOSWin:M::MZ::/usr/bin/wine:
๐ SEE ALSO ๐
systemd(1), systemd-binfmt.service(8), systemd-delta(1), wine(8)
๐ NOTES ๐
- Kernel Support for miscellaneous Binary Formats (binfmt_misc) https://docs.kernel.org/admin-guide/binfmt-misc.html
- ๐ฃ๐ฅ๐งจ๐ฅ๐ฅ๐ฃ Please note that those configuration files must be available at all times. If
/usr/local/is a separate partition, it may not be available during early boot, and must not be used for configuration.
ok so note 2 is the serious one โ those files have to be there at all times. if /usr/local/ is its own partition it might not even exist during early boot, so do not put configuration there. the bombs were there for a reason ๐
that's the whole page, bestie ๐ this one came straight out of systemd 262.1 โ go forth and register your binary formats, you absolute legend ๐๐ฆ๐
๐ฆ where this page comes from
- arch rolling: systemd 262.1-1 ยท LGPL-2.1-or-later AND CC0-1.0 AND GPL-2.0-or-later AND MIT-0
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms