From 6429511aca53729fd279c558800a40d1c6d7d2ca Mon Sep 17 00:00:00 2001 From: CentOS Buildsys Date: Mar 25 2013 21:16:59 +0000 Subject: import opensm-3.3.15-6.el7.src.rpm --- diff --git a/.opensm.metadata b/.opensm.metadata new file mode 100644 index 0000000..241c4e8 --- /dev/null +++ b/.opensm.metadata @@ -0,0 +1 @@ +602405b0ecfeb7e616449d2c618c6a141c199d21 SOURCES/opensm-3.3.15.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index 0e7897f..0000000 --- a/README.md +++ /dev/null @@ -1,5 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 - -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/opensm-3.3.13-prefix.patch b/SOURCES/opensm-3.3.13-prefix.patch new file mode 100644 index 0000000..cd1ea5c --- /dev/null +++ b/SOURCES/opensm-3.3.13-prefix.patch @@ -0,0 +1,58 @@ +diff -up opensm-3.3.13/man/opensm.8.in.prefix opensm-3.3.13/man/opensm.8.in +--- opensm-3.3.13/man/opensm.8.in.prefix 2012-02-28 18:27:33.297714661 -0500 ++++ opensm-3.3.13/man/opensm.8.in 2012-02-28 18:31:00.957696942 -0500 +@@ -11,6 +11,7 @@ opensm \- InfiniBand subnet manager and + [\-g(uid) ] + [\-l(mc) ] + [\-p(riority) ] ++[\-\-subnet_prefix ] + [\-smkey ] + [\-\-sm_sl ] + [\-r(eassign_lids)] +@@ -130,6 +131,13 @@ This will effect the handover cases, whe + is chosen by priority and GUID. Range goes from 0 + (default and lowest priority) to 15 (highest). + .TP ++\fB\-\-subnet_prefix\fR ++This option specifies the subnet prefix to use in ++on the fabric. The default prefix is ++0xfe80000000000000. OpenMPI in particular requires ++separate fabrics plugged into different ports to ++have different prefixes or else it won't run. ++.TP + \fB\-smkey\fR + This option specifies the SM\'s SM_Key (64 bits). + This will effect SM authentication. +diff -up opensm-3.3.13/opensm/main.c.prefix opensm-3.3.13/opensm/main.c +--- opensm-3.3.13/opensm/main.c.prefix 2012-01-17 08:22:40.000000000 -0500 ++++ opensm-3.3.13/opensm/main.c 2012-02-28 18:31:34.224694111 -0500 +@@ -156,6 +156,9 @@ static void show_usage(void) + " This will effect the handover cases, where master\n" + " is chosen by priority and GUID. Range goes\n" + " from 0 (lowest priority) to 15 (highest).\n\n"); ++ printf("--subnet_prefix \n" ++ " Set the subnet prefix to something other than the\n" ++ " default value of 0xfe80000000000000\n\n"); + printf("--smkey, -k \n" + " This option specifies the SM's SM_Key (64 bits).\n" + " This will effect SM authentication.\n" +@@ -607,6 +610,7 @@ int main(int argc, char *argv[]) + {"once", 0, NULL, 'o'}, + {"reassign_lids", 0, NULL, 'r'}, + {"priority", 1, NULL, 'p'}, ++ {"subnet_prefix", 1, NULL, 13}, + {"smkey", 1, NULL, 'k'}, + {"routing_engine", 1, NULL, 'R'}, + {"ucast_cache", 0, NULL, 'A'}, +@@ -911,6 +915,11 @@ int main(int argc, char *argv[]) + printf(" Priority = %d\n", temp); + break; + ++ case 13: ++ opt.subnet_prefix = cl_hton64(strtoull(optarg, NULL, 16)); ++ printf(" Subnet_Prefix = <0x%" PRIx64 ">\n", cl_hton64(opt.subnet_prefix)); ++ break; ++ + case 'k': + sm_key = cl_hton64(strtoull(optarg, NULL, 16)); + printf(" SM Key <0x%" PRIx64 ">\n", cl_hton64(sm_key)); diff --git a/SOURCES/opensm.launch b/SOURCES/opensm.launch new file mode 100644 index 0000000..ba21a71 --- /dev/null +++ b/SOURCES/opensm.launch @@ -0,0 +1,44 @@ +#!/bin/bash +# +# Launch the necessary OpenSM daemons for systemd +# +# sysconfig: /etc/sysconfig/opensm +# config: /etc/rdma/opensm.conf +# + +shopt -s nullglob + +prog=/usr/sbin/opensm +[ -f /etc/sysconfig/opensm ] && . /etc/sysconfig/opensm + +[ -n "$PRIORITY" ] && prio="-p $PRIORITY" + +if [ -z "$GUIDS" ]; then + CONFIGS="" + CONFIG_CNT=0 + for conf in /etc/rdma/opensm.conf.[0-9]*; do + CONFIGS="$CONFIGS $conf" + let CONFIG_CNT++ + done +else + GUID_CNT=0 + for guid in $GUIDS; do + let GUID_CNT++ + done +fi +# Start opensm +if [ -n "$GUIDS" ]; then + SUBNET_COUNT=0 + for guid in $GUIDS; do + SUBNET_PREFIX=`printf "0xfe800000000000%02d" $SUBNET_COUNT` + (while true; do $prog $prio -g $guid --subnet_prefix $SUBNET_PREFIX; sleep 30; done) & + let SUBNET_COUNT++ + done +elif [ -n "$CONFIGS" ]; then + for config in $CONFIGS; do + (while true; do $prog $prio -F $config; sleep 30; done) & + done +else + (while true; do $prog $prio; sleep 30; done) & +fi +exit 0 diff --git a/SOURCES/opensm.logrotate b/SOURCES/opensm.logrotate new file mode 100644 index 0000000..e16e227 --- /dev/null +++ b/SOURCES/opensm.logrotate @@ -0,0 +1,7 @@ +/var/log/opensm.log { + missingok + notifempty + copytruncate + weekly + compress +} diff --git a/SOURCES/opensm.rwtab b/SOURCES/opensm.rwtab new file mode 100644 index 0000000..c298bac --- /dev/null +++ b/SOURCES/opensm.rwtab @@ -0,0 +1 @@ +empty /var/cache/opensm diff --git a/SOURCES/opensm.service b/SOURCES/opensm.service new file mode 100644 index 0000000..6264b4d --- /dev/null +++ b/SOURCES/opensm.service @@ -0,0 +1,14 @@ +[Unit] +Description=Starts the OpenSM InfiniBand fabric Subnet Manager +Documentation=man:opensm +DefaultDependencies=false +Before=network.target remote-fs-pre.target +Requires=rdma.service +After=rdma.service + +[Service] +Type=forking +ExecStart=/usr/libexec/opensm-launch + +[Install] +WantedBy=network.target diff --git a/SOURCES/opensm.sysconfig b/SOURCES/opensm.sysconfig new file mode 100644 index 0000000..5f21efa --- /dev/null +++ b/SOURCES/opensm.sysconfig @@ -0,0 +1,72 @@ +# Problem #1: Multiple IB fabrics needing a subnet manager +# +# In the event that a machine has more than one IB subnet attached, +# and that machine is an opensm server, by default, opensm will +# only attach to one port and will not manage the fabric on the +# other port. There are two ways to solve this problem: +# +# 1) Start opensm on multiple machines and configure it to manage +# different fabrics on each machine +# 2) Configure opensm to start multiple instances on a single +# machine +# +# Both solutions to this problem require non-standard configurations. +# In other words, you would normally have to modify /etc/rdma/opensm.conf +# and once you do that, the file will no longer be updated for new +# options when opensm is upgraded. In an effort to allow people to +# have more than one subnet managed by opensm without having to modify +# the system default opensm.conf file, we have enabled two methods +# for modifying the default opensm config items needed to enable +# multiple fabric management. +# +# Method #1: Create multiple opensm.conf files in non-standard locations +# Copy /etc/rdma/opensm.conf to /etc/rdma/opensm.conf. +# (do this once for each instance you want started) +# Edit each copy of the opensm.conf file to reflect the necessary changes +# for a multiple instance startup. If you need to manage more than +# one fabric, you will have to change the guid option in each file +# to specify the guid of the specific port you want opensm attached +# to. +# +# The advantage to method #1 is that, on the off chance you want to do +# really special custom things on different ports, like have different +# QoS settings depending on which port you are attached to, you have the +# freedom to edit any and all settings for each instance without those +# changes affecting other instances or being lost when opensm upgrades. +# +# Method #2: Specify multiple GUIDS variable entries in this file +# Uncomment the below GUIDS variable and enter each guid you need to attach +# to into the list. If using this method you need to enter each +# guid into the list as we won't attach to any default ports, only +# those specified in the list. +# +#GUIDS="0x0002c90300048ca1 0x0002c90300048ca2" +# +# The obvious advantage to method #2 is that it's simple and doesn't +# clutter up your file system, but it is far more limited in what you +# can do. If you enable method #2, then even if you create the files +# referenced in method #1, they will be ignored. +# +# Problem #2: Activating a backup subnet manager +# +# The default priority of opensm is set so that it wants to be the +# primary subnet manager. This is great when you are only running +# opensm on one server, but if you want to have a non-primary opensm +# instance for failover, then you have to manually edit the opensm.conf +# file like for problem #1. This carries with it all the problems +# listed above. If you wish to enable opensm as a non-primary manager, +# then you can uncomment the PRIORITY variable below and set it to +# some number between 0 and 15, where 15 is the highest priority and +# the primary manager, with 0 being the lowest backup server. This method +# will work with the GUIDS option above, and also with the multiple +# config files in method #1 above. However, only a single priority is +# supported here. If you wanted more than one priority (say this machine +# is the primary on the first fabric, and second on the second fabric, +# while the other opensm server is primary on the second fabric and +# second on the primary), then the only way to do that is to use method #1 +# above and individually edit the config files. If you edit the config +# files to set the priority and then also set the priority here, then +# this setting will override the config files and render that particular +# edit useless. +# +#PRIORITY=15 diff --git a/SPECS/opensm.spec b/SPECS/opensm.spec new file mode 100644 index 0000000..e56828e --- /dev/null +++ b/SPECS/opensm.spec @@ -0,0 +1,217 @@ +Name: opensm +Version: 3.3.15 +Release: 6%{?dist} +Summary: OpenIB InfiniBand Subnet Manager and management utilities +Group: System Environment/Daemons +License: GPLv2 or BSD +Url: http://www.openfabrics.org/ +Source0: http://www.openfabrics.org/downloads/management/%{name}-%{version}.tar.gz +Source2: opensm.logrotate +Source4: opensm.sysconfig +Source5: opensm.service +Source6: opensm.launch +Source7: opensm.rwtab +Patch0: opensm-3.3.13-prefix.patch +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildRequires: libibmad-devel = 1.3.9, libtool, bison, flex, byacc, systemd +Requires: %{name}-libs = %{version}-%{release}, logrotate, rdma +Requires(post): systemd +Requires(preun): systemd +Requires(postun): systemd +ExcludeArch: s390 s390x + +%description +OpenSM is the OpenIB project's Subnet Manager for Infiniband networks. +The subnet manager is run as a system daemon on one of the machines in +the infiniband fabric to manage the fabric's routing state. This package +also contains various tools for diagnosing and testing Infiniband networks +that can be used from any machine and do not need to be run on a machine +running the opensm daemon. + +%package libs +Summary: Libraries used by opensm and included utilities +Group: System Environment/Libraries + +%description libs +Shared libraries for Infiniband user space access + +%package devel +Summary: Development files for the opensm-libs libraries +Group: Development/System +Requires: %{name}-libs = %{version}-%{release} + +%description devel +Development environment for the opensm libraries + +%package static +Summary: Static version of the opensm libraries +Group: Development/System +Requires: %{name}-devel = %{version}-%{release} +%description static +Static version of opensm libraries + +%prep +%setup -q +%patch0 -p1 -b .prefix + +%build +%configure --with-opensm-conf-sub-dir=rdma +make %{?_smp_mflags} +cd opensm +./opensm -c ../opensm-%{version}.conf + +%install +rm -rf %{buildroot} +make install DESTDIR=%{buildroot} +# remove unpackaged files from the buildroot +rm -f %{buildroot}%{_libdir}/*.la +rm -fr %{buildroot}%{_sysconfdir}/init.d +install -D -m644 opensm-%{version}.conf %{buildroot}%{_sysconfdir}/rdma/opensm.conf +install -D -m644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/opensm +install -D -m644 %{SOURCE4} %{buildroot}%{_sysconfdir}/sysconfig/opensm +install -D -m644 %{SOURCE5} %{buildroot}%{_unitdir}/opensm.service +install -D -m755 %{SOURCE6} %{buildroot}%{_libexecdir}/opensm-launch +install -D -m644 %{SOURCE7} %{buildroot}%{_sysconfdir}/rwtab.d/opensm +mkdir -p ${RPM_BUILD_ROOT}/var/cache/opensm + +%clean +rm -rf %{buildroot} + +%post +%systemd_post opensm.service + +%preun +# Don't use the macro because we need to remove our cache directory as well +# and the macro doesn't have the ability to do that. But, here the macro +# is for future reference: +# %systemd_preun opensm.service +if [ $1 = 0 ]; then + /bin/systemctl --no-reload disable opensm.service >/dev/null 2>&1 || : + /bin/systemctl stop opensm.service >/dev/null 2>&1 || : + rm -fr /var/cache/opensm +fi + +%postun +%systemd_postun_with_restart opensm.service + +%post libs -p /sbin/ldconfig + +%postun libs -p /sbin/ldconfig + +%files +%defattr(-,root,root,-) +%dir /var/cache/opensm +%{_sbindir}/* +%{_mandir}/* +%{_unitdir}/* +%{_libexecdir}/* +%config(noreplace) %{_sysconfdir}/logrotate.d/opensm +%config(noreplace) %{_sysconfdir}/rdma/opensm.conf +%config(noreplace) %{_sysconfdir}/sysconfig/opensm +%{_sysconfdir}/rwtab.d/opensm +%doc AUTHORS COPYING ChangeLog INSTALL README NEWS + +%files libs +%defattr(-,root,root,-) +%{_libdir}/lib*.so.* + +%files devel +%defattr(-,root,root,-) +%{_libdir}/lib*.so +%{_includedir}/infiniband + +%files static +%defattr(-,root,root,-) +%{_libdir}/lib*.a + +%changelog +* Mon Mar 25 2013 Doug Ledford - 3.3.15-6 +- Oops, forgot to remove the -B option to opensm when starting it + +* Mon Mar 25 2013 Doug Ledford - 3.3.15-5 +- Drop the old sysv init script +- Fix opensm-launch to restart opensm in a loop. This works around the + fact that systemd starts opensm so early that we very well might not have + sync on the link yet. Without the physical link being up, opensm exits + immediately. This way opensm will get restarted every 30 seconds until + sync is active on the link or until the opensm service is stopped. +- Always install the newly generated opensm-%%{version}.conf as opensm.conf +- Make the launch work properly in the event that no GUIDs are set and + there are no numbered config files + +* Thu Feb 14 2013 Fedora Release Engineering - 3.3.15-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Wed Dec 05 2012 Doug Ledford - 3.3.15-3 +- Fix startup on read only root +- Update default config file +- Resolves: bz817591 + +* Wed Dec 05 2012 Doug Ledford - 3.3.15-2 +- More tweaks to systemd setup (proper scriptlets now) +- More tweaks to old sysv init script support (fix Requires) + +* Tue Nov 27 2012 Doug Ledford - 3.3.15-1 +- Update to latest upstream release +- Update to systemd startup + +* Fri Jul 20 2012 Fedora Release Engineering - 3.3.13-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Tue Mar 13 2012 Doug Ledford - 3.3.13-2 +- Fix the config file comment in the opensm init script +- Resolves: bz802727 + +* Tue Feb 28 2012 Doug Ledford - 3.3.13-1 +- Update to latest upstream version +- Fix a minor issue in init scripts that would cause systemd to try and + start/stop things in the wrong order +- Add a patch to allow us to specify the subnet prefix on the command line + +* Tue Jan 03 2012 Doug Ledford - 3.3.12-1 +- Update to latest upstream version + +* Mon Aug 15 2011 Kalev Lember - 3.3.9-2 +- Rebuilt for rpm bug #728707 + +* Wed Jul 20 2011 Doug Ledford - 3.3.9-1 +- Update to latest upstream version +- Add /etc/sysconfig/opensm for use by opensm init script +- Enable the ability to start more than one instance of opensm for multiple + fabric support +- Enable the ability to start opensm with a priority other than default for + support of backup opensm instances + +* Tue Feb 08 2011 Fedora Release Engineering - 3.3.5-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Mon Mar 08 2010 Doug Ledford - 3.3.5-1 +- Update to latest upstream release. We need various defines in ib_types.h + for the latest ibutils package to build properly, and the latest ibutils + package is needed because we found licensing problems in the older + tarballs during review. + +* Mon Jan 11 2010 Doug Ledford - 3.3.3-2 +- ExcludeArch s390(x) as there's no hardware support there + +* Thu Dec 03 2009 Doug Ledford - 3.3.3-1 +- Update to latest upstream release +- Minor tweaks to init script for LSB compliance + +* Sat Jul 25 2009 Fedora Release Engineering - 3.3.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Mon Jul 20 2009 Doug Ledford - 3.3.2-1 +- Update to latest upstream version + +* Wed Apr 22 2009 Doug Ledford - 3.3.1-1 +- Update to latest upstream version + +* Fri Mar 06 2009 Caolán McNamara - 3.2.1-3 +- fix bare elifs to rebuild + +* Thu Feb 26 2009 Fedora Release Engineering - 3.2.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Sun Jun 08 2008 Doug Ledford - 3.2.1-1 +- Initial package for Fedora review process