copr-be/copr-hv: vdb partition device ends with number

This commit is contained in:
Pavel Raiskup 2021-05-11 22:55:43 +02:00
parent 45ab72261f
commit 246f84ffce

View file

@ -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"