Package Details: qemu-user-static 2.12-4

Git Clone URL: https://aur.archlinux.org/qemu-user-static.git (read-only)
Package Base: qemu-user-static
Description: A generic and open source processor emulator which achieves a good emulation speed by using dynamic translation, statically linked.
Upstream URL: http://wiki.qemu.org/Index.html
Licenses: GPL2, LGPL2.1
Submitter: TioDuke
Maintainer: TioDuke
Last Packager: TioDuke
Votes: 65
Popularity: 0.285465
First Submitted: 2013-05-30 09:49
Last Updated: 2018-06-03 05:05

Dependencies (1)

  • binfmt-qemu-static (optional) – to allow handling foreign ELF binaries and executing them via qemu

Sources (1)

Latest Comments

coderobe commented on 2018-02-28 00:13

the optdep binfmt-support should probably be changed to binfmt-qemu-static, which uses the correct binfmt config syntax & integrates with systemd-binfmt just fine

blubbblubb commented on 2018-01-21 16:03

ah thanks, so it should probably be removed as an optional dependency?

z3ntu commented on 2018-01-19 17:27

@blubbblubb: https://www.mail-archive.com/aur-requests@archlinux.org/msg21705.html

blubbblubb commented on 2018-01-18 20:54

Does anyone know what happened to the binfmt-support package?

TioDuke commented on 2017-06-14 11:14

@Synchronicity: Could you point me to the debian package you are refering to? I cannot find it. Thank you.

TioDuke commented on 2017-06-14 11:09

@ajs124: This package will be updated whenever Debian will release the new package. And as of renaming it to "-bin", feel free to do it in your _own_ system whenever you build it. It is a free world (at least it is here).

ajs124 commented on 2017-06-14 10:46

Why is this not marked as "-bin" if it is in fact a binary package and not compiled from sources.

Or rather, why is this a binary package in the first place?

Synchronicity commented on 2017-05-29 22:28

Detecting ppc binaries is broken. The magic and mask used for qemu-ppc in this package requires that the 8th byte of the ELF header (e_ident[EI_OSABI]) be 0x00. But sometimes it is different.

It seems this was already addressed in the Debian package, which uses a mask of 0xfc instead of 0xff for that byte.

Can the magics and masks for all the binfmts in this package be updated to match the Debian package?

adlerweb commented on 2017-04-25 20:14

Source is 404ed, current Debian package is http://ftp.debian.org/debian/pool/main/q/qemu/qemu-user-static_2.8+dfsg-4+b1_i386.deb

TioDuke commented on 2017-02-10 02:51

All you need to do is start/enable binfmt-support systemd service, which executes "/usr/bin/update-binfmts --enable", and you are all set up.

The "update-binfmts --importdir /usr/share/binfmts/ --import" command is for converting from the format normally under /usr/share/binfmts/ to the "right" format which goes under /usr/lib/binfmts.

Enjoy!

SandAngel commented on 2017-02-10 01:58

same problem here. When I run #update-binfmts --importdir /var/lib/binfmts/ --import, it showed the errors like @jhlink has posted.

TioDuke commented on 2017-02-09 02:09

@jhlink

I really don't know what you are talking about. If you check the systemd service file in binfmt-support, it issues the following command on start: /usr/bin/update-binfmts --enable

I have just run it myself and I've got no warnings and when I do a "ls /proc/sys/fs/binfmt_misc" I am able to see all the architectures registered there.

What is the command that you are using?

jhlink commented on 2017-02-07 18:02

Hello everyone!

I'm still having this problem that @maleadt was describing.

Using binfmt-support, I'm getting these warning messages and exiting.
Is there a certain format standard that these qemu-* files must adhere to for binfmt-support?

update-binfmts: warning: /var/lib/binfmts/qemu-sparc64: required 'package' line missing
update-binfmts: warning: /var/lib/binfmts/qemu-sparc32plus: required 'package' line missing
update-binfmts: warning: /var/lib/binfmts/qemu-sparc: required 'package' line missing
update-binfmts: warning: /var/lib/binfmts/qemu-sh4eb: required 'package' line missing
update-binfmts: warning: /var/lib/binfmts/qemu-sh4: required 'package' line missing
update-binfmts: warning: /var/lib/binfmts/qemu-s390x: required 'package' line missing
update-binfmts: warning: /var/lib/binfmts/qemu-ppc64abi32: required 'package' line missing
update-binfmts: warning: /var/lib/binfmts/qemu-ppc64: required 'package' line missing
update-binfmts: warning: /var/lib/binfmts/qemu-ppc: required 'package' line missing
update-binfmts: warning: /var/lib/binfmts/qemu-mipsel: required 'package' line missing
update-binfmts: warning: /var/lib/binfmts/qemu-mips: required 'package' line missing
update-binfmts: warning: /var/lib/binfmts/qemu-microblaze: required 'package' line missing
update-binfmts: warning: /var/lib/binfmts/qemu-m68k: required 'package' line missing
update-binfmts: warning: /var/lib/binfmts/qemu-cris: required 'package' line missing
update-binfmts: warning: /var/lib/binfmts/qemu-armeb: required 'package' line missing
update-binfmts: warning: /var/lib/binfmts/qemu-arm: required 'package' line missing
update-binfmts: warning: /var/lib/binfmts/qemu-alpha: required 'package' line missing
update-binfmts: warning: /var/lib/binfmts/qemu-aarch64: required 'package' line missing
update-binfmts: exiting due to previous errors


Thanks a lot!

acssilva commented on 2016-11-12 05:22

Naming scheme changed.

In order to make it work:
-_debsrc=${pkgname}_${pkgver}+dfsg-3_${_arch}.deb
-sha1sums=('1ed56046786a7a722289ad83b0f77874a9c605e6')
-[ "$CARCH" = 'i686' ] && sha1sums=('709f0949cf4e07060a9239998e88d4165a3b087f')

+_debsrc=${pkgname}_${pkgver}+dfsg-3+b1_${_arch}.deb
+md5sums=('c28ff4f2e1270335a72f38896e546717')

gdamjan commented on 2016-06-04 11:05

what are the files in /var/lib/binfmts/ ?
are they used by something in ArchLinux?

TioDuke commented on 2016-02-24 02:35

I finally created a script that will (hopefully) tell me whenever a new version is available, so updates should be coming sooner from now on. That been said, I still count on your help to give me a heads up if an update is available and the package is not updated (the script could be wrong or debian changed its naming scheme). Thank you.

TioDuke commented on 2016-02-20 12:38

@greyltc: please read my reaply on 2015-10-24 09:49

If you want to contribute, please contribute a script that tells me whenver a new version is available on Debian's servers : it would be highly appreciated.

greyltc commented on 2016-02-18 12:05

This package should have the -bin suffix. It's just unpacking a .deb, not actually building anything.

netidjeg commented on 2016-01-30 16:53

Looks like new/updated version, if I understand their numbering scheme correctly. (It sure doesn't lend itself much to automated/scripted checking very easily.)

-_debsrc=${pkgname}_${pkgver}+dfsg-3_${_arch}.deb
+_debsrc=${pkgname}_${pkgver}+dfsg-5_${_arch}.deb

-sha1sums=('9d2ad8848c4135e5443a400917e29363cfd822ba')
+sha1sums=('2a71f280c899dc2fc6702289c3f3453ae8e3f81b')

Swizz commented on 2016-01-14 18:15

The sources download raise a 404.

Use :
9d2ad8848c4135e5443a400917e29363cfd822ba qemu-user-static_2.5+dfsg-3_amd64.deb

bricewge commented on 2015-12-07 21:00

The sources changed. Here is a working PKGBUILD: https://gist.github.com/bricewge/1e404c293cb902e2a9b0

maleadt commented on 2015-11-21 13:34

Using this package with binfmt-support from AUR I'm getting:

update-binfmts: warning: /var/lib/binfmts/qemu-m68k: required 'package' line missing

Am I doing something wrong?

TioDuke commented on 2015-10-24 09:49

Package has been updated to latest debian

I really appreciate when you comment or flag the package out-of-date, so that I can update it properly. What I won't tolerate, is people complaining that the package is bad maintained: if you need to build it in a hurry and you can't wait for me to update, then modify it yourself before doing a makepkg (and if you are using an aur helper, bad luck; you need to undertand that makepkg is the supported Arch way).

michix5d commented on 2015-10-17 15:49

Flagged out of date. Needs new wget URL:
http://ftp.debian.org/debian/pool/main/q/qemu/qemu-user-static_2.4+dfsg-4_amd64.deb

mdl commented on 2015-09-22 05:46

This package currently can't be built because the file on the Debian mirror specified in the PKGBUILD is no longer present; it needs to be changed to "qemu-user-static_2.4+dfsg-3_amd64.deb".

mdl commented on 2015-09-19 07:33

PKGBUILD needs updating again, as qemu-user-static_2.4+dfsg-1a_amd64.deb is no longer on the Debian mirror. The latest package is now qemu-user-static_2.4+dfsg-3_amd64.deb.

jjanzic commented on 2015-09-08 20:20

There's 2.4 out: http://pastebin.com/5DAhLC61

kalsan commented on 2015-07-26 14:24

I'm getting a 404 when installing this. The PKGBUILD from http://pastebin.com/d9swBvqr appears to be working.

vinadoros commented on 2015-07-01 11:09

Hmm, I actually was getting this same error about the "package" line not being found right up until yesterday. I updated the binfmts-support package (there was no version change for it, but my AUR helper seemed to think it wanted an upgrade). After that, it started working with the modified change in this qemu-user-static PKGBUILD. Perhaps that needs an update or something. I don't know why it started working either (I didn't change the qemu-user-static package in any way, and I am using the new format).

DiegoAscanio commented on 2015-06-30 23:17

Sorry, I'm trying to compile yaourt, with makepkg and i'm not reaching it

DiegoAscanio commented on 2015-06-30 23:14

vinadoros, what you proposed does not works with update-binfmt, at least at the most recent version of qemu-user-static package, on debian repo.

when I tried to:
#update-binfmt --importdir /var/lib/binfmts --import

a warning came up saying that the required 'package' line was not found and update-binfmt exited dues to previous errors

I got it working with the old lines in PKGBUILD and using version 6a from debian repository.

Now I'm trying to cross compile makepkg, but it keeps stalling and seg faulting.

Sorry for the poor english.

vinadoros commented on 2015-06-27 17:46

Actually the link to qemu-user-static_2.3+dfsg-5 is also out of date (is now 6a). These lines should work in place of the existing lines:

_debsrc=${pkgname}_${pkgver}+dfsg-6a_${_arch}.deb
source=(http://ftp.debian.org/debian/pool/main/q/qemu/${_debsrc})
sha1sums=('aab940002044c9543a8aaf4502622b03fd06e153')
[ "$CARCH" = 'i686' ] && sha1sums=('51eaaca22d6ccf969623453190cffa62c79de480')

vinadoros commented on 2015-06-22 15:26

Hmm, the binary translation (in /var/lib/binfmts) doesn't seem to work properly when using update-binfmts. I think I know why. It seems the format of the files in /var/lib/binfmts have changed in the debian packages, and this has not been updated in this PKGBUILD. The solution I have tested is to replace these lines in the PKGBUILD:

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

With these lines:

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

yes

EOF
done
}

I have tested this PKGBUILD with the qemu-arm binary translation (by chrooting into a debain armhf chroot), and it seems to now be working. Here is a pastebin for the full working PKGBUILD:

http://pastebin.com/d9swBvqr

Can we get an update to this pkg? I have flagged it out of date to get some attention. Thanks.

benob commented on 2015-01-28 20:01

Update to 2.2
http://pastebin.com/6fqs9Yca

rains commented on 2015-01-28 08:45

there is a 'binfmt-support friendly' qemu-user-static PKGBUILD:
% 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:38

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
}

