X-Git-Url: https://plomlompom.com/repos/foo.html?a=blobdiff_plain;f=bookworm%2Fsetup_scripts%2Fsetup.sh;fp=bookworm%2Fsetup_scripts%2Fsetup.sh;h=815683edbd91051da2c0eb9e20128a06bfda986c;hb=f50c2ff925fb389818dcb23a684acc0275821a36;hp=0000000000000000000000000000000000000000;hpb=be700ff9e26fbe05a6e70d50ca636c22b0f741fe;p=config diff --git a/bookworm/setup_scripts/setup.sh b/bookworm/setup_scripts/setup.sh new file mode 100755 index 0000000..815683e --- /dev/null +++ b/bookworm/setup_scripts/setup.sh @@ -0,0 +1,40 @@ +#!/bin/sh +set -e +debian_version="bookworm" + +# Provide maximum input for set_hostname_and_fqdn.sh. +if [ "$#" -lt 2 ]; then + echo 'Need at least two arguments (hostname, FQDN).' + false +fi +hostname="$1" +fqdn="$2" +shift 2 + +config_tree_prefix="${HOME}/config/${debian_version}" +setup_scripts_dir="${config_tree_prefix}/setup_scripts" +cd "${setup_scripts_dir}" + +# Adapt /etc/ to our needs by copying from ./etc_files. This will set +# basic configurations affecting following steps, such as setup of APT +# and the locale selection, so needs to be right at the beginning. +./copy_dirtree.sh "${config_tree_prefix}/etc_files" "" all "$@" + +# Set hostname and FQDN. +./set_hostname_and_fqdn.sh "${hostname}" "${fqdn}" + +# Ensure package installation state as defined by what packages are +# defined as required by Debian policy and by settings in ./apt-mark/. +apt update +./install_for_target.sh all "$@" +./purge_nonrequireds.sh all "$@" + +# Ensure our desired locale is available. +locale-gen + +# Only upgrade after reducing the system to the desired minimum, so that +# we don't need to get more data than necessary. +apt -y dist-upgrade + +# Set Berlin localtime. +ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime