qemu-user-static: fix binfmt generation on cross

This commit is contained in:
classabbyamp 2024-07-25 01:58:02 -04:00
parent 44b4bc44cb
commit 00346cb2b4
No known key found for this signature in database
GPG Key ID: 6BE0755918A4C7F5
1 changed files with 12 additions and 2 deletions

View File

@ -2,7 +2,7 @@
# This package should be updated together with qemu
pkgname=qemu-user-static
version=9.0.2
revision=1
revision=2
build_style=configure
configure_args="--prefix=/usr --sysconfdir=/etc --libexecdir=/usr/libexec
--disable-kvm --disable-png --disable-virtfs --disable-fdt --disable-seccomp
@ -28,6 +28,16 @@ case "$XBPS_TARGET_MACHINE" in
ppc64*) _omit+=(ppc) ;;
esac
case "$XBPS_TARGET_MACHINE" in
x86_64*|i686*) _host_arch="i386" ;;
mips*) _host_arch="mips" ;;
ppc*le) _host_arch="ppcle" ;;
ppc*) _host_arch="ppc" ;;
arm*|aarch64*) _host_arch="arm" ;;
riscv*) _host_arch="riscv" ;;
*) _host_arch="${XBPS_TARGET_MACHINE%-musl}" ;;
esac
post_install() {
# Remove unneeded stuff.
rm -rf ${DESTDIR}/etc ${DESTDIR}/usr/share ${DESTDIR}/usr/libexec
@ -39,7 +49,7 @@ post_install() {
done
vmkdir usr/share/binfmts
scripts/qemu-binfmt-conf.sh --debian ALL --exportdir "${DESTDIR}"/usr/share/binfmts \
HOST_ARCH="$_host_arch" scripts/qemu-binfmt-conf.sh --debian --exportdir "${DESTDIR}"/usr/share/binfmts \
--qemu-path /usr/bin --preserve-argv0 yes --persistent yes --credential yes
for bf in "${DESTDIR}"/usr/share/binfmts/*; do
for ar in "${_omit[@]}"; do