Skip to contentSkip to conversation

libvirt: uprev and PACKAGECONFIG fixups

PATCH In review Bruce Ashfield 2 participants 4 messages Aug 11, 2013 – Aug 19, 2013

lore
Share & tools
lore
#0 lore raw

cover libvirt: uprev and PACKAGECONFIG fixups

These patches update libvirt to the July 1.1.1 release, as well as fix some build issues I found along the way.

As for the release update, standard libvirt/libvirtd tests were run, and the ability to launch, query and control a guest were confirmed.

Along with the 1.1.1 update, I've included a patch that fixes the virNetTLSInit unresolved symbol error that has been reported several times in the past. As the patch states, this fix isn't perfect, since there must be some libtool magic that could be used to make the link change I'm showing be automatically applied .. but I couldn't make it work, and instead have a blunter approach. If anyone wants to tackle a better fix, patches are welcome.

I'm keeping 1.0.3 around for a short while, just to ensure that 1.1.1 is fully functional.

As it turns out the virNetTLSInit link error is triggered by a bad combination of PACKAGECONFIG values (where everything but python is disabled for libvirt). It just so happens that this is the default since the libvirt-python.inc file sets PACKAGECONFIG, which inhibits the defaults you see in the libvirt recipe from ever triggering. Everyone must be building with their own options, in their own layers if this is working for people.

By pulling the python PACKAGECONFIG back into the main recipe and ensuring that PACKAGECONFIG_${PN} is used in the python.inc, we get the default options building again.

I've confirmed that things build here, but YMMV and error reports and patches are welcomed.

If no one objects, I'll push these patches on Monday.

Cheers,

Bruce

#1 lore raw

PATCH 1/2 libvirt: update to 1.1.1

Updating to the 1.1.1 libvirt release. Changes from the 1.0.3 recipe include a fix/workaround for the:

../src/.libs/libvirt.so: undefined reference to `virNetTLSInit'

That is seen on some machines. The current fix is to explicilty link against the library which provides the definition. A smarter fix via libtool may be possible, but was elusive at the time of writing this patch.

---
 ...ibvirt-net-rpc-to-virt-host-validate-when.patch |  127 ++++++++++++++
 recipes-extended/libvirt/libvirt_1.1.1.bb          |  180 ++++++++++++++++++++
 2 files changed, 307 insertions(+)
 create mode 100644 recipes-extended/libvirt/libvirt/tools-add-libvirt-net-rpc-to-virt-host-validate-when.patch
 create mode 100644 recipes-extended/libvirt/libvirt_1.1.1.bb
recipes-extended/libvirt/libvirt/tools-add-libvirt-net-rpc-to-virt-host-validate-when.patch new file +127 -0
new file mode 100644
index 0000000..821af90
@@ -0,0 +1,127 @@
+From 70700ad6bf2db2ba8e169168f225458743b90f86 Mon Sep 17 00:00:00 2001
+From: Bruce Ashfield <[email protected]>
+Date: Fri, 2 Aug 2013 11:38:43 -0400
+Subject: [PATCH] tools: add libvirt-net-rpc to virt-host-validate when TLS is
+ enabled
+
+When gnu-tls is enabled for libvirt references to virNetTLSInit are
+generated in libvirt. Any binaries linking against libvirt, must also
+link against libvirt-net-rpc which provides the implementation.
+
+Signed-off-by: Bruce Ashfield <[email protected]>
+---
+ examples/domain-events/events-c/Makefile.am |    6 ++++++
+ examples/dominfo/Makefile.am                |    7 +++++++
+ examples/domsuspend/Makefile.am             |    7 +++++++
+ examples/hellolibvirt/Makefile.am           |    7 +++++++
+ examples/openauth/Makefile.am               |    6 ++++++
+ tools/Makefile.am                           |   13 +++++++++++++
+ 6 files changed, 46 insertions(+)
+
+diff --git a/examples/domain-events/events-c/Makefile.am b/examples/domain-events/events-c/Makefile.am
+index 0646aee..6b2f5bd 100644
+--- a/examples/domain-events/events-c/Makefile.am
++++ b/examples/domain-events/events-c/Makefile.am
+@@ -21,3 +21,9 @@ event_test_CFLAGS = $(WARN_CFLAGS)
+ event_test_SOURCES = event-test.c
+ event_test_LDADD = $(top_builddir)/src/libvirt.la \
+ 		 $(top_builddir)/gnulib/lib/libgnu.la
++
++if WITH_GNUTLS
++event_test_LDADD += ../../../src/libvirt-net-rpc.la \
++                    ../../../gnulib/lib/libgnu.la
++endif
++
+diff --git a/examples/dominfo/Makefile.am b/examples/dominfo/Makefile.am
+index 4a30c77..99b3e17 100644
+--- a/examples/dominfo/Makefile.am
++++ b/examples/dominfo/Makefile.am
+@@ -23,3 +23,10 @@ noinst_PROGRAMS=info1
+ info1_SOURCES=info1.c
+ info1_LDFLAGS=
+ info1_LDADD= $(LDADDS)
++
++if WITH_GNUTLS
++info1_LDADD += $(top_builddir)/src/libvirt-net-rpc.la  \
++               $(top_builddir)/gnulib/lib/libgnu.la    \
++               $(NULL)
++endif
++
+diff --git a/examples/domsuspend/Makefile.am b/examples/domsuspend/Makefile.am
+index d0d9368..e368ffa 100644
+--- a/examples/domsuspend/Makefile.am
++++ b/examples/domsuspend/Makefile.am
+@@ -23,3 +23,10 @@ noinst_PROGRAMS=suspend
+ suspend_SOURCES=suspend.c
+ suspend_LDFLAGS=
+ suspend_LDADD= $(LDADDS)
++
++if WITH_GNUTLS
++suspend_LDADD += $(top_builddir)/src/libvirt-net-rpc.la  \
++                 $(top_builddir)/gnulib/lib/libgnu.la    \
++                 $(NULL)
++endif
++
+diff --git a/examples/hellolibvirt/Makefile.am b/examples/hellolibvirt/Makefile.am
+index 060cc71..d6ff30a 100644
+--- a/examples/hellolibvirt/Makefile.am
++++ b/examples/hellolibvirt/Makefile.am
+@@ -19,3 +19,10 @@ noinst_PROGRAMS = hellolibvirt
+ hellolibvirt_CFLAGS = $(WARN_CFLAGS)
+ hellolibvirt_SOURCES = hellolibvirt.c
+ hellolibvirt_LDADD = $(top_builddir)/src/libvirt.la
++
++if WITH_GNUTLS
++hellolibvirt_LDADD += $(top_builddir)/src/libvirt-net-rpc.la  \
++                      $(top_builddir)/gnulib/lib/libgnu.la    \
++                      $(NULL)
++endif
++
+diff --git a/examples/openauth/Makefile.am b/examples/openauth/Makefile.am
+index 1eb23fc..4d076f1 100644
+--- a/examples/openauth/Makefile.am
++++ b/examples/openauth/Makefile.am
+@@ -19,3 +19,9 @@ noinst_PROGRAMS = openauth
+ openauth_CFLAGS = $(WARN_CFLAGS)
+ openauth_SOURCES = openauth.c
+ openauth_LDADD = $(top_builddir)/src/libvirt.la
++if WITH_GNUTLS
++openauth_LDADD += $(top_builddir)/src/libvirt-net-rpc.la  \
++                  $(top_builddir)/gnulib/lib/libgnu.la    \
++                  $(NULL)
++endif
++
+diff --git a/tools/Makefile.am b/tools/Makefile.am
+index 1dac7c1..c4c6f72 100644
+--- a/tools/Makefile.am
++++ b/tools/Makefile.am
+@@ -121,6 +121,13 @@ virt_host_validate_LDADD = \
+ 		../gnulib/lib/libgnu.la				\
+ 		$(NULL)
+ 
++if WITH_GNUTLS
++virt_host_validate_LDADD += ../src/libvirt-net-rpc.la \
++                            ../gnulib/lib/libgnu.la   \
++                            $(NULL)
++endif
++
++
+ virt_host_validate_CFLAGS = \
+ 		$(WARN_CFLAGS)					\
+ 		$(PIE_CFLAGS)					\
+@@ -162,6 +169,12 @@ virsh_CFLAGS =							\
+ 		$(READLINE_CFLAGS)
+ BUILT_SOURCES =
+ 
++if WITH_GNUTLS
++virsh_LDADD += ../src/libvirt-net-rpc.la \
++               ../gnulib/lib/libgnu.la   \
++               $(NULL)
++endif
++
+ if WITH_WIN_ICON
+ virsh_LDADD += virsh_win_icon.$(OBJEXT)
+ 
+-- 
+1.7.10.4
+
recipes-extended/libvirt/libvirt_1.1.1.bb new file +180 -0

180 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#2 lore raw

Re: [PATCH 1/2] libvirt: update to 1.1.1

Quoted 9 lines · Bruce Ashfield

Updating to the 1.1.1 libvirt release. Changes from the 1.0.3 recipe include a fix/workaround for the:

../src/.libs/libvirt.so: undefined reference to `virNetTLSInit'

