diff --git a/roles/copr/backend/files/provision/files/enable-swap.sh b/roles/copr/backend/files/provision/files/enable-swap.sh index 214c9410d5..9842a01903 100644 --- a/roles/copr/backend/files/provision/files/enable-swap.sh +++ b/roles/copr/backend/files/provision/files/enable-swap.sh @@ -3,6 +3,7 @@ set -x set -e +part_suffix=p swap_device= if test -e /dev/xvda1 && test -e /dev/nvme0n1; then swap_device=/dev/nvme0n1 @@ -11,6 +12,7 @@ elif test -e /dev/nvme1n1; then elif test -e /dev/vdb; then # libvirt machine swap_device=/dev/vdb + part_suffix= fi test -n "$swap_device" @@ -33,12 +35,12 @@ p w " | fdisk "$swap_device" -mkfs.ext4 "${swap_device}p1" +mkfs.ext4 "${swap_device}${part_suffix}1" -mount "$swap_device"p1 /var/lib/copr-rpmbuild +mount "$swap_device${part_suffix}1" /var/lib/copr-rpmbuild mkdir /var/lib/copr-rpmbuild/results rpm --setperms copr-rpmbuild rpm --setugids copr-rpmbuild -mkswap "${swap_device}p2" -swapon "${swap_device}p2" +mkswap "${swap_device}${part_suffix}2" +swapon "${swap_device}${part_suffix}2"