Skip to content

Commit 878f6da

Browse files
Merge pull request #87 from psathyan/fixCthon04
Fix cthon04 job failure
2 parents 166c6f5 + 8f2135d commit 878f6da

File tree

1 file changed

+86
-47
lines changed

1 file changed

+86
-47
lines changed

build_scripts/common/basic-gluster.sh

Lines changed: 86 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -68,56 +68,83 @@ else
6868
GIT_REPO=$(basename "${GERRIT_PROJECT}")
6969
GIT_URL="https://${GERRIT_HOST}/${GERRIT_PROJECT}"
7070

71-
BASE_PACKAGES="git bison flex cmake gcc-c++ libacl-devel krb5-devel dbus-devel rpm-build redhat-rpm-config gdb"
72-
BUILDREQUIRES_EXTRA="libnsl2-devel libnfsidmap-devel libwbclient-devel userspace-rcu-devel libcephfs-devel"
73-
if [ "${CENTOS_VERSION}" = "7" ]; then
74-
yum -y install libgfapi-devel
75-
yum -y install ${BASE_PACKAGES} libnfsidmap-devel libwbclient-devel libcap-devel libblkid-devel userspace-rcu-devel userspace-rcu python2-devel
76-
elif [ "${CENTOS_VERSION}" = "8s" ]; then
77-
yum install -y ${BASE_PACKAGES} libacl-devel libblkid-devel libcap-devel redhat-rpm-config rpm-build libgfapi-devel xfsprogs-devel
78-
yum install --enablerepo=powertools -y ${BUILDREQUIRES_EXTRA}
79-
yum -y install selinux-policy-devel sqlite samba-winbind
80-
elif [ "${CENTOS_VERSION}" = "9s" ]; then
81-
yum install -y ${BASE_PACKAGES} libacl-devel libblkid-devel libcap-devel redhat-rpm-config rpm-build libgfapi-devel xfsprogs-devel
82-
yum install --enablerepo=crb -y ${BUILDREQUIRES_EXTRA}
83-
yum -y install selinux-policy-devel sqlite samba-winbind
84-
fi
71+
BASE_PACKAGES="git bison flex cmake gcc-c++ libacl-devel krb5-devel dbus-devel rpm-build redhat-rpm-config gdb"
72+
BUILDREQUIRES_EXTRA="libnsl2-devel libnfsidmap-devel libwbclient-devel userspace-rcu-devel libcephfs-devel"
73+
74+
if [ "${CENTOS_VERSION}" = "7" ]; then
75+
yum -y install libgfapi-devel
76+
yum -y install ${BASE_PACKAGES} libnfsidmap-devel libwbclient-devel libcap-devel libblkid-devel userspace-rcu-devel userspace-rcu python2-devel
77+
elif [ "${CENTOS_VERSION}" = "8s" ]; then
78+
yum install -y ${BASE_PACKAGES} libacl-devel libblkid-devel libcap-devel redhat-rpm-config rpm-build libgfapi-devel xfsprogs-devel
79+
yum install --enablerepo=powertools -y ${BUILDREQUIRES_EXTRA}
80+
yum -y install selinux-policy-devel sqlite samba-winbind
81+
elif [ "${CENTOS_VERSION}" = "9s" ]; then
82+
yum install -y ${BASE_PACKAGES} \
83+
libacl-devel \
84+
libblkid-devel \
85+
libcap-devel \
86+
redhat-rpm-config \
87+
rpm-build \
88+
libgfapi-devel \
89+
xfsprogs-devel \
90+
python3-devel
91+
yum install --enablerepo=crb -y ${BUILDREQUIRES_EXTRA}
92+
yum -y install selinux-policy-devel sqlite samba-winbind
93+
fi
8594

8695
git init "${GIT_REPO}"
8796
pushd "${GIT_REPO}"
8897

89-
#Its observed that fetch is failing so this little hack is added! Will delete in future if it turns out useless!
98+
#Its observed that fetch is failing so this little hack is added! Will delete in future if it turns out useless!
9099
git fetch --depth=1 "${GIT_URL}" "${GERRIT_REFSPEC}" > /dev/null
91-
if [ $? = 0 ]; then
92-
echo "Fetch succeeded"
93-
else
94-
sleep 2
95-
git fetch "${GIT_URL}" "${GERRIT_REFSPEC}"
96-
fi
100+
101+
if [ $? = 0 ]; then
102+
echo "Fetch succeeded"
103+
else
104+
sleep 2
105+
git fetch "${GIT_URL}" "${GERRIT_REFSPEC}"
106+
fi
97107

98108
git checkout -b "${GERRIT_REFSPEC}" FETCH_HEAD
99109

100110
# update libntirpc
101-
git submodule update --recursive --init || git submodule sync
111+
git submodule update --recursive --init || git submodule sync --recursive
102112

103113
mkdir build
104114
pushd build
105115

