aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2017-07-04 21:23:53 +0100
committerMarc Zyngier <marc.zyngier@arm.com>2017-07-04 21:25:37 +0100
commitec030129c0ea87b9067a78b2a7d08bcccb798388 (patch)
treea874727fd811768080ef9c0bdac96d6e0eb6f923
parent344cc5364fb78c552c24bb8e9ba598c20062abb4 (diff)
downloadvminstall-ec030129c0ea87b9067a78b2a7d08bcccb798388.tar.gz
runinstallvm: Add SIZE parameter for block device
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
-rw-r--r--README2
-rwxr-xr-xruninstallvm.sh3
2 files changed, 4 insertions, 1 deletions
diff --git a/README b/README
index cc2d482..21ad1f2 100644
--- a/README
+++ b/README
@@ -70,6 +70,8 @@ at some point. Maybe.
for runinstallvm.sh, with the exception of DISK and EFIVAR (which it
overrides). In addition, it provides the following:
+ - SIZE: Size of the virtio disk storage. Defaults to 16GB.
+
- KEEPME: When provided, create a directory with that name, and
store the VM disk and EFI variables in that directory. Also
generate a "runvm.sh" script in the same directory, which calls
diff --git a/runinstallvm.sh b/runinstallvm.sh
index 77a1676..73d5cf0 100755
--- a/runinstallvm.sh
+++ b/runinstallvm.sh
@@ -1,13 +1,14 @@
#!/bin/bash
OUT=${KEEPME-tmp}
+size=${SIZE-16G}
mkdir -p $OUT || exit 1
export DISK=$(mktemp -p $OUT -t XXXXXXXXXXXXXXXX.img)
export EFIVAR=$OUT/$(basename $DISK .img).fd
-truncate -s 16G $DISK
+truncate -s $size $DISK
truncate -s 64M $EFIVAR
if [ ! -z "$KEEPME" ]; then