]> git.donarmstrong.com Git - neurodebian.git/commitdiff
moving vm tools under vm/tools, deprecating nd_setupguestos replaced with vm/d-i...
authorYaroslav Halchenko <debian@onerussian.com>
Fri, 26 Nov 2010 18:03:18 +0000 (13:03 -0500)
committerYaroslav Halchenko <debian@onerussian.com>
Fri, 26 Nov 2010 18:03:18 +0000 (13:03 -0500)
now tools/ got overpopulated with things relevant for builders, live, and VM.

it might unnecessarily complicate debian/*install, thus moving into
corresponding directory under vm/tools

tools/nd_compactvdi [deleted file]
tools/nd_exportappliance [deleted file]
tools/nd_setupguestos [deleted file]
vm/d-i/tools/initial_setup [changed mode: 0644->0755]
vm/tools/nd_compactvdi [new file with mode: 0755]
vm/tools/nd_exportappliance [new file with mode: 0755]

diff --git a/tools/nd_compactvdi b/tools/nd_compactvdi
deleted file mode 100755 (executable)
index 2aac10a..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/bin/bash
-
-set -e
-set -u
-
-# Alternative:
-# shrink VDI image by writting to a new (unfragmented) image
-# 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."
-  exit 1
-fi
-
-wdir=$(mktemp -d -t compactvdi.XXXXXX)
-
-cd $wdir
-# make mount points
-mkdir -p vbdev vbmnt
-# get access to disks inside the VDIs
-vdfuse -f "$vdifile" vbdev
-# mount partitition (for now only support one)
-mount -o loop vbdev/Partition1 vbmnt
-
-# remove cruft
-#xapian indices
-find vbmnt/var/ -wholename '*xapian*.DB' -delete
-# package cache
-find vbmnt/var/cache/apt/archives/ -name '*.deb' -delete
-rm -f vbmnt/var/cache/apt/*.bin
-# device files -- udev restores them
-rm -rf vbmnt/dev/*
-# tmp
-rm -rf vbmnt/tmp/*
-# log files
-find vbmnt/var/log -type f -delete
-# apt lists
-find vbmnt/var/lib/apt -type f -name '*debian*' -o -type f -name '*list*' -delete
-# user data
-# cannot clean all root stuff, because it also contains useful thing (e.g. git setup)
-rm -f vbmnt/root/.*history
-rm -f vbmnt/home/brain/.*history vbmnt/home/brain/nd*
-
-# unmount filesystem
-umount vbmnt
-# zero out empty space
-zerofree -v vbdev/Partition1
-# close whole VDI
-umount vbdev
-
-# compact VDI
-# THIS NEEDS TO BE DONE ON A VDI THAT IS REGISTERED WITH VIRTUALBOX
-sudo -u "$SUDO_USER" VBoxManage modifyhd "$vdifile" --compact
-
-# cleanup
-rm -rf $wdir
diff --git a/tools/nd_exportappliance b/tools/nd_exportappliance
deleted file mode 100755 (executable)
index b48a92a..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/bash
-
-set -e
-set -u
-
-# Settings/arguments
-vendor="NeuroDebian"
-vm_version="6.0.0"
-vm_arch="amd64"
-vm_name="${vendor} ${vm_version} (${vm_arch})"
-product_name="${vendor} VirtualMachine (${vm_arch})"
-outdir=.
-
-# Common
-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."
-
-out_ovf="${outdir}/${vendor}_${vm_version}_${vm_arch}.ovf"
-VBoxManage export "${vm_name}" -o "$out_ovf" \
-       --vsys 0 \
-       --product "$vm_name" \
-       --producturl "http://neuro.debian.net/vm.html" \
-       --vendor "${vendor}" \
-       --vendorurl "http://neuro.debian.net" \
-       --version "$vm_version" \
-       --eula "$eula"
diff --git a/tools/nd_setupguestos b/tools/nd_setupguestos
deleted file mode 100644 (file)
index f14fb11..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-#!/bin/bash
-
-# play safe
-set -e
-set -u
-
-# Standard Debian install
-
-# prepare on hydra and use debproxy for speed
-
-# have dedicated hard-drives for swap and home
-
-# expert 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')
-
-# set root password to 'neurodebian' too
-echo "Set root passwd:"
-passwd root
-
-apt-get install --no-install-recommends 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-nh.sources.list
-
-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.pref
-Package: *
-Pin: release a=squeeze-backports
-Pin-Priority: 200
-EOT
-
-apt-get update
-apt-get install neurodebian-keyring
-apt-get update
-
-# to cheat the VM check
-touch /dev/vboxguest
-# to get all the stuff in recommends
-apt-get install dkms neurodebian-guest-additions
-
-apt-get install --no-install-recommends \
- gnome-core mc evince bash-completion ntpdate file-roller gnome-utils \
- gnome-themes eog vim \
- software-center gdebi gedit-plugins gnome-media synaptic menu less
-
-# 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 brasero
-
-# and whatever is obsolete
-apt-get autoremove --purge
-
-# custom config
-# use NeuroDebian website as default homepage
-sed -i -e 's,http://www.debian.org,http://neuro.debian.net,g' /etc/chromium-browser/master_preferences
-
-# reduce grub timeout to speed up boot of VM
-sed -i -e 's/GRUB_TIMEOUT=5/GRUB_TIMEOUT=1/g' /etc/default/grub
-update-grub
-
-# finally configure geomirror for APT and disable deb-src lists
-sed -i -e "s/10.0.0.1:9999/$(dpkg --print-architecture)-geomirror.debian.net/" \
-    -e "s/^deb-src/#deb-src/" /etc/apt/sources.list
-
-etckeeper commit "Initial VM setup done"
old mode 100644 (file)
new mode 100755 (executable)
diff --git a/vm/tools/nd_compactvdi b/vm/tools/nd_compactvdi
new file mode 100755 (executable)
index 0000000..2aac10a
--- /dev/null
@@ -0,0 +1,59 @@
+#!/bin/bash
+
+set -e
+set -u
+
+# Alternative:
+# shrink VDI image by writting to a new (unfragmented) image
+# 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."
+  exit 1
+fi
+
+wdir=$(mktemp -d -t compactvdi.XXXXXX)
+
+cd $wdir
+# make mount points
+mkdir -p vbdev vbmnt
+# get access to disks inside the VDIs
+vdfuse -f "$vdifile" vbdev
+# mount partitition (for now only support one)
+mount -o loop vbdev/Partition1 vbmnt
+
+# remove cruft
+#xapian indices
+find vbmnt/var/ -wholename '*xapian*.DB' -delete
+# package cache
+find vbmnt/var/cache/apt/archives/ -name '*.deb' -delete
+rm -f vbmnt/var/cache/apt/*.bin
+# device files -- udev restores them
+rm -rf vbmnt/dev/*
+# tmp
+rm -rf vbmnt/tmp/*
+# log files
+find vbmnt/var/log -type f -delete
+# apt lists
+find vbmnt/var/lib/apt -type f -name '*debian*' -o -type f -name '*list*' -delete
+# user data
+# cannot clean all root stuff, because it also contains useful thing (e.g. git setup)
+rm -f vbmnt/root/.*history
+rm -f vbmnt/home/brain/.*history vbmnt/home/brain/nd*
+
+# unmount filesystem
+umount vbmnt
+# zero out empty space
+zerofree -v vbdev/Partition1
+# close whole VDI
+umount vbdev
+
+# compact VDI
+# THIS NEEDS TO BE DONE ON A VDI THAT IS REGISTERED WITH VIRTUALBOX
+sudo -u "$SUDO_USER" VBoxManage modifyhd "$vdifile" --compact
+
+# cleanup
+rm -rf $wdir
diff --git a/vm/tools/nd_exportappliance b/vm/tools/nd_exportappliance
new file mode 100755 (executable)
index 0000000..b48a92a
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+set -e
+set -u
+
+# Settings/arguments
+vendor="NeuroDebian"
+vm_version="6.0.0"
+vm_arch="amd64"
+vm_name="${vendor} ${vm_version} (${vm_arch})"
+product_name="${vendor} VirtualMachine (${vm_arch})"
+outdir=.
+
+# Common
+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."
+
+out_ovf="${outdir}/${vendor}_${vm_version}_${vm_arch}.ovf"
+VBoxManage export "${vm_name}" -o "$out_ovf" \
+       --vsys 0 \
+       --product "$vm_name" \
+       --producturl "http://neuro.debian.net/vm.html" \
+       --vendor "${vendor}" \
+       --vendorurl "http://neuro.debian.net" \
+       --version "$vm_version" \
+       --eula "$eula"