fe8d44ccb3979985e3d9cf87cf8ca9120ee5e35f
[pti/rtp.git] / meta-stx / recipes-core / stx-utilities / utilities / platform-util.inc
1 #
2 ## Copyright (C) 2019 Wind River Systems, Inc.
3 #
4 #  Licensed under the Apache License, Version 2.0 (the "License");
5 #  you may not use this file except in compliance with the License.
6 #  You may obtain a copy of the License at
7 #
8 #      http://www.apache.org/licenses/LICENSE-2.0
9 #
10 #  Unless required by applicable law or agreed to in writing, software
11 #  distributed under the License is distributed on an "AS IS" BASIS,
12 #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 #  See the License for the specific language governing permissions and
14 #  limitations under the License.
15
16 PACKAGES += " platform-util"
17
18 RDEPENDS_platform-util  += " bash"
19 DESCRIPTION_platform-util  = "platform-util"
20 SUMMARY_platform-util  = "StarlingX Platform utilities installed only on controllers"
21
22 inherit setuptools distutils
23
24 do_configure_append() {
25         cd ${S}/utilities/platform-util/platform-util
26         distutils_do_configure
27 }
28 do_compile_append() {
29         cd ${S}/utilities/platform-util/platform-util
30         distutils_do_configure
31 }
32
33 do_install_append() {
34         cd ${S}/utilities/platform-util/platform-util
35         distutils_do_install
36
37         cd ${S}/utilities/platform-util/scripts
38
39         install -d -m0755 ${D}/${bindir}
40         install -m0755 tc_setup.sh ${D}/${bindir}/tc_setup.sh
41         install -m0755 remotelogging_tc_setup.sh ${D}/${bindir}/remotelogging_tc_setup.sh
42         install -m0755 connectivity_test  ${D}/${bindir}/connectivity_test
43         install -m0755 update-iso.sh ${D}/${bindir}/update-iso.sh
44
45         install -p -d -m0755 ${D}/${sysconfdir}/init.d
46         install -m0755 log_functions.sh ${D}/${sysconfdir}/init.d/log_functions.sh
47
48         install -p -d -m0755 ${D}/${sbindir}
49         install -m0755 patch-restart-mtce  ${D}/${sbindir}/patch-restart-mtce
50         install -m0755 patch-restart-processes ${D}/${sbindir}/patch-restart-processes
51         install -m0755 patch-restart-haproxy ${D}/${sbindir}/patch-restart-haproxy
52
53
54
55         install -p -d -m0755 ${D}/${systemd_system_unitdir}
56
57         install -m0644 opt-platform.mount  ${D}/${systemd_system_unitdir}/opt-platform.mount
58         install -m0644 opt-platform.service ${D}/${systemd_system_unitdir}/opt-platform.service
59
60 }
61
62 FILES_platform-util = "  \
63         ${bindir}/tc_setup.sh \
64         ${bindir}/verify-license \
65         ${bindir}/remotelogging_tc_setup.sh \
66         ${bindir}/connectivity_test \
67         ${bindir}/update-iso.sh \
68         ${sysconfdir}/init.d/log_functions.sh \
69         ${sbindir}/patch-restart-mtce \
70         ${sbindir}/patch-restart-processes \
71         ${sbindir}/patch-restart-haproxy \
72         ${systemd_system_unitdir}/opt-platform.mount \
73         ${systemd_system_unitdir}/opt-platform.service \
74         ${PYTHON_SITEPACKAGES_DIR}/platform_util/ \
75         ${PYTHON_SITEPACKAGES_DIR}/platform_util-${PV}-py${PYTHON_BASEVERSION}.egg-info/ \
76         "