Extracting branch and write it to the /etc/armbian-release file. This information is still needed for armbian-config (#2831)

This commit is contained in:
Igor Pečovnik 2021-05-15 18:38:11 +02:00 committed by GitHub
parent e0c4dffd2f
commit 73e8dfcc7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,6 +15,7 @@
# Read in basic OS image information
. /etc/armbian-release
# and script configuration
. /usr/lib/armbian/armbian-common
@ -398,6 +399,19 @@ add_usb_storage_quirks() {
} # add_usb_storage_quirks
branch_naming_workaround()
# https://armbian.atlassian.net/browse/AR-748
# Once we rework kernel packages, this can be done better
{
if [[ -z $(cat /etc/armbian-release | grep BRANCH) ]]; then
BRANCH=$(dpkg -l | egrep "linux-image" | egrep "current|legacy|edge" | awk '{print $2}' | cut -d"-" -f3 | head -1)
[[ -n ${BRANCH} ]] && echo "BRANCH=$BRANCH" >> /etc/armbian-release
fi
}
case $1 in
*start*)
# set optimal disk scheduler settings
@ -408,5 +422,8 @@ case $1 in
# add usb quirks
add_usb_storage_quirks &
# branch naming workaround
branch_naming_workaround &
;;
esac