home · contact · privacy
792a80754fac5013e5c86af17f36738045523704
[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 # Some debconf selections we don't want to get asked during coming
25 # install actions.
26 echo 'libc6:amd64 libraries/restart-without-asking boolean true' | debconf-set-selections
27
28 # Ensure package installation state as defined by what packages are
29 # defined as required by Debian policy and by settings in ./apt-mark/.
30 apt update
31 ./install_for_target.sh all
32 ./purge_nonrequireds.sh all
33
34 # Ensure our desired locale is available.
35 locale-gen
36
37 # Only upgrade after reducing the system to the desired minimum, so that
38 # we don't need to get more data than necessary.
39 apt -y dist-upgrade
40
41 # Set Berlin localtime.
42 ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime