summaryrefslogtreecommitdiffstats
path: root/generate_dt_header.sh
blob: 80eef17b8a596e52f7ac9e905ed9039974087139 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh

if [ $# -ne 1 ] ; then
	echo "Usage: $0 <file.dtb>"
	exit 1
fi

SYMBOL=$(echo "$1" | tr '.-' '_')
SYM_START="_binary_${SYMBOL}_o_start"
SYM_END="_biary_${SYMBOL}_o_end"
SYM_SIZE="_biary_${SYMBOL}_o_size"
HEADER="$f.h"

cat - <<EOF
/* This file is auto-generated from generate_dt_header.sh */
#ifndef __${SYMBOL}_H__
#define __${SYMBOL}_H__

unsigned char ${SYM_START};
unsigned char ${SYM_END};
long ${SYM_SIZE};

#endif /* __${SYMBOL}_H__ */
EOF
OpenPOWER on IntegriCloud