Package Details: binfmt-support 2.1.5-2

Git Clone URL: https://aur.archlinux.org/binfmt-support.git (read-only)
Package Base: binfmt-support
Description: register interpreters for various binary formats
Upstream URL: http://packages.debian.org/en/sid/binfmt-support
Licenses: GPL
Submitter: sergej
Maintainer: rains
Last Packager: rains
Votes: 42
Popularity: 5.055038
First Submitted: 2012-10-04 09:09
Last Updated: 2015-07-27 04:08

Dependencies (1)

Required by (1)

Sources (2)

Latest Comments

rains commented on 2015-07-27 04:07

done, @vinadoros thanks for reminding.

vinadoros commented on 2015-07-26 14:30

Question, I noticed this package in AUR4 hasn't received an update that the package in AUR3 has received (that one is at -2). I noticed the following line is different in the pkgbuild:

--- binfmt-support_aur4/PKGBUILD
+++ binfmt-support_aur/PKGBUILD
@@ -1,6 +1,6 @@
pkgname=binfmt-support
pkgver=2.1.5
-pkgrel=1
+pkgrel=2
pkgdesc="register interpreters for various binary formats"
arch=(i686 x86_64)
url="http://packages.debian.org/en/sid/binfmt-support"
@@ -14,7 +14,7 @@

build() {
cd "$srcdir/$pkgname-$pkgver"
- ./configure --prefix=/usr --libexecdir=/usr/lib --sbindir=/usr/bin
+ ./configure --prefix=/usr --libexecdir=/usr/lib --sbindir=/usr/bin --localstatedir=/var
make
}

This change seems significant, because the update-binfmts is unable to register the formats in the AUR4 version of this package, but can with the AUR3 version. Can you update the PKGBUILD? Flagging this out-of-date for attention. Thanks.

rains commented on 2015-01-29 17:07

@bendavis78 updated, works fine with qemu-user-static-exp

rains commented on 2015-01-28 08:35

@bendavis78 This bug is due to the outdated and buggy qemu-user-static, there is a working qemu-user-static PKGBUILD below:
% cat PKGBUILD
# Maintainer: Sergio Tridente <tioduke at gmail dot com >

pkgname=qemu-user-static
pkgver=2.1
pkgrel=11
pkgdesc="A generic and open source processor emulator which achieves a good emulation speed by using dynamic translation, statically linked."
arch=('i686' 'x86_64')
license=('GPL2' 'LGPL2.1')
url="http://wiki.qemu.org/Index.html"
depends=()
optdepends=('binfmt-support: to allow handling foreign ELF binaries and executing them via qemu')
conflicts=()
_arch=i386
[ "$CARCH" = 'x86_64' ] && _arch=amd64
_debsrc=${pkgname}_${pkgver}+dfsg-${pkgrel}_${_arch}.deb
source=(http://ftp.debian.org/debian/pool/main/q/qemu/${_debsrc})
sha1sums=('805f000c1826db83960ed2835c0d6380fb82de3e')
[ "$CARCH" = 'i686' ] && sha1sums=('f349df1be10439d8f85f5da1464da1938ef5e9df')

prepare() {
cd "$srcdir"
ar p ${_debsrc} data.tar.xz | bsdtar xf -
}

package() {
cd "$pkgdir"
mkdir -p "$pkgdir"/usr/bin/
mkdir -p "$pkgdir"/usr/share/man/
mkdir -p "$pkgdir"/var/lib/binfmts/

cp "$srcdir"/usr/bin/* "$pkgdir"/usr/bin/
cp "$srcdir"/usr/share/man/man1 "$pkgdir"/usr/share/man/ -r

create_binfmts
}

create_binfmts() {
aarch64_magic='\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7'
aarch64_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff'
alpha_magic='\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x26\x90'
alpha_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff'
arm_magic='\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00'
arm_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff'
armeb_magic='\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28'
armeb_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff'
cris_magic='\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x4c\x00'
cris_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff'
m68k_magic='\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x04'
m68k_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff'
microblaze_magic='\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\xba\xab'
microblaze_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff'
mips_magic='\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08'
mips_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff'
mipsel_magic='\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00'
mipsel_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xfe\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff'
ppc_magic='\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14'
ppc_mask='\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff'
ppc64_magic='\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15'
ppc64_mask='\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff'
ppc64abi32_magic='\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15'
ppc64abi32_mask='\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff'
s390x_magic='\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x16'
s390x_mask='\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff'
sh4_magic='\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a\x00'
sh4_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff'
sh4eb_magic='\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a'
sh4eb_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff'
sparc_magic='\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02'
sparc_mask='\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff'
sparc32plus_magic='\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x12'
sparc32plus_mask='\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff'
sparc64_magic='\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2b'
sparc64_mask='\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff'

# Drop support for emulating amd64 on i386, http://bugs.debian.org/604712
fmts="aarch64 alpha arm armeb cris m68k microblaze mips mipsel ppc ppc64 ppc64abi32 s390x sh4 sh4eb sparc sparc32plus sparc64"

for fmt in $fmts ; do
eval "magic=\"\$${fmt}_magic\" mask=\"\$${fmt}_mask\""
cat >> "${pkgdir}/var/lib/binfmts/$fmt" << EOF
qemu-user-static
magic
0
$magic
$mask
/usr/bin/qemu-$fmt-static

EOF
done
}

rains commented on 2015-01-28 08:05

@bendavis78 This bug is due to the outdated and buggy qemu-user-static, there is a working qemu-user-static PKGBUILD below:
% cat PKGBUILD
# Maintainer: Sergio Tridente <tioduke at gmail dot com >

pkgname=qemu-user-static
pkgver=2.1
pkgrel=11
pkgdesc="A generic and open source processor emulator which achieves a good emulation speed by using dynamic translation, statically linked."
arch=('i686' 'x86_64')
license=('GPL2' 'LGPL2.1')
url="http://wiki.qemu.org/Index.html"
depends=()
optdepends=('binfmt-support: to allow handling foreign ELF binaries and executing them via qemu')
conflicts=()
_arch=i386
[ "$CARCH" = 'x86_64' ] && _arch=amd64
_debsrc=${pkgname}_${pkgver}+dfsg-${pkgrel}_${_arch}.deb
source=(http://ftp.debian.org/debian/pool/main/q/qemu/${_debsrc})
sha1sums=('805f000c1826db83960ed2835c0d6380fb82de3e')
[ "$CARCH" = 'i686' ] && sha1sums=('f349df1be10439d8f85f5da1464da1938ef5e9df')

prepare() {
cd "$srcdir"
ar p ${_debsrc} data.tar.xz | bsdtar xf -
}

package() {
cd "$pkgdir"
mkdir -p "$pkgdir"/usr/bin/
mkdir -p "$pkgdir"/usr/share/man/
mkdir -p "$pkgdir"/var/lib/binfmts/

cp "$srcdir"/usr/bin/* "$pkgdir"/usr/bin/
cp "$srcdir"/usr/share/man/man1 "$pkgdir"/usr/share/man/ -r

create_binfmts
}

create_binfmts() {
aarch64_magic='\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7'
aarch64_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff'
alpha_magic='\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x26\x90'
alpha_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff'
arm_magic='\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00'
arm_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff'
armeb_magic='\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28'
armeb_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff'
cris_magic='\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x4c\x00'
cris_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff'
m68k_magic='\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x04'
m68k_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff'
microblaze_magic='\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\xba\xab'
microblaze_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff'
mips_magic='\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08'
mips_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff'
mipsel_magic='\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00'
mipsel_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xfe\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff'
ppc_magic='\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14'
ppc_mask='\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff'
ppc64_magic='\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15'
ppc64_mask='\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff'
ppc64abi32_magic='\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15'
ppc64abi32_mask='\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff'
s390x_magic='\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x16'
s390x_mask='\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff'
sh4_magic='\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a\x00'
sh4_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff'
sh4eb_magic='\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a'
sh4eb_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff'
sparc_magic='\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02'
sparc_mask='\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff'
sparc32plus_magic='\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x12'
sparc32plus_mask='\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff'
sparc64_magic='\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2b'
sparc64_mask='\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff'

# Drop support for emulating amd64 on i386, http://bugs.debian.org/604712
fmts="aarch64 alpha arm armeb cris m68k microblaze mips mipsel ppc ppc64 ppc64abi32 s390x sh4 sh4eb sparc sparc32plus sparc64"

for fmt in $fmts ; do
eval "magic=\"\$${fmt}_magic\" mask=\"\$${fmt}_mask\""
cat >> "${pkgdir}/var/lib/binfmts/qemu-$fmt" << EOF
qemu-user-static
interpreter
0
$magic
$mask
/usr/bin/qemu-$fmt-static

EOF
done
}

bendavis78 commented on 2014-08-10 22:17

For some reason, when the binfmt files are loaded, they don't seem to get registered properly. For example, when I run:

update-binfmts --enable

The contents of /proc/sys/fs/binfmt_misc/qemu-arm are:

enabled
interpreter mask \xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff
flags:
extension .offset 0

It should contain the interpreter (/usr/bin/qemu-arm-static) and the magic bytes, like so:

enabled
interpreter /usr/bin/qemu-arm-static
flags:
offset 0
magic 7f454c4601010100000000000000000002002800
mask ffffffffffffff00fffffffffffffffffeffffff

lafka commented on 2014-04-25 10:35

2.1.4 is up, md5sum: 205b41682dda59bd9695af733de2eeae

gog commented on 2014-02-25 15:22

2.1.1 has been removed. Version 2.1.3 is up, md5sum: c3ebcac433a39605ccf17b0b0023ca64

kniren commented on 2014-01-12 20:38

Apparently package version 2.0.15 has been removed from the download page, here is a working PKGBUILD with version 2.1.1:

https://gist.github.com/kniren/8390234

xantares commented on 2013-09-26 18:17

Hi,

I finally found it:

RemainAfterExit=yes

must be set (in [service] of binfmt-support.service) for the service to be considered alive,
or else it starts and stops immediately.

Could you please fix it ?

x.

xantares commented on 2013-09-26 18:15

Hi,

I finally found it:

RemainAfterExit=yes

must be set (in [service]) for the service to be considered alive,
or else it starts and stops immediately.

x.

xantares commented on 2013-09-25 13:52

Maybe my explaination was unclear.

binfmt-wine does not require any extra service.
It simply relies on the binfmt-support service.
The binfmt-support service runs update-binfmts --enable.
update-binfmts processes all files located under /etc/binfmt.d/.
binfmt-wine simply brings /etc/binfmt.d/wine.conf.

If your run manually update-binfmts --enable with /etc/binfmt.d/wine.conf => OK.
If you reboot, the call to binfmt-support service call to update-binfmts does not take wine.conf into account altough it returns 0.

x.





sergej commented on 2013-09-23 13:27

Try to add
After=systemd-binfmt.service
Requires=systemd-binfmt.service
to .service file.

sergej commented on 2013-09-23 13:26

probably it should be started after systemd-binfmt.service

xantares commented on 2013-09-22 10:08

Hi,

The binfmt service initialisation fails on my configuration.

I have a file /etc/binfmt.d/wine.conf (brought by binfmt-wine) which update-binfmt --enable takes into account.

The problem is it doesn't work at startup when launched from the binfmt service, my configuration is not enabled:
$ update-binfmts --display
DOSWin (disabled): ...

/usr/lib/systemd/system/binfmt-support.service:
ExecStart=/usr/bin/update-binfmts --enable


Howerver the service status is OK, update-binfmts returned 0:
$ systemctl status binfmt-support
binfmt-support.service - Enable support for additional binary formats. Java, python, etc.
Loaded: loaded (/usr/lib/systemd/system/binfmt-support.service; enabled)
Active: inactive (dead) since Sun 2013-09-22 11:57:02 CEST; 6min ago
Docs: man:update-binfmts(8)
Process: 223 ExecStop=/usr/bin/update-binfmts --disable (code=exited, status=0/SUCCESS)
Process: 216 ExecStart=/usr/bin/update-binfmts --enable (code=exited, status=0/SUCCESS)
Main PID: 216 (code=exited, status=0/SUCCESS)
CGroup: /system.slice/binfmt-support.service

But, if I wait a bit before spawning the binfmts service, it succeeds:
ExecStart=sh -c "sleep 10 && /usr/bin/update-binfmts --enable"

$ update-binfmts --display
DOSWin (enabled):

I suspect we should depend on some other filesytem service to spawn or something for the wine.conf to be read or something.

Any idea ?

graysky commented on 2013-09-01 14:11

Missing a dependency: libpipeline

graysky commented on 2013-06-01 08:34

Need to add the following to your configure step to be compliant with the /usr move:

--sbindir=/usr/bin

Here is a PKGBUILD: https://gist.github.com/graysky2/5689701

bleekmouse commented on 2013-02-14 01:04

binfmt-support.service fixed :) apparently systemd will stop a service when the binary exits, so it was constantly starting and stopping.

bleekmouse commented on 2013-02-09 21:54

I said that too quick, errors stopped, but it's still not starting :(

bleekmouse commented on 2013-02-09 21:46

just realised update-binfmts isn't necessarily on the path for all installs, so updated the systemd service file to use the full path. Should work now regardless :)

bleekmouse commented on 2013-01-28 14:06

Hey Sergej,
I noticed the package is missing a systemd service.

I added the file and upgraded to the next version 2.0.13. Check it out :
https://github.com/wrigleyster/arch-pkgs/tree/master/binfmt-support

/BM