From ec76e1282ef5c2f40818590f85ad879c92d81dd5 Mon Sep 17 00:00:00 2001 From: Igor Pecovnik Date: Sat, 24 Aug 2024 17:15:24 +0200 Subject: [PATCH] More elegant solution to prevent kernel upgrades per certain board --- config/boards/orangepi5.conf | 1 + lib/functions/bsp/armbian-bsp-cli-deb.sh | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/config/boards/orangepi5.conf b/config/boards/orangepi5.conf index 605f5640bf0f..42569fa11113 100644 --- a/config/boards/orangepi5.conf +++ b/config/boards/orangepi5.conf @@ -14,6 +14,7 @@ BOOT_SCENARIO="spl-blobs" BOOT_SUPPORT_SPI="yes" BOOT_SPI_RKSPI_LOADER="yes" IMAGE_PARTITION_TABLE="gpt" +KERNEL_UPGRADE_FREEZE="24.8.1" declare -g UEFI_EDK2_BOARD_ID="orangepi-5" # This _only_ used for uefi-edk2-rk3588 extension # @TODO: consider removing those, as the defaults in rockchip64_common have been bumped up diff --git a/lib/functions/bsp/armbian-bsp-cli-deb.sh b/lib/functions/bsp/armbian-bsp-cli-deb.sh index b69046fc0d1b..010cb5eef753 100644 --- a/lib/functions/bsp/armbian-bsp-cli-deb.sh +++ b/lib/functions/bsp/armbian-bsp-cli-deb.sh @@ -208,6 +208,18 @@ function compile_armbian-bsp-cli() { artifact_package_hook_helper_board_side_functions "postinst" board_side_bsp_cli_postinst_base "${postinst_functions[@]}" board_side_bsp_cli_postinst_finish unset board_side_bsp_cli_postinst_base board_side_bsp_cli_postinst_update_uboot_bootscript board_side_bsp_cli_postinst_finish + ### preventing upgrading stable kernels beyond version if defined + # if freeze variable is removed, upgrade becomes possible again + if [[ "${BETA}" != "yes" && -n "${KERNEL_UPGRADE_FREEZE}" ]]; then + cat <<- EOF >> "${destination}"/etc/apt/preferences.d/frozen-armbian + Package: linux-*-${BRANCH}-${LINUXFAMILY} + Pin: version ${KERNEL_UPGRADE_FREEZE} + Pin-Priority: 999 + EOF + else + touch "${destination}"/etc/apt/preferences.d/frozen-armbian + fi + # add some summary to the image # @TODO: another? fingerprint_image "${destination}/etc/armbian.txt"