openocd/src/helper/bin2char.sh
Antonio Borneo 757895b8ee openocd: src: replace SPDX to remaining files
With most of the files already processed through scripts, replace
manually the license to the few remaining files.

Change-Id: I3c7131e66b89ddad482f1074b5be5a9a69fdf6fd
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7073
Tested-by: jenkins
2022-07-23 13:59:25 +00:00

16 lines
491 B
Bash
Executable File

#!/bin/sh
# SPDX-License-Identifier: GPL-2.0-or-later
[ $# != 0 ] && {
echo "Usage: $0"
echo
echo "Read binary data from standard input and write it as a comma separated"
echo "list of hexadecimal byte values to standard output. The output is usable"
echo "as a C array initializer. It is terminated with a comma so it can be"
echo "continued e.g. for zero termination."
exit 1
}
echo "/* Autogenerated with $0 */"
od -v -A n -t x1 | sed 's/ *\(..\) */0x\1,/g'