diff options
author | Jackie Huang <jackie.huang@windriver.com> | 2017-08-29 17:27:27 +0800 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2017-08-31 10:18:33 +0200 |
commit | f6695433d6a9f433d88ac09f2fbaa585bf29af1d (patch) | |
tree | 762d7021f7e4b6768dfe8edf58e2fac8033f8169 /meta-oe | |
parent | 8ca8ec9be39ea04c3b89831e6cafa4a67f015f55 (diff) | |
download | meta-openembedded-f6695433d6a9f433d88ac09f2fbaa585bf29af1d.tar.gz |
corosync: add support for extra features
* Add support for features: dbus qdevice qnetd snmp
* Add related PACKAGECONFIG
* inherit useradd to add proper user for qnetd service
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe')
-rw-r--r-- | meta-oe/recipes-extended/corosync/corosync_2.4.2.bb | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/meta-oe/recipes-extended/corosync/corosync_2.4.2.bb b/meta-oe/recipes-extended/corosync/corosync_2.4.2.bb index 2f3aef299..7d5a87e4c 100644 --- a/meta-oe/recipes-extended/corosync/corosync_2.4.2.bb +++ b/meta-oe/recipes-extended/corosync/corosync_2.4.2.bb | |||
@@ -5,7 +5,7 @@ HOMEPAGE = "http://corosync.github.io/corosync/" | |||
5 | 5 | ||
6 | SECTION = "base" | 6 | SECTION = "base" |
7 | 7 | ||
8 | inherit autotools pkgconfig systemd | 8 | inherit autotools pkgconfig systemd useradd |
9 | 9 | ||
10 | SRC_URI = "http://build.clusterlabs.org/corosync/releases/${BP}.tar.gz" | 10 | SRC_URI = "http://build.clusterlabs.org/corosync/releases/${BP}.tar.gz" |
11 | SRC_URI[md5sum] = "547fa78704da53aa35912be58d31035f" | 11 | SRC_URI[md5sum] = "547fa78704da53aa35912be58d31035f" |
@@ -16,13 +16,23 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=a85eb4ce24033adb6088dd1d6ffc5e5d" | |||
16 | 16 | ||
17 | DEPENDS = "groff-native nss libqb" | 17 | DEPENDS = "groff-native nss libqb" |
18 | 18 | ||
19 | SYSTEMD_SERVICE_${PN} = "corosync.service corosync-notifyd.service" | 19 | SYSTEMD_SERVICE_${PN} = "corosync.service corosync-notifyd.service \ |
20 | ${@bb.utils.contains('PACKAGECONFIG', 'qdevice', 'corosync-qdevice.service', '', d)} \ | ||
21 | ${@bb.utils.contains('PACKAGECONFIG', 'qnetd', 'corosync-qnetd.service', '', d)} \ | ||
22 | " | ||
20 | SYSTEMD_AUTO_ENABLE = "enable" | 23 | SYSTEMD_AUTO_ENABLE = "enable" |
21 | 24 | ||
22 | INITSCRIPT_NAME = "corosync-daemon" | 25 | INITSCRIPT_NAME = "corosync-daemon" |
23 | 26 | ||
24 | PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" | 27 | PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \ |
28 | dbus qdevice qnetd snmp \ | ||
29 | " | ||
25 | 30 | ||
31 | PACKAGECONFIG[dbus] = "--enable-dbus,--disable-dbus,dbus" | ||
32 | PACKAGECONFIG[qdevice] = "--enable-qdevices,--disable-qdevices" | ||
33 | PACKAGECONFIG[qnetd] = "--enable-qnetd,--disable-qnetd" | ||
34 | PACKAGECONFIG[rdma] = "--enable-rdma,--disable-rdma" | ||
35 | PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp,net-snmp" | ||
26 | PACKAGECONFIG[systemd] = "--enable-systemd --with-systemddir=${systemd_system_unitdir},--disable-systemd --without-systemddir,systemd" | 36 | PACKAGECONFIG[systemd] = "--enable-systemd --with-systemddir=${systemd_system_unitdir},--disable-systemd --without-systemddir,systemd" |
27 | 37 | ||
28 | EXTRA_OECONF = "ac_cv_path_BASHPATH=${base_bindir}/bash" | 38 | EXTRA_OECONF = "ac_cv_path_BASHPATH=${base_bindir}/bash" |
@@ -43,12 +53,26 @@ do_install_append() { | |||
43 | install -d ${D}${sysconfdir}/default/volatiles | 53 | install -d ${D}${sysconfdir}/default/volatiles |
44 | echo "d root root 0755 ${localstatedir}/log/cluster none" > ${D}${sysconfdir}/default/volatiles/05_corosync | 54 | echo "d root root 0755 ${localstatedir}/log/cluster none" > ${D}${sysconfdir}/default/volatiles/05_corosync |
45 | 55 | ||
56 | if ${@bb.utils.contains('PACKAGECONFIG', 'qnetd', 'true', 'false', d)}; then | ||
57 | chown -R coroqnetd:coroqnetd ${D}${sysconfdir}/${BPN}/qnetd | ||
58 | echo "d coroqnetd coroqnetd 0770 /var/run/corosync-qnetd none" >> ${D}${sysconfdir}/default/volatiles/05_corosync | ||
59 | fi | ||
60 | |||
46 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then | 61 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then |
47 | install -d ${D}${sysconfdir}/tmpfiles.d | 62 | install -d ${D}${sysconfdir}/tmpfiles.d |
48 | echo "d ${localstatedir}/log/cluster - - - -" > ${D}${sysconfdir}/tmpfiles.d/corosync.conf | 63 | echo "d ${localstatedir}/log/cluster - - - -" > ${D}${sysconfdir}/tmpfiles.d/corosync.conf |
64 | |||
65 | if ${@bb.utils.contains('PACKAGECONFIG', 'qnetd', 'true', 'false', d)}; then | ||
66 | install -m 0644 ${S}/conf/tmpfiles.d/corosync-qnetd.conf ${D}${sysconfdir}/tmpfiles.d | ||
67 | fi | ||
49 | fi | 68 | fi |
50 | } | 69 | } |
51 | 70 | ||
52 | RDEPENDS_${PN} += "bash" | 71 | RDEPENDS_${PN} += "bash" |
53 | 72 | ||
54 | FILES_${PN}-dbg += "${libexecdir}/lcrso/.debug" | 73 | FILES_${PN}-dbg += "${libexecdir}/lcrso/.debug" |
74 | FILES_${PN}-doc += "${datadir}/snmp/mibs/COROSYNC-MIB.txt" | ||
75 | |||
76 | USERADD_PACKAGES = "${PN}" | ||
77 | GROUPADD_PARAM_${PN} = "--system coroqnetd" | ||
78 | USERADD_PARAM_${PN} = "--system -d / -M -s /bin/nologin -c 'User for corosync-qnetd' -g coroqnetd coroqnetd" | ||