Commit Graph

56 Commits

Author SHA1 Message Date
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
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
dfb30d930a trivial: Fix a typo when matching device VID:PIDs
Found using Coverity.
2016-11-09 19:35:23 +00:00
Richard Hughes
bd81a89044 libdfu: Correctly erase DfuSe devices 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
8a3c18b4a3 libdfu: Use an animated progress bar when performing DFU operations 2016-10-14 18:07:34 +01:00
Richard Hughes
ac614987e6 Show the nicely formatted target name for DfuSe devices 2016-10-12 15:05:41 +01:00
Richard Hughes
053ade98e8 trivial: Only show the cipher kind if set 2016-10-12 15:05:23 +01:00
Richard Hughes
2fd030e663 trivial: Print the transfer size in the 'dfu-tool list' output 2016-10-12 15:05:03 +01:00
Richard Hughes
c6a8deeb4c dfu: Fix listing devices using the ST reference bootloader 2016-10-12 15:04:31 +01:00
Richard Hughes
877df1dda3 libfdfu: Show a warning when getting the alt-name failed 2016-10-12 13:15:03 +01:00
Richard Hughes
f82a4c2231 Allow specifying the argument to 'dfu-tool set-release' in major.minor format. 2016-09-01 14:50:02 +01:00
Richard Hughes
7920826098 trivial: Remove the version from the DFU firmware format enum
This isn't accurate, as it's used for all versions of DFU.
2016-08-26 18:44:00 +01:00
Richard Hughes
b8d2de2110 Normalize the DfuFirmwareFormat enums
Using the DFU-specification value is upsetting various tools that expect the
enum to be in order.
2016-08-26 18:44:00 +01:00
Richard Hughes
3667ee7b22 libdfu: Add initial ELF reading and writing support 2016-08-26 18:44:00 +01:00
Richard Hughes
de327ffefd trivial: Print the serial number in the dfu-tool list output 2016-08-24 10:06:48 +01:00
Richard Hughes
c0804c5bfb trivial: Print the device name in the dfu-tool list output 2016-08-24 10:05:01 +01:00
Richard Hughes
3ae417b960 Add a set-address command to dfu-util
This allows us to set the start address of DfuSe elements.
2016-08-23 09:55:39 +01:00
Richard Hughes
e02eaf27ab trivial: Allow setting a firmware release of '0' 2016-08-23 09:54:37 +01:00
Richard Hughes
5e4cc87d6c Support the 'DEVO' cipher kind in libdfu
This is not really a cipher, more just obfuscation and is specific to the
Walkera Devo line of RC controllers. Many thanks to Mike Meyer for the help.
2016-08-23 09:28:10 +01:00
Richard Hughes
abe1de75ec trivial: Split out the XTEA cipher to a new file 2016-08-23 08:59:02 +01:00
Richard Hughes
f854e6eb80 Add a set-target-size command to dfu-tool
This allows us to specify the padding byte value and makes the convert command
easier to understand.
2016-08-23 08:35:55 +01:00
Richard Hughes
33a518a615 Add another compile warning and fix up any build failures 2016-07-27 16:57:36 +01:00
Richard Hughes
ce38d94d5e trivial: Get rid of useless internal-only gtk-doc markup 2016-06-29 11:25:25 +01:00
Richard Hughes
16261e3f76 libdfu: Show the DFU protocol version in 'dfu-tool list' 2016-06-08 15:14:06 +01:00
Richard Hughes
11dc9ace51 trivial: Fix up some warnings spotted by new GCC 2016-06-07 10:11:00 +01:00
Richard Hughes
280745f5f0 Release fwupd 0.6.0 2015-12-07 16:20:59 +00:00
Richard Hughes
7774f815a7 trivial: Fix clang-spotted hard-to-hit crash in dfu-tool 2015-12-06 16:36:58 +00:00
Richard Hughes
032596e800 libdfu: Fix several reported crashes in the inhex32 import code
This also adds the ability to write simple Intel HEX files too.
2015-12-06 16:27:16 +00:00
Richard Hughes
564303d877 libdfu: Only enumerate the DfuContext when required
This speeds up afl fuzzing significantly.
2015-12-06 16:27:03 +00:00
Richard Hughes
7c37e55459 libdfu: Add support for the draft 'DFU Metadata Table Specification' 2015-12-04 16:01:40 +00:00
Richard Hughes
4545dd70af libdfu: Add DfuCipher which is a property on a target and a firmware file
At the moment we're not doing anything smart other than looking at the
firmware filename, but in the future we might do something better.
2015-12-04 12:58:05 +00:00
Richard Hughes
045198d643 libdfu: Add commands to encrypt and decrypt firmware images
This uses XTEA to encrypt and decrypt images in the firmware file, although
I'm open for adding other methods as required.
2015-12-02 15:48:03 +00:00
Richard Hughes
1936e4afb5 libdfu: Display all the files shown with 'dfu-tool dump'
Also, show the file CRC in the debug output.
2015-12-01 14:53:04 +00:00
Richard Hughes
14d2b80503 libdfu: Make reading and writing to targets easier to understand
Rename the 'upload' command to read, and 'download' to write to make things
easier for end users. Also, break the last bits of compatibility with dfu-util.
2015-11-30 09:49:25 +00:00
Richard Hughes
9b1349b885 libdfu: Add an explicit 'attach' method
This can also deal with the m-stack quirk in a central place.
2015-11-27 10:54:26 +00:00
Richard Hughes
385bba0ada libdfu: Add a quirk to support DFU runtime-less devices 2015-11-26 18:59:59 +00:00
Richard Hughes
60b7eeeca9 libdfu: Handle cancellation with ctrl+c in dfu-tool 2015-11-26 12:36:53 +00:00
Richard Hughes
d3afaaab9f libdfu: Add a context object to handle device hotplug
Also, add a 'watch' command to dfu-tool to test this.
2015-11-23 13:53:06 +00:00
Richard Hughes
5d6066c002 libdfu: Use signals to propagate device state
Also, add padding to the various class structs so we can add more signals in
the future without breaking ABI.
2015-11-23 10:19:24 +00:00
Richard Hughes
e7aaf39de2 libdfu: Fix multi-interface devices like the Neo Freerunner
The DFU specification specifies that only one of the DFU interfaces has to
export a functional descriptor; I assumed they all had to. Adding support
for this kind of device rapidly turned into a massive restructure and it was
all too complicated anyway.

