summaryrefslogtreecommitdiff
path: root/binfmt-qemu-static-all-arch
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2020-09-04 12:44:08 +0200
committerErich Eckner <git@eckner.net>2020-09-04 12:44:08 +0200
commit209abe1905c487c1eac532b1e02ef1a43ad9d66e (patch)
treef8e1219bd2b795f451d345c8172e196bbc59229d /binfmt-qemu-static-all-arch
parent7ab6c56ab5e32ffe6f6297e1e7409744cea990b4 (diff)
downloadarchlinuxewe-209abe1905c487c1eac532b1e02ef1a43ad9d66e.tar.xz
binfmt-qemu-static-all-arch new
Diffstat (limited to 'binfmt-qemu-static-all-arch')
-rw-r--r--binfmt-qemu-static-all-arch/.gitignore1
-rw-r--r--binfmt-qemu-static-all-arch/PKGBUILD36
2 files changed, 37 insertions, 0 deletions
diff --git a/binfmt-qemu-static-all-arch/.gitignore b/binfmt-qemu-static-all-arch/.gitignore
new file mode 100644
index 000000000..14fccf2de
--- /dev/null
+++ b/binfmt-qemu-static-all-arch/.gitignore
@@ -0,0 +1 @@
+qemu-binfmt-conf-*.sh
diff --git a/binfmt-qemu-static-all-arch/PKGBUILD b/binfmt-qemu-static-all-arch/PKGBUILD
new file mode 100644
index 000000000..9d61c0a20
--- /dev/null
+++ b/binfmt-qemu-static-all-arch/PKGBUILD
@@ -0,0 +1,36 @@
+# Maintainer: Erich Eckner <arch at eckner dot net>
+# Contributor: Michael Taboada <michael@2mb.solutions>
+
+pkgname=binfmt-qemu-static-all-arch
+pkgver=20200413
+pkgrel=1
+pkgdesc="Register qemu-static interpreters for various binary formats - all archetectures, intelligently removing the current archetecture"
+arch=('armv5' 'armv6h' 'armv7h' 'aarch64' 'i686' 'x86_64')
+url="http://www.freedesktop.org/software/systemd/man/binfmt.d.html"
+license=('GPL')
+optdepends=('qemu-user-static')
+provides=('binfmt-qemu-static')
+conflicts=('binfmt-qemu-static')
+source=("qemu-binfmt-conf-$pkgver.sh::https://raw.githubusercontent.com/qemu/qemu/master/scripts/qemu-binfmt-conf.sh")
+sha512sums=('01d6b5d9e571b78e1def3217ba47498b790f6d72eb55eab31a68184fa9f0e5661ac6014672d39d4e065a4d8678a44f0b31a70eb17ea397bddb8353fd392af8f5')
+
+build() {
+ mkdir build
+ chmod +x "qemu-binfmt-conf-$pkgver.sh"
+ HOST_ARCH="$CARCH" "./qemu-binfmt-conf-$pkgver.sh" --systemd ALL --exportdir "$srcdir/build" --qemu-path /usr/bin --qemu-suffix -static
+ cat build/* \
+ | sed 's/$/CF/' \
+ > qemu-static.conf
+}
+
+package() {
+ install -Dm 644 "$srcdir/qemu-static.conf" "$pkgdir/usr/lib/binfmt.d/qemu-static.conf"
+ case $CARCH in
+ arm* | aarch64) sed -i "/qemu-arm/d" "$pkgdir/usr/lib/binfmt.d/qemu-static.conf" ;&
+ aarch64) sed -i "/qemu-aarch64/d" "$pkgdir/usr/lib/binfmt.d/qemu-static.conf" ;;
+ i686 | x86_64) sed -i "/qemu-i386/d" "$pkgdir/usr/lib/binfmt.d/qemu-static.conf" ; sed -i "/qemu-x86_64/d" "$pkgdir/usr/lib/binfmt.d/qemu-static.conf" ;;
+ *) sed -i "/$CARCH/d" "$pkgdir/usr/lib/binfmt.d/qemu-static.conf" ;;
+ esac
+}
+
+# vim:set ts=2 sw=2 et: