summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorChris Evich <cevich@redhat.com>2019-05-17 13:40:39 -0400
committerChris Evich <cevich@redhat.com>2019-05-21 08:44:02 -0400
commitc7d9780be430c6affe2e04b1b1ae0757410adefb (patch)
treeade49aa3bc582c71652cc5cc43eaf98a553426d1 /contrib
parent1a2055ffac8b3673e0d1a4062ae64a87cb4f404f (diff)
downloadpodman-c7d9780be430c6affe2e04b1b1ae0757410adefb.tar.gz
podman-c7d9780be430c6affe2e04b1b1ae0757410adefb.tar.bz2
podman-c7d9780be430c6affe2e04b1b1ae0757410adefb.zip
Cirrus: workaround root expand failure
Occasionally, and seemingly only on F29 the root disk fails to expand upon boot. When this happens, any number of failures could occur if space runs out. Until there is time to investigate the actual cause, workaround this problem by detecting it and acting accordingly. Signed-off-by: Chris Evich <cevich@redhat.com>
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/cirrus/setup_environment.sh14
1 files changed, 13 insertions, 1 deletions
diff --git a/contrib/cirrus/setup_environment.sh b/contrib/cirrus/setup_environment.sh
index 447f4f310..f40405e8d 100755
--- a/contrib/cirrus/setup_environment.sh
+++ b/contrib/cirrus/setup_environment.sh
@@ -33,7 +33,19 @@ done
# (see docs).
case "${OS_REL_VER}" in
ubuntu-18) ;;
- fedora-29) ;;
+ fedora-29)
+ # Occasionally, and seemingly only on F29 the root disk fails to expand
+ # upon boot. When this happens, any number of failures could occur if
+ # space runs out. Until there is time to investigate the actual cause,
+ # workaround this problem by detecting it and acting accordingly.
+ REMAINING=$(df /dev/sda1 | tail -1 | awk '{print $4}')
+ if [[ "$REMAINING" -lt "100000000" ]] # .cirrus.yml specifies 200gig
+ then
+ echo "Fixing failure to expand root filesystem"
+ growpart /dev/sda 1 # device guaranteed by cloud provider
+ resize2fs /dev/sda1 # growpart & resuze guaranteed by base-image
+ fi
+ ;;
fedora-28) ;;
centos-7) # Current VM is an image-builder-image no local podman/testing
echo "No further setup required for VM image building"