]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
arm-trusted-firmware-airoha: fix BL2 packing on Debian 11
authorRobert Marko <robert.marko@sartura.hr>
Sun, 9 Aug 2026 09:21:46 +0000 (11:21 +0200)
committerRobert Marko <robimarko@gmail.com>
Sun, 9 Aug 2026 09:22:55 +0000 (11:22 +0200)
Debian 11 ships coreutils 8.32, whose cksum does not support the
-a crc32b option. This leaves crc empty and causes the subsequent shell
arithmetic expression to fail.

Use Python's built-in binascii.crc32 implementation instead. Python 3 is
already required by the OpenWrt build system and produces the same CRC-32
value before the existing final XOR.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
package/boot/arm-trusted-firmware-airoha/scripts/airoha_pack_bl2.sh

index b43880c9be98ae2079b580cab98bf2ee9545d627..ab41d58158a287bf58365963b0a07fdf44b8ecc6 100755 (executable)
@@ -60,7 +60,7 @@ cat $BL22 >> $BL2
 cat $BL23 >> $BL2
 cat $FLASH_TABLE >> $BL2
 
-crc=$(cksum -a crc32b $BL2 | cut -d' ' -f1)
+crc=$(python3 -c 'import binascii, sys; print(binascii.crc32(sys.stdin.buffer.read()))' < "$BL2")
 
 # XOR with 0xffffffff
 crc=$((0xffffffff ^ $crc))