home · contact · privacy
ad3b3a93e4e84adef0f4b0a065049a5f889f4a32
[config] / buster / setup_scripts / setup.sh
1 #!/bin/sh
2 set -e
3
4 # Provide maximum input for set_hostname_and_fqdn.sh.
5 if [ "$#" -ne 2 ]; then
6     echo 'Need exactly two arguments (hostname, FQDN).'
7     false
8 fi
9 hostname="$1"
10 fqdn="$2"
11
12 config_tree_prefix="${HOME}/config/buster"
13 setup_scripts_dir="${config_tree_prefix}/setup_scripts"
14 cd "${setup_scripts_dir}"
15
16 # Adapt /etc/ to our needs by copying from ./etc_files. This will set
17 # basic configurations affecting following steps, such as setup of APT
18 # and the locale selection, so needs to be right at the beginning.
19 ./copy_dirtree.sh "${config_tree_prefix}/etc_files" "" all
20
21 # Set hostname and FQDN.
22 ./set_hostname_and_fqdn.sh "${hostname}" "${fqdn}"
23
24 # Ensure package installation state as defined by what packages are
25 # defined as required by Debian policy and by settings in ./apt-mark/.
26 apt update
27 ./install_for_target.sh all
28 ./purge_nonrequireds.sh all
29
30 # Ensure our desired locale is available.
31 locale-gen
32
33 # Only upgrade after reducing the system to the desired minimum, so that
34 # we don't need to get more data than necessary.
35 apt -y dist-upgrade
36
37 # Set Berlin localtime.
38 ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime