artifacts: fix hashing for u-boot and kernel

This commit is contained in:
Gunjan Gupta 2023-07-01 21:52:44 +05:30
parent bd56746146
commit 2cae0b9422
2 changed files with 19 additions and 2 deletions

View File

@ -97,7 +97,11 @@ function artifact_kernel_prepare_version() {
declare patches_hash="undetermined"
declare hash_files="undetermined"
display_alert "User patches directory for kernel" "${USERPATCHES_PATH}/kernel/${KERNELPATCHDIR}" "info"
calculate_hash_for_all_files_in_dirs "${SRC}/patch/kernel/${KERNELPATCHDIR}" "${USERPATCHES_PATH}/kernel/${KERNELPATCHDIR}"
declare -a kernel_patch_dirs=()
for patch_dir in ${KERNELPATCHDIR} ; do
kernel_patch_dirs+=( "${SRC}/patch/kernel/${patch_dir}" "${USERPATCHES_PATH}/kernel/${patch_dir}" )
done
calculate_hash_for_all_files_in_dirs "${kernel_patch_dirs[@]}"
patches_hash="${hash_files}"
declare kernel_patches_hash_short="${patches_hash:0:${short_hash_size}}"

View File

@ -55,7 +55,20 @@ function artifact_uboot_prepare_version() {
# @TODO: this is even more grave in case of u-boot: v2022.10 has patches for many boards inside, gotta resolve.
declare patches_hash="undetermined"
declare hash_files="undetermined"
calculate_hash_for_all_files_in_dirs "${SRC}/patch/u-boot/${BOOTPATCHDIR}" "${USERPATCHES_PATH}/u-boot/${BOOTPATCHDIR}"
declare -a uboot_patch_dirs=()
for patch_dir in ${BOOTPATCHDIR} ; do
uboot_patch_dirs+=( "${SRC}/patch/u-boot/${patch_dir}" "${USERPATCHES_PATH}/u-boot/${patch_dir}" )
done
if [[ -n "${ATFSOURCE}" && "${ATFSOURCE}" != "none" ]]; then
uboot_patch_dirs+=( "${SRC}/patch/atf/${ATFPATCHDIR}" "${USERPATCHES_PATH}/atf/${ATFPATCHDIR}" )
fi
if [[ -n "${CRUSTCONFIG}" ]]; then
uboot_patch_dirs+=( "${SRC}/patch/crust/${CRUSTPATCHDIR}" "${USERPATCHES_PATH}/crust/${CRUSTPATCHDIR}" )
fi
calculate_hash_for_all_files_in_dirs "${uboot_patch_dirs[@]}"
patches_hash="${hash_files}"
declare uboot_patches_hash_short="${patches_hash:0:${short_hash_size}}"