OpenWrt Forum Archive

Topic: Would it be hard to port ipmitool to an openwrt package

The content of this topic has been archived on 24 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

It seem like there once upon a time were a ipmitool package available for Kamikazi.


Does anyone know if there is any reason it isn't available anymore?


Would it be hard to port? (asking before I start trying as previous attempts to port packages have left me stranded because of lacking enough knowledge about C, C++ and gcc)

nimo wrote:

It seem like there once upon a time were a ipmitool package available for Kamikazi.


Does anyone know if there is any reason it isn't available anymore?

A few years ago, OpenWRT had retired and/or packages feed to old_packages feed. As such, packages under the old_packages feed won't get compiled under newer releases, AFAICT. However, it is still there and you will need to compile it yourself, AFAICT.

[debian@debian:/opt/openwrt-git-trunk 1258%] ~ scripts/feeds search ipmitool
Search results in feed 'old_packages':
ipmitool                     IPMI remote computer management utility
[debian@debian:/opt/openwrt-git-trunk 1259%] ~ dir feeds/old_packages/utils/ipmitool
total 8
-rw-r--r-- 1 debian users 1142 Jul  9  2015 Makefile
drwxr-xr-x 2 debian users 4096 Jul  9  2015 patches
[debian@debian:/opt/openwrt-git-trunk 1260%] ~ 

Thanks for your reply!

It was very simple to compile the standard ipmitool from the oldpackages feed.


However I did discover that the normal build had disabled the lanplus interface, to be able to compile that I edited the Makefile to enable lanplus:

# Copyright (C) 2008-2010, OpenWrt.org
#

include $(TOPDIR)/rules.mk

PKG_NAME:=ipmitool
PKG_VERSION:=1.8.11
PKG_RELEASE:=3

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@SF/ipmitool
PKG_MD5SUM:=1d0da20add7388d64c549f95538b6858

PKG_FIXUP:=autoreconf

#TARGET_LDFLAGS+=/usr/include/openssl
#PKG_BUILD_DEPENDS:=libopenssl

TARGET_LDFLAGS += -L$(STAGING_DIR)/usr/lib
TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include

include $(INCLUDE_DIR)/package.mk

define Package/ipmitool
  SECTION:=utils
  CATEGORY:=Utilities
  DEPENDS:=+libopenssl +libncurses +libreadline +libqcrypt
  TITLE:=IPMI remote computer management utility
  URL:=http://ipmitool.sourceforge.net/
endef

define Package/ipmitool/description
  IPMItool is a utility for managing and configuring devices
  that support the Intelligent Platform Management Interface
  (IPMI) version 1.5 and version 2.0 specifications.
endef

CONFIGURE_ARGS += \
  --enable-static=no \
  --enable-internal-md5 \
  --enable-intf-lan=yes \
  --enable-intf-lanplus=yes \
  --enable-intf-free=no \
  --enable-intf-open=no \
  --enable-intf-imb=no \
  --enable-intf-lipmi=no \
  --enable-intf-bmc=no

define Package/ipmitool/install
  $(INSTALL_DIR) $(1)/usr/sbin
  $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ipmitool $(1)/usr/sbin/
endef

$(eval $(call BuildPackage,ipmitool,+libopenssl))

But configure output says this:

checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking for library containing gethostbyname... none required
checking for library containing socket... none required
[b]checking for EVP_aes_128_cbc in -lcrypto... yes
checking for MD5_Init in -lcrypto... yes
checking for MD2_Init in -lcrypto... no
** The lanplus interface requires an SSL library with EVP_aes_128_cbc defined.[/b]
checking for linux/compiler.h... no
checking linux/ipmi.h usability... yes
checking linux/ipmi.h presence... yes
checking for linux/ipmi.h... yes
checking for ipmi_open_inband in -lfreeipmi... no
checking for ipmi_ctx_open_inband in -lfreeipmi... no
checking termios.h usability... yes
checking termios.h presence... yes
checking for termios.h... yes
checking sys/lipmi/lipmi_intf.h usability... no
checking sys/lipmi/lipmi_intf.h presence... no
checking for sys/lipmi/lipmi_intf.h... no
checking for library containing tgetent... -lncurses
checking for library containing initscr... none required
checking for library containing readline... -lreadline
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating doc/Makefile
config.status: creating contrib/Makefile
config.status: creating control/Makefile
config.status: creating control/pkginfo
config.status: creating control/prototype
config.status: creating control/rpmmacros
config.status: creating control/ipmitool.spec
config.status: creating lib/Makefile
config.status: creating include/Makefile
config.status: creating include/ipmitool/Makefile
config.status: creating src/Makefile
config.status: creating src/plugins/Makefile
config.status: creating src/plugins/lan/Makefile
config.status: creating src/plugins/lanplus/Makefile
config.status: creating src/plugins/open/Makefile
config.status: creating src/plugins/free/Makefile
config.status: creating src/plugins/imb/Makefile
config.status: creating src/plugins/bmc/Makefile
config.status: creating src/plugins/lipmi/Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
configure: WARNING: unrecognized options: --disable-nls

ipmitool 1.8.11

Interfaces
  lan     : yes
  lanplus : no
  open    : no
  free    : no
  imb     : no
  bmc     : no
  lipmi   : no

Extra tools
  ipmievd : yes

What am I missing?

Is it this line

checking for MD2_Init in -lcrypto... no

?

If that's the case why is not libopenssl providing that like it's supposed to?


Thanks in advance!

I was lurking around the configure.ac file from a git checkout and sure enough it clearly says the lanplus feature depends on SSL.

if test "x$xenable_intf_lanplus" != "xno" && test "x$have_crypto" != "xyes"; then
        echo "** The lanplus interface requires an SSL library with EVP_aes_128_cbc defined."
        xenable_intf_lanplus=no
fi

As such, you should not change anything else except removing the --enable-intf-lanplus=no \ as shown below since lanplus option is set as auto detect by the GNU configure scripts. In other words, if the GNU configure scripts finds the required libraries, it will enable the lanplus option.

--- a/feeds/old_packages/utils/ipmitool/Makefile    2015-07-09 09:40:18.302504218 -0400
+++ b/feeds/old_packages/utils/ipmitool/Makefile    2016-02-02 10:03:15.839049849 -0500
@@ -33,7 +33,6 @@
     --enable-static=no \
     --enable-internal-md5 \
     --enable-intf-lan=yes \
-    --enable-intf-lanplus=no \
     --enable-intf-free=no \
     --enable-intf-open=no \
     --enable-intf-imb=no \

Thanks for your help.


Everything was solved and ipmitool compiled happily with lanplus support when removing

--enable-internal-md5

as in the configure-script following lines were present:

if test "x$ac_cv_lib_crypto_EVP_aes_128_cbc" = xyes; then :
  if test "x$enable_internal_md5" != "xyes"; then
      have_crypto=yes; LIBS="$LIBS -lcrypto"
  fi
else
  have_crypto=no
fi

Which meant that as long as internal md5 were enabled it would disable crypto support and therefore comiple without openssl.

I managed to install ipmitool 1.8.18 on my netgear R7000 router flashed with adveced tomato:
Here's a short tutorial for my own reference and for anyone trying to accomplish this as well in the future:

Steps:
1. use an usb stick and install entware
2. download packages to create a build environment
3. download the latest ipmitool source files (I used 1.18.8)
4. install dependancies +libopenssl +libncurses +libreadline
5. symlink crypto libs so the ./configure command is able to detect is


1. : see here: (I cannot post links) Entware-ng Install-on-the-TomatoUSB
2. : see this guide: Entware-ng/Entware-ng/wiki/Using-gcc-(native-compilation)
3: download ipmitool from sourceforse, for lanplus as well (the above mentioned removing of --enable-internal-md5 doesn't seem to be needed anymore)4. use opkg install (you need the latest wget)
4. use opkg
5. this one took the most time to figure out: create a symlink from the /opt/lib/libcrypto.so.1.0.0 to /opt/lib/libcrypto.so (since the compiler is looking for libcrypto.so and otherwise lanplus interface cannot be used (needed for ipmi v2.0)

configure using ./configure --prefix=/opt and if everything is fine it will compile using make && make install and be a happy camper..

(Last edited by dafart on 29 Mar 2017, 18:26)

After having a working setup ipmitool suddenly stopped working; the error I'm getting is:
Could not open device at /dev/ipmi0 or /dev/ipmi/0 or /dev/ipmidev/0: No such file or directory

Looking at several forums it appears I need to insert the proper kernel modules, however I don't seem to be able to do so: modprobe: module ipmi_devintf not found in modules.dep

No idea how to insert the modules from the source directory.. No idea to debug.

I had been tweaking with an external USB drive and with the rtorrent easy install script (opkg install rtorrent-easy-install)

Flashing my firmware once again an start over from scratch resulted in the same problem, even after erasing NVRAM

And hints on hot to go from here?

Thanks in advance!

To answer my own question: it appears it has to do with my server and not with ipmitool itself.. After manually shutting down and starting the error disappeared an ipmitool works like it should be..

The discussion might have continued from here.