]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - debian/scripts/misc/fw-to-ihex.sh
UBUNTU: [Packaging] resync git-ubuntu-log
[mirror_ubuntu-bionic-kernel.git] / debian / scripts / misc / fw-to-ihex.sh
1 #!/bin/bash
2
3 F=$1
4 if [ "$F" = "" ]
5 then
6 echo You must supply a firmware file.
7 exit 1
8 fi
9
10 echo "unsigned char d[] = {" > $F.c
11 hexdump -v -e '"\t" 8/1 "0x%02x, " "\n"' $F >> $F.c
12 echo "};" >> $F.c
13 sed -i 's/0x .*$//' $F.c
14
15 O="`dirname $F`/`basename $F`.o"
16 gcc -o $O -c $F.c
17 objcopy -Oihex $F.o $F.ihex
18