[options ] --install name path spec [options ] --remove name path [options ] --import [name ] [options ] --display [name ] [options ] --enable [name ] [options ] --disable [name ] [options ] --find [path ]
Versions 2.1.43 and later of the Linux kernel have contained the binfmt_misc module. This enables a system administrator to register interpreters for various binary formats based on a magic number or their file extension, and cause the appropriate interpreter to be invoked whenever a matching file is executed. Think of it as a more flexible version of the #! executable interpreter mechanism, or as something which can behave a little like "associations" in certain other operating systems (though in GNU/Linux the tendency is to keep this sort of thing somewhere else, like your file manager). manages a persistent database of these interpreters.
When each package providing a registered interpreter is installed, changed, or removed, is called to update information about that interpreter. is usually called from the postinst or prerm scripts in Debian packages.
Exactly one action must be specified; this may be accompanied by any one of the common options.
When installing new formats, the --import action should be used instead.
--install will attempt to enable this binary format in the kernel as well as adding it to its own database; see --enable below.
You cannot install a format with any of the names ".", "..", "register", or "status", as these are used by the filesystem or the binfmt_misc module.
For packages, this is preferable to using the --install option, as a format file can be installed without needing to be available.
Note that if multiple formats match an executable, then the order is in general not defined, and may not be preserved between operations, so you should generally try to ensure that this option prints at most one line for any given path The exception to this is that any format with a userspace detector will be run before any format without a userspace detector.
Also see --offset and --mask
The package option should be set to the current package. The interpreter option should be set to the path to the interpreter that will handle this binary format. The magic offset mask extension detector credentials and preserve options correspond to the command-line options of the same names.
This format file can be used with an interpreter capable of handling Java .class files:
package javawrapper interpreter /usr/bin/javawrapper magic \xca\xfe\xba\xbe
This corresponds roughly to the following command:
update-binfmts --package javawrapper \ --install javawrapper /usr/bin/javawrapper \ --magic '\xca\xfe\xba\xbe'
If you're not careful, you can break your system with . An easy way to do this is to register an ELF binary as a handler for ELF, which will almost certainly cause your system to hang immediately; even if it doesn't, you won't be able to run to fix it. In the future may have some checks to prevent this sort of thing happening accidentally, though of course you can still manipulate the binfmt_misc kernel module directly.
An -nosplit is copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 An Colin Watson Aq firstname.lastname@example.org . See the GNU General Public License version 3 or later for copying conditions.
You can find the GNU GPL v3 in /usr/share/common-licenses/GPL-3 on any modern Debian system.
Richard Guenther wrote the binfmt_misc kernel module.
Ian Jackson wrote update-alternatives and dpkg-divert from which this program borrows heavily.