Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repository management: add config driven BSP package modification #7129

Merged
merged 1 commit into from
Aug 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions tools/repository/repo
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down