armbian-next: try to parse Source: linux-5.x.y-rcZ correctly into VER=5.x.y-rcZ instead of VER=5.x.y

- `VER` gets used in the final *image* name produced, and it is very confusing to get `5.19.0` instead of `5.19.0-rc3` there.
- added debug's so we can find when we're bit, there's 2 variations
This commit is contained in:
Ricardo Pardini 2022-06-23 23:04:32 +02:00
parent 95e0b9d484
commit 6d2c00613c
No known key found for this signature in database
GPG Key ID: 3D38CA12A66C5D02

View File

@ -312,7 +312,8 @@ function install_distribution_agnostic() {
# install kernel
[[ -n $KERNELSOURCE ]] && {
if [[ "${REPOSITORY_INSTALL}" != *kernel* ]]; then
VER=$(dpkg --info "${DEB_STORAGE}/${CHOSEN_KERNEL}_${REVISION}_${ARCH}.deb" | awk -F"-" '/Source:/{print $2}')
VER=$(dpkg --info "${DEB_STORAGE}/${CHOSEN_KERNEL}_${REVISION}_${ARCH}.deb" | grep "^ Source:" | sed -e 's/ Source: linux-//')
display_alert "Parsed kernel version from local package" "${VER}" "debug"
install_deb_chroot "${DEB_STORAGE}/${CHOSEN_KERNEL}_${REVISION}_${ARCH}.deb"
if [[ -f ${DEB_STORAGE}/${CHOSEN_KERNEL/image/dtb}_${REVISION}_${ARCH}.deb ]]; then
@ -329,6 +330,7 @@ function install_distribution_agnostic() {
VER=$(dpkg-deb -f "${SDCARD}"/var/cache/apt/archives/linux-image-${BRANCH}-${LINUXFAMILY}*_${ARCH}.deb Source)
VER="${VER/-$LINUXFAMILY/}"
VER="${VER/linux-/}"
display_alert "Parsed kernel version from remote package" "${VER}" "debug"
if [[ "${ARCH}" != "amd64" && "${LINUXFAMILY}" != "media" ]]; then # amd64 does not have dtb package, see packages/armbian/builddeb:355
install_deb_chroot "linux-dtb-${BRANCH}-${LINUXFAMILY}" "remote"
fi