Skip to content

Commit

Permalink
Bugfix: firmware switch function was not working correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
igorpecovnik committed Sep 29, 2024
1 parent bd256bc commit 0c8c7a9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
9 changes: 5 additions & 4 deletions lib/armbian-configng/config.ng.functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -286,14 +286,15 @@ armbian_fw_manipulate() {
done

for pkg in "${packages[@]}"; do
local pkg_uninstall=${pkg/=*/} # removing numbers
case $function in
unhold) apt-mark unhold ${pkg} | show_infobox ;;
hold) apt-mark hold ${pkg} | show_infobox ;;
reinstall)
apt_install_wrapper apt-get -y --download-only --allow-change-held-packages --allow-downgrades install "${pkg}"
apt_install_wrapper apt-get -y purge "${pkg_uninstall/${branch}/*}" # remove all branches
apt_install_wrapper apt-get -y --allow-change-held-packages --allow-downgrades install "${pkg}"
apt_install_wrapper apt-get -y --download-only --allow-change-held-packages --allow-downgrades install ${pkg}
echo $?
read
apt_install_wrapper apt-get -y purge "linux-u-boot-*" "linux-image-*" "linux-dtb-*" "linux-headers-*" # remove all branches
apt_install_wrapper apt-get -y --allow-change-held-packages --allow-downgrades install ${pkg}
apt_install_wrapper apt-get -y autoremove
apt_install_wrapper apt-get -y clean
;;
Expand Down
13 changes: 8 additions & 5 deletions lib/armbian-configng/config.ng.system.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ module_options+=(
# @description Use TUI / GUI for apt install if exists
#
function apt_install_wrapper() {
if [ -t 0 ]; then
debconf-apt-progress -- "$@"
else

#if [ -t 0 ]; then
# debconf-apt-progress -- $@
#lse
# Terminal not defined - proceed without TUI
"$@"
fi
DEBIAN_FRONTEND=noninteractive $@
#fi
}

module_options+=(
Expand Down Expand Up @@ -145,6 +146,7 @@ function set_stable() {

if ! grep -q 'apt.armbian.com' /etc/apt/sources.list.d/armbian.list; then
sed -i "s/http:\/\/[^ ]*/http:\/\/apt.armbian.com/" /etc/apt/sources.list.d/armbian.list
apt_install_wrapper apt-get update
armbian_fw_manipulate "reinstall"
fi
}
Expand All @@ -164,6 +166,7 @@ function set_rolling() {

if ! grep -q 'beta.armbian.com' /etc/apt/sources.list.d/armbian.list; then
sed -i "s/http:\/\/[^ ]*/http:\/\/beta.armbian.com/" /etc/apt/sources.list.d/armbian.list
apt_install_wrapper apt-get update
armbian_fw_manipulate "reinstall"
fi
}
Expand Down

0 comments on commit 0c8c7a9

Please sign in to comment.