forked from alaahl/rdma
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathrdma-initramfs-tools-hook
executable file
·70 lines (52 loc) · 1.72 KB
/
rdma-initramfs-tools-hook
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
# Network Interface Configuration System
# Copyright 2016 Mellanox Technologies. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2,
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#!/bin/sh -e
PREREQS=""
prereqs() { echo "$PREREQS"; }
case "$1" in
prereqs)
prereqs
exit 0
;;
esac
. /usr/share/initramfs-tools/hook-functions
# Begin real processing below this line
_install_file()
{
local fpath=$1; shift
local dest=$1; shift
if [ "X$fpath" = "X" ] || [ "X$dest" = "X" ]; then
exit 1
fi
fname=$(basename $fpath)
if [ -e $DESTDIR/$dest/$fname ]; then
return
fi
mkdir -p $DESTDIR/$dest
cp $fpath $DESTDIR/$dest
}
_install_file /etc/rdma/rdma.conf /etc/rdma
_install_file /etc/rdma/mlx4.conf /etc/rdma
_install_file /etc/rdma/sriov-vfs /etc/rdma
_install_file /sbin/rdma-init-kernel /sbin
_install_file /sbin/rdma-fixup-mtrr.awk /sbin
_install_file /sbin/mlx4-setup.sh /sbin
_install_file /sbin/rdma-set-sriov-vf /sbin
_install_file /lib/modprobe.d/libmlx4.conf /lib/modprobe.d
_install_file /etc/modprobe.d/mlx4-rdma.conf /etc/modprobe.d
_install_file /lib/udev/rules.d/98-rdma.rules /lib/udev/rules.d
_install_file /etc/udev/rules.d/70-persistent-ipoib.rules /udev/rules.d
for program in bash lspci setpci awk sleep; do
programpath=$(which $program)
copy_exec $programpath $(dirname $programpath)
done
exit 0