Update buidlroot to version 2016.08.1
This commit is contained in:
@@ -0,0 +1,108 @@
|
||||
From 008dd9771057dbbd7ce971c43bce2a0b05e2cf97 Mon Sep 17 00:00:00 2001
|
||||
From: Baruch Siach <baruch@tkos.co.il>
|
||||
Date: Sun, 21 Aug 2016 08:56:57 +0300
|
||||
Subject: [PATCH] lib/memory: fix indirect static link with zlib
|
||||
|
||||
quagga SNMP support depends on netsnmp, that optionally depends on OpenSSL,
|
||||
which in turn requires zlib. zlib exports the 'zcalloc' symbol, which collides
|
||||
with a function of the same name in memory.c. This is not a problem when
|
||||
linking dynamically, since quagga does not use zlib directly. But static
|
||||
linking fails with the error:
|
||||
|
||||
CCLD ospfd
|
||||
.../output/host/usr/mips64el-buildroot-linux-uclibc/sysroot/usr/lib/libz.a(zutil.o): In function `zcalloc':
|
||||
zutil.c:(.text+0x48): multiple definition of `zcalloc'
|
||||
.../output/build/quagga-1.0.20160315/lib/.libs/libzebra.a(memory.o):memory.c:(.text+0x1a0): first defined here
|
||||
|
||||
Rename 'zcalloc' to 'zzcalloc' to avoid symbol collision.
|
||||
|
||||
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
|
||||
---
|
||||
Patch status: posted upstream
|
||||
https://lists.quagga.net/pipermail/quagga-dev/2016-August/016109.html
|
||||
|
||||
lib/memory.c | 14 ++++++++------
|
||||
lib/memory.h | 4 ++--
|
||||
2 files changed, 10 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/lib/memory.c b/lib/memory.c
|
||||
index 269520d5a435..b1680a5e6f07 100644
|
||||
--- a/lib/memory.c
|
||||
+++ b/lib/memory.c
|
||||
@@ -80,9 +80,11 @@ zmalloc (int type, size_t size)
|
||||
|
||||
/*
|
||||
* Allocate memory as in zmalloc, and also clear the memory.
|
||||
+ * Add an extra 'z' prefix to function name to avoid collision when linking
|
||||
+ * statically with zlib that exports the 'zcalloc' symbol.
|
||||
*/
|
||||
void *
|
||||
-zcalloc (int type, size_t size)
|
||||
+zzcalloc (int type, size_t size)
|
||||
{
|
||||
void *memory;
|
||||
|
||||
@@ -97,9 +99,9 @@ zcalloc (int type, size_t size)
|
||||
}
|
||||
|
||||
/*
|
||||
- * Given a pointer returned by zmalloc or zcalloc, free it and
|
||||
+ * Given a pointer returned by zmalloc or zzcalloc, free it and
|
||||
* return a pointer to a new size, basically acting like realloc().
|
||||
- * Requires: ptr was returned by zmalloc, zcalloc, or zrealloc with the
|
||||
+ * Requires: ptr was returned by zmalloc, zzcalloc, or zrealloc with the
|
||||
* same type.
|
||||
* Effects: Returns a pointer to the new memory, or aborts.
|
||||
*/
|
||||
@@ -109,7 +111,7 @@ zrealloc (int type, void *ptr, size_t size)
|
||||
void *memory;
|
||||
|
||||
if (ptr == NULL) /* is really alloc */
|
||||
- return zcalloc(type, size);
|
||||
+ return zzcalloc(type, size);
|
||||
|
||||
memory = realloc (ptr, size);
|
||||
if (memory == NULL)
|
||||
@@ -122,7 +124,7 @@ zrealloc (int type, void *ptr, size_t size)
|
||||
|
||||
/*
|
||||
* Free memory allocated by z*alloc or zstrdup.
|
||||
- * Requires: ptr was returned by zmalloc, zcalloc, or zrealloc with the
|
||||
+ * Requires: ptr was returned by zmalloc, zzcalloc, or zrealloc with the
|
||||
* same type.
|
||||
* Effects: The memory is freed and may no longer be referenced.
|
||||
*/
|
||||
@@ -196,7 +198,7 @@ mtype_zcalloc (const char *file, int line, int type, size_t size)
|
||||
mstat[type].c_calloc++;
|
||||
mstat[type].t_calloc++;
|
||||
|
||||
- memory = zcalloc (type, size);
|
||||
+ memory = zzcalloc (type, size);
|
||||
mtype_log ("xcalloc", memory, file, line, type);
|
||||
|
||||
return memory;
|
||||
diff --git a/lib/memory.h b/lib/memory.h
|
||||
index 23962235dbfe..501352993d21 100644
|
||||
--- a/lib/memory.h
|
||||
+++ b/lib/memory.h
|
||||
@@ -56,7 +56,7 @@ extern struct mlist mlists[];
|
||||
mtype_zstrdup (__FILE__, __LINE__, (mtype), (str))
|
||||
#else
|
||||
#define XMALLOC(mtype, size) zmalloc ((mtype), (size))
|
||||
-#define XCALLOC(mtype, size) zcalloc ((mtype), (size))
|
||||
+#define XCALLOC(mtype, size) zzcalloc ((mtype), (size))
|
||||
#define XREALLOC(mtype, ptr, size) zrealloc ((mtype), (ptr), (size))
|
||||
#define XFREE(mtype, ptr) do { \
|
||||
zfree ((mtype), (ptr)); \
|
||||
@@ -67,7 +67,7 @@ extern struct mlist mlists[];
|
||||
|
||||
/* Prototypes of memory function. */
|
||||
extern void *zmalloc (int type, size_t size);
|
||||
-extern void *zcalloc (int type, size_t size);
|
||||
+extern void *zzcalloc (int type, size_t size);
|
||||
extern void *zrealloc (int type, void *ptr, size_t size);
|
||||
extern void zfree (int type, void *ptr);
|
||||
extern char *zstrdup (int type, const char *str);
|
||||
--
|
||||
2.8.1
|
||||
|
||||
@@ -24,11 +24,6 @@ config BR2_PACKAGE_QUAGGA_TCP_ZEBRA
|
||||
You'll want this enabled if zebra and the protocol daemon(s) run
|
||||
on different hosts.
|
||||
|
||||
config BR2_PACKAGE_QUAGGA_BABELD
|
||||
bool "BABEL protocol"
|
||||
help
|
||||
Build babeld daemon.
|
||||
|
||||
config BR2_PACKAGE_QUAGGA_BGPD
|
||||
bool "BPGv4+ protocol"
|
||||
help
|
||||
@@ -48,10 +43,6 @@ config BR2_PACKAGE_QUAGGA_OSPFD
|
||||
help
|
||||
Build ospfd daemon.
|
||||
|
||||
config BR2_PACKAGE_QUAGGA_OPAQUE_LSA
|
||||
bool "OSPF Opaque-LSA with OSPFAPI support (RFC2370)"
|
||||
depends on BR2_PACKAGE_QUAGGA_OSPFD
|
||||
|
||||
config BR2_PACKAGE_QUAGGA_OSPF6D
|
||||
bool "OSPFv3 (IPv6) protocol"
|
||||
help
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
# Locally calculated after checking pgp signature
|
||||
sha256 6fd6baadb136a801c29c1dd72d0fe69da9f19ae498e87bff7057778361e43b14 quagga-0.99.24.1.tar.xz
|
||||
sha256 d284af5dd875dbba90ab875d40db5d68fdc9ede17a76f2af525f85344be56767 quagga-1.0.20160315.tar.xz
|
||||
|
||||
@@ -4,13 +4,21 @@
|
||||
#
|
||||
################################################################################
|
||||
|
||||
QUAGGA_VERSION = 0.99.24.1
|
||||
QUAGGA_VERSION = 1.0.20160315
|
||||
QUAGGA_SOURCE = quagga-$(QUAGGA_VERSION).tar.xz
|
||||
QUAGGA_SITE = http://download.savannah.gnu.org/releases/quagga
|
||||
QUAGGA_DEPENDENCIES = host-gawk
|
||||
QUAGGA_LICENSE = GPLv2+
|
||||
QUAGGA_LICENSE_FILES = COPYING
|
||||
QUAGGA_CONF_OPTS = --program-transform-name=''
|
||||
|
||||
# We need to override the sysconf and localstate directories so that
|
||||
# quagga can create files as the quagga user without extra
|
||||
# intervention
|
||||
QUAGGA_CONF_OPTS = \
|
||||
--program-transform-name='' \
|
||||
--sysconfdir=/etc/quagga \
|
||||
--localstatedir=/var/run/quagga
|
||||
|
||||
# 0002-configure-fix-static-linking-with-readline.patch
|
||||
QUAGGA_AUTORECONF = YES
|
||||
|
||||
@@ -22,18 +30,30 @@ QUAGGA_CONF_OPTS += --disable-capabilities
|
||||
endif
|
||||
|
||||
QUAGGA_CONF_OPTS += $(if $(BR2_PACKAGE_QUAGGA_ZEBRA),--enable-zebra,--disable-zebra)
|
||||
QUAGGA_CONF_OPTS += $(if $(BR2_PACKAGE_QUAGGA_BABELD),--enable-babeld,--disable-babeld)
|
||||
QUAGGA_CONF_OPTS += $(if $(BR2_PACKAGE_QUAGGA_BGPD),--enable-bgpd,--disable-bgpd)
|
||||
QUAGGA_CONF_OPTS += $(if $(BR2_PACKAGE_QUAGGA_RIPD),--enable-ripd,--disable-ripd)
|
||||
QUAGGA_CONF_OPTS += $(if $(BR2_PACKAGE_QUAGGA_RIPNGD),--enable-ripngd,--disable-ripngd)
|
||||
QUAGGA_CONF_OPTS += $(if $(BR2_PACKAGE_QUAGGA_OSPFD),--enable-ospfd,--disable-ospfd)
|
||||
QUAGGA_CONF_OPTS += $(if $(BR2_PACKAGE_QUAGGA_OSPFD),--enable-ospfd,--disable-ospfd --disable-ospfapi)
|
||||
QUAGGA_CONF_OPTS += $(if $(BR2_PACKAGE_QUAGGA_OSPF6D),--enable-ospf6d,--disable-ospf6d)
|
||||
QUAGGA_CONF_OPTS += $(if $(BR2_PACKAGE_QUAGGA_PIMD),--enable-pimd,--disable-pimd)
|
||||
QUAGGA_CONF_OPTS += $(if $(BR2_PACKAGE_QUAGGA_WATCHQUAGGA),--enable-watchquagga,--disable-watchquagga)
|
||||
QUAGGA_CONF_OPTS += $(if $(BR2_PACKAGE_QUAGGA_ISISD),--enable-isisd,--disable-isisd)
|
||||
QUAGGA_CONF_OPTS += $(if $(BR2_PACKAGE_QUAGGA_BGP_ANNOUNCE),--enable-bgp-announce,--disable-bgp-announce)
|
||||
QUAGGA_CONF_OPTS += $(if $(BR2_PACKAGE_QUAGGA_TCP_ZERBRA),--enable-tcp-zebra,--disable-tcp-zebra)
|
||||
QUAGGA_CONF_OPTS += $(if $(BR2_PACKAGE_QUAGGA_OPAQUE_LSA),--enable-opaque-lsa,--disable-opaque-lsa)
|
||||
|
||||
define QUAGGA_USERS
|
||||
quagga -1 quagga -1 * - - - Quagga priv drop user
|
||||
endef
|
||||
|
||||
# Set the permissions of /etc/quagga such that quagga (through vtysh)
|
||||
# can save the configuration - set the folder recursively as the files
|
||||
# need to be 600, and then set the folder (non-recursively) to 755 so
|
||||
# it can used. Quagga also needs to write to the folder as it moves
|
||||
# and creates, rather than overwriting.
|
||||
define QUAGGA_PERMISSIONS
|
||||
/etc/quagga r 600 quagga quagga - - - - -
|
||||
/etc/quagga d 755 quagga quagga - - - - -
|
||||
endef
|
||||
|
||||
ifeq ($(BR2_PACKAGE_QUAGGA_SNMP),y)
|
||||
QUAGGA_CONF_ENV += ac_cv_path_NETSNMP_CONFIG=$(STAGING_DIR)/usr/bin/net-snmp-config
|
||||
@@ -48,8 +68,15 @@ else
|
||||
QUAGGA_CONF_OPTS += --disable-vtysh
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_arc),y)
|
||||
ifeq ($(BR2_TOOLCHAIN_SUPPORTS_PIE),)
|
||||
QUAGGA_CONF_OPTS += --disable-pie
|
||||
endif
|
||||
|
||||
define QUAGGA_INSTALL_INIT_SYSTEMD
|
||||
$(INSTALL) -D -m 644 package/quagga/quagga_tmpfiles.conf \
|
||||
$(TARGET_DIR)/usr/lib/tmpfiles.d/quagga.conf
|
||||
$(INSTALL) -D -m 644 package/quagga/quagga@.service \
|
||||
$(TARGET_DIR)/usr/lib/systemd/system/quagga@.service
|
||||
endef
|
||||
|
||||
$(eval $(autotools-package))
|
||||
|
||||
17
bsp/buildroot/package/quagga/quagga@.service
Normal file
17
bsp/buildroot/package/quagga/quagga@.service
Normal file
@@ -0,0 +1,17 @@
|
||||
[Unit]
|
||||
Description=Quagga %i routing daemon
|
||||
ConditionFileIsExecutable=/usr/sbin/%i
|
||||
Wants=quagga@zebra.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
EnvironmentFile=/etc/default/quagga-%i
|
||||
PrivateTmp=true
|
||||
# Systemd doesn't like having %i in the executable path.
|
||||
ExecStart=/usr/bin/env /usr/sbin/%i $OPTS -f /etc/quagga/%i.conf
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
1
bsp/buildroot/package/quagga/quagga_tmpfiles.conf
Normal file
1
bsp/buildroot/package/quagga/quagga_tmpfiles.conf
Normal file
@@ -0,0 +1 @@
|
||||
d /var/run/quagga/ 1755 quagga quagga -
|
||||
Reference in New Issue
Block a user