--- openipmi-2.0.18.orig/OpenIPMIpthread.pc.in +++ openipmi-2.0.18/OpenIPMIpthread.pc.in @@ -6,6 +6,6 @@ Name: OpenIPMIpthread Description: Pthread OS handler for OpenIPMI Version: @VERSION@ -Requires: OpenIPMI pthread -Libs: -L${libdir} -lOpenIPMIutils -lOpenIPMIpthread -Cflags: -I${includedir} +Requires: OpenIPMI +Libs: -L${libdir} -lOpenIPMIutils -lOpenIPMIpthread -pthread +Cflags: -I${includedir} -pthread --- openipmi-2.0.18.orig/aclocal.m4 +++ openipmi-2.0.18/aclocal.m4 @@ -625,7 +625,10 @@ x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; - ppc64-*linux*|powerpc64-*linux*) + powerpc64le-*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) @@ -644,7 +647,10 @@ x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; - ppc*-*linux*|powerpc*-*linux*) + powerpcle-*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*) --- openipmi-2.0.18.orig/configure +++ openipmi-2.0.18/configure @@ -4813,7 +4813,10 @@ x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; - ppc64-*linux*|powerpc64-*linux*) + powerpc64le-*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) @@ -4832,7 +4835,10 @@ x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; - ppc*-*linux*|powerpc*-*linux*) + powerpcle-*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*) --- openipmi-2.0.18.orig/debian/changelog +++ openipmi-2.0.18/debian/changelog @@ -0,0 +1,269 @@ +openipmi (2.0.18-0ubuntu11.2) xenial; urgency=medium + + * d/openipmi.init: Fixed openipmi init file for other archs. (LP: #1716517) + + -- Manoj Iyer Mon, 21 May 2018 15:50:05 -0500 + +openipmi (2.0.18-0ubuntu11.1) xenial; urgency=medium + + * debian/openipmi.init: add Default-Start and Default-Stop values + (LP: #1596474). + * Forward-port fix from 2.0.16-1.1: fix pkg-config files: pthread.pc + does not exist in Ubuntu (LP: #1311888). + + -- Nishanth Aravamudan Wed, 29 Jun 2016 15:11:08 -0700 + +openipmi (2.0.18-0ubuntu11) xenial; urgency=medium + + * debian/openipmi.init: Do not unload all modules if some configured + HW modules are not successfully loaded (LP: #1318317). + + -- Nishanth Aravamudan Thu, 03 Mar 2016 16:55:22 -0800 + +openipmi (2.0.18-0ubuntu10) xenial; urgency=medium + + * Enabling openssl support as it is causing + problems running third party applications. (closes: #775847) + (LP: #1546735) + + -- Eric Desrochers Fri, 04 Mar 2016 17:28:50 +0000 + +openipmi (2.0.18-0ubuntu9) xenial; urgency=medium + + * No-change rebuild for ncurses6 transition. + + -- Matthias Klose Sun, 07 Feb 2016 09:44:35 +0000 + +openipmi (2.0.18-0ubuntu8) utopic; urgency=medium + + * Detect that a module is built into the kernel. + -LP: #1309860 + + -- Tim Gardner Tue, 20 May 2014 11:15:44 -0700 + +openipmi (2.0.18-0ubuntu7) trusty; urgency=medium + + * Patch libtool macro support in for ppc64el shared libraries. + + -- Adam Conrad Tue, 18 Mar 2014 22:40:54 -0600 + +openipmi (2.0.18-0ubuntu6) saucy; urgency=low + + * Revert local changes to config.guess/config.sub; instead, use + autotools-dev's debhelper integration to update these files for each + build. + + -- Colin Watson Tue, 08 Oct 2013 23:06:03 +0100 + +openipmi (2.0.18-0ubuntu5) saucy; urgency=low + + * Rebuild for libsnmp30. + + -- Colin Watson Mon, 20 May 2013 11:05:34 +0100 + +openipmi (2.0.18-0ubuntu4) quantal; urgency=low + + * Rebuild for new armel compiler default of ARMv5t. + + -- Colin Watson Mon, 08 Oct 2012 08:36:00 +0100 + +openipmi (2.0.18-0ubuntu3) natty; urgency=low + + * Fix up packaging to install and use /etc/default/openipmi. + (LP: #473332) Thanks to Serge Hallyn. + + -- Chuck Short Fri, 04 Mar 2011 10:38:42 -0500 + +openipmi (2.0.18-0ubuntu2) natty; urgency=low + + * debian/openipmi.init: Change lockfile path. '/var/log/subsys' does not + exists in Debian. (LP: #722770) + + -- Andres Rodriguez Thu, 24 Feb 2011 11:34:04 -0500 + +openipmi (2.0.18-0ubuntu1) maverick; urgency=low + + * New upstream version. + + -- Chuck Short Wed, 26 May 2010 14:58:52 -0400 + +openipmi (2.0.16-1ubuntu1) lucid; urgency=low + + * Sync with debian. + * debian/control: + - changed maintainer to match DebianMaintainerField spec. + * debian/rules, debian/openipmi.init: + - added init script + + -- Chuck Short Thu, 05 Nov 2009 12:52:52 -0500 + +openipmi (2.0.16-1) unstable; urgency=low + + * new upstream release from 2009-03-16 + * debian/compat, debian/control, raised to debhelper 5 + * debian/control removed URL in description new we + have the Homepage: field + * debian/control updated Standards-Version: (no changes needed) + * debian/rules removed unused cdbd dependency + + -- Noèl Köthe Tue, 28 Jul 2009 10:17:23 +0200 + +openipmi (2.0.14-2ubuntu2) karmic; urgency=low + + * No-change upload to (hopefully) fix FTBFS. + + -- Martin Pitt Mon, 19 Oct 2009 10:11:04 +0200 + +openipmi (2.0.14-2ubuntu1) jaunty; urgency=low + + * Merge from debian unstable, remaining changes: + - debian/control: changed maintainer to match DebianMaintainerField spec. + - debian/rules: debian/openipmi.init: added init-script. + + -- Chuck Short Wed, 05 Nov 2008 03:00:14 +0000 + +openipmi (2.0.14-2) unstable; urgency=low + + * added GNU/kFreeBSD patch from Petr. Thanks + (closes: Bug#497902) + + -- Noèl Köthe Sun, 19 Oct 2008 15:58:15 +0200 + +openipmi (2.0.14-1ubuntu1) intrepid; urgency=low + + * Merge from debian unstable, remaining changes: + - debian/control: changed maintainer to match DebianMaintainerField spec. + - debian/rules: debian/openipmi.init: added init-script. + + -- Chuck Short Sun, 20 Jul 2008 13:51:04 +0100 + +openipmi (2.0.14-1) unstable; urgency=medium + + * new upstream release + (closes: Bug#490165) + * debian/control updated Standards-Version + + -- Noèl Köthe Sat, 19 Jul 2008 20:30:39 +0200 + +openipmi (2.0.13-1ubuntu1) intrepid; urgency=low + + * Merge from Debian unstable (LP: #242632), remaining changes: + - debian/control: remove unecessary cdbs build-dep + - debian/rules, debian/openipmi.init: added init script + - debian/control: changed Maintainer to match DebianMaintinaerField spec. + + -- Thierry Carrez Tue, 24 Jun 2008 14:24:49 +0200 + +openipmi (2.0.13-1) unstable; urgency=low + + * new upstream release + * corrected watch file Thanks to Raphael Geissert + (closes: Bug#449859) + * updated Standards-Version + * added Homepage to debian/control + + -- Noèl Köthe Mon, 25 Feb 2008 20:07:00 +0100 + +openipmi (2.0.13-0ubuntu3) hardy; urgency=low + + * Make the init script more lsb specific. + + -- Chuck Short Wed, 13 Feb 2008 14:03:38 -0500 + +openipmi (2.0.13-0ubuntu2) hardy; urgency=low + + * Added init script. + + -- Chuck Short Tue, 12 Feb 2008 19:24:00 -0500 + +openipmi (2.0.13-0ubuntu1) hardy; urgency=low + + * New upstream release. + * Cleaned up debian/control. + + -- Chuck Short Tue, 12 Feb 2008 12:49:05 -0500 + +openipmi (2.0.11-2build1) hardy; urgency=low + + * Rebuild for libsnmp10 -> libsnmp15 transition. + + -- Steve Kowalik Mon, 10 Dec 2007 20:32:47 +1100 + +openipmi (2.0.11-2) unstable; urgency=low + + * correcting build dependency libsnmp10-dev -> libsnmp-dev + (closes: Bug#444089) + * debian/control corrected libopenipmi-dev dependency + * debian/rules don't ignore make clean errors + + -- Noèl Köthe Mon, 01 Oct 2007 17:42:07 +0200 + +openipmi (2.0.11-1) unstable; urgency=low + + * new upstream release from 2007-02-25 + (closes: Bug#392788) + * added patch parts from Philipp Matthias Hahn + Thank you! + + -- Noèl Köthe Thu, 21 Jun 2007 19:48:32 +0200 + +openipmi (2.0.7-1) unstable; urgency=low + + * new upstream release from 2006-06-08 + Thanks to John Wright for initial work + (closes: Bug#380149) + * updated Standards Version + * new binaries openipmicmd, openipmish, rmcp_ping + + -- Noèl Köthe Fri, 15 Sep 2006 17:56:24 +0200 + +openipmi (2.0.2-2) unstable; urgency=low + + * added missing libgdbm-dev to libopenipmi-dev + (closes: Bug#334623) + + -- Noèl Köthe Thu, 20 Oct 2005 23:01:55 +0200 + +openipmi (2.0.2-1) unstable; urgency=low + + * new upstream release from 2005-07-14 + * changed build-dep to libsnmp9-dev + * corrected stuppid typo + (closes: Bug#329928) + + -- Noèl Köthe Tue, 11 Oct 2005 18:35:21 +0200 + +openipmi (2.0.1-1) unstable; urgency=low + + * going to 2.x upstream + * the gcc 4.0 build problem is fixed by upstream in this version + (closes: Bug#304580) + * updated Standards-Version + * removed debmake build-dep + (closes: Bug#305889) + + -- Noèl Köthe Mon, 04 Jul 2005 21:29:17 +0200 + +openipmi (1.4.14-1) unstable; urgency=low + + * 1.4.x packages + * added homepages to description + * added watch file + + -- Noèl Köthe Tue, 12 Apr 2005 20:55:02 +0200 + +openipmi (1.3.11-2) unstable; urgency=low + + * corrected build-deps + (closes: Bug#278193) + + -- Noèl Köthe Mon, 01 Nov 2004 13:31:13 +0100 + +openipmi (1.3.11-1) unstable; urgency=low + + * Initial Release with some help from Philipp Matthias Hahn + unofficial package + (closes: Bug#274721) + + -- Noèl Köthe Tue, 12 Oct 2004 18:39:24 +0200 + --- openipmi-2.0.18.orig/debian/compat +++ openipmi-2.0.18/debian/compat @@ -0,0 +1 @@ +5 --- openipmi-2.0.18.orig/debian/control +++ openipmi-2.0.18/debian/control @@ -0,0 +1,38 @@ +Source: openipmi +Section: admin +Priority: optional +Maintainer: Ubuntu Core Developers +XSBC-Original-Maintainer: Noèl Köthe +Build-Depends: debhelper (>> 5.0.0), autotools-dev, libsnmp-dev, libpopt-dev, libncurses5-dev +Standards-Version: 3.8.2 +Homepage: http://openipmi.sourceforge.net/ + +Package: openipmi +Section: admin +Architecture: any +Depends: ${shlibs:Depends} +Description: Intelligent Platform Management Interface (for servers) + IPMI allows remote monitoring and remote management of devices. + . + This package contains some command-line and graphical-user-interfaces + to interact with IPMI-enabled devices. + +Package: libopenipmi0 +Section: devel +Architecture: any +Depends: ${shlibs:Depends} +Description: Intelligent Platform Management Interface - runtime + IPMI allows remote monitoring and remote management of devices. + . + This package contains the runtime library. + +Package: libopenipmi-dev +Section: libdevel +Architecture: any +Depends: libopenipmi0 (= ${binary:Version}), libgdbm-dev +Description: Intelligent Platform Management Interface - development + IPMI allows remote monitoring and remote management of devices. + . + This package contains the development headers needed for compiling + programs against libopenipmi. + --- openipmi-2.0.18.orig/debian/copyright +++ openipmi-2.0.18/debian/copyright @@ -0,0 +1,15 @@ +This package was debianized by +Noèl Köthe on Tue, 12 Oct 2004 18:39:24 +0200. + +It was downloaded from http://openipmi.sourceforge.net/ + https://sf.net/projects/openipmi/ + +Copyright: + +Upstream Author: Corey Minyard + +License: + +Released under the terms of the GPL and some parts LGPL; see +/usr/share/common-licenses/GPL and /usr/share/common-licenses/LGPL. + --- openipmi-2.0.18.orig/debian/dirs +++ openipmi-2.0.18/debian/dirs @@ -0,0 +1,3 @@ +usr/bin +usr/sbin +etc/default --- openipmi-2.0.18.orig/debian/docs +++ openipmi-2.0.18/debian/docs @@ -0,0 +1,5 @@ +FAQ +README +README.Force +README.MotorolaMXP +TODO --- openipmi-2.0.18.orig/debian/info +++ openipmi-2.0.18/debian/info @@ -0,0 +1,4 @@ +doc/OpenIPMI.info +doc/OpenIPMI.info-1 +doc/OpenIPMI.info-2 +doc/OpenIPMI.info-3 --- openipmi-2.0.18.orig/debian/libopenipmi-dev.files +++ openipmi-2.0.18/debian/libopenipmi-dev.files @@ -0,0 +1,5 @@ +usr/lib/pkgconfig +usr/include +usr/lib/lib*.a +usr/lib/lib*.la +usr/lib/lib*.so --- openipmi-2.0.18.orig/debian/libopenipmi0.files +++ openipmi-2.0.18/debian/libopenipmi0.files @@ -0,0 +1 @@ +usr/lib/lib*.so.* --- openipmi-2.0.18.orig/debian/openipmi-doc.files +++ openipmi-2.0.18/debian/openipmi-doc.files @@ -0,0 +1,4 @@ +usr/share/info/OpenIPMI.info +usr/share/info/OpenIPMI.info-1 +usr/share/info/OpenIPMI.info-2 +usr/share/info/OpenIPMI.info-3 --- openipmi-2.0.18.orig/debian/openipmi.files +++ openipmi-2.0.18/debian/openipmi.files @@ -0,0 +1,17 @@ +usr/bin/ipmi_ui +usr/bin/ipmicmd +usr/bin/ipmilan +usr/bin/ipmish +usr/bin/openipmicmd +usr/bin/openipmish +usr/bin/rmcp_ping +usr/bin/solterm +usr/share/info/OpenIPMI.inf* +usr/share/man/man1/ipmi_ui.1 +usr/share/man/man1/openipmicmd.1 +usr/share/man/man1/openipmish.1 +usr/share/man/man1/rmcp_ping.1 +usr/share/man/man1/solterm.1 +usr/share/man/man7/ipmi_cmdlang.7 +usr/share/man/man7/openipmi_conparms.7 +usr/share/man/man8/ipmilan.8 --- openipmi-2.0.18.orig/debian/openipmi.init +++ openipmi-2.0.18/debian/openipmi.init @@ -0,0 +1,545 @@ +#!/bin/bash +############################################################################# +# +# ipmi: OpenIPMI Driver init script +# +# Authors: Matt Domsch +# Chris Poblete +# +# chkconfig: - 13 87 +# description: OpenIPMI Driver init script +# +### BEGIN INIT INFO +# Provides: ipmidrv +# Required-Start: $local_fs $remote_fs $syslog +# Required-Stop: $local_fs $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: OpenIPMI Driver init script +# Description: OpenIPMI Driver init script +### END INIT INFO +# +# Status return code bits +# no bits set = no errors +# bit 0 set = minimum modules aren't loaded +# bit 1 set = requested feature module isn't loaded +# bit 2 set = /dev/ipmi0 (or /dev/imb if using that instead) doesn't exist +# bit 3 set = /dev/watchdog doesn't exist +# bit 4 set = lockfile doesn't exist +# bit 5 set = modules are loaded even when asked to be unloaded + +# +############################################################################# +. /lib/lsb/init-functions + +CONFIGFILE=/etc/default/openipmi +# source config info +[ -r ${CONFIGFILE} ] && . ${CONFIGFILE} + +############################################################################# +# GLOBALS +############################################################################# +MODULE_NAME="ipmi" +INTF_NUM=0 + +IPMI_SMB_MODULE_NAME="ipmi_smb" +case $(uname -m) in + "aarch64") + IPMI_SI_MODULE_NAME="ipmi_ssif" ;; + "ppc64le") + IPMI_SI_MODULE_NAME="ipmi_powernv" ;; + *) + IPMI_SI_MODULE_NAME="ipmi_si" ;; +esac +kernel=`uname -r | cut -d. -f1-2` +if [ "${kernel}" == "2.4" ]; then + IPMI_SMB_MODULE_NAME="ipmi_smb_intf" + IPMI_SI_MODULE_NAME="ipmi_si_drv" +fi + +MODULES_INTERFACES="" +[ "${DEV_IPMI}" = "yes" ] && MODULES_INTERFACES="${MODULES_INTERFACES} ipmi_devintf" +[ "${IPMI_IMB}" = "yes" ] && MODULES_INTERFACES="${MODULES_INTERFACES} ipmi_imb" + +MODULES_FEATURES="" +[ "${IPMI_WATCHDOG}" = "yes" ] && MODULES_FEATURES="${MODULES_FEATURES} ipmi_watchdog" +[ "${IPMI_POWEROFF}" = "yes" ] && MODULES_FEATURES="${MODULES_FEATURES} ipmi_poweroff" + +MODULES_HW="" +[ "${IPMI_SI}" = "yes" ] && MODULES_HW="${MODULES_HW} ${IPMI_SI_MODULE_NAME}" +[ "${IPMI_SMB}" = "yes" ] && MODULES_HW="${MODULES_HW} ${IPMI_SMB_MODULE_NAME}" + +MODULES_BASE="ipmi_msghandler" +MODULES="${MODULES_INTERFACES} ${MODULES_FEATURES} ${MODULES_HW} ${MODULES_BASE}" + +RETVAL=0 +LOCKFILE=/var/lock/ipmi +DEV_IPMI_TIMEOUT=15 + +UDEV_EXISTS=0 +if [ -e /sbin/udev -o -e /sbin/udevd ]; then + UDEV_EXISTS=1 +fi + +############################################################################# +# NOTES: +# * /dev/ipmi0 is unconditionally deleted here on ipmi_devintf unload, +# because SLES9 and RHEL4 kernels don't send a message for udev to delete +# it for us. +# +############################################################################# + +modules_loaded_verbose() +{ + OnePlusLoaded=0 + OnePlusUnloaded=0 + for m in $@; do + if /sbin/lsmod | grep $m >/dev/null 2>&1 ; then + echo "$m module loaded." + OnePlusLoaded=1 + elif [ -d "/sys/module/$m" ]; then + echo "$m module in kernel." + OnePlusLoaded=1 + else + echo "$m module not loaded." + OnePlusUnloaded=1 + fi + done +} + +modules_loaded() +{ + OnePlusLoaded=0 + OnePlusUnloaded=0 + for m in $@; do + if /sbin/lsmod | grep $m >/dev/null 2>&1 ; then + OnePlusLoaded=1 + elif [ -d "/sys/module/$m" ]; then + OnePlusLoaded=1 + else + OnePlusUnloaded=1 + fi + done +} + +device_node_exists () +{ + if [ -e "$1" ]; then + echo "$1 exists." + return 1 + fi + echo "$1 does not exist." + return 0 +} + +minimum_modules_loaded() +{ + rc_base=1 + rc_hw=1 + modules_loaded_verbose "${MODULES_BASE}" + [ ${OnePlusLoaded} -eq 0 ] && rc_base=0 + + modules_loaded_verbose "${MODULES_HW}" + [ ${OnePlusLoaded} -eq 0 ] && rc_hw=0 + + return $((rc_base && rc_hw)) +} + +############################################################################# + +load_si() +{ + if [ "${IPMI_SI}" = "yes" ]; then + modprobe ${IPMI_SI_MODULE_NAME} > /dev/null 2>&1 + modules_loaded ${IPMI_SI_MODULE_NAME} + [ ${OnePlusLoaded} -ne 1 ] && RETVAL=$((RETVAL | 1)) + fi +} + +load_smb() +{ + if [ "${IPMI_SMB}" = "yes" ]; then + modprobe ${IPMI_SMB_MODULE_NAME} > /dev/null 2>&1 + modules_loaded ${IPMI_SMB_MODULE_NAME} + [ ${OnePlusLoaded} -ne 1 ] && RETVAL=$((RETVAL | 1)) + fi +} + +load_hw_modules() +{ + load_si + load_smb +} + +start_watchdog_common() +{ + load_hw_modules + modprobe ipmi_watchdog ${IPMI_WATCHDOG_OPTIONS} > /dev/null 2>&1 + modules_loaded ipmi_watchdog + [ ${OnePlusUnloaded} -ne 0 ] && + RETVAL=$((RETVAL | 2)) && + log_end_msg && + return + if [ ${UDEV_EXISTS} -eq 0 -a ! -e /dev/watchdog ]; then + mknod -m 0600 /dev/watchdog c 10 130 + [ $? -ne 0 ] && + RETVAL=$((RETVAL | 8)) && + log_end_msg && + return + fi + #log_success_msg +} + +start_watchdog_quiet() +{ + [ "${IPMI_WATCHDOG}" != "yes" ] && + return + start_watchdog_common +} + +start_watchdog() +{ + log_begin_msg $"Starting ipmi_watchdog driver: " + [ "${IPMI_WATCHDOG}" != "yes" ] && + RETVAL=$((RETVAL | 2)) && + log_failure_msg "not configured" && + return + start_watchdog_common + log_end_msg 0 +} + +stop_watchdog() +{ + log_begin_msg $"Stopping ipmi_watchdog driver: " + modprobe -q -r ipmi_watchdog > /dev/null 2>&1 + modules_loaded ipmi_watchdog + if [ ${OnePlusLoaded} -ne 0 ]; then + RETVAL=$((RETVAL | 32)) + log_failure_msg "failed" + else + if [ "${IPMI_WATCHDOG}" = "yes" ]; then + [ ${UDEV_EXISTS} -eq 0 ] && rm -f /dev/watchdog + fi + log_success_msg "success" + fi + log_end_msg 0 +} + +stop_watchdog_quiet() +{ + modprobe -q -r ipmi_watchdog > /dev/null 2>&1 + modules_loaded ipmi_watchdog + if [ ${OnePlusLoaded} -ne 0 ]; then + RETVAL=$((RETVAL | 32)) + else + if [ "${IPMI_WATCHDOG}" = "yes" ]; then + [ ${UDEV_EXISTS} -eq 0 ] && rm -f /dev/watchdog + fi + fi +} + +start_powercontrol_common() +{ + local poweroff_opts="" + load_hw_modules + if [ "${IPMI_POWERCYCLE}" == "yes" ]; then + modinfo ipmi_poweroff 2>/dev/null | grep poweroff_control > /dev/null 2>&1 && \ + poweroff_opts="poweroff_control=2" + modinfo ipmi_poweroff 2>/dev/null | grep poweroff_powercycle > /dev/null 2>&1 && \ + poweroff_opts="poweroff_powercycle=1" + fi + modprobe ipmi_poweroff "${poweroff_opts}" > /dev/null 2>&1 + modules_loaded ipmi_poweroff + [ ${OnePlusUnloaded} -ne 0 ] && + RETVAL=$((RETVAL | 2)) && + log_failure_msg && + return + log_success_msg +} + +start_powercontrol_quiet() +{ + [ "${IPMI_POWEROFF}" != "yes" ] && + return + log_begin_msg "Starting ipmi_poweroff driver: " + start_powercontrol_common + log_end_msg 0 +} + +start_powercontrol() +{ + log_begin_msg "Starting ipmi_poweroff driver." + [ "${IPMI_POWEROFF}" != "yes" ] && + RETVAL=$((RETVAL | 2)) && + log_failure_msg "not configured" && + return + start_powercontrol_common + log_end_msg 0 +} + +stop_powercontrol() +{ + log_being_msg "Stopping ipmi_poweroff driver." + modprobe -q -r ipmi_poweroff > /dev/null 2>&1 + modules_loaded ipmi_poweroff + if [ ${OnePlusLoaded} -ne 0 ]; then + RETVAL=$((RETVAL | 32)) + log_failure_msg + else + log_success_msg + fi + log_end_msg 0 +} + +stop_powercontrol_quiet() +{ + modprobe -q -r ipmi_poweroff > /dev/null 2>&1 + modules_loaded ipmi_poweroff + [ ${OnePlusLoaded} -ne 0 ] && RETVAL=$((RETVAL | 32)) +} + +############################################################################# +unload_all_ipmi_modules() +{ + stop_watchdog_quiet + stop_powercontrol_quiet + for m in ${MODULES}; do + modprobe -q -r ${m} > /dev/null 2>&1 + done + # delete interface node ONLY if ipmi_devintf is unloaded + [ `lsmod | grep -c "ipmi_devintf"` -eq 0 ] && + rm -f "/dev/ipmi${INTF_NUM}" +} + +unload_ipmi_modules_leave_features() +{ + for m in ${MODULES_INTERFACES}; do + modprobe -q -r ${m} > /dev/null 2>&1 + done + # delete interface node ONLY if ipmi_devintf is unloaded + [ `lsmod | grep -c "ipmi_devintf"` -eq 0 ] && + rm -f "/dev/ipmi${INTF_NUM}" + lsmod | egrep -q "ipmi_(poweroff|watchdog)" > /dev/null 2>&1 + if [ "$?" -ne "0" ]; then + stop_watchdog_quiet + stop_powercontrol_quiet + for m in ${MODULES}; do + modprobe -q -r ${m} > /dev/null 2>&1 + done + fi +} + +############################################################################# +load_ipmi_modules () +{ + local locdelay + modprobe ipmi_msghandler > /dev/null 2>&1 + modules_loaded ipmi_msghandler + [ ${OnePlusLoaded} -ne 1 ] && RETVAL=$((RETVAL | 1)) && return + load_hw_modules + [ $((RETVAL & 1)) -eq 1 ] && return + + if [ "${DEV_IPMI}" = "yes" ]; then + modprobe ipmi_devintf > /dev/null 2>&1 + modules_loaded ipmi_devintf + RETVAL=$((RETVAL & ~2)) + [ ${OnePlusLoaded} -eq 0 ] && RETVAL=$((RETVAL | 2)) + if [ ${OnePlusLoaded} -eq 1 ]; then + if [ ${UDEV_EXISTS} -eq 0 ]; then + DEVMAJOR=`cat /proc/devices | awk '/ipmidev/{print $1}'` + rm -f /dev/ipmi${INTF_NUM} + mknod -m 0600 /dev/ipmi${INTF_NUM} c ${DEVMAJOR} 0 || RETVAL=$((RETVAL | 4)) + fi + + # udev can take several seconds to create /dev/ipmi0, + # but it happens asynchronously, so delay here + locdelay=${DEV_IPMI_TIMEOUT} + while [ ! -e /dev/ipmi${INTF_NUM} -a ${locdelay} -gt 0 ]; do + locdelay=$((locdelay - 1)) + sleep 1 + done + fi + fi + + if [ "${IPMI_IMB}" = "yes" ]; then + modprobe ipmi_imb > /dev/null 2>&1 + modules_loaded ipmi_imb + RETVAL=$((RETVAL & ~2)) + [ ${OnePlusLoaded} -eq 0 ] && RETVAL=$((RETVAL | 2)) + if [ ${OnePlusLoaded} -eq 1 ]; then + DEVMAJOR=`cat /proc/devices | awk '/imb/{print $1}'` + rm -f /dev/imb + mknod -m 0600 /dev/imb c ${DEVMAJOR} 0 || RETVAL=$((RETVAL | 4)) + fi + fi + + # Per Corey Minyard, essentially no one uses ipmi_radisys + # and we don't want to encourage its further use + # so it won't be handled here. + return +} + +############################################################################# +start() +{ + log_begin_msg "Starting ${MODULE_NAME} drivers" "${MODULE_NAME}" + load_ipmi_modules + if [ ${RETVAL} -eq 0 ]; then + touch ${LOCKFILE} + else + if [ $((RETVAL & 1)) -eq 1 ]; then + log_end_msg 1 + else + touch ${LOCKFILE} + fi + fi + start_watchdog_quiet + start_powercontrol_quiet + log_end_msg 0 +} + +############################################################################# +stop() +{ + log_begin_msg "Stopping ${MODULE_NAME} drivers." + unload_ipmi_modules_leave_features + modules_loaded ${MODULES_INTERFACES} + if [ ${OnePlusLoaded} -ne 0 ]; then + RETVAL=$((RETVAL | 32)) + log_failure_msg "may be in use" + else + rm -f ${LOCKFILE} + fi + log_end_msg 0 +} + +stop_all() +{ + log_begin_msg "Stopping ${MODULE_NAME} drivers." + unload_all_ipmi_modules + modules_loaded ${MODULES} + if [ ${OnePlusLoaded} -ne 0 ]; then + RETVAL=$((RETVAL | 32)) + log_failure_msg "may be in use" + else + rm -f ${LOCKFILE} + log_success_msg + fi + log_end_msg 0 +} + +############################################################################# +restart() +{ + stop_all + RETVAL=0 + start +} + +############################################################################# + +status_all() +{ + minimum_modules_loaded + [ $? -eq 0 ] && RETVAL=$((RETVAL | 1)) + + modules_loaded_verbose ${MODULES_FEATURES} ${MODULES_INTERFACES} + [ ${OnePlusUnloaded} -ne 0 ] && RETVAL=$((RETVAL | 2)) + + if [ "${DEV_IPMI}" = "yes" ]; then + device_node_exists /dev/ipmi${INTF_NUM} + [ $? -eq 0 ] && RETVAL=$((RETVAL | 4)) + fi + + if [ "${IPMI_IMB}" = "yes" ]; then + device_node_exists /dev/imb + [ $? -eq 0 ] && RETVAL=$((RETVAL | 4)) + fi + + if [ "${IPMI_WATCHDOG}" = "yes" ]; then + device_node_exists /dev/watchdog + [ $? -eq 0 ] && RETVAL=$((RETVAL | 8)) + fi + + [ ! -e ${LOCKFILE} ] && RETVAL=$((RETVAL | 16)) +} + +status() +{ + minimum_modules_loaded + [ $? -eq 0 ] && RETVAL=$((RETVAL | 1)) + + if [ "${DEV_IPMI}" = "yes" ]; then + modules_loaded_verbose ipmi_devintf + [ ${OnePlusLoaded} -eq 0 ] && RETVAL=$((RETVAL | 2)) + + device_node_exists /dev/ipmi${INTF_NUM} + [ $? -eq 0 ] && RETVAL=$((RETVAL | 4)) + fi + + if [ "${IPMI_IMB}" = "yes" ]; then + device_node_exists /dev/imb + [ $? -eq 0 ] && RETVAL=$((RETVAL | 4)) + fi +} + +status_watchdog() +{ + minimum_modules_loaded + [ $? -eq 0 ] && RETVAL=$((RETVAL | 1)) + + modules_loaded_verbose ipmi_watchdog + [ ${OnePlusLoaded} -eq 0 ] && RETVAL=$((RETVAL | 2)) + + device_node_exists /dev/watchdog + [ $? -eq 0 ] && RETVAL=$((RETVAL | 8)) +} + +status_powercontrol() +{ + minimum_modules_loaded + [ $? -eq 0 ] && RETVAL=$((RETVAL | 1)) + + modules_loaded_verbose ipmi_powercontrol + [ ${OnePlusLoaded} -eq 0 ] && RETVAL=$((RETVAL | 2)) +} + +############################################################################# +usage () +{ + log_action_msg "Usage: $0 {start|stop|status|restart|condrestart|try-restart|start-watchdog|stop-watchdog|status-watchdog|start-powercontrol|stop-powercontrol|status-powercontrol|stop-all|status-all}" + RETVAL=1 +} + +condrestart () +{ + [ -e ${LOCKFILE} ] && restart +} + +############################################################################# +# MAIN +############################################################################# +case "$1" in + start) start ;; + stop) stop ;; + restart) restart ;; + status) status ;; + status-all) status_all ;; + condrestart) condrestart ;; + try-restart) condrestart ;; + start-watchdog) start_watchdog ;; + stop-watchdog) stop_watchdog ;; + status-watchdog) status_watchdog ;; + start-powercontrol) start_powercontrol ;; + stop-powercontrol) stop_powercontrol ;; + status-powercontrol) status_powercontrol ;; + stop-all) stop_all ;; + *) usage ;; +esac + +exit ${RETVAL} + +############################################################################# +# end of file +############################################################################# + --- openipmi-2.0.18.orig/debian/openipmi.links +++ openipmi-2.0.18/debian/openipmi.links @@ -0,0 +1,3 @@ +usr/share/man/man1/openipmicmd.1 usr/share/man/man1/ipmicmd.1 +usr/share/man/man1/openipmish.1 usr/share/man/man1/ipmish.1 + --- openipmi-2.0.18.orig/debian/rules +++ openipmi-2.0.18/debian/rules @@ -0,0 +1,113 @@ +#!/usr/bin/make -f + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# This has to be exported to make some magic below work. +export DH_OPTIONS + +# These are used for cross-compiling and for saving the configure script +# from having to guess our platform (since we know it already) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) + + +CFLAGS = -Wall -g + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +config.status: configure + dh_testdir + dh_autotools-dev_updateconfig + # Add here commands to configure the package. + CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) \ + --build=$(DEB_BUILD_GNU_TYPE) \ + --prefix=/usr \ + --with-openssl \ + --mandir=\$${prefix}/share/man \ + --infodir=\$${prefix}/share/info \ + --disable-rpath + + +#Architecture +build: build-arch + +build-arch: build-arch-stamp +build-arch-stamp: config.status + + # Add here commands to compile the arch part of the package. + #$(MAKE) + touch build-arch-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-arch-stamp #CONFIGURE-STAMP# + + # Add here commands to clean up after the build process. + [ ! -f Makefile ] || $(MAKE) distclean + + dh_autotools-dev_restoreconfig + dh_clean + +install: install-arch + +install-arch: + dh_testdir + dh_testroot + dh_clean -k -s + dh_installdirs -s + + # Add here commands to install the arch part of the package into + # debian/tmp. + $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp + + dh_movefiles + + dh_install -s + +# Must not depend on anything. This is to be called by +binary-indep: +# in another 'make' thread. + +binary-common: + dh_testdir + dh_testroot + dh_installchangelogs ChangeLog + dh_installdocs + dh_installexamples +# dh_installmenu +# dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime + dh_installinit -p openipmi --name openipmi --no-start -- defaults 21 20 + mv ipmi.sysconf openipmi + dh_install openipmi etc/default +# dh_installcron +# dh_installinfo + dh_installman + dh_link + dh_strip + dh_compress + dh_fixperms +# dh_perl +# dh_python + dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +# Build architecture dependant packages using the common target. +binary-arch: build-arch install-arch + $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common + +binary: binary-arch +.PHONY: build clean binary-arch binary install install-arch --- openipmi-2.0.18.orig/debian/watch +++ openipmi-2.0.18/debian/watch @@ -0,0 +1,7 @@ +# Example watch control file for uscan +# Rename this file to "watch" and then you can run the "uscan" command +# to check for upstream updates and more. +# Site Directory Pattern Version Script +version=2 +http://mesh.dl.sourceforge.net/o/op/openipmi/ OpenIPMI-(.*)\.tar\.gz debian uupdate +