]> sigrok.org Git - sigrok-util.git/blob - firmware/sysclk-lwla/sigrok-fwextract-sysclk-lwla1034
sysclk-lwla: Rename LWLA1034 firmware script
[sigrok-util.git] / firmware / sysclk-lwla / sigrok-fwextract-sysclk-lwla1034
1 #! /bin/sh -e
2 ##
3 ## This file is part of the sigrok-util project.
4 ##
5 ## Copyright (C) 2014 Daniel Elstner <daniel.kitta@gmail.com>
6 ##
7 ## This program is free software; you can redistribute it and/or modify
8 ## it under the terms of the GNU General Public License as published by
9 ## the Free Software Foundation; either version 3 of the License, or
10 ## (at your option) any later version.
11 ##
12 ## This program is distributed in the hope that it will be useful,
13 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 ## GNU General Public License for more details.
16 ##
17 ## You should have received a copy of the GNU General Public License
18 ## along with this program; if not, see <http://www.gnu.org/licenses/>.
19 ##
20
21 infile=$1
22 if [ -z "$infile" ]; then
23     echo "Usage: $0 SETUP-EXE" >&2
24     exit 1
25 fi
26
27 # Verify the checksum to make sure this is the right binary file
28 expectsum=f2a9333329200ad1d939d051257f914200cf0c765ff4962b2907dcf30716f455
29 set '' $(sha256sum -b "$infile")
30
31 if [ "$2" != "$expectsum" ]; then
32     echo "$0: checksum mismatch for '$infile'" >&2
33     echo "$0: make sure you picked the right file (lwla1034_EN_setup.exe on the CD-ROM)" >&2
34     exit 1
35 fi
36
37 # Extract the firmware binaries from the executable
38 dd bs=1 skip=34110338 count=78398 if="$infile" of=sysclk-lwla1034-int.bitstream
39 dd bs=1 skip=34266237 count=78247 if="$infile" of=sysclk-lwla1034-extpos.bitstream
40 dd bs=1 skip=34344484 count=79145 if="$infile" of=sysclk-lwla1034-extneg.bitstream
41 dd bs=1 skip=34578631 count=48525 if="$infile" of=sysclk-lwla1034-off.bitstream