-
Notifications
You must be signed in to change notification settings - Fork 2
/
patch-mlnxofed.sh
executable file
·562 lines (506 loc) · 15.6 KB
/
patch-mlnxofed.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
#!/bin/sh
# Patch to add back support for MLX4 and EFA on MLNX OFED
# This script is only tested against Enterprise Linux 8
#
# vinicius {\a\t} ferrao.net.br
# ferrao {\a\t} versatushpc.com.br
# Stop execution in case of any error (add x for debugging)
set -e
# Output directory for the new RPMS
RPMS_OUTPUT_DIR=$HOME/PATCHED-MLNX-OFED
# rpmbuild root directory
RPM_BUILD_ROOT=~/dd90dbfa-8d9f-43dd-a7ac-89f73e80e40f
# Work directory to patch the files
WORK_DIR=~/0995edb8-df4b-49f0-a144-fc6fa8835b71
# perl is being too verbose without hardcoding locales
LC_ALL=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
# Patches
patch_mlnx_ofed55() {
# CMakeLists.txt
cat > CMakeLists.txt.patch << 'EOF'
--- CMakeLists.txt 2021-11-16 12:47:39.000000000 -0300
+++ CMakeLists.txt.patched 2022-02-08 00:19:07.699078760 -0300
@@ -674,13 +674,15 @@
if (0)
add_subdirectory(providers/bnxt_re)
add_subdirectory(providers/cxgb4) # NO SPARSE
+endif()
add_subdirectory(providers/efa)
add_subdirectory(providers/efa/man)
+if (0)
add_subdirectory(providers/hns)
add_subdirectory(providers/irdma)
+endif()
add_subdirectory(providers/mlx4)
add_subdirectory(providers/mlx4/man)
-endif()
add_subdirectory(providers/mlx5)
add_subdirectory(providers/mlx5/man)
if (0)
EOF
patch -u CMakeLists.txt -i CMakeLists.txt.patch
rm -f CMakeLists.txt.patch
echo Patched: CMakeLists.txt
echo
# providers/mlx4/CMakeLists.txt
cat > CMakeLists.txt.patch << 'EOF'
--- CMakeLists.txt 2021-11-16 12:47:39.000000000 -0300
+++ CMakeLists.txt.patched 2022-02-08 00:46:16.715476920 -0300
@@ -13,8 +13,6 @@
mlx4dv.h
)
-if (0)
install(FILES "mlx4.conf" DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}/modprobe.d/")
-endif()
rdma_pkg_config("mlx4" "libibverbs" "${CMAKE_THREAD_LIBS_INIT}")
EOF
patch -u providers/mlx4/CMakeLists.txt -i CMakeLists.txt.patch
rm -f CMakeLists.txt.patch
echo Patched: providers/mlx4/CMakeLists.txt
echo
# pyverbs/CMakeLists.txt
cat > CMakeLists.txt.patch << 'EOF'
--- CMakeLists.txt 2021-11-16 12:47:39.000000000 -0300
+++ CMakeLists.txt.patched 2022-02-08 00:17:22.662412580 -0300
@@ -50,7 +50,5 @@
# mlx5 and efa providers are not built without coherent DMA, e.g. ARM32 build.
if (HAVE_COHERENT_DMA)
add_subdirectory(providers/mlx5)
-if (0)
add_subdirectory(providers/efa)
endif()
-endif()
EOF
patch -u pyverbs/CMakeLists.txt -i CMakeLists.txt.patch
rm -f CMakeLists.txt.patch
echo Patched: pyverbs/CMakeLists.txt
echo
# rdma-core.spec
cat > rdma-core.spec.patch << 'EOF'
--- rdma-core.spec 2021-11-16 12:47:39.000000000 -0300
+++ rdma-core.spec.patched 2022-02-08 00:39:25.862231222 -0300
@@ -250,6 +250,8 @@
Device-specific plug-in ibverbs userspace drivers are included:
- libirdma: Intel Ethernet Connection RDMA
+- libefa: Amazon Elastic Fabric Adapter
+- libmlx4: Mellanox ConnectX-3 InfiniBand HCA
- libmlx5: Mellanox ConnectX-4+ InfiniBand HCA
%package -n libibverbs-utils
@@ -475,9 +477,9 @@
%doc installed_docs/tag_matching.md
%config(noreplace) %{_sysconfdir}/rdma/mlx4.conf
%config(noreplace) %{_sysconfdir}/rdma/modules/rdma.conf
-%if 0
%dir %{_sysconfdir}/modprobe.d
%config(noreplace) %{_sysconfdir}/modprobe.d/mlx4.conf
+%if 0
%config(noreplace) %{_sysconfdir}/modprobe.d/truescale.conf
%endif
%dir %{dracutlibdir}
@@ -515,16 +517,20 @@
%endif
%{_libdir}/lib*.so
%{_libdir}/pkgconfig/*.pc
+%{_mandir}/man3/efadv*
%{_mandir}/man3/ibv_*
%{_mandir}/man3/rdma*
%{_mandir}/man3/umad*
%{_mandir}/man3/*_to_ibv_rate.*
+%{_mandir}/man7/efadv*
%{_mandir}/man7/rdma_cm.*
%ifnarch s390x s390
%{_mandir}/man3/mlx5dv*
+%{_mandir}/man3/mlx4dv*
%endif
%ifnarch s390x s390
%{_mandir}/man7/mlx5dv*
+%{_mandir}/man7/mlx4dv*
%endif
%{_mandir}/man3/ibnd_*
@@ -611,10 +617,12 @@
%files -n libibverbs
%dir %{_sysconfdir}/libibverbs.d
%dir %{_libdir}/libibverbs
+%{_libdir}/libefa.so.*
%{_libdir}/libibverbs*.so.*
%{_libdir}/libibverbs/*.so
%ifnarch s390x s390
%{_libdir}/libmlx5.so.*
+%{_libdir}/libmlx4.so.*
%endif
%config(noreplace) %{_sysconfdir}/libibverbs.d/*.driver
%doc installed_docs/libibverbs.md
EOF
patch -u rdma-core.spec -i rdma-core.spec.patch
rm -f rdma-core.spec.patch
echo Patched: rdma-core.spec
echo
}
patch_mlnx_ofed54() {
# CMakeLists.txt
cat > CMakeLists.txt.patch << 'EOF'
--- CMakeLists.txt 2021-06-24 14:52:47.000000000 -0300
+++ CMakeLists.txt.patched 2022-02-08 01:28:53.495956917 -0300
@@ -675,13 +675,15 @@
if (0)
add_subdirectory(providers/bnxt_re)
add_subdirectory(providers/cxgb4) # NO SPARSE
+endif()
add_subdirectory(providers/efa)
add_subdirectory(providers/efa/man)
+if (0)
add_subdirectory(providers/hns)
add_subdirectory(providers/i40iw) # NO SPARSE
+endif()
add_subdirectory(providers/mlx4)
add_subdirectory(providers/mlx4/man)
-endif()
add_subdirectory(providers/mlx5)
add_subdirectory(providers/mlx5/man)
if (0)
EOF
patch -u CMakeLists.txt -i CMakeLists.txt.patch
rm -f CMakeLists.txt.patch
echo Patched: CMakeLists.txt
echo
# providers/mlx4/CMakeLists.txt
cat > CMakeLists.txt.patch << 'EOF'
--- CMakeLists.txt 2021-06-24 14:52:48.000000000 -0300
+++ CMakeLists.patched 2022-02-08 01:30:59.191535699 -0300
@@ -13,8 +13,6 @@
mlx4dv.h
)
-if (0)
install(FILES "mlx4.conf" DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}/modprobe.d/")
-endif()
rdma_pkg_config("mlx4" "libibverbs" "${CMAKE_THREAD_LIBS_INIT}")
EOF
patch -u providers/mlx4/CMakeLists.txt -i CMakeLists.txt.patch
rm -f CMakeLists.txt.patch
echo Patched: providers/mlx4/CMakeLists.txt
echo
# pyverbs/CMakeLists.txt
cat > CMakeLists.txt.patch << 'EOF'
--- CMakeLists.txt 2021-06-24 14:52:48.000000000 -0300
+++ CMakeLists.txt.patched 2022-02-08 01:32:32.705686167 -0300
@@ -42,7 +42,5 @@
# mlx5 and efa providers are not built without coherent DMA, e.g. ARM32 build.
if (HAVE_COHERENT_DMA)
add_subdirectory(providers/mlx5)
-if (0)
add_subdirectory(providers/efa)
endif()
-endif()
EOF
patch -u pyverbs/CMakeLists.txt -i CMakeLists.txt.patch
rm -f CMakeLists.txt.patch
echo Patched: pyverbs/CMakeLists.txt
echo
# rdma-core.spec
cat > rdma-core.spec.patch << 'EOF'
--- rdma-core.spec 2021-06-24 14:52:48.000000000 -0300
+++ rdma-core.spec.patched 2022-02-08 01:39:22.703883240 -0300
@@ -238,6 +238,8 @@
Device-specific plug-in ibverbs userspace drivers are included:
+- libefa: Amazon Elastic Fabric Adapter
+- libmlx4: Mellanox ConnectX-3 InfiniBand HCA
- libmlx5: Mellanox ConnectX-4+ InfiniBand HCA
%package -n libibverbs-utils
@@ -463,9 +465,9 @@
%doc installed_docs/tag_matching.md
%config(noreplace) %{_sysconfdir}/rdma/mlx4.conf
%config(noreplace) %{_sysconfdir}/rdma/modules/rdma.conf
-%if 0
%dir %{_sysconfdir}/modprobe.d
%config(noreplace) %{_sysconfdir}/modprobe.d/mlx4.conf
+%if 0
%config(noreplace) %{_sysconfdir}/modprobe.d/truescale.conf
%endif
%dir %{dracutlibdir}
@@ -503,16 +505,20 @@
%endif
%{_libdir}/lib*.so
%{_libdir}/pkgconfig/*.pc
+%{_mandir}/man3/efadv*
%{_mandir}/man3/ibv_*
%{_mandir}/man3/rdma*
%{_mandir}/man3/umad*
%{_mandir}/man3/*_to_ibv_rate.*
+%{_mandir}/man7/efadv*
%{_mandir}/man7/rdma_cm.*
%ifnarch s390x s390
%{_mandir}/man3/mlx5dv*
+%{_mandir}/man3/mlx4dv*
%endif
%ifnarch s390x s390
%{_mandir}/man7/mlx5dv*
+%{_mandir}/man7/mlx4dv*
%endif
%{_mandir}/man3/ibnd_*
@@ -599,10 +605,12 @@
%files -n libibverbs
%dir %{_sysconfdir}/libibverbs.d
%dir %{_libdir}/libibverbs
+%{_libdir}/libefa.so.*
%{_libdir}/libibverbs*.so.*
%{_libdir}/libibverbs/*.so
%ifnarch s390x s390
%{_libdir}/libmlx5.so.*
+%{_libdir}/libmlx4.so.*
%endif
%config(noreplace) %{_sysconfdir}/libibverbs.d/*.driver
%doc installed_docs/libibverbs.md
EOF
patch -u rdma-core.spec -i rdma-core.spec.patch
rm -f rdma-core.spec.patch
echo Patched: rdma-core.spec
echo
}
patch_mlnx_ofed49() {
# CMakeLists.txt
cat > CMakeLists.txt.patch << 'EOF'
--- CMakeLists.txt 2021-04-23 07:31:00.000000000 -0300
+++ CMakeLists.txt.patched 2022-03-19 00:11:01.247634859 -0300
@@ -624,8 +624,10 @@
if (0)
add_subdirectory(providers/bnxt_re)
add_subdirectory(providers/cxgb4) # NO SPARSE
+endif()
add_subdirectory(providers/efa)
add_subdirectory(providers/efa/man)
+if (0)
add_subdirectory(providers/hns)
add_subdirectory(providers/i40iw) # NO SPARSE
endif()
EOF
patch -u CMakeLists.txt -i CMakeLists.txt.patch
rm -f CMakeLists.txt.patch
echo Patched: CMakeLists.txt
echo
# rdma-core.spec
cat > rdma-core.spec.patch << 'EOF'
--- rdma-core.spec 2021-04-23 07:31:00.000000000 -0300
+++ rdma-core.spec.patched 2022-03-19 00:27:13.436049287 -0300
@@ -263,6 +263,7 @@
Device-specific plug-in ibverbs userspace drivers are included:
+- libefa: Amazon Elastic Fabric Adapter
- libmlx4: Mellanox ConnectX-3 InfiniBand HCA
- libmlx5: Mellanox Connect-IB/X-4+ InfiniBand HCA
@@ -540,10 +541,12 @@
%endif
%{_libdir}/lib*.so
%{_libdir}/pkgconfig/*.pc
+%{_mandir}/man3/efadv*
%{_mandir}/man3/ibv_*
%{_mandir}/man3/rdma*
%{_mandir}/man3/umad*
%{_mandir}/man3/*_to_ibv_rate.*
+%{_mandir}/man7/efadv*
%{_mandir}/man7/rdma_cm.*
%ifnarch s390x s390
%{_mandir}/man3/mlx5dv*
@@ -638,6 +641,7 @@
%files -n libibverbs
%dir %{_sysconfdir}/libibverbs.d
%dir %{_libdir}/libibverbs
+%{_libdir}/libefa.so.*
%{_libdir}/libibverbs*.so.*
%{_libdir}/libibverbs/*.so
%ifnarch s390x s390
EOF
patch -u rdma-core.spec -i rdma-core.spec.patch
rm -f rdma-core.spec.patch
echo Patched: rdma-core.spec
echo
}
#
# Shell startup (main) begins here
#
# Detect MLNX OFED release
MLNX_OFED_VERSION=`ofed_info -s | cut -f 2- -d- | cut -f 1 -d:`
if [ -z $MLNX_OFED_VERSION ]; then
echo Cannot detect MLNX OFED, is it installed?
exit
else
echo Detected MLNX OFED release: $MLNX_OFED_VERSION
fi
case $MLNX_OFED_VERSION in
5.5-1.0.3.2)
# MLNX OFED 5.5-1.0.3.2 version info
# https://content.mellanox.com/ofed/MLNX_OFED-5.5-1.0.3.2/MLNX_OFED_SRC-5.5-1.0.3.2.tgz
RDMA_CORE_VERSION="55mlnx37"
RDMA_CORE_MINOR_VERSION="1.55103"
RDMA_CORE_NEW_VERSION="55104.versatushpc"
;;
5.4-3.4.0.0)
# MLNX OFED 5.4-3.4.0.0 version info
# https://content.mellanox.com/ofed/MLNX_OFED-5.4-3.4.0.0/MLNX_OFED_SRC-5.4-3.4.0.0.tgz
RDMA_CORE_VERSION="54mlnx1"
RDMA_CORE_MINOR_VERSION="1.54340"
RDMA_CORE_NEW_VERSION="54341.versatushpc"
;;
5.4-3.2.7.2.3)
# MLNX OFED 5.4-3.2.7.2.3 version info
# https://content.mellanox.com/ofed/MLNX_OFED-5.4-3.2.7.2.3/MLNX_OFED_SRC-5.4-3.2.7.2.3.tgz
RDMA_CORE_VERSION="54mlnx1"
RDMA_CORE_MINOR_VERSION="1.54327"
RDMA_CORE_NEW_VERSION="54328.versatushpc"
;;
5.4-3.1.0.0)
# MLNX OFED 5.4-3.1.0.0 version info
# https://content.mellanox.com/ofed/MLNX_OFED-5.4-3.1.0.0/MLNX_OFED_SRC-5.4-3.1.0.0.tgz
RDMA_CORE_VERSION="54mlnx1"
RDMA_CORE_MINOR_VERSION="1.54310"
RDMA_CORE_NEW_VERSION="54311.versatushpc"
;;
5.4-3.0.3.0)
# MLNX OFED 5.4-3.0.3.0 version info
# https://content.mellanox.com/ofed/MLNX_OFED-5.4-3.0.3.0/MLNX_OFED_SRC-5.4-3.0.3.0.tgz
RDMA_CORE_VERSION="54mlnx1"
RDMA_CORE_MINOR_VERSION="1.54303"
RDMA_CORE_NEW_VERSION="54304.versatushpc"
;;
5.4-2.4.1.3)
# MLNX OFED 5.4-2.4.1.3 version info
# https://content.mellanox.com/ofed/MLNX_OFED-5.4-2.4.1.3/MLNX_OFED_SRC-5.4-2.4.1.3.tgz
RDMA_CORE_VERSION="54mlnx1"
RDMA_CORE_MINOR_VERSION="1.54241"
RDMA_CORE_NEW_VERSION="54242.versatushpc"
;;
5.4-1.0.3.0)
# MLNX OFED 5.4-1.0.3.0 version info
# https://content.mellanox.com/ofed/MLNX_OFED-5.4-1.0.3.0/MLNX_OFED_SRC-5.4-1.0.3.0.tgz
RDMA_CORE_VERSION="54mlnx1"
RDMA_CORE_MINOR_VERSION="1.54103"
RDMA_CORE_NEW_VERSION="54104.versatushpc"
;;
4.9-5.1.0.0)
# MLNX OFED 4.9-5.1.0.0 version info
# https://content.mellanox.com/ofed/MLNX_OFED-4.9-5.1.0.0/MLNX_OFED_SRC-4.9-5.1.0.0.tgz
RDMA_CORE_VERSION="50mlnx1"
RDMA_CORE_MINOR_VERSION="1.49510"
RDMA_CORE_NEW_VERSION="49510.versatushpc"
;;
4.9-4.1.7.0)
# MLNX OFED 4.9-4.1.7.0 version info
# https://content.mellanox.com/ofed/MLNX_OFED-4.9-4.1.7.0/MLNX_OFED_SRC-4.9-4.1.7.0.tgz
RDMA_CORE_VERSION="50mlnx1"
RDMA_CORE_MINOR_VERSION="1.49417"
RDMA_CORE_NEW_VERSION="49418.versatushpc"
;;
4.9-4.0.8.0)
# MLNX OFED 4.9-4.0.8.0 version info
# https://content.mellanox.com/ofed/MLNX_OFED-4.9-4.0.8.0/MLNX_OFED_SRC-4.9-4.0.8.0.tgz
RDMA_CORE_VERSION="50mlnx1"
RDMA_CORE_MINOR_VERSION="1.49408"
RDMA_CORE_NEW_VERSION="49409.versatushpc"
;;
4.9-3.1.5.0)
# MLNX OFED 4.9-3.1.5.0 version info
# https://content.mellanox.com/ofed/MLNX_OFED-4.9-3.1.5.0/MLNX_OFED_SRC-4.9-3.1.5.0.tgz
RDMA_CORE_VERSION="50mlnx1"
RDMA_CORE_MINOR_VERSION="1.49315"
RDMA_CORE_NEW_VERSION="49316.versatushpc"
;;
4.9-2.2.6.0)
# MLNX OFED 4.9-2.2.6.0 version info
# https://content.mellanox.com/ofed/MLNX_OFED-4.9-2.2.6.0/MLNX_OFED_SRC-4.9-2.2.6.0.tgz
RDMA_CORE_VERSION="50mlnx1"
RDMA_CORE_MINOR_VERSION="1.49226"
RDMA_CORE_NEW_VERSION="49227.versatushpc"
;;
4.9-2.2.4.0)
# MLNX OFED 4.9-2.2.4.0 version info
# https://content.mellanox.com/ofed/MLNX_OFED-4.9-2.2.4.0/MLNX_OFED_SRC-4.9-2.2.4.0.tgz
RDMA_CORE_VERSION="50mlnx1"
RDMA_CORE_MINOR_VERSION="1.49224"
RDMA_CORE_NEW_VERSION="49225.versatushpc"
;;
4.9-0.1.7.0)
# MLNX OFED 4.9-0.1.7.0 version info
# https://content.mellanox.com/ofed/MLNX_OFED-4.9-0.1.7.0/MLNX_OFED_SRC-4.9-0.1.7.0.tgz
RDMA_CORE_VERSION="50mlnx1"
RDMA_CORE_MINOR_VERSION="1.49017"
RDMA_CORE_NEW_VERSION="49018.versatushpc"
;;
*)
# Unsupported MLNX OFED release
echo "Unsupported MLNX OFED release: $MLNX_OFED_VERSION"
exit
;;
esac
# Create the directory structure to build the packages
mkdir -p $RPM_BUILD_ROOT/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
mkdir -p $WORK_DIR
cd $WORK_DIR
# Install required packages for building
echo Installing required dependencies...
# Workaround for conflicting Cython from OpenHPC 2.x
if rpm -q --quiet python3-Cython-ohpc ; then
dnf remove -y python3-Cython-ohpc
fi
dnf install -y kernel-rpm-macros rpm-build patch pandoc cmake3 systemd-devel python3-devel libnl3-devel python3-Cython perl-generators
echo
# We can try to save some bandwidth if the SRC file is already in place, probably not...
if [ ! -f MLNX_OFED_SRC-$MLNX_OFED_VERSION.tgz ] ; then
echo Downloading MLNX OFED $MLNX_OFED_VERSION sources...
curl -O https://content.mellanox.com/ofed/MLNX_OFED-$MLNX_OFED_VERSION/MLNX_OFED_SRC-$MLNX_OFED_VERSION.tgz
fi
echo
tar zxf MLNX_OFED_SRC-$MLNX_OFED_VERSION.tgz
echo Extracting files from SRPMS...
rpm2cpio MLNX_OFED_SRC-$MLNX_OFED_VERSION/SRPMS/rdma-core-$RDMA_CORE_VERSION-$RDMA_CORE_MINOR_VERSION.src.rpm | cpio -i
echo
tar zxf rdma-core-$RDMA_CORE_VERSION.tgz
cd rdma-core-$RDMA_CORE_VERSION
echo Patching MLNX OFED to add back support for MLX4 and EFA...
echo
sleep 1
# This case statement will handle patching for different releases
case $MLNX_OFED_VERSION in
5.5-1.0.3.2)
patch_mlnx_ofed55
;;
5.4-3.4.0.0|\
5.4-3.2.7.2.3|\
5.4-3.1.0.0|\
5.4-3.0.3.0|\
5.4-2.4.1.3|\
5.4-1.0.3.0)
patch_mlnx_ofed54
;;
4.9-5.1.0.0|\
4.9-4.1.7.0|\
4.9-4.0.8.0|\
4.9-3.1.5.0|\
4.9-2.2.6.0|\
4.9-2.2.4.0|\
4.9-0.1.7.0)
patch_mlnx_ofed49
;;
esac
# Copy specfile to outside of the package
cp -f rdma-core.spec ..
cd ..
# Increase the version number and add the distro tag
sed -i s/Release:.*/Release:\ $RDMA_CORE_NEW_VERSION/g rdma-core.spec
sed -i s/Source:.*/Source:\ rdma-core-%{version}-%{release}.tgz/g rdma-core.spec
tar czf rdma-core-$RDMA_CORE_VERSION-$RDMA_CORE_NEW_VERSION.tgz rdma-core-$RDMA_CORE_VERSION
cp rdma-core-$RDMA_CORE_VERSION-$RDMA_CORE_NEW_VERSION.tgz $RPM_BUILD_ROOT/SOURCES
# Rebuild rdma-core
echo Building RPMS... it may take a while
rpmbuild --nodebuginfo --define "_topdir $RPM_BUILD_ROOT" -ba rdma-core.spec 2>/dev/null >/dev/null
mkdir -p $RPMS_OUTPUT_DIR
mv $RPM_BUILD_ROOT/RPMS/x86_64/* $RPMS_OUTPUT_DIR
# We don't want to install with -y; it's a safety measure
cd $RPMS_OUTPUT_DIR
dnf install *
# Cleanup
rm -rf $WORK_DIR
rm -rf $RPM_BUILD_ROOT
echo
echo Mellanox OFED installation has been patched for EFA \(libefa.so\) and MLX4 \(libmlx4.so\) support
echo RPM packages are available at $RPMS_OUTPUT_DIR
echo
echo Done