ucarp: add new recipe
PATCH 1/1 ucarp: add new recipe
UCARP allows a couple of hosts to share common virtual IP addresses in order to provide automatic failover. It is a portable userland implementation of the secure and patent-free Common Address Redundancy Protocol (CARP).
Signed-off-by Yi Zhao <[email protected]>
--- .../ucarp/ucarp/ucarp-configure-sha1.patch | 47 ++++++ .../ucarp/ucarp/ucarp-configure-snprintf.patch | 55 +++++++ meta-cgl-common/recipes-cgl/ucarp/ucarp/ucarp.init | 162 +++++++++++++++++++++ .../recipes-cgl/ucarp/ucarp/ucarp.service | 11 ++ .../recipes-cgl/ucarp/ucarp/vip-001.conf.example | 11 ++ .../recipes-cgl/ucarp/ucarp/vip-common.conf | 8 + .../recipes-cgl/ucarp/ucarp/vip-down.sh | 7 + meta-cgl-common/recipes-cgl/ucarp/ucarp/vip-up.sh | 7 + meta-cgl-common/recipes-cgl/ucarp/ucarp_1.5.2.bb | 65 +++++++++ 9 files changed, 373 insertions(+) create mode 100644 meta-cgl-common/recipes-cgl/ucarp/ucarp/ucarp-configure-sha1.patch create mode 100644 meta-cgl-common/recipes-cgl/ucarp/ucarp/ucarp-configure-snprintf.patch create mode 100644 meta-cgl-common/recipes-cgl/ucarp/ucarp/ucarp.init create mode 100644 meta-cgl-common/recipes-cgl/ucarp/ucarp/ucarp.service create mode 100644 meta-cgl-common/recipes-cgl/ucarp/ucarp/vip-001.conf.example create mode 100644 meta-cgl-common/recipes-cgl/ucarp/ucarp/vip-common.conf create mode 100644 meta-cgl-common/recipes-cgl/ucarp/ucarp/vip-down.sh create mode 100644 meta-cgl-common/recipes-cgl/ucarp/ucarp/vip-up.sh create mode 100644 meta-cgl-common/recipes-cgl/ucarp/ucarp_1.5.2.bb
meta-cgl-common/recipes-cgl/ucarp/ucarp/ucarp-configure-sha1.patch new file +47 -0
@@ -0,0 +1,47 @@ +Configure SHA1 option properly + +Work around a cross-compiling configuration problem by +defaulting the USE_SYSTEM_CRYPT_SHA1 option. + +Upstream-Status: Inappropriate [embedded specific] + +Signed-off-by: Greff Moffatt <[email protected]> +Signed-off-by: Aws Ismail <[email protected]> + +diff --git a/configure.ac b/configure.ac +index fa6300f..3978c43 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -232,32 +232,6 @@ else + [return value of an overflowed snprintf]) + fi + +-AC_MSG_CHECKING(whether you already have a standard SHA1 implementation) +-AC_RUN_IFELSE([AC_LANG_SOURCE([[ +-#include <stdio.h> +-#include <string.h> +-#include <sys/types.h> +-#include <sha1.h> +- +-int main(void) +-{ +- SHA1_CTX ctx; +- char b[41]; +- +- SHA1Init(&ctx); +- SHA1Update(&ctx, (const unsigned char *) "test", 4U); +- SHA1End(&ctx, b); +- b[40] = 0; +- +- return strcasecmp(b, "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3"); +-} +-]])],[ +-AC_MSG_RESULT(yes) +-AC_DEFINE(USE_SYSTEM_CRYPT_SHA1,,[Define if you already have standard +-SHA1 functions]) +-],[AC_MSG_RESULT(no) +-],[]) +- + AC_MSG_CHECKING([whether syslog names are available]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #define SYSLOG_NAMES 1
meta-cgl-common/recipes-cgl/ucarp/ucarp/ucarp-configure-snprintf.patch new file +55 -0
55 lines not on this page · raw message
meta-cgl-common/recipes-cgl/ucarp/ucarp/ucarp.init new file +162 -0
162 lines not on this page · raw message
meta-cgl-common/recipes-cgl/ucarp/ucarp/ucarp.service new file +11 -0
@@ -0,0 +1,11 @@ +[Unit] +Description=Common address redundancy protocol daemon +After=syslog.target network.target + +[Service] +PrivateTmp=true +Type=forking +ExecStart=@LIBEXECDIR@/ucarp start + +[Install] +WantedBy=multi-user.target
meta-cgl-common/recipes-cgl/ucarp/ucarp/vip-001.conf.example new file +11 -0
@@ -0,0 +1,11 @@ +# Virtual IP configuration file for UCARP +# The number (from 001 to 255) in the name of the file is the identifier + +# In the simple scenario, you want a single virtual IP address from the _same_ +# network to be taken over by one of the routers. +SOURCE_ADDRESS="192.168.1.20" +VIP_ADDRESS="192.168.1.252" + +# In more complex scenarios, check the "vip-common" file for values to override +# and how to add options. +
meta-cgl-common/recipes-cgl/ucarp/ucarp/vip-common.conf new file +8 -0
@@ -0,0 +1,8 @@ +# Common VIP settings which can be overridden in individual vip-<nnnn>.conf +PASSWORD="vip" +BIND_INTERFACE="eth0" +SOURCE_ADDRESS="" + +# If you have extra options to add, see "ucarp --help" output +OPTIONS="--shutdown --preempt" +
meta-cgl-common/recipes-cgl/ucarp/ucarp/vip-down.sh new file +7 -0
@@ -0,0 +1,7 @@ +#! /bin/sh +exec 2> /dev/null + +#/sbin/ip addr del "$2"/24 dev "$1" + +# or alternatively: +/sbin/ifconfig "$1":254 down
meta-cgl-common/recipes-cgl/ucarp/ucarp/vip-up.sh new file +7 -0
@@ -0,0 +1,7 @@ +#! /bin/sh +exec 2> /dev/null + +#/sbin/ip addr add "$2"/24 dev "$1" + +# or alternatively: +/sbin/ifconfig "$1":254 "$2" netmask 255.255.255.0
meta-cgl-common/recipes-cgl/ucarp/ucarp_1.5.2.bb new file +65 -0
65 lines not on this page · raw message
Signature · 1 line
2.7.4