Wait for zvol to appear

This commit is contained in:
Mateusz Kwiatkowski
2021-11-13 20:26:19 +01:00
parent 678832df94
commit c1d720d62c

View File

@@ -313,9 +313,18 @@ core::write_img(){
shift $? shift $?
_disk_dev="${1}" _disk_dev="${1}"
_img="$2" _img="$2"
timeout=30
i=0
# wait a few seconds for newly created zvol device to appear # wait a few seconds for newly created zvol device to appear
sleep 2 while [ $i -lt $timeout ]; do
if [ ! -r "${_disk_dev}" ]; then
sleep 1
i=$(($i+1))
else
break
fi
done
# just run start with an iso # just run start with an iso
datastore::img_find "_imgpath" "${_img}" || util::err "unable to locate img file - '${_img}'" datastore::img_find "_imgpath" "${_img}" || util::err "unable to locate img file - '${_img}'"