]> git.donarmstrong.com Git - neurodebian.git/blob - tools/nd-vmsetupwizard
Install custom synaptics filter for NeuroDebian.
[neurodebian.git] / tools / nd-vmsetupwizard
1 #!/bin/bash
2 #emacs: -*- mode: shell-script; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
3 #ex: set sts=4 ts=4 sw=4 et:
4
5 # play save
6 set -e
7 set -u
8
9 cfg_dir=/etc/neurodebian/guest/setupwizard_done
10 success_flag=$cfg_dir/setupwizard_done
11 nd_icon=/usr/share/pixmaps/neurodebian.svg
12 icon_opt="--window-icon=$nd_icon"
13
14 first_run=0
15 if [ ! -e $success_flag ]; then
16         first_run=1
17 fi
18
19 if [ $first_run -eq 1 ]; then
20 zenity --info $icon_opt --title="NeuroDebian Setup Wizard" \
21        --text="Welcome to the NeuroDebian virtual machine!
22
23 This is the first time you have started this virtual machine. We will now perform a few simple steps to finalize its configuration. This includes upgrading the system to the latest available versions and installing additional software packages upon your request."
24
25 # install custom filter for synaptics
26 sudo mkdir -p /root/.synaptic
27 sudo cat << EOT >> /root/.synaptic/filters
28 filter "NeuroDebian" {
29   section {
30     inclusive false;
31     sections {
32     };
33   };
34   status {
35     flags 0x1ffff;
36   };
37   pattern {
38     andMode 0;
39     patterns {
40       Origin; "neuro.debian.net"; false;
41       Maintainer; "team@neuro.debian.net"; false;
42     };
43   };
44   priority {
45   };
46   reducedview {
47     enabled false;
48   };
49 };
50 EOT
51 fi
52
53 if ! zenity --question $icon_opt --title="NeuroDebian Setup Wizard" \
54 --text="The setup procedure requires network access to download packages from the Debian archive. If you do not have network access right now, you can re-start this wizard at any time from the NeuroDebian menu.
55
56 Do you want to proceed with updating the system?
57 "; then
58         exit 0
59 fi
60
61 # initialize apt
62 update-manager -c
63
64 if [ ! -e /etc/popularity-contest.conf ]; then
65         zenity --info $icon_opt --title="NeuroDebian Setup Wizard" \
66                 --text="You will now be given the choice to participate in the package survey. If enabled, a list of installed packages will be anonymously sent to Debian (http://popcon.debian.org). Your participation is important for two reasons:
67
68 1) Popular packages receive more attention from developers, bugs are fixed faster and updates are provided quicker.
69 2) User statistics can help research software developers to acquire funding for continued development."
70
71         # install, but do not fail if something goes wrong
72         nd-autoinstall popularity-contest /etc/popularity-contest.conf || true
73 fi
74
75 # essential things are done -- let's mark sucess
76 if [ $first_run -eq 1 ]; then
77         sudo bash -c "mkdir -p $cfg_dir && touch $success_flag"
78 fi
79
80 packages=$(zenity --list --checklist --column="Install" --column="Description" \
81            --column="Package Name" --print-column=3 --hide-column=3 --hide-header \
82            --separator=' ' --text="Please select any additional component that shall be installed.
83
84 Please note that this selection will not affect packages already installed
85 on the system. No installed packages will be reinstalled or removed, only
86 additional components will be installed." \
87 FALSE "Emacs" "emacs" \
88 FALSE "OpenOffice.org" "openoffice.org" \
89 FALSE "Scientific Python" "ipython,python-numpy,python-matplotlib" \
90 FALSE "TeX Live" "texlive" \
91 FALSE "Adobe Flash browser plugin" "flashplugin-nonfree" \
92 FALSE "Sun Java browser plugin" "sun-java6-plugin" \
93 || true)
94
95 if [ -n "$packages" ]; then
96         for pkgs in $packages; do
97                 nd-autoinstall -f -p "${pkgs//,/ }" true
98         done
99 fi
100
101 # and start greeter
102 x-www-browser http://neuro.debian.net/vm_welcome.html &