diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2016-05-08 17:17:28 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2016-05-11 13:00:22 +0000 |
commit | b7913e00d652f4ac94c608afc92ea7143fbbbfea (patch) | |
tree | eb49d8640ecb44a856ecbe607b9568c1b729ab3a /main | |
parent | 7520fd8c890f135a20f1b02fa5ac17418482020f (diff) | |
download | aports-b7913e00d652f4ac94c608afc92ea7143fbbbfea.tar.bz2 aports-b7913e00d652f4ac94c608afc92ea7143fbbbfea.tar.xz |
main/qemu: fix qemu-bridge-helper - set suid, chmod 04710, info msg
Diffstat (limited to 'main')
-rw-r--r-- | main/qemu/APKBUILD | 16 | ||||
-rw-r--r-- | main/qemu/qemu.post-install | 10 | ||||
-rw-r--r-- | main/qemu/qemu.pre-install | 1 |
3 files changed, 25 insertions, 2 deletions
diff --git a/main/qemu/APKBUILD b/main/qemu/APKBUILD index f4c38c2584..8a5bd64ac0 100644 --- a/main/qemu/APKBUILD +++ b/main/qemu/APKBUILD @@ -1,8 +1,9 @@ # Contributor: Valery Kartel <valery.kartel@gmail.com> +# Contributor: Jakub Jirutka <jakub@jirutka.cz> # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=qemu pkgver=2.5.1 -pkgrel=2 +pkgrel=3 pkgdesc="QEMU is a generic machine emulator and virtualizer" url="http://qemu.org/" arch="all" @@ -36,7 +37,9 @@ makedepends=" zlib-dev " depends="" -install="$pkgname.pre-install" +pkggroups="qemu" +install="$pkgname.pre-install $pkgname.post-install" +options="suid" # needed for qemu-bridge-helper subpackages="$pkgname-guest-agent:guest" _subsystems=" @@ -213,6 +216,11 @@ package() { gzip "$pkgdir"/usr/share/man/man1/* gzip "$pkgdir"/usr/share/man/man8/* + # qemu-bridge-helper needs suid to create tunX devices; + # allow only users in the qemu group to run it. + chmod 04710 "$pkgdir"/usr/libexec/qemu/qemu-bridge-helper + chgrp qemu "$pkgdir"/usr/libexec/qemu/qemu-bridge-helper + if [ -n "$_arch" ]; then cd "$builddir"/build-gtk install $_arch-softmmu/qemu-system-$_arch \ @@ -223,6 +231,8 @@ package() { _subsys() { pkgdesc="Qemu ${1/-/ } emulator" depends="qemu" + options="" + mkdir -p "$subpkgdir"/usr/bin mv "$pkgdir"/usr/bin/qemu-$1 "$subpkgdir"/usr/bin/ || return 1 } @@ -230,6 +240,7 @@ _subsys() { img() { pkgdesc="QEMU command line tool for manipulating disk images" replaces="qemu" + options="" mkdir -p "$subpkgdir"/usr/bin mv "$pkgdir"/usr/bin/qemu-img \ @@ -251,6 +262,7 @@ img() { guest() { pkgdesc="QEMU guest agent" + options="" mkdir -p "$subpkgdir"/usr/bin mv "$pkgdir"/usr/bin/qemu-ga "$subpkgdir"/usr/bin/ diff --git a/main/qemu/qemu.post-install b/main/qemu/qemu.post-install new file mode 100644 index 0000000000..025f7304c6 --- /dev/null +++ b/main/qemu/qemu.post-install @@ -0,0 +1,10 @@ +#!/bin/sh + +cat 1>&2 <<EOF +* +* If you want to run VM as unprivileged user and let Qemu create tunX devices, +* then you must add that user to the group "qemu". +* If you use KVM for hardware-assisted virtualization, then you may also need +* to add that user to the group "kvm". +* +EOF diff --git a/main/qemu/qemu.pre-install b/main/qemu/qemu.pre-install index 9aae4a407d..542f2a8296 100644 --- a/main/qemu/qemu.pre-install +++ b/main/qemu/qemu.pre-install @@ -1,5 +1,6 @@ #!/bin/sh addgroup -S -g 34 kvm 2>/dev/null +addgroup -S -g 35 qemu 2>/dev/null exit 0 |