From d506e232e7388e70622a1c1b2a3069367d7b305b Mon Sep 17 00:00:00 2001 From: Brandon Maier Date: Tue, 28 May 2024 15:09:10 +0000 Subject: [PATCH] utils/add-custom-hashes: symlink linux-headers to linux Most boards use BR2_KERNEL_HEADERS_AS_KERNEL with their custom kernels. So when creating their custom hash files, the linux-headers.hash is the same as linux.hash. In this case we symlink linux-headers to linux to make maintenance easier. Update the add-custom-hashes tool to explicitly handle this case. Signed-off-by: Brandon Maier [Peter: use cmp -s] Signed-off-by: Peter Korsgaard --- utils/add-custom-hashes | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/utils/add-custom-hashes b/utils/add-custom-hashes index 20e48d8ef3..017b25b27f 100755 --- a/utils/add-custom-hashes +++ b/utils/add-custom-hashes @@ -97,6 +97,14 @@ for file in $BR_NO_CHECK_HASH_FOR; do done done +# Symlink linux-headers to linux if identical +linux_hash="$BR2_GLOBAL_PATCH_DIR/linux/linux.hash" +linux_headers_hash="$BR2_GLOBAL_PATCH_DIR/linux-headers/linux-headers.hash" +if [ -e "$linux_hash" ] && [ -e "$linux_headers_hash" ] \ + && cmp -s "$linux_hash" "$linux_headers_hash"; then + ln -sf ../linux/linux.hash "$linux_headers_hash" +fi + message Verifying hashes make clean