shift 1
     modules="$@"
     for module in "${modules}"; do
-        path="${aptmark_dir}/${module}"
+        path="${apt_mark_dir}/${module}"
         if [ ! -f "${path}" ]; then
             continue
         fi
 }
 
 mark_nonrequireds_auto() {
-    path_list_unsorted="/tmp/list_unsorted"
-    path_list_all_packages="/tmp/list_all_packages"
-    path_list_white="/tmp/list_white"
-    path_list_black="/tmp/list_black"
+    path_list_unsorted='/tmp/list_unsorted'
+    path_list_all_packages='/tmp/list_all_packages'
+    path_list_white='/tmp/list_white'
+    path_list_black='/tmp/list_black'
     dpkg-query -Wf '${Package} ${Priority}\n' | grep ' required' | sed 's/ required//' > "${path_list_unsorted}"
     sort "${path_list_unsorted}" | uniq > "${path_list_white}"
     dpkg-query -Wf '${Package}\n' > "${path_list_unsorted}"
-    sort "${path_list_unsorted}" | uniq > "${path_list_all_packages}" 
+    sort "${path_list_unsorted}" | uniq > "${path_list_all_packages}"
     comm -3 "${path_list_all_packages}" "${path_list_white}" > "${path_list_black}"
     apt-mark auto `cat "${path_list_black}"`
-    rm "${path_list_unsorted}" "${path_list_all_packages}" "${path_list_white}" "${path_list_white}"
+    rm "${path_list_unsorted}" "${path_list_all_packages}" "${path_list_white}" "${path_list_black}"
+}
+
+upgrade_from_older_release() {
+    # Upgrade system to calling context's Debian release.
+    # Caution: Don't expect any customized /etc files to surivive this!
+    path_sources_list='/etc/apt/sources.list'
+    apt update
+    apt -y -o Dpkg::Options::='--force-confnew' upgrade
+    apt -y -o Dpkg::Options::='--force-confnew' full-upgrade
+    cp "../etc/all${path_sources_list}" "${path_sources_list}"
+    apt clean
+    apt update
+    apt -y -o Dpkg::Options::='--force-confnew' upgrade
+    apt -y -o Dpkg::Options::='--force-confnew' full-upgrade
+    apt -y autoremove
 }
 
--- /dev/null
+# connectivity: ifupdown seems necessary everyhwere, isc-dhcp-client
+# unpredictably so
+ifupdown
+isc-dhcp-client
+# git for the setup directory; cloning works with ca-certificates
+ca-certificates
+git
+# to avoid constant warnings about no locale being found
+locales
+# extremely useful for basic network debugging; missed these more than once in an emergency
+netcat-traditional
+iputils-ping
+
 
 rm "${FILENAME_PUBLIC_KEY}" 
 # service sshd restart
 
+upgrade_from_older_release
+
 # properly apt system
 for root in "${PATH_MANY}" '..'; do
-    copy_dirtree "${root}/${NAME_ETC_DIR}" "" all
+    copy_dirtree "${root}/${NAME_ETC_DIR}" "" all raspi
 done
 apt update
 mark_nonrequireds_auto
 for root in "${PATH_MANY}" '..'; do
-    install_for_modules "${root}/${NAME_APTMARK_DIR}" all
+    install_for_modules "${root}/${NAME_APTMARK_DIR}" all raspi
 done
 apt -y --purge autoremove
-apt -y -o Dpkg::Options::='--force-confnew' upgrade
-apt -y -o Dpkg::Options::='--force-confnew' full-upgrade
+
+# TODO test if isc-dhcp-client necessary (ifupdown certainly is)
 
 # Ensure our desired locale is available.
 # locale-gen