106-
cmake -DCMAKE_BUILD_TYPE=Maintainer -DUSE_FSAL_GLUSTER=ON -DUSE_DBUS=ON -D_MSPAC_SUPPORT=OFF ../src
116+
cmake ../src \
117+
-DCMAKE_BUILD_TYPE=Maintainer \
118+
-DUSE_FSAL_GLUSTER=ON \
119+
-DUSE_FSAL_CEPH=OFF \
120+
-DUSE_FSAL_RGW=OFF \
121+
-DUSE_DBUS=ON \
122+
-DUSE_ADMIN_TOOLS=ON
123+
124+
# We have noticed issues with bcond_with missing for some variables
125+
# unwind_enriched_bt
126+
sed -i 's/^ unwind_enriched_bt$/%bcond_with unwind_enriched_bt/g' ../src/nfs-ganesha.spec
127+
128+
# monitoring
129+
sed -i 's/^ monitoring$/%bcond_with monitoring/g' ../src/nfs-ganesha.spec
130+
107131
make dist
108132
rpmbuild -ta --define "_srcrpmdir $PWD" --define "_rpmdir $PWD" *.tar.gz
133+
109134
rpm_arch=$(rpm -E '%{_arch}')
110135
ganesha_version=$(rpm -q --qf '%{VERSION}-%{RELEASE}' -p *.src.rpm)
136+
111137
if [ -e ${rpm_arch}/libntirpc-devel*.rpm ]; then
112138
ntirpc_version=$(rpm -q --qf '%{VERSION}-%{RELEASE}' -p ${rpm_arch}/libntirpc-devel*.rpm)
113139
ntirpc_rpm=${rpm_arch}/libntirpc-${ntirpc_version}.${rpm_arch}.rpm
114140
fi
141+
115142
yum -y install {x86_64,noarch}/*.rpm
116143

117-
#Test block
118-
ulimit -a
119-
ulimit -c unlimited
120-
ulimit -a
144+
#Test block
145+
ulimit -a
146+
ulimit -c unlimited
147+
ulimit -a
121148

122149
# start nfs-ganesha service with an empty configuration
123150
echo "NFSv4 { Graceless = true; }" > /etc/ganesha/ganesha.conf
@@ -206,27 +233,39 @@ then
206233
fi
207234

208235
#Enabling ACL for the volume if ENABLE_ACL param is set to True
209-
if [ "${ENABLE_ACL}" == "True" ]
210-
then
211-
conf_file="/etc/ganesha/exports/export."${GLUSTER_VOLUME}".conf"
212-
sed -i s/'Disable_ACL = .*'/'Disable_ACL = false;'/g ${conf_file}
213-
cat ${conf_file}
214-
215-
#Parsing export id from volume export conf file
216-
export_id=$(grep 'Export_Id' ${conf_file} | sed 's/^[[:space:]]*Export_Id.*=[[:space:]]*\([0-9]*\).*/\1/')
217-
218-
dbus-send --type=method_call --print-reply --system --dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.UpdateExport string:${conf_file} string:"EXPORT(Export_Id = ${export_id})"
236+
if [ "${ENABLE_ACL}" == "True" ]; then
237+
conf_file="/etc/ganesha/exports/export."${GLUSTER_VOLUME}".conf"
238+
sed -i s/'Disable_ACL = .*'/'Disable_ACL = false;'/g ${conf_file}
239+
cat ${conf_file}
240+
241+
#Parsing export id from volume export conf file
242+
export_id=$(grep 'Export_Id' ${conf_file} | \
243+
sed 's/^[[:space:]]*Export_Id.*=[[:space:]]*\([0-9]*\).*/\1/')
244+
245+
dbus-send --type=method_call \
246+
--print-reply \
247+
--system \
248+
--dest=org.ganesha.nfsd \
249+
/org/ganesha/nfsd/ExportMgr \
250+
org.ganesha.nfsd.exportmgr.UpdateExport \
251+
string:${conf_file} string:"EXPORT(Export_Id = ${export_id})"
219252
fi
220253

221254
#Enabling Security_Label for the volume if SECURITY_LABEL param is set to True
222-
if [ "${SECURITY_LABEL}" == "True" ]
223-
then
224-
conf_file="/etc/ganesha/exports/export."${GLUSTER_VOLUME}".conf"
225-
sed -i s/'Security_Label = .*'/'Security_Label = True;'/g ${conf_file}
226-
cat ${conf_file}
227-
228-
#Parsing export id from volume export conf file
229-
export_id=$(grep 'Export_Id' ${conf_file} | sed 's/^[[:space:]]*Export_Id.*=[[:space:]]*\([0-9]*\).*/\1/')
230-
231-
dbus-send --type=method_call --print-reply --system --dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.UpdateExport string:${conf_file} string:"EXPORT(Export_Id = ${export_id})"
255+
if [ "${SECURITY_LABEL}" == "True" ]; then
256+
conf_file="/etc/ganesha/exports/export."${GLUSTER_VOLUME}".conf"
257+
sed -i s/'Security_Label = .*'/'Security_Label = True;'/g ${conf_file}
258+
cat ${conf_file}
259+
260+
# Parsing export id from volume export conf file
261+
export_id=$(grep 'Export_Id' ${conf_file} | \
262+
sed 's/^[[:space:]]*Export_Id.*=[[:space:]]*\([0-9]*\).*/\1/')
263+
264+
dbus-send --type=method_call \
265+
--print-reply \
266+
--system \
267+
--dest=org.ganesha.nfsd \
268+
/org/ganesha/nfsd/ExportMgr \
269+
org.ganesha.nfsd.exportmgr.UpdateExport \
270+
string:${conf_file} string:"EXPORT(Export_Id = ${export_id})"
232271
fi

0 commit comments

Comments
 (0)