freeipmi: The GNU IPMI library
authorBjørn Mork <[email protected]>
Thu, 21 Sep 2023 06:56:56 +0000 (08:56 +0200)
committerHannu Nyman <[email protected]>
Wed, 5 Mar 2025 19:17:14 +0000 (21:17 +0200)
FreeIPMI provides in-band and out-of-band IPMI software based on the
IPMI v1.5/2.0 specification. The IPMI specification defines a set of
interfaces for platform management and is implemented by a number of
vendors for system management. The features of IPMI that most users
will be interested in are sensor monitoring, system event monitoring,
power control, and serial-over-LAN (SOL). The FreeIPMI tools and
libraries listed below should provide users with the ability to
access and utilize these and many other features. A number of useful
features for large HPC or cluster environments have also been
implemented into FreeIPMI.

Signed-off-by: Bjørn Mork <[email protected]>
admin/freeipmi/Makefile [new file with mode: 0644]
admin/freeipmi/patches/001-cross-compile-with-dev-urandom-support.patch [new file with mode: 0644]
admin/freeipmi/patches/002-pthreads-stack-size.patch [new file with mode: 0644]

diff --git a/admin/freeipmi/Makefile b/admin/freeipmi/Makefile
new file mode 100644 (file)
index 0000000..3f1cd59
--- /dev/null
@@ -0,0 +1,129 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=freeipmi
+PKG_VERSION:=1.6.11
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://ftp.gnu.org/gnu/$(PKG_NAME)
+PKG_HASH:=65fbd6910fc010457748695414f27c5755b4e8d75734221221f3858c6230a897
+PKG_LICENSE:=GPLv3
+PKG_LICENSE_FILES:=COPYING
+
+PKG_BUILD_DEPENDS:=!USE_GLIBC:argp-standalone
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libfreeipmi/Default
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE:=GNU implementation of the IPMI protocol
+  URL:=https://www.gnu.org/software/freeipmi/
+  MAINTAINER:=Bjørn Mork <[email protected]>
+endef
+
+define Package/libfreeipmi
+  $(call Package/libfreeipmi/Default)
+  DEPENDS:=+libgcrypt +libpthread
+  TITLE+= (libfreeipmi)
+endef
+
+define Package/libfreeipmi/description
+OpenIPMI, KCS, SMIC, SSIF, LAN drivers, and an IPMI API in a C Library.
+endef
+
+define Package/freeipmi-tools
+  $(call Package/libfreeipmi/Default)
+  DEPENDS:=+libipmiconsole +libipmidetect
+  TITLE+= (tools)
+endef
+
+define Package/freeipmi-tools/description
+Assorted IPMI-related tools:
+ * bmc-config - configure BMC values
+ * bmc-info - display BMC information
+ * ipmi-chassis - IPMI chassis management utility
+ * ipmi-fru - display FRU information
+ * ipmi-locate - IPMI probing utility
+ * ipmi-oem - IPMI OEM utility
+ * ipmi-pet - decode Platform Event Traps
+ * ipmi-raw - IPMI raw communication utility
+ * ipmi-sel - display SEL entries
+ * ipmi-sensors - display IPMI sensor information
+ * ipmi-sensors-config - configure sensors
+ * ipmiconsole - IPMI console utility
+ * ipmiping - send IPMI Get Authentication Capabilitiy request
+ * ipmipower - IPMI power control utility
+ * pef-config - configure PEF values
+ * rmcpping - send RMCP Ping to network hosts
+endef
+
+define Package/libipmiconsole
+  $(call Package/libfreeipmi/Default)
+  DEPENDS:=+libfreeipmi
+  TITLE+= (libipmiconsole)
+endef
+
+define Package/libipmiconsole/description
+A library for Serial-over-Lan (SOL).
+endef
+
+define Package/libipmidetect
+  $(call Package/libfreeipmi/Default)
+  DEPENDS:=+libfreeipmi
+  TITLE+= (libipmidetect)
+endef
+
+define Package/libipmidetect/description
+A library for IPMI node detection.
+endef
+
+CONFIGURE_ARGS += \
+       --disable-doc \
+       --disable-static
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
+endef
+
+define Package/libfreeipmi/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfreeipmi.so.* $(1)/usr/lib/
+endef
+
+define Package/freeipmi-tools/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/bmc-config $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/bmc-info $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ipmi-chassis $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ipmi-fru $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ipmi-locate $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ipmi-oem $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ipmi-pet $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ipmi-raw $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ipmi-sel $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ipmi-sensors $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ipmi-sensors-config $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ipmiping $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ipmi-pef-config $(1)/usr/sbin/pef-config
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rmcpping $(1)/usr/sbin/
+endef
+
+define Package/libipmiconsole/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libipmiconsole.so.* $(1)/usr/lib/
+endef
+
+define Package/libipmidetect/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libipmidetect.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libfreeipmi))
+$(eval $(call BuildPackage,freeipmi-tools))
+$(eval $(call BuildPackage,libipmiconsole))
+$(eval $(call BuildPackage,libipmidetect))
diff --git a/admin/freeipmi/patches/001-cross-compile-with-dev-urandom-support.patch b/admin/freeipmi/patches/001-cross-compile-with-dev-urandom-support.patch
new file mode 100644 (file)
index 0000000..6b2103c
--- /dev/null
@@ -0,0 +1,34 @@
+From 0d0b768272e9a8b092826cc593a1cc6924d65995 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= <[email protected]>
+Date: Thu, 21 Sep 2023 15:46:57 +0200
+Subject: [PATCH] cross-compile with /dev/urandom support
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The option to disable detection will also disable runtime support.
+Pretty useless...
+
+Shortcut this nonsense.  We do have /dev/random and /dev/urandom
+
+Signed-off-by: Bjørn Mork <[email protected]>
+---
+ configure.ac | 7 ++-----
+ 1 file changed, 2 insertions(+), 5 deletions(-)
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -749,11 +749,8 @@ AC_ARG_WITH([random-device],
+            ])
+ AC_MSG_RESULT([${ac_with_random_device=yes}])
+-if test x"${ac_with_random_device}" = xyes; then
+-   AC_CHECK_FILE([/dev/urandom], AC_DEFINE([HAVE_DEVURANDOM], [1], [Define that you found /dev/urandom]))
+-   AC_CHECK_FILE([/dev/random], AC_DEFINE([HAVE_DEVRANDOM], [1], [Define that you found /dev/random]))
+-fi
+-
++AC_DEFINE([HAVE_DEVURANDOM], [1], [Define that you found /dev/urandom])
++AC_DEFINE([HAVE_DEVRANDOM], [1], [Define that you found /dev/random])
+ dnl Option to install pkg-config support files
diff --git a/admin/freeipmi/patches/002-pthreads-stack-size.patch b/admin/freeipmi/patches/002-pthreads-stack-size.patch
new file mode 100644 (file)
index 0000000..3e72379
--- /dev/null
@@ -0,0 +1,76 @@
+From 61795c19742a28af946647c7c3cea6ba0f6e5e61 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= <[email protected]>
+Date: Thu, 21 Sep 2023 15:39:31 +0200
+Subject: [PATCH] libipmiconsole: set minimum stacksize to avoid SEGFAULT with
+ musl
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+libipmiconsole SEGFAULTs with musl because the default stacksize
+is too small.
+
+This fix is inspired by
+
+  mail/sendmail/patches/102-pthreads-stack-size.patch
+
+having the following description:
+
+  "This patch increases the stack size for pthreads from 80 KB, the default
+   stack size for musl libc, to 2 MB. The default stack size for glibc is 8 MB.
+
+   OpenDKIM, an application that depends on libmilter, segfaults if the stack
+   size for pthreads is left unchanged at the musl default value of 80 KB.
+   Apparently, OpenDKIM allocates blocks of 64 KB multiple times, which causes
+   libmilter and therefore OpenDKIM to crash:
+   https://git.alpinelinux.org/cgit/aports/commit/?id=95724d1bd53ae87f72e6388cb7323dbd8f84be9d
+
+   This patch follows the patch suggested by an Alpine Linux user in bug report
+   above. Also, a bug report has been filed upstream:
+   https://sourceforge.net/p/opendkim/bugs/258/
+  "
+
+Signed-off-by: Bjørn Mork <[email protected]>
+---
+ libipmiconsole/ipmiconsole_engine.c | 16 ++++++++++++++++
+ 1 file changed, 16 insertions(+)
+
+--- a/libipmiconsole/ipmiconsole_engine.c
++++ b/libipmiconsole/ipmiconsole_engine.c
+@@ -126,6 +126,8 @@ struct _ipmiconsole_poll_data {
+ #define IPMICONSOLE_PIPE_BUFLEN 1024
++#define IPMICONSOLE_MIN_STACKSIZE 2*1024*1024
++
+ static int
+ _ipmiconsole_garbage_collector_create (void)
+ {
+@@ -149,6 +151,13 @@ _ipmiconsole_garbage_collector_create (v
+       goto cleanup;
+     }
++  if ((perr = pthread_attr_setstacksize(&attr, IPMICONSOLE_MIN_STACKSIZE)))
++    {
++      IPMICONSOLE_DEBUG (("pthread_attr_setstacksize: %s", strerror (perr)));
++      errno = perr;
++      goto cleanup;
++    }
++
+   if ((perr = pthread_create (&thread, &attr, ipmiconsole_garbage_collector, NULL)))
+     {
+       IPMICONSOLE_DEBUG (("pthread_create: %s", strerror (perr)));
+@@ -1280,6 +1289,13 @@ ipmiconsole_engine_thread_create (void)
+     }
+   *index = console_engine_thread_count;
++  if ((perr = pthread_attr_setstacksize(&attr, IPMICONSOLE_MIN_STACKSIZE)))
++    {
++      IPMICONSOLE_DEBUG (("pthread_attr_setstacksize: %s", strerror (perr)));
++      errno = perr;
++      goto cleanup;
++    }
++
+   if ((perr = pthread_create (&thread, &attr, _ipmiconsole_engine, index)))
+     {
+       IPMICONSOLE_DEBUG (("pthread_create: %s", strerror (perr)));