summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorSaren Arterius2019-04-28 00:24:46 +0800
committerSaren Arterius2019-04-28 00:24:46 +0800
commit1612e9ff9cb21a980a1c8568232144ea169031f1 (patch)
tree347416895ad33ec0b9d6d330a0eeb9d195080673
downloadaur-1612e9ff9cb21a980a1c8568232144ea169031f1.tar.gz
first
-rw-r--r--.SRCINFO106
-rw-r--r--65-kvm.rules1
-rw-r--r--PKGBUILD224
-rw-r--r--qemu-ga.service9
-rw-r--r--qemu.install8
5 files changed, 348 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..22971202df2
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,106 @@
+pkgbase = qemu-pinning
+ pkgdesc = A generic and open source machine emulator and virtualizer. Patch from saveriomiroddi/qemu-pinning applied
+ pkgver = 4.0.0
+ pkgrel = 2
+ url = https://wiki.qemu.org/
+ arch = x86_64
+ license = GPL2
+ license = LGPL2.1
+ makedepends = spice-protocol
+ makedepends = python2
+ makedepends = ceph
+ makedepends = libiscsi
+ makedepends = glusterfs
+ makedepends = python-sphinx
+ depends = virglrenderer
+ depends = sdl2
+ depends = vte3
+ depends = libpulse
+ depends = seabios
+ depends = gnutls
+ depends = libpng
+ depends = libaio
+ depends = numactl
+ depends = jemalloc
+ depends = xfsprogs
+ depends = libnfs
+ depends = lzo
+ depends = snappy
+ depends = curl
+ depends = vde2
+ depends = libcap-ng
+ depends = spice
+ depends = libcacard
+ depends = usbredir
+ provides = qemu
+ source = https://download.qemu.org/qemu-4.0.0.tar.xz
+ source = https://download.qemu.org/qemu-4.0.0.tar.xz.sig
+ source = qemu-ga.service
+ source = 65-kvm.rules
+ source = https://github.com/saveriomiroddi/qemu-pinning/commit/f2fff5faee2b4723472d2a69520b77e23a609962.diff
+ validpgpkeys = CEACC9E15534EBABB82D3FA03353C9CEF108B584
+ sha512sums = 952e94194ce9e64c15388c59035cb31fb9f761d30095c2fb9441012b609c18c9976285727b93bf37b95e15675802d73f8e1c4619ebecd23606675bb503646b13
+ sha512sums = SKIP
+ sha512sums = 269c0f0bacbd06a3d817fde02dce26c99d9f55c9e3b74bb710bd7e5cdde7a66b904d2eb794c8a605bf9305e4e3dee261a6e7d4ec9d9134144754914039f176e4
+ sha512sums = bdf05f99407491e27a03aaf845b7cc8acfa2e0e59968236f10ffc905e5e3d5e8569df496fd71c887da2b5b8d1902494520c7da2d3a8258f7fd93a881dd610c99
+ sha512sums = 02b1425b0230106a544de9ced11f440ac41ef2048c06e569da9279309d137061629c94fa1eecba7191845a9b158d64b04039bfa66a2529ab8f7c335d485db6db
+
+pkgname = qemu-pinning
+ optdepends = qemu-arch-extra: extra architectures support
+ provides = qemu-headless
+ conflicts = qemu-headless
+ replaces = qemu-kvm
+
+pkgname = qemu-pinning-headless
+ pkgdesc = QEMU without GUI
+ depends = seabios
+ depends = gnutls
+ depends = libpng
+ depends = libaio
+ depends = numactl
+ depends = jemalloc
+ depends = xfsprogs
+ depends = libnfs
+ depends = lzo
+ depends = snappy
+ depends = curl
+ depends = vde2
+ depends = libcap-ng
+ depends = spice
+ depends = libcacard
+ depends = usbredir
+ optdepends = qemu-headless-arch-extra: extra architectures support
+
+pkgname = qemu-pinning-arch-extra
+ pkgdesc = QEMU for foreign architectures
+ depends = qemu
+ provides = qemu-headless-arch-extra
+ conflicts = qemu-headless-arch-extra
+ options = !strip
+
+pkgname = qemu-pinning-headless-arch-extra
+ pkgdesc = QEMU without GUI, for foreign architectures
+ depends = qemu-headless
+ options = !strip
+
+pkgname = qemu-pinning-block-iscsi
+ pkgdesc = QEMU iSCSI block module
+ depends = glib2
+ depends = libiscsi
+ depends = jemalloc
+
+pkgname = qemu-pinning-block-rbd
+ pkgdesc = QEMU RBD block module
+ depends = glib2
+ depends = ceph
+
+pkgname = qemu-pinning-block-gluster
+ pkgdesc = QEMU GlusterFS block module
+ depends = glib2
+ depends = glusterfs
+
+pkgname = qemu-pinning-guest-agent
+ pkgdesc = QEMU Guest Agent
+ depends = gcc-libs
+ depends = glib2
+
diff --git a/65-kvm.rules b/65-kvm.rules
new file mode 100644
index 00000000000..fbb0ebb69c9
--- /dev/null
+++ b/65-kvm.rules
@@ -0,0 +1 @@
+KERNEL=="vhost-net", GROUP="kvm", MODE="0660", TAG+="uaccess", OPTIONS+="static_node=vhost-net"
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..38eaa622fb2
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,224 @@
+# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
+# Contributor: S├ębastien "Seblu" Luttringer <seblu@seblu.net>
+
+pkgbase=qemu-pinning
+pkgname=(qemu-pinning qemu-pinning-headless qemu-pinning-arch-extra qemu-pinning-headless-arch-extra
+ qemu-pinning-block-{iscsi,rbd,gluster} qemu-pinning-guest-agent)
+_pkgname=qemu
+pkgdesc="A generic and open source machine emulator and virtualizer. Patch from saveriomiroddi/qemu-pinning applied"
+pkgver=4.0.0
+pkgrel=2
+arch=(x86_64)
+license=(GPL2 LGPL2.1)
+url="https://wiki.qemu.org/"
+_headlessdeps=(seabios gnutls libpng libaio numactl jemalloc xfsprogs libnfs
+ lzo snappy curl vde2 libcap-ng spice libcacard usbredir)
+provides=(qemu)
+depends=(virglrenderer sdl2 vte3 libpulse "${_headlessdeps[@]}")
+makedepends=(spice-protocol python2 ceph libiscsi glusterfs python-sphinx)
+source=(https://download.qemu.org/qemu-$pkgver.tar.xz{,.sig}
+ qemu-ga.service
+ 65-kvm.rules
+ https://github.com/saveriomiroddi/qemu-pinning/commit/f2fff5faee2b4723472d2a69520b77e23a609962.diff)
+sha512sums=('952e94194ce9e64c15388c59035cb31fb9f761d30095c2fb9441012b609c18c9976285727b93bf37b95e15675802d73f8e1c4619ebecd23606675bb503646b13'
+ 'SKIP'
+ '269c0f0bacbd06a3d817fde02dce26c99d9f55c9e3b74bb710bd7e5cdde7a66b904d2eb794c8a605bf9305e4e3dee261a6e7d4ec9d9134144754914039f176e4'
+ 'bdf05f99407491e27a03aaf845b7cc8acfa2e0e59968236f10ffc905e5e3d5e8569df496fd71c887da2b5b8d1902494520c7da2d3a8258f7fd93a881dd610c99'
+ '02b1425b0230106a544de9ced11f440ac41ef2048c06e569da9279309d137061629c94fa1eecba7191845a9b158d64b04039bfa66a2529ab8f7c335d485db6db')
+validpgpkeys=('CEACC9E15534EBABB82D3FA03353C9CEF108B584')
+
+case $CARCH in
+ i?86) _corearch=i386 ;;
+ x86_64) _corearch=x86_64 ;;
+esac
+
+prepare() {
+ mkdir -p build-{full,headless}
+ mkdir -p extra-arch-{full,headless}/usr/{bin,share/qemu}
+
+ cd ${_pkgname}-${pkgver}
+
+ patch -p1 < ../f2fff5faee2b4723472d2a69520b77e23a609962.diff
+
+ sed -i 's/vte-2\.90/vte-2.91/g' configure
+}
+
+build() {
+ _build full \
+ --audio-drv-list="pa alsa sdl"
+
+ _build headless \
+ --audio-drv-list= \
+ --disable-bluez \
+ --disable-sdl \
+ --disable-gtk \
+ --disable-vte \
+ --disable-opengl \
+ --disable-virglrenderer
+}
+
+_build() (
+ cd build-$1
+
+ # qemu vs. make 4 == bad
+ export ARFLAGS=rv
+
+ # http://permalink.gmane.org/gmane.comp.emulators.qemu/238740
+ export CFLAGS+=" -fPIC"
+
+ ../${_pkgname}-${pkgver}/configure \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --libexecdir=/usr/lib/qemu \
+ --python=/usr/bin/python2 \
+ --smbd=/usr/bin/smbd \
+ --enable-modules \
+ --enable-sdl \
+ --enable-jemalloc \
+ "${@:2}"
+
+ make
+)
+
+package_qemu-pinning() {
+ optdepends=('qemu-arch-extra: extra architectures support')
+ provides=(qemu-headless)
+ conflicts=(qemu-headless)
+ replaces=(qemu-kvm)
+
+ _package full
+}
+
+package_qemu-pinning-headless() {
+ pkgdesc="QEMU without GUI"
+ depends=("${_headlessdeps[@]}")
+ optdepends=('qemu-headless-arch-extra: extra architectures support')
+
+ _package headless
+}
+
+_package() {
+ optdepends+=('samba: SMB/CIFS server support'
+ 'qemu-block-iscsi: iSCSI block support'
+ 'qemu-block-rbd: RBD block support'
+ 'qemu-block-gluster: glusterfs block support')
+ install=qemu.install
+ options=(!strip)
+
+ make -C build-$1 DESTDIR="$pkgdir" install "${@:2}"
+
+ # systemd stuff
+ install -Dm644 65-kvm.rules "$pkgdir/usr/lib/udev/rules.d/65-kvm.rules"
+
+ # remove conflicting /var/run directory
+ cd "$pkgdir"
+ rm -r var
+
+ cd usr/lib
+ tidy_strip
+
+ # bridge_helper needs suid
+ # https://bugs.archlinux.org/task/32565
+ chmod u+s qemu/qemu-bridge-helper
+
+ # remove split block modules
+ rm qemu/block-{iscsi,rbd,gluster}.so
+
+ cd ../bin
+ tidy_strip
+
+ # remove extra arch
+ for _bin in qemu-*; do
+ [[ -f $_bin ]] || continue
+
+ case ${_bin#qemu-} in
+ # guest agent
+ ga) rm "$_bin"; continue ;;
+
+ # tools
+ img|io|nbd) continue ;;
+
+ # core emu
+ system-${_corearch}) continue ;;
+ esac
+
+ mv "$_bin" "$srcdir/extra-arch-$1/usr/bin"
+ done
+
+ cd ../share/qemu
+ for _blob in *; do
+ [[ -f $_blob ]] || continue
+
+ case $_blob in
+ # provided by seabios package
+ bios.bin|acpi-dsdt.aml|bios-256k.bin|vgabios-cirrus.bin|vgabios-qxl.bin|\
+ vgabios-stdvga.bin|vgabios-vmware.bin|vgabios-virtio.bin|vgabios-bochs-display.bin|\
+ vgabios-ramfb.bin) rm "$_blob"; continue ;;
+
+ # iPXE ROMs
+ efi-*|pxe-*) continue ;;
+
+ # core blobs
+ kvmvapic.bin|linuxboot*|multiboot.bin|sgabios.bin|vgabios*) continue ;;
+
+ # Trace events definitions
+ trace-events*) continue ;;
+
+ # Logos
+ *.bmp|*.svg) continue ;;
+ esac
+
+ mv "$_blob" "$srcdir/extra-arch-$1/usr/share/qemu"
+ done
+}
+
+package_qemu-pinning-arch-extra() {
+ pkgdesc="QEMU for foreign architectures"
+ depends=(qemu)
+ provides=(qemu-headless-arch-extra)
+ conflicts=(qemu-headless-arch-extra)
+ options=(!strip)
+
+ mv extra-arch-full/usr "$pkgdir"
+}
+
+package_qemu-pinning-headless-arch-extra() {
+ pkgdesc="QEMU without GUI, for foreign architectures"
+ depends=(qemu-headless)
+ options=(!strip)
+
+ mv extra-arch-headless/usr "$pkgdir"
+}
+
+package_qemu-pinning-block-iscsi() {
+ pkgdesc="QEMU iSCSI block module"
+ depends=(glib2 libiscsi jemalloc)
+
+ install -D build-full/block-iscsi.so "$pkgdir/usr/lib/qemu/block-iscsi.so"
+}
+
+package_qemu-pinning-block-rbd() {
+ pkgdesc="QEMU RBD block module"
+ depends=(glib2 ceph)
+
+ install -D build-full/block-rbd.so "$pkgdir/usr/lib/qemu/block-rbd.so"
+}
+
+package_qemu-pinning-block-gluster() {
+ pkgdesc="QEMU GlusterFS block module"
+ depends=(glib2 glusterfs)
+
+ install -D build-full/block-gluster.so "$pkgdir/usr/lib/qemu/block-gluster.so"
+}
+
+package_qemu-pinning-guest-agent() {
+ pkgdesc="QEMU Guest Agent"
+ depends=(gcc-libs glib2)
+
+ install -D build-full/qemu-ga "$pkgdir/usr/bin/qemu-ga"
+ install -Dm644 qemu-ga.service "$pkgdir/usr/lib/systemd/system/qemu-ga.service"
+ install -Dm755 "$srcdir/qemu-$pkgver/scripts/qemu-guest-agent/fsfreeze-hook" "$pkgdir/etc/qemu/fsfreeze-hook"
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/qemu-ga.service b/qemu-ga.service
new file mode 100644
index 00000000000..abbb6ab9dfe
--- /dev/null
+++ b/qemu-ga.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=QEMU Guest Agent
+ConditionPathExists=/dev/virtio-ports/org.qemu.guest_agent.0
+
+[Service]
+ExecStart=/usr/bin/qemu-ga
+
+[Install]
+WantedBy=multi-user.target
diff --git a/qemu.install b/qemu.install
new file mode 100644
index 00000000000..d90269ecfec
--- /dev/null
+++ b/qemu.install
@@ -0,0 +1,8 @@
+# Arg 1: the new package version
+post_install() {
+ # trigger events on modules files when already loaded
+ for _f in /sys/devices/virtual/misc/vhost-net; do
+ [[ -e "$_f" ]] && udevadm trigger "$_f"
+ done
+ :
+}