armbian-next: chroot_sdcard_apt_get_update() to replace and better log chroot_sdcard_apt_get update

- also add retries where it was missing
- @TODO: desktop_postinstall() is a mess, needs aggregation work
This commit is contained in:
Ricardo Pardini
2023-01-17 04:02:02 +01:00
parent 2455c55dac
commit a6a5152695
4 changed files with 15 additions and 10 deletions

View File

@@ -20,6 +20,10 @@ function chroot_sdcard_apt_get_install_dry_run() {
chroot_sdcard_apt_get --no-install-recommends --dry-run install "$@" "${logging_filter}"
}
function chroot_sdcard_apt_get_update() {
apt_logging="-q" chroot_sdcard_apt_get update
}
function chroot_sdcard_apt_get_remove() {
DONT_MAINTAIN_APT_CACHE="yes" chroot_sdcard_apt_get remove "$@"
}
@@ -27,7 +31,7 @@ function chroot_sdcard_apt_get_remove() {
function chroot_sdcard_apt_get() {
acng_check_status_or_restart # make sure apt-cacher-ng is running OK.
local -a apt_params=("-y" "-qq")
local -a apt_params=("-y" "${apt_logging:-"-qq"}") # super quiet by default, but can be tweaked up, for update for example
if [[ "${MANAGE_ACNG}" == "yes" ]]; then
display_alert "Using managed apt-cacher-ng" "http://localhost:3142" "debug"
apt_params+=(

View File

@@ -191,7 +191,7 @@ function create_new_rootfs_cache() {
# stage: update packages list
display_alert "Updating package list" "$RELEASE" "info"
do_with_retries 3 chroot_sdcard_apt_get update
do_with_retries 3 chroot_sdcard_apt_get_update
# stage: upgrade base packages from xxx-updates and xxx-backports repository branches
display_alert "Upgrading base packages" "Armbian" "info"

View File

@@ -257,7 +257,7 @@ function install_distribution_agnostic() {
fi
display_alert "Updating" "apt package lists"
do_with_retries 3 chroot_sdcard_apt_get update
do_with_retries 3 chroot_sdcard_apt_get_update
# install image packages; AGGREGATED_PACKAGES_IMAGE is produced by aggregation.py
# and includes the old PACKAGE_LIST_BOARD and PACKAGE_LIST_FAMILY

View File

@@ -1,23 +1,24 @@
#!/usr/bin/env bash
# a-kind-of-hook, called by install_distribution_agnostic() if it's a desktop build
desktop_postinstall() {
function desktop_postinstall() {
# disable display manager for the first run
disable_systemd_service_sdcard lightdm.service
disable_systemd_service_sdcard gdm3.service
# update packages index
chroot_sdcard_apt_get "update"
# @TODO: why?
display_alert "Updating package lists" "for desktop" "info"
do_with_retries 3 chroot_sdcard_apt_get_update
# @TODO: rpardini: this is... missing from aggregation...?
# install per board packages
# @TODO: rpardini: this is... missing from aggregation...? it is used by 2 boards.
# install per board packages, desktop-only, packages.
if [[ -n ${PACKAGE_LIST_DESKTOP_BOARD} ]]; then
chroot_sdcard_apt_get_install "$PACKAGE_LIST_DESKTOP_BOARD"
fi
# install per family packages
if [[ -n ${PACKAGE_LIST_DESKTOP_FAMILY} ]]; then
# install per family packages (desktop only)
if [[ -n ${PACKAGE_LIST_DESKTOP_FAMILY} ]]; then # @TODO: used by 0 boards
chroot_sdcard_apt_get_install "$PACKAGE_LIST_DESKTOP_FAMILY"
fi