home · contact · privacy
b64080c3b5315f73aa500d013e43447f8e49ff4a
[config] / bookworm / setup_scripts / setup.sh
1 #!/bin/sh
2 set -e
3 debian_version="bookworm"
4 . ./misc.sh
5
6 # Provide maximum input for set_hostname_and_fqdn.sh.
7 if [ "$#" -lt 2 ]; then
8     echo 'Need at least two arguments (hostname, FQDN).'
9     false
10 fi
11 hostname="$1"
12 fqdn="$2"
13 shift 2
14
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