mirror of https://github.com/armbian/build.git
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.
This commit is contained in:
parent
8f01eea1f8
commit
9041c08979
|
|
@ -56,6 +56,24 @@ adding_packages() {
|
|||
return 0
|
||||
fi
|
||||
for f in "${4}${2}"/*.deb; do
|
||||
# If we have a list of last known working kernels, repack BSP files to prevent upgrade to kernel that breaks
|
||||
if [[ -f userpatches/last-known-good.map ]]; then
|
||||
PACKAGE_NAME=$(dpkg-deb -W $f | awk '{ print $1 }')
|
||||
for g in $(cat userpatches/last-known-good-kernel-pkg.map); do
|
||||
# Read values from file
|
||||
BOARD=$(echo $g | cut -d"|" -f1);
|
||||
BRANCH=$(echo $g | cut -d"|" -f2);
|
||||
LINUXFAMILY=$(echo $g | cut -d"|" -f3)
|
||||
LASTKERNEL=$(echo $g | cut -d"|" -f4);
|
||||
if [[ ${PACKAGE_NAME} == "armbian-bsp-cli-${BOARD}-${BRANCH}" ]]; then
|
||||
echo "Setting last kernel upgrade for $BOARD to linux-image-$BRANCH-$BOARD=${LASTKERNEL}"
|
||||
tempdir=$(mktemp -d)
|
||||
dpkg-deb -R $f $tempdir
|
||||
sed -i '/^Replaces:/ s/$/, linux-image-'$BRANCH'-'$LINUXFAMILY' (>> '$LASTKERNEL'), linux-dtb-'$BRANCH'-'$LINUXFAMILY' (>> '$LASTKERNEL')/' $tempdir/DEBIAN/control
|
||||
dpkg-deb -b $tempdir ${f} >/dev/null
|
||||
fi
|
||||
done
|
||||
fi
|
||||
aptly repo add -remove-files -force-replace -config="${CONFIG}" "${1}" "${f}"
|
||||
done
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue