5 function checkout_commit() {
6 build_dir=/opt/kvmfornfv/
7 mkdir -p /tmp/kvmfornfv
9 if [[ "$installer_type" == "apex" ]];then
10 source ${build_dir}/ci/apex.conf
12 source ${build_dir}/ci/compass.conf
14 #Cloning into /tmp/kvmfornfv
16 if [[ "$branch" == "master" ]] || [[ "$branch" == *"danube"* ]];then
17 echo "Cloning the repository of $branch given"
18 git clone -b $branch https://gerrit.opnfv.org/gerrit/kvmfornfv.git /tmp/kvmfornfv
20 echo "Commit-id is ${commit_id}"
21 git checkout -f ${commit_id}
23 echo "Please check the commit-id provided in installer conf file"
32 kernel_src_dir=$SRC/kernel
33 config_file="${kernel_src_dir}/arch/x86/configs/opnfv.config"
34 cp -f ${config_file} "${kernel_src_dir}/.config"
37 echo "usage: ${0} output_dir"
41 if [[ -z "$@" ]]; then
45 if [ ! -d ${output_dir} -o ! -w ${output_dir} ] ; then
46 echo "${0}: Output directory '${output_dir}' does not exist or cannot \
51 if [ ! -d ${kernel_src_dir} ] ; then
52 echo "${0}: Directory '${kernel_src_dir}' does not exist, run this script \
53 from the root of kvmfornfv source tree"
57 if [ ! -f ${config_file} ] ; then
58 echo "${0}: ${config_file} does not exist"
66 function apex_rpm_build (){
67 rpmbuild_dir=$SRC/kvmfornfv_rpmbuild.$$
68 artifact_dir=${rpmbuild_dir}/RPMS/x86_64
69 mkdir -p $artifact_dir
71 # Make timestamp part of version string for automated kernel boot verification
72 date "+-%y%m%d%H%M" > "${kernel_src_dir}/localversion-zzz"
74 (cd ${kernel_src_dir}; make RPMOPTS="--define '_topdir ${rpmbuild_dir}'" rpm-pkg)
75 if [ ${?} -ne 0 ] ; then
76 echo "${0}: Kernel build failed"
77 rm -rf ${rpmbuild_dir}
81 cp -f ${artifact_dir}/* ${output_dir}
82 mv ${output_dir}/* ${build_dir}/build_output/
84 rm -rf ${rpmbuild_dir}
89 function compass_deb_build(){
95 # Apply out of tree patches
98 for i in $SRC/kvmfornfv/patches/$1/*.patch
111 echo "kernel_src_dir is : $kernel_src_dir"
114 # Configure the kernel
117 # Workaround build bug on Ubuntu 14.04
118 cat <<EOF > arch/x86/boot/install.sh
120 cp -a -- "\$2" "\$4/vmlinuz-\$1"
123 # Build the kernel debs
125 fakeroot make-kpkg --initrd --revision=$VERSION kernel_image kernel_headers kernel_debug -j$(nproc)
128 echo "list the debians built"
130 mv $SRC/linux-* $build_dir/build_output
133 if [[ "$installer_type" == "apex" ]];then