]> git.donarmstrong.com Git - neurodebian.git/commitdiff
Merge branch 'master' into enh/wheezy-vm
authorYaroslav Halchenko <debian@onerussian.com>
Fri, 7 Dec 2012 18:03:04 +0000 (13:03 -0500)
committerYaroslav Halchenko <debian@onerussian.com>
Fri, 7 Dec 2012 18:03:04 +0000 (13:03 -0500)
* master: (32 commits)
  ENH: nd_build_testrdepends -- sign the temporary repository with the package (use apt-ftparchive)
  ENH: Make neurodebian.cfg also visible on the website so we could easily fetch up-to-date version if needed
  ENH: improved nd_querycfg a bit: query content of a section or list of sections
  Changes for Lin4Neuro from Kiyotaka Nemoto
  Thomas's suggested description for the mirror
  Remove umlaut's from de-m mirror name -- breaks the build
  Added de-m mirror (INCF G-Node), Thanks Thomas Wachtler
  alias for openvibe
  Adding ubuntu quantal (nd12.10) into "supported"
  little TODO in nd_createappliance on preseeding solution
  brochure -- very minor from native speakers
  more items and a bit of indentation -- printing now
  added rudimentary README.txt on how to build brochure
  updated VM page for 6.0.6 (with the date when VM was wrapped on 1st of Oct)
  add remake to give it a page
  changelog + nd-vmsetupwizard: Preparing 0.29 release of neurodebian for updated nd-vmsetupwizard
  Make ymax dynamic (5% above current max value), per each distribution + labels for every other month
  A slight overhaul of the brochure -- nothing radical but at least it is up to date now
  injected spykeview
  BF: added an alias for neo (python-neo)
  ...

Conflicts:
tools/nd-vmsetupwizard
vm/tools/nd_createappliance

1  2 
tools/nd-vmsetupwizard
vm/tools/nd_createappliance

diff --combined tools/nd-vmsetupwizard
index c889a046faa18e631fbd8cf37cf2c90a86611f8b,496ccf173ef74afb1577c9668b132dfc56819442..337b4bb68ba19b663347494cf8b2e0c4c2181abe
  #       ln -f is used for further robustness
  [ ! -L $HOME/host ] && ln -sf /media/sf_host $HOME/host
  
- # TODO:
- #   we need to package python-mvpa2-tutorial-data for PyMVPA
- packages=$(zenity --list $icon_opt --checklist --column="Install" --column="Description" \
+ # TODO: add PyMVPA:
+ #   FALSE "PyMVPA" "python-mvpa2,python-mvpa2-doc,python-mvpa2-tutorial-data" \
+ # needs -doc and -tutorial-data package
+ packages=$(zenity --height 450 --list $icon_opt --checklist --column="Install" --column="Description" \
           --column="Package Name" --print-column=3 --hide-column=3 --hide-header \
           --separator=' ' --text="Please select any additional component that shall be installed.
  
@@@ -116,14 -117,17 +117,16 @@@ Please note that this selection will no
  on the system. No installed packages will be reinstalled or removed, only
  additional components will be installed." \
  FALSE "Emacs" "emacs" \
- FALSE "GNU Image Manipulation Program (Gimp)" "gimp" \
+ FALSE "Graphics (e.g. GIMP, Inscape)" "gimp,inkscape,svgtune,xzgv,vym" \
  FALSE "Octave" "octave,qtoctave" \
  FALSE "OpenOffice.org" "openoffice.org" \
- FALSE "PyMVPA" "ipython,python-mvpa2,python-mvpa2-doc,spyder" \
+ FALSE "PyMVPA Tutorial" "ipython01x,python-mvpa2,python-mvpa2-doc,python-mvpa2-tutorialdata,spyder" \
+ FALSE "Python: Electrophysiology & Modeling" "python-brian,python-pynn,python-pyentropy,stimfit" \
+ FALSE "Python: Neuroimaging" "ipython01x,spyder,nipy-suite,python-mvpa2" \
+ FALSE "Python: Scientific stack" "ipython01x,spyder,python-matplotlib,python-pandas,python-sympy" \
  FALSE "R" "r-recommended" \
- FALSE "Scientific Python" "ipython,python-scipy,python-matplotlib,spyder,python-pandas" \
  FALSE "TeX Live" "texlive" \
  FALSE "Adobe Flash browser plugin" "flashplugin-nonfree" \
 -FALSE "Sun Java browser plugin" "sun-java6-plugin" \
  || true)
  
  if [ -n "$packages" ]; then
index 593c315695340ba5a59367c2c18393f9f075d607,fd4cbdf0151476f99a81aa2c5450a7b7e9231371..9e21abc4b0fe1631302fefa89f40229a4a471ad3
@@@ -2,80 -2,30 +2,80 @@@
  #emacs: -*- mode: shell-script; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- 
  #ex: set sts=4 ts=4 sw=4 noet:
  
 +# fail early
  set -eu
  
 -# TODO: arguments later on to become cmdline args
 -#iso=debian-squeeze-di-beta1-amd64-businesscard.iso
 -iso=debian-6.0.6-${ARCH:=amd64}-businesscard.iso
 -di_cd=$(readlink -f $PWD/../../../neurodebian-images/$iso)
 -di_host=head1.hydra.dartmouth.edu               # where to look for di preseed
 -
  build_dir=$PWD/build
  dist_dir=$PWD/dist
  vendor="NeuroDebian"
 -vm_version="6.0.6"
 +vm_version="6.999.b4.20121206"
  vm_ostype=Debian
  vendor_url="http://neuro.debian.net"
  product_url="${vendor_url}/vm.html"
 +di_port=10100                   # port to start webserver on
  
  # 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."
  
 +# The defaults to be modified from cmdline
 +di_cd=
 +# look here for more details about the default IP of the host:
 +# # http://www.virtualbox.org/manual/ch09.html#changenat
 +mirror_host=10.0.0.1:9999
 +di_tz='US/Eastern'
 +di_preseed_in=
 +
 +function usage {
 +echo "Usage: $0 [OPTIONS]
 +
 +Create ND VirtualBox appliance.
 +
 +Options:
 +  -p PRESEED_IN path to preesed.cfg.in file for d-i
 +  -i ISO        path to debian installation iso file
 +  -m MIRROR     debian mirror to use for installation
 +  -t TIME_ZONE  time zone of virtual machine
 +  -h            Show this help and exit
 +"
 +}
 +
 +# Process cmdline
 +while getopts "p:i:" OPTION
 +do
 +  case $OPTION in
 +      "p") di_preseed_in="$OPTARG";;
 +      "i") di_cd="$OPTARG";;
 +      "m") mirror_host="$OPTARG";;
 +      "t") di_tz="$OPTARG";;
 +      "h") exit 1;;
 +  esac
 +done
 +
 +if [ -z "$di_cd" ] ; then
 +    echo "You must specify the iso image (-i)" >&2
 +    exit 1
 +fi
 +
 +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
 +
 +# Figure out our IP address for VM to reach webserver
 +eth=`route | awk '/default/{print $8;}'`
 +di_host=`ip addr show dev $eth | sed -ne '/inet /s, *inet \([0-9.]*\)/.*,\1,gp'`
  
 -# Computed settings
 -#vm_basepath=
 +# Generate preseed file
 +# yoh could not escape Python here
 +di_preseed=${di_preseed_in%.in}
 +python -c "open('$di_preseed', 'w').write(open('$di_preseed_in').read() % {'DI_HTTP_HOSTNAME': '$di_host:$di_port', 'MIRROR_HTTP_HOSTNAME': '$mirror_host', 'TIME_ZONE': '$di_tz'})"
  
  # By default 32bit unless installer image has amd64
  # TODO: might need to make more robust?
