Skip to content

Commit

Permalink
Merge pull request #172 from jgunthorpe/packaging
Browse files Browse the repository at this point in the history
Red Hat fixes look right, and other comments addresses, so merging.
  • Loading branch information
dledford authored Jul 27, 2017
2 parents a02a432 + c46fa45 commit 8f3a218
Show file tree
Hide file tree
Showing 21 changed files with 55 additions and 51 deletions.
7 changes: 2 additions & 5 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Homepage: https://github.com/linux-rdma/rdma-core

Package: rdma-core
Architecture: linux-any
Depends: ${misc:Depends}, ${shlibs:Depends}
Depends: dmidecode, ${misc:Depends}, ${shlibs:Depends}
Breaks: infiniband-diags (<< 2.0.0)
Replaces: infiniband-diags (<< 2.0.0)
Description: RDMA core userspace infrastructure and documentation
Expand All @@ -47,10 +47,7 @@ Description: InfiniBand Communication Manager Assistant (ACM)

Package: iwpmd
Architecture: linux-any
Depends: infiniband-diags,
lsb-base (>= 3.2-14~),
${misc:Depends},
${shlibs:Depends}
Depends: lsb-base (>= 3.2-14~), ${misc:Depends}, ${shlibs:Depends}
Description: Userspace component for iWarp RDMA services
This package contains the iWARP Port Mapper Daemon (iwpmd) which provides a
userspace service for iWARP drivers to claim TCP ports through the standard
Expand Down
6 changes: 0 additions & 6 deletions debian/ibverbs-providers.install
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
etc/libibverbs.d/
etc/modprobe.d/truescale.conf
usr/bin/rxe_cfg
usr/lib/*/libibverbs/lib*-rdmav2.so
usr/lib/*/libmlx4.so.*
usr/lib/*/libmlx5.so.*
usr/lib/truescale-serdes.cmds
usr/share/doc/rdma-core/rxe.md usr/share/doc/ibverbs-providers/
usr/share/man/man7/rxe.7
usr/share/man/man8/rxe_cfg.8
4 changes: 2 additions & 2 deletions debian/iwpmd.install
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
etc/init.d/iwpmd
etc/iwpmd.conf
lib/systemd/system/iwpmd.service
usr/bin/iwpmd
usr/share/man/man8/iwpmd.8
usr/sbin/iwpmd
usr/share/man/man5/iwpmd.conf.5
usr/share/man/man8/iwpmd.8
2 changes: 1 addition & 1 deletion debian/libibumad3.install
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
lib/udev/rules.d/libibumad.rules
lib/udev/rules.d/90-libibumad.rules
usr/lib/*/libibumad*.so.*
9 changes: 8 additions & 1 deletion debian/rdma-core.install
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
etc/modprobe.d/mlx4.conf
etc/modprobe.d/truescale.conf
lib/systemd/system/rdma-ndd.service
lib/udev/rules.d/rdma-ndd.rules
lib/udev/rules.d/60-rdma-ndd.rules
usr/bin/rxe_cfg
usr/lib/truescale-serdes.cmds
usr/sbin/rdma-ndd
usr/share/doc/rdma-core/MAINTAINERS
usr/share/doc/rdma-core/README.md
usr/share/doc/rdma-core/rxe.md usr/share/doc/rdma-core/
usr/share/man/man7/rxe.7
usr/share/man/man8/rdma-ndd.8
usr/share/man/man8/rxe_cfg.8
1 change: 1 addition & 0 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ override_dh_auto_configure:
-DCMAKE_INSTALL_SYSTEMD_SERVICEDIR:PATH=/lib/systemd/system \
-DCMAKE_INSTALL_INITDDIR:PATH=/etc/init.d \
-DCMAKE_INSTALL_LIBEXECDIR:PATH=/usr/lib \
-DCMAKE_INSTALL_RUNDIR:PATH=/run \
-DCMAKE_INSTALL_UDEV_RULESDIR:PATH=/lib/udev/rules.d

