copr-be/copr-hv: vdb partition device ends with number
This commit is contained in:
parent
45ab72261f
commit
246f84ffce
1 changed files with 6 additions and 4 deletions
|
@ -3,6 +3,7 @@
|
||||||
set -x
|
set -x
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
part_suffix=p
|
||||||
swap_device=
|
swap_device=
|
||||||
if test -e /dev/xvda1 && test -e /dev/nvme0n1; then
|
if test -e /dev/xvda1 && test -e /dev/nvme0n1; then
|
||||||
swap_device=/dev/nvme0n1
|
swap_device=/dev/nvme0n1
|
||||||
|
@ -11,6 +12,7 @@ elif test -e /dev/nvme1n1; then
|
||||||
elif test -e /dev/vdb; then
|
elif test -e /dev/vdb; then
|
||||||
# libvirt machine
|
# libvirt machine
|
||||||
swap_device=/dev/vdb
|
swap_device=/dev/vdb
|
||||||
|
part_suffix=
|
||||||
fi
|
fi
|
||||||
|
|
||||||
test -n "$swap_device"
|
test -n "$swap_device"
|
||||||
|
@ -33,12 +35,12 @@ p
|
||||||
w
|
w
|
||||||
" | fdisk "$swap_device"
|
" | 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
|
mkdir /var/lib/copr-rpmbuild/results
|
||||||
rpm --setperms copr-rpmbuild
|
rpm --setperms copr-rpmbuild
|
||||||
rpm --setugids copr-rpmbuild
|
rpm --setugids copr-rpmbuild
|
||||||
|
|
||||||
mkswap "${swap_device}p2"
|
mkswap "${swap_device}${part_suffix}2"
|
||||||
swapon "${swap_device}p2"
|
swapon "${swap_device}${part_suffix}2"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue