2 ## Copyright (C) 2019 Wind River Systems, Inc.
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
8 # http://www.apache.org/licenses/LICENSE-2.0
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.
18 workerconfig-standalone \
19 workerconfig-subfunction \
22 RDEPENDS_workerconfig += "bash"
23 RDEPENDS_workerconfig-standalone += "workerconfig"
24 RDEPENDS_workerconfig-subfunction += "workerconfig"
26 systemddir = "${sysconfdir}/systemd/system"
28 do_install_append () {
29 cd ${S}/workerconfig/workerconfig/
30 oe_runmake GOENABLEDDIR=${D}/${sysconfdir}/goenabled.d INITDDIR=${D}/${sysconfdir}/init.d \
31 SYSTEMDDIR=${D}/${systemddir} install
33 sed -i -e 's|/usr/local/bin|${bindir}|' \
34 ${D}${sysconfdir}/init.d/worker_config
37 FILES_workerconfig += " \
38 ${sysconfdir}/init.d/worker_config \
41 FILES_workerconfig-standalone += " \
42 ${systemddir}/config/workerconfig-standalone.service \
43 ${sysconfdir}/goenabled.d/config_goenabled_check.sh \
46 FILES_workerconfig-subfunction += " \
47 ${sysconfdir}/systemd/system/config/workerconfig-combined.service \
50 pkg_postinst_workerconfig-standalone () {
51 if [ ! -e $D${systemddir}/workerconfig.service ]; then
52 cp $D${systemddir}/config/workerconfig-standalone.service $D${systemddir}/workerconfig.service
54 rm -f $D${systemddir}/workerconfig.service
55 cp $D${systemddir}/config/workerconfig-standalone.service $D${systemddir}/workerconfig.service
58 # enable workerconfig service by default
64 systemctl daemon-reload
67 systemctl $OPTS enable workerconfig.service
70 systemctl --no-block restart workerconfig.service
75 pkg_postinst_workerconfig-subfunction () {
76 if [ ! -e $D${systemddir}/workerconfig.service ]; then
77 cp $D${systemddir}/config/workerconfig-combined.service $D${systemddir}/workerconfig.service
79 rm -f $D${systemddir}/workerconfig.service
80 cp $D${systemddir}/config/workerconfig-combined.service $D${systemddir}/workerconfig.service
83 # enable workerconfig service by default
89 systemctl daemon-reload
92 systemctl $OPTS enable workerconfig.service
95 systemctl --no-block restart workerconfig.service