Richard Hughes
cef8042edc
libdfu: Add DfuPatch
...
This allows us to binary patch firmware images.
The diff generation is implemented with a forwards-only algorithm; this allows
a vendor to remove non-free code without shipping a "reversed" version of the
non-redistributable code.
2017-07-31 11:58:21 +01:00
Patrick Ohly
eb03b0f33d
meson: introspection optional
...
Calling g-ir-scanner when cross-compiling with bitbake/OpenEmbedded
fails because it calls the wrong ld (the one from the host). More work
will be needed in meson.bbclass and/or gobject-introspection.bbclass
to make it work.
In the meantime, having an option to turn of introspection is useful
perhaps also in other cases where the extra work is not needed. For
example, fwupd works fine also when it is off.
The name of the new meson option matches the --disable-introspection
that is used by some autotools-based projects.
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
2017-07-26 13:29:21 +01:00
Richard Hughes
3cca1c65c2
trivial: Remove or downgrade some superfluous warnings
...
Fixes bugs like https://github.com/hughsie/fwupd/issues/159
2017-07-21 13:38:27 +01:00
Richard Hughes
c3c50fba4c
libdfu: Fix a crash if elf32_newehdr() fails
2017-07-21 13:07:00 +01:00
Richard Hughes
e0d84c536f
libdfu: Do not check the runtime release if device is in bootloader mode
2017-06-21 15:32:08 +01:00
Richard Hughes
b53ad36012
trivial: Fix up a number of FALSE/NULL return issues
2017-06-19 13:50:42 +01:00
Richard Hughes
d80666281c
trivial: Do not run any tests if configuring with -Denable-tests=false
2017-06-08 08:43:21 +01:00
Richard Hughes
1315b25928
trivial: Only do the memcpy of DfuImage when round-tripping DfuSe firmware
2017-06-07 15:34:53 +01:00
Richard Hughes
b9f89179f2
trivial: Fix a small leak in dfu_target_parse_sectors()
...
This only happens when it's called multiple times.
2017-06-07 15:34:53 +01:00
Timo Gurr
555c634a92
Allow to specify bindir
2017-05-29 16:54:30 +01:00
Richard Hughes
dc3856b51d
trivial: Fix a tiny memory leak when writing DfuSe images
...
Found using Coverity, many thanks.
2017-05-08 20:32:15 +01:00
Richard Hughes
183c56e712
Support signed Intel HEX files
...
The record type 0xfd is nonstandard but used in at least one product to avoid
having an additional signing key file.
2017-04-20 15:36:56 +01:00
Richard Hughes
3f3cb69bb7
trivial: Generate the pkg-config files using meson
2017-04-20 08:07:38 +01:00
Richard Hughes
1fdb335025
Remove the automake build system
2017-04-13 18:42:08 +01:00
Richard Hughes
57746cb839
Add the Meson build system as an alternate to autotools
...
Automake and autoconf are impossible to fully understand and Meson now provides
everything we need for a much smaller, faster, and more understandable build.
See http://mesonbuild.com/ for more information.
2017-04-12 16:35:18 +01:00
Richard Hughes
f63091e413
Add DFU quirk for OpenPICC
2017-03-11 20:47:32 +00:00
Richard Hughes
5eb8e29fa2
Add DFU quirk for SIMtrace
2017-03-11 20:47:22 +00:00
Mario Limonciello
ca9dadcc52
trivial: move gelf.h include to HAVE_LIBELF ( #87 )
2017-02-14 11:09:46 -06:00
Kai Krakow
1c7ea9ee2d
Fix compiler warnings
...
My compiler doesn't understand -Wno-discard-qualifiers so drop it and
fix the warnings instead. I think it is better to explicitly fix them
anyways instead of just to ignore the discarded const qualifier in
general.
I think the option should be avoided in hand-written code. The warning
is there for a reason: To protect you from possibly overwriting data you
expect to not be modified when passing pointers around.
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41215
2017-02-13 10:02:25 +00:00
Richard Hughes
fcca6f67b2
Include all debug messages when run with --verbose
2017-01-11 16:50:17 +00:00
Richard Hughes
c7ea2a2369
trivial: Fix up two compile warnings
2017-01-07 22:10:14 +00:00
Richard Hughes
66a24da646
trivial: Actually allow compiling with libelf
2017-01-07 22:07:13 +00:00
Richard Hughes
ba79b07b4f
libdfu: Don't read data from some DfuSe targets
...
The option bytes section makes no sense to include in the flashed image.
2017-01-07 21:13:51 +00:00
Richard Hughes
6d9d985f1b
trivial: Fix a gtk-doc header issue
2016-12-13 16:02:50 +00:00
Richard Hughes
d8e8134bdf
trivial: Move the libdfu test files to under libdfu
2016-12-12 11:17:11 +00:00
Richard Hughes
bc93e4ab6e
Make all providers and plugins share a GUsbContext
...
This means we don't have more that one thread just watching for the USB
hotplug events. To achieve this split up the coldplug into setup and coldplug
phases and run the enumerate just once in the daemon.
2016-12-08 19:51:55 +00:00
Richard Hughes
1deda31cae
Make libelf support optional
2016-11-22 15:39:57 +00:00
Richard Hughes
0e77c525dd
trivial: Fix the last commit to actually compile
2016-11-22 08:30:30 +00:00
Tsunghan Liu (Robert Liu)
a02bbb1c4e
* close USB devices before error returns ( #73 )
2016-11-21 09:12:28 -06:00
Richard Hughes
c8c2d60d65
trivial: Fix error check when parsing Neo Freerunner descriptor
...
Found using Coverity.
2016-11-09 20:14:15 +00:00
Richard Hughes
dfb30d930a
trivial: Fix a typo when matching device VID:PIDs
...
Found using Coverity.
2016-11-09 19:35:23 +00:00
Richard Hughes
b28daac301
libdfu: Use a heuristic for the start address if the firmware has no DfuSe footer
...
This fixes flashing into the 96Boards BLE Carbon.
2016-11-03 15:11:25 +00:00
Richard Hughes
ae7935448b
libdfu: Correctly set the element address when uploading from DfuSe devices
2016-10-16 08:26:01 +01:00
Richard Hughes
6c17d2ed43
trivial: Fix an error path when the interface cannot be claimed
2016-10-16 08:26:01 +01:00
Mario Limonciello
a91214f545
Enable hardening flags on more binaries
2016-10-14 12:43:02 -05:00
Richard Hughes
bd81a89044
libdfu: Correctly erase DfuSe devices
2016-10-14 18:07:34 +01:00
Richard Hughes
21806b4696
libdfu: Wait for DNBUSY to be cleared when checking the DfuSe status
2016-10-14 18:07:34 +01:00
Richard Hughes
9e172a0b1f
trivial: Raise the default timeout for DFU operations
...
Not all devices are fast, and the ST bootloader takes a long time to return
from erase.
2016-10-14 18:07:34 +01:00
Richard Hughes
503f057d3e
libdfu: Add dfu_sector_get_zone() to get the continuous memory zone number
2016-10-14 18:07:34 +01:00
Richard Hughes
8e480bff54
trivial: Show the caps as letters when listing sectors as a string
2016-10-14 18:07:34 +01:00
Richard Hughes
79d2b93771
Add a 'replace-data' command to dfu-tool
...
This allows us to search-and-replace data in a firmware file that may be
protected with a checksum or CRC.
2016-10-14 18:07:34 +01:00
Richard Hughes
0e7877b831
trivial: Fix self tests after fixing sector addresses
2016-10-14 18:07:34 +01:00
Richard Hughes
35bea355b2
libdfu: Match the device booloader or runtime VID and PID when checking firmware
2016-10-14 18:07:34 +01:00
Richard Hughes
91685ce43b
libdfu: Add quirks for HydraBus as it does not have a DFU runtime
2016-10-14 18:07:34 +01:00
Richard Hughes
8e2e46e60b
libdfu: Re-get the quirks when the DfuDevice gets a new GUsbDevice
2016-10-14 18:07:34 +01:00
Richard Hughes
1ff658dbb2
libdfu: Ensure the mode is set correctly when faking a runtime
2016-10-14 18:07:34 +01:00
Richard Hughes
bacf255428
libdfu: Ensure the device is open before claiming the interface
2016-10-14 18:07:34 +01:00
Richard Hughes
a5c48ce07f
libdfu: Fix verification of written DfuSe firmware
...
DfuSe doesn't stop returning data when the image is empty. Take as least as
much data as we require and then truncate the result to what we want.
2016-10-14 18:07:34 +01:00
Richard Hughes
73b63c87e8
libdfu: Do not do a zero-byte download when in DfuSe mode
...
For ST devices this means 'boot into APP mode' which we can also now populate.
2016-10-14 18:07:34 +01:00
Richard Hughes
8a3c18b4a3
libdfu: Use an animated progress bar when performing DFU operations
2016-10-14 18:07:34 +01:00