summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJackie Huang <jackie.huang@windriver.com>2017-04-26 16:22:00 +0800
committerJoe MacDonald <joe_macdonald@mentor.com>2017-04-27 12:02:12 -0400
commit26c812ece4120271a786a55abef463f9f65a25ad (patch)
treeecfb5de34b1c12aa0308d746f0fba394bd46f871
parent6dce1a2d9cf53d3b36e8999f25087a664645782b (diff)
downloadmeta-openembedded-26c812ece4120271a786a55abef463f9f65a25ad.tar.gz
openhpi: add new recipe
OpenHPI is an open source project created with the intent of providing an implementation of the SA Forum's Hardware Platform Interface (HPI). Signed-off-by: Jackie Huang <jackie.huang@windriver.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
-rw-r--r--meta-networking/recipes-daemons/openhpi/files/openhpi-add-libnetsnmp-when-link.patch25
-rw-r--r--meta-networking/recipes-daemons/openhpi/files/openhpi-fix-alignment-issue.patch23
-rw-r--r--meta-networking/recipes-daemons/openhpi/files/openhpi-fix-host-gcc.patch24
-rw-r--r--meta-networking/recipes-daemons/openhpi/files/openhpi-fix-testfail-errors.patch31
-rw-r--r--meta-networking/recipes-daemons/openhpi/files/openhpi-glib-cross-compile.patch33
-rw-r--r--meta-networking/recipes-daemons/openhpi/files/openhpi-hpi-shell-thread-fix.patch29
-rw-r--r--meta-networking/recipes-daemons/openhpi/files/openhpi-invalide-session.patch21
-rw-r--r--meta-networking/recipes-daemons/openhpi/files/openhpi-libxml2-cross-compile.patch21
-rw-r--r--meta-networking/recipes-daemons/openhpi/files/openhpi-linkfix.patch33
-rw-r--r--meta-networking/recipes-daemons/openhpi/files/openhpi-netsnmp-cross-compile.patch48
-rw-r--r--meta-networking/recipes-daemons/openhpi/files/openhpi-sysfs-cross-compile.patch23
-rw-r--r--meta-networking/recipes-daemons/openhpi/files/openhpi-use-serial-tests-config-needed-by-ptest.patch31
-rwxr-xr-xmeta-networking/recipes-daemons/openhpi/files/openhpi.init230
-rw-r--r--meta-networking/recipes-daemons/openhpi/files/openhpid.service11
-rwxr-xr-xmeta-networking/recipes-daemons/openhpi/files/run-ptest5
-rw-r--r--meta-networking/recipes-daemons/openhpi/openhpi_3.6.1.bb109
16 files changed, 697 insertions, 0 deletions
diff --git a/meta-networking/recipes-daemons/openhpi/files/openhpi-add-libnetsnmp-when-link.patch b/meta-networking/recipes-daemons/openhpi/files/openhpi-add-libnetsnmp-when-link.patch
new file mode 100644
index 000000000..4644910b7
--- /dev/null
+++ b/meta-networking/recipes-daemons/openhpi/files/openhpi-add-libnetsnmp-when-link.patch
@@ -0,0 +1,25 @@
1[PATCH] add libnetsnmp when link
2
3Upstream-Status: Pending
4
5Signed-off-by: Roy Li <rongqing.li@windriver.com>
6---
7 plugins/snmp_bc/t/Makefile.am | 2 +-
8 1 file changed, 1 insertion(+), 1 deletion(-)
9
10diff --git a/plugins/snmp_bc/t/Makefile.am b/plugins/snmp_bc/t/Makefile.am
11index 57e77ac..9894620 100644
12--- a/plugins/snmp_bc/t/Makefile.am
13+++ b/plugins/snmp_bc/t/Makefile.am
14@@ -74,7 +74,7 @@ nodist_libsnmp_bc_la_SOURCES = $(GENERATED_EVENT_CODE) $(REMOTE_SIM_SOURCES)
15 # libopenhpi_la_LIBADD = $(top_builddir)/utils/libopenhpiutils.la
16 # libopenhpi_la_LDFLAGS = -L$(top_builddir)/utils -version-info @HPI_LIB_VERSION@ -export-symbols $(top_srcdir)/src/hpi.sym
17
18-libsnmp_bc_la_LIBADD = -luuid @SNMPLIBS@ $(top_builddir)/utils/libopenhpiutils.la
19+libsnmp_bc_la_LIBADD = -luuid @SNMPLIBS@ $(top_builddir)/utils/libopenhpiutils.la -lnetsnmp
20 libsnmp_bc_la_LDFLAGS = -L$(top_builddir)/utils -module -version-info @HPI_LIB_VERSION@
21 # libsnmp_bc_la_LDFLAGS = -version 0:0:0
22
23--
241.7.10.4
25
diff --git a/meta-networking/recipes-daemons/openhpi/files/openhpi-fix-alignment-issue.patch b/meta-networking/recipes-daemons/openhpi/files/openhpi-fix-alignment-issue.patch
new file mode 100644
index 000000000..077e26cbf
--- /dev/null
+++ b/meta-networking/recipes-daemons/openhpi/files/openhpi-fix-alignment-issue.patch
@@ -0,0 +1,23 @@
1Fix alignment issue in ipmi_inventory.c
2
3Upstream-Status: Pending
4
5Signed-of-by: Aws Ismail <aws.ismail@windriver.com>
6
7diff --git a/plugins/ipmi/ipmi_inventory.c b/plugins/ipmi/ipmi_inventory.c
8index 5382186..01655c6 100644
9--- a/plugins/ipmi/ipmi_inventory.c
10+++ b/plugins/ipmi/ipmi_inventory.c
11@@ -2546,8 +2546,11 @@ static SaErrorT modify_inventory(SaHpiIdrFieldT *field,
12 if (tb->DataLength == 0) {
13 rv = ipmi_fru_set_board_info_mfg_time(fru, 0);
14 } else {
15+ time_t the_time;
16+ /* tb->Data is not aligned -- copy to temp */
17+ memcpy(&the_time, tb->Data, sizeof(the_time));
18 rv = ipmi_fru_set_board_info_mfg_time(fru,
19- *(time_t *)tb->Data);
20+ the_time);
21 }
22 break;
23 case SAHPI_IDR_FIELDTYPE_MANUFACTURER:
diff --git a/meta-networking/recipes-daemons/openhpi/files/openhpi-fix-host-gcc.patch b/meta-networking/recipes-daemons/openhpi/files/openhpi-fix-host-gcc.patch
new file mode 100644
index 000000000..029b857bc
--- /dev/null
+++ b/meta-networking/recipes-daemons/openhpi/files/openhpi-fix-host-gcc.patch
@@ -0,0 +1,24 @@
1fix host gcc warnings
2
3Remove gcc warnings when gcc is v3.2
4
5Upstream-Status: Pending
6
7Signed-of-by: Aws Ismail <aws.ismail@windriver.com>
8
9diff --git a/configure.ac b/configure.ac
10index f5a5b74..4a20154 100644
11--- a/configure.ac
12+++ b/configure.ac
13@@ -605,11 +605,6 @@ AC_ARG_ENABLE([werror],
14 fi],
15 [])
16
17-if test -n "`gcc --version | grep ' 3.2'`" ; then
18- CC_WARNINGS=`echo $CC_WARNINGS | sed -e 's/-Wno-strict-aliasing//g'`
19- CXX_WARNINGS=`echo $CC_WARNINGS | sed -e 's/-Wno-strict-aliasing//g'`
20-fi
21-
22 case $host_os in
23 solaris*)
24 CC_WARNINGS=`echo $CC_WARNINGS | sed -e 's/-Wcast-qual//g'`
diff --git a/meta-networking/recipes-daemons/openhpi/files/openhpi-fix-testfail-errors.patch b/meta-networking/recipes-daemons/openhpi/files/openhpi-fix-testfail-errors.patch
new file mode 100644
index 000000000..205696e65
--- /dev/null
+++ b/meta-networking/recipes-daemons/openhpi/files/openhpi-fix-testfail-errors.patch
@@ -0,0 +1,31 @@
1Fix for saftest failures.
2
3Upstream-Status: Pending
4
5Signed-off-by: yanjun.zhu <yanjun.zhu@windriver.com>
6
7diff -urpN a/openhpid/safhpi.c b/openhpid/safhpi.c
8--- a/openhpid/safhpi.c
9+++ b/openhpid/safhpi.c
10@@ -1976,7 +1976,7 @@ SaErrorT SAHPI_API saHpiSensorThresholds
11 oh_release_domain(d); /* Unlock domain */
12
13 OH_CALL_ABI(h, set_sensor_thresholds, SA_ERR_HPI_INVALID_CMD, rv,
14- ResourceId, SensorNum, SensorThresholds);
15+ ResourceId, SensorNum, &tmp);
16 oh_release_handler(h);
17
18 return rv;
19diff -urpN a/utils/sahpi_struct_utils.c b/utils/sahpi_struct_utils.c
20--- a/utils/sahpi_struct_utils.c
21+++ b/utils/sahpi_struct_utils.c
22@@ -3855,6 +3855,9 @@ SaHpiBoolT oh_valid_textbuffer(SaHpiText
23 /* found a unpaired surrogate */
24 return SAHPI_FALSE;
25 }
26+ } else {
27+ /*the first 2 bytes wrong*/
28+ return SAHPI_FALSE;
29 }
30 }
31 break;
diff --git a/meta-networking/recipes-daemons/openhpi/files/openhpi-glib-cross-compile.patch b/meta-networking/recipes-daemons/openhpi/files/openhpi-glib-cross-compile.patch
new file mode 100644
index 000000000..1627c9797
--- /dev/null
+++ b/meta-networking/recipes-daemons/openhpi/files/openhpi-glib-cross-compile.patch
@@ -0,0 +1,33 @@
1Fix glib cross compile
2
3Uses proper PKG_CONFIG_PATH when cross-compiling
4
5Upstream-Status: Pending
6
7Signed-of-by: Aws Ismail <aws.ismail@windriver.com>
8
9diff --git a/configure.ac b/configure.ac
10index b5f5aad..f5a5b74 100644
11--- a/configure.ac
12+++ b/configure.ac
13@@ -110,13 +110,13 @@ else
14 *** GLIB is always available from ftp://ftp.gtk.org/.])
15 fi
16
17-exact_version=`pkg-config --modversion $GLIB`;
18-GLIB_CFLAGS=`pkg-config --cflags $GLIB $GTHREAD`
19-GLIB_LIBS=`pkg-config --libs $GLIB $GTHREAD`
20-GLIB_ONLY_CFLAGS=`pkg-config --cflags $GLIB`
21-GLIB_ONLY_LIBS=`pkg-config --libs $GLIB`
22-GMODULE_ONLY_CFLAGS=`pkg-config --cflags $GMODULE`
23-GMODULE_ONLY_LIBS=`pkg-config --libs $GMODULE`
24+exact_version=`PKG_CONFIG_PATH=$PKG_CONFIG_PATH pkg-config --modversion $GLIB`;
25+GLIB_CFLAGS=`PKG_CONFIG_PATH=$PKG_CONFIG_PATH pkg-config --cflags $GLIB $GTHREAD`
26+GLIB_LIBS=`PKG_CONFIG_PATH=$PKG_CONFIG_PATH pkg-config --libs $GLIB $GTHREAD`
27+GLIB_ONLY_CFLAGS=`PKG_CONFIG_PATH=$PKG_CONFIG_PATH pkg-config --cflags $GLIB`
28+GLIB_ONLY_LIBS=`PKG_CONFIG_PATH=$PKG_CONFIG_PATH pkg-config --libs $GLIB`
29+GMODULE_ONLY_CFLAGS=`PKG_CONFIG_PATH=$PKG_CONFIG_PATH pkg-config --cflags $GMODULE`
30+GMODULE_ONLY_LIBS=`PKG_CONFIG_PATH=$PKG_CONFIG_PATH pkg-config --libs $GMODULE`
31
32 # On some versions of Solaris the pkg-config file for gthread-2.0 contains a
33 # compiler option, '-mt', that is incompatible with gcc
diff --git a/meta-networking/recipes-daemons/openhpi/files/openhpi-hpi-shell-thread-fix.patch b/meta-networking/recipes-daemons/openhpi/files/openhpi-hpi-shell-thread-fix.patch
new file mode 100644
index 000000000..7dac45318
--- /dev/null
+++ b/meta-networking/recipes-daemons/openhpi/files/openhpi-hpi-shell-thread-fix.patch
@@ -0,0 +1,29 @@
1commit e9f9a73c9dba8dd59f3d6c3acd9988ec8361d55a
2Author: Aws Ismail <aws.ismail@windriver.com>
3Date: Mon Dec 17 16:23:45 2012 -0500
4
5 Correct dangling g_thread_exit in session.c
6
7 hpi_shell's session.c has its progress_bar
8 thread created using pthread_create but
9 exited using g_thread_exit. Use pthread_exit
10 instead to avoid unpredictable GLIB thread
11 errors.
12
13 Upstream-Status: Pending
14
15 Signed-off-by: Aws Ismail <aws.ismail@windriver.com>
16
17diff --git a/hpi_shell/session.c b/hpi_shell/session.c
18index 85c31bf..187da4c 100644
19--- a/hpi_shell/session.c
20+++ b/hpi_shell/session.c
21@@ -66,7 +66,7 @@ static void* progress_bar(void *unused)
22 if (i < (PROGRESS_BUF_SIZE - mes_len - 1)) i++;
23 t++;
24 };
25- g_thread_exit(0);
26+ pthread_exit(0);
27 return (void *)1;
28 }
29
diff --git a/meta-networking/recipes-daemons/openhpi/files/openhpi-invalide-session.patch b/meta-networking/recipes-daemons/openhpi/files/openhpi-invalide-session.patch
new file mode 100644
index 000000000..d03c97e18
--- /dev/null
+++ b/meta-networking/recipes-daemons/openhpi/files/openhpi-invalide-session.patch
@@ -0,0 +1,21 @@
1Upstream-Status: Submitted
2
3Package saftest run a test case to pass invalid session id to function
4saHpiResourceIdGet that expect return SA_ERR_HPI_INVALID_SESSION. But the check
5for SA_ERR_HPI_INVALID_SESSION is missed somehow in function saHpiResourceIdGet.
6
7Add check for SA_ERR_HPI_INVALID_SESSION.
8
9Signed-off-by: Kai Kang <kai.kang@windriver.com>
10-----
11--- openhpi-3.4.0/baselib/safhpi.cpp.orig 2014-02-25 10:45:20.911734868 +0800
12+++ openhpi-3.4.0/baselib/safhpi.cpp 2014-02-25 10:46:05.366925389 +0800
13@@ -477,6 +477,8 @@
14 &rpt_update_count );
15 if ( rv == SA_ERR_HPI_NOT_PRESENT ) {
16 return SA_ERR_HPI_NOT_PRESENT;
17+ } else if ( rv == SA_ERR_HPI_INVALID_SESSION) {
18+ return SA_ERR_HPI_INVALID_SESSION;
19 } else if ( rv != SA_OK ) {
20 return SA_ERR_HPI_UNKNOWN;
21 }
diff --git a/meta-networking/recipes-daemons/openhpi/files/openhpi-libxml2-cross-compile.patch b/meta-networking/recipes-daemons/openhpi/files/openhpi-libxml2-cross-compile.patch
new file mode 100644
index 000000000..6d3b6648a
--- /dev/null
+++ b/meta-networking/recipes-daemons/openhpi/files/openhpi-libxml2-cross-compile.patch
@@ -0,0 +1,21 @@
1Fix libxml2 for cross-compiling
2
3Use proper XML2_INCLUDE path when cross-compiling
4
5Upstream-Status: Pending
6
7Signed-of-by: Aws Ismail <aws.ismail@windriver.com>
8
9diff --git a/configure.ac b/configure.ac
10index 30a792c..b5f5aad 100644
11--- a/configure.ac
12+++ b/configure.ac
13@@ -175,7 +175,7 @@ AC_CHECK_HEADERS([openssl/md2.h openssl/md5.h openssl/bio.h openssl/ssl.h openss
14
15 dnl xml is used for XML-based communication in ilo2_ribcl and oa_soap
16 AC_CHECK_LIB([xml2],[xmlParseMemory],[XML2_LIB=-lxml2],[XML2_LIB=])
17-AC_CHECK_HEADERS([libxml2/libxml/xmlexports.h],[XML2_INCLUDE="-I/usr/include/libxml2"],[XML2_INCLUDE])
18+AC_CHECK_HEADERS([libxml2/libxml/xmlexports.h],[XML2_INCLUDE="$XML2_INCLUDE"],[XML2_INCLUDE])
19 AC_SUBST(XML2_LIB)
20 AC_SUBST(XML2_INCLUDE)
21
diff --git a/meta-networking/recipes-daemons/openhpi/files/openhpi-linkfix.patch b/meta-networking/recipes-daemons/openhpi/files/openhpi-linkfix.patch
new file mode 100644
index 000000000..3222f5d13
--- /dev/null
+++ b/meta-networking/recipes-daemons/openhpi/files/openhpi-linkfix.patch
@@ -0,0 +1,33 @@
1Fix ipmi plugin's test dir compilation
2
3The ipmi plugin's test dir is not included
4in compilation since it does not compile
5properly with SSL
6
7Signed-of-by: Aws Ismail <aws.ismail@windriver.com>
8
9Upstream-Status: Pending
10
11Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
12---
13 plugins/ipmi/Makefile.in | 4 +++-
14 1 file changed, 3 insertions(+), 1 deletion(-)
15
16diff --git a/plugins/ipmi/Makefile.in b/plugins/ipmi/Makefile.in
17index 7c6b0a4..6204dbe 100644
18--- a/plugins/ipmi/Makefile.in
19+++ b/plugins/ipmi/Makefile.in
20@@ -448,7 +448,9 @@ top_srcdir = @top_srcdir@
21 MAINTAINERCLEANFILES = Makefile.in
22 AM_CPPFLAGS = -DG_LOG_DOMAIN=\"ipmi\" @OPENHPI_INCLUDES@
23 EXTRA_DIST = ipmi.sym ekeyfru.h
24-SUBDIRS = t
25+#SUBDIRS = t
26+#Tests don't compile wih SSL properly so comment them out
27+SUBDIRS =
28 AM_CFLAGS = @OPENIPMI_CFLAGS@
29 pkglib_LTLIBRARIES = libipmi.la
30 libipmi_la_SOURCES = ipmi.c \
31--
321.9.1
33
diff --git a/meta-networking/recipes-daemons/openhpi/files/openhpi-netsnmp-cross-compile.patch b/meta-networking/recipes-daemons/openhpi/files/openhpi-netsnmp-cross-compile.patch
new file mode 100644
index 000000000..95b0abc91
--- /dev/null
+++ b/meta-networking/recipes-daemons/openhpi/files/openhpi-netsnmp-cross-compile.patch
@@ -0,0 +1,48 @@
1Fix net-snmp when cross-compiling
2
3Remove irrelevant references to net-snmp libs and flags
4when cross-compiling net-snmp
5
6Signed-of-by: Aws Ismail <aws.ismail@windriver.com>
7
8Upstream-Status: Pending
9
10Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
11---
12 acinclude.m4 | 4 ++--
13 configure | 4 ++--
14 2 files changed, 4 insertions(+), 4 deletions(-)
15
16diff --git a/acinclude.m4 b/acinclude.m4
17index 82c33f6..727e461 100644
18--- a/acinclude.m4
19+++ b/acinclude.m4
20@@ -160,8 +160,8 @@ AC_DEFUN([OH_CHECK_NETSNMP],
21 ],
22 [
23 have_netsnmp=yes
24- SNMPFLAGS=`${net_snmp_config:-net-snmp-config} --cflags | perl -p -e 's/-O\S*//g'`
25- SNMPLIBS=`${net_snmp_config:-net-snmp-config} --libs`
26+ SNMPFLAGS=""
27+ SNMPLIBS=""
28 AC_MSG_RESULT(yes)
29 ],
30 [AC_MSG_RESULT(no. No SNMP based plugins can be built!)])
31diff --git a/configure b/configure
32index 00067bc..36b913c 100755
33--- a/configure
34+++ b/configure
35@@ -15949,8 +15949,8 @@ _ACEOF
36 if ac_fn_c_try_link "$LINENO"; then :
37
38 have_netsnmp=yes
39- SNMPFLAGS=`${net_snmp_config:-net-snmp-config} --cflags | perl -p -e 's/-O\S*//g'`
40- SNMPLIBS=`${net_snmp_config:-net-snmp-config} --libs`
41+ SNMPFLAGS=""
42+ SNMPLIBS=""
43 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
44 $as_echo "yes" >&6; }
45
46--
471.9.1
48
diff --git a/meta-networking/recipes-daemons/openhpi/files/openhpi-sysfs-cross-compile.patch b/meta-networking/recipes-daemons/openhpi/files/openhpi-sysfs-cross-compile.patch
new file mode 100644
index 000000000..38d9a6742
--- /dev/null
+++ b/meta-networking/recipes-daemons/openhpi/files/openhpi-sysfs-cross-compile.patch
@@ -0,0 +1,23 @@
1Fix sysfs when cross-compiling
2
3Use proper paths for sysfs plugins when cross-compiling
4
5Signed-of-by: Aws Ismail <aws.ismail@windriver.com>
6
7Upstream-Status: Pending
8
9Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
10
11diff --git a/plugins/sysfs/sysfs2hpi.c b/plugins/sysfs/sysfs2hpi.c
12index a745214..3685598 100644
13--- a/plugins/sysfs/sysfs2hpi.c
14+++ b/plugins/sysfs/sysfs2hpi.c
15@@ -18,7 +18,7 @@
16
17 #include <stdlib.h>
18 #include <string.h>
19-#include <libsysfs.h>
20+#include <sysfs/libsysfs.h>
21
22 #include <SaHpi.h>
23 #include <oh_utils.h>
diff --git a/meta-networking/recipes-daemons/openhpi/files/openhpi-use-serial-tests-config-needed-by-ptest.patch b/meta-networking/recipes-daemons/openhpi/files/openhpi-use-serial-tests-config-needed-by-ptest.patch
new file mode 100644
index 000000000..51537ef12
--- /dev/null
+++ b/meta-networking/recipes-daemons/openhpi/files/openhpi-use-serial-tests-config-needed-by-ptest.patch
@@ -0,0 +1,31 @@
1From 36fbaa27e7299f63c1324b0ad22b970e9365d6a7 Mon Sep 17 00:00:00 2001
2From: Jackie Huang <jackie.huang@windriver.com>
3Date: Wed, 24 Dec 2014 10:54:59 +0800
4Subject: [PATCH] openhpi: use serial-tests config needed by ptest
5
6ptest needs buildtest-TESTS and runtest-TESTS targets.
7serial-tests is required to generate those targets.
8
9Upstream-Status: Inappropriate [default automake behavior incompatible with ptest]
10
11Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
12---
13 configure.ac | 2 +-
14 1 files changed, 1 insertions(+), 1 deletions(-)
15
16diff --git a/configure.ac b/configure.ac
17index 4b51971..16136b3 100644
18--- a/configure.ac
19+++ b/configure.ac
20@@ -7,7 +7,7 @@ dnl various hacks by Sean Dague <http://dague.net/sean> 4/23/03
21 AC_PREREQ(2.57)
22 AC_INIT(openhpi, 3.5.0)
23 AC_CONFIG_SRCDIR(openhpi.spec.in)
24-AM_INIT_AUTOMAKE([1.8])
25+AM_INIT_AUTOMAKE([1.8 serial-tests])
26
27 AM_CONFIG_HEADER(config.h)
28 AH_TOP([#ifndef __OPENHPI_CONFIG_H
29--
301.7.1
31
diff --git a/meta-networking/recipes-daemons/openhpi/files/openhpi.init b/meta-networking/recipes-daemons/openhpi/files/openhpi.init
new file mode 100755
index 000000000..3a5f4a06a
--- /dev/null
+++ b/meta-networking/recipes-daemons/openhpi/files/openhpi.init
@@ -0,0 +1,230 @@
1#! /bin/sh
2#
3### BEGIN INIT INFO
4# Provides: openhpid
5# Required-Start: $network $remote_fs $syslog
6# Required-Stop: $network $remote_fs $syslog
7# Should-Start: $named
8# Should-Stop: $named
9# Default-Start: 2 3 4 5
10# Default-Stop: 0 1 6
11# Short-Description: Start OpenHPI daemon at boot time
12# Description: Enable OpenHPI service which is provided by openhpid.
13### END INIT INFO
14#
15# openhpid.sh Start/Stop the openhpi daemon.
16#
17# description: openhpid is standard UNIX program which uses the OpenHPI \
18# APIs and provides a standard internet server to access those \
19# APIs for client programs.
20# processname: openhpid
21# config: the standard openhpi conf file specified on the command line or the env.
22# pidfile: /var/run/openhpid.pid
23#
24# Author(s):
25# W. David Ashley <dashley@us.ibm.com>
26# Daniel de Araujo <ddearauj@us.ibm.com>
27
28# Source function library.
29PATH=/sbin:/bin:/usr/sbin:/usr/bin
30prog="OpenHPI"
31
32# If the openhpid executable is not available, we can't do any of this
33test -f /usr/sbin/openhpid || exit 0
34
35# Determine whether the lsb package is installed
36# If it is, determine which lsb is installed:
37# redhat, suse, or standard lsb
38
39if test -f /etc/init.d/functions
40then
41 lsbtype="rh"
42 . /etc/init.d/functions
43elif test -f /etc/rc.status
44then
45 lsbtype="suse"
46 . /etc/rc.status
47elif test -f /lib/lsb/init-functions
48then
49 lsbtype="lsb"
50 . /lib/lsb/init-functions
51elif test -f /etc/gentoo-release
52then
53 lsbtype="gentoo"
54 . /sbin/functions.sh
55else
56 lsbtype="nolsb"
57fi
58
59print_outcome()
60{
61
62 case "${lsbtype}" in
63
64 suse)
65 rc_status -v
66 ;;
67
68 lsb)
69 if test "$?" -eq 0
70 then
71 log_success_msg "success"
72 else
73 log_failure_msg "failed"
74 fi
75 ;;
76
77 gentoo)
78 eend $?
79 ;;
80
81 nolsb | rh)
82 if test "$?" -eq 0
83 then
84 echo " ... success"
85 fi
86 if test "$?" -ne 0
87 then
88 echo " ... failed"
89 fi
90 ;;
91 esac
92}
93
94start() {
95 case "${lsbtype}" in
96
97 suse)
98 echo -n "Starting $prog: "
99 startproc /usr/sbin/openhpid -c /etc/openhpi/openhpi.conf
100 RETVAL=$?
101 ;;
102 lsb)
103 echo -n "Starting $prog: "
104 start_daemon /usr/sbin/openhpid -c /etc/openhpi/openhpi.conf
105 RETVAL=$?
106 ;;
107 gentoo | rh)
108 echo "Starting $prog: "
109 start-stop-daemon --start --quiet --exec /usr/sbin/openhpid -- -c /etc/openhpi/openhpi.conf
110 RETVAL=$?
111 ;;
112 nolsb)
113 echo -n "Starting $prog: "
114 /usr/sbin/openhpid -c /etc/openhpi/openhpi.conf
115 RETVAL=$?
116 ;;
117
118 esac
119
120 print_outcome
121
122}
123
124stop() {
125 case "${lsbtype}" in
126
127 lsb | suse)
128 echo -n "Stopping $prog: "
129 killproc /usr/sbin/openhpid
130 RETVAL=$?
131 ;;
132
133 gentoo)
134 echo "Stopping $prog: "
135 start-stop-daemon --stop --quiet --exec /usr/sbin/openhpid
136 RETVAL=$?
137 ;;
138
139 nolsb | rh)
140 echo -n "Stopping $prog: "
141 if test -f /var/run/openhpid.pid && test "`cat /var/run/openhpid.pid`" != ""
142 then
143 kill "`cat /var/run/openhpid.pid`"
144 RETVAL=$?
145 else
146 RETVAL=0
147 fi
148 ;;
149
150 esac
151
152 print_outcome
153
154 if test "$RETVAL" -eq 0 && test -f /var/run/openhpid.pid
155 then
156 rm -f /var/lock/openhpid
157 rm -f /var/run/openhpid.pid
158 fi
159
160}
161
162dstatus() {
163 echo "Checking for $prog daemon: "
164
165 case "${lsbtype}" in
166
167 suse)
168 checkproc /usr/sbin/openhpid
169 rc_status -v
170 ;;
171 lsb)
172 pid="`pidofproc /usr/sbin/openhpid`"
173 if test "${pid}" != ""
174 then
175 log_success_msg "$prog is running"
176 else
177 log_success_msg "$prog is not running"
178 fi
179 ;;
180 gentoo | nolsb | rh)
181 if test -f /var/run/openhpid.pid &&
182 test "`cat /var/run/openhpid.pid`" != "" &&
183 kill -s 0 "`cat /var/run/openhpid.pid`"
184 then
185 echo "$prog is running"
186 else
187 echo "$prog is not running"
188 fi
189
190 ;;
191
192 esac
193
194
195
196}
197
198restart() {
199 stop
200 start
201}
202
203force_reload() {
204 # We don't currently support a reload, but can do a restart
205 stop
206 start
207}
208
209# See how we were called.
210
211case "$1" in
212 start)
213 start
214 ;;
215 stop)
216 stop
217 ;;
218 restart)
219 restart
220 ;;
221 status)
222 dstatus
223 ;;
224 force-reload)
225 force_reload
226 ;;
227 *)
228 echo "Usage: $0 {start|stop|restart|status|force-reload}"
229 exit 1
230esac
diff --git a/meta-networking/recipes-daemons/openhpi/files/openhpid.service b/meta-networking/recipes-daemons/openhpi/files/openhpid.service
new file mode 100644
index 000000000..cd4168f8e
--- /dev/null
+++ b/meta-networking/recipes-daemons/openhpi/files/openhpid.service
@@ -0,0 +1,11 @@
1[Unit]
2Description=Daemon providing access to the SAF Hardware Platform Interface
3After=syslog.target
4
5[Service]
6Type=forking
7PIDFile=/var/run/openhpid.pid
8ExecStart=@SBINDIR@/openhpid -c @SYSCONFDIR@/openhpi/openhpi.conf
9
10[Install]
11WantedBy=multi-user.target
diff --git a/meta-networking/recipes-daemons/openhpi/files/run-ptest b/meta-networking/recipes-daemons/openhpi/files/run-ptest
new file mode 100755
index 000000000..5b187d908
--- /dev/null
+++ b/meta-networking/recipes-daemons/openhpi/files/run-ptest
@@ -0,0 +1,5 @@
1#!/bin/sh
2for x in `find ./ -name Makefile`;
3do
4 make -C `dirname ${x}` -k runtest-TESTS
5done
diff --git a/meta-networking/recipes-daemons/openhpi/openhpi_3.6.1.bb b/meta-networking/recipes-daemons/openhpi/openhpi_3.6.1.bb
new file mode 100644
index 000000000..b9b0437b2
--- /dev/null
+++ b/meta-networking/recipes-daemons/openhpi/openhpi_3.6.1.bb
@@ -0,0 +1,109 @@
1SUMMARY = "Hardware Platform Interface Library and Tools"
2
3DESCRIPTION = "\
4OpenHPI is an open source project created with the intent of providing an \
5implementation of the SA Forum's Hardware Platform Interface (HPI). HPI \
6provides an abstracted interface to managing computer hardware, typically for \
7chassis and rack based servers. HPI includes resource modeling; access to and \
8control over sensor, control, watchdog, and inventory data associated with \
9resources; abstracted System Event Log interfaces; hardware events and alerts; \
10and a managed hotswap interface. \
11\
12OpenHPI provides a modular mechanism for adding new hardware and device support \
13easily. Many plugins exist in the OpenHPI source tree to provide access to \
14various types of hardware. This includes, but is not limited to, IPMI based \
15servers, Blade Center, and machines which export data via sysfs. \
16"
17
18HOMEPAGE = "http://openhpi.sourceforge.net/Home"
19SECTION = "net"
20LICENSE = "BSD"
21LIC_FILES_CHKSUM = "file://COPYING;md5=e3c772a32386888ccb5ae1c0ba95f1a4"
22
23DEPENDS = "net-snmp libxml2 ncurses openssl glib-2.0 popt e2fsprogs"
24
25SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.gz \
26 file://openhpi-netsnmp-cross-compile.patch \
27 file://openhpi-sysfs-cross-compile.patch \
28 file://openhpi-libxml2-cross-compile.patch \
29 file://openhpi-glib-cross-compile.patch \
30 file://openhpi-linkfix.patch \
31 file://openhpi-fix-host-gcc.patch \
32 file://openhpi-hpi-shell-thread-fix.patch \
33 file://openhpi-fix-testfail-errors.patch \
34 file://openhpi-add-libnetsnmp-when-link.patch \
35 file://openhpi-invalide-session.patch \
36 file://openhpi-use-serial-tests-config-needed-by-ptest.patch \
37 file://openhpi-fix-alignment-issue.patch \
38 \
39 file://openhpi.init \
40 file://openhpid.service \
41 file://run-ptest \
42"
43
44SRC_URI[md5sum] = "4718b16e0f749b5ad214a9b04f45dd23"
45SRC_URI[sha256sum] = "e0a810cb401c4bdcfc9551f2e6afd5a8ca4b411f5ee3bc60c19f82fd6e84a3dc"
46
47inherit autotools pkgconfig ptest update-rc.d systemd
48
49PACKAGES =+ "${PN}-libs"
50
51FILES_${PN}-libs = "${libdir}/${BPN}/*.so /usr/lib/${BPN}/*.so"
52
53INSANE_SKIP_${PN}-libs = "dev-so"
54RDEPENDS_${PN} += "${PN}-libs"
55
56PACKAGECONFIG ??= "libgcrypt"
57PACKAGECONFIG[sysfs] = "--enable-sysfs,--disable-sysfs,sysfsutils,"
58PACKAGECONFIG[libgcrypt] = "--enable-encryption,--disable-encryption,libgcrypt,"
59
60do_install_append () {
61 install -m 0755 -d ${D}${sysconfdir}/${BPN}
62 install -m 0755 ${S}/openhpiclient.conf.example ${D}${sysconfdir}/${BPN}/openhpiclient.conf
63 install -m 0700 ${S}/openhpi.conf.example ${D}${sysconfdir}/${BPN}/openhpi.conf
64 install -m 0755 ${S}/simulation.data.example ${D}${sysconfdir}/${BPN}/simulation.data
65 install -m 0755 ${S}/test_agent.data.example ${D}${sysconfdir}/${BPN}/test_agent.data
66 install -m 0755 ${WORKDIR}/openhpi.init ${D}${sysconfdir}/init.d/openhpid
67
68 install -d ${D}${systemd_unitdir}/system
69 install -m 0644 ${WORKDIR}/openhpid.service ${D}${systemd_unitdir}/system
70 sed -i -e "s,@SBINDIR@,${sbindir},g" -e "s,@SYSCONFDIR@,${sysconfdir},g" \
71 ${D}${systemd_unitdir}/system/openhpid.service
72}
73
74do_compile_ptest () {
75 for x in `find ${B} -name Makefile -exec grep -l buildtest-TESTS {} \;`; do
76 dir=`dirname ${x}`
77 upper=`dirname ${dir}`
78 if [ `basename ${upper}` != "cpp" ]; then
79 oe_runmake -C ${dir} buildtest-TESTS
80 fi
81 done
82}
83
84do_install_ptest () {
85 cp -rf ${B}/openhpid/t/ohpi/.libs/* ${B}/openhpid/t/ohpi/
86 TESTS="utils marshal openhpid"
87 for subtest in ${TESTS}; do
88 mkdir -p ${D}${PTEST_PATH}/${subtest}/t
89 cp -rf ${B}/${subtest}/t/* ${D}${PTEST_PATH}/${subtest}/t
90 done
91
92 for x in `find ${D}${PTEST_PATH} -name Makefile`; do
93 sed -i "s:${S}:${PTEST_PATH}/:g" ${x};
94 sed -i "s/^Makefile:/MM:/g" ${x};
95 done;
96
97 mkdir -p ${D}${PTEST_PATH}/plugins/watchdog/
98 cp -L ${D}/${libdir}/${BPN}/libwatchdog.so ${D}${PTEST_PATH}/plugins/watchdog/
99 cp -L ${D}/${libdir}/${BPN}/libsimulator.so ${D}${PTEST_PATH}/plugins/watchdog/
100 find ${D}${PTEST_PATH}/ -name "*.c" -exec rm {} \;
101 find ${D}${PTEST_PATH}/ -name "*.o" -exec rm {} \;
102 find ${D}${PTEST_PATH}/ -name "*.h" -exec rm {} \;
103}
104
105INITSCRIPT_NAME = "openhpid"
106INITSCRIPT_PARAMS = "start 30 . stop 70 0 1 2 3 4 5 6 ."
107
108SYSTEMD_SERVICE_${PN} = "openhpid.service"
109SYSTEMD_AUTO_ENABLE = "disable"