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