Reorganise the code so that we can support these kinds of devices and clean up
the API so it's sane and easy to use. This also allows us to generate the
GObject introspection GIR and to also install libdfu as a shared library.

If you've got any comments about the API, please shout now as when 6.0 is
released it will become API and ABI stable.
2015-11-22 21:17:48 +00:00
Richard Hughes
e7ba943cf5 libdfu: Support download and upload to ST DfuSe devices
Also, simplify the general download and upload API now we can deal with
element data in chunks.
2015-11-20 14:14:05 +00:00
Richard Hughes
0256f04338 libdfu: Improve the output of 'dfu-util list'
Being semi-compatible with dfu-util isn't important anymore.
2015-11-20 12:30:53 +00:00
Richard Hughes
3391e6b154 libdfu: Use the progress bar for all uploads and downloads 2015-11-19 17:44:29 +00:00
Richard Hughes
664bb739b0 libdfu: Require a --force flag to flash wildcard firmware 2015-11-17 08:59:24 +00:00
Richard Hughes
f048fbc703 libdfu: Call the progress callback when doing detach
This allows the UI to show something sane, and also allows fwupd to start any
timeout for ignoring detach:replug.
2015-11-16 16:28:10 +00:00
Richard Hughes
859fe0b43e libdfu: Check for extra args to dfu-tool convert 2015-11-16 11:48:20 +00:00
Richard Hughes
e8a6d3d0cb trivial: libdfu: flip reversed command descriptions 2015-11-16 11:47:16 +00:00
Richard Hughes
b5936f9eef libdfu: Correctly implement auto-boot in dfu_device_download() 2015-11-16 11:46:36 +00:00
Richard Hughes
b4eaec3654 libdfu: Allow choosing a different alt-setting when downloading 2015-11-15 19:12:13 +00:00