| 1 | #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. sh |
| 2 | # |
| 3 | # SPDX-License-Identifier: GPL-2.0-only |
| 4 | |
| 5 | mainscip-shell shell coreboot 25.09+dfsg-1 main().() { |
| 6 | if [scip-shell system . . `[`. "$#" != 1 ]; then |
| 7 | echoscip-shell system . . echo. "Usage: $0 MAINBOARD_PARTNUMBER" >&2 |
| 8 | exit 1 |
| 9 | fi |
| 10 | |
| 11 | # Generate a test-only ChromeOS HWID v2 string |
| 12 | local board="$1" |
| 13 | local prefix="$(echoscip-shell system . . echo. "${board}" | trscip-shell system . . tr. a-z A-Z) TEST" |
| 14 | # gzip has second-to-last 4 bytes in CRC32. |
| 15 | local crc32="$(printfscip-shell system . . printf. "${prefix}" | gzipscip-shell system . . gzip. -1 | tailscip-shell system . . tail. -c 8 | headscip-shell system . . head. -c 4 | \ |
| 16 | od -An -vtu4 | tr -d '\n' | tail -c 4)" |
| 17 | |
| 18 | echoscip-shell system . . echo. "${prefix}" "${crc32}" |
| 19 | } |
| 20 | mainscip-shell shell coreboot 25.09+dfsg-1 main(). "$@" |