diff options
Diffstat (limited to 'libre')
-rw-r--r-- | libre/qemu-user-static/PKGBUILD | 163 | ||||
-rw-r--r-- | libre/qemu-user-static/allow_elf64.patch | 25 |
2 files changed, 82 insertions, 106 deletions
diff --git a/libre/qemu-user-static/PKGBUILD b/libre/qemu-user-static/PKGBUILD index 5195ec1b9..56e51c5f2 100644 --- a/libre/qemu-user-static/PKGBUILD +++ b/libre/qemu-user-static/PKGBUILD @@ -1,7 +1,8 @@ -# Maintainer (Arch:qemu): Tobias Powalowski <tpowa@archlinux.org> -# Contributor (Arch:qemu): Sébastien "Seblu" Luttringer <seblu@seblu.net> +# Maintainer (aur): crab2313 <crab2313@gmail.com> +# Contributor: Stefan Agner <stefan@agner.ch> # Maintainer: Luke Shumaker <lukeshu@parabola.nu> # Contributor: Márcio Silva <coadde@hyperbola.info> +# Contributor: bill-auger <bill-auger@programmer.net> # "Do I need to rebuild?" : A flowchart # @@ -16,23 +17,19 @@ # `----> zlib ------------------' # 1:1.2.11-2 -_pkgbase=qemu +pkgbase=qemu-user-static pkgname=(qemu-user-static qemu-user-static-binfmt) -pkgdesc="A generic and open source machine emulator and virtualizer" -pkgver=3.1.0 +pkgdesc="Statically linked binaries of Qemu with user emulation. Useful for containers/chroot environment with binfmt." +pkgver=7.0.0 pkgrel=1 -pkgrel+=.static1 -arch=(x86_64) -arch+=(i686 armv7h) +arch=(armv7h i686 x86_64) license=(GPL2 LGPL2.1) url="http://wiki.qemu.org/" depends=() -makedepends=(pixman-static python glib2-static pcre-static) -source=(https://download.qemu.org/qemu-$pkgver.tar.xz{,.sig} - allow_elf64.patch) -sha512sums=('7e8dae823937cfac2f0c60406bd3bdcb89df40313dab2a4bed327d5198f7fcc68ac8b31e44692caa09299cc71256ee0b8c17e4f49f78ada8043d424f5daf82fe' - 'SKIP' - 'b450625ff1e705f8c7eed9e2c0c4fe2179ca061df88a1a777c861c11d543c151cd0160f7f7227babdfe8b36000de084cbcb6fd7bf0f93d2f936c2e65082c82bf') +makedepends=(python meson glib2-static pcre-static) +source=(https://download.qemu.org/qemu-$pkgver.tar.xz{,.sig}) +sha512sums=('44ecd10c018a3763e1bc87d1d35b98890d0d5636acd69fe9b5cadf5024d5af6a31684d60cbe1c3370e02986434c1fb0ad99224e0e6f6fe7eda169992508157b1' + 'SKIP') validpgpkeys=('CEACC9E15534EBABB82D3FA03353C9CEF108B584') case $CARCH in @@ -40,99 +37,103 @@ case $CARCH in x86_64) _corearch=x86_64 ;; esac -prepare() { - mkdir build-static - mkdir -p extra-arch-static/usr/{bin,share/qemu} +# If non empty, always run the configure script +: "${FORCE_CONFIGURE:=1}" - cd ${_pkgbase}-${pkgver} - sed -i 's/vte-2\.90/vte-2.91/g' configure +prepare() { + mkdir -p build-user-static - patch -p1 < ../allow_elf64.patch + cd qemu-${pkgver} + #sed -i 's/vte-2\.90/vte-2.91/g' configure } -build() { - local flags=( - --static - --disable-system # disable building qemu-system-$CPU, we only want qemu-$CPU - --enable-linux-user - --disable-modules - --disable-guest-agent # disable building qemu-ga - --disable-guest-agent-msi - --disable-tools # disable building the qemu-{io,nbd,img} tools - --disable-blobs # disable installing firmware files used by system - --disable-docs - - # jemalloc-static isn't packaged - --disable-jemalloc - - # These libraries are only used for system or tools, but even - # though that's disabled, libqemuutil.a still tries to link - # against them unless we specifically tell it not to (the linkage - # would be removed at the final linker's tree-shaking). - --disable-gcrypt - --disable-nettle - ) - _build static "${flags[@]}" \ - --audio-drv-list= \ - --disable-bluez \ - --disable-sdl \ - --disable-gtk \ - --disable-vte \ - --disable-opengl \ - --disable-virglrenderer +_configure() { + local libre_opts=( + --disable-blobs # disable installing firmware files used by system + ) + + ../qemu-${pkgver}/configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --libexecdir=/usr/lib/qemu \ + --enable-linux-user \ + --disable-debug-info \ + --disable-bsd-user \ + --disable-werror \ + --disable-system \ + --disable-tools \ + --disable-docs \ + --disable-gtk \ + --disable-gnutls \ + --disable-nettle \ + --disable-gcrypt \ + --disable-glusterfs \ + --disable-libnfs \ + --disable-libiscsi \ + --disable-vnc \ + --disable-kvm \ + --disable-libssh \ + --disable-vde \ + --disable-sdl \ + --disable-opengl \ + --disable-xen \ + --disable-fdt \ + --disable-vhost-net \ + --disable-vhost-crypto \ + --disable-vhost-user \ + --disable-vhost-vsock \ + --disable-vhost-scsi \ + --disable-tpm \ + --disable-qom-cast-debug \ + --disable-capstone \ + --disable-zstd \ + --disable-linux-io-uring \ + --disable-bpf \ + ${libre_opts[*]} \ + --static } -_build() ( - cd build-$1 - - # qemu vs. make 4 == bad - export ARFLAGS=rv - - # http://permalink.gmane.org/gmane.comp.emulators.qemu/238740 - export CFLAGS+=" -fPIC" - - ../${_pkgbase}-${pkgver}/configure \ - --prefix=/usr \ - --sysconfdir=/etc \ - --localstatedir=/var \ - --libexecdir=/usr/lib/qemu \ - --python=/usr/bin/python3 \ - --smbd=/usr/bin/smbd \ - --with-sdlabi=2.0 \ - --enable-modules \ - --enable-jemalloc \ - "${@:2}" - - make V=1 +build() ( + cd build-user-static + [[ ! $FORCE_CONFIGURE && -e ../qemu-${pkgver}/config.log ]] || _configure + make ARFLAGS="rc" ) package_qemu-user-static() { pkgdesc="QEMU user-mode emulation (static binaries)" + options=(!strip) - make -C build-static DESTDIR="$pkgdir" install "${@:2}" + make -C build-user-static DESTDIR="$pkgdir" install "${@:2}" - rm -fvr -- "$pkgdir"/{var,usr/lib,usr/share} + # remove conflicting /var/run directory + cd "$pkgdir" + rm -rf var - local prog - for prog in "$pkgdir"/usr/bin/*; do - mv -vnT -- "$prog" "${prog%-static}-static" + # Remove BIOS files etc... + rm -rf usr/share + + # Rename static qemu binaries + cd "${pkgdir}/usr/bin/" + tidy_strip + ls -1 | while read f; do + mv "$f" "$f-static" done } package_qemu-user-static-binfmt() { pkgdesc="binfmt registration for QEMU user-mode emulation" depends=("qemu-user-static=$pkgver") + conflicts=(qemu-user) - cd ${_pkgbase}-${pkgver} + cd build-user-static install -d "$pkgdir"/usr/lib/binfmt.d ./scripts/qemu-binfmt-conf.sh \ --qemu-path /usr/bin \ + --qemu-suffix -static \ --systemd ALL \ --exportdir "$pkgdir"/usr/lib/binfmt.d \ --credential yes - - # add the "-static" suffix - sed -i 's/:[^:]*$/-static&/' -- "$pkgdir"/usr/lib/binfmt.d/*.conf } diff --git a/libre/qemu-user-static/allow_elf64.patch b/libre/qemu-user-static/allow_elf64.patch deleted file mode 100644 index 0c5f6917c..000000000 --- a/libre/qemu-user-static/allow_elf64.patch +++ /dev/null @@ -1,25 +0,0 @@ -commit cb61bc8a42da1a971079767e63df4503b6ab2efb -Author: Anatol Pomozov <anatol.pomozov@gmail.com> -Date: Mon Jan 29 10:08:53 2018 -0800 - - multiboot: Make elf64 loading functionality compatible with GRUB - - GRUB is a reference multiboot implementation and supports loading elf64 - binaries. Make QEMU to work similar was as GRUB. - -diff --git a/hw/i386/multiboot.c b/hw/i386/multiboot.c -index 5bc0a2cddb..0907e42a39 100644 ---- a/hw/i386/multiboot.c -+++ b/hw/i386/multiboot.c -@@ -193,11 +193,6 @@ int load_multiboot(FWCfgState *fw_cfg, - int kernel_size; - fclose(f); - -- if (((struct elf64_hdr*)header)->e_machine == EM_X86_64) { -- error_report("Cannot load x86-64 image, give a 32bit one."); -- exit(1); -- } -- - kernel_size = load_elf(kernel_filename, NULL, NULL, &elf_entry, - &elf_low, &elf_high, 0, I386_ELF_MACHINE, - 0, 0); |