Skip to content

Commit ab67aa6

Browse files
committed
Bugfix: read branch information when we change BSP
1 parent 6bb973a commit ab67aa6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tools/modules/system/install_headers.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@ function module_headers () {
1616

1717
if [[ -f /etc/armbian-release ]]; then
1818
source /etc/armbian-release
19+
# branch information is stored in armbian-release at boot time. When we change kernel branches, we need to re-read this and add it
20+
if [[ -z "${BRANCH}" ]]; then
21+
BRANCH=$(dpkg -l | grep -E "linux-image" | grep -E "current|vendor|legacy|edge" | awk '{print $2}' | cut -d"-" -f3 | head -1)
22+
if grep -q BRANCH /etc/armbian-release; then
23+
[[ -n ${BRANCH} ]] && sed -i "s/BRANCH=.*/BRANCH=$BRANCH/g" /etc/armbian-release
24+
else
25+
[[ -n ${BRANCH} ]] && echo "BRANCH=$BRANCH" >> /etc/armbian-release
26+
fi
27+
fi
1928
local install_pkg="linux-headers-${BRANCH}-${LINUXFAMILY}"
2029
else
2130
local install_pkg="linux-headers-$(uname -r | sed 's/'-$(dpkg --print-architecture)'//')"

0 commit comments

Comments
 (0)