-# TODO: arguments later on to become cmdline args
-#iso=debian-squeeze-di-beta1-amd64-businesscard.iso
-#iso=debian-6.0.3-${ARCH:=amd64}-businesscard.iso
-#iso=debian-wheezy-DI-a1-${ARCH:=amd64}-businesscard.iso
-
-di_cd=/backup/isos/debian-wheezy-DI-b1-amd64-netinst.iso
-# look here for more details about the default IP of the host:
-# # http://www.virtualbox.org/manual/ch09.html#changenat
-di_host=10.0.2.2 # where to look for di preseed
-di_port=10100
-di_preseed=/home/tiziano/git/neurodebian/vm/d-i/wheezy/preseed.cfg
-
-
-build_dir=$PWD/build
-dist_dir=$PWD/dist
-vendor="NeuroDebian"
-vm_version="6.999.20120827"
-vm_ostype=Debian
-vendor_url="http://neuro.debian.net"
-product_url="${vendor_url}/vm.html"
-
-# Generic definitions
-eula="This virtual appliance contains Free and Open Source Software (FOSS) released under licenses compliant with the Debian Free Software Guidelines (DFSG, see http://www.debian.org/social_contract), such as, GPL, BSD, MIT, etc. Such software is free to be used or customized for any purpose.
-
-However, by default this virtual machine is also enabled to install additional software from Debian and NeuroDebian repositories that is distributed under more restrictive licenses (e.g. closed-source, non-commercial, research-only). It is the user's responsibility to adhere to the terms and conditions of any particular software that is installed and used in this virtual machine. Copyright and license details for any installed PACKAGE are available in /usr/share/doc/PACKAGE/copyright inside the virtual machine."
+if [ -z "$di_preseed_in" ]; then
+ # deduce release and use corresponding directory here
+ release=$(basename "$di_cd" | cut -d- -f2)
+ di_preseed_in=$(dirname $0)/../d-i/$release/preseed.cfg.in
+ if [ ! -e "$di_preseed_in" ]; then
+ echo "$di_preseed_in is not found. Specify one with -p" >&2
+ exit 2
+ fi
+fi