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 <brandon.maier@collins.com>
[Peter: use cmp -s]
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
(cherry picked from commit d506e232e7)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
Brandon Maier 2024-05-28 15:09:10 +00:00 committed by Peter Korsgaard
parent bb8e3f45a6
commit 3283e5f595

View File

@ -97,6 +97,14 @@ for file in $BR_NO_CHECK_HASH_FOR; do
done done
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 message Verifying hashes
make clean make clean