diff options
4 files changed, 234 insertions, 0 deletions
diff --git a/meta-networking/recipes-support/ipvsadm/ipvsadm/0001-Modify-the-Makefile-for-cross-compile.patch b/meta-networking/recipes-support/ipvsadm/ipvsadm/0001-Modify-the-Makefile-for-cross-compile.patch new file mode 100644 index 0000000000..7c3dfe4a84 --- /dev/null +++ b/meta-networking/recipes-support/ipvsadm/ipvsadm/0001-Modify-the-Makefile-for-cross-compile.patch | |||
| @@ -0,0 +1,97 @@ | |||
| 1 | From 58292175115bae7a4c3600d3022e59ea57213025 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Jianchuan Wang <jianchuan.wang@windriver.com> | ||
| 3 | Date: Mon, 12 Jan 2015 15:53:23 +0800 | ||
| 4 | Subject: [PATCH] Modify the Makefile for cross compile. | ||
| 5 | |||
| 6 | Upstream-Status: Inappropriate [embedded specific] | ||
| 7 | |||
| 8 | Signed-off-by: Jianchuan Wang <jianchuan.wang@windriver.com> | ||
| 9 | --- | ||
| 10 | Makefile | 23 ++++++----------------- | ||
| 11 | libipvs/Makefile | 3 +-- | ||
| 12 | 2 files changed, 7 insertions(+), 19 deletions(-) | ||
| 13 | |||
| 14 | diff --git a/Makefile b/Makefile | ||
| 15 | index e4e03cc..461c021 100644 | ||
| 16 | --- a/Makefile | ||
| 17 | +++ b/Makefile | ||
| 18 | @@ -35,10 +35,9 @@ ARCH = $(shell uname -m) | ||
| 19 | RPMSOURCEDIR = $(shell rpm --eval '%_sourcedir') | ||
| 20 | RPMSPECDIR = $(shell rpm --eval '%_specdir') | ||
| 21 | |||
| 22 | -CC = gcc | ||
| 23 | INCLUDE = | ||
| 24 | SBIN = $(BUILD_ROOT)/sbin | ||
| 25 | -MANDIR = usr/man | ||
| 26 | +MANDIR = usr/share/man | ||
| 27 | MAN = $(BUILD_ROOT)/$(MANDIR)/man8 | ||
| 28 | INIT = $(BUILD_ROOT)/etc/rc.d/init.d | ||
| 29 | MKDIR = mkdir | ||
| 30 | @@ -62,17 +61,7 @@ RPMBUILD = $(shell \ | ||
| 31 | echo "/bin/rpm"; \ | ||
| 32 | fi ) | ||
| 33 | |||
| 34 | -ifeq (,$(FORCE_GETOPT)) | ||
| 35 | -LIB_SEARCH = /lib64 /usr/lib64 /usr/local/lib64 /lib /usr/lib /usr/local/lib | ||
| 36 | -POPT_LIB = $(shell for i in $(LIB_SEARCH); do \ | ||
| 37 | - if [ -f $$i/libpopt.a ]; then \ | ||
| 38 | - if nm $$i/libpopt.a | fgrep -q poptGetContext; then \ | ||
| 39 | - echo "-lpopt"; \ | ||
| 40 | - break; \ | ||
| 41 | - fi; \ | ||
| 42 | - fi; \ | ||
| 43 | -done) | ||
| 44 | -endif | ||
| 45 | +POPT_LIB = -lpopt | ||
| 46 | |||
| 47 | ifneq (,$(POPT_LIB)) | ||
| 48 | POPT_DEFINE = -DHAVE_POPT | ||
| 49 | @@ -81,7 +70,7 @@ endif | ||
| 50 | OBJS = ipvsadm.o config_stream.o dynamic_array.o | ||
| 51 | LIBS = $(POPT_LIB) | ||
| 52 | ifneq (0,$(HAVE_NL)) | ||
| 53 | -LIBS += -lnl | ||
| 54 | +LIBS += -lnl-3 -lnl-genl-3 | ||
| 55 | endif | ||
| 56 | DEFINES = -DVERSION=\"$(VERSION)\" -DSCHEDULERS=\"$(SCHEDULERS)\" \ | ||
| 57 | -DPE_LIST=\"$(PE_LIST)\" $(POPT_DEFINE) | ||
| 58 | @@ -91,13 +80,13 @@ DEFINES += $(shell if [ ! -f ../ip_vs.h ]; then \ | ||
| 59 | |||
| 60 | .PHONY = all clean install dist distclean rpm rpms | ||
| 61 | |||
| 62 | -all: libs ipvsadm | ||
| 63 | +all: ipvsadm | ||
| 64 | |||
| 65 | libs: | ||
| 66 | make -C libipvs | ||
| 67 | |||
| 68 | -ipvsadm: $(OBJS) $(STATIC_LIBS) | ||
| 69 | - $(CC) $(CFLAGS) -o $@ $^ $(LIBS) | ||
| 70 | +ipvsadm: $(OBJS) libs | ||
| 71 | + $(CC) $(CFLAGS) -o $@ $(OBJS) $(STATIC_LIBS) $(LIBS) | ||
| 72 | |||
| 73 | install: all | ||
| 74 | if [ ! -d $(SBIN) ]; then $(MKDIR) -p $(SBIN); fi | ||
| 75 | diff --git a/libipvs/Makefile b/libipvs/Makefile | ||
| 76 | index a527a7f..b7300ec 100644 | ||
| 77 | --- a/libipvs/Makefile | ||
| 78 | +++ b/libipvs/Makefile | ||
| 79 | @@ -1,6 +1,5 @@ | ||
| 80 | # Makefile for libipvs | ||
| 81 | |||
| 82 | -CC = gcc | ||
| 83 | CFLAGS = -Wall -Wunused -Wstrict-prototypes -g -fPIC | ||
| 84 | ifneq (0,$(HAVE_NL)) | ||
| 85 | CFLAGS += -DLIBIPVS_USE_NL | ||
| 86 | @@ -18,7 +17,7 @@ SHARED_LIB = libipvs.so | ||
| 87 | all: $(STATIC_LIB) $(SHARED_LIB) | ||
| 88 | |||
| 89 | $(STATIC_LIB): libipvs.o ip_vs_nl_policy.o | ||
| 90 | - ar rv $@ $^ | ||
| 91 | + $(AR) rv $@ $^ | ||
| 92 | |||
| 93 | $(SHARED_LIB): libipvs.o ip_vs_nl_policy.o | ||
| 94 | $(CC) -shared -Wl,-soname,$@ -o $@ $^ | ||
| 95 | -- | ||
| 96 | 1.9.1 | ||
| 97 | |||
diff --git a/meta-networking/recipes-support/ipvsadm/ipvsadm/0002-Replace-nl_handle-to-nl_sock.patch b/meta-networking/recipes-support/ipvsadm/ipvsadm/0002-Replace-nl_handle-to-nl_sock.patch new file mode 100644 index 0000000000..7896d6d1ea --- /dev/null +++ b/meta-networking/recipes-support/ipvsadm/ipvsadm/0002-Replace-nl_handle-to-nl_sock.patch | |||
| @@ -0,0 +1,63 @@ | |||
| 1 | From 2686213259b15df9cf1d969c5a14d62f14cfbaae Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Jianchuan Wang <jianchuan.wang@windriver.com> | ||
| 3 | Date: Thu, 8 Jan 2015 17:37:11 +0800 | ||
| 4 | Subject: [PATCH 2/2] Replace nl_handle to nl_sock. | ||
| 5 | |||
| 6 | The nl_handle was replace with nl_sock in the libnl-3. | ||
| 7 | |||
| 8 | Upstream-Status: Inappropriate [embedded specific] | ||
| 9 | |||
| 10 | Signed-off-by: Jianchuan Wang <jianchuan.wang@windriver.com> | ||
| 11 | --- | ||
| 12 | libipvs/libipvs.c | 10 +++++----- | ||
| 13 | 1 file changed, 5 insertions(+), 5 deletions(-) | ||
| 14 | |||
| 15 | diff --git a/libipvs/libipvs.c b/libipvs/libipvs.c | ||
| 16 | index a157e18..21a9bfa 100644 | ||
| 17 | --- a/libipvs/libipvs.c | ||
| 18 | +++ b/libipvs/libipvs.c | ||
| 19 | @@ -32,7 +32,7 @@ static void* ipvs_func = NULL; | ||
| 20 | struct ip_vs_getinfo ipvs_info; | ||
| 21 | |||
| 22 | #ifdef LIBIPVS_USE_NL | ||
| 23 | -static struct nl_handle *sock = NULL; | ||
| 24 | +static struct nl_sock *sock = NULL; | ||
| 25 | static int family, try_nl = 1; | ||
| 26 | #endif | ||
| 27 | |||
| 28 | @@ -73,7 +73,7 @@ int ipvs_nl_send_message(struct nl_msg *msg, nl_recvmsg_msg_cb_t func, void *arg | ||
| 29 | { | ||
| 30 | int err = EINVAL; | ||
| 31 | |||
| 32 | - sock = nl_handle_alloc(); | ||
| 33 | + sock = nl_socket_alloc(); | ||
| 34 | if (!sock) { | ||
| 35 | nlmsg_free(msg); | ||
| 36 | return -1; | ||
| 37 | @@ -88,7 +88,7 @@ int ipvs_nl_send_message(struct nl_msg *msg, nl_recvmsg_msg_cb_t func, void *arg | ||
| 38 | |||
| 39 | /* To test connections and set the family */ | ||
| 40 | if (msg == NULL) { | ||
| 41 | - nl_handle_destroy(sock); | ||
| 42 | + nl_socket_free(sock); | ||
| 43 | sock = NULL; | ||
| 44 | return 0; | ||
| 45 | } | ||
| 46 | @@ -104,12 +104,12 @@ int ipvs_nl_send_message(struct nl_msg *msg, nl_recvmsg_msg_cb_t func, void *arg | ||
| 47 | |||
| 48 | nlmsg_free(msg); | ||
| 49 | |||
| 50 | - nl_handle_destroy(sock); | ||
| 51 | + nl_socket_free(sock); | ||
| 52 | |||
| 53 | return 0; | ||
| 54 | |||
| 55 | fail_genl: | ||
| 56 | - nl_handle_destroy(sock); | ||
| 57 | + nl_socket_free(sock); | ||
| 58 | sock = NULL; | ||
| 59 | nlmsg_free(msg); | ||
| 60 | errno = err; | ||
| 61 | -- | ||
| 62 | 1.8.3.1 | ||
| 63 | |||
diff --git a/meta-networking/recipes-support/ipvsadm/ipvsadm/0003-ipvsadm-remove-dependency-on-bash.patch b/meta-networking/recipes-support/ipvsadm/ipvsadm/0003-ipvsadm-remove-dependency-on-bash.patch new file mode 100644 index 0000000000..800114f2ce --- /dev/null +++ b/meta-networking/recipes-support/ipvsadm/ipvsadm/0003-ipvsadm-remove-dependency-on-bash.patch | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | From 2f4cdf70cf92d3a9503d8ff045ba277db40bb4e7 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Joe MacDonald <joe_macdonald@mentor.com> | ||
| 3 | Date: Monday, 13 Apr 2015 14:12:37 -0400 | ||
| 4 | Subject: [PATCH] ipvsadm: remove dependency on bash | ||
| 5 | |||
| 6 | The save/restore scripts are very simple and don't depend on any BASH | ||
| 7 | features at all, so switch the interpreter to /bin/sh. | ||
| 8 | |||
| 9 | Upstream-Status: Pending | ||
| 10 | |||
| 11 | Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com> | ||
| 12 | --- | ||
| 13 | ipvsadm-restore | 2 +- | ||
| 14 | ipvsadm-save | 2 +- | ||
| 15 | 2 files changed, 2 insertions(+), 2 deletions(-) | ||
| 16 | |||
| 17 | diff --git a/ipvsadm-restore b/ipvsadm-restore | ||
| 18 | index f24e1b3..a9fa8bc 100644 | ||
| 19 | --- a/ipvsadm-restore | ||
| 20 | +++ b/ipvsadm-restore | ||
| 21 | @@ -1,4 +1,4 @@ | ||
| 22 | -#!/bin/bash | ||
| 23 | +#!/bin/sh | ||
| 24 | # ipvsadm-restore - Restore IPVS rules | ||
| 25 | # | ||
| 26 | # A very simple wrapper to restore IPVS rules | ||
| 27 | diff --git a/ipvsadm-save b/ipvsadm-save | ||
| 28 | index f4d399e..af51638 100644 | ||
| 29 | --- a/ipvsadm-save | ||
| 30 | +++ b/ipvsadm-save | ||
| 31 | @@ -1,4 +1,4 @@ | ||
| 32 | -#!/bin/bash | ||
| 33 | +#!/bin/sh | ||
| 34 | # ipvsadm-save - Save IPVS rules | ||
| 35 | # | ||
| 36 | # A very simple wrapper to save IPVS rules | ||
| 37 | -- | ||
| 38 | 1.9.1 | ||
| 39 | |||
diff --git a/meta-networking/recipes-support/ipvsadm/ipvsadm_1.26.bb b/meta-networking/recipes-support/ipvsadm/ipvsadm_1.26.bb new file mode 100644 index 0000000000..b640a5081d --- /dev/null +++ b/meta-networking/recipes-support/ipvsadm/ipvsadm_1.26.bb | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | SUMMARY = "Linux Virtual Server administration Utility" | ||
| 2 | DESCRIPTION = "Ipvsadm is used to set up, maintain or inspect the virtual server \ | ||
| 3 | table in the Linux kernel. The Linux Virtual Server can be used to \ | ||
| 4 | build scalable network services based on a cluster of two or more nodes. \ | ||
| 5 | The active node of the cluster redirects service requests to a \ | ||
| 6 | collection of server hosts that will actually perform the services. \ | ||
| 7 | Supported features include two protocols (TCP and UDP), three packet-forwarding \ | ||
| 8 | methods (NAT, tunneling, and direct routing), and eight load balancing algorithms \ | ||
| 9 | (round robin, weighted round robin, least-connec-tion, weighted least-connection, \ | ||
| 10 | locality-based least-connection, locality-based least-connection with replication, \ | ||
| 11 | destination-hashing, and source-hashing)." | ||
| 12 | SECTION = "console/network" | ||
| 13 | LICENSE = "GPL-2.0" | ||
| 14 | LIC_FILES_CHKSUM = "file://README;beginline=40;endline=56;md5=a54cba37b64924aa5008881607942892" | ||
| 15 | |||
| 16 | DEPENDS += "libnl popt" | ||
| 17 | |||
| 18 | SRC_URI = "http://www.linuxvirtualserver.org/software/kernel-2.6/${BP}.tar.gz \ | ||
| 19 | file://0001-Modify-the-Makefile-for-cross-compile.patch \ | ||
| 20 | file://0002-Replace-nl_handle-to-nl_sock.patch \ | ||
| 21 | file://0003-ipvsadm-remove-dependency-on-bash.patch \ | ||
| 22 | " | ||
| 23 | |||
| 24 | SRC_URI[md5sum] = "eac3ba3f62cd4dea2da353aeddd353a8" | ||
| 25 | SRC_URI[sha256sum] = "6d6c46fecb1c532a892616b4445c73b71730e8790d5630f60269fd9cbee0eb2d" | ||
| 26 | |||
| 27 | do_compile() { | ||
| 28 | oe_runmake \ | ||
| 29 | CC="${CC} -I${STAGING_INCDIR} -I${STAGING_INCDIR}/libnl3 -L${STAGING_LIBDIR}" \ | ||
| 30 | all | ||
| 31 | } | ||
| 32 | |||
| 33 | do_install() { | ||
| 34 | oe_runmake 'BUILD_ROOT=${D}' install | ||
| 35 | } | ||
