4 CONFIG="arch/x86/configs/opnfv.config"
6 OVS_COMMIT="4ff6642f3c1dd8949c2f42b3310ee2523ee970a6"
10 # Apply out of tree patches
12 for i in $SRC/kvmfornfv/patches/$1/*.patch
23 apt-get install -y git fakeroot build-essential ncurses-dev xz-utils kernel-package bc autoconf automake libtool python python-pip
26 # Build kernel in another directory, so some files (which are root writeable only) generated during kernel
27 # building wouldn't remain in the source directory mapped into Docker container
29 cp -r /kvmfornfv $SRC/.
32 # Get the Open VSwitch sources
34 git clone https://github.com/openvswitch/ovs.git
35 cd ovs; git checkout $OVS_COMMIT
42 # Workaround build bug on Ubuntu 14.04
43 cat <<EOF > arch/x86/boot/install.sh
45 cp -a -- "\$2" "\$4/vmlinuz-\$1"
48 # Configure the kernel
51 make oldconfig </dev/null
53 # Build the kernel debs
56 fakeroot make-kpkg --initrd --revision=$VERSION kernel_image kernel_headers
58 # Build OVS kernel modules
65 ./configure --with-linux=$SRC/kvmfornfv/kernel
68 # Add OVS kernel modules to kernel deb
69 dpkg-deb -x $SRC/kvmfornfv/linux-image*.deb ovs.$$
70 dpkg-deb --control $SRC/kvmfornfv/linux-image*.deb ovs.$$/DEBIAN
71 cp datapath/linux/*.ko ovs.$$/lib/modules/*/kernel/net/openvswitch
72 depmod -b ovs.$$ -a `ls ovs.$$/lib/modules`
73 dpkg-deb -b ovs.$$ $SRC/kvmfornfv/linux-image*.deb
76 cp $SRC/kvmfornfv/linux-headers*.deb /kvmfornfv/.
77 cp $SRC/kvmfornfv/linux-image*.deb /kvmfornfv/.