summaryrefslogtreecommitdiffstats
path: root/fuel-plugin/build_kvm.sh
diff options
context:
space:
mode:
authordavidjchou <david.j.chou@intel.com>2016-06-14 08:04:29 -0700
committerdavidjchou <david.j.chou@intel.com>2016-06-20 10:43:56 -0700
commitc715b6029fd5b4eaf323f5efde4ec5db5ba0a9b4 (patch)
tree65c983f09e458ad199d8ff5bff3233e3110b9cb4 /fuel-plugin/build_kvm.sh
parentd746fed82003b740680434c09655d7d5e7108994 (diff)
Rebase fuel-plugin for kvmfornfv to fuel 9.0
1. Uplifit fuel-plugin for kvmfornfv to fuel 9.0 due to that fuel 9.0 will be the deployment tool of OPNFV Colorado release. 2. Fixed quirk for kernel. 3. Added all tools and libs for building OVS module. 4. Allow KVM developer to build fuel-plugin-kvm after they modify the kerenl code without commiting their change into the repo first. So, they can test their code change by fuel-plugin-kvm till they satisfy with their change, then commit to the repo. 5. The final code built into OPNFV fuel iso will depend on the commit ID for kvmfornfv speicifed in fuel for OPNFV source tree. Change-Id: Iaf9ff49c69df374d0757884cfdac4cccee3eebe4 Signed-off-by: davidjchou <david.j.chou@intel.com>
Diffstat (limited to 'fuel-plugin/build_kvm.sh')
-rwxr-xr-xfuel-plugin/build_kvm.sh171
1 files changed, 54 insertions, 117 deletions
diff --git a/fuel-plugin/build_kvm.sh b/fuel-plugin/build_kvm.sh
index 0ea75a0e4..9984f3bab 100755
--- a/fuel-plugin/build_kvm.sh
+++ b/fuel-plugin/build_kvm.sh
@@ -1,133 +1,70 @@
#!/bin/bash
-KVM_COMMIT="0e68cb048bb8aadb14675f5d4286d8ab2fc35449"
+SRC=/
+CONFIG="arch/x86/configs/opnfv.config"
+VERSION="1.0.OPNFV"
OVS_COMMIT="4ff6642f3c1dd8949c2f42b3310ee2523ee970a6"
-KEEP=no
quirks() {
-
- #
- # Apply out of tree patches
- #
- for i in $SRC/kvmfornfv/patches/$1/*.patch
- do
- if [ -f "$i" ]
- then
- echo "Applying: $i"
- patch -p1 <$i
- fi
- done
+#
+# Apply out of tree patches
+#
+for i in $SRC/kvmfornfv/patches/$1/*.patch
+do
+ if [ -f "$i" ]
+ then
+ echo "Applying: $i"
+ patch -p1 <$i
+ fi
+done
}
-for i
-do
- case $i in
+apt-get update
+apt-get install -y git fakeroot build-essential ncurses-dev xz-utils kernel-package bc autoconf automake libtool python python-pip
- -k) KEEP=yes
- shift
- ;;
+cd $SRC
- -c) KVM_COMMIT=$2
- shift;shift
- ;;
+# Get the Open VSwitch sources
+rm -rf ovs
+git clone https://github.com/openvswitch/ovs.git
+cd ovs; git checkout $OVS_COMMIT
- -o) OVS_COMMIT=$2
- shift;shift
- ;;
+cd $SRC/kvmfornfv/
+quirks kernel
- esac
-done
+cd kernel
-SRC=${1:-/root}
-CONFIG=${2:-arch/x86/configs/opnfv.config}
-VERSION=${3:-1.0.OPNFV}
-
-# Check for necessary build tools
-if ! type git >/dev/null 2>/dev/null
-then
- echo "Build tools missing, run the command
-
-apt-get install git fakeroot build-essential ncurses-dev xz-utils kernel-package automake
-
-as root and try again"
- exit 1
-fi
-
-# Make sure the source dir exists
-if [ ! -d $SRC ]
-then
- echo "$SRC: no such directory"
- exit 1
-fi
-
-(
- cd $SRC
-
- # Get the Open VSwitch sources
- if [ ! -d ovs ]
- then
- git clone https://github.com/openvswitch/ovs.git
- fi
-
- # Get the KVM for NFV kernel sources
- if [ ! -d kvmfornfv ]
- then
- git clone https://gerrit.opnfv.org/gerrit/kvmfornfv
- fi
- cd kvmfornfv
- git pull
- if [ x$KVM_COMMIT != x ]
- then
- git checkout $KVM_COMMIT
- else
- git reset --hard
- fi
- cd kernel
-
- # Workaround build bug on Ubuntu 14.04
- cat <<EOF > arch/x86/boot/install.sh
+# Workaround build bug on Ubuntu 14.04
+cat <<EOF > arch/x86/boot/install.sh
#!/bin/sh
cp -a -- "\$2" "\$4/vmlinuz-\$1"
EOF
- quirks kernel
-
- # Configure the kernel
- cp $CONFIG .config
-
- make oldconfig </dev/null
-
- # Build the kernel debs
- if [ $KEEP = no ]
- then
- make-kpkg clean
- fi
- fakeroot make-kpkg --initrd --revision=$VERSION kernel_image kernel_headers
- git checkout arch/x86/boot/install.sh
- git checkout fs/xfs/xfs_super.c
-
- # Build OVS kernel modules
- cd ../../ovs
- if [ x$OVS_COMMIT != x ]
- then
- git checkout $OVS_COMMIT
- else
- git reset --hard
- fi
-
- quirks ovs
-
- ./boot.sh
- ./configure --with-linux=$SRC/kvmfornfv/kernel
- make
-
- # Add OVS kernel modules to kernel deb
- dpkg-deb -x $SRC/kvmfornfv/linux-image*.deb ovs.$$
- dpkg-deb --control $SRC/kvmfornfv/linux-image*.deb ovs.$$/DEBIAN
- cp datapath/linux/*.ko ovs.$$/lib/modules/*/kernel/net/openvswitch
- depmod -b ovs.$$ -a `ls ovs.$$/lib/modules`
- dpkg-deb -b ovs.$$ $SRC/kvmfornfv/linux-image*.deb
- rm -rf ovs.$$
-)
-
-mv $SRC/kvmfornfv/*.deb .
+# Configure the kernel
+cp $CONFIG .config
+
+make oldconfig </dev/null
+
+# Build the kernel debs
+make-kpkg clean
+
+fakeroot make-kpkg --initrd --revision=$VERSION kernel_image kernel_headers
+
+# Build OVS kernel modules
+cd ../../ovs
+
+quirks ovs
+pip install six
+
+./boot.sh
+./configure --with-linux=$SRC/kvmfornfv/kernel
+make
+
+# Add OVS kernel modules to kernel deb
+dpkg-deb -x $SRC/kvmfornfv/linux-image*.deb ovs.$$
+dpkg-deb --control $SRC/kvmfornfv/linux-image*.deb ovs.$$/DEBIAN
+cp datapath/linux/*.ko ovs.$$/lib/modules/*/kernel/net/openvswitch
+depmod -b ovs.$$ -a `ls ovs.$$/lib/modules`
+dpkg-deb -b ovs.$$ $SRC/kvmfornfv/linux-image*.deb
+rm -rf ovs.$$
+