Skip to content

Commit 9041c08

Browse files
committed
Implement config driven BSP package modification to set last good kernel for a single device
This will prevent upgrading to higher kernels which are known to be broken.
1 parent 8f01eea commit 9041c08

File tree

1 file changed

+18
-0
lines changed
  • tools/repository

1 file changed

+18
-0
lines changed

tools/repository/repo

+18
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,24 @@ adding_packages() {
5656
return 0
5757
fi
5858
for f in "${4}${2}"/*.deb; do
59+
# If we have a list of last known working kernels, repack BSP files to prevent upgrade to kernel that breaks
60+
if [[ -f userpatches/last-known-good.map ]]; then
61+
PACKAGE_NAME=$(dpkg-deb -W $f | awk '{ print $1 }')
62+
for g in $(cat userpatches/last-known-good-kernel-pkg.map); do
63+
# Read values from file
64+
BOARD=$(echo $g | cut -d"|" -f1);
65+
BRANCH=$(echo $g | cut -d"|" -f2);
66+
LINUXFAMILY=$(echo $g | cut -d"|" -f3)
67+
LASTKERNEL=$(echo $g | cut -d"|" -f4);
68+
if [[ ${PACKAGE_NAME} == "armbian-bsp-cli-${BOARD}-${BRANCH}" ]]; then
69+
echo "Setting last kernel upgrade for $BOARD to linux-image-$BRANCH-$BOARD=${LASTKERNEL}"
70+
tempdir=$(mktemp -d)
71+
dpkg-deb -R $f $tempdir
72+
sed -i '/^Replaces:/ s/$/, linux-image-'$BRANCH'-'$LINUXFAMILY' (>> '$LASTKERNEL'), linux-dtb-'$BRANCH'-'$LINUXFAMILY' (>> '$LASTKERNEL')/' $tempdir/DEBIAN/control
73+
dpkg-deb -b $tempdir ${f} >/dev/null
74+
fi
75+
done
76+
fi
5977
aptly repo add -remove-files -force-replace -config="${CONFIG}" "${1}" "${f}"
6078
done
6179
}

0 commit comments

Comments
 (0)