XenGi commented on 2014-12-28 20:36

Changed again. here is a patch:

15c15
< _debsrc=${pkgname}_${pkgver}+dfsg-2_${_arch}.deb
---
> _debsrc=${pkgname}_${pkgver}+dfsg-11_${_arch}.deb
17,18c17,18
< sha1sums=('16afb8a1853c535ed27e9292d5c57110657c8145')
< [ "$CARCH" = 'i686' ] && sha1sums=('b9d74a745e09fa7188a9c27e710ced87f5888224')
---
> sha1sums=('805f000c1826db83960ed2835c0d6380fb82de3e')
> [ "$CARCH" = 'i686' ] && sha1sums=('f349df1be10439d8f85f5da1464da1938ef5e9df')

BuddyLuvve commented on 2014-12-07 19:14

Changed again...

${pkgname}_${pkgver}+dfsg-9_${_arch}.deb

qwazerty commented on 2014-11-18 20:58

And debsrc updated again.

_debsrc=${pkgname}_${pkgver}+dfsg-7+b1_${_arch}.deb

codestation commented on 2014-10-26 14:27

The name changed again, now is:

${pkgname}_${pkgver}+dfsg-5+b1_${_arch}.deb

kevinb commented on 2014-09-29 04:52

debian package must have been removed servers. Here is an updated PKGBUILD with the newest version.

http://pastebin.com/irJGmUk6

ryad.eldajani commented on 2014-09-10 15:37

I needed to make some tiny modifications to this PKGBUILD to get it working: http://pastebin.com/raw.php?i=9xE8ssDG

TioDuke commented on 2014-08-18 12:26

Thank you tycho. I tried (ab)using update-binfmts to no avail. Then, I took your script (with little modifications).

I am satisfied with doing it this way (there shouldn't be much of a high-maintenance as these magic/mask string don't change much, or ever).

tycho commented on 2014-08-18 10:58

Here's what I came up with. It's a bit high-maintenance for my liking, but it should work...

http://git.uplinklabs.net/snoonan/projects/archlinux/ec2/ec2-packages.git/tree/qemu-user-static/PKGBUILD?id=3bece4db7ef0e3bbdc3c4258545291227c2b1c83

tycho commented on 2014-08-18 09:48

Or more accurately, it abuses update-binfmts. There will need to be some hackery to mutate the postinst into something useful.

tycho commented on 2014-08-18 09:45

See the 'postinst' script in the control tarball. It generates the binfmts.

TioDuke commented on 2014-08-08 22:18

I have tried to update the package to version 2.1, but unfortunately there is no trace of the binfmt files. Until I found a solution, I am not planning to update the package.

@pngochai: If you know where to find the binfmt files, feel free to point me in the right direction. I have already searched inside most of the qemu-* packages from Debian (including qemu-binfmt), to no avail.

pngochai commented on 2014-08-08 21:53

Version 2.1 PKGBUILD
===============================
# Maintainer: Sergio Tridente <tioduke at gmail dot com >

pkgname=qemu-user-static
pkgver=2.1
pkgrel=1
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-2_${_arch}.deb
source=(http://ftp.debian.org/debian/pool/main/q/qemu/${_debsrc})
sha1sums=('16afb8a1853c535ed27e9292d5c57110657c8145')
[ "$CARCH" = 'i686' ] && sha1sums=('b9d74a745e09fa7188a9c27e710ced87f5888224')

build() {
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/

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

TioDuke commented on 2014-06-01 09:37

Uptdated t0 version 2.0.0

Thank you XenGi

XenGi commented on 2014-05-31 19:49

Here is a updated PKGBUILD for version 2.0.0 from debian repos. I don't trust canonical with this.

https://gist.github.com/XenGi/bfb305176b6bb22313a2

XenGi commented on 2014-05-31 19:48

Here is a updated PKGBUILD for version 2.0.0 from debian repos. I don't trust canonical with this.

# Maintainer: Sergio Tridente <tioduke at gmail dot com >

pkgname=qemu-user-static
pkgver=2.0.0
pkgrel=1
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-4~bpo70+1_${_arch}.deb
source=(http://ftp.debian.org/debian/pool/main/q/qemu/${_debsrc})
sha1sums=('24d2f29bd438f1e3fe9a881f6e3dcc3916bc5665')
[ "$CARCH" = 'i686' ] && sha1sums=('cbffd52b79d802db52417e40886f562636f7ac24')

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

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

cp "$srcdir"/usr/bin/* "$pkgdir"/usr/bin/
cp "$srcdir"/usr/share/man/man1 "$pkgdir"/usr/share/man/ -r
cp "$srcdir"/usr/share/binfmts "$pkgdir"/var/lib/ -r
}

erholst commented on 2014-04-04 05:56

Changed again.
with yaourt i choose to Edit PKGBUILD to change this line:
from:
source=(http://mirrors.us.kernel.org/ubuntu/pool/universe/q/qemu/${_debsrc})
to:
source=(http://launchpadlibrarian.net/163116292/${_debsrc})

erholst commented on 2014-04-04 05:53

Changed again.
with yaourt i choose to Edit PKGBUILD to change this line:
cahnge from:
source=(http://mirrors.us.kernel.org/ubuntu/pool/universe/q/qemu/${_debsrc})
to:
source=(http://launchpadlibrarian.net/163116292/${_debsrc})

danwood76 commented on 2014-02-26 09:36

And again:

_debsrc=${pkgname}_${pkgver}+dfsg-3ubuntu3_${_arch}.deb

[ "$CARCH" = 'x86_64' ] && sha1sums=('739422db29e2806e5606592def2142f8209306c2')

gdw commented on 2014-02-14 03:49

Changed again:

_debsrc=${pkgname}_${pkgver}+dfsg-3ubuntu2_${_arch}.deb
[ "$CARCH" = 'x86_64' ] && sha1sums=('0c4e55227c53c21fc8119bdc75fe6d179bd8fc10')

WarheadsSE commented on 2014-02-07 15:57

And it has changed again.

http://mirrors.us.kernel.org/ubuntu/pool/universe/q/qemu/qemu-user-static_1.7.0+dfsg-3ubuntu1_amd64.deb

22ed410ad34be30cb4c5ab900428c416f21df4a3 qemu-user-static_1.7.0+dfsg-3ubuntu1_amd64.deb

OrdinaryMagician commented on 2014-01-29 12:42

file changed again, should now be "${pkgname}_${pkgver}+dfsg-2ubuntu9_${_arch}.deb"

sehraf commented on 2014-01-24 22:31

the file (name) has changed: qemu-user-static_1.7.0+dfsg-2ubuntu3_*arch*.deb doesn't exists anymore (it's qemu-user-static_1.7.0+dfsg-2ubuntu7_*arch*.deb now)

lvzongting commented on 2013-11-22 19:36

http://mirrors.us.kernel.org/ubuntu/pool/universe/q/qemu/qemu-user-static_1.6.0+dfsg-2ubuntu2_i386.deb

contant new structer mips64el mips64

please update PKGBUILD

- pkgver=1.4.0
+ pkgver=1.6.0

- _debsrc=${pkgname}_${pkgver}+dfsg-1expubuntu4_${_arch}.deb
+ _debsrc=${pkgname}_${pkgver}+dfsg-2ubuntu2_${_arch}.deb

- sha1sums=('826a66ad57ba1a51c8b0cdd2020f0c0e471ac3f3')
+ sha1sums=('c6e9d9d917f631608ece0fddc4d12a81b2ff69f7')

sergej commented on 2013-10-11 20:07

I've made
https://aur.archlinux.org/packages/qemu-static/
which builds qemu-*-static from sources.

Probably these packages should be merged.

TioDuke commented on 2013-07-21 03:38

@rustam: Done.

rustam commented on 2013-07-08 14:29

Can you pls add the contents of /usr/share/binfmts/ to the package and add aur/binfmt-support as either depends or optdepends to allow handling foreign ELF binaries and executing them via qemu?