* [meta-cgl][PATCH 2/3] ocfs2-tools: fix the installation and systemd services
2017-07-28 2:32 [meta-cgl][PATCH 0/3] ocfs2-tools: several fixes jackie.huang
2017-07-28 2:32 ` [meta-cgl][PATCH 1/3] ocfs2-tools: fix dependencies jackie.huang
@ 2017-07-28 2:32 ` jackie.huang
2017-07-28 2:32 ` [meta-cgl][PATCH 3/3] ocfs2-tools: disable stack user support explicitly in init script jackie.huang
2 siblings, 0 replies; 4+ messages in thread
From: jackie.huang @ 2017-07-28 2:32 UTC (permalink / raw)
To: yocto
From: Jackie Huang <jackie.huang@windriver.com>
* use _append for do_install so that autotools_do_install
will be run first.
* add -m for the install commands.
* add ${S} for install source files instead of relative path.
* remove cluster.conf.sample and use the sample conf file
in source code instead.
* Disable systemd services by default since it won't
work before the conf file is changed according to
the actual network settings.
* Fix the services to use the correct helper scripts
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
---
.../ocfs2-tools/ocfs2-tools/cluster.conf.sample | 10 -----
.../ocfs2-tools/ocfs2-tools/o2cb.service | 4 +-
.../ocfs2-tools/ocfs2-tools/ocfs2.service | 4 +-
.../recipes-cgl/ocfs2-tools/ocfs2-tools_1.8.4.bb | 46 +++++++++++++---------
4 files changed, 31 insertions(+), 33 deletions(-)
delete mode 100644 meta-cgl-common/recipes-cgl/ocfs2-tools/ocfs2-tools/cluster.conf.sample
diff --git a/meta-cgl-common/recipes-cgl/ocfs2-tools/ocfs2-tools/cluster.conf.sample b/meta-cgl-common/recipes-cgl/ocfs2-tools/ocfs2-tools/cluster.conf.sample
deleted file mode 100644
index d7252b5..0000000
--- a/meta-cgl-common/recipes-cgl/ocfs2-tools/ocfs2-tools/cluster.conf.sample
+++ /dev/null
@@ -1,10 +0,0 @@
-node:
- ip_port = 7777
- ip_address = 192.168.246.100
- number = 0
- name = localhost.localdomain
- cluster = ocfs2
-
-cluster:
- node_count = 1
- name = ocfs2
diff --git a/meta-cgl-common/recipes-cgl/ocfs2-tools/ocfs2-tools/o2cb.service b/meta-cgl-common/recipes-cgl/ocfs2-tools/ocfs2-tools/o2cb.service
index 520b530..c49b547 100644
--- a/meta-cgl-common/recipes-cgl/ocfs2-tools/ocfs2-tools/o2cb.service
+++ b/meta-cgl-common/recipes-cgl/ocfs2-tools/ocfs2-tools/o2cb.service
@@ -5,8 +5,8 @@ After=network.target
[Service]
Type=oneshot
RemainAfterExit=yes
-ExecStart=/usr/lib/ocfs2-tools/o2cb-helper start
-ExecStop=/usr/lib/ocfs2-tools/o2cb-helper stop
+ExecStart=@LIBDIR@/o2cb-helper start
+ExecStop=@LIBDIR@/o2cb-helper stop
[Install]
WantedBy=multi-user.target
diff --git a/meta-cgl-common/recipes-cgl/ocfs2-tools/ocfs2-tools/ocfs2.service b/meta-cgl-common/recipes-cgl/ocfs2-tools/ocfs2-tools/ocfs2.service
index afcbbb9..d64da6c 100644
--- a/meta-cgl-common/recipes-cgl/ocfs2-tools/ocfs2-tools/ocfs2.service
+++ b/meta-cgl-common/recipes-cgl/ocfs2-tools/ocfs2-tools/ocfs2.service
@@ -6,8 +6,8 @@ After=network.target o2cb.service
[Service]
Type=oneshot
RemainAfterExit=yes
-ExecStart=/bin/mount -at ocfs2
-ExecStop=/bin/umount -a -t ocfs2
+ExecStart=@LIBDIR@/ocfs2-helper start
+ExecStop=@LIBDIR@/ocfs2-helper stop
[Install]
WantedBy=multi-user.target
diff --git a/meta-cgl-common/recipes-cgl/ocfs2-tools/ocfs2-tools_1.8.4.bb b/meta-cgl-common/recipes-cgl/ocfs2-tools/ocfs2-tools_1.8.4.bb
index 3074525..be9a505 100644
--- a/meta-cgl-common/recipes-cgl/ocfs2-tools/ocfs2-tools_1.8.4.bb
+++ b/meta-cgl-common/recipes-cgl/ocfs2-tools/ocfs2-tools_1.8.4.bb
@@ -14,7 +14,6 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
SRC_URI = "git://oss.oracle.com/git/ocfs2-tools.git \
file://0003-vendor-common-o2cb.ocf-add-new-conf-file.patch \
- file://cluster.conf.sample \
file://o2cb.service \
file://ocfs2.service \
"
@@ -62,32 +61,41 @@ do_compile_prepend() {
}
SYSTEMD_SERVICE_${PN} = "o2cb.service ocfs2.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+
+do_install_append() {
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 ${S}/vendor/common/o2cb.init ${D}${sysconfdir}/init.d/o2cb
+ install -m 0755 ${S}/vendor/common/ocfs2.init ${D}${sysconfdir}/init.d/ocfs2
+
+ install -d ${D}${sysconfdir}/sysconfig
+ install -m 0644 ${S}/vendor/common/o2cb.sysconfig ${D}${sysconfdir}/sysconfig/o2cb
+
+ install -d ${D}${sysconfdir}/udev/rules.d
+ install -m 0644 ${S}/vendor/common/51-ocfs2.rules ${D}${sysconfdir}/udev/rules.d/51-ocfs2.rules
-do_install() {
- install -d ${D}/etc/init.d
- install vendor/common/o2cb.init ${D}/etc/init.d/o2cb
- install vendor/common/ocfs2.init ${D}/etc/init.d/ocfs2
- install -d ${D}/etc/sysconfig
- install vendor/common/o2cb.sysconfig ${D}/etc/sysconfig/o2cb
- install -d ${D}/etc/udev/rules.d
- install vendor/common/51-ocfs2.rules ${D}/etc/udev/rules.d/51-ocfs2.rules
install -d ${D}/${libdir}/ocf/resource.d/ocfs2
- install -m 0755 vendor/common/o2cb.ocf ${D}/${libdir}/ocf/resource.d/ocfs2/o2cb
- oe_runmake DESTDIR="${D}" install
+ install -m 0755 ${S}/vendor/common/o2cb.ocf ${D}/${libdir}/ocf/resource.d/ocfs2/o2cb
chmod 644 ${D}/${libdir}/*.a
- install -dm 0755 ${D}/etc/ocfs2
- install -m 0644 ${WORKDIR}/cluster.conf.sample ${D}/etc/ocfs2/cluster.conf.sample
+
+ install -dm 0755 ${D}${sysconfdir}/ocfs2
+ install -m 0644 ${S}/documentation/samples/cluster.conf ${D}${sysconfdir}/ocfs2/cluster.conf.sample
+
rm -rf ${D}/${libdir}/ocf
rm -rf ${D}/sbin/ocfs2_controld.pcmk
rm -rf ${D}/sbin/ocfs2_controld.cman
- # fix up hardcoded paths
- sed -i -e 's,/usr/lib/,${libdir}/,' ${WORKDIR}/o2cb.service
+
if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
- install -d ${D}/${systemd_unitdir}/system
- install -m 644 ${WORKDIR}/o2cb.service ${D}/${systemd_unitdir}/system
- install -m 644 ${WORKDIR}/ocfs2.service ${D}/${systemd_unitdir}/system
+ install -d ${D}/${systemd_system_unitdir}
+ install -m 0644 ${WORKDIR}/o2cb.service ${D}/${systemd_system_unitdir}
+ sed -i -e 's,@LIBDIR@,${libexecdir},' ${D}${systemd_system_unitdir}/o2cb.service
+
+ install -m 0644 ${WORKDIR}/ocfs2.service ${D}/${systemd_system_unitdir}
+ sed -i -e 's,@LIBDIR@,${libexecdir},' ${D}${systemd_system_unitdir}/ocfs2.service
+
install -d ${D}/${libexecdir}
- install -m 755 vendor/common/o2cb.init ${D}/${libexecdir}/o2cb-helper
+ install -m 0755 ${S}/vendor/common/o2cb.init ${D}/${libexecdir}/o2cb-helper
+ install -m 0755 ${S}/vendor/common/ocfs2.init ${D}${libexecdir}/ocfs2-helper
fi
}
--
2.11.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* [meta-cgl][PATCH 3/3] ocfs2-tools: disable stack user support explicitly in init script
2017-07-28 2:32 [meta-cgl][PATCH 0/3] ocfs2-tools: several fixes jackie.huang
2017-07-28 2:32 ` [meta-cgl][PATCH 1/3] ocfs2-tools: fix dependencies jackie.huang
2017-07-28 2:32 ` [meta-cgl][PATCH 2/3] ocfs2-tools: fix the installation and systemd services jackie.huang
@ 2017-07-28 2:32 ` jackie.huang
2 siblings, 0 replies; 4+ messages in thread
From: jackie.huang @ 2017-07-28 2:32 UTC (permalink / raw)
To: yocto
From: Jackie Huang <jackie.huang@windriver.com>
Disable stack user support explicitly and only support
stack 'o2cb' in init script o2cb.
Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
---
.../disable-ocfs2-stack-user-support.patch | 42 ++++++++++++++++++++++
.../recipes-cgl/ocfs2-tools/ocfs2-tools_1.8.4.bb | 1 +
2 files changed, 43 insertions(+)
create mode 100644 meta-cgl-common/recipes-cgl/ocfs2-tools/ocfs2-tools/disable-ocfs2-stack-user-support.patch
diff --git a/meta-cgl-common/recipes-cgl/ocfs2-tools/ocfs2-tools/disable-ocfs2-stack-user-support.patch b/meta-cgl-common/recipes-cgl/ocfs2-tools/ocfs2-tools/disable-ocfs2-stack-user-support.patch
new file mode 100644
index 0000000..8d92f0c
--- /dev/null
+++ b/meta-cgl-common/recipes-cgl/ocfs2-tools/ocfs2-tools/disable-ocfs2-stack-user-support.patch
@@ -0,0 +1,42 @@
+Only support stack 'o2cb' in init script o2cb.
+
+Source file /etc/init.d/functions rather than /lib/lsb/init-functions which
+doesn't exist in wrlinux. /etc/init.d/functions provides functions killproc
+and pidofproc, and doesn't provides function start_daemon. It doesn't matter
+that start_daemon is used by stack 'user' only.
+
+Upstream-Status: Pending
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+diff --git a/vendor/common/o2cb.init.sh b/vendor/common/o2cb.init.sh
+index 2e73108..926e61e 100755
+--- a/vendor/common/o2cb.init.sh
++++ b/vendor/common/o2cb.init.sh
+@@ -18,11 +18,11 @@
+ # Force LC_ALL=C
+ export LC_ALL=C
+
+-# Let's try to use the LSB functions
+-. /lib/lsb/init-functions
++# Let's try to use the init scripts functions
++. /etc/init.d/functions
+ if [ $? != 0 ]
+ then
+- echo "Unable to load LSB init functions" >&2
++ echo "Unable to load init scripts functions" >&2
+ exit 1
+ fi
+
+@@ -72,6 +72,11 @@ VERSION=@@VERSION@@
+ # Need this default
+ [ -z "$O2CB_STACK" ] && O2CB_STACK=o2cb
+
++if [ "$O2CB_STACK" != "o2cb" ]; then
++ echo "Invalid cluster stack name \"$O2CB_STACK\""
++ exit 1
++fi
++
+ configfs_path()
+ {
+ # Note that this is only valid *after* configfs is loaded
diff --git a/meta-cgl-common/recipes-cgl/ocfs2-tools/ocfs2-tools_1.8.4.bb b/meta-cgl-common/recipes-cgl/ocfs2-tools/ocfs2-tools_1.8.4.bb
index be9a505..6e5b1fd 100644
--- a/meta-cgl-common/recipes-cgl/ocfs2-tools/ocfs2-tools_1.8.4.bb
+++ b/meta-cgl-common/recipes-cgl/ocfs2-tools/ocfs2-tools_1.8.4.bb
@@ -14,6 +14,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
SRC_URI = "git://oss.oracle.com/git/ocfs2-tools.git \
file://0003-vendor-common-o2cb.ocf-add-new-conf-file.patch \
+ file://disable-ocfs2-stack-user-support.patch \
file://o2cb.service \
file://ocfs2.service \
"
--
2.11.0
^ permalink raw reply related [flat|nested] 4+ messages in thread