Skip to contentSkip to conversation

utils/add-custom-hashes: symlink linux-headers to linux

PATCH In review Brandon Maier via buildroot 2 participants 3 messages May 28, 2024 – Jun 8, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 utils/add-custom-hashes | 8 ++++++++
 1 file changed, 8 insertions(+)
utils/add-custom-hashes +8 -0
index 20e48d8ef3..9bea39883a 100755
@@ -97,6 +97,14 @@ for file in $BR_NO_CHECK_HASH_FOR; do
     done
 done
 
+# Symlink linux-headers to linux
+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" ] \
+    && diff -q "$linux_hash" "$linux_headers_hash" >/dev/null; then
+    ln -sf ../linux/linux.hash "$linux_headers_hash"
+fi
+
 message Verifying hashes
 
 make clean
Signature · 6 lines
2.45.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Brandon" == Brandon Maier <[email protected]> writes:

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.

Nice!

Quoted 10 lines
---
 utils/add-custom-hashes | 8 ++++++++
 1 file changed, 8 insertions(+)
utils/add-custom-hashes +0 -0
index 20e48d8ef3..9bea39883a 100755

utils/add-custom-hashes for file in $BR_NO_CHECK_HASH_FOR; do · line 100

Quoted 4 lines
utils/add-custom-hashes +1 -0
@@ -97,6 +97,14 @@ for file in $BR_NO_CHECK_HASH_FOR; do
     done
 done
 
+# Symlink linux-headers to linux

.. if identical

utils/add-custom-hashes for file in $BR_NO_CHECK_HASH_FOR; do · line 104

Quoted 4 lines
utils/add-custom-hashes +4 -0
+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" ] \
+    && diff -q "$linux_hash" "$linux_headers_hash" >/dev/null; then

Rather than using diff -q > /dev/null, it IMHO makes more sense to use cmp -s like we do elsewhere.

Committed with that changed, thanks.

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw
Quoted 36 lines
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

"Peter" == Peter Korsgaard <[email protected]> writes:

"Brandon" == Brandon Maier <[email protected]> writes:

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.

Nice!

Quoted 13 lines

---
utils/add-custom-hashes | 8 ++++++++

1 file changed, 8 insertions(+)
utils/add-custom-hashes +0 -0
index 20e48d8ef3..9bea39883a 100755
@@ -97,6 +97,14 @@ for file in $BR_NO_CHECK_HASH_FOR; do

done
done

Quoted 1 line

+# Symlink linux-headers to linux

.. if identical

utils/add-custom-hashes for file in $BR_NO_CHECK_HASH_FOR; do · line 104

Quoted 4 lines
utils/add-custom-hashes +4 -0
+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" ] \
+    && diff -q "$linux_hash" "$linux_headers_hash" >/dev/null; then

Rather than using diff -q > /dev/null, it IMHO makes more sense to use cmp -s like we do elsewhere.

Quoted 1 line

Committed with that changed, thanks.

Committed to 2024.02.x, thanks.

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot