mb/google/fatcat: Move CSE sync at payload
[coreboot.git] / util / chromeos / gen_test_hwid.sh
blob8f3b948a966fb44ca6086e859961ead87d5cb30b
1 #!/usr/bin/env sh
3 # SPDX-License-Identifier: GPL-2.0-only
5 main() {
6 if [ "$#" != 1 ]; then
7 echo "Usage: $0 MAINBOARD_PARTNUMBER" >&2
8 exit 1
9 fi
11 # Generate a test-only ChromeOS HWID v2 string
12 local board="$1"
13 local prefix="$(echo "${board}" | tr a-z A-Z) TEST"
14 # gzip has second-to-last 4 bytes in CRC32.
15 local crc32="$(printf "${prefix}" | gzip -1 | tail -c 8 | head -c 4 | \
16 od -An -vtu4 | tr -d '\n' | tail -c 4)"
18 echo "${prefix}" "${crc32}"
20 main "$@"