5 config_file="arch/x86/configs/opnfv.config"
10 echo "usage: ${0} output_dir"
14 if [[ -z "$@" ]]; then
18 if [ ! -d ${output_dir} -o ! -w ${output_dir} ] ; then
19 echo "${0}: Output directory '${output_dir}' does not exist or cannot be written"
23 if [ ! -d ${kernel_src_dir} ] ; then
24 echo "${0}: Directory '${kernel_src_dir}' does not exist, run this script from the root of kvmfornfv source tree"
30 # Apply out of tree patches
32 for i in $SRC/kvmfornfv/patches/$1/*.patch
46 if [ ! -f ${config_file} ] ; then
47 echo "${0}: ${config_file} does not exist"
51 # Workaround build bug on Ubuntu 14.04
52 cat <<EOF > arch/x86/boot/install.sh
54 cp -a -- "\$2" "\$4/vmlinuz-\$1"
57 # Configure the kernel
58 cp $config_file .config
60 make oldconfig </dev/null
62 # Build the kernel debs
65 fakeroot make-kpkg --initrd --revision=$VERSION kernel_image kernel_headers
69 mv /root/kvmfornfv/linux-* /root/kvmfornfv/build_output