Created
October 4, 2021 12:07
-
-
Save netom/748434e04970d10ebf2b0c983a45e47f to your computer and use it in GitHub Desktop.
Search through `dmesg` output, look for BERT related messages and try to save the BERT content as both .hex and binary files.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
NOW=$(date +%s) | |
HEXFNAME=bert-data-${NOW}.hex | |
BINFNAME=bert-data-${NOW}.bin | |
{ dmesg \ | |
| grep '\[Hardware Error]: \+[0-9]' \ | |
| sed -r '/.*/ {s/^.*\[Hardware Error]: +[0-9a-FA-F]{4}([0-9a-FA-F]{4}): (([0-9a-FA-F]{8} ){4}).*$/:10 \1 00 \2 00/;s/ //g}' \ | |
; echo ':00000001FF'; \ | |
} | srec_cat - -intel -IGnore_Checksums -o - -intel > $HEXFNAME | |
objcopy --input-target=ihex --output-target=binary $HEXFNAME $BINFNAME |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment