3 ## This file is part of the sigrok-util project.
5 ## Copyright (C) 2014 Daniel Elstner <daniel.kitta@gmail.com>
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.
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.
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/>.
22 if [ -z "$infile" ]; then
23 echo "Usage: $0 SETUP-EXE" >&2
27 # Verify the checksum to make sure this is the right binary file
28 expectsum=f2a9333329200ad1d939d051257f914200cf0c765ff4962b2907dcf30716f455
29 set '' $(sha256sum -b "$infile")
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
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