#!/bin/sh
set -e
-set -x
. ./_misc.sh
expect_min_n_args 1 "(system name)" "$@"
get_system_name_arg "$1"
MIN_MODULES="all ${SYSTEM_CLASS_NAME} ${SYSTEM_NAME}"
-echo "Upgrading to testing."
+echo "\nUpgrading to testing."
# For this step only very selectively prepare /etc/ files.
PATH_REL_APT=apt
PATH_REL_APT_CONF=${PATH_REL_APT}/apt.conf.d
apt -y -o Dpkg::Options::='--force-confnew' full-upgrade
apt -y autoremove
-echo "Setting hostname and FQDN."
+echo "\nSetting hostname and FQDN."
echo "${SYSTEM_NAME}" > /etc/hostname
hostname "${SYSTEM_NAME}"
final_ip="127.0.1.1"
echo "127.0.0.1 localhost.localdomain localhost" > /etc/hosts
echo "${final_ip} ${SYSTEM_NAME}" >> /etc/hosts
-echo "Installing and/or keeping only what's required by us or Debian."
+echo "\nInstalling and/or keeping only what's required by us or Debian."
# Ensure package installation state as defined by what packages are
# defined as required by Debian policy and by settings in ./apt-mark/.
mark_nonrequireds_auto
done
apt -y --purge autoremove
-echo "Checking for existing wifi config in ${PATH_NETWORK_INTERFACES}."
+echo "\nChecking for existing wifi config in ${PATH_NETWORK_INTERFACES}."
# NB: This needs to come before steps potentially overwriting /etc/network/interfaces.
PATH_NETWORK_INTERFACES=/etc/network/interfaces
get_network_interfaces_last_wpa_value() {
fi
fi
-echo "Adapting /etc to our needs."
+echo "\nAdapting /etc to our needs."
for root in $ROOTS_HERE_AND_MANY; do
copy_dirtree "${root}/${PATH_REL_ETC}" '/etc' ${MIN_MODULES} user desktop
done
-echo "Ensuring our desired locale is available."
+echo "\nEnsuring our desired locale is available."
locale-gen
-echo "Setting Berlin localtime."
+echo "\nSetting Berlin localtime."
ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
ntpdate-debian
-echo "Setting up root user's home directory."
+echo "\nSetting up root user's home directory."
for root in $ROOTS_HERE_AND_MANY; do
copy_dirtree "${root}/${PATH_REL_HOME}" '/root' ${MIN_MODULES} minimal root
done
-echo "Setting up user ${USERNAME}."
+echo "\nSetting up user ${USERNAME}."
adduser --disabled-password --gecos "" "${USERNAME}"
usermod -a -G sudo "${USERNAME}"
for root in $ROOTS_HERE_AND_MANY; do