summaryrefslogtreecommitdiffstats
path: root/packer
diff options
context:
space:
mode:
authorVanessa Rene Valderrama <vvalderrama@linuxfoundation.org>2017-02-13 11:39:10 -0600
committerVanessa Rene Valderrama <vvalderrama@linuxfoundation.org>2017-02-13 15:46:41 -0600
commit48a978996e5af71257b35cfdf1006d1abad09097 (patch)
tree83b315f6f52a0a0a930a54813e8f54c6f45ad3f2 /packer
parent340813fe6c26384e0bf552c44aa50e95a259e30a (diff)
Disable auto updates on Ubuntu
Modifying the disable auto updates on Ubuntu to use perl instead of sed because the sed -ine is creating new files ending in ne. Modifying where the apt-get upgrade and updates occur to resolve dpkg/locks which are causing VPP & NSH_SFC builds to fail. Change-Id: I5a81d72df7b758bd8287c54909386114c33ed730 Signed-off-by: Vanessa Rene Valderrama <vvalderrama@linuxfoundation.org>
Diffstat (limited to 'packer')
-rw-r--r--packer/provision/basebuild.sh46
-rw-r--r--packer/provision/baseline.sh19
2 files changed, 31 insertions, 34 deletions
diff --git a/packer/provision/basebuild.sh b/packer/provision/basebuild.sh
index 75eecc9d2..082cfcccc 100644
--- a/packer/provision/basebuild.sh
+++ b/packer/provision/basebuild.sh
@@ -80,6 +80,24 @@ rh_systems() {
ubuntu_systems() {
+ # DEB add Toolchain repo
+ sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
+
+ #Configuring thirdparty Nexus repo
+ echo "deb [trusted=yes] https://nexus.fd.io/content/repositories/thirdparty ./" > /etc/apt/sources.list.d/FD.io.thirdparty.list
+
+ # DEB Install PPA packages
+ echo "---> Adding '$1' PPA $(date +'%Y%m%dT%H%M%S')"
+ dpkg -l software-properties-common > /dev/null 2>&1 || software-properties-common
+
+ listfile=$(perl -e "print(q{$1} =~ m{^ppa:(.+)/ppa})")-ppa-${CODENAME}.list
+ if [ ! -f /etc/apt/sources.list.d/${listfile} ]
+ then
+ do_retry sudo apt-add-repository -y $1
+ fi
+
+ apt-get update
+
# DEB cloud packages
echo "---> Installing cloud packages $(date +'%Y%m%dT%H%M%S')"
CLOUD_PKGS="cloud-initramfs-dyn-netconf cloud-initramfs-growroot cloud-initramfs-rescuevol"
@@ -101,27 +119,15 @@ ubuntu_systems() {
# DEB Install the correct version of toolchain packages
echo "---> Installing latest toolchain packages from PPA $(date +'%Y%m%dT%H%M%S')"
- # DEB Install PPA packages
- echo "---> Adding '$1' PPA $(date +'%Y%m%dT%H%M%S')"
- dpkg -l software-properties-common > /dev/null 2>&1 || software-properties-common
-
- listfile=$(perl -e "print(q{$1} =~ m{^ppa:(.+)/ppa})")-ppa-${CODENAME}.list
- if [ ! -f /etc/apt/sources.list.d/${listfile} ]
- then
- do_retry sudo apt-add-repository -y $1
- fi
-
#Retry to prevent timeout failure
- echo "---> Updating package index $(date +'%Y%m%dT%H%M%S')"
- do_retry sudo apt-get update
- echo "<--- Updating package index $(date +'%Y%m%dT%H%M%S')"
- echo "<--- Adding '$1' PPA $(date +'%Y%m%dT%H%M%S')"
+ #echo "---> Updating package index $(date +'%Y%m%dT%H%M%S')"
+ #do_retry sudo apt-get update
+ #echo "<--- Updating package index $(date +'%Y%m%dT%H%M%S')"
+ #echo "<--- Adding '$1' PPA $(date +'%Y%m%dT%H%M%S')"
# DEB Install GCC packages
echo "---> Installing GCC-5 packages $(date +'%Y%m%dT%H%M%S')"
GCC_PKGS="cpp gcc g++ cmake lcov gcc-multilib"
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update
apt install -y ${GCC_PKGS}
# DEB Install VPP packages to shorten build times
@@ -134,17 +140,12 @@ ubuntu_systems() {
# DEB Install CSIT packages
CSIT_PKGS="libxml2 libxml2-dev libxslt-dev zlib1g-dev bc unzip"
apt install -y ${CSIT_PKGS}
- pip install
# DEB Install latest kernel and uio
echo "---> Installing kernel image and header packages $(date +'%Y%m%dT%H%M%S')"
DEB_PKGS="linux-image-extra-virtual linux-headers-virtual linux-headers-`uname -r`"
apt install -y ${DEB_PKGS}
- #Configuring thirdparty Nexus repo
- echo "deb [trusted=yes] https://nexus.fd.io/content/repositories/thirdparty ./" > /etc/apt/sources.list.d/FD.io.thirdparty.list
- apt-get update
-
# DEB Install deb_dpdk packages to shorten build times
###REMOVED sphinx-rtd-theme
echo "---> Installing deb_dpdk packages $(date +'%Y%m%dT%H%M%S')"
@@ -162,9 +163,6 @@ ubuntu_systems() {
TOOL_PKGS="iproute2 ethtool vlan bridge-utils vim gdb lsb-release gdbserver"
apt install -y ${TOOL_PKGS}
- # DEB Clean up packages for a smaller image
- apt-get update
-
# DEB Updating CA certificates
echo "---> Forcing CA certificate update $(date +'%Y%m%dT%H%M%S')"
sudo update-ca-certificates -f > /dev/null 2>&1
diff --git a/packer/provision/baseline.sh b/packer/provision/baseline.sh
index 6fcc1b0fe..055252595 100644
--- a/packer/provision/baseline.sh
+++ b/packer/provision/baseline.sh
@@ -103,6 +103,15 @@ Dpkg::Options {
EOF
+ # make jdk8 available
+ add-apt-repository -y ppa:openjdk-r/ppa > /dev/null
+ # We need to force openjdk-8-jdk to install
+ apt-get install -qq openjdk-8-jdk > /dev/null
+
+ # disable unattended upgrades & daily updates
+ echo '---> Disabling automatic daily upgrades'
+ grep -lR 'APT::Periodic' /etc/apt/apt.conf.d/ | perl -pi -e 's/"1"/"0"/g'
+
echo "---> Updating operating system"
apt-get update -qq > /dev/null
apt-get upgrade -qq > /dev/null
@@ -115,12 +124,6 @@ EOF
echo "---> Configuring OpenJDK"
apt-get install -qq openjdk-7-jdk > /dev/null
- # make jdk8 available
- add-apt-repository -y ppa:openjdk-r/ppa > /dev/null
- apt-get update -qq > /dev/null
- # We need to force openjdk-8-jdk to install
- apt-get install -qq openjdk-8-jdk > /dev/null
-
# make sure that we still default to openjdk 7
update-alternatives --set java /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java
update-alternatives --set javac /usr/lib/jvm/java-7-openjdk-amd64/bin/javac
@@ -129,10 +132,6 @@ EOF
# stack commands to initialize Heat template based systems.
apt-get install -qq jq > /dev/null
- # disable unattended upgrades & daily updates
- echo '---> Disabling automatic daily upgrades'
- sed -ine 's/"1"/"0"/g' /etc/apt/apt.conf.d/10periodic
- echo 'APT::Periodic::Unattended-Upgrade "0";' >> /etc/apt/apt.conf.d/10periodic
}
all_systems() {