@@@ -112,7 -62,7 +112,7 @@@ VBoxManage unregistervm "${vm_name}" --
  rm -f ${vm_disk}
  }
  
 -clean_buildvm                   # clean things up
 +clean_buildvm >&/dev/null                   # clean things up
  
  #exit
  # Check that no previous VM was left (can happen if previous failures
@@@ -182,23 -132,25 +182,27 @@@ _info "Run Debian Installer
  # type  auto url=$di_host
  # press Enter"
  
 +# start local web server to serve preseed file
 +builtin cd $(dirname ${di_preseed})
 +python -m SimpleHTTPServer ${di_port} >&/dev/null &
 +di_pid=$!
 +builtin cd -
 +
 +
 +
  VBoxManage startvm "${vm_name}"
  
+ # TODO: see if we could just use virtinst (virt-install tool) to run d-i
+ #       with pre-seeding without this hackery.  See
+ #       http://honk.sigxcpu.org/con/Preseeding_Debian_virtual_machines_with_virt_install.html
+ #       for an example
  sleep 5                         # give some time to make sure we get to menu
  # Send our sequence -- cruel way
  #VBoxManage controlvm "${vm_name}" keyboardputscancode \
  #    01 81 \
  #    1e 9e 16 96 14 94 18 98 39 b9 16 96 13 93 26 a6 0d 8d 23 a3 15 95 20 a0 13 93 1e 9e \
  #    1c 9c # ESCAPE, auto url=hydra, ENTER
 -echo "typeGuest \"${vm_name}\" \"&ESC;Wauto url=${di_host}&ENTER;\"" | /usr/lib/virtualbox/vboxshell.py
 -
 -: "
 -oops -- asked either I want to store Partitioning on the disk...
 -
 -didn't happen before
 -"
 +echo "typeGuest \"${vm_name}\" \"&ESC;Wauto url=${di_host}|;${di_port}/$(basename ${di_preseed})&ENTER;\"" | /usr/lib/virtualbox/vboxshell.py
  
  # wait for it to finish! -- found no cleaner way :-/
  sleep 10
@@@ -206,9 -158,6 +210,9 @@@ while VBoxManage showvminfo "${vm_name}
      sleep 5
  done
  
 +# kill the web server
 +kill ${di_pid} || echo "Could not kill the webserver"
 +
  _info Compacting VDI
  sudo ./nd_compactvdi "${vm_disk}"