That is seen on some machines. The current fix is to explicilty link against the library which provides the definition. A smarter fix via libtool may be possible, but was elusive at the time of writing this patch.

Bruce,

I have looked it to this, more than I really should have. As soon as 'remote' or 'lxc' or a few other possibly options are enabled via PACKAGECONFIG libvirt-net-rpc.la ends up being linked in to libvirt.so and thus virNetTLSInit no longer undefined. The fix you have is fine, another approach is to add libvirt-net-rpc.la to one of the Makefile vars, when GNUTLS is enabled, such that it is linked into libvirt.so. Also using any sane config will ensure this is the case anyway and your change can be dropped.

Mark

Quoted 334 lines
---
 ...ibvirt-net-rpc-to-virt-host-validate-when.patch |  127 ++++++++++++++
 recipes-extended/libvirt/libvirt_1.1.1.bb          |  180 ++++++++++++++++++++
 2 files changed, 307 insertions(+)
 create mode 100644 recipes-extended/libvirt/libvirt/tools-add-libvirt-net-rpc-to-virt-host-validate-when.patch
 create mode 100644 recipes-extended/libvirt/libvirt_1.1.1.bb
recipes-extended/libvirt/libvirt/tools-add-libvirt-net-rpc-to-virt-host-validate-when.patch new file +127 -0
new file mode 100644
index 0000000..821af90
@@ -0,0 +1,127 @@
+From 70700ad6bf2db2ba8e169168f225458743b90f86 Mon Sep 17 00:00:00 2001
+From: Bruce Ashfield <[email protected]>
+Date: Fri, 2 Aug 2013 11:38:43 -0400
+Subject: [PATCH] tools: add libvirt-net-rpc to virt-host-validate when TLS is
+ enabled
+
+When gnu-tls is enabled for libvirt references to virNetTLSInit are
+generated in libvirt. Any binaries linking against libvirt, must also
+link against libvirt-net-rpc which provides the implementation.
+
+Signed-off-by: Bruce Ashfield <[email protected]>
+---
+ examples/domain-events/events-c/Makefile.am |    6 ++++++
+ examples/dominfo/Makefile.am                |    7 +++++++
+ examples/domsuspend/Makefile.am             |    7 +++++++
+ examples/hellolibvirt/Makefile.am           |    7 +++++++
+ examples/openauth/Makefile.am               |    6 ++++++
+ tools/Makefile.am                           |   13 +++++++++++++
+ 6 files changed, 46 insertions(+)
+
+diff --git a/examples/domain-events/events-c/Makefile.am b/examples/domain-events/events-c/Makefile.am
+index 0646aee..6b2f5bd 100644
+--- a/examples/domain-events/events-c/Makefile.am
++++ b/examples/domain-events/events-c/Makefile.am
+@@ -21,3 +21,9 @@ event_test_CFLAGS = $(WARN_CFLAGS)
+ event_test_SOURCES = event-test.c
+ event_test_LDADD = $(top_builddir)/src/libvirt.la \
+                $(top_builddir)/gnulib/lib/libgnu.la
++
++if WITH_GNUTLS
++event_test_LDADD += ../../../src/libvirt-net-rpc.la \
++                    ../../../gnulib/lib/libgnu.la
++endif
++
+diff --git a/examples/dominfo/Makefile.am b/examples/dominfo/Makefile.am
+index 4a30c77..99b3e17 100644
+--- a/examples/dominfo/Makefile.am
++++ b/examples/dominfo/Makefile.am
+@@ -23,3 +23,10 @@ noinst_PROGRAMS=info1
+ info1_SOURCES=info1.c
+ info1_LDFLAGS=
+ info1_LDADD= $(LDADDS)
++
++if WITH_GNUTLS
++info1_LDADD += $(top_builddir)/src/libvirt-net-rpc.la  \
++               $(top_builddir)/gnulib/lib/libgnu.la    \
++               $(NULL)
++endif
++
+diff --git a/examples/domsuspend/Makefile.am b/examples/domsuspend/Makefile.am
+index d0d9368..e368ffa 100644
+--- a/examples/domsuspend/Makefile.am
++++ b/examples/domsuspend/Makefile.am
+@@ -23,3 +23,10 @@ noinst_PROGRAMS=suspend
+ suspend_SOURCES=suspend.c
+ suspend_LDFLAGS=
+ suspend_LDADD= $(LDADDS)
++
++if WITH_GNUTLS
++suspend_LDADD += $(top_builddir)/src/libvirt-net-rpc.la  \
++                 $(top_builddir)/gnulib/lib/libgnu.la    \
++                 $(NULL)
++endif
++
+diff --git a/examples/hellolibvirt/Makefile.am b/examples/hellolibvirt/Makefile.am
+index 060cc71..d6ff30a 100644
+--- a/examples/hellolibvirt/Makefile.am
++++ b/examples/hellolibvirt/Makefile.am
+@@ -19,3 +19,10 @@ noinst_PROGRAMS = hellolibvirt
+ hellolibvirt_CFLAGS = $(WARN_CFLAGS)
+ hellolibvirt_SOURCES = hellolibvirt.c
+ hellolibvirt_LDADD = $(top_builddir)/src/libvirt.la
++
++if WITH_GNUTLS
++hellolibvirt_LDADD += $(top_builddir)/src/libvirt-net-rpc.la  \
++                      $(top_builddir)/gnulib/lib/libgnu.la    \
++                      $(NULL)
++endif
++
+diff --git a/examples/openauth/Makefile.am b/examples/openauth/Makefile.am
+index 1eb23fc..4d076f1 100644
+--- a/examples/openauth/Makefile.am
++++ b/examples/openauth/Makefile.am
+@@ -19,3 +19,9 @@ noinst_PROGRAMS = openauth
+ openauth_CFLAGS = $(WARN_CFLAGS)
+ openauth_SOURCES = openauth.c
+ openauth_LDADD = $(top_builddir)/src/libvirt.la
++if WITH_GNUTLS
++openauth_LDADD += $(top_builddir)/src/libvirt-net-rpc.la  \
++                  $(top_builddir)/gnulib/lib/libgnu.la    \
++                  $(NULL)
++endif
++
+diff --git a/tools/Makefile.am b/tools/Makefile.am
+index 1dac7c1..c4c6f72 100644
+--- a/tools/Makefile.am
++++ b/tools/Makefile.am
+@@ -121,6 +121,13 @@ virt_host_validate_LDADD = \
+               ../gnulib/lib/libgnu.la                         \
+               $(NULL)
+
++if WITH_GNUTLS
++virt_host_validate_LDADD += ../src/libvirt-net-rpc.la \
++                            ../gnulib/lib/libgnu.la   \
++                            $(NULL)
++endif
++
++
+ virt_host_validate_CFLAGS = \
+               $(WARN_CFLAGS)                                  \
+               $(PIE_CFLAGS)                                   \
+@@ -162,6 +169,12 @@ virsh_CFLAGS =                                                    \
+               $(READLINE_CFLAGS)
+ BUILT_SOURCES =
+
++if WITH_GNUTLS
++virsh_LDADD += ../src/libvirt-net-rpc.la \
++               ../gnulib/lib/libgnu.la   \
++               $(NULL)
++endif
++
+ if WITH_WIN_ICON
+ virsh_LDADD += virsh_win_icon.$(OBJEXT)
+
+--
+1.7.10.4
+
recipes-extended/libvirt/libvirt_1.1.1.bb new file +180 -1
new file mode 100644
index 0000000..4502e85
@@ -0,0 +1,180 @@
+DESCRIPTION = "A toolkit to interact with the virtualization capabilities of recent versions of Linux."
+HOMEPAGE = "http://libvirt.org"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+SECTION = "console/tools"
+PR = "r0"
+
+DEPENDS = "bridge-utils gnutls libxml2 lvm2 avahi parted curl libpcap util-linux e2fsprogs pm-utils \
+          iptables dnsmasq readline"
+
+# These might be included by PACKAGECONFIG
+#RRECOMMENDS+= "polkit qemu yajl libnl lxc netcf"
+
+# libvirt-guests.sh needs gettext.sh
+#
+RDEPENDS_${PN} = "gettext-runtime"
+
+RDEPENDS_libvirt-libvirtd += "bridge-utils iptables pm-utils dnsmasq netcat-openbsd"
+RDEPENDS_libvirt-libvirtd_append_x86-64 = " dmidecode"
+RDEPENDS_libvirt-libvirtd_append_x86 = " dmidecode"
+
+#connman blocks the 53 port and libvirtd can't start its DNS service
+RCONFLICTS_${PN}_libvirtd = "connman"
+
+SRC_URI = "http://libvirt.org/sources/libvirt-${PV}.tar.gz \
+           file://tools-add-libvirt-net-rpc-to-virt-host-validate-when.patch \
+          file://libvirtd.sh \
+          file://libvirtd.conf"
+
+SRC_URI[md5sum] = "632f30a2f22fbb404b8e10702d7f55ca"
+SRC_URI[sha256sum] = "dc6f1e1e15b9b190eaa706e76edabcfc94b239c012f5afc22b22357a4b3b22c2"
+
+inherit autotools gettext update-rc.d
+
+CACHED_CONFIGUREVARS += "\
+ac_cv_path_XMLLINT=/usr/bin/xmllint \
+ac_cv_path_XMLCATLOG=/usr/bin/xmlcatalog \
+ac_cv_path_AUGPARSE=/usr/bin/augparse \
+ac_cv_path_DNSMASQ=/usr/bin/dnsmasq \
+ac_cv_path_BRCTL=/usr/sbin/brctl \
+ac_cv_path_TC=/sbin/tc \
+ac_cv_path_UDEVADM=/sbin/udevadm \
+ac_cv_path_MODPROBE=/sbin/modprobe \
+ac_cv_path_IP_PATH=/bin/ip \
+ac_cv_path_IPTABLES_PATH=/usr/sbin/iptables \
+ac_cv_path_IP6TABLES_PATH=/usr/sbin/ip6tables \
+ac_cv_path_MOUNT=/bin/mount \
+ac_cv_path_UMOUNT=/bin/umount \
+ac_cv_path_MKFS=/usr/sbin/mkfs \
+ac_cv_path_SHOWMOUNT=/usr/sbin/showmount \
+ac_cv_path_PVCREATE=/usr/sbin/pvcreate \
+ac_cv_path_VGCREATE=/usr/sbin/vgcreate \
+ac_cv_path_LVCREATE=/usr/sbin/lvcreate \
+ac_cv_path_PVREMOVE=/usr/sbin/pvremove \
+ac_cv_path_VGREMOVE=/usr/sbin/vgremove \
+ac_cv_path_LVREMOVE=/usr/sbin/lvremove \
+ac_cv_path_LVCHANGE=/usr/sbin/lvchange \
+ac_cv_path_VGCHANGE=/usr/sbin/vgchange \
+ac_cv_path_VGSCAN=/usr/sbin/vgscan \
+ac_cv_path_PVS=/usr/sbin/pvs \
+ac_cv_path_VGS=/usr/sbin/vgs \
+ac_cv_path_LVS=/usr/sbin/lvs \
+ac_cv_path_PARTED=/usr/sbin/parted \
+ac_cv_path_DMSETUP=/usr/sbin/dmsetup"
+
+# Some other possible paths we are not yet setting
+#ac_cv_path_RPCGEN=
+#ac_cv_path_XSLTPROC=
+#ac_cv_path_RADVD=
+#ac_cv_path_UDEVSETTLE=
+#ac_cv_path_EBTABLES_PATH=
+#ac_cv_path_PKG_CONFIG=
+#ac_cv_path_ac_pt_PKG_CONFIG
+#ac_cv_path_PKCHECK_PATH=
+#ac_cv_path_POLKIT_AUTH=
+#ac_cv_path_DTRACE=
+#ac_cv_path_ISCSIADM=
+#ac_cv_path_MSGFMT=
+#ac_cv_path_GMSGFMT=
+#ac_cv_path_XGETTEXT=
+#ac_cv_path_MSGMERGE=
+#ac_cv_path_SCRUB=
+#ac_cv_path_PYTHON=
+
+ALLOW_EMPTY_${PN} = "1"
+
+PACKAGES =+ "${PN}-libvirtd ${PN}-virsh"
+
+ALLOW_EMPTY_${PN}-libvirtd = "1"
+
+FILES_${PN}-libvirtd = "${sysconfdir}/init.d \
+       ${sysconfdir}/sysctl.d \
+       ${sysconfdir}/logrotate.d \
+       ${sysconfdir}/libvirt/libvirtd.conf \
+        /usr/lib/sysctl.d/libvirtd.conf \
+       ${sbindir}/libvirtd"
+
+FILES_${PN}-virsh = "${bindir}/virsh"
+FILES_${PN} += "${libdir}/libvirt/connection-driver \
+           ${datadir}/augeas \
+           ${datadir}/polkit-1"
+
+FILES_${PN}-dbg += "${libdir}/libvirt/connection-driver/.debug ${libdir}/libvirt/lock-driver/.debug"
+FILES_${PN}-staticdev += "${libdir}/libvirt ${libdir}/*.a ${libdir}/libvirt/connection-driver/*.a ${libdir}/libvirt/lock-driver/*.a"
+
+INITSCRIPT_PACKAGES = "${PN}-libvirtd"
+INITSCRIPT_NAME_${PN}-libvirtd = "libvirtd"
+INITSCRIPT_PARAMS_${PN}-libvirtd = "defaults 72"
+
+# xen-minimal config
+#PACKAGECONFIG ??= "xen libxl xen-inotify test remote libvirtd"
+
+# full config
+PACKAGECONFIG ??= "qemu yajl xen libxl xen-inotify uml openvz vmware vbox esx \
+                 polkit lxc test remote macvtap libvirtd netcf udev python \
+                 ${@base_contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)} \
+                 ebtables"
+
+# enable,disable,depends,rdepends
+#
+PACKAGECONFIG[qemu] = "--with-qemu,--without-qemu,qemu,"
+PACKAGECONFIG[yajl] = "--with-yajl,--without-yajl,yajl,yajl"
+PACKAGECONFIG[xen] = "--with-xen,--without-xen,xen,"
+PACKAGECONFIG[xenapi] = "--with-xenapi,--without-xenapi,,"
+PACKAGECONFIG[libxl] = "--with-libxl=${STAGING_DIR_TARGET}/lib,--without-libxl,xen,"
+PACKAGECONFIG[xen-inotify] = "--with-xen-inotify,--without-xen-inotify,xen,"
+PACKAGECONFIG[uml] = "--with-uml, --without-uml,,"
+PACKAGECONFIG[openvz] = "--with-openvz,--without-openvz,,"
+PACKAGECONFIG[vmware] = "--with-vmware,--without-vmware,,"
+PACKAGECONFIG[phyp] = "--with-phyp,--without-phyp,,"
+PACKAGECONFIG[vbox] = "--with-vbox,--without-vbox,,"
+PACKAGECONFIG[esx] = "--with-esx,--without-esx,,"
+PACKAGECONFIG[hyperv] = "--with-hyperv,--without-hyperv,,"
+PACKAGECONFIG[polkit] = "--with-polkit,--without-polkit,polkit,polkit"
+PACKAGECONFIG[lxc] = "--with-lxc,--without-lxc, lxc,"
+PACKAGECONFIG[test] = "--with-test=yes,--with-test=no,,"
+PACKAGECONFIG[remote] = "--with-remote,--without-remote,,"
+PACKAGECONFIG[macvtap] = "--with-macvtap=yes,--with-macvtap=no,libnl,libnl"
+PACKAGECONFIG[libvirtd] = "--with-libvirtd,--without-libvirtd,,"
+PACKAGECONFIG[netcf] = "--with-netcf,--without-netcf,netcf,netcf"
+PACKAGECONFIG[dtrace] = "--with-dtrace,--without-dtrace,,"
+PACKAGECONFIG[udev] = "--with-udev --with-pciaccess,--without-udev,udev libpciaccess,"
+PACKAGECONFIG[selinux] = "--with-selinux,--without-selinux,libselinux,"
+PACKAGECONFIG[ebtables] = "ac_cv_path_EBTABLES_PATH=/sbin/ebtables,ac_cv_path_EBTABLES_PATH=,ebtables,ebtables"
+
+# Enable the Python tool support
+require libvirt-python.inc
+
+do_install_append() {
+       install -d ${D}/etc/init.d
+       install -d ${D}/etc/libvirt
+
+       install -m 0755 ${WORKDIR}/libvirtd.sh ${D}/etc/init.d/libvirtd
+       install -m 0644 ${WORKDIR}/libvirtd.conf ${D}/etc/libvirt/libvirtd.conf
+
+       # This will wind up in the libvirtd package, but will NOT be invoked by default.
+       #
+       mv ${D}/${libexecdir}/libvirt-guests.sh ${D}/${sysconfdir}/init.d
+
+       # The /var/run/libvirt directories created by the Makefile
+       # are wiped out in volatile, we need to create these at boot.
+       rm -rf ${D}${localstatedir}/run
+       install -d ${D}${sysconfdir}/default/volatiles
+       echo "d root root 0755 ${localstatedir}/run/libvirt none" \
+            > ${D}${sysconfdir}/default/volatiles/99_libvirt
+       echo "d root root 0755 ${localstatedir}/run/libvirt/lockd none" \
+            >> ${D}${sysconfdir}/default/volatiles/99_libvirt
+       echo "d root root 0755 ${localstatedir}/run/libvirt/lxc none" \
+            >> ${D}${sysconfdir}/default/volatiles/99_libvirt
+       echo "d root root 0755 ${localstatedir}/run/libvirt/network none" \
+            >> ${D}${sysconfdir}/default/volatiles/99_libvirt
+       echo "d root root 0755 ${localstatedir}/run/libvirt/qemu none" \
+            >> ${D}${sysconfdir}/default/volatiles/99_libvirt
+}
+
+pkg_postinst_libvirt() {
+        if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then
+                /etc/init.d/populate-volatile.sh update
+        fi
+}
--

1.7.10.4

_______________________________________________
meta-virtualization mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-virtualization

#3 lore raw

PATCH 2/2 libvirt: move python PACKAGECONFIG into main recipe

In reply to Bruce Ashfield

The libvirt-python.inc manipulation of PACKAGECONFIG meant that the default configuration options of the libvirt recipe never fired, since the variable had an assignment and the lazy set of the configuration values never applied to the build.

Moving the python PACKAGE_CONFIG options into the main recipe, and ensuring that PACKAGE_CONFIG_${PN} is used for libvirt-python means that most builds will now use the default configuration.

---
 recipes-extended/libvirt/libvirt-python.inc |    2 --
 recipes-extended/libvirt/libvirt_1.1.1.bb   |    7 ++++---
 2 files changed, 4 insertions(+), 5 deletions(-)
recipes-extended/libvirt/libvirt-python.inc +0 -2
index d4cc5f3..3d09d09 100644
@@ -5,8 +5,6 @@ export STAGING_LIBDIR
 export BUILD_SYS 
 export HOST_SYS
 
-PACKAGECONFIG += "python"
-PACKAGECONFIG[python] = "--with-python,--without-python,python,"
 RDEPENDS_${PN}-python += "python"
 PACKAGECONFIG_${PN}-python[xen] = ",,,xen-python"
 
recipes-extended/libvirt/libvirt_1.1.1.bb +4 -3
index 4502e85..2b971df 100644
@@ -112,9 +112,9 @@ INITSCRIPT_PARAMS_${PN}-libvirtd = "defaults 72"
 
 # full config
 PACKAGECONFIG ??= "qemu yajl xen libxl xen-inotify uml openvz vmware vbox esx \
-	          polkit lxc test remote macvtap libvirtd netcf udev python \
-	          ${@base_contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)} \
-	          ebtables"
+                   polkit lxc test remote macvtap libvirtd netcf udev python ebtables \
+                   {@base_contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)} \
+                  "
 
 # enable,disable,depends,rdepends
 #
@@ -142,6 +142,7 @@ PACKAGECONFIG[dtrace] = "--with-dtrace,--without-dtrace,,"
 PACKAGECONFIG[udev] = "--with-udev --with-pciaccess,--without-udev,udev libpciaccess,"
 PACKAGECONFIG[selinux] = "--with-selinux,--without-selinux,libselinux,"
 PACKAGECONFIG[ebtables] = "ac_cv_path_EBTABLES_PATH=/sbin/ebtables,ac_cv_path_EBTABLES_PATH=,ebtables,ebtables"
+PACKAGECONFIG[python] = "--with-python,--without-python,python,"
 
 # Enable the Python tool support
 require libvirt-python.inc
Signature · 1 line
1.7.10.4