Commit d75d9088 authored by Igor Pecovnik's avatar Igor Pecovnik
Browse files

Bugfix - changing between beta and stable was not always successful

parent cbc8e468
...@@ -360,31 +360,18 @@ function generic_select() ...@@ -360,31 +360,18 @@ function generic_select()
# reload kernel, bsp and armbian-config # reload kernel, bsp and armbian-config
# #
function reload_bsp(){ function reload_bsp(){
clear clear
debconf-apt-progress -- apt-get update debconf-apt-progress -- apt-get update
PACKAGE_LIST="linux-${DISTROID}-root-${BRANCH}-${BOARD} linux-u-boot-${BOARD}-${BRANCH}"
check_if_installed armbian-${DISTROID}-desktop && PACKAGE_LIST+=" armbian-${DISTROID}-desktop"
check_if_installed linux-headers${BRANCH}-${FAMILY} && PACKAGE_LIST+=" linux-headers-${BRANCH}-${FAMILY}"
# new branch names introduced with 12/2019 [[ -n $(apt-cache search --names-only "^linux-dtb-${BRANCH}-${LINUXFAMILY}") ]] && \
if [[ -n $(apt-cache search --names-only "^linux-image-current") ]]; then PACKAGE_LIST+=" linux-dtb-${BRANCH}-${LINUXFAMILY}"
[[ BRANCH == next ]] && TARGET_BRANCH="legacy" && TARGET_UBOOT_BRANCH="legacy" PACKAGE_LIST+=" linux-image-${BRANCH}-${LINUXFAMILY}"
TARGET_BRANCH="current"
TARGET_UBOOT_BRANCH="current"
else
TARGET_BRANCH="${BRANCH}"
TARGET_UBOOT_BRANCH="${UBOOT_BRANCH}"
fi
exceptions "$INSTALL_KERNEL"
unset PACKAGE_LIST
PACKAGE_LIST="linux-${DISTROID}-root$TARGET_BRANCH-$BOARD"
[[ -z ${TARGET_UBOOT_BRANCH} ]] && TARGET_UBOOT_BRANCH="current"
PACKAGE_LIST=$PACKAGE_LIST" linux-u-boot-$BOARD-$TARGET_UBOOT_BRANCH"
check_if_installed armbian-${DISTROID}-desktop && PACKAGE_LIST=$PACKAGE_LIST" armbian-${DISTROID}-desktop"
check_if_installed linux-headers${TARGET_BRANCH}-${TARGET_FAMILY} && PACKAGE_LIST=$PACKAGE_LIST" linux-headers${TARGET_BRANCH}-${TARGET_FAMILY}"
IFS=" "
[[ -n $(apt-cache search --names-only "^linux-dtb$TARGET_BRANCH-$TARGET_FAMILY") ]] && \
PACKAGE_LIST=$PACKAGE_LIST" linux-dtb$TARGET_BRANCH-$TARGET_FAMILY"
PACKAGE_LIST=$PACKAGE_LIST" linux-image${TARGET_BRANCH}-${TARGET_FAMILY}"
debconf-apt-progress -- apt --download-only --allow-downgrades -y --no-install-recommends install $PACKAGE_LIST armbian-config debconf-apt-progress -- apt --download-only --allow-downgrades -y --no-install-recommends install $PACKAGE_LIST armbian-config
# if download is ok, remove old packages # if download is ok, remove old packages
if [[ $? = 0 ]]; then if [[ $? = 0 ]]; then
...@@ -393,12 +380,13 @@ function reload_bsp(){ ...@@ -393,12 +380,13 @@ function reload_bsp(){
find "/boot/" -name "config*" -type f -delete find "/boot/" -name "config*" -type f -delete
find "/boot/" -name "vmlinuz*" -type f -delete find "/boot/" -name "vmlinuz*" -type f -delete
find "/boot/" -name "*nitrd*" -type f -delete find "/boot/" -name "*nitrd*" -type f -delete
# install packages # install packages
echo $PACKAGE_LIST >> /var/log/upgrade.log echo $PACKAGE_LIST >> /var/log/upgrade.log
debconf-apt-progress -- apt -y -qq --allow-downgrades --no-install-recommends --reinstall \ debconf-apt-progress -- apt -y -qq --allow-downgrades --no-install-recommends --reinstall \
-o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install $PACKAGE_LIST armbian-config -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install $PACKAGE_LIST armbian-config
if [[ $? = 1 ]]; then if [[ $? -eq 1 ]]; then
echo "Something went wrong ... check logs."; exit; echo "Something went wrong ... check logs."; exit;
else else
apt clean apt clean
......
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