libvirt: Place systemd units at appropriate location.

Systemd untis should be placed as per ${systemd_system_unitdir}.

Patched the source code to support configure variable to set the systemd units
directory.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
This commit is contained in:
Amarnath Valluri 2017-02-08 18:57:51 +02:00 committed by Bruce Ashfield
parent 0343d3f8bb
commit ee0b5e316a
2 changed files with 57 additions and 1 deletions

View File

@ -0,0 +1,55 @@
From 531178d7fbb5d4b3404766cfd0fc999398cccd58 Mon Sep 17 00:00:00 2001
From: Amarnath Valluri <amarnath.valluri@intel.com>
Date: Wed, 8 Feb 2017 18:39:48 +0200
Subject: [PATCH] Added configure variable for placing systemd untis location
Upstream-Status: Pending
Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
configure.ac | 3 +++
daemon/Makefile.am | 1 -
tools/Makefile.am | 1 -
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 0e5b8e3..5a6408c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2687,6 +2687,9 @@ AC_DEFINE_UNQUOTED([isbase64],[libvirt_gl_isbase64],[Hack to avoid symbol clash]
AC_DEFINE_UNQUOTED([base64_encode],[libvirt_gl_base64_encode],[Hack to avoid symbol clash])
AC_DEFINE_UNQUOTED([base64_encode_alloc],[libvirt_gl_base64_encode_alloc],[Hack to avoid symbol clash])
+AC_ARG_VAR(SYSTEMD_UNIT_DIR, 'location for systemd units, defautls to /lib/systemd/system')
+AS_IF([test "x$SYSTEMD_UNIT_DIR" = "x"], [SYSTEMD_UNIT_DIR="/lib/systemd/system"])
+
AC_CONFIG_FILES([run],
[chmod +x,-w run])
AC_CONFIG_FILES([\
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
index edb75e8..2ab42a6 100644
--- a/daemon/Makefile.am
+++ b/daemon/Makefile.am
@@ -449,7 +449,6 @@ endif ! LIBVIRT_INIT_SCRIPT_UPSTART
if LIBVIRT_INIT_SCRIPT_SYSTEMD
-SYSTEMD_UNIT_DIR = /lib/systemd/system
BUILT_SOURCES += libvirtd.service
install-init-systemd: install-sysconfig libvirtd.service
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 27ecbf1..8cefe1a 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -380,7 +380,6 @@ libvirt-guests.init: libvirt-guests.init.in libvirt-guests.sh
EXTRA_DIST += libvirt-guests.service.in
-SYSTEMD_UNIT_DIR = /lib/systemd/system
if LIBVIRT_INIT_SCRIPT_SYSTEMD
install-systemd: libvirt-guests.service install-sysconfig libvirt-guests.sh
--
2.7.4

View File

@ -37,6 +37,7 @@ SRC_URI = "http://libvirt.org/sources/libvirt-${PV}.tar.gz;name=libvirt \
file://0001-qemu-Let-empty-default-VNC-password-work-as-document.patch \
file://0001-ptest-add-missing-test_helper-files.patch \
file://0001-ptest-Remove-Windows-1252-check-from-esxutilstest.patch \
file://0001-Added-configure-variable-for-placing-systemd-untis-l.patch \
"
SRC_URI[libvirt.md5sum] = "f9dc1e63d559eca50ae0ee798a4c6c6d"
@ -264,7 +265,7 @@ EXTRA_OECONF += " \
--with-init-script=systemd \
"
EXTRA_OEMAKE = "BUILD_DIR=${B} DEST_DIR=${D}${PTEST_PATH} PTEST_DIR=${PTEST_PATH}"
EXTRA_OEMAKE = "BUILD_DIR=${B} DEST_DIR=${D}${PTEST_PATH} PTEST_DIR=${PTEST_PATH} SYSTEMD_UNIT_DIR=${systemd_system_unitdir}"
do_compile_ptest() {
oe_runmake -C tests buildtest-TESTS