main/qemu: fix qemu-bridge-helper - set suid, chmod 04710, info msg

This commit is contained in:
Jakub Jirutka 2016-05-08 17:17:28 +02:00 committed by Natanael Copa
parent 7520fd8c89
commit b7913e00d6
3 changed files with 25 additions and 2 deletions

View File

@ -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/

View File

@ -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

View File

@ -1,5 +1,6 @@
#!/bin/sh
addgroup -S -g 34 kvm 2>/dev/null
addgroup -S -g 35 qemu 2>/dev/null
exit 0