Patrick Georgi | 5ac6a63 | 2020-10-28 17:29:38 +0100 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | set -e |
| 3 | |
Nico Huber | 819ba50 | 2023-03-07 22:59:01 +0000 | [diff] [blame^] | 4 | TEMP_DIR=$(mktemp -d) |
| 5 | trap "rm -rf ${TEMP_DIR}" EXIT |
| 6 | |
Nico Huber | b84f55b | 2023-03-07 22:55:51 +0000 | [diff] [blame] | 7 | ${MAKECMD:-make} clean |
| 8 | ${MAKECMD:-make} -j${CPUS:-$(nproc)} CC="${CC:-ccache cc}" CONFIG_EVERYTHING=yes |
Nico Huber | 819ba50 | 2023-03-07 22:59:01 +0000 | [diff] [blame^] | 9 | FLASHROM=./flashrom |
| 10 | |
| 11 | dd bs=128K count=1 </dev/urandom >${TEMP_DIR}/rand |
| 12 | ${FLASHROM} -p dummy:emulate=M25P10.RES,image=${TEMP_DIR}/image -w ${TEMP_DIR}/rand |
| 13 | ${FLASHROM} -p dummy:emulate=M25P10.RES,image=${TEMP_DIR}/image -r ${TEMP_DIR}/bak |
| 14 | cmp ${TEMP_DIR}/rand ${TEMP_DIR}/bak |
| 15 | |
| 16 | dd bs=128K count=1 </dev/urandom >${TEMP_DIR}/rand |
| 17 | ${FLASHROM} -p dummy:emulate=M25P10.RES,image=${TEMP_DIR}/image -c M25P10 -w ${TEMP_DIR}/rand |
| 18 | ${FLASHROM} -p dummy:emulate=M25P10.RES,image=${TEMP_DIR}/image -c M25P10 -v ${TEMP_DIR}/rand |