]> git.donarmstrong.com Git - neurodebian.git/blobdiff - vm/tools/nd_compactvdi
NF: fully (nearly) automated construction of VM image
[neurodebian.git] / vm / tools / nd_compactvdi
index 2aac10aa6cb09649c70ad560b725aafd76d8699b..143db914fa2d45373ed4d0fc94f6718ef89abffb 100755 (executable)
@@ -8,10 +8,14 @@ set -u
 # target VDI needs to have proper partition table and MBR
 # simplest solution: clonezilla
 
-vdifile=$(readlink -f $1)
-
-if [ -z "$vdifile" ]; then
-  echo "You need to provide a VDI file."
+# No deferencing of symbolic links should be done
+# since otherwise might not be found by VirtualBox
+#vdifile=$(readlink -f $1)
+# Just asssume that we are providing full pathname
+vdifile="$1"
+
+if [ -z "$vdifile" ] || [ ! -e "$vdifile" ] || [ "${vdifile:0:1}" != "/" ] ; then
+  echo "You need to provide full pathname to an existing VDI file."
   exit 1
 fi