summaryrefslogtreecommitdiffstats
path: root/meta-networking
diff options
context:
space:
mode:
authorJianchuan Wang <jianchuan.wang@windriver.com>2015-01-22 17:35:56 +0800
committerJoe MacDonald <joe_macdonald@mentor.com>2015-04-15 08:47:26 -0400
commit71cf57715f3e847fad339adcfdaeab511d42d2f7 (patch)
tree1e3310fe82cbffe1b4627a5b59f5a42aeaf95a0d /meta-networking
parentf640eca1cc7919e3f42c9c5790de1d11e982b5f7 (diff)
downloadmeta-openembedded-71cf57715f3e847fad339adcfdaeab511d42d2f7.tar.gz
ipvsadm: Add version 1.26 (initial recipe)
* add ipvs administration tool Signed-off-by: Jianchuan Wang <jianchuan.wang@windriver.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
Diffstat (limited to 'meta-networking')
-rw-r--r--meta-networking/recipes-support/ipvsadm/ipvsadm/0001-Modify-the-Makefile-for-cross-compile.patch97
-rw-r--r--meta-networking/recipes-support/ipvsadm/ipvsadm/0002-Replace-nl_handle-to-nl_sock.patch63
-rw-r--r--meta-networking/recipes-support/ipvsadm/ipvsadm/0003-ipvsadm-remove-dependency-on-bash.patch39
-rw-r--r--meta-networking/recipes-support/ipvsadm/ipvsadm_1.26.bb35
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 000000000..7c3dfe4a8
--- /dev/null
+++ b/meta-networking/recipes-support/ipvsadm/ipvsadm/0001-Modify-the-Makefile-for-cross-compile.patch
@@ -0,0 +1,97 @@
1From 58292175115bae7a4c3600d3022e59ea57213025 Mon Sep 17 00:00:00 2001
2From: Jianchuan Wang <jianchuan.wang@windriver.com>
3Date: Mon, 12 Jan 2015 15:53:23 +0800
4Subject: [PATCH] Modify the Makefile for cross compile.
5
6Upstream-Status: Inappropriate [embedded specific]
7
8Signed-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
14diff --git a/Makefile b/Makefile
15index 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
75diff --git a/libipvs/Makefile b/libipvs/Makefile
76index 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--
961.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 000000000..7896d6d1e
--- /dev/null
+++ b/meta-networking/recipes-support/ipvsadm/ipvsadm/0002-Replace-nl_handle-to-nl_sock.patch
@@ -0,0 +1,63 @@
1From 2686213259b15df9cf1d969c5a14d62f14cfbaae Mon Sep 17 00:00:00 2001
2From: Jianchuan Wang <jianchuan.wang@windriver.com>
3Date: Thu, 8 Jan 2015 17:37:11 +0800
4Subject: [PATCH 2/2] Replace nl_handle to nl_sock.
5
6The nl_handle was replace with nl_sock in the libnl-3.
7
8Upstream-Status: Inappropriate [embedded specific]
9
10Signed-off-by: Jianchuan Wang <jianchuan.wang@windriver.com>
11---
12 libipvs/libipvs.c | 10 +++++-----
13 1 file changed, 5 insertions(+), 5 deletions(-)
14
15diff --git a/libipvs/libipvs.c b/libipvs/libipvs.c
16index 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--
621.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 000000000..800114f2c
--- /dev/null
+++ b/meta-networking/recipes-support/ipvsadm/ipvsadm/0003-ipvsadm-remove-dependency-on-bash.patch
@@ -0,0 +1,39 @@
1From 2f4cdf70cf92d3a9503d8ff045ba277db40bb4e7 Mon Sep 17 00:00:00 2001
2From: Joe MacDonald <joe_macdonald@mentor.com>
3Date: Monday, 13 Apr 2015 14:12:37 -0400
4Subject: [PATCH] ipvsadm: remove dependency on bash
5
6The save/restore scripts are very simple and don't depend on any BASH
7features at all, so switch the interpreter to /bin/sh.
8
9Upstream-Status: Pending
10
11Signed-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
17diff --git a/ipvsadm-restore b/ipvsadm-restore
18index 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
27diff --git a/ipvsadm-save b/ipvsadm-save
28index 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--
381.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 000000000..b640a5081
--- /dev/null
+++ b/meta-networking/recipes-support/ipvsadm/ipvsadm_1.26.bb
@@ -0,0 +1,35 @@
1SUMMARY = "Linux Virtual Server administration Utility"
2DESCRIPTION = "Ipvsadm is used to set up, maintain or inspect the virtual server \
3table in the Linux kernel. The Linux Virtual Server can be used to \
4build scalable network services based on a cluster of two or more nodes. \
5The active node of the cluster redirects service requests to a \
6collection of server hosts that will actually perform the services. \
7Supported features include two protocols (TCP and UDP), three packet-forwarding \
8methods (NAT, tunneling, and direct routing), and eight load balancing algorithms \
9(round robin, weighted round robin, least-connec-tion, weighted least-connection, \
10locality-based least-connection, locality-based least-connection with replication, \
11destination-hashing, and source-hashing)."
12SECTION = "console/network"
13LICENSE = "GPL-2.0"
14LIC_FILES_CHKSUM = "file://README;beginline=40;endline=56;md5=a54cba37b64924aa5008881607942892"
15
16DEPENDS += "libnl popt"
17
18SRC_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
24SRC_URI[md5sum] = "eac3ba3f62cd4dea2da353aeddd353a8"
25SRC_URI[sha256sum] = "6d6c46fecb1c532a892616b4445c73b71730e8790d5630f60269fd9cbee0eb2d"
26
27do_compile() {
28 oe_runmake \
29 CC="${CC} -I${STAGING_INCDIR} -I${STAGING_INCDIR}/libnl3 -L${STAGING_LIBDIR}" \
30 all
31}
32
33do_install() {
34 oe_runmake 'BUILD_ROOT=${D}' install
35}