-
Notifications
You must be signed in to change notification settings - Fork 5
/
setupDpdkCopy.sh
executable file
·91 lines (74 loc) · 1.73 KB
/
setupDpdkCopy.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
#!/bin/sh
sudo mkdir -p /opt/dpdk/build
sudo mkdir -p /opt/dpdk/build/include
sudo mkdir -p /opt/dpdk/build/lib
sudo mkdir -p /opt/dpdk/build/include/exec-env
sudo mkdir -p /opt/dpdk/build/include/generic
sudo rm -rf ~/trash/*
src=~/tools/dpdk-stable-17.08.1/build/lib
dst=/opt/dpdk/build/lib
#clean destination
if [ -d $dst ]; then
echo "Cleaning target directory $dst"
sudo mv $dst/* ~/trash/
fi
sudo cp -r $src/* $dst
src=~/tools/dpdk-stable-17.08.1/build/include
dst=/opt/dpdk/build/include
#clean destination
if [ -d $dst ]; then
echo "Cleaning target directory $dst"
sudo mv $dst/* ~/trash/
fi
#copy files
for i in `ls $src`; do
path=""
if [ -L $src/$i ]; then
path=`readlink -f $src/$i`
#echo $src/$i
#echo $path
sudo ln -s $path $dst/$i
else
sudo cp -r -vP $src/$i $dst
fi
done
src=~/tools/dpdk-stable-17.08.1/build/include/exec-env
dst=/opt/dpdk/build/include/exec-env
#clean destination
if [ -d $dst ]; then
echo "Cleaning target directory $dst"
sudo mv $dst/* ~/trash/
fi
#copy files
for i in `ls $src`; do
path=""
if [ -L $src/$i ]; then
path=`readlink -f $src/$i`
#echo $src/$i
#echo $path
sudo ln -s $path $dst/$i
else
sudo cp -r -vP $src/$i $dst
fi
done
src=~/tools/dpdk-stable-17.08.1/build/include/generic
dst=/opt/dpdk/build/include/generic
#clean destination
if [ -d $dst ]; then
echo "Cleaning target directory $dst"
sudo mv $dst/* ~/trash/
fi
#copy files
for i in `ls $src`; do
path=""
if [ -L $src/$i ]; then
path=`readlink -f $src/$i`
#echo $src/$i
#echo $path
sudo ln -s $path $dst/$i
else
sudo cp -r -vP $src/$i $dst
fi
done
# Listing target directiry files
#sudo ls -al $dst