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