Add tools for mounting VHD as NBD from Linux

This commit is contained in:
2026-09-08 02:44:14 +08:00
parent 895a4c00a1
commit 7afd4fdd0c
5 changed files with 115 additions and 0 deletions
Executable
+17
View File
@@ -0,0 +1,17 @@
#!/bin/bash
# wait until nbd is ready
APP_DIR="$(dirname "$0")"
NBD_READY="$APP_DIR/nbd-ready"
INTERVAL=0.5
TIMEOUT=$1
SECONDS=0
until $NBD_READY; do
if [ "$TIMEOUT" ] && (( SECONDS >= "$TIMEOUT" )); then
echo "Timeout waiting for NBD" >&2
exit 1
fi
sleep $INTERVAL
done