expect_min_n_args 1 "(system name)" "$@"
get_system_name_arg "$1"
-min_modules="all ${system_class_name} ${system_name}"
+MIN_MODULES="all ${system_class_name} ${system_name}"
-# 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 "${config_tree_prefix}/${PATH_REL_ETC}" "" ${min_modules}
-
-# Migrate to testing.
-upgrade_from_older_release
+# For upgrading only very selectively prepare /etc/ files.
+PATH_REL_APT_CONF=apt/apt.conf
+PATH_REL_SOURCES_LIST=apt/sources.list
+cp ${PATH_MANY}/${PATH_REL_ETC}/all/${PATH_REL_APT_CONF}/* /${PATH_REL_ETC}/${PATH_REL_APT_CONF}/
+apt update
+apt -y -o Dpkg::Options::='--force-confnew' upgrade
+apt -y -o Dpkg::Options::='--force-confnew' full-upgrade
+cp ../${PATH_REL_ETC}/all/${PATH_REL_SOURCES_LIST}/* /${PATH_REL_ETC}/
+apt clean
+apt update
+apt -y -o Dpkg::Options::='--force-confnew' upgrade
+apt -y -o Dpkg::Options::='--force-confnew' full-upgrade
+apt -y autoremove
# Set hostname and FQDN.
echo "${system_name}" > /etc/hostname
apt-mark hold linux-image-amd64 linux-headers-amd64
fi
for root in "${PATH_MANY}" '..'; do
- install_for_modules "${root}/${PATH_REL_APTMARK}" ${min_modules}
+ install_for_modules "${root}/${PATH_REL_APTMARK}" ${MIN_MODULES}
done
apt -y --purge autoremove
+
+# Adapt /etc/ to our needs.
for root in "${PATH_MANY}" '..'; do
- copy_dirtree "${root}/${PATH_REL_ETC}" '/etc' ${min_modules}
+ copy_dirtree "${root}/${PATH_REL_ETC}" '/etc' ${MIN_MODULES}
done
# Ensure our desired locale is available.
# Set up root environment.
for root in "${PATH_MANY}" '..'; do
- copy_dirtree "${root}/${PATH_REL_HOME}" '/root' ${min_modules} minimal root
+ copy_dirtree "${root}/${PATH_REL_HOME}" '/root' ${MIN_MODULES} minimal root
done
# Set up user and their environment.
adduser --disabled-password --gecos "" "${USERNAME}"
usermod -a -G sudo "${USERNAME}"
for root in "${PATH_MANY}" '..'; do
- copy_dirtree "${root}/${PATH_REL_HOME}" "${PATH_USER_HOME}" ${min_modules} desktop
+ copy_dirtree "${root}/${PATH_REL_HOME}" "${PATH_USER_HOME}" ${MIN_MODULES} desktop
done
chown -R "${USERNAME}:${USERNAME}" "${PATH_USER_HOME}"
passwd "${USERNAME}"