-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcreate_rpm.sh
More file actions
executable file
·116 lines (93 loc) · 2.46 KB
/
create_rpm.sh
File metadata and controls
executable file
·116 lines (93 loc) · 2.46 KB
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
#/bin/bash
set -x
splconfigopts=""
path=`pwd`
kernel_ver=`uname -r`
#cloning repo
git clone git@github.com:zfs-linux/spl.git
git clone git@github.com:zfs-linux/zfs.git
git clone git@github.com:zfs-linux/lzfs.git
mkdir -p /tmp/logzfs/
touch "/tmp/logzfs/logfile`date +%F`"
logpath="/tmp/logzfs/logfile`date +%F`"
splver="spl"
zfsver="zfs"
lzfsver="lzfs"
for name in spl zfs lzfs
do
cd $name 2> /dev/null
if test $? -ne 0
then
echo "Error : change directory "
exit -1
fi
git checkout GA-01.v02 2> /dev/null
if test $? -ne 0
then
echo "Error : checkout GA-01 failed "
exit -1
fi
commit_meta_value=`cat META | grep commit | cut -d ' ' -f2`
commit_text=`cat META | grep commit | cut -d ' ' -f1`
new_commit=`git log | head -n 1`
commit_val=`git log | head -n 1 | cut -d ' ' -f2`
if [ "$commit_text" = "commit" ]
then
sed -i "s/$commit_meta_value/$commit_val/g" META 2>> /dev/null
if test $? -ne 0
then
echo "error : sed failed"
exit -1
fi
else
echo $new_commit >> META
fi
if [ "$name" = "spl" ]
then
presize=`ls -s $logpath | cut -d' ' -f1`
./configure --disable-debug-kmem --with-linux=/usr/src/kernels/$kernel_ver/ 2>> $logpath
postsize=`ls -s $logpath | cut -d' ' -f1`
if test $presize -ne $postsize
then
echo "Error : spl configure error" >> $logpath
exit -1
fi
elif [ "$name" = "zfs" ]
then
presize=`ls -s $logpath | cut -d' ' -f1`
./configure --with-linux=/usr/src/kernels/$kernel_ver/ --with-spl=$path/$splver/ 2>> $logpath
postsize=`ls -s $logpath | cut -d' ' -f1`
if test $presize -ne $postsize
then
echo "Error : zfs configure error" >> $logpath
exit -1
fi
else
presize=`ls -s $logpath | cut -d' ' -f1`
./configure --with-linux=/usr/src/kernels/$kernel_ver/ --with-spl=$path/$splver/ --with-zfs=$path/$zfsver/ 2>> $logpath
postsize=`ls -s $logpath | cut -d' ' -f1`
if test $presize -ne $postsize
then
echo "Error : lzfs configure error" >> $logpath
exit -1
fi
fi
make 2>> $logpath
if test $? -ne 0
then
echo "Error : $name make error" >> $logpath
exit -1
fi
make rpm 2>> logpath
if test $? -ne 0
then
echo "Error : make rpm error for $name" >> $logpath
exit -1
fi
#copying rpm packages
targetsplpath="$path/rpm_GA-01/$name"
mkdir -p $targetsplpath
cp *.rpm $targetsplpath
cd ..
done
set +x