added my Recipes

This commit is contained in:
2024-07-11 14:16:35 +02:00
parent 38bc4f53ac
commit 09b621d929
7118 changed files with 525762 additions and 3 deletions

View File

@@ -0,0 +1,28 @@
From 0ab69dc18a2057ff5bf41abcdf2b983b72d5a903 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 12 Jul 2017 15:34:49 -0700
Subject: [PATCH 1/2] include sys/select.h for fd_set definition
Fixes
teamnl.c:160:2: error: unknown type name 'fd_set'; did you mean 'fpos_t'?
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
utils/teamnl.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/utils/teamnl.c b/utils/teamnl.c
index e8de7e2..25129e8 100644
--- a/utils/teamnl.c
+++ b/utils/teamnl.c
@@ -24,6 +24,7 @@
#include <getopt.h>
#include <errno.h>
#include <sys/signalfd.h>
+#include <sys/select.h>
#include <signal.h>
#include <unistd.h>
#include <team.h>
--
2.13.2

View File

@@ -0,0 +1,34 @@
From e86a58271d7d0a3b9cd546251d2527e93898bdb8 Mon Sep 17 00:00:00 2001
From: Mingli Yu <mingli.yu@windriver.com>
Date: Tue, 21 Dec 2021 11:15:31 +0800
Subject: [PATCH] team_basic_test.py: check the return value
Not only print the traceback like before, also check the
return value.
Upstream-Status: Submitted [https://github.com/jpirko/libteam/pull/63]
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
scripts/team_basic_test.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/scripts/team_basic_test.py b/scripts/team_basic_test.py
index 0b64af2..17588c7 100755
--- a/scripts/team_basic_test.py
+++ b/scripts/team_basic_test.py
@@ -203,4 +203,10 @@ def main():
btest.run()
if __name__ == "__main__":
- main()
+ try:
+ ret = main()
+ except Exception as esc:
+ ret = 1
+ import traceback
+ traceback.print_exc()
+ sys.exit(ret)
--
2.17.1

View File

@@ -0,0 +1,32 @@
From 00debe6bd4cf5a3133a8fbaab75f7447a39fa655 Mon Sep 17 00:00:00 2001
From: Wenzong Fan <wenzong.fan@windriver.com>
Date: Thu, 12 Apr 2018 01:54:15 +0000
Subject: [PATCH] team_basic_test.py: disable RedHat specific test
The test _run_teamd_initscripts() is for RedHat ifcfg scripts which are
incompatible with OE:
/etc/sysconfig/network-scripts/ifcfg-*
Upstream-Status: Inappropriate [OE Specific]
Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
---
scripts/team_basic_test.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/team_basic_test.py b/scripts/team_basic_test.py
index b05be9e..faabd18 100755
--- a/scripts/team_basic_test.py
+++ b/scripts/team_basic_test.py
@@ -171,7 +171,7 @@ TEAM_PORT_CONFIG='{"prio": 10}'
try:
for mode_name in self._team_modes:
self._run_one_mode(mode_name)
- self._run_teamd_initscripts()
+ #self._run_teamd_initscripts()
finally:
cmd_exec("modprobe -r team_mode_loadbalance team_mode_roundrobin team_mode_activebackup team_mode_broadcast team");
--
2.13.3

View File

@@ -0,0 +1,101 @@
From 06050e79655f0fa7d9daeda1fbd3a9a2c7736841 Mon Sep 17 00:00:00 2001
From: Mingli Yu <mingli.yu@windriver.com>
Date: Thu, 2 Dec 2021 15:08:25 +0800
Subject: [PATCH] team_basic_test.py: switch to python3
Switch the script team_basic_test.py to python3
Upstream-Status: Submitted [https://github.com/jpirko/libteam/pull/63]
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
scripts/team_basic_test.py | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/scripts/team_basic_test.py b/scripts/team_basic_test.py
index faabd18..0b64af2 100755
--- a/scripts/team_basic_test.py
+++ b/scripts/team_basic_test.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
"""
Basic test.
@@ -32,11 +32,11 @@ def usage():
"""
Print usage of this app
"""
- print "Usage: team_basic_test.py [OPTION...]"
- print ""
- print " -h, --help print this message"
- print " -c, --loop-count=NUMBER number of loops (default 1)"
- print " -p, --port=NETDEV port device (can be defined multiple times)"
+ print("Usage: team_basic_test.py [OPTION...]")
+ print("")
+ print(" -h, --help print this message")
+ print(" -c, --loop-count=NUMBER number of loops (default 1)")
+ print(" -p, --port=NETDEV port device (can be defined multiple times)")
sys.exit()
class CmdExecFailedException(Exception):
@@ -55,15 +55,15 @@ class CmdExecUnexpectedOutputException(Exception):
return "Command execution output unexpected: \"%s\" != \"%s\"" % (self.__output, self.__expected_output)
def print_output(out_type, string):
- print("%s:\n"
+ print(("%s:\n"
"----------------------------\n"
"%s"
- "----------------------------" % (out_type, string))
+ "----------------------------" % (out_type, string)))
def cmd_exec(cmd, expected_output=None, cleaner=False):
cmd = cmd.rstrip(" ")
if not cleaner:
- print("# \"%s\"" % cmd)
+ print(("# \"%s\"" % cmd))
subp = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
(data_stdout, data_stderr) = subp.communicate()
@@ -74,7 +74,7 @@ def cmd_exec(cmd, expected_output=None, cleaner=False):
if data_stderr:
print_output("Stderr", data_stderr)
raise CmdExecFailedException(subp.returncode)
- output = data_stdout.rstrip()
+ output = (data_stdout.rstrip()).decode()
if expected_output:
if output != expected_output:
raise CmdExecUnexpectedOutputException(output, expected_output)
@@ -166,7 +166,7 @@ TEAM_PORT_CONFIG='{"prio": 10}'
os.removedirs("/tmp/team_test/")
def _run_one_loop(self, run_nr):
- print "RUN #%d" % (run_nr)
+ print("RUN #%d" % (run_nr))
self._created_teams = []
try:
for mode_name in self._team_modes:
@@ -176,7 +176,7 @@ TEAM_PORT_CONFIG='{"prio": 10}'
cmd_exec("modprobe -r team_mode_loadbalance team_mode_roundrobin team_mode_activebackup team_mode_broadcast team");
def run(self):
- for i in xrange(self._loop_count):
+ for i in range(self._loop_count):
self._run_one_loop(i + 1)
def main():
@@ -186,8 +186,8 @@ def main():
"hc:p:",
["help", "loop-count=", "port="]
)
- except getopt.GetoptError, err:
- print str(err)
+ except getopt.GetoptError as err:
+ print(str(err))
usage()
btest = TeamBasicTest()
--
2.17.1

View File

@@ -0,0 +1,46 @@
From 49693cac37ee35ff673240c8060201efe0d999c2 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 24 Aug 2022 22:27:03 -0700
Subject: [PATCH] teamd: Include missing headers for strrchr and memcmp
Compiler does not see the prototype for these functions otherwise and
build fails e.g.
| ../../git/teamd/teamd_phys_port_check.c:52:10: error: call to undeclared library function 'strrchr' with type 'char *(const char *, int)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
| start = strrchr(link, '/');
| ^
Upstream-Status: Submitted [https://github.com/jpirko/libteam/pull/68]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
teamd/teamd_phys_port_check.c | 1 +
teamd/teamd_runner_loadbalance.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/teamd/teamd_phys_port_check.c b/teamd/teamd_phys_port_check.c
index 1eec129..c2454ab 100644
--- a/teamd/teamd_phys_port_check.c
+++ b/teamd/teamd_phys_port_check.c
@@ -19,6 +19,7 @@
#include <stdio.h>
#include <errno.h>
+#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
diff --git a/teamd/teamd_runner_loadbalance.c b/teamd/teamd_runner_loadbalance.c
index a581472..421a7c6 100644
--- a/teamd/teamd_runner_loadbalance.c
+++ b/teamd/teamd_runner_loadbalance.c
@@ -17,6 +17,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <string.h>
#include <sys/socket.h>
#include <linux/netdevice.h>
#include <team.h>
--
2.37.2

View File

@@ -0,0 +1,40 @@
From a5b945cb3c62a18dcd7047f62707c09076c4e48b Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 12 Jul 2017 15:35:51 -0700
Subject: [PATCH 2/2] teamd: Re-adjust include header order
So it gets the library definition before kernel definition
usr/include/ne
tinet/if_ether.h:101:8: error: redefinition of 'struct ethhdr'
struct ethhdr {
^~~~~~
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
teamd/teamd_runner_lacp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/teamd/teamd_runner_lacp.c b/teamd/teamd_runner_lacp.c
index 9c77fae..8800854 100644
--- a/teamd/teamd_runner_lacp.c
+++ b/teamd/teamd_runner_lacp.c
@@ -23,6 +23,7 @@
#include <unistd.h>
#include <limits.h>
#include <sys/ioctl.h>
+#include <net/ethernet.h>
#include <linux/if_ether.h>
#include <sys/socket.h>
#include <linux/netdevice.h>
@@ -30,7 +31,6 @@
#include <errno.h>
#include <team.h>
#include <private/misc.h>
-#include <net/ethernet.h>
#include "teamd.h"
#include "teamd_config.h"
--
2.13.2

View File

@@ -0,0 +1,8 @@
#!/bin/sh
python3 $(dirname $0)/team_basic_test.py
if [ $? -eq 0 ] ; then
echo "PASS: libteam"
else
echo "FAIL: libteam"
fi

View File

@@ -0,0 +1,42 @@
SUMMARY = "Library for controlling team network device"
HOMEPAGE = "http://www.libteam.org/"
SECTION = "libs/network"
LICENSE = "LGPL-2.1-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
DEPENDS = "libnl libdaemon jansson"
SRC_URI = "git://github.com/jpirko/libteam;branch=master;protocol=https \
file://0001-include-sys-select.h-for-fd_set-definition.patch \
file://0002-teamd-Re-adjust-include-header-order.patch \
file://0001-team_basic_test.py-disable-RedHat-specific-test.patch \
file://0001-team_basic_test.py-switch-to-python3.patch \
file://0001-team_basic_test.py-check-the-return-value.patch \
file://0001-teamd-Include-missing-headers-for-strrchr-and-memcmp.patch \
file://run-ptest \
"
SRCREV = "3ee12c6d569977cf1cd30d0da77807a07aa77158"
S = "${WORKDIR}/git"
inherit autotools pkgconfig ptest
FILES:${PN} = "${libdir}/libteam${SOLIBS} \
"
PACKAGES += "${PN}-dctl ${PN}-utils"
FILES:${PN}-dctl = "${libdir}/libteamdctl${SOLIBS} \
"
FILES:${PN}-utils = "${bindir}/bond2team \
${bindir}/teamd \
${bindir}/teamdctl \
${bindir}/teamnl \
"
RDEPENDS:${PN}-utils = "bash"
RDEPENDS:${PN}-ptest = "python3-core"
do_install_ptest() {
install ${S}/scripts/team_basic_test.py ${D}${PTEST_PATH}/
}