summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2019-10-15 12:05:31 -0400
committerAndrew Cady <d@jerkface.net>2019-10-15 12:05:31 -0400
commit4ec27faa89ec4ce56e198da8799cf146e0137850 (patch)
treebf2f85ae5ea7a4422135242117077e588ecca445
parenta383308a52a010414f5a3897e12338ad01187c2e (diff)
retry fallocating samizdat.disk.img with smaller disk sizes
-rwxr-xr-xsrc/qemu.sh13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/qemu.sh b/src/qemu.sh
index 130b688..81ffa1f 100755
--- a/src/qemu.sh
+++ b/src/qemu.sh
@@ -73,8 +73,19 @@ case $(arch) in
73 *) qemu=qemu-system-i386 ;; 73 *) qemu=qemu-system-i386 ;;
74esac 74esac
75 75
76try_fallocate()
77{
78 for size in "$@"; do
79 fallocate -l "$size" "$disk"~tmp || continue
80 mv "$disk"~tmp "$disk"
81 return
82 done
83 false
84}
85
76if [ ! -e "$disk" ]; then 86if [ ! -e "$disk" ]; then
77 fallocate -l 10GB "$disk" 87 try_fallocate 16GB 8GB 4GB 2GB 1GB ||
88 echo "Warning: no virtual disk (could not create $disk)" >&2
78fi 89fi
79 90
80if grep -q '^flags.*\<vmx\>' /proc/cpuinfo; then 91if grep -q '^flags.*\<vmx\>' /proc/cpuinfo; then