[packages/qemu] - binfmt definitions for foreign qemu-lated binaries (from qemu-kvm package)

baggins baggins at pld-linux.org
Sun Nov 3 21:30:12 CET 2013


commit a78c56720658f60193c5103892b1f438783b4611
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Sun Nov 3 21:15:18 2013 +0100

    - binfmt definitions for foreign qemu-lated binaries (from qemu-kvm package)

 qemu.binfmt |  6 ++++++
 qemu.spec   | 29 +++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+)
---
diff --git a/qemu.spec b/qemu.spec
index 3bca68a..526e4a7 100644
--- a/qemu.spec
+++ b/qemu.spec
@@ -23,6 +23,7 @@ License:	GPL v2+
 Group:		Applications/Emulators
 Source0:	http://wiki.qemu-project.org/download/%{name}-%{version}.tar.bz2
 # Source0-md5:	3a897d722457c5a895cd6ac79a28fda0
+Source2:	qemu.binfmt
 # Loads kvm kernel modules at boot
 Source3:	kvm-modules-load.conf
 # Creates /dev/kvm
@@ -675,6 +676,27 @@ install -p %{SOURCE10} $RPM_BUILD_ROOT%{_sysconfdir}/ksmtuned.conf
 install -p %{SOURCE11} $RPM_BUILD_ROOT%{systemdunitdir}
 install -p %{SOURCE12} $RPM_BUILD_ROOT%{_sysconfdir}/udev/rules.d
 
+for i in dummy \
+%ifnarch %{ix86} %{x8664}
+    qemu-i386 \
+%endif
+%ifnarch arm
+    qemu-arm \
+%endif
+%ifnarch ppc ppc64
+    qemu-ppc \
+%endif
+%ifnarch sparc sparc64
+    qemu-sparc \
+%endif
+%ifnarch sh4
+    qemu-sh4 \
+%endif
+; do
+	test $i = dummy && continue
+	grep /$i:\$ %{SOURCE2} > $RPM_BUILD_ROOT/usr/lib/binfmt.d/$i.conf
+done < %{SOURCE2}
+
 # already packaged
 %{__rm} $RPM_BUILD_ROOT%{_docdir}/qemu/qemu-{doc,tech}.html
 %{__rm} $RPM_BUILD_ROOT%{_docdir}/qemu/qmp-commands.txt
@@ -712,6 +734,12 @@ fi
 %systemd_trigger ksm.service
 %systemd_trigger ksmtuned.service
 
+%post user
+%systemd_service_restart systemd-binfmt.service
+
+%postun user
+%systemd_service_restart systemd-binfmt.service
+
 %post guest-agent
 %systemd_reload
 
@@ -764,6 +792,7 @@ fi
 
 %files user
 %defattr(644,root,root,755)
+/usr/lib/binfmt.d/qemu-*.conf
 %attr(755,root,root) %{_bindir}/qemu-alpha
 %attr(755,root,root) %{_bindir}/qemu-arm
 %attr(755,root,root) %{_bindir}/qemu-armeb
diff --git a/qemu.binfmt b/qemu.binfmt
new file mode 100644
index 0000000..9078b60
--- /dev/null
+++ b/qemu.binfmt
@@ -0,0 +1,6 @@
+:qemu-i386:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfa\xff\xff\xff:/usr/bin/qemu-i386:
+:qemu-i486:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x06\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfa\xff\xff\xff:/usr/bin/qemu-i386:
+:qemu-arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfa\xff\xff\xff:/usr/bin/qemu-arm:
+:qemu-ppc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfa\xff\xff\xff:/usr/bin/qemu-ppc:
+:qemu-sparc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfa\xff\xff\xff:/usr/bin/qemu-sparc:
+:qemu-sh4:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfa\xff\xff\xff:/usr/bin/qemu-sh4:
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/qemu.git/commitdiff/18e669280f9110eed077132bcbd5a37101cc89bf



More information about the pld-cvs-commit mailing list