Turned notes into an actual script. Added -guest-additions package.
Improved -desktop package.
Pacifier
+Package: neurodebian-guest-additions
+Architecture: all
+Depends: ${misc:Depends}, sudo, virtualbox-ose-guest-utils, virtualbox-ose-guest-x11, virtualbox-ose-guest-dkms, neurodebian-desktop
+Recommends: chromium-browser
+Suggests:
+Description: add-ons and configuration for the NeuroDebian virtual machine
+ This package configures a Debian installation as a guest operating system
+ in a VirtualBox-based virtual machine for NeuroDebian.
+ .
+ Do not install this package unless you know what you are doing! For example,
+ installation of this package relaxes several security mechanisms.
--- /dev/null
+#!/bin/bash -e
+
+# taken from gnome-icon-theme package postinst
+write_cache()
+{
+if [ -x /usr/bin/gtk-update-icon-cache ]; then
+ if ! gtk-update-icon-cache --force --quiet /usr/share/icons/gnome; then
+ echo "WARNING: icon cache generation failed"
+ fi
+fi
+}
+
+if [ "$1" = "triggered" ]; then
+ write_cache
+ exit 0
+fi
+
+
+if [ "$1" = "configure" -o "$1" = "abort-upgrade" ]; then
+ # Alternatives for the background (use higher priority than desktop-base
+ update-alternatives --install \
+ /usr/share/images/desktop-base/desktop-background \
+ desktop-background \
+ /usr/share/backgrounds/neurodebian.png 100
+
+ # push SVG icon and pixmaps for all relevant sizes
+ SIZES=$(ls /usr/share/icons/gnome/*/places | sed -rn 's,^.*/([0-9]+)x[0-9]+/.*$,\1,p')
+ command="update-alternatives --install /usr/share/icons/gnome/scalable/places/start-here.svg start-here.svg /usr/share/pixmaps/neurodebian.svg 100"
+ for s in $SIZES; do
+ command="$command --slave /usr/share/icons/gnome/${s}x${s}/places/start-here.png start-here-${s}.png /usr/share/pixmaps/neurodebian.png"
+ done
+ $command
+
+ # let GTK know about the change
+ write_cache
+fi
+
+#DEBHELPER#
+
--- /dev/null
+#!/bin/sh -e
+
+#DEBHELPER#
+
+if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ]; then
+ # remove background alternatives
+ update-alternatives --remove desktop-background \
+ /usr/share/backgrounds/neurodebian.png
+
+ # icons
+ update-alternatives --remove start-here.svg \
+ /usr/share/pixmaps/neurodebian.svg
+fi
--- /dev/null
+interest /usr/share/icons/gnome
--- /dev/null
+etc/sudoers.d/nopasswd etc/sudoers.d/
+etc/xdg/autostart/* etc/xdg/autostart/
--- /dev/null
+#!/bin/bash -e
+
+gdm_conf=/etc/gdm/gdm.conf
+if [ "$1" = "configure" -o "$1" = "abort-upgrade" ]; then
+ if [ -z "$(grep 'AutomaticLogin=brain' $gdm_conf)" ]; then
+ echo "Enabling autologin of user 'brain'."
+ sed -i -e 's/^\[daemon\]$/\[daemon\]\nAutomaticLoginEnable=true\nAutomaticLogin=brain\n/' $gdm_conf
+ fi
+fi
+
+#DEBHELPER#
+
# icons
[ ! -d build/icons ] && mkdir -p build/icons
inkscape artwork/icon.svg -w 32 -h 32 -e build/icons/neurodebian.png
+ cp artwork/icon.svg build/icons/neurodebian.svg
# manpages
[ ! -d build/man ] && mkdir -p build/man
help2man -h '--verbose-help' --no-info tools/backport-dsc \
--- /dev/null
+%sudo ALL=(ALL) NOPASSWD: ALL
--- /dev/null
+[Desktop Entry]
+Name=VirtualBox shared folder
+Comment=Mount the shared folder of the VirtualBox host
+Exec=sudo mount -t vboxsf -o defaults,uid=brain,gid=brain host /mnt/host
+Terminal=false
+Type=Application
+++ /dev/null
-Standard Debian install
-
-hostname: neurodebian
-domain: ''
-
-all file in one partition
-
-root: not there
-user: brain
-pwd: neurodebian
-
-
-Do a minimal install
---------------------
-
-All files in one partition/
-just base system, run selection, but no tasks (not even 'Standard system')
-
-
-install new stuff
------------------
-
-Add sources.list for backports and neurodebian
-wget -O /etc/apt/sources.list.d/neuro.debian.net.list http://neuro.debian.net/_static/neurodebian.lenny.us.sources.list
-echo "deb http://www.backports.org/debian lenny-backports main contrib non-free" >> /etc/apt/sources.list.d/backports.org.list
-wget -O - http://backports.org/debian/archive.key | apt-key add -
-wget -O - http://neuro.debian.net/_static/neuro.debian.net.asc | apt-key add -
-
-install kernel 2.6.27 (or later) from backports to have support for OpenGL
-direct rendering in VirtualBox
-(and deinstall the old one, after a successfull reboot)
-
-# a basic desktop
-aptitude install \
- alacarte desktop-base evince file-roller gcalctool gdm gksu gnome-core
- gnome-keyring gnome-utils gnome-volume-manager gnome-mount gthumb
- bash-completion less mc gnome-themes etckeeper git-core gitk ntpdate
- alsa-utils
-
-# install network manager applet
-# but we don't want to have all the openvpn stuff that pull in an armada of
-# things: I did it by hand in aptitude
-
-# cleanup unwanted stuff
-# video drivers (all but vesa)
-aptitude purge $(apt-cache search --names-only --installed xserver-xorg-video | grep xserver-xorg-video | cut -d ' ' -f 1,1) xserver-xorg-video-vesa+
-# random stuff
-aptitude purge radeontool sound-juicer
-
-# setup etckeeper
-etckeeper init
-
-# prepare for kernel module building (guest additions)
-aptitude install module-assistant
-module-assistant prepare
-# note guest additions for 3.1.2 are broken, use 3.1.0
-bash /media/cdrom/VBoxLinuxAdditions-x86.run (need 2.6.27+ kernel for direct rendering)
-#make sure that xorg.conf has 'vboxvideo' as device driver and also
-echo "vboxvideo" >> /etc/modules
-
-# make user brain allowed to execute sudo without a password
-adduser brain sudo
-visudo
-# and uncomment the respective line at the end of the file
-# (make sure there is nothing below it)
-
-# configure shared folders
-mkdir /mnt/host
-mount -t vboxsf host /mnt/host
-# better put the following into the session startup config of the user
-# stupid wrapping into bash line to workaround a silly bug in Virtualbox additions
-bash -c "cd /; sudo mount -t vboxsf -o defaults,uid=brain,gid=brain host /mnt/host"
-
-
-# neuro-stuff
-aptitude install afni afni-atlases amide caret dicomnifti fsl fsl-atlases lipsia
- minc-tools odin psychopy python-mvpa python-pyepl python-mvpa-doc
-
-# general scientifically useful stuff
-aptitude install ipython python-h5py vim-python
-
-# next step purge network interface config to give the power to network manager
-# important
-adduser brain netdev
-
-
-user config
------------
-# put use home dir in git to be able to track changes
-git init
-
-mkdir -p /home/brain/.config/backgrounds
-cp /mnt/host/.config/awesome/hotbrain.png /home/brain/.config/backgrounds/
-
-#change menu icon
-sudo cp /mnt/host/hacking/neurodebian/artwork/icon.svg /usr/share/icons/Mist/scalable/places/start-here.svg
-
-
-Deploy
-------
-
-# shrink VDI image by writting to a new (unfragmented) image
-# target VDI needs to have proper partition table and MBR
-# simplest solution: clonezilla
-
-# clean up the master COPY
-cp ~/vm/nd_master.vdi /tmp/nd_master.vdi
-cd /tmp
-mkdir -p vbdev vbmnt
-# get access to disks inside the VDIs
-sudo vdfuse -f nd_master.vdi vbdev
-# mount partitition
-sudo mount -o loop vbdev/Partition1 vbmnt
-
-# remove cruft
-# package cache
-sudo find vbmnt/var/cache/apt/archives/ -name '*.deb' -delete
-sudo rm vbmnt/var/cache/apt/*.bin
-# device files -- udev restores them
-sudo rm -rf vbmnt/dev/*
-# tmp
-sudo rm -rf vbmnt/tmp/*
-# log files
-sudo find vbmnt/var/log -type f -delete
-# apt lists
-sudo find vbmnt/var/lib/apt -type f -name '*debian*' -o -type f -name '*list*' -delete
-# history
-sudo rm vbmnt/root/.bash_history
-sudo rm vbmnt/home/brain/.bash_history
-
-# unmount filesystem
-sudo umount vbmnt
-# zero out empty space
-sudo zerofree -v vbdev/Partition1
-# close whole VDI
-sudo umount vbdev
-
-# compact VDI
-# THIS NEEDS TO BE DONE ON A VDI THAT IS REGISTERED WITH VIRTUALBOX
-VBoxManage modifyhd nd_master.vdi --compact
-
find vbmnt/var/log -type f -delete
# apt lists
find vbmnt/var/lib/apt -type f -name '*debian*' -o -type f -name '*list*' -delete
-# history
-rm -f vbmnt/root/.bash_history
-rm -f vbmnt/home/*/.bash_history
+# user data
+rm -f vbmnt/root/.*history
+# everything for the default user
+find vbmnt/home/brain -mindepth 1 -delete
# unmount filesystem
umount vbmnt
--- /dev/null
+#!/bin/bash
+
+# Standard Debian install
+
+# maybe have dedicated hard-drives for swap and home
+
+# hostname: neurodebian
+# domain: ''
+
+# all file in one partition
+
+# root: not there
+# user: brain
+# pwd: neurodebian
+
+
+# Do a minimal install
+# --------------------
+
+# All files in one partition/
+# just base system, run selection, but no tasks (not even 'Standard system')
+
+apt-get etckeeper
+
+# setup etckeeper
+git config --global user.name NeuroDebian
+git config --global user.email nd@localhost
+
+# install new stuff
+# -----------------
+
+# Add sources.list for backports and neurodebian
+wget -O /etc/apt/sources.list.d/neuro.debian.net.list http://neuro.debian.net/_static/neurodebian.squeeze.us.sources.list
+wget -O - http://neuro.debian.net/_static/neuro.debian.net.asc | apt-key add -
+
+echo "deb http://backports.debian.org/debian-backports squeeze-backports main contrib non-free" >> /etc/apt/sources.list.d/backports.debian.org.list
+cat << EOT >> /etc/apt/preferences.d/backports.debian.org
+Package: *
+Pin: release a=squeeze-backports
+Pin-Priority: 200
+EOT
+
+apt-get install neurodebian-guest-additions
+
+apt-get install --no-install-recommends \
+ desktop-base gdm gnome-core mc evince bash-completion ntpdate \
+ file-roller gnome-keyring gksu gnome-utils gnome-themes eog
+
+# intermediate cleanup to prevent virtual harddrive from fragmenting too much
+find /var/cache/apt/archives/ -name '*.deb' -delete
+
+# cleanup unwanted stuff
+# video drivers (all but vesa)
+apt-get purge $(apt-cache search --names-only --installed xserver-xorg-video | grep xserver-xorg-video | cut -d ' ' -f 1,1) xserver-xorg-video-vesa+
+apt-get purge gnome-media
+
+# and whatever is obsolete
+apt-get autoremove --purge
+
+# install network manager applet
+# but we don't want to have all the openvpn stuff that pull in an armada of
+# things: I did it by hand in aptitude
+
+# next step purge network interface config to give the power to network manager
+# important
+#adduser brain netdev