added my Recipes

This commit is contained in:
2024-07-11 14:16:35 +02:00
parent 38bc4f53ac
commit 09b621d929
7118 changed files with 525762 additions and 3 deletions

View File

@@ -0,0 +1,37 @@
#! /bin/sh
#
# This is an init script for openembedded
# Copy it to /etc/init.d/atftpd and type
# > update-rc.d atftpd defaults 60
#
test -f /usr/sbin/atftpd || exit 0
test -d /srv/tftp || mkdir -p /srv/tftp
case "$1" in
start)
echo -n "Starting tftp daemon: atftpd"
start-stop-daemon --start --quiet --exec /usr/sbin/atftpd -- --daemon --port 69
echo "."
;;
stop)
echo -n "Stopping tftp daemon: atftpd"
start-stop-daemon --stop --quiet --exec /usr/sbin/atftpd
echo "."
;;
reload|force-reload)
start-stop-daemon --stop --quiet --signal 1 --exec /usr/sbin/atftpd
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "Usage: /etc/init.d/atftpd {start|stop|reload|restart|force-reload}"
exit 1
esac
exit 0

View File

@@ -0,0 +1,10 @@
[Unit]
Description=Advanced TFTP Server
After=syslog.target network.target
[Service]
Type=forking
ExecStart=/usr/sbin/atftpd --daemon --port 69
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,56 @@
SUMMARY = "Advanced TFTP server and client"
SECTION = "net"
HOMEPAGE = "http://packages.debian.org/atftp"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://LICENSE;md5=f65159f73e603f89d6867d43191900e5"
SRCREV = "d5c27eb7a9695d83569767e27ef69674173db39a"
SRC_URI = "git://git.code.sf.net/p/atftp/code;branch=master;protocol=https \
file://atftpd.init \
file://atftpd.service \
"
S = "${WORKDIR}/git"
inherit autotools update-rc.d systemd
PACKAGECONFIG ??= "tcp-wrappers"
PACKAGECONFIG[pcre] = "--enable-libpcre,--disable-libpcre,libpcre"
PACKAGECONFIG[tcp-wrappers] = "--enable-libwrap,--disable-libwrap,tcp-wrappers"
PACKAGECONFIG[readline] = "--enable-libreadline,--disable-libreadline,readline"
INITSCRIPT_PACKAGES = "${PN}d"
INITSCRIPT_NAME:${PN}d = "atftpd"
INITSCRIPT_PARAMS:${PN}d = "defaults 80"
EXTRA_OEMAKE = "CFLAGS='${CFLAGS} -std=gnu89'"
do_install:append() {
install -d ${D}${sysconfdir}/init.d
install -m 0755 ${WORKDIR}/atftpd.init ${D}${sysconfdir}/init.d/atftpd
install -d ${D}/srv/tftp
rm ${D}${sbindir}/in.tftpd
install -d ${D}${systemd_unitdir}/system
install -m 0644 ${WORKDIR}/atftpd.service ${D}${systemd_unitdir}/system
}
PACKAGES =+ "${PN}d"
FILES:${PN} = "${bindir}/*"
FILES:${PN}d = "${sbindir}/* \
${sysconfdir} \
/srv/tftp \
${systemd_unitdir}/system/atftpd.service \
"
SYSTEMD_PACKAGES = "${PN}d"
SYSTEMD_SERVICE:${PN}d = "atftpd.service"
RPROVIDES:${PN}d += "${PN}d-systemd"
RREPLACES:${PN}d += "${PN}d-systemd"
RCONFLICTS:${PN}d += "${PN}d-systemd"

View File

@@ -0,0 +1,30 @@
From d0d5ac317dab11610a5fc91ca3e7f5ad72ce2236 Mon Sep 17 00:00:00 2001
From: Zang Ruochen <zangrc.fnst@cn.fujitsu.com>
Date: Tue, 29 Oct 2019 13:19:37 +0800
Subject: [PATCH] Bug fix for pid_t not found on musl.
When compiling version 5.1.6 on musl, the following error occurs:
log.h:49:8: error: unknown type name 'pid_t'
Upstream-Status: Pending
Signed-off-by: Zang Ruochen <zangrc.fnst@cn.fujitsu.com>
---
lib/defaults.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/defaults.c b/lib/defaults.c
index a6ea116..b3ecfa5 100644
--- a/lib/defaults.c
+++ b/lib/defaults.c
@@ -21,6 +21,7 @@
#include <string.h>
#include <sys/utsname.h>
#include <sys/stat.h>
+#include <sys/types.h>
#include <stdarg.h>
#include "config.h"
--
2.20.1

View File

@@ -0,0 +1,48 @@
From 987c8f4a718cdd6b764592ba7510090a59623959 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 31 Mar 2017 19:10:57 -0700
Subject: [PATCH] Define __SWORD_TYPE and _PATH_NSSWITCH_CONF
if they are not defined as is in musl then define
them here
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
include/automount.h | 8 ++++++++
include/nsswitch.h | 3 +++
2 files changed, 11 insertions(+)
diff --git a/include/automount.h b/include/automount.h
index cc336ad..8bdcf12 100644
--- a/include/automount.h
+++ b/include/automount.h
@@ -42,6 +42,14 @@
#define ENABLE_CORES 1
+#ifndef __SWORD_TYPE
+# if __WORDSIZE == 32 /* System word size */
+# define __SWORD_TYPE int
+# else /* __WORDSIZE == 64 */
+# define __SWORD_TYPE long int
+# endif
+#endif
+
/* We MUST have the paths to mount(8) and umount(8) */
#ifndef HAVE_MOUNT
#error Failed to locate mount(8)!
diff --git a/include/nsswitch.h b/include/nsswitch.h
index d3e4027..7a0c38f 100644
--- a/include/nsswitch.h
+++ b/include/nsswitch.h
@@ -24,6 +24,9 @@
#include <netdb.h>
#include "list.h"
+#ifndef _PATH_NSSWITCH_CONF
+#define _PATH_NSSWITCH_CONF "/etc/nsswitch.conf"
+#endif
#define NSSWITCH_FILE _PATH_NSSWITCH_CONF
enum nsswitch_status {

View File

@@ -0,0 +1,115 @@
From 9fe90ab1e333b2e2bed370ff13ba552eb54c3aaf Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 17 Jul 2021 09:56:28 -0700
Subject: [PATCH] Define __SWORD_TYPE if undefined
These fixes are inspired when building autofs on musl
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
daemon/automount.c | 20 ++++++++++++++------
include/hash.h | 5 +++++
lib/log.c | 6 +++++-
3 files changed, 24 insertions(+), 7 deletions(-)
--- a/daemon/automount.c
+++ b/daemon/automount.c
@@ -1,7 +1,7 @@
/* ----------------------------------------------------------------------- *
*
* automount.c - Linux automounter daemon
- *
+ *
* Copyright 1997 Transmeta Corporation - All Rights Reserved
* Copyright 1999-2000 Jeremy Fitzhardinge <jeremy@goop.org>
* Copyright 2001-2005 Ian Kent <raven@themaw.net>
@@ -11,7 +11,7 @@
* the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,
* USA; either version 2 of the License, or (at your option) any later
* version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@@ -40,6 +40,14 @@
#include <systemd/sd-daemon.h>
#endif
+#ifndef __SWORD_TYPE
+# if __WORDSIZE == 32 /* System word size */
+# define __SWORD_TYPE int
+# else /* __WORDSIZE == 64 */
+# define __SWORD_TYPE long int
+# endif
+#endif
+
#include "automount.h"
#if defined(LIBXML2_WORKAROUND) || defined(TIRPC_WORKAROUND)
#include <dlfcn.h>
@@ -282,7 +290,7 @@ int rmdir_path(struct autofs_point *ap,
dev, buf, st.st_dev);
return -1;
}
-
+
/*
* Last element of path may be a symbolic link; all others
* are directories (and the last directory element is
@@ -455,7 +463,7 @@ int count_mounts(struct autofs_point *ap
counter.count = 0;
counter.dev = dev;
-
+
if (walk_tree(path, counter_fn, 1, ap, &counter) == -1)
return -1;
@@ -811,7 +819,7 @@ static char *automount_path_to_fifo(unsi
/*
* An automount path can be made up of subdirectories. So, to
* create the fifo name, we will just replace instances of '/' with
- * '-'.
+ * '-'.
*/
p = fifo_name + strlen(fifodir);
while (*p != '\0') {
@@ -1640,7 +1648,7 @@ static void return_start_status(void *ar
sc->done = 1;
/*
- * Startup condition mutex must be locked during
+ * Startup condition mutex must be locked during
* the startup process.
*/
status = pthread_cond_signal(&sc->cond);
--- a/include/hash.h
+++ b/include/hash.h
@@ -5,6 +5,11 @@
#include <sys/types.h>
#include <stdint.h>
+#include <linux/stddef.h>
+
+#ifndef __GLIBC__
+#include <sys/reg.h>
+#endif
/*
* The "GOLDEN_RATIO_PRIME" is used in ifs/btrfs/brtfs_inode.h and
--- a/lib/log.c
+++ b/lib/log.c
@@ -38,7 +38,11 @@ static char *prepare_attempt_prefix(cons
char buffer[ATTEMPT_ID_SIZE + 1];
char *prefixed_msg = NULL;
- attempt_id = pthread_getspecific(key_thread_attempt_id);
+ if (key_thread_attempt_id) {
+ attempt_id = pthread_getspecific(key_thread_attempt_id);
+ } else {
+ attempt_id = 0;
+ }
if (attempt_id) {
int len = sizeof(buffer) + 1 + strlen(msg) + 1;

View File

@@ -0,0 +1,31 @@
From d7a34bb388e33d16260b67275cdb58f9c877d324 Mon Sep 17 00:00:00 2001
From: Changqing Li <changqing.li@windriver.com>
Date: Tue, 27 Nov 2018 15:27:47 +0800
Subject: [PATCH] From 6d24365f0828185fd1bb4d199209ca07eb95c41d Mon Sep 17
00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Fri, 24 Aug 2018
06:24:36 +0000 Subject: [PATCH] Do not hardcode path for pkg.m4
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
update patch to version 5.1.6
Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
configure.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.in b/configure.in
index 07c2051..e85d718 100644
--- a/configure.in
+++ b/configure.in
@@ -12,7 +12,7 @@ define([AC_CACHE_SAVE], )dnl
AC_INIT(.autofs-5.1.8)
# for pkg-config macros
-m4_include([/usr/share/aclocal/pkg.m4])
+m4_include([pkg.m4])
#
# autofs installs by default in /usr

View File

@@ -0,0 +1,54 @@
From 88f991b0ebb6fb8fcaad3d0eb8fb51a7439d053e Mon Sep 17 00:00:00 2001
From: Fabian Groffen <grobian@gentoo.org>
Date: Wed, 2 Feb 2022 09:27:13 +0800
Subject: [PATCH 1/2] autofs-5.1.8 - add autofs_strerror_r() helper for musl
If using musl libc the XSI-compliant variant strerror_r() which returns
an integer instead of a pointer so add a helper function to handle this
case.
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
Signed-off-by: Ian Kent <raven@themaw.net>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
include/automount.h | 5 +++++
lib/log.c | 10 ++++++++++
2 files changed, 15 insertions(+)
diff --git a/include/automount.h b/include/automount.h
index 8cd8b3a..f759e59 100644
--- a/include/automount.h
+++ b/include/automount.h
@@ -51,6 +51,11 @@
# endif
#endif
+#ifndef __GLIBC__
+# define strerror_r(N,B,S) autofs_strerror_r(N,B,S)
+char *autofs_strerror_r(int errnum, char *buf, size_t buflen); /* GNU */
+#endif
+
/* We MUST have the paths to mount(8) and umount(8) */
#ifndef HAVE_MOUNT
#error Failed to locate mount(8)!
diff --git a/lib/log.c b/lib/log.c
index 39b1e3b..b99fa39 100644
--- a/lib/log.c
+++ b/lib/log.c
@@ -368,3 +368,13 @@ pid_t log_pidinfo(struct autofs_point *ap, pid_t pid, char *label) {
return ppid;
}
+
+#ifndef __GLIBC__
+# undef strerror_r
+char *autofs_strerror_r(int errnum, char *buf, size_t buflen) {
+ int s = strerror_r(errnum, buf, buflen);
+ if (s)
+ return NULL;
+ return buf;
+}
+#endif
--
2.37.3

View File

@@ -0,0 +1,27 @@
From 745e355ac8b595a27e1fcca75bf01d3e244f4a5f Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 7 Sep 2017 22:22:31 -0700
Subject: [PATCH] modules/lookup_multi.c: Replace __S_IEXEC with S_IEXEC
__S_IEXEC is internal to libc and may not be available on
all libc e.g. musl
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
modules/lookup_multi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules/lookup_multi.c b/modules/lookup_multi.c
index 3ecda6d..cf109de 100644
--- a/modules/lookup_multi.c
+++ b/modules/lookup_multi.c
@@ -452,7 +452,7 @@ int lookup_reinit(const char *my_mapfmt,
continue;
}
- if (st.st_mode & __S_IEXEC)
+ if (st.st_mode & S_IEXEC)
type = src_prog;
else
type = src_file;

View File

@@ -0,0 +1,58 @@
From 096e33743158e0e8c04d60d01cc66e2945d79777 Mon Sep 17 00:00:00 2001
From: Changqing Li <changqing.li@windriver.com>
Date: Tue, 27 Nov 2018 16:52:35 +0800
Subject: [PATCH] From 557ca399f4b3a397f20bb147ec6dc4ab9732dd1e Mon Sep 17
00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Fri, 31 Mar 2017
19:12:10 -0700 Subject: [PATCH] Replace __S_IEXEC with S_IEXEC
S_IEXEC is portable
Signed-off-by: Khem Raj <raj.khem@gmail.com>
update patch to version 5.1.5
Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
daemon/lookup.c | 6 +++---
modules/lookup_multi.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
--- a/daemon/lookup.c
+++ b/daemon/lookup.c
@@ -397,7 +397,7 @@ static int read_file_source_instance(str
return NSS_STATUS_NOTFOUND;
}
- if (st.st_mode & __S_IEXEC)
+ if (st.st_mode & S_IEXEC)
type = src_prog;
else
type = src_file;
@@ -930,7 +930,7 @@ static int lookup_name_file_source_insta
return NSS_STATUS_NOTFOUND;
}
- if (st.st_mode & __S_IEXEC)
+ if (st.st_mode & S_IEXEC)
type = src_prog;
else
type = src_file;
@@ -1077,7 +1077,7 @@ static struct map_source *lookup_get_map
if (!S_ISREG(st.st_mode))
return NULL;
- if (st.st_mode & __S_IEXEC)
+ if (st.st_mode & S_IEXEC)
type = "program";
else
type = "file";
--- a/modules/lookup_multi.c
+++ b/modules/lookup_multi.c
@@ -247,7 +247,7 @@ static struct lookup_mod *nss_open_looku
continue;
}
- if (st.st_mode & __S_IEXEC)
+ if (st.st_mode & S_IEXEC)
type = src_prog;
else
type = src_file;

View File

