X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Ftools%2Fdisk-image-builder%2Fubuntu%2Frun-listmaker.sh;h=00ee77415ebaf106c40f3798d3fbbae56dbd9873;hp=5af8f08f99025e0568ae9608a8359bd0d4756454;hb=4ab17f1d485e858b885f430e8ffe0852602f31c3;hpb=d08c8e467ae317d8c020d964cbf8ede6d2ce3765 diff --git a/resources/tools/disk-image-builder/ubuntu/run-listmaker.sh b/resources/tools/disk-image-builder/ubuntu/run-listmaker.sh index 5af8f08f99..00ee77415e 100755 --- a/resources/tools/disk-image-builder/ubuntu/run-listmaker.sh +++ b/resources/tools/disk-image-builder/ubuntu/run-listmaker.sh @@ -37,27 +37,43 @@ then exit 1 fi DATE=$(date +%Y-%m-%d) -OS="ubuntu-14.04.4" + +if [ "$1" = "ubuntu-14.04.4" ] +then + OS="ubuntu-14.04.4" + VIRL_TOPOLOGY_FILE="listmaker/virl-listmaker-ubuntu-14.04.4.yaml" +elif [ "$1" = "ubuntu-16.04.1" ] +then + OS="ubuntu-16.04.1" + VIRL_TOPOLOGY_FILE="listmaker/virl-listmaker-ubuntu-16.04.1.yaml" +else + echo "Please provide OS as parameter:" + echo "Options: ${0} [ubuntu-14.04.4|ubuntu-16.04.1]" + exit 1 +fi + RELEASE="${OS}_${DATE}_${VERSION}" OUTPUT_DIR="lists/${RELEASE}" echo "Building release ${RELEASE}." -echo "Storinging data in ${OUTPUT_DIR}/." +echo "Storing data in ${OUTPUT_DIR}/." # APT packages wanted APT_WANTLIST_INFRA="nfs-common cloud-init" -APT_WANTLIST_CSIT="python-dev python-virtualenv git strongswan" +APT_WANTLIST_CSIT="python-dev python-pip python-virtualenv git strongswan" +APT_WANTLIST_TLDK="libpcap0.8-dev libpcap-dev" APT_WANTLIST_VPP="dkms bridge-utils" APT_WANTLIST_TREX="zlib1g-dev unzip" APT_WANTLIST_NESTED="qemu-system-x86" APT_WANTLIST_JAVA="openjdk-8-jdk-headless" -APT_WANTLIST_DOCKER="docker-engine" +#Docker is currently disabled due to issues with apt repositories retrieval +#APT_WANTLIST_DOCKER="docker-engine" # For now, let us NOT incude WANTLIST_NESTED in the below. We're installing qemu # separately from a separate source. -APT_WANTLIST="$APT_WANTLIST_INFRA $APT_WANTLIST_CSIT $APT_WANTLIST_VPP $WANTLIST_TREX" +APT_WANTLIST="$APT_WANTLIST_INFRA $APT_WANTLIST_CSIT $APT_WANTLIST_VPP $APT_WANTLIST_TREX $APT_WANTLIST_TLDK" APT_OUTPUTFILE="${OUTPUT_DIR}/apt-packages.txt" @@ -78,8 +94,6 @@ PIP_OUTPUTFILE="${OUTPUT_DIR}/pip-requirements.txt" SSH_USER="root" SSH_PASS="csit" -VIRL_TOPOLOGY_FILE="listmaker/virl-listmaker.yaml" - ### ### Spin up simulation ### @@ -145,6 +159,8 @@ function do_ssh { -o LogLevel=error ${SSH_USER}@${ip} "$@" } +if [ "$OS" = "ubuntu-14.04.4" ] +then do_ssh "cat - > /etc/apt/sources.list" <<_EOF deb http://us.archive.ubuntu.com/ubuntu/ trusty main restricted deb-src http://us.archive.ubuntu.com/ubuntu/ trusty main restricted @@ -167,7 +183,31 @@ deb-src http://security.ubuntu.com/ubuntu trusty-security universe deb http://security.ubuntu.com/ubuntu trusty-security multiverse deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse _EOF - +elif [ "$OS" = "ubuntu-16.04.1" ] +then +do_ssh "cat - > /etc/apt/sources.list" <<_EOF +deb http://us.archive.ubuntu.com/ubuntu/ xenial main restricted +deb-src http://us.archive.ubuntu.com/ubuntu/ xenial main restricted +deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted +deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted +deb http://us.archive.ubuntu.com/ubuntu/ xenial universe +deb-src http://us.archive.ubuntu.com/ubuntu/ xenial universe +deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates universe +deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates universe +deb http://us.archive.ubuntu.com/ubuntu/ xenial multiverse +deb-src http://us.archive.ubuntu.com/ubuntu/ xenial multiverse +deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates multiverse +deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates multiverse +deb http://us.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse +deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse +deb http://security.ubuntu.com/ubuntu xenial-security main restricted +deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted +deb http://security.ubuntu.com/ubuntu xenial-security universe +deb-src http://security.ubuntu.com/ubuntu xenial-security universe +deb http://security.ubuntu.com/ubuntu xenial-security multiverse +deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse +_EOF +fi ### FIXME: Need error handling around all this do_ssh apt-get update @@ -179,32 +219,47 @@ do_ssh apt-get --print-uris -y install $APT_WANTLIST >> $APT_TEMPFILE do_ssh DEBIAN_FRONTEND=noninteractive apt-get -y install $APT_WANTLIST ### Install qemu ($APT_WANTLIST_NESTED) separately from PPA +if [ "$OS" = "ubuntu-14.04.4" ] +then do_ssh "cat - >> /etc/apt/sources.list" <<_EOF # For a custom qemu build deb http://ppa.launchpad.net/syseleven-platform/virtualization/ubuntu trusty main deb-src http://ppa.launchpad.net/syseleven-platform/virtualization/ubuntu trusty main _EOF +fi do_ssh apt-get --allow-unauthenticated update do_ssh apt-get --print-uris --allow-unauthenticated -y install $APT_WANTLIST_NESTED >> $APT_TEMPFILE do_ssh DEBIAN_FRONTEND=noninteractive apt-get --allow-unauthenticated -y install $APT_WANTLIST_NESTED ### Install Java ($APT_WANTLIST_JAVA) separately from PPA +if [ "$OS" = "ubuntu-14.04.4" ] +then do_ssh "cat - >> /etc/apt/sources.list" <<_EOF # For java deb http://ppa.launchpad.net/openjdk-r/ppa/ubuntu trusty main _EOF +fi do_ssh apt-get --allow-unauthenticated update do_ssh apt-get --print-uris --allow-unauthenticated -y install $APT_WANTLIST_JAVA >> $APT_TEMPFILE do_ssh DEBIAN_FRONTEND=noninteractive apt-get --allow-unauthenticated -y install $APT_WANTLIST_JAVA ### Install Docker ($APT_WANTLIST_DOCKER) separately from PPA -do_ssh "cat - >> /etc/apt/sources.list" <<_EOF -# For Docker -deb https://apt.dockerproject.org/repo ubuntu-trusty main -_EOF -do_ssh apt-get --allow-unauthenticated update -do_ssh apt-get --print-uris --allow-unauthenticated -y install $APT_WANTLIST_DOCKER >> $APT_TEMPFILE -do_ssh DEBIAN_FRONTEND=noninteractive apt-get --allow-unauthenticated -y install $APT_WANTLIST_DOCKER +#if [ "$OS" = "ubuntu-14.04.4" ] +#then +#do_ssh "cat - >> /etc/apt/sources.list" <<_EOF +## For Docker +#deb https://apt.dockerproject.org/repo ubuntu-trusty main +#_EOF +#elif [ "$OS" = "ubuntu-16.04.1" ] +#then +#do_ssh "cat - >> /etc/apt/sources.list" <<_EOF +## For Docker +#deb https://apt.dockerproject.org/repo ubuntu-xenial main +#_EOF +#fi +#do_ssh apt-get --allow-unauthenticated update +#do_ssh apt-get --print-uris --allow-unauthenticated -y install $APT_WANTLIST_DOCKER >> $APT_TEMPFILE +#do_ssh DEBIAN_FRONTEND=noninteractive apt-get --allow-unauthenticated -y install $APT_WANTLIST_DOCKER cat $APT_TEMPFILE | grep MD5Sum | sort > $APT_OUTPUTFILE rm -f $APT_TEMPFILE