Unverified Commit 8f0ef1b0 authored by Igor Pečovnik's avatar Igor Pečovnik Committed by GitHub
Browse files

Remove deprecated (#73)

* Cleanup

* Update
parent 07a877b2
......@@ -347,21 +347,6 @@ function generic_select()
#
# kernel descriptions in more human friendly format
#
function kernel_desc ()
{
[[ "$1" == "dev" ]] && echo "development, unstable"
[[ "$1" == "next" ]] && echo "mainline or 2nd generation"
[[ "$1" == "default" ]] && echo "legacy, stock, 1st build"
}
#
# reload kernel, bsp and armbian-config
#
......@@ -426,6 +411,7 @@ function other_kernel_version ()
# get current kernel information
CURRENT_VERSION_TEMP=$(dpkg -l | grep '^ii' | grep linux-image)
CURRENT_VERSION=$(echo $CURRENT_VERSION_TEMP | awk '{print $2}')"="$(echo $CURRENT_VERSION_TEMP | awk '{print $3}')
# check what is available from the repository
debconf-apt-progress -- apt-get update
LIST=($(apt-cache show linux-image*${LINUXFAMILY} | grep -E "Package:|Version:|version:" \
......@@ -464,6 +450,7 @@ function other_kernel_version ()
exec 3>&-
if [[ $exitstatus = 0 ]]; then
IFS=" "
# determine upgrade packages
UPGRADE_ROOT="default"
UPGRADE_UBOOT=""
......@@ -471,44 +458,31 @@ function other_kernel_version ()
[[ $TARGET_VERSION == *next* ]] && UPGRADE_ROOT="-next" && UPGRADE_UBOOT="next"
[[ $TARGET_VERSION == *current* ]] && UPGRADE_ROOT="-current" && UPGRADE_UBOOT="current"
[[ $TARGET_VERSION == *dev* ]] && UPGRADE_ROOT="-dev" && UPGRADE_UBOOT="dev"
# install packages
PACKAGE_LIST="$TARGET_VERSION"
TARGET_VERSION_DTB=${TARGET_VERSION/image/dtb}
TARGET_VERSION_PRE=$(echo $TARGET_VERSION_DTB | cut -f1 -d"=")
TARGET_VERSION_SUB=$(echo $TARGET_VERSION_DTB | cut -f2 -d"=")
[[ -n $(apt-cache madison "$TARGET_VERSION_PRE" | grep $TARGET_VERSION_SUB ) ]] && \
PACKAGE_LIST=$PACKAGE_LIST" $TARGET_VERSION_DTB"
PACKAGE_LIST=$PACKAGE_LIST" $TARGET_VERSION_DTB linux-u-boot-${BOARD}-${UPGRADE_UBOOT}"
echo $PACKAGE_LIST > /tmp/switch_kernel.log 2>&1
debconf-apt-progress -- apt --download-only --allow-downgrades -y --no-install-recommends install $PACKAGE_LIST
if [[ $? = 0 ]]; then
dialog --backtitle "$BACKTITLE" --title "Please wait" --infobox "\nRemoving current kernel ..." 5 36
# remove old kernel
aptitude remove ~nlinux-image-${LINUXFAMILY} --quiet=100 -y >> /var/log/upgrade.log 2>&1
aptitude remove ~nlinux-image-next-${LINUXFAMILY} --quiet=100 -y >> /var/log/upgrade.log 2>&1
aptitude remove ~nlinux-image-dev-${LINUXFAMILY} --quiet=100 -y >> /var/log/upgrade.log 2>&1
aptitude remove ~nlinux-dtb-${LINUXFAMILY} --quiet=100 -y >> /var/log/upgrade.log 2>&1
aptitude remove ~nlinux-dtb-next-${LINUXFAMILY} --quiet=100 -y >> /var/log/upgrade.log 2>&1
aptitude remove ~nlinux-dtb-dev-${LINUXFAMILY} --quiet=100 -y >> /var/log/upgrade.log 2>&1
debconf-apt-progress -- apt -y -qq purge linux-u-boot* linux-image* linux-dtb* linux-headers* linux-${DISTROID}-root*
# cleanup
find "/boot/" -name "System.map*" -type f -delete
find "/boot/" -name "config*" -type f -delete
find "/boot/" -name "vmlinuz*" -type f -delete
find "/boot/" -name "*nitrd*" -type f -delete
debconf-apt-progress -- apt -y -qq --allow-downgrades --no-install-recommends install $PACKAGE_LIST
# update u-boot and rootfs
debconf-apt-progress -- apt --download-only --allow-downgrades -y --no-install-recommends install linux-u-boot-${BOARD}-${UPGRADE_UBOOT}
if [[ $? = 0 ]]; then
aptitude remove ~n$(dpkg -l | grep '^ii' | grep linux-u-boot | awk '{print $2}') --quiet=100 -y >> /var/log/upgrade.log 2>&1
debconf-apt-progress -- apt -y -qq --allow-downgrades --no-install-recommends install linux-u-boot-${BOARD}-${UPGRADE_UBOOT}
fi
debconf-apt-progress -- apt --download-only --allow-downgrades -y --no-install-recommends install linux-${DISTROID}-root${UPGRADE_ROOT}-${BOARD}
if [[ $? = 0 ]]; then
aptitude remove ~n$(dpkg -l | grep '^ii' | grep linux-${DISTROID} | awk '{print $2}') --quiet=100 -y >> /var/log/upgrade.log 2>&1
debconf-apt-progress -- apt -y -qq --allow-downgrades --no-install-recommends install linux-${DISTROID}-root${UPGRADE_ROOT}-${BOARD}
fi
# clean apt cache
find "/boot/" -name "System.map*" -type f -delete; find "/boot/" -name "config*" -type f -delete
find "/boot/" -name "vmlinuz*" -type f -delete; find "/boot/" -name "*nitrd*" -type f -delete
apt clean
# BSP must be installed separate otherwise it won't work
debconf-apt-progress -- apt -y -qq --allow-downgrades --no-install-recommends install linux-${DISTROID}-root${UPGRADE_ROOT}-${BOARD}
debconf-apt-progress -- apt -y -qq --allow-downgrades --no-install-recommends install $PACKAGE_LIST
if [[ $? = 0 ]]; then reboot; fi
else
dialog --backtitle "$BACKTITLE" --title "Warning" --msgbox \
......
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