home · contact · privacy
6a655d92ee20b6dce8a3a02b9faf849b7c2b6d5c
[config] / jessie_start.sh
1 #!/bin/sh
2 set -x
3 set -e
4
5 # Post-installation reduction. (Answer "no" to GRUB question.)
6 dpkg-query -Wf '${Package} ${Priority}\n' | grep ' required' | sed 's/ required//' > list_white_unsorted 
7 echo 'ifupdown' >> list_white_unsorted 
8 echo 'isc-dhcp-client' >> list_white_unsorted
9 sort list_white_unsorted > list_white
10 dpkg-query -Wf '${Package}\n' > list_all_packages
11 sort list_all_packages > foo
12 mv foo list_all_packages
13 comm -3 list_all_packages list_white > list_black
14 apt-mark auto `cat list_black`
15 echo 'APT::AutoRemove::RecommendsImportant "false";' > /etc/apt/apt.conf.d/99mindeps
16 echo 'APT::AutoRemove::SuggestsImportant "false";' >> /etc/apt/apt.conf.d/99mindeps 
17 DEBIAN_FRONTEND=noninteractive apt-get -y --purge autoremove
18 rm list_all_packages list_white_unsorted list_white list_black 
19 echo 'APT::Install-Recommends "false";' >> /etc/apt/apt.conf.d/99mindeps
20 echo 'APT::Install-Suggests "false";' >> /etc/apt/apt.conf.d/99mindeps
21
22 # Package management config, system upgrade.
23 echo 'deb http://ftp.debian.org/debian/ jessie main contrib non-free' > /etc/apt/sources.list
24 echo 'deb http://security.debian.org/ jessie/updates main contrib non-free' >> /etc/apt/sources.list
25 echo 'deb http://ftp.debian.org/debian/ jessie-updates main contrib non-free' >> /etc/apt/sources.list
26 dhclient eth0
27 apt-get update
28 apt-get -y dist-upgrade
29
30 # Don't clear boot messages on start up.
31 sed -i 's/^TTYVTDisallocate=yes$/TTYVTDisallocate=no/g' /etc/systemd/system/getty.target.wants/getty\@tty1.service
32
33 # Console config.
34 DEBIAN_FRONTEND=nointeractive apt-get -y install locales console-setup
35 echo 'ACTIVE_CONSOLES="/dev/tty[1-6]"' > /etc/default/console-setup
36 echo 'CHARMAP="UTF-8"' >> /etc/default/console-setup
37 echo 'CODESET="Lat15"' >> /etc/default/console-setup
38 echo 'FONTFACE="TerminusBold"' >> /etc/default/console-setup
39 echo 'FONTSIZE="8x16"' >> /etc/default/console-setup
40 echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen
41 locale-gen
42 echo 'export LC_ALL="en_US.UTF-8"' >> /etc/profile
43
44 # Clone git repository.
45 apt-get -y install ca-certificates
46 apt-get -y install git
47 git clone http://github.com/plomlompom/config
48 config/symlink.sh
49
50 # Add user. Remove old user's config/ if it exists.
51 useradd -m -s /bin/bash plom
52 rm -rf /home/plom/config
53 su - plom -c 'git clone http://github.com/plomlompom/config /home/plom/config'
54 su plom -c /home/plom/config/symlink.sh
55
56 # Set up window system.
57 apt-get -y install xserver-xorg xinit xterm i3 i3status
58
59 # Set up manuals.
60 apt-get -y install man-db manpages less
61
62 # Clean up.
63 rm jessie_start.sh
64
65 # Set password for user.
66 passwd plom