added my Recipes
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
uname can not get version of kernel correctly while cross compile
|
||||
|
||||
Upstream-Status: Inappropriate [configuration]
|
||||
|
||||
Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
|
||||
---
|
||||
configure.ac | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 523899b..4e6ae0d 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -924,7 +924,7 @@ AC_MSG_RESULT([$ARCH ($host_os)])
|
||||
if test "x$ARCH" = "xlinux"; then
|
||||
AC_MSG_CHECKING([for the linux kernel version])
|
||||
|
||||
- kernel=`uname -r`
|
||||
+ kernel="${KERNEL_VERSION}"
|
||||
|
||||
case "${kernel}" in
|
||||
2.6.*)
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
From 37b662cf44e14b33e93759d4b129d23095b41372 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Wed, 31 Aug 2022 23:55:02 -0700
|
||||
Subject: [PATCH] initialize msghdr portably
|
||||
|
||||
on linux we have musl as an option for system C library and current
|
||||
initialization assumes the structure to be same as glibc, therefore
|
||||
initialize the elements of structure instead, so it can work on both
|
||||
glibc and musl.
|
||||
|
||||
Fixes
|
||||
net.c:115:79: error: incompatible pointer to integer conversion initializing 'int' with an expression of type 'void *' [-Wint-conversion]
|
||||
struct msghdr s_msg = { (void *)&s_sa, sizeof(struct sockaddr_nl), s_io, 1, NULL, 0, 0};
|
||||
^~~~
|
||||
|
||||
Upstream-Status: Submitted [https://github.com/zabbix/zabbix/pull/77]
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
src/libs/zbxsysinfo/linux/net.c | 12 ++++++++++--
|
||||
1 file changed, 10 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/libs/zbxsysinfo/linux/net.c b/src/libs/zbxsysinfo/linux/net.c
|
||||
index 1425a3604d..98f03de0dd 100644
|
||||
--- a/src/libs/zbxsysinfo/linux/net.c
|
||||
+++ b/src/libs/zbxsysinfo/linux/net.c
|
||||
@@ -114,13 +114,21 @@ static int find_tcp_port_by_state_nl(unsigned short port, int state, int *found)
|
||||
|
||||
struct sockaddr_nl s_sa = { AF_NETLINK, 0, 0, 0 };
|
||||
struct iovec s_io[1] = { { &request, sizeof(request) } };
|
||||
- struct msghdr s_msg = { (void *)&s_sa, sizeof(struct sockaddr_nl), s_io, 1, NULL, 0, 0};
|
||||
+ struct msghdr s_msg = { 0 };
|
||||
+ s_msg.msg_name = (void *)&s_sa;
|
||||
+ s_msg.msg_namelen = sizeof(struct sockaddr_nl);
|
||||
+ s_msg.msg_iov = s_io;
|
||||
+ s_msg.msg_iovlen = 1;
|
||||
|
||||
char buffer[BUFSIZ] = { 0 };
|
||||
|
||||
struct sockaddr_nl r_sa = { AF_NETLINK, 0, 0, 0 };
|
||||
struct iovec r_io[1] = { { buffer, BUFSIZ } };
|
||||
- struct msghdr r_msg = { (void *)&r_sa, sizeof(struct sockaddr_nl), r_io, 1, NULL, 0, 0};
|
||||
+ struct msghdr r_msg = { 0 };
|
||||
+ r_msg.msg_name = (void *)&r_sa;
|
||||
+ r_msg.msg_namelen = sizeof(struct sockaddr_nl);
|
||||
+ r_msg.msg_iov = r_io;
|
||||
+ r_msg.msg_iovlen = 1;
|
||||
|
||||
struct nlmsghdr *r_hdr;
|
||||
|
||||
--
|
||||
2.37.3
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
[Unit]
|
||||
Description=Zabbix Monitor Agent
|
||||
After=syslog.target network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=@SBINDIR@/zabbix_agentd -f
|
||||
User=zabbix
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,78 @@
|
||||
SUMMARY = "Open-source monitoring solution for your IT infrastructure"
|
||||
DESCRIPTION = "\
|
||||
ZABBIX is software that monitors numerous parameters of a network and the \
|
||||
health and integrity of servers. ZABBIX uses a flexible notification \
|
||||
mechanism that allows users to configure e-mail based alerts for virtually \
|
||||
any event. This allows a fast reaction to server problems. ZABBIX offers \
|
||||
excellent reporting and data visualisation features based on the stored \
|
||||
data. This makes ZABBIX ideal for capacity planning. \
|
||||
\
|
||||
ZABBIX supports both polling and trapping. All ZABBIX reports and \
|
||||
statistics, as well as configuration parameters are accessed through a \
|
||||
web-based front end. A web-based front end ensures that the status of \
|
||||
your network and the health of your servers can be assessed from any \
|
||||
location. Properly configured, ZABBIX can play an important role in \
|
||||
monitoring IT infrastructure. This is equally true for small \
|
||||
organisations with a few servers and for large companies with a \
|
||||
multitude of servers."
|
||||
HOMEPAGE = "http://www.zabbix.com/"
|
||||
SECTION = "Applications/Internet"
|
||||
LICENSE = "GPL-2.0-or-later"
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=300e938ad303147fede2294ed78fe02e"
|
||||
DEPENDS = "libevent libpcre openldap virtual/libiconv zlib"
|
||||
|
||||
PACKAGE_ARCH = "${MACHINE_ARCH}"
|
||||
|
||||
SRC_URI = "https://cdn.zabbix.com/zabbix/sources/stable/6.2/${BPN}-${PV}.tar.gz \
|
||||
file://0001-Fix-configure.ac.patch \
|
||||
file://0001-initialize-msghdr-portably.patch \
|
||||
file://zabbix-agent.service \
|
||||
"
|
||||
SRC_URI[sha256sum] = "6d423810667b948ed22052d9aa84a035e2d4b92cbe8efdb669cac529806b722d"
|
||||
|
||||
inherit autotools-brokensep linux-kernel-base pkgconfig systemd useradd
|
||||
|
||||
SYSTEMD_PACKAGES = "${PN}"
|
||||
SYSTEMD_SERVICE:${PN} = "zabbix-agent.service"
|
||||
SYSTEMD_AUTO_ENABLE = "enable"
|
||||
|
||||
USERADD_PACKAGES = "${PN}"
|
||||
GROUPADD_PARAM:${PN} = "-r zabbix"
|
||||
USERADD_PARAM:${PN} = "-r -g zabbix -d /var/lib/zabbix \
|
||||
-s /sbin/nologin -c \"Zabbix Monitoring System\" zabbix \
|
||||
"
|
||||
|
||||
KERNEL_VERSION = "${@get_kernelversion_headers('${STAGING_KERNEL_DIR}')}"
|
||||
|
||||
EXTRA_OECONF = " \
|
||||
--enable-dependency-tracking \
|
||||
--enable-agent \
|
||||
--enable-ipv6 \
|
||||
--with-net-snmp \
|
||||
--with-ldap=${STAGING_EXECPREFIXDIR} \
|
||||
--with-unixodbc \
|
||||
--with-ssh2 \
|
||||
--with-sqlite3 \
|
||||
--with-zlib \
|
||||
--with-libpthread \
|
||||
--with-libevent \
|
||||
--with-libpcre=${STAGING_EXECPREFIXDIR} \
|
||||
--with-iconv=${STAGING_EXECPREFIXDIR} \
|
||||
"
|
||||
CFLAGS:append = " -lldap -llber -pthread"
|
||||
|
||||
do_configure:prepend() {
|
||||
export KERNEL_VERSION="${KERNEL_VERSION}"
|
||||
}
|
||||
|
||||
do_install:append() {
|
||||
if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
|
||||
install -d ${D}${systemd_unitdir}/system
|
||||
install -m 0644 ${WORKDIR}/zabbix-agent.service ${D}${systemd_unitdir}/system/
|
||||
sed -i -e 's#@SBINDIR@#${sbindir}#g' ${D}${systemd_unitdir}/system/zabbix-agent.service
|
||||
fi
|
||||
}
|
||||
|
||||
FILES:${PN} += "${libdir}"
|
||||
|
||||
RDEPENDS:${PN} = "logrotate"
|
||||
Reference in New Issue
Block a user