Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Framework: expand package installing function with custom parameter #7124

Merged
merged 3 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/functions/rootfs/apt-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ function install_deb_chroot() {
local package="$1"
local variant="$2"
local transfer="$3"
local apt_options="$4"
local install_target="${package}"
local log_extra=" from repository"
local package_filename
Expand All @@ -103,7 +104,7 @@ function install_deb_chroot() {
declare -g if_error_detail_message="Installation of $install_target failed ${BOARD} ${RELEASE} ${BUILD_DESKTOP} ${LINUXFAMILY}"
declare -a extra_apt_envs=()
extra_apt_envs+=("ARMBIAN_IMAGE_BUILD_BOOTFS_TYPE=${BOOTFS_TYPE:-"unset"}") # used by package postinst scripts to bevahe
DONT_MAINTAIN_APT_CACHE="yes" chroot_sdcard_apt_get --no-install-recommends install "${install_target}" # don't auto-maintain apt cache when installing from packages.
DONT_MAINTAIN_APT_CACHE="yes" chroot_sdcard_apt_get --no-install-recommends "${apt_options}" install "${install_target}" # don't auto-maintain apt cache when installing from packages.
unset extra_apt_envs

# IMPORTANT! Do not use short-circuit above as last statement in a function, since it determines the result of the function.
Expand All @@ -112,13 +113,14 @@ function install_deb_chroot() {

function install_artifact_deb_chroot() {
declare deb_name="$1"
declare apt_options="$2"
declare -A -g image_artifacts_debs_reversioned # global associative array
declare revisioned_deb_rel_path="${image_artifacts_debs_reversioned["${deb_name}"]}"
if [[ -z "${revisioned_deb_rel_path}" ]]; then
exit_with_error "No revisioned deb path found for '${deb_name}'"
fi
display_alert "Installing artifact deb" "${deb_name} :: ${revisioned_deb_rel_path}" "debug"
install_deb_chroot "${DEB_STORAGE}/${revisioned_deb_rel_path}"
install_deb_chroot "${DEB_STORAGE}/${revisioned_deb_rel_path}" "" "" "${apt_options}"

# Mark the deb as installed in the global associative array.
declare -A -g image_artifacts_debs_installed
Expand Down
2 changes: 1 addition & 1 deletion lib/functions/rootfs/create-cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,4 @@ function extract_rootfs_artifact() {
}

# This comment strategically introduced to force a rebuild of all rootfs, as this file's contents are hashed into all rootfs versions.
# There was a problem when generating cache. Packages were upgraded from our (beta) repository which lead into package downgrade error problem
# There was a problem when generating cache. Packages were upgraded from our (beta) repository which lead into package downgrade error problem.
2 changes: 1 addition & 1 deletion lib/functions/rootfs/distro-specific.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function install_distribution_specific() {

# install our base-files package (this replaces the original from Debian/Ubuntu)
if [[ "${KEEP_ORIGINAL_OS_RELEASE:-"no"}" != "yes" ]]; then
install_artifact_deb_chroot "armbian-base-files"
install_artifact_deb_chroot "armbian-base-files" "--allow-downgrades"
fi

# Set DNS server if systemd-resolved is in use
Expand Down