]> git.donarmstrong.com Git - neurodebian.git/blob - vm/d-i/tools/initial_setup
da4cb1bce61acfa9de070a145fb0fe287230e39b
[neurodebian.git] / vm / d-i / tools / initial_setup
1 #!/bin/bash
2
3 # play safe
4 set -e
5 set -u
6
7 # Standard Debian install
8
9 # prepare on hydra and use debproxy for speed
10
11 # have dedicated hard-drives for swap and home
12
13 # expert install
14
15 # hostname: neurodebian
16 # domain: ''
17
18 # Needs to be assured since it got reset to debian
19 hostname neurodebian
20 sed -i -e 's/^127\.0\.1\.1.*/127.0.1.1\tneurodebian/g' /etc/hosts
21
22 # all file in one partition
23
24 # root: not there
25 # user: brain
26 # pwd: neurodebian
27
28
29 # Do a minimal install
30 # --------------------
31
32 # All files in one partition/
33 # just base system, run selection, but no tasks (not even 'Standard system')
34
35 # set root password to 'neurodebian' too
36 #echo "Set root passwd:"
37 #passwd root
38
39 apt-get install --no-install-recommends -y etckeeper
40
41 # setup etckeeper
42 git config --global user.name NeuroDebian
43 git config --global user.email nd@localhost
44
45 # install new stuff
46 # -----------------
47
48 # Add sources.list for backports and neurodebian
49 wget -O /etc/apt/sources.list.d/neuro.debian.net.list http://neuro.debian.net/_static/neurodebian.squeeze.us-nh.sources.list
50
51 echo "deb http://backports.debian.org/debian-backports squeeze-backports main contrib non-free" > /etc/apt/sources.list.d/backports.debian.org.list
52 cat << EOT > /etc/apt/preferences.d/backports.debian.org.pref
53 Package: *
54 Pin: release a=squeeze-backports
55 Pin-Priority: 200
56 EOT
57
58 apt-get update -y
59 # Backports' Release files signed with both ftpmaster and old backports keys
60 # That causes APT to spit out a warning, but to not confuse users, lets simply
61 # obtain that key if possible
62 gpg --keyserver hkp://subkeys.pgp.net --recv-keys 16BA136C && \
63         gpg --export 16BA136C | apt-key add - || :
64
65 apt-get install -y --allow-unauthenticated neurodebian-keyring
66 apt-get update -y
67
68 # to cheat the VM check
69 touch /dev/vboxguest
70 # to get all the stuff in recommends
71 apt-get install -y dkms neurodebian-guest-additions
72
73 apt-get install --no-install-recommends -y \
74  gnome-core mc evince bash-completion ntpdate file-roller gnome-utils \
75  gnome-themes eog vim \
76  software-center gdebi gedit-plugins gnome-media synaptic menu less libxp6
77
78 # intermediate cleanup to prevent virtual harddrive from fragmenting too much
79 find /var/cache/apt/archives/ -name '*.deb' -delete
80
81 # cleanup unwanted stuff
82 # video drivers (all but vesa)
83 apt-get purge -y $(apt-cache search --names-only --installed xserver-xorg-video | grep xserver-xorg-video | cut -d ' ' -f 1,1) xserver-xorg-video-vesa+
84 apt-get purge -y brasero
85
86 # and whatever is obsolete
87 apt-get autoremove --purge -y
88
89 # custom config
90 # use NeuroDebian website as default homepage
91 sed -i -e 's,http://www.debian.org,http://neuro.debian.net,g' /etc/chromium-browser/master_preferences
92
93 # reduce grub timeout to speed up boot of VM
94 sed -i -e 's/GRUB_TIMEOUT=5/GRUB_TIMEOUT=1/g' /etc/default/grub
95 update-grub
96
97 # finally configure geomirror for APT and disable deb-src lists
98 sed -i -e "s/10.0.0.1:9999/$(dpkg --print-architecture)-geomirror.debian.net/" \
99     -e "s/^deb-src/#deb-src/" /etc/apt/sources.list
100
101 etckeeper commit "Initial VM setup done"
102
103 # Create a link to automatically mounted Shared folder
104 # Created by the Welcome Wizard
105 #sudo -u brain ln -s /mnt/host /home/brain/