Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
Please login to access the resource
openSUSE:Slowroll:Base:1
warewulf
ipmi-allow-build-to-use-locally-installed-ipmit...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File ipmi-allow-build-to-use-locally-installed-ipmitools.patch of Package warewulf
From: Egbert Eich <eich@suse.com> Date: Wed Nov 28 22:30:03 2018 +0100 Subject: ipmi: allow build to use locally-installed ipmitools Patch-mainline: Not yet Git-repo: https://github.com/warewulf/warewulf3 Git-commit: 54b7a7ab28fa0e1a9693722fa7b5fd6289feab64 References: This allows users and distribution vendors to use a single version of ipmitools conistantly across the system. See also commit: 91a37ce1b202ce72a5276aaebc7387bfd1c6459f If ipmitool available locally, do not install a copy to the warewulf libdir but pick the installed one. Signed-off-by: Egbert Eich <eich@suse.com> Signed-off-by: Egbert Eich <eich@suse.de> --- ipmi/configure.ac | 29 +++++++++++++++++++++++++++++ ipmi/initramfs/Makefile.am | 36 +++++++++++++++++++++--------------- ipmi/lib/Warewulf/Ipmi.pm | 7 ++++++- 3 files changed, 56 insertions(+), 16 deletions(-) diff --git a/ipmi/configure.ac b/ipmi/configure.ac index 83f7493..c6d9e44 100644 --- a/ipmi/configure.ac +++ b/ipmi/configure.ac @@ -62,6 +62,35 @@ dnl# Get git version GITVERSION=`cat .gitversion | tr -d '\n'` AC_SUBST(GITVERSION) +AC_MSG_CHECKING([for locally installed ipmitool]) +AC_ARG_WITH([local-ipmitool], [ + AS_HELP_STRING([--with-local-ipmitool], [ + use locally installed ipmitool @<:@default is no@:>@ + ])], [], [with_local_ipmitool=no] +) + +local_ipmitool_path= +AS_IF([test -n "$with_local_ipmitool" -a "x$with_local_ipmitool" != "xno"], [ + local_ipmitool_path="$with_local_ipmitool" + AS_IF([test "x$with_local_ipmitool" == "xyes"], [local_ipmitool_path=ipmitool]) + AS_IF([test -f "$local_ipmitool_path"], [ + AC_MSG_RESULT([$local_ipmitool_path]) + ], [ + search_ipmitool_path=`which "$local_ipmitool_path" 2>/dev/null` + AS_IF([test -z "$search_ipmitool_path"], [ + AC_MSG_ERROR([no, $local_ipmitool_path could not be found]) + ], [ + AC_MSG_RESULT([$search_ipmitool_path]) + local_ipmitool_path="$search_ipmitool_path" + ]) + ]) +], [ + AC_MSG_RESULT([no]) + local_ipmitool_path= +]) + +AC_SUBST(local_ipmitool_path) + AC_OUTPUT(Makefile warewulf-ipmi.spec lib/Makefile diff --git a/ipmi/initramfs/Makefile.am b/ipmi/initramfs/Makefile.am index 909c702..4a2b364 100644 --- a/ipmi/initramfs/Makefile.am +++ b/ipmi/initramfs/Makefile.am @@ -8,25 +8,29 @@ IPMITOOL_VERSION = 1.8.18 IPMITOOL_SOURCE = $(top_srcdir)/3rd_party/BSD/ipmitool-$(IPMITOOL_VERSION).tar.bz2 ipmitool: - @ if [ ! -d "_work/ipmitool/ipmitool-$(IPMITOOL_VERSION)" ]; then \ - echo "Preparing to build ipmitool" ;\ - mkdir -p _work/ipmitool;\ - tar xjf $(srcdir)/$(IPMITOOL_SOURCE) -C _work/ipmitool/ ;\ - fi - @ if [ ! -f "_work/ipmitool/ipmitool-$(IPMITOOL_VERSION)/src/ipmitool" ]; then \ - echo "Building ipmitool" ;\ + @ if [ -n "@local_ipmitool_path@" -a -f "@local_ipmitool_path@" ]; then \ + cp "@local_ipmitool_path@" ipmitool; \ + else \ + if [ ! -d "_work/ipmitool/ipmitool-$(IPMITOOL_VERSION)" ]; then \ + echo "Preparing to build ipmitool" ;\ + mkdir -p _work/ipmitool;\ + tar xjf $(srcdir)/$(IPMITOOL_SOURCE) -C _work/ipmitool/ ;\ + fi; \ + if [ ! -f "_work/ipmitool/ipmitool-$(IPMITOOL_VERSION)/src/ipmitool" ]; then \ + echo "Building ipmitool" ;\ if [ -f "/usr/lib/rpm/config.guess" ]; then \ cp /usr/lib/rpm/config.guess _work/ipmitool/ipmitool-$(IPMITOOL_VERSION) ;\ fi; \ if [ -f "/usr/lib/rpm/config.sub" ]; then \ cp /usr/lib/rpm/config.sub _work/ipmitool/ipmitool-$(IPMITOOL_VERSION) ;\ fi; \ - cd _work/ipmitool/ipmitool-$(IPMITOOL_VERSION) ;\ - ./configure --enable-static --disable-ipmishell ;\ - $(MAKE) LDFLAGS=-static ;\ - fi - @ if [ ! -f "unionfs" ]; then \ - cp -a _work/ipmitool/ipmitool-$(IPMITOOL_VERSION)/src/ipmitool ipmitool ;\ + cd _work/ipmitool/ipmitool-$(IPMITOOL_VERSION) ;\ + ./configure --enable-static --disable-ipmishell ;\ + $(MAKE) LDFLAGS=-static ;\ + fi; \ + if [ ! -f "unionfs" ]; then \ + cp -a _work/ipmitool/ipmitool-$(IPMITOOL_VERSION)/src/ipmitool ipmitool ;\ + fi \ fi @@ -51,8 +55,10 @@ install-data-local: capability.cpio install -d -m 755 $(DESTDIR)/$(WAREWULF_STATEDIR)/warewulf/initramfs/$(MACHINE) install -d -m 755 $(DESTDIR)/$(WAREWULF_STATEDIR)/warewulf/initramfs/$(MACHINE)/capabilities install -m 644 capability.cpio $(DESTDIR)/$(WAREWULF_STATEDIR)/warewulf/initramfs/$(MACHINE)/capabilities/setup-ipmi - install -d -m 755 $(DESTDIR)/$(WAREWULF_LIBEXECDIR)/warewulf - install -m 755 ipmitool $(DESTDIR)/$(WAREWULF_LIBEXECDIR)/warewulf + @ if [ -z "@local_ipmitool_path@" -o ! -f "@local_ipmitool_path@" ]; then \ + install -d -m 755 $(DESTDIR)/$(WAREWULF_LIBEXECDIR)/warewulf; \ + install -m 755 ipmitool $(DESTDIR)/$(WAREWULF_LIBEXECDIR)/warewulf; \ + fi uninstall-local: rm -rf $(DESTDIR)/$(WAREWULF_STATEDIR)/warewulf/initramfs/$(MACHINE)/capabilities/setup-ipmi diff --git a/ipmi/lib/Warewulf/Ipmi.pm b/ipmi/lib/Warewulf/Ipmi.pm index cc8de8f..2393889 100644 --- a/ipmi/lib/Warewulf/Ipmi.pm +++ b/ipmi/lib/Warewulf/Ipmi.pm @@ -227,8 +227,13 @@ ipmi_command() my $proto = $self->ipmi_proto(); my $name = $self->name() || "UNDEF"; my $libexecdir = Warewulf::ACVars->libexecdir(); - my $ret = "$libexecdir/warewulf/ipmitool "; + my $ret; + if ( -e "$libexecdir/warewulf/ipmitool" ) { + $ret = "$libexecdir/warewulf/ipmitool "; + } else { + $ret = "ipmitool "; + } if ($ipaddr and $username and $password and $proto) { $ret .= "-I $proto -U $username -P $password -H $ipaddr "; if ($action eq "poweron" ) {
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor