Added code to wait for loopback readiness

This commit is contained in:
Phuong Vu 2021-12-05 17:28:31 +07:00
parent c2e09c32bc
commit 9137ba5e5f
1 changed files with 2 additions and 0 deletions

View File

@ -292,6 +292,8 @@ else
parttype="logical" parttype="logical"
fi fi
loopback="$(losetup -f --show -o "$partstart" "$img")" loopback="$(losetup -f --show -o "$partstart" "$img")"
# Wait 3 seconds to ensure loopback is ready.
sleep 3
tune2fs_output="$(tune2fs -l "$loopback")" tune2fs_output="$(tune2fs -l "$loopback")"
rc=$? rc=$?
if (( $rc )); then if (( $rc )); then