summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Woolley <rob.woolley@windriver.com>2017-04-19 07:42:20 -0700
committerBruce Ashfield <bruce.ashfield@windriver.com>2017-04-24 22:51:26 -0400
commit67c86c4962170354ad8a2ec4cdbb9bc0056cfd66 (patch)
tree36178e25bfc9823fae036573328abbac00cdf1f5
parenta20d51d5c60f1ae3ce8784d5db044af28006d115 (diff)
downloadmeta-virtualization-67c86c4962170354ad8a2ec4cdbb9bc0056cfd66.tar.gz
libvirt: Fix conditional dependencies on polkit
The DIRFILES variable was a temporary workaround to resolve a do_rootfs RPM package conflict between libvirt and polkit. This happened because of the different permissions and ownership that the packages placed on ${datadir}/usr/share/polkit-1/rules.d. The behaviour is now conditional based on how PACKAGECONFIG is set. The polkit rules will be removed from the package if polkit is not enabled. If polkit is enabled the permissions and ownership are set to match those set by the polkit recipe. This uses the useradd enhancements for RSS. It requires that shadow-native be included as a DEPENDS to provide the useradd command in the native sysroot. Signed-off-by: Rob Woolley <rob.woolley@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
-rw-r--r--recipes-extended/libvirt/libvirt_1.3.5.bb17
1 files changed, 13 insertions, 4 deletions
diff --git a/recipes-extended/libvirt/libvirt_1.3.5.bb b/recipes-extended/libvirt/libvirt_1.3.5.bb
index 7b55ead4..a8e6f3f8 100644
--- a/recipes-extended/libvirt/libvirt_1.3.5.bb
+++ b/recipes-extended/libvirt/libvirt_1.3.5.bb
@@ -7,7 +7,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
7SECTION = "console/tools" 7SECTION = "console/tools"
8 8
9DEPENDS = "bridge-utils gnutls libxml2 lvm2 avahi parted curl libpcap util-linux e2fsprogs pm-utils \ 9DEPENDS = "bridge-utils gnutls libxml2 lvm2 avahi parted curl libpcap util-linux e2fsprogs pm-utils \
10 iptables dnsmasq readline libtasn1 libxslt-native acl" 10 iptables dnsmasq readline libtasn1 libxslt-native acl \
11 ${@bb.utils.contains('PACKAGECONFIG', 'polkit', 'shadow-native', '', d)}"
11 12
12# libvirt-guests.sh needs gettext.sh 13# libvirt-guests.sh needs gettext.sh
13# 14#
@@ -22,8 +23,6 @@ RDEPENDS_libvirt-libvirtd_append_x86 = " dmidecode"
22#connman blocks the 53 port and libvirtd can't start its DNS service 23#connman blocks the 53 port and libvirtd can't start its DNS service
23RCONFLICTS_${PN}_libvirtd = "connman" 24RCONFLICTS_${PN}_libvirtd = "connman"
24 25
25DIRFILES = ""
26
27SRC_URI = "http://libvirt.org/sources/libvirt-${PV}.tar.gz;name=libvirt \ 26SRC_URI = "http://libvirt.org/sources/libvirt-${PV}.tar.gz;name=libvirt \
28 file://tools-add-libvirt-net-rpc-to-virt-host-validate-when.patch \ 27 file://tools-add-libvirt-net-rpc-to-virt-host-validate-when.patch \
29 file://libvirtd.sh \ 28 file://libvirtd.sh \
@@ -120,7 +119,8 @@ FILES_${PN}-libvirtd = " \
120FILES_${PN}-virsh = "${bindir}/virsh" 119FILES_${PN}-virsh = "${bindir}/virsh"
121FILES_${PN} += "${libdir}/libvirt/connection-driver \ 120FILES_${PN} += "${libdir}/libvirt/connection-driver \
122 ${datadir}/augeas \ 121 ${datadir}/augeas \
123 ${datadir}/polkit-1" 122 ${@bb.utils.contains('PACKAGECONFIG', 'polkit', '${datadir}/polkit-1', '', d)} \
123 "
124 124
125FILES_${PN}-dbg += "${libdir}/libvirt/connection-driver/.debug ${libdir}/libvirt/lock-driver/.debug" 125FILES_${PN}-dbg += "${libdir}/libvirt/connection-driver/.debug ${libdir}/libvirt/lock-driver/.debug"
126FILES_${PN}-staticdev += "${libdir}/*.a ${libdir}/libvirt/connection-driver/*.a ${libdir}/libvirt/lock-driver/*.a" 126FILES_${PN}-staticdev += "${libdir}/*.a ${libdir}/libvirt/connection-driver/*.a ${libdir}/libvirt/lock-driver/*.a"
@@ -254,6 +254,15 @@ do_install_append() {
254 echo "d root root 0755 ${localstatedir}/run/libvirt/qemu none" \ 254 echo "d root root 0755 ${localstatedir}/run/libvirt/qemu none" \
255 >> ${D}${sysconfdir}/default/volatiles/99_libvirt 255 >> ${D}${sysconfdir}/default/volatiles/99_libvirt
256 256
257 # Manually set permissions and ownership to match polkit recipe
258 if ${@bb.utils.contains('PACKAGECONFIG', 'polkit', 'true', 'false', d)}; then
259 install -d -m 0700 ${D}/${datadir}/polkit-1/rules.d
260 chown polkitd ${D}/${datadir}/polkit-1/rules.d
261 chgrp root ${D}/${datadir}/polkit-1/rules.d
262 else
263 rm -rf ${D}/${datadir}/polkit-1
264 fi
265
257 # Add hook support for libvirt 266 # Add hook support for libvirt
258 mkdir -p ${D}/etc/libvirt/hooks 267 mkdir -p ${D}/etc/libvirt/hooks
259 268