X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=fuel-plugin%2Fbuild_kvm.sh;h=befadd95fda69d29d42508c161d9c02c7ec35ef8;hb=83e64d3406c385029664c1dd271b2be61d017fd1;hp=e4af1023e8c0bd8491d1c76057ab989cb7c7f6a9;hpb=da27230f80795d0028333713f036d44c53cb0e68;p=kvmfornfv.git diff --git a/fuel-plugin/build_kvm.sh b/fuel-plugin/build_kvm.sh index e4af1023e..befadd95f 100755 --- a/fuel-plugin/build_kvm.sh +++ b/fuel-plugin/build_kvm.sh @@ -1,158 +1,78 @@ #!/bin/bash +SRC=/root +CONFIG="arch/x86/configs/opnfv.config" +VERSION="1.0.OPNFV" +OVS_COMMIT="4ff6642f3c1dd8949c2f42b3310ee2523ee970a6" + quirks() { - # Workaround build bug on Ubuntu 14.04 - cat < arch/x86/boot/install.sh +# +# 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 +} + +apt-get update +apt-get install -y git fakeroot build-essential ncurses-dev xz-utils kernel-package bc autoconf automake libtool python python-pip + +# +# Build kernel in another directory, so some files (which are root writeable only) generated during kernel +# building wouldn't remain in the source directory mapped into Docker container +# +cp -r /kvmfornfv $SRC/. +cd $SRC + +# Get the Open VSwitch sources +rm -rf ovs +git clone https://github.com/openvswitch/ovs.git +cd ovs; git checkout $OVS_COMMIT + +cd $SRC/kvmfornfv/ +quirks kernel + +cd kernel + +# Workaround build bug on Ubuntu 14.04 +cat < arch/x86/boot/install.sh #!/bin/sh cp -a -- "\$2" "\$4/vmlinuz-\$1" EOF - # Add deprecated XFS delaylog option back in - cat <m_qflags |= (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE); - mp->m_qflags &= ~XFS_GQUOTA_ENFD; -+ } else if (!strcmp(this_char, MNTOPT_DELAYLOG)) { -+ xfs_warn(mp, -+ "delaylog is the default now, option is deprecated."); - } else if (!strcmp(this_char, MNTOPT_DISCARD)) { - mp->m_flags |= XFS_MOUNT_DISCARD; - } else if (!strcmp(this_char, MNTOPT_NODISCARD)) { --- -1.9.1 +# Configure the kernel +cp $CONFIG .config -EOF -} +make oldconfig /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 - - quirks - - # Configure the kernel - cp $CONFIG .config - - make oldconfig