7 # Standard Debian install
9 # prepare on hydra and use debproxy for speed
11 # have dedicated hard-drives for swap and home
15 # hostname: neurodebian
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
23 # all file in one partition
30 # Do a minimal install
31 # --------------------
33 # All files in one partition/
34 # just base system, run selection, but no tasks (not even 'Standard system')
36 # set root password to 'neurodebian' too
37 #echo "Set root passwd:"
40 apt-get install --no-install-recommends -y etckeeper
43 git config --global user.name NeuroDebian
44 git config --global user.email nd@localhost
49 # Add sources.list for backports and neurodebian
50 wget -O /etc/apt/sources.list.d/neuro.debian.net.list http://neuro.debian.net/lists/wheezy.us-nh
53 ## echo "deb http://backports.debian.org/debian-backports wheezy-backports main contrib non-free" > /etc/apt/sources.list.d/backports.debian.org.list
54 cat << EOT > /etc/apt/preferences.d/backports.debian.org.pref
56 Pin: release a=wheezy-backports
61 # Backports' Release files signed with both ftpmaster and old backports keys
62 # That causes APT to spit out a warning, but to not confuse users, lets simply
63 # obtain that key if possible
64 gpg --keyserver hkp://subkeys.pgp.net --recv-keys 16BA136C && \
65 gpg --export 16BA136C | apt-key add - || :
67 apt-get install -y --allow-unauthenticated neurodebian-keyring
70 # to cheat the VM check
73 # Assure that corresponding linux headers are installed since otherwise they
74 # might not be. There is also a dichotomy between target 686 and installer
75 # using 486 build of the kernel. It requires manual build/installation
76 # of guest additions for 686 at this point. Hence all the ugly logic below
80 [ $cdarch = '486' ] && darch='686' || darch=$cdarch
81 apt-get install -y linux-headers-2.6-$cdarch
83 ## # Forcefully install guest additions from backports so we are
84 ## # compatible with VirtualBox 4.x series
85 ## apt-get install -y -t wheezy-backports virtualbox-ose-guest-dkms \
86 ## virtualbox-ose-guest-utils virtualbox-ose-guest-x11 \
87 ## >| /var/log/initial_setup-dkms.log 2>&1
89 # to get all the rest stuff in recommends
90 apt-get install -y dkms
91 # TODO: neurodebian-guest-additions
93 if [ "$darch" != "$cdarch" ] ; then
94 # Because DKMS builds for currently running kernel, which during
95 # installation might be a more generic 486, lets force building for 686
96 # and also install necessary headers (will be purged later on anyways)
97 apt-get install -y linux-headers-2.6-$darch
99 unamer=${cunamer//$cdarch/$darch}
100 # First collect information about installed vb additions
101 vbg=( `dkms status | grep virtualbox | head -n 1 | tr ',' ' '` )
102 echo "I: forcing build and install of guest additions for 686"
103 dkms build -m ${vbg[0]} -v ${vbg[1]} -a i686 -k $unamer \
104 >| /var/log/initial_setup-dkms-686-build.log 2>&1
105 dkms install -m ${vbg[0]} -v ${vbg[1]} -a i686 -k $unamer \
106 >| /var/log/initial_setup-dkms-686-install.log 2>&1
109 # Add brain use into vboxsf group so he gets access to shared folders
113 # assure at the end that we got right modules build in the right location
114 find /lib/modules/*$darch -iname vboxsf.ko | grep -q .
117 # apt-get install --no-install-recommends -y \
118 # gnome-core mc evince bash-completion ntpdate file-roller gnome-utils \
119 # gnome-themes gnome-disk-utility network-manager-gnome eog vim reportbug \
120 # software-center gdebi gedit-plugins gnome-media synaptic menu less libxp6
122 apt-get install --no-install-recommends -y \
123 mc evince bash-completion ntpdate file-roller \
125 software-center synaptic menu less libxp6 \
126 task-xfce-desktop lightdm \
128 sudo neurodebian-desktop update-notifier
130 # XXX last ones are actually pulled it by neurodebian-guest-additions whenever we
131 # resolve their destiny ;-) a;though it might be pooling too much, eg exim4
133 # TODO: autologin for lightdm (autologin-user=brain in /etc/lightdm/lightdm.conf), default panel (with chromium) for xfce
135 # Clean-up installed development files which got pulled in for
136 # VM guest additions (to build kernel modules via DKMS)
137 apt-get purge -y libc6-dev
138 dpkg -l | awk '/^ii.*[ \t]linux-headers/{print $2;}' | xargs -r apt-get purge -y
140 # Gnome optional pulled by gnome-core:
141 apt-get purge -y gnome-core evolution-common evolution libevolution
144 apt-get -y autoremove
146 # intermediate cleanup to prevent virtual harddrive from fragmenting too much
147 find /var/cache/apt/archives/ -name '*.deb' -delete
149 # cleanup unwanted stuff
150 # video drivers (all but vesa)
151 apt-get purge -y --force-yes $(apt-cache search --names-only --installed xserver-xorg-video | grep xserver-xorg-video | cut -d ' ' -f 1,1) xserver-xorg-video-vesa+
152 apt-get purge -y brasero
154 # and whatever is obsolete
155 apt-get autoremove --purge -y
158 # use NeuroDebian website as default homepage
159 sed -i -e 's,http://www.debian.org,http://neuro.debian.net,g' /etc/chromium*/master_preferences
161 # reduce grub timeout to speed up boot of VM
162 sed -i -e 's/GRUB_TIMEOUT=5/GRUB_TIMEOUT=1/g' /etc/default/grub
165 # finally configure geomirror for APT and disable deb-src lists
166 sed -i -e "s/10.0.0.1:9999/$(dpkg --print-architecture)-geomirror.debian.net/" \
167 -e "s/^deb-src/#deb-src/" /etc/apt/sources.list
169 etckeeper commit "Initial VM setup done"
171 # Create a link to automatically mounted Shared folder
172 # Created by the Welcome Wizard
173 #sudo -u brain ln -s /mnt/host /home/brain/