override_dh_auto_build:
Expand Down
2 changes: 1 addition & 1 deletion debian/srptools.install
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
etc/srp_daemon.conf
lib/systemd/system/srp_daemon.service
lib/systemd/system/srp_daemon_port@.service
lib/udev/rules.d/srp_daemon.rules
lib/udev/rules.d/60-srp_daemon.rules
usr/lib/srp_daemon/start_on_all_ports
usr/sbin/ibsrpdm
usr/sbin/srp_daemon
Expand Down
8 changes: 5 additions & 3 deletions iwpmd/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
rdma_executable(iwpmd
rdma_sbin_executable(iwpmd
iwarp_pm_common.c
iwarp_pm_helper.c
iwarp_pm_server.c
Expand All @@ -13,8 +13,10 @@ rdma_man_pages(
iwpmd.conf.5.in
)

install(FILES "iwpmd.service" DESTINATION "${CMAKE_INSTALL_SYSTEMD_SERVICEDIR}")
install(FILES "iwpmd_init"
rdma_subst_install(FILES "iwpmd.service.in"
RENAME "iwpmd.service"
DESTINATION "${CMAKE_INSTALL_SYSTEMD_SERVICEDIR}")
rdma_subst_install(FILES "iwpmd_init.in"
DESTINATION "${CMAKE_INSTALL_INITDDIR}"
RENAME "iwpmd"
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)
Expand Down
2 changes: 1 addition & 1 deletion iwpmd/iwpmd.service → iwpmd/iwpmd.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Documentation=man:iwpmd file:/etc/iwpmd.conf
After=network.target

[Service]
ExecStart=/usr/bin/iwpmd --systemd
ExecStart=@CMAKE_INSTALL_FULL_SBINDIR@/iwpmd --systemd
LimitNOFILE=102400

[Install]
Expand Down
2 changes: 1 addition & 1 deletion iwpmd/iwpmd_init → iwpmd/iwpmd_init.in
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# Description: iWarp Port Mapper Daemon for opening sockets to claim TCP ports from userspace
### END INIT INFO

IWPMD_BIN="/usr/bin/iwpmd"
IWPMD_BIN="@CMAKE_INSTALL_FULL_SBINDIR@/iwpmd"
LOCK="/var/lock/subsys/iwpmd"
IWPMD_PID=0
RETVAL=0
Expand Down
4 changes: 2 additions & 2 deletions libibumad/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ rdma_library(ibumad libibumad.map
umad_str.c
)

rdma_subst_install(FILES libibumad.udev-rules
RENAME libibumad.rules
install(FILES libibumad.udev-rules
RENAME 90-libibumad.rules
DESTINATION "${CMAKE_INSTALL_UDEV_RULESDIR}")

2 changes: 1 addition & 1 deletion libibumad/libibumad.udev-rules
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ACTION=="add", SUBSYSTEM=="infiniband_mad", TAG+="systemd", ENV{SYSTEMD_ALIAS}="/dev/infiniband/umad/$attr{ibdev}:$attr{port}"
ACTION=="add", SUBSYSTEM=="infiniband_mad", KERNEL=="*umad*", TAG+="systemd", ENV{SYSTEMD_ALIAS}="/sys/subsystem/rdma/devices/$attr{ibdev}:$attr{port}/umad"
2 changes: 2 additions & 0 deletions providers/mlx4/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ rdma_shared_provider(mlx4 libmlx4.map
publish_headers(infiniband
mlx4dv.h
)

install(FILES "mlx4.conf" DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}/modprobe.d/")
File renamed without changes.
4 changes: 3 additions & 1 deletion rdma-ndd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ rdma_man_pages(
rdma-ndd.8.in
)

install(FILES "rdma-ndd.rules" DESTINATION "${CMAKE_INSTALL_UDEV_RULESDIR}")
install(FILES "rdma-ndd.rules"
RENAME "60-rdma-ndd.rules"
DESTINATION "${CMAKE_INSTALL_UDEV_RULESDIR}")

rdma_subst_install(FILES "rdma-ndd.service.in"
DESTINATION "${CMAKE_INSTALL_SYSTEMD_SERVICEDIR}"
Expand Down
26 changes: 14 additions & 12 deletions redhat/rdma-core.spec
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ install -D -m0755 redhat/rdma.ifup-ib %{buildroot}/%{_sysconfdir}/sysconfig/netw
install -D -m0755 redhat/rdma.ifdown-ib %{buildroot}/%{_sysconfdir}/sysconfig/network-scripts/ifdown-ib
install -D -m0644 redhat/rdma.service %{buildroot}%{_unitdir}/rdma.service
install -D -m0644 redhat/rdma.udev-ipoib-naming.rules %{buildroot}%{_sysconfdir}/udev/rules.d/70-persistent-ipoib.rules
install -D -m0644 redhat/rdma.mlx4.user.modprobe %{buildroot}%{_sysconfdir}/modprobe.d/mlx4.conf
install -D -m0755 redhat/rdma.modules-setup.sh %{buildroot}%{dracutlibdir}/modules.d/05rdma/module-setup.sh
install -D -m0644 redhat/rdma.udev-rules %{buildroot}%{_udevrulesdir}/98-rdma.rules
install -D -m0644 redhat/rdma.mlx4.sys.modprobe %{buildroot}%{sysmodprobedir}/libmlx4.conf
Expand Down Expand Up @@ -320,15 +319,19 @@ rm -rf %{buildroot}/%{_sbindir}/srp_daemon.sh
%dir %{_sysconfdir}/rdma
%dir %{_docdir}/%{name}-%{version}
%doc %{_docdir}/%{name}-%{version}/README.md
%config(noreplace) %{_sysconfdir}/rdma/*
%doc %{_docdir}/%{name}-%{version}/rxe.md
%config(noreplace) %{_sysconfdir}/rdma/mlx4.conf
%config(noreplace) %{_sysconfdir}/rdma/rdma.conf
%config(noreplace) %{_sysconfdir}/rdma/sriov-vfs
%config(noreplace) %{_sysconfdir}/udev/rules.d/*
%config(noreplace) %{_sysconfdir}/modprobe.d/mlx4.conf
%config(noreplace) %{_sysconfdir}/modprobe.d/truescale.conf
%{_sysconfdir}/sysconfig/network-scripts/*
%{_unitdir}/rdma.service
%dir %{dracutlibdir}/modules.d/05rdma
%{dracutlibdir}/modules.d/05rdma/module-setup.sh
%{_udevrulesdir}/*
%{_udevrulesdir}/98-rdma.rules
%{_udevrulesdir}/60-rdma-ndd.rules
%{sysmodprobedir}/libmlx4.conf
%{sysmodprobedir}/cxgb3.conf
%{sysmodprobedir}/cxgb4.conf
Expand All @@ -337,9 +340,12 @@ rm -rf %{buildroot}/%{_sbindir}/srp_daemon.sh
%{_libexecdir}/rdma-fixup-mtrr.awk
%{_libexecdir}/mlx4-setup.sh
%{_libexecdir}/truescale-serdes.cmds
%{_bindir}/rxe_cfg
%{_sbindir}/rdma-ndd
%{_unitdir}/rdma-ndd.service
%{_mandir}/man7/rxe*
%{_mandir}/man8/rdma-ndd.*
%{_mandir}/man8/rxe*
%license COPYING.*

%files devel
Expand All @@ -364,14 +370,10 @@ rm -rf %{buildroot}/%{_sbindir}/srp_daemon.sh
%dir %{_libdir}/libibverbs
%{_libdir}/libibverbs*.so.*
%{_libdir}/libibverbs/*.so
%{_libdir}/libmlx5.so*
%{_libdir}/libmlx4.so*
%{_libdir}/libmlx5.so.*
%{_libdir}/libmlx4.so.*
%config(noreplace) %{_sysconfdir}/libibverbs.d/*.driver
%doc %{_docdir}/%{name}-%{version}/libibverbs.md
%doc %{_docdir}/%{name}-%{version}/rxe.md
%{_bindir}/rxe_cfg
%{_mandir}/man7/rxe*
%{_mandir}/man8/rxe*

%files -n libibverbs-utils
%{_bindir}/ibv_*
Expand All @@ -391,7 +393,7 @@ rm -rf %{buildroot}/%{_sbindir}/srp_daemon.sh
%doc %{_docdir}/%{name}-%{version}/ibacm.md

%files -n iwpmd
%{_bindir}/iwpmd
%{_sbindir}/iwpmd
%{_unitdir}/iwpmd.service
%config(noreplace) %{_sysconfdir}/iwpmd.conf
%{_mandir}/man8/iwpmd.*
Expand All @@ -403,7 +405,7 @@ rm -rf %{buildroot}/%{_sbindir}/srp_daemon.sh

%files -n libibumad
%{_libdir}/libibumad*.so.*
%{_udevrulesdir}/libibumad.rules
%{_udevrulesdir}/90-libibumad.rules

%files -n librdmacm
%{_libdir}/librdmacm*.so.*
Expand Down Expand Up @@ -448,7 +450,7 @@ rm -rf %{buildroot}/%{_sbindir}/srp_daemon.sh
%{_sbindir}/ibsrpdm
%{_sbindir}/srp_daemon
%{_sbindir}/run_srp_daemon
%{_udevrulesdir}/srp_daemon.rules
%{_udevrulesdir}/60-srp_daemon.rules
%{_mandir}/man1/ibsrpdm.1*
%{_mandir}/man1/srp_daemon.1*
%{_mandir}/man5/srp_daemon.service.5*
Expand Down
4 changes: 3 additions & 1 deletion srp_daemon/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ rdma_subst_install(FILES srp_daemon_port@.service.in

install(FILES srp_daemon.conf DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}")

install(FILES srp_daemon.rules DESTINATION "${CMAKE_INSTALL_UDEV_RULESDIR}")
install(FILES "srp_daemon.rules"
RENAME "60-srp_daemon.rules"
DESTINATION "${CMAKE_INSTALL_UDEV_RULESDIR}")

# FIXME: The ib init.d file should really be included in rdma-core as well.
set(RDMA_SERVICE "openibd" CACHE STRING "init.d file service name to order srpd after")
Expand Down
11 changes: 3 additions & 8 deletions srp_daemon/srp_daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,22 +297,17 @@ void pr_debug(const char *fmt, ...)
void pr_err(const char *fmt, ...)
{
va_list args;
int pos;
char str[1000];

va_start(args, fmt);
pos = vsnprintf(str, sizeof(str), fmt, args);
va_end(args);
if (pos >= sizeof(str))
str[sizeof(str) - 1] = '\0';
switch (s_log_dest) {
case log_to_syslog:
syslog(LOG_DAEMON | LOG_ERR, "%s", str);
vsyslog(LOG_DAEMON | LOG_ERR, fmt, args);
break;
case log_to_stderr:
fprintf(stderr, "%s", str);
vfprintf(stderr, fmt, args);
break;
}
va_end(args);
}

static int check_not_equal_str(const char *dir_name, const char *attr,
Expand Down
2 changes: 1 addition & 1 deletion srp_daemon/srp_daemon.rules
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ACTION=="add", SUBSYSTEM=="infiniband_mad", PROGRAM:="/usr/bin/systemctl show srp_daemon -p ActiveState", RESULT=="ActiveState=active", ENV{SYSTEMD_WANTS}+="srp_daemon_port@$attr{ibdev}:$attr{port}.service"
ACTION=="add", SUBSYSTEM=="infiniband_mad", KERNEL=="*umad*", PROGRAM=="/bin/systemctl show srp_daemon -p ActiveState", RESULT=="ActiveState=active", ENV{SYSTEMD_WANTS}+="srp_daemon_port@$attr{ibdev}:$attr{port}.service"
4 changes: 2 additions & 2 deletions srp_daemon/srp_daemon_port@.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Description=SRP daemon that monitors port %i
Documentation=man:srp_daemon file:/etc/rdma/rdma.conf file:/etc/srp_daemon.conf
DefaultDependencies=false
Conflicts=emergency.target emergency.service
After=srp_daemon.service dev-infiniband-umad-%i.device network.target
BindsTo=srp_daemon.service dev-infiniband-umad-%i.device
After=srp_daemon.service sys-subsystem-rdma-devices-%i-umad.device network.target
BindsTo=srp_daemon.service sys-subsystem-rdma-devices-%i-umad.device
Before=remote-fs-pre.target

[Service]
Expand Down
4 changes: 2 additions & 2 deletions srp_daemon/start_on_all_ports
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
#!/bin/bash

for p in /sys/class/infiniband/*/ports/*; do
[ -e "$p" ] || continue
p=${p#/sys/class/infiniband/}
nohup /usr/bin/systemctl start "srp_daemon_port@${p/\/ports\//:}" </dev/null >&/dev/null &
nohup /bin/systemctl start "srp_daemon_port@${p/\/ports\//:}" </dev/null >&/dev/null &
done

0 comments on commit 8f3a218

Please sign in to comment.