From: Christian Heller Date: Thu, 1 May 2025 04:22:41 +0000 (+0200) Subject: Fix. X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/%22https:/validator.w3.org/todo?a=commitdiff_plain;h=f036e0f18c971a1f266393401693f3f35b7a0041;p=config Fix. --- diff --git a/bookworm/aptmark/server_basic b/bookworm/aptmark/server_basic new file mode 100644 index 0000000..ade9652 --- /dev/null +++ b/bookworm/aptmark/server_basic @@ -0,0 +1,7 @@ +# so we can log in at all … +openssh-server +# necessary on _some_ vservers +net-tools +quota +# + diff --git a/bookworm/scripts/lib/minimize_installation b/bookworm/scripts/lib/minimize_installation new file mode 100644 index 0000000..26006ca --- /dev/null +++ b/bookworm/scripts/lib/minimize_installation @@ -0,0 +1,35 @@ +. lib/apt_get_edited +. lib/ensure_packages_of_tags + +minimize_installation() { + _INSTALL_TAGS="$@" + + echo '### minimize_installation: narrow system to what's required explicitly by us and Debian' + _PATH_LIST_PREFIX=/tmp/list_ + _TOK_REQ=' required' + + echo "# Collect packages deemed '${_TOK_REQ}' by Debian: " + _PATH_LIST_UNSORTED="${_PATH_LIST_PREFIX}unsorted" + dpkg-query -Wf '${Package} ${Priority}\n' | grep "${_TOK_REQ}" | cut -d' ' -f1 > "${_PATH_LIST_UNSORTED}" + _PATH_LIST_WHITE="${_PATH_LIST_PREFIX}white" + sort "${_PATH_LIST_UNSORTED}" > "${_PATH_LIST_WHITE}" + echo $(cat "${_PATH_LIST_WHITE}) + + echo -n '# Collect installed packages outside this selection: ' + dpkg-query -Wf '${Package}\n' > "${_PATH_LIST_UNSORTED}" + _PATH_LIST_ALL_PACKAGES="${_PATH_LIST_PREFIX}all_packages" + sort "${_PATH_LIST_UNSORTED}" > "${_PATH_LIST_ALL_PACKAGES}" + _PATH_LIST_BLACK="${_PATH_LIST_PREFIX}black" + comm -3 "${_PATH_LIST_ALL_PACKAGES}" "${_PATH_LIST_WHITE}" > "${_PATH_LIST_BLACK}" + echo $(cat "${_PATH_LIST_BLACK}) + + echo '# apt-mark auto packages from diff …' + apt-mark auto `cat "${_PATH_LIST_BLACK}"` > /dev/null + rm "${_PATH_LIST_UNSORTED}" "${_PATH_LIST_ALL_PACKAGES}" "${_PATH_LIST_WHITE}" "${_PATH_LIST_BLACK}" + + echo '# install or mark as manually installed packages from our own selections …' + ensure_packages_of_tags ${_INSTALL_TAGS} + + echo '# run autopurge to get rid of all unwanted packages …' + apt_get_edited '-q -q autopurge' +} diff --git a/trixie/aptmark/all_old b/trixie/aptmark/all_old new file mode 120000 index 0000000..1913f5e --- /dev/null +++ b/trixie/aptmark/all_old @@ -0,0 +1 @@ +../../bookworm/aptmark/all \ No newline at end of file diff --git a/trixie/aptmark/server_basic_old b/trixie/aptmark/server_basic_old new file mode 120000 index 0000000..13ab3c2 --- /dev/null +++ b/trixie/aptmark/server_basic_old @@ -0,0 +1 @@ +../../bookworm/aptmark/server_basic \ No newline at end of file