stx-utilities: inherit systemd to enable services
[pti/rtp.git] / meta-stx / recipes-core / stx-utilities / utilities / worker-utils.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 += " worker-utils"
17
18 RDEPENDS_worker-utils  += " perl systemd python bash"
19 DESCRIPTION_worker-utils  = "Initial worker node resource reservation and misc. utilities"
20 SUMMARY_worker-utils  = "dynamic MOTD generation"
21
22 inherit setuptools distutils python-dir
23
24 do_configure_append() {
25         :
26 }
27 do_compile_append() {
28         cd ${S}/utilities/worker-utils/worker-utils
29         oe_runmake all
30 }
31
32 do_install_append() {
33         cd ${S}/utilities/worker-utils/worker-utils
34
35         oe_runmake install \
36                 BINDIR=${D}/${bindir} \
37                 INITDDIR=${D}/${sysconfdir}/init.d \
38                 GOENABLEDDIR=${D}/${sysconfdir}/goenabled.d \
39                 PLATFORMCONFDIR=${D}/${sysconfdir}/platform \
40                 SYSTEMDDIR=${D}/${systemd_system_unitdir}
41 }
42
43 FILES_worker-utils = "  \
44         ${sysconfdir}/init.d/affine-platform.sh \
45         ${sysconfdir}/init.d/affine-tasks.sh \
46         ${sysconfdir}/init.d/cpumap_functions.sh \
47         ${sysconfdir}/init.d/task_affinity_functions.sh \
48         ${bindir}/ps-sched.sh \
49         ${bindir}/topology.py \
50         ${bindir}/topology.pyc \
51         ${bindir}/affine-interrupts.sh \
52         ${bindir}/set-cpu-wakeup-latency.sh \
53         ${bindir}/topology \
54         ${sysconfdir}/platform/worker_reserved.conf \
55         ${sysconfdir}/goenabled.d/worker-goenabled.sh \
56         ${systemd_system_unitdir}/affine-platform.sh.service \
57         ${systemd_system_unitdir}/affine-tasks.service \
58         "
59
60 SYSTEMD_PACKAGES += "worker-utils"
61 SYSTEMD_SERVICE_worker-utils = "\
62         affine-tasks.service \
63         affine-platform.sh.service \
64         "
65 SYSTEMD_AUTO_ENABLE_worker-utils = "enable"