Add initial meta-stx to support StarlingX build
[pti/rtp.git] / meta-stx / recipes-networking / openvswitch / openvswitch_%.bbappend
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 FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
17
18 RDEPENDS_${PN} += " \
19                 python-pyelftools \
20                 firewalld \
21                 logrotate \
22                 hwdata \
23                 "
24
25 PACKAGECONFIG = "libcap-ng ssl dpdk"
26 PACKAGECONFIG[ssl] = "--enable-ssl,--disable-ssl,openssl,"
27 PACKAGECONFIG[dpdk] = "--with-dpdk=${STAGING_DIR_TARGET}${DPDK_INSTALL_DIR}/share/${TARGET_ARCH}-native-linuxapp-gcc,,dpdk,"
28
29
30 SRC_URI += " \
31         "
32
33 EXTRA_OECONF += " \
34                 "
35 do_configure_append () {
36         :
37 }
38
39 do_compile_append () {
40         :
41 }
42
43 do_install_append () {
44         cd ${S}
45         install -d -p -m0755 ${D}/${base_libdir}/udev/rules.d
46         install -d -m0755 ${D}/${systemd_system_unitdir}
47         install -p -m0644 rhel/usr_lib_udev_rules.d_91-vfio.rules ${D}/${base_libdir}/udev/rules.d/91-vfio.rules
48
49         install -p -m0644 \
50                 rhel/usr_lib_systemd_system_ovs-delete-transient-ports.service \
51                 ${D}/${systemd_system_unitdir}/ovs-delete-transient-ports.service 
52
53         install -p -m0644 \
54                 rhel/usr_lib_systemd_system_ovn-controller.service \
55                 ${D}/${systemd_system_unitdir}/ovn-controller.service \
56
57         install -p -m0644 \
58                 rhel/usr_lib_systemd_system_ovn-controller-vtep.service \
59                 ${D}/${systemd_system_unitdir}/ovn-controller-vtep.service \
60
61         install -p -m0644 \
62                 rhel/usr_lib_systemd_system_ovn-northd.service \
63                 ${D}/${systemd_system_unitdir}/ovn-northd.service \
64
65 ##############
66 # TODO: Do we need to use sysv? 
67 #               
68 #       install -m 0755 rhel/etc_init.d_openvswitch \
69 #        $RPM_BUILD_ROOT%{_datadir}/openvswitch/scripts/openvswitch.init
70 #
71 # TODO: Is this the best solution?
72 #       install -d -m 0755 $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/
73 #       install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifdown-ovs \
74 #               $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs
75 #       install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifup-ovs \
76 #               $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/ifup-ovs
77 # TODO: warrior builds openvswitch with python3.
78 #       install -d -m 0755 $RPM_BUILD_ROOT%{python2_sitelib}
79 #       cp -a $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/* \
80 #               $RPM_BUILD_ROOT%{python2_sitelib}
81 #
82 # TODO: who needs this script?
83 #      install -p -D -m 0755 \
84 #               rhel/usr_share_openvswitch_scripts_ovs-systemd-reload \
85 #               $RPM_BUILD_ROOT%{_datadir}/openvswitch/scripts/ovs-systemd-reload
86 ###########
87
88         install -d -p -m0755 ${D}/${sysconfdir}/logrotate.d
89         install -p -D -m 0644 rhel/etc_logrotate.d_openvswitch \
90                 ${D}/${sysconfdir}/logrotate.d/openvswitch
91
92
93         install -d -p -m 0755 ${D}/${sharedstatedir}/openvswitch
94         install -d -p  -m 0755 ${D}/${libdir}/firewalld/services/
95         install -p -m 0644 rhel/usr_lib_firewalld_services_ovn-central-firewall-service.xml \
96                 ${D}/${libdir}/firewalld/services/ovn-central-firewall-service.xml
97
98         install -d -p -m 0755 ${D}/${libdir}/ocf/resource.d/ovn
99         ln -s ${datadir}/openvswitch/scripts/ovndb-servers.ocf  ${D}/${libdir}/ocf/resource.d/ovn/ovndb-servers
100
101         if ${@bb.utils.contains('PACKAGECONFIG', 'dpdk', 'true', 'false', d)}; then
102                 install -m 0755 ${STAGING_DATADIR}/dpdk/usertools/dpdk-pmdinfo.py ${D}${datadir}/openvswitch/scripts/dpdk-pmdinfo.py
103                 install -m 0755 ${STAGING_DATADIR}/dpdk/usertools/dpdk-devbind.py ${D}${datadir}/openvswitch/scripts/dpdk-devbind.py
104         fi
105       
106 }
107
108
109 FILES_${PN}_append = " \
110         ${libdir}/      \
111         ${base_libdir}/ \
112         "