mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
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:
@@ -56,6 +56,24 @@ adding_packages() {
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
for f in "${4}${2}"/*.deb; do
|
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}"
|
aptly repo add -remove-files -force-replace -config="${CONFIG}" "${1}" "${f}"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user