Commit 2a67d66f authored by Igor Pecovnik's avatar Igor Pecovnik
Browse files

Switch to stable builds also reinstall armbian packages

parent 85ed150a
......@@ -37,7 +37,7 @@ function jobs ()
# Enabling BT
#
"BT install" )
if ! is_package_manager_running; then
if ! is_package_manager_running; then
debconf-apt-progress -- apt-get -y install bluetooth bluez bluez-tools
check_if_installed xserver-xorg && debconf-apt-progress -- apt-get -y --no-install-recommends install pulseaudio-module-bluetooth blueman
fi
......@@ -1063,21 +1063,46 @@ function jobs ()
;;
# Switch to stable builds
# Switch to stable builds and reinstall armbian packages
#
"Stable" )
if ! is_package_manager_running; then
dialog --colors --title " \Z1Warning\Z0 " --backtitle "$BACKTITLE" --yes-label "OK" --no-label "Cancel" \
--yesno "\nYou are switching back to stable respository where you are going to get future updates. Are you fine with that?" 9 44
dialog --colors --title " \Z1Warning\Z0 " --backtitle "$BACKTITLE" --yes-label "OK" \
--no-label "Cancel" --yesno \
"\nYou are switching back to stable respository where you are going to get future updates. Are you fine with that?" 9 44
if [[ $? = 0 ]]; then
sed -i 's/beta.armbian.com/apt.armbian.com/' /etc/apt/sources.list.d/armbian.list
debconf-apt-progress -- apt-get update
debconf-apt-progress -- apt-get -y upgrade
# remove nighlty packages and install stable
TARGET_BRANCH=$BRANCH
exceptions "$INSTALL_KERNEL"
dialog --backtitle "$BACKTITLE" --title "Please wait" --infobox "\nRemoving current nightly kernel." 5 36
apt-get -s -y -qq --no-install-recommends install linux-image${TARGET_BRANCH}-${TARGET_FAMILY} \
linux-headers${TARGET_BRANCH}-${TARGET_FAMILY} linux-u-boot-${BOARD}-${UBOOT_BRANCH} \
linux-$(lsb_release -cs)-root$TARGET_BRANCH-$BOARD > /dev/null 2>&1
# if test download is ok, remove old kernel
if [[ $? = 0 ]]; then
aptitude remove ~nlinux-image --quiet=100 -y >> /var/log/upgrade.log
aptitude remove ~nlinux-dtb --quiet=100 -y >> /var/log/upgrade.log
aptitude remove ~nlinux-headers --quiet=100 -y >> /var/log/upgrade.log
aptitude remove ~nlinux-$(lsb_release -cs)-root --quiet=100 -y >> /var/log/upgrade.log
fi
# install new packages
INSTALL_DTB=""
[[ -n $(apt-cache search --names-only "^linux-dtb$TARGET_BRANCH-$TARGET_FAMILY") ]] && \
INSTALL_DTB="linux-dtb$TARGET_BRANCH-$TARGET_FAMILY"
debconf-apt-progress -- apt-get --reinstall -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \
-y -qq --no-install-recommends install linux-image${TARGET_BRANCH}-${TARGET_FAMILY} \
linux-headers${TARGET_BRANCH}-${TARGET_FAMILY} linux-u-boot-${BOARD}-${UBOOT_BRANCH} \
linux-$(lsb_release -cs)-root$TARGET_BRANCH-$BOARD $INSTALL_DTB
dialog --title "Switching to stable" --backtitle "$BACKTITLE" --yes-label "Reboot" --no-label "Cancel" --yesno \
"\nReboot to apply new settings?" 7 34
if [[ $? = 0 ]]; then reboot; fi
fi
fi
;;
# Switch to alternative kernels
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment