home · contact · privacy
Overhaul upgrading. master
authorChristian Heller <c.heller@plomlompom.de>
Tue, 25 Feb 2025 07:29:29 +0000 (08:29 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Tue, 25 Feb 2025 07:29:29 +0000 (08:29 +0100)
testing/scripts/setup_desktop.sh

index c0170955c752b69f0f0358830da3e3fe2c1f97e6..f909034b044a8bee75199bc211baa820c5d57d94 100755 (executable)
@@ -5,15 +5,21 @@ set -x
 
 expect_min_n_args 1 "(system name)" "$@"
 get_system_name_arg "$1"
 
 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
 
 # Set hostname and FQDN.
 echo "${system_name}" > /etc/hostname
@@ -51,11 +57,13 @@ if [ "$system_name" = "h610m" ]; then
     apt-mark hold linux-image-amd64 linux-headers-amd64
 fi
 for root in "${PATH_MANY}" '..'; do
     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
 done
 apt -y --purge autoremove
+
+# Adapt /etc/ to our needs.
 for root in "${PATH_MANY}" '..'; do
 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.
 done
 
 # Ensure our desired locale is available.
@@ -67,14 +75,14 @@ ntpdate-debian
 
 # Set up root environment.
 for root in "${PATH_MANY}" '..'; do
 
 # 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
 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}"
 done
 chown -R "${USERNAME}:${USERNAME}" "${PATH_USER_HOME}"
 passwd "${USERNAME}"