@@ -0,0 +1,106 @@
From 1c0b0b70a276280f431d72319109a0bbc0267970 Mon Sep 17 00:00:00 2001
From: Fabian Groffen <grobian@gentoo.org>
Date: Wed, 2 Feb 2022 10:15:22 +0800
Subject: [PATCH 2/2] autofs-5.1.8 - handle innetgr() not present in musl
The function innetgr(3) may not be present in musl libc, add a check
for this.
Originally contributed by Fabian, modified by me.
Upstream-Status: Backport [https://git.kernel.org/pub/scm/linux/storage/autofs/autofs.git/commit/?id=f60e40af3c038b8955325a11b7294ad38c15c9e8]
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
Signed-off-by: Ian Kent <raven@themaw.net>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
configure | 6 ++++++
configure.in | 2 +-
include/config.h.in | 3 +++
modules/parse_amd.c | 7 +++++++
4 files changed, 17 insertions(+), 1 deletion(-)
--- a/configure.in
+++ b/configure.in
@@ -169,7 +169,7 @@ AF_CHECK_SSS_LIB(SSS_AUTOFS, libsss_auto
AC_SUBST(HAVE_SSS_AUTOFS)
AC_SUBST(sssldir)
-AC_CHECK_FUNCS(pipe2)
+AC_CHECK_FUNCS(pipe2 innetgr)
#
# Newer mounts have the -s (sloppy) option to ignore unknown options,
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -30,6 +30,9 @@
/* Define to 1 if you have the `getservbyname' function. */
#undef HAVE_GETSERVBYNAME
+/* Define to 1 if you have the `innetgr' function. */
+#undef HAVE_INNETGR
+
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
@@ -45,9 +48,6 @@
/* Define if you have the Linux /proc filesystem. */
#undef HAVE_LINUX_PROCFS
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
/* define if you have MOUNT */
#undef HAVE_MOUNT
@@ -69,6 +69,9 @@
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
+/* Define to 1 if you have the <stdio.h> header file. */
+#undef HAVE_STDIO_H
+
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
@@ -141,7 +144,9 @@
/* define if you have YACC */
#undef PATH_YACC
-/* Define to 1 if you have the ANSI C header files. */
+/* Define to 1 if all of the C90 standard headers exist (not just the ones
+ required in a freestanding environment). This macro is provided for
+ backward compatibility; new code need not use it. */
#undef STDC_HEADERS
/* Define to 1 to use the libtirpc tsd usage workaround */
--- a/modules/parse_amd.c
+++ b/modules/parse_amd.c
@@ -424,6 +424,7 @@ static int sel_in_network(struct autofs_
return ret;
}
+#ifdef HAVE_INNETGR
static int sel_netgrp(struct autofs_point *ap,
struct selector *s, struct substvar *sv)
{
@@ -488,6 +489,7 @@ out:
return ret;
}
+#endif
static int eval_selector(struct autofs_point *ap,
struct amd_entry *this, struct substvar *sv)
@@ -627,7 +629,12 @@ static int eval_selector(struct autofs_p
switch (s->sel->selector) {
case SEL_NETGRP:
case SEL_NETGRPD:
+#ifndef HAVE_INNETGR
+ error(logopt, MODPREFIX
+ "netgroups not available, function innetgr(3) not available");
+#else
ret = sel_netgrp(ap, s, sv);
+#endif
break;
default:

View File

@@ -0,0 +1,25 @@
From df5d45b2d7ad7e7b5f0542a816d08b0409a529a1 Mon Sep 17 00:00:00 2001
From: Roy Li <rongqing.li@windriver.com>
Date: Tue, 19 Aug 2014 11:31:35 +0800
Subject: [PATCH] [PATCH] add the needed stdarg.h
Upstream-Status: Pending
Signed-off-by: Roy Li <rongqing.li@windriver.com>
---
lib/defaults.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/defaults.c b/lib/defaults.c
index 0e48a78..667f35d 100644
--- a/lib/defaults.c
+++ b/lib/defaults.c
@@ -16,6 +16,7 @@
#include <stdlib.h>
#include <stdio.h>
+#include <stdarg.h>
#include <ctype.h>
#include <string.h>
#include <sys/utsname.h>

View File

@@ -0,0 +1,26 @@
From 080626108c9ab70e2489752ef2a14006d0564b0c Mon Sep 17 00:00:00 2001
From: Joe MacDonald <joe.macdonald@windriver.com>
Date: Tue, 18 Jun 2013 10:05:21 -0400
Subject: [PATCH] Fix the dependency issue
Upstream-Status: Pending
autofs's lib sources have a dependency on a number of files that are
generated by rpcgen during buildtime
Signed-off-by: Roy.Li <rongqing.li@windriver.com>
Signed-off-by: Joe MacDonald <joe.macdonald@windriver.com>
---
lib/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/Makefile b/lib/Makefile
index 518b483..4798a4b 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -81,3 +81,4 @@ install: all
clean:
rm -f $(LIB) $(RPCS) $(OBJS) $(YACCSRC) *.output *~
+$(OBJS): $(RPCS)

View File

@@ -0,0 +1,53 @@
From b9b44cd82caceeb638cc6a862b5bb90b93ad6c6a Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 5 Jan 2013 19:53:10 -0800
---
aclocal.m4 | 2 ++
configure.in | 8 ++++++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/aclocal.m4 b/aclocal.m4
index 2115204..2a9a802 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -7,6 +7,8 @@ dnl --------------------------------------------------------------------------
AC_DEFUN(AF_PATH_INCLUDE,
[AC_PATH_PROGS($1,$2,$3,$4)
if test -n "$$1"; then
+ AH_TEMPLATE([HAVE_$1], [Have $2])
+ AH_TEMPLATE([PATH_$1], [Have $2])
AC_DEFINE(HAVE_$1,1,[define if you have $1])
AC_DEFINE_UNQUOTED(PATH_$1, "$$1", [define if you have $1])
HAVE_$1=1
diff --git a/configure.in b/configure.in
index 25d7c4e..44a1c8b 100644
--- a/configure.in
+++ b/configure.in
@@ -324,13 +324,15 @@ AC_PROG_CC
cat > pietest.c <<EOF
int main(void) { return 0; }
EOF
+AF_tmp_ldflags="$LDFLAGS"
+AF_tmp_cflags="$CFLAGS"
CFLAGS=-fPIE
LDFLAGS=-pie
DAEMON_CFLAGS=
DAEMON_LDFLAGS=
AC_MSG_CHECKING([whether gcc -fPIE works])
-AC_RUN_IFELSE([AC_LANG_PROGRAM([[]], [[int main(void) {return 0;}]])],
- [gcc_supports_pie=yes], [gcc_supports_pie=no], [gcc_supports_pie=no])
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[int main(void) {return 0;}]])],
+ [gcc_supports_pie=yes], [gcc_supports_pie=no], [gcc_supports_pie=no])
AC_MSG_RESULT([$gcc_supports_pie])
if test $gcc_supports_pie = yes ; then
DAEMON_CFLAGS="-fPIE"
@@ -339,6 +341,8 @@ fi
rm -f pietest.c
AC_SUBST(DAEMON_CFLAGS)
AC_SUBST(DAEMON_LDFLAGS)
+CFLAGS="${AF_tmp_cflags}"
+LDFLAGS="${AF_tmp_ldflags}"
#
# Enable ability to access value in external env variable

View File

@@ -0,0 +1,76 @@
From 971d48a00ef82880c34e89778bf430a01360ebd5 Mon Sep 17 00:00:00 2001
From: Roy Li <rongqing.li@windriver.com>
Date: Mon, 18 May 2015 16:28:36 +0800
Subject: [PATCH] [PATCH] fix the YACC rule to fix a building failure
Upstream-Statu: Pending
The original rule will create the header file twice, one is that the header
file as the object file is created, other time is when create the C source file.
since YACC always has "-d" parameter.
This lead to a race when compile amd_tok.o, the header file maybe rewritten.
|----------------------
|amd_tok.l:359:10: error: 'RBRACKET' undeclared (first use in this function)
| ")" { return RBRACKET; }
| ^
|../Makefile.rules:64: recipe for target 'amd_tok.o' failed
|----------------------
Signed-off-by: Roy Li <rongqing.li@windriver.com>
---
lib/Makefile | 6 ++++--
modules/Makefile | 3 ++-
2 files changed, 6 insertions(+), 3 deletions(-)
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -53,7 +53,8 @@ mount_xdr.o: mount_xdr.c
nss_tok.c: nss_tok.l
$(LEX) -o$@ -Pnss_ $?
-nss_parse.tab.c nss_parse.tab.h: nss_parse.y
+nss_parse.tab.h: nss_parse.tab.c
+nss_parse.tab.c: nss_parse.y
$(YACC) -v -d -p nss_ -b nss_parse $?
nss_tok.o: nss_tok.c nss_parse.tab.h
--- a/modules/Makefile
+++ b/modules/Makefile
@@ -103,7 +103,8 @@ amd_tok.c: amd_tok.l
amd_tok.o: amd_tok.c amd_parse.tab.h
-amd_parse.tab.c amd_parse.tab.h: amd_parse.y
+amd_parse.tab.h: amd_parse.tab.c
+amd_parse.tab.c: amd_parse.y
$(YACC) -v -d -p amd_ -b amd_parse $?
amd_parse.tab.o: amd_parse.tab.c amd_parse.tab.h
--- a/daemon/Makefile
+++ b/daemon/Makefile
@@ -16,7 +16,7 @@ YACCSRC = master_tok.c master_parse.tab.
version := $(shell cat ../.version)
CFLAGS += -rdynamic $(DAEMON_CFLAGS) -D_GNU_SOURCE -I../include
-CFLAGS += -DAUTOFS_LIB_DIR=\"$(autofslibdir)\"
+CFLAGS += -DAUTOFS_LIB_DIR=\"$(autofslibdir)\"
CFLAGS += -DAUTOFS_MAP_DIR=\"$(autofsmapdir)\"
CFLAGS += -DAUTOFS_CONF_DIR=\"$(autofsconfdir)\"
CFLAGS += -DAUTOFS_FIFO_DIR=\"$(autofsfifodir)\"
@@ -44,7 +44,8 @@ automount: $(OBJS) $(AUTOFS_LIB)
master_tok.c: master_tok.l
$(LEX) -o$@ -Pmaster_ $?
-master_parse.tab.c master_parse.tab.h: master_parse.y
+master_parse.tab.h: master_parse.tab.c
+master_parse.tab.c: master_parse.y
$(YACC) -v -d -p master_ -b master_parse $?
master_tok.o: master_tok.c master_parse.tab.h
@@ -57,5 +58,3 @@ clean:
install: all
install -d -m 755 $(INSTALLROOT)$(sbindir)
install -c automount -m 755 $(INSTALLROOT)$(sbindir)
-
-

View File

@@ -0,0 +1,47 @@
From c500d9906f163bf716c872d37403b9de02ef0a86 Mon Sep 17 00:00:00 2001
From: Amy Fong <amy.fong@windriver.com>
Date: Fri, 18 Jan 2013 12:13:32 -0500
Subject: [PATCH] autofs: fails to compile with openldap disabled
As of 5.0.6, it appears that changes were introduced so that
if you compile with openldap disabled and openldap headers are not
available, then autofs fails to build.
Upstream-Status: Pending
Signed-off-by: Amy Fong <amy.fong@windriver.com>
--
lookup_ldap.h | 4 ++++
1 file changed, 4 insertions(+)
---
include/lookup_ldap.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/include/lookup_ldap.h b/include/lookup_ldap.h
index 3a7aba7..bfdb0b3 100644
--- a/include/lookup_ldap.h
+++ b/include/lookup_ldap.h
@@ -1,7 +1,9 @@
#ifndef LOOKUP_LDAP_H
#define LOOKUP_LDAP_H
+#ifdef WITH_LDAP
#include <ldap.h>
+#endif
#ifdef WITH_SASL
#include <openssl/ssl.h>
@@ -117,10 +119,12 @@ struct lookup_context {
#define LDAP_AUTH_USESIMPLE 0x0008
+#ifdef WITH_LDAP
/* lookup_ldap.c */
LDAP *init_ldap_connection(unsigned logopt, const char *uri, struct lookup_context *ctxt);
int unbind_ldap_connection(unsigned logopt, struct ldap_conn *conn, struct lookup_context *ctxt);
int authtype_requires_creds(const char *authtype);
+#endif
#ifdef WITH_SASL
/* cyrus-sasl.c */

View File

@@ -0,0 +1,26 @@
From 3cbee00fe5725b87abdae80cfa2ee735e4513ca6 Mon Sep 17 00:00:00 2001
From: Roy Li <rongqing.li@windriver.com>
Date: Tue, 19 Aug 2014 11:31:35 +0800
Subject: [PATCH] [PATCH] force STRIP to emtpy
otherwise the generate file will be stripped
Signed-off-by: Roy Li <rongqing.li@windriver.com>
---
Makefile.rules | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile.rules b/Makefile.rules
index 709dd04..b1f7e50 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -31,7 +31,7 @@ LDFLAGS ?= -s
endif
ifdef DONTSTRIP
-STRIP ?= :
+STRIP = :
else
STRIP ?= strip --strip-debug
endif

View File

@@ -0,0 +1,30 @@
Avoid conflicts between sys/mount.h and linux/mount.h
linux/fs.h includes linux/mount.h and this include file is unused so
do not include it and avoid conflict too with glibc 2.36+ see [1]
[1] https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
--- a/modules/parse_amd.c
+++ b/modules/parse_amd.c
@@ -27,7 +27,6 @@
#include <sys/utsname.h>
#include <netinet/in.h>
#include <sys/mount.h>
-#include <linux/fs.h>
#define MODULE_PARSE
#include "automount.h"
--- a/modules/parse_sun.c
+++ b/modules/parse_sun.c
@@ -30,7 +30,6 @@
#include <sys/utsname.h>
#include <netinet/in.h>
#include <sys/mount.h>
-#include <linux/fs.h>
#define MODULE_PARSE
#include "automount.h"

View File

@@ -0,0 +1,29 @@
From a3007d7ea930823926611081bb873ddd771325cb Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 5 Jan 2013 19:53:10 -0800
---
samples/auto.net | 2 +-
samples/auto.smb | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/samples/auto.net b/samples/auto.net
index 0384f61..61215f6 100755
--- a/samples/auto.net
+++ b/samples/auto.net
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# This file must be executable to work! chmod 755!
diff --git a/samples/auto.smb b/samples/auto.smb
index 6af5d85..d296b81 100755
--- a/samples/auto.smb
+++ b/samples/auto.smb
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# This file must be executable to work! chmod 755!

View File

@@ -0,0 +1,37 @@
From 602f9ca83c2bdbf511bcb178fcb4b9fc54da955f Mon Sep 17 00:00:00 2001
From: Changqing Li <changqing.li@windriver.com>
Date: Tue, 27 Nov 2018 15:20:46 +0800
Subject: [PATCH] From e3ae56cf0bb4063c31295f45d04e3c504f4b6cc7 Mon Sep 17
00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Mon, 24 Apr 2017
20:41:25 -0700 Subject: [PATCH] autofs: Upgrade to 5.1.2 release
Use pkg-config first to look for external libnsl which is now
split out from glibc, if it does not exist then see if its provided
by glibc itself.
-Khem
Upstream-Status: Pending
update patch to version 5.1.5
Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
configure.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.in b/configure.in
index 76ecb40..493b9f1 100644
--- a/configure.in
+++ b/configure.in
@@ -238,7 +238,7 @@ AC_SUBST(LIBCLOCK_GETTIME)
PKG_CHECK_MODULES([NSL],[libnsl],,
[
-AC_CHECK_LIB(nsl, yp_match, NSL_LIBS="-lnsl")
+PKG_CHECK_MODULES([NSL], [libnsl], [], [AC_CHECK_LIB([nsl],[yp_match],[LIBNSL="-lnsl"],[LIBNSL=""])])
AC_SUBST(NSL_LIBS)
NSL_CFLAGS=""
])
--
2.7.4

View File

@@ -0,0 +1,118 @@
From cfacbb917f87b903b50132a5025f86b0cc522e9c Mon Sep 17 00:00:00 2001
From: Robert Yang <liezhi.yang@windriver.com>
Date: Sat, 13 Sep 2014 20:19:28 -0700
Subject: [PATCH] autofs.init.in: remove bashism
It can work without the bashism.
Upstream-Status: Pending
Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
redhat/autofs.init.in | 12 ++++++------
samples/rc.autofs.in | 10 +++++-----
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/redhat/autofs.init.in b/redhat/autofs.init.in
index 9d008ff..4f1c0d8 100644
--- a/redhat/autofs.init.in
+++ b/redhat/autofs.init.in
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
#
# rc file for automount using a Sun-style "master map".
#
@@ -42,7 +42,7 @@ if [ -r $confdir/autofs ]; then
. $confdir/autofs
fi
-function start() {
+start() {
# Make sure autofs4 module is loaded
if ! grep -q autofs /proc/filesystems
then
@@ -102,7 +102,7 @@ function start() {
return $RETVAL
}
-function stop() {
+stop() {
echo -n $"Stopping $prog: "
count=0
while [ -n "`pidof $prog`" -a $count -lt 15 ] ; do
@@ -125,7 +125,7 @@ function stop() {
return $RETVAL
}
-function restart() {
+restart() {
status autofs > /dev/null 2>&1
if [ $? -eq 0 ]; then
stop
@@ -143,7 +143,7 @@ function restart() {
start
}
-function reload() {
+reload() {
if [ ! -f /var/lock/subsys/autofs ]; then
echo $"$prog not running"
RETVAL=1
@@ -161,7 +161,7 @@ function reload() {
return $RETVAL
}
-function usage_message() {
+usage_message() {
echo $"Usage: $0 {start|forcestart|stop|status|restart|force-reload|forcerestart|reload|condrestart|try-restart|usage}"
}
diff --git a/samples/rc.autofs.in b/samples/rc.autofs.in
index 487669f..e96cde1 100644
--- a/samples/rc.autofs.in
+++ b/samples/rc.autofs.in
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
#
# rc file for automount using a Sun-style "master map".
#
@@ -36,7 +36,7 @@ if [ -r $confdir/autofs ]; then
. $confdir/autofs
fi
-function start() {
+start() {
echo -n "Starting $prog: "
# Make sure autofs4 module is loaded
@@ -85,7 +85,7 @@ function start() {
return $RETVAL
}
-function stop() {
+stop() {
echo -n $"Stopping $prog: "
count=0
while [ -n "`pidof $prog`" -a $count -lt 15 ] ; do
@@ -102,7 +102,7 @@ function stop() {
return $RETVAL
}
-function restart() {
+restart() {
stop
while [ -n "`pidof $prog`" ] ; do
sleep 5
@@ -110,7 +110,7 @@ function restart() {
start
}
-function reload() {
+reload() {
pid=`pidof $prog`
if [ -z $pid ]; then
echo $"$prog not running"

View File

@@ -0,0 +1,36 @@
From dd90a690f95569b999b8ac9ab57e834b3421dcbb Mon Sep 17 00:00:00 2001
From: Changqing Li <changqing.li@windriver.com>
Date: Tue, 27 Nov 2018 15:19:07 +0800
Subject: [PATCH] From dabcbdae38038a8e4ad2c4286112381c407c5ce7 Mon Sep 17
00:00:00 2001 From: Roy Li <rongqing.li@windriver.com> Date: Tue, 19 Aug 2014
11:31:35 +0800 Subject: [PATCH] using pkg-config to detect libxml-2.0 and
krb5
Upstream-Status: Pending
Signed-off-by: Roy Li <rongqing.li@windriver.com>
update patch to 5.1.5
Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
configure.in | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
--- a/configure.in
+++ b/configure.in
@@ -215,7 +215,14 @@ PKG_CHECK_MODULES([XML], [libxml-2.0], [
AC_DEFINE(LIBXML2_WORKAROUND, 1, [Use libxml2 tsd usage workaround])
], [HAVE_LIBXML=0])
-AF_CHECK_KRB5()
+PKG_CHECK_MODULES(KRB5, [krb5], [
+ HAVE_KRB5=1
+ SAVE_CFLAGS=$CFLAGS
+ SAVE_LIBS=$LIBS
+ CFLAGS="$CFLAGS $KRB5_FLAGS"
+ LIBS="$LIBS $KRB5_LIBS"
+ AC_CHECK_FUNCS([krb5_principal_get_realm])
+], [HAVE_KRB5=0])
AC_SEARCH_LIBS([versionsort],[])
if test "$ac_cv_search_versionsort" = "no"; then

View File

@@ -0,0 +1,100 @@
SUMMARY = "Kernel based automounter for linux"
SECTION = "utils"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=ee9324a6f564bb2376b63878ac396798"
DEPENDS += "libtirpc flex-native bison-native e2fsprogs openssl libxml2 util-linux cyrus-sasl libnsl2"
CFLAGS += "-I${STAGING_INCDIR}/tirpc"
inherit autotools-brokensep systemd update-rc.d pkgconfig
SRC_URI = "${KERNELORG_MIRROR}/linux/daemons/autofs/v5/autofs-${PV}.tar.gz \
file://no-bash.patch \
file://cross.patch \
file://fix_disable_ldap.patch \
file://autofs-5.0.7-fix-lib-deps.patch \
file://add-the-needed-stdarg.h.patch \
file://using-pkg-config-to-detect-libxml-2.0-and-krb5.patch \
file://force-STRIP-to-emtpy.patch \
file://remove-bashism.patch \
file://fix-the-YACC-rule-to-fix-a-building-failure.patch \
file://0001-Define-__SWORD_TYPE-and-_PATH_NSSWITCH_CONF.patch \
file://0002-Replace-__S_IEXEC-with-S_IEXEC.patch \
file://pkgconfig-libnsl.patch \
file://0001-modules-lookup_multi.c-Replace-__S_IEXEC-with-S_IEXE.patch \
file://0001-Do-not-hardcode-path-for-pkg.m4.patch \
file://0001-Bug-fix-for-pid_t-not-found-on-musl.patch \
file://0001-Define-__SWORD_TYPE-if-undefined.patch \
file://mount_conflict.patch \
file://0001-autofs-5.1.8-add-autofs_strerror_r-helper-for-musl.patch \
file://0002-autofs-5.1.8-handle-innetgr-not-present-in-musl.patch \
"
SRC_URI[sha256sum] = "0bd401c56f0eb1ca6251344c3a3d70bface3eccf9c67117cd184422c4cace30c"
UPSTREAM_CHECK_URI = "${KERNELORG_MIRROR}/linux/daemons/autofs/v5/"
INITSCRIPT_NAME = "autofs"
INITSCRIPT_PARAMS = "defaults"
# FIXME: modules/Makefile has crappy rules that don't obey LDFLAGS
#CFLAGS += "${LDFLAGS}"
PACKAGECONFIG[systemd] = "--with-systemd=${systemd_unitdir}/system,--without-systemd,systemd"
PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
EXTRA_OEMAKE = "DONTSTRIP=1"
EXTRA_OECONF += "--disable-mount-locking \
--enable-ignore-busy --with-openldap=no \
--with-confdir=${sysconfdir}/default \
--with-fifodir=/run \
--with-flagdir=/run \
--with-sasl=no --with-libtirpc \
--with-mapdir=${sysconfdir} \
--with-path=${STAGING_BINDIR_NATIVE} \
--with-fifodir=${localstatedir}/run \
--with-flagdir=${localstatedir}/run \
"
CACHED_CONFIGUREVARS = "ac_cv_path_RANLIB=${RANLIB} \
ac_cv_path_RPCGEN=rpcgen \
initdir=${INIT_D_DIR} \
piddir=/run \
"
do_configure:prepend () {
if [ ! -e ${S}/acinclude.m4 ]; then
cp ${S}/aclocal.m4 ${S}/acinclude.m4
fi
cp ${STAGING_DATADIR_NATIVE}/aclocal/pkg.m4 .
}
do_install:append () {
# samples have been removed from SUBDIRS from 5.1.5, need to install separately
oe_runmake 'DESTDIR=${D}' install_samples
if [ -d ${D}/run ]; then
rmdir ${D}/run
fi
if [ -d ${D}${localstatedir}/run ]; then
rmdir ${D}${localstatedir}/run
fi
# On hybrid systemd/sysvinit builds, we need to install the sysvinit script by hand.
if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
install -d -m 755 ${D}${INIT_D_DIR}
install -m 755 ${S}/samples/rc.autofs ${D}${INIT_D_DIR}/autofs
fi
}
SECURITY_CFLAGS = "${SECURITY_NO_PIE_CFLAGS}"
# all the libraries are unversioned, so don't pack it on PN-dev
SOLIBS = ".so"
FILES_SOLIBSDEV = ""
# Some symlinks are created in plugins dir e.g.
# mount_nfs4.so -> mount_nfs.so
INSANE_SKIP:${PN} = "dev-so"
RPROVIDES:${PN} += "${PN}-systemd"
RREPLACES:${PN} += "${PN}-systemd"
RCONFLICTS:${PN} += "${PN}-systemd"
SYSTEMD_SERVICE:${PN} = "autofs.service"

View File

@@ -0,0 +1,13 @@
SUMMARY = "simple dynamic multicast routing daemon that only uses IGMP signalling"
HOMEPAGE = "http://sourceforge.net/projects/igmpproxy/"
LICENSE = "GPL-2.0-or-later"
LIC_FILES_CHKSUM = "file://COPYING;md5=432040ff3a55670c1dec0c32b209ad69"
SRC_URI = "https://github.com/pali/igmpproxy/releases/download/${PV}/${BP}.tar.gz"
SRC_URI[md5sum] = "5565874d9631103109a72452cecb5ce7"
SRC_URI[sha256sum] = "d1fc244cb2fbbf99f720bda3e841fe59ece9b6919073790b4b892739b1b844eb"
UPSTREAM_CHECK_URI = "https://github.com/pali/${BPN}/releases"
inherit autotools pkgconfig

View File

@@ -0,0 +1,56 @@
From 4848b9e4d516a9203c08432901a7b40419e8f43c Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 19 Jul 2017 15:54:35 -0700
Subject: [PATCH 1/3] Respect flags from env
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Makefile | 4 ++--
cli/Makefile | 2 +-
pppd/Makefile | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
index a05a000..439a978 100644
--- a/Makefile
+++ b/Makefile
@@ -81,8 +81,8 @@ LIBS.dmalloc= -ldmalloc
export USE_DMALLOC
endif
-CPPFLAGS= $(CPPFLAGS.ippooltest)
-CFLAGS= -I. -Iusl -Icli -MMD -Wall -g $(CPPFLAGS) $(CPPFLAGS.dmalloc)
+CPPFLAGS+= $(CPPFLAGS.ippooltest)
+CFLAGS+= -I. -Iusl -Icli -MMD -Wall -g $(CPPFLAGS) $(CPPFLAGS.dmalloc)
LDFLAGS.ippoold= $(LDFLAGS) -Wl,-E -L. -Lusl -lusl -lnsl -ldl $(LIBS.dmalloc) -lc
LDFLAGS.ippoolconfig= $(LDFLAGS) -Lcli -lcli -lreadline -lcurses -lnsl $(LIBS.dmalloc) -lc
diff --git a/cli/Makefile b/cli/Makefile
index 4b5dd59..56fbf2f 100644
--- a/cli/Makefile
+++ b/cli/Makefile
@@ -7,7 +7,7 @@ CLI_SRCS_TEST.o= $(CLI_SRCS_TEST.c:%.c=%.o)
LDFLAGS.cli_test= -L.. -L. $(READLINE_LDFLAGS) -lcli -lusl -lreadline -lcurses -lc
-CFLAGS= $(CFLAGS.optimize) -MMD -Wall -Werror -I.. $(READLINE_CFLAGS)
+CFLAGS= $(CFLAGS.optimize) -MMD -Wall -Werror -I.. $(READLINE_CFLAGS) $(CPPFLAGS)
.PHONY: all test clean
diff --git a/pppd/Makefile b/pppd/Makefile
index 106deca..7fd815f 100644
--- a/pppd/Makefile
+++ b/pppd/Makefile
@@ -10,7 +10,7 @@ endif
# END CONFIGURABLE SETTINGS
-CFLAGS += -g -I.. -I/usr/include/pppd $(CFLAGS.pppd) -fPIC
+CFLAGS += -g -I.. -I=/usr/include/pppd $(CFLAGS.pppd) -fPIC
LDFLAGS += -shared
all: ippool.so
--
2.13.3

View File

@@ -0,0 +1,42 @@
From 4788ce6ec602f6441970e1095572c4ff0e90c7c5 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 17 Jan 2023 22:33:52 -0800
Subject: [PATCH] Use unsigned int type for 1-bit integer bitfield
In C++, signed integers are represented in two's complement. This also applies to signed bitfields.
A signed bitfield composed of one bit can therefore store a value in the range -1 to 0.
Assigning a value of 1 to such a bitfield should produce a warning since it is out of range of representable values.
Therefore fix this case by using unsigned int instead of signed int
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
usl/usl_signal.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/usl/usl_signal.c b/usl/usl_signal.c
index 45ddd94..8c1d4d0 100644
--- a/usl/usl_signal.c
+++ b/usl/usl_signal.c
@@ -39,12 +39,12 @@ struct usl_notifier {
};
typedef struct {
- volatile int sighup:1;
- volatile int sigterm:1;
- volatile int sigchld:1;
- volatile int sigusr1:1;
- volatile int sigusr2:1;
- volatile int running:1;
+ volatile unsigned int sighup:1;
+ volatile unsigned int sigterm:1;
+ volatile unsigned int sigchld:1;
+ volatile unsigned int sigusr1:1;
+ volatile unsigned int sigusr2:1;
+ volatile unsigned int running:1;
sig_atomic_t waiting;
sigjmp_buf sigjmp;
} usl_signal_data_t;
--
2.39.1

View File

@@ -0,0 +1,72 @@
From da67444994bde603c7ff1483a6803bdab24e1f14 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 29 Aug 2022 09:36:55 -0700
Subject: [PATCH 1/2] pppd/ippool.c: Fix type casting issues between in_addr
and ippool_api_ip_addr
Also remove unused variabled
Upstream-Status: Inappropriate [No upstream]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
pppd/ippool.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
--- a/pppd/ippool.c
+++ b/pppd/ippool.c
@@ -16,6 +16,7 @@
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <netinet/in.h>
+#include <arpa/inet.h>
#include <signal.h>
#include <linux/types.h>
@@ -24,7 +25,6 @@
const char pppd_version[] = VERSION;
-static int ippool_fd = -1;
static char *ippool_pool_name = NULL;
static char *ippool_pool_name2 = NULL;
static char *ippool_server = "localhost";
@@ -64,9 +64,9 @@ static int ippool_addr_alloc(CLIENT *cl,
}
*addr = clnt_res.addr.s_addr;
-
+ struct in_addr temp_addr = {*addr};
if (ippool_debug) {
- dbglog("Allocated address %s from pool %s", inet_ntoa(clnt_res.addr.s_addr), pool_name);
+ dbglog("Allocated address %s from pool %s", inet_ntoa(temp_addr), pool_name);
}
out:
return result;
@@ -85,14 +85,16 @@ static void ippool_addr_free(CLIENT *cl,
}
if (clnt_res < 0) {
if (ippool_debug) {
+ struct in_addr temp_addr = {free_addr.s_addr};
warn("IP address %s free to pool %s failed: %s",
- inet_ntoa(free_addr), pool_name, strerror(-clnt_res));
+ inet_ntoa(temp_addr), pool_name, strerror(-clnt_res));
}
goto out;
}
if (ippool_debug) {
- dbglog("Freed address %s to pool %s", inet_ntoa(free_addr), pool_name);
+ struct in_addr temp_addr = {free_addr.s_addr};
+ dbglog("Freed address %s to pool %s", inet_ntoa(temp_addr), pool_name);
}
out:
return;
@@ -138,8 +140,6 @@ static void ippool_choose_ip(u_int32_t *
{
ipcp_options *wo = &ipcp_wantoptions[0];
ipcp_options *go = &ipcp_gotoptions[0];
- ipcp_options *ao = &ipcp_allowoptions[0];
- ipcp_options *ho = &ipcp_hisoptions[0];
CLIENT *cl;
int result = 0;

View File

@@ -0,0 +1,31 @@
From e4e0aae139b6489dc582fd14e54e562126482ce2 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 26 Aug 2017 07:23:53 -0700
Subject: [PATCH 1/3] read() returns ssize_t
Fixes
usl_fd.c:284:10: error: comparison of unsigned expression < 0 is always false [-Werror,-Wtautological-compare]
if (nb < 0) {
~~ ^ ~
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
usl/usl_fd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/usl/usl_fd.c b/usl/usl_fd.c
index 3b7a813..04ba48c 100644
--- a/usl/usl_fd.c
+++ b/usl/usl_fd.c
@@ -280,7 +280,7 @@ size_t usl_fd_read(int fd, void *buf, size_t count)
char *ptr = buf;
for (chars_read = 0; chars_read < count; ) {
- size_t nb = read(fd, ptr, count - chars_read);
+ ssize_t nb = read(fd, ptr, count - chars_read);
if (nb < 0) {
if (errno == EINTR)
continue;
--
2.14.1

View File

@@ -0,0 +1,28 @@
From 5d7f20c045b3c74dad2c53d65e30bd4840250082 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 27 Jun 2017 15:17:19 -0700
Subject: [PATCH] usl_timer: Check for return value of write() API
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
usl/usl_timer.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/usl/usl_timer.c b/usl/usl_timer.c
index fda752b..d8414a6 100644
--- a/usl/usl_timer.c
+++ b/usl/usl_timer.c
@@ -94,7 +94,9 @@ void usl_timer_tick(void)
if (!usl_tick_pending) {
usl_tick_pending = 1;
- write(usl_tick_pipe[1], &msg, sizeof(msg));
+ if (write(usl_tick_pipe[1], &msg, sizeof(msg)) != sizeof(msg)) {
+ fprintf(stderr, "write to fd %i failed: %s\n", usl_tick_pipe[1], strerror(errno));
+ }
}
}
--
2.13.2

View File

@@ -0,0 +1,31 @@
From cf25576428903168cd41b183fb1ca9c2b7e2666e Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 26 Aug 2017 07:28:10 -0700
Subject: [PATCH 2/3] Mark first element of a string as null
Fixes
cli_lib.c:427:20: error: expression which evaluates to zero treated as a null pointer constant of type 'char *' [-Werror,-Wnon-literal-null-conversion]
values[arg] = '\0';
^~~~
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
cli/cli_lib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cli/cli_lib.c b/cli/cli_lib.c
index 41a0b06..e4d2fd5 100644
--- a/cli/cli_lib.c
+++ b/cli/cli_lib.c
@@ -424,7 +424,7 @@ int cli_find_args(int argc, char *argv[], struct cli_node *cmd, struct cli_node
if (arg_string[1] == '\0') {
/* no arg value - only allowed for string args */
if (node->arg->parser == cli_arg_parse_string) {
- values[arg] = '\0';
+ *values[arg] = '\0';
} else {
result = -EINVAL;
break;
--
2.14.1

View File

@@ -0,0 +1,22 @@
From f9ea91771f0d3c984e7d5fe9e15962db1ee686ad Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 29 Aug 2022 09:39:16 -0700
Subject: [PATCH 2/2] ippool_rpc_server.c: Add missing prototype for
ippool_api_rpc_check_request
Upstream-Status: Inappropriate [no upstream]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
ippool_rpc_server.c | 2 ++
1 file changed, 2 insertions(+)
--- a/Makefile
+++ b/Makefile
@@ -123,6 +123,7 @@ $(IPPOOL_RPC_STEM)_server.c: $(IPPOOL_RP
-$(RM) $@ $@.tmp
rpcgen $(RPCGENFLAGS) -m -o $@.tmp $<
cat $@.tmp | sed -e 's/switch (rqstp->rq_proc) {/if (ippool_api_rpc_check_request(transp) < 0) return; switch (rqstp->rq_proc) {/' > $@
+ sed -i '20i int ippool_api_rpc_check_request(SVCXPRT *xprt);' $@
$(IPPOOL_RPC_STEM)_client.c: $(IPPOOL_RPC_STEM).x
-$(RM) $@

View File

@@ -0,0 +1,30 @@
From 47aef26198431f7ad568c2277dded158bda3e36f Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 19 Jul 2017 16:00:35 -0700
Subject: [PATCH 2/3] link with libtirpc
musl needs it
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 439a978..ea821eb 100644
--- a/Makefile
+++ b/Makefile
@@ -83,8 +83,8 @@ endif
CPPFLAGS+= $(CPPFLAGS.ippooltest)
CFLAGS+= -I. -Iusl -Icli -MMD -Wall -g $(CPPFLAGS) $(CPPFLAGS.dmalloc)
-LDFLAGS.ippoold= $(LDFLAGS) -Wl,-E -L. -Lusl -lusl -lnsl -ldl $(LIBS.dmalloc) -lc
-LDFLAGS.ippoolconfig= $(LDFLAGS) -Lcli -lcli -lreadline -lcurses -lnsl $(LIBS.dmalloc) -lc
+LDFLAGS.ippoold= $(LDFLAGS) -Wl,-E -L. -Lusl -lusl -ldl $(LIBS.dmalloc) -lc -ltirpc
+LDFLAGS.ippoolconfig= $(LDFLAGS) -Lcli -lcli -lreadline -lcurses $(LIBS.dmalloc) -lc -ltirpc
OPT_CFLAGS?= -O
--
2.13.3

View File

@@ -0,0 +1,58 @@
From 994d9575374d3cdb34b1b0f70c3c53ae76fe578e Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 26 Aug 2017 07:41:05 -0700
Subject: [PATCH 3/3] cli: Mark return of strtol as long int
strtol does not return unsigned long
error: taking the absolute value of unsigned type 'unsigned long' has no effect [-Werror,-Wabsolute-value]
if ((*endp == '\0') && (labs(tmp) < 32768)) {
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
cli/cli_lib.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/cli/cli_lib.c b/cli/cli_lib.c
index e4d2fd5..5f487dc 100644
--- a/cli/cli_lib.c
+++ b/cli/cli_lib.c
@@ -522,7 +522,7 @@ int cli_arg_parse_int32(struct cli_node *arg, const char *val, void *result)
int cli_arg_parse_int16(struct cli_node *arg, const char *val, void *result)
{
int16_t *intval = result;
- unsigned long tmp;
+ long tmp;
char *endp;
int ret = 0;
@@ -539,7 +539,7 @@ int cli_arg_parse_int16(struct cli_node *arg, const char *val, void *result)
int cli_arg_parse_int8(struct cli_node *arg, const char *val, void *result)
{
int8_t *intval = result;
- unsigned long tmp;
+ long tmp;
char *endp;
int ret = 0;
@@ -573,7 +573,7 @@ int cli_arg_parse_uint32(struct cli_node *arg, const char *val, void *result)
int cli_arg_parse_uint16(struct cli_node *arg, const char *val, void *result)
{
uint16_t *intval = result;
- unsigned long tmp;
+ long tmp;
char *endp;
int ret = 0;
@@ -590,7 +590,7 @@ int cli_arg_parse_uint16(struct cli_node *arg, const char *val, void *result)
int cli_arg_parse_uint8(struct cli_node *arg, const char *val, void *result)
{
uint8_t *intval = result;
- unsigned long tmp;
+ long tmp;
char *endp;
int ret = 0;
--
2.14.1

View File

@@ -0,0 +1,80 @@
From eb345047decba665e3f39908336a83f039e1ece2 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 19 Jul 2017 16:01:32 -0700
Subject: [PATCH 3/3] musl fixes
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
cli/cli_readline.c | 7 +-
ippool_api.c | 9 ++-
net/ppp_defs.h | 194 +++++++++++++++++++++++++++++++++++++++++++++++++++++
usl/usl.h | 4 ++
4 files changed, 208 insertions(+), 6 deletions(-)
create mode 100644 net/ppp_defs.h
Index: ippool-1.3/cli/cli_readline.c
===================================================================
--- ippool-1.3.orig/cli/cli_readline.c
+++ ippool-1.3/cli/cli_readline.c
@@ -17,13 +17,14 @@
* Boston, MA 02110-1301 USA
*
*****************************************************************************/
-
+#define _GNU_SOURCE
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/file.h>
#include <sys/stat.h>
-#include <sys/errno.h>
+#include <fcntl.h>
+#include <errno.h>
#include <signal.h>
#include <readline/readline.h>
@@ -630,7 +631,7 @@ static void cli_rl_uninstall_signal_hand
static int cli_rl_install_signal_handlers(void)
{
- __sighandler_t handler;
+ sighandler_t handler;
rl_catch_signals = 0;
rl_clear_signals();
Index: ippool-1.3/ippool_api.c
===================================================================
--- ippool-1.3.orig/ippool_api.c
+++ ippool-1.3/ippool_api.c
@@ -181,10 +181,13 @@ int ippool_api_rpc_check_request(SVCXPRT
* non-loopback interface, reject the request.
*/
if ((!ippool_opt_remote_rpc) &&
- ((xprt->xp_raddr.sin_addr.s_addr != htonl(INADDR_LOOPBACK)) &&
- (xprt->xp_raddr.sin_addr.s_addr != htonl(INADDR_ANY)))) {
+ ((xprt->xp_raddr.sin6_addr.s6_addr != htonl(INADDR_LOOPBACK)) &&
+ (xprt->xp_raddr.sin6_addr.s6_addr != htonl(INADDR_ANY)))) {
+ char straddr[INET6_ADDRSTRLEN];
+ inet_ntop(AF_INET6, &xprt->xp_raddr.sin6_addr, straddr, sizeof(straddr));
+
if (ippool_opt_debug) {
- ippool_log(LOG_ERR, "Rejecting RPC request from %s", inet_ntoa(xprt->xp_raddr.sin_addr));
+ ippool_log(LOG_ERR, "Rejecting RPC request from %s", straddr);
}
svcerr_auth(xprt, AUTH_TOOWEAK);
return -EPERM;
Index: ippool-1.3/usl/usl.h
===================================================================
--- ippool-1.3.orig/usl/usl.h
+++ ippool-1.3/usl/usl.h
@@ -38,6 +38,10 @@
#include "usl_fsm.h"
#include "usl_list.h"
+#ifndef WAIT_ANY
+#define WAIT_ANY (-1)
+#endif
+
#define USL_VERSION "0.6"
#ifdef DEBUG

View File

@@ -0,0 +1,22 @@
ippool: always log to syslog
Even when running in the foreground, send log messages to syslog.
Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Joe Slater <jslater@windriver.com>
--- a/ippool_main.c
+++ b/ippool_main.c
@@ -251,9 +251,8 @@ void ippool_vlog(int level, const char *
if (ippool_opt_nodaemon) {
vprintf(fmt, ap);
printf("\n");
- } else {
- vsyslog(level, fmt, ap);
}
+ vsyslog(level, fmt, ap);
DMALLOC_VMESSAGE(fmt, ap);
}

View File

@@ -0,0 +1,18 @@
[Unit]
Description=ip address pool allocator
Requires=rpcbind.service
After=rpcbind.service
[Service]
Type=simple
# Start ippoold in the foreground!
ExecStart=@SBINDIR@/ippoold -f
# Normal output will go to syslog, so suppress stdout.
StandardOutput=null
# ExecStop is not needed. systemd will send SIGTERM
# and ippoold will exit status 1.
SuccessExitStatus=1
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,65 @@
Fix start error if lsb init-functions doesn't exist
Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
diff --git a/debian/init.d b/debian/init.d
index 363ba89..0327fec 100644
--- a/debian/init.d
+++ b/debian/init.d
@@ -10,6 +10,9 @@
# Description: Start ippool daemon
### END INIT INFO
+# Source function library.
+. /etc/init.d/functions
+
DAEMON=/usr/sbin/ippoold
NAME=ippoold
MODULE=pppol2tp
@@ -18,7 +21,23 @@ MODULE=pppol2tp
test -x $DAEMON || exit 0
# Get lsb functions
-. /lib/lsb/init-functions
+if [ -f /lib/lsb/init-functions ]
+then
+ . /lib/lsb/init-functions
+else
+ log_begin_msg() {
+ echo -n $*
+ }
+
+ log_end_msg() {
+ if [ $1 -eq 0 ]; then
+ echo "done"
+ else
+ echo "failed"
+ fi
+ }
+fi
+
. /etc/default/rcS
case "$1" in
@@ -35,6 +54,10 @@ case "$1" in
fi
log_end_msg $?
;;
+ status)
+ status /usr/sbin/ippoold;
+ exit $?
+ ;;
restart)
$0 stop
sleep 1
@@ -46,7 +69,7 @@ case "$1" in
log_end_msg $?
;;
*)
- log_success_msg "Usage: /etc/init.d/ippoold {start|stop|restart|reload|force-reload}"
+ log_success_msg "Usage: /etc/init.d/ippoold {start|stop|status|restart|reload|force-reload}"
exit 1
esac

View File

@@ -0,0 +1,89 @@
1)add -fPIC for $(IPPOOL_RPC_STEM)_xdr.o, $(IPPOOL_RPC_STEM)_client.o
2)add sub target for subdirs-all, and those dependencies below
pppd plugin directory build depends on $(IPPOOL_RPC_STEM)_xdr.o
$(IPPOOL_RPC_STEM)_client.o ippool_rpc.h
ippoold depends on libusl
ippoolconfig depends on libcli
$(IPPOOL_RPC_STEM)_xdr.o, $(IPPOOL_RPC_STEM)_client.o
$(IPPOOL_RPC_STEM)_server.o *.o in main directory depends on ippool_rpc.h
as those all directly or indirectly include ippool_rpc.h which is
dynamically generated by rpcgen
to make parallel make working.
3)include dependency files for pppd.
Upstream-Status: Pending
Signed-off-by: Yao Zhao <yao.zhao@windriver.com>
---
diff --git a/Makefile b/Makefile
index 73aa72f..4f7af1d 100644
--- a/Makefile
+++ b/Makefile
@@ -106,14 +106,14 @@ all: generated-files $(IPPOOL_RPC_STEM)_xdr.o $(IPPOOL_RPC_STEM)_client.o \
subdirs-all $(PROGS.sbin) $(PROGS.bin)
# Compile without -Wall because rpcgen-generated code is full of warnings
-$(IPPOOL_RPC_STEM)_xdr.o: $(IPPOOL_RPC_STEM)_xdr.c
- $(CC) -I. -MMD -g -c -w $(CPPFLAGS) $(CFLAGS.optimize) $<
+$(IPPOOL_RPC_STEM)_xdr.o: $(IPPOOL_RPC_STEM)_xdr.c $(IPPOOL_RPC_STEM).h
+ $(CC) -I. -MMD -g -c -w $(CPPFLAGS) $(CFLAGS.optimize) $< -fPIC
-$(IPPOOL_RPC_STEM)_client.o: $(IPPOOL_RPC_STEM)_client.c
- $(CC) -I. -MMD -g -c -w $(CPPFLAGS) $(CFLAGS.optimize) $<
+$(IPPOOL_RPC_STEM)_client.o: $(IPPOOL_RPC_STEM)_client.c $(IPPOOL_RPC_STEM).h
+ $(CC) -I. -MMD -g -c -w $(CPPFLAGS) $(CFLAGS.optimize) $< -fPIC
-$(IPPOOL_RPC_STEM)_server.o: $(IPPOOL_RPC_STEM)_server.c
- $(CC) -I. -MMD -g -c -w $(CPPFLAGS) $(CFLAGS.optimize) $<
+$(IPPOOL_RPC_STEM)_server.o: $(IPPOOL_RPC_STEM)_server.c $(IPPOOL_RPC_STEM).h
+ $(CC) -I. -MMD -g -c -w $(CPPFLAGS) $(CFLAGS.optimize) $< -fPIC
$(IPPOOL_RPC_STEM)_xdr.c: $(IPPOOL_RPC_STEM).x
-$(RM) $@
@@ -136,8 +136,12 @@ $(IPPOOL_RPC_STEM).h: $(IPPOOL_RPC_STEM).x
generated-files: $(RPC_FILES)
-subdirs-all:
- @for d in $(SUBDIRS); do $(MAKE) -C $$d $(MFLAGS) EXTRA_CFLAGS="$(CPPFLAGS)" all; if [ $$? -ne 0 ]; then exit 1; fi; done
+subdirs-all: $(patsubst %,%-dir, $(SUBDIRS))
+
+pppd-dir: $(IPPOOL_RPC_STEM)_xdr.o $(IPPOOL_RPC_STEM)_client.o $(IPPOOL_RPC_STEM).h
+
+$(patsubst %,%-dir,$(SUBDIRS)):
+ @for d in $(patsubst %-dir,%,$@); do $(MAKE) -C $$d $(MFLAGS) EXTRA_CFLAGS="$(CPPFLAGS)" all; if [ $$? -ne 0 ]; then exit 1; fi; done
clean:
@for d in $(SUBDIRS); do $(MAKE) -C $$d $(MFLAGS) $@; if [ $$? -ne 0 ]; then exit 1; fi; done
@@ -151,13 +155,13 @@ TAGS:
@for d in $(SUBDIRS); do $(MAKE) -C $$d $(MFLAGS) $@; done
etags -t $(wildcard *.c) $(wildcard *.h)
-ippoold: $(IPPOOLD_SRCS.o)
- $(CC) -o $@ $^ $(LDFLAGS.ippoold)
+ippoold: $(IPPOOLD_SRCS.o) usl-dir
+ $(CC) -o $@ $(IPPOOLD_SRCS.o) $(LDFLAGS.ippoold)
-ippoolconfig: $(IPPOOLCONFIG_SRCS.o)
- $(CC) -o $@ $^ $(LDFLAGS.ippoolconfig)
+ippoolconfig: $(IPPOOLCONFIG_SRCS.o) cli-dir
+ $(CC) -o $@ $(IPPOOLCONFIG_SRCS.o) $(LDFLAGS.ippoolconfig)
-%.o: %.c
+%.o: %.c $(IPPOOL_RPC_STEM).h
$(CC) -c $(CFLAGS) $< -o $@
install: all
diff --git a/pppd/Makefile b/pppd/Makefile
index 78d9b33..106deca 100644
--- a/pppd/Makefile
+++ b/pppd/Makefile
@@ -24,3 +24,5 @@ install: ippool.so
clean:
-rm -rf *.o *.so
+
+include $(wildcard *.d /dev/null)

View File

@@ -0,0 +1,49 @@
include limits.h to avoid UINT_MAX undefined compiling error.
remove the unused assign which caused compiling error with -Werror.
Upstream-Status: Pending
Signed-off-by: Yao Zhao <yao.zhao@windriver.com>
---
diff --git a/usl/usl_timer.c b/usl/usl_timer.c
index 734b820..fda752b 100644
--- a/usl/usl_timer.c
+++ b/usl/usl_timer.c
@@ -42,6 +42,7 @@
#include <signal.h>
#include <string.h>
#include <sys/time.h>
+#include <limits.h>
#include "usl.h"
@@ -87,14 +88,13 @@ void (*usl_timer_tick_hook)(void);
*/
void usl_timer_tick(void)
{
- int result;
char msg = '\0';
usl_tick++;
if (!usl_tick_pending) {
usl_tick_pending = 1;
- result = write(usl_tick_pipe[1], &msg, sizeof(msg));
+ write(usl_tick_pipe[1], &msg, sizeof(msg));
}
}
@@ -111,11 +111,10 @@ static void usl_timer_tick_handler(int fd, void *arg)
struct usl_ord_list_head *tmp;
struct usl_list_head *iwalk;
struct usl_list_head *itmp;
- int result;
char msg;
USL_LIST_HEAD(expire_list);
- result = usl_fd_read(usl_tick_pipe[0], &msg, sizeof(msg));
+ usl_fd_read(usl_tick_pipe[0], &msg, sizeof(msg));
usl_tick_pending = 0;
usl_list_for_each(walk, tmp, &usl_timer_list) {

View File

@@ -0,0 +1,21 @@
Add LDFLAGS variable to Makefile so that extra linker flags can be sent via this variable.
Upstream-Status: Pending
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
diff --git a/Makefile b/Makefile
index 4f7af1d..a05a000 100644
--- a/Makefile
+++ b/Makefile
@@ -83,8 +83,8 @@ endif
CPPFLAGS= $(CPPFLAGS.ippooltest)
CFLAGS= -I. -Iusl -Icli -MMD -Wall -g $(CPPFLAGS) $(CPPFLAGS.dmalloc)
-LDFLAGS.ippoold= -Wl,-E -L. -Lusl -lusl -lnsl -ldl $(LIBS.dmalloc) -lc
-LDFLAGS.ippoolconfig= -Lcli -lcli -lreadline -lcurses -lnsl $(LIBS.dmalloc) -lc
+LDFLAGS.ippoold= $(LDFLAGS) -Wl,-E -L. -Lusl -lusl -lnsl -ldl $(LIBS.dmalloc) -lc
+LDFLAGS.ippoolconfig= $(LDFLAGS) -Lcli -lcli -lreadline -lcurses -lnsl $(LIBS.dmalloc) -lc
OPT_CFLAGS?= -O

View File

@@ -0,0 +1,26 @@
#!/bin/sh
BANNER="----------------------------------------------------------------------------"
TCLSH="tclsh all.tcl -preservecore 3 -verbose bps -tmpdir ./results -outfile test-ippool.result"
test_setup() {
if [ -d ./results ]; then rm -fr ./results; fi
mkdir ./results
}
test_ippool() {
echo "${BANNER}"
eval $TCLSH -constraints "ipPool"
}
test_postprocess() {
echo "${BANNER}"
(failed=`grep FAILED results/*.result | wc -l`; \
let failed2=failed/2 ;\
passed=`grep PASSED results/*.result | wc -l`; \
echo "TEST SUMMARY: $passed tests PASSED, $failed2 tests FAILED" ;\
exit $failed2)
}
test_setup
test_ippool
test_postprocess

View File

@@ -0,0 +1,39 @@
Replace strncpy with memcpy
since the length of data to
be copied has already been determined with strlen(). Replace strncpy()
with memcpy() to address the warning and optimize the code a little.
| ippool_config.c:112:2: note: 'snprintf' output between 8 and 55 bytes into a destination of size 48
| 112 | snprintf(prompt, sizeof(prompt), "ippool-%s", server_name);
| | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
--- a/cli/cli_readline.c
+++ b/cli/cli_readline.c
@@ -257,10 +257,15 @@ static void cli_rl_display_wrapped_text(
int pos;
int in_ws;
int i;
+ int bufsize = sizeof(text_buf)/sizeof(text_buf[0]);
if (left_margin == 0) {
left_margin = 3;
}
+ if (left_margin > bufsize) {
+ left_margin = bufsize;
+ }
+
if (right_margin == 0) {
right_margin = 78;;
}
@@ -271,7 +276,7 @@ static void cli_rl_display_wrapped_text(
/* First copy the text heading to the buffer and add a "-", accounting for
* the specified left margin.
*/
- strncpy(&text_buf[0], text1, left_margin - 3);
+ memcpy(&text_buf[0], text1, left_margin - 3);
for (pos = strlen(text1); pos < left_margin - 3; pos++) {
text_buf[pos] = ' ';
}

View File

@@ -0,0 +1,113 @@
SUMMARY = "An IP address pool manager"
DESCRIPTION = "IpPool is implemented as a separate server daemon \
to allow any application to use its address pools. This makes it possible \
to define address pools that are shared by PPP, L2TP, PPTP etc. It may be \
useful in some VPN server setups. IpPool comes with a command line \
management application, ippoolconfig to manage and query address pool \
status. A pppd plugin is supplied which allows pppd to request IP \
addresses from ippoold. \
"
HOMEPAGE = "http://www.openl2tp.org/"
SECTION = "console/network"
LICENSE = "GPL-2.0-or-later"
SRC_URI = "https://sourceforge.net/projects/openl2tp/files/${BPN}/${PV}/${BPN}-${PV}.tar.gz \
file://runtest.sh \
file://ippool.service \
file://ippool_usl_timer.patch \
file://ippool_parallel_make_and_pic.patch \
file://ippool_init.d.patch \
file://always_syslog.patch \
file://makefile-add-ldflags.patch \
file://0001-usl_timer-Check-for-return-value-of-write-API.patch \
file://0001-Respect-flags-from-env.patch \
file://0001-read-returns-ssize_t.patch \
file://0002-Mark-first-element-of-a-string-as-null.patch \
file://0003-cli-Mark-return-of-strtol-as-long-int.patch \
file://0002-link-with-libtirpc.patch \
file://0003-musl-fixes.patch \
file://strncpy-truncation.patch \
file://0001-pppd-ippool.c-Fix-type-casting-issues-between-in_add.patch \
file://0002-ippool_rpc_server.c-Add-missing-prototype-for-ippool.patch \
file://0001-Use-unsigned-int-type-for-1-bit-integer-bitfield.patch \
"
LIC_FILES_CHKSUM = "file://LICENSE;md5=4c59283b82fc2b166455e0fc23c71c6f"
SRC_URI[md5sum] = "e2401e65db26a3764585b97212888fae"
SRC_URI[sha256sum] = "d3eab7d6cad5da8ccc9d1e31d5303e27a39622c07bdb8fa3618eea314412075b"
inherit systemd
DEPENDS = "readline ppp ncurses gzip-native rpcsvc-proto-native libtirpc"
RDEPENDS:${PN} = "rpcbind"
EXTRA_OEMAKE = "CC='${CC}' AS='${AS}' LD='${LD}' AR='${AR}' NM='${NM}' STRIP='${STRIP}'"
EXTRA_OEMAKE += "PPPD_VERSION=${PPPD_VERSION} SYS_LIBDIR=${libdir}"
# enable self tests
EXTRA_OEMAKE += "IPPOOL_TEST=y"
CPPFLAGS += "${SELECTED_OPTIMIZATION} -I${STAGING_INCDIR}/tirpc"
SYSTEMD_SERVICE:${PN} = "ippool.service"
SYSTEMD_AUTO_ENABLE = "disable"
do_compile:prepend() {
# fix the CFLAGS= and CPPFLAGS= in main Makefile, to have the extra CFLAGS in env
sed -i -e "s/^CFLAGS=/CFLAGS+=/" ${S}/Makefile
sed -i -e "s/^CPPFLAGS=/CPPFLAGS+=/" ${S}/Makefile
sed -i -e "s:-I/usr/include/pppd:-I=/usr/include/pppd:" ${S}/pppd/Makefile
}
do_install() {
oe_runmake DESTDIR=${D} install
install -D -m 0755 ${S}/debian/init.d ${D}${sysconfdir}/init.d/ippoold
install -D -m 0644 ${WORKDIR}/ippool.service ${D}${systemd_system_unitdir}/ippool.service
sed -i -e 's:@SBINDIR@:${sbindir}:g' ${D}${systemd_system_unitdir}/ippool.service
# install self test
install -d ${D}/opt/${BPN}
install ${S}/test/all.tcl ${S}/test/ippool.test \
${S}/test/test_procs.tcl ${D}/opt/${BPN}
install ${WORKDIR}/runtest.sh ${D}/opt/${BPN}
# fix the ../ippoolconfig in test_procs.tcl
sed -i -e "s:../ippoolconfig:ippoolconfig:" \
${D}/opt/${BPN}/test_procs.tcl
}
PACKAGES =+ "${PN}-test"
FILES:${PN} += "${libdir}/pppd/${PPPD_VERSION}/ippool.so"
FILES:${PN}-dbg += "${libdir}/pppd/${PPPD_VERSION}/.debug/ippool.so"
FILES:${PN}-test = "/opt/${BPN}"
# needs tcl to run tests
RDEPENDS:${PN}-test += "tcl ${BPN}"
PPPD_VERSION="${@get_ppp_version(d)}"
def get_ppp_version(d):
import re
pppd_plugin = d.expand('${STAGING_LIBDIR}/pppd')
if not os.path.isdir(pppd_plugin):
return None
bb.debug(1, "pppd plugin dir %s" % pppd_plugin)
r = re.compile(r"\d*\.\d*\.\d*")
for f in os.listdir(pppd_plugin):
if os.path.isdir(os.path.join(pppd_plugin, f)):
ma = r.match(f)
if ma:
bb.debug(1, "pppd version dir %s" % f)
return f
else:
bb.debug(1, "under pppd plugin dir %s" % f)
return None

View File

@@ -0,0 +1,31 @@
From 6afdfbdf1ecf3e7e9158734a3994a57ea151d680 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 12 Aug 2020 12:00:29 -0700
Subject: [PATCH] Makefile: Do not set -Werror
clang finds more warnings which causes build to fail, disable treating
warning as errors
Upstream-Status: Inappropriate [OE-Specific]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
usr/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/usr/Makefile b/usr/Makefile
index 84f33bc..9e7b839 100644
--- a/usr/Makefile
+++ b/usr/Makefile
@@ -44,7 +44,7 @@ HOMEDIR ?= $(etcdir)/iscsi
PKG_CONFIG ?= /usr/bin/pkg-config
CFLAGS ?= -O2 -g
-WARNFLAGS ?= -Wall -Wextra -Werror -Wstrict-prototypes -fno-common
+WARNFLAGS ?= -Wall -Wextra -Wstrict-prototypes -fno-common
CFLAGS += $(WARNFLAGS) -I../include -I. -D_GNU_SOURCE \
-I$(TOPDIR)/libopeniscsiusr \
-DISCSI_VERSION_STR=\"$(ISCSI_VERSION_STR)\"
--
2.34.1

View File

@@ -0,0 +1,2 @@
# <type> <owner> <group> <mode> <path> <linksource>
d root root 0755 /var/lock/iscsi none

View File

@@ -0,0 +1,119 @@
#! /bin/sh
### BEGIN INIT INFO
# Provides:
# Required-Start:
# Required-Stop:
# Default-Start:
# Default-Stop:
# Short-Description: Starts and stops the iSCSI initiator services and logins to default targets
### END INIT INFO
#set -x
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/iscsid
ADM=/usr/sbin/iscsiadm
PIDFILE=/var/run/iscsid.pid
[ -x "$DAEMON" ] || exit 0
if [ ! -d /sys/class/ ]; then
echo "Failure:" "iSCSI requires a mounted sysfs, not started."
exit 1
fi
nodestartup_re='s/^node\.conn\[0]\.startup[ ]*=[ ]*//p'
RETVAL=0
start() {
echo "Starting iSCSI initiator service" "iscsid"
modprobe -q iscsi_tcp 2>/dev/null || :
modprobe -q ib_iser 2>/dev/null || :
if [ ! -f /etc/iscsi/initiatorname.iscsi ]; then
INITIATORNAME=$(iscsi-iname)
cat >/etc/iscsi/initiatorname.iscsi <<EOF
## DO NOT EDIT OR REMOVE THIS FILE!
## If you remove this file, the iSCSI daemon will not start.
## If you change the InitiatorName, existing access control lists
## may reject this initiator. The InitiatorName must be unique
## for each iSCSI initiator. Do NOT duplicate iSCSI InitiatorNames.
InitiatorName=$INITIATORNAME
EOF
fi
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON
RETVAL=$?
starttargets
}
starttargets() {
echo "Setting up iSCSI targets"
$ADM -m node --loginall=automatic
}
stoptargets() {
echo "Disconnecting iSCSI targets"
sync
$ADM -m node --logoutall=all
RETVAL=$?
#if RETVAL is 21, means no active sessions, consider ok
if [ "$RETVAL" = "21" ]; then
RETVAL=0
fi
}
stop() {
stoptargets
if [ $RETVAL -ne 0 ]; then
echo "Failure:" "Could not stop all targets, try again later"
return $RETVAL
fi
echo "Stopping iSCSI initiator service"
start-stop-daemon --stop --quiet --pidfile $PIDFILE --exec $DAEMON
rm -f $PIDFILE
status=0
modprobe -r ib_iser 2>/dev/null
if [ "$?" -ne "0" -a "$?" -ne "1" ]; then
status=1
fi
modprobe -r iscsi_tcp 2>/dev/null
if [ "$?" -ne "0" -a "$?" -ne "1" ]; then
status=1
fi
}
restart() {
stop
if [ $RETVAL -ne 0 ]; then
echo "Failure:" "Stopping iSCSI initiator service failed, not starting"
return $RETVAL
fi
start
}
restarttargets() {
stoptargets
if [ $RETVAL -ne 0 ]; then
echo "Failure:" "Could not stop all targets, try again later"
return $RETVAL
fi
starttargets
}
status() {
#XXX FIXME: what to do here?
#status iscsid
# list active sessions
echo Current active iSCSI sessions:
$ADM -m session
}
case "$1" in
start|starttargets|stop|stoptargets|restart|restarttargets|status)
$1
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
;;
esac
exit $RETVAL

View File

@@ -0,0 +1,4 @@
# default command line settings for open-iscsi's iscsid
OPTS_ISCSID=""
OPTS_ISCSIADM=""

View File

@@ -0,0 +1,15 @@
[Unit]
Description=Open-iSCSI initiator (i.e. client) target bindings
After=iscsi-initiator.service
Requires=iscsi-initiator.service
[Service]
Type=oneshot
EnvironmentFile=/etc/default/iscsi-initiator
ExecStart=/usr/sbin/iscsiadm -m node --loginall=automatic $OPTS_ISCSIADM
ExecStop=/usr/sbin/iscsiadm -m node --logoutall=all $OPTS_ISCSIADM
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,13 @@
[Unit]
Description=Open-iSCSI initiator (i.e. client) service
After=syslog.target
[Service]
EnvironmentFile=/etc/default/iscsi-initiator
ExecStartPre=/sbin/modprobe iscsi_tcp
ExecStartPre=/usr/lib/iscsi/set_initiatorname
ExecStart=/usr/sbin/iscsid -f $OPTS_ISCSID
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,12 @@
#!/bin/sh
if [ ! -f /etc/iscsi/initiatorname.iscsi ]; then
INITIATORNAME=$(iscsi-iname)
cat >/etc/iscsi/initiatorname.iscsi <<EOF
## DO NOT EDIT OR REMOVE THIS FILE!
## If you remove this file, the iSCSI daemon will not start.
## If you change the InitiatorName, existing access control lists
## may reject this initiator. The InitiatorName must be unique
## for each iSCSI initiator. Do NOT duplicate iSCSI InitiatorNames.
InitiatorName=$INITIATORNAME
EOF
fi

View File

@@ -0,0 +1,118 @@
SUMMARY = "iSCSI daemon and utility programs"
DESCRIPTION = "Open-iSCSI project is a high performance, transport \
independent, multi-platform implementation of RFC3720. The iscsi package \
provides the server daemon for the iSCSI protocol, as well as the utility \
programs used to manage it. iSCSI is a protocol for distributed \
disk access using SCSI commands sent over Internet Protocol networks."
HOMEPAGE = "http://www.open-iscsi.com/"
LICENSE = "GPL-2.0-only & LGPL-2.1-only"
SECTION = "net"
DEPENDS = "openssl flex-native bison-native open-isns util-linux kmod"
DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}"
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
SRCREV = "543ba0f15d340b97f30782308cec424a6738fec3"
SRC_URI = "git://github.com/open-iscsi/open-iscsi;branch=master;protocol=https \
file://0001-Makefile-Do-not-set-Werror.patch \
file://initd.debian \
file://99_iscsi-initiator-utils \
file://iscsi-initiator \
file://iscsi-initiator.service \
file://iscsi-initiator-targets.service \
file://set_initiatorname \
"
S = "${WORKDIR}/git"
inherit update-rc.d systemd autotools pkgconfig
EXTRA_OECONF = " \
--target=${TARGET_SYS} \
--host=${BUILD_SYS} \
"
EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', '--without-systemd NO_SYSTEMD=1', d)}"
EXTRA_OEMAKE = ' \
OS="${TARGET_SYS}" \
TARGET="${TARGET_OS}" \
BASE="${prefix}" \
MANDIR="${mandir}" \
OPTFLAGS="-DNO_SYSTEMD ${CFLAGS}" \
PKG_CONFIG="${STAGING_BINDIR_NATIVE}/pkg-config" \
SED=sed \
'
do_configure () {
cd ${S}/iscsiuio ; autoreconf --install; ./configure ${EXTRA_OECONF}
}
do_compile () {
# Make sure we DO NOT regenerate prom_lex.c.
if [ -f ${S}/utils/fwparam_ibft/prom_lex.l ]; then
mv ${S}/utils/fwparam_ibft/prom_lex.l ${S}/utils/fwparam_ibft/prom_lex.l.unused
fi
oe_runmake -C ${S} ${EXTRA_OEMAKE} user
}
do_install () {
#install necessary directories
install -d ${D}${sbindir} \
${D}${sysconfdir}/init.d \
${D}${sysconfdir}/iscsi \
${D}${localstatedir}/lib/iscsi/nodes \
${D}${localstatedir}/lib/iscsi/send_targets \
${D}${localstatedir}/lib/iscsi/static \
${D}${localstatedir}/lib/iscsi/isns \
${D}${localstatedir}/lib/iscsi/slp \
${D}${localstatedir}/lib/iscsi/ifaces \
${D}${libdir} \
${D}${mandir}/man8
install -p -m 755 ${S}/usr/iscsid ${S}/usr/iscsiadm \
${S}/utils/iscsi-iname \
${S}/usr/iscsistart ${D}/${sbindir}
cp -dR ${S}/libopeniscsiusr/libopeniscsiusr.so* ${D}${libdir}
install -p -m 644 ${S}/doc/iscsiadm.8 ${S}/doc/iscsid.8 ${D}/${mandir}/man8
install -p -m 644 ${S}/etc/iscsid.conf ${D}${sysconfdir}/iscsi
install -p -m 755 ${WORKDIR}/initd.debian ${D}${sysconfdir}/init.d/iscsid
sed -i -e "s:= /sbin/iscsid:= ${sbindir}/iscsid:" ${D}${sysconfdir}/iscsi/iscsid.conf
if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
install -d ${D}${sysconfdir}/tmpfiles.d
echo "d /run/${BPN}/lock - - - -" \
> ${D}${sysconfdir}/tmpfiles.d/iscsi.conf
install -d ${D}/etc/default/
install -p -m 755 ${WORKDIR}/iscsi-initiator ${D}${sysconfdir}/default/
install -d ${D}${systemd_unitdir}/system/
install -m 0644 ${WORKDIR}/iscsi-initiator.service \
${WORKDIR}/iscsi-initiator-targets.service \
${D}${systemd_unitdir}/system/
install -d ${D}${nonarch_libdir}/iscsi
install -m 0755 ${WORKDIR}/set_initiatorname ${D}${nonarch_libdir}/iscsi
else
install -d ${D}/etc/default/volatiles
install -m 0644 ${WORKDIR}/99_iscsi-initiator-utils ${D}/etc/default/volatiles
fi
}
pkg_postinst:${PN}() {
if [ "x$D" = "x" ]; then
if [ -e /etc/init.d/populate-volatile.sh ]; then
/etc/init.d/populate-volatile.sh update
elif command -v systemd-tmpfiles >/dev/null; then
systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/iscsi.conf
fi
fi
}
SYSTEMD_SERVICE = " iscsi-initiator.service iscsi-initiator-targets.service "
INITSCRIPT_NAME = "iscsid"
INITSCRIPT_PARAMS = "start 30 1 2 3 4 5 . stop 70 0 1 2 3 4 5 6 ."
FILES:${PN} += "${nonarch_libdir}/iscsi"

View File

@@ -0,0 +1,58 @@
From a85ca79143a87286f793957e803ee3daf03c2b57 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 6 Jul 2021 14:06:44 -0700
Subject: [PATCH] layer4: Change order of include files
curent order to include standard headers first is causing an isue with
glibc 2.34 + kernel-headers 5.13+ where order of including netinet/in.h
and linux/in.h matters and it does not define __UAPI_DEF_IN_IPPROTO
before including linux/in.h and then later includes netinet/in.h which
then means lot of definitions will be defined twice and compile would
fail. Re-ordering the local headers to appear first solves the issue
amicably, and I think this is right order too
Upsteam-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
keepalived/core/layer4.c | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/keepalived/core/layer4.c b/keepalived/core/layer4.c
index 90cdc84..c122c29 100644
--- a/keepalived/core/layer4.c
+++ b/keepalived/core/layer4.c
@@ -23,6 +23,16 @@
#include "config.h"
+#include "layer4.h"
+#include "logger.h"
+#include "scheduler.h"
+#ifdef _WITH_LVS_
+#include "check_api.h"
+#endif
+#include "bitops.h"
+#include "utils.h"
+#include "align.h"
+
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
@@ -33,17 +43,6 @@
#include <sys/time.h>
#endif
#include <linux/errqueue.h>
-#include <netinet/in.h>
-
-#include "layer4.h"
-#include "logger.h"
-#include "scheduler.h"
-#ifdef _WITH_LVS_
-#include "check_api.h"
-#endif
-#include "bitops.h"
-#include "utils.h"
-#include "align.h"
// #define ICMP_DEBUG 1

View File

@@ -0,0 +1,46 @@
SUMMARY = "High Availability monitor built upon LVS, VRRP and service pollers"
DESCRIPTION = "Keepalived is a routing software written in C. The main goal \
of this project is to provide simple and robust facilities for loadbalancing \
and high-availability to Linux system and Linux based infrastructures. \
Loadbalancing framework relies on well-known and widely used Linux Virtual \
Server (IPVS) kernel module providing Layer4 loadbalancing \
"
HOMEPAGE = "http://www.keepalived.org/"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
SRC_URI = "http://www.keepalived.org/software/${BP}.tar.gz \
file://0001-layer4-Change-order-of-include-files.patch \
"
SRC_URI[sha256sum] = "103692bd5345a4ed9f4581632ea636214fdf53e45682e200aab122c4fa674ece"
UPSTREAM_CHECK_URI = "https://github.com/acassen/keepalived/releases"
DEPENDS = "libnfnetlink openssl"
inherit autotools pkgconfig systemd
PACKAGECONFIG ??= "libnl snmp \
${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \
"
PACKAGECONFIG[libnl] = "--enable-libnl,--disable-libnl,libnl"
PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp,net-snmp"
PACKAGECONFIG[systemd] = "--with-init=systemd --with-systemdsystemunitdir=${systemd_system_unitdir},--with-init=SYSV,systemd"
EXTRA_OEMAKE = "initdir=${sysconfdir}/init.d"
do_install:append() {
if [ -f ${D}${sysconfdir}/init.d/${BPN} ]; then
chmod 0755 ${D}${sysconfdir}/init.d/${BPN}
sed -i 's#rc.d/##' ${D}${sysconfdir}/init.d/${BPN}
fi
if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
install -D -m 0644 ${B}/${BPN}/${BPN}.service ${D}${systemd_system_unitdir}/${BPN}.service
fi
}
FILES:${PN} += "${datadir}/snmp/mibs/KEEPALIVED-MIB.txt"
SYSTEMD_SERVICE:${PN} = "keepalived.service"
SYSTEMD_AUTO_ENABLE ?= "disable"

View File

@@ -0,0 +1,2 @@
# Uncomment to start SNMP subagent and enable CDP, SONMP and EDP protocol
#DAEMON_ARGS="-x -c -s -e"

View File

@@ -0,0 +1,128 @@
#! /bin/sh
### BEGIN INIT INFO
# Provides: lldpd
# Required-Start: $remote_fs $network $syslog
# Required-Stop: $network $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: LLDP daemon
# Description: lldpd is a 802.1AB implementation, a L2 network
# discovery protocol. It also supports CDP, EDP and
# various other protocols.
### END INIT INFO
# Do NOT "set -e"
log_daemon_msg() {
echo $*
}
log_end_msg() {
if [ $1 -eq 0 ]; then
success $*
else
failure $*
fi
}
log_failure_msg() {
echo $*
}
log_success_msg() {
echo $*
}
# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="LLDP daemon"
NAME=lldpd
DAEMON=/usr/sbin/$NAME
DAEMON_ARGS=""
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
CHROOT=/var/run/$NAME
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
# LSB log_* functions
. /etc/init.d/functions
do_start()
{
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
$DAEMON_ARGS \
|| return 2
}
do_stop()
{
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
RETVAL="$?"
[ "$RETVAL" = 2 ] && return 2
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
[ "$?" = 2 ] && return 2
rm -f $PIDFILE
return "$RETVAL"
}
do_reload() {
start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
return 0
}
case "$1" in
start)
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
do_start
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
stop)
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
do_stop
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
reload)
log_daemon_msg "Reloading $DESC" "$NAME"
do_reload
log_end_msg $?
;;
restart|force-reload)
log_daemon_msg "Restarting $DESC" "$NAME"
do_stop
case "$?" in
0|1)
do_start
case "$?" in
0) log_end_msg 0 ;;
1) log_end_msg 1 ;; # Old process is still running
*) log_end_msg 1 ;; # Failed to start
esac
;;
*)
# Failed to stop
log_end_msg 1
;;
esac
;;
status)
status_of_proc $DAEMON $NAME -p $PIDFILE && exit 0 || exit $?
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload|status}" >&2
exit 3
;;
esac
:

View File

@@ -0,0 +1,16 @@
#!/bin/sh
num_fail=0
for test in tests/check*
do
./"$test" \
&& echo "PASS: $test" \
|| {
echo "FAIL: $test"
num_fail=$(( ${num_fail} + 1))
}
done
exit $num_fail

View File

@@ -0,0 +1,81 @@
SUMMARY = "A 802.1ab implementation (LLDP) to help you locate neighbors of all your equipments"
SECTION = "net/misc"
LICENSE = "ISC"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/ISC;md5=f3b90e78ea0cffb20bf5cca7947a896d"
DEPENDS = "libbsd libevent"
SRC_URI = "\
http://media.luffy.cx/files/${BPN}/${BP}.tar.gz \
file://lldpd.init.d \
file://lldpd.default \
file://run-ptest \
"
SRC_URI[sha256sum] = "e3b391650c7ba67cea2fe84d67fdb4d7fc8aa1ec5cf86eb8bb984711df8465a9"
inherit autotools update-rc.d useradd systemd pkgconfig bash-completion github-releases ptest
USERADD_PACKAGES = "${PN}"
USERADD_PARAM:${PN} = "--system -g lldpd --shell /bin/false lldpd"
GROUPADD_PARAM:${PN} = "--system lldpd"
EXTRA_OECONF += "--without-embedded-libevent \
--disable-oldies \
--with-privsep-user=lldpd \
--with-privsep-group=lldpd \
--with-systemdsystemunitdir=${systemd_system_unitdir} \
--without-sysusersdir \
"
PACKAGECONFIG ??= "cdp fdp edp sonmp lldpmed dot1 dot3"
PACKAGECONFIG[xml] = "--with-xml,--without-xml,libxm2"
PACKAGECONFIG[snmp] = "--with-snmp,--without-snmp,net-snmp"
PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline"
PACKAGECONFIG[seccomp] = "--with-seccomp,--without-seccomp,libseccomp"
PACKAGECONFIG[cdp] = "--enable-cdp,--disable-cdp"
PACKAGECONFIG[fdp] = "--enable-fdp,--disable-fdp"
PACKAGECONFIG[edp] = "--enable-edp,--disable-edp"
PACKAGECONFIG[sonmp] = "--enable-sonmp,--disable-sonmp"
PACKAGECONFIG[lldpmed] = "--enable-lldpmed,--disable-lldpmed"
PACKAGECONFIG[dot1] = "--enable-dot1,--disable-dot1"
PACKAGECONFIG[dot3] = "--enable-dot3,--disable-dot3"
PACKAGECONFIG[custom] = "--enable-custom,--disable-custom"
INITSCRIPT_NAME = "lldpd"
INITSCRIPT_PARAMS = "defaults"
SYSTEMD_SERVICE:${PN} = "lldpd.service"
do_install:append() {
install -Dm 0755 ${WORKDIR}/lldpd.init.d ${D}${sysconfdir}/init.d/lldpd
install -Dm 0644 ${WORKDIR}/lldpd.default ${D}${sysconfdir}/default/lldpd
# Make an empty configuration file
touch ${D}${sysconfdir}/lldpd.conf
}
PACKAGES =+ "${PN}-zsh-completion"
FILES:${PN} += "${libdir}/sysusers.d"
RDEPENDS:${PN} += "os-release"
FILES:${PN}-zsh-completion += "${datadir}/zsh/"
# FIXME: zsh is broken in meta-oe so this cannot be enabled for now
#RDEPENDS:${PN}-zsh-completion += "zsh"
RDEPENDS:${PN}-ptest = "libcheck"
DEPENDS += "${@bb.utils.contains('PTEST_ENABLED', '1', 'libcheck', '', d)}"
TESTDIR = "tests"
do_compile_ptest () {
# hack to remove the call to `make check-TESTS`
sed -i 's/$(MAKE) $(AM_MAKEFLAGS) check-TESTS//g' ${TESTDIR}/Makefile
oe_runmake check
}
do_install_ptest () {
# install the tests
cp -rf ${B}/${TESTDIR} ${D}${PTEST_PATH}
# remove the object files
rm ${D}${PTEST_PATH}/${TESTDIR}/*.o
}

View File

@@ -0,0 +1,25 @@
From 53ca110d53ca82f6c4224e4c29dbcf7dfe6914cd Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 23 Aug 2022 00:25:06 -0700
Subject: [PATCH] Forward port defining PREFIX_BINDIR to use new autoconf
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
configure.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.in b/configure.in
index c3ef568..a320c56 100644
--- a/configure.in
+++ b/configure.in
@@ -44,7 +44,7 @@ wi_EXTRA_SYSV_SUNOS_DIRS dnl For better curses library on SunOS 4
dnl Try to use PATH rather than hardcode the installation path, if possible.
if test "${prefix-NONE}" != "NONE" && test "$prefix" != "/usr/local" && test "$prefix" != "/usr"; then
- AC_DEFINE_UNQUOTED(PREFIX_BINDIR, "$prefix/bin")
+ AC_DEFINE([PREFIX_BINDIR], [${prefix}/bin], [Install bindir])
fi

View File

@@ -0,0 +1,83 @@
Fix build with -fno-common
Patch from https://src.fedoraproject.org/rpms/ncftp/raw/master/f/ncftp-3.2.5-gcc10.patch
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
--- a/ncftp/bookmark.h
+++ b/ncftp/bookmark.h
@@ -29,6 +29,8 @@ typedef struct Bookmark {
int reserved;
} Bookmark;
+extern Bookmark gBm;
+
#define kBookmarkVersion 8
#define kBookmarkMinVersion 3
#if (defined(WIN32) || defined(_WINDOWS)) && !defined(__CYGWIN__)
--- a/ncftp/cmds.c
+++ b/ncftp/cmds.c
@@ -98,7 +98,7 @@ extern char gPager[], gHome[], gShell[];
extern char gOS[];
extern int gAutoResume;
extern int gAutoSaveChangesToExistingBookmarks;
-extern Bookmark gBm;
+//extern Bookmark gBm;
extern int gLoadedBm, gConfirmClose, gSavePasswords, gScreenColumns;
extern char gLocalCWD[512], gPrevLocalCWD[512];
extern int gMayCancelJmp;
--- a/ncftp/main.c
+++ b/ncftp/main.c
@@ -38,7 +38,7 @@ extern int gUnprocessedJobs;
char gLocalCWD[512], gPrevLocalCWD[512];
extern char gRemoteCWD[512], gPrevRemoteCWD[512];
-extern Bookmark gBm;
+//extern Bookmark gBm;
extern int gLoadedBm;
extern int gFirewallType;
extern char gAutoAscii[];
--- a/sh_util/gpshare.c
+++ b/sh_util/gpshare.c
@@ -28,7 +28,7 @@
static int gIsAtty1 = 1, gIsAtty2 = 1;
extern int gLoadedBm, gBookmarkMatchMode;
-Bookmark gBm;
+//Bookmark gBm;
double
FileSize(double size, const char **uStr0, double *uMult0)
--- a/sh_util/ncftpget.c
+++ b/sh_util/ncftpget.c
@@ -40,7 +40,7 @@ extern unsigned int gFirewallPort;
extern char gFirewallExceptionList[256];
extern int gFwDataPortMode;
extern const char gOS[], gVersion[];
-extern Bookmark gBm;
+//extern Bookmark gBm;
static void
#if (defined(__GNUC__)) && (__GNUC__ >= 2)
--- a/sh_util/ncftpls.c
+++ b/sh_util/ncftpls.c
@@ -39,7 +39,7 @@ extern unsigned int gFirewallPort;
extern char gFirewallExceptionList[256];
extern int gFwDataPortMode;
extern const char gOS[], gVersion[];
-extern Bookmark gBm;
+//extern Bookmark gBm;
static int FTPRemoteRecursiveMList(FTPCIPtr cip, const char *const rdir, /* FTPFileInfoListPtr files, */ FTPLineListPtr lines);
--- a/sh_util/ncftpput.c
+++ b/sh_util/ncftpput.c
@@ -41,7 +41,6 @@ extern unsigned int gFirewallPort;
extern char gFirewallExceptionList[256];
extern int gFwDataPortMode;
extern const char gOS[], gVersion[];
-extern Bookmark gBm;
extern int gSendfileInProgress;
static void

View File

@@ -0,0 +1,32 @@
From 043e1a9ec83a59671ef8c4cad679dbf781e5ef98 Mon Sep 17 00:00:00 2001
From: Jackie Huang <jackie.huang@windriver.com>
Date: Sun, 29 Nov 2015 23:37:06 -0800
Subject: [PATCH] configure: use BUILD_CC for ccdv
ccdv is intended to be invoked from Makefiles only,
it doesn't work for the cross compiling, so compile
it with $BUILD_CC and corresponding CFLAGS.
Upstream-Status: Inappropriate [cross compile specific]
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
---
configure | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure b/configure
index 2f0fae0..a7e9112 100755
--- a/configure
+++ b/configure
@@ -11286,7 +11286,7 @@ panic:
} /* main */
/* eof ccdv.c */
EOF
- ${CC-cc} $DEFS $CPPFLAGS $CFLAGS "ccdv.c" -o "ccdv" >/dev/null 2>&1
+ ${BUILD_CC} $DEFS ${BUILD_CPPFLAGS} ${BUILD_CFLAGS} "ccdv.c" -o "ccdv" >/dev/null 2>&1
rm -f ccdv.c ccdv.o ccdv.c.gz.uu ccdv.c.gz
strip ./ccdv >/dev/null 2>&1
./ccdv >/dev/null 2>&1
--
2.3.5

View File

@@ -0,0 +1,28 @@
This patch is needed to avoid double definitions of functions
especially when building with security flags turned on. The double
definitions causes the sed.sh script in configure to fail since it
starts to spit out double outputs e.g.
wi_cv_gethostname_size_t size_t size_t
which then caused almost all subsequent compile time tests to fail since
this gets into confdefs.h file
removing this include causes only one definitions to be emitted into
the genrated protos.h file and thus avoiding the above failure.
Other solution would to fix sed.sh to ignore double definitions
Upstream-Status: Pending
Signed-of-by: Khem Raj <raj.khem@gmail.com>
--- a/autoconf_local/aclocal.m4
+++ b/autoconf_local/aclocal.m4
@@ -4220,7 +4220,6 @@ changequote({{, }})dnl
cat << 'EOF' > "$wi_tmpdir/unistd.c"
#include <confdefs.h>
-#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>

View File

@@ -0,0 +1,32 @@
DESCRIPTION = "A sophisticated console ftp client"
HOMEPAGE = "http://ncftp.com/"
SECTION = "net"
LICENSE = "ClArtistic"
LIC_FILES_CHKSUM = "file://ncftp/cmds.c;beginline=3;endline=4;md5=9c2390809f71465aa7ff76e03dc14d91"
DEPENDS = "ncurses"
SRC_URI = "ftp://ftp.ncftp.com/${BPN}/${BP}-src.tar.xz \
file://ncftp-configure-use-BUILD_CC-for-ccdv.patch \
file://unistd.patch \
file://ncftp-3.2.5-gcc10.patch \
file://0001-Forward-port-defining-PREFIX_BINDIR-to-use-new-autoc.patch \
"
SRC_URI[md5sum] = "42d0f896d69a4d603ec097546444245f"
SRC_URI[sha256sum] = "5f200687c05d0807690d9fb770327b226f02dd86155b49e750853fce4e31098d"
inherit autotools-brokensep pkgconfig
CFLAGS += "-DNO_SSLv2 -D_FILE_OFFSET_BITS=64 -Wall"
PACKAGECONFIG ??= ""
PACKAGECONFIG[ccdv] = "--enable-ccdv,--disable-ccdv,,"
EXTRA_OECONF = "--disable-precomp --disable-universal ac_cv_path_TAR=tar"
ACLOCALEXTRAPATH:append = " -I ${S}/autoconf_local"
do_install () {
install -d ${D}${bindir} ${D}${sysconfdir} ${D}${mandir}
oe_runmake 'prefix=${D}${prefix}' 'BINDIR=${D}${bindir}' \
'SYSCONFDIR=${D}${sysconfdir}' 'mandir=${D}${mandir}' \
install
}

View File

@@ -0,0 +1,32 @@
SUMMARY = "Dispatcher service for systemd-networkd connection status changes"
DESCRIPTION = "This daemon is similar to NetworkManager-dispatcher, but is much \
more limited in the types of events it supports due to the limited nature of \
systemd-networkd(8)."
AUTHOR = "Clayton Craft and others"
LICENSE = "GPL-3.0-only"
LIC_FILES_CHKSUM = "file://LICENSE;md5=84dcc94da3adb52b53ae4fa38fe49e5d"
inherit features_check systemd
RDEPENDS:${PN} = "python3-pygobject python3-dbus"
REQUIRED_DISTRO_FEATURES = "systemd"
SRCREV = "30e278e50749a60a930ceaa0971207c6436b8a0c"
SRC_URI = "git://gitlab.com/craftyguy/networkd-dispatcher;protocol=https;nobranch=1"
S = "${WORKDIR}/git"
SYSTEMD_PACKAGES = "${PN}"
SYSTEMD_SERVICE:${PN} = "networkd-dispatcher.service"
SYSTEMD_AUTO_ENABLE = "disable"
# Nothing to build, just a python script to install
do_configure[noexec] = "1"
do_compile[noexec] = "1"
do_install() {
install -D -m 0755 ${S}/networkd-dispatcher ${D}${bindir}/networkd-dispatcher
install -D -m 0644 ${S}/networkd-dispatcher.service ${D}/${systemd_system_unitdir}/networkd-dispatcher.service
install -D -m 0644 ${S}/networkd-dispatcher.conf ${D}/${sysconfdir}/conf.d/networkd-dispatcher.conf
}

View File

@@ -0,0 +1,27 @@
From 2bc5c6367a7f70ca5bff177ec95bcad3b1c2b66b Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 6 Sep 2018 18:15:10 -0700
Subject: [PATCH] Do not poke at build host's /etc/os-release
During cross compile we are interested in target distro and not host
distro therefore do not check for it.
Upstream-Status: Inappropriate [Cross compile specific]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: openhpi-3.8.0/configure.ac
===================================================================
--- openhpi-3.8.0.orig/configure.ac
+++ openhpi-3.8.0/configure.ac
@@ -194,7 +194,6 @@ AC_SUBST(JSON_C_LIB)
AC_SUBST(JSON_C_INCLUDE)
AC_CHECK_LIB([rabbitmq],[amqp_new_connection],[RABBITMQ_LIB=-lrabbitmq],[RABBITMQ_LIB=])
AC_SUBST(RABBITMQ_LIB)
-AC_CHECK_FILE([/etc/os-release],[DISTRO=`grep "^ID=" /etc/os-release | awk -F"\"" '{ print $2 }'`])
AC_CHECK_HEADERS([amqp.h],[have_rabbitmq=yes],[have_rabbitmq=no])

View File

@@ -0,0 +1,41 @@
From 8f47adc3b9085d589e62cb5eb560dd23a703036a Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 8 Sep 2018 12:47:49 -0700
Subject: [PATCH] include iostream for cout
End cout with endl
Fixes
plugins/dynamic_simulator/thread.cpp:241:3: error: 'cout' was not declared in this scope
cout<<"PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP is Defined"
^~~~
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
plugins/dynamic_simulator/thread.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/plugins/dynamic_simulator/thread.cpp b/plugins/dynamic_simulator/thread.cpp
index b971502..61eaf42 100644
--- a/plugins/dynamic_simulator/thread.cpp
+++ b/plugins/dynamic_simulator/thread.cpp
@@ -26,7 +26,7 @@
*/
#include "thread.h"
-#include <stdio.h>
+#include <iostream>
#include <sys/time.h>
#include <errno.h>
@@ -238,7 +238,7 @@ cThreadLock::cThreadLock()
pthread_mutexattr_settype( &attr, PTHREAD_MUTEX_RECURSIVE );
pthread_mutex_init( &m_lock, &attr );
pthread_mutexattr_destroy( &attr );
- cout<<"PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP is Defined"
+ std::cout<<"PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP is Defined"<<std::endl;
}
#else
static pthread_mutex_t lock_tmpl = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;

View File

@@ -0,0 +1,37 @@
From b8bc6bfdb5e7fb5b46d3a830e04632939bee6b98 Mon Sep 17 00:00:00 2001
From: Catalin Enache <catalin.enache@windriver.com>
Date: Fri, 9 Feb 2018 16:35:11 +0200
Subject: [PATCH] saHpiSessionClose: close socket
saHpiSessionClose leaks file descriptors
Upstream issue: https://github.com/open-hpi/openhpi/issues/1918
Upstream-Status: Pending
Signed-off-by: Catalin Enache <catalin.enache@windriver.com>
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
---
baselib/session.cpp | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/baselib/session.cpp b/baselib/session.cpp
index c5edfc8..4ece1b7 100644
--- a/baselib/session.cpp
+++ b/baselib/session.cpp
@@ -126,6 +126,12 @@ cSession::cSession()
cSession::~cSession()
{
+ cClientStreamSock * sock;
+ gpointer ptr = wrap_g_static_private_get( &m_sockets );
+ if ( ptr ) {
+ sock = reinterpret_cast<cClientStreamSock *>(ptr);
+ sock->Close();
+ }
wrap_g_static_private_free( &m_sockets );
}
--
2.10.2

View File

@@ -0,0 +1,22 @@
From ed51168dfd6844deeaebf7d5f6c65898aafb6299 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sun, 27 Aug 2017 12:12:04 -0700
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
configure.ac | 1 +
1 file changed, 1 insertion(+)
diff --git a/configure.ac b/configure.ac
index c29a31f..f7fe0f7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -46,6 +46,7 @@ AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_AWK
AC_PROG_GREP
+AX_CXX_COMPILE_STDCXX_11([noext],[mandatory])
enabled_non32bit="no"
AC_ARG_ENABLE([non32bit-int],

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,98 @@
From: Helmut Grohne <helmut@subdivi.de>
Subject: fix cross compilation
The OH_SET_SIZES macro relies on the usual autoconf sizeof cache variables
during cross compilation, but it never ensure that they are initialized.
pkg-config must be called with $ac_tool_prefix and PKG_PROG_PKG_CONFIG takes
care of that. Setting PKG_CONFIG_PATH breaks the pkg-config-cross-wrapper.
Don't do that.
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Index: openhpi-3.8.0/acinclude.m4
===================================================================
--- openhpi-3.8.0.orig/acinclude.m4
+++ openhpi-3.8.0/acinclude.m4
@@ -22,30 +22,39 @@ AC_DEFUN([OH_SET_SIZES],
if test "x$cross_compiling" != "xno"; then
if test "x$OH_SIZEOF_UCHAR" = x; then
+ AC_CHECK_SIZEOF([unsigned char])
OH_SIZEOF_UCHAR=$ac_cv_sizeof_uchar
fi
if test "x$OH_SIZEOF_USHORT" = x; then
+ AC_CHECK_SIZEOF([unsigned short])
OH_SIZEOF_USHORT=$ac_cv_sizeof_ushort
fi
if test "x$OH_SIZEOF_UINT" = x; then
+ AC_CHECK_SIZEOF([unsigned int])
OH_SIZEOF_UINT=$ac_cv_sizeof_uint
fi
if test "x$OH_SIZEOF_CHAR" = x; then
+ AC_CHECK_SIZEOF([char])
OH_SIZEOF_CHAR=$ac_cv_sizeof_char
fi
if test "x$OH_SIZEOF_SHORT" = x; then
+ AC_CHECK_SIZEOF([short])
OH_SIZEOF_SHORT=$ac_cv_sizeof_short
fi
if test "x$OH_SIZEOF_INT" = x; then
+ AC_CHECK_SIZEOF([int])
OH_SIZEOF_INT=$ac_cv_sizeof_int
fi
if test "x$OH_SIZEOF_LLONG" = x; then
+ AC_CHECK_SIZEOF([long long])
OH_SIZEOF_LLONG=$ac_cv_sizeof_longlong
fi
if test "x$OH_SIZEOF_FLOAT" = x; then
+ AC_CHECK_SIZEOF([float])
OH_SIZEOF_FLOAT=$ac_cv_sizeof_float
fi
if test "x$OH_SIZEOF_DOUBLE" = x; then
+ AC_CHECK_SIZEOF([double])
OH_SIZEOF_DOUBLE=$ac_cv_sizeof_double
fi
else
Index: openhpi-3.8.0/configure.ac
===================================================================
--- openhpi-3.8.0.orig/configure.ac
+++ openhpi-3.8.0/configure.ac
@@ -87,9 +87,9 @@ have_rtas_lib=no
dnl Check for GLIB
-AC_CHECK_PROG([found_pkg_config],[pkg-config],[yes])
+PKG_PROG_PKG_CONFIG
-if test "x$found_pkg_config" != "xyes"; then
+if test "x$PKG_CONFIG" = "x"; then
OH_CHECK_FAIL(pkg-config,pkg-config)
fi
PKG_CFG_SETPATH
@@ -105,7 +105,7 @@ GLIB=glib-2.0
GTHREAD=gthread-2.0
GMODULE=gmodule-2.0
-if pkg-config --atleast-version $GLIB_REQUIRED_VERSION $GLIB; then
+if $PKG_CONFIG --atleast-version $GLIB_REQUIRED_VERSION $GLIB; then
:
else
AC_MSG_ERROR([
@@ -268,12 +268,12 @@ dnl
dnl We really need to make ipmi enablement be contigent on OpenIPMI
dnl
-if PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig pkg-config --atleast-version 1.4.20 OpenIPMI; then
+if $PKG_CONFIG --atleast-version 1.4.20 OpenIPMI; then
have_openipmi=yes
AC_CHECK_LIB([OpenIPMI], [ipmi_smi_setup_con], [have_openipmi=yes])
- OPENIPMI_CFLAGS=`PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig pkg-config --cflags OpenIPMI`
+ OPENIPMI_CFLAGS=`$PKG_CONFIG --cflags OpenIPMI`
AC_SUBST(OPENIPMI_CFLAGS)
- OPENIPMI_LIBS=`PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig pkg-config --libs OpenIPMI`
+ OPENIPMI_LIBS=`$PKG_CONFIG --libs OpenIPMI`
AC_SUBST(OPENIPMI_LIBS)
fi

View File

@@ -0,0 +1,20 @@
Fix
sensor_factors_000.cpp:66:5: error: non-constant-expression cannot be narrowed from type 'int' to 'unsigned char' in initializer list [-Wc++11-narrowing]
((dRExp << 4) & 0xf0) | (dBExp & 0x0f ), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Index: openhpi-3.6.1/plugins/ipmidirect/t/sensor_factors_000.cpp
===================================================================
--- openhpi-3.6.1.orig/plugins/ipmidirect/t/sensor_factors_000.cpp
+++ openhpi-3.6.1/plugins/ipmidirect/t/sensor_factors_000.cpp
@@ -63,7 +63,7 @@ static cIpmiSdr sdr =
dB & 0xff,
((dB >> 2) & 0xc0) | (dAccuracy & 0x3f),
((dAccuracy >> 2) & 0xf0) | ((dAccuracyExp << 2) & 0x0c),
- ((dRExp << 4) & 0xf0) | (dBExp & 0x0f ),
+ (unsigned char)(((dRExp << 4) & 0xf0) | (dBExp & 0x0f )),
0,
0,
}

View File

@@ -0,0 +1,37 @@
Description: Fix FTBFS with OpenSSL 1.1 by honouring OPENSSL_NO_MD2
Author: Adrian Bunk <bunk@debian.org>
Bug-Debian: https://bugs.debian.org/859543
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Index: openhpi-3.8.0/plugins/ipmidirect/ipmi_auth.cpp
===================================================================
--- openhpi-3.8.0.orig/plugins/ipmidirect/ipmi_auth.cpp
+++ openhpi-3.8.0/plugins/ipmidirect/ipmi_auth.cpp
@@ -21,6 +21,7 @@
#include "ipmi_auth.h"
#include <string.h>
#include <errno.h>
+#include <openssl/opensslconf.h>
cIpmiAuth *
@@ -32,7 +33,7 @@ IpmiAuthFactory( tIpmiAuthType type )
return new cIpmiAuthNone;
case eIpmiAuthTypeMd2:
-#ifdef HAVE_OPENSSL_MD2_H
+#if defined(HAVE_OPENSSL_MD2_H) && !defined(OPENSSL_NO_MD2)
return new cIpmiAuthMd2;
#else
break;
@@ -78,7 +79,7 @@ cIpmiAuthNone::Check( cIpmiAuthSg /*d*/[
}
-#ifdef HAVE_OPENSSL_MD2_H
+#if defined(HAVE_OPENSSL_MD2_H) && !defined(OPENSSL_NO_MD2)
#include <openssl/md2.h>

View File

@@ -0,0 +1,20 @@
Link with libssl
fixed build with openssl-1.1.x
Taken from Fedora
https://src.fedoraproject.org/rpms/openhpi/c/be77f5484b0206f8946a85b29424ea10bf863063
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Upstream-Status: Pending [Unknown]
diff -up openhpi-3.6.1/ssl/Makefile.am.than openhpi-3.6.1/ssl/Makefile.am
--- openhpi-3.6.1/ssl/Makefile.am.than 2017-02-21 12:21:12.114814698 -0500
+++ openhpi-3.6.1/ssl/Makefile.am 2017-02-21 12:22:44.576454262 -0500
@@ -19,5 +19,5 @@ lib_LTLIBRARIES = libopenhpi_ssl.la
libopenhpi_ssl_la_SOURCES = oh_ssl.c oh_ssl.h
libopenhpi_ssl_la_LDFLAGS = -version-info @HPI_LIB_VERSION@
-libopenhpi_ssl_la_LIBADD = @CRYPTO_LIB@
+libopenhpi_ssl_la_LIBADD = -lssl @CRYPTO_LIB@

View File

@@ -0,0 +1,25 @@
[PATCH] add libnetsnmp when link
Upstream-Status: Pending
Signed-off-by: Roy Li <rongqing.li@windriver.com>
---
plugins/snmp_bc/t/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/snmp_bc/t/Makefile.am b/plugins/snmp_bc/t/Makefile.am
index 57e77ac..9894620 100644
--- a/plugins/snmp_bc/t/Makefile.am
+++ b/plugins/snmp_bc/t/Makefile.am
@@ -74,7 +74,7 @@ nodist_libsnmp_bc_la_SOURCES = $(GENERATED_EVENT_CODE) $(REMOTE_SIM_SOURCES)
# libopenhpi_la_LIBADD = $(top_builddir)/utils/libopenhpiutils.la
# libopenhpi_la_LDFLAGS = -L$(top_builddir)/utils -version-info @HPI_LIB_VERSION@ -export-symbols $(top_srcdir)/src/hpi.sym
-libsnmp_bc_la_LIBADD = -luuid @SNMPLIBS@ $(top_builddir)/utils/libopenhpiutils.la
+libsnmp_bc_la_LIBADD = -luuid @SNMPLIBS@ $(top_builddir)/utils/libopenhpiutils.la -lnetsnmp
libsnmp_bc_la_LDFLAGS = -L$(top_builddir)/utils -module -version-info @HPI_LIB_VERSION@
# libsnmp_bc_la_LDFLAGS = -version 0:0:0
--
1.7.10.4

View File

@@ -0,0 +1,23 @@
Fix alignment issue in ipmi_inventory.c
Upstream-Status: Pending
Signed-of-by: Aws Ismail <aws.ismail@windriver.com>
diff --git a/plugins/ipmi/ipmi_inventory.c b/plugins/ipmi/ipmi_inventory.c
index 5382186..01655c6 100644
--- a/plugins/ipmi/ipmi_inventory.c
+++ b/plugins/ipmi/ipmi_inventory.c
@@ -2546,8 +2546,11 @@ static SaErrorT modify_inventory(SaHpiIdrFieldT *field,
if (tb->DataLength == 0) {
rv = ipmi_fru_set_board_info_mfg_time(fru, 0);
} else {
+ time_t the_time;
+ /* tb->Data is not aligned -- copy to temp */
+ memcpy(&the_time, tb->Data, sizeof(the_time));
rv = ipmi_fru_set_board_info_mfg_time(fru,
- *(time_t *)tb->Data);
+ the_time);
}
break;
case SAHPI_IDR_FIELDTYPE_MANUFACTURER:

View File

@@ -0,0 +1,35 @@
From e0b2be7a1fce0fed63bac8c350b711b69edfe30e Mon Sep 17 00:00:00 2001
From: "yanjun.zhu" <yanjun.zhu@windriver.com>
Date: Tue, 30 Apr 2019 10:04:58 +0800
Subject: [PATCH] openhpid/safhpi.c: fix function saHpiSensorThresholdsSet
In COPY_TH the SensorThresholds->TH will be copied to tmp.TH only if
TH.IsSupported == SAHPI_TRUE. So we should pass &tmp but not
SensorThresholds as the argument to OH_CALL_ABI. Otherwise the TH will
be set even if TH.IsSupported == SAHPI_FALSE.
Upstream-Status: Submitted
[https://github.com/open-hpi/openhpi/pull/2744/commits/77a78bb1ada56e55c5ba6d7a5987c214705bf035]
Signed-off-by: yanjun.zhu <yanjun.zhu@windriver.com>
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
---
openhpid/safhpi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/openhpid/safhpi.c b/openhpid/safhpi.c
index 28a2632..61b7f03 100644
--- a/openhpid/safhpi.c
+++ b/openhpid/safhpi.c
@@ -1933,7 +1933,7 @@ SaErrorT SAHPI_API saHpiSensorThresholdsSet (
oh_release_domain(d); /* Unlock domain */
OH_CALL_ABI(h, set_sensor_thresholds, SA_ERR_HPI_INVALID_CMD, rv,
- ResourceId, SensorNum, SensorThresholds);
+ ResourceId, SensorNum, &tmp);
oh_release_handler(h);
return rv;
--
2.7.4

View File

@@ -0,0 +1,24 @@
fix host gcc warnings
Remove gcc warnings when gcc is v3.2
Upstream-Status: Pending
Signed-of-by: Aws Ismail <aws.ismail@windriver.com>
Index: openhpi-3.6.1/configure.ac
===================================================================
--- openhpi-3.6.1.orig/configure.ac
+++ openhpi-3.6.1/configure.ac
@@ -656,11 +656,6 @@ AC_ARG_ENABLE([werror],
fi],
[])
-if test -n "`gcc --version | grep ' 3.2'`" ; then
- CC_WARNINGS=`echo $CC_WARNINGS | sed -e 's/-Wno-strict-aliasing//g'`
- CXX_WARNINGS=`echo $CC_WARNINGS | sed -e 's/-Wno-strict-aliasing//g'`
-fi
-
case $host_os in
solaris*)
CC_WARNINGS=`echo $CC_WARNINGS | sed -e 's/-Wcast-qual//g'`

View File

@@ -0,0 +1,33 @@
Fix glib cross compile
Uses proper PKG_CONFIG_PATH when cross-compiling
Upstream-Status: Pending
Signed-of-by: Aws Ismail <aws.ismail@windriver.com>
diff --git a/configure.ac b/configure.ac
index b5f5aad..f5a5b74 100644
--- a/configure.ac
+++ b/configure.ac
@@ -110,13 +110,13 @@ else
*** GLIB is always available from ftp://ftp.gtk.org/.])
fi
-exact_version=`pkg-config --modversion $GLIB`;
-GLIB_CFLAGS=`pkg-config --cflags $GLIB $GTHREAD`
-GLIB_LIBS=`pkg-config --libs $GLIB $GTHREAD`
-GLIB_ONLY_CFLAGS=`pkg-config --cflags $GLIB`
-GLIB_ONLY_LIBS=`pkg-config --libs $GLIB`
-GMODULE_ONLY_CFLAGS=`pkg-config --cflags $GMODULE`
-GMODULE_ONLY_LIBS=`pkg-config --libs $GMODULE`
+exact_version=`PKG_CONFIG_PATH=$PKG_CONFIG_PATH pkg-config --modversion $GLIB`;
+GLIB_CFLAGS=`PKG_CONFIG_PATH=$PKG_CONFIG_PATH pkg-config --cflags $GLIB $GTHREAD`
+GLIB_LIBS=`PKG_CONFIG_PATH=$PKG_CONFIG_PATH pkg-config --libs $GLIB $GTHREAD`
+GLIB_ONLY_CFLAGS=`PKG_CONFIG_PATH=$PKG_CONFIG_PATH pkg-config --cflags $GLIB`
+GLIB_ONLY_LIBS=`PKG_CONFIG_PATH=$PKG_CONFIG_PATH pkg-config --libs $GLIB`
+GMODULE_ONLY_CFLAGS=`PKG_CONFIG_PATH=$PKG_CONFIG_PATH pkg-config --cflags $GMODULE`
+GMODULE_ONLY_LIBS=`PKG_CONFIG_PATH=$PKG_CONFIG_PATH pkg-config --libs $GMODULE`
# On some versions of Solaris the pkg-config file for gthread-2.0 contains a
# compiler option, '-mt', that is incompatible with gcc

View File

@@ -0,0 +1,21 @@
Upstream-Status: Submitted
Package saftest run a test case to pass invalid session id to function
saHpiResourceIdGet that expect return SA_ERR_HPI_INVALID_SESSION. But the check
for SA_ERR_HPI_INVALID_SESSION is missed somehow in function saHpiResourceIdGet.
Add check for SA_ERR_HPI_INVALID_SESSION.
Signed-off-by: Kai Kang <kai.kang@windriver.com>
-----
--- openhpi-3.4.0/baselib/safhpi.cpp.orig 2014-02-25 10:45:20.911734868 +0800
+++ openhpi-3.4.0/baselib/safhpi.cpp 2014-02-25 10:46:05.366925389 +0800
@@ -477,6 +477,8 @@
&rpt_update_count );
if ( rv == SA_ERR_HPI_NOT_PRESENT ) {
return SA_ERR_HPI_NOT_PRESENT;
+ } else if ( rv == SA_ERR_HPI_INVALID_SESSION) {
+ return SA_ERR_HPI_INVALID_SESSION;
} else if ( rv != SA_OK ) {
return SA_ERR_HPI_UNKNOWN;
}

View File

@@ -0,0 +1,28 @@
From afe545e77f9d841b7777d859e7e8108492fece96 Mon Sep 17 00:00:00 2001
From: Jackie Huang <jackie.huang@windriver.com>
Date: Wed, 26 Apr 2017 16:22:00 +0800
Subject: [PATCH] Fix libxml2 for cross-compiling
Use proper XML2_INCLUDE path when cross-compiling
Upstream-Status: Pending
Signed-of-by: Aws Ismail <aws.ismail@windriver.com>
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 6242cbf..4fb6b69 100644
--- a/configure.ac
+++ b/configure.ac
@@ -179,7 +179,7 @@ AC_CHECK_HEADERS([openssl/md2.h openssl/md5.h openssl/bio.h openssl/ssl.h openss
dnl xml is used for XML-based communication in ilo2_ribcl and oa_soap
AC_CHECK_LIB([xml2],[xmlParseMemory],[XML2_LIB=-lxml2],[XML2_LIB=])
-AC_CHECK_HEADERS([libxml2/libxml/xmlexports.h],[XML2_INCLUDE="-I/usr/include/libxml2"],[XML2_INCLUDE=])
+AC_CHECK_HEADERS([libxml2/libxml/xmlexports.h],[XML2_INCLUDE="$XML2_INCLUDE"],[XML2_INCLUDE=])
AC_SUBST(XML2_LIB)
AC_SUBST(XML2_INCLUDE)

View File

@@ -0,0 +1,33 @@
Fix ipmi plugin's test dir compilation
The ipmi plugin's test dir is not included
in compilation since it does not compile
properly with SSL
Signed-of-by: Aws Ismail <aws.ismail@windriver.com>
Upstream-Status: Pending
Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
---
plugins/ipmi/Makefile.in | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/plugins/ipmi/Makefile.in b/plugins/ipmi/Makefile.in
index 7c6b0a4..6204dbe 100644
--- a/plugins/ipmi/Makefile.in
+++ b/plugins/ipmi/Makefile.in
@@ -448,7 +448,9 @@ top_srcdir = @top_srcdir@
MAINTAINERCLEANFILES = Makefile.in
AM_CPPFLAGS = -DG_LOG_DOMAIN=\"ipmi\" @OPENHPI_INCLUDES@
EXTRA_DIST = ipmi.sym ekeyfru.h
-SUBDIRS = t
+#SUBDIRS = t
+#Tests don't compile wih SSL properly so comment them out
+SUBDIRS =
AM_CFLAGS = @OPENIPMI_CFLAGS@
pkglib_LTLIBRARIES = libipmi.la
libipmi_la_SOURCES = ipmi.c \
--
1.9.1

View File

@@ -0,0 +1,45 @@
Fix net-snmp when cross-compiling
Remove irrelevant references to net-snmp libs and flags
when cross-compiling net-snmp
Signed-of-by: Aws Ismail <aws.ismail@windriver.com>
Upstream-Status: Pending
Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
---
acinclude.m4 | 4 ++--
configure | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
Index: openhpi-3.8.0/acinclude.m4
===================================================================
--- openhpi-3.8.0.orig/acinclude.m4
+++ openhpi-3.8.0/acinclude.m4
@@ -160,8 +160,8 @@ AC_DEFUN([OH_CHECK_NETSNMP],
],
[
have_netsnmp=yes
- SNMPFLAGS=`${net_snmp_config:-net-snmp-config} --cflags | perl -p -e 's/ -O\S*//g'`
- SNMPLIBS=`${net_snmp_config:-net-snmp-config} --libs`
+ SNMPFLAGS=""
+ SNMPLIBS=""
AC_MSG_RESULT(yes)
],
[AC_MSG_RESULT(no. No SNMP based plugins can be built!)])
Index: openhpi-3.8.0/configure
===================================================================
--- openhpi-3.8.0.orig/configure
+++ openhpi-3.8.0/configure
@@ -16062,8 +16062,8 @@ _ACEOF
if ac_fn_c_try_link "$LINENO"; then :
have_netsnmp=yes
- SNMPFLAGS=`${net_snmp_config:-net-snmp-config} --cflags | perl -p -e 's/ -O\S*//g'`
- SNMPLIBS=`${net_snmp_config:-net-snmp-config} --libs`
+ SNMPFLAGS=""
+ SNMPLIBS=""
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }

View File

@@ -0,0 +1,23 @@
Fix sysfs when cross-compiling
Use proper paths for sysfs plugins when cross-compiling
Signed-of-by: Aws Ismail <aws.ismail@windriver.com>
Upstream-Status: Pending
Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
diff --git a/plugins/sysfs/sysfs2hpi.c b/plugins/sysfs/sysfs2hpi.c
index a745214..3685598 100644
--- a/plugins/sysfs/sysfs2hpi.c
+++ b/plugins/sysfs/sysfs2hpi.c
@@ -18,7 +18,7 @@
#include <stdlib.h>
#include <string.h>
-#include <libsysfs.h>
+#include <sysfs/libsysfs.h>
#include <SaHpi.h>
#include <oh_utils.h>

View File

@@ -0,0 +1,29 @@
From 5e0ae172586f5aeb270a8f9b012dd3e36536a2a9 Mon Sep 17 00:00:00 2001
From: Jackie Huang <jackie.huang@windriver.com>
Date: Wed, 24 Dec 2014 10:54:59 +0800
Subject: [PATCH] openhpi: use serial-tests config needed by ptest
ptest needs buildtest-TESTS and runtest-TESTS targets.
serial-tests is required to generate those targets.
Upstream-Status: Inappropriate [default automake behavior incompatible with ptest]
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 89d8104..c29a31f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7,7 +7,7 @@ dnl various hacks by Sean Dague <http://dague.net/sean> 4/23/03
AC_PREREQ(2.57)
AC_INIT(openhpi, 3.8.0)
AC_CONFIG_SRCDIR(openhpi.spec.in)
-AM_INIT_AUTOMAKE([1.8])
+AM_INIT_AUTOMAKE([1.8 serial-tests])
AM_CONFIG_HEADER(config.h)
AH_TOP([#ifndef __OPENHPI_CONFIG_H

View File

@@ -0,0 +1,230 @@
#! /bin/sh
#
### BEGIN INIT INFO
# Provides: openhpid
# Required-Start: $network $remote_fs $syslog
# Required-Stop: $network $remote_fs $syslog
# Should-Start: $named
# Should-Stop: $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start OpenHPI daemon at boot time
# Description: Enable OpenHPI service which is provided by openhpid.
### END INIT INFO
#
# openhpid.sh Start/Stop the openhpi daemon.
#
# description: openhpid is standard UNIX program which uses the OpenHPI \
# APIs and provides a standard internet server to access those \
# APIs for client programs.
# processname: openhpid
# config: the standard openhpi conf file specified on the command line or the env.
# pidfile: /var/run/openhpid.pid
#
# Author(s):
# W. David Ashley <dashley@us.ibm.com>
# Daniel de Araujo <ddearauj@us.ibm.com>
# Source function library.
PATH=/sbin:/bin:/usr/sbin:/usr/bin
prog="OpenHPI"
# If the openhpid executable is not available, we can't do any of this
test -f /usr/sbin/openhpid || exit 0
# Determine whether the lsb package is installed
# If it is, determine which lsb is installed:
# redhat, suse, or standard lsb
if test -f /etc/init.d/functions
then
lsbtype="rh"
. /etc/init.d/functions
elif test -f /etc/rc.status
then
lsbtype="suse"
. /etc/rc.status
elif test -f /lib/lsb/init-functions
then
lsbtype="lsb"
. /lib/lsb/init-functions
elif test -f /etc/gentoo-release
then
lsbtype="gentoo"
. /sbin/functions.sh
else
lsbtype="nolsb"
fi
print_outcome()
{
case "${lsbtype}" in
suse)
rc_status -v
;;
lsb)
if test "$?" -eq 0
then
log_success_msg "success"
else
log_failure_msg "failed"
fi
;;
gentoo)
eend $?
;;
nolsb | rh)
if test "$?" -eq 0
then
echo " ... success"
fi
if test "$?" -ne 0
then
echo " ... failed"
fi
;;
esac
}
start() {
case "${lsbtype}" in
suse)
echo -n "Starting $prog: "
startproc /usr/sbin/openhpid -c /etc/openhpi/openhpi.conf
RETVAL=$?
;;
lsb)
echo -n "Starting $prog: "
start_daemon /usr/sbin/openhpid -c /etc/openhpi/openhpi.conf
RETVAL=$?
;;
gentoo | rh)
echo "Starting $prog: "
start-stop-daemon --start --quiet --exec /usr/sbin/openhpid -- -c /etc/openhpi/openhpi.conf
RETVAL=$?
;;
nolsb)
echo -n "Starting $prog: "
/usr/sbin/openhpid -c /etc/openhpi/openhpi.conf
RETVAL=$?
;;
esac
print_outcome
}
stop() {
case "${lsbtype}" in
lsb | suse)
echo -n "Stopping $prog: "
killproc /usr/sbin/openhpid
RETVAL=$?
;;
gentoo)
echo "Stopping $prog: "
start-stop-daemon --stop --quiet --exec /usr/sbin/openhpid
RETVAL=$?
;;
nolsb | rh)
echo -n "Stopping $prog: "
if test -f /var/run/openhpid.pid && test "`cat /var/run/openhpid.pid`" != ""
then
kill "`cat /var/run/openhpid.pid`"
RETVAL=$?
else
RETVAL=0
fi
;;
esac
print_outcome
if test "$RETVAL" -eq 0 && test -f /var/run/openhpid.pid
then
rm -f /var/lock/openhpid
rm -f /var/run/openhpid.pid
fi
}
dstatus() {
echo "Checking for $prog daemon: "
case "${lsbtype}" in
suse)
checkproc /usr/sbin/openhpid
rc_status -v
;;
lsb)
pid="`pidofproc /usr/sbin/openhpid`"
if test "${pid}" != ""
then
log_success_msg "$prog is running"
else
log_success_msg "$prog is not running"
fi
;;
gentoo | nolsb | rh)
if test -f /var/run/openhpid.pid &&
test "`cat /var/run/openhpid.pid`" != "" &&
kill -s 0 "`cat /var/run/openhpid.pid`"
then
echo "$prog is running"
else
echo "$prog is not running"
fi
;;
esac
}
restart() {
stop
start
}
force_reload() {
# We don't currently support a reload, but can do a restart
stop
start
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
status)
dstatus
;;
force-reload)
force_reload
;;
*)
echo "Usage: $0 {start|stop|restart|status|force-reload}"
exit 1
esac

View File

@@ -0,0 +1,11 @@
[Unit]
Description=Daemon providing access to the SAF Hardware Platform Interface
After=syslog.target
[Service]
Type=forking
PIDFile=/run/openhpid.pid
ExecStart=@SBINDIR@/openhpid -c @SYSCONFDIR@/openhpi/openhpi.conf
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,5 @@
#!/bin/sh
for x in `find ./ -name Makefile`;
do
make -C `dirname ${x}` -k runtest-TESTS
done

View File

@@ -0,0 +1,138 @@
SUMMARY = "Hardware Platform Interface Library and Tools"
DESCRIPTION = "\
OpenHPI is an open source project created with the intent of providing an \
implementation of the SA Forum's Hardware Platform Interface (HPI). HPI \
provides an abstracted interface to managing computer hardware, typically for \
chassis and rack based servers. HPI includes resource modeling; access to and \
control over sensor, control, watchdog, and inventory data associated with \
resources; abstracted System Event Log interfaces; hardware events and alerts; \
and a managed hotswap interface. \
\
OpenHPI provides a modular mechanism for adding new hardware and device support \
easily. Many plugins exist in the OpenHPI source tree to provide access to \
various types of hardware. This includes, but is not limited to, IPMI based \
servers, Blade Center, and machines which export data via sysfs. \
"
HOMEPAGE = "http://openhpi.sourceforge.net/Home"
SECTION = "net"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://COPYING;md5=e3c772a32386888ccb5ae1c0ba95f1a4"
DEPENDS = "net-snmp libxml2 ncurses openssl glib-2.0 popt e2fsprogs \
autoconf-archive-native os-release"
SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.gz \
file://openhpi.init \
file://openhpid.service \
file://run-ptest \
file://openhpi-netsnmp-cross-compile.patch \
file://openhpi-sysfs-cross-compile.patch \
file://openhpi-libxml2-cross-compile.patch \
file://openhpi-glib-cross-compile.patch \
file://openhpi-linkfix.patch \
file://openhpi-fix-host-gcc.patch \
file://openhpi-fix-function-saHpiSensorThresholds.patch \
file://openhpi-add-libnetsnmp-when-link.patch \
file://openhpi-invalide-session.patch \
file://openhpi-use-serial-tests-config-needed-by-ptest.patch \
file://openhpi-fix-alignment-issue.patch \
file://c++11.patch \
file://clang-c++11.patch \
file://fix-narrowing-warning.patch \
file://0001-session-close-socket.patch \
file://openhpi-3.6.1-ssl.patch \
file://0001-Do-not-poke-at-build-host-s-etc-os-release.patch \
file://cross_899198.patch \
file://no-md2.patch \
file://0001-include-iostream-for-cout.patch \
"
SRC_URI[md5sum] = "fffda3deea8a0d3671a72eea9d13a4df"
SRC_URI[sha256sum] = "c94332a29160dd75cb799c027e614690c00263b0fabed87417707bec04c38723"
inherit autotools pkgconfig ptest update-rc.d systemd
PACKAGES =+ "${PN}-libs"
FILES:${PN}-libs = "${libdir}/${BPN}/*.so /usr/lib/${BPN}/*.so"
INSANE_SKIP:${PN}-libs = "dev-so"
RDEPENDS:${PN} += "${PN}-libs"
PACKAGECONFIG ??= "libgcrypt non32bit snmp-bc"
PACKAGECONFIG[sysfs] = "--enable-sysfs,--disable-sysfs,sysfsutils,"
PACKAGECONFIG[libgcrypt] = "--enable-encryption,--disable-encryption,libgcrypt,"
PACKAGECONFIG[non32bit] = "--enable-non32bit-int,--disable-non32bit-int,,"
PACKAGECONFIG[snmp-bc] = "--enable-snmp_bc,--disable-snmp_bc"
export DISTRO
do_install:append () {
install -m 0755 -d ${D}${sysconfdir}/${BPN}
install -m 0644 ${S}/openhpiclient.conf.example ${D}${sysconfdir}/${BPN}/openhpiclient.conf
install -m 0600 ${S}/openhpi.conf.example ${D}${sysconfdir}/${BPN}/openhpi.conf
install -m 0644 ${S}/simulation.data.example ${D}${sysconfdir}/${BPN}/simulation.data
install -m 0644 ${S}/test_agent.data.example ${D}${sysconfdir}/${BPN}/test_agent.data
install -m 0755 ${WORKDIR}/openhpi.init ${D}${sysconfdir}/init.d/openhpid
install -d ${D}${systemd_unitdir}/system
install -m 0644 ${WORKDIR}/openhpid.service ${D}${systemd_unitdir}/system
sed -i -e "s,@SBINDIR@,${sbindir},g" -e "s,@SYSCONFDIR@,${sysconfdir},g" \
${D}${systemd_unitdir}/system/openhpid.service
}
do_compile_ptest () {
for x in `find ${B} -name Makefile -exec grep -l buildtest-TESTS {} \;`; do
dir=`dirname ${x}`
case $dir in
*cpp/t) ;;
*snmp_bc/t) if ${@bb.utils.contains('PACKAGECONFIG','snmp-bc','true','false',d)}
then
oe_runmake -C ${dir} buildtest-TESTS
fi
;;
*) oe_runmake -C ${dir} buildtest-TESTS ;;
esac
done
}
ack_do_compile_ptest () {
for x in `find ${B} -name Makefile -exec grep -l buildtest-TESTS {} \;`; do
dir=`dirname ${x}`
upper=`dirname ${dir}`
if [ `basename ${upper}` != "cpp" ]; then
oe_runmake -C ${dir} buildtest-TESTS
fi
done
}
do_install_ptest () {
cp -rf ${B}/openhpid/t/ohpi/.libs/* ${B}/openhpid/t/ohpi/
TESTS="utils marshal openhpid"
for subtest in ${TESTS}; do
mkdir -p ${D}${PTEST_PATH}/${subtest}/t
cp -rf ${B}/${subtest}/t/* ${D}${PTEST_PATH}/${subtest}/t
done
for x in `find ${D}${PTEST_PATH} -name Makefile`; do
sed -i "s:${S}:${PTEST_PATH}/:g" ${x};
sed -i "s/^Makefile:/MM:/g" ${x};
done;
install -m 644 ${S}/openhpid/t/ohpi/openhpi.conf ${D}${PTEST_PATH}/openhpid/t/ohpi/
sed -i "s:OPENHPI_CONF=[^ ]*:OPENHPI_CONF=./openhpi.conf:g" ${D}${PTEST_PATH}/openhpid/t/ohpi/Makefile
mkdir -p ${D}${PTEST_PATH}/plugins/watchdog/
cp -L ${D}/${libdir}/${BPN}/libwatchdog.so ${D}${PTEST_PATH}/plugins/watchdog/
cp -L ${D}/${libdir}/${BPN}/libsimulator.so ${D}${PTEST_PATH}/plugins/watchdog/
find ${D}${PTEST_PATH}/ -name "*.c" -exec rm {} \;
find ${D}${PTEST_PATH}/ -name "*.o" -exec rm {} \;
find ${D}${PTEST_PATH}/ -name "*.h" -exec rm {} \;
}
INITSCRIPT_NAME = "openhpid"
INITSCRIPT_PARAMS = "start 30 . stop 70 0 1 2 3 4 5 6 ."
SYSTEMD_SERVICE:${PN} = "openhpid.service"
SYSTEMD_AUTO_ENABLE = "disable"

View File

@@ -0,0 +1,311 @@
From 9a46462f08535e946d97fd40c79229a7ee8b7336 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 17 Aug 2020 00:00:00 -0700
Subject: [PATCH] Fix build with -fno-common
Mark the declarations with extern where needed in header files
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/ckpt/agent/cpa_cb.h | 2 +-
src/ckpt/ckptd/cpd_init.h | 2 +-
src/evt/agent/eda.h | 2 +-
src/evt/evtd/eds.h | 2 +-
src/evt/evtd/eds_amf.c | 2 ++
src/evt/evtd/eds_amf.h | 2 +-
src/evt/evtd/eds_cb.h | 2 +-
src/imm/immd/immd.h | 2 +-
src/lck/lckd/gld_dl_api.h | 4 ++--
src/lck/lcknd/glnd_cb.h | 4 ++--
src/mds/mds_core.h | 34 +++++++++++++++++++---------------
src/mds/mds_dt_tcp.c | 2 ++
src/mds/mds_dt_tcp.h | 2 +-
src/mds/mds_main.c | 2 +-
src/msg/msgnd/mqnd_db.h | 2 +-
15 files changed, 37 insertions(+), 29 deletions(-)
diff --git a/src/ckpt/agent/cpa_cb.h b/src/ckpt/agent/cpa_cb.h
index ac48c6c..d633583 100644
--- a/src/ckpt/agent/cpa_cb.h
+++ b/src/ckpt/agent/cpa_cb.h
@@ -119,7 +119,7 @@ typedef struct cpa_cb {
} CPA_CB;
-uint32_t gl_cpa_hdl;
+extern uint32_t gl_cpa_hdl;
typedef struct cpa_prcess_evt_sync {
NCS_QELEM qelem;
diff --git a/src/ckpt/ckptd/cpd_init.h b/src/ckpt/ckptd/cpd_init.h
index 0c02642..cf3466b 100644
--- a/src/ckpt/ckptd/cpd_init.h
+++ b/src/ckpt/ckptd/cpd_init.h
@@ -33,7 +33,7 @@
#include <saAmf.h>
#include "cpd_cb.h"
-uint32_t gl_cpd_cb_hdl;
+extern uint32_t gl_cpd_cb_hdl;
/* Macro to get the component name for the component type */
#define m_CPD_TASKNAME "CPD"
diff --git a/src/evt/agent/eda.h b/src/evt/agent/eda.h
index 4d1991c..138c910 100644
--- a/src/evt/agent/eda.h
+++ b/src/evt/agent/eda.h
@@ -39,7 +39,7 @@
#include "base/logtrace.h"
/* EDA CB global handle declaration */
-uint32_t gl_eda_hdl;
+extern uint32_t gl_eda_hdl;
/* EDA Default MDS timeout value */
#define EDA_MDS_DEF_TIMEOUT 100
diff --git a/src/evt/evtd/eds.h b/src/evt/evtd/eds.h
index bc9c429..3545d77 100644
--- a/src/evt/evtd/eds.h
+++ b/src/evt/evtd/eds.h
@@ -72,6 +72,6 @@
#include "base/daemon.h"
/* EDS CB global handle declaration */
-uint32_t gl_eds_hdl;
+extern uint32_t gl_eds_hdl;
#endif // EVT_EVTD_EDS_H_
diff --git a/src/evt/evtd/eds_amf.c b/src/evt/evtd/eds_amf.c
index 97b71a5..adebf0c 100644
--- a/src/evt/evtd/eds_amf.c
+++ b/src/evt/evtd/eds_amf.c
@@ -30,6 +30,8 @@ stuff.
#include "eds.h"
#include "eds_dl_api.h"
+struct next_HAState nextStateInfo;
+
/* HA AMF statemachine & State handler definitions */
/****************************************************************************
diff --git a/src/evt/evtd/eds_amf.h b/src/evt/evtd/eds_amf.h
index e9aeaa6..f9803b4 100644
--- a/src/evt/evtd/eds_amf.h
+++ b/src/evt/evtd/eds_amf.h
@@ -49,7 +49,7 @@ uint32_t eds_quiesced_state_handler(EDS_CB *cb, SaInvocationT invocation);
struct next_HAState {
uint8_t nextState1;
uint8_t nextState2;
-} nextStateInfo; /* AMF HA state can transit to a maximum of the two defined
+}; /* AMF HA state can transit to a maximum of the two defined
states */
#define VALIDATE_STATE(curr, next) \
diff --git a/src/evt/evtd/eds_cb.h b/src/evt/evtd/eds_cb.h
index c127ead..19c48cd 100644
--- a/src/evt/evtd/eds_cb.h
+++ b/src/evt/evtd/eds_cb.h
@@ -40,7 +40,7 @@
#include "base/ncssysf_tmr.h"
/* global variables */
-uint32_t gl_eds_hdl;
+extern uint32_t gl_eds_hdl;
struct eda_reg_list_tag;
diff --git a/src/imm/immd/immd.h b/src/imm/immd/immd.h
index 7dc1da6..bab3945 100644
--- a/src/imm/immd/immd.h
+++ b/src/imm/immd/immd.h
@@ -42,7 +42,7 @@
#include "immd_sbedu.h"
#include "base/ncs_mda_pvt.h"
-IMMD_CB *immd_cb;
+extern IMMD_CB *immd_cb;
extern uint32_t initialize_for_assignment(IMMD_CB *cb, SaAmfHAStateT ha_state);
diff --git a/src/lck/lckd/gld_dl_api.h b/src/lck/lckd/gld_dl_api.h
index 6476a71..3a67fd1 100644
--- a/src/lck/lckd/gld_dl_api.h
+++ b/src/lck/lckd/gld_dl_api.h
@@ -33,7 +33,7 @@
#include "base/ncsgl_defs.h"
#include "base/ncs_lib.h"
-uint32_t gl_gld_hdl;
-uint32_t gld_lib_req(NCS_LIB_REQ_INFO *req_info);
+extern uint32_t gl_gld_hdl;
+extern uint32_t gld_lib_req(NCS_LIB_REQ_INFO *req_info);
#endif // LCK_LCKD_GLD_DL_API_H_
diff --git a/src/lck/lcknd/glnd_cb.h b/src/lck/lcknd/glnd_cb.h
index 3b82f60..77a1f88 100644
--- a/src/lck/lcknd/glnd_cb.h
+++ b/src/lck/lcknd/glnd_cb.h
@@ -28,8 +28,8 @@ extern "C" {
#endif
/* global variables */
-uint32_t gl_glnd_hdl;
-NCSCONTEXT gl_glnd_task_hdl;
+extern uint32_t gl_glnd_hdl;
+extern NCSCONTEXT gl_glnd_task_hdl;
/* macros for the global varibales */
#define m_GLND_RETRIEVE_GLND_CB_HDL gl_glnd_hdl
diff --git a/src/mds/mds_core.h b/src/mds/mds_core.h
index dad62cd..ed69d3a 100644
--- a/src/mds/mds_core.h
+++ b/src/mds/mds_core.h
@@ -26,6 +26,10 @@
#ifndef MDS_MDS_CORE_H_
#define MDS_MDS_CORE_H_
+#ifndef EXTERN
+#define EXTERN extern
+#endif
+
#include <pthread.h>
#include "base/ncsgl_defs.h"
#include "mds/mds_papi.h"
@@ -600,65 +604,65 @@ extern "C" {
/* ******************************************** */
/* Initialization of MDTM Module */
-uint32_t (*mds_mdtm_init)(NODE_ID node_id, uint32_t *mds_tipc_ref);
+EXTERN uint32_t (*mds_mdtm_init)(NODE_ID node_id, uint32_t *mds_tipc_ref);
/* Destroying the MDTM Module*/
-uint32_t (*mds_mdtm_destroy)(void);
+EXTERN uint32_t (*mds_mdtm_destroy)(void);
-uint32_t (*mds_mdtm_send)(MDTM_SEND_REQ *req);
+EXTERN uint32_t (*mds_mdtm_send)(MDTM_SEND_REQ *req);
/* SVC Install */
-uint32_t (*mds_mdtm_svc_install)(PW_ENV_ID pwe_id, MDS_SVC_ID svc_id,
+EXTERN uint32_t (*mds_mdtm_svc_install)(PW_ENV_ID pwe_id, MDS_SVC_ID svc_id,
NCSMDS_SCOPE_TYPE install_scope,
V_DEST_RL role, MDS_VDEST_ID vdest_id,
NCS_VDEST_TYPE vdest_policy,
MDS_SVC_PVT_SUB_PART_VER mds_svc_pvt_ver);
/* SVC Uninstall */
-uint32_t (*mds_mdtm_svc_uninstall)(PW_ENV_ID pwe_id, MDS_SVC_ID svc_id,
+EXTERN uint32_t (*mds_mdtm_svc_uninstall)(PW_ENV_ID pwe_id, MDS_SVC_ID svc_id,
NCSMDS_SCOPE_TYPE install_scope,
V_DEST_RL role, MDS_VDEST_ID vdest_id,
NCS_VDEST_TYPE vdest_policy,
MDS_SVC_PVT_SUB_PART_VER mds_svc_pvt_ver);
/* SVC Subscribe */
-uint32_t (*mds_mdtm_svc_subscribe)(PW_ENV_ID pwe_id, MDS_SVC_ID svc_id,
+EXTERN uint32_t (*mds_mdtm_svc_subscribe)(PW_ENV_ID pwe_id, MDS_SVC_ID svc_id,
NCSMDS_SCOPE_TYPE subscribe_scope,
MDS_SVC_HDL local_svc_hdl,
MDS_SUBTN_REF_VAL *subtn_ref_val);
/* added svc_hdl */
/* SVC Unsubscribe */
-uint32_t (*mds_mdtm_svc_unsubscribe)(PW_ENV_ID pwe_id, MDS_SVC_ID svc_id,
+EXTERN uint32_t (*mds_mdtm_svc_unsubscribe)(PW_ENV_ID pwe_id, MDS_SVC_ID svc_id,
NCSMDS_SCOPE_TYPE subscribe_scope,
MDS_SUBTN_REF_VAL subtn_ref_val);
/* VDEST Install */
-uint32_t (*mds_mdtm_vdest_install)(MDS_VDEST_ID vdest_id);
+EXTERN uint32_t (*mds_mdtm_vdest_install)(MDS_VDEST_ID vdest_id);
/* VDEST Uninstall */
-uint32_t (*mds_mdtm_vdest_uninstall)(MDS_VDEST_ID vdest_id);
+EXTERN uint32_t (*mds_mdtm_vdest_uninstall)(MDS_VDEST_ID vdest_id);
/* VDEST Subscribe */
-uint32_t (*mds_mdtm_vdest_subscribe)(MDS_VDEST_ID vdest_id,
+EXTERN uint32_t (*mds_mdtm_vdest_subscribe)(MDS_VDEST_ID vdest_id,
MDS_SUBTN_REF_VAL *subtn_ref_val);
/* VDEST Unsubscribe */
-uint32_t (*mds_mdtm_vdest_unsubscribe)(MDS_VDEST_ID vdest_id,
+EXTERN uint32_t (*mds_mdtm_vdest_unsubscribe)(MDS_VDEST_ID vdest_id,
MDS_SUBTN_REF_VAL subtn_ref_val);
/* Tx Register (For incrementing the use count) */
-uint32_t (*mds_mdtm_tx_hdl_register)(MDS_DEST adest);
+EXTERN uint32_t (*mds_mdtm_tx_hdl_register)(MDS_DEST adest);
/* Tx Unregister (For decrementing the use count) */
-uint32_t (*mds_mdtm_tx_hdl_unregister)(MDS_DEST adest);
+EXTERN uint32_t (*mds_mdtm_tx_hdl_unregister)(MDS_DEST adest);
/* Node subscription */
-uint32_t (*mds_mdtm_node_subscribe)(MDS_SVC_HDL svc_hdl,
+EXTERN uint32_t (*mds_mdtm_node_subscribe)(MDS_SVC_HDL svc_hdl,
MDS_SUBTN_REF_VAL *subtn_ref_val);
/* Node unsubscription */
-uint32_t (*mds_mdtm_node_unsubscribe)(MDS_SUBTN_REF_VAL subtn_ref_val);
+EXTERN uint32_t (*mds_mdtm_node_unsubscribe)(MDS_SUBTN_REF_VAL subtn_ref_val);
#ifdef __cplusplus
}
diff --git a/src/mds/mds_dt_tcp.c b/src/mds/mds_dt_tcp.c
index 4a37246..e73cef4 100644
--- a/src/mds/mds_dt_tcp.c
+++ b/src/mds/mds_dt_tcp.c
@@ -70,6 +70,8 @@ NCS_PATRICIA_TREE mdtm_reassembly_list;
/* Get the pid of the process */
pid_t mdtm_pid;
+
+MDTM_TCP_CB *tcp_cb;
static void mds_mdtm_enc_init(MDS_MDTM_DTM_MSG *init, uint8_t *buff);
static uint32_t mdtm_create_rcv_task(void);
diff --git a/src/mds/mds_dt_tcp.h b/src/mds/mds_dt_tcp.h
index 1065464..350d534 100644
--- a/src/mds/mds_dt_tcp.h
+++ b/src/mds/mds_dt_tcp.h
@@ -50,7 +50,7 @@ typedef struct mdtm_tcp_cb {
} MDTM_TCP_CB;
-MDTM_TCP_CB *tcp_cb;
+extern MDTM_TCP_CB *tcp_cb;
typedef enum mds_mdtm_dtm_msg_types {
MDS_MDTM_DTM_PID_TYPE = 1,
diff --git a/src/mds/mds_main.c b/src/mds/mds_main.c
index 0bcb2f9..5671ed3 100644
--- a/src/mds/mds_main.c
+++ b/src/mds/mds_main.c
@@ -20,7 +20,7 @@
#endif
#include "osaf/configmake.h"
-
+#define EXTERN
/*****************************************************************************
..............................................................................
diff --git a/src/msg/msgnd/mqnd_db.h b/src/msg/msgnd/mqnd_db.h
index b78024e..fee43e5 100644
--- a/src/msg/msgnd/mqnd_db.h
+++ b/src/msg/msgnd/mqnd_db.h
@@ -33,7 +33,7 @@
#include <saClm.h>
#include <saImmOi.h>
/* Decleration for global variable */
-uint32_t gl_mqnd_cb_hdl;
+extern uint32_t gl_mqnd_cb_hdl;
/* Macros for reading global database */
#define m_MQND_STORE_HDL(hdl) (gl_mqnd_cb_hdl = (hdl))
--
2.28.0

View File

@@ -0,0 +1,31 @@
From 90f81c1fb3e560cfc99ee7ab9a48a1736e3929cd Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sun, 15 Nov 2020 13:22:31 -0800
Subject: [PATCH] Use correct printf format for __fsblkcnt_t
This depends on time_t size and on some 32bit architectures e.g. riscv32
this would be a 64bit value
Fixes
os_defs.c:920:40: error: format '%ld' expects argument of type 'long int', but argument 3 has type '__fsblkcnt_t' {aka 'long long unsigned int'} [-Werror=format=]
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/base/os_defs.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/src/base/os_defs.c
+++ b/src/base/os_defs.c
@@ -917,7 +917,11 @@ uint32_t ncs_os_posix_shm(NCS_OS_POSIX_S
((statsvfs.f_bfree - 1) * statsvfs.f_frsize)) {
syslog(
LOG_ERR,
+#if (_FILE_OFFSET_BITS == 64 || __TIMESIZE == 64) && __WORDSIZE == 32
+ "Insufficient shared memory (%lld) to write the data of size: %" PRId64
+#else
"Insufficient shared memory (%ld) to write the data of size: %" PRId64
+#endif
"\n",
(statsvfs.f_bfree * statsvfs.f_frsize),
req->info.write.i_write_size);

View File

@@ -0,0 +1,125 @@
From c2668f7f2ea82a61115b7cae56ed081b41ff5153 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 22 Apr 2017 12:34:37 -0700
Subject: [PATCH] configure: Disable format-overflow if supported by gcc
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Makefile.am | 6 +--
configure.ac | 2 +
m4/ax_check_compile_flag.m4 | 74 +++++++++++++++++++++++++++++++++++++
3 files changed, 79 insertions(+), 3 deletions(-)
create mode 100644 m4/ax_check_compile_flag.m4
diff --git a/Makefile.am b/Makefile.am
index b3d6553..5607fc2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -52,10 +52,10 @@ AM_CPPFLAGS = \
-pthread \
-D_GNU_SOURCE -DINTERNAL_VERSION_ID='"@INTERNAL_VERSION_ID@"' \
$(CORE_INCLUDES) \
- $(all_includes)
+ $(all_includes) @NOWARNINGS@
-AM_CFLAGS = -pipe -std=gnu11 @OSAF_HARDEN_FLAGS@ -Wall -Wformat=2 -Werror
-AM_CXXFLAGS = -pipe -std=gnu++11 @OSAF_HARDEN_FLAGS@ -Wall -Wformat=2 -Werror
+AM_CFLAGS = -pipe -std=gnu11 @OSAF_HARDEN_FLAGS@ -Wall -Wformat=2 -Werror @NOWARNINGS@
+AM_CXXFLAGS = -pipe -std=gnu++11 @OSAF_HARDEN_FLAGS@ -Wall -Wformat=2 -Werror @NOWARNINGS@
if ENABLE_GCOV
AM_CFLAGS += --coverage
diff --git a/configure.ac b/configure.ac
index 5b86730..47d1002 100644
--- a/configure.ac
+++ b/configure.ac
@@ -600,6 +600,8 @@ if test -z "$OSAF_HARDEN_FLAGS"; then
fi
AC_SUBST(OSAF_HARDEN_FLAGS)
+AX_CHECK_COMPILE_FLAG([-Werror=format-overflow],[NOWARNINGS=-Wno-error=format-overflow])
+AC_SUBST(NOWARNINGS)
#############################################
# List the output Makefiles
#############################################
diff --git a/m4/ax_check_compile_flag.m4 b/m4/ax_check_compile_flag.m4
new file mode 100644
index 0000000..dcabb92
--- /dev/null
+++ b/m4/ax_check_compile_flag.m4
@@ -0,0 +1,74 @@
+# ===========================================================================
+# https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
+#
+# DESCRIPTION
+#
+# Check whether the given FLAG works with the current language's compiler
+# or gives an error. (Warnings, however, are ignored)
+#
+# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
+# success/failure.
+#
+# If EXTRA-FLAGS is defined, it is added to the current language's default
+# flags (e.g. CFLAGS) when the check is done. The check is thus made with
+# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
+# force the compiler to issue an error when a bad flag is given.
+#
+# INPUT gives an alternative input source to AC_COMPILE_IFELSE.
+#
+# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
+# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation, either version 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+# Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see <https://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. You
+# need not follow the terms of the GNU General Public License when using
+# or distributing such scripts, even though portions of the text of the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+#serial 5
+
+AC_DEFUN([AX_CHECK_COMPILE_FLAG],
+[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
+AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
+AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
+ ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
+ _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
+ AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
+ [AS_VAR_SET(CACHEVAR,[yes])],
+ [AS_VAR_SET(CACHEVAR,[no])])
+ _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
+AS_VAR_IF(CACHEVAR,yes,
+ [m4_default([$2], :)],
+ [m4_default([$3], :)])
+AS_VAR_POPDEF([CACHEVAR])dnl
+])dnl AX_CHECK_COMPILE_FLAGS

View File

@@ -0,0 +1,27 @@
From 979b2b6a1aa574a26e8b736049c4207d568f60f3 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 13 Apr 2017 17:39:07 -0700
Subject: [PATCH] configure: Pass linker specific options with -Wl
This helps make it pass the options to linker correctly
and we can use non-gcc compilers
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 12a5d5c..5b86730 100644
--- a/configure.ac
+++ b/configure.ac
@@ -596,7 +596,7 @@ if test -z "$OSAF_HARDEN_FLAGS"; then
if echo "${CFLAGS} ${CXXFLAGS}" | grep -q -- -O0; then
OSAF_HARDEN_FLAGS=""
fi
- OSAF_HARDEN_FLAGS="${OSAF_HARDEN_FLAGS} -fstack-protector --param ssp-buffer-size=4 -fPIE -pie -zrelro -znow"
+ OSAF_HARDEN_FLAGS="${OSAF_HARDEN_FLAGS} -fstack-protector --param ssp-buffer-size=4 -fPIE -pie -Wl,-z,relro,-z,now"
fi
AC_SUBST(OSAF_HARDEN_FLAGS)

View File

@@ -0,0 +1,23 @@
From 300fd3e27e71a91fc52d3f985ed4fde548852853 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 27 Sep 2019 12:50:11 -0700
Subject: [PATCH] create_empty_library: Use CC variable intead of hardcoding
gcc
This ensures that cross-compiles can succeed, otherwise we get wrong
architecture on these stub libraries
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
scripts/create_empty_library | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/scripts/create_empty_library
+++ b/scripts/create_empty_library
@@ -66,4 +66,4 @@ for s in $symbols; do
echo "SaAisErrorT $s() { return SA_AIS_ERR_UNAVAILABLE; }" >> "$tmpdir/lib.c"
done
rm -f "$1"
-gcc -O2 -shared -fPIC "$tmpdir/lib.c" -Wl,-version-script="$2" -Wl,-soname="$libbase.so.$version1" -o "$1"
+$CC -O2 -shared -fPIC "$tmpdir/lib.c" -Wl,-version-script="$2" -Wl,-soname="$libbase.so.$version1" -o "$1" $LDFLAGS

View File

@@ -0,0 +1,50 @@
From ffc829603a2c50674c8e04de5221e43f80bfc1b2 Mon Sep 17 00:00:00 2001
From: Andrey Zhizhikin <andrey.z@gmail.com>
Date: Mon, 27 Jan 2020 13:00:53 +0000
Subject: [PATCH] immom_python: convert to python3
Convert immom_python to use python3, python2 is EOL and is not supported
by all distributions anymore.
Upstream-Status: Pending
Signed-off-by: Andrey Zhizhikin <andrey.z@gmail.com>
---
samples/immsv/immom_python/immom.py | 2 +-
samples/immsv/immom_python/immomexamples.py | 2 +-
samples/immsv/immom_python/immomtest.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/samples/immsv/immom_python/immom.py b/samples/immsv/immom_python/immom.py
index 4f68625ed..f88197000 100755
--- a/samples/immsv/immom_python/immom.py
+++ b/samples/immsv/immom_python/immom.py
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python3
"""
immom -- An IMM Object Manager in Python
diff --git a/samples/immsv/immom_python/immomexamples.py b/samples/immsv/immom_python/immomexamples.py
index 70c579265..bd693c25f 100755
--- a/samples/immsv/immom_python/immomexamples.py
+++ b/samples/immsv/immom_python/immomexamples.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#!/usr/bin/env python3
import immom
diff --git a/samples/immsv/immom_python/immomtest.py b/samples/immsv/immom_python/immomtest.py
index 4b98bea8c..ed2463ba9 100755
--- a/samples/immsv/immom_python/immomtest.py
+++ b/samples/immsv/immom_python/immomtest.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import immom
--
2.17.1

View File

@@ -0,0 +1,32 @@
From c21f77d592415f316138c05f581192a1f061e735 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 15 Sep 2017 10:09:03 -0700
Subject: [PATCH] immpbe_dump.cc: Use sys/wait.h instead of wait.h
Fixes
redirecting incorrect #include <wait.h> to <sys/wait.h>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/imm/common/immpbe_dump.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/imm/common/immpbe_dump.cc b/src/imm/common/immpbe_dump.cc
index e6b3cc5..3956028 100644
--- a/src/imm/common/immpbe_dump.cc
+++ b/src/imm/common/immpbe_dump.cc
@@ -26,12 +26,12 @@
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
-#include <wait.h>
#include <unistd.h>
#include <iostream>
#include <sstream>
#include <stdint.h>
#include <sys/stat.h>
+#include <sys/wait.h>
#include <libgen.h>
#include <set>
#include <vector>

View File

@@ -0,0 +1,43 @@
From 225891675b80beaa9d74ce56809e52c4451df72c Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 25 Jan 2023 21:46:22 -0800
Subject: [PATCH 1/2] include cstdint for uintXX_t types
GCC-13 needs it [1]
[1] https://www.gnu.org/software/gcc/gcc-13/porting_to.html
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/imm/immnd/ImmModel.h | 1 +
src/osaf/consensus/consensus_env.h | 1 +
2 files changed, 2 insertions(+)
diff --git a/src/imm/immnd/ImmModel.h b/src/imm/immnd/ImmModel.h
index 44da470..0660431 100644
--- a/src/imm/immnd/ImmModel.h
+++ b/src/imm/immnd/ImmModel.h
@@ -22,6 +22,7 @@
#include <saImmOm.h>
#include <cstdarg>
#include <sys/types.h>
+#include <cstdint>
#include <string>
#include <vector>
#include <map>
diff --git a/src/osaf/consensus/consensus_env.h b/src/osaf/consensus/consensus_env.h
index df4f93a..89ccf46 100644
--- a/src/osaf/consensus/consensus_env.h
+++ b/src/osaf/consensus/consensus_env.h
@@ -15,6 +15,7 @@
#ifndef OSAF_CONSENSUS_CONSENSUS_ENV_H_
#define OSAF_CONSENSUS_CONSENSUS_ENV_H_
+#include <cstdint>
#include <string>
#include "base/mutex.h"
--
2.39.1

View File

@@ -0,0 +1,32 @@
From 6168d43ddd353b92ad8bcd5c49dc68f18caa8a00 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 12 Apr 2022 17:07:49 -0700
Subject: [PATCH 1/2] include missing <array> header
Fixes
src/osaf/consensus/key_value.cc:25:30: error: aggregate 'std::array<char, 128> buffer' has incomplete type and cannot be defined
25 | std::array<char, buf_size> buffer;
| ^~~~~~
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/osaf/consensus/key_value.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/osaf/consensus/key_value.cc b/src/osaf/consensus/key_value.cc
index 692dd3f..6e16cbf 100644
--- a/src/osaf/consensus/key_value.cc
+++ b/src/osaf/consensus/key_value.cc
@@ -18,7 +18,7 @@
#include "base/getenv.h"
#include "base/logtrace.h"
#include "osaf/consensus/consensus.h"
-
+#include <array>
int KeyValue::Execute(const std::string& command, std::string& output) {
TRACE_ENTER();
constexpr size_t buf_size = 128;
--
2.35.1

View File

@@ -0,0 +1,120 @@
From 7fb393c66df33110fef0cbabac7d304f12eb82e4 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 15 Sep 2017 09:39:40 -0700
Subject: [PATCH] src: Add missing header limits.h for _POSIX_HOST_NAME_MAX
Use _GNU_SOURCE instead of libc internal __USE_GNU
Do not use the deprecated headers under include/sys
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/base/os_defs.h | 5 +++--
src/mds/mds_dt_tcp.c | 1 -
src/mds/mds_dt_tcp_disc.h | 2 +-
src/mds/mds_dt_tipc.c | 1 -
src/mds/mds_dt_tipc.h | 2 +-
src/mds/mds_dt_trans.c | 1 -
src/ntf/ntfd/NtfLogger.cc | 2 +-
7 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/src/base/os_defs.h b/src/base/os_defs.h
index a570c43..3559b19 100644
--- a/src/base/os_defs.h
+++ b/src/base/os_defs.h
@@ -47,17 +47,18 @@
#include <sys/stat.h>
#include <sys/msg.h> /* Added for message-queues : PM : 28/10/03 */
#include <syslog.h>
-#ifndef __USE_GNU
+#include <limits.h>
+#ifndef _GNU_SOURCE
struct msgbuf {
long int mtype;
char mtext[1];
};
#endif /* else defined in <sys/msg.h> */
#include <sys/time.h>
-#include <sys/fcntl.h>
#include <sys/socket.h>
#include <netinet/in.h>
+#include <fcntl.h>
#include <signal.h>
#include <pthread.h>
diff --git a/src/mds/mds_dt_tcp.c b/src/mds/mds_dt_tcp.c
index 1407eb1..a87c22f 100644
--- a/src/mds/mds_dt_tcp.c
+++ b/src/mds/mds_dt_tcp.c
@@ -27,7 +27,6 @@
#include <stdlib.h>
#include <sched.h>
-#include <sys/poll.h>
#include <poll.h>
#include <sys/types.h>
#include <unistd.h>
diff --git a/src/mds/mds_dt_tcp_disc.h b/src/mds/mds_dt_tcp_disc.h
index a6249d7..574f526 100644
--- a/src/mds/mds_dt_tcp_disc.h
+++ b/src/mds/mds_dt_tcp_disc.h
@@ -24,7 +24,7 @@
#include "base/ncssysf_tsk.h"
#include "base/ncssysf_mem.h"
#include "mds_dt_tcp_disc.h"
-#include "sys/poll.h"
+#include <poll.h>
/* mds_indentifire + mds_version + msg_type + scope_type + server_type +
server_instance_lower + server_instance_upper + sub_ref_val + sub_ref_val +
diff --git a/src/mds/mds_dt_tipc.c b/src/mds/mds_dt_tipc.c
index 7714175..a0ed3b6 100644
--- a/src/mds/mds_dt_tipc.c
+++ b/src/mds/mds_dt_tipc.c
@@ -35,7 +35,6 @@
#include <stdbool.h>
#include <stdlib.h>
#include <sched.h>
-#include <sys/poll.h>
#include <poll.h>
#include <sys/types.h>
#include <unistd.h>
diff --git a/src/mds/mds_dt_tipc.h b/src/mds/mds_dt_tipc.h
index e73a11b..401d208 100644
--- a/src/mds/mds_dt_tipc.h
+++ b/src/mds/mds_dt_tipc.h
@@ -32,7 +32,7 @@
#include <assert.h>
#include <string.h>
#include <sys/param.h>
-#include <sys/poll.h>
+#include <poll.h>
#include <netdb.h>
#include <errno.h>
#include <fcntl.h>
diff --git a/src/mds/mds_dt_trans.c b/src/mds/mds_dt_trans.c
index 6f621e0..5aacbd3 100644
--- a/src/mds/mds_dt_trans.c
+++ b/src/mds/mds_dt_trans.c
@@ -26,7 +26,6 @@
#include "mds_core.h"
#include "base/osaf_utility.h"
-#include <sys/poll.h>
#include <poll.h>
#define MDS_PROT_TCP 0xA0
diff --git a/src/ntf/ntfd/NtfLogger.cc b/src/ntf/ntfd/NtfLogger.cc
index fd17c58..1120008 100644
--- a/src/ntf/ntfd/NtfLogger.cc
+++ b/src/ntf/ntfd/NtfLogger.cc
@@ -20,7 +20,7 @@
* INCLUDE FILES
* ========================================================================
*/
-#include <sys/poll.h>
+#include <poll.h>
#include "base/osaf_utility.h"
#include <saAis.h>

View File

@@ -0,0 +1,59 @@
From 5e5686de677c884d5d785254412ced3c9d2d1b08 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 25 Jan 2023 21:47:45 -0800
Subject: [PATCH 2/2] Fix -Werror=enum-int-mismatch with gcc13
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/evt/agent/eda_hdl.h | 5 +++--
src/evt/evtd/eds_mds.h | 3 +--
src/smf/smfnd/smfnd.h | 8 ++++----
3 files changed, 8 insertions(+), 8 deletions(-)
--- a/src/evt/agent/eda_hdl.h
+++ b/src/evt/agent/eda_hdl.h
@@ -31,6 +31,7 @@
#define EVT_AGENT_EDA_HDL_H_
#include "evt/agent/eda.h"
+#include "ais/include/saAis.h"
uint32_t eda_hdl_cbk_dispatch(EDA_CB *, EDA_CLIENT_HDL_REC *, SaDispatchFlagsT);
@@ -68,11 +69,11 @@ EDA_CHANNEL_HDL_REC *eda_find_chan_hdl_r
void eda_msg_destroy(EDSV_MSG *msg);
-uint32_t eda_extract_pattern_from_event(
+SaAisErrorT eda_extract_pattern_from_event(
SaEvtEventPatternArrayT *from_pattern_array,
SaEvtEventPatternArrayT **to_pattern_array);
-uint32_t eda_allocate_and_extract_pattern_from_event(
+SaAisErrorT eda_allocate_and_extract_pattern_from_event(
SaEvtEventPatternArrayT *from_pattern_array,
SaEvtEventPatternArrayT **to_pattern_array);
--- a/src/evt/evtd/eds_mds.h
+++ b/src/evt/evtd/eds_mds.h
@@ -49,8 +49,7 @@ uint32_t eds_mds_msg_send(EDS_CB *cb, ED
MDS_SEND_PRIORITY_TYPE prio);
uint32_t eds_mds_ack_send(EDS_CB *cb, EDSV_MSG *msg, MDS_DEST dest,
- SaTimeT timeout, MDS_SEND_PRIORITY_TYPE prio);
-
+ SaTimeT timeout, uint32_t prio);
uint32_t eds_dec_subscribe_msg(NCS_UBAID *uba, long msg_hdl, uint8_t ckpt_flag);
uint32_t eds_dec_publish_msg(NCS_UBAID *uba, long msg_hdl, uint8_t ckpt_flag);
--- a/src/smf/smfnd/smfnd.h
+++ b/src/smf/smfnd/smfnd.h
@@ -76,7 +76,7 @@ extern "C" {
#endif
/* smfnd_amf.c */
-extern uint32_t smfnd_amf_init(smfnd_cb_t *cb);
+extern SaAisErrorT smfnd_amf_init(smfnd_cb_t *cb);
/* smfnd_mds.c */
extern uint32_t smfnd_mds_init(smfnd_cb_t *cb);

View File

@@ -0,0 +1,28 @@
From fe654d5340d18f04e4689ba19f843554909a0c00 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 12 Apr 2022 17:16:37 -0700
Subject: [PATCH 2/2] configure: Disable selected warnings
These warnings are emitted when compiling with gcc 11 and gcc 12
Do not treat them as errors
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
configure.ac | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/configure.ac
+++ b/configure.ac
@@ -601,7 +601,10 @@ if test -z "$OSAF_HARDEN_FLAGS"; then
fi
AC_SUBST(OSAF_HARDEN_FLAGS)
-AX_CHECK_COMPILE_FLAG([-Werror=format-overflow],[NOWARNINGS=-Wno-error=format-overflow])
+AX_CHECK_COMPILE_FLAG([-Werror=format-overflow],[NOWARNINGS='-Wno-error=format-overflow'])
+AX_CHECK_COMPILE_FLAG([-Wuse-after-free],[NOWARNINGS+=' -Wno-error=use-after-free'])
+AX_CHECK_COMPILE_FLAG([-Wstringop-truncation],[NOWARNINGS+=' -Wno-error=stringop-truncation'])
+AX_CHECK_COMPILE_FLAG([-Warray-bounds],[NOWARNINGS+=' -Wno-error=array-bounds'])
AC_SUBST(NOWARNINGS)
#############################################
# List the output Makefiles

View File

@@ -0,0 +1,99 @@
SUMMARY = "OpenSAF is an open source implementation of the SAF AIS specification"
DESCRIPTION = "OpenSAF is an open source project established to develop a base platform \
middleware consistent with Service Availability Forum (SA Forum) \
specifications, under the LGPLv2.1 license. The OpenSAF Foundation was \
established by leading Communications and Enterprise Computing Companies to \
facilitate the OpenSAF Project and to accelerate the adoption of the OpenSAF \
code base in commercial products. \
The OpenSAF project was launched in mid 2007 and has been under development by \
an informal group of supporters of the OpenSAF initiative. The OpenSAF \
Foundation was founded on January 22nd 2008 with Emerson Network Power, \
Ericsson, Nokia Siemens Networks, HP and Sun Microsystems as founding members."
HOMEPAGE = "http://www.opensaf.org"
SECTION = "admin"
LICENSE = "LGPL-2.1-only"
LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=a916467b91076e631dd8edb7424769c7"
DEPENDS = "libxml2 python3"
TOOLCHAIN = "gcc"
SECURITY_CFLAGS = "${SECURITY_NO_PIE_CFLAGS}"
SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/releases/${BPN}-${PV}.tar.gz \
file://0001-configure-Pass-linker-specific-options-with-Wl.patch \
file://0001-configure-Disable-format-overflow-if-supported-by-gc.patch \
file://0001-src-Add-missing-header-limits.h-for-_POSIX_HOST_NAME.patch \
file://0001-immpbe_dump.cc-Use-sys-wait.h-instead-of-wait.h.patch \
file://0001-create_empty_library-Use-CC-variable-intead-of-hardc.patch \
file://0001-immom_python-convert-to-python3.patch \
file://0001-Fix-build-with-fno-common.patch \
file://0001-Use-correct-printf-format-for-__fsblkcnt_t.patch \
file://0001-include-missing-array-header.patch \
file://0002-configure-Disable-selected-warnings.patch \
file://0001-include-cstdint-for-uintXX_t-types.patch \
file://0002-Fix-Werror-enum-int-mismatch-with-gcc13.patch \
"
SRC_URI[sha256sum] = "f008d53c83087ce2014c6089bc4ef08e14c1b4091298b943f4ceade1aa6bf61e"
UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/opensaf/files/releases"
inherit autotools useradd systemd pkgconfig
USERADD_PACKAGES = "${PN}"
GROUPADD_PARAM:${PN} = "-f -r opensaf"
USERADD_PARAM:${PN} = "-r -g opensaf -d ${datadir}/opensaf/ -s ${sbindir}/nologin -c \"OpenSAF\" opensaf"
SYSTEMD_SERVICE:${PN} += "opensafd.service"
SYSTEMD_AUTO_ENABLE = "disable"
PACKAGECONFIG[systemd] = ",,systemd"
PACKAGECONFIG[openhpi] = "--with-hpi-interface=B03,,openhpi"
PACKAGECONFIG[plm] = "--enable-ais-plm,--disable-ais-plm,libvirt openhpi"
PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', ' systemd', '', d)}"
CPPFLAGS += "-Wno-error"
CXXFLAGS += "-Wno-error"
LDFLAGS += "-Wl,--as-needed -latomic -Wl,--no-as-needed"
do_install:append() {
rm -fr "${D}${localstatedir}/lock"
rm -fr "${D}${localstatedir}/run"
rmdir "${D}${localstatedir}/log/${BPN}/saflog"
rmdir "${D}${localstatedir}/log/${BPN}"
rmdir "${D}${localstatedir}/log"
rmdir --ignore-fail-on-non-empty "${D}${localstatedir}"
rmdir --ignore-fail-on-non-empty "${D}${datadir}/java"
# Rename /etc/init.d/opensafd to /usr/lib/opensaf/opensafd-init as it is
# needed by opensafd.service, but /etc/init.d is removed by systemd.bbclass
# if sysvinit is not in DISTRO_FEATURES.
mv ${D}${sysconfdir}/init.d/opensafd ${D}${libdir}/${BPN}/opensafd-init
ln -srf ${D}${libdir}/${BPN}/opensafd-init ${D}${sysconfdir}/init.d/opensafd
[ ! -f ${D}${systemd_system_unitdir}/opensafd.service ] ||
sed -ri -e "s|/etc/init.d/opensafd|${libdir}/${BPN}/opensafd-init|" ${D}${systemd_system_unitdir}/opensafd.service
# Create /var/log/opensaf/saflog in runtime.
if [ "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" ]; then
install -d ${D}${nonarch_libdir}/tmpfiles.d
echo "d ${localstatedir}/log/${BPN}/saflog - - - -" > ${D}${nonarch_libdir}/tmpfiles.d/${BPN}.conf
fi
if [ "${@bb.utils.filter('DISTRO_FEATURES', 'sysvinit', d)}" ]; then
install -d ${D}${sysconfdir}/default/volatiles
echo "d root root 0755 ${localstatedir}/log/${BPN}/saflog none" > ${D}${sysconfdir}/default/volatiles/99_${BPN}
fi
}
FILES:${PN} += "${libdir}/libSa*.so ${systemd_unitdir}/system/*.service"
FILES:${PN} += "${nonarch_libdir}/tmpfiles.d"
FILES:${PN}-dev += "${libdir}/libopensaf_core.so"
FILES:${PN}-staticdev += "${PKGLIBDIR}/*.a"
INSANE_SKIP:${PN} = "dev-so"
RDEPENDS:${PN} += "bash python3-core"
# http://errors.yoctoproject.org/Errors/Details/186970/
COMPATIBLE_HOST:libc-musl = 'null'
FILES_SOLIBSDEV = ""

Some files were not shown because too many files have changed in this diff Show More