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