diff options
| author | Mark Asselstine <mark.asselstine@windriver.com> | 2015-09-10 13:59:01 -0400 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2015-09-10 14:42:43 -0400 |
| commit | 9f177c12d8361341853fe9c34f6c5b8df3cbcc1a (patch) | |
| tree | 7fa7a110e7bb6c9ffe736b9d9fccf2782e3fe297 | |
| parent | c3c4d977cbb51363f9030c2e39d56a772b29f73b (diff) | |
| download | meta-virtualization-9f177c12d8361341853fe9c34f6c5b8df3cbcc1a.tar.gz | |
libvirt: enable systemd support
Commit d114a62dd8a2121fa3026b83c5b250eb0ee6f21d [libvirt: kill
update-rc.d when not using sysvinit] resulted in libvirt services not
starting automatically at boot when using systemd. The upstream
libvirt package already has the necessary systemd service files so it
is just a matter of activating them via the '--with-init-script'
configure option and making the recipe use these.
We always set '--with-init-script' to 'systemd' regardless of
the systemd vs sysvinit DISTRO_FLAG since our sysvinit scripts are
external and thus not affected by this setting when building for
sysvinit.
Both sysvinit and systemd packages will be libvirt-libvirtd, the
bbclasses ensure that only the files for one init system will exist in
the package, so this 'overloading' is acceptable.
Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
| -rw-r--r-- | recipes-extended/libvirt/libvirt/Revert-build-add-prefix-to-SYSTEMD_UNIT_DIR.patch | 84 | ||||
| -rw-r--r-- | recipes-extended/libvirt/libvirt_1.2.17.bb | 24 |
2 files changed, 105 insertions, 3 deletions
diff --git a/recipes-extended/libvirt/libvirt/Revert-build-add-prefix-to-SYSTEMD_UNIT_DIR.patch b/recipes-extended/libvirt/libvirt/Revert-build-add-prefix-to-SYSTEMD_UNIT_DIR.patch new file mode 100644 index 00000000..c2606bd1 --- /dev/null +++ b/recipes-extended/libvirt/libvirt/Revert-build-add-prefix-to-SYSTEMD_UNIT_DIR.patch | |||
| @@ -0,0 +1,84 @@ | |||
| 1 | From 171fc890bb5972e566bd7b3d87a40ac434a5b3e6 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Mark Asselstine <mark.asselstine@windriver.com> | ||
| 3 | Date: Wed, 9 Sep 2015 11:52:44 -0400 | ||
| 4 | Subject: [PATCH] Revert "build: add $(prefix) to SYSTEMD_UNIT_DIR" | ||
| 5 | |||
| 6 | This reverts upstream commit 00e9d6071b2450659ce01bc984f64ecb5d7ba62d | ||
| 7 | with minor context changes to allow it to apply. | ||
| 8 | |||
| 9 | Yocto based builds use /lib/systemd/system for systemd unit files and | ||
| 10 | since upstream has chosen to use a mechanism for setting | ||
| 11 | SYSTEMD_UNIT_DIR which is not flexible we have to resort to reverting | ||
| 12 | this upstream commit to avoid having ${prefix} added to the path. | ||
| 13 | |||
| 14 | Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> | ||
| 15 | --- | ||
| 16 | daemon/Makefile.am | 4 ++-- | ||
| 17 | src/Makefile.am | 4 ++-- | ||
| 18 | tools/Makefile.am | 4 ++-- | ||
| 19 | 3 files changed, 6 insertions(+), 6 deletions(-) | ||
| 20 | |||
| 21 | diff --git a/daemon/Makefile.am b/daemon/Makefile.am | ||
| 22 | index 00221ab..e5c5db8 100644 | ||
| 23 | --- a/daemon/Makefile.am | ||
| 24 | +++ b/daemon/Makefile.am | ||
| 25 | @@ -1,6 +1,6 @@ | ||
| 26 | ## Process this file with automake to produce Makefile.in | ||
| 27 | |||
| 28 | -## Copyright (C) 2005-2015 Red Hat, Inc. | ||
| 29 | +## Copyright (C) 2005-2015 Red Hat, Inc. | ||
| 30 | ## | ||
| 31 | ## This library is free software; you can redistribute it and/or | ||
| 32 | ## modify it under the terms of the GNU Lesser General Public | ||
| 33 | @@ -387,7 +387,7 @@ endif ! LIBVIRT_INIT_SCRIPT_UPSTART | ||
| 34 | |||
| 35 | if LIBVIRT_INIT_SCRIPT_SYSTEMD | ||
| 36 | |||
| 37 | -SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system | ||
| 38 | +SYSTEMD_UNIT_DIR = /lib/systemd/system | ||
| 39 | BUILT_SOURCES += libvirtd.service libvirtd.socket | ||
| 40 | |||
| 41 | install-init-systemd: install-sysconfig libvirtd.service | ||
| 42 | diff --git a/src/Makefile.am b/src/Makefile.am | ||
| 43 | index 8f77658..57e163f 100644 | ||
| 44 | --- a/src/Makefile.am | ||
| 45 | +++ b/src/Makefile.am | ||
| 46 | @@ -1,6 +1,6 @@ | ||
| 47 | ## Process this file with automake to produce Makefile.in | ||
| 48 | |||
| 49 | -## Copyright (C) 2005-2015 Red Hat, Inc. | ||
| 50 | +## Copyright (C) 2005-2015 Red Hat, Inc. | ||
| 51 | ## | ||
| 52 | ## This library is free software; you can redistribute it and/or | ||
| 53 | ## modify it under the terms of the GNU Lesser General Public | ||
| 54 | @@ -2220,7 +2220,7 @@ EXTRA_DIST += \ | ||
| 55 | if WITH_LIBVIRTD | ||
| 56 | if LIBVIRT_INIT_SCRIPT_SYSTEMD | ||
| 57 | |||
| 58 | -SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system | ||
| 59 | +SYSTEMD_UNIT_DIR = /lib/systemd/system | ||
| 60 | |||
| 61 | BUILT_SOURCES += virtlockd.service virtlockd.socket | ||
| 62 | DISTCLEANFILES += virtlockd.service virtlockd.socket | ||
| 63 | diff --git a/tools/Makefile.am b/tools/Makefile.am | ||
| 64 | index 6847f13..256a8f3 100644 | ||
| 65 | --- a/tools/Makefile.am | ||
| 66 | +++ b/tools/Makefile.am | ||
| 67 | @@ -1,4 +1,4 @@ | ||
| 68 | -## Copyright (C) 2005-2014 Red Hat, Inc. | ||
| 69 | +## Copyright (C) 2005-2013 Red Hat, Inc. | ||
| 70 | ## | ||
| 71 | ## This library is free software; you can redistribute it and/or | ||
| 72 | ## modify it under the terms of the GNU Lesser General Public | ||
| 73 | @@ -306,7 +306,7 @@ libvirt-guests.init: libvirt-guests.init.in libvirt-guests.sh | ||
| 74 | |||
| 75 | |||
| 76 | EXTRA_DIST += libvirt-guests.service.in | ||
| 77 | -SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system | ||
| 78 | +SYSTEMD_UNIT_DIR = /lib/systemd/system | ||
| 79 | |||
| 80 | if LIBVIRT_INIT_SCRIPT_SYSTEMD | ||
| 81 | install-systemd: libvirt-guests.service install-sysconfig libvirt-guests.sh | ||
| 82 | -- | ||
| 83 | 1.9.1 | ||
| 84 | |||
diff --git a/recipes-extended/libvirt/libvirt_1.2.17.bb b/recipes-extended/libvirt/libvirt_1.2.17.bb index 26953b61..28a22bb2 100644 --- a/recipes-extended/libvirt/libvirt_1.2.17.bb +++ b/recipes-extended/libvirt/libvirt_1.2.17.bb | |||
| @@ -32,12 +32,13 @@ SRC_URI = "http://libvirt.org/sources/libvirt-${PV}.tar.gz;name=libvirt \ | |||
| 32 | file://tests-allow-separated-src-and-build-dirs.patch \ | 32 | file://tests-allow-separated-src-and-build-dirs.patch \ |
| 33 | file://libvirt-use-pkg-config-to-locate-libcap.patch \ | 33 | file://libvirt-use-pkg-config-to-locate-libcap.patch \ |
| 34 | file://0001-to-fix-build-error.patch \ | 34 | file://0001-to-fix-build-error.patch \ |
| 35 | file://Revert-build-add-prefix-to-SYSTEMD_UNIT_DIR.patch \ | ||
| 35 | " | 36 | " |
| 36 | 37 | ||
| 37 | SRC_URI[libvirt.md5sum] = "a1f49050223be3cbd7678c32b1ee2756" | 38 | SRC_URI[libvirt.md5sum] = "a1f49050223be3cbd7678c32b1ee2756" |
| 38 | SRC_URI[libvirt.sha256sum] = "e07eaf20b0590fae05ba3b53ad4dac3e5fbd771437563cc78b692f23ddd02fad" | 39 | SRC_URI[libvirt.sha256sum] = "e07eaf20b0590fae05ba3b53ad4dac3e5fbd771437563cc78b692f23ddd02fad" |
| 39 | 40 | ||
| 40 | inherit autotools gettext update-rc.d pkgconfig ptest | 41 | inherit autotools gettext update-rc.d pkgconfig ptest systemd |
| 41 | 42 | ||
| 42 | CACHED_CONFIGUREVARS += "\ | 43 | CACHED_CONFIGUREVARS += "\ |
| 43 | ac_cv_path_XMLLINT=/usr/bin/xmllint \ | 44 | ac_cv_path_XMLLINT=/usr/bin/xmllint \ |
| @@ -98,12 +99,15 @@ PACKAGES =+ "${PN}-libvirtd ${PN}-virsh" | |||
| 98 | 99 | ||
| 99 | ALLOW_EMPTY_${PN}-libvirtd = "1" | 100 | ALLOW_EMPTY_${PN}-libvirtd = "1" |
| 100 | 101 | ||
| 101 | FILES_${PN}-libvirtd = "${sysconfdir}/init.d \ | 102 | FILES_${PN}-libvirtd = " \ |
| 103 | ${sysconfdir}/init.d \ | ||
| 102 | ${sysconfdir}/sysctl.d \ | 104 | ${sysconfdir}/sysctl.d \ |
| 103 | ${sysconfdir}/logrotate.d \ | 105 | ${sysconfdir}/logrotate.d \ |
| 104 | ${sysconfdir}/libvirt/libvirtd.conf \ | 106 | ${sysconfdir}/libvirt/libvirtd.conf \ |
| 105 | /usr/lib/sysctl.d/60-libvirtd.conf \ | 107 | /usr/lib/sysctl.d/60-libvirtd.conf \ |
| 106 | ${sbindir}/libvirtd" | 108 | ${sbindir}/libvirtd \ |
| 109 | ${systemd_unitdir}/system/* \ | ||
| 110 | " | ||
| 107 | 111 | ||
| 108 | FILES_${PN}-virsh = "${bindir}/virsh" | 112 | FILES_${PN}-virsh = "${bindir}/virsh" |
| 109 | FILES_${PN} += "${libdir}/libvirt/connection-driver \ | 113 | FILES_${PN} += "${libdir}/libvirt/connection-driver \ |
| @@ -129,6 +133,16 @@ INITSCRIPT_PACKAGES = "${PN}-libvirtd" | |||
| 129 | INITSCRIPT_NAME_${PN}-libvirtd = "libvirtd" | 133 | INITSCRIPT_NAME_${PN}-libvirtd = "libvirtd" |
| 130 | INITSCRIPT_PARAMS_${PN}-libvirtd = "defaults 72" | 134 | INITSCRIPT_PARAMS_${PN}-libvirtd = "defaults 72" |
| 131 | 135 | ||
| 136 | SYSTEMD_PACKAGES = "${PN}-libvirtd" | ||
| 137 | SYSTEMD_SERVICE_${PN}-libvirtd = " \ | ||
| 138 | libvirtd.socket \ | ||
| 139 | libvirtd.service \ | ||
| 140 | virtlockd.service \ | ||
| 141 | libvirt-guests.service \ | ||
| 142 | virtlockd.socket \ | ||
| 143 | " | ||
| 144 | |||
| 145 | |||
| 132 | PRIVATE_LIBS_${PN}-ptest = " \ | 146 | PRIVATE_LIBS_${PN}-ptest = " \ |
| 133 | libvirt-lxc.so.0 \ | 147 | libvirt-lxc.so.0 \ |
| 134 | libvirt.so.0 \ | 148 | libvirt.so.0 \ |
| @@ -224,6 +238,10 @@ do_install_append() { | |||
| 224 | mkdir -p ${D}/etc/libvirt/hooks | 238 | mkdir -p ${D}/etc/libvirt/hooks |
| 225 | } | 239 | } |
| 226 | 240 | ||
| 241 | EXTRA_OECONF += " \ | ||
| 242 | --with-init-script=systemd \ | ||
| 243 | " | ||
| 244 | |||
| 227 | EXTRA_OEMAKE = "BUILD_DIR=${B} DEST_DIR=${D}${PTEST_PATH} PTEST_DIR=${PTEST_PATH}" | 245 | EXTRA_OEMAKE = "BUILD_DIR=${B} DEST_DIR=${D}${PTEST_PATH} PTEST_DIR=${PTEST_PATH}" |
| 228 | 246 | ||
| 229 | do_compile_ptest() { | 247 | do_compile_ptest() { |
