From 246f84ffceea7284e9ca84f3b1399a69057d0181 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Tue, 11 May 2021 22:55:43 +0200 Subject: [PATCH] copr-be/copr-hv: vdb partition device ends with number --- .../copr/backend/files/provision/files/enable-swap.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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"