1 |
#!/bin/sh |
2 |
# |
3 |
# Copyright (C) 2013 Daniel Francis <francis@sugarlabs.org> |
4 |
# |
5 |
# This program is free software; you can redistribute it and/or modify |
6 |
# it under the terms of the GNU General Public License as published by |
7 |
# the Free Software Foundation; either version 3 of the License, or |
8 |
# (at your option) any later version. |
9 |
# |
10 |
# This program is distributed in the hope that it will be useful, |
11 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 |
# GNU General Public License for more details. |
14 |
# |
15 |
# You should have received a copy of the GNU General Public License |
16 |
# along with this program; if not, write to the Free Software |
17 |
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
18 |
# MA 02110-1301, USA. |
19 |
|
20 |
configure_apt () { |
21 |
echo "###############" |
22 |
echo "Configuring APT" |
23 |
echo "###############" |
24 |
apt-get update |
25 |
echo "##### OK #####" |
26 |
} |
27 |
|
28 |
install_packages () { |
29 |
echo "###############################################" |
30 |
echo "Installing packages required to run Sugar-build" |
31 |
echo "###############################################" |
32 |
apt-get -y install ssh git python sudo time locales dialog python-apt |
33 |
echo "##### OK #####" |
34 |
echo "##################" |
35 |
echo "Generating locales" |
36 |
echo "##################" |
37 |
locale-gen $LANG |
38 |
echo "##### OK #####" |
39 |
} |
40 |
|
41 |
create_user () { |
42 |
echo "#################" |
43 |
echo "Creating new user" |
44 |
echo "#################" |
45 |
mkdir /home/sugar |
46 |
useradd -g sudo -d /home/sugar -s /bin/bash sugar |
47 |
chown sugar /home/sugar |
48 |
passwd sugar |
49 |
echo "##### OK #####" |
50 |
} |
51 |
|
52 |
disable_upstart () { |
53 |
dpkg-divert --local --rename --add /sbin/initctl |
54 |
ln -s /bin/true /sbin/initctl |
55 |
} |
56 |
|
57 |
configure_apt |
58 |
install_packages |
59 |
create_user |
60 |
disable_upstart |
61 |
|
62 |
su sugar sugar-build-clone.sh |