+}
+
+function compass_deb_build(){
+cd ${kernel_src_dir}
+make oldconfig
+
+quirks(){
+ #
+ # Apply out of tree patches
+ #
+ echo "Inside quirks"
+ for i in $SRC/kvmfornfv/patches/$1/*.patch
+ do
+ if [ -f "$i" ]
+ then
+ echo "Applying: $i"
+ patch -p1 <$i
+ fi
+ done
+ echo "end quirks"
+}
+quirks kernel
+
+echo "SRC is:$SRC"
+echo "kernel_src_dir is : $kernel_src_dir"
+
+VERSION="1.0.OPNFV"
+# Configure the kernel
+cd $kernel_src_dir
+
+# Workaround build bug on Ubuntu 14.04
+cat <<EOF > arch/x86/boot/install.sh
+#!/bin/sh
+cp -a -- "\$2" "\$4/vmlinuz-\$1"
+EOF
+
+# Build the kernel debs
+make-kpkg clean
+fakeroot make-kpkg --initrd --revision=$VERSION kernel_image kernel_headers kernel_debug -j$(nproc)
+make
+
+echo "list the debians built"
+ls -lrth $SRC
+mv $SRC/linux-* $build_dir/build_output
+}
+
+if [[ "$installer_type" == "apex" ]];then
+ apex_rpm_build
+else
+ compass_deb_build
+fi
+