From a5d8a6233a191333a66aa125c25d26e1f1678115 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Thu, 16 Jan 2020 00:43:03 +0100 Subject: [PATCH] copr: aws-builder: provide more space for builds We don't have large root partition enough, and both /tmp and /var/lib/copr-rpmbuild eat the remaing ~3.7G. The swap disk though is large enough, so we can use part of it to mimic the boxes we have in openstack. --- .../files/provision/files/enable-swap.sh | 29 +++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/roles/copr/backend/files/provision/files/enable-swap.sh b/roles/copr/backend/files/provision/files/enable-swap.sh index 7a55939824..27c2212f28 100644 --- a/roles/copr/backend/files/provision/files/enable-swap.sh +++ b/roles/copr/backend/files/provision/files/enable-swap.sh @@ -1,5 +1,6 @@ #!/usr/bin/bash +set -x set -e swap_device= @@ -11,5 +12,29 @@ fi test -n "$swap_device" -mkswap "$swap_device" -swapon "$swap_device" +systemctl unmask tmp.mount +systemctl start tmp.mount + + +echo "\ +n +p + + ++16G +n +p +2 + + +w +" | fdisk "$swap_device" + +mkfs.ext4 "${swap_device}p1" + +mount /dev/"$swap_device"p1 /var/lib/copr-rpmbuild +chown root:mock /var/lib/copr-rpmbuild +chmod 775 /var/lib/copr-rpmbuild + +mkswap "${swap_device}p2" +swapon "${swap_device}p2"