summaryrefslogtreecommitdiff
path: root/contrib/cirrus
diff options
context:
space:
mode:
authorChris Evich <cevich@redhat.com>2019-09-24 13:22:13 -0400
committerChris Evich <cevich@redhat.com>2019-09-26 12:36:33 -0400
commit8368a894ba23f4c1eb5bba398612c3b3dc45387e (patch)
treefbc3fc4f6702a5eac8d2fdecacbf7efcd54a28e9 /contrib/cirrus
parentb9e21af44fb085c899d1c94401f8b5ef0471199a (diff)
downloadpodman-8368a894ba23f4c1eb5bba398612c3b3dc45387e.tar.gz
podman-8368a894ba23f4c1eb5bba398612c3b3dc45387e.tar.bz2
podman-8368a894ba23f4c1eb5bba398612c3b3dc45387e.zip
Cirrus: Disable boottime Ubuntu package update
Signed-off-by: Chris Evich <cevich@redhat.com>
Diffstat (limited to 'contrib/cirrus')
-rwxr-xr-xcontrib/cirrus/check_image.sh5
-rw-r--r--contrib/cirrus/lib.sh2
-rw-r--r--contrib/cirrus/packer/ubuntu_setup.sh10
3 files changed, 16 insertions, 1 deletions
diff --git a/contrib/cirrus/check_image.sh b/contrib/cirrus/check_image.sh
index 39f49d0a1..5423f67d6 100755
--- a/contrib/cirrus/check_image.sh
+++ b/contrib/cirrus/check_image.sh
@@ -56,6 +56,11 @@ then
item_test "On ubuntu /usr/bin/runc is /usr/lib/cri-o-runc/sbin/runc" "$SAMESAME" -eq "0" || let "NFAILS+=1"
fi
+if [[ "$OS_RELEASE_ID" == "ubuntu" ]]
+then
+ item_test "On ubuntu, no periodic apt crap is enabled" -z "$(egrep $PERIODIC_APT_RE /etc/apt/apt.conf.d/*)"
+fi
+
echo "Checking items specific to ${PACKER_BUILDER_NAME}${BUILT_IMAGE_SUFFIX}"
case "$PACKER_BUILDER_NAME" in
xfedora*)
diff --git a/contrib/cirrus/lib.sh b/contrib/cirrus/lib.sh
index f81a8d501..fe4c25e73 100644
--- a/contrib/cirrus/lib.sh
+++ b/contrib/cirrus/lib.sh
@@ -73,6 +73,8 @@ UPLDREL_IMAGE="quay.io/libpod/upldrel:latest"
export DEBIAN_FRONTEND="noninteractive"
SUDOAPTGET="ooe.sh sudo -E apt-get -qq --yes"
SUDOAPTADD="ooe.sh sudo -E add-apt-repository --yes"
+# Regex that finds enabled periodic apt configuration items
+PERIODIC_APT_RE='^(APT::Periodic::.+")1"\;'
# Short-cuts for retrying/timeout calls
LILTO="timeout_attempt_delay_command 24s 5 30s"
BIGTO="timeout_attempt_delay_command 300s 5 30s"
diff --git a/contrib/cirrus/packer/ubuntu_setup.sh b/contrib/cirrus/packer/ubuntu_setup.sh
index 4ae8ea6e9..c94e74a08 100644
--- a/contrib/cirrus/packer/ubuntu_setup.sh
+++ b/contrib/cirrus/packer/ubuntu_setup.sh
@@ -18,8 +18,16 @@ trap "sudo rm -rf $GOPATH" EXIT
# Ensure there are no disruptive periodic services enabled by default in image
systemd_banish
+# Stop disruption upon boot ASAP after booting
+echo "Disabling all packaging activity on boot"
+# Don't let sed process sed's temporary files
+_FILEPATHS=$(sudo ls -1 /etc/apt/apt.conf.d)
+for filename in $_FILEPATHS; do \
+ echo "Checking/Patching $filename"
+ sudo sed -i -r -e "s/$PERIODIC_APT_RE/"'\10"\;/' "/etc/apt/apt.conf.d/$filename"; done
+
echo "Updating/configuring package repositories."
-$LILTO $SUDOAPTGET update
+$BIGTO $SUDOAPTGET update
echo "Upgrading all packages"
$BIGTO $SUDOAPTGET upgrade